@re-ai/hd-api
Advanced tools
Comparing version 0.0.4 to 0.0.5
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.API_PATHS = void 0; | ||
var API_PATHS; | ||
(function (API_PATHS) { | ||
})(API_PATHS || (exports.API_PATHS = API_PATHS = {})); |
export * from './types/TOptions'; | ||
export * from './types/TDevice'; | ||
export * from './types/THDMessage'; | ||
export * from './types/TTranslation'; | ||
export { DeviceAPIService as ReAIDeviceAPI } from './services/deviceService'; | ||
export { HDMessage as ReAIDeviceMessage } from './services/HDMessage'; |
@@ -21,2 +21,3 @@ "use strict"; | ||
__exportStar(require("./types/THDMessage"), exports); | ||
__exportStar(require("./types/TTranslation"), exports); | ||
var deviceService_1 = require("./services/deviceService"); | ||
@@ -23,0 +24,0 @@ Object.defineProperty(exports, "ReAIDeviceAPI", { enumerable: true, get: function () { return deviceService_1.DeviceAPIService; } }); |
@@ -11,3 +11,3 @@ import { HDAuthQRCode, HDDevice, HDDeviceCreateReq, HDDeviceUpdateReq } from "../types/TDevice"; | ||
*/ | ||
lists(uid?: string): Promise<APIResponse<HDDevice[]>>; | ||
lists(): Promise<APIResponse<HDDevice[]>>; | ||
/** | ||
@@ -17,3 +17,3 @@ * 单独设备的信息 | ||
*/ | ||
get(hdId: string, uid?: string): Promise<APIResponse<HDDevice>>; | ||
get(hdId: string): Promise<APIResponse<HDDevice>>; | ||
/** | ||
@@ -20,0 +20,0 @@ * 创建设备 |
@@ -11,5 +11,5 @@ import { HDWSMessageRecieveKeys, HDWSMessageRecieveResultData } from "../types/THDMessage"; | ||
* } | ||
* @returns 返回值是false的时候,代表为处理消息 | ||
* @returns 返回值是false的时候,代表没有处理消息 | ||
*/ | ||
handle(message: string, onResult: (msgId: string, key: HDWSMessageRecieveKeys, data: HDWSMessageRecieveResultData) => Promise<any>): Promise<boolean | any>; | ||
} |
@@ -20,3 +20,3 @@ "use strict"; | ||
name: name, | ||
data: data | ||
arguments: data ? "" : JSON.stringify(data) | ||
} | ||
@@ -23,0 +23,0 @@ }); |
@@ -18,4 +18,9 @@ export type HDDevice = { | ||
export type HDAuthQRCode = { | ||
data: HDAuthQRCodeData; | ||
raw: string; | ||
url: string; | ||
}; | ||
export type HDAuthQRCodeData = { | ||
type: string; | ||
requestId: string; | ||
}; |
@@ -40,3 +40,3 @@ export declare enum HDInfoTypes { | ||
message: "success" | "fail"; | ||
} | HDWifiInfo | HDWifiInfo[] | HDBluetoothInfo | HDBluetoothInfo[] | HDGPSInfo | HDSensorInfo; | ||
} | HDWifiInfo[] | HDBluetoothInfo[] | HDGPSInfo | HDSensorInfo; | ||
export type HDWifiInfo = { | ||
@@ -43,0 +43,0 @@ ssid: string; |
@@ -32,5 +32,5 @@ | ||
{ | ||
"hdId": "字符串", | ||
"aiConversationId": "字符串(可选)", | ||
"uid": "字符串(可选)", | ||
"hdId": "硬件设备id", | ||
"aiConversationId": "对话id(可选)", | ||
"uid": "用户id(可选)", | ||
"state": "HDdeviceState(可选)", | ||
@@ -54,3 +54,3 @@ "createdAt": "字符串", | ||
{ | ||
"hdId": "字符串" | ||
"hdId": "硬件设备id" | ||
} | ||
@@ -64,4 +64,4 @@ ``` | ||
{ | ||
"hdId": "字符串", | ||
"aiConversationId": "字符串" | ||
"hdId": "硬件设备id", | ||
"aiConversationId": "ai对话id" | ||
} | ||
@@ -75,4 +75,8 @@ ``` | ||
{ | ||
"type": "字符串", | ||
"requestId": "字符串" | ||
"url": "二维码地址", | ||
"raw" : "二二维码数据", | ||
"data" : { | ||
"type": "login", | ||
"requestId": "登录请求id" | ||
} | ||
} | ||
@@ -83,3 +87,3 @@ ``` | ||
### `lists(uid?: string): Promise<APIResponse<HDDevice[]>>` | ||
### `lists(): Promise<APIResponse<HDDevice[]>>` | ||
获取用户的设备列表。 | ||
@@ -90,3 +94,3 @@ | ||
{ | ||
"uid": "字符串(可选)" | ||
} | ||
@@ -107,3 +111,3 @@ ``` | ||
### `get(hdId: string, uid?: string): Promise<APIResponse<HDDevice>>` | ||
### `get(hdId: string): Promise<APIResponse<HDDevice>>` | ||
获取指定设备的信息。 | ||
@@ -114,4 +118,3 @@ | ||
{ | ||
"hdId": "字符串", | ||
"uid": "字符串(可选)" | ||
"hdId": "硬件id" | ||
} | ||
@@ -136,3 +139,3 @@ ``` | ||
{ | ||
"hdId": "字符串" | ||
"hdId": "硬件id" | ||
} | ||
@@ -157,4 +160,4 @@ ``` | ||
{ | ||
"hdId": "字符串", | ||
"aiConversationId": "字符串" | ||
"hdId": "硬件id", | ||
"aiConversationId": "ai对话id" | ||
} | ||
@@ -161,0 +164,0 @@ ``` |
{ | ||
"name": "@re-ai/hd-api", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "ReAI 硬件接口api", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
export * from './types/TOptions' | ||
export * from './types/TDevice' | ||
export * from './types/THDMessage' | ||
export * from './types/TTranslation' | ||
export { DeviceAPIService as ReAIDeviceAPI } from './services/deviceService' | ||
export { HDMessage as ReAIDeviceMessage } from './services/HDMessage' |
@@ -13,3 +13,3 @@ import { HDAuthQRCode, HDDevice, HDDeviceCreateReq, HDDeviceUpdateReq } from "../types/TDevice"; | ||
*/ | ||
lists(uid?: string) : Promise<APIResponse<HDDevice[]>>; | ||
lists() : Promise<APIResponse<HDDevice[]>>; | ||
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
get(hdId : string, uid?: string) : Promise<APIResponse<HDDevice>>; | ||
get(hdId : string) : Promise<APIResponse<HDDevice>>; | ||
@@ -23,0 +23,0 @@ /** |
@@ -13,3 +13,3 @@ import { HDWSMessageRecieveKeys, HDWSMessageRecieveResultData } from "../types/THDMessage"; | ||
* } | ||
* @returns 返回值是false的时候,代表为处理消息 | ||
* @returns 返回值是false的时候,代表没有处理消息 | ||
*/ | ||
@@ -16,0 +16,0 @@ handle( |
@@ -7,2 +7,3 @@ import { OptionsService } from "../types/TOptions"; | ||
client: APIClient | ||
constructor(options?: OptionsService) { | ||
@@ -9,0 +10,0 @@ this.client = new APIClient({ |
@@ -22,3 +22,3 @@ import { IWSMessageHDHandler } from "../interfaces/IWSMessageHDHandler"; | ||
name: name, | ||
data: data | ||
arguments: data ? "" : JSON.stringify(data) | ||
} | ||
@@ -25,0 +25,0 @@ }) |
@@ -23,4 +23,10 @@ export type HDDevice = { | ||
export type HDAuthQRCode = { | ||
data: HDAuthQRCodeData, | ||
raw: string, | ||
url: string | ||
} | ||
export type HDAuthQRCodeData = { | ||
type: string, | ||
requestId: string | ||
} |
@@ -45,3 +45,3 @@ export enum HDInfoTypes { | ||
message: "success" | "fail" | ||
} | HDWifiInfo | HDWifiInfo[] | HDBluetoothInfo | HDBluetoothInfo[] | HDGPSInfo | HDSensorInfo | ||
} | HDWifiInfo[] | HDBluetoothInfo[] | HDGPSInfo | HDSensorInfo | ||
@@ -48,0 +48,0 @@ export type HDWifiInfo = { |
41800
1046