Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/openIM.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.8.3-patch.3
v3.8.3-patch.10
16 changes: 15 additions & 1 deletion assets/wasm_exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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)");
}
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 13 additions & 0 deletions src/api/database/alter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export function alterTable(db: Database) {
alter351(db);
alter380(db);
alter381(db);
alter383p8(db);
}

function alter351(db: Database) {
Expand Down Expand Up @@ -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
}
}
1 change: 1 addition & 0 deletions src/sqls/localUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
)
`
Expand Down
1 change: 1 addition & 0 deletions src/utils/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const InternalConstraint = [
['entity_id', 'entityID'],
['version_id', 'versionID'],
['display_is_read', 'displayIsRead'],
['add_friend_permission', 'addFriendPermission'],
];

function _getInternalCamelCaseBySnakeCase(key: string) {
Expand Down