@inter-digital/wasm-client-sdk 3.8.3-patch.12 → 3.8.3-patch.14
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/LICENSE +201 -661
- package/assets/openIM.wasm +0 -0
- package/assets/version +1 -1
- package/assets/wasm_exec.js +1 -15
- package/lib/index.es.js +26 -45
- package/lib/index.js +25 -44
- package/lib/index.umd.js +25 -44
- package/lib/sdk/index.d.ts +7 -8
- package/lib/types/entity.d.ts +1 -2
- package/lib/types/enum.d.ts +0 -5
- package/lib/types/params.d.ts +13 -21
- package/lib/worker-legacy.js +1 -1
- package/lib/worker.js +1 -1
- package/package.json +1 -1
package/assets/openIM.wasm
CHANGED
|
Binary file
|
package/assets/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v3.8.3-patch.
|
|
1
|
+
v3.8.3-patch.3
|
package/assets/wasm_exec.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
if (!globalThis.fs) {
|
|
15
15
|
let outputBuf = "";
|
|
16
16
|
globalThis.fs = {
|
|
17
|
-
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1
|
|
17
|
+
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused
|
|
18
18
|
writeSync(fd, buf) {
|
|
19
19
|
outputBuf += decoder.decode(buf);
|
|
20
20
|
const nl = outputBuf.lastIndexOf("\n");
|
|
@@ -73,14 +73,6 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
if (!globalThis.path) {
|
|
77
|
-
globalThis.path = {
|
|
78
|
-
resolve(...pathSegments) {
|
|
79
|
-
return pathSegments.join("/");
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
76
|
if (!globalThis.crypto) {
|
|
85
77
|
throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
|
|
86
78
|
}
|
|
@@ -216,16 +208,10 @@
|
|
|
216
208
|
return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
|
|
217
209
|
}
|
|
218
210
|
|
|
219
|
-
const testCallExport = (a, b) => {
|
|
220
|
-
this._inst.exports.testExport0();
|
|
221
|
-
return this._inst.exports.testExport(a, b);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
211
|
const timeOrigin = Date.now() - performance.now();
|
|
225
212
|
this.importObject = {
|
|
226
213
|
_gotest: {
|
|
227
214
|
add: (a, b) => a + b,
|
|
228
|
-
callExport: testCallExport,
|
|
229
215
|
},
|
|
230
216
|
gojs: {
|
|
231
217
|
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
|
package/lib/index.es.js
CHANGED
|
@@ -490,13 +490,13 @@ function initWorker() {
|
|
|
490
490
|
? new URL('worker.js', import.meta.url)
|
|
491
491
|
: new URL('worker-legacy.js', import.meta.url);
|
|
492
492
|
if (isViteEnvironment) {
|
|
493
|
-
workerUrl = workerUrl.href.replace('.vite/deps', '@
|
|
493
|
+
workerUrl = workerUrl.href.replace('.vite/deps', '@inter-digital/wasm-client-sdk/lib');
|
|
494
494
|
}
|
|
495
495
|
if (isNuxtEnvironment) {
|
|
496
|
-
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@
|
|
496
|
+
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@inter-digital/wasm-client-sdk/lib');
|
|
497
497
|
}
|
|
498
498
|
if (isQuasarEnvironment) {
|
|
499
|
-
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@
|
|
499
|
+
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@inter-digital/wasm-client-sdk/lib');
|
|
500
500
|
}
|
|
501
501
|
worker = new Worker(workerUrl, {
|
|
502
502
|
type: isSupportModuleWorker ? 'module' : 'classic',
|
|
@@ -1012,12 +1012,6 @@ var MessageReceiveOptType;
|
|
|
1012
1012
|
MessageReceiveOptType[MessageReceiveOptType["NotReceive"] = 1] = "NotReceive";
|
|
1013
1013
|
MessageReceiveOptType[MessageReceiveOptType["NotNotify"] = 2] = "NotNotify";
|
|
1014
1014
|
})(MessageReceiveOptType || (MessageReceiveOptType = {}));
|
|
1015
|
-
var AddFriendPermission;
|
|
1016
|
-
(function (AddFriendPermission) {
|
|
1017
|
-
AddFriendPermission[AddFriendPermission["AddFriendAllowed"] = 0] = "AddFriendAllowed";
|
|
1018
|
-
AddFriendPermission[AddFriendPermission["AddFriendAllowedNoReview"] = 1] = "AddFriendAllowedNoReview";
|
|
1019
|
-
AddFriendPermission[AddFriendPermission["AddFriendDenied"] = 2] = "AddFriendDenied";
|
|
1020
|
-
})(AddFriendPermission || (AddFriendPermission = {}));
|
|
1021
1015
|
var AllowType;
|
|
1022
1016
|
(function (AllowType) {
|
|
1023
1017
|
AllowType[AllowType["Allowed"] = 0] = "Allowed";
|
|
@@ -1177,9 +1171,9 @@ class SDK extends Emitter {
|
|
|
1177
1171
|
this.goExisted = false;
|
|
1178
1172
|
this.tryParse = true;
|
|
1179
1173
|
this.isLogStandardOutput = true;
|
|
1180
|
-
this.
|
|
1174
|
+
this.init = async (params, operationID = v4()) => {
|
|
1181
1175
|
var _a, _b;
|
|
1182
|
-
this._logWrap(`SDK => (invoked by js) run
|
|
1176
|
+
this._logWrap(`SDK => (invoked by js) run init with args ${JSON.stringify({
|
|
1183
1177
|
params,
|
|
1184
1178
|
operationID,
|
|
1185
1179
|
})}`);
|
|
@@ -1214,7 +1208,17 @@ class SDK extends Emitter {
|
|
|
1214
1208
|
isExternalExtensions: params.isExternalExtensions || false,
|
|
1215
1209
|
};
|
|
1216
1210
|
this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
|
|
1217
|
-
window.initSDK(operationID, JSON.stringify(config));
|
|
1211
|
+
return window.initSDK(operationID, JSON.stringify(config));
|
|
1212
|
+
};
|
|
1213
|
+
this.login = async (params, operationID = v4()) => {
|
|
1214
|
+
this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
|
|
1215
|
+
params,
|
|
1216
|
+
operationID,
|
|
1217
|
+
})}`);
|
|
1218
|
+
// If initialization config is provided, run init first
|
|
1219
|
+
if ('platformID' in params) {
|
|
1220
|
+
await this.init(params, operationID);
|
|
1221
|
+
}
|
|
1218
1222
|
return await window.login(operationID, params.userID, params.token);
|
|
1219
1223
|
};
|
|
1220
1224
|
this.logout = (operationID = v4()) => {
|
|
@@ -1684,21 +1688,11 @@ class SDK extends Emitter {
|
|
|
1684
1688
|
this.getSpecifiedFriendsInfo = (data, operationID = v4()) => {
|
|
1685
1689
|
return this._invoker('getSpecifiedFriendsInfo', window.getSpecifiedFriendsInfo, [operationID, JSON.stringify(data.friendUserIDList), data.filterBlack]);
|
|
1686
1690
|
};
|
|
1687
|
-
this.getFriendApplicationListAsRecipient = (
|
|
1688
|
-
|
|
1689
|
-
offset: 0,
|
|
1690
|
-
count: 0,
|
|
1691
|
-
}, operationID = v4()) => {
|
|
1692
|
-
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1691
|
+
this.getFriendApplicationListAsRecipient = (operationID = v4()) => {
|
|
1692
|
+
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID]);
|
|
1693
1693
|
};
|
|
1694
|
-
this.getFriendApplicationListAsApplicant = (
|
|
1695
|
-
|
|
1696
|
-
count: 0,
|
|
1697
|
-
}, operationID = v4()) => {
|
|
1698
|
-
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1699
|
-
};
|
|
1700
|
-
this.getFriendApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1701
|
-
return this._invoker('getFriendApplicationUnhandledCount ', window.getFriendApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1694
|
+
this.getFriendApplicationListAsApplicant = (operationID = v4()) => {
|
|
1695
|
+
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID]);
|
|
1702
1696
|
};
|
|
1703
1697
|
this.getFriendList = (filterBlack = false, operationID = v4()) => {
|
|
1704
1698
|
return this._invoker('getFriendList ', window.getFriendList, [operationID, filterBlack]);
|
|
@@ -1937,24 +1931,11 @@ class SDK extends Emitter {
|
|
|
1937
1931
|
data.newOwnerUserID,
|
|
1938
1932
|
]);
|
|
1939
1933
|
};
|
|
1940
|
-
this.getGroupApplicationListAsApplicant = (
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
}, operationID = v4()) => {
|
|
1946
|
-
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1947
|
-
};
|
|
1948
|
-
this.getGroupApplicationListAsRecipient = (data = {
|
|
1949
|
-
groupID: [],
|
|
1950
|
-
handleResults: [],
|
|
1951
|
-
offset: 0,
|
|
1952
|
-
count: 0,
|
|
1953
|
-
}, operationID = v4()) => {
|
|
1954
|
-
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1955
|
-
};
|
|
1956
|
-
this.getGroupApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1957
|
-
return this._invoker('getGroupApplicationUnhandledCount ', window.getGroupApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1934
|
+
this.getGroupApplicationListAsApplicant = (operationID = v4()) => {
|
|
1935
|
+
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID]);
|
|
1936
|
+
};
|
|
1937
|
+
this.getGroupApplicationListAsRecipient = (operationID = v4()) => {
|
|
1938
|
+
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID]);
|
|
1958
1939
|
};
|
|
1959
1940
|
this.acceptGroupApplication = (data, operationID = v4()) => {
|
|
1960
1941
|
return this._invoker('acceptGroupApplication ', window.acceptGroupApplication, [operationID, data.groupID, data.fromUserID, data.handleMsg]);
|
|
@@ -2212,4 +2193,4 @@ var indexeddbMainThreadWorkerB24e7a21 = /*#__PURE__*/Object.freeze({
|
|
|
2212
2193
|
'default': WorkerFactory
|
|
2213
2194
|
});
|
|
2214
2195
|
|
|
2215
|
-
export {
|
|
2196
|
+
export { AllowType, ApplicationHandleResult, CbEvents, GroupAtType, GroupJoinSource, GroupMemberFilter, GroupMemberRole, GroupMessageReaderFilter, GroupStatus, GroupType, GroupVerificationType, LogLevel, LoginStatus, MessageReceiveOptType, MessageStatus, MessageType, OnlineState, Platform, Relationship, SessionType, ViewType, getSDK };
|
package/lib/index.js
CHANGED
|
@@ -494,13 +494,13 @@ function initWorker() {
|
|
|
494
494
|
? new URL('worker.js', (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href)))
|
|
495
495
|
: new URL('worker-legacy.js', (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href)));
|
|
496
496
|
if (isViteEnvironment) {
|
|
497
|
-
workerUrl = workerUrl.href.replace('.vite/deps', '@
|
|
497
|
+
workerUrl = workerUrl.href.replace('.vite/deps', '@inter-digital/wasm-client-sdk/lib');
|
|
498
498
|
}
|
|
499
499
|
if (isNuxtEnvironment) {
|
|
500
|
-
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@
|
|
500
|
+
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@inter-digital/wasm-client-sdk/lib');
|
|
501
501
|
}
|
|
502
502
|
if (isQuasarEnvironment) {
|
|
503
|
-
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@
|
|
503
|
+
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@inter-digital/wasm-client-sdk/lib');
|
|
504
504
|
}
|
|
505
505
|
worker = new Worker(workerUrl, {
|
|
506
506
|
type: isSupportModuleWorker ? 'module' : 'classic',
|
|
@@ -1016,12 +1016,6 @@ exports.MessageReceiveOptType = void 0;
|
|
|
1016
1016
|
MessageReceiveOptType[MessageReceiveOptType["NotReceive"] = 1] = "NotReceive";
|
|
1017
1017
|
MessageReceiveOptType[MessageReceiveOptType["NotNotify"] = 2] = "NotNotify";
|
|
1018
1018
|
})(exports.MessageReceiveOptType || (exports.MessageReceiveOptType = {}));
|
|
1019
|
-
exports.AddFriendPermission = void 0;
|
|
1020
|
-
(function (AddFriendPermission) {
|
|
1021
|
-
AddFriendPermission[AddFriendPermission["AddFriendAllowed"] = 0] = "AddFriendAllowed";
|
|
1022
|
-
AddFriendPermission[AddFriendPermission["AddFriendAllowedNoReview"] = 1] = "AddFriendAllowedNoReview";
|
|
1023
|
-
AddFriendPermission[AddFriendPermission["AddFriendDenied"] = 2] = "AddFriendDenied";
|
|
1024
|
-
})(exports.AddFriendPermission || (exports.AddFriendPermission = {}));
|
|
1025
1019
|
exports.AllowType = void 0;
|
|
1026
1020
|
(function (AllowType) {
|
|
1027
1021
|
AllowType[AllowType["Allowed"] = 0] = "Allowed";
|
|
@@ -1181,9 +1175,9 @@ class SDK extends Emitter {
|
|
|
1181
1175
|
this.goExisted = false;
|
|
1182
1176
|
this.tryParse = true;
|
|
1183
1177
|
this.isLogStandardOutput = true;
|
|
1184
|
-
this.
|
|
1178
|
+
this.init = async (params, operationID = v4()) => {
|
|
1185
1179
|
var _a, _b;
|
|
1186
|
-
this._logWrap(`SDK => (invoked by js) run
|
|
1180
|
+
this._logWrap(`SDK => (invoked by js) run init with args ${JSON.stringify({
|
|
1187
1181
|
params,
|
|
1188
1182
|
operationID,
|
|
1189
1183
|
})}`);
|
|
@@ -1218,7 +1212,17 @@ class SDK extends Emitter {
|
|
|
1218
1212
|
isExternalExtensions: params.isExternalExtensions || false,
|
|
1219
1213
|
};
|
|
1220
1214
|
this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
|
|
1221
|
-
window.initSDK(operationID, JSON.stringify(config));
|
|
1215
|
+
return window.initSDK(operationID, JSON.stringify(config));
|
|
1216
|
+
};
|
|
1217
|
+
this.login = async (params, operationID = v4()) => {
|
|
1218
|
+
this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
|
|
1219
|
+
params,
|
|
1220
|
+
operationID,
|
|
1221
|
+
})}`);
|
|
1222
|
+
// If initialization config is provided, run init first
|
|
1223
|
+
if ('platformID' in params) {
|
|
1224
|
+
await this.init(params, operationID);
|
|
1225
|
+
}
|
|
1222
1226
|
return await window.login(operationID, params.userID, params.token);
|
|
1223
1227
|
};
|
|
1224
1228
|
this.logout = (operationID = v4()) => {
|
|
@@ -1688,21 +1692,11 @@ class SDK extends Emitter {
|
|
|
1688
1692
|
this.getSpecifiedFriendsInfo = (data, operationID = v4()) => {
|
|
1689
1693
|
return this._invoker('getSpecifiedFriendsInfo', window.getSpecifiedFriendsInfo, [operationID, JSON.stringify(data.friendUserIDList), data.filterBlack]);
|
|
1690
1694
|
};
|
|
1691
|
-
this.getFriendApplicationListAsRecipient = (
|
|
1692
|
-
|
|
1693
|
-
offset: 0,
|
|
1694
|
-
count: 0,
|
|
1695
|
-
}, operationID = v4()) => {
|
|
1696
|
-
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1695
|
+
this.getFriendApplicationListAsRecipient = (operationID = v4()) => {
|
|
1696
|
+
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID]);
|
|
1697
1697
|
};
|
|
1698
|
-
this.getFriendApplicationListAsApplicant = (
|
|
1699
|
-
|
|
1700
|
-
count: 0,
|
|
1701
|
-
}, operationID = v4()) => {
|
|
1702
|
-
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1703
|
-
};
|
|
1704
|
-
this.getFriendApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1705
|
-
return this._invoker('getFriendApplicationUnhandledCount ', window.getFriendApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1698
|
+
this.getFriendApplicationListAsApplicant = (operationID = v4()) => {
|
|
1699
|
+
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID]);
|
|
1706
1700
|
};
|
|
1707
1701
|
this.getFriendList = (filterBlack = false, operationID = v4()) => {
|
|
1708
1702
|
return this._invoker('getFriendList ', window.getFriendList, [operationID, filterBlack]);
|
|
@@ -1941,24 +1935,11 @@ class SDK extends Emitter {
|
|
|
1941
1935
|
data.newOwnerUserID,
|
|
1942
1936
|
]);
|
|
1943
1937
|
};
|
|
1944
|
-
this.getGroupApplicationListAsApplicant = (
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
}, operationID = v4()) => {
|
|
1950
|
-
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1951
|
-
};
|
|
1952
|
-
this.getGroupApplicationListAsRecipient = (data = {
|
|
1953
|
-
groupID: [],
|
|
1954
|
-
handleResults: [],
|
|
1955
|
-
offset: 0,
|
|
1956
|
-
count: 0,
|
|
1957
|
-
}, operationID = v4()) => {
|
|
1958
|
-
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1959
|
-
};
|
|
1960
|
-
this.getGroupApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1961
|
-
return this._invoker('getGroupApplicationUnhandledCount ', window.getGroupApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1938
|
+
this.getGroupApplicationListAsApplicant = (operationID = v4()) => {
|
|
1939
|
+
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID]);
|
|
1940
|
+
};
|
|
1941
|
+
this.getGroupApplicationListAsRecipient = (operationID = v4()) => {
|
|
1942
|
+
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID]);
|
|
1962
1943
|
};
|
|
1963
1944
|
this.acceptGroupApplication = (data, operationID = v4()) => {
|
|
1964
1945
|
return this._invoker('acceptGroupApplication ', window.acceptGroupApplication, [operationID, data.groupID, data.fromUserID, data.handleMsg]);
|
package/lib/index.umd.js
CHANGED
|
@@ -496,13 +496,13 @@
|
|
|
496
496
|
? new URL('worker.js', (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('index.umd.js', document.baseURI).href)))
|
|
497
497
|
: new URL('worker-legacy.js', (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('index.umd.js', document.baseURI).href)));
|
|
498
498
|
if (isViteEnvironment) {
|
|
499
|
-
workerUrl = workerUrl.href.replace('.vite/deps', '@
|
|
499
|
+
workerUrl = workerUrl.href.replace('.vite/deps', '@inter-digital/wasm-client-sdk/lib');
|
|
500
500
|
}
|
|
501
501
|
if (isNuxtEnvironment) {
|
|
502
|
-
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@
|
|
502
|
+
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@inter-digital/wasm-client-sdk/lib');
|
|
503
503
|
}
|
|
504
504
|
if (isQuasarEnvironment) {
|
|
505
|
-
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@
|
|
505
|
+
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@inter-digital/wasm-client-sdk/lib');
|
|
506
506
|
}
|
|
507
507
|
worker = new Worker(workerUrl, {
|
|
508
508
|
type: isSupportModuleWorker ? 'module' : 'classic',
|
|
@@ -1018,12 +1018,6 @@
|
|
|
1018
1018
|
MessageReceiveOptType[MessageReceiveOptType["NotReceive"] = 1] = "NotReceive";
|
|
1019
1019
|
MessageReceiveOptType[MessageReceiveOptType["NotNotify"] = 2] = "NotNotify";
|
|
1020
1020
|
})(exports.MessageReceiveOptType || (exports.MessageReceiveOptType = {}));
|
|
1021
|
-
exports.AddFriendPermission = void 0;
|
|
1022
|
-
(function (AddFriendPermission) {
|
|
1023
|
-
AddFriendPermission[AddFriendPermission["AddFriendAllowed"] = 0] = "AddFriendAllowed";
|
|
1024
|
-
AddFriendPermission[AddFriendPermission["AddFriendAllowedNoReview"] = 1] = "AddFriendAllowedNoReview";
|
|
1025
|
-
AddFriendPermission[AddFriendPermission["AddFriendDenied"] = 2] = "AddFriendDenied";
|
|
1026
|
-
})(exports.AddFriendPermission || (exports.AddFriendPermission = {}));
|
|
1027
1021
|
exports.AllowType = void 0;
|
|
1028
1022
|
(function (AllowType) {
|
|
1029
1023
|
AllowType[AllowType["Allowed"] = 0] = "Allowed";
|
|
@@ -1183,9 +1177,9 @@
|
|
|
1183
1177
|
this.goExisted = false;
|
|
1184
1178
|
this.tryParse = true;
|
|
1185
1179
|
this.isLogStandardOutput = true;
|
|
1186
|
-
this.
|
|
1180
|
+
this.init = async (params, operationID = v4()) => {
|
|
1187
1181
|
var _a, _b;
|
|
1188
|
-
this._logWrap(`SDK => (invoked by js) run
|
|
1182
|
+
this._logWrap(`SDK => (invoked by js) run init with args ${JSON.stringify({
|
|
1189
1183
|
params,
|
|
1190
1184
|
operationID,
|
|
1191
1185
|
})}`);
|
|
@@ -1220,7 +1214,17 @@
|
|
|
1220
1214
|
isExternalExtensions: params.isExternalExtensions || false,
|
|
1221
1215
|
};
|
|
1222
1216
|
this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
|
|
1223
|
-
window.initSDK(operationID, JSON.stringify(config));
|
|
1217
|
+
return window.initSDK(operationID, JSON.stringify(config));
|
|
1218
|
+
};
|
|
1219
|
+
this.login = async (params, operationID = v4()) => {
|
|
1220
|
+
this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
|
|
1221
|
+
params,
|
|
1222
|
+
operationID,
|
|
1223
|
+
})}`);
|
|
1224
|
+
// If initialization config is provided, run init first
|
|
1225
|
+
if ('platformID' in params) {
|
|
1226
|
+
await this.init(params, operationID);
|
|
1227
|
+
}
|
|
1224
1228
|
return await window.login(operationID, params.userID, params.token);
|
|
1225
1229
|
};
|
|
1226
1230
|
this.logout = (operationID = v4()) => {
|
|
@@ -1690,21 +1694,11 @@
|
|
|
1690
1694
|
this.getSpecifiedFriendsInfo = (data, operationID = v4()) => {
|
|
1691
1695
|
return this._invoker('getSpecifiedFriendsInfo', window.getSpecifiedFriendsInfo, [operationID, JSON.stringify(data.friendUserIDList), data.filterBlack]);
|
|
1692
1696
|
};
|
|
1693
|
-
this.getFriendApplicationListAsRecipient = (
|
|
1694
|
-
|
|
1695
|
-
offset: 0,
|
|
1696
|
-
count: 0,
|
|
1697
|
-
}, operationID = v4()) => {
|
|
1698
|
-
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1697
|
+
this.getFriendApplicationListAsRecipient = (operationID = v4()) => {
|
|
1698
|
+
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID]);
|
|
1699
1699
|
};
|
|
1700
|
-
this.getFriendApplicationListAsApplicant = (
|
|
1701
|
-
|
|
1702
|
-
count: 0,
|
|
1703
|
-
}, operationID = v4()) => {
|
|
1704
|
-
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1705
|
-
};
|
|
1706
|
-
this.getFriendApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1707
|
-
return this._invoker('getFriendApplicationUnhandledCount ', window.getFriendApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1700
|
+
this.getFriendApplicationListAsApplicant = (operationID = v4()) => {
|
|
1701
|
+
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID]);
|
|
1708
1702
|
};
|
|
1709
1703
|
this.getFriendList = (filterBlack = false, operationID = v4()) => {
|
|
1710
1704
|
return this._invoker('getFriendList ', window.getFriendList, [operationID, filterBlack]);
|
|
@@ -1943,24 +1937,11 @@
|
|
|
1943
1937
|
data.newOwnerUserID,
|
|
1944
1938
|
]);
|
|
1945
1939
|
};
|
|
1946
|
-
this.getGroupApplicationListAsApplicant = (
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
}, operationID = v4()) => {
|
|
1952
|
-
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1953
|
-
};
|
|
1954
|
-
this.getGroupApplicationListAsRecipient = (data = {
|
|
1955
|
-
groupID: [],
|
|
1956
|
-
handleResults: [],
|
|
1957
|
-
offset: 0,
|
|
1958
|
-
count: 0,
|
|
1959
|
-
}, operationID = v4()) => {
|
|
1960
|
-
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1961
|
-
};
|
|
1962
|
-
this.getGroupApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1963
|
-
return this._invoker('getGroupApplicationUnhandledCount ', window.getGroupApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1940
|
+
this.getGroupApplicationListAsApplicant = (operationID = v4()) => {
|
|
1941
|
+
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID]);
|
|
1942
|
+
};
|
|
1943
|
+
this.getGroupApplicationListAsRecipient = (operationID = v4()) => {
|
|
1944
|
+
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID]);
|
|
1964
1945
|
};
|
|
1965
1946
|
this.acceptGroupApplication = (data, operationID = v4()) => {
|
|
1966
1947
|
return this._invoker('acceptGroupApplication ', window.acceptGroupApplication, [operationID, data.groupID, data.fromUserID, data.handleMsg]);
|
package/lib/sdk/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Emitter from '../utils/emitter';
|
|
2
|
-
import { AccessFriendApplicationParams, AccessGroupApplicationParams, AccessMessageParams, AddFriendParams, AdvancedMsgParams, AdvancedQuoteMsgParams, AtMsgParams, ChangeGroupMemberMuteParams, ChangeGroupMuteParams, CreateGroupParams, CustomMsgParams, CustomSignalParams, FaceMessageParams, FileMsgParamsByURL, FindMessageParams, GetAdvancedHistoryMsgParams, GetGroupMemberByTimeParams, GetGroupMemberParams, GetGroupMessageReaderParams, GetHistoryMsgParams, GetOneConversationParams, ImageMsgParamsByURL, InitAndLoginConfig, InsertGroupMsgParams, InsertSingleMsgParams, AccessToGroupParams, SetConversationRecvOptParams, JoinGroupParams, LocationMsgParams, UpdateMemberInfoParams, MergerMsgParams, PartialUserItem, SetConversationPinParams, QuoteMsgParams, RemarkFriendParams, RtcActionParams, SearchFriendParams, SearchGroupMemberParams, SearchGroupParams, SearchLocalParams, SendGroupReadReceiptParams, SendMsgParams, SetBurnDurationParams, SetConversationMsgDestructParams, SetConversationMsgDestructTimeParams, SetConversationDraftParams, SetGroupRoleParams, SetGroupVerificationParams, SetMemberPermissionParams, SetMessageLocalExParams, SetConversationPrivateStateParams, SignalingInviteParams, SoundMsgParamsByURL, SplitConversationParams, TransferGroupParams, TypingUpdateParams, UploadFileParams, VideoMsgParamsByURL, SetGroupMemberNickParams, WasmPathConfig, PinFriendParams, SetFriendExParams, SetConversationExParams, AddBlackParams, OffsetParams, UpdateFriendsParams, SetConversationParams, GetSpecifiedFriendsParams, ChangeInputStatesParams, GetInputstatesParams, FetchSurroundingParams
|
|
2
|
+
import { AccessFriendApplicationParams, AccessGroupApplicationParams, AccessMessageParams, AddFriendParams, AdvancedMsgParams, AdvancedQuoteMsgParams, AtMsgParams, ChangeGroupMemberMuteParams, ChangeGroupMuteParams, CreateGroupParams, CustomMsgParams, CustomSignalParams, FaceMessageParams, FileMsgParamsByURL, FindMessageParams, GetAdvancedHistoryMsgParams, GetGroupMemberByTimeParams, GetGroupMemberParams, GetGroupMessageReaderParams, GetHistoryMsgParams, GetOneConversationParams, ImageMsgParamsByURL, InitConfig, LoginConfig, InitAndLoginConfig, InsertGroupMsgParams, InsertSingleMsgParams, AccessToGroupParams, SetConversationRecvOptParams, JoinGroupParams, LocationMsgParams, UpdateMemberInfoParams, MergerMsgParams, PartialUserItem, SetConversationPinParams, QuoteMsgParams, RemarkFriendParams, RtcActionParams, SearchFriendParams, SearchGroupMemberParams, SearchGroupParams, SearchLocalParams, SendGroupReadReceiptParams, SendMsgParams, SetBurnDurationParams, SetConversationMsgDestructParams, SetConversationMsgDestructTimeParams, SetConversationDraftParams, SetGroupRoleParams, SetGroupVerificationParams, SetMemberPermissionParams, SetMessageLocalExParams, SetConversationPrivateStateParams, SignalingInviteParams, SoundMsgParamsByURL, SplitConversationParams, TransferGroupParams, TypingUpdateParams, UploadFileParams, VideoMsgParamsByURL, SetGroupMemberNickParams, WasmPathConfig, PinFriendParams, SetFriendExParams, SetConversationExParams, AddBlackParams, OffsetParams, UpdateFriendsParams, SetConversationParams, GetSpecifiedFriendsParams, ChangeInputStatesParams, GetInputstatesParams, FetchSurroundingParams } from '../types/params';
|
|
3
3
|
import { AdvancedGetMessageResult, BlackUserItem, CallingRoomData, CardElem, ConversationItem, FriendApplicationItem, FriendshipInfo, FriendUserItem, GroupApplicationItem, GroupItem, GroupMemberItem, MessageItem, OfflinePush, PublicUserItem, RtcInvite, RtcInviteResults, SearchedFriendsInfo, SearchMessageResult, SelfUserInfo, UserOnlineState, WsResponse } from '../types/entity';
|
|
4
4
|
import { LoginStatus, MessageReceiveOptType, Platform } from '../types/enum';
|
|
5
5
|
declare class SDK extends Emitter {
|
|
@@ -11,7 +11,8 @@ declare class SDK extends Emitter {
|
|
|
11
11
|
constructor(url?: string, debug?: boolean);
|
|
12
12
|
_logWrap(...args: any[]): void;
|
|
13
13
|
_invoker<T>(functionName: string, func: (...args: any[]) => Promise<any>, args: any[], processor?: (data: string) => string): Promise<WsResponse<T>>;
|
|
14
|
-
|
|
14
|
+
init: (params: InitConfig, operationID?: string) => Promise<void>;
|
|
15
|
+
login: (params: LoginConfig | InitAndLoginConfig, operationID?: string) => Promise<any>;
|
|
15
16
|
logout: <T>(operationID?: string) => Promise<WsResponse<T>>;
|
|
16
17
|
getAllConversationList: (operationID?: string) => Promise<WsResponse<ConversationItem[]>>;
|
|
17
18
|
getOneConversation: (params: GetOneConversationParams, operationID?: string) => Promise<WsResponse<ConversationItem>>;
|
|
@@ -121,9 +122,8 @@ declare class SDK extends Emitter {
|
|
|
121
122
|
addFriend: <T>(data: AddFriendParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
122
123
|
searchFriends: (data: SearchFriendParams, operationID?: string) => Promise<WsResponse<SearchedFriendsInfo[]>>;
|
|
123
124
|
getSpecifiedFriendsInfo: (data: GetSpecifiedFriendsParams, operationID?: string) => Promise<WsResponse<FriendUserItem[]>>;
|
|
124
|
-
getFriendApplicationListAsRecipient: (
|
|
125
|
-
getFriendApplicationListAsApplicant: (
|
|
126
|
-
getFriendApplicationUnhandledCount: (data: GetSelfUnhandledApplyCountParams, operationID?: string) => Promise<WsResponse<number>>;
|
|
125
|
+
getFriendApplicationListAsRecipient: (operationID?: string) => Promise<WsResponse<FriendApplicationItem[]>>;
|
|
126
|
+
getFriendApplicationListAsApplicant: (operationID?: string) => Promise<WsResponse<FriendApplicationItem[]>>;
|
|
127
127
|
getFriendList: (filterBlack?: boolean, operationID?: string) => Promise<WsResponse<FriendUserItem[]>>;
|
|
128
128
|
getFriendListPage: (data: OffsetParams & {
|
|
129
129
|
filterBlack?: boolean;
|
|
@@ -181,9 +181,8 @@ declare class SDK extends Emitter {
|
|
|
181
181
|
changeGroupMute: <T>(data: ChangeGroupMuteParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
182
182
|
changeGroupMemberMute: <T>(data: ChangeGroupMemberMuteParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
183
183
|
transferGroupOwner: <T>(data: TransferGroupParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
184
|
-
getGroupApplicationListAsApplicant: (
|
|
185
|
-
getGroupApplicationListAsRecipient: (
|
|
186
|
-
getGroupApplicationUnhandledCount: (data: GetSelfUnhandledApplyCountParams, operationID?: string) => Promise<WsResponse<number>>;
|
|
184
|
+
getGroupApplicationListAsApplicant: (operationID?: string) => Promise<WsResponse<GroupApplicationItem[]>>;
|
|
185
|
+
getGroupApplicationListAsRecipient: (operationID?: string) => Promise<WsResponse<GroupApplicationItem[]>>;
|
|
187
186
|
acceptGroupApplication: <T>(data: AccessGroupApplicationParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
188
187
|
refuseGroupApplication: <T>(data: AccessGroupApplicationParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
189
188
|
/**
|
package/lib/types/entity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CbEvents } from '../constant';
|
|
2
|
-
import { GroupType, SessionType, MessageType, Platform, MessageStatus, GroupStatus, GroupVerificationType, AllowType, GroupJoinSource, GroupMemberRole, MessageReceiveOptType, GroupAtType, LogLevel, ApplicationHandleResult, Relationship, OnlineState
|
|
2
|
+
import { GroupType, SessionType, MessageType, Platform, MessageStatus, GroupStatus, GroupVerificationType, AllowType, GroupJoinSource, GroupMemberRole, MessageReceiveOptType, GroupAtType, LogLevel, ApplicationHandleResult, Relationship, OnlineState } from './enum';
|
|
3
3
|
export declare type WSEvent<T = unknown> = {
|
|
4
4
|
event: CbEvents;
|
|
5
5
|
data: T;
|
|
@@ -95,7 +95,6 @@ export declare type SelfUserInfo = {
|
|
|
95
95
|
nickname: string;
|
|
96
96
|
userID: string;
|
|
97
97
|
globalRecvMsgOpt: MessageReceiveOptType;
|
|
98
|
-
addFriendPermission: AddFriendPermission;
|
|
99
98
|
};
|
|
100
99
|
export declare type PartialUserInfo = {
|
|
101
100
|
userID: string;
|
package/lib/types/enum.d.ts
CHANGED
|
@@ -3,11 +3,6 @@ export declare enum MessageReceiveOptType {
|
|
|
3
3
|
NotReceive = 1,
|
|
4
4
|
NotNotify = 2
|
|
5
5
|
}
|
|
6
|
-
export declare enum AddFriendPermission {
|
|
7
|
-
AddFriendAllowed = 0,
|
|
8
|
-
AddFriendAllowedNoReview = 1,
|
|
9
|
-
AddFriendDenied = 2
|
|
10
|
-
}
|
|
11
6
|
export declare enum AllowType {
|
|
12
7
|
Allowed = 0,
|
|
13
8
|
NotAllowed = 1
|
package/lib/types/params.d.ts
CHANGED
|
@@ -5,6 +5,19 @@ export declare type WasmPathConfig = {
|
|
|
5
5
|
sqlWasmPath?: string;
|
|
6
6
|
debug?: boolean;
|
|
7
7
|
};
|
|
8
|
+
export declare type InitConfig = {
|
|
9
|
+
platformID: number;
|
|
10
|
+
apiAddr: string;
|
|
11
|
+
wsAddr: string;
|
|
12
|
+
logLevel?: LogLevel;
|
|
13
|
+
isLogStandardOutput?: boolean;
|
|
14
|
+
isExternalExtensions?: boolean;
|
|
15
|
+
tryParse?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type LoginConfig = {
|
|
18
|
+
userID: string;
|
|
19
|
+
token: string;
|
|
20
|
+
};
|
|
8
21
|
export declare type InitAndLoginConfig = {
|
|
9
22
|
userID: string;
|
|
10
23
|
token: string;
|
|
@@ -392,24 +405,3 @@ export declare type SetConversationMsgDestructTimeParams = {
|
|
|
392
405
|
conversationID: string;
|
|
393
406
|
msgDestructTime: number;
|
|
394
407
|
};
|
|
395
|
-
export declare type GetGroupApplicationListParams = {
|
|
396
|
-
groupID: string[];
|
|
397
|
-
handleResults: number[];
|
|
398
|
-
offset: number;
|
|
399
|
-
count: number;
|
|
400
|
-
};
|
|
401
|
-
export declare type GetFriendApplicationListAsRecipientParams = {
|
|
402
|
-
handleResults: number[];
|
|
403
|
-
offset: number;
|
|
404
|
-
count: number;
|
|
405
|
-
};
|
|
406
|
-
export declare type GetFriendApplicationListAsApplicationParams = {
|
|
407
|
-
offset: number;
|
|
408
|
-
count: number;
|
|
409
|
-
};
|
|
410
|
-
export declare type GetFriendApplicationUnhandledCountParams = {
|
|
411
|
-
time: number;
|
|
412
|
-
};
|
|
413
|
-
export declare type GetSelfUnhandledApplyCountParams = {
|
|
414
|
-
time: number;
|
|
415
|
-
};
|