@workos-inc/widgets 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/api/endpoint.cjs +4 -1
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +17 -9
- package/dist/cjs/experimental/api/fetch.cjs +1083 -0
- package/dist/cjs/experimental/api/fetch.cjs.map +1 -0
- package/dist/cjs/experimental/api/fetch.d.cts +1871 -0
- package/dist/cjs/experimental/api/react-query.cjs +1863 -0
- package/dist/cjs/experimental/api/react-query.cjs.map +1 -0
- package/dist/cjs/experimental/api/react-query.d.cts +2685 -0
- package/dist/cjs/experimental/api/swr.cjs +1972 -0
- package/dist/cjs/experimental/api/swr.cjs.map +1 -0
- package/dist/cjs/experimental/api/swr.d.cts +2585 -0
- package/dist/cjs/lib/add-mfa-dialog.cjs +2 -2
- package/dist/cjs/lib/add-mfa-dialog.cjs.map +1 -1
- package/dist/cjs/lib/admin-portal-domain-verification.cjs.map +1 -1
- package/dist/cjs/lib/api/user.d.cts +2 -2
- package/dist/cjs/lib/api-keys/api-keys-search.cjs +2 -2
- package/dist/cjs/lib/api-keys/api-keys-search.cjs.map +1 -1
- package/dist/cjs/lib/api-keys/create-api-key.cjs +8 -8
- package/dist/cjs/lib/api-keys/create-api-key.cjs.map +1 -1
- package/dist/cjs/lib/change-password-dialog.cjs +18 -18
- package/dist/cjs/lib/change-password-dialog.cjs.map +1 -1
- package/dist/cjs/lib/copy-button.cjs.map +1 -1
- package/dist/cjs/lib/edit-user-profile-dialog.cjs +8 -8
- package/dist/cjs/lib/edit-user-profile-dialog.cjs.map +1 -1
- package/dist/cjs/lib/elements/utils.cjs +3 -4
- package/dist/cjs/lib/elements/utils.cjs.map +1 -1
- package/dist/cjs/lib/elements.cjs.map +1 -1
- package/dist/cjs/lib/elevated-access.cjs +2 -2
- package/dist/cjs/lib/elevated-access.cjs.map +1 -1
- package/dist/cjs/lib/marker.cjs.map +1 -1
- package/dist/cjs/lib/organization-switcher.cjs.map +1 -1
- package/dist/cjs/lib/otp-input.cjs +6 -7
- package/dist/cjs/lib/otp-input.cjs.map +1 -1
- package/dist/cjs/lib/provider-icon.cjs.map +1 -1
- package/dist/cjs/lib/set-password-dialog.cjs +12 -12
- package/dist/cjs/lib/set-password-dialog.cjs.map +1 -1
- package/dist/cjs/lib/status.cjs.map +1 -1
- package/dist/cjs/lib/users-search.cjs +2 -2
- package/dist/cjs/lib/users-search.cjs.map +1 -1
- package/dist/cjs/organization-switcher.client.cjs.map +1 -1
- package/dist/esm/api/endpoint.d.ts +17 -9
- package/dist/esm/api/endpoint.js +4 -1
- package/dist/esm/api/endpoint.js.map +1 -1
- package/dist/esm/experimental/api/fetch.d.ts +1871 -0
- package/dist/esm/experimental/api/fetch.js +954 -0
- package/dist/esm/experimental/api/fetch.js.map +1 -0
- package/dist/esm/experimental/api/react-query.d.ts +2685 -0
- package/dist/esm/experimental/api/react-query.js +1641 -0
- package/dist/esm/experimental/api/react-query.js.map +1 -0
- package/dist/esm/experimental/api/swr.d.ts +2585 -0
- package/dist/esm/experimental/api/swr.js +1731 -0
- package/dist/esm/experimental/api/swr.js.map +1 -0
- package/dist/esm/lib/add-mfa-dialog.js +1 -1
- package/dist/esm/lib/add-mfa-dialog.js.map +1 -1
- package/dist/esm/lib/admin-portal-domain-verification.js.map +1 -1
- package/dist/esm/lib/api/user.d.ts +2 -2
- package/dist/esm/lib/api-keys/api-keys-search.js +1 -1
- package/dist/esm/lib/api-keys/api-keys-search.js.map +1 -1
- package/dist/esm/lib/api-keys/create-api-key.js +1 -1
- package/dist/esm/lib/api-keys/create-api-key.js.map +1 -1
- package/dist/esm/lib/change-password-dialog.js +1 -1
- package/dist/esm/lib/change-password-dialog.js.map +1 -1
- package/dist/esm/lib/copy-button.js.map +1 -1
- package/dist/esm/lib/edit-user-profile-dialog.js +1 -1
- package/dist/esm/lib/edit-user-profile-dialog.js.map +1 -1
- package/dist/esm/lib/elements/utils.js +1 -2
- package/dist/esm/lib/elements/utils.js.map +1 -1
- package/dist/esm/lib/elements.js.map +1 -1
- package/dist/esm/lib/elevated-access.js +1 -1
- package/dist/esm/lib/elevated-access.js.map +1 -1
- package/dist/esm/lib/marker.js.map +1 -1
- package/dist/esm/lib/organization-switcher.js.map +1 -1
- package/dist/esm/lib/otp-input.js +6 -3
- package/dist/esm/lib/otp-input.js.map +1 -1
- package/dist/esm/lib/provider-icon.js.map +1 -1
- package/dist/esm/lib/set-password-dialog.js +1 -1
- package/dist/esm/lib/set-password-dialog.js.map +1 -1
- package/dist/esm/lib/status.js.map +1 -1
- package/dist/esm/lib/users-search.js +1 -1
- package/dist/esm/lib/users-search.js.map +1 -1
- package/dist/esm/organization-switcher.client.js.map +1 -1
- package/package.json +33 -23
- package/dist/cjs/lib/use-layout-effect.cjs +0 -31
- package/dist/cjs/lib/use-layout-effect.cjs.map +0 -1
- package/dist/cjs/lib/use-layout-effect.d.cts +0 -5
- package/dist/esm/lib/use-layout-effect.d.ts +0 -5
- package/dist/esm/lib/use-layout-effect.js +0 -7
- package/dist/esm/lib/use-layout-effect.js.map +0 -1
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
const MemberStatus = {
|
|
2
|
+
Active: "Active",
|
|
3
|
+
Invited: "Invited",
|
|
4
|
+
InviteExpired: "InviteExpired",
|
|
5
|
+
InviteRevoked: "InviteRevoked",
|
|
6
|
+
NoInvite: "NoInvite"
|
|
7
|
+
};
|
|
8
|
+
const MemberActionsItem = {
|
|
9
|
+
"edit-role": "edit-role",
|
|
10
|
+
"resend-invite": "resend-invite",
|
|
11
|
+
"revoke-invite": "revoke-invite",
|
|
12
|
+
"revoke-membership": "revoke-membership"
|
|
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
|
+
const OrganizationDomainState = {
|
|
42
|
+
Failed: "Failed",
|
|
43
|
+
LegacyVerified: "LegacyVerified",
|
|
44
|
+
Pending: "Pending",
|
|
45
|
+
Verified: "Verified"
|
|
46
|
+
};
|
|
47
|
+
const DomainVerificationNameServer = {
|
|
48
|
+
AwsRoute53: "AwsRoute53",
|
|
49
|
+
GoogleDomains: "GoogleDomains",
|
|
50
|
+
CloudFlare: "CloudFlare",
|
|
51
|
+
GoDaddy: "GoDaddy",
|
|
52
|
+
Other: "Other"
|
|
53
|
+
};
|
|
54
|
+
const SamlSessionState = {
|
|
55
|
+
Authorized: "Authorized",
|
|
56
|
+
Failed: "Failed",
|
|
57
|
+
Started: "Started",
|
|
58
|
+
Successful: "Successful",
|
|
59
|
+
Timedout: "Timedout"
|
|
60
|
+
};
|
|
61
|
+
const OidcSessionState = {
|
|
62
|
+
Started: "Started",
|
|
63
|
+
Authorized: "Authorized",
|
|
64
|
+
Successful: "Successful",
|
|
65
|
+
Failed: "Failed",
|
|
66
|
+
Terminated: "Terminated",
|
|
67
|
+
Timedout: "Timedout"
|
|
68
|
+
};
|
|
69
|
+
const SsoConnectionSessionJSONState = {
|
|
70
|
+
...SamlSessionState,
|
|
71
|
+
...OidcSessionState
|
|
72
|
+
};
|
|
73
|
+
const SsoConnectionAnyOfType = {
|
|
74
|
+
AdfsSaml: "AdfsSaml",
|
|
75
|
+
Auth0Saml: "Auth0Saml",
|
|
76
|
+
AzureSaml: "AzureSaml",
|
|
77
|
+
CasSaml: "CasSaml",
|
|
78
|
+
ClassLinkSaml: "ClassLinkSaml",
|
|
79
|
+
CloudflareSaml: "CloudflareSaml",
|
|
80
|
+
CyberArkSaml: "CyberArkSaml",
|
|
81
|
+
DuoSaml: "DuoSaml",
|
|
82
|
+
GenericSaml: "GenericSaml",
|
|
83
|
+
GoogleSaml: "GoogleSaml",
|
|
84
|
+
JumpCloudSaml: "JumpCloudSaml",
|
|
85
|
+
KeycloakSaml: "KeycloakSaml",
|
|
86
|
+
LastPassSaml: "LastPassSaml",
|
|
87
|
+
MiniOrangeSaml: "MiniOrangeSaml",
|
|
88
|
+
NetIqSaml: "NetIqSaml",
|
|
89
|
+
OktaSaml: "OktaSaml",
|
|
90
|
+
OneLoginSaml: "OneLoginSaml",
|
|
91
|
+
OracleSaml: "OracleSaml",
|
|
92
|
+
PingFederateSaml: "PingFederateSaml",
|
|
93
|
+
PingOneSaml: "PingOneSaml",
|
|
94
|
+
RipplingSaml: "RipplingSaml",
|
|
95
|
+
SalesforceSaml: "SalesforceSaml",
|
|
96
|
+
ShibbolethGenericSaml: "ShibbolethGenericSaml",
|
|
97
|
+
ShibbolethSaml: "ShibbolethSaml",
|
|
98
|
+
SimpleSamlPhpSaml: "SimpleSamlPhpSaml",
|
|
99
|
+
TestIdp: "TestIdp",
|
|
100
|
+
VmWareSaml: "VmWareSaml"
|
|
101
|
+
};
|
|
102
|
+
const SsoConnectionAnyOfState = {
|
|
103
|
+
Inactive: "Inactive",
|
|
104
|
+
Validating: "Validating",
|
|
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"
|
|
187
|
+
};
|
|
188
|
+
const GenerateAdminPortalLinkIntent = {
|
|
189
|
+
domain_verification: "domain_verification",
|
|
190
|
+
sso: "sso"
|
|
191
|
+
};
|
|
192
|
+
const getMembersUrl = (params) => {
|
|
193
|
+
const normalizedParams = new URLSearchParams();
|
|
194
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
195
|
+
if (value !== void 0) {
|
|
196
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
const stringifiedParams = normalizedParams.toString();
|
|
200
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
|
|
201
|
+
};
|
|
202
|
+
const members = async (params, options) => {
|
|
203
|
+
const res = await fetch(getMembersUrl(params), {
|
|
204
|
+
...options,
|
|
205
|
+
method: "GET"
|
|
206
|
+
});
|
|
207
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
208
|
+
const data = body ? JSON.parse(body) : {};
|
|
209
|
+
return { data, status: res.status, headers: res.headers };
|
|
210
|
+
};
|
|
211
|
+
const getRolesUrl = () => {
|
|
212
|
+
return `https://api.workos.com/_widgets/UserManagement/roles`;
|
|
213
|
+
};
|
|
214
|
+
const roles = async (options) => {
|
|
215
|
+
const res = await fetch(getRolesUrl(), {
|
|
216
|
+
...options,
|
|
217
|
+
method: "GET"
|
|
218
|
+
});
|
|
219
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
220
|
+
const data = body ? JSON.parse(body) : {};
|
|
221
|
+
return { data, status: res.status, headers: res.headers };
|
|
222
|
+
};
|
|
223
|
+
const getRolesAndConfigUrl = () => {
|
|
224
|
+
return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;
|
|
225
|
+
};
|
|
226
|
+
const rolesAndConfig = async (options) => {
|
|
227
|
+
const res = await fetch(getRolesAndConfigUrl(), {
|
|
228
|
+
...options,
|
|
229
|
+
method: "GET"
|
|
230
|
+
});
|
|
231
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
232
|
+
const data = body ? JSON.parse(body) : {};
|
|
233
|
+
return {
|
|
234
|
+
data,
|
|
235
|
+
status: res.status,
|
|
236
|
+
headers: res.headers
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
const getInviteMemberUrl = () => {
|
|
240
|
+
return `https://api.workos.com/_widgets/UserManagement/invite-user`;
|
|
241
|
+
};
|
|
242
|
+
const inviteMember = async (inviteMemberBody, options) => {
|
|
243
|
+
const res = await fetch(getInviteMemberUrl(), {
|
|
244
|
+
...options,
|
|
245
|
+
method: "POST",
|
|
246
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
247
|
+
body: JSON.stringify(inviteMemberBody)
|
|
248
|
+
});
|
|
249
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
250
|
+
const data = body ? JSON.parse(body) : {};
|
|
251
|
+
return {
|
|
252
|
+
data,
|
|
253
|
+
status: res.status,
|
|
254
|
+
headers: res.headers
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
const getResendInviteUrl = (userId) => {
|
|
258
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;
|
|
259
|
+
};
|
|
260
|
+
const resendInvite = async (userId, options) => {
|
|
261
|
+
const res = await fetch(getResendInviteUrl(userId), {
|
|
262
|
+
...options,
|
|
263
|
+
method: "POST"
|
|
264
|
+
});
|
|
265
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
266
|
+
const data = body ? JSON.parse(body) : {};
|
|
267
|
+
return {
|
|
268
|
+
data,
|
|
269
|
+
status: res.status,
|
|
270
|
+
headers: res.headers
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
const getRevokeInviteUrl = (userId) => {
|
|
274
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
|
|
275
|
+
};
|
|
276
|
+
const revokeInvite = async (userId, options) => {
|
|
277
|
+
const res = await fetch(getRevokeInviteUrl(userId), {
|
|
278
|
+
...options,
|
|
279
|
+
method: "DELETE"
|
|
280
|
+
});
|
|
281
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
282
|
+
const data = body ? JSON.parse(body) : {};
|
|
283
|
+
return {
|
|
284
|
+
data,
|
|
285
|
+
status: res.status,
|
|
286
|
+
headers: res.headers
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
const getRemoveMemberUrl = (userId) => {
|
|
290
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
291
|
+
};
|
|
292
|
+
const removeMember = async (userId, options) => {
|
|
293
|
+
const res = await fetch(getRemoveMemberUrl(userId), {
|
|
294
|
+
...options,
|
|
295
|
+
method: "DELETE"
|
|
296
|
+
});
|
|
297
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
298
|
+
const data = body ? JSON.parse(body) : {};
|
|
299
|
+
return {
|
|
300
|
+
data,
|
|
301
|
+
status: res.status,
|
|
302
|
+
headers: res.headers
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
const getUpdateMemberUrl = (userId) => {
|
|
306
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
307
|
+
};
|
|
308
|
+
const updateMember = async (userId, updateMemberBody, options) => {
|
|
309
|
+
const res = await fetch(getUpdateMemberUrl(userId), {
|
|
310
|
+
...options,
|
|
311
|
+
method: "POST",
|
|
312
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
313
|
+
body: JSON.stringify(updateMemberBody)
|
|
314
|
+
});
|
|
315
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
316
|
+
const data = body ? JSON.parse(body) : {};
|
|
317
|
+
return {
|
|
318
|
+
data,
|
|
319
|
+
status: res.status,
|
|
320
|
+
headers: res.headers
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
const getOrganizationsUrl = () => {
|
|
324
|
+
return `https://api.workos.com/_widgets/UserManagement/organizations`;
|
|
325
|
+
};
|
|
326
|
+
const organizations = async (options) => {
|
|
327
|
+
const res = await fetch(getOrganizationsUrl(), {
|
|
328
|
+
...options,
|
|
329
|
+
method: "GET"
|
|
330
|
+
});
|
|
331
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
332
|
+
const data = body ? JSON.parse(body) : {};
|
|
333
|
+
return {
|
|
334
|
+
data,
|
|
335
|
+
status: res.status,
|
|
336
|
+
headers: res.headers
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
const getMeUrl = () => {
|
|
340
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
341
|
+
};
|
|
342
|
+
const me = async (options) => {
|
|
343
|
+
const res = await fetch(getMeUrl(), {
|
|
344
|
+
...options,
|
|
345
|
+
method: "GET"
|
|
346
|
+
});
|
|
347
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
348
|
+
const data = body ? JSON.parse(body) : {};
|
|
349
|
+
return { data, status: res.status, headers: res.headers };
|
|
350
|
+
};
|
|
351
|
+
const getUpdateMeUrl = () => {
|
|
352
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
353
|
+
};
|
|
354
|
+
const updateMe = async (updateMeBody, options) => {
|
|
355
|
+
const res = await fetch(getUpdateMeUrl(), {
|
|
356
|
+
...options,
|
|
357
|
+
method: "POST",
|
|
358
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
359
|
+
body: JSON.stringify(updateMeBody)
|
|
360
|
+
});
|
|
361
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
362
|
+
const data = body ? JSON.parse(body) : {};
|
|
363
|
+
return { data, status: res.status, headers: res.headers };
|
|
364
|
+
};
|
|
365
|
+
const getCreateTotpFactorUrl = () => {
|
|
366
|
+
return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
|
|
367
|
+
};
|
|
368
|
+
const createTotpFactor = async (options) => {
|
|
369
|
+
const res = await fetch(getCreateTotpFactorUrl(), {
|
|
370
|
+
...options,
|
|
371
|
+
method: "POST"
|
|
372
|
+
});
|
|
373
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
374
|
+
const data = body ? JSON.parse(body) : {};
|
|
375
|
+
return {
|
|
376
|
+
data,
|
|
377
|
+
status: res.status,
|
|
378
|
+
headers: res.headers
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
const getVerifyTotpFactorUrl = () => {
|
|
382
|
+
return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
|
|
383
|
+
};
|
|
384
|
+
const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
385
|
+
const res = await fetch(getVerifyTotpFactorUrl(), {
|
|
386
|
+
...options,
|
|
387
|
+
method: "POST",
|
|
388
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
389
|
+
body: JSON.stringify(verifyTotpFactorRequest)
|
|
390
|
+
});
|
|
391
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
392
|
+
const data = body ? JSON.parse(body) : {};
|
|
393
|
+
return {
|
|
394
|
+
data,
|
|
395
|
+
status: res.status,
|
|
396
|
+
headers: res.headers
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
const getDeleteTotpFactorsUrl = () => {
|
|
400
|
+
return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
|
|
401
|
+
};
|
|
402
|
+
const deleteTotpFactors = async (options) => {
|
|
403
|
+
const res = await fetch(getDeleteTotpFactorsUrl(), {
|
|
404
|
+
...options,
|
|
405
|
+
method: "DELETE"
|
|
406
|
+
});
|
|
407
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
408
|
+
const data = body ? JSON.parse(body) : {};
|
|
409
|
+
return {
|
|
410
|
+
data,
|
|
411
|
+
status: res.status,
|
|
412
|
+
headers: res.headers
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
const getAuthenticationInformationUrl = () => {
|
|
416
|
+
return `https://api.workos.com/_widgets/UserProfile/authentication-information`;
|
|
417
|
+
};
|
|
418
|
+
const authenticationInformation = async (options) => {
|
|
419
|
+
const res = await fetch(getAuthenticationInformationUrl(), {
|
|
420
|
+
...options,
|
|
421
|
+
method: "GET"
|
|
422
|
+
});
|
|
423
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
424
|
+
const data = body ? JSON.parse(body) : {};
|
|
425
|
+
return {
|
|
426
|
+
data,
|
|
427
|
+
status: res.status,
|
|
428
|
+
headers: res.headers
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
const getCreatePasswordUrl = () => {
|
|
432
|
+
return `https://api.workos.com/_widgets/UserProfile/create-password`;
|
|
433
|
+
};
|
|
434
|
+
const createPassword = async (createPasswordRequest, options) => {
|
|
435
|
+
const res = await fetch(getCreatePasswordUrl(), {
|
|
436
|
+
...options,
|
|
437
|
+
method: "POST",
|
|
438
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
439
|
+
body: JSON.stringify(createPasswordRequest)
|
|
440
|
+
});
|
|
441
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
442
|
+
const data = body ? JSON.parse(body) : {};
|
|
443
|
+
return {
|
|
444
|
+
data,
|
|
445
|
+
status: res.status,
|
|
446
|
+
headers: res.headers
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
const getUpdatePasswordUrl = () => {
|
|
450
|
+
return `https://api.workos.com/_widgets/UserProfile/update-password`;
|
|
451
|
+
};
|
|
452
|
+
const updatePassword = async (updatePasswordRequest, options) => {
|
|
453
|
+
const res = await fetch(getUpdatePasswordUrl(), {
|
|
454
|
+
...options,
|
|
455
|
+
method: "POST",
|
|
456
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
457
|
+
body: JSON.stringify(updatePasswordRequest)
|
|
458
|
+
});
|
|
459
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
460
|
+
const data = body ? JSON.parse(body) : {};
|
|
461
|
+
return {
|
|
462
|
+
data,
|
|
463
|
+
status: res.status,
|
|
464
|
+
headers: res.headers
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
const getRevokeAllSessionsUrl = () => {
|
|
468
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
|
|
469
|
+
};
|
|
470
|
+
const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
471
|
+
const res = await fetch(getRevokeAllSessionsUrl(), {
|
|
472
|
+
...options,
|
|
473
|
+
method: "DELETE",
|
|
474
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
475
|
+
body: JSON.stringify(revokeAllSessionsRequest)
|
|
476
|
+
});
|
|
477
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
478
|
+
const data = body ? JSON.parse(body) : {};
|
|
479
|
+
return {
|
|
480
|
+
data,
|
|
481
|
+
status: res.status,
|
|
482
|
+
headers: res.headers
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
const getRevokeSessionUrl = (sessionId) => {
|
|
486
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;
|
|
487
|
+
};
|
|
488
|
+
const revokeSession = async (sessionId, options) => {
|
|
489
|
+
const res = await fetch(getRevokeSessionUrl(sessionId), {
|
|
490
|
+
...options,
|
|
491
|
+
method: "DELETE"
|
|
492
|
+
});
|
|
493
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
494
|
+
const data = body ? JSON.parse(body) : {};
|
|
495
|
+
return {
|
|
496
|
+
data,
|
|
497
|
+
status: res.status,
|
|
498
|
+
headers: res.headers
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
const getSessionsUrl = () => {
|
|
502
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions`;
|
|
503
|
+
};
|
|
504
|
+
const sessions = async (options) => {
|
|
505
|
+
const res = await fetch(getSessionsUrl(), {
|
|
506
|
+
...options,
|
|
507
|
+
method: "GET"
|
|
508
|
+
});
|
|
509
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
510
|
+
const data = body ? JSON.parse(body) : {};
|
|
511
|
+
return { data, status: res.status, headers: res.headers };
|
|
512
|
+
};
|
|
513
|
+
const getSendVerificationUrl = () => {
|
|
514
|
+
return `https://api.workos.com/_widgets/UserProfile/send-verification`;
|
|
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`;
|
|
531
|
+
};
|
|
532
|
+
const verify = async (verifyRequest, options) => {
|
|
533
|
+
const res = await fetch(getVerifyUrl(), {
|
|
534
|
+
...options,
|
|
535
|
+
method: "POST",
|
|
536
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
537
|
+
body: JSON.stringify(verifyRequest)
|
|
538
|
+
});
|
|
539
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
540
|
+
const data = body ? JSON.parse(body) : {};
|
|
541
|
+
return { data, status: res.status, headers: res.headers };
|
|
542
|
+
};
|
|
543
|
+
const getRegisterPasskeyUrl = () => {
|
|
544
|
+
return `https://api.workos.com/_widgets/UserProfile/passkeys`;
|
|
545
|
+
};
|
|
546
|
+
const registerPasskey = async (options) => {
|
|
547
|
+
const res = await fetch(getRegisterPasskeyUrl(), {
|
|
548
|
+
...options,
|
|
549
|
+
method: "POST"
|
|
550
|
+
});
|
|
551
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
552
|
+
const data = body ? JSON.parse(body) : {};
|
|
553
|
+
return {
|
|
554
|
+
data,
|
|
555
|
+
status: res.status,
|
|
556
|
+
headers: res.headers
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
const getVerifyPasskeyUrl = () => {
|
|
560
|
+
return `https://api.workos.com/_widgets/UserProfile/passkeys/verify`;
|
|
561
|
+
};
|
|
562
|
+
const verifyPasskey = async (verifyPasskeyRequest, options) => {
|
|
563
|
+
const res = await fetch(getVerifyPasskeyUrl(), {
|
|
564
|
+
...options,
|
|
565
|
+
method: "POST",
|
|
566
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
567
|
+
body: JSON.stringify(verifyPasskeyRequest)
|
|
568
|
+
});
|
|
569
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
570
|
+
const data = body ? JSON.parse(body) : {};
|
|
571
|
+
return {
|
|
572
|
+
data,
|
|
573
|
+
status: res.status,
|
|
574
|
+
headers: res.headers
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
const getDeletePasskeyUrl = (passkeyId) => {
|
|
578
|
+
return `https://api.workos.com/_widgets/UserProfile/passkeys/${passkeyId}`;
|
|
579
|
+
};
|
|
580
|
+
const deletePasskey = async (passkeyId, options) => {
|
|
581
|
+
const res = await fetch(getDeletePasskeyUrl(passkeyId), {
|
|
582
|
+
...options,
|
|
583
|
+
method: "DELETE"
|
|
584
|
+
});
|
|
585
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
586
|
+
const data = body ? JSON.parse(body) : {};
|
|
587
|
+
return {
|
|
588
|
+
data,
|
|
589
|
+
status: res.status,
|
|
590
|
+
headers: res.headers
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
const getSettingsUrl = () => {
|
|
594
|
+
return `https://api.workos.com/_widgets/settings`;
|
|
595
|
+
};
|
|
596
|
+
const settings = async (options) => {
|
|
597
|
+
const res = await fetch(getSettingsUrl(), {
|
|
598
|
+
...options,
|
|
599
|
+
method: "GET"
|
|
600
|
+
});
|
|
601
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
602
|
+
const data = body ? JSON.parse(body) : {};
|
|
603
|
+
return { data, status: res.status, headers: res.headers };
|
|
604
|
+
};
|
|
605
|
+
const getListOrganizationDomainsUrl = () => {
|
|
606
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains`;
|
|
607
|
+
};
|
|
608
|
+
const listOrganizationDomains = async (options) => {
|
|
609
|
+
const res = await fetch(getListOrganizationDomainsUrl(), {
|
|
610
|
+
...options,
|
|
611
|
+
method: "GET"
|
|
612
|
+
});
|
|
613
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
614
|
+
const data = body ? JSON.parse(body) : {};
|
|
615
|
+
return {
|
|
616
|
+
data,
|
|
617
|
+
status: res.status,
|
|
618
|
+
headers: res.headers
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
const getGenerateAdminPortalLinkUrl = (params) => {
|
|
622
|
+
const normalizedParams = new URLSearchParams();
|
|
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`;
|
|
630
|
+
};
|
|
631
|
+
const generateAdminPortalLink = async (params, options) => {
|
|
632
|
+
const res = await fetch(getGenerateAdminPortalLinkUrl(params), {
|
|
633
|
+
...options,
|
|
634
|
+
method: "POST"
|
|
635
|
+
});
|
|
636
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
637
|
+
const data = body ? JSON.parse(body) : {};
|
|
638
|
+
return {
|
|
639
|
+
data,
|
|
640
|
+
status: res.status,
|
|
641
|
+
headers: res.headers
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
const getDeleteOrganizationDomainUrl = (domainId) => {
|
|
645
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;
|
|
646
|
+
};
|
|
647
|
+
const deleteOrganizationDomain = async (domainId, options) => {
|
|
648
|
+
const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {
|
|
649
|
+
...options,
|
|
650
|
+
method: "DELETE"
|
|
651
|
+
});
|
|
652
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
653
|
+
const data = body ? JSON.parse(body) : {};
|
|
654
|
+
return {
|
|
655
|
+
data,
|
|
656
|
+
status: res.status,
|
|
657
|
+
headers: res.headers
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
const getReverifyOrganizationDomainUrl = (domainId) => {
|
|
661
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;
|
|
662
|
+
};
|
|
663
|
+
const reverifyOrganizationDomain = async (domainId, options) => {
|
|
664
|
+
const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {
|
|
665
|
+
...options,
|
|
666
|
+
method: "POST"
|
|
667
|
+
});
|
|
668
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
669
|
+
const data = body ? JSON.parse(body) : {};
|
|
670
|
+
return {
|
|
671
|
+
data,
|
|
672
|
+
status: res.status,
|
|
673
|
+
headers: res.headers
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
const getListSsoConnectionsUrl = () => {
|
|
677
|
+
return `https://api.workos.com/_widgets/admin-portal/sso-connections`;
|
|
678
|
+
};
|
|
679
|
+
const listSsoConnections = async (options) => {
|
|
680
|
+
const res = await fetch(getListSsoConnectionsUrl(), {
|
|
681
|
+
...options,
|
|
682
|
+
method: "GET"
|
|
683
|
+
});
|
|
684
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
685
|
+
const data = body ? JSON.parse(body) : {};
|
|
686
|
+
return {
|
|
687
|
+
data,
|
|
688
|
+
status: res.status,
|
|
689
|
+
headers: res.headers
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
const getCreateOrganizationApiKeyUrl = () => {
|
|
693
|
+
return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
694
|
+
};
|
|
695
|
+
const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options) => {
|
|
696
|
+
const res = await fetch(getCreateOrganizationApiKeyUrl(), {
|
|
697
|
+
...options,
|
|
698
|
+
method: "POST",
|
|
699
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
700
|
+
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
701
|
+
});
|
|
702
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
703
|
+
const data = body ? JSON.parse(body) : {};
|
|
704
|
+
return {
|
|
705
|
+
data,
|
|
706
|
+
status: res.status,
|
|
707
|
+
headers: res.headers
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
const getListOrganizationApiKeysUrl = (params) => {
|
|
711
|
+
const normalizedParams = new URLSearchParams();
|
|
712
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
713
|
+
if (value !== void 0) {
|
|
714
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
const stringifiedParams = normalizedParams.toString();
|
|
718
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
719
|
+
};
|
|
720
|
+
const listOrganizationApiKeys = async (params, options) => {
|
|
721
|
+
const res = await fetch(getListOrganizationApiKeysUrl(params), {
|
|
722
|
+
...options,
|
|
723
|
+
method: "GET"
|
|
724
|
+
});
|
|
725
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
726
|
+
const data = body ? JSON.parse(body) : {};
|
|
727
|
+
return {
|
|
728
|
+
data,
|
|
729
|
+
status: res.status,
|
|
730
|
+
headers: res.headers
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
const getListOrganizationApiKeyPermissionsUrl = (params) => {
|
|
734
|
+
const normalizedParams = new URLSearchParams();
|
|
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`;
|
|
742
|
+
};
|
|
743
|
+
const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
744
|
+
const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {
|
|
745
|
+
...options,
|
|
746
|
+
method: "GET"
|
|
747
|
+
});
|
|
748
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
749
|
+
const data = body ? JSON.parse(body) : {};
|
|
750
|
+
return {
|
|
751
|
+
data,
|
|
752
|
+
status: res.status,
|
|
753
|
+
headers: res.headers
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
|
|
757
|
+
return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
|
|
758
|
+
};
|
|
759
|
+
const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
760
|
+
const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {
|
|
761
|
+
...options,
|
|
762
|
+
method: "DELETE"
|
|
763
|
+
});
|
|
764
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
765
|
+
const data = body ? JSON.parse(body) : {};
|
|
766
|
+
return {
|
|
767
|
+
data,
|
|
768
|
+
status: res.status,
|
|
769
|
+
headers: res.headers
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
const getMyDataIntegrationsUrl = () => {
|
|
773
|
+
return `https://api.workos.com/_widgets/DataIntegrations/mine`;
|
|
774
|
+
};
|
|
775
|
+
const myDataIntegrations = async (options) => {
|
|
776
|
+
const res = await fetch(getMyDataIntegrationsUrl(), {
|
|
777
|
+
...options,
|
|
778
|
+
method: "GET"
|
|
779
|
+
});
|
|
780
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
781
|
+
const data = body ? JSON.parse(body) : {};
|
|
782
|
+
return {
|
|
783
|
+
data,
|
|
784
|
+
status: res.status,
|
|
785
|
+
headers: res.headers
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
const getGetDataIntegrationAuthorizeUrlUrl = (slug, params) => {
|
|
789
|
+
const normalizedParams = new URLSearchParams();
|
|
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`;
|
|
797
|
+
};
|
|
798
|
+
const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
799
|
+
const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {
|
|
800
|
+
...options,
|
|
801
|
+
method: "GET"
|
|
802
|
+
});
|
|
803
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
804
|
+
const data = body ? JSON.parse(body) : {};
|
|
805
|
+
return {
|
|
806
|
+
data,
|
|
807
|
+
status: res.status,
|
|
808
|
+
headers: res.headers
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
|
|
812
|
+
return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
|
|
813
|
+
};
|
|
814
|
+
const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state, options) => {
|
|
815
|
+
const res = await fetch(
|
|
816
|
+
getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),
|
|
817
|
+
{
|
|
818
|
+
...options,
|
|
819
|
+
method: "GET"
|
|
820
|
+
}
|
|
821
|
+
);
|
|
822
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
823
|
+
const data = body ? JSON.parse(body) : {};
|
|
824
|
+
return {
|
|
825
|
+
data,
|
|
826
|
+
status: res.status,
|
|
827
|
+
headers: res.headers
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
const getDeleteDataInstallationUrl = (installationId) => {
|
|
831
|
+
return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;
|
|
832
|
+
};
|
|
833
|
+
const deleteDataInstallation = async (installationId, options) => {
|
|
834
|
+
const res = await fetch(getDeleteDataInstallationUrl(installationId), {
|
|
835
|
+
...options,
|
|
836
|
+
method: "DELETE"
|
|
837
|
+
});
|
|
838
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
839
|
+
const data = body ? JSON.parse(body) : {};
|
|
840
|
+
return {
|
|
841
|
+
data,
|
|
842
|
+
status: res.status,
|
|
843
|
+
headers: res.headers
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
export {
|
|
847
|
+
AuthenticationInformationResponseDataVerificationMethodsMfaProvider,
|
|
848
|
+
AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider,
|
|
849
|
+
AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
|
|
850
|
+
CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
|
|
851
|
+
CreateTotpFactorResponseAuthenticationFactorAllOfObject,
|
|
852
|
+
CreateTotpFactorResponseAuthenticationFactorAllOfType,
|
|
853
|
+
DataInstallationObject,
|
|
854
|
+
DataInstallationState,
|
|
855
|
+
DataIntegrationCredentialsType,
|
|
856
|
+
DataIntegrationIntegrationType,
|
|
857
|
+
DataIntegrationObject,
|
|
858
|
+
DataIntegrationOwnership,
|
|
859
|
+
DomainVerificationNameServer,
|
|
860
|
+
GenerateAdminPortalLinkIntent,
|
|
861
|
+
MemberActionsItem,
|
|
862
|
+
MemberStatus,
|
|
863
|
+
OidcSessionState,
|
|
864
|
+
OrganizationDomainState,
|
|
865
|
+
SamlSessionState,
|
|
866
|
+
SendVerificationResponseType,
|
|
867
|
+
SettingsResponseObject,
|
|
868
|
+
SsoConnectionAnyOfEightAllOfProviderTag,
|
|
869
|
+
SsoConnectionAnyOfEightAllOfState,
|
|
870
|
+
SsoConnectionAnyOfEightAllOfType,
|
|
871
|
+
SsoConnectionAnyOfProviderTag,
|
|
872
|
+
SsoConnectionAnyOfState,
|
|
873
|
+
SsoConnectionAnyOfType,
|
|
874
|
+
SsoConnectionSessionJSONState,
|
|
875
|
+
authenticationInformation,
|
|
876
|
+
createOrganizationApiKey,
|
|
877
|
+
createPassword,
|
|
878
|
+
createTotpFactor,
|
|
879
|
+
deleteDataInstallation,
|
|
880
|
+
deleteOrganizationApiKey,
|
|
881
|
+
deleteOrganizationDomain,
|
|
882
|
+
deletePasskey,
|
|
883
|
+
deleteTotpFactors,
|
|
884
|
+
generateAdminPortalLink,
|
|
885
|
+
getAuthenticationInformationUrl,
|
|
886
|
+
getCreateOrganizationApiKeyUrl,
|
|
887
|
+
getCreatePasswordUrl,
|
|
888
|
+
getCreateTotpFactorUrl,
|
|
889
|
+
getDataInstallationAuthorizationStatus,
|
|
890
|
+
getDataIntegrationAuthorizeUrl,
|
|
891
|
+
getDeleteDataInstallationUrl,
|
|
892
|
+
getDeleteOrganizationApiKeyUrl,
|
|
893
|
+
getDeleteOrganizationDomainUrl,
|
|
894
|
+
getDeletePasskeyUrl,
|
|
895
|
+
getDeleteTotpFactorsUrl,
|
|
896
|
+
getGenerateAdminPortalLinkUrl,
|
|
897
|
+
getGetDataInstallationAuthorizationStatusUrl,
|
|
898
|
+
getGetDataIntegrationAuthorizeUrlUrl,
|
|
899
|
+
getInviteMemberUrl,
|
|
900
|
+
getListOrganizationApiKeyPermissionsUrl,
|
|
901
|
+
getListOrganizationApiKeysUrl,
|
|
902
|
+
getListOrganizationDomainsUrl,
|
|
903
|
+
getListSsoConnectionsUrl,
|
|
904
|
+
getMeUrl,
|
|
905
|
+
getMembersUrl,
|
|
906
|
+
getMyDataIntegrationsUrl,
|
|
907
|
+
getOrganizationsUrl,
|
|
908
|
+
getRegisterPasskeyUrl,
|
|
909
|
+
getRemoveMemberUrl,
|
|
910
|
+
getResendInviteUrl,
|
|
911
|
+
getReverifyOrganizationDomainUrl,
|
|
912
|
+
getRevokeAllSessionsUrl,
|
|
913
|
+
getRevokeInviteUrl,
|
|
914
|
+
getRevokeSessionUrl,
|
|
915
|
+
getRolesAndConfigUrl,
|
|
916
|
+
getRolesUrl,
|
|
917
|
+
getSendVerificationUrl,
|
|
918
|
+
getSessionsUrl,
|
|
919
|
+
getSettingsUrl,
|
|
920
|
+
getUpdateMeUrl,
|
|
921
|
+
getUpdateMemberUrl,
|
|
922
|
+
getUpdatePasswordUrl,
|
|
923
|
+
getVerifyPasskeyUrl,
|
|
924
|
+
getVerifyTotpFactorUrl,
|
|
925
|
+
getVerifyUrl,
|
|
926
|
+
inviteMember,
|
|
927
|
+
listOrganizationApiKeyPermissions,
|
|
928
|
+
listOrganizationApiKeys,
|
|
929
|
+
listOrganizationDomains,
|
|
930
|
+
listSsoConnections,
|
|
931
|
+
me,
|
|
932
|
+
members,
|
|
933
|
+
myDataIntegrations,
|
|
934
|
+
organizations,
|
|
935
|
+
registerPasskey,
|
|
936
|
+
removeMember,
|
|
937
|
+
resendInvite,
|
|
938
|
+
reverifyOrganizationDomain,
|
|
939
|
+
revokeAllSessions,
|
|
940
|
+
revokeInvite,
|
|
941
|
+
revokeSession,
|
|
942
|
+
roles,
|
|
943
|
+
rolesAndConfig,
|
|
944
|
+
sendVerification,
|
|
945
|
+
sessions,
|
|
946
|
+
settings,
|
|
947
|
+
updateMe,
|
|
948
|
+
updateMember,
|
|
949
|
+
updatePassword,
|
|
950
|
+
verify,
|
|
951
|
+
verifyPasskey,
|
|
952
|
+
verifyTotpFactor
|
|
953
|
+
};
|
|
954
|
+
//# sourceMappingURL=fetch.js.map
|