@getpara/user-management-client 2.8.0 → 2.10.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 -2
- package/dist/cjs/index.js +3 -0
- package/dist/esm/client.js +6 -2
- package/dist/esm/index.js +2 -0
- package/dist/types/client.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -3
package/dist/cjs/client.js
CHANGED
|
@@ -92,7 +92,7 @@ const handleResponseSuccess = (response) => {
|
|
|
92
92
|
throw new import_error.ParaApiError("Invalid status code");
|
|
93
93
|
};
|
|
94
94
|
const handleResponseError = (error) => {
|
|
95
|
-
var _a, _b, _c;
|
|
95
|
+
var _a, _b, _c, _d;
|
|
96
96
|
if (error === null) throw new import_error.ParaApiError("Error is null");
|
|
97
97
|
if (import_axios.default.isAxiosError(error)) {
|
|
98
98
|
let message = (_b = (_a = error.response) == null ? void 0 : _a.data) != null ? _b : "Unknown error";
|
|
@@ -101,7 +101,7 @@ const handleResponseError = (error) => {
|
|
|
101
101
|
} else if (error.code === "ERR_CANCELED") {
|
|
102
102
|
message = "Connection canceled";
|
|
103
103
|
}
|
|
104
|
-
throw new import_error.ParaApiError(message, error.code, error.response.status, (
|
|
104
|
+
throw new import_error.ParaApiError(message, error.code, (_c = error.response) == null ? void 0 : _c.status, (_d = error.request) == null ? void 0 : _d.responseURL);
|
|
105
105
|
}
|
|
106
106
|
throw new import_error.ParaApiError("Unknown error");
|
|
107
107
|
};
|
|
@@ -531,6 +531,10 @@ class Client {
|
|
|
531
531
|
});
|
|
532
532
|
return res.data;
|
|
533
533
|
});
|
|
534
|
+
this.getPregenShares = (encryptedPayload) => __async(this, null, function* () {
|
|
535
|
+
const res = yield this.baseRequest.post(`/enclave/pregen-shares`, { encryptedPayload });
|
|
536
|
+
return res.data;
|
|
537
|
+
});
|
|
534
538
|
this.getUserPreferences = (userId) => __async(this, null, function* () {
|
|
535
539
|
const res = yield this.baseRequest.get(`/users/${userId}/preferences`);
|
|
536
540
|
return res.data;
|
package/dist/cjs/index.js
CHANGED
|
@@ -28,17 +28,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var src_exports = {};
|
|
30
30
|
__export(src_exports, {
|
|
31
|
+
SESSION_COOKIE_HEADER_NAME: () => import_consts.SESSION_COOKIE_HEADER_NAME,
|
|
31
32
|
default: () => src_default
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(src_exports);
|
|
34
35
|
__reExport(src_exports, require("./client.js"), module.exports);
|
|
35
36
|
__reExport(src_exports, require("./utils.js"), module.exports);
|
|
36
37
|
__reExport(src_exports, require("./error.js"), module.exports);
|
|
38
|
+
var import_consts = require("./consts.js");
|
|
37
39
|
__reExport(src_exports, require("@getpara/shared"), module.exports);
|
|
38
40
|
var import_client = __toESM(require("./client.js"));
|
|
39
41
|
var src_default = import_client.default;
|
|
40
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
43
|
0 && (module.exports = {
|
|
44
|
+
SESSION_COOKIE_HEADER_NAME,
|
|
42
45
|
...require("./client.js"),
|
|
43
46
|
...require("./utils.js"),
|
|
44
47
|
...require("./error.js"),
|
package/dist/esm/client.js
CHANGED
|
@@ -15,7 +15,7 @@ const handleResponseSuccess = (response) => {
|
|
|
15
15
|
throw new ParaApiError("Invalid status code");
|
|
16
16
|
};
|
|
17
17
|
const handleResponseError = (error) => {
|
|
18
|
-
var _a, _b, _c;
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
19
|
if (error === null) throw new ParaApiError("Error is null");
|
|
20
20
|
if (axios.isAxiosError(error)) {
|
|
21
21
|
let message = (_b = (_a = error.response) == null ? void 0 : _a.data) != null ? _b : "Unknown error";
|
|
@@ -24,7 +24,7 @@ const handleResponseError = (error) => {
|
|
|
24
24
|
} else if (error.code === "ERR_CANCELED") {
|
|
25
25
|
message = "Connection canceled";
|
|
26
26
|
}
|
|
27
|
-
throw new ParaApiError(message, error.code, error.response.status, (
|
|
27
|
+
throw new ParaApiError(message, error.code, (_c = error.response) == null ? void 0 : _c.status, (_d = error.request) == null ? void 0 : _d.responseURL);
|
|
28
28
|
}
|
|
29
29
|
throw new ParaApiError("Unknown error");
|
|
30
30
|
};
|
|
@@ -454,6 +454,10 @@ class Client {
|
|
|
454
454
|
});
|
|
455
455
|
return res.data;
|
|
456
456
|
});
|
|
457
|
+
this.getPregenShares = (encryptedPayload) => __async(this, null, function* () {
|
|
458
|
+
const res = yield this.baseRequest.post(`/enclave/pregen-shares`, { encryptedPayload });
|
|
459
|
+
return res.data;
|
|
460
|
+
});
|
|
457
461
|
this.getUserPreferences = (userId) => __async(this, null, function* () {
|
|
458
462
|
const res = yield this.baseRequest.get(`/users/${userId}/preferences`);
|
|
459
463
|
return res.data;
|
package/dist/esm/index.js
CHANGED
|
@@ -2,9 +2,11 @@ import "./chunk-BBZEL7EG.js";
|
|
|
2
2
|
export * from "./client.js";
|
|
3
3
|
export * from "./utils.js";
|
|
4
4
|
export * from "./error.js";
|
|
5
|
+
import { SESSION_COOKIE_HEADER_NAME } from "./consts.js";
|
|
5
6
|
export * from "@getpara/shared";
|
|
6
7
|
import Client from "./client.js";
|
|
7
8
|
var src_default = Client;
|
|
8
9
|
export {
|
|
10
|
+
SESSION_COOKIE_HEADER_NAME,
|
|
9
11
|
src_default as default
|
|
10
12
|
};
|
package/dist/types/client.d.ts
CHANGED
|
@@ -481,6 +481,9 @@ declare class Client {
|
|
|
481
481
|
deleteEnclaveShares: (encryptedPayload: string) => Promise<{
|
|
482
482
|
payload: any;
|
|
483
483
|
}>;
|
|
484
|
+
getPregenShares: (encryptedPayload: string) => Promise<{
|
|
485
|
+
payload: string;
|
|
486
|
+
}>;
|
|
484
487
|
getUserPreferences: (userId: string) => Promise<{
|
|
485
488
|
preferences: UserPreferences;
|
|
486
489
|
}>;
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/shared": "1.
|
|
5
|
+
"@getpara/shared": "1.10.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": "8da2c51cc91f021acbc2ec7373b9ca0638fc840a",
|
|
24
24
|
"main": "dist/cjs/index.js",
|
|
25
25
|
"module": "dist/esm/index.js",
|
|
26
26
|
"scripts": {
|