@workos-inc/node 7.45.0 → 7.47.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/common/interfaces/event.interface.d.ts +10 -2
- package/lib/common/serializers/event.serializer.js +1 -0
- package/lib/organization-domains/fixtures/get-organization-domain-pending.json +1 -0
- package/lib/organization-domains/fixtures/get-organization-domain-verified.json +1 -0
- package/lib/organization-domains/interfaces/organization-domain.interface.d.ts +2 -0
- package/lib/organization-domains/organization-domains.spec.js +4 -0
- package/lib/organization-domains/serializers/organization-domain.serializer.js +1 -0
- package/lib/workos.js +1 -1
- package/package.json +1 -1
|
@@ -253,6 +253,14 @@ export interface PasswordResetCreatedEventResponse extends EventResponseBase {
|
|
|
253
253
|
event: 'password_reset.created';
|
|
254
254
|
data: PasswordResetEventResponse;
|
|
255
255
|
}
|
|
256
|
+
export interface PasswordResetSucceededEvent extends EventBase {
|
|
257
|
+
event: 'password_reset.succeeded';
|
|
258
|
+
data: PasswordResetEvent;
|
|
259
|
+
}
|
|
260
|
+
export interface PasswordResetSucceededEventResponse extends EventResponseBase {
|
|
261
|
+
event: 'password_reset.succeeded';
|
|
262
|
+
data: PasswordResetEventResponse;
|
|
263
|
+
}
|
|
256
264
|
export interface UserCreatedEvent extends EventBase {
|
|
257
265
|
event: 'user.created';
|
|
258
266
|
data: User;
|
|
@@ -401,7 +409,7 @@ export interface OrganizationDomainVerificationFailedEventResponse extends Event
|
|
|
401
409
|
event: 'organization_domain.verification_failed';
|
|
402
410
|
data: OrganizationDomainResponse;
|
|
403
411
|
}
|
|
404
|
-
export type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeactivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationCreatedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipAdded | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | OrganizationMembershipRemoved | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent;
|
|
405
|
-
export type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeactivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationCreatedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipAddedResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | OrganizationMembershipRemovedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse;
|
|
412
|
+
export type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeactivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationCreatedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | PasswordResetSucceededEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipAdded | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | OrganizationMembershipRemoved | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent;
|
|
413
|
+
export type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeactivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationCreatedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | PasswordResetSucceededEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipAddedResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | OrganizationMembershipRemovedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse;
|
|
406
414
|
export type EventName = Event['event'];
|
|
407
415
|
export {};
|
|
@@ -59,6 +59,7 @@ const deserializeEvent = (event) => {
|
|
|
59
59
|
case 'magic_auth.created':
|
|
60
60
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_4.deserializeMagicAuthEvent)(event.data) });
|
|
61
61
|
case 'password_reset.created':
|
|
62
|
+
case 'password_reset.succeeded':
|
|
62
63
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_4.deserializePasswordResetEvent)(event.data) });
|
|
63
64
|
case 'user.created':
|
|
64
65
|
case 'user.updated':
|
|
@@ -15,6 +15,7 @@ export interface OrganizationDomain {
|
|
|
15
15
|
object: 'organization_domain';
|
|
16
16
|
id: string;
|
|
17
17
|
domain: string;
|
|
18
|
+
organizationId: string;
|
|
18
19
|
state: OrganizationDomainState;
|
|
19
20
|
verificationToken?: string;
|
|
20
21
|
verificationStrategy: OrganizationDomainVerificationStrategy;
|
|
@@ -23,6 +24,7 @@ export interface OrganizationDomainResponse {
|
|
|
23
24
|
object: 'organization_domain';
|
|
24
25
|
id: string;
|
|
25
26
|
domain: string;
|
|
27
|
+
organization_id: string;
|
|
26
28
|
state: OrganizationDomainState;
|
|
27
29
|
verification_token?: string;
|
|
28
30
|
verification_strategy: OrganizationDomainVerificationStrategy;
|
|
@@ -28,6 +28,7 @@ describe('OrganizationDomains', () => {
|
|
|
28
28
|
expect((0, test_utils_1.fetchURL)()).toContain('/organization_domains/org_domain_01HCZRAP3TPQ0X0DKJHR32TATG');
|
|
29
29
|
expect(subject.id).toEqual('org_domain_01HCZRAP3TPQ0X0DKJHR32TATG');
|
|
30
30
|
expect(subject.domain).toEqual('workos.com');
|
|
31
|
+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
|
|
31
32
|
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Verified);
|
|
32
33
|
expect(subject.verificationToken).toBeNull();
|
|
33
34
|
expect(subject.verificationStrategy).toEqual('manual');
|
|
@@ -38,6 +39,7 @@ describe('OrganizationDomains', () => {
|
|
|
38
39
|
expect((0, test_utils_1.fetchURL)()).toContain('/organization_domains/org_domain_01HD50K7EPWCMNPGMKXKKE14XT');
|
|
39
40
|
expect(subject.id).toEqual('org_domain_01HD50K7EPWCMNPGMKXKKE14XT');
|
|
40
41
|
expect(subject.domain).toEqual('workos.com');
|
|
42
|
+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
|
|
41
43
|
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Pending);
|
|
42
44
|
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
|
|
43
45
|
expect(subject.verificationStrategy).toEqual('dns');
|
|
@@ -50,6 +52,7 @@ describe('OrganizationDomains', () => {
|
|
|
50
52
|
expect((0, test_utils_1.fetchURL)()).toContain('/organization_domains/org_domain_01HD50K7EPWCMNPGMKXKKE14XT/verify');
|
|
51
53
|
expect(subject.id).toEqual('org_domain_01HD50K7EPWCMNPGMKXKKE14XT');
|
|
52
54
|
expect(subject.domain).toEqual('workos.com');
|
|
55
|
+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
|
|
53
56
|
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Pending);
|
|
54
57
|
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
|
|
55
58
|
expect(subject.verificationStrategy).toEqual('dns');
|
|
@@ -69,6 +72,7 @@ describe('OrganizationDomains', () => {
|
|
|
69
72
|
});
|
|
70
73
|
expect(subject.id).toEqual('org_domain_01HD50K7EPWCMNPGMKXKKE14XT');
|
|
71
74
|
expect(subject.domain).toEqual('workos.com');
|
|
75
|
+
expect(subject.organizationId).toEqual('org_01JR8C1EHCRPV4B4XP4W2B9X1M');
|
|
72
76
|
expect(subject.state).toEqual(interfaces_1.OrganizationDomainState.Pending);
|
|
73
77
|
expect(subject.verificationToken).toEqual('F06PGMsZIO0shrveGWuGxgCj7');
|
|
74
78
|
expect(subject.verificationStrategy).toEqual('dns');
|
|
@@ -5,6 +5,7 @@ const deserializeOrganizationDomain = (organizationDomain) => ({
|
|
|
5
5
|
object: organizationDomain.object,
|
|
6
6
|
id: organizationDomain.id,
|
|
7
7
|
domain: organizationDomain.domain,
|
|
8
|
+
organizationId: organizationDomain.organization_id,
|
|
8
9
|
state: organizationDomain.state,
|
|
9
10
|
verificationToken: organizationDomain.verification_token,
|
|
10
11
|
verificationStrategy: organizationDomain.verification_strategy,
|
package/lib/workos.js
CHANGED
|
@@ -31,7 +31,7 @@ const widgets_1 = require("./widgets/widgets");
|
|
|
31
31
|
const actions_1 = require("./actions/actions");
|
|
32
32
|
const vault_1 = require("./vault/vault");
|
|
33
33
|
const conflict_exception_1 = require("./common/exceptions/conflict.exception");
|
|
34
|
-
const VERSION = '7.
|
|
34
|
+
const VERSION = '7.47.0';
|
|
35
35
|
const DEFAULT_HOSTNAME = 'api.workos.com';
|
|
36
36
|
const HEADER_AUTHORIZATION = 'Authorization';
|
|
37
37
|
const HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
|
package/package.json
CHANGED