@imtbl/sdk 1.7.1 → 1.7.3

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/dist/passport.js CHANGED
@@ -9146,7 +9146,7 @@ class MultiRollupApiClients {
9146
9146
  }
9147
9147
 
9148
9148
  // eslint-disable-next-line @typescript-eslint/naming-convention
9149
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.7.1' };
9149
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.7.3' };
9150
9150
  const createConfig = ({ basePath, headers, }) => {
9151
9151
  if (!basePath.trim()) {
9152
9152
  throw Error('basePath can not be empty');
@@ -9293,7 +9293,7 @@ const storeDetail = (key, value) => {
9293
9293
  };
9294
9294
  setItem(Store.RUNTIME, RUNTIME_DETAILS);
9295
9295
  };
9296
- const getDetail = (key) => {
9296
+ const getDetail$1 = (key) => {
9297
9297
  // Handle the scenario where detail is a falsy value
9298
9298
  if (RUNTIME_DETAILS[key] === undefined) {
9299
9299
  return undefined;
@@ -9325,7 +9325,7 @@ const flattenProperties = (properties) => {
9325
9325
  };
9326
9326
 
9327
9327
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
9328
- const SDK_VERSION = '1.7.1';
9328
+ const SDK_VERSION = '1.7.3';
9329
9329
  const getReferrer = () => {
9330
9330
  if (isNode()) {
9331
9331
  return '';
@@ -9368,7 +9368,7 @@ const initialise = async () => {
9368
9368
  initialised = true;
9369
9369
  try {
9370
9370
  const runtimeDetails = flattenProperties(getRuntimeDetails());
9371
- const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
9371
+ const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
9372
9372
  const body = {
9373
9373
  version: 1,
9374
9374
  data: {
@@ -9521,6 +9521,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
9521
9521
  storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
9522
9522
  };
9523
9523
  errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
9524
+ const getDetail = errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
9524
9525
 
9525
9526
  var Environment;
9526
9527
  (function (Environment) {
@@ -9537,7 +9538,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
9537
9538
  chainID,
9538
9539
  coreContractAddress,
9539
9540
  registrationContractAddress,
9540
- sdkVersion: 'ts-immutable-sdk-1.7.1',
9541
+ sdkVersion: 'ts-immutable-sdk-1.7.3',
9541
9542
  });
9542
9543
  /**
9543
9544
  * Sets `sdkVersion` at the time of build
@@ -14262,10 +14263,20 @@ class AuthManager {
14262
14263
  },
14263
14264
  });
14264
14265
  };
14265
- async login() {
14266
+ /**
14267
+ * login
14268
+ * @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation.
14269
+ */
14270
+ async login(anonymousId) {
14266
14271
  return withPassportError(async () => {
14272
+ const rid = getDetail(Detail.RUNTIME_ID);
14267
14273
  const popupWindowFeatures = { width: 410, height: 450 };
14268
14274
  const oidcUser = await this.userManager.signinPopup({
14275
+ extraQueryParams: {
14276
+ ...(this.userManager.settings?.extraQueryParams ?? {}),
14277
+ rid: rid || '',
14278
+ third_party_a_id: anonymousId || '',
14279
+ },
14269
14280
  popupWindowFeatures,
14270
14281
  });
14271
14282
  return AuthManager.mapOidcUserToDomainModel(oidcUser);
@@ -14285,17 +14296,22 @@ class AuthManager {
14285
14296
  async loginCallback() {
14286
14297
  return withPassportError(async () => this.userManager.signinPopupCallback(), PassportErrorType.AUTHENTICATION_ERROR);
14287
14298
  }
14288
- async loginWithDeviceFlow() {
14299
+ /**
14300
+ * loginWithDeviceFlow
14301
+ * @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation.
14302
+ */
14303
+ async loginWithDeviceFlow(anonymousId) {
14289
14304
  return withPassportError(async () => {
14290
14305
  const response = await globalAxios$1.post(`${this.config.authenticationDomain}/oauth/device/code`, {
14291
14306
  client_id: this.config.oidcConfiguration.clientId,
14292
14307
  scope: this.config.oidcConfiguration.scope,
14293
14308
  audience: this.config.oidcConfiguration.audience,
14294
14309
  }, formUrlEncodedHeader);
14310
+ const rid = getDetail(Detail.RUNTIME_ID);
14295
14311
  return {
14296
14312
  code: response.data.user_code,
14297
14313
  deviceCode: response.data.device_code,
14298
- url: response.data.verification_uri_complete,
14314
+ url: `${response.data.verification_uri_complete}${rid ? `&rid=${rid}` : ''}${anonymousId ? `&third_party_a_id=${anonymousId}` : ''}`,
14299
14315
  interval: response.data.interval,
14300
14316
  };
14301
14317
  }, PassportErrorType.AUTHENTICATION_ERROR);
package/dist/x.js CHANGED
@@ -104,7 +104,7 @@ const storeDetail = (key, value) => {
104
104
  };
105
105
  setItem(Store.RUNTIME, RUNTIME_DETAILS);
106
106
  };
107
- const getDetail = (key) => {
107
+ const getDetail$1 = (key) => {
108
108
  // Handle the scenario where detail is a falsy value
109
109
  if (RUNTIME_DETAILS[key] === undefined) {
110
110
  return undefined;
@@ -136,7 +136,7 @@ const flattenProperties = (properties) => {
136
136
  };
137
137
 
138
138
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
139
- const SDK_VERSION = '1.7.1';
139
+ const SDK_VERSION = '1.7.3';
140
140
  const getReferrer = () => {
141
141
  if (isNode()) {
142
142
  return '';
@@ -179,7 +179,7 @@ const initialise = async () => {
179
179
  initialised = true;
180
180
  try {
181
181
  const runtimeDetails = flattenProperties(getRuntimeDetails());
182
- const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
182
+ const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
183
183
  const body = {
184
184
  version: 1,
185
185
  data: {
@@ -311,6 +311,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
311
311
  storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
312
312
  };
313
313
  errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
314
+ errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
314
315
 
315
316
  var Environment;
316
317
  (function (Environment) {
@@ -327,7 +328,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
327
328
  chainID,
328
329
  coreContractAddress,
329
330
  registrationContractAddress,
330
- sdkVersion: 'ts-immutable-sdk-1.7.1',
331
+ sdkVersion: 'ts-immutable-sdk-1.7.3',
331
332
  });
332
333
  /**
333
334
  * Sets `sdkVersion` at the time of build
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "1.7.1",
4
+ "version": "1.7.3",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",