@arv-bedrock/auth-sso 0.3.3 → 0.4.2
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/README.md +87 -0
- package/dist/cjs/auth.js +45 -0
- package/dist/cjs/index.js +23 -1
- package/dist/cjs/types/auth.d.ts +4 -1
- package/dist/cjs/types/auth.d.ts.map +1 -1
- package/dist/cjs/types/index.d.ts +20 -1
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/utils/_fetch.d.ts.map +1 -1
- package/dist/cjs/types/utils/types.d.ts +23 -0
- package/dist/cjs/types/utils/types.d.ts.map +1 -1
- package/dist/cjs/utils/_fetch.js +9 -4
- package/dist/esm/auth.js +45 -0
- package/dist/esm/index.mjs +19 -0
- package/dist/esm/types/auth.d.ts +4 -1
- package/dist/esm/types/auth.d.ts.map +1 -1
- package/dist/esm/types/index.d.ts +20 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/utils/_fetch.d.ts.map +1 -1
- package/dist/esm/types/utils/types.d.ts +23 -0
- package/dist/esm/types/utils/types.d.ts.map +1 -1
- package/dist/esm/utils/_fetch.js +9 -4
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -156,6 +156,48 @@ await BedrockAuth.requestInviting("user@example.com", 7);
|
|
|
156
156
|
console.log("Invitation sent.");
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
+
### Import/Update/Delete Users
|
|
160
|
+
|
|
161
|
+
#### `importUsers(usres: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>`
|
|
162
|
+
Import users for preregistration
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
const importUser = await BedrockAuth.importUsers([{
|
|
166
|
+
title: "title";
|
|
167
|
+
email: "email";
|
|
168
|
+
firstName: "firstName";
|
|
169
|
+
lastName: "lastName";
|
|
170
|
+
phoneNumber: "phoneNumber";
|
|
171
|
+
}]);
|
|
172
|
+
console.log("ImportUsers", importUser);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### UpdateImportUsers
|
|
176
|
+
|
|
177
|
+
#### `updateImportUsers(usres: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>`
|
|
178
|
+
Update the previously existing and unexpired imported records via email
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
const updateImportUser = await BedrockAuth.updateImportUsers([{
|
|
182
|
+
title: "title";
|
|
183
|
+
email: "email";
|
|
184
|
+
firstName: "firstName";
|
|
185
|
+
lastName: "lastName";
|
|
186
|
+
phoneNumber: "phoneNumber";
|
|
187
|
+
}]);
|
|
188
|
+
console.log("updateImportUser", updateImportUser);
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### DeleteImportUsers
|
|
192
|
+
|
|
193
|
+
#### `deleteImportUsers(usres: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>`
|
|
194
|
+
Delete the previously existing and unexpired imported records via email
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
const deleteImportUser = await BedrockAuth.deleteImportUsers(["example@gmail.com", "email@gmail.com"]);
|
|
198
|
+
console.log("deleteImportUser", deleteImportUser);
|
|
199
|
+
```
|
|
200
|
+
|
|
159
201
|
---
|
|
160
202
|
|
|
161
203
|
## Advanced Features
|
|
@@ -214,3 +256,48 @@ export type UpdateProfile = {
|
|
|
214
256
|
picture?: string | undefined | null;
|
|
215
257
|
};
|
|
216
258
|
```
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
### `ImportUserType`
|
|
262
|
+
|
|
263
|
+
Represents the input data required to import a single user into the system.
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
export type ImportUserType {
|
|
267
|
+
title?: string;
|
|
268
|
+
email: string;
|
|
269
|
+
firstName?: string;
|
|
270
|
+
lastName?: string;
|
|
271
|
+
phoneNumber?: string;
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### `ImportUserResponse`
|
|
276
|
+
|
|
277
|
+
The response structure returned after processing a batch import of users. Contains a correlation ID for tracking and a list of per-user results.
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
export type ImportUserResponse {
|
|
281
|
+
correlationId: string;
|
|
282
|
+
results: ImportUserResult[];
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### `ImportUserResult`
|
|
287
|
+
|
|
288
|
+
Detailed result of an individual user import operation, including whether it succeeded and any failure reasons.
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
export type ImportUserResult {
|
|
292
|
+
i: number;
|
|
293
|
+
email: string;
|
|
294
|
+
success: boolean;
|
|
295
|
+
reasons: string[];
|
|
296
|
+
code?: string;
|
|
297
|
+
title?: string;
|
|
298
|
+
firstName?: string;
|
|
299
|
+
lastName?: string;
|
|
300
|
+
phoneNumber?: string;
|
|
301
|
+
expireAt?: string;
|
|
302
|
+
}
|
|
303
|
+
```
|
package/dist/cjs/auth.js
CHANGED
|
@@ -311,6 +311,51 @@ class Auth {
|
|
|
311
311
|
const query = `${this.queryString}&redirectUri=${redirectUrl ? redirectUrl : url}`;
|
|
312
312
|
window.location.assign(`${this.authHost}/auth/manage-account?${query}`);
|
|
313
313
|
}
|
|
314
|
+
importUsers(users, duration) {
|
|
315
|
+
if (this.isCitizen()) {
|
|
316
|
+
throw new Error("support officer only");
|
|
317
|
+
}
|
|
318
|
+
let queryParam = "";
|
|
319
|
+
if (typeof duration === "number")
|
|
320
|
+
queryParam = `&duration=${duration}`;
|
|
321
|
+
return (0, _fetch_1.default)(`${this.authHost}/api/v2/register/import?${this.queryString}${queryParam}`, {
|
|
322
|
+
method: "POST",
|
|
323
|
+
retryCount: 1,
|
|
324
|
+
timeout: -1,
|
|
325
|
+
body: JSON.stringify(users),
|
|
326
|
+
headers: {
|
|
327
|
+
"x-client-id": this.clientId,
|
|
328
|
+
},
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
updateImportUsers(users) {
|
|
332
|
+
if (this.isCitizen()) {
|
|
333
|
+
throw new Error("support officer only");
|
|
334
|
+
}
|
|
335
|
+
return (0, _fetch_1.default)(`${this.authHost}/api/v2/register/import?${this.queryString}`, {
|
|
336
|
+
method: "PATCH",
|
|
337
|
+
retryCount: 1,
|
|
338
|
+
timeout: -1,
|
|
339
|
+
body: JSON.stringify(users),
|
|
340
|
+
headers: {
|
|
341
|
+
"x-client-id": this.clientId,
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
deleteImportUsers(emails) {
|
|
346
|
+
if (this.isCitizen()) {
|
|
347
|
+
throw new Error("support officer only");
|
|
348
|
+
}
|
|
349
|
+
return (0, _fetch_1.default)(`${this.authHost}/api/v2/register/import?${this.queryString}`, {
|
|
350
|
+
method: "DELETE",
|
|
351
|
+
retryCount: 1,
|
|
352
|
+
timeout: -1,
|
|
353
|
+
body: JSON.stringify(emails),
|
|
354
|
+
headers: {
|
|
355
|
+
"x-client-id": this.clientId,
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
}
|
|
314
359
|
}
|
|
315
360
|
const bedRockAuth = new Auth();
|
|
316
361
|
exports.default = bedRockAuth;
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.doManageAccount = exports.refreshToken = exports.updateProfile = exports.disabledAccount = exports.requestInviting = exports.verifyToken = exports.getRedirectUri = exports.doPortal = exports.getCode = exports.clearCookie = exports.getProfile = exports.setCookie = exports.doRegister = exports.doLogout = exports.doLogin = exports.initBedrockAuth = void 0;
|
|
15
|
+
exports.deleteImportUsers = exports.updateImportUsers = exports.importUsers = exports.doManageAccount = exports.refreshToken = exports.updateProfile = exports.disabledAccount = exports.requestInviting = exports.verifyToken = exports.getRedirectUri = exports.doPortal = exports.getCode = exports.clearCookie = exports.getProfile = exports.setCookie = exports.doRegister = exports.doLogout = exports.doLogin = exports.initBedrockAuth = void 0;
|
|
16
16
|
const auth_1 = __importDefault(require("./auth"));
|
|
17
17
|
const constant_1 = require("./utils/constant");
|
|
18
18
|
const initBedrockAuth = ({ authUri, clientId, clientSecret, callback, userType, reconnection, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -67,3 +67,25 @@ const refreshToken = () => auth_1.default.refreshToken();
|
|
|
67
67
|
exports.refreshToken = refreshToken;
|
|
68
68
|
const doManageAccount = (redirectUrl) => auth_1.default.doManageAccount(redirectUrl);
|
|
69
69
|
exports.doManageAccount = doManageAccount;
|
|
70
|
+
/**
|
|
71
|
+
* Imports users for preregistration.
|
|
72
|
+
*
|
|
73
|
+
* @param {ImportUserType[]} body - List of users to import
|
|
74
|
+
* @param {number} [duration] - duration (Optional)
|
|
75
|
+
*/
|
|
76
|
+
const importUsers = (body, duration) => auth_1.default.importUsers(body, duration);
|
|
77
|
+
exports.importUsers = importUsers;
|
|
78
|
+
/**
|
|
79
|
+
* Update the previously existing and unexpired imported records via email.
|
|
80
|
+
*
|
|
81
|
+
* @param {ImportUserType[]} body - List of users with updated information.
|
|
82
|
+
*/
|
|
83
|
+
const updateImportUsers = (body) => auth_1.default.updateImportUsers(body);
|
|
84
|
+
exports.updateImportUsers = updateImportUsers;
|
|
85
|
+
/**
|
|
86
|
+
* Delete the previously existing and unexpired imported records via email.
|
|
87
|
+
*
|
|
88
|
+
* @param {string[]} body - List of user emails to delete.
|
|
89
|
+
*/
|
|
90
|
+
const deleteImportUsers = (body) => auth_1.default.deleteImportUsers(body);
|
|
91
|
+
exports.deleteImportUsers = deleteImportUsers;
|
package/dist/cjs/types/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthServiceResponse, ClientInfo, ClientInit, DisabledAccount, Options, RefreshTokenResponse, ResponseData, UpdateProfile } from "./utils/types";
|
|
1
|
+
import { AuthServiceResponse, ClientInfo, ClientInit, DisabledAccount, ImportUserResponse, ImportUserType, Options, RefreshTokenResponse, ResponseData, UpdateProfile } from "./utils/types";
|
|
2
2
|
declare class Auth {
|
|
3
3
|
private userType;
|
|
4
4
|
private authHost;
|
|
@@ -32,6 +32,9 @@ declare class Auth {
|
|
|
32
32
|
disabledAccount(body: DisabledAccount): Promise<ResponseData<[]>>;
|
|
33
33
|
refreshToken(): Promise<ResponseData<RefreshTokenResponse>>;
|
|
34
34
|
doManageAccount(redirectUrl?: string): void;
|
|
35
|
+
importUsers(users: ImportUserType[], duration?: number): Promise<ResponseData<ImportUserResponse>>;
|
|
36
|
+
updateImportUsers(users: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>;
|
|
37
|
+
deleteImportUsers(emails: string[]): Promise<ResponseData<ImportUserResponse>>;
|
|
35
38
|
}
|
|
36
39
|
declare const bedRockAuth: Auth;
|
|
37
40
|
export default bedRockAuth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../auth.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,UAAU,EAEV,eAAe,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../auth.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,UAAU,EAEV,eAAe,EACf,kBAAkB,EAClB,cAAc,EAEd,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,aAAa,EAEd,MAAM,eAAe,CAAC;AAEvB,cAAM,IAAI;IACR,OAAO,CAAC,QAAQ,CAAW;IAE3B,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAa;;IAqB/B,SAAS;IAIF,OAAO;IAKP,cAAc;IAKrB,OAAO,CAAC,cAAc;IAUf,OAAO,CAAC,WAAW,GAAE,MAA6B;IAalD,QAAQ,iBAAwB,MAAM,mBAkB3C;IAEK,UAAU,CAAC,WAAW,GAAE,MAA6B;IAc5D,OAAO,CAAC,gBAAgB;IAQX,IAAI,CAAC,OAAO,EAAE,OAAO;IAkBrB,SAAS,CAAC,IAAI,EAAE,MAAM;YAuBrB,oBAAoB;IAgBlC,OAAO,CAAC,QAAQ;IAIH,aAAa;YAWZ,aAAa;IAqBd,WAAW;IAYX,cAAc;IAYd,UAAU;IA2BhB,QAAQ;IASR,WAAW;IAqBX,eAAe,CACpB,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAuD;IAY5D,aAAa,CAAC,IAAI,EAAE,aAAa;IAqBjC,eAAe,CAAC,IAAI,EAAE,eAAe;IAYrC,YAAY;IAkBZ,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM;IAapC,WAAW,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM;IAuBtD,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE;IAmBzC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE;CAkB1C;AAED,QAAA,MAAM,WAAW,MAAa,CAAC;AAE/B,eAAe,WAAW,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DisabledAccount, UpdateProfile, UserType } from "./utils/types";
|
|
1
|
+
import { DisabledAccount, ImportUserType, UpdateProfile, UserType } from "./utils/types";
|
|
2
2
|
export type AuthProps = {
|
|
3
3
|
userType?: UserType;
|
|
4
4
|
authUri: string;
|
|
@@ -27,4 +27,23 @@ export declare const disabledAccount: (body: DisabledAccount) => Promise<import(
|
|
|
27
27
|
export declare const updateProfile: (body: UpdateProfile) => Promise<import("./utils/types").ResponseData<[]>>;
|
|
28
28
|
export declare const refreshToken: () => Promise<import("./utils/types").ResponseData<import("./utils/types").RefreshTokenResponse>>;
|
|
29
29
|
export declare const doManageAccount: (redirectUrl?: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Imports users for preregistration.
|
|
32
|
+
*
|
|
33
|
+
* @param {ImportUserType[]} body - List of users to import
|
|
34
|
+
* @param {number} [duration] - duration (Optional)
|
|
35
|
+
*/
|
|
36
|
+
export declare const importUsers: (body: ImportUserType[], duration?: number) => Promise<import("./utils/types").ResponseData<import("./utils/types").ImportUserResponse>>;
|
|
37
|
+
/**
|
|
38
|
+
* Update the previously existing and unexpired imported records via email.
|
|
39
|
+
*
|
|
40
|
+
* @param {ImportUserType[]} body - List of users with updated information.
|
|
41
|
+
*/
|
|
42
|
+
export declare const updateImportUsers: (body: ImportUserType[]) => Promise<import("./utils/types").ResponseData<import("./utils/types").ImportUserResponse>>;
|
|
43
|
+
/**
|
|
44
|
+
* Delete the previously existing and unexpired imported records via email.
|
|
45
|
+
*
|
|
46
|
+
* @param {string[]} body - List of user emails to delete.
|
|
47
|
+
*/
|
|
48
|
+
export declare const deleteImportUsers: (body: string[]) => Promise<import("./utils/types").ResponseData<import("./utils/types").ImportUserResponse>>;
|
|
30
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,cAAc,EACd,aAAa,EACb,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;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AU,kBAAmB,SAAQ,WAAW;IAC9C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,QAIA;AAED,iBAAe,WAAW,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"_fetch.d.ts","sourceRoot":"","sources":["../../../../utils/_fetch.ts"],"names":[],"mappings":"AAUA,UAAU,kBAAmB,SAAQ,WAAW;IAC9C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,QAIA;AAED,iBAAe,WAAW,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,CAAC,CAAC,CAqEZ;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -80,4 +80,27 @@ export interface RefreshTokenResponse {
|
|
|
80
80
|
refreshToken: string;
|
|
81
81
|
refreshExpiresIn: number;
|
|
82
82
|
}
|
|
83
|
+
export interface ImportUserType {
|
|
84
|
+
title?: string;
|
|
85
|
+
email: string;
|
|
86
|
+
firstName?: string;
|
|
87
|
+
lastName?: string;
|
|
88
|
+
phoneNumber?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ImportUserResponse {
|
|
91
|
+
correlationId: string;
|
|
92
|
+
results: ImportUserResult[];
|
|
93
|
+
}
|
|
94
|
+
export interface ImportUserResult {
|
|
95
|
+
i: number;
|
|
96
|
+
email: string;
|
|
97
|
+
success: boolean;
|
|
98
|
+
reasons: string[];
|
|
99
|
+
code?: string;
|
|
100
|
+
title?: string;
|
|
101
|
+
firstName?: string;
|
|
102
|
+
lastName?: string;
|
|
103
|
+
phoneNumber?: string;
|
|
104
|
+
expireAt?: string;
|
|
105
|
+
}
|
|
83
106
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEnE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7C,MAAM,WAAW,IAAI;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,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gB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/cjs/utils/_fetch.js
CHANGED
|
@@ -32,11 +32,16 @@ function customFetch(url, options = {}) {
|
|
|
32
32
|
requestOptions.headers = headers;
|
|
33
33
|
while (attempt < maxRetries) {
|
|
34
34
|
try {
|
|
35
|
-
const controller = new AbortController();
|
|
36
|
-
const timeoutId =
|
|
37
|
-
|
|
35
|
+
const controller = timeout !== -1 ? new AbortController() : undefined;
|
|
36
|
+
const timeoutId = timeout !== -1
|
|
37
|
+
? setTimeout(() => controller === null || controller === void 0 ? void 0 : controller.abort(), timeout)
|
|
38
|
+
: undefined;
|
|
39
|
+
if (controller) {
|
|
40
|
+
requestOptions.signal = controller.signal;
|
|
41
|
+
}
|
|
38
42
|
const response = yield fetch(url, requestOptions);
|
|
39
|
-
|
|
43
|
+
if (timeoutId)
|
|
44
|
+
clearTimeout(timeoutId);
|
|
40
45
|
let responseData = null;
|
|
41
46
|
if (!response.ok) {
|
|
42
47
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
package/dist/esm/auth.js
CHANGED
|
@@ -268,6 +268,51 @@ class Auth {
|
|
|
268
268
|
const query = `${this.queryString}&redirectUri=${redirectUrl ? redirectUrl : url}`;
|
|
269
269
|
window.location.assign(`${this.authHost}/auth/manage-account?${query}`);
|
|
270
270
|
}
|
|
271
|
+
importUsers(users, duration) {
|
|
272
|
+
if (this.isCitizen()) {
|
|
273
|
+
throw new Error("support officer only");
|
|
274
|
+
}
|
|
275
|
+
let queryParam = "";
|
|
276
|
+
if (typeof duration === "number")
|
|
277
|
+
queryParam = `&duration=${duration}`;
|
|
278
|
+
return customFetch(`${this.authHost}/api/v2/register/import?${this.queryString}${queryParam}`, {
|
|
279
|
+
method: "POST",
|
|
280
|
+
retryCount: 1,
|
|
281
|
+
timeout: -1,
|
|
282
|
+
body: JSON.stringify(users),
|
|
283
|
+
headers: {
|
|
284
|
+
"x-client-id": this.clientId,
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
updateImportUsers(users) {
|
|
289
|
+
if (this.isCitizen()) {
|
|
290
|
+
throw new Error("support officer only");
|
|
291
|
+
}
|
|
292
|
+
return customFetch(`${this.authHost}/api/v2/register/import?${this.queryString}`, {
|
|
293
|
+
method: "PATCH",
|
|
294
|
+
retryCount: 1,
|
|
295
|
+
timeout: -1,
|
|
296
|
+
body: JSON.stringify(users),
|
|
297
|
+
headers: {
|
|
298
|
+
"x-client-id": this.clientId,
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
deleteImportUsers(emails) {
|
|
303
|
+
if (this.isCitizen()) {
|
|
304
|
+
throw new Error("support officer only");
|
|
305
|
+
}
|
|
306
|
+
return customFetch(`${this.authHost}/api/v2/register/import?${this.queryString}`, {
|
|
307
|
+
method: "DELETE",
|
|
308
|
+
retryCount: 1,
|
|
309
|
+
timeout: -1,
|
|
310
|
+
body: JSON.stringify(emails),
|
|
311
|
+
headers: {
|
|
312
|
+
"x-client-id": this.clientId,
|
|
313
|
+
},
|
|
314
|
+
});
|
|
315
|
+
}
|
|
271
316
|
}
|
|
272
317
|
const bedRockAuth = new Auth();
|
|
273
318
|
export default bedRockAuth;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -35,3 +35,22 @@ export const disabledAccount = (body) => BR.disabledAccount(body);
|
|
|
35
35
|
export const updateProfile = (body) => BR.updateProfile(body);
|
|
36
36
|
export const refreshToken = () => BR.refreshToken();
|
|
37
37
|
export const doManageAccount = (redirectUrl) => BR.doManageAccount(redirectUrl);
|
|
38
|
+
/**
|
|
39
|
+
* Imports users for preregistration.
|
|
40
|
+
*
|
|
41
|
+
* @param {ImportUserType[]} body - List of users to import
|
|
42
|
+
* @param {number} [duration] - duration (Optional)
|
|
43
|
+
*/
|
|
44
|
+
export const importUsers = (body, duration) => BR.importUsers(body, duration);
|
|
45
|
+
/**
|
|
46
|
+
* Update the previously existing and unexpired imported records via email.
|
|
47
|
+
*
|
|
48
|
+
* @param {ImportUserType[]} body - List of users with updated information.
|
|
49
|
+
*/
|
|
50
|
+
export const updateImportUsers = (body) => BR.updateImportUsers(body);
|
|
51
|
+
/**
|
|
52
|
+
* Delete the previously existing and unexpired imported records via email.
|
|
53
|
+
*
|
|
54
|
+
* @param {string[]} body - List of user emails to delete.
|
|
55
|
+
*/
|
|
56
|
+
export const deleteImportUsers = (body) => BR.deleteImportUsers(body);
|
package/dist/esm/types/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthServiceResponse, ClientInfo, ClientInit, DisabledAccount, Options, RefreshTokenResponse, ResponseData, UpdateProfile } from "./utils/types";
|
|
1
|
+
import { AuthServiceResponse, ClientInfo, ClientInit, DisabledAccount, ImportUserResponse, ImportUserType, Options, RefreshTokenResponse, ResponseData, UpdateProfile } from "./utils/types";
|
|
2
2
|
declare class Auth {
|
|
3
3
|
private userType;
|
|
4
4
|
private authHost;
|
|
@@ -32,6 +32,9 @@ declare class Auth {
|
|
|
32
32
|
disabledAccount(body: DisabledAccount): Promise<ResponseData<[]>>;
|
|
33
33
|
refreshToken(): Promise<ResponseData<RefreshTokenResponse>>;
|
|
34
34
|
doManageAccount(redirectUrl?: string): void;
|
|
35
|
+
importUsers(users: ImportUserType[], duration?: number): Promise<ResponseData<ImportUserResponse>>;
|
|
36
|
+
updateImportUsers(users: ImportUserType[]): Promise<ResponseData<ImportUserResponse>>;
|
|
37
|
+
deleteImportUsers(emails: string[]): Promise<ResponseData<ImportUserResponse>>;
|
|
35
38
|
}
|
|
36
39
|
declare const bedRockAuth: Auth;
|
|
37
40
|
export default bedRockAuth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../auth.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,UAAU,EAEV,eAAe,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../auth.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,UAAU,EAEV,eAAe,EACf,kBAAkB,EAClB,cAAc,EAEd,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,aAAa,EAEd,MAAM,eAAe,CAAC;AAEvB,cAAM,IAAI;IACR,OAAO,CAAC,QAAQ,CAAW;IAE3B,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAa;;IAqB/B,SAAS;IAIF,OAAO;IAKP,cAAc;IAKrB,OAAO,CAAC,cAAc;IAUf,OAAO,CAAC,WAAW,GAAE,MAA6B;IAalD,QAAQ,iBAAwB,MAAM,mBAkB3C;IAEK,UAAU,CAAC,WAAW,GAAE,MAA6B;IAc5D,OAAO,CAAC,gBAAgB;IAQX,IAAI,CAAC,OAAO,EAAE,OAAO;IAkBrB,SAAS,CAAC,IAAI,EAAE,MAAM;YAuBrB,oBAAoB;IAgBlC,OAAO,CAAC,QAAQ;IAIH,aAAa;YAWZ,aAAa;IAqBd,WAAW;IAYX,cAAc;IAYd,UAAU;IA2BhB,QAAQ;IASR,WAAW;IAqBX,eAAe,CACpB,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAuD;IAY5D,aAAa,CAAC,IAAI,EAAE,aAAa;IAqBjC,eAAe,CAAC,IAAI,EAAE,eAAe;IAYrC,YAAY;IAkBZ,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM;IAapC,WAAW,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM;IAuBtD,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE;IAmBzC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE;CAkB1C;AAED,QAAA,MAAM,WAAW,MAAa,CAAC;AAE/B,eAAe,WAAW,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DisabledAccount, UpdateProfile, UserType } from "./utils/types";
|
|
1
|
+
import { DisabledAccount, ImportUserType, UpdateProfile, UserType } from "./utils/types";
|
|
2
2
|
export type AuthProps = {
|
|
3
3
|
userType?: UserType;
|
|
4
4
|
authUri: string;
|
|
@@ -27,4 +27,23 @@ export declare const disabledAccount: (body: DisabledAccount) => Promise<import(
|
|
|
27
27
|
export declare const updateProfile: (body: UpdateProfile) => Promise<import("./utils/types").ResponseData<[]>>;
|
|
28
28
|
export declare const refreshToken: () => Promise<import("./utils/types").ResponseData<import("./utils/types").RefreshTokenResponse>>;
|
|
29
29
|
export declare const doManageAccount: (redirectUrl?: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Imports users for preregistration.
|
|
32
|
+
*
|
|
33
|
+
* @param {ImportUserType[]} body - List of users to import
|
|
34
|
+
* @param {number} [duration] - duration (Optional)
|
|
35
|
+
*/
|
|
36
|
+
export declare const importUsers: (body: ImportUserType[], duration?: number) => Promise<import("./utils/types").ResponseData<import("./utils/types").ImportUserResponse>>;
|
|
37
|
+
/**
|
|
38
|
+
* Update the previously existing and unexpired imported records via email.
|
|
39
|
+
*
|
|
40
|
+
* @param {ImportUserType[]} body - List of users with updated information.
|
|
41
|
+
*/
|
|
42
|
+
export declare const updateImportUsers: (body: ImportUserType[]) => Promise<import("./utils/types").ResponseData<import("./utils/types").ImportUserResponse>>;
|
|
43
|
+
/**
|
|
44
|
+
* Delete the previously existing and unexpired imported records via email.
|
|
45
|
+
*
|
|
46
|
+
* @param {string[]} body - List of user emails to delete.
|
|
47
|
+
*/
|
|
48
|
+
export declare const deleteImportUsers: (body: string[]) => Promise<import("./utils/types").ResponseData<import("./utils/types").ImportUserResponse>>;
|
|
30
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,cAAc,EACd,aAAa,EACb,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;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C,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,QAIA;AAED,iBAAe,WAAW,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"_fetch.d.ts","sourceRoot":"","sources":["../../../../utils/_fetch.ts"],"names":[],"mappings":"AAUA,UAAU,kBAAmB,SAAQ,WAAW;IAC9C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,QAIA;AAED,iBAAe,WAAW,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,CAAC,CAAC,CAqEZ;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -80,4 +80,27 @@ export interface RefreshTokenResponse {
|
|
|
80
80
|
refreshToken: string;
|
|
81
81
|
refreshExpiresIn: number;
|
|
82
82
|
}
|
|
83
|
+
export interface ImportUserType {
|
|
84
|
+
title?: string;
|
|
85
|
+
email: string;
|
|
86
|
+
firstName?: string;
|
|
87
|
+
lastName?: string;
|
|
88
|
+
phoneNumber?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ImportUserResponse {
|
|
91
|
+
correlationId: string;
|
|
92
|
+
results: ImportUserResult[];
|
|
93
|
+
}
|
|
94
|
+
export interface ImportUserResult {
|
|
95
|
+
i: number;
|
|
96
|
+
email: string;
|
|
97
|
+
success: boolean;
|
|
98
|
+
reasons: string[];
|
|
99
|
+
code?: string;
|
|
100
|
+
title?: string;
|
|
101
|
+
firstName?: string;
|
|
102
|
+
lastName?: string;
|
|
103
|
+
phoneNumber?: string;
|
|
104
|
+
expireAt?: string;
|
|
105
|
+
}
|
|
83
106
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEnE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7C,MAAM,WAAW,IAAI;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,S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AC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/esm/utils/_fetch.js
CHANGED
|
@@ -24,11 +24,16 @@ async function customFetch(url, options = {}) {
|
|
|
24
24
|
requestOptions.headers = headers;
|
|
25
25
|
while (attempt < maxRetries) {
|
|
26
26
|
try {
|
|
27
|
-
const controller = new AbortController();
|
|
28
|
-
const timeoutId =
|
|
29
|
-
|
|
27
|
+
const controller = timeout !== -1 ? new AbortController() : undefined;
|
|
28
|
+
const timeoutId = timeout !== -1
|
|
29
|
+
? setTimeout(() => controller?.abort(), timeout)
|
|
30
|
+
: undefined;
|
|
31
|
+
if (controller) {
|
|
32
|
+
requestOptions.signal = controller.signal;
|
|
33
|
+
}
|
|
30
34
|
const response = await fetch(url, requestOptions);
|
|
31
|
-
|
|
35
|
+
if (timeoutId)
|
|
36
|
+
clearTimeout(timeoutId);
|
|
32
37
|
let responseData = null;
|
|
33
38
|
if (!response.ok) {
|
|
34
39
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arv-bedrock/auth-sso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"main": "./dist/cjs/index.js",
|
|
5
5
|
"types": "./dist/cjs/types/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -35,11 +35,13 @@
|
|
|
35
35
|
"dist/**/*"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@semantic-release/changelog": "^6.0.
|
|
38
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
39
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
39
40
|
"@semantic-release/git": "^10.0.1",
|
|
40
41
|
"@semantic-release/gitlab": "^9.5.1",
|
|
41
|
-
"@semantic-release/npm": "^9.0.
|
|
42
|
+
"@semantic-release/npm": "^9.0.2",
|
|
42
43
|
"@types/node": "^18.11.9",
|
|
44
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
43
45
|
"cz-conventional-changelog": "^3.3.0",
|
|
44
46
|
"semantic-release": "^20.0.2",
|
|
45
47
|
"tcs": "^10.0.2"
|