@workos-inc/widgets 1.8.0 → 1.8.2

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 (90) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/api/endpoint.cjs +4 -1
  3. package/dist/cjs/api/endpoint.cjs.map +1 -1
  4. package/dist/cjs/api/endpoint.d.cts +17 -9
  5. package/dist/cjs/experimental/api/fetch.cjs +1083 -0
  6. package/dist/cjs/experimental/api/fetch.cjs.map +1 -0
  7. package/dist/cjs/experimental/api/fetch.d.cts +1871 -0
  8. package/dist/cjs/experimental/api/react-query.cjs +1863 -0
  9. package/dist/cjs/experimental/api/react-query.cjs.map +1 -0
  10. package/dist/cjs/experimental/api/react-query.d.cts +2685 -0
  11. package/dist/cjs/experimental/api/swr.cjs +1972 -0
  12. package/dist/cjs/experimental/api/swr.cjs.map +1 -0
  13. package/dist/cjs/experimental/api/swr.d.cts +2585 -0
  14. package/dist/cjs/lib/add-mfa-dialog.cjs +2 -2
  15. package/dist/cjs/lib/add-mfa-dialog.cjs.map +1 -1
  16. package/dist/cjs/lib/admin-portal-domain-verification.cjs.map +1 -1
  17. package/dist/cjs/lib/api/user.d.cts +2 -2
  18. package/dist/cjs/lib/api-keys/api-keys-search.cjs +2 -2
  19. package/dist/cjs/lib/api-keys/api-keys-search.cjs.map +1 -1
  20. package/dist/cjs/lib/api-keys/create-api-key.cjs +8 -8
  21. package/dist/cjs/lib/api-keys/create-api-key.cjs.map +1 -1
  22. package/dist/cjs/lib/change-password-dialog.cjs +18 -18
  23. package/dist/cjs/lib/change-password-dialog.cjs.map +1 -1
  24. package/dist/cjs/lib/copy-button.cjs.map +1 -1
  25. package/dist/cjs/lib/edit-user-profile-dialog.cjs +8 -8
  26. package/dist/cjs/lib/edit-user-profile-dialog.cjs.map +1 -1
  27. package/dist/cjs/lib/elements/utils.cjs +3 -4
  28. package/dist/cjs/lib/elements/utils.cjs.map +1 -1
  29. package/dist/cjs/lib/elements.cjs.map +1 -1
  30. package/dist/cjs/lib/elevated-access.cjs +2 -2
  31. package/dist/cjs/lib/elevated-access.cjs.map +1 -1
  32. package/dist/cjs/lib/marker.cjs.map +1 -1
  33. package/dist/cjs/lib/organization-switcher.cjs.map +1 -1
  34. package/dist/cjs/lib/otp-input.cjs +6 -7
  35. package/dist/cjs/lib/otp-input.cjs.map +1 -1
  36. package/dist/cjs/lib/provider-icon.cjs.map +1 -1
  37. package/dist/cjs/lib/set-password-dialog.cjs +12 -12
  38. package/dist/cjs/lib/set-password-dialog.cjs.map +1 -1
  39. package/dist/cjs/lib/status.cjs.map +1 -1
  40. package/dist/cjs/lib/users-search.cjs +2 -2
  41. package/dist/cjs/lib/users-search.cjs.map +1 -1
  42. package/dist/cjs/organization-switcher.client.cjs.map +1 -1
  43. package/dist/esm/api/endpoint.d.ts +17 -9
  44. package/dist/esm/api/endpoint.js +4 -1
  45. package/dist/esm/api/endpoint.js.map +1 -1
  46. package/dist/esm/experimental/api/fetch.d.ts +1871 -0
  47. package/dist/esm/experimental/api/fetch.js +954 -0
  48. package/dist/esm/experimental/api/fetch.js.map +1 -0
  49. package/dist/esm/experimental/api/react-query.d.ts +2685 -0
  50. package/dist/esm/experimental/api/react-query.js +1641 -0
  51. package/dist/esm/experimental/api/react-query.js.map +1 -0
  52. package/dist/esm/experimental/api/swr.d.ts +2585 -0
  53. package/dist/esm/experimental/api/swr.js +1731 -0
  54. package/dist/esm/experimental/api/swr.js.map +1 -0
  55. package/dist/esm/lib/add-mfa-dialog.js +1 -1
  56. package/dist/esm/lib/add-mfa-dialog.js.map +1 -1
  57. package/dist/esm/lib/admin-portal-domain-verification.js.map +1 -1
  58. package/dist/esm/lib/api/user.d.ts +2 -2
  59. package/dist/esm/lib/api-keys/api-keys-search.js +1 -1
  60. package/dist/esm/lib/api-keys/api-keys-search.js.map +1 -1
  61. package/dist/esm/lib/api-keys/create-api-key.js +1 -1
  62. package/dist/esm/lib/api-keys/create-api-key.js.map +1 -1
  63. package/dist/esm/lib/change-password-dialog.js +1 -1
  64. package/dist/esm/lib/change-password-dialog.js.map +1 -1
  65. package/dist/esm/lib/copy-button.js.map +1 -1
  66. package/dist/esm/lib/edit-user-profile-dialog.js +1 -1
  67. package/dist/esm/lib/edit-user-profile-dialog.js.map +1 -1
  68. package/dist/esm/lib/elements/utils.js +1 -2
  69. package/dist/esm/lib/elements/utils.js.map +1 -1
  70. package/dist/esm/lib/elements.js.map +1 -1
  71. package/dist/esm/lib/elevated-access.js +1 -1
  72. package/dist/esm/lib/elevated-access.js.map +1 -1
  73. package/dist/esm/lib/marker.js.map +1 -1
  74. package/dist/esm/lib/organization-switcher.js.map +1 -1
  75. package/dist/esm/lib/otp-input.js +6 -3
  76. package/dist/esm/lib/otp-input.js.map +1 -1
  77. package/dist/esm/lib/provider-icon.js.map +1 -1
  78. package/dist/esm/lib/set-password-dialog.js +1 -1
  79. package/dist/esm/lib/set-password-dialog.js.map +1 -1
  80. package/dist/esm/lib/status.js.map +1 -1
  81. package/dist/esm/lib/users-search.js +1 -1
  82. package/dist/esm/lib/users-search.js.map +1 -1
  83. package/dist/esm/organization-switcher.client.js.map +1 -1
  84. package/package.json +33 -23
  85. package/dist/cjs/lib/use-layout-effect.cjs +0 -31
  86. package/dist/cjs/lib/use-layout-effect.cjs.map +0 -1
  87. package/dist/cjs/lib/use-layout-effect.d.cts +0 -5
  88. package/dist/esm/lib/use-layout-effect.d.ts +0 -5
  89. package/dist/esm/lib/use-layout-effect.js +0 -7
  90. package/dist/esm/lib/use-layout-effect.js.map +0 -1
