@ray-js/api 1.5.18 → 1.5.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/@types/BizKit.d.ts
CHANGED
@@ -1,9 +1,308 @@
|
|
1
1
|
/**
|
2
2
|
* BizKit
|
3
3
|
*
|
4
|
-
* @version
|
4
|
+
* @version 4.5.1
|
5
5
|
*/
|
6
6
|
declare namespace ty {
|
7
|
+
/**
|
8
|
+
* 获取历史消息
|
9
|
+
*/
|
10
|
+
export function getAIAssistantHistory(params: {
|
11
|
+
/** 数量,不传递默认值30 */
|
12
|
+
size: number
|
13
|
+
/** primaryId */
|
14
|
+
primaryId: number
|
15
|
+
/** 消息标识 */
|
16
|
+
requestId: string
|
17
|
+
/** 类型, TEXT_FINISH SKILL_FINISH */
|
18
|
+
type: string
|
19
|
+
/** 渠道 可选参数,不传表示首页AI组手 */
|
20
|
+
channel: string
|
21
|
+
complete?: () => void
|
22
|
+
success?: (params: {
|
23
|
+
/** 列表数据 */
|
24
|
+
data: string
|
25
|
+
/** 渠道 */
|
26
|
+
channel: string
|
27
|
+
}) => void
|
28
|
+
fail?: (params: {
|
29
|
+
errorMsg: string
|
30
|
+
errorCode: string | number
|
31
|
+
innerError: {
|
32
|
+
errorCode: string | number
|
33
|
+
errorMsg: string
|
34
|
+
}
|
35
|
+
}) => void
|
36
|
+
}): void
|
37
|
+
|
38
|
+
/**
|
39
|
+
* 删除消息
|
40
|
+
*/
|
41
|
+
export function deleteAIAssistant(params: {
|
42
|
+
/** primaryId */
|
43
|
+
primaryId: number
|
44
|
+
complete?: () => void
|
45
|
+
success?: (params: null) => void
|
46
|
+
fail?: (params: {
|
47
|
+
errorMsg: string
|
48
|
+
errorCode: string | number
|
49
|
+
innerError: {
|
50
|
+
errorCode: string | number
|
51
|
+
errorMsg: string
|
52
|
+
}
|
53
|
+
}) => void
|
54
|
+
}): void
|
55
|
+
|
56
|
+
/**
|
57
|
+
* 发送消息
|
58
|
+
*/
|
59
|
+
export function sendAIAssistant(params: {
|
60
|
+
/** 消息 */
|
61
|
+
block: string
|
62
|
+
/** 可选参数 */
|
63
|
+
options: string
|
64
|
+
/** 类型 TEXT / SKILL,存在DB中的类型是TEXT_FINISH, SKILL_FINISH */
|
65
|
+
type: string
|
66
|
+
/** 可选字段,如果传递了,则会绑定到该消息上,如果没有传递,则会生成一个新的requestId */
|
67
|
+
requestId?: string
|
68
|
+
complete?: () => void
|
69
|
+
success?: (params: {
|
70
|
+
/** 单次对话消息标识 */
|
71
|
+
requestId: string
|
72
|
+
/** primaryId */
|
73
|
+
primaryId: number
|
74
|
+
/** 发送消息 200成功 -2001 发送失败 */
|
75
|
+
code: string
|
76
|
+
}) => void
|
77
|
+
fail?: (params: {
|
78
|
+
errorMsg: string
|
79
|
+
errorCode: string | number
|
80
|
+
innerError: {
|
81
|
+
errorCode: string | number
|
82
|
+
errorMsg: string
|
83
|
+
}
|
84
|
+
}) => void
|
85
|
+
}): void
|
86
|
+
|
87
|
+
/**
|
88
|
+
* 数据初始
|
89
|
+
*/
|
90
|
+
export function createAIAssistant(params?: {
|
91
|
+
complete?: () => void
|
92
|
+
success?: (params: null) => void
|
93
|
+
fail?: (params: {
|
94
|
+
errorMsg: string
|
95
|
+
errorCode: string | number
|
96
|
+
innerError: {
|
97
|
+
errorCode: string | number
|
98
|
+
errorMsg: string
|
99
|
+
}
|
100
|
+
}) => void
|
101
|
+
}): void
|
102
|
+
|
103
|
+
/**
|
104
|
+
* 移除消息监听
|
105
|
+
*获取单次对话消息标识
|
106
|
+
*/
|
107
|
+
export function getAIAssistantRequestId(params?: {
|
108
|
+
complete?: () => void
|
109
|
+
success?: (params: {
|
110
|
+
/** 单次对话消息标识 */
|
111
|
+
requestId: string
|
112
|
+
}) => void
|
113
|
+
fail?: (params: {
|
114
|
+
errorMsg: string
|
115
|
+
errorCode: string | number
|
116
|
+
innerError: {
|
117
|
+
errorCode: string | number
|
118
|
+
errorMsg: string
|
119
|
+
}
|
120
|
+
}) => void
|
121
|
+
}): void
|
122
|
+
|
123
|
+
/**
|
124
|
+
* 插入数据
|
125
|
+
*/
|
126
|
+
export function insertAIAssistantInfo(params: {
|
127
|
+
/** 消息标识:如果requestId是新生成的,则会作为宿主消息查询出来;如果是用的其他消息的requestId,列表查询的时候则会被绑定到这条消息上返回 */
|
128
|
+
requestId: string
|
129
|
+
/**
|
130
|
+
* 类型, 自定义类型
|
131
|
+
* 保留字段:TEXT_FINISH,CUSTOM_FINISH, 这两个字符串会被插件默认当做宿主消息,会被当做一个气泡,其他类型的比如SKILL_FINISH,XX_FINISH,都会绑定到该消息上,删除的时候会被一起删除掉
|
132
|
+
* 1、如果你想插入一条河其他消息绑定的,则不能传入 TEXT_FINISH, CUSTOM_FINISH,传入其他的,比如:XX1_FINISH,requestId则需要传入绑定的那条消息的requestId
|
133
|
+
* 2、如果你想插入一条消息作为单独的气泡,则需要传入 TEXT_FINISH 或者 CUSTOM_FINISH,requestId则需要重新生成,可以通过插件提供的api获取。
|
134
|
+
* 3、消息的绑定也会根据插入的source值相关,只有source相同的才会绑定。比如requestId==1的数据在数据库中有两条,source分别是1和2,插入内容根据source匹配绑定到对应的消息上。
|
135
|
+
*/
|
136
|
+
type: string
|
137
|
+
/** 消息内容: 消息内容完全业务方自己定义,如果业务复杂,涉及到自定义的type很多,需要业务自己规划设计好data的结构进行区分。 */
|
138
|
+
data: string
|
139
|
+
/** 错误码 */
|
140
|
+
code: string
|
141
|
+
/** 错误信息 */
|
142
|
+
message: string
|
143
|
+
/**
|
144
|
+
* 消息来源 1. 本地 2. 云端
|
145
|
+
* 消息的绑定会根据插入的source值相关,只有source相同的才会绑定。比如requestId==1的数据在数据库中有两条,source分别是1和2,插入内容根据source匹配绑定到对应的消息上。
|
146
|
+
*/
|
147
|
+
source: string
|
148
|
+
/** 渠道 可选参数,不传表示首页AI组手 */
|
149
|
+
channel: string
|
150
|
+
complete?: () => void
|
151
|
+
success?: (params: null) => void
|
152
|
+
fail?: (params: {
|
153
|
+
errorMsg: string
|
154
|
+
errorCode: string | number
|
155
|
+
innerError: {
|
156
|
+
errorCode: string | number
|
157
|
+
errorMsg: string
|
158
|
+
}
|
159
|
+
}) => void
|
160
|
+
}): void
|
161
|
+
|
162
|
+
/**
|
163
|
+
* 更新数据
|
164
|
+
*/
|
165
|
+
export function updateAIAssistantInfo(params: {
|
166
|
+
/** 消息标识 */
|
167
|
+
primaryId: number
|
168
|
+
/** 消息内容 */
|
169
|
+
data: string
|
170
|
+
/** 错误码 */
|
171
|
+
code: string
|
172
|
+
/** 错误信息 */
|
173
|
+
message: string
|
174
|
+
/** 消息来源 1. 本地 2. 云端 */
|
175
|
+
source: string
|
176
|
+
complete?: () => void
|
177
|
+
success?: (params: null) => void
|
178
|
+
fail?: (params: {
|
179
|
+
errorMsg: string
|
180
|
+
errorCode: string | number
|
181
|
+
innerError: {
|
182
|
+
errorCode: string | number
|
183
|
+
errorMsg: string
|
184
|
+
}
|
185
|
+
}) => void
|
186
|
+
}): void
|
187
|
+
|
188
|
+
/**
|
189
|
+
* 获取语音助手展示类型
|
190
|
+
*/
|
191
|
+
export function getSpeechDisplayType(params?: {
|
192
|
+
complete?: () => void
|
193
|
+
success?: (params: {
|
194
|
+
/** 0 不展示 1 显示老助手 2 显示新助手 */
|
195
|
+
type: number
|
196
|
+
}) => void
|
197
|
+
fail?: (params: {
|
198
|
+
errorMsg: string
|
199
|
+
errorCode: string | number
|
200
|
+
innerError: {
|
201
|
+
errorCode: string | number
|
202
|
+
errorMsg: string
|
203
|
+
}
|
204
|
+
}) => void
|
205
|
+
}): void
|
206
|
+
|
207
|
+
/**
|
208
|
+
* 关闭AI助手
|
209
|
+
*/
|
210
|
+
export function disableAIAssistant(params?: {
|
211
|
+
complete?: () => void
|
212
|
+
success?: (params: null) => void
|
213
|
+
fail?: (params: {
|
214
|
+
errorMsg: string
|
215
|
+
errorCode: string | number
|
216
|
+
innerError: {
|
217
|
+
errorCode: string | number
|
218
|
+
errorMsg: string
|
219
|
+
}
|
220
|
+
}) => void
|
221
|
+
}): void
|
222
|
+
|
223
|
+
/**
|
224
|
+
* 打开AI助手
|
225
|
+
*/
|
226
|
+
export function enableAIAssistant(params?: {
|
227
|
+
complete?: () => void
|
228
|
+
success?: (params: null) => void
|
229
|
+
fail?: (params: {
|
230
|
+
errorMsg: string
|
231
|
+
errorCode: string | number
|
232
|
+
innerError: {
|
233
|
+
errorCode: string | number
|
234
|
+
errorMsg: string
|
235
|
+
}
|
236
|
+
}) => void
|
237
|
+
}): void
|
238
|
+
|
239
|
+
/**
|
240
|
+
* 清除数据
|
241
|
+
*/
|
242
|
+
export function deleteAIAssistantDbSource(params: {
|
243
|
+
/** 清除家庭数据, 不传表示清除当前家庭 */
|
244
|
+
homeId: string
|
245
|
+
complete?: () => void
|
246
|
+
success?: (params: null) => void
|
247
|
+
fail?: (params: {
|
248
|
+
errorMsg: string
|
249
|
+
errorCode: string | number
|
250
|
+
innerError: {
|
251
|
+
errorCode: string | number
|
252
|
+
errorMsg: string
|
253
|
+
}
|
254
|
+
}) => void
|
255
|
+
}): void
|
256
|
+
|
257
|
+
/**
|
258
|
+
* 获取单条数据
|
259
|
+
*/
|
260
|
+
export function getSingleAIAssistant(params: {
|
261
|
+
/** 主键 */
|
262
|
+
primaryId: number
|
263
|
+
complete?: () => void
|
264
|
+
success?: (params: {
|
265
|
+
/** 主键 */
|
266
|
+
primaryId: number
|
267
|
+
/** 消息标识 */
|
268
|
+
requestId: string
|
269
|
+
/** 消息来源 1. 本地 2. 云端 */
|
270
|
+
source: string
|
271
|
+
/** 消息内容 */
|
272
|
+
data: string
|
273
|
+
/** 错误码 */
|
274
|
+
code: number
|
275
|
+
/** 类型 */
|
276
|
+
type: string
|
277
|
+
/** 创建时间 */
|
278
|
+
createTime: number
|
279
|
+
}) => void
|
280
|
+
fail?: (params: {
|
281
|
+
errorMsg: string
|
282
|
+
errorCode: string | number
|
283
|
+
innerError: {
|
284
|
+
errorCode: string | number
|
285
|
+
errorMsg: string
|
286
|
+
}
|
287
|
+
}) => void
|
288
|
+
}): void
|
289
|
+
|
290
|
+
/**
|
291
|
+
* 是否支持老语音助手
|
292
|
+
*/
|
293
|
+
export function isSupportOldSpeech(params?: {
|
294
|
+
complete?: () => void
|
295
|
+
success?: (params: boolean) => void
|
296
|
+
fail?: (params: {
|
297
|
+
errorMsg: string
|
298
|
+
errorCode: string | number
|
299
|
+
innerError: {
|
300
|
+
errorCode: string | number
|
301
|
+
errorMsg: string
|
302
|
+
}
|
303
|
+
}) => void
|
304
|
+
}): void
|
305
|
+
|
7
306
|
/**
|
8
307
|
* atop接口
|
9
308
|
*/
|
@@ -42,6 +341,48 @@ declare namespace ty {
|
|
42
341
|
}) => void
|
43
342
|
}): void
|
44
343
|
|
344
|
+
/**
|
345
|
+
* highway面板接口
|
346
|
+
*/
|
347
|
+
export function apiRequestByHighwayRestful(params: {
|
348
|
+
/**
|
349
|
+
* 域名
|
350
|
+
* e.g. apigw-cn.wgine.com
|
351
|
+
*/
|
352
|
+
host?: string
|
353
|
+
/**
|
354
|
+
* 请求API, 严格遵循restful标准格式,"/"开头
|
355
|
+
* e.g. /v1.0/m/thing/test/path/to/my/api
|
356
|
+
*/
|
357
|
+
api: string
|
358
|
+
/**
|
359
|
+
* 数据不会被加密,以 HEADER 形式传递
|
360
|
+
* 每一个request都包含了默认的公共参数,header会覆盖默认的公共参数
|
361
|
+
*/
|
362
|
+
header?: Record<string, any>
|
363
|
+
/** 数据会被加密,最终以 QUERY 形式传递 */
|
364
|
+
query?: Record<string, any>
|
365
|
+
/** 只针对 POST 请求,数据会被加密,最终以 BODY 形式传递 */
|
366
|
+
body?: Record<string, any>
|
367
|
+
/** http请求方式 */
|
368
|
+
method?: HighwayMethod
|
369
|
+
complete?: () => void
|
370
|
+
success?: (params: {
|
371
|
+
/** 序列化返回结果 */
|
372
|
+
result: {}
|
373
|
+
/** apiName */
|
374
|
+
api: string
|
375
|
+
}) => void
|
376
|
+
fail?: (params: {
|
377
|
+
errorMsg: string
|
378
|
+
errorCode: string | number
|
379
|
+
innerError: {
|
380
|
+
errorCode: string | number
|
381
|
+
errorMsg: string
|
382
|
+
}
|
383
|
+
}) => void
|
384
|
+
}): void
|
385
|
+
|
45
386
|
/**
|
46
387
|
* 单次点 事件埋点
|
47
388
|
*/
|
@@ -137,6 +478,28 @@ declare namespace ty {
|
|
137
478
|
}) => void
|
138
479
|
}): void
|
139
480
|
|
481
|
+
/**
|
482
|
+
* 链路埋点 支持10个链路点,链路下标:0 - 9
|
483
|
+
*/
|
484
|
+
export function eventLink(params: {
|
485
|
+
/** 链路点位置,目前只支持10个链路点,0 - 9 */
|
486
|
+
linkIndex: number
|
487
|
+
/** 链路唯一id,保证唯一性,建议格式是:链路关键词_小程序id */
|
488
|
+
linkId: string
|
489
|
+
/** 业务扩展参数 map转成string */
|
490
|
+
params: string
|
491
|
+
complete?: () => void
|
492
|
+
success?: (params: null) => void
|
493
|
+
fail?: (params: {
|
494
|
+
errorMsg: string
|
495
|
+
errorCode: string | number
|
496
|
+
innerError: {
|
497
|
+
errorCode: string | number
|
498
|
+
errorMsg: string
|
499
|
+
}
|
500
|
+
}) => void
|
501
|
+
}): void
|
502
|
+
|
140
503
|
/**
|
141
504
|
* 拿到当前App的业务信息
|
142
505
|
*/
|
@@ -173,6 +536,224 @@ declare namespace ty {
|
|
173
536
|
appScheme: string
|
174
537
|
/** app id */
|
175
538
|
appId: string
|
539
|
+
/** app clientId */
|
540
|
+
clientId?: string
|
541
|
+
}) => void
|
542
|
+
fail?: (params: {
|
543
|
+
errorMsg: string
|
544
|
+
errorCode: string | number
|
545
|
+
innerError: {
|
546
|
+
errorCode: string | number
|
547
|
+
errorMsg: string
|
548
|
+
}
|
549
|
+
}) => void
|
550
|
+
}): void
|
551
|
+
|
552
|
+
/**
|
553
|
+
* 拿到当前连接的wifi的ssid
|
554
|
+
*/
|
555
|
+
export function getCurrentWifiSSID(params?: {
|
556
|
+
complete?: () => void
|
557
|
+
success?: (params: {
|
558
|
+
/** 拿到当前连接的wifi的ssid */
|
559
|
+
ssId: string
|
560
|
+
}) => void
|
561
|
+
fail?: (params: {
|
562
|
+
errorMsg: string
|
563
|
+
errorCode: string | number
|
564
|
+
innerError: {
|
565
|
+
errorCode: string | number
|
566
|
+
errorMsg: string
|
567
|
+
}
|
568
|
+
}) => void
|
569
|
+
}): void
|
570
|
+
|
571
|
+
/**
|
572
|
+
* 获取NG配置
|
573
|
+
*/
|
574
|
+
export function getNGConfigByKeys(params: {
|
575
|
+
/** ng配置的key */
|
576
|
+
keys: string[]
|
577
|
+
complete?: () => void
|
578
|
+
success?: (params: {
|
579
|
+
/** ng配置 */
|
580
|
+
config: Record<string, {}>
|
581
|
+
}) => void
|
582
|
+
fail?: (params: {
|
583
|
+
errorMsg: string
|
584
|
+
errorCode: string | number
|
585
|
+
innerError: {
|
586
|
+
errorCode: string | number
|
587
|
+
errorMsg: string
|
588
|
+
}
|
589
|
+
}) => void
|
590
|
+
}): void
|
591
|
+
|
592
|
+
/**
|
593
|
+
* 获取配置中心的配置
|
594
|
+
*/
|
595
|
+
export function getConfigByKeys(params: {
|
596
|
+
/**
|
597
|
+
* 三段式结构对应配置中心的业务配置
|
598
|
+
* 举例:["oem:config:open_device_network"]
|
599
|
+
*/
|
600
|
+
keys: string[]
|
601
|
+
complete?: () => void
|
602
|
+
success?: (params: {
|
603
|
+
/** ng配置 */
|
604
|
+
config: Record<string, {}>
|
605
|
+
}) => void
|
606
|
+
fail?: (params: {
|
607
|
+
errorMsg: string
|
608
|
+
errorCode: string | number
|
609
|
+
innerError: {
|
610
|
+
errorCode: string | number
|
611
|
+
errorMsg: string
|
612
|
+
}
|
613
|
+
}) => void
|
614
|
+
}): void
|
615
|
+
|
616
|
+
/**
|
617
|
+
* 获取三方服务信息
|
618
|
+
*/
|
619
|
+
export function getThirdPartyServiceInfo(params: {
|
620
|
+
/** 三方服务列表 ThirdPartyType */
|
621
|
+
types: number[]
|
622
|
+
complete?: () => void
|
623
|
+
success?: (params: ThirdPartyServiceInfo[]) => void
|
624
|
+
fail?: (params: {
|
625
|
+
errorMsg: string
|
626
|
+
errorCode: string | number
|
627
|
+
innerError: {
|
628
|
+
errorCode: string | number
|
629
|
+
errorMsg: string
|
630
|
+
}
|
631
|
+
}) => void
|
632
|
+
}): void
|
633
|
+
|
634
|
+
/**
|
635
|
+
* 打开三方小程序
|
636
|
+
*/
|
637
|
+
export function openThirdPartyMiniProgram(params: {
|
638
|
+
/** 三方小程序类型 ThirdPartyMiniProgramType */
|
639
|
+
type: number
|
640
|
+
/** 三方小程序参数 */
|
641
|
+
params: Record<string, {}>
|
642
|
+
complete?: () => void
|
643
|
+
success?: (params: {
|
644
|
+
/** 三方小程序结果 */
|
645
|
+
data: Record<string, {}>
|
646
|
+
}) => void
|
647
|
+
fail?: (params: {
|
648
|
+
errorMsg: string
|
649
|
+
errorCode: string | number
|
650
|
+
innerError: {
|
651
|
+
errorCode: string | number
|
652
|
+
errorMsg: string
|
653
|
+
}
|
654
|
+
}) => void
|
655
|
+
}): void
|
656
|
+
|
657
|
+
/**
|
658
|
+
* 进入选择国家页面
|
659
|
+
*/
|
660
|
+
export function openCountrySelectPage(params?: {
|
661
|
+
complete?: () => void
|
662
|
+
success?: (params: null) => void
|
663
|
+
fail?: (params: {
|
664
|
+
errorMsg: string
|
665
|
+
errorCode: string | number
|
666
|
+
innerError: {
|
667
|
+
errorCode: string | number
|
668
|
+
errorMsg: string
|
669
|
+
}
|
670
|
+
}) => void
|
671
|
+
}): void
|
672
|
+
|
673
|
+
/**
|
674
|
+
* 获取iconfont信息
|
675
|
+
*/
|
676
|
+
export function getIconfontInfo(params?: {
|
677
|
+
complete?: () => void
|
678
|
+
success?: (params: {
|
679
|
+
/**
|
680
|
+
* iconfont 信息结构体
|
681
|
+
* nameMap iconfont信息载体
|
682
|
+
*/
|
683
|
+
nameMap: string
|
684
|
+
}) => void
|
685
|
+
fail?: (params: {
|
686
|
+
errorMsg: string
|
687
|
+
errorCode: string | number
|
688
|
+
innerError: {
|
689
|
+
errorCode: string | number
|
690
|
+
errorMsg: string
|
691
|
+
}
|
692
|
+
}) => void
|
693
|
+
}): void
|
694
|
+
|
695
|
+
/**
|
696
|
+
* IAP支付方法
|
697
|
+
*/
|
698
|
+
export function iapPay(params: {
|
699
|
+
/** 订单ID */
|
700
|
+
orderID: string
|
701
|
+
/** 商品ID */
|
702
|
+
productID: string
|
703
|
+
/** 订阅单预支付code */
|
704
|
+
preFlowCode: string
|
705
|
+
complete?: () => void
|
706
|
+
success?: (params: {
|
707
|
+
/** 订单ID */
|
708
|
+
orderID: string
|
709
|
+
}) => void
|
710
|
+
fail?: (params: {
|
711
|
+
errorMsg: string
|
712
|
+
errorCode: string | number
|
713
|
+
innerError: {
|
714
|
+
errorCode: string | number
|
715
|
+
errorMsg: string
|
716
|
+
}
|
717
|
+
}) => void
|
718
|
+
}): void
|
719
|
+
|
720
|
+
/**
|
721
|
+
* 支付类型
|
722
|
+
*/
|
723
|
+
export function iapType(params?: {
|
724
|
+
complete?: () => void
|
725
|
+
success?: (params: {
|
726
|
+
/** 支付类型 0:三方支付; 1:苹果支付 */
|
727
|
+
data: number
|
728
|
+
}) => void
|
729
|
+
fail?: (params: {
|
730
|
+
errorMsg: string
|
731
|
+
errorCode: string | number
|
732
|
+
innerError: {
|
733
|
+
errorCode: string | number
|
734
|
+
errorMsg: string
|
735
|
+
}
|
736
|
+
}) => void
|
737
|
+
}): void
|
738
|
+
|
739
|
+
/**
|
740
|
+
* 图片上传
|
741
|
+
*/
|
742
|
+
export function uploadImage(params: {
|
743
|
+
/** the file path */
|
744
|
+
filePath: string
|
745
|
+
/** business type, config via backend ng */
|
746
|
+
bizType: string
|
747
|
+
/** file type, ios necessary */
|
748
|
+
contentType?: string
|
749
|
+
/** polling interval of big file in second, default is 2 second */
|
750
|
+
delayTime?: number
|
751
|
+
/** max polling count, default is 5 */
|
752
|
+
pollMaxCount?: number
|
753
|
+
complete?: () => void
|
754
|
+
success?: (params: {
|
755
|
+
/** The json string returned by the request */
|
756
|
+
result: string
|
176
757
|
}) => void
|
177
758
|
fail?: (params: {
|
178
759
|
errorMsg: string
|
@@ -185,13 +766,19 @@ declare namespace ty {
|
|
185
766
|
}): void
|
186
767
|
|
187
768
|
/**
|
188
|
-
*
|
769
|
+
* 视频上传
|
189
770
|
*/
|
190
|
-
export function
|
771
|
+
export function uploadVideo(params: {
|
772
|
+
/** the file path */
|
773
|
+
filePath: string
|
774
|
+
/** business type, config via backend ng */
|
775
|
+
bizType: string
|
776
|
+
/** file type, ios necessary */
|
777
|
+
contentType?: string
|
191
778
|
complete?: () => void
|
192
779
|
success?: (params: {
|
193
|
-
/**
|
194
|
-
|
780
|
+
/** The json string returned by the request */
|
781
|
+
result: string
|
195
782
|
}) => void
|
196
783
|
fail?: (params: {
|
197
784
|
errorMsg: string
|
@@ -204,11 +791,14 @@ declare namespace ty {
|
|
204
791
|
}): void
|
205
792
|
|
206
793
|
/**
|
207
|
-
*
|
794
|
+
* 获取手机当前地区语言 zh-hans 、en-GB
|
208
795
|
*/
|
209
|
-
export function
|
796
|
+
export function getLangKey(params?: {
|
210
797
|
complete?: () => void
|
211
|
-
success?: (params:
|
798
|
+
success?: (params: {
|
799
|
+
/** 手机当前地区语言 */
|
800
|
+
langKey: string
|
801
|
+
}) => void
|
212
802
|
fail?: (params: {
|
213
803
|
errorMsg: string
|
214
804
|
errorCode: string | number
|
@@ -220,16 +810,13 @@ declare namespace ty {
|
|
220
810
|
}): void
|
221
811
|
|
222
812
|
/**
|
223
|
-
*
|
813
|
+
* 获取多语言
|
224
814
|
*/
|
225
|
-
export function
|
815
|
+
export function getLangContent(params?: {
|
226
816
|
complete?: () => void
|
227
817
|
success?: (params: {
|
228
|
-
/**
|
229
|
-
|
230
|
-
* nameMap iconfont信息载体
|
231
|
-
*/
|
232
|
-
nameMap: string
|
818
|
+
/** 多语言 */
|
819
|
+
langContent: {}
|
233
820
|
}) => void
|
234
821
|
fail?: (params: {
|
235
822
|
errorMsg: string
|
@@ -242,24 +829,11 @@ declare namespace ty {
|
|
242
829
|
}): void
|
243
830
|
|
244
831
|
/**
|
245
|
-
*
|
832
|
+
* 注册界面刷新
|
246
833
|
*/
|
247
|
-
export function
|
248
|
-
/** the file path */
|
249
|
-
filePath: string
|
250
|
-
/** business type, config via backend ng */
|
251
|
-
bizType: string
|
252
|
-
/** file type */
|
253
|
-
contentType?: string
|
254
|
-
/** polling interval of big file in second, default is 2 second */
|
255
|
-
delayTime?: number
|
256
|
-
/** max polling count, default is 5 */
|
257
|
-
pollMaxCount?: number
|
834
|
+
export function registerPageRefreshListener(params?: {
|
258
835
|
complete?: () => void
|
259
|
-
success?: (params:
|
260
|
-
/** The json string returned by the request */
|
261
|
-
result: string
|
262
|
-
}) => void
|
836
|
+
success?: (params: null) => void
|
263
837
|
fail?: (params: {
|
264
838
|
errorMsg: string
|
265
839
|
errorCode: string | number
|
@@ -271,13 +845,15 @@ declare namespace ty {
|
|
271
845
|
}): void
|
272
846
|
|
273
847
|
/**
|
274
|
-
*
|
848
|
+
* 传入key值,获取对应NG元数据
|
275
849
|
*/
|
276
|
-
export function
|
850
|
+
export function getNgRawData(params: {
|
851
|
+
/** 要获取元数据的key值,支持x.y.z格式 */
|
852
|
+
rawKey: string
|
277
853
|
complete?: () => void
|
278
854
|
success?: (params: {
|
279
|
-
/**
|
280
|
-
|
855
|
+
/** 返回元数据 */
|
856
|
+
rawData: string
|
281
857
|
}) => void
|
282
858
|
fail?: (params: {
|
283
859
|
errorMsg: string
|
@@ -290,14 +866,11 @@ declare namespace ty {
|
|
290
866
|
}): void
|
291
867
|
|
292
868
|
/**
|
293
|
-
*
|
869
|
+
* 获取在线客户电子
|
294
870
|
*/
|
295
|
-
export function
|
871
|
+
export function getOnlineCustomerService(params?: {
|
296
872
|
complete?: () => void
|
297
|
-
success?: (params: {
|
298
|
-
/** 多语言 */
|
299
|
-
langContent: {}
|
300
|
-
}) => void
|
873
|
+
success?: (params: { url: string }) => void
|
301
874
|
fail?: (params: {
|
302
875
|
errorMsg: string
|
303
876
|
errorCode: string | number
|
@@ -470,7 +1043,8 @@ declare namespace ty {
|
|
470
1043
|
}): void
|
471
1044
|
|
472
1045
|
/**
|
473
|
-
*
|
1046
|
+
* !!!注: 由于审核安全风险,在iOS端调用此方法只会打开当前应用对应的设置界面,不再支持以下scope
|
1047
|
+
*根据不同scope值,打开对应的手机系统设置界面
|
474
1048
|
*"Settings"-> 手机设置主界面
|
475
1049
|
*"Settings-Bluetooth" -> 手机蓝牙设置界面
|
476
1050
|
*"Settings-WiFi" -> 手机Wifi设置界面
|
@@ -525,6 +1099,71 @@ declare namespace ty {
|
|
525
1099
|
}) => void
|
526
1100
|
}): void
|
527
1101
|
|
1102
|
+
/**
|
1103
|
+
* Call this to set the result that your activity will return to its caller
|
1104
|
+
*/
|
1105
|
+
export function setActivityResult(params: {
|
1106
|
+
/** The result code to propagate back to the originating activity, often RESULT_CANCELED or RESULT_OK */
|
1107
|
+
resultCode: number
|
1108
|
+
/** The data to propagate back to the originating activity. */
|
1109
|
+
data?: Record<string, {}>
|
1110
|
+
complete?: () => void
|
1111
|
+
success?: (params: null) => void
|
1112
|
+
fail?: (params: {
|
1113
|
+
errorMsg: string
|
1114
|
+
errorCode: string | number
|
1115
|
+
innerError: {
|
1116
|
+
errorCode: string | number
|
1117
|
+
errorMsg: string
|
1118
|
+
}
|
1119
|
+
}) => void
|
1120
|
+
}): void
|
1121
|
+
|
1122
|
+
/**
|
1123
|
+
* 打开三方App
|
1124
|
+
*/
|
1125
|
+
export function openThirdApp(params: {
|
1126
|
+
/** an RFC 2396-compliant, encoded URI */
|
1127
|
+
uriString: string
|
1128
|
+
/** The name of the application package to handle the intent, or null to allow any application package. */
|
1129
|
+
packageName: string
|
1130
|
+
complete?: () => void
|
1131
|
+
success?: (params: { isCanOpen?: boolean }) => void
|
1132
|
+
fail?: (params: {
|
1133
|
+
errorMsg: string
|
1134
|
+
errorCode: string | number
|
1135
|
+
innerError: {
|
1136
|
+
errorCode: string | number
|
1137
|
+
errorMsg: string
|
1138
|
+
}
|
1139
|
+
}) => void
|
1140
|
+
}): void
|
1141
|
+
|
1142
|
+
/**
|
1143
|
+
* 打开三方App
|
1144
|
+
*/
|
1145
|
+
export function openThirdAppSync(params?: ThirdAppBean): {
|
1146
|
+
isCanOpen?: boolean
|
1147
|
+
}
|
1148
|
+
|
1149
|
+
/**
|
1150
|
+
* 聚焦系统浏览器通过打开URL
|
1151
|
+
*/
|
1152
|
+
export function openUrlForceDefaultBrowser(params: {
|
1153
|
+
/** 要打开的url */
|
1154
|
+
url: string
|
1155
|
+
complete?: () => void
|
1156
|
+
success?: (params: null) => void
|
1157
|
+
fail?: (params: {
|
1158
|
+
errorMsg: string
|
1159
|
+
errorCode: string | number
|
1160
|
+
innerError: {
|
1161
|
+
errorCode: string | number
|
1162
|
+
errorMsg: string
|
1163
|
+
}
|
1164
|
+
}) => void
|
1165
|
+
}): void
|
1166
|
+
|
528
1167
|
/**
|
529
1168
|
* 获取支付相关常量信息
|
530
1169
|
*/
|
@@ -765,7 +1404,7 @@ declare namespace ty {
|
|
765
1404
|
* miniProgram:微信小程序分享内容
|
766
1405
|
*/
|
767
1406
|
contentType: string
|
768
|
-
/** recipients
|
1407
|
+
/** recipients 邮件收件人/短信接收人 */
|
769
1408
|
recipients?: string[]
|
770
1409
|
/** imagePath 图片路径 */
|
771
1410
|
imagePath?: string
|
@@ -988,6 +1627,168 @@ declare namespace ty {
|
|
988
1627
|
}) => void
|
989
1628
|
}): void
|
990
1629
|
|
1630
|
+
/**
|
1631
|
+
* 获取websocket的连接状态
|
1632
|
+
*/
|
1633
|
+
export function getWebSocketStatus(params?: {
|
1634
|
+
complete?: () => void
|
1635
|
+
success?: (params: {
|
1636
|
+
/** 0.未初始化 1. 连接中 2. 连接成功 3. 连接失败 ', */
|
1637
|
+
status: number
|
1638
|
+
}) => void
|
1639
|
+
fail?: (params: {
|
1640
|
+
errorMsg: string
|
1641
|
+
errorCode: string | number
|
1642
|
+
innerError: {
|
1643
|
+
errorCode: string | number
|
1644
|
+
errorMsg: string
|
1645
|
+
}
|
1646
|
+
}) => void
|
1647
|
+
}): void
|
1648
|
+
|
1649
|
+
/**
|
1650
|
+
* 获取websocket的连接状态
|
1651
|
+
*/
|
1652
|
+
export function getWebSocketStatusSync(): {
|
1653
|
+
/** 0.未初始化 1. 连接中 2. 连接成功 3. 连接失败 ', */
|
1654
|
+
status: number
|
1655
|
+
}
|
1656
|
+
|
1657
|
+
/**
|
1658
|
+
* 绑定微信
|
1659
|
+
*/
|
1660
|
+
export function bindWechat(params?: {
|
1661
|
+
complete?: () => void
|
1662
|
+
success?: (params: null) => void
|
1663
|
+
fail?: (params: {
|
1664
|
+
errorMsg: string
|
1665
|
+
errorCode: string | number
|
1666
|
+
innerError: {
|
1667
|
+
errorCode: string | number
|
1668
|
+
errorMsg: string
|
1669
|
+
}
|
1670
|
+
}) => void
|
1671
|
+
}): void
|
1672
|
+
|
1673
|
+
/**
|
1674
|
+
* 是否支持微信绑定
|
1675
|
+
*/
|
1676
|
+
export function isSupportWechat(params?: {
|
1677
|
+
complete?: () => void
|
1678
|
+
success?: (params: {
|
1679
|
+
/** 是否支持微信绑定 */
|
1680
|
+
isSupport: boolean
|
1681
|
+
}) => void
|
1682
|
+
fail?: (params: {
|
1683
|
+
errorMsg: string
|
1684
|
+
errorCode: string | number
|
1685
|
+
innerError: {
|
1686
|
+
errorCode: string | number
|
1687
|
+
errorMsg: string
|
1688
|
+
}
|
1689
|
+
}) => void
|
1690
|
+
}): void
|
1691
|
+
|
1692
|
+
/**
|
1693
|
+
* 跳转微信小程序
|
1694
|
+
*/
|
1695
|
+
export function gotoWechatMiniApp(params: {
|
1696
|
+
/** 小程序原始 appId */
|
1697
|
+
miniAppId: string
|
1698
|
+
/** 小程序路径 */
|
1699
|
+
path: string
|
1700
|
+
/**
|
1701
|
+
* mini program Type:
|
1702
|
+
* 0: 正式版 MINIPTOGRAM_TYPE_RELEASE
|
1703
|
+
* 1: 测试版 MINIPROGRAM_TYPE_TEST
|
1704
|
+
* 2: 预览版 MINIPROGRAM_TYPE_PREVIEW
|
1705
|
+
*/
|
1706
|
+
miniProgramType: number
|
1707
|
+
complete?: () => void
|
1708
|
+
success?: (params: null) => void
|
1709
|
+
fail?: (params: {
|
1710
|
+
errorMsg: string
|
1711
|
+
errorCode: string | number
|
1712
|
+
innerError: {
|
1713
|
+
errorCode: string | number
|
1714
|
+
errorMsg: string
|
1715
|
+
}
|
1716
|
+
}) => void
|
1717
|
+
}): void
|
1718
|
+
|
1719
|
+
/**
|
1720
|
+
* 是否正在通话中
|
1721
|
+
*/
|
1722
|
+
export function isCalling(params?: {
|
1723
|
+
complete?: () => void
|
1724
|
+
success?: (params: {
|
1725
|
+
/** 结果 */
|
1726
|
+
result: boolean
|
1727
|
+
}) => void
|
1728
|
+
fail?: (params: {
|
1729
|
+
errorMsg: string
|
1730
|
+
errorCode: string | number
|
1731
|
+
innerError: {
|
1732
|
+
errorCode: string | number
|
1733
|
+
errorMsg: string
|
1734
|
+
}
|
1735
|
+
}) => void
|
1736
|
+
}): void
|
1737
|
+
|
1738
|
+
/**
|
1739
|
+
* 是否正在通话中
|
1740
|
+
*/
|
1741
|
+
export function canLaunchCall(params?: {
|
1742
|
+
complete?: () => void
|
1743
|
+
success?: (params: {
|
1744
|
+
/** 结果 */
|
1745
|
+
result: boolean
|
1746
|
+
}) => void
|
1747
|
+
fail?: (params: {
|
1748
|
+
errorMsg: string
|
1749
|
+
errorCode: string | number
|
1750
|
+
innerError: {
|
1751
|
+
errorCode: string | number
|
1752
|
+
errorMsg: string
|
1753
|
+
}
|
1754
|
+
}) => void
|
1755
|
+
}): void
|
1756
|
+
|
1757
|
+
/**
|
1758
|
+
* 发起呼叫
|
1759
|
+
*/
|
1760
|
+
export function launchCall(params: {
|
1761
|
+
/** 设备id */
|
1762
|
+
targetId: string
|
1763
|
+
/**
|
1764
|
+
* 超时时间,单位秒
|
1765
|
+
* note: 不要传时间戳
|
1766
|
+
*/
|
1767
|
+
timeout: number
|
1768
|
+
/** 通话业务参数 例如linux中控 {"channelType": 1, "category": "dgnzk"} */
|
1769
|
+
extra: Record<string, any>
|
1770
|
+
complete?: () => void
|
1771
|
+
success?: (params: null) => void
|
1772
|
+
fail?: (params: {
|
1773
|
+
errorMsg: string
|
1774
|
+
errorCode: string | number
|
1775
|
+
innerError: {
|
1776
|
+
errorCode: string | number
|
1777
|
+
errorMsg: string
|
1778
|
+
}
|
1779
|
+
}) => void
|
1780
|
+
}): void
|
1781
|
+
|
1782
|
+
/**
|
1783
|
+
* 添加消息监听
|
1784
|
+
*/
|
1785
|
+
export function onAIAssistantChange(listener: (params: ReceiveBean) => void): void
|
1786
|
+
|
1787
|
+
/**
|
1788
|
+
* 取消监听:添加消息监听
|
1789
|
+
*/
|
1790
|
+
export function offAIAssistantChange(listener: (params: ReceiveBean) => void): void
|
1791
|
+
|
991
1792
|
/**
|
992
1793
|
* 国家列表界面选择的国家信息
|
993
1794
|
*/
|
@@ -1012,6 +1813,16 @@ declare namespace ty {
|
|
1012
1813
|
*/
|
1013
1814
|
export function offUploadProgressUpdate(listener: (params: ProgressEvent) => void): void
|
1014
1815
|
|
1816
|
+
/**
|
1817
|
+
* 页面刷新事件
|
1818
|
+
*/
|
1819
|
+
export function onPageRefresh(listener: (params: RefreshParams) => void): void
|
1820
|
+
|
1821
|
+
/**
|
1822
|
+
* 取消监听:页面刷新事件
|
1823
|
+
*/
|
1824
|
+
export function offPageRefresh(listener: (params: RefreshParams) => void): void
|
1825
|
+
|
1015
1826
|
/**
|
1016
1827
|
* 事件通道响应
|
1017
1828
|
*/
|
@@ -1048,9 +1859,54 @@ declare namespace ty {
|
|
1048
1859
|
export function onRouterResult(listener: (params: RouterResultResponse) => void): void
|
1049
1860
|
|
1050
1861
|
/**
|
1051
|
-
* 取消监听:万能路由界面返回的数据
|
1862
|
+
* 取消监听:万能路由界面返回的数据
|
1863
|
+
*/
|
1864
|
+
export function offRouterResult(listener: (params: RouterResultResponse) => void): void
|
1865
|
+
|
1866
|
+
/**
|
1867
|
+
* RN或小程序页面关闭事件(Android独有)
|
1868
|
+
*/
|
1869
|
+
export function onFrontPageClose(listener: (params: PageCloseResponse) => void): void
|
1870
|
+
|
1871
|
+
/**
|
1872
|
+
* 取消监听:RN或小程序页面关闭事件(Android独有)
|
1873
|
+
*/
|
1874
|
+
export function offFrontPageClose(listener: (params: PageCloseResponse) => void): void
|
1875
|
+
|
1876
|
+
/**
|
1877
|
+
* onWebSocketStatusChange 接受消息
|
1878
|
+
*/
|
1879
|
+
export function onWebSocketStatusChange(listener: (params: StatusBean) => void): void
|
1880
|
+
|
1881
|
+
/**
|
1882
|
+
* 取消监听:onWebSocketStatusChange 接受消息
|
1052
1883
|
*/
|
1053
|
-
export function
|
1884
|
+
export function offWebSocketStatusChange(listener: (params: StatusBean) => void): void
|
1885
|
+
|
1886
|
+
export enum HighwayMethod {
|
1887
|
+
/** HTTP 请求 GET */
|
1888
|
+
GET = 'GET',
|
1889
|
+
|
1890
|
+
/** HTTP 请求 POST */
|
1891
|
+
POST = 'POST',
|
1892
|
+
|
1893
|
+
/** HTTP 请求 PUT */
|
1894
|
+
PUT = 'PUT',
|
1895
|
+
|
1896
|
+
/** HTTP 请求 DELETE */
|
1897
|
+
DELETE = 'DELETE',
|
1898
|
+
}
|
1899
|
+
|
1900
|
+
export type ThirdPartyServiceInfo = {
|
1901
|
+
/** 服务是否可用 */
|
1902
|
+
available: boolean
|
1903
|
+
/** app是否已经安装 */
|
1904
|
+
isAppInstalled: boolean
|
1905
|
+
/** app安装连接 */
|
1906
|
+
appInstallUrl: string
|
1907
|
+
/** 三方服务类型 ThirdPartyType */
|
1908
|
+
type: number
|
1909
|
+
}
|
1054
1910
|
|
1055
1911
|
export type PanelUiInfoBean = {
|
1056
1912
|
/** phase 面板phase */
|
@@ -1097,6 +1953,13 @@ declare namespace ty {
|
|
1097
1953
|
uiPhase?: string
|
1098
1954
|
}
|
1099
1955
|
|
1956
|
+
export type ThirdAppBean = {
|
1957
|
+
/** an RFC 2396-compliant, encoded URI */
|
1958
|
+
uriString: string
|
1959
|
+
/** The name of the application package to handle the intent, or null to allow any application package. */
|
1960
|
+
packageName: string
|
1961
|
+
}
|
1962
|
+
|
1100
1963
|
export type TimeConfig = {
|
1101
1964
|
/** background */
|
1102
1965
|
background: string
|
@@ -1117,6 +1980,11 @@ declare namespace ty {
|
|
1117
1980
|
webPageUrl: string
|
1118
1981
|
}
|
1119
1982
|
|
1983
|
+
export type ReceiveBean = {
|
1984
|
+
/** 消息内容 */
|
1985
|
+
data: string
|
1986
|
+
}
|
1987
|
+
|
1120
1988
|
export type CountrySelectResultResponse = {
|
1121
1989
|
/** 国家码 */
|
1122
1990
|
countryCode?: string
|
@@ -1133,6 +2001,13 @@ declare namespace ty {
|
|
1133
2001
|
progress: number
|
1134
2002
|
}
|
1135
2003
|
|
2004
|
+
export type RefreshParams = {
|
2005
|
+
/** 关键词 */
|
2006
|
+
key: string
|
2007
|
+
/** 业务参数 */
|
2008
|
+
data?: Record<string, {}>
|
2009
|
+
}
|
2010
|
+
|
1136
2011
|
export type EventChannelMessageParams = {
|
1137
2012
|
/** 事件id */
|
1138
2013
|
eventId: string
|
@@ -1170,6 +2045,74 @@ declare namespace ty {
|
|
1170
2045
|
data?: string
|
1171
2046
|
}
|
1172
2047
|
|
2048
|
+
export type PageCloseResponse = {
|
2049
|
+
/** 来源 */
|
2050
|
+
from?: string
|
2051
|
+
}
|
2052
|
+
|
2053
|
+
export type StatusBean = {
|
2054
|
+
/** 0.未初始化 1. 连接中 2. 连接成功 3. 连接失败 ', */
|
2055
|
+
status: number
|
2056
|
+
}
|
2057
|
+
|
2058
|
+
export type ApiRequestByAtopParams = {
|
2059
|
+
/**
|
2060
|
+
* atop入参数据模型
|
2061
|
+
* api api名称
|
2062
|
+
*/
|
2063
|
+
api: string
|
2064
|
+
/** version api版本号 */
|
2065
|
+
version?: string
|
2066
|
+
/** postData 入参结构体 */
|
2067
|
+
postData: Record<string, any>
|
2068
|
+
/**
|
2069
|
+
* extData 额外参数,当前只支持传递gid
|
2070
|
+
* 数据格式:{"gid":"xxxx"}
|
2071
|
+
*/
|
2072
|
+
extData?: Record<string, any>
|
2073
|
+
}
|
2074
|
+
|
2075
|
+
export type ApiRequestByAtopResponse = {
|
2076
|
+
/**
|
2077
|
+
* 请求结果
|
2078
|
+
* thing_data_ 出参结构体, JSON序列化
|
2079
|
+
*/
|
2080
|
+
thing_json_?: {}
|
2081
|
+
/** 元数据 */
|
2082
|
+
data: string
|
2083
|
+
}
|
2084
|
+
|
2085
|
+
export type HighwayReq = {
|
2086
|
+
/**
|
2087
|
+
* 域名
|
2088
|
+
* e.g. apigw-cn.wgine.com
|
2089
|
+
*/
|
2090
|
+
host?: string
|
2091
|
+
/**
|
2092
|
+
* 请求API, 严格遵循restful标准格式,"/"开头
|
2093
|
+
* e.g. /v1.0/m/thing/test/path/to/my/api
|
2094
|
+
*/
|
2095
|
+
api: string
|
2096
|
+
/**
|
2097
|
+
* 数据不会被加密,以 HEADER 形式传递
|
2098
|
+
* 每一个request都包含了默认的公共参数,header会覆盖默认的公共参数
|
2099
|
+
*/
|
2100
|
+
header?: Record<string, any>
|
2101
|
+
/** 数据会被加密,最终以 QUERY 形式传递 */
|
2102
|
+
query?: Record<string, any>
|
2103
|
+
/** 只针对 POST 请求,数据会被加密,最终以 BODY 形式传递 */
|
2104
|
+
body?: Record<string, any>
|
2105
|
+
/** http请求方式 */
|
2106
|
+
method?: HighwayMethod
|
2107
|
+
}
|
2108
|
+
|
2109
|
+
export type HighwayResp = {
|
2110
|
+
/** 序列化返回结果 */
|
2111
|
+
result: {}
|
2112
|
+
/** apiName */
|
2113
|
+
api: string
|
2114
|
+
}
|
2115
|
+
|
1173
2116
|
export type EventBean = {
|
1174
2117
|
/** 事件id */
|
1175
2118
|
eventId: string
|
@@ -1188,6 +2131,40 @@ declare namespace ty {
|
|
1188
2131
|
infos: Record<string, {}>
|
1189
2132
|
}
|
1190
2133
|
|
2134
|
+
export type EventLinkBean = {
|
2135
|
+
/** 链路点位置,目前只支持10个链路点,0 - 9 */
|
2136
|
+
linkIndex: number
|
2137
|
+
/** 链路唯一id,保证唯一性,建议格式是:链路关键词_小程序id */
|
2138
|
+
linkId: string
|
2139
|
+
/** 业务扩展参数 map转成string */
|
2140
|
+
params: string
|
2141
|
+
}
|
2142
|
+
|
2143
|
+
export type ManagerContext = {
|
2144
|
+
/** managerId */
|
2145
|
+
managerId: number
|
2146
|
+
/** 家庭id */
|
2147
|
+
homeId: string
|
2148
|
+
/** 码率,eg:u律传8000,pcm传16000 */
|
2149
|
+
sampleRate: number
|
2150
|
+
/** 通道, eg:1 */
|
2151
|
+
channels: number
|
2152
|
+
/** 编码格式,eg:ThingAudioAsrCodeTypePCM = 0 ,ThingAudioAsrCodeTypePCMU = 1 */
|
2153
|
+
codec: string
|
2154
|
+
/** 云端asr解析选项,参考:https://wiki.tuya-inc.com:7799/page/1400707433826881594#5A14F9, 注意不要设置其他跟文本无关的参数,本检测只会处理跟文本相关的数据,nlp,skill,tts不包含。 */
|
2155
|
+
options: string
|
2156
|
+
}
|
2157
|
+
|
2158
|
+
export type AsrManagerContext = {
|
2159
|
+
/** managerId */
|
2160
|
+
managerId: number
|
2161
|
+
}
|
2162
|
+
|
2163
|
+
export type Active = {
|
2164
|
+
/** 状态 */
|
2165
|
+
isActive: boolean
|
2166
|
+
}
|
2167
|
+
|
1191
2168
|
export type AppInfoBean = {
|
1192
2169
|
/**
|
1193
2170
|
* App信息
|
@@ -1219,6 +2196,8 @@ declare namespace ty {
|
|
1219
2196
|
appScheme: string
|
1220
2197
|
/** app id */
|
1221
2198
|
appId: string
|
2199
|
+
/** app clientId */
|
2200
|
+
clientId?: string
|
1222
2201
|
}
|
1223
2202
|
|
1224
2203
|
export type SystemWirelessInfoBean = {
|
@@ -1226,6 +2205,41 @@ declare namespace ty {
|
|
1226
2205
|
ssId: string
|
1227
2206
|
}
|
1228
2207
|
|
2208
|
+
export type NGConfigParams = {
|
2209
|
+
/** ng配置的key */
|
2210
|
+
keys: string[]
|
2211
|
+
}
|
2212
|
+
|
2213
|
+
export type ConfigResponse = {
|
2214
|
+
/** ng配置 */
|
2215
|
+
config: Record<string, {}>
|
2216
|
+
}
|
2217
|
+
|
2218
|
+
export type ConfigParams = {
|
2219
|
+
/**
|
2220
|
+
* 三段式结构对应配置中心的业务配置
|
2221
|
+
* 举例:["oem:config:open_device_network"]
|
2222
|
+
*/
|
2223
|
+
keys: string[]
|
2224
|
+
}
|
2225
|
+
|
2226
|
+
export type ThirdPartyServiceParams = {
|
2227
|
+
/** 三方服务列表 ThirdPartyType */
|
2228
|
+
types: number[]
|
2229
|
+
}
|
2230
|
+
|
2231
|
+
export type ThirdPartyMiniProgramParams = {
|
2232
|
+
/** 三方小程序类型 ThirdPartyMiniProgramType */
|
2233
|
+
type: number
|
2234
|
+
/** 三方小程序参数 */
|
2235
|
+
params: Record<string, {}>
|
2236
|
+
}
|
2237
|
+
|
2238
|
+
export type ThirdPartyMiniProgramResult = {
|
2239
|
+
/** 三方小程序结果 */
|
2240
|
+
data: Record<string, {}>
|
2241
|
+
}
|
2242
|
+
|
1229
2243
|
export type IconfontInfoBean = {
|
1230
2244
|
/**
|
1231
2245
|
* iconfont 信息结构体
|
@@ -1234,12 +2248,31 @@ declare namespace ty {
|
|
1234
2248
|
nameMap: string
|
1235
2249
|
}
|
1236
2250
|
|
2251
|
+
export type PaymentParam = {
|
2252
|
+
/** 订单ID */
|
2253
|
+
orderID: string
|
2254
|
+
/** 商品ID */
|
2255
|
+
productID: string
|
2256
|
+
/** 订阅单预支付code */
|
2257
|
+
preFlowCode: string
|
2258
|
+
}
|
2259
|
+
|
2260
|
+
export type PaymentResponse = {
|
2261
|
+
/** 订单ID */
|
2262
|
+
orderID: string
|
2263
|
+
}
|
2264
|
+
|
2265
|
+
export type TypeResponse = {
|
2266
|
+
/** 支付类型 0:三方支付; 1:苹果支付 */
|
2267
|
+
data: number
|
2268
|
+
}
|
2269
|
+
|
1237
2270
|
export type UploadParams = {
|
1238
2271
|
/** the file path */
|
1239
2272
|
filePath: string
|
1240
2273
|
/** business type, config via backend ng */
|
1241
2274
|
bizType: string
|
1242
|
-
/** file type */
|
2275
|
+
/** file type, ios necessary */
|
1243
2276
|
contentType?: string
|
1244
2277
|
/** polling interval of big file in second, default is 2 second */
|
1245
2278
|
delayTime?: number
|
@@ -1252,6 +2285,15 @@ declare namespace ty {
|
|
1252
2285
|
result: string
|
1253
2286
|
}
|
1254
2287
|
|
2288
|
+
export type VideoUploadParams = {
|
2289
|
+
/** the file path */
|
2290
|
+
filePath: string
|
2291
|
+
/** business type, config via backend ng */
|
2292
|
+
bizType: string
|
2293
|
+
/** file type, ios necessary */
|
2294
|
+
contentType?: string
|
2295
|
+
}
|
2296
|
+
|
1255
2297
|
export type LocalConstants = {
|
1256
2298
|
/** 手机当前地区语言 */
|
1257
2299
|
langKey: string
|
@@ -1269,6 +2311,34 @@ declare namespace ty {
|
|
1269
2311
|
langContent: {}
|
1270
2312
|
}
|
1271
2313
|
|
2314
|
+
export type ManagerContext_QpZPYN = {
|
2315
|
+
/** managerId */
|
2316
|
+
managerId: number
|
2317
|
+
/** 自定义标记 */
|
2318
|
+
tag: string
|
2319
|
+
}
|
2320
|
+
|
2321
|
+
export type ManagerReqContext = {
|
2322
|
+
/** managerId */
|
2323
|
+
managerId: number
|
2324
|
+
/** 单条日志不要过10k */
|
2325
|
+
message: string
|
2326
|
+
}
|
2327
|
+
|
2328
|
+
export type NGRequestBean = {
|
2329
|
+
/** 要获取元数据的key值,支持x.y.z格式 */
|
2330
|
+
rawKey: string
|
2331
|
+
}
|
2332
|
+
|
2333
|
+
export type NGResponseBean = {
|
2334
|
+
/** 返回元数据 */
|
2335
|
+
rawData: string
|
2336
|
+
}
|
2337
|
+
|
2338
|
+
export type CustomerServiceRes = {
|
2339
|
+
url: string
|
2340
|
+
}
|
2341
|
+
|
1272
2342
|
export type PanelBean = {
|
1273
2343
|
/**
|
1274
2344
|
* 跳转RN面板(优先通过deviceId跳转设备面板,panelUiInfoBean不为null,则两者组合来跳转面板)
|
@@ -1355,6 +2425,22 @@ declare namespace ty {
|
|
1355
2425
|
eventId: string
|
1356
2426
|
}
|
1357
2427
|
|
2428
|
+
export type ActivityResultBean = {
|
2429
|
+
/** The result code to propagate back to the originating activity, often RESULT_CANCELED or RESULT_OK */
|
2430
|
+
resultCode: number
|
2431
|
+
/** The data to propagate back to the originating activity. */
|
2432
|
+
data?: Record<string, {}>
|
2433
|
+
}
|
2434
|
+
|
2435
|
+
export type CanOpenThirdAppBean = {
|
2436
|
+
isCanOpen?: boolean
|
2437
|
+
}
|
2438
|
+
|
2439
|
+
export type OpenDefaultBrowserUrlBean = {
|
2440
|
+
/** 要打开的url */
|
2441
|
+
url: string
|
2442
|
+
}
|
2443
|
+
|
1358
2444
|
export type PayInfoBean = {
|
1359
2445
|
/**
|
1360
2446
|
* 支付方式
|
@@ -1465,7 +2551,7 @@ declare namespace ty {
|
|
1465
2551
|
* miniProgram:微信小程序分享内容
|
1466
2552
|
*/
|
1467
2553
|
contentType: string
|
1468
|
-
/** recipients
|
2554
|
+
/** recipients 邮件收件人/短信接收人 */
|
1469
2555
|
recipients?: string[]
|
1470
2556
|
/** imagePath 图片路径 */
|
1471
2557
|
imagePath?: string
|
@@ -1577,6 +2663,243 @@ declare namespace ty {
|
|
1577
2663
|
orientation: number
|
1578
2664
|
}
|
1579
2665
|
|
2666
|
+
export type WechatSupport = {
|
2667
|
+
/** 是否支持微信绑定 */
|
2668
|
+
isSupport: boolean
|
2669
|
+
}
|
2670
|
+
|
2671
|
+
export type MiniApp = {
|
2672
|
+
/** 小程序原始 appId */
|
2673
|
+
miniAppId: string
|
2674
|
+
/** 小程序路径 */
|
2675
|
+
path: string
|
2676
|
+
/**
|
2677
|
+
* mini program Type:
|
2678
|
+
* 0: 正式版 MINIPTOGRAM_TYPE_RELEASE
|
2679
|
+
* 1: 测试版 MINIPROGRAM_TYPE_TEST
|
2680
|
+
* 2: 预览版 MINIPROGRAM_TYPE_PREVIEW
|
2681
|
+
*/
|
2682
|
+
miniProgramType: number
|
2683
|
+
}
|
2684
|
+
|
2685
|
+
export type Result = {
|
2686
|
+
/** 结果 */
|
2687
|
+
result: boolean
|
2688
|
+
}
|
2689
|
+
|
2690
|
+
export type Call = {
|
2691
|
+
/** 设备id */
|
2692
|
+
targetId: string
|
2693
|
+
/**
|
2694
|
+
* 超时时间,单位秒
|
2695
|
+
* note: 不要传时间戳
|
2696
|
+
*/
|
2697
|
+
timeout: number
|
2698
|
+
/** 通话业务参数 例如linux中控 {"channelType": 1, "category": "dgnzk"} */
|
2699
|
+
extra: Record<string, any>
|
2700
|
+
}
|
2701
|
+
|
2702
|
+
/**
|
2703
|
+
* AI语音助手管理器
|
2704
|
+
*/
|
2705
|
+
interface GetAsrListenerManagerTask {
|
2706
|
+
/**
|
2707
|
+
* 状态
|
2708
|
+
*/
|
2709
|
+
getAsrActive(params: {
|
2710
|
+
complete?: () => void
|
2711
|
+
success?: (params: {
|
2712
|
+
/** 状态 */
|
2713
|
+
isActive: boolean
|
2714
|
+
}) => void
|
2715
|
+
fail?: (params: {
|
2716
|
+
errorMsg: string
|
2717
|
+
errorCode: string | number
|
2718
|
+
innerError: {
|
2719
|
+
errorCode: string | number
|
2720
|
+
errorMsg: string
|
2721
|
+
}
|
2722
|
+
}) => void
|
2723
|
+
}): void
|
2724
|
+
|
2725
|
+
/**
|
2726
|
+
* 关闭麦克风,关闭后识音要等到全部识别完成才结束
|
2727
|
+
*/
|
2728
|
+
stopDetect(params: {
|
2729
|
+
complete?: () => void
|
2730
|
+
success?: (params: null) => void
|
2731
|
+
fail?: (params: {
|
2732
|
+
errorMsg: string
|
2733
|
+
errorCode: string | number
|
2734
|
+
innerError: {
|
2735
|
+
errorCode: string | number
|
2736
|
+
errorMsg: string
|
2737
|
+
}
|
2738
|
+
}) => void
|
2739
|
+
}): void
|
2740
|
+
|
2741
|
+
/**
|
2742
|
+
* 关闭麦克风,关闭后识音要等到全部识别完成才结束
|
2743
|
+
*/
|
2744
|
+
startDetect(params: {
|
2745
|
+
complete?: () => void
|
2746
|
+
success?: (params: null) => void
|
2747
|
+
fail?: (params: {
|
2748
|
+
errorMsg: string
|
2749
|
+
errorCode: string | number
|
2750
|
+
innerError: {
|
2751
|
+
errorCode: string | number
|
2752
|
+
errorMsg: string
|
2753
|
+
}
|
2754
|
+
}) => void
|
2755
|
+
}): void
|
2756
|
+
|
2757
|
+
/**
|
2758
|
+
* 开始监听 + 识音
|
2759
|
+
*/
|
2760
|
+
onDetect(
|
2761
|
+
listener: (params: {
|
2762
|
+
/** managerId */
|
2763
|
+
managerId: number
|
2764
|
+
/** 拾音状态 0. 未开启 1.进行中 2.结束 3.发送错误 */
|
2765
|
+
state: number
|
2766
|
+
/** 语言转换内容 */
|
2767
|
+
text: string
|
2768
|
+
/** 错误码 0. 录音时间太短 */
|
2769
|
+
errorCode: number
|
2770
|
+
}) => void
|
2771
|
+
): void
|
2772
|
+
|
2773
|
+
/**
|
2774
|
+
* 取消监听
|
2775
|
+
*/
|
2776
|
+
offDetect(
|
2777
|
+
listener: (params: {
|
2778
|
+
/** managerId */
|
2779
|
+
managerId: number
|
2780
|
+
/** 拾音状态 0. 未开启 1.进行中 2.结束 3.发送错误 */
|
2781
|
+
state: number
|
2782
|
+
/** 语言转换内容 */
|
2783
|
+
text: string
|
2784
|
+
/** 错误码 0. 录音时间太短 */
|
2785
|
+
errorCode: number
|
2786
|
+
}) => void
|
2787
|
+
): void
|
2788
|
+
}
|
2789
|
+
export function getAsrListenerManager(params: {
|
2790
|
+
/** 家庭id */
|
2791
|
+
homeId: string
|
2792
|
+
/** 码率,eg:u律传8000,pcm传16000 */
|
2793
|
+
sampleRate: number
|
2794
|
+
/** 通道, eg:1 */
|
2795
|
+
channels: number
|
2796
|
+
/** 编码格式,eg:ThingAudioAsrCodeTypePCM = 0 ,ThingAudioAsrCodeTypePCMU = 1 */
|
2797
|
+
codec: string
|
2798
|
+
/** 云端asr解析选项,参考:https://wiki.tuya-inc.com:7799/page/1400707433826881594#5A14F9, 注意不要设置其他跟文本无关的参数,本检测只会处理跟文本相关的数据,nlp,skill,tts不包含。 */
|
2799
|
+
options: string
|
2800
|
+
complete?: () => void
|
2801
|
+
success?: (params: null) => void
|
2802
|
+
fail?: (params: {
|
2803
|
+
errorMsg: string
|
2804
|
+
errorCode: string | number
|
2805
|
+
innerError: {
|
2806
|
+
errorCode: string | number
|
2807
|
+
errorMsg: string
|
2808
|
+
}
|
2809
|
+
}) => void
|
2810
|
+
}): GetAsrListenerManagerTask
|
2811
|
+
|
2812
|
+
/**
|
2813
|
+
* AI语音助手管理器
|
2814
|
+
*/
|
2815
|
+
interface GetLogManagerTask {
|
2816
|
+
/**
|
2817
|
+
* log日志
|
2818
|
+
*/
|
2819
|
+
log(params: {
|
2820
|
+
/** 单条日志不要过10k */
|
2821
|
+
message: string
|
2822
|
+
complete?: () => void
|
2823
|
+
success?: (params: null) => void
|
2824
|
+
fail?: (params: {
|
2825
|
+
errorMsg: string
|
2826
|
+
errorCode: string | number
|
2827
|
+
innerError: {
|
2828
|
+
errorCode: string | number
|
2829
|
+
errorMsg: string
|
2830
|
+
}
|
2831
|
+
}) => void
|
2832
|
+
}): void
|
2833
|
+
|
2834
|
+
/**
|
2835
|
+
* error日志
|
2836
|
+
*/
|
2837
|
+
error(params: {
|
2838
|
+
/** 单条日志不要过10k */
|
2839
|
+
message: string
|
2840
|
+
complete?: () => void
|
2841
|
+
success?: (params: null) => void
|
2842
|
+
fail?: (params: {
|
2843
|
+
errorMsg: string
|
2844
|
+
errorCode: string | number
|
2845
|
+
innerError: {
|
2846
|
+
errorCode: string | number
|
2847
|
+
errorMsg: string
|
2848
|
+
}
|
2849
|
+
}) => void
|
2850
|
+
}): void
|
2851
|
+
|
2852
|
+
/**
|
2853
|
+
* feedback日志
|
2854
|
+
*/
|
2855
|
+
feedback(params: {
|
2856
|
+
/** 单条日志不要过10k */
|
2857
|
+
message: string
|
2858
|
+
complete?: () => void
|
2859
|
+
success?: (params: null) => void
|
2860
|
+
fail?: (params: {
|
2861
|
+
errorMsg: string
|
2862
|
+
errorCode: string | number
|
2863
|
+
innerError: {
|
2864
|
+
errorCode: string | number
|
2865
|
+
errorMsg: string
|
2866
|
+
}
|
2867
|
+
}) => void
|
2868
|
+
}): void
|
2869
|
+
|
2870
|
+
/**
|
2871
|
+
* debug日志
|
2872
|
+
*/
|
2873
|
+
debug(params: {
|
2874
|
+
/** 单条日志不要过10k */
|
2875
|
+
message: string
|
2876
|
+
complete?: () => void
|
2877
|
+
success?: (params: null) => void
|
2878
|
+
fail?: (params: {
|
2879
|
+
errorMsg: string
|
2880
|
+
errorCode: string | number
|
2881
|
+
innerError: {
|
2882
|
+
errorCode: string | number
|
2883
|
+
errorMsg: string
|
2884
|
+
}
|
2885
|
+
}) => void
|
2886
|
+
}): void
|
2887
|
+
}
|
2888
|
+
export function getLogManager(params: {
|
2889
|
+
/** 自定义标记 */
|
2890
|
+
tag: string
|
2891
|
+
complete?: () => void
|
2892
|
+
success?: (params: null) => void
|
2893
|
+
fail?: (params: {
|
2894
|
+
errorMsg: string
|
2895
|
+
errorCode: string | number
|
2896
|
+
innerError: {
|
2897
|
+
errorCode: string | number
|
2898
|
+
errorMsg: string
|
2899
|
+
}
|
2900
|
+
}) => void
|
2901
|
+
}): GetLogManagerTask
|
2902
|
+
|
1580
2903
|
/**
|
1581
2904
|
* EventChannel
|
1582
2905
|
*/
|