@workos-inc/node 3.9.2 → 4.0.1
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 +45 -3
- package/lib/common/serializers/event.serializer.js +9 -0
- package/lib/directory-sync/interfaces/directory-user.interface.d.ts +12 -12
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/lib/mfa/interfaces/challenge.interface.d.ts +2 -2
- package/lib/mfa/interfaces/factor.interface.d.ts +6 -2
- package/lib/mfa/interfaces/totp.interface.d.ts +7 -2
- package/lib/mfa/serializers/factor.serializer.js +1 -1
- package/lib/mfa/serializers/totp.serializer.js +17 -7
- package/lib/sso/interfaces/authorization-url-options.interface.d.ts +1 -1
- package/lib/sso/interfaces/get-profile-and-token-options.interface.d.ts +1 -1
- package/lib/sso/sso.d.ts +2 -2
- package/lib/sso/sso.js +4 -4
- package/lib/sso/sso.spec.js +21 -21
- package/lib/user-management/fixtures/invitation.json +13 -0
- package/lib/user-management/fixtures/list-invitations.json +22 -0
- package/lib/user-management/fixtures/list-organization-memberships.json +17 -0
- package/lib/user-management/fixtures/organization-membership.json +8 -0
- package/lib/user-management/interfaces/authenticate-with-code-options.interface.d.ts +11 -0
- package/lib/user-management/interfaces/authenticate-with-email-verification-options.interface.d.ts +13 -0
- package/lib/user-management/interfaces/authenticate-with-magic-auth-options.interface.d.ts +15 -0
- package/lib/user-management/interfaces/authenticate-with-options-base.interface.d.ts +11 -0
- package/lib/user-management/interfaces/authenticate-with-organization-selection.interface.d.ts +13 -0
- package/lib/user-management/interfaces/authenticate-with-password-options.interface.d.ts +13 -0
- package/lib/{users → user-management}/interfaces/authenticate-with-totp-options.interface.d.ts +3 -9
- package/lib/{users → user-management}/interfaces/authentication-response.interface.d.ts +2 -0
- package/lib/user-management/interfaces/authorization-url-options.interface.d.ts +10 -0
- package/lib/user-management/interfaces/create-organization-membership-options.interface.d.ts +8 -0
- package/lib/{users → user-management}/interfaces/enroll-auth-factor.interface.d.ts +4 -4
- package/lib/{users → user-management}/interfaces/index.d.ts +2 -5
- package/lib/{users → user-management}/interfaces/index.js +2 -5
- package/lib/user-management/interfaces/invitation.interface.d.ts +26 -0
- package/lib/user-management/interfaces/list-invitations-options.interface.d.ts +9 -0
- package/lib/user-management/interfaces/list-organization-memberships-options.interface.d.ts +9 -0
- package/lib/{users → user-management}/interfaces/list-users-options.interface.d.ts +5 -1
- package/lib/user-management/interfaces/organization-membership.interface.d.ts +16 -0
- package/lib/user-management/interfaces/send-invitation-options.interface.d.ts +12 -0
- package/lib/user-management/interfaces/send-password-reset-email-options.interface.d.ts +8 -0
- package/lib/{users → user-management}/interfaces/update-user-options.interface.d.ts +6 -0
- package/lib/user-management/interfaces/user.interface.js +2 -0
- package/lib/user-management/interfaces/verify-email-options.interface.d.ts +7 -0
- package/lib/user-management/interfaces/verify-email-options.interface.js +2 -0
- package/lib/user-management/serializers/authenticate-with-email-verification.serializer.d.ts +2 -0
- package/lib/user-management/serializers/authenticate-with-email-verification.serializer.js +13 -0
- package/lib/{users → user-management}/serializers/authenticate-with-magic-auth-options.serializer.js +2 -1
- package/lib/user-management/serializers/authenticate-with-organization-selection-options.serializer.d.ts +2 -0
- package/lib/user-management/serializers/authenticate-with-organization-selection-options.serializer.js +13 -0
- package/lib/{users → user-management}/serializers/authentication-response.serializer.js +1 -0
- package/lib/user-management/serializers/create-organization-membership-options.serializer.d.ts +2 -0
- package/lib/user-management/serializers/create-organization-membership-options.serializer.js +8 -0
- package/lib/user-management/serializers/invitation.serializer.d.ts +2 -0
- package/lib/user-management/serializers/invitation.serializer.js +17 -0
- package/lib/user-management/serializers/list-invitations-options.serializer.d.ts +2 -0
- package/lib/user-management/serializers/list-invitations-options.serializer.js +12 -0
- package/lib/user-management/serializers/list-organization-memberships-options.serializer.d.ts +2 -0
- package/lib/user-management/serializers/list-organization-memberships-options.serializer.js +12 -0
- package/lib/user-management/serializers/list-users-options.serializer.d.ts +2 -0
- package/lib/user-management/serializers/list-users-options.serializer.js +12 -0
- package/lib/user-management/serializers/organization-membership.serializer.d.ts +2 -0
- package/lib/user-management/serializers/organization-membership.serializer.js +12 -0
- package/lib/user-management/serializers/send-invitation-options.serializer.d.ts +2 -0
- package/lib/user-management/serializers/send-invitation-options.serializer.js +10 -0
- package/lib/user-management/serializers/send-password-reset-email.serializer.d.ts +2 -0
- package/lib/user-management/serializers/send-password-reset-email.serializer.js +8 -0
- package/lib/{users → user-management}/serializers/update-user-options.serializer.js +3 -0
- package/lib/user-management/user-management.d.ts +53 -0
- package/lib/user-management/user-management.js +214 -0
- package/lib/user-management/user-management.spec.js +748 -0
- package/lib/workos.d.ts +2 -4
- package/lib/workos.js +3 -5
- package/package.json +1 -1
- package/lib/audit-trail/audit-trail.d.ts +0 -12
- package/lib/audit-trail/audit-trail.js +0 -31
- package/lib/audit-trail/audit-trail.spec.js +0 -183
- package/lib/audit-trail/interfaces/create-event-options.interface.d.ts +0 -3
- package/lib/audit-trail/interfaces/event-options.interface.d.ts +0 -14
- package/lib/audit-trail/interfaces/event.interface.d.ts +0 -23
- package/lib/audit-trail/interfaces/index.d.ts +0 -4
- package/lib/audit-trail/interfaces/list-events-options.interface.d.ts +0 -16
- package/lib/users/interfaces/add-user-to-organization-options.interface.d.ts +0 -7
- package/lib/users/interfaces/authenticate-with-code-options.interface.d.ts +0 -17
- package/lib/users/interfaces/authenticate-with-magic-auth-options.interface.d.ts +0 -19
- package/lib/users/interfaces/authenticate-with-password-options.interface.d.ts +0 -19
- package/lib/users/interfaces/delete-user-options.interface.d.ts +0 -3
- package/lib/users/interfaces/remove-user-from-organization-options.interface.d.ts +0 -4
- package/lib/users/interfaces/send-password-reset-options.interface.d.ts +0 -17
- package/lib/users/interfaces/verify-email-code-options.interface.d.ts +0 -7
- package/lib/users/serializers/send-password-reset-email.serializer.d.ts +0 -3
- package/lib/users/serializers/send-password-reset-email.serializer.js +0 -14
- package/lib/users/users.d.ts +0 -38
- package/lib/users/users.js +0 -140
- package/lib/users/users.spec.d.ts +0 -1
- package/lib/users/users.spec.js +0 -462
- /package/lib/{users → user-management}/fixtures/list-factors.json +0 -0
- /package/lib/{users → user-management}/fixtures/list-users.json +0 -0
- /package/lib/{users → user-management}/fixtures/user.json +0 -0
- /package/lib/{users → user-management}/interfaces/authenticate-with-code-options.interface.js +0 -0
- /package/lib/{audit-trail/interfaces/create-event-options.interface.js → user-management/interfaces/authenticate-with-email-verification-options.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/authenticate-with-magic-auth-options.interface.js +0 -0
- /package/lib/{audit-trail/interfaces/event-options.interface.js → user-management/interfaces/authenticate-with-options-base.interface.js} +0 -0
- /package/lib/{audit-trail/interfaces/event.interface.js → user-management/interfaces/authenticate-with-organization-selection.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/authenticate-with-password-options.interface.js +0 -0
- /package/lib/{users → user-management}/interfaces/authenticate-with-totp-options.interface.js +0 -0
- /package/lib/{users → user-management}/interfaces/authentication-response.interface.js +0 -0
- /package/lib/{audit-trail/interfaces/index.js → user-management/interfaces/authorization-url-options.interface.js} +0 -0
- /package/lib/{audit-trail/interfaces/list-events-options.interface.js → user-management/interfaces/create-organization-membership-options.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/create-user-options.interface.d.ts +0 -0
- /package/lib/{users → user-management}/interfaces/create-user-options.interface.js +0 -0
- /package/lib/{users → user-management}/interfaces/enroll-auth-factor.interface.js +0 -0
- /package/lib/{users/interfaces/add-user-to-organization-options.interface.js → user-management/interfaces/invitation.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/list-auth-factors-options.interface.d.ts +0 -0
- /package/lib/{users → user-management}/interfaces/list-auth-factors-options.interface.js +0 -0
- /package/lib/{users/interfaces/delete-user-options.interface.js → user-management/interfaces/list-invitations-options.interface.js} +0 -0
- /package/lib/{users/interfaces/list-users-options.interface.js → user-management/interfaces/list-organization-memberships-options.interface.js} +0 -0
- /package/lib/{users/interfaces/remove-user-from-organization-options.interface.js → user-management/interfaces/list-users-options.interface.js} +0 -0
- /package/lib/{users/interfaces/reset-password-options.interface.js → user-management/interfaces/organization-membership.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/reset-password-options.interface.d.ts +0 -0
- /package/lib/{users/interfaces/send-magic-auth-code-options.interface.js → user-management/interfaces/reset-password-options.interface.js} +0 -0
- /package/lib/{users/interfaces/send-password-reset-options.interface.js → user-management/interfaces/send-invitation-options.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/send-magic-auth-code-options.interface.d.ts +0 -0
- /package/lib/{users/interfaces/send-verification-email-options.js → user-management/interfaces/send-magic-auth-code-options.interface.js} +0 -0
- /package/lib/{users/interfaces/update-user-options.interface.js → user-management/interfaces/send-password-reset-email-options.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/send-verification-email-options.d.ts +0 -0
- /package/lib/{users/interfaces/update-user-password-options.interface.js → user-management/interfaces/send-verification-email-options.js} +0 -0
- /package/lib/{users/interfaces/user.interface.js → user-management/interfaces/update-user-options.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/update-user-password-options.interface.d.ts +0 -0
- /package/lib/{users/interfaces/verify-email-code-options.interface.js → user-management/interfaces/update-user-password-options.interface.js} +0 -0
- /package/lib/{users → user-management}/interfaces/user.interface.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/authenticate-with-code-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/authenticate-with-code-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/authenticate-with-magic-auth-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/authenticate-with-password-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/authenticate-with-password-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/authenticate-with-totp-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/authenticate-with-totp-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/authentication-response.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/create-user-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/create-user-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/enroll-auth-factor-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/enroll-auth-factor-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/index.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/index.js +0 -0
- /package/lib/{users → user-management}/serializers/reset-password-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/reset-password-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/send-magic-auth-code-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/send-magic-auth-code-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/update-user-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/update-user-password-options.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/update-user-password-options.serializer.js +0 -0
- /package/lib/{users → user-management}/serializers/user.serializer.d.ts +0 -0
- /package/lib/{users → user-management}/serializers/user.serializer.js +0 -0
- /package/lib/{audit-trail/audit-trail.spec.d.ts → user-management/user-management.spec.d.ts} +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { DirectoryUser, DirectoryUserResponse, DirectoryGroup, DirectoryGroupResponse, EventDirectory, EventDirectoryResponse } from '../../directory-sync/interfaces';
|
|
2
2
|
import { Connection, ConnectionResponse } from '../../sso/interfaces';
|
|
3
|
+
import { User, UserResponse } from '../../user-management/interfaces';
|
|
4
|
+
import { OrganizationMembership, OrganizationMembershipResponse } from '../../user-management/interfaces/organization-membership.interface';
|
|
3
5
|
export interface EventBase {
|
|
4
6
|
id: string;
|
|
5
7
|
createdAt: string;
|
|
@@ -136,7 +138,47 @@ export interface DsyncUserUpdatedEventResponse extends EventResponseBase {
|
|
|
136
138
|
event: 'dsync.user.updated';
|
|
137
139
|
data: DirectoryUserResponse & Record<'previous_attributes', any>;
|
|
138
140
|
}
|
|
139
|
-
export
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
export interface UserCreatedEvent extends EventBase {
|
|
142
|
+
event: 'user.created';
|
|
143
|
+
data: User;
|
|
144
|
+
}
|
|
145
|
+
export interface UserCreatedEventResponse extends EventResponseBase {
|
|
146
|
+
event: 'user.created';
|
|
147
|
+
data: UserResponse;
|
|
148
|
+
}
|
|
149
|
+
export interface UserUpdatedEvent extends EventBase {
|
|
150
|
+
event: 'user.updated';
|
|
151
|
+
data: User;
|
|
152
|
+
}
|
|
153
|
+
export interface UserUpdatedEventResponse extends EventResponseBase {
|
|
154
|
+
event: 'user.updated';
|
|
155
|
+
data: UserResponse;
|
|
156
|
+
}
|
|
157
|
+
export interface UserDeletedEvent extends EventBase {
|
|
158
|
+
event: 'user.deleted';
|
|
159
|
+
data: User;
|
|
160
|
+
}
|
|
161
|
+
export interface UserDeletedEventResponse extends EventResponseBase {
|
|
162
|
+
event: 'user.deleted';
|
|
163
|
+
data: UserResponse;
|
|
164
|
+
}
|
|
165
|
+
export interface OrganizationMembershipAdded extends EventBase {
|
|
166
|
+
event: 'organization_membership.added';
|
|
167
|
+
data: OrganizationMembership;
|
|
168
|
+
}
|
|
169
|
+
export interface OrganizationMembershipAddedResponse extends EventResponseBase {
|
|
170
|
+
event: 'organization_membership.added';
|
|
171
|
+
data: OrganizationMembershipResponse;
|
|
172
|
+
}
|
|
173
|
+
export interface OrganizationMembershipRemoved extends EventBase {
|
|
174
|
+
event: 'organization_membership.removed';
|
|
175
|
+
data: OrganizationMembership;
|
|
176
|
+
}
|
|
177
|
+
export interface OrganizationMembershipRemovedResponse extends EventResponseBase {
|
|
178
|
+
event: 'organization_membership.removed';
|
|
179
|
+
data: OrganizationMembershipResponse;
|
|
180
|
+
}
|
|
181
|
+
export type Event = ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeactivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipAdded | OrganizationMembershipRemoved;
|
|
182
|
+
export type EventResponse = ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeactivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipAddedResponse | OrganizationMembershipRemovedResponse;
|
|
183
|
+
export type EventName = 'connection.activated' | 'connection.deactivated' | 'connection.deleted' | 'dsync.activated' | 'dsync.deactivated' | 'dsync.deleted' | 'dsync.group.created' | 'dsync.group.deleted' | 'dsync.group.updated' | 'dsync.group.user_added' | 'dsync.group.user_removed' | 'dsync.user.created' | 'dsync.user.deleted' | 'dsync.user.updated' | 'user.created' | 'user.updated' | 'user.deleted' | 'organization_membership.added' | 'organization_membership.removed';
|
|
142
184
|
export {};
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deserializeEvent = void 0;
|
|
4
4
|
const serializers_1 = require("../../directory-sync/serializers");
|
|
5
5
|
const serializers_2 = require("../../sso/serializers");
|
|
6
|
+
const serializers_3 = require("../../user-management/serializers");
|
|
7
|
+
const organization_membership_serializer_1 = require("../../user-management/serializers/organization-membership.serializer");
|
|
6
8
|
const deserializeEvent = (event) => {
|
|
7
9
|
const eventBase = {
|
|
8
10
|
id: event.id,
|
|
@@ -35,6 +37,13 @@ const deserializeEvent = (event) => {
|
|
|
35
37
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_1.deserializeDirectoryUser)(event.data) });
|
|
36
38
|
case 'dsync.user.updated':
|
|
37
39
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_1.deserializeUpdatedEventDirectoryUser)(event.data) });
|
|
40
|
+
case 'user.created':
|
|
41
|
+
case 'user.updated':
|
|
42
|
+
case 'user.deleted':
|
|
43
|
+
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_3.deserializeUser)(event.data) });
|
|
44
|
+
case 'organization_membership.added':
|
|
45
|
+
case 'organization_membership.removed':
|
|
46
|
+
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, organization_membership_serializer_1.deserializeOrganizationMembership)(event.data) });
|
|
38
47
|
}
|
|
39
48
|
};
|
|
40
49
|
exports.deserializeEvent = deserializeEvent;
|
|
@@ -8,14 +8,14 @@ export interface DirectoryUser<TCustomAttributes extends object = DefaultCustomA
|
|
|
8
8
|
rawAttributes: TRawAttributes;
|
|
9
9
|
customAttributes: TCustomAttributes;
|
|
10
10
|
idpId: string;
|
|
11
|
-
firstName: string;
|
|
11
|
+
firstName: string | null;
|
|
12
12
|
emails: {
|
|
13
|
-
type
|
|
14
|
-
value
|
|
15
|
-
primary
|
|
13
|
+
type?: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
primary?: boolean;
|
|
16
16
|
}[];
|
|
17
|
-
username: string;
|
|
18
|
-
lastName: string;
|
|
17
|
+
username: string | null;
|
|
18
|
+
lastName: string | null;
|
|
19
19
|
jobTitle: string | null;
|
|
20
20
|
state: 'active' | 'inactive' | 'suspended';
|
|
21
21
|
createdAt: string;
|
|
@@ -29,14 +29,14 @@ export interface DirectoryUserResponse<TCustomAttributes extends object = Defaul
|
|
|
29
29
|
raw_attributes: TRawAttributes;
|
|
30
30
|
custom_attributes: TCustomAttributes;
|
|
31
31
|
idp_id: string;
|
|
32
|
-
first_name: string;
|
|
32
|
+
first_name: string | null;
|
|
33
33
|
emails: {
|
|
34
|
-
type
|
|
35
|
-
value
|
|
36
|
-
primary
|
|
34
|
+
type?: string;
|
|
35
|
+
value?: string;
|
|
36
|
+
primary?: boolean;
|
|
37
37
|
}[];
|
|
38
|
-
username: string;
|
|
39
|
-
last_name: string;
|
|
38
|
+
username: string | null;
|
|
39
|
+
last_name: string | null;
|
|
40
40
|
job_title: string | null;
|
|
41
41
|
state: 'active' | 'inactive' | 'suspended';
|
|
42
42
|
created_at: string;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { WorkOS } from './workos';
|
|
2
2
|
export * from './audit-logs/interfaces';
|
|
3
|
-
export * from './audit-trail/interfaces';
|
|
4
3
|
export * from './common/exceptions';
|
|
5
4
|
export * from './common/interfaces';
|
|
6
5
|
export * from './common/utils/pagination';
|
|
@@ -11,6 +10,6 @@ export * from './organizations/interfaces';
|
|
|
11
10
|
export * from './passwordless/interfaces';
|
|
12
11
|
export * from './portal/interfaces';
|
|
13
12
|
export * from './sso/interfaces';
|
|
14
|
-
export * from './
|
|
13
|
+
export * from './user-management/interfaces';
|
|
15
14
|
export { WorkOS };
|
|
16
15
|
export default WorkOS;
|
package/lib/index.js
CHANGED
|
@@ -18,7 +18,6 @@ exports.WorkOS = void 0;
|
|
|
18
18
|
const workos_1 = require("./workos");
|
|
19
19
|
Object.defineProperty(exports, "WorkOS", { enumerable: true, get: function () { return workos_1.WorkOS; } });
|
|
20
20
|
__exportStar(require("./audit-logs/interfaces"), exports);
|
|
21
|
-
__exportStar(require("./audit-trail/interfaces"), exports);
|
|
22
21
|
__exportStar(require("./common/exceptions"), exports);
|
|
23
22
|
__exportStar(require("./common/interfaces"), exports);
|
|
24
23
|
__exportStar(require("./common/utils/pagination"), exports);
|
|
@@ -29,6 +28,6 @@ __exportStar(require("./organizations/interfaces"), exports);
|
|
|
29
28
|
__exportStar(require("./passwordless/interfaces"), exports);
|
|
30
29
|
__exportStar(require("./portal/interfaces"), exports);
|
|
31
30
|
__exportStar(require("./sso/interfaces"), exports);
|
|
32
|
-
__exportStar(require("./
|
|
31
|
+
__exportStar(require("./user-management/interfaces"), exports);
|
|
33
32
|
// tslint:disable-next-line:no-default-export
|
|
34
33
|
exports.default = workos_1.WorkOS;
|
|
@@ -4,7 +4,7 @@ export interface Challenge {
|
|
|
4
4
|
createdAt: string;
|
|
5
5
|
updatedAt: string;
|
|
6
6
|
expiresAt?: string;
|
|
7
|
-
code
|
|
7
|
+
code?: string;
|
|
8
8
|
authenticationFactorId: string;
|
|
9
9
|
}
|
|
10
10
|
export interface ChallengeResponse {
|
|
@@ -13,6 +13,6 @@ export interface ChallengeResponse {
|
|
|
13
13
|
created_at: string;
|
|
14
14
|
updated_at: string;
|
|
15
15
|
expires_at?: string;
|
|
16
|
-
code
|
|
16
|
+
code?: string;
|
|
17
17
|
authentication_factor_id: string;
|
|
18
18
|
}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { Sms, SmsResponse } from './sms.interface';
|
|
2
2
|
import { Totp, TotpResponse } from './totp.interface';
|
|
3
|
+
type FactorType = 'sms' | 'totp' | 'generic_otp';
|
|
3
4
|
export interface Factor {
|
|
4
5
|
object: 'authentication_factor';
|
|
5
6
|
id: string;
|
|
6
7
|
createdAt: string;
|
|
7
8
|
updatedAt: string;
|
|
8
|
-
type:
|
|
9
|
+
type: FactorType;
|
|
9
10
|
sms?: Sms;
|
|
10
11
|
totp?: Totp;
|
|
12
|
+
userId?: string;
|
|
11
13
|
}
|
|
12
14
|
export interface FactorResponse {
|
|
13
15
|
object: 'authentication_factor';
|
|
14
16
|
id: string;
|
|
15
17
|
created_at: string;
|
|
16
18
|
updated_at: string;
|
|
17
|
-
type:
|
|
19
|
+
type: FactorType;
|
|
18
20
|
sms?: SmsResponse;
|
|
19
21
|
totp?: TotpResponse;
|
|
22
|
+
user_id?: string;
|
|
20
23
|
}
|
|
24
|
+
export {};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
interface TotpObject {
|
|
2
2
|
issuer: string;
|
|
3
3
|
user: string;
|
|
4
4
|
qrCode: string;
|
|
5
5
|
secret: string;
|
|
6
6
|
uri: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type TotpObjectWithOnlyIssuerAndUser = Pick<TotpObject, 'issuer' | 'user'>;
|
|
9
|
+
export type Totp = TotpObject | TotpObjectWithOnlyIssuerAndUser;
|
|
10
|
+
interface TotpResponseObject {
|
|
9
11
|
issuer: string;
|
|
10
12
|
user: string;
|
|
11
13
|
qr_code: string;
|
|
12
14
|
secret: string;
|
|
13
15
|
uri: string;
|
|
14
16
|
}
|
|
17
|
+
type TotpResponseObjectWithOnlyIssuerAndUser = Pick<TotpResponseObject, 'issuer' | 'user'>;
|
|
18
|
+
export type TotpResponse = TotpResponseObject | TotpResponseObjectWithOnlyIssuerAndUser;
|
|
19
|
+
export {};
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deserializeFactor = void 0;
|
|
4
4
|
const sms_serializer_1 = require("./sms.serializer");
|
|
5
5
|
const totp_serializer_1 = require("./totp.serializer");
|
|
6
|
-
const deserializeFactor = (factor) => (Object.assign(Object.assign({ object: factor.object, id: factor.id, createdAt: factor.created_at, updatedAt: factor.updated_at, type: factor.type }, (factor.sms ? { sms: (0, sms_serializer_1.deserializeSms)(factor.sms) } : {})), (factor.totp ? { totp: (0, totp_serializer_1.deserializeTotp)(factor.totp) } : {})));
|
|
6
|
+
const deserializeFactor = (factor) => (Object.assign(Object.assign(Object.assign({ object: factor.object, id: factor.id, createdAt: factor.created_at, updatedAt: factor.updated_at, type: factor.type }, (factor.sms ? { sms: (0, sms_serializer_1.deserializeSms)(factor.sms) } : {})), (factor.totp ? { totp: (0, totp_serializer_1.deserializeTotp)(factor.totp) } : {})), { userId: factor.user_id }));
|
|
7
7
|
exports.deserializeFactor = deserializeFactor;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deserializeTotp = void 0;
|
|
4
|
-
const deserializeTotp = (totp) =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const deserializeTotp = (totp) => {
|
|
5
|
+
if ('qr_code' in totp && 'secret' in totp && 'uri' in totp) {
|
|
6
|
+
return {
|
|
7
|
+
issuer: totp.issuer,
|
|
8
|
+
user: totp.user,
|
|
9
|
+
qrCode: totp.qr_code,
|
|
10
|
+
secret: totp.secret,
|
|
11
|
+
uri: totp.uri,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return {
|
|
16
|
+
issuer: totp.issuer,
|
|
17
|
+
user: totp.user,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
};
|
|
11
21
|
exports.deserializeTotp = deserializeTotp;
|
package/lib/sso/sso.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare class SSO {
|
|
|
6
6
|
constructor(workos: WorkOS);
|
|
7
7
|
listConnections(options?: ListConnectionsOptions): Promise<AutoPaginatable<Connection>>;
|
|
8
8
|
deleteConnection(id: string): Promise<void>;
|
|
9
|
-
|
|
9
|
+
getAuthorizationUrl({ connection, clientId, domain, domainHint, loginHint, organization, provider, redirectURI, state, }: AuthorizationURLOptions): string;
|
|
10
10
|
getConnection(id: string): Promise<Connection>;
|
|
11
|
-
getProfileAndToken({ code,
|
|
11
|
+
getProfileAndToken({ code, clientId, }: GetProfileAndTokenOptions): Promise<ProfileAndToken>;
|
|
12
12
|
getProfile({ accessToken }: GetProfileOptions): Promise<Profile>;
|
|
13
13
|
}
|
package/lib/sso/sso.js
CHANGED
|
@@ -38,7 +38,7 @@ class SSO {
|
|
|
38
38
|
yield this.workos.delete(`/connections/${id}`);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
getAuthorizationUrl({ connection, clientId, domain, domainHint, loginHint, organization, provider, redirectURI, state, }) {
|
|
42
42
|
if (!domain && !provider && !connection && !organization) {
|
|
43
43
|
throw new Error(`Incomplete arguments. Need to specify either a 'connection', 'organization', 'domain', or 'provider'.`);
|
|
44
44
|
}
|
|
@@ -52,7 +52,7 @@ class SSO {
|
|
|
52
52
|
domain_hint: domainHint,
|
|
53
53
|
login_hint: loginHint,
|
|
54
54
|
provider,
|
|
55
|
-
client_id:
|
|
55
|
+
client_id: clientId,
|
|
56
56
|
redirect_uri: redirectURI,
|
|
57
57
|
response_type: 'code',
|
|
58
58
|
state,
|
|
@@ -65,10 +65,10 @@ class SSO {
|
|
|
65
65
|
return (0, serializers_1.deserializeConnection)(data);
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
getProfileAndToken({ code,
|
|
68
|
+
getProfileAndToken({ code, clientId, }) {
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
70
|
const form = new URLSearchParams({
|
|
71
|
-
client_id:
|
|
71
|
+
client_id: clientId,
|
|
72
72
|
client_secret: this.workos.key,
|
|
73
73
|
grant_type: 'authorization_code',
|
|
74
74
|
code,
|
package/lib/sso/sso.spec.js
CHANGED
|
@@ -29,13 +29,13 @@ describe('SSO', () => {
|
|
|
29
29
|
updated_at: '2023-07-17T20:07:20.055Z',
|
|
30
30
|
};
|
|
31
31
|
describe('SSO', () => {
|
|
32
|
-
describe('
|
|
32
|
+
describe('getAuthorizationUrl', () => {
|
|
33
33
|
describe('with no custom api hostname', () => {
|
|
34
34
|
it('generates an authorize url with the default api hostname', () => {
|
|
35
35
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
36
|
-
const url = workos.sso.
|
|
36
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
37
37
|
domain: 'lyft.com',
|
|
38
|
-
|
|
38
|
+
clientId: 'proj_123',
|
|
39
39
|
redirectURI: 'example.com/sso/workos/callback',
|
|
40
40
|
});
|
|
41
41
|
expect(url).toMatchSnapshot();
|
|
@@ -44,8 +44,8 @@ describe('SSO', () => {
|
|
|
44
44
|
describe('with no domain or provider', () => {
|
|
45
45
|
it('throws an error for incomplete arguments', () => {
|
|
46
46
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
47
|
-
const urlFn = () => workos.sso.
|
|
48
|
-
|
|
47
|
+
const urlFn = () => workos.sso.getAuthorizationUrl({
|
|
48
|
+
clientId: 'proj_123',
|
|
49
49
|
redirectURI: 'example.com/sso/workos/callback',
|
|
50
50
|
});
|
|
51
51
|
expect(urlFn).toThrowErrorMatchingSnapshot();
|
|
@@ -56,9 +56,9 @@ describe('SSO', () => {
|
|
|
56
56
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU', {
|
|
57
57
|
apiHostname: 'api.workos.dev',
|
|
58
58
|
});
|
|
59
|
-
const url = workos.sso.
|
|
59
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
60
60
|
provider: 'Google',
|
|
61
|
-
|
|
61
|
+
clientId: 'proj_123',
|
|
62
62
|
redirectURI: 'example.com/sso/workos/callback',
|
|
63
63
|
});
|
|
64
64
|
expect(url).toMatchSnapshot();
|
|
@@ -69,9 +69,9 @@ describe('SSO', () => {
|
|
|
69
69
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU', {
|
|
70
70
|
apiHostname: 'api.workos.dev',
|
|
71
71
|
});
|
|
72
|
-
const url = workos.sso.
|
|
72
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
73
73
|
connection: 'connection_123',
|
|
74
|
-
|
|
74
|
+
clientId: 'proj_123',
|
|
75
75
|
redirectURI: 'example.com/sso/workos/callback',
|
|
76
76
|
});
|
|
77
77
|
expect(url).toMatchSnapshot();
|
|
@@ -82,9 +82,9 @@ describe('SSO', () => {
|
|
|
82
82
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU', {
|
|
83
83
|
apiHostname: 'api.workos.dev',
|
|
84
84
|
});
|
|
85
|
-
const url = workos.sso.
|
|
85
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
86
86
|
organization: 'organization_123',
|
|
87
|
-
|
|
87
|
+
clientId: 'proj_123',
|
|
88
88
|
redirectURI: 'example.com/sso/workos/callback',
|
|
89
89
|
});
|
|
90
90
|
expect(url).toMatchSnapshot();
|
|
@@ -95,9 +95,9 @@ describe('SSO', () => {
|
|
|
95
95
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU', {
|
|
96
96
|
apiHostname: 'api.workos.dev',
|
|
97
97
|
});
|
|
98
|
-
const url = workos.sso.
|
|
98
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
99
99
|
domain: 'lyft.com',
|
|
100
|
-
|
|
100
|
+
clientId: 'proj_123',
|
|
101
101
|
redirectURI: 'example.com/sso/workos/callback',
|
|
102
102
|
});
|
|
103
103
|
expect(url).toMatchSnapshot();
|
|
@@ -106,9 +106,9 @@ describe('SSO', () => {
|
|
|
106
106
|
describe('with state', () => {
|
|
107
107
|
it('generates an authorize url with the provided state', () => {
|
|
108
108
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
109
|
-
const url = workos.sso.
|
|
109
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
110
110
|
domain: 'lyft.com',
|
|
111
|
-
|
|
111
|
+
clientId: 'proj_123',
|
|
112
112
|
redirectURI: 'example.com/sso/workos/callback',
|
|
113
113
|
state: 'custom state',
|
|
114
114
|
});
|
|
@@ -118,10 +118,10 @@ describe('SSO', () => {
|
|
|
118
118
|
describe('with domainHint', () => {
|
|
119
119
|
it('generates an authorize url with the provided domain hint', () => {
|
|
120
120
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
121
|
-
const url = workos.sso.
|
|
121
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
122
122
|
domainHint: 'lyft.com',
|
|
123
123
|
connection: 'connection_123',
|
|
124
|
-
|
|
124
|
+
clientId: 'proj_123',
|
|
125
125
|
redirectURI: 'example.com/sso/workos/callback',
|
|
126
126
|
state: 'custom state',
|
|
127
127
|
});
|
|
@@ -131,10 +131,10 @@ describe('SSO', () => {
|
|
|
131
131
|
describe('with loginHint', () => {
|
|
132
132
|
it('generates an authorize url with the provided login hint', () => {
|
|
133
133
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
134
|
-
const url = workos.sso.
|
|
134
|
+
const url = workos.sso.getAuthorizationUrl({
|
|
135
135
|
loginHint: 'foo@workos.com',
|
|
136
136
|
connection: 'connection_123',
|
|
137
|
-
|
|
137
|
+
clientId: 'proj_123',
|
|
138
138
|
redirectURI: 'example.com/sso/workos/callback',
|
|
139
139
|
state: 'custom state',
|
|
140
140
|
});
|
|
@@ -186,7 +186,7 @@ describe('SSO', () => {
|
|
|
186
186
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
187
187
|
const { accessToken, profile } = yield workos.sso.getProfileAndToken({
|
|
188
188
|
code: 'authorization_code',
|
|
189
|
-
|
|
189
|
+
clientId: 'proj_123',
|
|
190
190
|
});
|
|
191
191
|
expect(mock.history.post.length).toBe(1);
|
|
192
192
|
const { data, headers } = mock.history.post[0];
|
|
@@ -237,7 +237,7 @@ describe('SSO', () => {
|
|
|
237
237
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
238
238
|
const { accessToken, profile } = yield workos.sso.getProfileAndToken({
|
|
239
239
|
code: 'authorization_code',
|
|
240
|
-
|
|
240
|
+
clientId: 'proj_123',
|
|
241
241
|
});
|
|
242
242
|
expect(mock.history.post.length).toBe(1);
|
|
243
243
|
const { data, headers } = mock.history.post[0];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"object": "invitation",
|
|
3
|
+
"id": "invitation_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
4
|
+
"email": "dane@workos.com",
|
|
5
|
+
"state": "pending",
|
|
6
|
+
"accepted_at": "2023-07-18T02:07:19.911Z",
|
|
7
|
+
"revoked_at": "2023-07-18T02:07:19.911Z",
|
|
8
|
+
"expires_at": "2023-07-18T02:07:19.911Z",
|
|
9
|
+
"organization_id": "org_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
10
|
+
"token": "Z1uX3RbwcIl5fIGJJJCXXisdI",
|
|
11
|
+
"created_at": "2023-07-18T02:07:19.911Z",
|
|
12
|
+
"updated_at": "2023-07-18T02:07:19.911Z"
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"object": "list",
|
|
3
|
+
"data": [
|
|
4
|
+
{
|
|
5
|
+
"object": "invitation",
|
|
6
|
+
"id": "invitation_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
7
|
+
"email": "dane@workos.com",
|
|
8
|
+
"state": "pending",
|
|
9
|
+
"accepted_at": "2023-07-18T02:07:19.911Z",
|
|
10
|
+
"revoked_at": "2023-07-18T02:07:19.911Z",
|
|
11
|
+
"expires_at": "2023-07-18T02:07:19.911Z",
|
|
12
|
+
"organization_id": "org_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
13
|
+
"token": "Z1uX3RbwcIl5fIGJJJCXXisdI",
|
|
14
|
+
"created_at": "2023-07-18T02:07:19.911Z",
|
|
15
|
+
"updated_at": "2023-07-18T02:07:19.911Z"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"list_metadata": {
|
|
19
|
+
"before": null,
|
|
20
|
+
"after": null
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"object": "list",
|
|
3
|
+
"data": [
|
|
4
|
+
{
|
|
5
|
+
"object": "organization_membership",
|
|
6
|
+
"id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
7
|
+
"user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
8
|
+
"organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
9
|
+
"created_at": "2023-07-18T02:07:19.911Z",
|
|
10
|
+
"updated_at": "2023-07-18T02:07:19.911Z"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"list_metadata": {
|
|
14
|
+
"before": null,
|
|
15
|
+
"after": null
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"object": "organization_membership",
|
|
3
|
+
"id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
4
|
+
"user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
5
|
+
"organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS",
|
|
6
|
+
"created_at": "2023-07-18T02:07:19.911Z",
|
|
7
|
+
"updated_at": "2023-07-18T02:07:19.911Z"
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AuthenticateWithOptionsBase, SerializedAuthenticateWithOptionsBase } from './authenticate-with-options-base.interface';
|
|
2
|
+
export interface AuthenticateWithCodeOptions extends AuthenticateWithOptionsBase {
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AuthenticateUserWithCodeCredentials {
|
|
6
|
+
clientSecret: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface SerializedAuthenticateWithCodeOptions extends SerializedAuthenticateWithOptionsBase {
|
|
9
|
+
grant_type: 'authorization_code';
|
|
10
|
+
code: string;
|
|
11
|
+
}
|
package/lib/user-management/interfaces/authenticate-with-email-verification-options.interface.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuthenticateWithOptionsBase, SerializedAuthenticateWithOptionsBase } from './authenticate-with-options-base.interface';
|
|
2
|
+
export interface AuthenticateWithEmailVerificationOptions extends AuthenticateWithOptionsBase {
|
|
3
|
+
code: string;
|
|
4
|
+
pendingAuthenticationToken: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthenticateUserWithEmailVerificationCredentials {
|
|
7
|
+
clientSecret: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface SerializedAuthenticateWithEmailVerificationOptions extends SerializedAuthenticateWithOptionsBase {
|
|
10
|
+
grant_type: 'urn:workos:oauth:grant-type:email-verification:code';
|
|
11
|
+
code: string;
|
|
12
|
+
pending_authentication_token: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AuthenticateWithOptionsBase, SerializedAuthenticateWithOptionsBase } from './authenticate-with-options-base.interface';
|
|
2
|
+
export interface AuthenticateWithMagicAuthOptions extends AuthenticateWithOptionsBase {
|
|
3
|
+
code: string;
|
|
4
|
+
email: string;
|
|
5
|
+
linkAuthorizationCode?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AuthenticateUserWithMagicAuthCredentials {
|
|
8
|
+
clientSecret: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface SerializedAuthenticateWithMagicAuthOptions extends SerializedAuthenticateWithOptionsBase {
|
|
11
|
+
grant_type: 'urn:workos:oauth:grant-type:magic-auth:code';
|
|
12
|
+
code: string;
|
|
13
|
+
email: string;
|
|
14
|
+
link_authorization_code?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AuthenticateWithOptionsBase {
|
|
2
|
+
clientId: string;
|
|
3
|
+
ipAddress?: string;
|
|
4
|
+
userAgent?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SerializedAuthenticateWithOptionsBase {
|
|
7
|
+
client_id: string;
|
|
8
|
+
client_secret: string | undefined;
|
|
9
|
+
ip_address?: string;
|
|
10
|
+
user_agent?: string;
|
|
11
|
+
}
|
package/lib/user-management/interfaces/authenticate-with-organization-selection.interface.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuthenticateWithOptionsBase, SerializedAuthenticateWithOptionsBase } from './authenticate-with-options-base.interface';
|
|
2
|
+
export interface AuthenticateWithOrganizationSelectionOptions extends AuthenticateWithOptionsBase {
|
|
3
|
+
organizationId: string;
|
|
4
|
+
pendingAuthenticationToken: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthenticateUserWithOrganizationSelectionCredentials {
|
|
7
|
+
clientSecret: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface SerializedAuthenticateWithOrganizationSelectionOptions extends SerializedAuthenticateWithOptionsBase {
|
|
10
|
+
grant_type: 'urn:workos:oauth:grant-type:organization-selection';
|
|
11
|
+
organization_id: string;
|
|
12
|
+
pending_authentication_token: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuthenticateWithOptionsBase, SerializedAuthenticateWithOptionsBase } from './authenticate-with-options-base.interface';
|
|
2
|
+
export interface AuthenticateWithPasswordOptions extends AuthenticateWithOptionsBase {
|
|
3
|
+
email: string;
|
|
4
|
+
password: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthenticateUserWithPasswordCredentials {
|
|
7
|
+
clientSecret: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface SerializedAuthenticateWithPasswordOptions extends SerializedAuthenticateWithOptionsBase {
|
|
10
|
+
grant_type: 'password';
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
}
|
package/lib/{users → user-management}/interfaces/authenticate-with-totp-options.interface.d.ts
RENAMED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { AuthenticateWithOptionsBase, SerializedAuthenticateWithOptionsBase } from './authenticate-with-options-base.interface';
|
|
2
|
+
export interface AuthenticateWithTotpOptions extends AuthenticateWithOptionsBase {
|
|
3
3
|
code: string;
|
|
4
4
|
pendingAuthenticationToken: string;
|
|
5
5
|
authenticationChallengeId: string;
|
|
6
|
-
ipAddress?: string;
|
|
7
|
-
userAgent?: string;
|
|
8
6
|
}
|
|
9
7
|
export interface AuthenticateUserWithTotpCredentials {
|
|
10
8
|
clientSecret: string | undefined;
|
|
11
9
|
}
|
|
12
|
-
export interface SerializedAuthenticateWithTotpOptions {
|
|
10
|
+
export interface SerializedAuthenticateWithTotpOptions extends SerializedAuthenticateWithOptionsBase {
|
|
13
11
|
grant_type: 'urn:workos:oauth:grant-type:mfa-totp';
|
|
14
|
-
client_id: string;
|
|
15
|
-
client_secret: string | undefined;
|
|
16
12
|
code: string;
|
|
17
13
|
pending_authentication_token: string;
|
|
18
14
|
authentication_challenge_id: string;
|
|
19
|
-
ip_address?: string;
|
|
20
|
-
user_agent?: string;
|
|
21
15
|
}
|