@@ -0,0 +1,1083 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var fetch_exports = {};
20
+ __export(fetch_exports, {
21
+ AuthenticationInformationResponseDataVerificationMethodsMfaProvider: () => AuthenticationInformationResponseDataVerificationMethodsMfaProvider,
22
+ AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider: () => AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider,
23
+ AuthenticationInformationResponseDataVerificationMethodsPasswordProvider: () => AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
24
+ CreateTotpFactorResponseAuthenticationChallengeAllOfObject: () => CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
25
+ CreateTotpFactorResponseAuthenticationFactorAllOfObject: () => CreateTotpFactorResponseAuthenticationFactorAllOfObject,
26
+ CreateTotpFactorResponseAuthenticationFactorAllOfType: () => CreateTotpFactorResponseAuthenticationFactorAllOfType,
27
+ DataInstallationObject: () => DataInstallationObject,
28
+ DataInstallationState: () => DataInstallationState,
29
+ DataIntegrationCredentialsType: () => DataIntegrationCredentialsType,
30
+ DataIntegrationIntegrationType: () => DataIntegrationIntegrationType,
31
+ DataIntegrationObject: () => DataIntegrationObject,
32
+ DataIntegrationOwnership: () => DataIntegrationOwnership,
33
+ DomainVerificationNameServer: () => DomainVerificationNameServer,
34
+ GenerateAdminPortalLinkIntent: () => GenerateAdminPortalLinkIntent,
35
+ MemberActionsItem: () => MemberActionsItem,
36
+ MemberStatus: () => MemberStatus,
37
+ OidcSessionState: () => OidcSessionState,
38
+ OrganizationDomainState: () => OrganizationDomainState,
39
+ SamlSessionState: () => SamlSessionState,
40
+ SendVerificationResponseType: () => SendVerificationResponseType,
41
+ SettingsResponseObject: () => SettingsResponseObject,
42
+ SsoConnectionAnyOfEightAllOfProviderTag: () => SsoConnectionAnyOfEightAllOfProviderTag,
43
+ SsoConnectionAnyOfEightAllOfState: () => SsoConnectionAnyOfEightAllOfState,
44
+ SsoConnectionAnyOfEightAllOfType: () => SsoConnectionAnyOfEightAllOfType,
45
+ SsoConnectionAnyOfProviderTag: () => SsoConnectionAnyOfProviderTag,
46
+ SsoConnectionAnyOfState: () => SsoConnectionAnyOfState,
47
+ SsoConnectionAnyOfType: () => SsoConnectionAnyOfType,
48
+ SsoConnectionSessionJSONState: () => SsoConnectionSessionJSONState,
49
+ authenticationInformation: () => authenticationInformation,
50
+ createOrganizationApiKey: () => createOrganizationApiKey,
51
+ createPassword: () => createPassword,
52
+ createTotpFactor: () => createTotpFactor,
53
+ deleteDataInstallation: () => deleteDataInstallation,
54
+ deleteOrganizationApiKey: () => deleteOrganizationApiKey,
55
+ deleteOrganizationDomain: () => deleteOrganizationDomain,
56
+ deletePasskey: () => deletePasskey,
57
+ deleteTotpFactors: () => deleteTotpFactors,
58
+ generateAdminPortalLink: () => generateAdminPortalLink,
59
+ getAuthenticationInformationUrl: () => getAuthenticationInformationUrl,
60
+ getCreateOrganizationApiKeyUrl: () => getCreateOrganizationApiKeyUrl,
61
+ getCreatePasswordUrl: () => getCreatePasswordUrl,
62
+ getCreateTotpFactorUrl: () => getCreateTotpFactorUrl,
63
+ getDataInstallationAuthorizationStatus: () => getDataInstallationAuthorizationStatus,
64
+ getDataIntegrationAuthorizeUrl: () => getDataIntegrationAuthorizeUrl,
65
+ getDeleteDataInstallationUrl: () => getDeleteDataInstallationUrl,
66
+ getDeleteOrganizationApiKeyUrl: () => getDeleteOrganizationApiKeyUrl,
67
+ getDeleteOrganizationDomainUrl: () => getDeleteOrganizationDomainUrl,
68
+ getDeletePasskeyUrl: () => getDeletePasskeyUrl,
69
+ getDeleteTotpFactorsUrl: () => getDeleteTotpFactorsUrl,
70
+ getGenerateAdminPortalLinkUrl: () => getGenerateAdminPortalLinkUrl,
71
+ getGetDataInstallationAuthorizationStatusUrl: () => getGetDataInstallationAuthorizationStatusUrl,
72
+ getGetDataIntegrationAuthorizeUrlUrl: () => getGetDataIntegrationAuthorizeUrlUrl,
73
+ getInviteMemberUrl: () => getInviteMemberUrl,
74
+ getListOrganizationApiKeyPermissionsUrl: () => getListOrganizationApiKeyPermissionsUrl,
75
+ getListOrganizationApiKeysUrl: () => getListOrganizationApiKeysUrl,
76
+ getListOrganizationDomainsUrl: () => getListOrganizationDomainsUrl,
77
+ getListSsoConnectionsUrl: () => getListSsoConnectionsUrl,
78
+ getMeUrl: () => getMeUrl,
79
+ getMembersUrl: () => getMembersUrl,
80
+ getMyDataIntegrationsUrl: () => getMyDataIntegrationsUrl,
81
+ getOrganizationsUrl: () => getOrganizationsUrl,
82
+ getRegisterPasskeyUrl: () => getRegisterPasskeyUrl,
83
+ getRemoveMemberUrl: () => getRemoveMemberUrl,
84
+ getResendInviteUrl: () => getResendInviteUrl,
85
+ getReverifyOrganizationDomainUrl: () => getReverifyOrganizationDomainUrl,
86
+ getRevokeAllSessionsUrl: () => getRevokeAllSessionsUrl,
87
+ getRevokeInviteUrl: () => getRevokeInviteUrl,
88
+ getRevokeSessionUrl: () => getRevokeSessionUrl,
89
+ getRolesAndConfigUrl: () => getRolesAndConfigUrl,
90
+ getRolesUrl: () => getRolesUrl,
91
+ getSendVerificationUrl: () => getSendVerificationUrl,
92
+ getSessionsUrl: () => getSessionsUrl,
93
+ getSettingsUrl: () => getSettingsUrl,
94
+ getUpdateMeUrl: () => getUpdateMeUrl,
95
+ getUpdateMemberUrl: () => getUpdateMemberUrl,
96
+ getUpdatePasswordUrl: () => getUpdatePasswordUrl,
97
+ getVerifyPasskeyUrl: () => getVerifyPasskeyUrl,
98
+ getVerifyTotpFactorUrl: () => getVerifyTotpFactorUrl,
99
+ getVerifyUrl: () => getVerifyUrl,
100
+ inviteMember: () => inviteMember,
101
+ listOrganizationApiKeyPermissions: () => listOrganizationApiKeyPermissions,
102
+ listOrganizationApiKeys: () => listOrganizationApiKeys,
103
+ listOrganizationDomains: () => listOrganizationDomains,
104
+ listSsoConnections: () => listSsoConnections,
105
+ me: () => me,
106
+ members: () => members,
107
+ myDataIntegrations: () => myDataIntegrations,
108
+ organizations: () => organizations,
109
+ registerPasskey: () => registerPasskey,
110
+ removeMember: () => removeMember,
111
+ resendInvite: () => resendInvite,
112
+ reverifyOrganizationDomain: () => reverifyOrganizationDomain,
113
+ revokeAllSessions: () => revokeAllSessions,
114
+ revokeInvite: () => revokeInvite,
115
+ revokeSession: () => revokeSession,
116
+ roles: () => roles,
117
+ rolesAndConfig: () => rolesAndConfig,
118
+ sendVerification: () => sendVerification,
119
+ sessions: () => sessions,
120
+ settings: () => settings,
121
+ updateMe: () => updateMe,
122
+ updateMember: () => updateMember,
123
+ updatePassword: () => updatePassword,
124
+ verify: () => verify,
125
+ verifyPasskey: () => verifyPasskey,
126
+ verifyTotpFactor: () => verifyTotpFactor
127
+ });
128
+ module.exports = __toCommonJS(fetch_exports);
129
+ const MemberStatus = {
130
+ Active: "Active",
131
+ Invited: "Invited",
132
+ InviteExpired: "InviteExpired",
133
+ InviteRevoked: "InviteRevoked",
134
+ NoInvite: "NoInvite"
135
+ };
136
+ const MemberActionsItem = {
137
+ "edit-role": "edit-role",
138
+ "resend-invite": "resend-invite",
139
+ "revoke-invite": "revoke-invite",
140
+ "revoke-membership": "revoke-membership"
141
+ };
142
+ const CreateTotpFactorResponseAuthenticationFactorAllOfObject = {
143
+ authentication_factor: "authentication_factor"
144
+ };
145
+ const CreateTotpFactorResponseAuthenticationFactorAllOfType = {
146
+ generic_otp: "generic_otp",
147
+ sms: "sms",
148
+ totp: "totp",
149
+ webauthn: "webauthn"
150
+ };
151
+ const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {
152
+ authentication_challenge: "authentication_challenge"
153
+ };
154
+ const AuthenticationInformationResponseDataVerificationMethodsMfaProvider = {
155
+ MFA: "MFA"
156
+ };
157
+ const AuthenticationInformationResponseDataVerificationMethodsPasswordProvider = {
158
+ Password: "Password"
159
+ };
160
+ const AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider = {
161
+ Passkey: "Passkey"
162
+ };
163
+ const SendVerificationResponseType = {
164
+ EmailVerification: "EmailVerification"
165
+ };
166
+ const SettingsResponseObject = {
167
+ settings: "settings"
168
+ };
169
+ const OrganizationDomainState = {
170
+ Failed: "Failed",
171
+ LegacyVerified: "LegacyVerified",
172
+ Pending: "Pending",
173
+ Verified: "Verified"
174
+ };
175
+ const DomainVerificationNameServer = {
176
+ AwsRoute53: "AwsRoute53",
177
+ GoogleDomains: "GoogleDomains",
178
+ CloudFlare: "CloudFlare",
179
+ GoDaddy: "GoDaddy",
180
+ Other: "Other"
181
+ };
182
+ const SamlSessionState = {
183
+ Authorized: "Authorized",
184
+ Failed: "Failed",
185
+ Started: "Started",
186
+ Successful: "Successful",
187
+ Timedout: "Timedout"
188
+ };
189
+ const OidcSessionState = {
190
+ Started: "Started",
191
+ Authorized: "Authorized",
192
+ Successful: "Successful",
193
+ Failed: "Failed",
194
+ Terminated: "Terminated",
195
+ Timedout: "Timedout"
196
+ };
197
+ const SsoConnectionSessionJSONState = {
198
+ ...SamlSessionState,
199
+ ...OidcSessionState
200
+ };
201
+ const SsoConnectionAnyOfType = {
202
+ AdfsSaml: "AdfsSaml",
203
+ Auth0Saml: "Auth0Saml",
204
+ AzureSaml: "AzureSaml",
205
+ CasSaml: "CasSaml",
206
+ ClassLinkSaml: "ClassLinkSaml",
207
+ CloudflareSaml: "CloudflareSaml",
208
+ CyberArkSaml: "CyberArkSaml",
209
+ DuoSaml: "DuoSaml",
210
+ GenericSaml: "GenericSaml",
211
+ GoogleSaml: "GoogleSaml",
212
+ JumpCloudSaml: "JumpCloudSaml",
213
+ KeycloakSaml: "KeycloakSaml",
214
+ LastPassSaml: "LastPassSaml",
215
+ MiniOrangeSaml: "MiniOrangeSaml",
216
+ NetIqSaml: "NetIqSaml",
217
+ OktaSaml: "OktaSaml",
218
+ OneLoginSaml: "OneLoginSaml",
219
+ OracleSaml: "OracleSaml",
220
+ PingFederateSaml: "PingFederateSaml",
221
+ PingOneSaml: "PingOneSaml",
222
+ RipplingSaml: "RipplingSaml",
223
+ SalesforceSaml: "SalesforceSaml",
224
+ ShibbolethGenericSaml: "ShibbolethGenericSaml",
225
+ ShibbolethSaml: "ShibbolethSaml",
226
+ SimpleSamlPhpSaml: "SimpleSamlPhpSaml",
227
+ TestIdp: "TestIdp",
228
+ VmWareSaml: "VmWareSaml"
229
+ };
230
+ const SsoConnectionAnyOfState = {
231
+ Inactive: "Inactive",
232
+ Validating: "Validating",
233
+ Active: "Active",
234
+ Deleting: "Deleting"
235
+ };
236
+ const SsoConnectionAnyOfProviderTag = {
237
+ Saml: "Saml"
238
+ };
239
+ const SsoConnectionAnyOfEightAllOfState = {
240
+ Inactive: "Inactive",
241
+ Validating: "Validating",
242
+ Active: "Active",
243
+ Deleting: "Deleting"
244
+ };
245
+ const SsoConnectionAnyOfEightAllOfType = {
246
+ AdpOidc: "AdpOidc",
247
+ Auth0Migration: "Auth0Migration",
248
+ CleverOidc: "CleverOidc",
249
+ EntraIdOidc: "EntraIdOidc",
250
+ GenericOidc: "GenericOidc",
251
+ GoogleOidc: "GoogleOidc",
252
+ OktaOidc: "OktaOidc",
253
+ LoginGovOidc: "LoginGovOidc"
254
+ };
255
+ const SsoConnectionAnyOfEightAllOfProviderTag = {
256
+ OpenIdConnect: "OpenIdConnect"
257
+ };
258
+ const DataInstallationObject = {
259
+ data_installation: "data_installation",
260
+ connected_account: "connected_account"
261
+ };
262
+ const DataInstallationState = {
263
+ connected: "connected",
264
+ needs_reauthorization: "needs_reauthorization"
265
+ };
266
+ const DataIntegrationObject = {
267
+ data_integration: "data_integration"
268
+ };
269
+ const DataIntegrationIntegrationType = {
270
+ asana: "asana",
271
+ box: "box",
272
+ "cal-dot-com": "cal-dot-com",
273
+ calendly: "calendly",
274
+ confluence: "confluence",
275
+ dropbox: "dropbox",
276
+ "frame-io": "frame-io",
277
+ front: "front",
278
+ github: "github",
279
+ gitlab: "gitlab",
280
+ gmail: "gmail",
281
+ google: "google",
282
+ "google-calendar": "google-calendar",
283
+ "google-drive": "google-drive",
284
+ helpscout: "helpscout",
285
+ hubspot: "hubspot",
286
+ intercom: "intercom",
287
+ jira: "jira",
288
+ linear: "linear",
289
+ microsoft: "microsoft",
290
+ "microsoft-onedrive": "microsoft-onedrive",
291
+ "microsoft-onenote": "microsoft-onenote",
292
+ "microsoft-outlook": "microsoft-outlook",
293
+ "microsoft-outlook-calendar": "microsoft-outlook-calendar",
294
+ "microsoft-sharepoint": "microsoft-sharepoint",
295
+ "microsoft-teams": "microsoft-teams",
296
+ "microsoft-todo": "microsoft-todo",
297
+ notion: "notion",
298
+ prefect: "prefect",
299
+ "pydantic-logfire": "pydantic-logfire",
300
+ salesforce: "salesforce",
301
+ sentry: "sentry",
302
+ slack: "slack",
303
+ snowflake: "snowflake",
304
+ stripe: "stripe",
305
+ xero: "xero",
306
+ zendesk: "zendesk"
307
+ };
308
+ const DataIntegrationOwnership = {
309
+ userland_user: "userland_user",
310
+ organization: "organization"
311
+ };
312
+ const DataIntegrationCredentialsType = {
313
+ shared: "shared",
314
+ custom: "custom"
315
+ };
316
+ const GenerateAdminPortalLinkIntent = {
317
+ domain_verification: "domain_verification",
318
+ sso: "sso"
319
+ };
320
+ const getMembersUrl = (params) => {
321
+ const normalizedParams = new URLSearchParams();
322
+ Object.entries(params || {}).forEach(([key, value]) => {
323
+ if (value !== void 0) {
324
+ normalizedParams.append(key, value === null ? "null" : value.toString());
325
+ }
326
+ });
327
+ const stringifiedParams = normalizedParams.toString();
328
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
329
+ };
330
+ const members = async (params, options) => {
331
+ const res = await fetch(getMembersUrl(params), {
332
+ ...options,
333
+ method: "GET"
334
+ });
335
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
336
+ const data = body ? JSON.parse(body) : {};
337
+ return { data, status: res.status, headers: res.headers };
338
+ };
339
+ const getRolesUrl = () => {
340
+ return `https://api.workos.com/_widgets/UserManagement/roles`;
341
+ };
342
+ const roles = async (options) => {
343
+ const res = await fetch(getRolesUrl(), {
344
+ ...options,
345
+ method: "GET"
346
+ });
347
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
348
+ const data = body ? JSON.parse(body) : {};
349
+ return { data, status: res.status, headers: res.headers };
350
+ };
351
+ const getRolesAndConfigUrl = () => {
352
+ return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;
353
+ };
354
+ const rolesAndConfig = async (options) => {
355
+ const res = await fetch(getRolesAndConfigUrl(), {
356
+ ...options,
357
+ method: "GET"
358
+ });
359
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
360
+ const data = body ? JSON.parse(body) : {};
361
+ return {
362
+ data,
363
+ status: res.status,
364
+ headers: res.headers
365
+ };
366
+ };
367
+ const getInviteMemberUrl = () => {
368
+ return `https://api.workos.com/_widgets/UserManagement/invite-user`;
369
+ };
370
+ const inviteMember = async (inviteMemberBody, options) => {
371
+ const res = await fetch(getInviteMemberUrl(), {
372
+ ...options,
373
+ method: "POST",
374
+ headers: { "Content-Type": "application/json", ...options?.headers },
375
+ body: JSON.stringify(inviteMemberBody)
376
+ });
377
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
378
+ const data = body ? JSON.parse(body) : {};
379
+ return {
380
+ data,
381
+ status: res.status,
382
+ headers: res.headers
383
+ };
384
+ };
385
+ const getResendInviteUrl = (userId) => {
386
+ return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;
387
+ };
388
+ const resendInvite = async (userId, options) => {
389
+ const res = await fetch(getResendInviteUrl(userId), {
390
+ ...options,
391
+ method: "POST"
392
+ });
393
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
394
+ const data = body ? JSON.parse(body) : {};
395
+ return {
396
+ data,
397
+ status: res.status,
398
+ headers: res.headers
399
+ };
400
+ };
401
+ const getRevokeInviteUrl = (userId) => {
402
+ return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
403
+ };
404
+ const revokeInvite = async (userId, options) => {
405
+ const res = await fetch(getRevokeInviteUrl(userId), {
406
+ ...options,
407
+ method: "DELETE"
408
+ });
409
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
410
+ const data = body ? JSON.parse(body) : {};
411
+ return {
412
+ data,
413
+ status: res.status,
414
+ headers: res.headers
415
+ };
416
+ };
417
+ const getRemoveMemberUrl = (userId) => {
418
+ return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
419
+ };
420
+ const removeMember = async (userId, options) => {
421
+ const res = await fetch(getRemoveMemberUrl(userId), {
422
+ ...options,
423
+ method: "DELETE"
424
+ });
425
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
426
+ const data = body ? JSON.parse(body) : {};
427
+ return {
428
+ data,
429
+ status: res.status,
430
+ headers: res.headers
431
+ };
432
+ };
433
+ const getUpdateMemberUrl = (userId) => {
434
+ return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
435
+ };
436
+ const updateMember = async (userId, updateMemberBody, options) => {
437
+ const res = await fetch(getUpdateMemberUrl(userId), {
438
+ ...options,
439
+ method: "POST",
440
+ headers: { "Content-Type": "application/json", ...options?.headers },
441
+ body: JSON.stringify(updateMemberBody)
442
+ });
443
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
444
+ const data = body ? JSON.parse(body) : {};
445
+ return {
446
+ data,
447
+ status: res.status,
448
+ headers: res.headers
449
+ };
450
+ };
451
+ const getOrganizationsUrl = () => {
452
+ return `https://api.workos.com/_widgets/UserManagement/organizations`;
453
+ };
454
+ const organizations = async (options) => {
455
+ const res = await fetch(getOrganizationsUrl(), {
456
+ ...options,
457
+ method: "GET"
458
+ });
459
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
460
+ const data = body ? JSON.parse(body) : {};
461
+ return {
462
+ data,
463
+ status: res.status,
464
+ headers: res.headers
465
+ };
466
+ };
467
+ const getMeUrl = () => {
468
+ return `https://api.workos.com/_widgets/UserProfile/me`;
469
+ };
470
+ const me = async (options) => {
471
+ const res = await fetch(getMeUrl(), {
472
+ ...options,
473
+ method: "GET"
474
+ });
475
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
476
+ const data = body ? JSON.parse(body) : {};
477
+ return { data, status: res.status, headers: res.headers };
478
+ };
479
+ const getUpdateMeUrl = () => {
480
+ return `https://api.workos.com/_widgets/UserProfile/me`;
481
+ };
482
+ const updateMe = async (updateMeBody, options) => {
483
+ const res = await fetch(getUpdateMeUrl(), {
484
+ ...options,
485
+ method: "POST",
486
+ headers: { "Content-Type": "application/json", ...options?.headers },
487
+ body: JSON.stringify(updateMeBody)
488
+ });
489
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
490
+ const data = body ? JSON.parse(body) : {};
491
+ return { data, status: res.status, headers: res.headers };
492
+ };
493
+ const getCreateTotpFactorUrl = () => {
494
+ return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
495
+ };
496
+ const createTotpFactor = async (options) => {
497
+ const res = await fetch(getCreateTotpFactorUrl(), {
498
+ ...options,
499
+ method: "POST"
500
+ });
501
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
502
+ const data = body ? JSON.parse(body) : {};
503
+ return {
504
+ data,
505
+ status: res.status,
506
+ headers: res.headers
507
+ };
508
+ };
509
+ const getVerifyTotpFactorUrl = () => {
510
+ return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
511
+ };
512
+ const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
513
+ const res = await fetch(getVerifyTotpFactorUrl(), {
514
+ ...options,
515
+ method: "POST",
516
+ headers: { "Content-Type": "application/json", ...options?.headers },
517
+ body: JSON.stringify(verifyTotpFactorRequest)
518
+ });
519
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
520
+ const data = body ? JSON.parse(body) : {};
521
+ return {
522
+ data,
523
+ status: res.status,
524
+ headers: res.headers
525
+ };
526
+ };
527
+ const getDeleteTotpFactorsUrl = () => {
528
+ return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
529
+ };
530
+ const deleteTotpFactors = async (options) => {
531
+ const res = await fetch(getDeleteTotpFactorsUrl(), {
532
+ ...options,
533
+ method: "DELETE"
534
+ });
535
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
536
+ const data = body ? JSON.parse(body) : {};
537
+ return {
538
+ data,
539
+ status: res.status,
540
+ headers: res.headers
541
+ };
542
+ };
543
+ const getAuthenticationInformationUrl = () => {
544
+ return `https://api.workos.com/_widgets/UserProfile/authentication-information`;
545
+ };
546
+ const authenticationInformation = async (options) => {
547
+ const res = await fetch(getAuthenticationInformationUrl(), {
548
+ ...options,
549
+ method: "GET"
550
+ });
551
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
552
+ const data = body ? JSON.parse(body) : {};
553
+ return {
554
+ data,
555
+ status: res.status,
556
+ headers: res.headers
557
+ };
558
+ };
559
+ const getCreatePasswordUrl = () => {
560
+ return `https://api.workos.com/_widgets/UserProfile/create-password`;
561
+ };
562
+ const createPassword = async (createPasswordRequest, options) => {
563
+ const res = await fetch(getCreatePasswordUrl(), {
564
+ ...options,
565
+ method: "POST",
566
+ headers: { "Content-Type": "application/json", ...options?.headers },
567
+ body: JSON.stringify(createPasswordRequest)
568
+ });
569
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
570
+ const data = body ? JSON.parse(body) : {};
571
+ return {
572
+ data,
573
+ status: res.status,
574
+ headers: res.headers
575
+ };
576
+ };
577
+ const getUpdatePasswordUrl = () => {
578
+ return `https://api.workos.com/_widgets/UserProfile/update-password`;
579
+ };
580
+ const updatePassword = async (updatePasswordRequest, options) => {
581
+ const res = await fetch(getUpdatePasswordUrl(), {
582
+ ...options,
583
+ method: "POST",
584
+ headers: { "Content-Type": "application/json", ...options?.headers },
585
+ body: JSON.stringify(updatePasswordRequest)
586
+ });
587
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
588
+ const data = body ? JSON.parse(body) : {};
589
+ return {
590
+ data,
591
+ status: res.status,
592
+ headers: res.headers
593
+ };
594
+ };
595
+ const getRevokeAllSessionsUrl = () => {
596
+ return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
597
+ };
598
+ const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
599
+ const res = await fetch(getRevokeAllSessionsUrl(), {
600
+ ...options,
601
+ method: "DELETE",
602
+ headers: { "Content-Type": "application/json", ...options?.headers },
603
+ body: JSON.stringify(revokeAllSessionsRequest)
604
+ });
605
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
606
+ const data = body ? JSON.parse(body) : {};
607
+ return {
608
+ data,
609
+ status: res.status,
610
+ headers: res.headers
611
+ };
612
+ };
613
+ const getRevokeSessionUrl = (sessionId) => {
614
+ return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;
615
+ };
616
+ const revokeSession = async (sessionId, options) => {
617
+ const res = await fetch(getRevokeSessionUrl(sessionId), {
618
+ ...options,
619
+ method: "DELETE"
620
+ });
621
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
622
+ const data = body ? JSON.parse(body) : {};
623
+ return {
624
+ data,
625
+ status: res.status,
626
+ headers: res.headers
627
+ };
628
+ };
629
+ const getSessionsUrl = () => {
630
+ return `https://api.workos.com/_widgets/UserProfile/sessions`;
631
+ };
632
+ const sessions = async (options) => {
633
+ const res = await fetch(getSessionsUrl(), {
634
+ ...options,
635
+ method: "GET"
636
+ });
637
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
638
+ const data = body ? JSON.parse(body) : {};
639
+ return { data, status: res.status, headers: res.headers };
640
+ };
641
+ const getSendVerificationUrl = () => {
642
+ return `https://api.workos.com/_widgets/UserProfile/send-verification`;
643
+ };
644
+ const sendVerification = async (options) => {
645
+ const res = await fetch(getSendVerificationUrl(), {
646
+ ...options,
647
+ method: "POST"
648
+ });
649
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
650
+ const data = body ? JSON.parse(body) : {};
651
+ return {
652
+ data,
653
+ status: res.status,
654
+ headers: res.headers
655
+ };
656
+ };
657
+ const getVerifyUrl = () => {
658
+ return `https://api.workos.com/_widgets/UserProfile/verify`;
659
+ };
660
+ const verify = async (verifyRequest, options) => {
661
+ const res = await fetch(getVerifyUrl(), {
662
+ ...options,
663
+ method: "POST",
664
+ headers: { "Content-Type": "application/json", ...options?.headers },
665
+ body: JSON.stringify(verifyRequest)
666
+ });
667
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
668
+ const data = body ? JSON.parse(body) : {};
669
+ return { data, status: res.status, headers: res.headers };
670
+ };
671
+ const getRegisterPasskeyUrl = () => {
672
+ return `https://api.workos.com/_widgets/UserProfile/passkeys`;
673
+ };
674
+ const registerPasskey = async (options) => {
675
+ const res = await fetch(getRegisterPasskeyUrl(), {
676
+ ...options,
677
+ method: "POST"
678
+ });
679
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
680
+ const data = body ? JSON.parse(body) : {};
681
+ return {
682
+ data,
683
+ status: res.status,
684
+ headers: res.headers
685
+ };
686
+ };
687
+ const getVerifyPasskeyUrl = () => {
688
+ return `https://api.workos.com/_widgets/UserProfile/passkeys/verify`;
689
+ };
690
+ const verifyPasskey = async (verifyPasskeyRequest, options) => {
691
+ const res = await fetch(getVerifyPasskeyUrl(), {
692
+ ...options,
693
+ method: "POST",
694
+ headers: { "Content-Type": "application/json", ...options?.headers },
695
+ body: JSON.stringify(verifyPasskeyRequest)
696
+ });
697
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
698
+ const data = body ? JSON.parse(body) : {};
699
+ return {
700
+ data,
701
+ status: res.status,
702
+ headers: res.headers
703
+ };
704
+ };
705
+ const getDeletePasskeyUrl = (passkeyId) => {
706
+ return `https://api.workos.com/_widgets/UserProfile/passkeys/${passkeyId}`;
707
+ };
708
+ const deletePasskey = async (passkeyId, options) => {
709
+ const res = await fetch(getDeletePasskeyUrl(passkeyId), {
710
+ ...options,
711
+ method: "DELETE"
712
+ });
713
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
714
+ const data = body ? JSON.parse(body) : {};
715
+ return {
716
+ data,
717
+ status: res.status,
718
+ headers: res.headers
719
+ };
720
+ };
721
+ const getSettingsUrl = () => {
722
+ return `https://api.workos.com/_widgets/settings`;
723
+ };
724
+ const settings = async (options) => {
725
+ const res = await fetch(getSettingsUrl(), {
726
+ ...options,
727
+ method: "GET"
728
+ });
729
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
730
+ const data = body ? JSON.parse(body) : {};
731
+ return { data, status: res.status, headers: res.headers };
732
+ };
733
+ const getListOrganizationDomainsUrl = () => {
734
+ return `https://api.workos.com/_widgets/admin-portal/organization-domains`;
735
+ };
736
+ const listOrganizationDomains = async (options) => {
737
+ const res = await fetch(getListOrganizationDomainsUrl(), {
738
+ ...options,
739
+ method: "GET"
740
+ });
741
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
742
+ const data = body ? JSON.parse(body) : {};
743
+ return {
744
+ data,
745
+ status: res.status,
746
+ headers: res.headers
747
+ };
748
+ };
749
+ const getGenerateAdminPortalLinkUrl = (params) => {
750
+ const normalizedParams = new URLSearchParams();
751
+ Object.entries(params || {}).forEach(([key, value]) => {
752
+ if (value !== void 0) {
753
+ normalizedParams.append(key, value === null ? "null" : value.toString());
754
+ }
755
+ });
756
+ const stringifiedParams = normalizedParams.toString();
757
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
758
+ };
759
+ const generateAdminPortalLink = async (params, options) => {
760
+ const res = await fetch(getGenerateAdminPortalLinkUrl(params), {
761
+ ...options,
762
+ method: "POST"
763
+ });
764
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
765
+ const data = body ? JSON.parse(body) : {};
766
+ return {
767
+ data,
768
+ status: res.status,
769
+ headers: res.headers
770
+ };
771
+ };
772
+ const getDeleteOrganizationDomainUrl = (domainId) => {
773
+ return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;
774
+ };
775
+ const deleteOrganizationDomain = async (domainId, options) => {
776
+ const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {
777
+ ...options,
778
+ method: "DELETE"
779
+ });
780
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
781
+ const data = body ? JSON.parse(body) : {};
782
+ return {
783
+ data,
784
+ status: res.status,
785
+ headers: res.headers
786
+ };
787
+ };
788
+ const getReverifyOrganizationDomainUrl = (domainId) => {
789
+ return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;
790
+ };
791
+ const reverifyOrganizationDomain = async (domainId, options) => {
792
+ const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {
793
+ ...options,
794
+ method: "POST"
795
+ });
796
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
797
+ const data = body ? JSON.parse(body) : {};
798
+ return {
799
+ data,
800
+ status: res.status,
801
+ headers: res.headers
802
+ };
803
+ };
804
+ const getListSsoConnectionsUrl = () => {
805
+ return `https://api.workos.com/_widgets/admin-portal/sso-connections`;
806
+ };
807
+ const listSsoConnections = async (options) => {
808
+ const res = await fetch(getListSsoConnectionsUrl(), {
809
+ ...options,
810
+ method: "GET"
811
+ });
812
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
813
+ const data = body ? JSON.parse(body) : {};
814
+ return {
815
+ data,
816
+ status: res.status,
817
+ headers: res.headers
818
+ };
819
+ };
820
+ const getCreateOrganizationApiKeyUrl = () => {
821
+ return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
822
+ };
823
+ const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options) => {
824
+ const res = await fetch(getCreateOrganizationApiKeyUrl(), {
825
+ ...options,
826
+ method: "POST",
827
+ headers: { "Content-Type": "application/json", ...options?.headers },
828
+ body: JSON.stringify(createOrganizationApiKeyRequest)
829
+ });
830
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
831
+ const data = body ? JSON.parse(body) : {};
832
+ return {
833
+ data,
834
+ status: res.status,
835
+ headers: res.headers
836
+ };
837
+ };
838
+ const getListOrganizationApiKeysUrl = (params) => {
839
+ const normalizedParams = new URLSearchParams();
840
+ Object.entries(params || {}).forEach(([key, value]) => {
841
+ if (value !== void 0) {
842
+ normalizedParams.append(key, value === null ? "null" : value.toString());
843
+ }
844
+ });
845
+ const stringifiedParams = normalizedParams.toString();
846
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
847
+ };
848
+ const listOrganizationApiKeys = async (params, options) => {
849
+ const res = await fetch(getListOrganizationApiKeysUrl(params), {
850
+ ...options,
851
+ method: "GET"
852
+ });
853
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
854
+ const data = body ? JSON.parse(body) : {};
855
+ return {
856
+ data,
857
+ status: res.status,
858
+ headers: res.headers
859
+ };
860
+ };
861
+ const getListOrganizationApiKeyPermissionsUrl = (params) => {
862
+ const normalizedParams = new URLSearchParams();
863
+ Object.entries(params || {}).forEach(([key, value]) => {
864
+ if (value !== void 0) {
865
+ normalizedParams.append(key, value === null ? "null" : value.toString());
866
+ }
867
+ });
868
+ const stringifiedParams = normalizedParams.toString();
869
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
870
+ };
871
+ const listOrganizationApiKeyPermissions = async (params, options) => {
872
+ const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {
873
+ ...options,
874
+ method: "GET"
875
+ });
876
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
877
+ const data = body ? JSON.parse(body) : {};
878
+ return {
879
+ data,
880
+ status: res.status,
881
+ headers: res.headers
882
+ };
883
+ };
884
+ const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
885
+ return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
886
+ };
887
+ const deleteOrganizationApiKey = async (apiKeyId, options) => {
888
+ const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {
889
+ ...options,
890
+ method: "DELETE"
891
+ });
892
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
893
+ const data = body ? JSON.parse(body) : {};
894
+ return {
895
+ data,
896
+ status: res.status,
897
+ headers: res.headers
898
+ };
899
+ };
900
+ const getMyDataIntegrationsUrl = () => {
901
+ return `https://api.workos.com/_widgets/DataIntegrations/mine`;
902
+ };
903
+ const myDataIntegrations = async (options) => {
904
+ const res = await fetch(getMyDataIntegrationsUrl(), {
905
+ ...options,
906
+ method: "GET"
907
+ });
908
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
909
+ const data = body ? JSON.parse(body) : {};
910
+ return {
911
+ data,
912
+ status: res.status,
913
+ headers: res.headers
914
+ };
915
+ };
916
+ const getGetDataIntegrationAuthorizeUrlUrl = (slug, params) => {
917
+ const normalizedParams = new URLSearchParams();
918
+ Object.entries(params || {}).forEach(([key, value]) => {
919
+ if (value !== void 0) {
920
+ normalizedParams.append(key, value === null ? "null" : value.toString());
921
+ }
922
+ });
923
+ const stringifiedParams = normalizedParams.toString();
924
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
925
+ };
926
+ const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
927
+ const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {
928
+ ...options,
929
+ method: "GET"
930
+ });
931
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
932
+ const data = body ? JSON.parse(body) : {};
933
+ return {
934
+ data,
935
+ status: res.status,
936
+ headers: res.headers
937
+ };
938
+ };
939
+ const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
940
+ return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
941
+ };
942
+ const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state, options) => {
943
+ const res = await fetch(
944
+ getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),
945
+ {
946
+ ...options,
947
+ method: "GET"
948
+ }
949
+ );
950
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
951
+ const data = body ? JSON.parse(body) : {};
952
+ return {
953
+ data,
954
+ status: res.status,
955
+ headers: res.headers
956
+ };
957
+ };
958
+ const getDeleteDataInstallationUrl = (installationId) => {
959
+ return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;
960
+ };
961
+ const deleteDataInstallation = async (installationId, options) => {
962
+ const res = await fetch(getDeleteDataInstallationUrl(installationId), {
963
+ ...options,
964
+ method: "DELETE"
965
+ });
966
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
967
+ const data = body ? JSON.parse(body) : {};
968
+ return {
969
+ data,
970
+ status: res.status,
971
+ headers: res.headers
972
+ };
973
+ };
974
+ // Annotate the CommonJS export names for ESM import in node:
975
+ 0 && (module.exports = {
976
+ AuthenticationInformationResponseDataVerificationMethodsMfaProvider,
977
+ AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider,
978
+ AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
979
+ CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
980
+ CreateTotpFactorResponseAuthenticationFactorAllOfObject,
981
+ CreateTotpFactorResponseAuthenticationFactorAllOfType,
982
+ DataInstallationObject,
983
+ DataInstallationState,
984
+ DataIntegrationCredentialsType,
985
+ DataIntegrationIntegrationType,
986
+ DataIntegrationObject,
987
+ DataIntegrationOwnership,
988
+ DomainVerificationNameServer,
989
+ GenerateAdminPortalLinkIntent,
990
+ MemberActionsItem,
991
+ MemberStatus,
992
+ OidcSessionState,
993
+ OrganizationDomainState,
994
+ SamlSessionState,
995
+ SendVerificationResponseType,
996
+ SettingsResponseObject,
997
+ SsoConnectionAnyOfEightAllOfProviderTag,
998
+ SsoConnectionAnyOfEightAllOfState,
999
+ SsoConnectionAnyOfEightAllOfType,
1000
+ SsoConnectionAnyOfProviderTag,
1001
+ SsoConnectionAnyOfState,
1002
+ SsoConnectionAnyOfType,
1003
+ SsoConnectionSessionJSONState,
1004
+ authenticationInformation,
1005
+ createOrganizationApiKey,
1006
+ createPassword,
1007
+ createTotpFactor,
1008
+ deleteDataInstallation,
1009
+ deleteOrganizationApiKey,
1010
+ deleteOrganizationDomain,
1011
+ deletePasskey,
1012
+ deleteTotpFactors,
1013
+ generateAdminPortalLink,
1014
+ getAuthenticationInformationUrl,
1015
+ getCreateOrganizationApiKeyUrl,
1016
+ getCreatePasswordUrl,
1017
+ getCreateTotpFactorUrl,
1018
+ getDataInstallationAuthorizationStatus,
1019
+ getDataIntegrationAuthorizeUrl,
1020
+ getDeleteDataInstallationUrl,
1021
+ getDeleteOrganizationApiKeyUrl,
1022
+ getDeleteOrganizationDomainUrl,
1023
+ getDeletePasskeyUrl,
1024
+ getDeleteTotpFactorsUrl,
1025
+ getGenerateAdminPortalLinkUrl,
1026
+ getGetDataInstallationAuthorizationStatusUrl,
1027
+ getGetDataIntegrationAuthorizeUrlUrl,
1028
+ getInviteMemberUrl,
1029
+ getListOrganizationApiKeyPermissionsUrl,
1030
+ getListOrganizationApiKeysUrl,
1031
+ getListOrganizationDomainsUrl,
1032
+ getListSsoConnectionsUrl,
1033
+ getMeUrl,
1034
+ getMembersUrl,
1035
+ getMyDataIntegrationsUrl,
1036
+ getOrganizationsUrl,
1037
+ getRegisterPasskeyUrl,
1038
+ getRemoveMemberUrl,
1039
+ getResendInviteUrl,
1040
+ getReverifyOrganizationDomainUrl,
1041
+ getRevokeAllSessionsUrl,
1042
+ getRevokeInviteUrl,
1043
+ getRevokeSessionUrl,
1044
+ getRolesAndConfigUrl,
1045
+ getRolesUrl,
1046
+ getSendVerificationUrl,
1047
+ getSessionsUrl,
1048
+ getSettingsUrl,
1049
+ getUpdateMeUrl,
1050
+ getUpdateMemberUrl,
1051
+ getUpdatePasswordUrl,
1052
+ getVerifyPasskeyUrl,
1053
+ getVerifyTotpFactorUrl,
1054
+ getVerifyUrl,
1055
+ inviteMember,
1056
+ listOrganizationApiKeyPermissions,
1057
+ listOrganizationApiKeys,
1058
+ listOrganizationDomains,
1059
+ listSsoConnections,
1060
+ me,
1061
+ members,
1062
+ myDataIntegrations,
1063
+ organizations,
1064
+ registerPasskey,
1065
+ removeMember,
1066
+ resendInvite,
1067
+ reverifyOrganizationDomain,
1068
+ revokeAllSessions,
1069
+ revokeInvite,
1070
+ revokeSession,
1071
+ roles,
1072
+ rolesAndConfig,
1073
+ sendVerification,
1074
+ sessions,
1075
+ settings,
1076
+ updateMe,
1077
+ updateMember,
1078
+ updatePassword,
1079
+ verify,
1080
+ verifyPasskey,
1081
+ verifyTotpFactor
1082
+ });
1083
+ //# sourceMappingURL=fetch.cjs.map