@thunderid/node 1.0.7 → 1.1.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtendedAuthorizeRequestUrlParams, IdToken, OIDCEndpoints, Storage, ThunderIDJavaScriptClient, TokenExchangeRequestConfig, TokenResponse, User } from '@thunderid/javascript';
|
|
2
2
|
import { ThunderIDNodeConfig } from './models/config';
|
|
3
|
-
declare class ThunderIDNodeClient<T = ThunderIDNodeConfig> extends ThunderIDJavaScriptClient<T> {
|
|
3
|
+
declare class ThunderIDNodeClient<T extends ThunderIDNodeConfig = ThunderIDNodeConfig> extends ThunderIDJavaScriptClient<T> {
|
|
4
4
|
private _nodeInstanceId;
|
|
5
5
|
constructor(instanceId?: number);
|
|
6
6
|
initialize(config: T, storage?: Storage): Promise<boolean>;
|
|
@@ -17,6 +17,11 @@ declare class ThunderIDNodeClient<T = ThunderIDNodeConfig> extends ThunderIDJava
|
|
|
17
17
|
getUser(userId?: string): Promise<User>;
|
|
18
18
|
getOpenIDProviderEndpoints(): Promise<Partial<OIDCEndpoints>>;
|
|
19
19
|
exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise<TokenResponse | Response | User>;
|
|
20
|
+
/**
|
|
21
|
+
* Updates one or more of the signed-in user's credentials (e.g. `password`, or any other
|
|
22
|
+
* attribute the user type schema declares `credential: true`).
|
|
23
|
+
*/
|
|
24
|
+
updateUserCredentials(payload: Record<string, string>, userId?: string): Promise<void>;
|
|
20
25
|
}
|
|
21
26
|
export default ThunderIDNodeClient;
|
|
22
27
|
//# sourceMappingURL=ThunderIDNodeClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThunderIDNodeClient.d.ts","sourceRoot":"","sources":["../src/ThunderIDNodeClient.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThunderIDNod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c,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIhD,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC,0BAA0B,IAAI,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAI7D,aAAa,CACjC,MAAM,EAAE,0BAA0B,EAClC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,GAAG,QAAQ,GAAG,IAAI,CAAC;IAI3C;;;OAGG;IACU,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAapG;AAED,eAAe,mBAAmB,CAAC"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -234,6 +234,20 @@ var ThunderIDNodeClient = class extends __thunderid_javascript.ThunderIDJavaScri
|
|
|
234
234
|
async exchangeToken(config, userId) {
|
|
235
235
|
return super.exchangeToken(config, userId);
|
|
236
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Updates one or more of the signed-in user's credentials (e.g. `password`, or any other
|
|
239
|
+
* attribute the user type schema declares `credential: true`).
|
|
240
|
+
*/
|
|
241
|
+
async updateUserCredentials(payload, userId) {
|
|
242
|
+
const configData = await this.getStorageManager().getConfigData();
|
|
243
|
+
const baseUrl = configData?.baseUrl;
|
|
244
|
+
await (0, __thunderid_javascript.updateMeCredentials)({
|
|
245
|
+
baseUrl,
|
|
246
|
+
headers: { Authorization: `Bearer ${await this.getAccessToken(userId)}` },
|
|
247
|
+
payload,
|
|
248
|
+
url: (0, __thunderid_javascript.resolveResourceEndpoint)("usersMeCredentials", configData)
|
|
249
|
+
});
|
|
250
|
+
}
|
|
237
251
|
};
|
|
238
252
|
var ThunderIDNodeClient_default = ThunderIDNodeClient;
|
|
239
253
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fetch, { Headers, Request, Response } from "cross-fetch";
|
|
2
|
-
import { ThunderIDAuthException, ThunderIDJavaScriptClient, getVendorPrefix } from "@thunderid/javascript";
|
|
2
|
+
import { ThunderIDAuthException, ThunderIDJavaScriptClient, getVendorPrefix, 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";
|
|
@@ -205,6 +205,20 @@ var ThunderIDNodeClient = class extends ThunderIDJavaScriptClient {
|
|
|
205
205
|
async exchangeToken(config, userId) {
|
|
206
206
|
return super.exchangeToken(config, userId);
|
|
207
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Updates one or more of the signed-in user's credentials (e.g. `password`, or any other
|
|
210
|
+
* attribute the user type schema declares `credential: true`).
|
|
211
|
+
*/
|
|
212
|
+
async updateUserCredentials(payload, userId) {
|
|
213
|
+
const configData = await this.getStorageManager().getConfigData();
|
|
214
|
+
const baseUrl = configData?.baseUrl;
|
|
215
|
+
await updateMeCredentials({
|
|
216
|
+
baseUrl,
|
|
217
|
+
headers: { Authorization: `Bearer ${await this.getAccessToken(userId)}` },
|
|
218
|
+
payload,
|
|
219
|
+
url: resolveResourceEndpoint("usersMeCredentials", configData)
|
|
220
|
+
});
|
|
221
|
+
}
|
|
208
222
|
};
|
|
209
223
|
var ThunderIDNodeClient_default = ThunderIDNodeClient;
|
|
210
224
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thunderid/node",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.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.10"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@thunderid/javascript": "^1.0
|
|
47
|
+
"@thunderid/javascript": "^1.1.0",
|
|
48
48
|
"base64url": "3.0.1",
|
|
49
49
|
"cross-fetch": "4.1.0",
|
|
50
50
|
"fast-sha256": "1.3.0",
|