@workos-inc/node 8.0.0-rc.2 → 8.0.0-rc.3

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.
Files changed (59) hide show
  1. package/lib/cjs/client/sso.cjs +2 -2
  2. package/lib/cjs/client/sso.cjs.map +1 -1
  3. package/lib/cjs/client/user-management.cjs +2 -2
  4. package/lib/cjs/client/user-management.cjs.map +1 -1
  5. package/lib/cjs/common/exceptions/unprocessable-entity.exception.cjs +1 -12
  6. package/lib/cjs/common/exceptions/unprocessable-entity.exception.cjs.map +1 -1
  7. package/lib/cjs/common/net/fetch-client.cjs +4 -4
  8. package/lib/cjs/common/net/fetch-client.cjs.map +1 -1
  9. package/lib/cjs/common/net/http-client.cjs +4 -1
  10. package/lib/cjs/common/net/http-client.cjs.map +1 -1
  11. package/lib/cjs/common/net/http-client.d.cts +1 -0
  12. package/lib/cjs/common/utils/leb128.cjs +101 -0
  13. package/lib/cjs/common/utils/leb128.cjs.map +1 -0
  14. package/lib/cjs/common/utils/leb128.d.cts +24 -0
  15. package/lib/cjs/common/utils/query-string.cjs +66 -0
  16. package/lib/cjs/common/utils/query-string.cjs.map +1 -0
  17. package/lib/cjs/common/utils/query-string.d.cts +11 -0
  18. package/lib/cjs/vault/vault.cjs +3 -3
  19. package/lib/cjs/vault/vault.cjs.map +1 -1
  20. package/lib/cjs/widgets/interfaces/get-token.cjs.map +1 -1
  21. package/lib/cjs/widgets/interfaces/get-token.d.cts +1 -1
  22. package/lib/cjs/workos.cjs +1 -1
  23. package/lib/cjs/workos.cjs.map +1 -1
  24. package/lib/esm/client/sso.js +1 -1
  25. package/lib/esm/client/sso.js.map +1 -1
  26. package/lib/esm/client/user-management.js +1 -1
  27. package/lib/esm/client/user-management.js.map +1 -1
  28. package/lib/esm/common/exceptions/unprocessable-entity.exception.js +1 -2
  29. package/lib/esm/common/exceptions/unprocessable-entity.exception.js.map +1 -1
  30. package/lib/esm/common/net/fetch-client.js +4 -4
  31. package/lib/esm/common/net/fetch-client.js.map +1 -1
  32. package/lib/esm/common/net/http-client.d.ts +1 -0
  33. package/lib/esm/common/net/http-client.js +4 -1
  34. package/lib/esm/common/net/http-client.js.map +1 -1
  35. package/lib/esm/common/utils/leb128.d.ts +24 -0
  36. package/lib/esm/common/utils/leb128.js +77 -0
  37. package/lib/esm/common/utils/leb128.js.map +1 -0
  38. package/lib/esm/common/utils/query-string.d.ts +11 -0
  39. package/lib/esm/common/utils/query-string.js +43 -0
  40. package/lib/esm/common/utils/query-string.js.map +1 -0
  41. package/lib/esm/vault/vault.js +1 -1
  42. package/lib/esm/vault/vault.js.map +1 -1
  43. package/lib/esm/widgets/interfaces/get-token.d.ts +1 -1
  44. package/lib/esm/widgets/interfaces/get-token.js.map +1 -1
  45. package/lib/esm/workos.js +1 -1
  46. package/lib/esm/workos.js.map +1 -1
  47. package/package.json +2 -6
  48. package/lib/cjs/client/utils.cjs +0 -49
  49. package/lib/cjs/client/utils.cjs.map +0 -1
  50. package/lib/cjs/client/utils.d.cts +0 -7
  51. package/lib/cjs/common/interfaces/delete-options.interface.cjs +0 -17
  52. package/lib/cjs/common/interfaces/delete-options.interface.cjs.map +0 -1
  53. package/lib/cjs/common/interfaces/delete-options.interface.d.cts +0 -8
  54. package/lib/cjs/workos-BcNRiAbw.d.cts +0 -398
  55. package/lib/cjs/workos-BjsIEalN.d.cts +0 -399
  56. package/lib/cjs/workos-ZPbUKdml.d.cts +0 -397
  57. package/lib/esm/client/utils.d.ts +0 -7
  58. package/lib/esm/client/utils.js +0 -16
  59. package/lib/esm/client/utils.js.map +0 -1
