@workos-inc/node 6.1.0 → 6.2.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/lib/user-management/interfaces/update-user-options.interface.d.ts +2 -2
- package/lib/user-management/user-management.d.ts +1 -0
- package/lib/user-management/user-management.js +6 -0
- package/lib/user-management/user-management.spec.js +13 -0
- package/lib/workos.js +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ export interface UpdateUserOptions {
|
|
|
5
5
|
emailVerified?: boolean;
|
|
6
6
|
password?: string;
|
|
7
7
|
passwordHash?: string;
|
|
8
|
-
passwordHashType?: 'bcrypt' | 'firebase-scrypt';
|
|
8
|
+
passwordHashType?: 'bcrypt' | 'firebase-scrypt' | 'ssha';
|
|
9
9
|
}
|
|
10
10
|
export interface SerializedUpdateUserOptions {
|
|
11
11
|
first_name?: string;
|
|
@@ -13,5 +13,5 @@ export interface SerializedUpdateUserOptions {
|
|
|
13
13
|
email_verified?: boolean;
|
|
14
14
|
password?: string;
|
|
15
15
|
password_hash?: string;
|
|
16
|
-
password_hash_type?: 'bcrypt' | 'firebase-scrypt';
|
|
16
|
+
password_hash_type?: 'bcrypt' | 'firebase-scrypt' | 'ssha';
|
|
17
17
|
}
|
|
@@ -231,5 +231,11 @@ class UserManagement {
|
|
|
231
231
|
}
|
|
232
232
|
return `${this.workos.baseURL}/user_management/sessions/logout?session_id=${sessionId}`;
|
|
233
233
|
}
|
|
234
|
+
getJwksUrl(clientId) {
|
|
235
|
+
if (!clientId) {
|
|
236
|
+
throw TypeError('clientId must be a valid clientId');
|
|
237
|
+
}
|
|
238
|
+
return `${this.workos.baseURL}/sso/jwks/${clientId}`;
|
|
239
|
+
}
|
|
234
240
|
}
|
|
235
241
|
exports.UserManagement = UserManagement;
|
|
@@ -761,4 +761,17 @@ describe('UserManagement', () => {
|
|
|
761
761
|
expect(url).toBe('https://api.workos.com/user_management/sessions/logout?session_id=123456');
|
|
762
762
|
});
|
|
763
763
|
});
|
|
764
|
+
describe('getJwksUrl', () => {
|
|
765
|
+
it('returns the jwks url', () => {
|
|
766
|
+
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
767
|
+
const url = workos.userManagement.getJwksUrl('client_whatever');
|
|
768
|
+
expect(url).toBe('https://api.workos.com/sso/jwks/client_whatever');
|
|
769
|
+
});
|
|
770
|
+
it('throws an error if the clientId is blank', () => {
|
|
771
|
+
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
772
|
+
expect(() => {
|
|
773
|
+
workos.userManagement.getJwksUrl('');
|
|
774
|
+
}).toThrowError(TypeError);
|
|
775
|
+
});
|
|
776
|
+
});
|
|
764
777
|
});
|
package/lib/workos.js
CHANGED
|
@@ -24,7 +24,7 @@ const audit_logs_1 = require("./audit-logs/audit-logs");
|
|
|
24
24
|
const user_management_1 = require("./user-management/user-management");
|
|
25
25
|
const bad_request_exception_1 = require("./common/exceptions/bad-request.exception");
|
|
26
26
|
const fetch_client_1 = require("./common/utils/fetch-client");
|
|
27
|
-
const VERSION = '6.
|
|
27
|
+
const VERSION = '6.2.0';
|
|
28
28
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
29
29
|
class WorkOS {
|
|
30
30
|
constructor(key, options = {}) {
|
package/package.json
CHANGED