@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,1731 @@
1
+ import useSwr from "swr";
2
+ import useSWRMutation from "swr/mutation";
3
+ const MemberStatus = {
4
+ Active: "Active",
5
+ Invited: "Invited",
6
+ InviteExpired: "InviteExpired",
7
+ InviteRevoked: "InviteRevoked",
8
+ NoInvite: "NoInvite"
9
+ };
10
+ const MemberActionsItem = {
11
+ "edit-role": "edit-role",
12
+ "resend-invite": "resend-invite",
13
+ "revoke-invite": "revoke-invite",
14
+ "revoke-membership": "revoke-membership"
15
+ };
16
+ const CreateTotpFactorResponseAuthenticationFactorAllOfObject = {
17
+ authentication_factor: "authentication_factor"
18
+ };
19
+ const CreateTotpFactorResponseAuthenticationFactorAllOfType = {
20
+ generic_otp: "generic_otp",
21
+ sms: "sms",
22
+ totp: "totp",
23
+ webauthn: "webauthn"
24
+ };
25
+ const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {
26
+ authentication_challenge: "authentication_challenge"
27
+ };
28
+ const AuthenticationInformationResponseDataVerificationMethodsMfaProvider = {
29
+ MFA: "MFA"
30
+ };
31
+ const AuthenticationInformationResponseDataVerificationMethodsPasswordProvider = {
32
+ Password: "Password"
33
+ };
34
+ const AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider = {
35
+ Passkey: "Passkey"
36
+ };
37
+ const SendVerificationResponseType = {
38
+ EmailVerification: "EmailVerification"
39
+ };
40
+ const SettingsResponseObject = {
41
+ settings: "settings"
42
+ };
43
+ const OrganizationDomainState = {
44
+ Failed: "Failed",
45
+ LegacyVerified: "LegacyVerified",
46
+ Pending: "Pending",
47
+ Verified: "Verified"
48
+ };
49
+ const DomainVerificationNameServer = {
50
+ AwsRoute53: "AwsRoute53",
51
+ GoogleDomains: "GoogleDomains",
52
+ CloudFlare: "CloudFlare",
53
+ GoDaddy: "GoDaddy",
54
+ Other: "Other"
55
+ };
56
+ const SamlSessionState = {
57
+ Authorized: "Authorized",
58
+ Failed: "Failed",
59
+ Started: "Started",
60
+ Successful: "Successful",
61
+ Timedout: "Timedout"
62
+ };
63
+ const OidcSessionState = {
64
+ Started: "Started",
65
+ Authorized: "Authorized",
66
+ Successful: "Successful",
67
+ Failed: "Failed",
68
+ Terminated: "Terminated",
69
+ Timedout: "Timedout"
70
+ };
71
+ const SsoConnectionSessionJSONState = {
72
+ ...SamlSessionState,
73
+ ...OidcSessionState
74
+ };
75
+ const SsoConnectionAnyOfType = {
76
+ AdfsSaml: "AdfsSaml",
77
+ Auth0Saml: "Auth0Saml",
78
+ AzureSaml: "AzureSaml",
79
+ CasSaml: "CasSaml",
80
+ ClassLinkSaml: "ClassLinkSaml",
81
+ CloudflareSaml: "CloudflareSaml",
82
+ CyberArkSaml: "CyberArkSaml",
83
+ DuoSaml: "DuoSaml",
84
+ GenericSaml: "GenericSaml",
85
+ GoogleSaml: "GoogleSaml",
86
+ JumpCloudSaml: "JumpCloudSaml",
87
+ KeycloakSaml: "KeycloakSaml",
88
+ LastPassSaml: "LastPassSaml",
89
+ MiniOrangeSaml: "MiniOrangeSaml",
90
+ NetIqSaml: "NetIqSaml",
91
+ OktaSaml: "OktaSaml",
92
+ OneLoginSaml: "OneLoginSaml",
93
+ OracleSaml: "OracleSaml",
94
+ PingFederateSaml: "PingFederateSaml",
95
+ PingOneSaml: "PingOneSaml",
96
+ RipplingSaml: "RipplingSaml",
97
+ SalesforceSaml: "SalesforceSaml",
98
+ ShibbolethGenericSaml: "ShibbolethGenericSaml",
99
+ ShibbolethSaml: "ShibbolethSaml",
100
+ SimpleSamlPhpSaml: "SimpleSamlPhpSaml",
101
+ TestIdp: "TestIdp",
102
+ VmWareSaml: "VmWareSaml"
103
+ };
104
+ const SsoConnectionAnyOfState = {
105
+ Inactive: "Inactive",
106
+ Validating: "Validating",
107
+ Active: "Active",
108
+ Deleting: "Deleting"
109
+ };
110
+ const SsoConnectionAnyOfProviderTag = {
111
+ Saml: "Saml"
112
+ };
113
+ const SsoConnectionAnyOfEightAllOfState = {
114
+ Inactive: "Inactive",
115
+ Validating: "Validating",
116
+ Active: "Active",
117
+ Deleting: "Deleting"
118
+ };
119
+ const SsoConnectionAnyOfEightAllOfType = {
120
+ AdpOidc: "AdpOidc",
121
+ Auth0Migration: "Auth0Migration",
122
+ CleverOidc: "CleverOidc",
123
+ EntraIdOidc: "EntraIdOidc",
124
+ GenericOidc: "GenericOidc",
125
+ GoogleOidc: "GoogleOidc",
126
+ OktaOidc: "OktaOidc",
127
+ LoginGovOidc: "LoginGovOidc"
128
+ };
129
+ const SsoConnectionAnyOfEightAllOfProviderTag = {
130
+ OpenIdConnect: "OpenIdConnect"
131
+ };
132
+ const DataInstallationObject = {
133
+ data_installation: "data_installation",
134
+ connected_account: "connected_account"
135
+ };
136
+ const DataInstallationState = {
137
+ connected: "connected",
138
+ needs_reauthorization: "needs_reauthorization"
139
+ };
140
+ const DataIntegrationObject = {
141
+ data_integration: "data_integration"
142
+ };
143
+ const DataIntegrationIntegrationType = {
144
+ asana: "asana",
145
+ box: "box",
146
+ "cal-dot-com": "cal-dot-com",
147
+ calendly: "calendly",
148
+ confluence: "confluence",
149
+ dropbox: "dropbox",
150
+ "frame-io": "frame-io",
151
+ front: "front",
152
+ github: "github",
153
+ gitlab: "gitlab",
154
+ gmail: "gmail",
155
+ google: "google",
156
+ "google-calendar": "google-calendar",
157
+ "google-drive": "google-drive",
158
+ helpscout: "helpscout",
159
+ hubspot: "hubspot",
160
+ intercom: "intercom",
161
+ jira: "jira",
162
+ linear: "linear",
163
+ microsoft: "microsoft",
164
+ "microsoft-onedrive": "microsoft-onedrive",
165
+ "microsoft-onenote": "microsoft-onenote",
166
+ "microsoft-outlook": "microsoft-outlook",
167
+ "microsoft-outlook-calendar": "microsoft-outlook-calendar",
168
+ "microsoft-sharepoint": "microsoft-sharepoint",
169
+ "microsoft-teams": "microsoft-teams",
170
+ "microsoft-todo": "microsoft-todo",
171
+ notion: "notion",
172
+ prefect: "prefect",
173
+ "pydantic-logfire": "pydantic-logfire",
174
+ salesforce: "salesforce",
175
+ sentry: "sentry",
176
+ slack: "slack",
177
+ snowflake: "snowflake",
178
+ stripe: "stripe",
179
+ xero: "xero",
180
+ zendesk: "zendesk"
181
+ };
182
+ const DataIntegrationOwnership = {
183
+ userland_user: "userland_user",
184
+ organization: "organization"
185
+ };
186
+ const DataIntegrationCredentialsType = {
187
+ shared: "shared",
188
+ custom: "custom"
189
+ };
190
+ const GenerateAdminPortalLinkIntent = {
191
+ domain_verification: "domain_verification",
192
+ sso: "sso"
193
+ };
194
+ const getMembersUrl = (params) => {
195
+ const normalizedParams = new URLSearchParams();
196
+ Object.entries(params || {}).forEach(([key, value]) => {
197
+ if (value !== void 0) {
198
+ normalizedParams.append(key, value === null ? "null" : value.toString());
199
+ }
200
+ });
201
+ const stringifiedParams = normalizedParams.toString();
202
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
203
+ };
204
+ const members = async (params, options) => {
205
+ const res = await fetch(getMembersUrl(params), {
206
+ ...options,
207
+ method: "GET"
208
+ });
209
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
210
+ const data = body ? JSON.parse(body) : {};
211
+ return { data, status: res.status, headers: res.headers };
212
+ };
213
+ const getMembersKey = (params) => [
214
+ `https://api.workos.com/_widgets/UserManagement/members`,
215
+ ...params ? [params] : []
216
+ ];
217
+ const useMembers = (params, options) => {
218
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
219
+ const isEnabled = swrOptions?.enabled !== false;
220
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getMembersKey(params) : null);
221
+ const swrFn = () => members(params, fetchOptions);
222
+ const query = useSwr(
223
+ swrKey,
224
+ swrFn,
225
+ swrOptions
226
+ );
227
+ return {
228
+ swrKey,
229
+ ...query
230
+ };
231
+ };
232
+ const getRolesUrl = () => {
233
+ return `https://api.workos.com/_widgets/UserManagement/roles`;
234
+ };
235
+ const roles = async (options) => {
236
+ const res = await fetch(getRolesUrl(), {
237
+ ...options,
238
+ method: "GET"
239
+ });
240
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
241
+ const data = body ? JSON.parse(body) : {};
242
+ return { data, status: res.status, headers: res.headers };
243
+ };
244
+ const getRolesKey = () => [`https://api.workos.com/_widgets/UserManagement/roles`];
245
+ const useRoles = (options) => {
246
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
247
+ const isEnabled = swrOptions?.enabled !== false;
248
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getRolesKey() : null);
249
+ const swrFn = () => roles(fetchOptions);
250
+ const query = useSwr(
251
+ swrKey,
252
+ swrFn,
253
+ swrOptions
254
+ );
255
+ return {
256
+ swrKey,
257
+ ...query
258
+ };
259
+ };
260
+ const getRolesAndConfigUrl = () => {
261
+ return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;
262
+ };
263
+ const rolesAndConfig = async (options) => {
264
+ const res = await fetch(getRolesAndConfigUrl(), {
265
+ ...options,
266
+ method: "GET"
267
+ });
268
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
269
+ const data = body ? JSON.parse(body) : {};
270
+ return {
271
+ data,
272
+ status: res.status,
273
+ headers: res.headers
274
+ };
275
+ };
276
+ const getRolesAndConfigKey = () => [`https://api.workos.com/_widgets/UserManagement/roles-and-config`];
277
+ const useRolesAndConfig = (options) => {
278
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
279
+ const isEnabled = swrOptions?.enabled !== false;
280
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getRolesAndConfigKey() : null);
281
+ const swrFn = () => rolesAndConfig(fetchOptions);
282
+ const query = useSwr(
283
+ swrKey,
284
+ swrFn,
285
+ swrOptions
286
+ );
287
+ return {
288
+ swrKey,
289
+ ...query
290
+ };
291
+ };
292
+ const getInviteMemberUrl = () => {
293
+ return `https://api.workos.com/_widgets/UserManagement/invite-user`;
294
+ };
295
+ const inviteMember = async (inviteMemberBody, options) => {
296
+ const res = await fetch(getInviteMemberUrl(), {
297
+ ...options,
298
+ method: "POST",
299
+ headers: { "Content-Type": "application/json", ...options?.headers },
300
+ body: JSON.stringify(inviteMemberBody)
301
+ });
302
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
303
+ const data = body ? JSON.parse(body) : {};
304
+ return {
305
+ data,
306
+ status: res.status,
307
+ headers: res.headers
308
+ };
309
+ };
310
+ const getInviteMemberMutationFetcher = (options) => {
311
+ return (_, { arg }) => {
312
+ return inviteMember(arg, options);
313
+ };
314
+ };
315
+ const getInviteMemberMutationKey = () => [`https://api.workos.com/_widgets/UserManagement/invite-user`];
316
+ const useInviteMember = (options) => {
317
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
318
+ const swrKey = swrOptions?.swrKey ?? getInviteMemberMutationKey();
319
+ const swrFn = getInviteMemberMutationFetcher(fetchOptions);
320
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
321
+ return {
322
+ swrKey,
323
+ ...query
324
+ };
325
+ };
326
+ const getResendInviteUrl = (userId) => {
327
+ return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;
328
+ };
329
+ const resendInvite = async (userId, options) => {
330
+ const res = await fetch(getResendInviteUrl(userId), {
331
+ ...options,
332
+ method: "POST"
333
+ });
334
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
335
+ const data = body ? JSON.parse(body) : {};
336
+ return {
337
+ data,
338
+ status: res.status,
339
+ headers: res.headers
340
+ };
341
+ };
342
+ const getResendInviteMutationFetcher = (userId, options) => {
343
+ return (_, __) => {
344
+ return resendInvite(userId, options);
345
+ };
346
+ };
347
+ const getResendInviteMutationKey = (userId) => [
348
+ `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`
349
+ ];
350
+ const useResendInvite = (userId, options) => {
351
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
352
+ const swrKey = swrOptions?.swrKey ?? getResendInviteMutationKey(userId);
353
+ const swrFn = getResendInviteMutationFetcher(userId, fetchOptions);
354
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
355
+ return {
356
+ swrKey,
357
+ ...query
358
+ };
359
+ };
360
+ const getRevokeInviteUrl = (userId) => {
361
+ return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
362
+ };
363
+ const revokeInvite = async (userId, options) => {
364
+ const res = await fetch(getRevokeInviteUrl(userId), {
365
+ ...options,
366
+ method: "DELETE"
367
+ });
368
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
369
+ const data = body ? JSON.parse(body) : {};
370
+ return {
371
+ data,
372
+ status: res.status,
373
+ headers: res.headers
374
+ };
375
+ };
376
+ const getRevokeInviteMutationFetcher = (userId, options) => {
377
+ return (_, __) => {
378
+ return revokeInvite(userId, options);
379
+ };
380
+ };
381
+ const getRevokeInviteMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/invites/${userId}`];
382
+ const useRevokeInvite = (userId, options) => {
383
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
384
+ const swrKey = swrOptions?.swrKey ?? getRevokeInviteMutationKey(userId);
385
+ const swrFn = getRevokeInviteMutationFetcher(userId, fetchOptions);
386
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
387
+ return {
388
+ swrKey,
389
+ ...query
390
+ };
391
+ };
392
+ const getRemoveMemberUrl = (userId) => {
393
+ return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
394
+ };
395
+ const removeMember = async (userId, options) => {
396
+ const res = await fetch(getRemoveMemberUrl(userId), {
397
+ ...options,
398
+ method: "DELETE"
399
+ });
400
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
401
+ const data = body ? JSON.parse(body) : {};
402
+ return {
403
+ data,
404
+ status: res.status,
405
+ headers: res.headers
406
+ };
407
+ };
408
+ const getRemoveMemberMutationFetcher = (userId, options) => {
409
+ return (_, __) => {
410
+ return removeMember(userId, options);
411
+ };
412
+ };
413
+ const getRemoveMemberMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/members/${userId}`];
414
+ const useRemoveMember = (userId, options) => {
415
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
416
+ const swrKey = swrOptions?.swrKey ?? getRemoveMemberMutationKey(userId);
417
+ const swrFn = getRemoveMemberMutationFetcher(userId, fetchOptions);
418
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
419
+ return {
420
+ swrKey,
421
+ ...query
422
+ };
423
+ };
424
+ const getUpdateMemberUrl = (userId) => {
425
+ return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
426
+ };
427
+ const updateMember = async (userId, updateMemberBody, options) => {
428
+ const res = await fetch(getUpdateMemberUrl(userId), {
429
+ ...options,
430
+ method: "POST",
431
+ headers: { "Content-Type": "application/json", ...options?.headers },
432
+ body: JSON.stringify(updateMemberBody)
433
+ });
434
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
435
+ const data = body ? JSON.parse(body) : {};
436
+ return {
437
+ data,
438
+ status: res.status,
439
+ headers: res.headers
440
+ };
441
+ };
442
+ const getUpdateMemberMutationFetcher = (userId, options) => {
443
+ return (_, { arg }) => {
444
+ return updateMember(userId, arg, options);
445
+ };
446
+ };
447
+ const getUpdateMemberMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/members/${userId}`];
448
+ const useUpdateMember = (userId, options) => {
449
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
450
+ const swrKey = swrOptions?.swrKey ?? getUpdateMemberMutationKey(userId);
451
+ const swrFn = getUpdateMemberMutationFetcher(userId, fetchOptions);
452
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
453
+ return {
454
+ swrKey,
455
+ ...query
456
+ };
457
+ };
458
+ const getOrganizationsUrl = () => {
459
+ return `https://api.workos.com/_widgets/UserManagement/organizations`;
460
+ };
461
+ const organizations = async (options) => {
462
+ const res = await fetch(getOrganizationsUrl(), {
463
+ ...options,
464
+ method: "GET"
465
+ });
466
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
467
+ const data = body ? JSON.parse(body) : {};
468
+ return {
469
+ data,
470
+ status: res.status,
471
+ headers: res.headers
472
+ };
473
+ };
474
+ const getOrganizationsKey = () => [`https://api.workos.com/_widgets/UserManagement/organizations`];
475
+ const useOrganizations = (options) => {
476
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
477
+ const isEnabled = swrOptions?.enabled !== false;
478
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getOrganizationsKey() : null);
479
+ const swrFn = () => organizations(fetchOptions);
480
+ const query = useSwr(
481
+ swrKey,
482
+ swrFn,
483
+ swrOptions
484
+ );
485
+ return {
486
+ swrKey,
487
+ ...query
488
+ };
489
+ };
490
+ const getMeUrl = () => {
491
+ return `https://api.workos.com/_widgets/UserProfile/me`;
492
+ };
493
+ const me = async (options) => {
494
+ const res = await fetch(getMeUrl(), {
495
+ ...options,
496
+ method: "GET"
497
+ });
498
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
499
+ const data = body ? JSON.parse(body) : {};
500
+ return { data, status: res.status, headers: res.headers };
501
+ };
502
+ const getMeKey = () => [`https://api.workos.com/_widgets/UserProfile/me`];
503
+ const useMe = (options) => {
504
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
505
+ const isEnabled = swrOptions?.enabled !== false;
506
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getMeKey() : null);
507
+ const swrFn = () => me(fetchOptions);
508
+ const query = useSwr(
509
+ swrKey,
510
+ swrFn,
511
+ swrOptions
512
+ );
513
+ return {
514
+ swrKey,
515
+ ...query
516
+ };
517
+ };
518
+ const getUpdateMeUrl = () => {
519
+ return `https://api.workos.com/_widgets/UserProfile/me`;
520
+ };
521
+ const updateMe = async (updateMeBody, options) => {
522
+ const res = await fetch(getUpdateMeUrl(), {
523
+ ...options,
524
+ method: "POST",
525
+ headers: { "Content-Type": "application/json", ...options?.headers },
526
+ body: JSON.stringify(updateMeBody)
527
+ });
528
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
529
+ const data = body ? JSON.parse(body) : {};
530
+ return { data, status: res.status, headers: res.headers };
531
+ };
532
+ const getUpdateMeMutationFetcher = (options) => {
533
+ return (_, { arg }) => {
534
+ return updateMe(arg, options);
535
+ };
536
+ };
537
+ const getUpdateMeMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/me`];
538
+ const useUpdateMe = (options) => {
539
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
540
+ const swrKey = swrOptions?.swrKey ?? getUpdateMeMutationKey();
541
+ const swrFn = getUpdateMeMutationFetcher(fetchOptions);
542
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
543
+ return {
544
+ swrKey,
545
+ ...query
546
+ };
547
+ };
548
+ const getCreateTotpFactorUrl = () => {
549
+ return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
550
+ };
551
+ const createTotpFactor = async (options) => {
552
+ const res = await fetch(getCreateTotpFactorUrl(), {
553
+ ...options,
554
+ method: "POST"
555
+ });
556
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
557
+ const data = body ? JSON.parse(body) : {};
558
+ return {
559
+ data,
560
+ status: res.status,
561
+ headers: res.headers
562
+ };
563
+ };
564
+ const getCreateTotpFactorMutationFetcher = (options) => {
565
+ return (_, __) => {
566
+ return createTotpFactor(options);
567
+ };
568
+ };
569
+ const getCreateTotpFactorMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/create-totp-factor`];
570
+ const useCreateTotpFactor = (options) => {
571
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
572
+ const swrKey = swrOptions?.swrKey ?? getCreateTotpFactorMutationKey();
573
+ const swrFn = getCreateTotpFactorMutationFetcher(fetchOptions);
574
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
575
+ return {
576
+ swrKey,
577
+ ...query
578
+ };
579
+ };
580
+ const getVerifyTotpFactorUrl = () => {
581
+ return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
582
+ };
583
+ const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
584
+ const res = await fetch(getVerifyTotpFactorUrl(), {
585
+ ...options,
586
+ method: "POST",
587
+ headers: { "Content-Type": "application/json", ...options?.headers },
588
+ body: JSON.stringify(verifyTotpFactorRequest)
589
+ });
590
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
591
+ const data = body ? JSON.parse(body) : {};
592
+ return {
593
+ data,
594
+ status: res.status,
595
+ headers: res.headers
596
+ };
597
+ };
598
+ const getVerifyTotpFactorMutationFetcher = (options) => {
599
+ return (_, { arg }) => {
600
+ return verifyTotpFactor(arg, options);
601
+ };
602
+ };
603
+ const getVerifyTotpFactorMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/verify-totp-factor`];
604
+ const useVerifyTotpFactor = (options) => {
605
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
606
+ const swrKey = swrOptions?.swrKey ?? getVerifyTotpFactorMutationKey();
607
+ const swrFn = getVerifyTotpFactorMutationFetcher(fetchOptions);
608
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
609
+ return {
610
+ swrKey,
611
+ ...query
612
+ };
613
+ };
614
+ const getDeleteTotpFactorsUrl = () => {
615
+ return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
616
+ };
617
+ const deleteTotpFactors = async (options) => {
618
+ const res = await fetch(getDeleteTotpFactorsUrl(), {
619
+ ...options,
620
+ method: "DELETE"
621
+ });
622
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
623
+ const data = body ? JSON.parse(body) : {};
624
+ return {
625
+ data,
626
+ status: res.status,
627
+ headers: res.headers
628
+ };
629
+ };
630
+ const getDeleteTotpFactorsMutationFetcher = (options) => {
631
+ return (_, __) => {
632
+ return deleteTotpFactors(options);
633
+ };
634
+ };
635
+ const getDeleteTotpFactorsMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/totp-factors`];
636
+ const useDeleteTotpFactors = (options) => {
637
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
638
+ const swrKey = swrOptions?.swrKey ?? getDeleteTotpFactorsMutationKey();
639
+ const swrFn = getDeleteTotpFactorsMutationFetcher(fetchOptions);
640
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
641
+ return {
642
+ swrKey,
643
+ ...query
644
+ };
645
+ };
646
+ const getAuthenticationInformationUrl = () => {
647
+ return `https://api.workos.com/_widgets/UserProfile/authentication-information`;
648
+ };
649
+ const authenticationInformation = async (options) => {
650
+ const res = await fetch(getAuthenticationInformationUrl(), {
651
+ ...options,
652
+ method: "GET"
653
+ });
654
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
655
+ const data = body ? JSON.parse(body) : {};
656
+ return {
657
+ data,
658
+ status: res.status,
659
+ headers: res.headers
660
+ };
661
+ };
662
+ const getAuthenticationInformationKey = () => [
663
+ `https://api.workos.com/_widgets/UserProfile/authentication-information`
664
+ ];
665
+ const useAuthenticationInformation = (options) => {
666
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
667
+ const isEnabled = swrOptions?.enabled !== false;
668
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getAuthenticationInformationKey() : null);
669
+ const swrFn = () => authenticationInformation(fetchOptions);
670
+ const query = useSwr(
671
+ swrKey,
672
+ swrFn,
673
+ swrOptions
674
+ );
675
+ return {
676
+ swrKey,
677
+ ...query
678
+ };
679
+ };
680
+ const getCreatePasswordUrl = () => {
681
+ return `https://api.workos.com/_widgets/UserProfile/create-password`;
682
+ };
683
+ const createPassword = async (createPasswordRequest, options) => {
684
+ const res = await fetch(getCreatePasswordUrl(), {
685
+ ...options,
686
+ method: "POST",
687
+ headers: { "Content-Type": "application/json", ...options?.headers },
688
+ body: JSON.stringify(createPasswordRequest)
689
+ });
690
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
691
+ const data = body ? JSON.parse(body) : {};
692
+ return {
693
+ data,
694
+ status: res.status,
695
+ headers: res.headers
696
+ };
697
+ };
698
+ const getCreatePasswordMutationFetcher = (options) => {
699
+ return (_, { arg }) => {
700
+ return createPassword(arg, options);
701
+ };
702
+ };
703
+ const getCreatePasswordMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/create-password`];
704
+ const useCreatePassword = (options) => {
705
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
706
+ const swrKey = swrOptions?.swrKey ?? getCreatePasswordMutationKey();
707
+ const swrFn = getCreatePasswordMutationFetcher(fetchOptions);
708
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
709
+ return {
710
+ swrKey,
711
+ ...query
712
+ };
713
+ };
714
+ const getUpdatePasswordUrl = () => {
715
+ return `https://api.workos.com/_widgets/UserProfile/update-password`;
716
+ };
717
+ const updatePassword = async (updatePasswordRequest, options) => {
718
+ const res = await fetch(getUpdatePasswordUrl(), {
719
+ ...options,
720
+ method: "POST",
721
+ headers: { "Content-Type": "application/json", ...options?.headers },
722
+ body: JSON.stringify(updatePasswordRequest)
723
+ });
724
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
725
+ const data = body ? JSON.parse(body) : {};
726
+ return {
727
+ data,
728
+ status: res.status,
729
+ headers: res.headers
730
+ };
731
+ };
732
+ const getUpdatePasswordMutationFetcher = (options) => {
733
+ return (_, { arg }) => {
734
+ return updatePassword(arg, options);
735
+ };
736
+ };
737
+ const getUpdatePasswordMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/update-password`];
738
+ const useUpdatePassword = (options) => {
739
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
740
+ const swrKey = swrOptions?.swrKey ?? getUpdatePasswordMutationKey();
741
+ const swrFn = getUpdatePasswordMutationFetcher(fetchOptions);
742
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
743
+ return {
744
+ swrKey,
745
+ ...query
746
+ };
747
+ };
748
+ const getRevokeAllSessionsUrl = () => {
749
+ return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
750
+ };
751
+ const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
752
+ const res = await fetch(getRevokeAllSessionsUrl(), {
753
+ ...options,
754
+ method: "DELETE",
755
+ headers: { "Content-Type": "application/json", ...options?.headers },
756
+ body: JSON.stringify(revokeAllSessionsRequest)
757
+ });
758
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
759
+ const data = body ? JSON.parse(body) : {};
760
+ return {
761
+ data,
762
+ status: res.status,
763
+ headers: res.headers
764
+ };
765
+ };
766
+ const getRevokeAllSessionsMutationFetcher = (options) => {
767
+ return (_, { arg }) => {
768
+ return revokeAllSessions(arg, options);
769
+ };
770
+ };
771
+ const getRevokeAllSessionsMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`];
772
+ const useRevokeAllSessions = (options) => {
773
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
774
+ const swrKey = swrOptions?.swrKey ?? getRevokeAllSessionsMutationKey();
775
+ const swrFn = getRevokeAllSessionsMutationFetcher(fetchOptions);
776
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
777
+ return {
778
+ swrKey,
779
+ ...query
780
+ };
781
+ };
782
+ const getRevokeSessionUrl = (sessionId) => {
783
+ return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;
784
+ };
785
+ const revokeSession = async (sessionId, options) => {
786
+ const res = await fetch(getRevokeSessionUrl(sessionId), {
787
+ ...options,
788
+ method: "DELETE"
789
+ });
790
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
791
+ const data = body ? JSON.parse(body) : {};
792
+ return {
793
+ data,
794
+ status: res.status,
795
+ headers: res.headers
796
+ };
797
+ };
798
+ const getRevokeSessionMutationFetcher = (sessionId, options) => {
799
+ return (_, __) => {
800
+ return revokeSession(sessionId, options);
801
+ };
802
+ };
803
+ const getRevokeSessionMutationKey = (sessionId) => [
804
+ `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`
805
+ ];
806
+ const useRevokeSession = (sessionId, options) => {
807
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
808
+ const swrKey = swrOptions?.swrKey ?? getRevokeSessionMutationKey(sessionId);
809
+ const swrFn = getRevokeSessionMutationFetcher(sessionId, fetchOptions);
810
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
811
+ return {
812
+ swrKey,
813
+ ...query
814
+ };
815
+ };
816
+ const getSessionsUrl = () => {
817
+ return `https://api.workos.com/_widgets/UserProfile/sessions`;
818
+ };
819
+ const sessions = async (options) => {
820
+ const res = await fetch(getSessionsUrl(), {
821
+ ...options,
822
+ method: "GET"
823
+ });
824
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
825
+ const data = body ? JSON.parse(body) : {};
826
+ return { data, status: res.status, headers: res.headers };
827
+ };
828
+ const getSessionsKey = () => [`https://api.workos.com/_widgets/UserProfile/sessions`];
829
+ const useSessions = (options) => {
830
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
831
+ const isEnabled = swrOptions?.enabled !== false;
832
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getSessionsKey() : null);
833
+ const swrFn = () => sessions(fetchOptions);
834
+ const query = useSwr(
835
+ swrKey,
836
+ swrFn,
837
+ swrOptions
838
+ );
839
+ return {
840
+ swrKey,
841
+ ...query
842
+ };
843
+ };
844
+ const getSendVerificationUrl = () => {
845
+ return `https://api.workos.com/_widgets/UserProfile/send-verification`;
846
+ };
847
+ const sendVerification = async (options) => {
848
+ const res = await fetch(getSendVerificationUrl(), {
849
+ ...options,
850
+ method: "POST"
851
+ });
852
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
853
+ const data = body ? JSON.parse(body) : {};
854
+ return {
855
+ data,
856
+ status: res.status,
857
+ headers: res.headers
858
+ };
859
+ };
860
+ const getSendVerificationMutationFetcher = (options) => {
861
+ return (_, __) => {
862
+ return sendVerification(options);
863
+ };
864
+ };
865
+ const getSendVerificationMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/send-verification`];
866
+ const useSendVerification = (options) => {
867
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
868
+ const swrKey = swrOptions?.swrKey ?? getSendVerificationMutationKey();
869
+ const swrFn = getSendVerificationMutationFetcher(fetchOptions);
870
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
871
+ return {
872
+ swrKey,
873
+ ...query
874
+ };
875
+ };
876
+ const getVerifyUrl = () => {
877
+ return `https://api.workos.com/_widgets/UserProfile/verify`;
878
+ };
879
+ const verify = async (verifyRequest, options) => {
880
+ const res = await fetch(getVerifyUrl(), {
881
+ ...options,
882
+ method: "POST",
883
+ headers: { "Content-Type": "application/json", ...options?.headers },
884
+ body: JSON.stringify(verifyRequest)
885
+ });
886
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
887
+ const data = body ? JSON.parse(body) : {};
888
+ return { data, status: res.status, headers: res.headers };
889
+ };
890
+ const getVerifyMutationFetcher = (options) => {
891
+ return (_, { arg }) => {
892
+ return verify(arg, options);
893
+ };
894
+ };
895
+ const getVerifyMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/verify`];
896
+ const useVerify = (options) => {
897
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
898
+ const swrKey = swrOptions?.swrKey ?? getVerifyMutationKey();
899
+ const swrFn = getVerifyMutationFetcher(fetchOptions);
900
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
901
+ return {
902
+ swrKey,
903
+ ...query
904
+ };
905
+ };
906
+ const getRegisterPasskeyUrl = () => {
907
+ return `https://api.workos.com/_widgets/UserProfile/passkeys`;
908
+ };
909
+ const registerPasskey = async (options) => {
910
+ const res = await fetch(getRegisterPasskeyUrl(), {
911
+ ...options,
912
+ method: "POST"
913
+ });
914
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
915
+ const data = body ? JSON.parse(body) : {};
916
+ return {
917
+ data,
918
+ status: res.status,
919
+ headers: res.headers
920
+ };
921
+ };
922
+ const getRegisterPasskeyMutationFetcher = (options) => {
923
+ return (_, __) => {
924
+ return registerPasskey(options);
925
+ };
926
+ };
927
+ const getRegisterPasskeyMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/passkeys`];
928
+ const useRegisterPasskey = (options) => {
929
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
930
+ const swrKey = swrOptions?.swrKey ?? getRegisterPasskeyMutationKey();
931
+ const swrFn = getRegisterPasskeyMutationFetcher(fetchOptions);
932
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
933
+ return {
934
+ swrKey,
935
+ ...query
936
+ };
937
+ };
938
+ const getVerifyPasskeyUrl = () => {
939
+ return `https://api.workos.com/_widgets/UserProfile/passkeys/verify`;
940
+ };
941
+ const verifyPasskey = async (verifyPasskeyRequest, options) => {
942
+ const res = await fetch(getVerifyPasskeyUrl(), {
943
+ ...options,
944
+ method: "POST",
945
+ headers: { "Content-Type": "application/json", ...options?.headers },
946
+ body: JSON.stringify(verifyPasskeyRequest)
947
+ });
948
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
949
+ const data = body ? JSON.parse(body) : {};
950
+ return {
951
+ data,
952
+ status: res.status,
953
+ headers: res.headers
954
+ };
955
+ };
956
+ const getVerifyPasskeyMutationFetcher = (options) => {
957
+ return (_, { arg }) => {
958
+ return verifyPasskey(arg, options);
959
+ };
960
+ };
961
+ const getVerifyPasskeyMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/passkeys/verify`];
962
+ const useVerifyPasskey = (options) => {
963
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
964
+ const swrKey = swrOptions?.swrKey ?? getVerifyPasskeyMutationKey();
965
+ const swrFn = getVerifyPasskeyMutationFetcher(fetchOptions);
966
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
967
+ return {
968
+ swrKey,
969
+ ...query
970
+ };
971
+ };
972
+ const getDeletePasskeyUrl = (passkeyId) => {
973
+ return `https://api.workos.com/_widgets/UserProfile/passkeys/${passkeyId}`;
974
+ };
975
+ const deletePasskey = async (passkeyId, options) => {
976
+ const res = await fetch(getDeletePasskeyUrl(passkeyId), {
977
+ ...options,
978
+ method: "DELETE"
979
+ });
980
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
981
+ const data = body ? JSON.parse(body) : {};
982
+ return {
983
+ data,
984
+ status: res.status,
985
+ headers: res.headers
986
+ };
987
+ };
988
+ const getDeletePasskeyMutationFetcher = (passkeyId, options) => {
989
+ return (_, __) => {
990
+ return deletePasskey(passkeyId, options);
991
+ };
992
+ };
993
+ const getDeletePasskeyMutationKey = (passkeyId) => [
994
+ `https://api.workos.com/_widgets/UserProfile/passkeys/${passkeyId}`
995
+ ];
996
+ const useDeletePasskey = (passkeyId, options) => {
997
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
998
+ const swrKey = swrOptions?.swrKey ?? getDeletePasskeyMutationKey(passkeyId);
999
+ const swrFn = getDeletePasskeyMutationFetcher(passkeyId, fetchOptions);
1000
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
1001
+ return {
1002
+ swrKey,
1003
+ ...query
1004
+ };
1005
+ };
1006
+ const getSettingsUrl = () => {
1007
+ return `https://api.workos.com/_widgets/settings`;
1008
+ };
1009
+ const settings = async (options) => {
1010
+ const res = await fetch(getSettingsUrl(), {
1011
+ ...options,
1012
+ method: "GET"
1013
+ });
1014
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1015
+ const data = body ? JSON.parse(body) : {};
1016
+ return { data, status: res.status, headers: res.headers };
1017
+ };
1018
+ const getSettingsKey = () => [`https://api.workos.com/_widgets/settings`];
1019
+ const useSettings = (options) => {
1020
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1021
+ const isEnabled = swrOptions?.enabled !== false;
1022
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getSettingsKey() : null);
1023
+ const swrFn = () => settings(fetchOptions);
1024
+ const query = useSwr(
1025
+ swrKey,
1026
+ swrFn,
1027
+ swrOptions
1028
+ );
1029
+ return {
1030
+ swrKey,
1031
+ ...query
1032
+ };
1033
+ };
1034
+ const getListOrganizationDomainsUrl = () => {
1035
+ return `https://api.workos.com/_widgets/admin-portal/organization-domains`;
1036
+ };
1037
+ const listOrganizationDomains = async (options) => {
1038
+ const res = await fetch(getListOrganizationDomainsUrl(), {
1039
+ ...options,
1040
+ method: "GET"
1041
+ });
1042
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1043
+ const data = body ? JSON.parse(body) : {};
1044
+ return {
1045
+ data,
1046
+ status: res.status,
1047
+ headers: res.headers
1048
+ };
1049
+ };
1050
+ const getListOrganizationDomainsKey = () => [
1051
+ `https://api.workos.com/_widgets/admin-portal/organization-domains`
1052
+ ];
1053
+ const useListOrganizationDomains = (options) => {
1054
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1055
+ const isEnabled = swrOptions?.enabled !== false;
1056
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListOrganizationDomainsKey() : null);
1057
+ const swrFn = () => listOrganizationDomains(fetchOptions);
1058
+ const query = useSwr(
1059
+ swrKey,
1060
+ swrFn,
1061
+ swrOptions
1062
+ );
1063
+ return {
1064
+ swrKey,
1065
+ ...query
1066
+ };
1067
+ };
1068
+ const getGenerateAdminPortalLinkUrl = (params) => {
1069
+ const normalizedParams = new URLSearchParams();
1070
+ Object.entries(params || {}).forEach(([key, value]) => {
1071
+ if (value !== void 0) {
1072
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1073
+ }
1074
+ });
1075
+ const stringifiedParams = normalizedParams.toString();
1076
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
1077
+ };
1078
+ const generateAdminPortalLink = async (params, options) => {
1079
+ const res = await fetch(getGenerateAdminPortalLinkUrl(params), {
1080
+ ...options,
1081
+ method: "POST"
1082
+ });
1083
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1084
+ const data = body ? JSON.parse(body) : {};
1085
+ return {
1086
+ data,
1087
+ status: res.status,
1088
+ headers: res.headers
1089
+ };
1090
+ };
1091
+ const getGenerateAdminPortalLinkMutationFetcher = (params, options) => {
1092
+ return (_, __) => {
1093
+ return generateAdminPortalLink(params, options);
1094
+ };
1095
+ };
1096
+ const getGenerateAdminPortalLinkMutationKey = (params) => [
1097
+ `https://api.workos.com/_widgets/admin-portal/generate-link`,
1098
+ ...params ? [params] : []
1099
+ ];
1100
+ const useGenerateAdminPortalLink = (params, options) => {
1101
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1102
+ const swrKey = swrOptions?.swrKey ?? getGenerateAdminPortalLinkMutationKey(params);
1103
+ const swrFn = getGenerateAdminPortalLinkMutationFetcher(params, fetchOptions);
1104
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
1105
+ return {
1106
+ swrKey,
1107
+ ...query
1108
+ };
1109
+ };
1110
+ const getDeleteOrganizationDomainUrl = (domainId) => {
1111
+ return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;
1112
+ };
1113
+ const deleteOrganizationDomain = async (domainId, options) => {
1114
+ const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {
1115
+ ...options,
1116
+ method: "DELETE"
1117
+ });
1118
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1119
+ const data = body ? JSON.parse(body) : {};
1120
+ return {
1121
+ data,
1122
+ status: res.status,
1123
+ headers: res.headers
1124
+ };
1125
+ };
1126
+ const getDeleteOrganizationDomainMutationFetcher = (domainId, options) => {
1127
+ return (_, __) => {
1128
+ return deleteOrganizationDomain(domainId, options);
1129
+ };
1130
+ };
1131
+ const getDeleteOrganizationDomainMutationKey = (domainId) => [
1132
+ `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`
1133
+ ];
1134
+ const useDeleteOrganizationDomain = (domainId, options) => {
1135
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1136
+ const swrKey = swrOptions?.swrKey ?? getDeleteOrganizationDomainMutationKey(domainId);
1137
+ const swrFn = getDeleteOrganizationDomainMutationFetcher(
1138
+ domainId,
1139
+ fetchOptions
1140
+ );
1141
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
1142
+ return {
1143
+ swrKey,
1144
+ ...query
1145
+ };
1146
+ };
1147
+ const getReverifyOrganizationDomainUrl = (domainId) => {
1148
+ return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;
1149
+ };
1150
+ const reverifyOrganizationDomain = async (domainId, options) => {
1151
+ const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {
1152
+ ...options,
1153
+ method: "POST"
1154
+ });
1155
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1156
+ const data = body ? JSON.parse(body) : {};
1157
+ return {
1158
+ data,
1159
+ status: res.status,
1160
+ headers: res.headers
1161
+ };
1162
+ };
1163
+ const getReverifyOrganizationDomainMutationFetcher = (domainId, options) => {
1164
+ return (_, __) => {
1165
+ return reverifyOrganizationDomain(domainId, options);
1166
+ };
1167
+ };
1168
+ const getReverifyOrganizationDomainMutationKey = (domainId) => [
1169
+ `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`
1170
+ ];
1171
+ const useReverifyOrganizationDomain = (domainId, options) => {
1172
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1173
+ const swrKey = swrOptions?.swrKey ?? getReverifyOrganizationDomainMutationKey(domainId);
1174
+ const swrFn = getReverifyOrganizationDomainMutationFetcher(
1175
+ domainId,
1176
+ fetchOptions
1177
+ );
1178
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
1179
+ return {
1180
+ swrKey,
1181
+ ...query
1182
+ };
1183
+ };
1184
+ const getListSsoConnectionsUrl = () => {
1185
+ return `https://api.workos.com/_widgets/admin-portal/sso-connections`;
1186
+ };
1187
+ const listSsoConnections = async (options) => {
1188
+ const res = await fetch(getListSsoConnectionsUrl(), {
1189
+ ...options,
1190
+ method: "GET"
1191
+ });
1192
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1193
+ const data = body ? JSON.parse(body) : {};
1194
+ return {
1195
+ data,
1196
+ status: res.status,
1197
+ headers: res.headers
1198
+ };
1199
+ };
1200
+ const getListSsoConnectionsKey = () => [`https://api.workos.com/_widgets/admin-portal/sso-connections`];
1201
+ const useListSsoConnections = (options) => {
1202
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1203
+ const isEnabled = swrOptions?.enabled !== false;
1204
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListSsoConnectionsKey() : null);
1205
+ const swrFn = () => listSsoConnections(fetchOptions);
1206
+ const query = useSwr(
1207
+ swrKey,
1208
+ swrFn,
1209
+ swrOptions
1210
+ );
1211
+ return {
1212
+ swrKey,
1213
+ ...query
1214
+ };
1215
+ };
1216
+ const getCreateOrganizationApiKeyUrl = () => {
1217
+ return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
1218
+ };
1219
+ const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options) => {
1220
+ const res = await fetch(getCreateOrganizationApiKeyUrl(), {
1221
+ ...options,
1222
+ method: "POST",
1223
+ headers: { "Content-Type": "application/json", ...options?.headers },
1224
+ body: JSON.stringify(createOrganizationApiKeyRequest)
1225
+ });
1226
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1227
+ const data = body ? JSON.parse(body) : {};
1228
+ return {
1229
+ data,
1230
+ status: res.status,
1231
+ headers: res.headers
1232
+ };
1233
+ };
1234
+ const getCreateOrganizationApiKeyMutationFetcher = (options) => {
1235
+ return (_, { arg }) => {
1236
+ return createOrganizationApiKey(arg, options);
1237
+ };
1238
+ };
1239
+ const getCreateOrganizationApiKeyMutationKey = () => [`https://api.workos.com/_widgets/ApiKeys/organization-api-keys`];
1240
+ const useCreateOrganizationApiKey = (options) => {
1241
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1242
+ const swrKey = swrOptions?.swrKey ?? getCreateOrganizationApiKeyMutationKey();
1243
+ const swrFn = getCreateOrganizationApiKeyMutationFetcher(fetchOptions);
1244
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
1245
+ return {
1246
+ swrKey,
1247
+ ...query
1248
+ };
1249
+ };
1250
+ const getListOrganizationApiKeysUrl = (params) => {
1251
+ const normalizedParams = new URLSearchParams();
1252
+ Object.entries(params || {}).forEach(([key, value]) => {
1253
+ if (value !== void 0) {
1254
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1255
+ }
1256
+ });
1257
+ const stringifiedParams = normalizedParams.toString();
1258
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
1259
+ };
1260
+ const listOrganizationApiKeys = async (params, options) => {
1261
+ const res = await fetch(getListOrganizationApiKeysUrl(params), {
1262
+ ...options,
1263
+ method: "GET"
1264
+ });
1265
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1266
+ const data = body ? JSON.parse(body) : {};
1267
+ return {
1268
+ data,
1269
+ status: res.status,
1270
+ headers: res.headers
1271
+ };
1272
+ };
1273
+ const getListOrganizationApiKeysKey = (params) => [
1274
+ `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`,
1275
+ ...params ? [params] : []
1276
+ ];
1277
+ const useListOrganizationApiKeys = (params, options) => {
1278
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1279
+ const isEnabled = swrOptions?.enabled !== false;
1280
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListOrganizationApiKeysKey(params) : null);
1281
+ const swrFn = () => listOrganizationApiKeys(params, fetchOptions);
1282
+ const query = useSwr(
1283
+ swrKey,
1284
+ swrFn,
1285
+ swrOptions
1286
+ );
1287
+ return {
1288
+ swrKey,
1289
+ ...query
1290
+ };
1291
+ };
1292
+ const getListOrganizationApiKeyPermissionsUrl = (params) => {
1293
+ const normalizedParams = new URLSearchParams();
1294
+ Object.entries(params || {}).forEach(([key, value]) => {
1295
+ if (value !== void 0) {
1296
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1297
+ }
1298
+ });
1299
+ const stringifiedParams = normalizedParams.toString();
1300
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
1301
+ };
1302
+ const listOrganizationApiKeyPermissions = async (params, options) => {
1303
+ const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {
1304
+ ...options,
1305
+ method: "GET"
1306
+ });
1307
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1308
+ const data = body ? JSON.parse(body) : {};
1309
+ return {
1310
+ data,
1311
+ status: res.status,
1312
+ headers: res.headers
1313
+ };
1314
+ };
1315
+ const getListOrganizationApiKeyPermissionsKey = (params) => [
1316
+ `https://api.workos.com/_widgets/ApiKeys/permissions`,
1317
+ ...params ? [params] : []
1318
+ ];
1319
+ const useListOrganizationApiKeyPermissions = (params, options) => {
1320
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1321
+ const isEnabled = swrOptions?.enabled !== false;
1322
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListOrganizationApiKeyPermissionsKey(params) : null);
1323
+ const swrFn = () => listOrganizationApiKeyPermissions(params, fetchOptions);
1324
+ const query = useSwr(
1325
+ swrKey,
1326
+ swrFn,
1327
+ swrOptions
1328
+ );
1329
+ return {
1330
+ swrKey,
1331
+ ...query
1332
+ };
1333
+ };
1334
+ const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
1335
+ return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
1336
+ };
1337
+ const deleteOrganizationApiKey = async (apiKeyId, options) => {
1338
+ const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {
1339
+ ...options,
1340
+ method: "DELETE"
1341
+ });
1342
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1343
+ const data = body ? JSON.parse(body) : {};
1344
+ return {
1345
+ data,
1346
+ status: res.status,
1347
+ headers: res.headers
1348
+ };
1349
+ };
1350
+ const getDeleteOrganizationApiKeyMutationFetcher = (apiKeyId, options) => {
1351
+ return (_, __) => {
1352
+ return deleteOrganizationApiKey(apiKeyId, options);
1353
+ };
1354
+ };
1355
+ const getDeleteOrganizationApiKeyMutationKey = (apiKeyId) => [`https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`];
1356
+ const useDeleteOrganizationApiKey = (apiKeyId, options) => {
1357
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1358
+ const swrKey = swrOptions?.swrKey ?? getDeleteOrganizationApiKeyMutationKey(apiKeyId);
1359
+ const swrFn = getDeleteOrganizationApiKeyMutationFetcher(
1360
+ apiKeyId,
1361
+ fetchOptions
1362
+ );
1363
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
1364
+ return {
1365
+ swrKey,
1366
+ ...query
1367
+ };
1368
+ };
1369
+ const getMyDataIntegrationsUrl = () => {
1370
+ return `https://api.workos.com/_widgets/DataIntegrations/mine`;
1371
+ };
1372
+ const myDataIntegrations = async (options) => {
1373
+ const res = await fetch(getMyDataIntegrationsUrl(), {
1374
+ ...options,
1375
+ method: "GET"
1376
+ });
1377
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1378
+ const data = body ? JSON.parse(body) : {};
1379
+ return {
1380
+ data,
1381
+ status: res.status,
1382
+ headers: res.headers
1383
+ };
1384
+ };
1385
+ const getMyDataIntegrationsKey = () => [`https://api.workos.com/_widgets/DataIntegrations/mine`];
1386
+ const useMyDataIntegrations = (options) => {
1387
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1388
+ const isEnabled = swrOptions?.enabled !== false;
1389
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getMyDataIntegrationsKey() : null);
1390
+ const swrFn = () => myDataIntegrations(fetchOptions);
1391
+ const query = useSwr(
1392
+ swrKey,
1393
+ swrFn,
1394
+ swrOptions
1395
+ );
1396
+ return {
1397
+ swrKey,
1398
+ ...query
1399
+ };
1400
+ };
1401
+ const getGetDataIntegrationAuthorizeUrlUrl = (slug, params) => {
1402
+ const normalizedParams = new URLSearchParams();
1403
+ Object.entries(params || {}).forEach(([key, value]) => {
1404
+ if (value !== void 0) {
1405
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1406
+ }
1407
+ });
1408
+ const stringifiedParams = normalizedParams.toString();
1409
+ return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
1410
+ };
1411
+ const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
1412
+ const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {
1413
+ ...options,
1414
+ method: "GET"
1415
+ });
1416
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1417
+ const data = body ? JSON.parse(body) : {};
1418
+ return {
1419
+ data,
1420
+ status: res.status,
1421
+ headers: res.headers
1422
+ };
1423
+ };
1424
+ const getGetDataIntegrationAuthorizeUrlKey = (slug, params) => [
1425
+ `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`,
1426
+ ...params ? [params] : []
1427
+ ];
1428
+ const useGetDataIntegrationAuthorizeUrl = (slug, params, options) => {
1429
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1430
+ const isEnabled = swrOptions?.enabled !== false && !!slug;
1431
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetDataIntegrationAuthorizeUrlKey(slug, params) : null);
1432
+ const swrFn = () => getDataIntegrationAuthorizeUrl(slug, params, fetchOptions);
1433
+ const query = useSwr(
1434
+ swrKey,
1435
+ swrFn,
1436
+ swrOptions
1437
+ );
1438
+ return {
1439
+ swrKey,
1440
+ ...query
1441
+ };
1442
+ };
1443
+ const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
1444
+ return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
1445
+ };
1446
+ const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state, options) => {
1447
+ const res = await fetch(
1448
+ getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),
1449
+ {
1450
+ ...options,
1451
+ method: "GET"
1452
+ }
1453
+ );
1454
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1455
+ const data = body ? JSON.parse(body) : {};
1456
+ return {
1457
+ data,
1458
+ status: res.status,
1459
+ headers: res.headers
1460
+ };
1461
+ };
1462
+ const getGetDataInstallationAuthorizationStatusKey = (dataIntegrationId, state) => [
1463
+ `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`
1464
+ ];
1465
+ const useGetDataInstallationAuthorizationStatus = (dataIntegrationId, state, options) => {
1466
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1467
+ const isEnabled = swrOptions?.enabled !== false && !!(dataIntegrationId && state);
1468
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetDataInstallationAuthorizationStatusKey(dataIntegrationId, state) : null);
1469
+ const swrFn = () => getDataInstallationAuthorizationStatus(
1470
+ dataIntegrationId,
1471
+ state,
1472
+ fetchOptions
1473
+ );
1474
+ const query = useSwr(
1475
+ swrKey,
1476
+ swrFn,
1477
+ swrOptions
1478
+ );
1479
+ return {
1480
+ swrKey,
1481
+ ...query
1482
+ };
1483
+ };
1484
+ const getDeleteDataInstallationUrl = (installationId) => {
1485
+ return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;
1486
+ };
1487
+ const deleteDataInstallation = async (installationId, options) => {
1488
+ const res = await fetch(getDeleteDataInstallationUrl(installationId), {
1489
+ ...options,
1490
+ method: "DELETE"
1491
+ });
1492
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1493
+ const data = body ? JSON.parse(body) : {};
1494
+ return {
1495
+ data,
1496
+ status: res.status,
1497
+ headers: res.headers
1498
+ };
1499
+ };
1500
+ const getDeleteDataInstallationMutationFetcher = (installationId, options) => {
1501
+ return (_, __) => {
1502
+ return deleteDataInstallation(installationId, options);
1503
+ };
1504
+ };
1505
+ const getDeleteDataInstallationMutationKey = (installationId) => [
1506
+ `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`
1507
+ ];
1508
+ const useDeleteDataInstallation = (installationId, options) => {
1509
+ const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
1510
+ const swrKey = swrOptions?.swrKey ?? getDeleteDataInstallationMutationKey(installationId);
1511
+ const swrFn = getDeleteDataInstallationMutationFetcher(
1512
+ installationId,
1513
+ fetchOptions
1514
+ );
1515
+ const query = useSWRMutation(swrKey, swrFn, swrOptions);
1516
+ return {
1517
+ swrKey,
1518
+ ...query
1519
+ };
1520
+ };
1521
+ export {
1522
+ AuthenticationInformationResponseDataVerificationMethodsMfaProvider,
1523
+ AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider,
1524
+ AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
1525
+ CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
1526
+ CreateTotpFactorResponseAuthenticationFactorAllOfObject,
1527
+ CreateTotpFactorResponseAuthenticationFactorAllOfType,
1528
+ DataInstallationObject,
1529
+ DataInstallationState,
1530
+ DataIntegrationCredentialsType,
1531
+ DataIntegrationIntegrationType,
1532
+ DataIntegrationObject,
1533
+ DataIntegrationOwnership,
1534
+ DomainVerificationNameServer,
1535
+ GenerateAdminPortalLinkIntent,
1536
+ MemberActionsItem,
1537
+ MemberStatus,
1538
+ OidcSessionState,
1539
+ OrganizationDomainState,
1540
+ SamlSessionState,
1541
+ SendVerificationResponseType,
1542
+ SettingsResponseObject,
1543
+ SsoConnectionAnyOfEightAllOfProviderTag,
1544
+ SsoConnectionAnyOfEightAllOfState,
1545
+ SsoConnectionAnyOfEightAllOfType,
1546
+ SsoConnectionAnyOfProviderTag,
1547
+ SsoConnectionAnyOfState,
1548
+ SsoConnectionAnyOfType,
1549
+ SsoConnectionSessionJSONState,
1550
+ authenticationInformation,
1551
+ createOrganizationApiKey,
1552
+ createPassword,
1553
+ createTotpFactor,
1554
+ deleteDataInstallation,
1555
+ deleteOrganizationApiKey,
1556
+ deleteOrganizationDomain,
1557
+ deletePasskey,
1558
+ deleteTotpFactors,
1559
+ generateAdminPortalLink,
1560
+ getAuthenticationInformationKey,
1561
+ getAuthenticationInformationUrl,
1562
+ getCreateOrganizationApiKeyMutationFetcher,
1563
+ getCreateOrganizationApiKeyMutationKey,
1564
+ getCreateOrganizationApiKeyUrl,
1565
+ getCreatePasswordMutationFetcher,
1566
+ getCreatePasswordMutationKey,
1567
+ getCreatePasswordUrl,
1568
+ getCreateTotpFactorMutationFetcher,
1569
+ getCreateTotpFactorMutationKey,
1570
+ getCreateTotpFactorUrl,
1571
+ getDataInstallationAuthorizationStatus,
1572
+ getDataIntegrationAuthorizeUrl,
1573
+ getDeleteDataInstallationMutationFetcher,
1574
+ getDeleteDataInstallationMutationKey,
1575
+ getDeleteDataInstallationUrl,
1576
+ getDeleteOrganizationApiKeyMutationFetcher,
1577
+ getDeleteOrganizationApiKeyMutationKey,
1578
+ getDeleteOrganizationApiKeyUrl,
1579
+ getDeleteOrganizationDomainMutationFetcher,
1580
+ getDeleteOrganizationDomainMutationKey,
1581
+ getDeleteOrganizationDomainUrl,
1582
+ getDeletePasskeyMutationFetcher,
1583
+ getDeletePasskeyMutationKey,
1584
+ getDeletePasskeyUrl,
1585
+ getDeleteTotpFactorsMutationFetcher,
1586
+ getDeleteTotpFactorsMutationKey,
1587
+ getDeleteTotpFactorsUrl,
1588
+ getGenerateAdminPortalLinkMutationFetcher,
1589
+ getGenerateAdminPortalLinkMutationKey,
1590
+ getGenerateAdminPortalLinkUrl,
1591
+ getGetDataInstallationAuthorizationStatusKey,
1592
+ getGetDataInstallationAuthorizationStatusUrl,
1593
+ getGetDataIntegrationAuthorizeUrlKey,
1594
+ getGetDataIntegrationAuthorizeUrlUrl,
1595
+ getInviteMemberMutationFetcher,
1596
+ getInviteMemberMutationKey,
1597
+ getInviteMemberUrl,
1598
+ getListOrganizationApiKeyPermissionsKey,
1599
+ getListOrganizationApiKeyPermissionsUrl,
1600
+ getListOrganizationApiKeysKey,
1601
+ getListOrganizationApiKeysUrl,
1602
+ getListOrganizationDomainsKey,
1603
+ getListOrganizationDomainsUrl,
1604
+ getListSsoConnectionsKey,
1605
+ getListSsoConnectionsUrl,
1606
+ getMeKey,
1607
+ getMeUrl,
1608
+ getMembersKey,
1609
+ getMembersUrl,
1610
+ getMyDataIntegrationsKey,
1611
+ getMyDataIntegrationsUrl,
1612
+ getOrganizationsKey,
1613
+ getOrganizationsUrl,
1614
+ getRegisterPasskeyMutationFetcher,
1615
+ getRegisterPasskeyMutationKey,
1616
+ getRegisterPasskeyUrl,
1617
+ getRemoveMemberMutationFetcher,
1618
+ getRemoveMemberMutationKey,
1619
+ getRemoveMemberUrl,
1620
+ getResendInviteMutationFetcher,
1621
+ getResendInviteMutationKey,
1622
+ getResendInviteUrl,
1623
+ getReverifyOrganizationDomainMutationFetcher,
1624
+ getReverifyOrganizationDomainMutationKey,
1625
+ getReverifyOrganizationDomainUrl,
1626
+ getRevokeAllSessionsMutationFetcher,
1627
+ getRevokeAllSessionsMutationKey,
1628
+ getRevokeAllSessionsUrl,
1629
+ getRevokeInviteMutationFetcher,
1630
+ getRevokeInviteMutationKey,
1631
+ getRevokeInviteUrl,
1632
+ getRevokeSessionMutationFetcher,
1633
+ getRevokeSessionMutationKey,
1634
+ getRevokeSessionUrl,
1635
+ getRolesAndConfigKey,
1636
+ getRolesAndConfigUrl,
1637
+ getRolesKey,
1638
+ getRolesUrl,
1639
+ getSendVerificationMutationFetcher,
1640
+ getSendVerificationMutationKey,
1641
+ getSendVerificationUrl,
1642
+ getSessionsKey,
1643
+ getSessionsUrl,
1644
+ getSettingsKey,
1645
+ getSettingsUrl,
1646
+ getUpdateMeMutationFetcher,
1647
+ getUpdateMeMutationKey,
1648
+ getUpdateMeUrl,
1649
+ getUpdateMemberMutationFetcher,
1650
+ getUpdateMemberMutationKey,
1651
+ getUpdateMemberUrl,
1652
+ getUpdatePasswordMutationFetcher,
1653
+ getUpdatePasswordMutationKey,
1654
+ getUpdatePasswordUrl,
1655
+ getVerifyMutationFetcher,
1656
+ getVerifyMutationKey,
1657
+ getVerifyPasskeyMutationFetcher,
1658
+ getVerifyPasskeyMutationKey,
1659
+ getVerifyPasskeyUrl,
1660
+ getVerifyTotpFactorMutationFetcher,
1661
+ getVerifyTotpFactorMutationKey,
1662
+ getVerifyTotpFactorUrl,
1663
+ getVerifyUrl,
1664
+ inviteMember,
1665
+ listOrganizationApiKeyPermissions,
1666
+ listOrganizationApiKeys,
1667
+ listOrganizationDomains,
1668
+ listSsoConnections,
1669
+ me,
1670
+ members,
1671
+ myDataIntegrations,
1672
+ organizations,
1673
+ registerPasskey,
1674
+ removeMember,
1675
+ resendInvite,
1676
+ reverifyOrganizationDomain,
1677
+ revokeAllSessions,
1678
+ revokeInvite,
1679
+ revokeSession,
1680
+ roles,
1681
+ rolesAndConfig,
1682
+ sendVerification,
1683
+ sessions,
1684
+ settings,
1685
+ updateMe,
1686
+ updateMember,
1687
+ updatePassword,
1688
+ useAuthenticationInformation,
1689
+ useCreateOrganizationApiKey,
1690
+ useCreatePassword,
1691
+ useCreateTotpFactor,
1692
+ useDeleteDataInstallation,
1693
+ useDeleteOrganizationApiKey,
1694
+ useDeleteOrganizationDomain,
1695
+ useDeletePasskey,
1696
+ useDeleteTotpFactors,
1697
+ useGenerateAdminPortalLink,
1698
+ useGetDataInstallationAuthorizationStatus,
1699
+ useGetDataIntegrationAuthorizeUrl,
1700
+ useInviteMember,
1701
+ useListOrganizationApiKeyPermissions,
1702
+ useListOrganizationApiKeys,
1703
+ useListOrganizationDomains,
1704
+ useListSsoConnections,
1705
+ useMe,
1706
+ useMembers,
1707
+ useMyDataIntegrations,
1708
+ useOrganizations,
1709
+ useRegisterPasskey,
1710
+ useRemoveMember,
1711
+ useResendInvite,
1712
+ useReverifyOrganizationDomain,
1713
+ useRevokeAllSessions,
1714
+ useRevokeInvite,
1715
+ useRevokeSession,
1716
+ useRoles,
1717
+ useRolesAndConfig,
1718
+ useSendVerification,
1719
+ useSessions,
1720
+ useSettings,
1721
+ useUpdateMe,
1722
+ useUpdateMember,
1723
+ useUpdatePassword,
1724
+ useVerify,
1725
+ useVerifyPasskey,
1726
+ useVerifyTotpFactor,
1727
+ verify,
1728
+ verifyPasskey,
1729
+ verifyTotpFactor
1730
+ };
1731
+ //# sourceMappingURL=swr.js.map