@inter-digital/wasm-client-sdk 3.8.3-patch.13 → 3.8.3-patch.14-beta.1
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 +32 -41
- package/lib/index.js +31 -40
- package/lib/index.umd.js +31 -40
- package/lib/sdk/index.d.ts +5 -7
- package/lib/types/entity.d.ts +1 -2
- package/lib/types/enum.d.ts +0 -5
- package/lib/types/params.d.ts +0 -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
|
@@ -943,6 +943,18 @@ let initialized = false;
|
|
|
943
943
|
let go;
|
|
944
944
|
let goExitPromise;
|
|
945
945
|
const CACHE_KEY = 'openim-wasm-cache';
|
|
946
|
+
if (typeof window !== 'undefined') {
|
|
947
|
+
const cleanup = () => {
|
|
948
|
+
reset();
|
|
949
|
+
};
|
|
950
|
+
window.addEventListener('beforeunload', cleanup);
|
|
951
|
+
window.addEventListener('unload', cleanup);
|
|
952
|
+
if ('__TAURI__' in window) {
|
|
953
|
+
window.addEventListener('tauri://close-requested', cleanup);
|
|
954
|
+
window.addEventListener('tauri://destroyed', cleanup);
|
|
955
|
+
window.addEventListener('tauri://window-close-requested', cleanup);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
946
958
|
async function initializeWasm(url) {
|
|
947
959
|
if (initialized) {
|
|
948
960
|
return null;
|
|
@@ -970,6 +982,12 @@ async function initializeWasm(url) {
|
|
|
970
982
|
initialized = true;
|
|
971
983
|
return go;
|
|
972
984
|
}
|
|
985
|
+
function reset() {
|
|
986
|
+
initialized = false;
|
|
987
|
+
if (go) {
|
|
988
|
+
go = undefined;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
973
991
|
function getGO() {
|
|
974
992
|
return go;
|
|
975
993
|
}
|
|
@@ -1012,12 +1030,6 @@ var MessageReceiveOptType;
|
|
|
1012
1030
|
MessageReceiveOptType[MessageReceiveOptType["NotReceive"] = 1] = "NotReceive";
|
|
1013
1031
|
MessageReceiveOptType[MessageReceiveOptType["NotNotify"] = 2] = "NotNotify";
|
|
1014
1032
|
})(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
1033
|
var AllowType;
|
|
1022
1034
|
(function (AllowType) {
|
|
1023
1035
|
AllowType[AllowType["Allowed"] = 0] = "Allowed";
|
|
@@ -1214,14 +1226,14 @@ class SDK extends Emitter {
|
|
|
1214
1226
|
isExternalExtensions: params.isExternalExtensions || false,
|
|
1215
1227
|
};
|
|
1216
1228
|
this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
|
|
1217
|
-
window.initSDK(operationID, JSON.stringify(config));
|
|
1229
|
+
return window.initSDK(operationID, JSON.stringify(config));
|
|
1218
1230
|
};
|
|
1219
1231
|
this.login = async (params, operationID = v4()) => {
|
|
1220
1232
|
this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
|
|
1221
1233
|
params,
|
|
1222
1234
|
operationID,
|
|
1223
1235
|
})}`);
|
|
1224
|
-
// If
|
|
1236
|
+
// If initialization config is provided, run init first
|
|
1225
1237
|
if ('platformID' in params) {
|
|
1226
1238
|
await this.init(params, operationID);
|
|
1227
1239
|
}
|
|
@@ -1694,21 +1706,11 @@ class SDK extends Emitter {
|
|
|
1694
1706
|
this.getSpecifiedFriendsInfo = (data, operationID = v4()) => {
|
|
1695
1707
|
return this._invoker('getSpecifiedFriendsInfo', window.getSpecifiedFriendsInfo, [operationID, JSON.stringify(data.friendUserIDList), data.filterBlack]);
|
|
1696
1708
|
};
|
|
1697
|
-
this.getFriendApplicationListAsRecipient = (
|
|
1698
|
-
|
|
1699
|
-
offset: 0,
|
|
1700
|
-
count: 0,
|
|
1701
|
-
}, operationID = v4()) => {
|
|
1702
|
-
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1703
|
-
};
|
|
1704
|
-
this.getFriendApplicationListAsApplicant = (data = {
|
|
1705
|
-
offset: 0,
|
|
1706
|
-
count: 0,
|
|
1707
|
-
}, operationID = v4()) => {
|
|
1708
|
-
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1709
|
+
this.getFriendApplicationListAsRecipient = (operationID = v4()) => {
|
|
1710
|
+
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID]);
|
|
1709
1711
|
};
|
|
1710
|
-
this.
|
|
1711
|
-
return this._invoker('
|
|
1712
|
+
this.getFriendApplicationListAsApplicant = (operationID = v4()) => {
|
|
1713
|
+
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID]);
|
|
1712
1714
|
};
|
|
1713
1715
|
this.getFriendList = (filterBlack = false, operationID = v4()) => {
|
|
1714
1716
|
return this._invoker('getFriendList ', window.getFriendList, [operationID, filterBlack]);
|
|
@@ -1947,24 +1949,11 @@ class SDK extends Emitter {
|
|
|
1947
1949
|
data.newOwnerUserID,
|
|
1948
1950
|
]);
|
|
1949
1951
|
};
|
|
1950
|
-
this.getGroupApplicationListAsApplicant = (
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
}, operationID = v4()) => {
|
|
1956
|
-
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1957
|
-
};
|
|
1958
|
-
this.getGroupApplicationListAsRecipient = (data = {
|
|
1959
|
-
groupID: [],
|
|
1960
|
-
handleResults: [],
|
|
1961
|
-
offset: 0,
|
|
1962
|
-
count: 0,
|
|
1963
|
-
}, operationID = v4()) => {
|
|
1964
|
-
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1965
|
-
};
|
|
1966
|
-
this.getGroupApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1967
|
-
return this._invoker('getGroupApplicationUnhandledCount ', window.getGroupApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1952
|
+
this.getGroupApplicationListAsApplicant = (operationID = v4()) => {
|
|
1953
|
+
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID]);
|
|
1954
|
+
};
|
|
1955
|
+
this.getGroupApplicationListAsRecipient = (operationID = v4()) => {
|
|
1956
|
+
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID]);
|
|
1968
1957
|
};
|
|
1969
1958
|
this.acceptGroupApplication = (data, operationID = v4()) => {
|
|
1970
1959
|
return this._invoker('acceptGroupApplication ', window.acceptGroupApplication, [operationID, data.groupID, data.fromUserID, data.handleMsg]);
|
|
@@ -2105,6 +2094,8 @@ class SDK extends Emitter {
|
|
|
2105
2094
|
]);
|
|
2106
2095
|
};
|
|
2107
2096
|
this.fileMapSet = (uuid, file) => window.fileMapSet(uuid, file);
|
|
2097
|
+
// Reset any previous state before initializing
|
|
2098
|
+
reset();
|
|
2108
2099
|
initDatabaseAPI(debug);
|
|
2109
2100
|
this.isLogStandardOutput = debug;
|
|
2110
2101
|
this.wasmInitializedPromise = initializeWasm(url);
|
|
@@ -2222,4 +2213,4 @@ var indexeddbMainThreadWorkerB24e7a21 = /*#__PURE__*/Object.freeze({
|
|
|
2222
2213
|
'default': WorkerFactory
|
|
2223
2214
|
});
|
|
2224
2215
|
|
|
2225
|
-
export {
|
|
2216
|
+
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
|
@@ -947,6 +947,18 @@ let initialized = false;
|
|
|
947
947
|
let go;
|
|
948
948
|
let goExitPromise;
|
|
949
949
|
const CACHE_KEY = 'openim-wasm-cache';
|
|
950
|
+
if (typeof window !== 'undefined') {
|
|
951
|
+
const cleanup = () => {
|
|
952
|
+
reset();
|
|
953
|
+
};
|
|
954
|
+
window.addEventListener('beforeunload', cleanup);
|
|
955
|
+
window.addEventListener('unload', cleanup);
|
|
956
|
+
if ('__TAURI__' in window) {
|
|
957
|
+
window.addEventListener('tauri://close-requested', cleanup);
|
|
958
|
+
window.addEventListener('tauri://destroyed', cleanup);
|
|
959
|
+
window.addEventListener('tauri://window-close-requested', cleanup);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
950
962
|
async function initializeWasm(url) {
|
|
951
963
|
if (initialized) {
|
|
952
964
|
return null;
|
|
@@ -974,6 +986,12 @@ async function initializeWasm(url) {
|
|
|
974
986
|
initialized = true;
|
|
975
987
|
return go;
|
|
976
988
|
}
|
|
989
|
+
function reset() {
|
|
990
|
+
initialized = false;
|
|
991
|
+
if (go) {
|
|
992
|
+
go = undefined;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
977
995
|
function getGO() {
|
|
978
996
|
return go;
|
|
979
997
|
}
|
|
@@ -1016,12 +1034,6 @@ exports.MessageReceiveOptType = void 0;
|
|
|
1016
1034
|
MessageReceiveOptType[MessageReceiveOptType["NotReceive"] = 1] = "NotReceive";
|
|
1017
1035
|
MessageReceiveOptType[MessageReceiveOptType["NotNotify"] = 2] = "NotNotify";
|
|
1018
1036
|
})(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
1037
|
exports.AllowType = void 0;
|
|
1026
1038
|
(function (AllowType) {
|
|
1027
1039
|
AllowType[AllowType["Allowed"] = 0] = "Allowed";
|
|
@@ -1218,14 +1230,14 @@ class SDK extends Emitter {
|
|
|
1218
1230
|
isExternalExtensions: params.isExternalExtensions || false,
|
|
1219
1231
|
};
|
|
1220
1232
|
this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
|
|
1221
|
-
window.initSDK(operationID, JSON.stringify(config));
|
|
1233
|
+
return window.initSDK(operationID, JSON.stringify(config));
|
|
1222
1234
|
};
|
|
1223
1235
|
this.login = async (params, operationID = v4()) => {
|
|
1224
1236
|
this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
|
|
1225
1237
|
params,
|
|
1226
1238
|
operationID,
|
|
1227
1239
|
})}`);
|
|
1228
|
-
// If
|
|
1240
|
+
// If initialization config is provided, run init first
|
|
1229
1241
|
if ('platformID' in params) {
|
|
1230
1242
|
await this.init(params, operationID);
|
|
1231
1243
|
}
|
|
@@ -1698,21 +1710,11 @@ class SDK extends Emitter {
|
|
|
1698
1710
|
this.getSpecifiedFriendsInfo = (data, operationID = v4()) => {
|
|
1699
1711
|
return this._invoker('getSpecifiedFriendsInfo', window.getSpecifiedFriendsInfo, [operationID, JSON.stringify(data.friendUserIDList), data.filterBlack]);
|
|
1700
1712
|
};
|
|
1701
|
-
this.getFriendApplicationListAsRecipient = (
|
|
1702
|
-
|
|
1703
|
-
offset: 0,
|
|
1704
|
-
count: 0,
|
|
1705
|
-
}, operationID = v4()) => {
|
|
1706
|
-
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1707
|
-
};
|
|
1708
|
-
this.getFriendApplicationListAsApplicant = (data = {
|
|
1709
|
-
offset: 0,
|
|
1710
|
-
count: 0,
|
|
1711
|
-
}, operationID = v4()) => {
|
|
1712
|
-
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1713
|
+
this.getFriendApplicationListAsRecipient = (operationID = v4()) => {
|
|
1714
|
+
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID]);
|
|
1713
1715
|
};
|
|
1714
|
-
this.
|
|
1715
|
-
return this._invoker('
|
|
1716
|
+
this.getFriendApplicationListAsApplicant = (operationID = v4()) => {
|
|
1717
|
+
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID]);
|
|
1716
1718
|
};
|
|
1717
1719
|
this.getFriendList = (filterBlack = false, operationID = v4()) => {
|
|
1718
1720
|
return this._invoker('getFriendList ', window.getFriendList, [operationID, filterBlack]);
|
|
@@ -1951,24 +1953,11 @@ class SDK extends Emitter {
|
|
|
1951
1953
|
data.newOwnerUserID,
|
|
1952
1954
|
]);
|
|
1953
1955
|
};
|
|
1954
|
-
this.getGroupApplicationListAsApplicant = (
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
}, operationID = v4()) => {
|
|
1960
|
-
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1961
|
-
};
|
|
1962
|
-
this.getGroupApplicationListAsRecipient = (data = {
|
|
1963
|
-
groupID: [],
|
|
1964
|
-
handleResults: [],
|
|
1965
|
-
offset: 0,
|
|
1966
|
-
count: 0,
|
|
1967
|
-
}, operationID = v4()) => {
|
|
1968
|
-
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1969
|
-
};
|
|
1970
|
-
this.getGroupApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1971
|
-
return this._invoker('getGroupApplicationUnhandledCount ', window.getGroupApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1956
|
+
this.getGroupApplicationListAsApplicant = (operationID = v4()) => {
|
|
1957
|
+
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID]);
|
|
1958
|
+
};
|
|
1959
|
+
this.getGroupApplicationListAsRecipient = (operationID = v4()) => {
|
|
1960
|
+
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID]);
|
|
1972
1961
|
};
|
|
1973
1962
|
this.acceptGroupApplication = (data, operationID = v4()) => {
|
|
1974
1963
|
return this._invoker('acceptGroupApplication ', window.acceptGroupApplication, [operationID, data.groupID, data.fromUserID, data.handleMsg]);
|
|
@@ -2109,6 +2098,8 @@ class SDK extends Emitter {
|
|
|
2109
2098
|
]);
|
|
2110
2099
|
};
|
|
2111
2100
|
this.fileMapSet = (uuid, file) => window.fileMapSet(uuid, file);
|
|
2101
|
+
// Reset any previous state before initializing
|
|
2102
|
+
reset();
|
|
2112
2103
|
initDatabaseAPI(debug);
|
|
2113
2104
|
this.isLogStandardOutput = debug;
|
|
2114
2105
|
this.wasmInitializedPromise = initializeWasm(url);
|
package/lib/index.umd.js
CHANGED
|
@@ -949,6 +949,18 @@
|
|
|
949
949
|
let go;
|
|
950
950
|
let goExitPromise;
|
|
951
951
|
const CACHE_KEY = 'openim-wasm-cache';
|
|
952
|
+
if (typeof window !== 'undefined') {
|
|
953
|
+
const cleanup = () => {
|
|
954
|
+
reset();
|
|
955
|
+
};
|
|
956
|
+
window.addEventListener('beforeunload', cleanup);
|
|
957
|
+
window.addEventListener('unload', cleanup);
|
|
958
|
+
if ('__TAURI__' in window) {
|
|
959
|
+
window.addEventListener('tauri://close-requested', cleanup);
|
|
960
|
+
window.addEventListener('tauri://destroyed', cleanup);
|
|
961
|
+
window.addEventListener('tauri://window-close-requested', cleanup);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
952
964
|
async function initializeWasm(url) {
|
|
953
965
|
if (initialized) {
|
|
954
966
|
return null;
|
|
@@ -976,6 +988,12 @@
|
|
|
976
988
|
initialized = true;
|
|
977
989
|
return go;
|
|
978
990
|
}
|
|
991
|
+
function reset() {
|
|
992
|
+
initialized = false;
|
|
993
|
+
if (go) {
|
|
994
|
+
go = undefined;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
979
997
|
function getGO() {
|
|
980
998
|
return go;
|
|
981
999
|
}
|
|
@@ -1018,12 +1036,6 @@
|
|
|
1018
1036
|
MessageReceiveOptType[MessageReceiveOptType["NotReceive"] = 1] = "NotReceive";
|
|
1019
1037
|
MessageReceiveOptType[MessageReceiveOptType["NotNotify"] = 2] = "NotNotify";
|
|
1020
1038
|
})(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
1039
|
exports.AllowType = void 0;
|
|
1028
1040
|
(function (AllowType) {
|
|
1029
1041
|
AllowType[AllowType["Allowed"] = 0] = "Allowed";
|
|
@@ -1220,14 +1232,14 @@
|
|
|
1220
1232
|
isExternalExtensions: params.isExternalExtensions || false,
|
|
1221
1233
|
};
|
|
1222
1234
|
this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
|
|
1223
|
-
window.initSDK(operationID, JSON.stringify(config));
|
|
1235
|
+
return window.initSDK(operationID, JSON.stringify(config));
|
|
1224
1236
|
};
|
|
1225
1237
|
this.login = async (params, operationID = v4()) => {
|
|
1226
1238
|
this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
|
|
1227
1239
|
params,
|
|
1228
1240
|
operationID,
|
|
1229
1241
|
})}`);
|
|
1230
|
-
// If
|
|
1242
|
+
// If initialization config is provided, run init first
|
|
1231
1243
|
if ('platformID' in params) {
|
|
1232
1244
|
await this.init(params, operationID);
|
|
1233
1245
|
}
|
|
@@ -1700,21 +1712,11 @@
|
|
|
1700
1712
|
this.getSpecifiedFriendsInfo = (data, operationID = v4()) => {
|
|
1701
1713
|
return this._invoker('getSpecifiedFriendsInfo', window.getSpecifiedFriendsInfo, [operationID, JSON.stringify(data.friendUserIDList), data.filterBlack]);
|
|
1702
1714
|
};
|
|
1703
|
-
this.getFriendApplicationListAsRecipient = (
|
|
1704
|
-
|
|
1705
|
-
offset: 0,
|
|
1706
|
-
count: 0,
|
|
1707
|
-
}, operationID = v4()) => {
|
|
1708
|
-
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1709
|
-
};
|
|
1710
|
-
this.getFriendApplicationListAsApplicant = (data = {
|
|
1711
|
-
offset: 0,
|
|
1712
|
-
count: 0,
|
|
1713
|
-
}, operationID = v4()) => {
|
|
1714
|
-
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1715
|
+
this.getFriendApplicationListAsRecipient = (operationID = v4()) => {
|
|
1716
|
+
return this._invoker('getFriendApplicationListAsRecipient ', window.getFriendApplicationListAsRecipient, [operationID]);
|
|
1715
1717
|
};
|
|
1716
|
-
this.
|
|
1717
|
-
return this._invoker('
|
|
1718
|
+
this.getFriendApplicationListAsApplicant = (operationID = v4()) => {
|
|
1719
|
+
return this._invoker('getFriendApplicationListAsApplicant ', window.getFriendApplicationListAsApplicant, [operationID]);
|
|
1718
1720
|
};
|
|
1719
1721
|
this.getFriendList = (filterBlack = false, operationID = v4()) => {
|
|
1720
1722
|
return this._invoker('getFriendList ', window.getFriendList, [operationID, filterBlack]);
|
|
@@ -1953,24 +1955,11 @@
|
|
|
1953
1955
|
data.newOwnerUserID,
|
|
1954
1956
|
]);
|
|
1955
1957
|
};
|
|
1956
|
-
this.getGroupApplicationListAsApplicant = (
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
}, operationID = v4()) => {
|
|
1962
|
-
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID, JSON.stringify(data)]);
|
|
1963
|
-
};
|
|
1964
|
-
this.getGroupApplicationListAsRecipient = (data = {
|
|
1965
|
-
groupID: [],
|
|
1966
|
-
handleResults: [],
|
|
1967
|
-
offset: 0,
|
|
1968
|
-
count: 0,
|
|
1969
|
-
}, operationID = v4()) => {
|
|
1970
|
-
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID, JSON.stringify(data)]);
|
|
1971
|
-
};
|
|
1972
|
-
this.getGroupApplicationUnhandledCount = (data, operationID = v4()) => {
|
|
1973
|
-
return this._invoker('getGroupApplicationUnhandledCount ', window.getGroupApplicationUnhandledCount, [operationID, JSON.stringify(data)]);
|
|
1958
|
+
this.getGroupApplicationListAsApplicant = (operationID = v4()) => {
|
|
1959
|
+
return this._invoker('getGroupApplicationListAsApplicant ', window.getGroupApplicationListAsApplicant, [operationID]);
|
|
1960
|
+
};
|
|
1961
|
+
this.getGroupApplicationListAsRecipient = (operationID = v4()) => {
|
|
1962
|
+
return this._invoker('getGroupApplicationListAsRecipient ', window.getGroupApplicationListAsRecipient, [operationID]);
|
|
1974
1963
|
};
|
|
1975
1964
|
this.acceptGroupApplication = (data, operationID = v4()) => {
|
|
1976
1965
|
return this._invoker('acceptGroupApplication ', window.acceptGroupApplication, [operationID, data.groupID, data.fromUserID, data.handleMsg]);
|
|
@@ -2111,6 +2100,8 @@
|
|
|
2111
2100
|
]);
|
|
2112
2101
|
};
|
|
2113
2102
|
this.fileMapSet = (uuid, file) => window.fileMapSet(uuid, file);
|
|
2103
|
+
// Reset any previous state before initializing
|
|
2104
|
+
reset();
|
|
2114
2105
|
initDatabaseAPI(debug);
|
|
2115
2106
|
this.isLogStandardOutput = debug;
|
|
2116
2107
|
this.wasmInitializedPromise = initializeWasm(url);
|
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,
|
|
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 {
|
|
@@ -122,9 +122,8 @@ declare class SDK extends Emitter {
|
|
|
122
122
|
addFriend: <T>(data: AddFriendParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
123
123
|
searchFriends: (data: SearchFriendParams, operationID?: string) => Promise<WsResponse<SearchedFriendsInfo[]>>;
|
|
124
124
|
getSpecifiedFriendsInfo: (data: GetSpecifiedFriendsParams, operationID?: string) => Promise<WsResponse<FriendUserItem[]>>;
|
|
125
|
-
getFriendApplicationListAsRecipient: (
|
|
126
|
-
getFriendApplicationListAsApplicant: (
|
|
127
|
-
getFriendApplicationUnhandledCount: (data: GetSelfUnhandledApplyCountParams, operationID?: string) => Promise<WsResponse<number>>;
|
|
125
|
+
getFriendApplicationListAsRecipient: (operationID?: string) => Promise<WsResponse<FriendApplicationItem[]>>;
|
|
126
|
+
getFriendApplicationListAsApplicant: (operationID?: string) => Promise<WsResponse<FriendApplicationItem[]>>;
|
|
128
127
|
getFriendList: (filterBlack?: boolean, operationID?: string) => Promise<WsResponse<FriendUserItem[]>>;
|
|
129
128
|
getFriendListPage: (data: OffsetParams & {
|
|
130
129
|
filterBlack?: boolean;
|
|
@@ -182,9 +181,8 @@ declare class SDK extends Emitter {
|
|
|
182
181
|
changeGroupMute: <T>(data: ChangeGroupMuteParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
183
182
|
changeGroupMemberMute: <T>(data: ChangeGroupMemberMuteParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
184
183
|
transferGroupOwner: <T>(data: TransferGroupParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
185
|
-
getGroupApplicationListAsApplicant: (
|
|
186
|
-
getGroupApplicationListAsRecipient: (
|
|
187
|
-
getGroupApplicationUnhandledCount: (data: GetSelfUnhandledApplyCountParams, operationID?: string) => Promise<WsResponse<number>>;
|
|
184
|
+
getGroupApplicationListAsApplicant: (operationID?: string) => Promise<WsResponse<GroupApplicationItem[]>>;
|
|
185
|
+
getGroupApplicationListAsRecipient: (operationID?: string) => Promise<WsResponse<GroupApplicationItem[]>>;
|
|
188
186
|
acceptGroupApplication: <T>(data: AccessGroupApplicationParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
189
187
|
refuseGroupApplication: <T>(data: AccessGroupApplicationParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
190
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
|
@@ -405,24 +405,3 @@ export declare type SetConversationMsgDestructTimeParams = {
|
|
|
405
405
|
conversationID: string;
|
|
406
406
|
msgDestructTime: number;
|
|
407
407
|
};
|
|
408
|
-
export declare type GetGroupApplicationListParams = {
|
|
409
|
-
groupID: string[];
|
|
410
|
-
handleResults: number[];
|
|
411
|
-
offset: number;
|
|
412
|
-
count: number;
|
|
413
|
-
};
|
|
414
|
-
export declare type GetFriendApplicationListAsRecipientParams = {
|
|
415
|
-
handleResults: number[];
|
|
416
|
-
offset: number;
|
|
417
|
-
count: number;
|
|
418
|
-
};
|
|
419
|
-
export declare type GetFriendApplicationListAsApplicationParams = {
|
|
420
|
-
offset: number;
|
|
421
|
-
count: number;
|
|
422
|
-
};
|
|
423
|
-
export declare type GetFriendApplicationUnhandledCountParams = {
|
|
424
|
-
time: number;
|
|
425
|
-
};
|
|
426
|
-
export declare type GetSelfUnhandledApplyCountParams = {
|
|
427
|
-
time: number;
|
|
428
|
-
};
|