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