@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
|
@@ -11,33 +11,6 @@ const MemberActionsItem = {
|
|
|
11
11
|
"revoke-invite": "revoke-invite",
|
|
12
12
|
"revoke-membership": "revoke-membership"
|
|
13
13
|
};
|
|
14
|
-
const CreateTotpFactorResponseAuthenticationFactorAllOfObject = {
|
|
15
|
-
authentication_factor: "authentication_factor"
|
|
16
|
-
};
|
|
17
|
-
const CreateTotpFactorResponseAuthenticationFactorAllOfType = {
|
|
18
|
-
generic_otp: "generic_otp",
|
|
19
|
-
sms: "sms",
|
|
20
|
-
totp: "totp",
|
|
21
|
-
webauthn: "webauthn"
|
|
22
|
-
};
|
|
23
|
-
const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {
|
|
24
|
-
authentication_challenge: "authentication_challenge"
|
|
25
|
-
};
|
|
26
|
-
const AuthenticationInformationResponseDataVerificationMethodsMfaProvider = {
|
|
27
|
-
MFA: "MFA"
|
|
28
|
-
};
|
|
29
|
-
const AuthenticationInformationResponseDataVerificationMethodsPasswordProvider = {
|
|
30
|
-
Password: "Password"
|
|
31
|
-
};
|
|
32
|
-
const AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider = {
|
|
33
|
-
Passkey: "Passkey"
|
|
34
|
-
};
|
|
35
|
-
const SendVerificationResponseType = {
|
|
36
|
-
EmailVerification: "EmailVerification"
|
|
37
|
-
};
|
|
38
|
-
const SettingsResponseObject = {
|
|
39
|
-
settings: "settings"
|
|
40
|
-
};
|
|
41
14
|
const OrganizationDomainState = {
|
|
42
15
|
Failed: "Failed",
|
|
43
16
|
LegacyVerified: "LegacyVerified",
|
|
@@ -70,126 +43,63 @@ const SsoConnectionSessionJSONState = {
|
|
|
70
43
|
...SamlSessionState,
|
|
71
44
|
...OidcSessionState
|
|
72
45
|
};
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Active: "Active",
|
|
106
|
-
Deleting: "Deleting"
|
|
107
|
-
};
|
|
108
|
-
const SsoConnectionAnyOfProviderTag = {
|
|
109
|
-
Saml: "Saml"
|
|
110
|
-
};
|
|
111
|
-
const SsoConnectionAnyOfEightAllOfState = {
|
|
112
|
-
Inactive: "Inactive",
|
|
113
|
-
Validating: "Validating",
|
|
114
|
-
Active: "Active",
|
|
115
|
-
Deleting: "Deleting"
|
|
116
|
-
};
|
|
117
|
-
const SsoConnectionAnyOfEightAllOfType = {
|
|
118
|
-
AdpOidc: "AdpOidc",
|
|
119
|
-
Auth0Migration: "Auth0Migration",
|
|
120
|
-
CleverOidc: "CleverOidc",
|
|
121
|
-
EntraIdOidc: "EntraIdOidc",
|
|
122
|
-
GenericOidc: "GenericOidc",
|
|
123
|
-
GoogleOidc: "GoogleOidc",
|
|
124
|
-
OktaOidc: "OktaOidc",
|
|
125
|
-
LoginGovOidc: "LoginGovOidc"
|
|
126
|
-
};
|
|
127
|
-
const SsoConnectionAnyOfEightAllOfProviderTag = {
|
|
128
|
-
OpenIdConnect: "OpenIdConnect"
|
|
129
|
-
};
|
|
130
|
-
const DataInstallationObject = {
|
|
131
|
-
data_installation: "data_installation",
|
|
132
|
-
connected_account: "connected_account"
|
|
133
|
-
};
|
|
134
|
-
const DataInstallationState = {
|
|
135
|
-
connected: "connected",
|
|
136
|
-
needs_reauthorization: "needs_reauthorization"
|
|
137
|
-
};
|
|
138
|
-
const DataIntegrationObject = {
|
|
139
|
-
data_integration: "data_integration"
|
|
140
|
-
};
|
|
141
|
-
const DataIntegrationIntegrationType = {
|
|
142
|
-
asana: "asana",
|
|
143
|
-
box: "box",
|
|
144
|
-
"cal-dot-com": "cal-dot-com",
|
|
145
|
-
calendly: "calendly",
|
|
146
|
-
confluence: "confluence",
|
|
147
|
-
dropbox: "dropbox",
|
|
148
|
-
"frame-io": "frame-io",
|
|
149
|
-
front: "front",
|
|
150
|
-
github: "github",
|
|
151
|
-
gitlab: "gitlab",
|
|
152
|
-
gmail: "gmail",
|
|
153
|
-
google: "google",
|
|
154
|
-
"google-calendar": "google-calendar",
|
|
155
|
-
"google-drive": "google-drive",
|
|
156
|
-
helpscout: "helpscout",
|
|
157
|
-
hubspot: "hubspot",
|
|
158
|
-
intercom: "intercom",
|
|
159
|
-
jira: "jira",
|
|
160
|
-
linear: "linear",
|
|
161
|
-
microsoft: "microsoft",
|
|
162
|
-
"microsoft-onedrive": "microsoft-onedrive",
|
|
163
|
-
"microsoft-onenote": "microsoft-onenote",
|
|
164
|
-
"microsoft-outlook": "microsoft-outlook",
|
|
165
|
-
"microsoft-outlook-calendar": "microsoft-outlook-calendar",
|
|
166
|
-
"microsoft-sharepoint": "microsoft-sharepoint",
|
|
167
|
-
"microsoft-teams": "microsoft-teams",
|
|
168
|
-
"microsoft-todo": "microsoft-todo",
|
|
169
|
-
notion: "notion",
|
|
170
|
-
prefect: "prefect",
|
|
171
|
-
"pydantic-logfire": "pydantic-logfire",
|
|
172
|
-
salesforce: "salesforce",
|
|
173
|
-
sentry: "sentry",
|
|
174
|
-
slack: "slack",
|
|
175
|
-
snowflake: "snowflake",
|
|
176
|
-
stripe: "stripe",
|
|
177
|
-
xero: "xero",
|
|
178
|
-
zendesk: "zendesk"
|
|
179
|
-
};
|
|
180
|
-
const DataIntegrationOwnership = {
|
|
181
|
-
userland_user: "userland_user",
|
|
182
|
-
organization: "organization"
|
|
183
|
-
};
|
|
184
|
-
const DataIntegrationCredentialsType = {
|
|
185
|
-
shared: "shared",
|
|
186
|
-
custom: "custom"
|
|
46
|
+
const DirectoryType = {
|
|
47
|
+
azure_scim_v20: "azure scim v2.0",
|
|
48
|
+
bamboohr: "bamboohr",
|
|
49
|
+
breathe_hr: "breathe hr",
|
|
50
|
+
cezanne_hr: "cezanne hr",
|
|
51
|
+
cyberark_scim_v20: "cyberark scim v2.0",
|
|
52
|
+
fourth_hr: "fourth hr",
|
|
53
|
+
generic_scim_v20: "generic scim v2.0",
|
|
54
|
+
gsuite_directory: "gsuite directory",
|
|
55
|
+
gusto: "gusto",
|
|
56
|
+
hibob: "hibob",
|
|
57
|
+
jump_cloud_scim_v20: "jump cloud scim v2.0",
|
|
58
|
+
okta_scim_v20: "okta scim v2.0",
|
|
59
|
+
onelogin_scim_v20: "onelogin scim v2.0",
|
|
60
|
+
people_hr: "people hr",
|
|
61
|
+
personio: "personio",
|
|
62
|
+
pingfederate_scim_v20: "pingfederate scim v2.0",
|
|
63
|
+
rippling: "rippling",
|
|
64
|
+
rippling_scim_v20: "rippling scim v2.0",
|
|
65
|
+
s3: "s3",
|
|
66
|
+
sailpoint_scim_v20: "sailpoint scim v2.0",
|
|
67
|
+
sftp: "sftp",
|
|
68
|
+
sftp_workday: "sftp workday",
|
|
69
|
+
workday: "workday"
|
|
70
|
+
};
|
|
71
|
+
const DirectoryState = {
|
|
72
|
+
requires_type: "requires_type",
|
|
73
|
+
linked: "linked",
|
|
74
|
+
validating: "validating",
|
|
75
|
+
invalid_credentials: "invalid_credentials",
|
|
76
|
+
unlinked: "unlinked",
|
|
77
|
+
deleting: "deleting"
|
|
187
78
|
};
|
|
188
79
|
const GenerateAdminPortalLinkIntent = {
|
|
189
80
|
domain_verification: "domain_verification",
|
|
190
|
-
sso: "sso"
|
|
81
|
+
sso: "sso",
|
|
82
|
+
log_streams: "log_streams"
|
|
191
83
|
};
|
|
192
|
-
const
|
|
84
|
+
const getCreateOrganizationApiKeyUrl = () => {
|
|
85
|
+
return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
86
|
+
};
|
|
87
|
+
const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options) => {
|
|
88
|
+
const res = await fetch(getCreateOrganizationApiKeyUrl(), {
|
|
89
|
+
...options,
|
|
90
|
+
method: "POST",
|
|
91
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
92
|
+
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
93
|
+
});
|
|
94
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
95
|
+
const data = body ? JSON.parse(body) : {};
|
|
96
|
+
return {
|
|
97
|
+
data,
|
|
98
|
+
status: res.status,
|
|
99
|
+
headers: res.headers
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
const getListOrganizationApiKeysUrl = (params) => {
|
|
193
103
|
const normalizedParams = new URLSearchParams();
|
|
194
104
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
195
105
|
if (value !== void 0) {
|
|
@@ -197,36 +107,51 @@ const getMembersUrl = (params) => {
|
|
|
197
107
|
}
|
|
198
108
|
});
|
|
199
109
|
const stringifiedParams = normalizedParams.toString();
|
|
200
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/
|
|
110
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
201
111
|
};
|
|
202
|
-
const
|
|
203
|
-
const res = await fetch(
|
|
112
|
+
const listOrganizationApiKeys = async (params, options) => {
|
|
113
|
+
const res = await fetch(getListOrganizationApiKeysUrl(params), {
|
|
204
114
|
...options,
|
|
205
115
|
method: "GET"
|
|
206
116
|
});
|
|
207
117
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
208
118
|
const data = body ? JSON.parse(body) : {};
|
|
209
|
-
return {
|
|
119
|
+
return {
|
|
120
|
+
data,
|
|
121
|
+
status: res.status,
|
|
122
|
+
headers: res.headers
|
|
123
|
+
};
|
|
210
124
|
};
|
|
211
|
-
const
|
|
212
|
-
|
|
125
|
+
const getListOrganizationApiKeyPermissionsUrl = (params) => {
|
|
126
|
+
const normalizedParams = new URLSearchParams();
|
|
127
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
128
|
+
if (value !== void 0) {
|
|
129
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
const stringifiedParams = normalizedParams.toString();
|
|
133
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
213
134
|
};
|
|
214
|
-
const
|
|
215
|
-
const res = await fetch(
|
|
135
|
+
const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
136
|
+
const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {
|
|
216
137
|
...options,
|
|
217
138
|
method: "GET"
|
|
218
139
|
});
|
|
219
140
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
220
141
|
const data = body ? JSON.parse(body) : {};
|
|
221
|
-
return {
|
|
142
|
+
return {
|
|
143
|
+
data,
|
|
144
|
+
status: res.status,
|
|
145
|
+
headers: res.headers
|
|
146
|
+
};
|
|
222
147
|
};
|
|
223
|
-
const
|
|
224
|
-
return `https://api.workos.com/_widgets/
|
|
148
|
+
const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
|
|
149
|
+
return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
|
|
225
150
|
};
|
|
226
|
-
const
|
|
227
|
-
const res = await fetch(
|
|
151
|
+
const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
152
|
+
const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {
|
|
228
153
|
...options,
|
|
229
|
-
method: "
|
|
154
|
+
method: "DELETE"
|
|
230
155
|
});
|
|
231
156
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
232
157
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -236,15 +161,13 @@ const rolesAndConfig = async (options) => {
|
|
|
236
161
|
headers: res.headers
|
|
237
162
|
};
|
|
238
163
|
};
|
|
239
|
-
const
|
|
240
|
-
return `https://api.workos.com/_widgets/
|
|
164
|
+
const getDeleteDataInstallationUrl = (installationId) => {
|
|
165
|
+
return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;
|
|
241
166
|
};
|
|
242
|
-
const
|
|
243
|
-
const res = await fetch(
|
|
167
|
+
const deleteDataInstallation = async (installationId, options) => {
|
|
168
|
+
const res = await fetch(getDeleteDataInstallationUrl(installationId), {
|
|
244
169
|
...options,
|
|
245
|
-
method: "
|
|
246
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
247
|
-
body: JSON.stringify(inviteMemberBody)
|
|
170
|
+
method: "DELETE"
|
|
248
171
|
});
|
|
249
172
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
250
173
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -254,13 +177,13 @@ const inviteMember = async (inviteMemberBody, options) => {
|
|
|
254
177
|
headers: res.headers
|
|
255
178
|
};
|
|
256
179
|
};
|
|
257
|
-
const
|
|
258
|
-
return `https://api.workos.com/_widgets/
|
|
180
|
+
const getMyDataIntegrationsUrl = () => {
|
|
181
|
+
return `https://api.workos.com/_widgets/DataIntegrations/mine`;
|
|
259
182
|
};
|
|
260
|
-
const
|
|
261
|
-
const res = await fetch(
|
|
183
|
+
const myDataIntegrations = async (options) => {
|
|
184
|
+
const res = await fetch(getMyDataIntegrationsUrl(), {
|
|
262
185
|
...options,
|
|
263
|
-
method: "
|
|
186
|
+
method: "GET"
|
|
264
187
|
});
|
|
265
188
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
266
189
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -270,14 +193,17 @@ const resendInvite = async (userId, options) => {
|
|
|
270
193
|
headers: res.headers
|
|
271
194
|
};
|
|
272
195
|
};
|
|
273
|
-
const
|
|
274
|
-
return `https://api.workos.com/_widgets/
|
|
196
|
+
const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
|
|
197
|
+
return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
|
|
275
198
|
};
|
|
276
|
-
const
|
|
277
|
-
const res = await fetch(
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
199
|
+
const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state, options) => {
|
|
200
|
+
const res = await fetch(
|
|
201
|
+
getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),
|
|
202
|
+
{
|
|
203
|
+
...options,
|
|
204
|
+
method: "GET"
|
|
205
|
+
}
|
|
206
|
+
);
|
|
281
207
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
282
208
|
const data = body ? JSON.parse(body) : {};
|
|
283
209
|
return {
|
|
@@ -286,13 +212,20 @@ const revokeInvite = async (userId, options) => {
|
|
|
286
212
|
headers: res.headers
|
|
287
213
|
};
|
|
288
214
|
};
|
|
289
|
-
const
|
|
290
|
-
|
|
215
|
+
const getGetDataIntegrationAuthorizeUrlUrl = (slug, params) => {
|
|
216
|
+
const normalizedParams = new URLSearchParams();
|
|
217
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
218
|
+
if (value !== void 0) {
|
|
219
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
const stringifiedParams = normalizedParams.toString();
|
|
223
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
291
224
|
};
|
|
292
|
-
const
|
|
293
|
-
const res = await fetch(
|
|
225
|
+
const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
226
|
+
const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {
|
|
294
227
|
...options,
|
|
295
|
-
method: "
|
|
228
|
+
method: "GET"
|
|
296
229
|
});
|
|
297
230
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
298
231
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -302,15 +235,15 @@ const removeMember = async (userId, options) => {
|
|
|
302
235
|
headers: res.headers
|
|
303
236
|
};
|
|
304
237
|
};
|
|
305
|
-
const
|
|
306
|
-
return `https://api.workos.com/_widgets/UserManagement/
|
|
238
|
+
const getInviteMemberUrl = () => {
|
|
239
|
+
return `https://api.workos.com/_widgets/UserManagement/invite-user`;
|
|
307
240
|
};
|
|
308
|
-
const
|
|
309
|
-
const res = await fetch(
|
|
241
|
+
const inviteMember = async (inviteMemberBody, options) => {
|
|
242
|
+
const res = await fetch(getInviteMemberUrl(), {
|
|
310
243
|
...options,
|
|
311
244
|
method: "POST",
|
|
312
245
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
313
|
-
body: JSON.stringify(
|
|
246
|
+
body: JSON.stringify(inviteMemberBody)
|
|
314
247
|
});
|
|
315
248
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
316
249
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -320,13 +253,13 @@ const updateMember = async (userId, updateMemberBody, options) => {
|
|
|
320
253
|
headers: res.headers
|
|
321
254
|
};
|
|
322
255
|
};
|
|
323
|
-
const
|
|
324
|
-
return `https://api.workos.com/_widgets/UserManagement/
|
|
256
|
+
const getRevokeInviteUrl = (userId) => {
|
|
257
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
|
|
325
258
|
};
|
|
326
|
-
const
|
|
327
|
-
const res = await fetch(
|
|
259
|
+
const revokeInvite = async (userId, options) => {
|
|
260
|
+
const res = await fetch(getRevokeInviteUrl(userId), {
|
|
328
261
|
...options,
|
|
329
|
-
method: "
|
|
262
|
+
method: "DELETE"
|
|
330
263
|
});
|
|
331
264
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
332
265
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -336,39 +269,48 @@ const organizations = async (options) => {
|
|
|
336
269
|
headers: res.headers
|
|
337
270
|
};
|
|
338
271
|
};
|
|
339
|
-
const
|
|
340
|
-
return `https://api.workos.com/_widgets/
|
|
272
|
+
const getResendInviteUrl = (userId) => {
|
|
273
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;
|
|
341
274
|
};
|
|
342
|
-
const
|
|
343
|
-
const res = await fetch(
|
|
275
|
+
const resendInvite = async (userId, options) => {
|
|
276
|
+
const res = await fetch(getResendInviteUrl(userId), {
|
|
344
277
|
...options,
|
|
345
|
-
method: "
|
|
278
|
+
method: "POST"
|
|
346
279
|
});
|
|
347
280
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
348
281
|
const data = body ? JSON.parse(body) : {};
|
|
349
|
-
return {
|
|
282
|
+
return {
|
|
283
|
+
data,
|
|
284
|
+
status: res.status,
|
|
285
|
+
headers: res.headers
|
|
286
|
+
};
|
|
350
287
|
};
|
|
351
|
-
const
|
|
352
|
-
|
|
288
|
+
const getMembersUrl = (params) => {
|
|
289
|
+
const normalizedParams = new URLSearchParams();
|
|
290
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
291
|
+
if (value !== void 0) {
|
|
292
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
const stringifiedParams = normalizedParams.toString();
|
|
296
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
|
|
353
297
|
};
|
|
354
|
-
const
|
|
355
|
-
const res = await fetch(
|
|
298
|
+
const members = async (params, options) => {
|
|
299
|
+
const res = await fetch(getMembersUrl(params), {
|
|
356
300
|
...options,
|
|
357
|
-
method: "
|
|
358
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
359
|
-
body: JSON.stringify(updateMeBody)
|
|
301
|
+
method: "GET"
|
|
360
302
|
});
|
|
361
303
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
362
304
|
const data = body ? JSON.parse(body) : {};
|
|
363
305
|
return { data, status: res.status, headers: res.headers };
|
|
364
306
|
};
|
|
365
|
-
const
|
|
366
|
-
return `https://api.workos.com/_widgets/
|
|
307
|
+
const getRemoveMemberUrl = (userId) => {
|
|
308
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
367
309
|
};
|
|
368
|
-
const
|
|
369
|
-
const res = await fetch(
|
|
310
|
+
const removeMember = async (userId, options) => {
|
|
311
|
+
const res = await fetch(getRemoveMemberUrl(userId), {
|
|
370
312
|
...options,
|
|
371
|
-
method: "
|
|
313
|
+
method: "DELETE"
|
|
372
314
|
});
|
|
373
315
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
374
316
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -378,15 +320,15 @@ const createTotpFactor = async (options) => {
|
|
|
378
320
|
headers: res.headers
|
|
379
321
|
};
|
|
380
322
|
};
|
|
381
|
-
const
|
|
382
|
-
return `https://api.workos.com/_widgets/
|
|
323
|
+
const getUpdateMemberUrl = (userId) => {
|
|
324
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
383
325
|
};
|
|
384
|
-
const
|
|
385
|
-
const res = await fetch(
|
|
326
|
+
const updateMember = async (userId, updateMemberBody, options) => {
|
|
327
|
+
const res = await fetch(getUpdateMemberUrl(userId), {
|
|
386
328
|
...options,
|
|
387
329
|
method: "POST",
|
|
388
330
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
389
|
-
body: JSON.stringify(
|
|
331
|
+
body: JSON.stringify(updateMemberBody)
|
|
390
332
|
});
|
|
391
333
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
392
334
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -396,13 +338,13 @@ const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
|
396
338
|
headers: res.headers
|
|
397
339
|
};
|
|
398
340
|
};
|
|
399
|
-
const
|
|
400
|
-
return `https://api.workos.com/_widgets/
|
|
341
|
+
const getOrganizationsUrl = () => {
|
|
342
|
+
return `https://api.workos.com/_widgets/UserManagement/organizations`;
|
|
401
343
|
};
|
|
402
|
-
const
|
|
403
|
-
const res = await fetch(
|
|
344
|
+
const organizations = async (options) => {
|
|
345
|
+
const res = await fetch(getOrganizationsUrl(), {
|
|
404
346
|
...options,
|
|
405
|
-
method: "
|
|
347
|
+
method: "GET"
|
|
406
348
|
});
|
|
407
349
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
408
350
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -412,31 +354,25 @@ const deleteTotpFactors = async (options) => {
|
|
|
412
354
|
headers: res.headers
|
|
413
355
|
};
|
|
414
356
|
};
|
|
415
|
-
const
|
|
416
|
-
return `https://api.workos.com/_widgets/
|
|
357
|
+
const getRolesUrl = () => {
|
|
358
|
+
return `https://api.workos.com/_widgets/UserManagement/roles`;
|
|
417
359
|
};
|
|
418
|
-
const
|
|
419
|
-
const res = await fetch(
|
|
360
|
+
const roles = async (options) => {
|
|
361
|
+
const res = await fetch(getRolesUrl(), {
|
|
420
362
|
...options,
|
|
421
363
|
method: "GET"
|
|
422
364
|
});
|
|
423
365
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
424
366
|
const data = body ? JSON.parse(body) : {};
|
|
425
|
-
return {
|
|
426
|
-
data,
|
|
427
|
-
status: res.status,
|
|
428
|
-
headers: res.headers
|
|
429
|
-
};
|
|
367
|
+
return { data, status: res.status, headers: res.headers };
|
|
430
368
|
};
|
|
431
|
-
const
|
|
432
|
-
return `https://api.workos.com/_widgets/
|
|
369
|
+
const getRolesAndConfigUrl = () => {
|
|
370
|
+
return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;
|
|
433
371
|
};
|
|
434
|
-
const
|
|
435
|
-
const res = await fetch(
|
|
372
|
+
const rolesAndConfig = async (options) => {
|
|
373
|
+
const res = await fetch(getRolesAndConfigUrl(), {
|
|
436
374
|
...options,
|
|
437
|
-
method: "
|
|
438
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
439
|
-
body: JSON.stringify(createPasswordRequest)
|
|
375
|
+
method: "GET"
|
|
440
376
|
});
|
|
441
377
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
442
378
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -446,15 +382,13 @@ const createPassword = async (createPasswordRequest, options) => {
|
|
|
446
382
|
headers: res.headers
|
|
447
383
|
};
|
|
448
384
|
};
|
|
449
|
-
const
|
|
450
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
385
|
+
const getAuthenticationInformationUrl = () => {
|
|
386
|
+
return `https://api.workos.com/_widgets/UserProfile/authentication-information`;
|
|
451
387
|
};
|
|
452
|
-
const
|
|
453
|
-
const res = await fetch(
|
|
388
|
+
const authenticationInformation = async (options) => {
|
|
389
|
+
const res = await fetch(getAuthenticationInformationUrl(), {
|
|
454
390
|
...options,
|
|
455
|
-
method: "
|
|
456
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
457
|
-
body: JSON.stringify(updatePasswordRequest)
|
|
391
|
+
method: "GET"
|
|
458
392
|
});
|
|
459
393
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
460
394
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -464,15 +398,15 @@ const updatePassword = async (updatePasswordRequest, options) => {
|
|
|
464
398
|
headers: res.headers
|
|
465
399
|
};
|
|
466
400
|
};
|
|
467
|
-
const
|
|
468
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
401
|
+
const getCreatePasswordUrl = () => {
|
|
402
|
+
return `https://api.workos.com/_widgets/UserProfile/create-password`;
|
|
469
403
|
};
|
|
470
|
-
const
|
|
471
|
-
const res = await fetch(
|
|
404
|
+
const createPassword = async (createPasswordRequest, options) => {
|
|
405
|
+
const res = await fetch(getCreatePasswordUrl(), {
|
|
472
406
|
...options,
|
|
473
|
-
method: "
|
|
407
|
+
method: "POST",
|
|
474
408
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
475
|
-
body: JSON.stringify(
|
|
409
|
+
body: JSON.stringify(createPasswordRequest)
|
|
476
410
|
});
|
|
477
411
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
478
412
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -482,13 +416,13 @@ const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
|
482
416
|
headers: res.headers
|
|
483
417
|
};
|
|
484
418
|
};
|
|
485
|
-
const
|
|
486
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
419
|
+
const getCreateTotpFactorUrl = () => {
|
|
420
|
+
return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
|
|
487
421
|
};
|
|
488
|
-
const
|
|
489
|
-
const res = await fetch(
|
|
422
|
+
const createTotpFactor = async (options) => {
|
|
423
|
+
const res = await fetch(getCreateTotpFactorUrl(), {
|
|
490
424
|
...options,
|
|
491
|
-
method: "
|
|
425
|
+
method: "POST"
|
|
492
426
|
});
|
|
493
427
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
494
428
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -498,11 +432,11 @@ const revokeSession = async (sessionId, options) => {
|
|
|
498
432
|
headers: res.headers
|
|
499
433
|
};
|
|
500
434
|
};
|
|
501
|
-
const
|
|
502
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
435
|
+
const getMeUrl = () => {
|
|
436
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
503
437
|
};
|
|
504
|
-
const
|
|
505
|
-
const res = await fetch(
|
|
438
|
+
const me = async (options) => {
|
|
439
|
+
const res = await fetch(getMeUrl(), {
|
|
506
440
|
...options,
|
|
507
441
|
method: "GET"
|
|
508
442
|
});
|
|
@@ -510,31 +444,15 @@ const sessions = async (options) => {
|
|
|
510
444
|
const data = body ? JSON.parse(body) : {};
|
|
511
445
|
return { data, status: res.status, headers: res.headers };
|
|
512
446
|
};
|
|
513
|
-
const
|
|
514
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
515
|
-
};
|
|
516
|
-
const sendVerification = async (options) => {
|
|
517
|
-
const res = await fetch(getSendVerificationUrl(), {
|
|
518
|
-
...options,
|
|
519
|
-
method: "POST"
|
|
520
|
-
});
|
|
521
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
522
|
-
const data = body ? JSON.parse(body) : {};
|
|
523
|
-
return {
|
|
524
|
-
data,
|
|
525
|
-
status: res.status,
|
|
526
|
-
headers: res.headers
|
|
527
|
-
};
|
|
528
|
-
};
|
|
529
|
-
const getVerifyUrl = () => {
|
|
530
|
-
return `https://api.workos.com/_widgets/UserProfile/verify`;
|
|
447
|
+
const getUpdateMeUrl = () => {
|
|
448
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
531
449
|
};
|
|
532
|
-
const
|
|
533
|
-
const res = await fetch(
|
|
450
|
+
const updateMe = async (updateMeBody, options) => {
|
|
451
|
+
const res = await fetch(getUpdateMeUrl(), {
|
|
534
452
|
...options,
|
|
535
453
|
method: "POST",
|
|
536
454
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
537
|
-
body: JSON.stringify(
|
|
455
|
+
body: JSON.stringify(updateMeBody)
|
|
538
456
|
});
|
|
539
457
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
540
458
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -590,11 +508,27 @@ const deletePasskey = async (passkeyId, options) => {
|
|
|
590
508
|
headers: res.headers
|
|
591
509
|
};
|
|
592
510
|
};
|
|
593
|
-
const
|
|
594
|
-
return `https://api.workos.com/_widgets/
|
|
511
|
+
const getSendVerificationUrl = () => {
|
|
512
|
+
return `https://api.workos.com/_widgets/UserProfile/send-verification`;
|
|
595
513
|
};
|
|
596
|
-
const
|
|
597
|
-
const res = await fetch(
|
|
514
|
+
const sendVerification = async (options) => {
|
|
515
|
+
const res = await fetch(getSendVerificationUrl(), {
|
|
516
|
+
...options,
|
|
517
|
+
method: "POST"
|
|
518
|
+
});
|
|
519
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
520
|
+
const data = body ? JSON.parse(body) : {};
|
|
521
|
+
return {
|
|
522
|
+
data,
|
|
523
|
+
status: res.status,
|
|
524
|
+
headers: res.headers
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
const getSessionsUrl = () => {
|
|
528
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions`;
|
|
529
|
+
};
|
|
530
|
+
const sessions = async (options) => {
|
|
531
|
+
const res = await fetch(getSessionsUrl(), {
|
|
598
532
|
...options,
|
|
599
533
|
method: "GET"
|
|
600
534
|
});
|
|
@@ -602,13 +536,15 @@ const settings = async (options) => {
|
|
|
602
536
|
const data = body ? JSON.parse(body) : {};
|
|
603
537
|
return { data, status: res.status, headers: res.headers };
|
|
604
538
|
};
|
|
605
|
-
const
|
|
606
|
-
return `https://api.workos.com/_widgets/
|
|
539
|
+
const getRevokeAllSessionsUrl = () => {
|
|
540
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
|
|
607
541
|
};
|
|
608
|
-
const
|
|
609
|
-
const res = await fetch(
|
|
542
|
+
const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
543
|
+
const res = await fetch(getRevokeAllSessionsUrl(), {
|
|
610
544
|
...options,
|
|
611
|
-
method: "
|
|
545
|
+
method: "DELETE",
|
|
546
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
547
|
+
body: JSON.stringify(revokeAllSessionsRequest)
|
|
612
548
|
});
|
|
613
549
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
614
550
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -618,20 +554,13 @@ const listOrganizationDomains = async (options) => {
|
|
|
618
554
|
headers: res.headers
|
|
619
555
|
};
|
|
620
556
|
};
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
624
|
-
if (value !== void 0) {
|
|
625
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
const stringifiedParams = normalizedParams.toString();
|
|
629
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
557
|
+
const getRevokeSessionUrl = (sessionId) => {
|
|
558
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;
|
|
630
559
|
};
|
|
631
|
-
const
|
|
632
|
-
const res = await fetch(
|
|
560
|
+
const revokeSession = async (sessionId, options) => {
|
|
561
|
+
const res = await fetch(getRevokeSessionUrl(sessionId), {
|
|
633
562
|
...options,
|
|
634
|
-
method: "
|
|
563
|
+
method: "DELETE"
|
|
635
564
|
});
|
|
636
565
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
637
566
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -641,11 +570,11 @@ const generateAdminPortalLink = async (params, options) => {
|
|
|
641
570
|
headers: res.headers
|
|
642
571
|
};
|
|
643
572
|
};
|
|
644
|
-
const
|
|
645
|
-
return `https://api.workos.com/_widgets/
|
|
573
|
+
const getDeleteTotpFactorsUrl = () => {
|
|
574
|
+
return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
|
|
646
575
|
};
|
|
647
|
-
const
|
|
648
|
-
const res = await fetch(
|
|
576
|
+
const deleteTotpFactors = async (options) => {
|
|
577
|
+
const res = await fetch(getDeleteTotpFactorsUrl(), {
|
|
649
578
|
...options,
|
|
650
579
|
method: "DELETE"
|
|
651
580
|
});
|
|
@@ -657,13 +586,15 @@ const deleteOrganizationDomain = async (domainId, options) => {
|
|
|
657
586
|
headers: res.headers
|
|
658
587
|
};
|
|
659
588
|
};
|
|
660
|
-
const
|
|
661
|
-
return `https://api.workos.com/_widgets/
|
|
589
|
+
const getUpdatePasswordUrl = () => {
|
|
590
|
+
return `https://api.workos.com/_widgets/UserProfile/update-password`;
|
|
662
591
|
};
|
|
663
|
-
const
|
|
664
|
-
const res = await fetch(
|
|
592
|
+
const updatePassword = async (updatePasswordRequest, options) => {
|
|
593
|
+
const res = await fetch(getUpdatePasswordUrl(), {
|
|
665
594
|
...options,
|
|
666
|
-
method: "POST"
|
|
595
|
+
method: "POST",
|
|
596
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
597
|
+
body: JSON.stringify(updatePasswordRequest)
|
|
667
598
|
});
|
|
668
599
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
669
600
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -673,13 +604,29 @@ const reverifyOrganizationDomain = async (domainId, options) => {
|
|
|
673
604
|
headers: res.headers
|
|
674
605
|
};
|
|
675
606
|
};
|
|
676
|
-
const
|
|
677
|
-
return `https://api.workos.com/_widgets/
|
|
607
|
+
const getVerifyUrl = () => {
|
|
608
|
+
return `https://api.workos.com/_widgets/UserProfile/verify`;
|
|
678
609
|
};
|
|
679
|
-
const
|
|
680
|
-
const res = await fetch(
|
|
610
|
+
const verify = async (verifyRequest, options) => {
|
|
611
|
+
const res = await fetch(getVerifyUrl(), {
|
|
681
612
|
...options,
|
|
682
|
-
method: "
|
|
613
|
+
method: "POST",
|
|
614
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
615
|
+
body: JSON.stringify(verifyRequest)
|
|
616
|
+
});
|
|
617
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
618
|
+
const data = body ? JSON.parse(body) : {};
|
|
619
|
+
return { data, status: res.status, headers: res.headers };
|
|
620
|
+
};
|
|
621
|
+
const getVerifyTotpFactorUrl = () => {
|
|
622
|
+
return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
|
|
623
|
+
};
|
|
624
|
+
const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
625
|
+
const res = await fetch(getVerifyTotpFactorUrl(), {
|
|
626
|
+
...options,
|
|
627
|
+
method: "POST",
|
|
628
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
629
|
+
body: JSON.stringify(verifyTotpFactorRequest)
|
|
683
630
|
});
|
|
684
631
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
685
632
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -689,15 +636,13 @@ const listSsoConnections = async (options) => {
|
|
|
689
636
|
headers: res.headers
|
|
690
637
|
};
|
|
691
638
|
};
|
|
692
|
-
const
|
|
693
|
-
return `https://api.workos.com/_widgets/
|
|
639
|
+
const getGetAuditLogStreamUrl = () => {
|
|
640
|
+
return `https://api.workos.com/_widgets/admin-portal/audit-log-stream`;
|
|
694
641
|
};
|
|
695
|
-
const
|
|
696
|
-
const res = await fetch(
|
|
642
|
+
const getAuditLogStream = async (options) => {
|
|
643
|
+
const res = await fetch(getGetAuditLogStreamUrl(), {
|
|
697
644
|
...options,
|
|
698
|
-
method: "
|
|
699
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
700
|
-
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
645
|
+
method: "GET"
|
|
701
646
|
});
|
|
702
647
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
703
648
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -707,7 +652,7 @@ const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options
|
|
|
707
652
|
headers: res.headers
|
|
708
653
|
};
|
|
709
654
|
};
|
|
710
|
-
const
|
|
655
|
+
const getGenerateAdminPortalLinkUrl = (params) => {
|
|
711
656
|
const normalizedParams = new URLSearchParams();
|
|
712
657
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
713
658
|
if (value !== void 0) {
|
|
@@ -715,12 +660,12 @@ const getListOrganizationApiKeysUrl = (params) => {
|
|
|
715
660
|
}
|
|
716
661
|
});
|
|
717
662
|
const stringifiedParams = normalizedParams.toString();
|
|
718
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/
|
|
663
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
719
664
|
};
|
|
720
|
-
const
|
|
721
|
-
const res = await fetch(
|
|
665
|
+
const generateAdminPortalLink = async (params, options) => {
|
|
666
|
+
const res = await fetch(getGenerateAdminPortalLinkUrl(params), {
|
|
722
667
|
...options,
|
|
723
|
-
method: "
|
|
668
|
+
method: "POST"
|
|
724
669
|
});
|
|
725
670
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
726
671
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -730,18 +675,11 @@ const listOrganizationApiKeys = async (params, options) => {
|
|
|
730
675
|
headers: res.headers
|
|
731
676
|
};
|
|
732
677
|
};
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
736
|
-
if (value !== void 0) {
|
|
737
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
const stringifiedParams = normalizedParams.toString();
|
|
741
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
678
|
+
const getListOrganizationDomainsUrl = () => {
|
|
679
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains`;
|
|
742
680
|
};
|
|
743
|
-
const
|
|
744
|
-
const res = await fetch(
|
|
681
|
+
const listOrganizationDomains = async (options) => {
|
|
682
|
+
const res = await fetch(getListOrganizationDomainsUrl(), {
|
|
745
683
|
...options,
|
|
746
684
|
method: "GET"
|
|
747
685
|
});
|
|
@@ -753,11 +691,11 @@ const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
|
753
691
|
headers: res.headers
|
|
754
692
|
};
|
|
755
693
|
};
|
|
756
|
-
const
|
|
757
|
-
return `https://api.workos.com/_widgets/
|
|
694
|
+
const getDeleteOrganizationDomainUrl = (domainId) => {
|
|
695
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;
|
|
758
696
|
};
|
|
759
|
-
const
|
|
760
|
-
const res = await fetch(
|
|
697
|
+
const deleteOrganizationDomain = async (domainId, options) => {
|
|
698
|
+
const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {
|
|
761
699
|
...options,
|
|
762
700
|
method: "DELETE"
|
|
763
701
|
});
|
|
@@ -769,13 +707,13 @@ const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
|
769
707
|
headers: res.headers
|
|
770
708
|
};
|
|
771
709
|
};
|
|
772
|
-
const
|
|
773
|
-
return `https://api.workos.com/_widgets/
|
|
710
|
+
const getReverifyOrganizationDomainUrl = (domainId) => {
|
|
711
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;
|
|
774
712
|
};
|
|
775
|
-
const
|
|
776
|
-
const res = await fetch(
|
|
713
|
+
const reverifyOrganizationDomain = async (domainId, options) => {
|
|
714
|
+
const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {
|
|
777
715
|
...options,
|
|
778
|
-
method: "
|
|
716
|
+
method: "POST"
|
|
779
717
|
});
|
|
780
718
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
781
719
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -785,18 +723,11 @@ const myDataIntegrations = async (options) => {
|
|
|
785
723
|
headers: res.headers
|
|
786
724
|
};
|
|
787
725
|
};
|
|
788
|
-
const
|
|
789
|
-
|
|
790
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
791
|
-
if (value !== void 0) {
|
|
792
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
const stringifiedParams = normalizedParams.toString();
|
|
796
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
726
|
+
const getListSsoConnectionsUrl = () => {
|
|
727
|
+
return `https://api.workos.com/_widgets/admin-portal/sso-connections`;
|
|
797
728
|
};
|
|
798
|
-
const
|
|
799
|
-
const res = await fetch(
|
|
729
|
+
const listSsoConnections = async (options) => {
|
|
730
|
+
const res = await fetch(getListSsoConnectionsUrl(), {
|
|
800
731
|
...options,
|
|
801
732
|
method: "GET"
|
|
802
733
|
});
|
|
@@ -808,17 +739,14 @@ const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
|
808
739
|
headers: res.headers
|
|
809
740
|
};
|
|
810
741
|
};
|
|
811
|
-
const
|
|
812
|
-
return `https://api.workos.com/_widgets/
|
|
742
|
+
const getListDirectoriesUrl = () => {
|
|
743
|
+
return `https://api.workos.com/_widgets/directory-sync/directories`;
|
|
813
744
|
};
|
|
814
|
-
const
|
|
815
|
-
const res = await fetch(
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
method: "GET"
|
|
820
|
-
}
|
|
821
|
-
);
|
|
745
|
+
const listDirectories = async (options) => {
|
|
746
|
+
const res = await fetch(getListDirectoriesUrl(), {
|
|
747
|
+
...options,
|
|
748
|
+
method: "GET"
|
|
749
|
+
});
|
|
822
750
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
823
751
|
const data = body ? JSON.parse(body) : {};
|
|
824
752
|
return {
|
|
@@ -827,13 +755,13 @@ const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state,
|
|
|
827
755
|
headers: res.headers
|
|
828
756
|
};
|
|
829
757
|
};
|
|
830
|
-
const
|
|
831
|
-
return `https://api.workos.com/_widgets/
|
|
758
|
+
const getGetDirectoryUrl = (directoryId) => {
|
|
759
|
+
return `https://api.workos.com/_widgets/directory-sync/directories/${directoryId}`;
|
|
832
760
|
};
|
|
833
|
-
const
|
|
834
|
-
const res = await fetch(
|
|
761
|
+
const getDirectory = async (directoryId, options) => {
|
|
762
|
+
const res = await fetch(getGetDirectoryUrl(directoryId), {
|
|
835
763
|
...options,
|
|
836
|
-
method: "
|
|
764
|
+
method: "GET"
|
|
837
765
|
});
|
|
838
766
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
839
767
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -843,19 +771,21 @@ const deleteDataInstallation = async (installationId, options) => {
|
|
|
843
771
|
headers: res.headers
|
|
844
772
|
};
|
|
845
773
|
};
|
|
774
|
+
const getSettingsUrl = () => {
|
|
775
|
+
return `https://api.workos.com/_widgets/settings`;
|
|
776
|
+
};
|
|
777
|
+
const settings = async (options) => {
|
|
778
|
+
const res = await fetch(getSettingsUrl(), {
|
|
779
|
+
...options,
|
|
780
|
+
method: "GET"
|
|
781
|
+
});
|
|
782
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
783
|
+
const data = body ? JSON.parse(body) : {};
|
|
784
|
+
return { data, status: res.status, headers: res.headers };
|
|
785
|
+
};
|
|
846
786
|
export {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
|
|
850
|
-
CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
|
|
851
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfObject,
|
|
852
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfType,
|
|
853
|
-
DataInstallationObject,
|
|
854
|
-
DataInstallationState,
|
|
855
|
-
DataIntegrationCredentialsType,
|
|
856
|
-
DataIntegrationIntegrationType,
|
|
857
|
-
DataIntegrationObject,
|
|
858
|
-
DataIntegrationOwnership,
|
|
787
|
+
DirectoryState,
|
|
788
|
+
DirectoryType,
|
|
859
789
|
DomainVerificationNameServer,
|
|
860
790
|
GenerateAdminPortalLinkIntent,
|
|
861
791
|
MemberActionsItem,
|
|
@@ -863,14 +793,6 @@ export {
|
|
|
863
793
|
OidcSessionState,
|
|
864
794
|
OrganizationDomainState,
|
|
865
795
|
SamlSessionState,
|
|
866
|
-
SendVerificationResponseType,
|
|
867
|
-
SettingsResponseObject,
|
|
868
|
-
SsoConnectionAnyOfEightAllOfProviderTag,
|
|
869
|
-
SsoConnectionAnyOfEightAllOfState,
|
|
870
|
-
SsoConnectionAnyOfEightAllOfType,
|
|
871
|
-
SsoConnectionAnyOfProviderTag,
|
|
872
|
-
SsoConnectionAnyOfState,
|
|
873
|
-
SsoConnectionAnyOfType,
|
|
874
796
|
SsoConnectionSessionJSONState,
|
|
875
797
|
authenticationInformation,
|
|
876
798
|
createOrganizationApiKey,
|
|
@@ -882,6 +804,7 @@ export {
|
|
|
882
804
|
deletePasskey,
|
|
883
805
|
deleteTotpFactors,
|
|
884
806
|
generateAdminPortalLink,
|
|
807
|
+
getAuditLogStream,
|
|
885
808
|
getAuthenticationInformationUrl,
|
|
886
809
|
getCreateOrganizationApiKeyUrl,
|
|
887
810
|
getCreatePasswordUrl,
|
|
@@ -893,10 +816,14 @@ export {
|
|
|
893
816
|
getDeleteOrganizationDomainUrl,
|
|
894
817
|
getDeletePasskeyUrl,
|
|
895
818
|
getDeleteTotpFactorsUrl,
|
|
819
|
+
getDirectory,
|
|
896
820
|
getGenerateAdminPortalLinkUrl,
|
|
821
|
+
getGetAuditLogStreamUrl,
|
|
897
822
|
getGetDataInstallationAuthorizationStatusUrl,
|
|
898
823
|
getGetDataIntegrationAuthorizeUrlUrl,
|
|
824
|
+
getGetDirectoryUrl,
|
|
899
825
|
getInviteMemberUrl,
|
|
826
|
+
getListDirectoriesUrl,
|
|
900
827
|
getListOrganizationApiKeyPermissionsUrl,
|
|
901
828
|
getListOrganizationApiKeysUrl,
|
|
902
829
|
getListOrganizationDomainsUrl,
|
|
@@ -924,6 +851,7 @@ export {
|
|
|
924
851
|
getVerifyTotpFactorUrl,
|
|
925
852
|
getVerifyUrl,
|
|
926
853
|
inviteMember,
|
|
854
|
+
listDirectories,
|
|
927
855
|
listOrganizationApiKeyPermissions,
|
|
928
856
|
listOrganizationApiKeys,
|
|
929
857
|
listOrganizationDomains,
|