@workos-inc/widgets 1.8.2 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cjs/admin-portal-domain-verification.client.cjs.map +1 -1
- package/dist/cjs/admin-portal-sso-connection.client.cjs +4 -7
- package/dist/cjs/admin-portal-sso-connection.client.cjs.map +1 -1
- package/dist/cjs/api/api-provider.cjs.map +1 -1
- package/dist/cjs/api/api-provider.d.cts +1 -1
- package/dist/cjs/api/endpoint.cjs +741 -771
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +860 -813
- package/dist/cjs/directory-sync.client.cjs +156 -0
- package/dist/cjs/directory-sync.client.cjs.map +1 -0
- package/dist/cjs/directory-sync.client.d.cts +26 -0
- package/dist/cjs/experimental/api/fetch.cjs +327 -411
- package/dist/cjs/experimental/api/fetch.cjs.map +1 -1
- package/dist/cjs/experimental/api/fetch.d.cts +832 -798
- package/dist/cjs/experimental/api/react-query.cjs +747 -777
- package/dist/cjs/experimental/api/react-query.cjs.map +1 -1
- package/dist/cjs/experimental/api/react-query.d.cts +1378 -1263
- package/dist/cjs/experimental/api/swr.cjs +720 -742
- package/dist/cjs/experimental/api/swr.cjs.map +1 -1
- package/dist/cjs/experimental/api/swr.d.cts +1218 -1175
- package/dist/cjs/index.cjs +5 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -0
- package/dist/cjs/lib/add-mfa-dialog.cjs +18 -16
- package/dist/cjs/lib/add-mfa-dialog.cjs.map +1 -1
- package/dist/cjs/lib/admin-portal-sso-connection.cjs +0 -8
- package/dist/cjs/lib/admin-portal-sso-connection.cjs.map +1 -1
- package/dist/cjs/lib/admin-portal-sso-connection.d.cts +1 -2
- package/dist/cjs/lib/api-keys/api-keys-context.cjs +1 -1
- package/dist/cjs/lib/api-keys/api-keys-context.cjs.map +1 -1
- package/dist/cjs/lib/api-keys/api-keys-table.cjs +7 -5
- package/dist/cjs/lib/api-keys/api-keys-table.cjs.map +1 -1
- package/dist/cjs/lib/directory-sync.cjs +288 -0
- package/dist/cjs/lib/directory-sync.cjs.map +1 -0
- package/dist/cjs/lib/directory-sync.d.cts +72 -0
- package/dist/cjs/lib/identity-providers.cjs +57 -1
- package/dist/cjs/lib/identity-providers.cjs.map +1 -1
- package/dist/cjs/lib/identity-providers.d.cts +5 -3
- package/dist/cjs/lib/pipes.cjs +9 -9
- package/dist/cjs/lib/pipes.cjs.map +1 -1
- package/dist/cjs/lib/provider-icon.cjs.map +1 -1
- package/dist/cjs/lib/provider-icon.d.cts +2 -2
- package/dist/cjs/lib/reset-mfa-dialog.cjs +2 -1
- package/dist/cjs/lib/reset-mfa-dialog.cjs.map +1 -1
- package/dist/cjs/lib/use-permissions.cjs.map +1 -1
- package/dist/cjs/lib/use-permissions.d.cts +1 -1
- package/dist/cjs/lib/users-management-context.cjs +1 -1
- package/dist/cjs/lib/users-management-context.cjs.map +1 -1
- package/dist/cjs/lib/users-management.cjs +3 -3
- package/dist/cjs/lib/users-management.cjs.map +1 -1
- package/dist/cjs/lib/utils.cjs +9 -0
- package/dist/cjs/lib/utils.cjs.map +1 -1
- package/dist/cjs/lib/utils.d.cts +16 -2
- package/dist/cjs/workos-widgets.client.cjs +13 -1
- package/dist/cjs/workos-widgets.client.cjs.map +1 -1
- package/dist/esm/admin-portal-domain-verification.client.js +2 -2
- package/dist/esm/admin-portal-domain-verification.client.js.map +1 -1
- package/dist/esm/admin-portal-sso-connection.client.js +6 -9
- package/dist/esm/admin-portal-sso-connection.client.js.map +1 -1
- package/dist/esm/api/api-provider.d.ts +1 -1
- package/dist/esm/api/api-provider.js.map +1 -1
- package/dist/esm/api/endpoint.d.ts +860 -813
- package/dist/esm/api/endpoint.js +727 -751
- package/dist/esm/api/endpoint.js.map +1 -1
- package/dist/esm/directory-sync.client.d.ts +26 -0
- package/dist/esm/directory-sync.client.js +134 -0
- package/dist/esm/directory-sync.client.js.map +1 -0
- package/dist/esm/experimental/api/fetch.d.ts +832 -798
- package/dist/esm/experimental/api/fetch.js +319 -391
- package/dist/esm/experimental/api/fetch.js.map +1 -1
- package/dist/esm/experimental/api/react-query.d.ts +1378 -1263
- package/dist/esm/experimental/api/react-query.js +730 -757
- package/dist/esm/experimental/api/react-query.js.map +1 -1
- package/dist/esm/experimental/api/swr.d.ts +1218 -1175
- package/dist/esm/experimental/api/swr.js +706 -722
- package/dist/esm/experimental/api/swr.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/add-mfa-dialog.js +18 -16
- package/dist/esm/lib/add-mfa-dialog.js.map +1 -1
- package/dist/esm/lib/admin-portal-sso-connection.d.ts +1 -2
- package/dist/esm/lib/admin-portal-sso-connection.js +0 -8
- package/dist/esm/lib/admin-portal-sso-connection.js.map +1 -1
- package/dist/esm/lib/api-keys/api-keys-context.js +1 -1
- package/dist/esm/lib/api-keys/api-keys-context.js.map +1 -1
- package/dist/esm/lib/api-keys/api-keys-table.js +7 -5
- package/dist/esm/lib/api-keys/api-keys-table.js.map +1 -1
- package/dist/esm/lib/directory-sync.d.ts +72 -0
- package/dist/esm/lib/directory-sync.js +259 -0
- package/dist/esm/lib/directory-sync.js.map +1 -0
- package/dist/esm/lib/identity-providers.d.ts +5 -3
- package/dist/esm/lib/identity-providers.js +55 -1
- package/dist/esm/lib/identity-providers.js.map +1 -1
- package/dist/esm/lib/pipes.js +9 -10
- package/dist/esm/lib/pipes.js.map +1 -1
- package/dist/esm/lib/provider-icon.d.ts +2 -2
- package/dist/esm/lib/provider-icon.js.map +1 -1
- package/dist/esm/lib/reset-mfa-dialog.js +2 -1
- package/dist/esm/lib/reset-mfa-dialog.js.map +1 -1
- package/dist/esm/lib/use-permissions.d.ts +1 -1
- package/dist/esm/lib/use-permissions.js.map +1 -1
- package/dist/esm/lib/users-management-context.js +1 -1
- package/dist/esm/lib/users-management-context.js.map +1 -1
- package/dist/esm/lib/users-management.js +5 -4
- package/dist/esm/lib/users-management.js.map +1 -1
- package/dist/esm/lib/utils.d.ts +16 -2
- package/dist/esm/lib/utils.js +8 -0
- package/dist/esm/lib/utils.js.map +1 -1
- package/dist/esm/workos-widgets.client.js +13 -1
- package/dist/esm/workos-widgets.client.js.map +1 -1
- package/package.json +2 -2
|
@@ -18,18 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var react_query_exports = {};
|
|
20
20
|
__export(react_query_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
AuthenticationInformationResponseDataVerificationMethodsPasswordProvider: () => AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
|
|
24
|
-
CreateTotpFactorResponseAuthenticationChallengeAllOfObject: () => CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
|
|
25
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfObject: () => CreateTotpFactorResponseAuthenticationFactorAllOfObject,
|
|
26
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfType: () => CreateTotpFactorResponseAuthenticationFactorAllOfType,
|
|
27
|
-
DataInstallationObject: () => DataInstallationObject,
|
|
28
|
-
DataInstallationState: () => DataInstallationState,
|
|
29
|
-
DataIntegrationCredentialsType: () => DataIntegrationCredentialsType,
|
|
30
|
-
DataIntegrationIntegrationType: () => DataIntegrationIntegrationType,
|
|
31
|
-
DataIntegrationObject: () => DataIntegrationObject,
|
|
32
|
-
DataIntegrationOwnership: () => DataIntegrationOwnership,
|
|
21
|
+
DirectoryState: () => DirectoryState,
|
|
22
|
+
DirectoryType: () => DirectoryType,
|
|
33
23
|
DomainVerificationNameServer: () => DomainVerificationNameServer,
|
|
34
24
|
GenerateAdminPortalLinkIntent: () => GenerateAdminPortalLinkIntent,
|
|
35
25
|
MemberActionsItem: () => MemberActionsItem,
|
|
@@ -37,14 +27,6 @@ __export(react_query_exports, {
|
|
|
37
27
|
OidcSessionState: () => OidcSessionState,
|
|
38
28
|
OrganizationDomainState: () => OrganizationDomainState,
|
|
39
29
|
SamlSessionState: () => SamlSessionState,
|
|
40
|
-
SendVerificationResponseType: () => SendVerificationResponseType,
|
|
41
|
-
SettingsResponseObject: () => SettingsResponseObject,
|
|
42
|
-
SsoConnectionAnyOfEightAllOfProviderTag: () => SsoConnectionAnyOfEightAllOfProviderTag,
|
|
43
|
-
SsoConnectionAnyOfEightAllOfState: () => SsoConnectionAnyOfEightAllOfState,
|
|
44
|
-
SsoConnectionAnyOfEightAllOfType: () => SsoConnectionAnyOfEightAllOfType,
|
|
45
|
-
SsoConnectionAnyOfProviderTag: () => SsoConnectionAnyOfProviderTag,
|
|
46
|
-
SsoConnectionAnyOfState: () => SsoConnectionAnyOfState,
|
|
47
|
-
SsoConnectionAnyOfType: () => SsoConnectionAnyOfType,
|
|
48
30
|
SsoConnectionSessionJSONState: () => SsoConnectionSessionJSONState,
|
|
49
31
|
authenticationInformation: () => authenticationInformation,
|
|
50
32
|
createOrganizationApiKey: () => createOrganizationApiKey,
|
|
@@ -56,6 +38,7 @@ __export(react_query_exports, {
|
|
|
56
38
|
deletePasskey: () => deletePasskey,
|
|
57
39
|
deleteTotpFactors: () => deleteTotpFactors,
|
|
58
40
|
generateAdminPortalLink: () => generateAdminPortalLink,
|
|
41
|
+
getAuditLogStream: () => getAuditLogStream,
|
|
59
42
|
getAuthenticationInformationQueryKey: () => getAuthenticationInformationQueryKey,
|
|
60
43
|
getAuthenticationInformationQueryOptions: () => getAuthenticationInformationQueryOptions,
|
|
61
44
|
getAuthenticationInformationUrl: () => getAuthenticationInformationUrl,
|
|
@@ -77,16 +60,26 @@ __export(react_query_exports, {
|
|
|
77
60
|
getDeletePasskeyUrl: () => getDeletePasskeyUrl,
|
|
78
61
|
getDeleteTotpFactorsMutationOptions: () => getDeleteTotpFactorsMutationOptions,
|
|
79
62
|
getDeleteTotpFactorsUrl: () => getDeleteTotpFactorsUrl,
|
|
63
|
+
getDirectory: () => getDirectory,
|
|
80
64
|
getGenerateAdminPortalLinkMutationOptions: () => getGenerateAdminPortalLinkMutationOptions,
|
|
81
65
|
getGenerateAdminPortalLinkUrl: () => getGenerateAdminPortalLinkUrl,
|
|
66
|
+
getGetAuditLogStreamQueryKey: () => getGetAuditLogStreamQueryKey,
|
|
67
|
+
getGetAuditLogStreamQueryOptions: () => getGetAuditLogStreamQueryOptions,
|
|
68
|
+
getGetAuditLogStreamUrl: () => getGetAuditLogStreamUrl,
|
|
82
69
|
getGetDataInstallationAuthorizationStatusQueryKey: () => getGetDataInstallationAuthorizationStatusQueryKey,
|
|
83
70
|
getGetDataInstallationAuthorizationStatusQueryOptions: () => getGetDataInstallationAuthorizationStatusQueryOptions,
|
|
84
71
|
getGetDataInstallationAuthorizationStatusUrl: () => getGetDataInstallationAuthorizationStatusUrl,
|
|
85
72
|
getGetDataIntegrationAuthorizeUrlQueryKey: () => getGetDataIntegrationAuthorizeUrlQueryKey,
|
|
86
73
|
getGetDataIntegrationAuthorizeUrlQueryOptions: () => getGetDataIntegrationAuthorizeUrlQueryOptions,
|
|
87
74
|
getGetDataIntegrationAuthorizeUrlUrl: () => getGetDataIntegrationAuthorizeUrlUrl,
|
|
75
|
+
getGetDirectoryQueryKey: () => getGetDirectoryQueryKey,
|
|
76
|
+
getGetDirectoryQueryOptions: () => getGetDirectoryQueryOptions,
|
|
77
|
+
getGetDirectoryUrl: () => getGetDirectoryUrl,
|
|
88
78
|
getInviteMemberMutationOptions: () => getInviteMemberMutationOptions,
|
|
89
79
|
getInviteMemberUrl: () => getInviteMemberUrl,
|
|
80
|
+
getListDirectoriesQueryKey: () => getListDirectoriesQueryKey,
|
|
81
|
+
getListDirectoriesQueryOptions: () => getListDirectoriesQueryOptions,
|
|
82
|
+
getListDirectoriesUrl: () => getListDirectoriesUrl,
|
|
90
83
|
getListOrganizationApiKeyPermissionsQueryKey: () => getListOrganizationApiKeyPermissionsQueryKey,
|
|
91
84
|
getListOrganizationApiKeyPermissionsQueryOptions: () => getListOrganizationApiKeyPermissionsQueryOptions,
|
|
92
85
|
getListOrganizationApiKeyPermissionsUrl: () => getListOrganizationApiKeyPermissionsUrl,
|
|
@@ -152,6 +145,7 @@ __export(react_query_exports, {
|
|
|
152
145
|
getVerifyTotpFactorUrl: () => getVerifyTotpFactorUrl,
|
|
153
146
|
getVerifyUrl: () => getVerifyUrl,
|
|
154
147
|
inviteMember: () => inviteMember,
|
|
148
|
+
listDirectories: () => listDirectories,
|
|
155
149
|
listOrganizationApiKeyPermissions: () => listOrganizationApiKeyPermissions,
|
|
156
150
|
listOrganizationApiKeys: () => listOrganizationApiKeys,
|
|
157
151
|
listOrganizationDomains: () => listOrganizationDomains,
|
|
@@ -185,9 +179,12 @@ __export(react_query_exports, {
|
|
|
185
179
|
useDeletePasskey: () => useDeletePasskey,
|
|
186
180
|
useDeleteTotpFactors: () => useDeleteTotpFactors,
|
|
187
181
|
useGenerateAdminPortalLink: () => useGenerateAdminPortalLink,
|
|
182
|
+
useGetAuditLogStream: () => useGetAuditLogStream,
|
|
188
183
|
useGetDataInstallationAuthorizationStatus: () => useGetDataInstallationAuthorizationStatus,
|
|
189
184
|
useGetDataIntegrationAuthorizeUrl: () => useGetDataIntegrationAuthorizeUrl,
|
|
185
|
+
useGetDirectory: () => useGetDirectory,
|
|
190
186
|
useInviteMember: () => useInviteMember,
|
|
187
|
+
useListDirectories: () => useListDirectories,
|
|
191
188
|
useListOrganizationApiKeyPermissions: () => useListOrganizationApiKeyPermissions,
|
|
192
189
|
useListOrganizationApiKeys: () => useListOrganizationApiKeys,
|
|
193
190
|
useListOrganizationDomains: () => useListOrganizationDomains,
|
|
@@ -233,33 +230,6 @@ const MemberActionsItem = {
|
|
|
233
230
|
"revoke-invite": "revoke-invite",
|
|
234
231
|
"revoke-membership": "revoke-membership"
|
|
235
232
|
};
|
|
236
|
-
const CreateTotpFactorResponseAuthenticationFactorAllOfObject = {
|
|
237
|
-
authentication_factor: "authentication_factor"
|
|
238
|
-
};
|
|
239
|
-
const CreateTotpFactorResponseAuthenticationFactorAllOfType = {
|
|
240
|
-
generic_otp: "generic_otp",
|
|
241
|
-
sms: "sms",
|
|
242
|
-
totp: "totp",
|
|
243
|
-
webauthn: "webauthn"
|
|
244
|
-
};
|
|
245
|
-
const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {
|
|
246
|
-
authentication_challenge: "authentication_challenge"
|
|
247
|
-
};
|
|
248
|
-
const AuthenticationInformationResponseDataVerificationMethodsMfaProvider = {
|
|
249
|
-
MFA: "MFA"
|
|
250
|
-
};
|
|
251
|
-
const AuthenticationInformationResponseDataVerificationMethodsPasswordProvider = {
|
|
252
|
-
Password: "Password"
|
|
253
|
-
};
|
|
254
|
-
const AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider = {
|
|
255
|
-
Passkey: "Passkey"
|
|
256
|
-
};
|
|
257
|
-
const SendVerificationResponseType = {
|
|
258
|
-
EmailVerification: "EmailVerification"
|
|
259
|
-
};
|
|
260
|
-
const SettingsResponseObject = {
|
|
261
|
-
settings: "settings"
|
|
262
|
-
};
|
|
263
233
|
const OrganizationDomainState = {
|
|
264
234
|
Failed: "Failed",
|
|
265
235
|
LegacyVerified: "LegacyVerified",
|
|
@@ -292,126 +262,78 @@ const SsoConnectionSessionJSONState = {
|
|
|
292
262
|
...SamlSessionState,
|
|
293
263
|
...OidcSessionState
|
|
294
264
|
};
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
Active: "Active",
|
|
328
|
-
Deleting: "Deleting"
|
|
329
|
-
};
|
|
330
|
-
const SsoConnectionAnyOfProviderTag = {
|
|
331
|
-
Saml: "Saml"
|
|
332
|
-
};
|
|
333
|
-
const SsoConnectionAnyOfEightAllOfState = {
|
|
334
|
-
Inactive: "Inactive",
|
|
335
|
-
Validating: "Validating",
|
|
336
|
-
Active: "Active",
|
|
337
|
-
Deleting: "Deleting"
|
|
338
|
-
};
|
|
339
|
-
const SsoConnectionAnyOfEightAllOfType = {
|
|
340
|
-
AdpOidc: "AdpOidc",
|
|
341
|
-
Auth0Migration: "Auth0Migration",
|
|
342
|
-
CleverOidc: "CleverOidc",
|
|
343
|
-
EntraIdOidc: "EntraIdOidc",
|
|
344
|
-
GenericOidc: "GenericOidc",
|
|
345
|
-
GoogleOidc: "GoogleOidc",
|
|
346
|
-
OktaOidc: "OktaOidc",
|
|
347
|
-
LoginGovOidc: "LoginGovOidc"
|
|
348
|
-
};
|
|
349
|
-
const SsoConnectionAnyOfEightAllOfProviderTag = {
|
|
350
|
-
OpenIdConnect: "OpenIdConnect"
|
|
351
|
-
};
|
|
352
|
-
const DataInstallationObject = {
|
|
353
|
-
data_installation: "data_installation",
|
|
354
|
-
connected_account: "connected_account"
|
|
355
|
-
};
|
|
356
|
-
const DataInstallationState = {
|
|
357
|
-
connected: "connected",
|
|
358
|
-
needs_reauthorization: "needs_reauthorization"
|
|
359
|
-
};
|
|
360
|
-
const DataIntegrationObject = {
|
|
361
|
-
data_integration: "data_integration"
|
|
362
|
-
};
|
|
363
|
-
const DataIntegrationIntegrationType = {
|
|
364
|
-
asana: "asana",
|
|
365
|
-
box: "box",
|
|
366
|
-
"cal-dot-com": "cal-dot-com",
|
|
367
|
-
calendly: "calendly",
|
|
368
|
-
confluence: "confluence",
|
|
369
|
-
dropbox: "dropbox",
|
|
370
|
-
"frame-io": "frame-io",
|
|
371
|
-
front: "front",
|
|
372
|
-
github: "github",
|
|
373
|
-
gitlab: "gitlab",
|
|
374
|
-
gmail: "gmail",
|
|
375
|
-
google: "google",
|
|
376
|
-
"google-calendar": "google-calendar",
|
|
377
|
-
"google-drive": "google-drive",
|
|
378
|
-
helpscout: "helpscout",
|
|
379
|
-
hubspot: "hubspot",
|
|
380
|
-
intercom: "intercom",
|
|
381
|
-
jira: "jira",
|
|
382
|
-
linear: "linear",
|
|
383
|
-
microsoft: "microsoft",
|
|
384
|
-
"microsoft-onedrive": "microsoft-onedrive",
|
|
385
|
-
"microsoft-onenote": "microsoft-onenote",
|
|
386
|
-
"microsoft-outlook": "microsoft-outlook",
|
|
387
|
-
"microsoft-outlook-calendar": "microsoft-outlook-calendar",
|
|
388
|
-
"microsoft-sharepoint": "microsoft-sharepoint",
|
|
389
|
-
"microsoft-teams": "microsoft-teams",
|
|
390
|
-
"microsoft-todo": "microsoft-todo",
|
|
391
|
-
notion: "notion",
|
|
392
|
-
prefect: "prefect",
|
|
393
|
-
"pydantic-logfire": "pydantic-logfire",
|
|
394
|
-
salesforce: "salesforce",
|
|
395
|
-
sentry: "sentry",
|
|
396
|
-
slack: "slack",
|
|
397
|
-
snowflake: "snowflake",
|
|
398
|
-
stripe: "stripe",
|
|
399
|
-
xero: "xero",
|
|
400
|
-
zendesk: "zendesk"
|
|
401
|
-
};
|
|
402
|
-
const DataIntegrationOwnership = {
|
|
403
|
-
userland_user: "userland_user",
|
|
404
|
-
organization: "organization"
|
|
405
|
-
};
|
|
406
|
-
const DataIntegrationCredentialsType = {
|
|
407
|
-
shared: "shared",
|
|
408
|
-
custom: "custom"
|
|
265
|
+
const DirectoryType = {
|
|
266
|
+
azure_scim_v20: "azure scim v2.0",
|
|
267
|
+
bamboohr: "bamboohr",
|
|
268
|
+
breathe_hr: "breathe hr",
|
|
269
|
+
cezanne_hr: "cezanne hr",
|
|
270
|
+
cyberark_scim_v20: "cyberark scim v2.0",
|
|
271
|
+
fourth_hr: "fourth hr",
|
|
272
|
+
generic_scim_v20: "generic scim v2.0",
|
|
273
|
+
gsuite_directory: "gsuite directory",
|
|
274
|
+
gusto: "gusto",
|
|
275
|
+
hibob: "hibob",
|
|
276
|
+
jump_cloud_scim_v20: "jump cloud scim v2.0",
|
|
277
|
+
okta_scim_v20: "okta scim v2.0",
|
|
278
|
+
onelogin_scim_v20: "onelogin scim v2.0",
|
|
279
|
+
people_hr: "people hr",
|
|
280
|
+
personio: "personio",
|
|
281
|
+
pingfederate_scim_v20: "pingfederate scim v2.0",
|
|
282
|
+
rippling: "rippling",
|
|
283
|
+
rippling_scim_v20: "rippling scim v2.0",
|
|
284
|
+
s3: "s3",
|
|
285
|
+
sailpoint_scim_v20: "sailpoint scim v2.0",
|
|
286
|
+
sftp: "sftp",
|
|
287
|
+
sftp_workday: "sftp workday",
|
|
288
|
+
workday: "workday"
|
|
289
|
+
};
|
|
290
|
+
const DirectoryState = {
|
|
291
|
+
requires_type: "requires_type",
|
|
292
|
+
linked: "linked",
|
|
293
|
+
validating: "validating",
|
|
294
|
+
invalid_credentials: "invalid_credentials",
|
|
295
|
+
unlinked: "unlinked",
|
|
296
|
+
deleting: "deleting"
|
|
409
297
|
};
|
|
410
298
|
const GenerateAdminPortalLinkIntent = {
|
|
411
299
|
domain_verification: "domain_verification",
|
|
412
|
-
sso: "sso"
|
|
300
|
+
sso: "sso",
|
|
301
|
+
log_streams: "log_streams"
|
|
413
302
|
};
|
|
414
|
-
const
|
|
303
|
+
const getCreateOrganizationApiKeyUrl = () => {
|
|
304
|
+
return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
305
|
+
};
|
|
306
|
+
const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options) => {
|
|
307
|
+
const res = await fetch(getCreateOrganizationApiKeyUrl(), {
|
|
308
|
+
...options,
|
|
309
|
+
method: "POST",
|
|
310
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
311
|
+
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
312
|
+
});
|
|
313
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
314
|
+
const data = body ? JSON.parse(body) : {};
|
|
315
|
+
return {
|
|
316
|
+
data,
|
|
317
|
+
status: res.status,
|
|
318
|
+
headers: res.headers
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
const getCreateOrganizationApiKeyMutationOptions = (options) => {
|
|
322
|
+
const mutationKey = ["createOrganizationApiKey"];
|
|
323
|
+
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 };
|
|
324
|
+
const mutationFn = (props) => {
|
|
325
|
+
const { data } = props ?? {};
|
|
326
|
+
return createOrganizationApiKey(data, fetchOptions);
|
|
327
|
+
};
|
|
328
|
+
return { mutationFn, ...mutationOptions };
|
|
329
|
+
};
|
|
330
|
+
const useCreateOrganizationApiKey = (options, queryClient) => {
|
|
331
|
+
return (0, import_react_query.useMutation)(
|
|
332
|
+
getCreateOrganizationApiKeyMutationOptions(options),
|
|
333
|
+
queryClient
|
|
334
|
+
);
|
|
335
|
+
};
|
|
336
|
+
const getListOrganizationApiKeysUrl = (params) => {
|
|
415
337
|
const normalizedParams = new URLSearchParams();
|
|
416
338
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
417
339
|
if (value !== void 0) {
|
|
@@ -419,71 +341,148 @@ const getMembersUrl = (params) => {
|
|
|
419
341
|
}
|
|
420
342
|
});
|
|
421
343
|
const stringifiedParams = normalizedParams.toString();
|
|
422
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/
|
|
344
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
423
345
|
};
|
|
424
|
-
const
|
|
425
|
-
const res = await fetch(
|
|
346
|
+
const listOrganizationApiKeys = async (params, options) => {
|
|
347
|
+
const res = await fetch(getListOrganizationApiKeysUrl(params), {
|
|
426
348
|
...options,
|
|
427
349
|
method: "GET"
|
|
428
350
|
});
|
|
429
351
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
430
352
|
const data = body ? JSON.parse(body) : {};
|
|
431
|
-
return {
|
|
353
|
+
return {
|
|
354
|
+
data,
|
|
355
|
+
status: res.status,
|
|
356
|
+
headers: res.headers
|
|
357
|
+
};
|
|
432
358
|
};
|
|
433
|
-
const
|
|
359
|
+
const getListOrganizationApiKeysQueryKey = (params) => {
|
|
434
360
|
return [
|
|
435
|
-
`https://api.workos.com/_widgets/
|
|
361
|
+
`https://api.workos.com/_widgets/ApiKeys/organization-api-keys`,
|
|
436
362
|
...params ? [params] : []
|
|
437
363
|
];
|
|
438
364
|
};
|
|
439
|
-
const
|
|
365
|
+
const getListOrganizationApiKeysQueryOptions = (params, options) => {
|
|
440
366
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
441
|
-
const queryKey = queryOptions?.queryKey ??
|
|
442
|
-
const queryFn = ({
|
|
443
|
-
signal
|
|
444
|
-
}) => members(params, { signal, ...fetchOptions });
|
|
367
|
+
const queryKey = queryOptions?.queryKey ?? getListOrganizationApiKeysQueryKey(params);
|
|
368
|
+
const queryFn = ({ signal }) => listOrganizationApiKeys(params, { signal, ...fetchOptions });
|
|
445
369
|
return { queryKey, queryFn, ...queryOptions };
|
|
446
370
|
};
|
|
447
|
-
function
|
|
448
|
-
const queryOptions =
|
|
371
|
+
function useListOrganizationApiKeys(params, options, queryClient) {
|
|
372
|
+
const queryOptions = getListOrganizationApiKeysQueryOptions(params, options);
|
|
449
373
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
450
|
-
query
|
|
451
|
-
return query;
|
|
374
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
452
375
|
}
|
|
453
|
-
const
|
|
454
|
-
|
|
376
|
+
const getListOrganizationApiKeyPermissionsUrl = (params) => {
|
|
377
|
+
const normalizedParams = new URLSearchParams();
|
|
378
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
379
|
+
if (value !== void 0) {
|
|
380
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
const stringifiedParams = normalizedParams.toString();
|
|
384
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
455
385
|
};
|
|
456
|
-
const
|
|
457
|
-
const res = await fetch(
|
|
386
|
+
const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
387
|
+
const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {
|
|
458
388
|
...options,
|
|
459
389
|
method: "GET"
|
|
460
390
|
});
|
|
461
391
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
462
392
|
const data = body ? JSON.parse(body) : {};
|
|
463
|
-
return {
|
|
393
|
+
return {
|
|
394
|
+
data,
|
|
395
|
+
status: res.status,
|
|
396
|
+
headers: res.headers
|
|
397
|
+
};
|
|
464
398
|
};
|
|
465
|
-
const
|
|
466
|
-
return [
|
|
399
|
+
const getListOrganizationApiKeyPermissionsQueryKey = (params) => {
|
|
400
|
+
return [
|
|
401
|
+
`https://api.workos.com/_widgets/ApiKeys/permissions`,
|
|
402
|
+
...params ? [params] : []
|
|
403
|
+
];
|
|
467
404
|
};
|
|
468
|
-
const
|
|
405
|
+
const getListOrganizationApiKeyPermissionsQueryOptions = (params, options) => {
|
|
469
406
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
470
|
-
const queryKey = queryOptions?.queryKey ??
|
|
471
|
-
const queryFn = ({
|
|
472
|
-
signal
|
|
473
|
-
}) => roles({ signal, ...fetchOptions });
|
|
407
|
+
const queryKey = queryOptions?.queryKey ?? getListOrganizationApiKeyPermissionsQueryKey(params);
|
|
408
|
+
const queryFn = ({ signal }) => listOrganizationApiKeyPermissions(params, { signal, ...fetchOptions });
|
|
474
409
|
return { queryKey, queryFn, ...queryOptions };
|
|
475
410
|
};
|
|
476
|
-
function
|
|
477
|
-
const queryOptions =
|
|
411
|
+
function useListOrganizationApiKeyPermissions(params, options, queryClient) {
|
|
412
|
+
const queryOptions = getListOrganizationApiKeyPermissionsQueryOptions(
|
|
413
|
+
params,
|
|
414
|
+
options
|
|
415
|
+
);
|
|
478
416
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
479
|
-
query
|
|
480
|
-
return query;
|
|
417
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
481
418
|
}
|
|
482
|
-
const
|
|
483
|
-
return `https://api.workos.com/_widgets/
|
|
419
|
+
const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
|
|
420
|
+
return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
|
|
484
421
|
};
|
|
485
|
-
const
|
|
486
|
-
const res = await fetch(
|
|
422
|
+
const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
423
|
+
const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {
|
|
424
|
+
...options,
|
|
425
|
+
method: "DELETE"
|
|
426
|
+
});
|
|
427
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
428
|
+
const data = body ? JSON.parse(body) : {};
|
|
429
|
+
return {
|
|
430
|
+
data,
|
|
431
|
+
status: res.status,
|
|
432
|
+
headers: res.headers
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
const getDeleteOrganizationApiKeyMutationOptions = (options) => {
|
|
436
|
+
const mutationKey = ["deleteOrganizationApiKey"];
|
|
437
|
+
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 };
|
|
438
|
+
const mutationFn = (props) => {
|
|
439
|
+
const { apiKeyId } = props ?? {};
|
|
440
|
+
return deleteOrganizationApiKey(apiKeyId, fetchOptions);
|
|
441
|
+
};
|
|
442
|
+
return { mutationFn, ...mutationOptions };
|
|
443
|
+
};
|
|
444
|
+
const useDeleteOrganizationApiKey = (options, queryClient) => {
|
|
445
|
+
return (0, import_react_query.useMutation)(
|
|
446
|
+
getDeleteOrganizationApiKeyMutationOptions(options),
|
|
447
|
+
queryClient
|
|
448
|
+
);
|
|
449
|
+
};
|
|
450
|
+
const getDeleteDataInstallationUrl = (installationId) => {
|
|
451
|
+
return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;
|
|
452
|
+
};
|
|
453
|
+
const deleteDataInstallation = async (installationId, options) => {
|
|
454
|
+
const res = await fetch(getDeleteDataInstallationUrl(installationId), {
|
|
455
|
+
...options,
|
|
456
|
+
method: "DELETE"
|
|
457
|
+
});
|
|
458
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
459
|
+
const data = body ? JSON.parse(body) : {};
|
|
460
|
+
return {
|
|
461
|
+
data,
|
|
462
|
+
status: res.status,
|
|
463
|
+
headers: res.headers
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
const getDeleteDataInstallationMutationOptions = (options) => {
|
|
467
|
+
const mutationKey = ["deleteDataInstallation"];
|
|
468
|
+
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 };
|
|
469
|
+
const mutationFn = (props) => {
|
|
470
|
+
const { installationId } = props ?? {};
|
|
471
|
+
return deleteDataInstallation(installationId, fetchOptions);
|
|
472
|
+
};
|
|
473
|
+
return { mutationFn, ...mutationOptions };
|
|
474
|
+
};
|
|
475
|
+
const useDeleteDataInstallation = (options, queryClient) => {
|
|
476
|
+
return (0, import_react_query.useMutation)(
|
|
477
|
+
getDeleteDataInstallationMutationOptions(options),
|
|
478
|
+
queryClient
|
|
479
|
+
);
|
|
480
|
+
};
|
|
481
|
+
const getMyDataIntegrationsUrl = () => {
|
|
482
|
+
return `https://api.workos.com/_widgets/DataIntegrations/mine`;
|
|
483
|
+
};
|
|
484
|
+
const myDataIntegrations = async (options) => {
|
|
485
|
+
const res = await fetch(getMyDataIntegrationsUrl(), {
|
|
487
486
|
...options,
|
|
488
487
|
method: "GET"
|
|
489
488
|
});
|
|
@@ -495,24 +494,115 @@ const rolesAndConfig = async (options) => {
|
|
|
495
494
|
headers: res.headers
|
|
496
495
|
};
|
|
497
496
|
};
|
|
498
|
-
const
|
|
497
|
+
const getMyDataIntegrationsQueryKey = () => {
|
|
498
|
+
return [`https://api.workos.com/_widgets/DataIntegrations/mine`];
|
|
499
|
+
};
|
|
500
|
+
const getMyDataIntegrationsQueryOptions = (options) => {
|
|
501
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
502
|
+
const queryKey = queryOptions?.queryKey ?? getMyDataIntegrationsQueryKey();
|
|
503
|
+
const queryFn = ({ signal }) => myDataIntegrations({ signal, ...fetchOptions });
|
|
504
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
505
|
+
};
|
|
506
|
+
function useMyDataIntegrations(options, queryClient) {
|
|
507
|
+
const queryOptions = getMyDataIntegrationsQueryOptions(options);
|
|
508
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
509
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
510
|
+
}
|
|
511
|
+
const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
|
|
512
|
+
return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
|
|
513
|
+
};
|
|
514
|
+
const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state, options) => {
|
|
515
|
+
const res = await fetch(
|
|
516
|
+
getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),
|
|
517
|
+
{
|
|
518
|
+
...options,
|
|
519
|
+
method: "GET"
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
523
|
+
const data = body ? JSON.parse(body) : {};
|
|
524
|
+
return {
|
|
525
|
+
data,
|
|
526
|
+
status: res.status,
|
|
527
|
+
headers: res.headers
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
const getGetDataInstallationAuthorizationStatusQueryKey = (dataIntegrationId, state) => {
|
|
499
531
|
return [
|
|
500
|
-
`https://api.workos.com/_widgets/
|
|
532
|
+
`https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`
|
|
501
533
|
];
|
|
502
534
|
};
|
|
503
|
-
const
|
|
535
|
+
const getGetDataInstallationAuthorizationStatusQueryOptions = (dataIntegrationId, state, options) => {
|
|
504
536
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
505
|
-
const queryKey = queryOptions?.queryKey ??
|
|
506
|
-
const queryFn = ({
|
|
507
|
-
signal
|
|
508
|
-
|
|
509
|
-
|
|
537
|
+
const queryKey = queryOptions?.queryKey ?? getGetDataInstallationAuthorizationStatusQueryKey(dataIntegrationId, state);
|
|
538
|
+
const queryFn = ({ signal }) => getDataInstallationAuthorizationStatus(dataIntegrationId, state, {
|
|
539
|
+
signal,
|
|
540
|
+
...fetchOptions
|
|
541
|
+
});
|
|
542
|
+
return {
|
|
543
|
+
queryKey,
|
|
544
|
+
queryFn,
|
|
545
|
+
enabled: !!(dataIntegrationId && state),
|
|
546
|
+
...queryOptions
|
|
547
|
+
};
|
|
510
548
|
};
|
|
511
|
-
function
|
|
512
|
-
const queryOptions =
|
|
549
|
+
function useGetDataInstallationAuthorizationStatus(dataIntegrationId, state, options, queryClient) {
|
|
550
|
+
const queryOptions = getGetDataInstallationAuthorizationStatusQueryOptions(
|
|
551
|
+
dataIntegrationId,
|
|
552
|
+
state,
|
|
553
|
+
options
|
|
554
|
+
);
|
|
555
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
556
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
557
|
+
}
|
|
558
|
+
const getGetDataIntegrationAuthorizeUrlUrl = (slug, params) => {
|
|
559
|
+
const normalizedParams = new URLSearchParams();
|
|
560
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
561
|
+
if (value !== void 0) {
|
|
562
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
const stringifiedParams = normalizedParams.toString();
|
|
566
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
567
|
+
};
|
|
568
|
+
const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
569
|
+
const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {
|
|
570
|
+
...options,
|
|
571
|
+
method: "GET"
|
|
572
|
+
});
|
|
573
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
574
|
+
const data = body ? JSON.parse(body) : {};
|
|
575
|
+
return {
|
|
576
|
+
data,
|
|
577
|
+
status: res.status,
|
|
578
|
+
headers: res.headers
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
const getGetDataIntegrationAuthorizeUrlQueryKey = (slug, params) => {
|
|
582
|
+
return [
|
|
583
|
+
`https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`,
|
|
584
|
+
...params ? [params] : []
|
|
585
|
+
];
|
|
586
|
+
};
|
|
587
|
+
const getGetDataIntegrationAuthorizeUrlQueryOptions = (slug, params, options) => {
|
|
588
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
589
|
+
const queryKey = queryOptions?.queryKey ?? getGetDataIntegrationAuthorizeUrlQueryKey(slug, params);
|
|
590
|
+
const queryFn = ({ signal }) => getDataIntegrationAuthorizeUrl(slug, params, { signal, ...fetchOptions });
|
|
591
|
+
return {
|
|
592
|
+
queryKey,
|
|
593
|
+
queryFn,
|
|
594
|
+
enabled: !!slug,
|
|
595
|
+
...queryOptions
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
function useGetDataIntegrationAuthorizeUrl(slug, params, options, queryClient) {
|
|
599
|
+
const queryOptions = getGetDataIntegrationAuthorizeUrlQueryOptions(
|
|
600
|
+
slug,
|
|
601
|
+
params,
|
|
602
|
+
options
|
|
603
|
+
);
|
|
513
604
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
514
|
-
query
|
|
515
|
-
return query;
|
|
605
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
516
606
|
}
|
|
517
607
|
const getInviteMemberUrl = () => {
|
|
518
608
|
return `https://api.workos.com/_widgets/UserManagement/invite-user`;
|
|
@@ -542,16 +632,15 @@ const getInviteMemberMutationOptions = (options) => {
|
|
|
542
632
|
return { mutationFn, ...mutationOptions };
|
|
543
633
|
};
|
|
544
634
|
const useInviteMember = (options, queryClient) => {
|
|
545
|
-
|
|
546
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
635
|
+
return (0, import_react_query.useMutation)(getInviteMemberMutationOptions(options), queryClient);
|
|
547
636
|
};
|
|
548
|
-
const
|
|
549
|
-
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}
|
|
637
|
+
const getRevokeInviteUrl = (userId) => {
|
|
638
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
|
|
550
639
|
};
|
|
551
|
-
const
|
|
552
|
-
const res = await fetch(
|
|
640
|
+
const revokeInvite = async (userId, options) => {
|
|
641
|
+
const res = await fetch(getRevokeInviteUrl(userId), {
|
|
553
642
|
...options,
|
|
554
|
-
method: "
|
|
643
|
+
method: "DELETE"
|
|
555
644
|
});
|
|
556
645
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
557
646
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -561,26 +650,25 @@ const resendInvite = async (userId, options) => {
|
|
|
561
650
|
headers: res.headers
|
|
562
651
|
};
|
|
563
652
|
};
|
|
564
|
-
const
|
|
565
|
-
const mutationKey = ["
|
|
653
|
+
const getRevokeInviteMutationOptions = (options) => {
|
|
654
|
+
const mutationKey = ["revokeInvite"];
|
|
566
655
|
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 };
|
|
567
656
|
const mutationFn = (props) => {
|
|
568
657
|
const { userId } = props ?? {};
|
|
569
|
-
return
|
|
658
|
+
return revokeInvite(userId, fetchOptions);
|
|
570
659
|
};
|
|
571
660
|
return { mutationFn, ...mutationOptions };
|
|
572
661
|
};
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
662
|
+
const useRevokeInvite = (options, queryClient) => {
|
|
663
|
+
return (0, import_react_query.useMutation)(getRevokeInviteMutationOptions(options), queryClient);
|
|
576
664
|
};
|
|
577
|
-
const
|
|
578
|
-
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
|
|
665
|
+
const getResendInviteUrl = (userId) => {
|
|
666
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;
|
|
579
667
|
};
|
|
580
|
-
const
|
|
581
|
-
const res = await fetch(
|
|
668
|
+
const resendInvite = async (userId, options) => {
|
|
669
|
+
const res = await fetch(getResendInviteUrl(userId), {
|
|
582
670
|
...options,
|
|
583
|
-
method: "
|
|
671
|
+
method: "POST"
|
|
584
672
|
});
|
|
585
673
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
586
674
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -590,19 +678,56 @@ const revokeInvite = async (userId, options) => {
|
|
|
590
678
|
headers: res.headers
|
|
591
679
|
};
|
|
592
680
|
};
|
|
593
|
-
const
|
|
594
|
-
const mutationKey = ["
|
|
681
|
+
const getResendInviteMutationOptions = (options) => {
|
|
682
|
+
const mutationKey = ["resendInvite"];
|
|
595
683
|
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 };
|
|
596
684
|
const mutationFn = (props) => {
|
|
597
685
|
const { userId } = props ?? {};
|
|
598
|
-
return
|
|
686
|
+
return resendInvite(userId, fetchOptions);
|
|
599
687
|
};
|
|
600
688
|
return { mutationFn, ...mutationOptions };
|
|
601
689
|
};
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
|
|
690
|
+
const useResendInvite = (options, queryClient) => {
|
|
691
|
+
return (0, import_react_query.useMutation)(getResendInviteMutationOptions(options), queryClient);
|
|
692
|
+
};
|
|
693
|
+
const getMembersUrl = (params) => {
|
|
694
|
+
const normalizedParams = new URLSearchParams();
|
|
695
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
696
|
+
if (value !== void 0) {
|
|
697
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
const stringifiedParams = normalizedParams.toString();
|
|
701
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
|
|
702
|
+
};
|
|
703
|
+
const members = async (params, options) => {
|
|
704
|
+
const res = await fetch(getMembersUrl(params), {
|
|
705
|
+
...options,
|
|
706
|
+
method: "GET"
|
|
707
|
+
});
|
|
708
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
709
|
+
const data = body ? JSON.parse(body) : {};
|
|
710
|
+
return { data, status: res.status, headers: res.headers };
|
|
711
|
+
};
|
|
712
|
+
const getMembersQueryKey = (params) => {
|
|
713
|
+
return [
|
|
714
|
+
`https://api.workos.com/_widgets/UserManagement/members`,
|
|
715
|
+
...params ? [params] : []
|
|
716
|
+
];
|
|
717
|
+
};
|
|
718
|
+
const getMembersQueryOptions = (params, options) => {
|
|
719
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
720
|
+
const queryKey = queryOptions?.queryKey ?? getMembersQueryKey(params);
|
|
721
|
+
const queryFn = ({
|
|
722
|
+
signal
|
|
723
|
+
}) => members(params, { signal, ...fetchOptions });
|
|
724
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
605
725
|
};
|
|
726
|
+
function useMembers(params, options, queryClient) {
|
|
727
|
+
const queryOptions = getMembersQueryOptions(params, options);
|
|
728
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
729
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
730
|
+
}
|
|
606
731
|
const getRemoveMemberUrl = (userId) => {
|
|
607
732
|
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
608
733
|
};
|
|
@@ -629,8 +754,7 @@ const getRemoveMemberMutationOptions = (options) => {
|
|
|
629
754
|
return { mutationFn, ...mutationOptions };
|
|
630
755
|
};
|
|
631
756
|
const useRemoveMember = (options, queryClient) => {
|
|
632
|
-
|
|
633
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
757
|
+
return (0, import_react_query.useMutation)(getRemoveMemberMutationOptions(options), queryClient);
|
|
634
758
|
};
|
|
635
759
|
const getUpdateMemberUrl = (userId) => {
|
|
636
760
|
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
@@ -660,8 +784,7 @@ const getUpdateMemberMutationOptions = (options) => {
|
|
|
660
784
|
return { mutationFn, ...mutationOptions };
|
|
661
785
|
};
|
|
662
786
|
const useUpdateMember = (options, queryClient) => {
|
|
663
|
-
|
|
664
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
787
|
+
return (0, import_react_query.useMutation)(getUpdateMemberMutationOptions(options), queryClient);
|
|
665
788
|
};
|
|
666
789
|
const getOrganizationsUrl = () => {
|
|
667
790
|
return `https://api.workos.com/_widgets/UserManagement/organizations`;
|
|
@@ -695,14 +818,13 @@ const getOrganizationsQueryOptions = (options) => {
|
|
|
695
818
|
function useOrganizations(options, queryClient) {
|
|
696
819
|
const queryOptions = getOrganizationsQueryOptions(options);
|
|
697
820
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
698
|
-
query
|
|
699
|
-
return query;
|
|
821
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
700
822
|
}
|
|
701
|
-
const
|
|
702
|
-
return `https://api.workos.com/_widgets/
|
|
823
|
+
const getRolesUrl = () => {
|
|
824
|
+
return `https://api.workos.com/_widgets/UserManagement/roles`;
|
|
703
825
|
};
|
|
704
|
-
const
|
|
705
|
-
const res = await fetch(
|
|
826
|
+
const roles = async (options) => {
|
|
827
|
+
const res = await fetch(getRolesUrl(), {
|
|
706
828
|
...options,
|
|
707
829
|
method: "GET"
|
|
708
830
|
});
|
|
@@ -710,114 +832,29 @@ const me = async (options) => {
|
|
|
710
832
|
const data = body ? JSON.parse(body) : {};
|
|
711
833
|
return { data, status: res.status, headers: res.headers };
|
|
712
834
|
};
|
|
713
|
-
const
|
|
714
|
-
return [`https://api.workos.com/_widgets/
|
|
835
|
+
const getRolesQueryKey = () => {
|
|
836
|
+
return [`https://api.workos.com/_widgets/UserManagement/roles`];
|
|
715
837
|
};
|
|
716
|
-
const
|
|
838
|
+
const getRolesQueryOptions = (options) => {
|
|
717
839
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
718
|
-
const queryKey = queryOptions?.queryKey ??
|
|
719
|
-
const queryFn = ({
|
|
840
|
+
const queryKey = queryOptions?.queryKey ?? getRolesQueryKey();
|
|
841
|
+
const queryFn = ({
|
|
842
|
+
signal
|
|
843
|
+
}) => roles({ signal, ...fetchOptions });
|
|
720
844
|
return { queryKey, queryFn, ...queryOptions };
|
|
721
845
|
};
|
|
722
|
-
function
|
|
723
|
-
const queryOptions =
|
|
846
|
+
function useRoles(options, queryClient) {
|
|
847
|
+
const queryOptions = getRolesQueryOptions(options);
|
|
724
848
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
725
|
-
query
|
|
726
|
-
return query;
|
|
849
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
727
850
|
}
|
|
728
|
-
const
|
|
729
|
-
return `https://api.workos.com/_widgets/
|
|
730
|
-
};
|
|
731
|
-
const updateMe = async (updateMeBody, options) => {
|
|
732
|
-
const res = await fetch(getUpdateMeUrl(), {
|
|
733
|
-
...options,
|
|
734
|
-
method: "POST",
|
|
735
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
736
|
-
body: JSON.stringify(updateMeBody)
|
|
737
|
-
});
|
|
738
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
739
|
-
const data = body ? JSON.parse(body) : {};
|
|
740
|
-
return { data, status: res.status, headers: res.headers };
|
|
741
|
-
};
|
|
742
|
-
const getUpdateMeMutationOptions = (options) => {
|
|
743
|
-
const mutationKey = ["updateMe"];
|
|
744
|
-
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 };
|
|
745
|
-
const mutationFn = (props) => {
|
|
746
|
-
const { data } = props ?? {};
|
|
747
|
-
return updateMe(data, fetchOptions);
|
|
748
|
-
};
|
|
749
|
-
return { mutationFn, ...mutationOptions };
|
|
750
|
-
};
|
|
751
|
-
const useUpdateMe = (options, queryClient) => {
|
|
752
|
-
const mutationOptions = getUpdateMeMutationOptions(options);
|
|
753
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
754
|
-
};
|
|
755
|
-
const getCreateTotpFactorUrl = () => {
|
|
756
|
-
return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
|
|
757
|
-
};
|
|
758
|
-
const createTotpFactor = async (options) => {
|
|
759
|
-
const res = await fetch(getCreateTotpFactorUrl(), {
|
|
760
|
-
...options,
|
|
761
|
-
method: "POST"
|
|
762
|
-
});
|
|
763
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
764
|
-
const data = body ? JSON.parse(body) : {};
|
|
765
|
-
return {
|
|
766
|
-
data,
|
|
767
|
-
status: res.status,
|
|
768
|
-
headers: res.headers
|
|
769
|
-
};
|
|
770
|
-
};
|
|
771
|
-
const getCreateTotpFactorMutationOptions = (options) => {
|
|
772
|
-
const mutationKey = ["createTotpFactor"];
|
|
773
|
-
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 };
|
|
774
|
-
const mutationFn = () => {
|
|
775
|
-
return createTotpFactor(fetchOptions);
|
|
776
|
-
};
|
|
777
|
-
return { mutationFn, ...mutationOptions };
|
|
778
|
-
};
|
|
779
|
-
const useCreateTotpFactor = (options, queryClient) => {
|
|
780
|
-
const mutationOptions = getCreateTotpFactorMutationOptions(options);
|
|
781
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
782
|
-
};
|
|
783
|
-
const getVerifyTotpFactorUrl = () => {
|
|
784
|
-
return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
|
|
785
|
-
};
|
|
786
|
-
const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
787
|
-
const res = await fetch(getVerifyTotpFactorUrl(), {
|
|
788
|
-
...options,
|
|
789
|
-
method: "POST",
|
|
790
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
791
|
-
body: JSON.stringify(verifyTotpFactorRequest)
|
|
792
|
-
});
|
|
793
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
794
|
-
const data = body ? JSON.parse(body) : {};
|
|
795
|
-
return {
|
|
796
|
-
data,
|
|
797
|
-
status: res.status,
|
|
798
|
-
headers: res.headers
|
|
799
|
-
};
|
|
800
|
-
};
|
|
801
|
-
const getVerifyTotpFactorMutationOptions = (options) => {
|
|
802
|
-
const mutationKey = ["verifyTotpFactor"];
|
|
803
|
-
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 };
|
|
804
|
-
const mutationFn = (props) => {
|
|
805
|
-
const { data } = props ?? {};
|
|
806
|
-
return verifyTotpFactor(data, fetchOptions);
|
|
807
|
-
};
|
|
808
|
-
return { mutationFn, ...mutationOptions };
|
|
809
|
-
};
|
|
810
|
-
const useVerifyTotpFactor = (options, queryClient) => {
|
|
811
|
-
const mutationOptions = getVerifyTotpFactorMutationOptions(options);
|
|
812
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
813
|
-
};
|
|
814
|
-
const getDeleteTotpFactorsUrl = () => {
|
|
815
|
-
return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
|
|
851
|
+
const getRolesAndConfigUrl = () => {
|
|
852
|
+
return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;
|
|
816
853
|
};
|
|
817
|
-
const
|
|
818
|
-
const res = await fetch(
|
|
854
|
+
const rolesAndConfig = async (options) => {
|
|
855
|
+
const res = await fetch(getRolesAndConfigUrl(), {
|
|
819
856
|
...options,
|
|
820
|
-
method: "
|
|
857
|
+
method: "GET"
|
|
821
858
|
});
|
|
822
859
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
823
860
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -827,18 +864,24 @@ const deleteTotpFactors = async (options) => {
|
|
|
827
864
|
headers: res.headers
|
|
828
865
|
};
|
|
829
866
|
};
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
return deleteTotpFactors(fetchOptions);
|
|
835
|
-
};
|
|
836
|
-
return { mutationFn, ...mutationOptions };
|
|
867
|
+
const getRolesAndConfigQueryKey = () => {
|
|
868
|
+
return [
|
|
869
|
+
`https://api.workos.com/_widgets/UserManagement/roles-and-config`
|
|
870
|
+
];
|
|
837
871
|
};
|
|
838
|
-
const
|
|
839
|
-
const
|
|
840
|
-
|
|
872
|
+
const getRolesAndConfigQueryOptions = (options) => {
|
|
873
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
874
|
+
const queryKey = queryOptions?.queryKey ?? getRolesAndConfigQueryKey();
|
|
875
|
+
const queryFn = ({
|
|
876
|
+
signal
|
|
877
|
+
}) => rolesAndConfig({ signal, ...fetchOptions });
|
|
878
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
841
879
|
};
|
|
880
|
+
function useRolesAndConfig(options, queryClient) {
|
|
881
|
+
const queryOptions = getRolesAndConfigQueryOptions(options);
|
|
882
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
883
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
884
|
+
}
|
|
842
885
|
const getAuthenticationInformationUrl = () => {
|
|
843
886
|
return `https://api.workos.com/_widgets/UserProfile/authentication-information`;
|
|
844
887
|
};
|
|
@@ -869,8 +912,7 @@ const getAuthenticationInformationQueryOptions = (options) => {
|
|
|
869
912
|
function useAuthenticationInformation(options, queryClient) {
|
|
870
913
|
const queryOptions = getAuthenticationInformationQueryOptions(options);
|
|
871
914
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
872
|
-
query
|
|
873
|
-
return query;
|
|
915
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
874
916
|
}
|
|
875
917
|
const getCreatePasswordUrl = () => {
|
|
876
918
|
return `https://api.workos.com/_widgets/UserProfile/create-password`;
|
|
@@ -900,78 +942,15 @@ const getCreatePasswordMutationOptions = (options) => {
|
|
|
900
942
|
return { mutationFn, ...mutationOptions };
|
|
901
943
|
};
|
|
902
944
|
const useCreatePassword = (options, queryClient) => {
|
|
903
|
-
|
|
904
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
905
|
-
};
|
|
906
|
-
const getUpdatePasswordUrl = () => {
|
|
907
|
-
return `https://api.workos.com/_widgets/UserProfile/update-password`;
|
|
908
|
-
};
|
|
909
|
-
const updatePassword = async (updatePasswordRequest, options) => {
|
|
910
|
-
const res = await fetch(getUpdatePasswordUrl(), {
|
|
911
|
-
...options,
|
|
912
|
-
method: "POST",
|
|
913
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
914
|
-
body: JSON.stringify(updatePasswordRequest)
|
|
915
|
-
});
|
|
916
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
917
|
-
const data = body ? JSON.parse(body) : {};
|
|
918
|
-
return {
|
|
919
|
-
data,
|
|
920
|
-
status: res.status,
|
|
921
|
-
headers: res.headers
|
|
922
|
-
};
|
|
923
|
-
};
|
|
924
|
-
const getUpdatePasswordMutationOptions = (options) => {
|
|
925
|
-
const mutationKey = ["updatePassword"];
|
|
926
|
-
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 };
|
|
927
|
-
const mutationFn = (props) => {
|
|
928
|
-
const { data } = props ?? {};
|
|
929
|
-
return updatePassword(data, fetchOptions);
|
|
930
|
-
};
|
|
931
|
-
return { mutationFn, ...mutationOptions };
|
|
932
|
-
};
|
|
933
|
-
const useUpdatePassword = (options, queryClient) => {
|
|
934
|
-
const mutationOptions = getUpdatePasswordMutationOptions(options);
|
|
935
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
936
|
-
};
|
|
937
|
-
const getRevokeAllSessionsUrl = () => {
|
|
938
|
-
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
|
|
939
|
-
};
|
|
940
|
-
const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
941
|
-
const res = await fetch(getRevokeAllSessionsUrl(), {
|
|
942
|
-
...options,
|
|
943
|
-
method: "DELETE",
|
|
944
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
945
|
-
body: JSON.stringify(revokeAllSessionsRequest)
|
|
946
|
-
});
|
|
947
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
948
|
-
const data = body ? JSON.parse(body) : {};
|
|
949
|
-
return {
|
|
950
|
-
data,
|
|
951
|
-
status: res.status,
|
|
952
|
-
headers: res.headers
|
|
953
|
-
};
|
|
954
|
-
};
|
|
955
|
-
const getRevokeAllSessionsMutationOptions = (options) => {
|
|
956
|
-
const mutationKey = ["revokeAllSessions"];
|
|
957
|
-
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 };
|
|
958
|
-
const mutationFn = (props) => {
|
|
959
|
-
const { data } = props ?? {};
|
|
960
|
-
return revokeAllSessions(data, fetchOptions);
|
|
961
|
-
};
|
|
962
|
-
return { mutationFn, ...mutationOptions };
|
|
963
|
-
};
|
|
964
|
-
const useRevokeAllSessions = (options, queryClient) => {
|
|
965
|
-
const mutationOptions = getRevokeAllSessionsMutationOptions(options);
|
|
966
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
945
|
+
return (0, import_react_query.useMutation)(getCreatePasswordMutationOptions(options), queryClient);
|
|
967
946
|
};
|
|
968
|
-
const
|
|
969
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
947
|
+
const getCreateTotpFactorUrl = () => {
|
|
948
|
+
return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
|
|
970
949
|
};
|
|
971
|
-
const
|
|
972
|
-
const res = await fetch(
|
|
950
|
+
const createTotpFactor = async (options) => {
|
|
951
|
+
const res = await fetch(getCreateTotpFactorUrl(), {
|
|
973
952
|
...options,
|
|
974
|
-
method: "
|
|
953
|
+
method: "POST"
|
|
975
954
|
});
|
|
976
955
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
977
956
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -981,102 +960,68 @@ const revokeSession = async (sessionId, options) => {
|
|
|
981
960
|
headers: res.headers
|
|
982
961
|
};
|
|
983
962
|
};
|
|
984
|
-
const
|
|
985
|
-
const mutationKey = ["
|
|
963
|
+
const getCreateTotpFactorMutationOptions = (options) => {
|
|
964
|
+
const mutationKey = ["createTotpFactor"];
|
|
986
965
|
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 };
|
|
987
|
-
const mutationFn = (
|
|
988
|
-
|
|
989
|
-
return revokeSession(sessionId, fetchOptions);
|
|
966
|
+
const mutationFn = () => {
|
|
967
|
+
return createTotpFactor(fetchOptions);
|
|
990
968
|
};
|
|
991
969
|
return { mutationFn, ...mutationOptions };
|
|
992
970
|
};
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
996
|
-
};
|
|
997
|
-
const getSessionsUrl = () => {
|
|
998
|
-
return `https://api.workos.com/_widgets/UserProfile/sessions`;
|
|
999
|
-
};
|
|
1000
|
-
const sessions = async (options) => {
|
|
1001
|
-
const res = await fetch(getSessionsUrl(), {
|
|
1002
|
-
...options,
|
|
1003
|
-
method: "GET"
|
|
1004
|
-
});
|
|
1005
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1006
|
-
const data = body ? JSON.parse(body) : {};
|
|
1007
|
-
return { data, status: res.status, headers: res.headers };
|
|
1008
|
-
};
|
|
1009
|
-
const getSessionsQueryKey = () => {
|
|
1010
|
-
return [`https://api.workos.com/_widgets/UserProfile/sessions`];
|
|
1011
|
-
};
|
|
1012
|
-
const getSessionsQueryOptions = (options) => {
|
|
1013
|
-
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1014
|
-
const queryKey = queryOptions?.queryKey ?? getSessionsQueryKey();
|
|
1015
|
-
const queryFn = ({
|
|
1016
|
-
signal
|
|
1017
|
-
}) => sessions({ signal, ...fetchOptions });
|
|
1018
|
-
return { queryKey, queryFn, ...queryOptions };
|
|
971
|
+
const useCreateTotpFactor = (options, queryClient) => {
|
|
972
|
+
return (0, import_react_query.useMutation)(getCreateTotpFactorMutationOptions(options), queryClient);
|
|
1019
973
|
};
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1023
|
-
query.queryKey = queryOptions.queryKey;
|
|
1024
|
-
return query;
|
|
1025
|
-
}
|
|
1026
|
-
const getSendVerificationUrl = () => {
|
|
1027
|
-
return `https://api.workos.com/_widgets/UserProfile/send-verification`;
|
|
974
|
+
const getMeUrl = () => {
|
|
975
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
1028
976
|
};
|
|
1029
|
-
const
|
|
1030
|
-
const res = await fetch(
|
|
977
|
+
const me = async (options) => {
|
|
978
|
+
const res = await fetch(getMeUrl(), {
|
|
1031
979
|
...options,
|
|
1032
|
-
method: "
|
|
980
|
+
method: "GET"
|
|
1033
981
|
});
|
|
1034
982
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1035
983
|
const data = body ? JSON.parse(body) : {};
|
|
1036
|
-
return {
|
|
1037
|
-
data,
|
|
1038
|
-
status: res.status,
|
|
1039
|
-
headers: res.headers
|
|
1040
|
-
};
|
|
984
|
+
return { data, status: res.status, headers: res.headers };
|
|
1041
985
|
};
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
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 };
|
|
1045
|
-
const mutationFn = () => {
|
|
1046
|
-
return sendVerification(fetchOptions);
|
|
1047
|
-
};
|
|
1048
|
-
return { mutationFn, ...mutationOptions };
|
|
986
|
+
const getMeQueryKey = () => {
|
|
987
|
+
return [`https://api.workos.com/_widgets/UserProfile/me`];
|
|
1049
988
|
};
|
|
1050
|
-
const
|
|
1051
|
-
const
|
|
1052
|
-
|
|
989
|
+
const getMeQueryOptions = (options) => {
|
|
990
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
991
|
+
const queryKey = queryOptions?.queryKey ?? getMeQueryKey();
|
|
992
|
+
const queryFn = ({ signal }) => me({ signal, ...fetchOptions });
|
|
993
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1053
994
|
};
|
|
1054
|
-
|
|
1055
|
-
|
|
995
|
+
function useMe(options, queryClient) {
|
|
996
|
+
const queryOptions = getMeQueryOptions(options);
|
|
997
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
998
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
999
|
+
}
|
|
1000
|
+
const getUpdateMeUrl = () => {
|
|
1001
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
1056
1002
|
};
|
|
1057
|
-
const
|
|
1058
|
-
const res = await fetch(
|
|
1003
|
+
const updateMe = async (updateMeBody, options) => {
|
|
1004
|
+
const res = await fetch(getUpdateMeUrl(), {
|
|
1059
1005
|
...options,
|
|
1060
1006
|
method: "POST",
|
|
1061
1007
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1062
|
-
body: JSON.stringify(
|
|
1008
|
+
body: JSON.stringify(updateMeBody)
|
|
1063
1009
|
});
|
|
1064
1010
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1065
1011
|
const data = body ? JSON.parse(body) : {};
|
|
1066
1012
|
return { data, status: res.status, headers: res.headers };
|
|
1067
1013
|
};
|
|
1068
|
-
const
|
|
1069
|
-
const mutationKey = ["
|
|
1014
|
+
const getUpdateMeMutationOptions = (options) => {
|
|
1015
|
+
const mutationKey = ["updateMe"];
|
|
1070
1016
|
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 };
|
|
1071
1017
|
const mutationFn = (props) => {
|
|
1072
1018
|
const { data } = props ?? {};
|
|
1073
|
-
return
|
|
1019
|
+
return updateMe(data, fetchOptions);
|
|
1074
1020
|
};
|
|
1075
1021
|
return { mutationFn, ...mutationOptions };
|
|
1076
1022
|
};
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
1023
|
+
const useUpdateMe = (options, queryClient) => {
|
|
1024
|
+
return (0, import_react_query.useMutation)(getUpdateMeMutationOptions(options), queryClient);
|
|
1080
1025
|
};
|
|
1081
1026
|
const getRegisterPasskeyUrl = () => {
|
|
1082
1027
|
return `https://api.workos.com/_widgets/UserProfile/passkeys`;
|
|
@@ -1103,8 +1048,7 @@ const getRegisterPasskeyMutationOptions = (options) => {
|
|
|
1103
1048
|
return { mutationFn, ...mutationOptions };
|
|
1104
1049
|
};
|
|
1105
1050
|
const useRegisterPasskey = (options, queryClient) => {
|
|
1106
|
-
|
|
1107
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
1051
|
+
return (0, import_react_query.useMutation)(getRegisterPasskeyMutationOptions(options), queryClient);
|
|
1108
1052
|
};
|
|
1109
1053
|
const getVerifyPasskeyUrl = () => {
|
|
1110
1054
|
return `https://api.workos.com/_widgets/UserProfile/passkeys/verify`;
|
|
@@ -1134,8 +1078,7 @@ const getVerifyPasskeyMutationOptions = (options) => {
|
|
|
1134
1078
|
return { mutationFn, ...mutationOptions };
|
|
1135
1079
|
};
|
|
1136
1080
|
const useVerifyPasskey = (options, queryClient) => {
|
|
1137
|
-
|
|
1138
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
1081
|
+
return (0, import_react_query.useMutation)(getVerifyPasskeyMutationOptions(options), queryClient);
|
|
1139
1082
|
};
|
|
1140
1083
|
const getDeletePasskeyUrl = (passkeyId) => {
|
|
1141
1084
|
return `https://api.workos.com/_widgets/UserProfile/passkeys/${passkeyId}`;
|
|
@@ -1163,14 +1106,40 @@ const getDeletePasskeyMutationOptions = (options) => {
|
|
|
1163
1106
|
return { mutationFn, ...mutationOptions };
|
|
1164
1107
|
};
|
|
1165
1108
|
const useDeletePasskey = (options, queryClient) => {
|
|
1166
|
-
|
|
1167
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
1109
|
+
return (0, import_react_query.useMutation)(getDeletePasskeyMutationOptions(options), queryClient);
|
|
1168
1110
|
};
|
|
1169
|
-
const
|
|
1170
|
-
return `https://api.workos.com/_widgets/
|
|
1111
|
+
const getSendVerificationUrl = () => {
|
|
1112
|
+
return `https://api.workos.com/_widgets/UserProfile/send-verification`;
|
|
1171
1113
|
};
|
|
1172
|
-
const
|
|
1173
|
-
const res = await fetch(
|
|
1114
|
+
const sendVerification = async (options) => {
|
|
1115
|
+
const res = await fetch(getSendVerificationUrl(), {
|
|
1116
|
+
...options,
|
|
1117
|
+
method: "POST"
|
|
1118
|
+
});
|
|
1119
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1120
|
+
const data = body ? JSON.parse(body) : {};
|
|
1121
|
+
return {
|
|
1122
|
+
data,
|
|
1123
|
+
status: res.status,
|
|
1124
|
+
headers: res.headers
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
const getSendVerificationMutationOptions = (options) => {
|
|
1128
|
+
const mutationKey = ["sendVerification"];
|
|
1129
|
+
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 };
|
|
1130
|
+
const mutationFn = () => {
|
|
1131
|
+
return sendVerification(fetchOptions);
|
|
1132
|
+
};
|
|
1133
|
+
return { mutationFn, ...mutationOptions };
|
|
1134
|
+
};
|
|
1135
|
+
const useSendVerification = (options, queryClient) => {
|
|
1136
|
+
return (0, import_react_query.useMutation)(getSendVerificationMutationOptions(options), queryClient);
|
|
1137
|
+
};
|
|
1138
|
+
const getSessionsUrl = () => {
|
|
1139
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions`;
|
|
1140
|
+
};
|
|
1141
|
+
const sessions = async (options) => {
|
|
1142
|
+
const res = await fetch(getSessionsUrl(), {
|
|
1174
1143
|
...options,
|
|
1175
1144
|
method: "GET"
|
|
1176
1145
|
});
|
|
@@ -1178,30 +1147,31 @@ const settings = async (options) => {
|
|
|
1178
1147
|
const data = body ? JSON.parse(body) : {};
|
|
1179
1148
|
return { data, status: res.status, headers: res.headers };
|
|
1180
1149
|
};
|
|
1181
|
-
const
|
|
1182
|
-
return [`https://api.workos.com/_widgets/
|
|
1150
|
+
const getSessionsQueryKey = () => {
|
|
1151
|
+
return [`https://api.workos.com/_widgets/UserProfile/sessions`];
|
|
1183
1152
|
};
|
|
1184
|
-
const
|
|
1153
|
+
const getSessionsQueryOptions = (options) => {
|
|
1185
1154
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1186
|
-
const queryKey = queryOptions?.queryKey ??
|
|
1155
|
+
const queryKey = queryOptions?.queryKey ?? getSessionsQueryKey();
|
|
1187
1156
|
const queryFn = ({
|
|
1188
1157
|
signal
|
|
1189
|
-
}) =>
|
|
1158
|
+
}) => sessions({ signal, ...fetchOptions });
|
|
1190
1159
|
return { queryKey, queryFn, ...queryOptions };
|
|
1191
1160
|
};
|
|
1192
|
-
function
|
|
1193
|
-
const queryOptions =
|
|
1161
|
+
function useSessions(options, queryClient) {
|
|
1162
|
+
const queryOptions = getSessionsQueryOptions(options);
|
|
1194
1163
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1195
|
-
query
|
|
1196
|
-
return query;
|
|
1164
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
1197
1165
|
}
|
|
1198
|
-
const
|
|
1199
|
-
return `https://api.workos.com/_widgets/
|
|
1166
|
+
const getRevokeAllSessionsUrl = () => {
|
|
1167
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
|
|
1200
1168
|
};
|
|
1201
|
-
const
|
|
1202
|
-
const res = await fetch(
|
|
1169
|
+
const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
1170
|
+
const res = await fetch(getRevokeAllSessionsUrl(), {
|
|
1203
1171
|
...options,
|
|
1204
|
-
method: "
|
|
1172
|
+
method: "DELETE",
|
|
1173
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1174
|
+
body: JSON.stringify(revokeAllSessionsRequest)
|
|
1205
1175
|
});
|
|
1206
1176
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1207
1177
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1211,37 +1181,25 @@ const listOrganizationDomains = async (options) => {
|
|
|
1211
1181
|
headers: res.headers
|
|
1212
1182
|
};
|
|
1213
1183
|
};
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1184
|
+
const getRevokeAllSessionsMutationOptions = (options) => {
|
|
1185
|
+
const mutationKey = ["revokeAllSessions"];
|
|
1186
|
+
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 };
|
|
1187
|
+
const mutationFn = (props) => {
|
|
1188
|
+
const { data } = props ?? {};
|
|
1189
|
+
return revokeAllSessions(data, fetchOptions);
|
|
1190
|
+
};
|
|
1191
|
+
return { mutationFn, ...mutationOptions };
|
|
1218
1192
|
};
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1221
|
-
const queryKey = queryOptions?.queryKey ?? getListOrganizationDomainsQueryKey();
|
|
1222
|
-
const queryFn = ({ signal }) => listOrganizationDomains({ signal, ...fetchOptions });
|
|
1223
|
-
return { queryKey, queryFn, ...queryOptions };
|
|
1193
|
+
const useRevokeAllSessions = (options, queryClient) => {
|
|
1194
|
+
return (0, import_react_query.useMutation)(getRevokeAllSessionsMutationOptions(options), queryClient);
|
|
1224
1195
|
};
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1228
|
-
query.queryKey = queryOptions.queryKey;
|
|
1229
|
-
return query;
|
|
1230
|
-
}
|
|
1231
|
-
const getGenerateAdminPortalLinkUrl = (params) => {
|
|
1232
|
-
const normalizedParams = new URLSearchParams();
|
|
1233
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1234
|
-
if (value !== void 0) {
|
|
1235
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1236
|
-
}
|
|
1237
|
-
});
|
|
1238
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1239
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
1196
|
+
const getRevokeSessionUrl = (sessionId) => {
|
|
1197
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;
|
|
1240
1198
|
};
|
|
1241
|
-
const
|
|
1242
|
-
const res = await fetch(
|
|
1199
|
+
const revokeSession = async (sessionId, options) => {
|
|
1200
|
+
const res = await fetch(getRevokeSessionUrl(sessionId), {
|
|
1243
1201
|
...options,
|
|
1244
|
-
method: "
|
|
1202
|
+
method: "DELETE"
|
|
1245
1203
|
});
|
|
1246
1204
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1247
1205
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1251,24 +1209,23 @@ const generateAdminPortalLink = async (params, options) => {
|
|
|
1251
1209
|
headers: res.headers
|
|
1252
1210
|
};
|
|
1253
1211
|
};
|
|
1254
|
-
const
|
|
1255
|
-
const mutationKey = ["
|
|
1212
|
+
const getRevokeSessionMutationOptions = (options) => {
|
|
1213
|
+
const mutationKey = ["revokeSession"];
|
|
1256
1214
|
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 };
|
|
1257
1215
|
const mutationFn = (props) => {
|
|
1258
|
-
const {
|
|
1259
|
-
return
|
|
1216
|
+
const { sessionId } = props ?? {};
|
|
1217
|
+
return revokeSession(sessionId, fetchOptions);
|
|
1260
1218
|
};
|
|
1261
1219
|
return { mutationFn, ...mutationOptions };
|
|
1262
1220
|
};
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1265
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
1221
|
+
const useRevokeSession = (options, queryClient) => {
|
|
1222
|
+
return (0, import_react_query.useMutation)(getRevokeSessionMutationOptions(options), queryClient);
|
|
1266
1223
|
};
|
|
1267
|
-
const
|
|
1268
|
-
return `https://api.workos.com/_widgets/
|
|
1224
|
+
const getDeleteTotpFactorsUrl = () => {
|
|
1225
|
+
return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
|
|
1269
1226
|
};
|
|
1270
|
-
const
|
|
1271
|
-
const res = await fetch(
|
|
1227
|
+
const deleteTotpFactors = async (options) => {
|
|
1228
|
+
const res = await fetch(getDeleteTotpFactorsUrl(), {
|
|
1272
1229
|
...options,
|
|
1273
1230
|
method: "DELETE"
|
|
1274
1231
|
});
|
|
@@ -1280,26 +1237,82 @@ const deleteOrganizationDomain = async (domainId, options) => {
|
|
|
1280
1237
|
headers: res.headers
|
|
1281
1238
|
};
|
|
1282
1239
|
};
|
|
1283
|
-
const
|
|
1284
|
-
const mutationKey = ["
|
|
1240
|
+
const getDeleteTotpFactorsMutationOptions = (options) => {
|
|
1241
|
+
const mutationKey = ["deleteTotpFactors"];
|
|
1242
|
+
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 };
|
|
1243
|
+
const mutationFn = () => {
|
|
1244
|
+
return deleteTotpFactors(fetchOptions);
|
|
1245
|
+
};
|
|
1246
|
+
return { mutationFn, ...mutationOptions };
|
|
1247
|
+
};
|
|
1248
|
+
const useDeleteTotpFactors = (options, queryClient) => {
|
|
1249
|
+
return (0, import_react_query.useMutation)(getDeleteTotpFactorsMutationOptions(options), queryClient);
|
|
1250
|
+
};
|
|
1251
|
+
const getUpdatePasswordUrl = () => {
|
|
1252
|
+
return `https://api.workos.com/_widgets/UserProfile/update-password`;
|
|
1253
|
+
};
|
|
1254
|
+
const updatePassword = async (updatePasswordRequest, options) => {
|
|
1255
|
+
const res = await fetch(getUpdatePasswordUrl(), {
|
|
1256
|
+
...options,
|
|
1257
|
+
method: "POST",
|
|
1258
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1259
|
+
body: JSON.stringify(updatePasswordRequest)
|
|
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 getUpdatePasswordMutationOptions = (options) => {
|
|
1270
|
+
const mutationKey = ["updatePassword"];
|
|
1285
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 };
|
|
1286
1272
|
const mutationFn = (props) => {
|
|
1287
|
-
const {
|
|
1288
|
-
return
|
|
1273
|
+
const { data } = props ?? {};
|
|
1274
|
+
return updatePassword(data, fetchOptions);
|
|
1289
1275
|
};
|
|
1290
1276
|
return { mutationFn, ...mutationOptions };
|
|
1291
1277
|
};
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1294
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
1278
|
+
const useUpdatePassword = (options, queryClient) => {
|
|
1279
|
+
return (0, import_react_query.useMutation)(getUpdatePasswordMutationOptions(options), queryClient);
|
|
1295
1280
|
};
|
|
1296
|
-
const
|
|
1297
|
-
return `https://api.workos.com/_widgets/
|
|
1281
|
+
const getVerifyUrl = () => {
|
|
1282
|
+
return `https://api.workos.com/_widgets/UserProfile/verify`;
|
|
1298
1283
|
};
|
|
1299
|
-
const
|
|
1300
|
-
const res = await fetch(
|
|
1284
|
+
const verify = async (verifyRequest, options) => {
|
|
1285
|
+
const res = await fetch(getVerifyUrl(), {
|
|
1301
1286
|
...options,
|
|
1302
|
-
method: "POST"
|
|
1287
|
+
method: "POST",
|
|
1288
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1289
|
+
body: JSON.stringify(verifyRequest)
|
|
1290
|
+
});
|
|
1291
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1292
|
+
const data = body ? JSON.parse(body) : {};
|
|
1293
|
+
return { data, status: res.status, headers: res.headers };
|
|
1294
|
+
};
|
|
1295
|
+
const getVerifyMutationOptions = (options) => {
|
|
1296
|
+
const mutationKey = ["verify"];
|
|
1297
|
+
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 };
|
|
1298
|
+
const mutationFn = (props) => {
|
|
1299
|
+
const { data } = props ?? {};
|
|
1300
|
+
return verify(data, fetchOptions);
|
|
1301
|
+
};
|
|
1302
|
+
return { mutationFn, ...mutationOptions };
|
|
1303
|
+
};
|
|
1304
|
+
const useVerify = (options, queryClient) => {
|
|
1305
|
+
return (0, import_react_query.useMutation)(getVerifyMutationOptions(options), queryClient);
|
|
1306
|
+
};
|
|
1307
|
+
const getVerifyTotpFactorUrl = () => {
|
|
1308
|
+
return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
|
|
1309
|
+
};
|
|
1310
|
+
const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
1311
|
+
const res = await fetch(getVerifyTotpFactorUrl(), {
|
|
1312
|
+
...options,
|
|
1313
|
+
method: "POST",
|
|
1314
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1315
|
+
body: JSON.stringify(verifyTotpFactorRequest)
|
|
1303
1316
|
});
|
|
1304
1317
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1305
1318
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1309,24 +1322,23 @@ const reverifyOrganizationDomain = async (domainId, options) => {
|
|
|
1309
1322
|
headers: res.headers
|
|
1310
1323
|
};
|
|
1311
1324
|
};
|
|
1312
|
-
const
|
|
1313
|
-
const mutationKey = ["
|
|
1325
|
+
const getVerifyTotpFactorMutationOptions = (options) => {
|
|
1326
|
+
const mutationKey = ["verifyTotpFactor"];
|
|
1314
1327
|
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 };
|
|
1315
1328
|
const mutationFn = (props) => {
|
|
1316
|
-
const {
|
|
1317
|
-
return
|
|
1329
|
+
const { data } = props ?? {};
|
|
1330
|
+
return verifyTotpFactor(data, fetchOptions);
|
|
1318
1331
|
};
|
|
1319
1332
|
return { mutationFn, ...mutationOptions };
|
|
1320
1333
|
};
|
|
1321
|
-
const
|
|
1322
|
-
|
|
1323
|
-
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
1334
|
+
const useVerifyTotpFactor = (options, queryClient) => {
|
|
1335
|
+
return (0, import_react_query.useMutation)(getVerifyTotpFactorMutationOptions(options), queryClient);
|
|
1324
1336
|
};
|
|
1325
|
-
const
|
|
1326
|
-
return `https://api.workos.com/_widgets/admin-portal/
|
|
1337
|
+
const getGetAuditLogStreamUrl = () => {
|
|
1338
|
+
return `https://api.workos.com/_widgets/admin-portal/audit-log-stream`;
|
|
1327
1339
|
};
|
|
1328
|
-
const
|
|
1329
|
-
const res = await fetch(
|
|
1340
|
+
const getAuditLogStream = async (options) => {
|
|
1341
|
+
const res = await fetch(getGetAuditLogStreamUrl(), {
|
|
1330
1342
|
...options,
|
|
1331
1343
|
method: "GET"
|
|
1332
1344
|
});
|
|
@@ -1338,32 +1350,36 @@ const listSsoConnections = async (options) => {
|
|
|
1338
1350
|
headers: res.headers
|
|
1339
1351
|
};
|
|
1340
1352
|
};
|
|
1341
|
-
const
|
|
1353
|
+
const getGetAuditLogStreamQueryKey = () => {
|
|
1342
1354
|
return [
|
|
1343
|
-
`https://api.workos.com/_widgets/admin-portal/
|
|
1355
|
+
`https://api.workos.com/_widgets/admin-portal/audit-log-stream`
|
|
1344
1356
|
];
|
|
1345
1357
|
};
|
|
1346
|
-
const
|
|
1358
|
+
const getGetAuditLogStreamQueryOptions = (options) => {
|
|
1347
1359
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1348
|
-
const queryKey = queryOptions?.queryKey ??
|
|
1349
|
-
const queryFn = ({ signal }) =>
|
|
1360
|
+
const queryKey = queryOptions?.queryKey ?? getGetAuditLogStreamQueryKey();
|
|
1361
|
+
const queryFn = ({ signal }) => getAuditLogStream({ signal, ...fetchOptions });
|
|
1350
1362
|
return { queryKey, queryFn, ...queryOptions };
|
|
1351
1363
|
};
|
|
1352
|
-
function
|
|
1353
|
-
const queryOptions =
|
|
1364
|
+
function useGetAuditLogStream(options, queryClient) {
|
|
1365
|
+
const queryOptions = getGetAuditLogStreamQueryOptions(options);
|
|
1354
1366
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1355
|
-
query
|
|
1356
|
-
return query;
|
|
1367
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
1357
1368
|
}
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1369
|
+
const getGenerateAdminPortalLinkUrl = (params) => {
|
|
1370
|
+
const normalizedParams = new URLSearchParams();
|
|
1371
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1372
|
+
if (value !== void 0) {
|
|
1373
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1374
|
+
}
|
|
1375
|
+
});
|
|
1376
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1377
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
1360
1378
|
};
|
|
1361
|
-
const
|
|
1362
|
-
const res = await fetch(
|
|
1379
|
+
const generateAdminPortalLink = async (params, options) => {
|
|
1380
|
+
const res = await fetch(getGenerateAdminPortalLinkUrl(params), {
|
|
1363
1381
|
...options,
|
|
1364
|
-
method: "POST"
|
|
1365
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1366
|
-
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
1382
|
+
method: "POST"
|
|
1367
1383
|
});
|
|
1368
1384
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1369
1385
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1373,31 +1389,26 @@ const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options
|
|
|
1373
1389
|
headers: res.headers
|
|
1374
1390
|
};
|
|
1375
1391
|
};
|
|
1376
|
-
const
|
|
1377
|
-
const mutationKey = ["
|
|
1392
|
+
const getGenerateAdminPortalLinkMutationOptions = (options) => {
|
|
1393
|
+
const mutationKey = ["generateAdminPortalLink"];
|
|
1378
1394
|
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 };
|
|
1379
1395
|
const mutationFn = (props) => {
|
|
1380
|
-
const {
|
|
1381
|
-
return
|
|
1396
|
+
const { params } = props ?? {};
|
|
1397
|
+
return generateAdminPortalLink(params, fetchOptions);
|
|
1382
1398
|
};
|
|
1383
1399
|
return { mutationFn, ...mutationOptions };
|
|
1384
1400
|
};
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1387
|
-
|
|
1401
|
+
const useGenerateAdminPortalLink = (options, queryClient) => {
|
|
1402
|
+
return (0, import_react_query.useMutation)(
|
|
1403
|
+
getGenerateAdminPortalLinkMutationOptions(options),
|
|
1404
|
+
queryClient
|
|
1405
|
+
);
|
|
1388
1406
|
};
|
|
1389
|
-
const
|
|
1390
|
-
|
|
1391
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1392
|
-
if (value !== void 0) {
|
|
1393
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1394
|
-
}
|
|
1395
|
-
});
|
|
1396
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1397
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
1407
|
+
const getListOrganizationDomainsUrl = () => {
|
|
1408
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains`;
|
|
1398
1409
|
};
|
|
1399
|
-
const
|
|
1400
|
-
const res = await fetch(
|
|
1410
|
+
const listOrganizationDomains = async (options) => {
|
|
1411
|
+
const res = await fetch(getListOrganizationDomainsUrl(), {
|
|
1401
1412
|
...options,
|
|
1402
1413
|
method: "GET"
|
|
1403
1414
|
});
|
|
@@ -1409,38 +1420,29 @@ const listOrganizationApiKeys = async (params, options) => {
|
|
|
1409
1420
|
headers: res.headers
|
|
1410
1421
|
};
|
|
1411
1422
|
};
|
|
1412
|
-
const
|
|
1423
|
+
const getListOrganizationDomainsQueryKey = () => {
|
|
1413
1424
|
return [
|
|
1414
|
-
`https://api.workos.com/_widgets/
|
|
1415
|
-
...params ? [params] : []
|
|
1425
|
+
`https://api.workos.com/_widgets/admin-portal/organization-domains`
|
|
1416
1426
|
];
|
|
1417
1427
|
};
|
|
1418
|
-
const
|
|
1428
|
+
const getListOrganizationDomainsQueryOptions = (options) => {
|
|
1419
1429
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1420
|
-
const queryKey = queryOptions?.queryKey ??
|
|
1421
|
-
const queryFn = ({ signal }) =>
|
|
1430
|
+
const queryKey = queryOptions?.queryKey ?? getListOrganizationDomainsQueryKey();
|
|
1431
|
+
const queryFn = ({ signal }) => listOrganizationDomains({ signal, ...fetchOptions });
|
|
1422
1432
|
return { queryKey, queryFn, ...queryOptions };
|
|
1423
1433
|
};
|
|
1424
|
-
function
|
|
1425
|
-
const queryOptions =
|
|
1434
|
+
function useListOrganizationDomains(options, queryClient) {
|
|
1435
|
+
const queryOptions = getListOrganizationDomainsQueryOptions(options);
|
|
1426
1436
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1427
|
-
query
|
|
1428
|
-
return query;
|
|
1437
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
1429
1438
|
}
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1432
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1433
|
-
if (value !== void 0) {
|
|
1434
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1435
|
-
}
|
|
1436
|
-
});
|
|
1437
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1438
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
1439
|
+
const getDeleteOrganizationDomainUrl = (domainId) => {
|
|
1440
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;
|
|
1439
1441
|
};
|
|
1440
|
-
const
|
|
1441
|
-
const res = await fetch(
|
|
1442
|
+
const deleteOrganizationDomain = async (domainId, options) => {
|
|
1443
|
+
const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {
|
|
1442
1444
|
...options,
|
|
1443
|
-
method: "
|
|
1445
|
+
method: "DELETE"
|
|
1444
1446
|
});
|
|
1445
1447
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1446
1448
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1450,34 +1452,28 @@ const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
|
1450
1452
|
headers: res.headers
|
|
1451
1453
|
};
|
|
1452
1454
|
};
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
const queryKey = queryOptions?.queryKey ?? getListOrganizationApiKeyPermissionsQueryKey(params);
|
|
1462
|
-
const queryFn = ({ signal }) => listOrganizationApiKeyPermissions(params, { signal, ...fetchOptions });
|
|
1463
|
-
return { queryKey, queryFn, ...queryOptions };
|
|
1455
|
+
const getDeleteOrganizationDomainMutationOptions = (options) => {
|
|
1456
|
+
const mutationKey = ["deleteOrganizationDomain"];
|
|
1457
|
+
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 };
|
|
1458
|
+
const mutationFn = (props) => {
|
|
1459
|
+
const { domainId } = props ?? {};
|
|
1460
|
+
return deleteOrganizationDomain(domainId, fetchOptions);
|
|
1461
|
+
};
|
|
1462
|
+
return { mutationFn, ...mutationOptions };
|
|
1464
1463
|
};
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1464
|
+
const useDeleteOrganizationDomain = (options, queryClient) => {
|
|
1465
|
+
return (0, import_react_query.useMutation)(
|
|
1466
|
+
getDeleteOrganizationDomainMutationOptions(options),
|
|
1467
|
+
queryClient
|
|
1469
1468
|
);
|
|
1470
|
-
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1471
|
-
query.queryKey = queryOptions.queryKey;
|
|
1472
|
-
return query;
|
|
1473
|
-
}
|
|
1474
|
-
const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
|
|
1475
|
-
return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
|
|
1476
1469
|
};
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1470
|
+
const getReverifyOrganizationDomainUrl = (domainId) => {
|
|
1471
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;
|
|
1472
|
+
};
|
|
1473
|
+
const reverifyOrganizationDomain = async (domainId, options) => {
|
|
1474
|
+
const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {
|
|
1479
1475
|
...options,
|
|
1480
|
-
method: "
|
|
1476
|
+
method: "POST"
|
|
1481
1477
|
});
|
|
1482
1478
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1483
1479
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1487,24 +1483,26 @@ const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
|
1487
1483
|
headers: res.headers
|
|
1488
1484
|
};
|
|
1489
1485
|
};
|
|
1490
|
-
const
|
|
1491
|
-
const mutationKey = ["
|
|
1486
|
+
const getReverifyOrganizationDomainMutationOptions = (options) => {
|
|
1487
|
+
const mutationKey = ["reverifyOrganizationDomain"];
|
|
1492
1488
|
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 };
|
|
1493
1489
|
const mutationFn = (props) => {
|
|
1494
|
-
const {
|
|
1495
|
-
return
|
|
1490
|
+
const { domainId } = props ?? {};
|
|
1491
|
+
return reverifyOrganizationDomain(domainId, fetchOptions);
|
|
1496
1492
|
};
|
|
1497
1493
|
return { mutationFn, ...mutationOptions };
|
|
1498
1494
|
};
|
|
1499
|
-
const
|
|
1500
|
-
|
|
1501
|
-
|
|
1495
|
+
const useReverifyOrganizationDomain = (options, queryClient) => {
|
|
1496
|
+
return (0, import_react_query.useMutation)(
|
|
1497
|
+
getReverifyOrganizationDomainMutationOptions(options),
|
|
1498
|
+
queryClient
|
|
1499
|
+
);
|
|
1502
1500
|
};
|
|
1503
|
-
const
|
|
1504
|
-
return `https://api.workos.com/_widgets/
|
|
1501
|
+
const getListSsoConnectionsUrl = () => {
|
|
1502
|
+
return `https://api.workos.com/_widgets/admin-portal/sso-connections`;
|
|
1505
1503
|
};
|
|
1506
|
-
const
|
|
1507
|
-
const res = await fetch(
|
|
1504
|
+
const listSsoConnections = async (options) => {
|
|
1505
|
+
const res = await fetch(getListSsoConnectionsUrl(), {
|
|
1508
1506
|
...options,
|
|
1509
1507
|
method: "GET"
|
|
1510
1508
|
});
|
|
@@ -1516,33 +1514,27 @@ const myDataIntegrations = async (options) => {
|
|
|
1516
1514
|
headers: res.headers
|
|
1517
1515
|
};
|
|
1518
1516
|
};
|
|
1519
|
-
const
|
|
1520
|
-
return [
|
|
1517
|
+
const getListSsoConnectionsQueryKey = () => {
|
|
1518
|
+
return [
|
|
1519
|
+
`https://api.workos.com/_widgets/admin-portal/sso-connections`
|
|
1520
|
+
];
|
|
1521
1521
|
};
|
|
1522
|
-
const
|
|
1522
|
+
const getListSsoConnectionsQueryOptions = (options) => {
|
|
1523
1523
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1524
|
-
const queryKey = queryOptions?.queryKey ??
|
|
1525
|
-
const queryFn = ({ signal }) =>
|
|
1524
|
+
const queryKey = queryOptions?.queryKey ?? getListSsoConnectionsQueryKey();
|
|
1525
|
+
const queryFn = ({ signal }) => listSsoConnections({ signal, ...fetchOptions });
|
|
1526
1526
|
return { queryKey, queryFn, ...queryOptions };
|
|
1527
1527
|
};
|
|
1528
|
-
function
|
|
1529
|
-
const queryOptions =
|
|
1528
|
+
function useListSsoConnections(options, queryClient) {
|
|
1529
|
+
const queryOptions = getListSsoConnectionsQueryOptions(options);
|
|
1530
1530
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1531
|
-
query
|
|
1532
|
-
return query;
|
|
1531
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
1533
1532
|
}
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1536
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1537
|
-
if (value !== void 0) {
|
|
1538
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1539
|
-
}
|
|
1540
|
-
});
|
|
1541
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1542
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
1533
|
+
const getListDirectoriesUrl = () => {
|
|
1534
|
+
return `https://api.workos.com/_widgets/directory-sync/directories`;
|
|
1543
1535
|
};
|
|
1544
|
-
const
|
|
1545
|
-
const res = await fetch(
|
|
1536
|
+
const listDirectories = async (options) => {
|
|
1537
|
+
const res = await fetch(getListDirectoriesUrl(), {
|
|
1546
1538
|
...options,
|
|
1547
1539
|
method: "GET"
|
|
1548
1540
|
});
|
|
@@ -1554,44 +1546,32 @@ const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
|
1554
1546
|
headers: res.headers
|
|
1555
1547
|
};
|
|
1556
1548
|
};
|
|
1557
|
-
const
|
|
1549
|
+
const getListDirectoriesQueryKey = () => {
|
|
1558
1550
|
return [
|
|
1559
|
-
`https://api.workos.com/_widgets/
|
|
1560
|
-
...params ? [params] : []
|
|
1551
|
+
`https://api.workos.com/_widgets/directory-sync/directories`
|
|
1561
1552
|
];
|
|
1562
1553
|
};
|
|
1563
|
-
const
|
|
1554
|
+
const getListDirectoriesQueryOptions = (options) => {
|
|
1564
1555
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1565
|
-
const queryKey = queryOptions?.queryKey ??
|
|
1566
|
-
const queryFn = ({
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
enabled: !!slug,
|
|
1571
|
-
...queryOptions
|
|
1572
|
-
};
|
|
1556
|
+
const queryKey = queryOptions?.queryKey ?? getListDirectoriesQueryKey();
|
|
1557
|
+
const queryFn = ({
|
|
1558
|
+
signal
|
|
1559
|
+
}) => listDirectories({ signal, ...fetchOptions });
|
|
1560
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1573
1561
|
};
|
|
1574
|
-
function
|
|
1575
|
-
const queryOptions =
|
|
1576
|
-
slug,
|
|
1577
|
-
params,
|
|
1578
|
-
options
|
|
1579
|
-
);
|
|
1562
|
+
function useListDirectories(options, queryClient) {
|
|
1563
|
+
const queryOptions = getListDirectoriesQueryOptions(options);
|
|
1580
1564
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1581
|
-
query
|
|
1582
|
-
return query;
|
|
1565
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
1583
1566
|
}
|
|
1584
|
-
const
|
|
1585
|
-
return `https://api.workos.com/_widgets/
|
|
1567
|
+
const getGetDirectoryUrl = (directoryId) => {
|
|
1568
|
+
return `https://api.workos.com/_widgets/directory-sync/directories/${directoryId}`;
|
|
1586
1569
|
};
|
|
1587
|
-
const
|
|
1588
|
-
const res = await fetch(
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
method: "GET"
|
|
1593
|
-
}
|
|
1594
|
-
);
|
|
1570
|
+
const getDirectory = async (directoryId, options) => {
|
|
1571
|
+
const res = await fetch(getGetDirectoryUrl(directoryId), {
|
|
1572
|
+
...options,
|
|
1573
|
+
method: "GET"
|
|
1574
|
+
});
|
|
1595
1575
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1596
1576
|
const data = body ? JSON.parse(body) : {};
|
|
1597
1577
|
return {
|
|
@@ -1600,78 +1580,61 @@ const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state,
|
|
|
1600
1580
|
headers: res.headers
|
|
1601
1581
|
};
|
|
1602
1582
|
};
|
|
1603
|
-
const
|
|
1583
|
+
const getGetDirectoryQueryKey = (directoryId) => {
|
|
1604
1584
|
return [
|
|
1605
|
-
`https://api.workos.com/_widgets/
|
|
1585
|
+
`https://api.workos.com/_widgets/directory-sync/directories/${directoryId}`
|
|
1606
1586
|
];
|
|
1607
1587
|
};
|
|
1608
|
-
const
|
|
1588
|
+
const getGetDirectoryQueryOptions = (directoryId, options) => {
|
|
1609
1589
|
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1610
|
-
const queryKey = queryOptions?.queryKey ??
|
|
1611
|
-
const queryFn = ({
|
|
1612
|
-
signal
|
|
1613
|
-
|
|
1614
|
-
});
|
|
1590
|
+
const queryKey = queryOptions?.queryKey ?? getGetDirectoryQueryKey(directoryId);
|
|
1591
|
+
const queryFn = ({
|
|
1592
|
+
signal
|
|
1593
|
+
}) => getDirectory(directoryId, { signal, ...fetchOptions });
|
|
1615
1594
|
return {
|
|
1616
1595
|
queryKey,
|
|
1617
1596
|
queryFn,
|
|
1618
|
-
enabled: !!
|
|
1597
|
+
enabled: !!directoryId,
|
|
1619
1598
|
...queryOptions
|
|
1620
1599
|
};
|
|
1621
1600
|
};
|
|
1622
|
-
function
|
|
1623
|
-
const queryOptions =
|
|
1624
|
-
dataIntegrationId,
|
|
1625
|
-
state,
|
|
1626
|
-
options
|
|
1627
|
-
);
|
|
1601
|
+
function useGetDirectory(directoryId, options, queryClient) {
|
|
1602
|
+
const queryOptions = getGetDirectoryQueryOptions(directoryId, options);
|
|
1628
1603
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1629
|
-
query
|
|
1630
|
-
return query;
|
|
1604
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
1631
1605
|
}
|
|
1632
|
-
const
|
|
1633
|
-
return `https://api.workos.com/_widgets/
|
|
1606
|
+
const getSettingsUrl = () => {
|
|
1607
|
+
return `https://api.workos.com/_widgets/settings`;
|
|
1634
1608
|
};
|
|
1635
|
-
const
|
|
1636
|
-
const res = await fetch(
|
|
1609
|
+
const settings = async (options) => {
|
|
1610
|
+
const res = await fetch(getSettingsUrl(), {
|
|
1637
1611
|
...options,
|
|
1638
|
-
method: "
|
|
1612
|
+
method: "GET"
|
|
1639
1613
|
});
|
|
1640
1614
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1641
1615
|
const data = body ? JSON.parse(body) : {};
|
|
1642
|
-
return {
|
|
1643
|
-
data,
|
|
1644
|
-
status: res.status,
|
|
1645
|
-
headers: res.headers
|
|
1646
|
-
};
|
|
1616
|
+
return { data, status: res.status, headers: res.headers };
|
|
1647
1617
|
};
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1650
|
-
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 };
|
|
1651
|
-
const mutationFn = (props) => {
|
|
1652
|
-
const { installationId } = props ?? {};
|
|
1653
|
-
return deleteDataInstallation(installationId, fetchOptions);
|
|
1654
|
-
};
|
|
1655
|
-
return { mutationFn, ...mutationOptions };
|
|
1618
|
+
const getSettingsQueryKey = () => {
|
|
1619
|
+
return [`https://api.workos.com/_widgets/settings`];
|
|
1656
1620
|
};
|
|
1657
|
-
const
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1621
|
+
const getSettingsQueryOptions = (options) => {
|
|
1622
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
1623
|
+
const queryKey = queryOptions?.queryKey ?? getSettingsQueryKey();
|
|
1624
|
+
const queryFn = ({
|
|
1625
|
+
signal
|
|
1626
|
+
}) => settings({ signal, ...fetchOptions });
|
|
1627
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1660
1628
|
};
|
|
1629
|
+
function useSettings(options, queryClient) {
|
|
1630
|
+
const queryOptions = getSettingsQueryOptions(options);
|
|
1631
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
1632
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
1633
|
+
}
|
|
1661
1634
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1662
1635
|
0 && (module.exports = {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
|
|
1666
|
-
CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
|
|
1667
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfObject,
|
|
1668
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfType,
|
|
1669
|
-
DataInstallationObject,
|
|
1670
|
-
DataInstallationState,
|
|
1671
|
-
DataIntegrationCredentialsType,
|
|
1672
|
-
DataIntegrationIntegrationType,
|
|
1673
|
-
DataIntegrationObject,
|
|
1674
|
-
DataIntegrationOwnership,
|
|
1636
|
+
DirectoryState,
|
|
1637
|
+
DirectoryType,
|
|
1675
1638
|
DomainVerificationNameServer,
|
|
1676
1639
|
GenerateAdminPortalLinkIntent,
|
|
1677
1640
|
MemberActionsItem,
|
|
@@ -1679,14 +1642,6 @@ const useDeleteDataInstallation = (options, queryClient) => {
|
|
|
1679
1642
|
OidcSessionState,
|
|
1680
1643
|
OrganizationDomainState,
|
|
1681
1644
|
SamlSessionState,
|
|
1682
|
-
SendVerificationResponseType,
|
|
1683
|
-
SettingsResponseObject,
|
|
1684
|
-
SsoConnectionAnyOfEightAllOfProviderTag,
|
|
1685
|
-
SsoConnectionAnyOfEightAllOfState,
|
|
1686
|
-
SsoConnectionAnyOfEightAllOfType,
|
|
1687
|
-
SsoConnectionAnyOfProviderTag,
|
|
1688
|
-
SsoConnectionAnyOfState,
|
|
1689
|
-
SsoConnectionAnyOfType,
|
|
1690
1645
|
SsoConnectionSessionJSONState,
|
|
1691
1646
|
authenticationInformation,
|
|
1692
1647
|
createOrganizationApiKey,
|
|
@@ -1698,6 +1653,7 @@ const useDeleteDataInstallation = (options, queryClient) => {
|
|
|
1698
1653
|
deletePasskey,
|
|
1699
1654
|
deleteTotpFactors,
|
|
1700
1655
|
generateAdminPortalLink,
|
|
1656
|
+
getAuditLogStream,
|
|
1701
1657
|
getAuthenticationInformationQueryKey,
|
|
1702
1658
|
getAuthenticationInformationQueryOptions,
|
|
1703
1659
|
getAuthenticationInformationUrl,
|
|
@@ -1719,16 +1675,26 @@ const useDeleteDataInstallation = (options, queryClient) => {
|
|
|
1719
1675
|
getDeletePasskeyUrl,
|
|
1720
1676
|
getDeleteTotpFactorsMutationOptions,
|
|
1721
1677
|
getDeleteTotpFactorsUrl,
|
|
1678
|
+
getDirectory,
|
|
1722
1679
|
getGenerateAdminPortalLinkMutationOptions,
|
|
1723
1680
|
getGenerateAdminPortalLinkUrl,
|
|
1681
|
+
getGetAuditLogStreamQueryKey,
|
|
1682
|
+
getGetAuditLogStreamQueryOptions,
|
|
1683
|
+
getGetAuditLogStreamUrl,
|
|
1724
1684
|
getGetDataInstallationAuthorizationStatusQueryKey,
|
|
1725
1685
|
getGetDataInstallationAuthorizationStatusQueryOptions,
|
|
1726
1686
|
getGetDataInstallationAuthorizationStatusUrl,
|
|
1727
1687
|
getGetDataIntegrationAuthorizeUrlQueryKey,
|
|
1728
1688
|
getGetDataIntegrationAuthorizeUrlQueryOptions,
|
|
1729
1689
|
getGetDataIntegrationAuthorizeUrlUrl,
|
|
1690
|
+
getGetDirectoryQueryKey,
|
|
1691
|
+
getGetDirectoryQueryOptions,
|
|
1692
|
+
getGetDirectoryUrl,
|
|
1730
1693
|
getInviteMemberMutationOptions,
|
|
1731
1694
|
getInviteMemberUrl,
|
|
1695
|
+
getListDirectoriesQueryKey,
|
|
1696
|
+
getListDirectoriesQueryOptions,
|
|
1697
|
+
getListDirectoriesUrl,
|
|
1732
1698
|
getListOrganizationApiKeyPermissionsQueryKey,
|
|
1733
1699
|
getListOrganizationApiKeyPermissionsQueryOptions,
|
|
1734
1700
|
getListOrganizationApiKeyPermissionsUrl,
|
|
@@ -1794,6 +1760,7 @@ const useDeleteDataInstallation = (options, queryClient) => {
|
|
|
1794
1760
|
getVerifyTotpFactorUrl,
|
|
1795
1761
|
getVerifyUrl,
|
|
1796
1762
|
inviteMember,
|
|
1763
|
+
listDirectories,
|
|
1797
1764
|
listOrganizationApiKeyPermissions,
|
|
1798
1765
|
listOrganizationApiKeys,
|
|
1799
1766
|
listOrganizationDomains,
|
|
@@ -1827,9 +1794,12 @@ const useDeleteDataInstallation = (options, queryClient) => {
|
|
|
1827
1794
|
useDeletePasskey,
|
|
1828
1795
|
useDeleteTotpFactors,
|
|
1829
1796
|
useGenerateAdminPortalLink,
|
|
1797
|
+
useGetAuditLogStream,
|
|
1830
1798
|
useGetDataInstallationAuthorizationStatus,
|
|
1831
1799
|
useGetDataIntegrationAuthorizeUrl,
|
|
1800
|
+
useGetDirectory,
|
|
1832
1801
|
useInviteMember,
|
|
1802
|
+
useListDirectories,
|
|
1833
1803
|
useListOrganizationApiKeyPermissions,
|
|
1834
1804
|
useListOrganizationApiKeys,
|
|
1835
1805
|
useListOrganizationDomains,
|