declare namespace IOT { // MQTT namespace API { namespace MODEL { type QueryPamars = { modelLabel?: string // 模型名称 transportType: TransportEnum } & Partial interface Model { id: string modelLabel: string, transportType: string, payloadType: string, deviceType: string, modelDescription: string, } interface ModelDot extends Model { id: string, createAt: string, updateAt: string, deleted: boolean, tenantId: string } interface plugin { id: string 'modelId': string, 'modelPluginType': 'JS', 'modelPluginBody': string } } namespace MODELATTR { interface ModelAttr { attributeKey: string attributeLabel: string dataType: string dataUnit: string scope: string expr: string } } namespace MODELTEMPLATE { interface modelTemplate { id: string templateLabel: string templateAttribute: { id: string attributeKey: string attributeLabel: string dataType: string dataUnit: string scope: string expr: string modelId: string key: string }[] templatePlugin: any templateCmd: any } } namespace CMD { interface Cmd { id: string, 'cmdLabel': string, 'cmdParams': { id: string 'paramLabel': string, 'dataType': string, 'required': boolean, 'dataUnit': string, 'minValue': any, 'maxValue': any, 'scope': string, 'description': string }[], 'cmdResponses': { 'paramLabel': string, 'dataType': string, 'required': boolean, 'dataUnit': string, 'minValue': any, 'maxValue': any, 'scope': string, 'description': string }[], 'modelId': string } } namespace DEVICE { type QueryPamars = { page: number pageSize: number deviceStatus?: DeviceTypeEnum modelId?: string searchKey?: string searchValue?: string } type BodyParams = { modelId: string deviceCode: string deviceLabel: string deviceAuthType: string deviceSecret: string confirmSecret: string } type SubBodyParams = { gatewayId: string, modelId: string deviceCode: string deviceLabel: string } interface Device { id: string deviceLabel: string deviceCode: string deviceDescription: string modelId: string modelLabel: string deviceStatus: string deviceNodeType: string lastConnectTs: string lastActivityTs: string } interface DeviceTag { deviceId: string, tagLabel: string tagValue: string } interface Count { 'TOTAL': string, 'DISABLED': string, 'INIT': string, 'CONNECT': string, 'DISCONNECT': string } interface Msg { 'id': string, 'deviceId': string, 'status': DeviceMsgEnum, // 消息状态 值有QUEUED 队列中,SENT 已发送,DELIVERED 设备收到 SUCCESSFUL 成功 TIMEOUT 超时 FAILED 失败 'msgPayload': string, 'msgLabel': string, 'topic': string, 'msgId': number } interface Cmd { id: string 'status': DeviceMsgEnum, 'msgId': number, 'cmdLabel': string, 'cmdPayload': any // '{"method":null,"params":null}', 'deviceId': string } interface Group { 'groupLabel': string, // 分组名字 'upperGroupId': string, // 上级分组id } interface GroupQueryParams { page: number, pageSize: number, modelId?: string, searchKey?: string, deviceGroupId: string, searchValue?: string, } interface Topology { gatewayDevice: { 'id': string, 'modelLabel': string, 'deviceCode': string, 'deviceLabel': string, 'deviceDescription': string, 'modelId': string, 'deviceStatus': string, 'deviceNodeType': string, 'lastConnectTs': string, 'lastActivityTs': string, 'gatewayId': string }[], model: { 'id': string, 'modelLabel': string, 'transportType': string, 'payloadType': string, 'deviceType': string, 'modelDescription': string, }[], subDevice: { 'id': string, 'modelLabel': string, 'deviceCode': string, 'deviceLabel': string, 'deviceDescription': string, 'modelId': string, 'deviceStatus': string, 'deviceNodeType': string, 'lastConnectTs': string, 'lastActivityTs': string, 'gatewayId': string }[] } interface Session { 'id': string, 'createAt': 1683171293012, 'updateAt': string, 'deviceId': string, 'sessionType': 'CONNECT' | 'DISCONNECT', 'connectTime': string, 'activityTime': string } interface Attr { hum?: { 'deviceId':string, 'ts': string, 'key': string, 'keyLabel': string, 'stringValue': any, 'doubleValue': any, 'longValue': number, 'booleanValue': null, 'jsonValue': null, 'dataUnit': string, 'scope': null, 'dataType': string }[] [key: string]: any } } namespace EVENT { interface Event { 'id': string, 'entityId': string, 'eventName': string, 'eventPayload': string, 'eventType': string, 'eventTs': bigint, 'success': boolean } interface QueryParams { deviceId: string lastId: string startTime: string, page: string success?: boolean pageSize: string eventType: EventTypeEnum endTime: string } } namespace RULE { interface ForwardRuleQueryParams { page: number, pageSize: number, ruleLabel?: string, id: string, subjectResource: SubjectResourceEnum, subjectEvent: SubjectEventEnum, status: boolean, } interface ForwardRuleBody { subjectResource: SubjectResourceEnum, subjectEvent: SubjectEventEnum, ruleLabel: string, ruleDescription?: string, forwardRuleTargets: Array } interface ForwardRule { 'id': null, 'ruleLabel': string, 'ruleDescription': string, 'subjectResource': SubjectResourceEnum, 'subjectEvent': SubjectEventEnum, 'entityId': null, 'forwardRuleTargets': null, 'status': false } interface LinkRuleBody { ruleLabel: string ruleDescription: string conditionLogic: string conditions: Array actions: Array } interface LinkRule { 'ruleLabel': string, 'ruleDescription': string, 'conditionLogic': string, 'conditions': Array actions: Array status: boolean } } namespace DATA { interface QueryParams { page: number, pageSize: number, deviceId: string modelId: string attributeKey: string, startTime: string, endTime } interface History { 'deviceId': string, 'ts': 1681181164001, 'key': string, 'keyLabel': string, 'stringValue': string, 'doubleValue': null, 'longValue': null, 'booleanValue': null, 'jsonValue': null, 'dataUnit': null, 'scope': null } interface OpenApi { id: string 'apiUrl': string, 'apiLabel': string, 'apiDescription':string, 'apiParameters': string, 'apiParametersDescription': string, 'apiResponse': string, 'apiResponseDescription': string } } namespace DEVOPS { type statsType = 'transportSuccessCounter' | 'transportFailCounter' | 'transportTotalCounter' | 'toTransportSuccessCounter' | 'toTransportFailCounter' | 'toTransportTotalCounter'| 'transportReqSuccessCounter'| 'transportReqFailCounter'| 'transportReqTotalCounter' interface Notice { entityId: string, id: string noticeDescription: string noticeEntityId: string noticeLabel: string } } namespace TASK { interface Task { 'taskLabel': string, 'taskConfig': { cmdParameters: Record taskType: 'DEVICE_CMD' |'DEVICE_MSG' |'DEVICE_DISCONNECT' }, // 任务配置 'status': number, // 任务状态 'taskDescription': string, 'cornDescr': string // corn 表达式 } interface Statistics { 'TOTAL': number, 'DISABLE': number, 'ENABLE': number } interface TrackTask { 'id': string, 'taskId': string, // 任务id 'ts': bigint, // 执行时间 'params': null, // 任务参数 'ret': null, // 任务结果 } } namespace SYS { interface Sys { 'id': string, 'sysLabel': string, 'sysIcon': string, // 系统图片,上传时候限制大小为3M 并且base64 编码 'sysTheme': string, 'mailConf': { 'host': string, 'port': number, 'protocol': string, 'username': string, 'password': string } } interface Notice { 'id': string, 'source': 0 | 1, // 通知数据来源 0 通知 1 告警 'label': string, // 通知方式名称 'notification': null, // 通知配置 'status': boolean, // 状态 true 是启用 false 是停用 notification: { methodType: 'EMAIL' | 'WEBHOOK', to: string cc: string[] hookUrl: string hookMethod: 'POST' | 'GET' customHeaders: Record } } } } }