@getpara/user-management-client 3.0.0 → 3.2.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.
- package/dist/cjs/client.js +6 -5
- package/dist/cjs/consts.js +3 -0
- package/dist/esm/client.js +7 -5
- package/dist/esm/consts.js +2 -0
- package/dist/types/client.d.ts +8 -3
- package/dist/types/consts.d.ts +1 -0
- package/package.json +2 -2
package/dist/cjs/client.js
CHANGED
|
@@ -138,6 +138,7 @@ class Client {
|
|
|
138
138
|
apiKey,
|
|
139
139
|
partnerId,
|
|
140
140
|
version,
|
|
141
|
+
clientType,
|
|
141
142
|
opts,
|
|
142
143
|
retrieveSessionCookie,
|
|
143
144
|
persistSessionCookie,
|
|
@@ -389,8 +390,8 @@ class Client {
|
|
|
389
390
|
return res;
|
|
390
391
|
});
|
|
391
392
|
// POST /users/:userId/wallets/:walletId/refresh
|
|
392
|
-
this.refreshKeys = (userId, walletId, oldPartnerId, newPartnerId, keyShareProtocolId) => __async(this, null, function* () {
|
|
393
|
-
const body = { oldPartnerId, newPartnerId, keyShareProtocolId };
|
|
393
|
+
this.refreshKeys = (userId, walletId, oldPartnerId, newPartnerId, keyShareProtocolId, useNewOT) => __async(this, null, function* () {
|
|
394
|
+
const body = { oldPartnerId, newPartnerId, keyShareProtocolId, useNewOT };
|
|
394
395
|
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/refresh`, body);
|
|
395
396
|
return res;
|
|
396
397
|
});
|
|
@@ -450,8 +451,8 @@ class Client {
|
|
|
450
451
|
const res = yield this.baseRequest.post("/recovery", body);
|
|
451
452
|
return res;
|
|
452
453
|
});
|
|
453
|
-
this.preSignMessage = (userId, walletId, message, scheme, cosmosSignDoc, protocolId) => __async(this, null, function* () {
|
|
454
|
-
const body = { message, scheme, cosmosSignDoc, protocolId };
|
|
454
|
+
this.preSignMessage = (userId, walletId, message, scheme, cosmosSignDoc, protocolId, useNewOT) => __async(this, null, function* () {
|
|
455
|
+
const body = { message, scheme, cosmosSignDoc, protocolId, useNewOT };
|
|
455
456
|
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/messages/sign`, body);
|
|
456
457
|
return res.data;
|
|
457
458
|
});
|
|
@@ -629,7 +630,7 @@ class Client {
|
|
|
629
630
|
});
|
|
630
631
|
return { success: res.data.success };
|
|
631
632
|
});
|
|
632
|
-
const headers = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId }), partnerConfigOverride && { [import_consts.PARTNER_CONFIG_OVERRIDE_HEADER_NAME]: JSON.stringify(partnerConfigOverride) }), {
|
|
633
|
+
const headers = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId }), clientType && { [import_consts.CLIENT_TYPE_HEADER_NAME]: clientType }), partnerConfigOverride && { [import_consts.PARTNER_CONFIG_OVERRIDE_HEADER_NAME]: JSON.stringify(partnerConfigOverride) }), {
|
|
633
634
|
// Opts into structured-JSON error responses for OTP error classes (server-side
|
|
634
635
|
// contract added in @getpara/shared 1.16.0). Without it the server falls back to
|
|
635
636
|
// plain-text bodies for backward compat with older SDKs.
|
package/dist/cjs/consts.js
CHANGED
|
@@ -18,6 +18,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
18
18
|
var consts_exports = {};
|
|
19
19
|
__export(consts_exports, {
|
|
20
20
|
API_KEY_HEADER_NAME: () => API_KEY_HEADER_NAME,
|
|
21
|
+
CLIENT_TYPE_HEADER_NAME: () => CLIENT_TYPE_HEADER_NAME,
|
|
21
22
|
PARTNER_CONFIG_OVERRIDE_HEADER_NAME: () => PARTNER_CONFIG_OVERRIDE_HEADER_NAME,
|
|
22
23
|
PARTNER_ID_HEADER_NAME: () => PARTNER_ID_HEADER_NAME,
|
|
23
24
|
SESSION_COOKIE_HEADER_NAME: () => SESSION_COOKIE_HEADER_NAME,
|
|
@@ -26,12 +27,14 @@ __export(consts_exports, {
|
|
|
26
27
|
module.exports = __toCommonJS(consts_exports);
|
|
27
28
|
const SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
|
|
28
29
|
const VERSION_HEADER_NAME = "x-para-version";
|
|
30
|
+
const CLIENT_TYPE_HEADER_NAME = "x-para-client-type";
|
|
29
31
|
const PARTNER_ID_HEADER_NAME = "x-partner-id";
|
|
30
32
|
const API_KEY_HEADER_NAME = "X-External-API-Key";
|
|
31
33
|
const PARTNER_CONFIG_OVERRIDE_HEADER_NAME = "x-partner-config-override";
|
|
32
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
35
|
0 && (module.exports = {
|
|
34
36
|
API_KEY_HEADER_NAME,
|
|
37
|
+
CLIENT_TYPE_HEADER_NAME,
|
|
35
38
|
PARTNER_CONFIG_OVERRIDE_HEADER_NAME,
|
|
36
39
|
PARTNER_ID_HEADER_NAME,
|
|
37
40
|
SESSION_COOKIE_HEADER_NAME,
|
package/dist/esm/client.js
CHANGED
|
@@ -14,6 +14,7 @@ import { extractWalletRef, fromAccountMetadata, fromLinkedAccounts } from "./uti
|
|
|
14
14
|
import {
|
|
15
15
|
SESSION_COOKIE_HEADER_NAME,
|
|
16
16
|
VERSION_HEADER_NAME,
|
|
17
|
+
CLIENT_TYPE_HEADER_NAME,
|
|
17
18
|
PARTNER_ID_HEADER_NAME,
|
|
18
19
|
API_KEY_HEADER_NAME,
|
|
19
20
|
PARTNER_CONFIG_OVERRIDE_HEADER_NAME
|
|
@@ -68,6 +69,7 @@ class Client {
|
|
|
68
69
|
apiKey,
|
|
69
70
|
partnerId,
|
|
70
71
|
version,
|
|
72
|
+
clientType,
|
|
71
73
|
opts,
|
|
72
74
|
retrieveSessionCookie,
|
|
73
75
|
persistSessionCookie,
|
|
@@ -319,8 +321,8 @@ class Client {
|
|
|
319
321
|
return res;
|
|
320
322
|
});
|
|
321
323
|
// POST /users/:userId/wallets/:walletId/refresh
|
|
322
|
-
this.refreshKeys = (userId, walletId, oldPartnerId, newPartnerId, keyShareProtocolId) => __async(this, null, function* () {
|
|
323
|
-
const body = { oldPartnerId, newPartnerId, keyShareProtocolId };
|
|
324
|
+
this.refreshKeys = (userId, walletId, oldPartnerId, newPartnerId, keyShareProtocolId, useNewOT) => __async(this, null, function* () {
|
|
325
|
+
const body = { oldPartnerId, newPartnerId, keyShareProtocolId, useNewOT };
|
|
324
326
|
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/refresh`, body);
|
|
325
327
|
return res;
|
|
326
328
|
});
|
|
@@ -380,8 +382,8 @@ class Client {
|
|
|
380
382
|
const res = yield this.baseRequest.post("/recovery", body);
|
|
381
383
|
return res;
|
|
382
384
|
});
|
|
383
|
-
this.preSignMessage = (userId, walletId, message, scheme, cosmosSignDoc, protocolId) => __async(this, null, function* () {
|
|
384
|
-
const body = { message, scheme, cosmosSignDoc, protocolId };
|
|
385
|
+
this.preSignMessage = (userId, walletId, message, scheme, cosmosSignDoc, protocolId, useNewOT) => __async(this, null, function* () {
|
|
386
|
+
const body = { message, scheme, cosmosSignDoc, protocolId, useNewOT };
|
|
385
387
|
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/messages/sign`, body);
|
|
386
388
|
return res.data;
|
|
387
389
|
});
|
|
@@ -559,7 +561,7 @@ class Client {
|
|
|
559
561
|
});
|
|
560
562
|
return { success: res.data.success };
|
|
561
563
|
});
|
|
562
|
-
const headers = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId }), partnerConfigOverride && { [PARTNER_CONFIG_OVERRIDE_HEADER_NAME]: JSON.stringify(partnerConfigOverride) }), {
|
|
564
|
+
const headers = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId }), clientType && { [CLIENT_TYPE_HEADER_NAME]: clientType }), partnerConfigOverride && { [PARTNER_CONFIG_OVERRIDE_HEADER_NAME]: JSON.stringify(partnerConfigOverride) }), {
|
|
563
565
|
// Opts into structured-JSON error responses for OTP error classes (server-side
|
|
564
566
|
// contract added in @getpara/shared 1.16.0). Without it the server falls back to
|
|
565
567
|
// plain-text bodies for backward compat with older SDKs.
|
package/dist/esm/consts.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import "./chunk-BBZEL7EG.js";
|
|
2
2
|
const SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
|
|
3
3
|
const VERSION_HEADER_NAME = "x-para-version";
|
|
4
|
+
const CLIENT_TYPE_HEADER_NAME = "x-para-client-type";
|
|
4
5
|
const PARTNER_ID_HEADER_NAME = "x-partner-id";
|
|
5
6
|
const API_KEY_HEADER_NAME = "X-External-API-Key";
|
|
6
7
|
const PARTNER_CONFIG_OVERRIDE_HEADER_NAME = "x-partner-config-override";
|
|
7
8
|
export {
|
|
8
9
|
API_KEY_HEADER_NAME,
|
|
10
|
+
CLIENT_TYPE_HEADER_NAME,
|
|
9
11
|
PARTNER_CONFIG_OVERRIDE_HEADER_NAME,
|
|
10
12
|
PARTNER_ID_HEADER_NAME,
|
|
11
13
|
SESSION_COOKIE_HEADER_NAME,
|
package/dist/types/client.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ interface ConfigOpts {
|
|
|
6
6
|
type ClientConfig = {
|
|
7
7
|
userManagementHost: string;
|
|
8
8
|
version?: string;
|
|
9
|
+
/** Normalized client type (swift | flutter | react-native | web | ...). Sent as the x-para-client-type header → client_type analytics property. */
|
|
10
|
+
clientType?: string;
|
|
9
11
|
partnerId?: string;
|
|
10
12
|
apiKey: string;
|
|
11
13
|
opts?: ConfigOpts;
|
|
@@ -125,12 +127,14 @@ interface signTransactionBody {
|
|
|
125
127
|
transaction: string;
|
|
126
128
|
chainId: string;
|
|
127
129
|
protocolId?: string;
|
|
130
|
+
useNewOT?: boolean;
|
|
128
131
|
}
|
|
129
132
|
interface sendTransactionBody {
|
|
130
133
|
transaction: string;
|
|
131
134
|
chain?: Chain;
|
|
132
135
|
chainId?: string;
|
|
133
136
|
protocolId?: string;
|
|
137
|
+
useNewOT?: boolean;
|
|
134
138
|
}
|
|
135
139
|
interface AcceptScopesBody {
|
|
136
140
|
scopeIds: string[];
|
|
@@ -169,7 +173,7 @@ export declare const isRetryableError: (error: AxiosError) => boolean;
|
|
|
169
173
|
declare class Client {
|
|
170
174
|
private baseRequest;
|
|
171
175
|
private inFlightFaucetRequests;
|
|
172
|
-
constructor({ userManagementHost, apiKey, partnerId, version, opts, retrieveSessionCookie, persistSessionCookie, partnerConfigOverride, staticTraceContext, }: ClientConfig);
|
|
176
|
+
constructor({ userManagementHost, apiKey, partnerId, version, clientType, opts, retrieveSessionCookie, persistSessionCookie, partnerConfigOverride, staticTraceContext, }: ClientConfig);
|
|
173
177
|
signUpOrLogIn: (body: VerifiedAuth & VerificationEmailProps) => Promise<SignUpOrLogInResponse>;
|
|
174
178
|
/**
|
|
175
179
|
* @deprecated
|
|
@@ -277,7 +281,7 @@ declare class Client {
|
|
|
277
281
|
}>;
|
|
278
282
|
sendTransaction: (userId: string, walletId: string, body: sendTransactionBody) => Promise<any>;
|
|
279
283
|
signTransaction: (userId: string, walletId: string, body: signTransactionBody) => Promise<any>;
|
|
280
|
-
refreshKeys: (userId: string, walletId: string, oldPartnerId?: string, newPartnerId?: string, keyShareProtocolId?: string) => Promise<any>;
|
|
284
|
+
refreshKeys: (userId: string, walletId: string, oldPartnerId?: string, newPartnerId?: string, keyShareProtocolId?: string, useNewOT?: boolean) => Promise<any>;
|
|
281
285
|
updatePregenWallet: (walletId: string, body: updatePregenWalletBody) => Promise<any>;
|
|
282
286
|
getWallets: (userId: string, includePartnerData?: boolean) => Promise<AxiosResponse<GetWalletsRes, any>>;
|
|
283
287
|
getAllWallets: (userId: string) => Promise<AxiosResponse<GetWalletsRes, any>>;
|
|
@@ -289,7 +293,7 @@ declare class Client {
|
|
|
289
293
|
logout: () => Promise<any>;
|
|
290
294
|
recoveryVerification: (email: string, verificationCode: string) => Promise<any>;
|
|
291
295
|
recoveryInit: (email: string) => Promise<any>;
|
|
292
|
-
preSignMessage: (userId: string, walletId: string, message: string, scheme?: TWalletScheme, cosmosSignDoc?: string, protocolId?: string) => Promise<any>;
|
|
296
|
+
preSignMessage: (userId: string, walletId: string, message: string, scheme?: TWalletScheme, cosmosSignDoc?: string, protocolId?: string, useNewOT?: boolean) => Promise<any>;
|
|
293
297
|
deleteSelf: (userId: string) => Promise<any>;
|
|
294
298
|
uploadKeyshares(userId: string, walletId: string, encryptedKeyshares: EncryptedKeyShare[]): Promise<any>;
|
|
295
299
|
uploadUserKeyShares(userId: string, encryptedKeyshares: (EncryptedKeyShare & {
|
|
@@ -481,6 +485,7 @@ declare class Client {
|
|
|
481
485
|
sdkType: SDKType;
|
|
482
486
|
userId: string;
|
|
483
487
|
sdkVersion?: string;
|
|
488
|
+
context?: Record<string, unknown>;
|
|
484
489
|
}) => Promise<void>;
|
|
485
490
|
trackReactSdkAnalytics: (opts: {
|
|
486
491
|
props: object;
|
package/dist/types/consts.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
|
|
2
2
|
export declare const VERSION_HEADER_NAME = "x-para-version";
|
|
3
|
+
export declare const CLIENT_TYPE_HEADER_NAME = "x-para-client-type";
|
|
3
4
|
export declare const PARTNER_ID_HEADER_NAME = "x-partner-id";
|
|
4
5
|
export declare const API_KEY_HEADER_NAME = "X-External-API-Key";
|
|
5
6
|
export declare const PARTNER_CONFIG_OVERRIDE_HEADER_NAME = "x-partner-config-override";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@getpara/shared": "^1.21.0",
|
|
6
6
|
"@opentelemetry/api": "^1.9.1",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist",
|
|
23
23
|
"package.json"
|
|
24
24
|
],
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "096152f48e9d9a64fdb192588315c64d33d15a1b",
|
|
26
26
|
"main": "dist/cjs/index.js",
|
|
27
27
|
"module": "dist/esm/index.js",
|
|
28
28
|
"scripts": {
|