diff --git a/assets/openIM.wasm b/assets/openIM.wasm index 4861fa6..d73bebc 100755 Binary files a/assets/openIM.wasm and b/assets/openIM.wasm differ diff --git a/assets/version b/assets/version index ce83256..3c9b256 100644 --- a/assets/version +++ b/assets/version @@ -1 +1 @@ -v3.8.3-patch.3 \ No newline at end of file +v3.8.3-patch.10 \ No newline at end of file diff --git a/assets/wasm_exec.js b/assets/wasm_exec.js index bc6f210..d71af9e 100644 --- a/assets/wasm_exec.js +++ b/assets/wasm_exec.js @@ -14,7 +14,7 @@ if (!globalThis.fs) { let outputBuf = ""; globalThis.fs = { - constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused + constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 }, // unused writeSync(fd, buf) { outputBuf += decoder.decode(buf); const nl = outputBuf.lastIndexOf("\n"); @@ -73,6 +73,14 @@ } } + if (!globalThis.path) { + globalThis.path = { + resolve(...pathSegments) { + return pathSegments.join("/"); + } + } + } + if (!globalThis.crypto) { throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)"); } @@ -208,10 +216,16 @@ return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len)); } + const testCallExport = (a, b) => { + this._inst.exports.testExport0(); + return this._inst.exports.testExport(a, b); + } + const timeOrigin = Date.now() - performance.now(); this.importObject = { _gotest: { add: (a, b) => a + b, + callExport: testCallExport, }, gojs: { // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters) diff --git a/package-lock.json b/package-lock.json index 452d854..e49a28b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openim/wasm-client-sdk", - "version": "3.8.3-patch.9.1", + "version": "3.8.3-patch.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@openim/wasm-client-sdk", - "version": "3.8.3-patch.9.1", + "version": "3.8.3-patch.10", "license": "MIT", "devDependencies": { "@commitlint/cli": "^16.2.4", diff --git a/package.json b/package.json index 24a6ee2..e56ff34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openim/wasm-client-sdk", - "version": "3.8.3-patch.9.1", + "version": "3.8.3-patch.10", "description": "open im sdk for web", "source": "src/index.ts", "main": "lib/index.js", diff --git a/src/api/database/alter.ts b/src/api/database/alter.ts index a501890..baca581 100644 --- a/src/api/database/alter.ts +++ b/src/api/database/alter.ts @@ -4,6 +4,7 @@ export function alterTable(db: Database) { alter351(db); alter380(db); alter381(db); + alter383p8(db); } function alter351(db: Database) { @@ -41,3 +42,15 @@ function alter381(db: Database) { // alter table error } } + +function alter383p8(db: Database) { + try { + db.exec( + ` + ALTER TABLE local_users ADD COLUMN add_friend_permission numeric; + ` + ); + } catch (error) { + // alter table error + } +} diff --git a/src/sqls/localUsers.ts b/src/sqls/localUsers.ts index d02146b..2193a44 100644 --- a/src/sqls/localUsers.ts +++ b/src/sqls/localUsers.ts @@ -15,6 +15,7 @@ export function localUsers(db: Database): QueryExecResult[] { 'ex' varchar(1024), 'attached_info' varchar(1024), 'global_recv_msg_opt' integer, + 'add_friend_permission' integer, primary key ('user_id') ) ` diff --git a/src/utils/key.ts b/src/utils/key.ts index 23a8598..a1bbb0f 100644 --- a/src/utils/key.ts +++ b/src/utils/key.ts @@ -66,6 +66,7 @@ const InternalConstraint = [ ['entity_id', 'entityID'], ['version_id', 'versionID'], ['display_is_read', 'displayIsRead'], + ['add_friend_permission', 'addFriendPermission'], ]; function _getInternalCamelCaseBySnakeCase(key: string) {