@getpara/user-management-client 2.15.0 → 2.17.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 +9 -2
- package/dist/cjs/consts.js +3 -0
- package/dist/esm/client.js +16 -3
- package/dist/esm/consts.js +2 -0
- package/dist/types/client.d.ts +6 -1
- package/dist/types/consts.d.ts +1 -0
- package/package.json +3 -3
package/dist/cjs/client.js
CHANGED
|
@@ -113,7 +113,8 @@ class Client {
|
|
|
113
113
|
version,
|
|
114
114
|
opts,
|
|
115
115
|
retrieveSessionCookie,
|
|
116
|
-
persistSessionCookie
|
|
116
|
+
persistSessionCookie,
|
|
117
|
+
partnerConfigOverride
|
|
117
118
|
}) {
|
|
118
119
|
this.signUpOrLogIn = (body) => __async(this, null, function* () {
|
|
119
120
|
const res = yield this.baseRequest.post(`/users/init`, body);
|
|
@@ -573,7 +574,7 @@ class Client {
|
|
|
573
574
|
});
|
|
574
575
|
return { success: res.data.success };
|
|
575
576
|
});
|
|
576
|
-
const headers = __spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId });
|
|
577
|
+
const headers = __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) });
|
|
577
578
|
const axiosConfig = {
|
|
578
579
|
baseURL: userManagementHost,
|
|
579
580
|
withCredentials: true,
|
|
@@ -827,6 +828,12 @@ class Client {
|
|
|
827
828
|
return res;
|
|
828
829
|
});
|
|
829
830
|
}
|
|
831
|
+
getPolicyPermissions(userId, policyId) {
|
|
832
|
+
return __async(this, null, function* () {
|
|
833
|
+
const res = yield this.baseRequest.get(`/users/${userId}/policies/${policyId}/permissions`);
|
|
834
|
+
return res.data;
|
|
835
|
+
});
|
|
836
|
+
}
|
|
830
837
|
acceptScopes(userId, walletId, body) {
|
|
831
838
|
return __async(this, null, function* () {
|
|
832
839
|
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/scopes/accept`, body);
|
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
|
+
PARTNER_CONFIG_OVERRIDE_HEADER_NAME: () => PARTNER_CONFIG_OVERRIDE_HEADER_NAME,
|
|
21
22
|
PARTNER_ID_HEADER_NAME: () => PARTNER_ID_HEADER_NAME,
|
|
22
23
|
SESSION_COOKIE_HEADER_NAME: () => SESSION_COOKIE_HEADER_NAME,
|
|
23
24
|
VERSION_HEADER_NAME: () => VERSION_HEADER_NAME
|
|
@@ -27,9 +28,11 @@ const SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
|
|
|
27
28
|
const VERSION_HEADER_NAME = "x-para-version";
|
|
28
29
|
const PARTNER_ID_HEADER_NAME = "x-partner-id";
|
|
29
30
|
const API_KEY_HEADER_NAME = "X-External-API-Key";
|
|
31
|
+
const PARTNER_CONFIG_OVERRIDE_HEADER_NAME = "x-partner-config-override";
|
|
30
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
33
|
0 && (module.exports = {
|
|
32
34
|
API_KEY_HEADER_NAME,
|
|
35
|
+
PARTNER_CONFIG_OVERRIDE_HEADER_NAME,
|
|
33
36
|
PARTNER_ID_HEADER_NAME,
|
|
34
37
|
SESSION_COOKIE_HEADER_NAME,
|
|
35
38
|
VERSION_HEADER_NAME
|
package/dist/esm/client.js
CHANGED
|
@@ -6,7 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-BBZEL7EG.js";
|
|
7
7
|
import axios from "axios";
|
|
8
8
|
import { extractWalletRef, fromAccountMetadata, fromLinkedAccounts } from "./utils.js";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
SESSION_COOKIE_HEADER_NAME,
|
|
11
|
+
VERSION_HEADER_NAME,
|
|
12
|
+
PARTNER_ID_HEADER_NAME,
|
|
13
|
+
API_KEY_HEADER_NAME,
|
|
14
|
+
PARTNER_CONFIG_OVERRIDE_HEADER_NAME
|
|
15
|
+
} from "./consts.js";
|
|
10
16
|
import { ParaApiError } from "./error.js";
|
|
11
17
|
const handleResponseSuccess = (response) => {
|
|
12
18
|
if (response.status === 200) {
|
|
@@ -36,7 +42,8 @@ class Client {
|
|
|
36
42
|
version,
|
|
37
43
|
opts,
|
|
38
44
|
retrieveSessionCookie,
|
|
39
|
-
persistSessionCookie
|
|
45
|
+
persistSessionCookie,
|
|
46
|
+
partnerConfigOverride
|
|
40
47
|
}) {
|
|
41
48
|
this.signUpOrLogIn = (body) => __async(this, null, function* () {
|
|
42
49
|
const res = yield this.baseRequest.post(`/users/init`, body);
|
|
@@ -496,7 +503,7 @@ class Client {
|
|
|
496
503
|
});
|
|
497
504
|
return { success: res.data.success };
|
|
498
505
|
});
|
|
499
|
-
const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
|
|
506
|
+
const headers = __spreadValues(__spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId }), partnerConfigOverride && { [PARTNER_CONFIG_OVERRIDE_HEADER_NAME]: JSON.stringify(partnerConfigOverride) });
|
|
500
507
|
const axiosConfig = {
|
|
501
508
|
baseURL: userManagementHost,
|
|
502
509
|
withCredentials: true,
|
|
@@ -750,6 +757,12 @@ class Client {
|
|
|
750
757
|
return res;
|
|
751
758
|
});
|
|
752
759
|
}
|
|
760
|
+
getPolicyPermissions(userId, policyId) {
|
|
761
|
+
return __async(this, null, function* () {
|
|
762
|
+
const res = yield this.baseRequest.get(`/users/${userId}/policies/${policyId}/permissions`);
|
|
763
|
+
return res.data;
|
|
764
|
+
});
|
|
765
|
+
}
|
|
753
766
|
acceptScopes(userId, walletId, body) {
|
|
754
767
|
return __async(this, null, function* () {
|
|
755
768
|
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/scopes/accept`, body);
|
package/dist/esm/consts.js
CHANGED
|
@@ -3,8 +3,10 @@ const SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
|
|
|
3
3
|
const VERSION_HEADER_NAME = "x-para-version";
|
|
4
4
|
const PARTNER_ID_HEADER_NAME = "x-partner-id";
|
|
5
5
|
const API_KEY_HEADER_NAME = "X-External-API-Key";
|
|
6
|
+
const PARTNER_CONFIG_OVERRIDE_HEADER_NAME = "x-partner-config-override";
|
|
6
7
|
export {
|
|
7
8
|
API_KEY_HEADER_NAME,
|
|
9
|
+
PARTNER_CONFIG_OVERRIDE_HEADER_NAME,
|
|
8
10
|
PARTNER_ID_HEADER_NAME,
|
|
9
11
|
SESSION_COOKIE_HEADER_NAME,
|
|
10
12
|
VERSION_HEADER_NAME
|
package/dist/types/client.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ type ClientConfig = {
|
|
|
11
11
|
opts?: ConfigOpts;
|
|
12
12
|
retrieveSessionCookie?: () => string | undefined;
|
|
13
13
|
persistSessionCookie?: (cookie: string) => void;
|
|
14
|
+
/** E2E only: partner config overrides sent via X-Partner-Config-Override header. */
|
|
15
|
+
partnerConfigOverride?: Record<string, unknown>;
|
|
14
16
|
};
|
|
15
17
|
interface createUserIdRes {
|
|
16
18
|
protocolId: string;
|
|
@@ -144,7 +146,7 @@ export declare const handleResponseSuccess: (response: AxiosResponse<any, any>)
|
|
|
144
146
|
export declare const handleResponseError: (error: any) => never;
|
|
145
147
|
declare class Client {
|
|
146
148
|
private baseRequest;
|
|
147
|
-
constructor({ userManagementHost, apiKey, partnerId, version, opts, retrieveSessionCookie, persistSessionCookie, }: ClientConfig);
|
|
149
|
+
constructor({ userManagementHost, apiKey, partnerId, version, opts, retrieveSessionCookie, persistSessionCookie, partnerConfigOverride, }: ClientConfig);
|
|
148
150
|
signUpOrLogIn: (body: VerifiedAuth & VerificationEmailProps) => Promise<SignUpOrLogInResponse>;
|
|
149
151
|
/**
|
|
150
152
|
* @deprecated
|
|
@@ -319,6 +321,9 @@ declare class Client {
|
|
|
319
321
|
tempTrasmissionInit(message: string, userId?: string): Promise<AxiosResponse<any, any>>;
|
|
320
322
|
tempTrasmission(id: string): Promise<AxiosResponse<any, any>>;
|
|
321
323
|
getPartner(partnerId: string): Promise<AxiosResponse<any, any>>;
|
|
324
|
+
getPolicyPermissions(userId: string, policyId: string): Promise<{
|
|
325
|
+
allAccepted: boolean;
|
|
326
|
+
}>;
|
|
322
327
|
acceptScopes(userId: string, walletId: string, body: AcceptScopesBody): Promise<AxiosResponse<any, any>>;
|
|
323
328
|
getPendingTransaction(userId: string, pendingTransactionId: string): Promise<AxiosResponse<any, any>>;
|
|
324
329
|
acceptPendingTransaction(userId: string, pendingTransactionId: string): Promise<AxiosResponse<any, any>>;
|
package/dist/types/consts.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare const SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
|
|
|
2
2
|
export declare const VERSION_HEADER_NAME = "x-para-version";
|
|
3
3
|
export declare const PARTNER_ID_HEADER_NAME = "x-partner-id";
|
|
4
4
|
export declare const API_KEY_HEADER_NAME = "X-External-API-Key";
|
|
5
|
+
export declare const PARTNER_CONFIG_OVERRIDE_HEADER_NAME = "x-partner-config-override";
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/shared": "1.11.0",
|
|
5
|
+
"@getpara/shared": "^1.11.0",
|
|
6
6
|
"axios": "^1.8.4",
|
|
7
7
|
"libphonenumber-js": "^1.11.7"
|
|
8
8
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dist",
|
|
21
21
|
"package.json"
|
|
22
22
|
],
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "3ed1f835b97ae720f1ac747611296e3b86f61138",
|
|
24
24
|
"main": "dist/cjs/index.js",
|
|
25
25
|
"module": "dist/esm/index.js",
|
|
26
26
|
"scripts": {
|