@workos-inc/widgets 1.8.2 → 1.9.0
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 +5 -0
- 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 +702 -623
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +810 -729
- package/dist/cjs/directory-sync.client.cjs +143 -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 +309 -252
- package/dist/cjs/experimental/api/fetch.cjs.map +1 -1
- package/dist/cjs/experimental/api/fetch.d.cts +809 -731
- package/dist/cjs/experimental/api/react-query.cjs +695 -613
- package/dist/cjs/experimental/api/react-query.cjs.map +1 -1
- package/dist/cjs/experimental/api/react-query.d.cts +1355 -1250
- package/dist/cjs/experimental/api/swr.cjs +660 -583
- package/dist/cjs/experimental/api/swr.cjs.map +1 -1
- package/dist/cjs/experimental/api/swr.d.cts +1307 -1212
- 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/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/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/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 +810 -729
- package/dist/esm/api/endpoint.js +691 -618
- 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 +121 -0
- package/dist/esm/directory-sync.client.js.map +1 -0
- package/dist/esm/experimental/api/fetch.d.ts +809 -731
- package/dist/esm/experimental/api/fetch.js +300 -247
- package/dist/esm/experimental/api/fetch.js.map +1 -1
- package/dist/esm/experimental/api/react-query.d.ts +1355 -1250
- package/dist/esm/experimental/api/react-query.js +683 -608
- package/dist/esm/experimental/api/react-query.js.map +1 -1
- package/dist/esm/experimental/api/swr.d.ts +1307 -1212
- package/dist/esm/experimental/api/swr.js +649 -578
- 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/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/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/package.json +3 -3
|
@@ -18,18 +18,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var fetch_exports = {};
|
|
20
20
|
__export(fetch_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
AuthenticationInformationResponseDataVerificationMethodsMfaOneOfProvider: () => AuthenticationInformationResponseDataVerificationMethodsMfaOneOfProvider,
|
|
22
|
+
AuthenticationInformationResponseDataVerificationMethodsPasskeyOneOfProvider: () => AuthenticationInformationResponseDataVerificationMethodsPasskeyOneOfProvider,
|
|
23
|
+
AuthenticationInformationResponseDataVerificationMethodsPasswordOneOfProvider: () => AuthenticationInformationResponseDataVerificationMethodsPasswordOneOfProvider,
|
|
24
24
|
CreateTotpFactorResponseAuthenticationChallengeAllOfObject: () => CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
|
|
25
25
|
CreateTotpFactorResponseAuthenticationFactorAllOfObject: () => CreateTotpFactorResponseAuthenticationFactorAllOfObject,
|
|
26
26
|
CreateTotpFactorResponseAuthenticationFactorAllOfType: () => CreateTotpFactorResponseAuthenticationFactorAllOfType,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
DataInstallationAllOfObject: () => DataInstallationAllOfObject,
|
|
28
|
+
DataInstallationAllOfState: () => DataInstallationAllOfState,
|
|
29
29
|
DataIntegrationCredentialsType: () => DataIntegrationCredentialsType,
|
|
30
30
|
DataIntegrationIntegrationType: () => DataIntegrationIntegrationType,
|
|
31
31
|
DataIntegrationObject: () => DataIntegrationObject,
|
|
32
32
|
DataIntegrationOwnership: () => DataIntegrationOwnership,
|
|
33
|
+
DirectoryState: () => DirectoryState,
|
|
34
|
+
DirectoryType: () => DirectoryType,
|
|
33
35
|
DomainVerificationNameServer: () => DomainVerificationNameServer,
|
|
34
36
|
GenerateAdminPortalLinkIntent: () => GenerateAdminPortalLinkIntent,
|
|
35
37
|
MemberActionsItem: () => MemberActionsItem,
|
|
@@ -71,6 +73,7 @@ __export(fetch_exports, {
|
|
|
71
73
|
getGetDataInstallationAuthorizationStatusUrl: () => getGetDataInstallationAuthorizationStatusUrl,
|
|
72
74
|
getGetDataIntegrationAuthorizeUrlUrl: () => getGetDataIntegrationAuthorizeUrlUrl,
|
|
73
75
|
getInviteMemberUrl: () => getInviteMemberUrl,
|
|
76
|
+
getListDirectoriesUrl: () => getListDirectoriesUrl,
|
|
74
77
|
getListOrganizationApiKeyPermissionsUrl: () => getListOrganizationApiKeyPermissionsUrl,
|
|
75
78
|
getListOrganizationApiKeysUrl: () => getListOrganizationApiKeysUrl,
|
|
76
79
|
getListOrganizationDomainsUrl: () => getListOrganizationDomainsUrl,
|
|
@@ -98,6 +101,7 @@ __export(fetch_exports, {
|
|
|
98
101
|
getVerifyTotpFactorUrl: () => getVerifyTotpFactorUrl,
|
|
99
102
|
getVerifyUrl: () => getVerifyUrl,
|
|
100
103
|
inviteMember: () => inviteMember,
|
|
104
|
+
listDirectories: () => listDirectories,
|
|
101
105
|
listOrganizationApiKeyPermissions: () => listOrganizationApiKeyPermissions,
|
|
102
106
|
listOrganizationApiKeys: () => listOrganizationApiKeys,
|
|
103
107
|
listOrganizationDomains: () => listOrganizationDomains,
|
|
@@ -151,13 +155,13 @@ const CreateTotpFactorResponseAuthenticationFactorAllOfType = {
|
|
|
151
155
|
const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {
|
|
152
156
|
authentication_challenge: "authentication_challenge"
|
|
153
157
|
};
|
|
154
|
-
const
|
|
158
|
+
const AuthenticationInformationResponseDataVerificationMethodsMfaOneOfProvider = {
|
|
155
159
|
MFA: "MFA"
|
|
156
160
|
};
|
|
157
|
-
const
|
|
161
|
+
const AuthenticationInformationResponseDataVerificationMethodsPasswordOneOfProvider = {
|
|
158
162
|
Password: "Password"
|
|
159
163
|
};
|
|
160
|
-
const
|
|
164
|
+
const AuthenticationInformationResponseDataVerificationMethodsPasskeyOneOfProvider = {
|
|
161
165
|
Passkey: "Passkey"
|
|
162
166
|
};
|
|
163
167
|
const SendVerificationResponseType = {
|
|
@@ -255,11 +259,11 @@ const SsoConnectionAnyOfEightAllOfType = {
|
|
|
255
259
|
const SsoConnectionAnyOfEightAllOfProviderTag = {
|
|
256
260
|
OpenIdConnect: "OpenIdConnect"
|
|
257
261
|
};
|
|
258
|
-
const
|
|
262
|
+
const DataInstallationAllOfObject = {
|
|
259
263
|
data_installation: "data_installation",
|
|
260
264
|
connected_account: "connected_account"
|
|
261
265
|
};
|
|
262
|
-
const
|
|
266
|
+
const DataInstallationAllOfState = {
|
|
263
267
|
connected: "connected",
|
|
264
268
|
needs_reauthorization: "needs_reauthorization"
|
|
265
269
|
};
|
|
@@ -313,11 +317,62 @@ const DataIntegrationCredentialsType = {
|
|
|
313
317
|
shared: "shared",
|
|
314
318
|
custom: "custom"
|
|
315
319
|
};
|
|
320
|
+
const DirectoryType = {
|
|
321
|
+
azure_scim_v20: "azure scim v2.0",
|
|
322
|
+
bamboohr: "bamboohr",
|
|
323
|
+
breathe_hr: "breathe hr",
|
|
324
|
+
cezanne_hr: "cezanne hr",
|
|
325
|
+
cyberark_scim_v20: "cyberark scim v2.0",
|
|
326
|
+
fourth_hr: "fourth hr",
|
|
327
|
+
generic_scim_v20: "generic scim v2.0",
|
|
328
|
+
gsuite_directory: "gsuite directory",
|
|
329
|
+
gusto: "gusto",
|
|
330
|
+
hibob: "hibob",
|
|
331
|
+
jump_cloud_scim_v20: "jump cloud scim v2.0",
|
|
332
|
+
okta_scim_v20: "okta scim v2.0",
|
|
333
|
+
onelogin_scim_v20: "onelogin scim v2.0",
|
|
334
|
+
people_hr: "people hr",
|
|
335
|
+
personio: "personio",
|
|
336
|
+
pingfederate_scim_v20: "pingfederate scim v2.0",
|
|
337
|
+
rippling: "rippling",
|
|
338
|
+
rippling_scim_v20: "rippling scim v2.0",
|
|
339
|
+
s3: "s3",
|
|
340
|
+
sailpoint_scim_v20: "sailpoint scim v2.0",
|
|
341
|
+
sftp: "sftp",
|
|
342
|
+
sftp_workday: "sftp workday",
|
|
343
|
+
workday: "workday"
|
|
344
|
+
};
|
|
345
|
+
const DirectoryState = {
|
|
346
|
+
requires_type: "requires_type",
|
|
347
|
+
linked: "linked",
|
|
348
|
+
validating: "validating",
|
|
349
|
+
invalid_credentials: "invalid_credentials",
|
|
350
|
+
unlinked: "unlinked",
|
|
351
|
+
deleting: "deleting"
|
|
352
|
+
};
|
|
316
353
|
const GenerateAdminPortalLinkIntent = {
|
|
317
354
|
domain_verification: "domain_verification",
|
|
318
355
|
sso: "sso"
|
|
319
356
|
};
|
|
320
|
-
const
|
|
357
|
+
const getCreateOrganizationApiKeyUrl = () => {
|
|
358
|
+
return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
359
|
+
};
|
|
360
|
+
const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options) => {
|
|
361
|
+
const res = await fetch(getCreateOrganizationApiKeyUrl(), {
|
|
362
|
+
...options,
|
|
363
|
+
method: "POST",
|
|
364
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
365
|
+
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
366
|
+
});
|
|
367
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
368
|
+
const data = body ? JSON.parse(body) : {};
|
|
369
|
+
return {
|
|
370
|
+
data,
|
|
371
|
+
status: res.status,
|
|
372
|
+
headers: res.headers
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
const getListOrganizationApiKeysUrl = (params) => {
|
|
321
376
|
const normalizedParams = new URLSearchParams();
|
|
322
377
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
323
378
|
if (value !== void 0) {
|
|
@@ -325,36 +380,51 @@ const getMembersUrl = (params) => {
|
|
|
325
380
|
}
|
|
326
381
|
});
|
|
327
382
|
const stringifiedParams = normalizedParams.toString();
|
|
328
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/
|
|
383
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
329
384
|
};
|
|
330
|
-
const
|
|
331
|
-
const res = await fetch(
|
|
385
|
+
const listOrganizationApiKeys = async (params, options) => {
|
|
386
|
+
const res = await fetch(getListOrganizationApiKeysUrl(params), {
|
|
332
387
|
...options,
|
|
333
388
|
method: "GET"
|
|
334
389
|
});
|
|
335
390
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
336
391
|
const data = body ? JSON.parse(body) : {};
|
|
337
|
-
return {
|
|
392
|
+
return {
|
|
393
|
+
data,
|
|
394
|
+
status: res.status,
|
|
395
|
+
headers: res.headers
|
|
396
|
+
};
|
|
338
397
|
};
|
|
339
|
-
const
|
|
340
|
-
|
|
398
|
+
const getListOrganizationApiKeyPermissionsUrl = (params) => {
|
|
399
|
+
const normalizedParams = new URLSearchParams();
|
|
400
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
401
|
+
if (value !== void 0) {
|
|
402
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
const stringifiedParams = normalizedParams.toString();
|
|
406
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
341
407
|
};
|
|
342
|
-
const
|
|
343
|
-
const res = await fetch(
|
|
408
|
+
const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
409
|
+
const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {
|
|
344
410
|
...options,
|
|
345
411
|
method: "GET"
|
|
346
412
|
});
|
|
347
413
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
348
414
|
const data = body ? JSON.parse(body) : {};
|
|
349
|
-
return {
|
|
415
|
+
return {
|
|
416
|
+
data,
|
|
417
|
+
status: res.status,
|
|
418
|
+
headers: res.headers
|
|
419
|
+
};
|
|
350
420
|
};
|
|
351
|
-
const
|
|
352
|
-
return `https://api.workos.com/_widgets/
|
|
421
|
+
const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
|
|
422
|
+
return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
|
|
353
423
|
};
|
|
354
|
-
const
|
|
355
|
-
const res = await fetch(
|
|
424
|
+
const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
425
|
+
const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {
|
|
356
426
|
...options,
|
|
357
|
-
method: "
|
|
427
|
+
method: "DELETE"
|
|
358
428
|
});
|
|
359
429
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
360
430
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -364,15 +434,13 @@ const rolesAndConfig = async (options) => {
|
|
|
364
434
|
headers: res.headers
|
|
365
435
|
};
|
|
366
436
|
};
|
|
367
|
-
const
|
|
368
|
-
return `https://api.workos.com/_widgets/
|
|
437
|
+
const getDeleteDataInstallationUrl = (installationId) => {
|
|
438
|
+
return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;
|
|
369
439
|
};
|
|
370
|
-
const
|
|
371
|
-
const res = await fetch(
|
|
440
|
+
const deleteDataInstallation = async (installationId, options) => {
|
|
441
|
+
const res = await fetch(getDeleteDataInstallationUrl(installationId), {
|
|
372
442
|
...options,
|
|
373
|
-
method: "
|
|
374
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
375
|
-
body: JSON.stringify(inviteMemberBody)
|
|
443
|
+
method: "DELETE"
|
|
376
444
|
});
|
|
377
445
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
378
446
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -382,13 +450,13 @@ const inviteMember = async (inviteMemberBody, options) => {
|
|
|
382
450
|
headers: res.headers
|
|
383
451
|
};
|
|
384
452
|
};
|
|
385
|
-
const
|
|
386
|
-
return `https://api.workos.com/_widgets/
|
|
453
|
+
const getMyDataIntegrationsUrl = () => {
|
|
454
|
+
return `https://api.workos.com/_widgets/DataIntegrations/mine`;
|
|
387
455
|
};
|
|
388
|
-
const
|
|
389
|
-
const res = await fetch(
|
|
456
|
+
const myDataIntegrations = async (options) => {
|
|
457
|
+
const res = await fetch(getMyDataIntegrationsUrl(), {
|
|
390
458
|
...options,
|
|
391
|
-
method: "
|
|
459
|
+
method: "GET"
|
|
392
460
|
});
|
|
393
461
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
394
462
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -398,14 +466,17 @@ const resendInvite = async (userId, options) => {
|
|
|
398
466
|
headers: res.headers
|
|
399
467
|
};
|
|
400
468
|
};
|
|
401
|
-
const
|
|
402
|
-
return `https://api.workos.com/_widgets/
|
|
469
|
+
const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
|
|
470
|
+
return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
|
|
403
471
|
};
|
|
404
|
-
const
|
|
405
|
-
const res = await fetch(
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
472
|
+
const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state, options) => {
|
|
473
|
+
const res = await fetch(
|
|
474
|
+
getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),
|
|
475
|
+
{
|
|
476
|
+
...options,
|
|
477
|
+
method: "GET"
|
|
478
|
+
}
|
|
479
|
+
);
|
|
409
480
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
410
481
|
const data = body ? JSON.parse(body) : {};
|
|
411
482
|
return {
|
|
@@ -414,13 +485,20 @@ const revokeInvite = async (userId, options) => {
|
|
|
414
485
|
headers: res.headers
|
|
415
486
|
};
|
|
416
487
|
};
|
|
417
|
-
const
|
|
418
|
-
|
|
488
|
+
const getGetDataIntegrationAuthorizeUrlUrl = (slug, params) => {
|
|
489
|
+
const normalizedParams = new URLSearchParams();
|
|
490
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
491
|
+
if (value !== void 0) {
|
|
492
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
const stringifiedParams = normalizedParams.toString();
|
|
496
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
419
497
|
};
|
|
420
|
-
const
|
|
421
|
-
const res = await fetch(
|
|
498
|
+
const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
499
|
+
const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {
|
|
422
500
|
...options,
|
|
423
|
-
method: "
|
|
501
|
+
method: "GET"
|
|
424
502
|
});
|
|
425
503
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
426
504
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -430,15 +508,15 @@ const removeMember = async (userId, options) => {
|
|
|
430
508
|
headers: res.headers
|
|
431
509
|
};
|
|
432
510
|
};
|
|
433
|
-
const
|
|
434
|
-
return `https://api.workos.com/_widgets/UserManagement/
|
|
511
|
+
const getInviteMemberUrl = () => {
|
|
512
|
+
return `https://api.workos.com/_widgets/UserManagement/invite-user`;
|
|
435
513
|
};
|
|
436
|
-
const
|
|
437
|
-
const res = await fetch(
|
|
514
|
+
const inviteMember = async (inviteMemberBody, options) => {
|
|
515
|
+
const res = await fetch(getInviteMemberUrl(), {
|
|
438
516
|
...options,
|
|
439
517
|
method: "POST",
|
|
440
518
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
441
|
-
body: JSON.stringify(
|
|
519
|
+
body: JSON.stringify(inviteMemberBody)
|
|
442
520
|
});
|
|
443
521
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
444
522
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -448,13 +526,13 @@ const updateMember = async (userId, updateMemberBody, options) => {
|
|
|
448
526
|
headers: res.headers
|
|
449
527
|
};
|
|
450
528
|
};
|
|
451
|
-
const
|
|
452
|
-
return `https://api.workos.com/_widgets/UserManagement/
|
|
529
|
+
const getRevokeInviteUrl = (userId) => {
|
|
530
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
|
|
453
531
|
};
|
|
454
|
-
const
|
|
455
|
-
const res = await fetch(
|
|
532
|
+
const revokeInvite = async (userId, options) => {
|
|
533
|
+
const res = await fetch(getRevokeInviteUrl(userId), {
|
|
456
534
|
...options,
|
|
457
|
-
method: "
|
|
535
|
+
method: "DELETE"
|
|
458
536
|
});
|
|
459
537
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
460
538
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -464,39 +542,48 @@ const organizations = async (options) => {
|
|
|
464
542
|
headers: res.headers
|
|
465
543
|
};
|
|
466
544
|
};
|
|
467
|
-
const
|
|
468
|
-
return `https://api.workos.com/_widgets/
|
|
545
|
+
const getResendInviteUrl = (userId) => {
|
|
546
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;
|
|
469
547
|
};
|
|
470
|
-
const
|
|
471
|
-
const res = await fetch(
|
|
548
|
+
const resendInvite = async (userId, options) => {
|
|
549
|
+
const res = await fetch(getResendInviteUrl(userId), {
|
|
472
550
|
...options,
|
|
473
|
-
method: "
|
|
551
|
+
method: "POST"
|
|
474
552
|
});
|
|
475
553
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
476
554
|
const data = body ? JSON.parse(body) : {};
|
|
477
|
-
return {
|
|
555
|
+
return {
|
|
556
|
+
data,
|
|
557
|
+
status: res.status,
|
|
558
|
+
headers: res.headers
|
|
559
|
+
};
|
|
478
560
|
};
|
|
479
|
-
const
|
|
480
|
-
|
|
561
|
+
const getMembersUrl = (params) => {
|
|
562
|
+
const normalizedParams = new URLSearchParams();
|
|
563
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
564
|
+
if (value !== void 0) {
|
|
565
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
const stringifiedParams = normalizedParams.toString();
|
|
569
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
|
|
481
570
|
};
|
|
482
|
-
const
|
|
483
|
-
const res = await fetch(
|
|
571
|
+
const members = async (params, options) => {
|
|
572
|
+
const res = await fetch(getMembersUrl(params), {
|
|
484
573
|
...options,
|
|
485
|
-
method: "
|
|
486
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
487
|
-
body: JSON.stringify(updateMeBody)
|
|
574
|
+
method: "GET"
|
|
488
575
|
});
|
|
489
576
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
490
577
|
const data = body ? JSON.parse(body) : {};
|
|
491
578
|
return { data, status: res.status, headers: res.headers };
|
|
492
579
|
};
|
|
493
|
-
const
|
|
494
|
-
return `https://api.workos.com/_widgets/
|
|
580
|
+
const getRemoveMemberUrl = (userId) => {
|
|
581
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
495
582
|
};
|
|
496
|
-
const
|
|
497
|
-
const res = await fetch(
|
|
583
|
+
const removeMember = async (userId, options) => {
|
|
584
|
+
const res = await fetch(getRemoveMemberUrl(userId), {
|
|
498
585
|
...options,
|
|
499
|
-
method: "
|
|
586
|
+
method: "DELETE"
|
|
500
587
|
});
|
|
501
588
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
502
589
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -506,15 +593,15 @@ const createTotpFactor = async (options) => {
|
|
|
506
593
|
headers: res.headers
|
|
507
594
|
};
|
|
508
595
|
};
|
|
509
|
-
const
|
|
510
|
-
return `https://api.workos.com/_widgets/
|
|
596
|
+
const getUpdateMemberUrl = (userId) => {
|
|
597
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
511
598
|
};
|
|
512
|
-
const
|
|
513
|
-
const res = await fetch(
|
|
599
|
+
const updateMember = async (userId, updateMemberBody, options) => {
|
|
600
|
+
const res = await fetch(getUpdateMemberUrl(userId), {
|
|
514
601
|
...options,
|
|
515
602
|
method: "POST",
|
|
516
603
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
517
|
-
body: JSON.stringify(
|
|
604
|
+
body: JSON.stringify(updateMemberBody)
|
|
518
605
|
});
|
|
519
606
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
520
607
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -524,13 +611,13 @@ const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
|
524
611
|
headers: res.headers
|
|
525
612
|
};
|
|
526
613
|
};
|
|
527
|
-
const
|
|
528
|
-
return `https://api.workos.com/_widgets/
|
|
614
|
+
const getOrganizationsUrl = () => {
|
|
615
|
+
return `https://api.workos.com/_widgets/UserManagement/organizations`;
|
|
529
616
|
};
|
|
530
|
-
const
|
|
531
|
-
const res = await fetch(
|
|
617
|
+
const organizations = async (options) => {
|
|
618
|
+
const res = await fetch(getOrganizationsUrl(), {
|
|
532
619
|
...options,
|
|
533
|
-
method: "
|
|
620
|
+
method: "GET"
|
|
534
621
|
});
|
|
535
622
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
536
623
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -540,31 +627,25 @@ const deleteTotpFactors = async (options) => {
|
|
|
540
627
|
headers: res.headers
|
|
541
628
|
};
|
|
542
629
|
};
|
|
543
|
-
const
|
|
544
|
-
return `https://api.workos.com/_widgets/
|
|
630
|
+
const getRolesUrl = () => {
|
|
631
|
+
return `https://api.workos.com/_widgets/UserManagement/roles`;
|
|
545
632
|
};
|
|
546
|
-
const
|
|
547
|
-
const res = await fetch(
|
|
633
|
+
const roles = async (options) => {
|
|
634
|
+
const res = await fetch(getRolesUrl(), {
|
|
548
635
|
...options,
|
|
549
636
|
method: "GET"
|
|
550
637
|
});
|
|
551
638
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
552
639
|
const data = body ? JSON.parse(body) : {};
|
|
553
|
-
return {
|
|
554
|
-
data,
|
|
555
|
-
status: res.status,
|
|
556
|
-
headers: res.headers
|
|
557
|
-
};
|
|
640
|
+
return { data, status: res.status, headers: res.headers };
|
|
558
641
|
};
|
|
559
|
-
const
|
|
560
|
-
return `https://api.workos.com/_widgets/
|
|
642
|
+
const getRolesAndConfigUrl = () => {
|
|
643
|
+
return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;
|
|
561
644
|
};
|
|
562
|
-
const
|
|
563
|
-
const res = await fetch(
|
|
645
|
+
const rolesAndConfig = async (options) => {
|
|
646
|
+
const res = await fetch(getRolesAndConfigUrl(), {
|
|
564
647
|
...options,
|
|
565
|
-
method: "
|
|
566
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
567
|
-
body: JSON.stringify(createPasswordRequest)
|
|
648
|
+
method: "GET"
|
|
568
649
|
});
|
|
569
650
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
570
651
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -574,15 +655,13 @@ const createPassword = async (createPasswordRequest, options) => {
|
|
|
574
655
|
headers: res.headers
|
|
575
656
|
};
|
|
576
657
|
};
|
|
577
|
-
const
|
|
578
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
658
|
+
const getAuthenticationInformationUrl = () => {
|
|
659
|
+
return `https://api.workos.com/_widgets/UserProfile/authentication-information`;
|
|
579
660
|
};
|
|
580
|
-
const
|
|
581
|
-
const res = await fetch(
|
|
661
|
+
const authenticationInformation = async (options) => {
|
|
662
|
+
const res = await fetch(getAuthenticationInformationUrl(), {
|
|
582
663
|
...options,
|
|
583
|
-
method: "
|
|
584
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
585
|
-
body: JSON.stringify(updatePasswordRequest)
|
|
664
|
+
method: "GET"
|
|
586
665
|
});
|
|
587
666
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
588
667
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -592,15 +671,15 @@ const updatePassword = async (updatePasswordRequest, options) => {
|
|
|
592
671
|
headers: res.headers
|
|
593
672
|
};
|
|
594
673
|
};
|
|
595
|
-
const
|
|
596
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
674
|
+
const getCreatePasswordUrl = () => {
|
|
675
|
+
return `https://api.workos.com/_widgets/UserProfile/create-password`;
|
|
597
676
|
};
|
|
598
|
-
const
|
|
599
|
-
const res = await fetch(
|
|
677
|
+
const createPassword = async (createPasswordRequest, options) => {
|
|
678
|
+
const res = await fetch(getCreatePasswordUrl(), {
|
|
600
679
|
...options,
|
|
601
|
-
method: "
|
|
680
|
+
method: "POST",
|
|
602
681
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
603
|
-
body: JSON.stringify(
|
|
682
|
+
body: JSON.stringify(createPasswordRequest)
|
|
604
683
|
});
|
|
605
684
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
606
685
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -610,13 +689,13 @@ const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
|
610
689
|
headers: res.headers
|
|
611
690
|
};
|
|
612
691
|
};
|
|
613
|
-
const
|
|
614
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
692
|
+
const getCreateTotpFactorUrl = () => {
|
|
693
|
+
return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
|
|
615
694
|
};
|
|
616
|
-
const
|
|
617
|
-
const res = await fetch(
|
|
695
|
+
const createTotpFactor = async (options) => {
|
|
696
|
+
const res = await fetch(getCreateTotpFactorUrl(), {
|
|
618
697
|
...options,
|
|
619
|
-
method: "
|
|
698
|
+
method: "POST"
|
|
620
699
|
});
|
|
621
700
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
622
701
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -626,11 +705,11 @@ const revokeSession = async (sessionId, options) => {
|
|
|
626
705
|
headers: res.headers
|
|
627
706
|
};
|
|
628
707
|
};
|
|
629
|
-
const
|
|
630
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
708
|
+
const getMeUrl = () => {
|
|
709
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
631
710
|
};
|
|
632
|
-
const
|
|
633
|
-
const res = await fetch(
|
|
711
|
+
const me = async (options) => {
|
|
712
|
+
const res = await fetch(getMeUrl(), {
|
|
634
713
|
...options,
|
|
635
714
|
method: "GET"
|
|
636
715
|
});
|
|
@@ -638,31 +717,15 @@ const sessions = async (options) => {
|
|
|
638
717
|
const data = body ? JSON.parse(body) : {};
|
|
639
718
|
return { data, status: res.status, headers: res.headers };
|
|
640
719
|
};
|
|
641
|
-
const
|
|
642
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
643
|
-
};
|
|
644
|
-
const sendVerification = async (options) => {
|
|
645
|
-
const res = await fetch(getSendVerificationUrl(), {
|
|
646
|
-
...options,
|
|
647
|
-
method: "POST"
|
|
648
|
-
});
|
|
649
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
650
|
-
const data = body ? JSON.parse(body) : {};
|
|
651
|
-
return {
|
|
652
|
-
data,
|
|
653
|
-
status: res.status,
|
|
654
|
-
headers: res.headers
|
|
655
|
-
};
|
|
656
|
-
};
|
|
657
|
-
const getVerifyUrl = () => {
|
|
658
|
-
return `https://api.workos.com/_widgets/UserProfile/verify`;
|
|
720
|
+
const getUpdateMeUrl = () => {
|
|
721
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
659
722
|
};
|
|
660
|
-
const
|
|
661
|
-
const res = await fetch(
|
|
723
|
+
const updateMe = async (updateMeBody, options) => {
|
|
724
|
+
const res = await fetch(getUpdateMeUrl(), {
|
|
662
725
|
...options,
|
|
663
726
|
method: "POST",
|
|
664
727
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
665
|
-
body: JSON.stringify(
|
|
728
|
+
body: JSON.stringify(updateMeBody)
|
|
666
729
|
});
|
|
667
730
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
668
731
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -718,11 +781,27 @@ const deletePasskey = async (passkeyId, options) => {
|
|
|
718
781
|
headers: res.headers
|
|
719
782
|
};
|
|
720
783
|
};
|
|
721
|
-
const
|
|
722
|
-
return `https://api.workos.com/_widgets/
|
|
784
|
+
const getSendVerificationUrl = () => {
|
|
785
|
+
return `https://api.workos.com/_widgets/UserProfile/send-verification`;
|
|
723
786
|
};
|
|
724
|
-
const
|
|
725
|
-
const res = await fetch(
|
|
787
|
+
const sendVerification = async (options) => {
|
|
788
|
+
const res = await fetch(getSendVerificationUrl(), {
|
|
789
|
+
...options,
|
|
790
|
+
method: "POST"
|
|
791
|
+
});
|
|
792
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
793
|
+
const data = body ? JSON.parse(body) : {};
|
|
794
|
+
return {
|
|
795
|
+
data,
|
|
796
|
+
status: res.status,
|
|
797
|
+
headers: res.headers
|
|
798
|
+
};
|
|
799
|
+
};
|
|
800
|
+
const getSessionsUrl = () => {
|
|
801
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions`;
|
|
802
|
+
};
|
|
803
|
+
const sessions = async (options) => {
|
|
804
|
+
const res = await fetch(getSessionsUrl(), {
|
|
726
805
|
...options,
|
|
727
806
|
method: "GET"
|
|
728
807
|
});
|
|
@@ -730,13 +809,15 @@ const settings = async (options) => {
|
|
|
730
809
|
const data = body ? JSON.parse(body) : {};
|
|
731
810
|
return { data, status: res.status, headers: res.headers };
|
|
732
811
|
};
|
|
733
|
-
const
|
|
734
|
-
return `https://api.workos.com/_widgets/
|
|
812
|
+
const getRevokeAllSessionsUrl = () => {
|
|
813
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
|
|
735
814
|
};
|
|
736
|
-
const
|
|
737
|
-
const res = await fetch(
|
|
815
|
+
const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
816
|
+
const res = await fetch(getRevokeAllSessionsUrl(), {
|
|
738
817
|
...options,
|
|
739
|
-
method: "
|
|
818
|
+
method: "DELETE",
|
|
819
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
820
|
+
body: JSON.stringify(revokeAllSessionsRequest)
|
|
740
821
|
});
|
|
741
822
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
742
823
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -746,20 +827,13 @@ const listOrganizationDomains = async (options) => {
|
|
|
746
827
|
headers: res.headers
|
|
747
828
|
};
|
|
748
829
|
};
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
752
|
-
if (value !== void 0) {
|
|
753
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
754
|
-
}
|
|
755
|
-
});
|
|
756
|
-
const stringifiedParams = normalizedParams.toString();
|
|
757
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
830
|
+
const getRevokeSessionUrl = (sessionId) => {
|
|
831
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;
|
|
758
832
|
};
|
|
759
|
-
const
|
|
760
|
-
const res = await fetch(
|
|
833
|
+
const revokeSession = async (sessionId, options) => {
|
|
834
|
+
const res = await fetch(getRevokeSessionUrl(sessionId), {
|
|
761
835
|
...options,
|
|
762
|
-
method: "
|
|
836
|
+
method: "DELETE"
|
|
763
837
|
});
|
|
764
838
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
765
839
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -769,11 +843,11 @@ const generateAdminPortalLink = async (params, options) => {
|
|
|
769
843
|
headers: res.headers
|
|
770
844
|
};
|
|
771
845
|
};
|
|
772
|
-
const
|
|
773
|
-
return `https://api.workos.com/_widgets/
|
|
846
|
+
const getDeleteTotpFactorsUrl = () => {
|
|
847
|
+
return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
|
|
774
848
|
};
|
|
775
|
-
const
|
|
776
|
-
const res = await fetch(
|
|
849
|
+
const deleteTotpFactors = async (options) => {
|
|
850
|
+
const res = await fetch(getDeleteTotpFactorsUrl(), {
|
|
777
851
|
...options,
|
|
778
852
|
method: "DELETE"
|
|
779
853
|
});
|
|
@@ -785,13 +859,15 @@ const deleteOrganizationDomain = async (domainId, options) => {
|
|
|
785
859
|
headers: res.headers
|
|
786
860
|
};
|
|
787
861
|
};
|
|
788
|
-
const
|
|
789
|
-
return `https://api.workos.com/_widgets/
|
|
862
|
+
const getUpdatePasswordUrl = () => {
|
|
863
|
+
return `https://api.workos.com/_widgets/UserProfile/update-password`;
|
|
790
864
|
};
|
|
791
|
-
const
|
|
792
|
-
const res = await fetch(
|
|
865
|
+
const updatePassword = async (updatePasswordRequest, options) => {
|
|
866
|
+
const res = await fetch(getUpdatePasswordUrl(), {
|
|
793
867
|
...options,
|
|
794
|
-
method: "POST"
|
|
868
|
+
method: "POST",
|
|
869
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
870
|
+
body: JSON.stringify(updatePasswordRequest)
|
|
795
871
|
});
|
|
796
872
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
797
873
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -801,31 +877,29 @@ const reverifyOrganizationDomain = async (domainId, options) => {
|
|
|
801
877
|
headers: res.headers
|
|
802
878
|
};
|
|
803
879
|
};
|
|
804
|
-
const
|
|
805
|
-
return `https://api.workos.com/_widgets/
|
|
880
|
+
const getVerifyUrl = () => {
|
|
881
|
+
return `https://api.workos.com/_widgets/UserProfile/verify`;
|
|
806
882
|
};
|
|
807
|
-
const
|
|
808
|
-
const res = await fetch(
|
|
883
|
+
const verify = async (verifyRequest, options) => {
|
|
884
|
+
const res = await fetch(getVerifyUrl(), {
|
|
809
885
|
...options,
|
|
810
|
-
method: "
|
|
886
|
+
method: "POST",
|
|
887
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
888
|
+
body: JSON.stringify(verifyRequest)
|
|
811
889
|
});
|
|
812
890
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
813
891
|
const data = body ? JSON.parse(body) : {};
|
|
814
|
-
return {
|
|
815
|
-
data,
|
|
816
|
-
status: res.status,
|
|
817
|
-
headers: res.headers
|
|
818
|
-
};
|
|
892
|
+
return { data, status: res.status, headers: res.headers };
|
|
819
893
|
};
|
|
820
|
-
const
|
|
821
|
-
return `https://api.workos.com/_widgets/
|
|
894
|
+
const getVerifyTotpFactorUrl = () => {
|
|
895
|
+
return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
|
|
822
896
|
};
|
|
823
|
-
const
|
|
824
|
-
const res = await fetch(
|
|
897
|
+
const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
898
|
+
const res = await fetch(getVerifyTotpFactorUrl(), {
|
|
825
899
|
...options,
|
|
826
900
|
method: "POST",
|
|
827
901
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
828
|
-
body: JSON.stringify(
|
|
902
|
+
body: JSON.stringify(verifyTotpFactorRequest)
|
|
829
903
|
});
|
|
830
904
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
831
905
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -835,7 +909,7 @@ const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options
|
|
|
835
909
|
headers: res.headers
|
|
836
910
|
};
|
|
837
911
|
};
|
|
838
|
-
const
|
|
912
|
+
const getGenerateAdminPortalLinkUrl = (params) => {
|
|
839
913
|
const normalizedParams = new URLSearchParams();
|
|
840
914
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
841
915
|
if (value !== void 0) {
|
|
@@ -843,12 +917,12 @@ const getListOrganizationApiKeysUrl = (params) => {
|
|
|
843
917
|
}
|
|
844
918
|
});
|
|
845
919
|
const stringifiedParams = normalizedParams.toString();
|
|
846
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/
|
|
920
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
847
921
|
};
|
|
848
|
-
const
|
|
849
|
-
const res = await fetch(
|
|
922
|
+
const generateAdminPortalLink = async (params, options) => {
|
|
923
|
+
const res = await fetch(getGenerateAdminPortalLinkUrl(params), {
|
|
850
924
|
...options,
|
|
851
|
-
method: "
|
|
925
|
+
method: "POST"
|
|
852
926
|
});
|
|
853
927
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
854
928
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -858,18 +932,11 @@ const listOrganizationApiKeys = async (params, options) => {
|
|
|
858
932
|
headers: res.headers
|
|
859
933
|
};
|
|
860
934
|
};
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
864
|
-
if (value !== void 0) {
|
|
865
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
866
|
-
}
|
|
867
|
-
});
|
|
868
|
-
const stringifiedParams = normalizedParams.toString();
|
|
869
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
935
|
+
const getListOrganizationDomainsUrl = () => {
|
|
936
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains`;
|
|
870
937
|
};
|
|
871
|
-
const
|
|
872
|
-
const res = await fetch(
|
|
938
|
+
const listOrganizationDomains = async (options) => {
|
|
939
|
+
const res = await fetch(getListOrganizationDomainsUrl(), {
|
|
873
940
|
...options,
|
|
874
941
|
method: "GET"
|
|
875
942
|
});
|
|
@@ -881,11 +948,11 @@ const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
|
881
948
|
headers: res.headers
|
|
882
949
|
};
|
|
883
950
|
};
|
|
884
|
-
const
|
|
885
|
-
return `https://api.workos.com/_widgets/
|
|
951
|
+
const getDeleteOrganizationDomainUrl = (domainId) => {
|
|
952
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;
|
|
886
953
|
};
|
|
887
|
-
const
|
|
888
|
-
const res = await fetch(
|
|
954
|
+
const deleteOrganizationDomain = async (domainId, options) => {
|
|
955
|
+
const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {
|
|
889
956
|
...options,
|
|
890
957
|
method: "DELETE"
|
|
891
958
|
});
|
|
@@ -897,13 +964,13 @@ const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
|
897
964
|
headers: res.headers
|
|
898
965
|
};
|
|
899
966
|
};
|
|
900
|
-
const
|
|
901
|
-
return `https://api.workos.com/_widgets/
|
|
967
|
+
const getReverifyOrganizationDomainUrl = (domainId) => {
|
|
968
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;
|
|
902
969
|
};
|
|
903
|
-
const
|
|
904
|
-
const res = await fetch(
|
|
970
|
+
const reverifyOrganizationDomain = async (domainId, options) => {
|
|
971
|
+
const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {
|
|
905
972
|
...options,
|
|
906
|
-
method: "
|
|
973
|
+
method: "POST"
|
|
907
974
|
});
|
|
908
975
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
909
976
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -913,18 +980,11 @@ const myDataIntegrations = async (options) => {
|
|
|
913
980
|
headers: res.headers
|
|
914
981
|
};
|
|
915
982
|
};
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
919
|
-
if (value !== void 0) {
|
|
920
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
921
|
-
}
|
|
922
|
-
});
|
|
923
|
-
const stringifiedParams = normalizedParams.toString();
|
|
924
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
983
|
+
const getListSsoConnectionsUrl = () => {
|
|
984
|
+
return `https://api.workos.com/_widgets/admin-portal/sso-connections`;
|
|
925
985
|
};
|
|
926
|
-
const
|
|
927
|
-
const res = await fetch(
|
|
986
|
+
const listSsoConnections = async (options) => {
|
|
987
|
+
const res = await fetch(getListSsoConnectionsUrl(), {
|
|
928
988
|
...options,
|
|
929
989
|
method: "GET"
|
|
930
990
|
});
|
|
@@ -936,17 +996,14 @@ const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
|
936
996
|
headers: res.headers
|
|
937
997
|
};
|
|
938
998
|
};
|
|
939
|
-
const
|
|
940
|
-
return `https://api.workos.com/_widgets/
|
|
999
|
+
const getListDirectoriesUrl = () => {
|
|
1000
|
+
return `https://api.workos.com/_widgets/directory-sync/directories`;
|
|
941
1001
|
};
|
|
942
|
-
const
|
|
943
|
-
const res = await fetch(
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
method: "GET"
|
|
948
|
-
}
|
|
949
|
-
);
|
|
1002
|
+
const listDirectories = async (options) => {
|
|
1003
|
+
const res = await fetch(getListDirectoriesUrl(), {
|
|
1004
|
+
...options,
|
|
1005
|
+
method: "GET"
|
|
1006
|
+
});
|
|
950
1007
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
951
1008
|
const data = body ? JSON.parse(body) : {};
|
|
952
1009
|
return {
|
|
@@ -955,36 +1012,34 @@ const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state,
|
|
|
955
1012
|
headers: res.headers
|
|
956
1013
|
};
|
|
957
1014
|
};
|
|
958
|
-
const
|
|
959
|
-
return `https://api.workos.com/_widgets/
|
|
1015
|
+
const getSettingsUrl = () => {
|
|
1016
|
+
return `https://api.workos.com/_widgets/settings`;
|
|
960
1017
|
};
|
|
961
|
-
const
|
|
962
|
-
const res = await fetch(
|
|
1018
|
+
const settings = async (options) => {
|
|
1019
|
+
const res = await fetch(getSettingsUrl(), {
|
|
963
1020
|
...options,
|
|
964
|
-
method: "
|
|
1021
|
+
method: "GET"
|
|
965
1022
|
});
|
|
966
1023
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
967
1024
|
const data = body ? JSON.parse(body) : {};
|
|
968
|
-
return {
|
|
969
|
-
data,
|
|
970
|
-
status: res.status,
|
|
971
|
-
headers: res.headers
|
|
972
|
-
};
|
|
1025
|
+
return { data, status: res.status, headers: res.headers };
|
|
973
1026
|
};
|
|
974
1027
|
// Annotate the CommonJS export names for ESM import in node:
|
|
975
1028
|
0 && (module.exports = {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1029
|
+
AuthenticationInformationResponseDataVerificationMethodsMfaOneOfProvider,
|
|
1030
|
+
AuthenticationInformationResponseDataVerificationMethodsPasskeyOneOfProvider,
|
|
1031
|
+
AuthenticationInformationResponseDataVerificationMethodsPasswordOneOfProvider,
|
|
979
1032
|
CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
|
|
980
1033
|
CreateTotpFactorResponseAuthenticationFactorAllOfObject,
|
|
981
1034
|
CreateTotpFactorResponseAuthenticationFactorAllOfType,
|
|
982
|
-
|
|
983
|
-
|
|
1035
|
+
DataInstallationAllOfObject,
|
|
1036
|
+
DataInstallationAllOfState,
|
|
984
1037
|
DataIntegrationCredentialsType,
|
|
985
1038
|
DataIntegrationIntegrationType,
|
|
986
1039
|
DataIntegrationObject,
|
|
987
1040
|
DataIntegrationOwnership,
|
|
1041
|
+
DirectoryState,
|
|
1042
|
+
DirectoryType,
|
|
988
1043
|
DomainVerificationNameServer,
|
|
989
1044
|
GenerateAdminPortalLinkIntent,
|
|
990
1045
|
MemberActionsItem,
|
|
@@ -1026,6 +1081,7 @@ const deleteDataInstallation = async (installationId, options) => {
|
|
|
1026
1081
|
getGetDataInstallationAuthorizationStatusUrl,
|
|
1027
1082
|
getGetDataIntegrationAuthorizeUrlUrl,
|
|
1028
1083
|
getInviteMemberUrl,
|
|
1084
|
+
getListDirectoriesUrl,
|
|
1029
1085
|
getListOrganizationApiKeyPermissionsUrl,
|
|
1030
1086
|
getListOrganizationApiKeysUrl,
|
|
1031
1087
|
getListOrganizationDomainsUrl,
|
|
@@ -1053,6 +1109,7 @@ const deleteDataInstallation = async (installationId, options) => {
|
|
|
1053
1109
|
getVerifyTotpFactorUrl,
|
|
1054
1110
|
getVerifyUrl,
|
|
1055
1111
|
inviteMember,
|
|
1112
|
+
listDirectories,
|
|
1056
1113
|
listOrganizationApiKeyPermissions,
|
|
1057
1114
|
listOrganizationApiKeys,
|
|
1058
1115
|
listOrganizationDomains,
|