@inter-digital/wasm-client-sdk 3.8.3-patch.11 → 3.8.3-patch.13

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/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', '@openim/wasm-client-sdk/lib');
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', '@openim/wasm-client-sdk/lib');
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/, '@openim/wasm-client-sdk/lib');
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',
@@ -1177,9 +1177,9 @@ class SDK extends Emitter {
1177
1177
  this.goExisted = false;
1178
1178
  this.tryParse = true;
1179
1179
  this.isLogStandardOutput = true;
1180
- this.login = async (params, operationID = v4()) => {
1180
+ this.init = async (params, operationID = v4()) => {
1181
1181
  var _a, _b;
1182
- this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
1182
+ this._logWrap(`SDK => (invoked by js) run init with args ${JSON.stringify({
1183
1183
  params,
1184
1184
  operationID,
1185
1185
  })}`);
@@ -1215,6 +1215,16 @@ class SDK extends Emitter {
1215
1215
  };
1216
1216
  this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
1217
1217
  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 params contains initialization config, run init first
1225
+ if ('platformID' in params) {
1226
+ await this.init(params, operationID);
1227
+ }
1218
1228
  return await window.login(operationID, params.userID, params.token);
1219
1229
  };
1220
1230
  this.logout = (operationID = v4()) => {
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', '@openim/wasm-client-sdk/lib');
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', '@openim/wasm-client-sdk/lib');
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/, '@openim/wasm-client-sdk/lib');
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',
@@ -1181,9 +1181,9 @@ class SDK extends Emitter {
1181
1181
  this.goExisted = false;
1182
1182
  this.tryParse = true;
1183
1183
  this.isLogStandardOutput = true;
1184
- this.login = async (params, operationID = v4()) => {
1184
+ this.init = async (params, operationID = v4()) => {
1185
1185
  var _a, _b;
1186
- this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
1186
+ this._logWrap(`SDK => (invoked by js) run init with args ${JSON.stringify({
1187
1187
  params,
1188
1188
  operationID,
1189
1189
  })}`);
@@ -1219,6 +1219,16 @@ class SDK extends Emitter {
1219
1219
  };
1220
1220
  this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
1221
1221
  window.initSDK(operationID, JSON.stringify(config));
1222
+ };
1223
+ this.login = async (params, operationID = v4()) => {
1224
+ this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
1225
+ params,
1226
+ operationID,
1227
+ })}`);
1228
+ // If params contains initialization config, run init first
1229
+ if ('platformID' in params) {
1230
+ await this.init(params, operationID);
1231
+ }
1222
1232
  return await window.login(operationID, params.userID, params.token);
1223
1233
  };
1224
1234
  this.logout = (operationID = v4()) => {
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', '@openim/wasm-client-sdk/lib');
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', '@openim/wasm-client-sdk/lib');
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/, '@openim/wasm-client-sdk/lib');
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',
@@ -1183,9 +1183,9 @@
1183
1183
  this.goExisted = false;
1184
1184
  this.tryParse = true;
1185
1185
  this.isLogStandardOutput = true;
1186
- this.login = async (params, operationID = v4()) => {
1186
+ this.init = async (params, operationID = v4()) => {
1187
1187
  var _a, _b;
1188
- this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
1188
+ this._logWrap(`SDK => (invoked by js) run init with args ${JSON.stringify({
1189
1189
  params,
1190
1190
  operationID,
1191
1191
  })}`);
@@ -1221,6 +1221,16 @@
1221
1221
  };
1222
1222
  this.tryParse = (_b = params.tryParse) !== null && _b !== void 0 ? _b : true;
1223
1223
  window.initSDK(operationID, JSON.stringify(config));
1224
+ };
1225
+ this.login = async (params, operationID = v4()) => {
1226
+ this._logWrap(`SDK => (invoked by js) run login with args ${JSON.stringify({
1227
+ params,
1228
+ operationID,
1229
+ })}`);
1230
+ // If params contains initialization config, run init first
1231
+ if ('platformID' in params) {
1232
+ await this.init(params, operationID);
1233
+ }
1224
1234
  return await window.login(operationID, params.userID, params.token);
1225
1235
  };
1226
1236
  this.logout = (operationID = v4()) => {
@@ -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, GetFriendApplicationListAsRecipientParams, GetFriendApplicationListAsApplicationParams, GetSelfUnhandledApplyCountParams, GetGroupApplicationListParams } from '../types/params';
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, InitConfig, LoginConfig, 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, GetFriendApplicationListAsRecipientParams, GetFriendApplicationListAsApplicationParams, GetSelfUnhandledApplyCountParams, GetGroupApplicationListParams } 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
- login: (params: InitAndLoginConfig, operationID?: string) => Promise<any>;
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>>;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inter-digital/wasm-client-sdk",
3
- "version": "3.8.3-patch.11",
3
+ "version": "3.8.3-patch.13",
4
4
  "description": "open im sdk for web",
5
5
  "source": "src/index.ts",
6
6
  "main": "lib/index.js",