@workos-inc/node 3.9.0 → 4.0.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 +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 +23 -3
- package/lib/mfa/interfaces/totp.interface.d.ts +4 -0
- package/lib/mfa/mfa.d.ts +2 -2
- package/lib/mfa/mfa.js +1 -1
- package/lib/mfa/mfa.spec.js +0 -6
- package/lib/mfa/serializers/factor.serializer.d.ts +2 -1
- package/lib/mfa/serializers/factor.serializer.js +3 -1
- package/lib/mfa/serializers/totp.serializer.d.ts +2 -1
- package/lib/mfa/serializers/totp.serializer.js +17 -8
- package/lib/sso/interfaces/authorization-url-options.interface.d.ts +2 -2
- 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 +5 -5
- package/lib/sso/sso.spec.js +30 -30
- package/lib/user-management/fixtures/invitation.json +13 -0
- package/lib/{users → user-management}/fixtures/list-factors.json +0 -3
- 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/user-management/interfaces/factor.interface.d.ts +37 -0
- 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/update-user-password-options.interface.js +2 -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/factor.serializer.d.ts +3 -0
- package/lib/user-management/serializers/factor.serializer.js +24 -0
- package/lib/{users → user-management}/serializers/index.d.ts +1 -0
- package/lib/{users → user-management}/serializers/index.js +1 -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 +54 -0
- package/lib/user-management/user-management.js +215 -0
- package/lib/user-management/user-management.spec.js +745 -0
- package/lib/workos.d.ts +2 -4
- package/lib/workos.js +3 -5
- package/package.json +2 -2
- 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-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/factor.interface.js} +0 -0
- /package/lib/{users/interfaces/delete-user-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/list-users-options.interface.js → user-management/interfaces/list-invitations-options.interface.js} +0 -0
- /package/lib/{users/interfaces/remove-user-from-organization-options.interface.js → user-management/interfaces/list-organization-memberships-options.interface.js} +0 -0
- /package/lib/{users/interfaces/reset-password-options.interface.js → user-management/interfaces/list-users-options.interface.js} +0 -0
- /package/lib/{users/interfaces/send-magic-auth-code-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-password-reset-options.interface.js → user-management/interfaces/reset-password-options.interface.js} +0 -0
- /package/lib/{users/interfaces/send-verification-email-options.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/update-user-options.interface.js → user-management/interfaces/send-magic-auth-code-options.interface.js} +0 -0
- /package/lib/{users/interfaces/update-user-password-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/user.interface.js → user-management/interfaces/send-verification-email-options.js} +0 -0
- /package/lib/{users/interfaces/verify-email-code-options.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 → 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/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
|
@@ -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
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface EnrollAuthFactorOptions {
|
|
2
2
|
userId: string;
|
|
3
3
|
type: 'totp';
|
|
4
|
-
totpIssuer
|
|
5
|
-
totpUser
|
|
4
|
+
totpIssuer?: string;
|
|
5
|
+
totpUser?: string;
|
|
6
6
|
}
|
|
7
7
|
export interface SerializedEnrollUserInMfaFactorOptions {
|
|
8
8
|
type: 'totp';
|
|
9
|
-
totp_issuer
|
|
10
|
-
totp_user
|
|
9
|
+
totp_issuer?: string;
|
|
10
|
+
totp_user?: string;
|
|
11
11
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Totp, TotpResponse, TotpWithSecrets, TotpWithSecretsResponse } from '../../mfa/interfaces/totp.interface';
|
|
2
|
+
export interface Factor {
|
|
3
|
+
object: 'authentication_factor';
|
|
4
|
+
id: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
type: 'totp';
|
|
8
|
+
totp: Totp;
|
|
9
|
+
userId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FactorWithSecrets {
|
|
12
|
+
object: 'authentication_factor';
|
|
13
|
+
id: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
type: 'totp';
|
|
17
|
+
totp: TotpWithSecrets;
|
|
18
|
+
userId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FactorResponse {
|
|
21
|
+
object: 'authentication_factor';
|
|
22
|
+
id: string;
|
|
23
|
+
created_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
type: 'totp';
|
|
26
|
+
totp: TotpResponse;
|
|
27
|
+
user_id: string;
|
|
28
|
+
}
|
|
29
|
+
export interface FactorWithSecretsResponse {
|
|
30
|
+
object: 'authentication_factor';
|
|
31
|
+
id: string;
|
|
32
|
+
created_at: string;
|
|
33
|
+
updated_at: string;
|
|
34
|
+
type: 'totp';
|
|
35
|
+
totp: TotpWithSecretsResponse;
|
|
36
|
+
user_id: string;
|
|
37
|
+
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
export * from './add-user-to-organization-options.interface';
|
|
2
1
|
export * from './authenticate-with-magic-auth-options.interface';
|
|
3
2
|
export * from './authenticate-with-password-options.interface';
|
|
4
3
|
export * from './authenticate-with-code-options.interface';
|
|
5
4
|
export * from './authenticate-with-totp-options.interface';
|
|
6
5
|
export * from './authentication-response.interface';
|
|
7
6
|
export * from './reset-password-options.interface';
|
|
8
|
-
export * from './send-password-reset-options.interface';
|
|
7
|
+
export * from './send-password-reset-email-options.interface';
|
|
9
8
|
export * from './create-user-options.interface';
|
|
10
|
-
export * from './delete-user-options.interface';
|
|
11
9
|
export * from './enroll-auth-factor.interface';
|
|
12
10
|
export * from './list-users-options.interface';
|
|
13
11
|
export * from './list-auth-factors-options.interface';
|
|
14
|
-
export * from './remove-user-from-organization-options.interface';
|
|
15
12
|
export * from './send-magic-auth-code-options.interface';
|
|
16
13
|
export * from './send-verification-email-options';
|
|
17
14
|
export * from './update-user-options.interface';
|
|
18
15
|
export * from './update-user-password-options.interface';
|
|
19
16
|
export * from './user.interface';
|
|
20
|
-
export * from './verify-email-
|
|
17
|
+
export * from './verify-email-options.interface';
|
|
@@ -14,23 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./add-user-to-organization-options.interface"), exports);
|
|
18
17
|
__exportStar(require("./authenticate-with-magic-auth-options.interface"), exports);
|
|
19
18
|
__exportStar(require("./authenticate-with-password-options.interface"), exports);
|
|
20
19
|
__exportStar(require("./authenticate-with-code-options.interface"), exports);
|
|
21
20
|
__exportStar(require("./authenticate-with-totp-options.interface"), exports);
|
|
22
21
|
__exportStar(require("./authentication-response.interface"), exports);
|
|
23
22
|
__exportStar(require("./reset-password-options.interface"), exports);
|
|
24
|
-
__exportStar(require("./send-password-reset-options.interface"), exports);
|
|
23
|
+
__exportStar(require("./send-password-reset-email-options.interface"), exports);
|
|
25
24
|
__exportStar(require("./create-user-options.interface"), exports);
|
|
26
|
-
__exportStar(require("./delete-user-options.interface"), exports);
|
|
27
25
|
__exportStar(require("./enroll-auth-factor.interface"), exports);
|
|
28
26
|
__exportStar(require("./list-users-options.interface"), exports);
|
|
29
27
|
__exportStar(require("./list-auth-factors-options.interface"), exports);
|
|
30
|
-
__exportStar(require("./remove-user-from-organization-options.interface"), exports);
|
|
31
28
|
__exportStar(require("./send-magic-auth-code-options.interface"), exports);
|
|
32
29
|
__exportStar(require("./send-verification-email-options"), exports);
|
|
33
30
|
__exportStar(require("./update-user-options.interface"), exports);
|
|
34
31
|
__exportStar(require("./update-user-password-options.interface"), exports);
|
|
35
32
|
__exportStar(require("./user.interface"), exports);
|
|
36
|
-
__exportStar(require("./verify-email-
|
|
33
|
+
__exportStar(require("./verify-email-options.interface"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface Invitation {
|
|
2
|
+
object: 'invitation';
|
|
3
|
+
id: string;
|
|
4
|
+
email: string;
|
|
5
|
+
state: 'pending' | 'accepted' | 'expired' | 'revoked';
|
|
6
|
+
acceptedAt: string | null;
|
|
7
|
+
revokedAt: string | null;
|
|
8
|
+
expiresAt: string;
|
|
9
|
+
organizationId: string | null;
|
|
10
|
+
token: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface InvitationResponse {
|
|
15
|
+
object: 'invitation';
|
|
16
|
+
id: string;
|
|
17
|
+
email: string;
|
|
18
|
+
state: 'pending' | 'accepted' | 'expired' | 'revoked';
|
|
19
|
+
accepted_at: string | null;
|
|
20
|
+
revoked_at: string | null;
|
|
21
|
+
expires_at: string;
|
|
22
|
+
organization_id: string | null;
|
|
23
|
+
token: string;
|
|
24
|
+
created_at: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PaginationOptions } from '../../common/interfaces';
|
|
2
|
+
export interface ListInvitationsOptions extends PaginationOptions {
|
|
3
|
+
organizationId?: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SerializedListInvitationsOptions extends PaginationOptions {
|
|
7
|
+
organization_id?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PaginationOptions } from '../../common/interfaces';
|
|
2
|
+
export interface ListOrganizationMembershipsOptions extends PaginationOptions {
|
|
3
|
+
organizationId?: string;
|
|
4
|
+
userId?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SerializedListOrganizationMembershipsOptions extends PaginationOptions {
|
|
7
|
+
organization_id?: string;
|
|
8
|
+
user_id?: string;
|
|
9
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { PaginationOptions } from '../../common/interfaces/pagination-options.interface';
|
|
2
2
|
export interface ListUsersOptions extends PaginationOptions {
|
|
3
3
|
email?: string;
|
|
4
|
-
|
|
4
|
+
organizationId?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SerializedListUsersOptions extends PaginationOptions {
|
|
7
|
+
email?: string;
|
|
8
|
+
organization_id?: string;
|
|
5
9
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface OrganizationMembership {
|
|
2
|
+
object: 'organization_membership';
|
|
3
|
+
id: string;
|
|
4
|
+
organizationId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
updatedAt: string;
|
|
8
|
+
}
|
|
9
|
+
export interface OrganizationMembershipResponse {
|
|
10
|
+
object: 'organization_membership';
|
|
11
|
+
id: string;
|
|
12
|
+
organization_id: string;
|
|
13
|
+
user_id: string;
|
|
14
|
+
created_at: string;
|
|
15
|
+
updated_at: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SendInvitationOptions {
|
|
2
|
+
email: string;
|
|
3
|
+
organizationId?: string;
|
|
4
|
+
expiresInDays?: number;
|
|
5
|
+
inviterUserId?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SerializedSendInvitationOptions {
|
|
8
|
+
email: string;
|
|
9
|
+
organization_id?: string;
|
|
10
|
+
expires_in_days?: number;
|
|
11
|
+
inviter_user_id?: string;
|
|
12
|
+
}
|
|
@@ -3,9 +3,15 @@ export interface UpdateUserOptions {
|
|
|
3
3
|
firstName?: string;
|
|
4
4
|
lastName?: string;
|
|
5
5
|
emailVerified?: boolean;
|
|
6
|
+
password?: string;
|
|
7
|
+
passwordHash?: string;
|
|
8
|
+
passwordHashType?: 'bcrypt';
|
|
6
9
|
}
|
|
7
10
|
export interface SerializedUpdateUserOptions {
|
|
8
11
|
first_name?: string;
|
|
9
12
|
last_name?: string;
|
|
10
13
|
email_verified?: boolean;
|
|
14
|
+
password?: string;
|
|
15
|
+
password_hash?: string;
|
|
16
|
+
password_hash_type?: 'bcrypt';
|
|
11
17
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AuthenticateUserWithEmailVerificationCredentials, AuthenticateWithEmailVerificationOptions, SerializedAuthenticateWithEmailVerificationOptions } from '../interfaces/authenticate-with-email-verification-options.interface';
|
|
2
|
+
export declare const serializeAuthenticateWithEmailVerificationOptions: (options: AuthenticateWithEmailVerificationOptions & AuthenticateUserWithEmailVerificationCredentials) => SerializedAuthenticateWithEmailVerificationOptions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeAuthenticateWithEmailVerificationOptions = void 0;
|
|
4
|
+
const serializeAuthenticateWithEmailVerificationOptions = (options) => ({
|
|
5
|
+
grant_type: 'urn:workos:oauth:grant-type:email-verification:code',
|
|
6
|
+
client_id: options.clientId,
|
|
7
|
+
client_secret: options.clientSecret,
|
|
8
|
+
pending_authentication_token: options.pendingAuthenticationToken,
|
|
9
|
+
code: options.code,
|
|
10
|
+
ip_address: options.ipAddress,
|
|
11
|
+
user_agent: options.userAgent,
|
|
12
|
+
});
|
|
13
|
+
exports.serializeAuthenticateWithEmailVerificationOptions = serializeAuthenticateWithEmailVerificationOptions;
|
package/lib/{users → user-management}/serializers/authenticate-with-magic-auth-options.serializer.js
RENAMED
|
@@ -6,7 +6,8 @@ const serializeAuthenticateWithMagicAuthOptions = (options) => ({
|
|
|
6
6
|
client_id: options.clientId,
|
|
7
7
|
client_secret: options.clientSecret,
|
|
8
8
|
code: options.code,
|
|
9
|
-
|
|
9
|
+
email: options.email,
|
|
10
|
+
link_authorization_code: options.linkAuthorizationCode,
|
|
10
11
|
ip_address: options.ipAddress,
|
|
11
12
|
user_agent: options.userAgent,
|
|
12
13
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AuthenticateUserWithOrganizationSelectionCredentials, AuthenticateWithOrganizationSelectionOptions, SerializedAuthenticateWithOrganizationSelectionOptions } from '../interfaces/authenticate-with-organization-selection.interface';
|
|
2
|
+
export declare const serializeAuthenticateWithOrganizationSelectionOptions: (options: AuthenticateWithOrganizationSelectionOptions & AuthenticateUserWithOrganizationSelectionCredentials) => SerializedAuthenticateWithOrganizationSelectionOptions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeAuthenticateWithOrganizationSelectionOptions = void 0;
|
|
4
|
+
const serializeAuthenticateWithOrganizationSelectionOptions = (options) => ({
|
|
5
|
+
grant_type: 'urn:workos:oauth:grant-type:organization-selection',
|
|
6
|
+
client_id: options.clientId,
|
|
7
|
+
client_secret: options.clientSecret,
|
|
8
|
+
pending_authentication_token: options.pendingAuthenticationToken,
|
|
9
|
+
organization_id: options.organizationId,
|
|
10
|
+
ip_address: options.ipAddress,
|
|
11
|
+
user_agent: options.userAgent,
|
|
12
|
+
});
|
|
13
|
+
exports.serializeAuthenticateWithOrganizationSelectionOptions = serializeAuthenticateWithOrganizationSelectionOptions;
|
|
@@ -4,5 +4,6 @@ exports.deserializeAuthenticationResponse = void 0;
|
|
|
4
4
|
const user_serializer_1 = require("./user.serializer");
|
|
5
5
|
const deserializeAuthenticationResponse = (authenticationResponse) => ({
|
|
6
6
|
user: (0, user_serializer_1.deserializeUser)(authenticationResponse.user),
|
|
7
|
+
organizationId: authenticationResponse.organization_id,
|
|
7
8
|
});
|
|
8
9
|
exports.deserializeAuthenticationResponse = deserializeAuthenticationResponse;
|
package/lib/user-management/serializers/create-organization-membership-options.serializer.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CreateOrganizationMembershipOptions, SerializedCreateOrganizationMembershipOptions } from '../interfaces/create-organization-membership-options.interface';
|
|
2
|
+
export declare const serializeCreateOrganizationMembershipOptions: (options: CreateOrganizationMembershipOptions) => SerializedCreateOrganizationMembershipOptions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeCreateOrganizationMembershipOptions = void 0;
|
|
4
|
+
const serializeCreateOrganizationMembershipOptions = (options) => ({
|
|
5
|
+
organization_id: options.organizationId,
|
|
6
|
+
user_id: options.userId,
|
|
7
|
+
});
|
|
8
|
+
exports.serializeCreateOrganizationMembershipOptions = serializeCreateOrganizationMembershipOptions;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Factor, FactorResponse, FactorWithSecrets, FactorWithSecretsResponse } from '../interfaces/factor.interface';
|
|
2
|
+
export declare const deserializeFactor: (factor: FactorResponse) => Factor;
|
|
3
|
+
export declare const deserializeFactorWithSecrets: (factor: FactorWithSecretsResponse) => FactorWithSecrets;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeFactorWithSecrets = exports.deserializeFactor = void 0;
|
|
4
|
+
const totp_serializer_1 = require("../../mfa/serializers/totp.serializer");
|
|
5
|
+
const deserializeFactor = (factor) => ({
|
|
6
|
+
object: factor.object,
|
|
7
|
+
id: factor.id,
|
|
8
|
+
createdAt: factor.created_at,
|
|
9
|
+
updatedAt: factor.updated_at,
|
|
10
|
+
type: factor.type,
|
|
11
|
+
totp: (0, totp_serializer_1.deserializeTotp)(factor.totp),
|
|
12
|
+
userId: factor.user_id,
|
|
13
|
+
});
|
|
14
|
+
exports.deserializeFactor = deserializeFactor;
|
|
15
|
+
const deserializeFactorWithSecrets = (factor) => ({
|
|
16
|
+
object: factor.object,
|
|
17
|
+
id: factor.id,
|
|
18
|
+
createdAt: factor.created_at,
|
|
19
|
+
updatedAt: factor.updated_at,
|
|
20
|
+
type: factor.type,
|
|
21
|
+
totp: (0, totp_serializer_1.deserializeTotpWithSecrets)(factor.totp),
|
|
22
|
+
userId: factor.user_id,
|
|
23
|
+
});
|
|
24
|
+
exports.deserializeFactorWithSecrets = deserializeFactorWithSecrets;
|
|
@@ -4,6 +4,7 @@ export * from './authenticate-with-password-options.serializer';
|
|
|
4
4
|
export * from './authenticate-with-totp-options.serializer';
|
|
5
5
|
export * from './authentication-response.serializer';
|
|
6
6
|
export * from './enroll-auth-factor-options.serializer';
|
|
7
|
+
export * from './factor.serializer';
|
|
7
8
|
export * from './reset-password-options.serializer';
|
|
8
9
|
export * from './send-password-reset-email.serializer';
|
|
9
10
|
export * from './create-user-options.serializer';
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./authenticate-with-password-options.serializer"), exports
|
|
|
20
20
|
__exportStar(require("./authenticate-with-totp-options.serializer"), exports);
|
|
21
21
|
__exportStar(require("./authentication-response.serializer"), exports);
|
|
22
22
|
__exportStar(require("./enroll-auth-factor-options.serializer"), exports);
|
|
23
|
+
__exportStar(require("./factor.serializer"), exports);
|
|
23
24
|
__exportStar(require("./reset-password-options.serializer"), exports);
|
|
24
25
|
__exportStar(require("./send-password-reset-email.serializer"), exports);
|
|
25
26
|
__exportStar(require("./create-user-options.serializer"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeInvitation = void 0;
|
|
4
|
+
const deserializeInvitation = (invitation) => ({
|
|
5
|
+
object: invitation.object,
|
|
6
|
+
id: invitation.id,
|
|
7
|
+
email: invitation.email,
|
|
8
|
+
state: invitation.state,
|
|
9
|
+
acceptedAt: invitation.accepted_at,
|
|
10
|
+
revokedAt: invitation.revoked_at,
|
|
11
|
+
expiresAt: invitation.expires_at,
|
|
12
|
+
organizationId: invitation.organization_id,
|
|
13
|
+
token: invitation.token,
|
|
14
|
+
createdAt: invitation.created_at,
|
|
15
|
+
updatedAt: invitation.updated_at,
|
|
16
|
+
});
|
|
17
|
+
exports.deserializeInvitation = deserializeInvitation;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeListInvitationsOptions = void 0;
|
|
4
|
+
const serializeListInvitationsOptions = (options) => ({
|
|
5
|
+
email: options.email,
|
|
6
|
+
organization_id: options.organizationId,
|
|
7
|
+
limit: options.limit,
|
|
8
|
+
before: options.before,
|
|
9
|
+
after: options.after,
|
|
10
|
+
order: options.order,
|
|
11
|
+
});
|
|
12
|
+
exports.serializeListInvitationsOptions = serializeListInvitationsOptions;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ListOrganizationMembershipsOptions, SerializedListOrganizationMembershipsOptions } from '../interfaces/list-organization-memberships-options.interface';
|
|
2
|
+
export declare const serializeListOrganizationMembershipsOptions: (options: ListOrganizationMembershipsOptions) => SerializedListOrganizationMembershipsOptions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeListOrganizationMembershipsOptions = void 0;
|
|
4
|
+
const serializeListOrganizationMembershipsOptions = (options) => ({
|
|
5
|
+
user_id: options.userId,
|
|
6
|
+
organization_id: options.organizationId,
|
|
7
|
+
limit: options.limit,
|
|
8
|
+
before: options.before,
|
|
9
|
+
after: options.after,
|
|
10
|
+
order: options.order,
|
|
11
|
+
});
|
|
12
|
+
exports.serializeListOrganizationMembershipsOptions = serializeListOrganizationMembershipsOptions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeListUsersOptions = void 0;
|
|
4
|
+
const serializeListUsersOptions = (options) => ({
|
|
5
|
+
email: options.email,
|
|
6
|
+
organization_id: options.organizationId,
|
|
7
|
+
limit: options.limit,
|
|
8
|
+
before: options.before,
|
|
9
|
+
after: options.after,
|
|
10
|
+
order: options.order,
|
|
11
|
+
});
|
|
12
|
+
exports.serializeListUsersOptions = serializeListUsersOptions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeOrganizationMembership = void 0;
|
|
4
|
+
const deserializeOrganizationMembership = (organizationMembership) => ({
|
|
5
|
+
object: organizationMembership.object,
|
|
6
|
+
id: organizationMembership.id,
|
|
7
|
+
userId: organizationMembership.user_id,
|
|
8
|
+
organizationId: organizationMembership.organization_id,
|
|
9
|
+
createdAt: organizationMembership.created_at,
|
|
10
|
+
updatedAt: organizationMembership.updated_at,
|
|
11
|
+
});
|
|
12
|
+
exports.deserializeOrganizationMembership = deserializeOrganizationMembership;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeSendInvitationOptions = void 0;
|
|
4
|
+
const serializeSendInvitationOptions = (options) => ({
|
|
5
|
+
email: options.email,
|
|
6
|
+
organization_id: options.organizationId,
|
|
7
|
+
expires_in_days: options.expiresInDays,
|
|
8
|
+
inviter_user_id: options.inviterUserId,
|
|
9
|
+
});
|
|
10
|
+
exports.serializeSendInvitationOptions = serializeSendInvitationOptions;
|