@getpara/user-management-client 2.0.0-alpha.12 → 2.0.0-alpha.14

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.
@@ -374,9 +374,16 @@ class Client {
374
374
  });
375
375
  return res.data;
376
376
  });
377
+ this.issueJwt = (..._0) => __async(this, [..._0], function* ({ keyIndex = 0 } = {}) {
378
+ const res = yield this.baseRequest.post(`/auth/jwt`, { keyIndex });
379
+ return res.data;
380
+ });
377
381
  this.trackError = (opts) => __async(this, null, function* () {
378
382
  yield this.baseRequest.post("/errors/sdk", opts);
379
383
  });
384
+ this.trackReactSdkAnalytics = (opts) => __async(this, null, function* () {
385
+ yield this.baseRequest.post("/partners/analytics/react-sdk", opts);
386
+ });
380
387
  const headers = __spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId });
381
388
  const axiosConfig = {
382
389
  baseURL: userManagementHost,
@@ -297,9 +297,16 @@ class Client {
297
297
  });
298
298
  return res.data;
299
299
  });
300
+ this.issueJwt = (..._0) => __async(this, [..._0], function* ({ keyIndex = 0 } = {}) {
301
+ const res = yield this.baseRequest.post(`/auth/jwt`, { keyIndex });
302
+ return res.data;
303
+ });
300
304
  this.trackError = (opts) => __async(this, null, function* () {
301
305
  yield this.baseRequest.post("/errors/sdk", opts);
302
306
  });
307
+ this.trackReactSdkAnalytics = (opts) => __async(this, null, function* () {
308
+ yield this.baseRequest.post("/partners/analytics/react-sdk", opts);
309
+ });
303
310
  const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
304
311
  const axiosConfig = {
305
312
  baseURL: userManagementHost,
@@ -1,5 +1,5 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, PasswordStatus, PregenIds, PrimaryAuth, PublicKeyStatus, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams } from './types/index.js';
2
+ import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, PasswordStatus, PregenIds, PrimaryAuth, PublicKeyStatus, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse } from './types/index.js';
3
3
  interface ConfigOpts {
4
4
  useFetchAdapter?: boolean;
5
5
  }
@@ -340,6 +340,7 @@ declare class Client {
340
340
  walletId: string;
341
341
  rpcUrl?: string;
342
342
  }) => Promise<GetWalletBalanceRes>;
343
+ issueJwt: ({ keyIndex }?: IssueJwtParams) => Promise<IssueJwtResponse>;
343
344
  trackError: (opts: {
344
345
  methodName: string;
345
346
  error: {
@@ -349,5 +350,9 @@ declare class Client {
349
350
  sdkType: SDKType;
350
351
  userId: string;
351
352
  }) => Promise<void>;
353
+ trackReactSdkAnalytics: (opts: {
354
+ props: object;
355
+ reactSdkVersion: string;
356
+ }) => Promise<void>;
352
357
  }
353
358
  export default Client;
@@ -213,3 +213,19 @@ export type AccountMetadata = Partial<Record<AccountMetadataKey, {
213
213
  date: Date;
214
214
  metadata: Record<string, any>;
215
215
  }>>;
216
+ export type IssueJwtParams = {
217
+ /**
218
+ * The index of the Para RSA keypair to use for signing the JWT. Defaults to `0`.
219
+ */
220
+ keyIndex?: number;
221
+ };
222
+ export type IssueJwtResponse = {
223
+ /**
224
+ * The Para JWT token.
225
+ */
226
+ token: string;
227
+ /**
228
+ * The `keyid`` / `kid` of the keypair used to sign the JWT.
229
+ */
230
+ keyId: string;
231
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/user-management-client",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.14",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -32,5 +32,5 @@
32
32
  "require": "./dist/cjs/index.js"
33
33
  }
34
34
  },
35
- "gitHead": "3a1284d5bb57c48fe53f651872da9a6e6903400a"
35
+ "gitHead": "03898846281bf37536a6ed12dede119e6171ad45"
36
36
  }