| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519 |
- declare namespace IOT {
- // MQTT
- namespace API {
- namespace MODEL {
- type QueryPamars = {
- modelLabel?: string // 模型名称
- transportType: TransportEnum
- } & Partial<COMMON.QueryParams>
- interface Model {
- id?: string
- modelTemplateId?: string
- modelLabel: string,
- transportType: string,
- payloadType: string,
- deviceType: string,
- modelDescription: string,
- rts: boolean // 用来标志是否具备视频流能力
- }
- 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 {
- id?: string
- 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,
- cmdCode: 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,
- canRemove: boolean // 用来标志是否可以被删除,具备该值且者该值为true的情况下 命令是不能有删除按钮
- }
- }
- 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
- authType: 'SECRET' | 'X509CERT'
- deviceAddr: 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,
- 'cmdCode': string,
- 'cmdLabel': string,
- 'cmdPayload': any // '{"method":null,"params":null}',
- 'deviceId': string
- }
- interface Group {
- 'groupLabel': string, // 分组名字
- 'upperGroupId': string, // 上级分组id
- 'id': 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,
- offlineNum: number
- onlineNum: number
- sessionEntities: {
- '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
- }
- interface Ota {
- 'deviceId': string,
- 'otaTime': number, // 设备当前ota 升级名称,如果是0 说明从未升级过,有值的情况是 毫秒数字
- 'msgId': any,
- 'status': any, // QUEUED,SENT,DELIVERED,SUCCESSFUL,TIMEOUT,FAILED
- 'otaPkgId': string, // ota包id
- 'otaPkgLabel': string, // 设备当前ota 名称,如果是-- 说明从未升级过
- 'otaPkgVersion': string // 设备当前ota 版本,如果是-- 说明从未升级过
- }
- interface OtaQueryParams {
- page: number
- pageSize: number
- deviceId: string
- otaLabel: string
- otaVersion: string
- otaStatus: 'QUEUED' | 'SENT' | 'DELIVERED' | 'SUCCESSFUL' | 'TIMEOUT' | 'FAILED' | ''
- }
- }
- 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<string, any>
- 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,
- mqttServerUrl: string // 'MQTT 服务地址'
- coapServerUrl: string // 'COAP 服务地址'
- httpServerUrl: string // 'HTTP 服务地址'
- '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<string, string>
- }
- }
- }
- namespace OTA {
- interface QueryParams {
- page: number
- pageSize: number
- label: string
- version: string
- pkgType: 'FILE_URL' | 'FILE_ZIP' | ''
- }
- interface BodyParams {
- label: string
- version: string
- pkgUrl: string
- pkgType: 'FILE_URL' | 'FILE_ZIP',
- }
- interface Detail {
- 'id'?: string,
- 'createAt': number,
- 'updateAt': null,
- 'version': string,
- 'pkgType': 'FILE_URL' | 'FILE_ZIP',
- 'pkgUrl': string,
- 'label': string,
- }
- }
- namespace THIRDDEVICE {
- interface QueryParams {
- 'deviceCode'?: string, // 设备编码 唯一标志 必须填写
- 'deviceLabel'?: string, // 设备名称 必须填写
- 'deviceType'?: string, // 设备类型
- 'deviceDesc'?: string, // 设备描述
- 'deviceAddr'?: string, // 设备地址
- }
- interface Detail {
- 'deviceCode': string, // 设备编码 唯一标志
- 'deviceLabel': string, // 设备名称
- 'deviceType': string, // 设备类型
- 'deviceStatus': string, // 设备状态
- 'deviceStatusDesc': string, // 设备状态描述
- 'deviceDesc': string, // 设备描述
- 'deviceAddr': string, // 设备地址
- 'deviceData': string, // 设备数据,json 或者字符串,可以点击放大查看 或者其他展示方式
- }
- }
- }
- }
|