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