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