@@ -1,399 +0,0 @@
1
- import { DeleteOptions } from './common/interfaces/delete-options.interface.cjs';
2
- import { GetOptions } from './common/interfaces/get-options.interface.cjs';
3
- import { PostOptions } from './common/interfaces/post-options.interface.cjs';
4
- import { PutOptions } from './common/interfaces/put-options.interface.cjs';
5
- import { WorkOSOptions } from './common/interfaces/workos-options.interface.cjs';
6
- import { ListEventOptions } from './events/interfaces/list-events-options.interface.cjs';
7
- import { Event } from './common/interfaces/event.interface.cjs';
8
- import { List } from './common/interfaces/list.interface.cjs';
9
- import { AutoPaginatable } from './common/utils/pagination.cjs';
10
- import { CreateOrganizationOptions, CreateOrganizationRequestOptions } from './organizations/interfaces/create-organization-options.interface.cjs';
11
- import { ListOrganizationFeatureFlagsOptions } from './organizations/interfaces/list-organization-feature-flags-options.interface.cjs';
12
- import { ListOrganizationsOptions } from './organizations/interfaces/list-organizations-options.interface.cjs';
13
- import { Organization } from './organizations/interfaces/organization.interface.cjs';
14
- import { UpdateOrganizationOptions } from './organizations/interfaces/update-organization-options.interface.cjs';
15
- import { FeatureFlag } from './feature-flags/interfaces/feature-flag.interface.cjs';
16
- import { RoleList } from './roles/interfaces/role.interface.cjs';
17
- import { ListOrganizationRolesOptions } from './organizations/interfaces/list-organization-roles-options.interface.cjs';
18
- import { CreateOrganizationDomainOptions } from './organization-domains/interfaces/create-organization-domain-options.interface.cjs';
19
- import { OrganizationDomain } from './organization-domains/interfaces/organization-domain.interface.cjs';
20
- import { PasswordlessSession } from './passwordless/interfaces/passwordless-session.interface.cjs';
21
- import { CreatePasswordlessSessionOptions } from './passwordless/interfaces/create-passwordless-session-options.interface.cjs';
22
- import { SendSessionResponse } from './passwordless/interfaces/send-session-response.interface.cjs';
23
- import { GeneratePortalLinkIntent } from './portal/interfaces/generate-portal-link-intent.interface.cjs';
24
- import { UnknownRecord } from './common/interfaces/unknown-record.interface.cjs';
25
- import { SSOAuthorizationURLOptions } from './sso/interfaces/authorization-url-options.interface.cjs';
26
- import { Connection } from './sso/interfaces/connection.interface.cjs';
27
- import { GetProfileOptions } from './sso/interfaces/get-profile-options.interface.cjs';
28
- import { GetProfileAndTokenOptions } from './sso/interfaces/get-profile-and-token-options.interface.cjs';
29
- import { ListConnectionsOptions, SerializedListConnectionsOptions } from './sso/interfaces/list-connections-options.interface.cjs';
30
- import { ProfileAndToken } from './sso/interfaces/profile-and-token.interface.cjs';
31
- import { Profile } from './sso/interfaces/profile.interface.cjs';
32
- import { Webhooks } from './webhooks/webhooks.cjs';
33
- import { ChallengeFactorOptions } from './mfa/interfaces/challenge-factor-options.cjs';
34
- import { Challenge } from './mfa/interfaces/challenge.interface.cjs';
35
- import { EnrollFactorOptions } from './mfa/interfaces/enroll-factor-options.cjs';
36
- import { Factor, FactorWithSecrets } from './mfa/interfaces/factor.interface.cjs';
37
- import { VerifyChallengeOptions } from './mfa/interfaces/verify-challenge-options.cjs';
38
- import { VerifyResponse } from './mfa/interfaces/verify-challenge-response.cjs';
39
- import { AuditLogExportOptions } from './audit-logs/interfaces/audit-log-export-options.interface.cjs';
40
- import { AuditLogExport } from './audit-logs/interfaces/audit-log-export.interface.cjs';
41
- import { CreateAuditLogEventOptions, CreateAuditLogEventRequestOptions } from './audit-logs/interfaces/create-audit-log-event-options.interface.cjs';
42
- import { CreateAuditLogSchemaOptions, CreateAuditLogSchemaRequestOptions, AuditLogSchema } from './audit-logs/interfaces/create-audit-log-schema-options.interface.cjs';
43
- import { createRemoteJWKSet } from 'jose';
44
- import { L as LogoutURLOptions } from './user-management-qKHMGyQi.cjs';
45
- import { PaginationOptions } from './common/interfaces/pagination-options.interface.cjs';
46
- import { AuthenticateWithCodeOptions } from './user-management/interfaces/authenticate-with-code-options.interface.cjs';
47
- import { AuthenticateWithCodeAndVerifierOptions } from './user-management/interfaces/authenticate-with-code-and-verifier-options.interface.cjs';
48
- import { AuthenticateWithEmailVerificationOptions } from './user-management/interfaces/authenticate-with-email-verification-options.interface.cjs';
49
- import { AuthenticateWithMagicAuthOptions } from './user-management/interfaces/authenticate-with-magic-auth-options.interface.cjs';
50
- import { AuthenticateWithOrganizationSelectionOptions } from './user-management/interfaces/authenticate-with-organization-selection.interface.cjs';
51
- import { AuthenticateWithPasswordOptions } from './user-management/interfaces/authenticate-with-password-options.interface.cjs';
52
- import { AuthenticateWithRefreshTokenOptions } from './user-management/interfaces/authenticate-with-refresh-token-options.interface.cjs';
53
- import { AuthenticateWithSessionCookieSuccessResponse, AuthenticateWithSessionCookieFailedResponse, AuthenticateWithSessionCookieOptions, SessionCookieData } from './user-management/interfaces/authenticate-with-session-cookie.interface.cjs';
54
- import { AuthenticateWithTotpOptions } from './user-management/interfaces/authenticate-with-totp-options.interface.cjs';
55
- import { AuthenticationResponse } from './user-management/interfaces/authentication-response.interface.cjs';
56
- import { UserManagementAuthorizationURLOptions } from './user-management/interfaces/authorization-url-options.interface.cjs';
57
- import { CreateMagicAuthOptions } from './user-management/interfaces/create-magic-auth-options.interface.cjs';
58
- import { CreateOrganizationMembershipOptions } from './user-management/interfaces/create-organization-membership-options.interface.cjs';
59
- import { CreatePasswordResetOptions } from './user-management/interfaces/create-password-reset-options.interface.cjs';
60
- import { CreateUserOptions } from './user-management/interfaces/create-user-options.interface.cjs';
61
- import { EmailVerification } from './user-management/interfaces/email-verification.interface.cjs';
62
- import { EnrollAuthFactorOptions } from './user-management/interfaces/enroll-auth-factor.interface.cjs';
63
- import { FactorWithSecrets as FactorWithSecrets$1, Factor as Factor$1 } from './user-management/interfaces/factor.interface.cjs';
64
- import { Identity } from './user-management/interfaces/identity.interface.cjs';
65
- import { Invitation } from './user-management/interfaces/invitation.interface.cjs';
66
- import { ListAuthFactorsOptions } from './user-management/interfaces/list-auth-factors-options.interface.cjs';
67
- import { ListInvitationsOptions, SerializedListInvitationsOptions } from './user-management/interfaces/list-invitations-options.interface.cjs';
68
- import { ListOrganizationMembershipsOptions, SerializedListOrganizationMembershipsOptions } from './user-management/interfaces/list-organization-memberships-options.interface.cjs';
69
- import { ListSessionsOptions, SerializedListSessionsOptions } from './user-management/interfaces/list-sessions-options.interface.cjs';
70
- import { ListUserFeatureFlagsOptions } from './user-management/interfaces/list-user-feature-flags-options.interface.cjs';
71
- import { ListUsersOptions, SerializedListUsersOptions } from './user-management/interfaces/list-users-options.interface.cjs';
72
- import { MagicAuth } from './user-management/interfaces/magic-auth.interface.cjs';
73
- import { OrganizationMembership } from './user-management/interfaces/organization-membership.interface.cjs';
74
- import { PasswordReset } from './user-management/interfaces/password-reset.interface.cjs';
75
- import { ResetPasswordOptions } from './user-management/interfaces/reset-password-options.interface.cjs';
76
- import { RevokeSessionOptions } from './user-management/interfaces/revoke-session-options.interface.cjs';
77
- import { SendInvitationOptions } from './user-management/interfaces/send-invitation-options.interface.cjs';
78
- import { SendVerificationEmailOptions } from './user-management/interfaces/send-verification-email-options.interface.cjs';
79
- import { Session } from './user-management/interfaces/session.interface.cjs';
80
- import { UpdateOrganizationMembershipOptions } from './user-management/interfaces/update-organization-membership-options.interface.cjs';
81
- import { UpdateUserOptions } from './user-management/interfaces/update-user-options.interface.cjs';
82
- import { User } from './user-management/interfaces/user.interface.cjs';
83
- import { VerifyEmailOptions } from './user-management/interfaces/verify-email-options.interface.cjs';
84
- import { SessionHandlerOptions } from './user-management/interfaces/session-handler-options.interface.cjs';
85
- import { RefreshSessionResponse } from './user-management/interfaces/refresh-and-seal-session-data.interface.cjs';
86
- import { CheckOptions, CheckRequestOptions, CheckResult, CheckBatchOptions } from './fga/interfaces/check.interface.cjs';
87
- import { QueryOptions, QueryRequestOptions, QueryResult, SerializedQueryOptions } from './fga/interfaces/query.interface.cjs';
88
- import { CreateResourceOptions, Resource, ResourceInterface, ResourceOptions, ListResourcesOptions, SerializedListResourcesOptions, UpdateResourceOptions, DeleteResourceOptions, BatchWriteResourcesOptions } from './fga/interfaces/resource.interface.cjs';
89
- import { WarrantToken } from './fga/interfaces/warrant-token.interface.cjs';
90
- import { WriteWarrantOptions, ListWarrantsOptions, ListWarrantsRequestOptions, Warrant, SerializedListWarrantsOptions } from './fga/interfaces/warrant.interface.cjs';
91
- import { FgaPaginatable } from './fga/utils/fga-paginatable.cjs';
92
- import { HttpClient } from './common/net/http-client.cjs';
93
- import { GetTokenOptions } from './widgets/interfaces/get-token.cjs';
94
- import { Actions } from './actions/actions.cjs';
95
- import { CreateDataKeyOptions } from './vault/interfaces/key/create-data-key.interface.cjs';
96
- import { DecryptDataKeyOptions } from './vault/interfaces/key/decrypt-data-key.interface.cjs';
97
- import { DataKeyPair, DataKey, KeyContext } from './vault/interfaces/key.interface.cjs';
98
- import { CreateObjectOptions } from './vault/interfaces/object/create-object.interface.cjs';
99
- import { DeleteObjectOptions } from './vault/interfaces/object/delete-object.interface.cjs';
100
- import { ReadObjectOptions } from './vault/interfaces/object/read-object.interface.cjs';
101
- import { UpdateObjectOptions } from './vault/interfaces/object/update-object.interface.cjs';
102
- import { ObjectMetadata, ObjectDigest, ObjectVersion, VaultObject } from './vault/interfaces/object.interface.cjs';
103
- import { CryptoProvider } from './common/crypto/crypto-provider.cjs';
104
- import { Directory } from './directory-sync/interfaces/directory.interface.cjs';
105
- import { DirectoryGroup } from './directory-sync/interfaces/directory-group.interface.cjs';
106
- import { ListDirectoriesOptions, SerializedListDirectoriesOptions } from './directory-sync/interfaces/list-directories-options.interface.cjs';
107
- import { ListDirectoryGroupsOptions } from './directory-sync/interfaces/list-groups-options.interface.cjs';
108
- import { ListDirectoryUsersOptions } from './directory-sync/interfaces/list-directory-users-options.interface.cjs';
109
- import { DefaultCustomAttributes, DirectoryUserWithGroups } from './directory-sync/interfaces/directory-user.interface.cjs';
110
-
111
- declare class DirectorySync {
112
- private readonly workos;
113
- constructor(workos: WorkOS);
114
- listDirectories(options?: ListDirectoriesOptions): Promise<AutoPaginatable<Directory, SerializedListDirectoriesOptions>>;
115
- getDirectory(id: string): Promise<Directory>;
116
- deleteDirectory(id: string): Promise<void>;
117
- listGroups(options: ListDirectoryGroupsOptions): Promise<AutoPaginatable<DirectoryGroup, ListDirectoryGroupsOptions>>;
118
- listUsers<TCustomAttributes extends object = DefaultCustomAttributes>(options: ListDirectoryUsersOptions): Promise<AutoPaginatable<DirectoryUserWithGroups<TCustomAttributes>, ListDirectoryUsersOptions>>;
119
- getUser<TCustomAttributes extends object = DefaultCustomAttributes>(user: string): Promise<DirectoryUserWithGroups<TCustomAttributes>>;
120
- getGroup(group: string): Promise<DirectoryGroup>;
121
- }
122
-
123
- declare class Events {
124
- private readonly workos;
125
- constructor(workos: WorkOS);
126
- listEvents(options: ListEventOptions): Promise<List<Event>>;
127
- }
128
-
129
- declare class Organizations {
130
- private readonly workos;
131
- constructor(workos: WorkOS);
132
- listOrganizations(options?: ListOrganizationsOptions): Promise<AutoPaginatable<Organization, ListOrganizationsOptions>>;
133
- createOrganization(payload: CreateOrganizationOptions, requestOptions?: CreateOrganizationRequestOptions): Promise<Organization>;
134
- deleteOrganization(id: string): Promise<void>;
135
- getOrganization(id: string): Promise<Organization>;
136
- getOrganizationByExternalId(externalId: string): Promise<Organization>;
137
- updateOrganization(options: UpdateOrganizationOptions): Promise<Organization>;
138
- listOrganizationRoles(options: ListOrganizationRolesOptions): Promise<RoleList>;
139
- listOrganizationFeatureFlags(options: ListOrganizationFeatureFlagsOptions): Promise<AutoPaginatable<FeatureFlag, ListOrganizationFeatureFlagsOptions>>;
140
- }
141
-
142
- declare class OrganizationDomains {
143
- private readonly workos;
144
- constructor(workos: WorkOS);
145
- get(id: string): Promise<OrganizationDomain>;
146
- verify(id: string): Promise<OrganizationDomain>;
147
- create(payload: CreateOrganizationDomainOptions): Promise<OrganizationDomain>;
148
- delete(id: string): Promise<void>;
149
- }
150
-
151
- declare class Passwordless {
152
- private readonly workos;
153
- constructor(workos: WorkOS);
154
- createSession({ redirectURI, expiresIn, ...options }: CreatePasswordlessSessionOptions): Promise<PasswordlessSession>;
155
- sendSession(sessionId: string): Promise<SendSessionResponse>;
156
- }
157
-
158
- declare class Portal {
159
- private readonly workos;
160
- constructor(workos: WorkOS);
161
- generateLink({ intent, organization, returnUrl, successUrl, }: {
162
- intent: GeneratePortalLinkIntent;
163
- organization: string;
164
- returnUrl?: string;
165
- successUrl?: string;
166
- }): Promise<{
167
- link: string;
168
- }>;
169
- }
170
-
171
- declare class SSO {
172
- private readonly workos;
173
- constructor(workos: WorkOS);
174
- listConnections(options?: ListConnectionsOptions): Promise<AutoPaginatable<Connection, SerializedListConnectionsOptions>>;
175
- deleteConnection(id: string): Promise<void>;
176
- getAuthorizationUrl(options: SSOAuthorizationURLOptions): string;
177
- getConnection(id: string): Promise<Connection>;
178
- getProfileAndToken<CustomAttributesType extends UnknownRecord = UnknownRecord>({ code, clientId, }: GetProfileAndTokenOptions): Promise<ProfileAndToken<CustomAttributesType>>;
179
- getProfile<CustomAttributesType extends UnknownRecord = UnknownRecord>({ accessToken, }: GetProfileOptions): Promise<Profile<CustomAttributesType>>;
180
- }
181
-
182
- declare class Mfa {
183
- private readonly workos;
184
- constructor(workos: WorkOS);
185
- deleteFactor(id: string): Promise<void>;
186
- getFactor(id: string): Promise<Factor>;
187
- enrollFactor(options: EnrollFactorOptions): Promise<FactorWithSecrets>;
188
- challengeFactor(options: ChallengeFactorOptions): Promise<Challenge>;
189
- verifyChallenge(options: VerifyChallengeOptions): Promise<VerifyResponse>;
190
- }
191
-
192
- declare class AuditLogs {
193
- private readonly workos;
194
- constructor(workos: WorkOS);
195
- createEvent(organization: string, event: CreateAuditLogEventOptions, options?: CreateAuditLogEventRequestOptions): Promise<void>;
196
- createExport(options: AuditLogExportOptions): Promise<AuditLogExport>;
197
- getExport(auditLogExportId: string): Promise<AuditLogExport>;
198
- createSchema(schema: CreateAuditLogSchemaOptions, options?: CreateAuditLogSchemaRequestOptions): Promise<AuditLogSchema>;
199
- }
200
-
201
- type RefreshOptions = {
202
- cookiePassword?: string;
203
- organizationId?: string;
204
- };
205
- declare class CookieSession {
206
- private jwks;
207
- private userManagement;
208
- private cookiePassword;
209
- private sessionData;
210
- constructor(userManagement: UserManagement, sessionData: string, cookiePassword: string);
211
- /**
212
- * Authenticates a user with a session cookie.
213
- *
214
- * @returns An object indicating whether the authentication was successful or not. If successful, it will include the user's session data.
215
- */
216
- authenticate(): Promise<AuthenticateWithSessionCookieSuccessResponse | AuthenticateWithSessionCookieFailedResponse>;
217
- /**
218
- * Refreshes the user's session.
219
- *
220
- * @param options - Optional options for refreshing the session.
221
- * @param options.cookiePassword - The password to use for the new session cookie.
222
- * @param options.organizationId - The organization ID to use for the new session cookie.
223
- * @returns An object indicating whether the refresh was successful or not. If successful, it will include the new sealed session data.
224
- */
225
- refresh(options?: RefreshOptions): Promise<RefreshSessionResponse>;
226
- /**
227
- * Gets the URL to redirect the user to for logging out.
228
- *
229
- * @returns The URL to redirect the user to for logging out.
230
- */
231
- getLogoutUrl({ returnTo, }?: {
232
- returnTo?: string;
233
- }): Promise<string>;
234
- private isValidJwt;
235
- }
236
-
237
- declare class UserManagement {
238
- private readonly workos;
239
- private _jwks;
240
- clientId: string | undefined;
241
- constructor(workos: WorkOS);
242
- get jwks(): ReturnType<typeof createRemoteJWKSet> | undefined;
243
- /**
244
- * Loads a sealed session using the provided session data and cookie password.
245
- *
246
- * @param options - The options for loading the sealed session.
247
- * @param options.sessionData - The sealed session data.
248
- * @param options.cookiePassword - The password used to encrypt the session data.
249
- * @returns The session class.
250
- */
251
- loadSealedSession(options: {
252
- sessionData: string;
253
- cookiePassword: string;
254
- }): CookieSession;
255
- getUser(userId: string): Promise<User>;
256
- getUserByExternalId(externalId: string): Promise<User>;
257
- listUsers(options?: ListUsersOptions): Promise<AutoPaginatable<User, SerializedListUsersOptions>>;
258
- createUser(payload: CreateUserOptions): Promise<User>;
259
- authenticateWithMagicAuth(payload: AuthenticateWithMagicAuthOptions): Promise<AuthenticationResponse>;
260
- authenticateWithPassword(payload: AuthenticateWithPasswordOptions): Promise<AuthenticationResponse>;
261
- authenticateWithCode(payload: AuthenticateWithCodeOptions): Promise<AuthenticationResponse>;
262
- authenticateWithCodeAndVerifier(payload: AuthenticateWithCodeAndVerifierOptions): Promise<AuthenticationResponse>;
263
- authenticateWithRefreshToken(payload: AuthenticateWithRefreshTokenOptions): Promise<AuthenticationResponse>;
264
- authenticateWithTotp(payload: AuthenticateWithTotpOptions): Promise<AuthenticationResponse>;
265
- authenticateWithEmailVerification(payload: AuthenticateWithEmailVerificationOptions): Promise<AuthenticationResponse>;
266
- authenticateWithOrganizationSelection(payload: AuthenticateWithOrganizationSelectionOptions): Promise<AuthenticationResponse>;
267
- authenticateWithSessionCookie({ sessionData, cookiePassword, }: AuthenticateWithSessionCookieOptions): Promise<AuthenticateWithSessionCookieSuccessResponse | AuthenticateWithSessionCookieFailedResponse>;
268
- private isValidJwt;
269
- private prepareAuthenticationResponse;
270
- private sealSessionDataFromAuthenticationResponse;
271
- getSessionFromCookie({ sessionData, cookiePassword, }: SessionHandlerOptions): Promise<SessionCookieData | undefined>;
272
- getEmailVerification(emailVerificationId: string): Promise<EmailVerification>;
273
- sendVerificationEmail({ userId, }: SendVerificationEmailOptions): Promise<{
274
- user: User;
275
- }>;
276
- getMagicAuth(magicAuthId: string): Promise<MagicAuth>;
277
- createMagicAuth(options: CreateMagicAuthOptions): Promise<MagicAuth>;
278
- verifyEmail({ code, userId, }: VerifyEmailOptions): Promise<{
279
- user: User;
280
- }>;
281
- getPasswordReset(passwordResetId: string): Promise<PasswordReset>;
282
- createPasswordReset(options: CreatePasswordResetOptions): Promise<PasswordReset>;
283
- resetPassword(payload: ResetPasswordOptions): Promise<{
284
- user: User;
285
- }>;
286
- updateUser(payload: UpdateUserOptions): Promise<User>;
287
- enrollAuthFactor(payload: EnrollAuthFactorOptions): Promise<{
288
- authenticationFactor: FactorWithSecrets$1;
289
- authenticationChallenge: Challenge;
290
- }>;
291
- listAuthFactors(options: ListAuthFactorsOptions): Promise<AutoPaginatable<Factor$1, PaginationOptions>>;
292
- listUserFeatureFlags(options: ListUserFeatureFlagsOptions): Promise<AutoPaginatable<FeatureFlag>>;
293
- listSessions(userId: string, options?: ListSessionsOptions): Promise<AutoPaginatable<Session, SerializedListSessionsOptions>>;
294
- deleteUser(userId: string): Promise<void>;
295
- getUserIdentities(userId: string): Promise<Identity[]>;
296
- getOrganizationMembership(organizationMembershipId: string): Promise<OrganizationMembership>;
297
- listOrganizationMemberships(options: ListOrganizationMembershipsOptions): Promise<AutoPaginatable<OrganizationMembership, SerializedListOrganizationMembershipsOptions>>;
298
- createOrganizationMembership(options: CreateOrganizationMembershipOptions): Promise<OrganizationMembership>;
299
- updateOrganizationMembership(organizationMembershipId: string, options: UpdateOrganizationMembershipOptions): Promise<OrganizationMembership>;
300
- deleteOrganizationMembership(organizationMembershipId: string): Promise<void>;
301
- deactivateOrganizationMembership(organizationMembershipId: string): Promise<OrganizationMembership>;
302
- reactivateOrganizationMembership(organizationMembershipId: string): Promise<OrganizationMembership>;
303
- getInvitation(invitationId: string): Promise<Invitation>;
304
- findInvitationByToken(invitationToken: string): Promise<Invitation>;
305
- listInvitations(options: ListInvitationsOptions): Promise<AutoPaginatable<Invitation, SerializedListInvitationsOptions>>;
306
- sendInvitation(payload: SendInvitationOptions): Promise<Invitation>;
307
- acceptInvitation(invitationId: string): Promise<Invitation>;
308
- revokeInvitation(invitationId: string): Promise<Invitation>;
309
- revokeSession(payload: RevokeSessionOptions): Promise<void>;
310
- getAuthorizationUrl(options: UserManagementAuthorizationURLOptions): string;
311
- getLogoutUrl(options: LogoutURLOptions): string;
312
- getJwksUrl(clientId: string): string;
313
- }
314
-
315
- declare class FGA {
316
- private readonly workos;
317
- constructor(workos: WorkOS);
318
- check(checkOptions: CheckOptions, options?: CheckRequestOptions): Promise<CheckResult>;
319
- checkBatch(checkOptions: CheckBatchOptions, options?: CheckRequestOptions): Promise<CheckResult[]>;
320
- createResource(resource: CreateResourceOptions): Promise<Resource>;
321
- getResource(resource: ResourceInterface | ResourceOptions): Promise<Resource>;
322
- listResources(options?: ListResourcesOptions): Promise<AutoPaginatable<Resource, SerializedListResourcesOptions>>;
323
- updateResource(options: UpdateResourceOptions): Promise<Resource>;
324
- deleteResource(resource: DeleteResourceOptions): Promise<void>;
325
- batchWriteResources(options: BatchWriteResourcesOptions): Promise<Resource[]>;
326
- writeWarrant(options: WriteWarrantOptions): Promise<WarrantToken>;
327
- batchWriteWarrants(options: WriteWarrantOptions[]): Promise<WarrantToken>;
328
- listWarrants(options?: ListWarrantsOptions, requestOptions?: ListWarrantsRequestOptions): Promise<AutoPaginatable<Warrant, SerializedListWarrantsOptions>>;
329
- query(options: QueryOptions, requestOptions?: QueryRequestOptions): Promise<FgaPaginatable<QueryResult, SerializedQueryOptions>>;
330
- }
331
-
332
- declare class Widgets {
333
- private readonly workos;
334
- constructor(workos: WorkOS);
335
- getToken(payload: GetTokenOptions): Promise<string>;
336
- }
337
-
338
- declare class Vault {
339
- private readonly workos;
340
- private cryptoProvider;
341
- constructor(workos: WorkOS);
342
- private decode;
343
- createObject(options: CreateObjectOptions): Promise<ObjectMetadata>;
344
- listObjects(options?: PaginationOptions | undefined): Promise<List<ObjectDigest>>;
345
- listObjectVersions(options: ReadObjectOptions): Promise<ObjectVersion[]>;
346
- readObject(options: ReadObjectOptions): Promise<VaultObject>;
347
- describeObject(options: ReadObjectOptions): Promise<VaultObject>;
348
- updateObject(options: UpdateObjectOptions): Promise<VaultObject>;
349
- deleteObject(options: DeleteObjectOptions): Promise<void>;
350
- createDataKey(options: CreateDataKeyOptions): Promise<DataKeyPair>;
351
- decryptDataKey(options: DecryptDataKeyOptions): Promise<DataKey>;
352
- encrypt(data: string, context: KeyContext, associatedData?: string): Promise<string>;
353
- decrypt(encryptedData: string, associatedData?: string): Promise<string>;
354
- }
355
-
356
- declare class WorkOS {
357
- readonly key?: string | undefined;
358
- readonly options: WorkOSOptions;
359
- readonly baseURL: string;
360
- readonly client: HttpClient;
361
- readonly clientId?: string;
362
- readonly actions: Actions;
363
- readonly auditLogs: AuditLogs;
364
- readonly directorySync: DirectorySync;
365
- readonly organizations: Organizations;
366
- readonly organizationDomains: OrganizationDomains;
367
- readonly passwordless: Passwordless;
368
- readonly portal: Portal;
369
- readonly sso: SSO;
370
- readonly webhooks: Webhooks;
371
- readonly mfa: Mfa;
372
- readonly events: Events;
373
- readonly userManagement: UserManagement;
374
- readonly fga: FGA;
375
- readonly widgets: Widgets;
376
- readonly vault: Vault;
377
- constructor(key?: string | undefined, options?: WorkOSOptions);
378
- private createUserAgent;
379
- createWebhookClient(): Webhooks;
380
- createActionsClient(): Actions;
381
- getCryptoProvider(): CryptoProvider;
382
- createHttpClient(options: WorkOSOptions, userAgent: string): HttpClient;
383
- get version(): string;
384
- post<Result = any, Entity = any>(path: string, entity: Entity, options?: PostOptions): Promise<{
385
- data: Result;
386
- }>;
387
- get<Result = any>(path: string, options?: GetOptions): Promise<{
388
- data: Result;
389
- }>;
390
- put<Result = any, Entity = any>(path: string, entity: Entity, options?: PutOptions): Promise<{
391
- data: Result;
392
- }>;
393
- delete(path: string, options?: DeleteOptions): Promise<void>;
394
- emitWarning(warning: string): void;
395
- private handleParseError;
396
- private handleHttpError;
397
- }
398
-
399
- export { AuditLogs as A, CookieSession as C, DirectorySync as D, Events as E, FGA as F, Mfa as M, Organizations as O, Passwordless as P, SSO as S, UserManagement as U, Vault as V, WorkOS as W, OrganizationDomains as a, Portal as b, Widgets as c };