@cg-devcenter/rtc-fpnn-webjs-sdk 1.0.0-cg.10

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/docs/Users.md ADDED
@@ -0,0 +1,48 @@
1
+ # RTM Client Websocket SDK User API Docs
2
+
3
+ ## Index
4
+
5
+ [TOC]
6
+
7
+ ## Apis
8
+
9
+ **协议范围:** 本页记录 FPNN 兼容 API 的参数和事件名称;列出的方法不一定都能通过 TLV v1 调用。请先核对 [TLV v1 支持矩阵](USAGE.md#6-tlv-v1-api-支持矩阵);两协议的 method、URI 和 Push 对照见[协议迁移说明](PROTOCOL_MIGRATION.md)。
10
+
11
+ * `getUserGroups(timeout, callback)`: 获取用户所在的Group
12
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
13
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
14
+ * `err`: **(Error)**
15
+ * `data`: **(array[Int64])**
16
+
17
+ * `getOnlineUsers(uids, timeout, callback)`: 获取在线用户
18
+ * `uids`: **(Required | array[Int64])** 多个用户 id
19
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
20
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
21
+ * `err`: **(Error)**
22
+ * `data`: **(array[Int64])**
23
+
24
+ * `setUserInfo(oinfo, pinfo, timeout, callback) `: 设置用户信息
25
+ * `oinfo`: **(Optional | string)** 公开信息
26
+ * `pinfo`: **(Optional | string)** 私有信息
27
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
28
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
29
+ * `err`: **(object[mid:Int64, error:Error])**
30
+ * `data`: **(object)**
31
+
32
+ * `getUserInfo(timeout, callback) `: 获取用户信息
33
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
34
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
35
+ * `err`: **(object[mid:Int64, error:Error])**
36
+ * `data`: **(object[oinfo:string, pinfo:string])**
37
+
38
+ * `getUserOpenInfo(uids, timeout, callback) `: 获取用户信息
39
+ * `uids`: **(Required | array(Int64))** 用户id列表
40
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
41
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
42
+ * `err`: **(object[mid:Int64, error:Error])**
43
+ * `data`: **(object[info:map<string, string>])**
44
+
45
+
46
+
47
+
48
+
@@ -0,0 +1,82 @@
1
+ # RTM Client Websocket SDK ValueAdded API Docs
2
+
3
+ ## Index
4
+
5
+ [TOC]
6
+
7
+ ## Apis
8
+
9
+ **协议范围:** 本页记录 FPNN 兼容 API 的参数和事件名称;列出的方法不一定都能通过 TLV v1 调用。请先核对 [TLV v1 支持矩阵](USAGE.md#6-tlv-v1-api-支持矩阵);两协议的 method、URI 和 Push 对照见[协议迁移说明](PROTOCOL_MIGRATION.md)。审核接口中的 `strategyId` 必须占据其参数位置;只传 timeout 时先传 `undefined`,例如 `imageCheck(image, type, undefined, timeout, callback)`。
10
+
11
+ * `translate(originalMessage, originalLanguage, targetLanguage, type, profanity, timeout, callback)`: 翻译消息
12
+ * `originalMessage`: **(Required | stirng)** 待翻译的原始消息
13
+ * `originalLanguage`: **(Optional | string)** 待翻译的消息的语言类型, 可为 `undefined`
14
+ * `targetLanguage`: **(Required | string)** 本次翻译的目标语言类型
15
+ * `type`: **(Required | string)** 可选值为chat或mail。如未指定,则默认使用chat
16
+ * `profanity`: **(Required | string)** 敏感语过滤。设置为以下3项之一: off, stop, censor,默认:off
17
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
18
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
19
+ * `err`: **(Error)**
20
+ * `data`: **(object[source:string, target:string, targetText:string, sourceText:string])**
21
+
22
+ * `textCheck(text, strategyId, timeout, callback)`: 文本审核;兼容简写 `textCheck(text, timeout, callback)`。
23
+ * `text`: **(Required | string)** 文本
24
+ * `strategyId`: **(Optional)** 审核策略 ID;不使用时传 `undefined`,旧式 timeout 简写不需要此参数
25
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
26
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
27
+ * `err`: **(Error)**
28
+ * `data`: **({ result: int32, ?text: string,?tags:list<int32>,?wlist:list<string> })**
29
+ * `result`: 0: 通过,2,不通过
30
+ * `text`: 敏感词过滤后的文本内容,含有的敏感词会被替换为*,如果没有被标星,则无此字段
31
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
32
+ * `wlist`: 敏感词列表
33
+
34
+ * `imageCheck(image, type, strategyId, timeout, callback)`: 图片审核
35
+ * `image`: **(Required | string)** 图片的url 或者内容
36
+ * `type`: **(Required | number)** 1, url, 2, 内容
37
+ * `strategyId`: **(Optional)** 审核策略 ID;不使用时传 `undefined` 保留参数位置
38
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
39
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
40
+ * `err`: **(Error)**
41
+ * `data`: **({ result: int32, ?tags:list<int32> })**
42
+ * `result`: 0: 通过,2,不通过
43
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
44
+
45
+ * `audioCheck(audio, type, lang, codec, srate, strategyId, timeout, callback)`: 音频审核
46
+ * `audio`: **(Required | string)** 音频的url 或者内容
47
+ * `type`: **(Required | number)** 1, url, 2, 内容
48
+ * `lang`: **(Required | string)** 音频语言
49
+ * `codec`: **(Optional | string)** 音频b编码, 默认AMR_WB
50
+ * `srate`: **(Optional | number)** 音频采样率, 16000
51
+ * `strategyId`: **(Optional)** 审核策略 ID;不使用时传 `undefined` 保留参数位置
52
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
53
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
54
+ * `err`: **(Error)**
55
+ * `data`: **({ result: int32, ?tags:list<int32> })**
56
+ * `result`: 0: 通过,2,不通过
57
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
58
+
59
+ * `videoCheck(video, type, videoName, strategyId, timeout, callback)`: 视频审核
60
+ * `video`: **(Required | string)** 视频的url 或者内容
61
+ * `type`: **(Required | number)** 1, url, 2, 内容
62
+ * `videoName`: **(Required | string)** 音频文件名
63
+ * `strategyId`: **(Optional)** 审核策略 ID;不使用时传 `undefined` 保留参数位置
64
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
65
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
66
+ * `err`: **(Error)**
67
+ * `data`: **({ result: int32, ?tags:list<int32> })**
68
+ * `result`: 0: 通过,2,不通过
69
+ * `tags`: 触发的分类,比如涉黄涉政等等,具体见文本审核分类
70
+
71
+ * `speech2Text(audio, type, lang, codec, srate, timeout, callback)`: 语音转文字
72
+ * `audio`: **(Required | string)** 音频的url 或者内容
73
+ * `type`: **(Required | number)** 1, url, 2, 内容
74
+ * `lang`: **(Required | string)** 音频语言
75
+ * `codec`: **(Optional | string)** 音频b编码, 默认AMR_WB
76
+ * `srate`: **(Optional | number)** 音频采样率, 16000
77
+ * `timeout`: **(Optional | number)** 超时时间(ms), 默认: `20 * 1000`
78
+ * `callback`: **(Optional | function)** 回调方法, `callback(err, data)`
79
+ * `err`: **(Error)**
80
+ * `data`: **({ text: string, lang: string })**
81
+ * `text`: 识别的结果
82
+ * `lang`: 识别的语言
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@cg-devcenter/rtc-fpnn-webjs-sdk",
3
+ "version": "1.0.0-cg.10",
4
+ "description": "Browser RTM SDK with FPNN and TLV v1 MessagePack WebSocket transports",
5
+ "main": "./dist/rtm.min.js",
6
+ "browser": "./dist/rtm.min.js",
7
+ "module": "./dist/rtm.mjs",
8
+ "types": "./dist/rtm.d.ts",
9
+ "unpkg": "./dist/rtm.min.js",
10
+ "jsdelivr": "./dist/rtm.min.js",
11
+ "files": [
12
+ "dist",
13
+ "docs/TLV.md",
14
+ "docs/TLV_CONTRACT.md",
15
+ "docs/CAPABILITIES.md",
16
+ "docs/USAGE.md",
17
+ "docs/RTM_MIGRATION.md",
18
+ "docs/LEGACY_RTM_TLV_COMPATIBILITY.md",
19
+ "docs/PROTOCOL_MIGRATION.md",
20
+ "docs/Users.md",
21
+ "docs/Groups.md",
22
+ "docs/Rooms.md",
23
+ "docs/Messages.md",
24
+ "docs/Chat.md",
25
+ "docs/Data.md",
26
+ "docs/System.md",
27
+ "docs/Files.md",
28
+ "docs/Friends.md",
29
+ "docs/ValueAdded.md",
30
+ "docs/EventProcess.md"
31
+ ],
32
+ "exports": {
33
+ ".": {
34
+ "import": {
35
+ "types": "./dist/rtm.d.mts",
36
+ "default": "./dist/rtm.mjs"
37
+ },
38
+ "require": {
39
+ "types": "./dist/rtm.d.cts",
40
+ "default": "./dist/rtm.min.js"
41
+ }
42
+ },
43
+ "./vite": {
44
+ "types": "./dist/rtm.vite.d.ts",
45
+ "import": "./dist/rtm.vite.mjs",
46
+ "default": "./dist/rtm.vite.mjs"
47
+ },
48
+ "./vite-plugin": {
49
+ "types": "./dist/rtm.vite-plugin.d.mts",
50
+ "import": "./dist/rtm.vite-plugin.mjs",
51
+ "default": "./dist/rtm.vite-plugin.mjs"
52
+ },
53
+ "./webpack4": {
54
+ "types": "./dist/rtm.webpack4-plugin.d.cts",
55
+ "require": "./dist/rtm.webpack4-plugin.cjs",
56
+ "default": "./dist/rtm.webpack4-plugin.cjs"
57
+ },
58
+ "./shared-worker": "./dist/rtm.shared-worker.js",
59
+ "./dist/*": "./dist/*",
60
+ "./package.json": "./package.json"
61
+ },
62
+ "author": "Dixun",
63
+ "license": "MIT",
64
+ "scripts": {
65
+ "prebuild": "node scripts/check-build-node.mjs",
66
+ "build": "webpack --mode production && webpack --config webpack.shared-worker.config.js --mode production && node scripts/build-modern.mjs",
67
+ "postbuild": "npm run capabilities:generate",
68
+ "capabilities:generate": "node scripts/generate-capabilities-catalog.mjs",
69
+ "capabilities:check": "node scripts/generate-capabilities-catalog.mjs --check",
70
+ "test": "npm run test:unit && npm run test:package",
71
+ "test:unit": "node test/tlv/run.js && node test/tlv/documentation.js && node test/migration-compatibility.js && node test/legacy-rtm-compatibility.js && node test/demo-workflows.js && node test/vue-demo-state.js && node test/sdk-capabilities.mjs",
72
+ "test:package": "npm run build && npm run capabilities:check && node test/package-files.js && node test/package-tarball.js && node test/package-smoke.js && node test/package-esm-smoke.mjs && node test/package-webpack4.js && npm run test:types",
73
+ "test:types": "tsc --noEmit --module NodeNext --moduleResolution NodeNext --target ES2020 test/package-types/esm.mts test/package-types/cjs.cts",
74
+ "demo:tlv-basic": "node examples/tlv-basic-demo/server.js",
75
+ "demo:shared-worker": "node examples/shared-worker-demo/server.js",
76
+ "prepack": "npm run build"
77
+ },
78
+ "devDependencies": {
79
+ "babel-core": "^6.26.3",
80
+ "babel-loader": "^7.1.5",
81
+ "babel-preset-env": "^1.7.0",
82
+ "babel-preset-es2015": "^6.24.1",
83
+ "babel-preset-stage-2": "^6.24.1",
84
+ "buffer": "^5.1.0",
85
+ "esbuild": "^0.25.12",
86
+ "int64-buffer": "^0.1.10",
87
+ "typescript": "^5.8.3",
88
+ "webpack": "^4.1.1",
89
+ "webpack-cli": "^3.3.12"
90
+ },
91
+ "repository": null,
92
+ "homepage": null
93
+ }