@getpara/user-management-client 1.10.0 → 1.12.0

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.
@@ -82,7 +82,6 @@ __export(client_exports, {
82
82
  });
83
83
  module.exports = __toCommonJS(client_exports);
84
84
  var import_axios = __toESM(require("axios"));
85
- var import_qs = __toESM(require("qs"));
86
85
  var import_utils = require("./utils.js");
87
86
  var import_consts = require("./consts.js");
88
87
  var import_error = require("./error.js");
@@ -354,6 +353,9 @@ class Client {
354
353
  });
355
354
  return res.data;
356
355
  });
356
+ this.trackError = (opts) => __async(this, null, function* () {
357
+ yield this.baseRequest.post("/errors/sdk", opts);
358
+ });
357
359
  const headers = __spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId });
358
360
  const axiosConfig = {
359
361
  baseURL: userManagementHost,
@@ -814,10 +816,7 @@ class Client {
814
816
  // GET /users/:userId/wallets/:walletId/refresh-done
815
817
  isRefreshDone(userId, walletId, partnerId, protocolId) {
816
818
  return __async(this, null, function* () {
817
- const queryParams = {};
818
- if (partnerId) queryParams["partnerId"] = partnerId;
819
- if (protocolId) queryParams["protocolId"] = protocolId;
820
- const query = import_qs.default.stringify(queryParams);
819
+ const query = new URLSearchParams(__spreadValues(__spreadValues({}, partnerId ? { partnerId } : {}), protocolId ? { protocolId } : {})).toString();
821
820
  const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/refresh-done?${query}`);
822
821
  return res.data;
823
822
  });
@@ -864,9 +863,7 @@ class Client {
864
863
  }
865
864
  getEncryptedWalletPrivateKey(passwordId) {
866
865
  return __async(this, null, function* () {
867
- const queryParams = {};
868
- queryParams["passwordId"] = passwordId;
869
- const query = import_qs.default.stringify(queryParams);
866
+ const query = new URLSearchParams({ passwordId }).toString();
870
867
  const res = yield this.baseRequest.get(`/encrypted-wallet-private-keys?${query}`);
871
868
  return res;
872
869
  });
@@ -25,7 +25,6 @@ __export(wallet_exports, {
25
25
  WalletType: () => WalletType
26
26
  });
27
27
  module.exports = __toCommonJS(wallet_exports);
28
- var import_auth = require("./auth.js");
29
28
  var WalletScheme = /* @__PURE__ */ ((WalletScheme2) => {
30
29
  WalletScheme2["DKLS"] = "DKLS";
31
30
  WalletScheme2["CGGMP"] = "CGGMP";
@@ -62,9 +61,10 @@ const PREGEN_IDENTIFIER_TYPES = [
62
61
  "EMAIL",
63
62
  "PHONE",
64
63
  "CUSTOM_ID",
65
- import_auth.OAuthMethod.DISCORD,
66
- import_auth.OAuthMethod.TWITTER,
67
- import_auth.OAuthMethod.TELEGRAM
64
+ "GUEST_ID",
65
+ "DISCORD",
66
+ "TWITTER",
67
+ "TELEGRAM"
68
68
  ];
69
69
  const NON_ED25519 = ["DKLS" /* DKLS */, "CGGMP" /* CGGMP */];
70
70
  // Annotate the CommonJS export names for ESM import in node:
@@ -5,7 +5,6 @@ import {
5
5
  __spreadValues
6
6
  } from "./chunk-BBZEL7EG.js";
7
7
  import axios from "axios";
8
- import qs from "qs";
9
8
  import { extractWalletRef } from "./utils.js";
10
9
  import { SESSION_COOKIE_HEADER_NAME, VERSION_HEADER_NAME, PARTNER_ID_HEADER_NAME, API_KEY_HEADER_NAME } from "./consts.js";
11
10
  import { ParaApiError } from "./error.js";
@@ -277,6 +276,9 @@ class Client {
277
276
  });
278
277
  return res.data;
279
278
  });
279
+ this.trackError = (opts) => __async(this, null, function* () {
280
+ yield this.baseRequest.post("/errors/sdk", opts);
281
+ });
280
282
  const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
281
283
  const axiosConfig = {
282
284
  baseURL: userManagementHost,
@@ -737,10 +739,7 @@ class Client {
737
739
  // GET /users/:userId/wallets/:walletId/refresh-done
738
740
  isRefreshDone(userId, walletId, partnerId, protocolId) {
739
741
  return __async(this, null, function* () {
740
- const queryParams = {};
741
- if (partnerId) queryParams["partnerId"] = partnerId;
742
- if (protocolId) queryParams["protocolId"] = protocolId;
743
- const query = qs.stringify(queryParams);
742
+ const query = new URLSearchParams(__spreadValues(__spreadValues({}, partnerId ? { partnerId } : {}), protocolId ? { protocolId } : {})).toString();
744
743
  const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/refresh-done?${query}`);
745
744
  return res.data;
746
745
  });
@@ -787,9 +786,7 @@ class Client {
787
786
  }
788
787
  getEncryptedWalletPrivateKey(passwordId) {
789
788
  return __async(this, null, function* () {
790
- const queryParams = {};
791
- queryParams["passwordId"] = passwordId;
792
- const query = qs.stringify(queryParams);
789
+ const query = new URLSearchParams({ passwordId }).toString();
793
790
  const res = yield this.baseRequest.get(`/encrypted-wallet-private-keys?${query}`);
794
791
  return res;
795
792
  });
@@ -1,5 +1,4 @@
1
1
  import "../chunk-BBZEL7EG.js";
2
- import { OAuthMethod } from "./auth.js";
3
2
  var WalletScheme = /* @__PURE__ */ ((WalletScheme2) => {
4
3
  WalletScheme2["DKLS"] = "DKLS";
5
4
  WalletScheme2["CGGMP"] = "CGGMP";
@@ -36,9 +35,10 @@ const PREGEN_IDENTIFIER_TYPES = [
36
35
  "EMAIL",
37
36
  "PHONE",
38
37
  "CUSTOM_ID",
39
- OAuthMethod.DISCORD,
40
- OAuthMethod.TWITTER,
41
- OAuthMethod.TELEGRAM
38
+ "GUEST_ID",
39
+ "DISCORD",
40
+ "TWITTER",
41
+ "TELEGRAM"
42
42
  ];
43
43
  const NON_ED25519 = ["DKLS" /* DKLS */, "CGGMP" /* CGGMP */];
44
44
  export {
@@ -142,6 +142,7 @@ interface sessionPasswordBody {
142
142
  encryptionKeyHash?: string;
143
143
  }
144
144
  type BiometricLocationHintParams = AuthParams;
145
+ export type SDKType = 'WEB' | 'SERVER' | 'BRIDGE' | 'REACT_NATIVE';
145
146
  export type VerifyTelegramRes = {
146
147
  isValid: true;
147
148
  userId: string;
@@ -348,5 +349,14 @@ declare class Client {
348
349
  walletId: string;
349
350
  rpcUrl?: string;
350
351
  }) => Promise<GetWalletBalanceRes>;
352
+ trackError: (opts: {
353
+ methodName: string;
354
+ error: {
355
+ name: string;
356
+ message: string;
357
+ };
358
+ sdkType: SDKType;
359
+ userId: string;
360
+ }) => Promise<void>;
351
361
  }
352
362
  export default Client;
@@ -1,4 +1,3 @@
1
- import { OAuthMethod } from './auth.js';
2
1
  import { PartnerEntity } from './partner.js';
3
2
  export declare enum WalletScheme {
4
3
  DKLS = "DKLS",
@@ -33,7 +32,7 @@ export type WalletParams = Partial<{
33
32
  walletId?: string;
34
33
  externalWalletAddress?: string;
35
34
  }>;
36
- export declare const PREGEN_IDENTIFIER_TYPES: readonly ["EMAIL", "PHONE", "CUSTOM_ID", OAuthMethod.DISCORD, OAuthMethod.TWITTER, OAuthMethod.TELEGRAM];
35
+ export declare const PREGEN_IDENTIFIER_TYPES: readonly ["EMAIL", "PHONE", "CUSTOM_ID", "GUEST_ID", "DISCORD", "TWITTER", "TELEGRAM"];
37
36
  export type TPregenIdentifierType = (typeof PREGEN_IDENTIFIER_TYPES)[number];
38
37
  export type PregenIds = Partial<Record<TPregenIdentifierType, string[]>>;
39
38
  export interface WalletEntity {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/user-management-client",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -16,8 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "axios": "^1.8.4",
19
- "libphonenumber-js": "1.11.2",
20
- "qs": "^6.12.0"
19
+ "libphonenumber-js": "1.11.2"
21
20
  },
22
21
  "devDependencies": {
23
22
  "typescript": "^5.0.4"
@@ -33,5 +32,5 @@
33
32
  "require": "./dist/cjs/index.js"
34
33
  }
35
34
  },
36
- "gitHead": "617cf0aa1307a96ec5e91d39e306e8a0b3b86b82"
35
+ "gitHead": "748afcf08c9d307a2d3eaf0716f73132f3eb8529"
37
36
  }