@thunderid/node 1.2.2 → 1.3.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/ThunderIDNodeClient.d.ts +38 -1
- package/dist/ThunderIDNodeClient.d.ts.map +1 -1
- package/dist/cjs/index.cjs +45 -0
- package/dist/index.js +46 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BackchannelLogoutResult, ExtendedAuthorizeRequestUrlParams, IdToken, OIDCEndpoints, Storage, ThunderIDJavaScriptClient, TokenExchangeRequestConfig, TokenResponse, User } from '@thunderid/javascript';
|
|
1
|
+
import { BackchannelLogoutResult, ExtendedAuthorizeRequestUrlParams, IdToken, ManagedFlowListResponse, ManagedUserListResponse, ManagedUserTypeListResponse, OIDCEndpoints, Storage, ThunderIDJavaScriptClient, TokenExchangeRequestConfig, TokenResponse, User } from '@thunderid/javascript';
|
|
2
2
|
import { ThunderIDNodeConfig } from './models/config';
|
|
3
3
|
declare class ThunderIDNodeClient<T extends ThunderIDNodeConfig = ThunderIDNodeConfig> extends ThunderIDJavaScriptClient<T> {
|
|
4
4
|
private _nodeInstanceId;
|
|
@@ -59,6 +59,43 @@ declare class ThunderIDNodeClient<T extends ThunderIDNodeConfig = ThunderIDNodeC
|
|
|
59
59
|
* attribute the user type schema declares `credential: true`).
|
|
60
60
|
*/
|
|
61
61
|
updateUserCredentials(payload: Record<string, string>, userId?: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* The URL inputs and bearer token for a management request made on behalf of the session identified by
|
|
64
|
+
* `userId`. The access token stays on the server.
|
|
65
|
+
*/
|
|
66
|
+
private managementRequestConfig;
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves one page of the user directory on behalf of the session identified by `userId`.
|
|
69
|
+
*
|
|
70
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
71
|
+
*/
|
|
72
|
+
getUsers(options?: {
|
|
73
|
+
filter?: string;
|
|
74
|
+
limit?: number;
|
|
75
|
+
offset?: number;
|
|
76
|
+
signal?: AbortSignal;
|
|
77
|
+
}, userId?: string): Promise<ManagedUserListResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Retrieves one page of flows on behalf of the session identified by `userId`.
|
|
80
|
+
*
|
|
81
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
82
|
+
*/
|
|
83
|
+
getFlows(options?: {
|
|
84
|
+
flowType?: string;
|
|
85
|
+
limit?: number;
|
|
86
|
+
offset?: number;
|
|
87
|
+
signal?: AbortSignal;
|
|
88
|
+
}, userId?: string): Promise<ManagedFlowListResponse>;
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves one page of user types on behalf of the session identified by `userId`.
|
|
91
|
+
*
|
|
92
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
93
|
+
*/
|
|
94
|
+
getUserTypes(options?: {
|
|
95
|
+
limit?: number;
|
|
96
|
+
offset?: number;
|
|
97
|
+
signal?: AbortSignal;
|
|
98
|
+
}, userId?: string): Promise<ManagedUserTypeListResponse>;
|
|
62
99
|
}
|
|
63
100
|
export default ThunderIDNodeClient;
|
|
64
101
|
//# sourceMappingURL=ThunderIDNodeClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThunderIDNodeClient.d.ts","sourceRoot":"","sources":["../src/ThunderIDNodeClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,uBAAuB,EACvB,iCAAiC,
|
|
1
|
+
{"version":3,"file":"ThunderIDNodeClient.d.ts","sourceRoot":"","sources":["../src/ThunderIDNodeClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,uBAAuB,EACvB,iCAAiC,EAIjC,OAAO,EAIP,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,aAAa,EAGb,OAAO,EAEP,yBAAyB,EACzB,0BAA0B,EAC1B,aAAa,EAEb,IAAI,EACL,MAAM,uBAAuB,CAAC;AAE/B,OAA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OAAO,GAAE;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAM,EACrE,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,2BAA2B,CAAC;CAGxC;AAED,eAAe,mBAAmB,CAAC"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -436,6 +436,51 @@ var ThunderIDNodeClient = class extends __thunderid_javascript.ThunderIDJavaScri
|
|
|
436
436
|
url: (0, __thunderid_javascript.resolveResourceEndpoint)("usersMeCredentials", configData)
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* The URL inputs and bearer token for a management request made on behalf of the session identified by
|
|
441
|
+
* `userId`. The access token stays on the server.
|
|
442
|
+
*/
|
|
443
|
+
async managementRequestConfig(key, userId) {
|
|
444
|
+
const configData = await this.getStorageManager().getConfigData();
|
|
445
|
+
return {
|
|
446
|
+
baseUrl: configData?.baseUrl,
|
|
447
|
+
headers: { Authorization: `Bearer ${await this.getAccessToken(userId)}` },
|
|
448
|
+
url: (0, __thunderid_javascript.resolveResourceEndpoint)(key, configData)
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Retrieves one page of the user directory on behalf of the session identified by `userId`.
|
|
453
|
+
*
|
|
454
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
455
|
+
*/
|
|
456
|
+
async getUsers(options = {}, userId) {
|
|
457
|
+
return (0, __thunderid_javascript.getUsers)({
|
|
458
|
+
...options,
|
|
459
|
+
...await this.managementRequestConfig("users", userId)
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Retrieves one page of flows on behalf of the session identified by `userId`.
|
|
464
|
+
*
|
|
465
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
466
|
+
*/
|
|
467
|
+
async getFlows(options = {}, userId) {
|
|
468
|
+
return (0, __thunderid_javascript.getFlows)({
|
|
469
|
+
...options,
|
|
470
|
+
...await this.managementRequestConfig("flows", userId)
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Retrieves one page of user types on behalf of the session identified by `userId`.
|
|
475
|
+
*
|
|
476
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
477
|
+
*/
|
|
478
|
+
async getUserTypes(options = {}, userId) {
|
|
479
|
+
return (0, __thunderid_javascript.getUserTypes)({
|
|
480
|
+
...options,
|
|
481
|
+
...await this.managementRequestConfig("userTypes", userId)
|
|
482
|
+
});
|
|
483
|
+
}
|
|
439
484
|
};
|
|
440
485
|
var ThunderIDNodeClient_default = ThunderIDNodeClient;
|
|
441
486
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fetch, { Headers, Request, Response } from "cross-fetch";
|
|
2
|
-
import { BackchannelLogoutConstants, InvalidLogoutTokenError, ThunderIDAuthException, ThunderIDJavaScriptClient, getVendorPrefix, logger, resolveResourceEndpoint, updateMeCredentials } from "@thunderid/javascript";
|
|
2
|
+
import { BackchannelLogoutConstants, InvalidLogoutTokenError, ThunderIDAuthException, ThunderIDJavaScriptClient, getFlows, getUserTypes, getUsers, getVendorPrefix, logger, resolveResourceEndpoint, updateMeCredentials } from "@thunderid/javascript";
|
|
3
3
|
import cache from "memory-cache";
|
|
4
4
|
import base64url from "base64url";
|
|
5
5
|
import sha256 from "fast-sha256";
|
|
@@ -407,6 +407,51 @@ var ThunderIDNodeClient = class extends ThunderIDJavaScriptClient {
|
|
|
407
407
|
url: resolveResourceEndpoint("usersMeCredentials", configData)
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* The URL inputs and bearer token for a management request made on behalf of the session identified by
|
|
412
|
+
* `userId`. The access token stays on the server.
|
|
413
|
+
*/
|
|
414
|
+
async managementRequestConfig(key, userId) {
|
|
415
|
+
const configData = await this.getStorageManager().getConfigData();
|
|
416
|
+
return {
|
|
417
|
+
baseUrl: configData?.baseUrl,
|
|
418
|
+
headers: { Authorization: `Bearer ${await this.getAccessToken(userId)}` },
|
|
419
|
+
url: resolveResourceEndpoint(key, configData)
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Retrieves one page of the user directory on behalf of the session identified by `userId`.
|
|
424
|
+
*
|
|
425
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
426
|
+
*/
|
|
427
|
+
async getUsers(options = {}, userId) {
|
|
428
|
+
return getUsers({
|
|
429
|
+
...options,
|
|
430
|
+
...await this.managementRequestConfig("users", userId)
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Retrieves one page of flows on behalf of the session identified by `userId`.
|
|
435
|
+
*
|
|
436
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
437
|
+
*/
|
|
438
|
+
async getFlows(options = {}, userId) {
|
|
439
|
+
return getFlows({
|
|
440
|
+
...options,
|
|
441
|
+
...await this.managementRequestConfig("flows", userId)
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Retrieves one page of user types on behalf of the session identified by `userId`.
|
|
446
|
+
*
|
|
447
|
+
* Makes a single request and does not follow `links`. The access token stays on the server.
|
|
448
|
+
*/
|
|
449
|
+
async getUserTypes(options = {}, userId) {
|
|
450
|
+
return getUserTypes({
|
|
451
|
+
...options,
|
|
452
|
+
...await this.managementRequestConfig("userTypes", userId)
|
|
453
|
+
});
|
|
454
|
+
}
|
|
410
455
|
};
|
|
411
456
|
var ThunderIDNodeClient_default = ThunderIDNodeClient;
|
|
412
457
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thunderid/node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Node.js runtime SDK for ThunderID",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"thunderid",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vitest": "4.1.11"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@thunderid/javascript": "^1.
|
|
47
|
+
"@thunderid/javascript": "^1.4.0",
|
|
48
48
|
"base64url": "3.0.1",
|
|
49
49
|
"cross-fetch": "4.1.0",
|
|
50
50
|
"fast-sha256": "1.3.0",
|