@workos-inc/node 7.11.4 → 7.12.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/authentication-response.interface.d.ts +0 -8
- package/lib/user-management/serializers/authentication-response.serializer.d.ts +1 -2
- package/lib/user-management/serializers/authentication-response.serializer.js +1 -6
- package/lib/user-management/user-management.d.ts +2 -2
- package/lib/user-management/user-management.js +1 -1
- package/lib/user-management/user-management.spec.js +1 -0
- package/lib/workos.js +1 -1
- package/package.json +1 -1
|
@@ -17,12 +17,4 @@ export interface AuthenticationResponseResponse {
|
|
|
17
17
|
impersonator?: ImpersonatorResponse;
|
|
18
18
|
authentication_method?: AuthenticationMethod;
|
|
19
19
|
}
|
|
20
|
-
export interface RefreshAuthenticationResponse {
|
|
21
|
-
accessToken: string;
|
|
22
|
-
refreshToken: string;
|
|
23
|
-
}
|
|
24
|
-
export interface RefreshAuthenticationResponseResponse {
|
|
25
|
-
access_token: string;
|
|
26
|
-
refresh_token: string;
|
|
27
|
-
}
|
|
28
20
|
export {};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { AuthenticationResponse, AuthenticationResponseResponse
|
|
1
|
+
import { AuthenticationResponse, AuthenticationResponseResponse } from '../interfaces';
|
|
2
2
|
export declare const deserializeAuthenticationResponse: (authenticationResponse: AuthenticationResponseResponse) => AuthenticationResponse;
|
|
3
|
-
export declare const deserializeRefreshAuthenticationResponse: (refreshAuthenticationResponse: RefreshAuthenticationResponseResponse) => RefreshAuthenticationResponse;
|
|
@@ -11,15 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.deserializeAuthenticationResponse = void 0;
|
|
15
15
|
const user_serializer_1 = require("./user.serializer");
|
|
16
16
|
const deserializeAuthenticationResponse = (authenticationResponse) => {
|
|
17
17
|
const { user, organization_id, access_token, refresh_token, authentication_method, impersonator } = authenticationResponse, rest = __rest(authenticationResponse, ["user", "organization_id", "access_token", "refresh_token", "authentication_method", "impersonator"]);
|
|
18
18
|
return Object.assign({ user: (0, user_serializer_1.deserializeUser)(user), organizationId: organization_id, accessToken: access_token, refreshToken: refresh_token, impersonator, authenticationMethod: authentication_method }, rest);
|
|
19
19
|
};
|
|
20
20
|
exports.deserializeAuthenticationResponse = deserializeAuthenticationResponse;
|
|
21
|
-
const deserializeRefreshAuthenticationResponse = (refreshAuthenticationResponse) => {
|
|
22
|
-
const { access_token, refresh_token } = refreshAuthenticationResponse, rest = __rest(refreshAuthenticationResponse, ["access_token", "refresh_token"]);
|
|
23
|
-
return Object.assign({ accessToken: access_token, refreshToken: refresh_token }, rest);
|
|
24
|
-
};
|
|
25
|
-
exports.deserializeRefreshAuthenticationResponse = deserializeRefreshAuthenticationResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkOS } from '../workos';
|
|
2
2
|
import { AutoPaginatable } from '../common/utils/pagination';
|
|
3
|
-
import { AuthenticateWithCodeOptions, AuthenticateWithMagicAuthOptions, AuthenticateWithPasswordOptions, AuthenticateWithTotpOptions, AuthenticationResponse, ResetPasswordOptions, SendPasswordResetEmailOptions, CreateUserOptions, EnrollAuthFactorOptions, ListAuthFactorsOptions, ListUsersOptions, SendMagicAuthCodeOptions, SendVerificationEmailOptions, UpdateUserOptions, User, VerifyEmailOptions, AuthenticateWithRefreshTokenOptions,
|
|
3
|
+
import { AuthenticateWithCodeOptions, AuthenticateWithMagicAuthOptions, AuthenticateWithPasswordOptions, AuthenticateWithTotpOptions, AuthenticationResponse, ResetPasswordOptions, SendPasswordResetEmailOptions, CreateUserOptions, EnrollAuthFactorOptions, ListAuthFactorsOptions, ListUsersOptions, SendMagicAuthCodeOptions, SendVerificationEmailOptions, UpdateUserOptions, User, VerifyEmailOptions, AuthenticateWithRefreshTokenOptions, MagicAuth, CreateMagicAuthOptions, EmailVerification, PasswordReset, CreatePasswordResetOptions } from './interfaces';
|
|
4
4
|
import { Challenge } from '../mfa/interfaces';
|
|
5
5
|
import { OrganizationMembership } from './interfaces/organization-membership.interface';
|
|
6
6
|
import { ListOrganizationMembershipsOptions } from './interfaces/list-organization-memberships-options.interface';
|
|
@@ -23,7 +23,7 @@ export declare class UserManagement {
|
|
|
23
23
|
authenticateWithMagicAuth(payload: AuthenticateWithMagicAuthOptions): Promise<AuthenticationResponse>;
|
|
24
24
|
authenticateWithPassword(payload: AuthenticateWithPasswordOptions): Promise<AuthenticationResponse>;
|
|
25
25
|
authenticateWithCode(payload: AuthenticateWithCodeOptions): Promise<AuthenticationResponse>;
|
|
26
|
-
authenticateWithRefreshToken(payload: AuthenticateWithRefreshTokenOptions): Promise<
|
|
26
|
+
authenticateWithRefreshToken(payload: AuthenticateWithRefreshTokenOptions): Promise<AuthenticationResponse>;
|
|
27
27
|
authenticateWithTotp(payload: AuthenticateWithTotpOptions): Promise<AuthenticationResponse>;
|
|
28
28
|
authenticateWithEmailVerification(payload: AuthenticateWithEmailVerificationOptions): Promise<AuthenticationResponse>;
|
|
29
29
|
authenticateWithOrganizationSelection(payload: AuthenticateWithOrganizationSelectionOptions): Promise<AuthenticationResponse>;
|
|
@@ -90,7 +90,7 @@ class UserManagement {
|
|
|
90
90
|
authenticateWithRefreshToken(payload) {
|
|
91
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
92
|
const { data } = yield this.workos.post('/user_management/authenticate', (0, serializers_1.serializeAuthenticateWithRefreshTokenOptions)(Object.assign(Object.assign({}, payload), { clientSecret: this.workos.key })));
|
|
93
|
-
return (0, serializers_1.
|
|
93
|
+
return (0, serializers_1.deserializeAuthenticationResponse)(data);
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
authenticateWithTotp(payload) {
|
|
@@ -228,6 +228,7 @@ describe('UserManagement', () => {
|
|
|
228
228
|
describe('authenticateWithRefreshToken', () => {
|
|
229
229
|
it('sends a refresh_token authentication request', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
230
230
|
(0, test_utils_1.fetchOnce)({
|
|
231
|
+
user: user_json_1.default,
|
|
231
232
|
access_token: 'access_token',
|
|
232
233
|
refresh_token: 'refreshToken2',
|
|
233
234
|
});
|
package/lib/workos.js
CHANGED
|
@@ -26,7 +26,7 @@ const bad_request_exception_1 = require("./common/exceptions/bad-request.excepti
|
|
|
26
26
|
const http_client_1 = require("./common/net/http-client");
|
|
27
27
|
const subtle_crypto_provider_1 = require("./common/crypto/subtle-crypto-provider");
|
|
28
28
|
const fetch_client_1 = require("./common/net/fetch-client");
|
|
29
|
-
const VERSION = '7.
|
|
29
|
+
const VERSION = '7.12.0';
|
|
30
30
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
31
31
|
class WorkOS {
|
|
32
32
|
constructor(key, options = {}) {
|
package/package.json
CHANGED