@cg-devcenter/rtc-fpnn-webjs-sdk 1.0.0-cg.5 → 1.0.0-cg.6

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.
@@ -0,0 +1,76 @@
1
+ # RTM Client Websocket SDK ValueAdded API Docs
2
+
3
+ ## Index
4
+
5
+ [TOC]
6
+
7
+ ## Apis
8
+
9
+ * `translate(originalMessage, originalLanguage, targetLanguage, type, profanity, timeout, callback)`: 翻译消息
10
+ * `originalMessage`: **(Required | stirng)** 待翻译的原始消息
11
+ * `originalLanguage`: **(Optional | string)** 待翻译的消息的语言类型, 可为 `undefined`
12
+ * `targetLanguage`: **(Required | string)** 本次翻译的目标语言类型
13
+ * `type`: **(Required | string)** 可选值为chat或mail。如未指定,则默认使用chat
14
+ * `profanity`: **(Required | string)** 敏感语过滤。设置为以下3项之一: off, stop, censor,默认:off
15
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
16
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
17
+ * `err`: **(Error)**
18
+ * `data`: **(object[source:string, target:string, targetText:string, sourceText:string])**
19
+
20
+ * `textCheck(text, timeout, callback)`: 文本审核
21
+ * `text`: **(Required | string)** 文本
22
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
23
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
24
+ * `err`: **(Error)**
25
+ * `data`: **({ result: int32, ?text: string,?tags:list<int32>,?wlist:list<string> })**
26
+ * `result`: 0: 通过,2,不通过
27
+ * `text`: 敏感词过滤后的文本内容,含有的敏感词会被替换为*,如果没有被标星,则无此字段
28
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
29
+ * `wlist`: 敏感词列表
30
+
31
+ * `imageCheck(image, type, timeout, callback)`: 图片审核
32
+ * `image`: **(Required | string)** 图片的url 或者内容
33
+ * `type`: **(Required | number)** 1, url, 2, 内容
34
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
35
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
36
+ * `err`: **(Error)**
37
+ * `data`: **({ result: int32, ?tags:list<int32> })**
38
+ * `result`: 0: 通过,2,不通过
39
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
40
+
41
+ * `audioCheck(audio, type, lang, codec, srate, timeout, callback)`: 音频审核
42
+ * `audio`: **(Required | string)** 音频的url 或者内容
43
+ * `type`: **(Required | number)** 1, url, 2, 内容
44
+ * `lang`: **(Required | string)** 音频语言
45
+ * `codec`: **(Optional | string)** 音频b编码, 默认AMR_WB
46
+ * `srate`: **(Optional | number)** 音频采样率, 16000
47
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
48
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
49
+ * `err`: **(Error)**
50
+ * `data`: **({ result: int32, ?tags:list<int32> })**
51
+ * `result`: 0: 通过,2,不通过
52
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
53
+
54
+ * `videoCheck(video, type, videoName, timeout, callback)`: 视频审核
55
+ * `video`: **(Required | string)** 视频的url 或者内容
56
+ * `type`: **(Required | number)** 1, url, 2, 内容
57
+ * `videoName`: **(Required | string)** 音频文件名
58
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
59
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
60
+ * `err`: **(Error)**
61
+ * `data`: **({ result: int32, ?tags:list<int32> })**
62
+ * `result`: 0: 通过,2,不通过
63
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
64
+
65
+ * `speech2Text(audio, type, lang, codec, srate, timeout, callback)`: 语音转文字
66
+ * `audio`: **(Required | string)** 音频的url 或者内容
67
+ * `type`: **(Required | number)** 1, url, 2, 内容
68
+ * `lang`: **(Required | string)** 音频语言
69
+ * `codec`: **(Optional | string)** 音频b编码, 默认AMR_WB
70
+ * `srate`: **(Optional | number)** 音频采样率, 16000
71
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
72
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
73
+ * `err`: **(Error)**
74
+ * `data`: **({ text: string, lang: string })**
75
+ * `text`: 识别的结果
76
+ * `lang`: 识别的语言
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cg-devcenter/rtc-fpnn-webjs-sdk",
3
- "version": "1.0.0-cg.5",
3
+ "version": "1.0.0-cg.6",
4
4
  "description": "Browser RTM SDK with FPNN and TLV v1 MessagePack WebSocket transports",
5
5
  "main": "./dist/rtm.min.js",
6
6
  "browser": "./dist/rtm.min.js",
@@ -14,7 +14,18 @@
14
14
  "docs/CAPABILITIES.md",
15
15
  "docs/TLV_LIVE_E2E_TEST.md",
16
16
  "docs/USAGE.md",
17
- "docs/PROTOCOL_MIGRATION.md"
17
+ "docs/PROTOCOL_MIGRATION.md",
18
+ "docs/Users.md",
19
+ "docs/Groups.md",
20
+ "docs/Rooms.md",
21
+ "docs/Messages.md",
22
+ "docs/Chat.md",
23
+ "docs/Data.md",
24
+ "docs/System.md",
25
+ "docs/Files.md",
26
+ "docs/Friends.md",
27
+ "docs/ValueAdded.md",
28
+ "docs/EventProcess.md"
18
29
  ],
19
30
  "exports": {
20
31
  ".": {
@@ -36,7 +47,7 @@
36
47
  "scripts": {
37
48
  "build": "webpack --mode production && webpack --config webpack.shared-worker.config.js --mode production",
38
49
  "test": "npm run test:unit && npm run test:package",
39
- "test:unit": "node test/tlv/run.js && node test/tlv/documentation.js",
50
+ "test:unit": "node test/tlv/run.js && node test/tlv/documentation.js && node test/demo-workflows.js && node test/vue-demo-state.js",
40
51
  "test:package": "npm run build && node test/package-smoke.js",
41
52
  "demo:tlv-basic": "node examples/tlv-basic-demo/server.js",
42
53
  "demo:shared-worker": "node examples/shared-worker-demo/server.js",