@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
|
@@ -13,33 +13,6 @@ const MemberActionsItem = {
|
|
|
13
13
|
"revoke-invite": "revoke-invite",
|
|
14
14
|
"revoke-membership": "revoke-membership"
|
|
15
15
|
};
|
|
16
|
-
const CreateTotpFactorResponseAuthenticationFactorAllOfObject = {
|
|
17
|
-
authentication_factor: "authentication_factor"
|
|
18
|
-
};
|
|
19
|
-
const CreateTotpFactorResponseAuthenticationFactorAllOfType = {
|
|
20
|
-
generic_otp: "generic_otp",
|
|
21
|
-
sms: "sms",
|
|
22
|
-
totp: "totp",
|
|
23
|
-
webauthn: "webauthn"
|
|
24
|
-
};
|
|
25
|
-
const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {
|
|
26
|
-
authentication_challenge: "authentication_challenge"
|
|
27
|
-
};
|
|
28
|
-
const AuthenticationInformationResponseDataVerificationMethodsMfaProvider = {
|
|
29
|
-
MFA: "MFA"
|
|
30
|
-
};
|
|
31
|
-
const AuthenticationInformationResponseDataVerificationMethodsPasswordProvider = {
|
|
32
|
-
Password: "Password"
|
|
33
|
-
};
|
|
34
|
-
const AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider = {
|
|
35
|
-
Passkey: "Passkey"
|
|
36
|
-
};
|
|
37
|
-
const SendVerificationResponseType = {
|
|
38
|
-
EmailVerification: "EmailVerification"
|
|
39
|
-
};
|
|
40
|
-
const SettingsResponseObject = {
|
|
41
|
-
settings: "settings"
|
|
42
|
-
};
|
|
43
16
|
const OrganizationDomainState = {
|
|
44
17
|
Failed: "Failed",
|
|
45
18
|
LegacyVerified: "LegacyVerified",
|
|
@@ -72,181 +45,110 @@ const SsoConnectionSessionJSONState = {
|
|
|
72
45
|
...SamlSessionState,
|
|
73
46
|
...OidcSessionState
|
|
74
47
|
};
|
|
75
|
-
const
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
Active: "Active",
|
|
108
|
-
Deleting: "Deleting"
|
|
109
|
-
};
|
|
110
|
-
const SsoConnectionAnyOfProviderTag = {
|
|
111
|
-
Saml: "Saml"
|
|
112
|
-
};
|
|
113
|
-
const SsoConnectionAnyOfEightAllOfState = {
|
|
114
|
-
Inactive: "Inactive",
|
|
115
|
-
Validating: "Validating",
|
|
116
|
-
Active: "Active",
|
|
117
|
-
Deleting: "Deleting"
|
|
118
|
-
};
|
|
119
|
-
const SsoConnectionAnyOfEightAllOfType = {
|
|
120
|
-
AdpOidc: "AdpOidc",
|
|
121
|
-
Auth0Migration: "Auth0Migration",
|
|
122
|
-
CleverOidc: "CleverOidc",
|
|
123
|
-
EntraIdOidc: "EntraIdOidc",
|
|
124
|
-
GenericOidc: "GenericOidc",
|
|
125
|
-
GoogleOidc: "GoogleOidc",
|
|
126
|
-
OktaOidc: "OktaOidc",
|
|
127
|
-
LoginGovOidc: "LoginGovOidc"
|
|
128
|
-
};
|
|
129
|
-
const SsoConnectionAnyOfEightAllOfProviderTag = {
|
|
130
|
-
OpenIdConnect: "OpenIdConnect"
|
|
131
|
-
};
|
|
132
|
-
const DataInstallationObject = {
|
|
133
|
-
data_installation: "data_installation",
|
|
134
|
-
connected_account: "connected_account"
|
|
135
|
-
};
|
|
136
|
-
const DataInstallationState = {
|
|
137
|
-
connected: "connected",
|
|
138
|
-
needs_reauthorization: "needs_reauthorization"
|
|
139
|
-
};
|
|
140
|
-
const DataIntegrationObject = {
|
|
141
|
-
data_integration: "data_integration"
|
|
142
|
-
};
|
|
143
|
-
const DataIntegrationIntegrationType = {
|
|
144
|
-
asana: "asana",
|
|
145
|
-
box: "box",
|
|
146
|
-
"cal-dot-com": "cal-dot-com",
|
|
147
|
-
calendly: "calendly",
|
|
148
|
-
confluence: "confluence",
|
|
149
|
-
dropbox: "dropbox",
|
|
150
|
-
"frame-io": "frame-io",
|
|
151
|
-
front: "front",
|
|
152
|
-
github: "github",
|
|
153
|
-
gitlab: "gitlab",
|
|
154
|
-
gmail: "gmail",
|
|
155
|
-
google: "google",
|
|
156
|
-
"google-calendar": "google-calendar",
|
|
157
|
-
"google-drive": "google-drive",
|
|
158
|
-
helpscout: "helpscout",
|
|
159
|
-
hubspot: "hubspot",
|
|
160
|
-
intercom: "intercom",
|
|
161
|
-
jira: "jira",
|
|
162
|
-
linear: "linear",
|
|
163
|
-
microsoft: "microsoft",
|
|
164
|
-
"microsoft-onedrive": "microsoft-onedrive",
|
|
165
|
-
"microsoft-onenote": "microsoft-onenote",
|
|
166
|
-
"microsoft-outlook": "microsoft-outlook",
|
|
167
|
-
"microsoft-outlook-calendar": "microsoft-outlook-calendar",
|
|
168
|
-
"microsoft-sharepoint": "microsoft-sharepoint",
|
|
169
|
-
"microsoft-teams": "microsoft-teams",
|
|
170
|
-
"microsoft-todo": "microsoft-todo",
|
|
171
|
-
notion: "notion",
|
|
172
|
-
prefect: "prefect",
|
|
173
|
-
"pydantic-logfire": "pydantic-logfire",
|
|
174
|
-
salesforce: "salesforce",
|
|
175
|
-
sentry: "sentry",
|
|
176
|
-
slack: "slack",
|
|
177
|
-
snowflake: "snowflake",
|
|
178
|
-
stripe: "stripe",
|
|
179
|
-
xero: "xero",
|
|
180
|
-
zendesk: "zendesk"
|
|
181
|
-
};
|
|
182
|
-
const DataIntegrationOwnership = {
|
|
183
|
-
userland_user: "userland_user",
|
|
184
|
-
organization: "organization"
|
|
185
|
-
};
|
|
186
|
-
const DataIntegrationCredentialsType = {
|
|
187
|
-
shared: "shared",
|
|
188
|
-
custom: "custom"
|
|
48
|
+
const DirectoryType = {
|
|
49
|
+
azure_scim_v20: "azure scim v2.0",
|
|
50
|
+
bamboohr: "bamboohr",
|
|
51
|
+
breathe_hr: "breathe hr",
|
|
52
|
+
cezanne_hr: "cezanne hr",
|
|
53
|
+
cyberark_scim_v20: "cyberark scim v2.0",
|
|
54
|
+
fourth_hr: "fourth hr",
|
|
55
|
+
generic_scim_v20: "generic scim v2.0",
|
|
56
|
+
gsuite_directory: "gsuite directory",
|
|
57
|
+
gusto: "gusto",
|
|
58
|
+
hibob: "hibob",
|
|
59
|
+
jump_cloud_scim_v20: "jump cloud scim v2.0",
|
|
60
|
+
okta_scim_v20: "okta scim v2.0",
|
|
61
|
+
onelogin_scim_v20: "onelogin scim v2.0",
|
|
62
|
+
people_hr: "people hr",
|
|
63
|
+
personio: "personio",
|
|
64
|
+
pingfederate_scim_v20: "pingfederate scim v2.0",
|
|
65
|
+
rippling: "rippling",
|
|
66
|
+
rippling_scim_v20: "rippling scim v2.0",
|
|
67
|
+
s3: "s3",
|
|
68
|
+
sailpoint_scim_v20: "sailpoint scim v2.0",
|
|
69
|
+
sftp: "sftp",
|
|
70
|
+
sftp_workday: "sftp workday",
|
|
71
|
+
workday: "workday"
|
|
72
|
+
};
|
|
73
|
+
const DirectoryState = {
|
|
74
|
+
requires_type: "requires_type",
|
|
75
|
+
linked: "linked",
|
|
76
|
+
validating: "validating",
|
|
77
|
+
invalid_credentials: "invalid_credentials",
|
|
78
|
+
unlinked: "unlinked",
|
|
79
|
+
deleting: "deleting"
|
|
189
80
|
};
|
|
190
81
|
const GenerateAdminPortalLinkIntent = {
|
|
191
82
|
domain_verification: "domain_verification",
|
|
192
|
-
sso: "sso"
|
|
83
|
+
sso: "sso",
|
|
84
|
+
log_streams: "log_streams"
|
|
193
85
|
};
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
197
|
-
if (value !== void 0) {
|
|
198
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
const stringifiedParams = normalizedParams.toString();
|
|
202
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
|
|
86
|
+
const getCreateOrganizationApiKeyUrl = () => {
|
|
87
|
+
return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
203
88
|
};
|
|
204
|
-
const
|
|
205
|
-
const res = await fetch(
|
|
89
|
+
const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options) => {
|
|
90
|
+
const res = await fetch(getCreateOrganizationApiKeyUrl(), {
|
|
206
91
|
...options,
|
|
207
|
-
method: "
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
94
|
+
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
208
95
|
});
|
|
209
96
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
210
97
|
const data = body ? JSON.parse(body) : {};
|
|
211
|
-
return {
|
|
98
|
+
return {
|
|
99
|
+
data,
|
|
100
|
+
status: res.status,
|
|
101
|
+
headers: res.headers
|
|
102
|
+
};
|
|
212
103
|
};
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
104
|
+
const getCreateOrganizationApiKeyMutationFetcher = (options) => {
|
|
105
|
+
return (_, { arg }) => {
|
|
106
|
+
return createOrganizationApiKey(arg, options);
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const getCreateOrganizationApiKeyMutationKey = () => [`https://api.workos.com/_widgets/ApiKeys/organization-api-keys`];
|
|
110
|
+
const useCreateOrganizationApiKey = (options) => {
|
|
218
111
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
const
|
|
222
|
-
const query = useSwr(
|
|
223
|
-
swrKey,
|
|
224
|
-
swrFn,
|
|
225
|
-
swrOptions
|
|
226
|
-
);
|
|
112
|
+
const swrKey = swrOptions?.swrKey ?? getCreateOrganizationApiKeyMutationKey();
|
|
113
|
+
const swrFn = getCreateOrganizationApiKeyMutationFetcher(fetchOptions);
|
|
114
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
227
115
|
return {
|
|
228
116
|
swrKey,
|
|
229
117
|
...query
|
|
230
118
|
};
|
|
231
119
|
};
|
|
232
|
-
const
|
|
233
|
-
|
|
120
|
+
const getListOrganizationApiKeysUrl = (params) => {
|
|
121
|
+
const normalizedParams = new URLSearchParams();
|
|
122
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
123
|
+
if (value !== void 0) {
|
|
124
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const stringifiedParams = normalizedParams.toString();
|
|
128
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
234
129
|
};
|
|
235
|
-
const
|
|
236
|
-
const res = await fetch(
|
|
130
|
+
const listOrganizationApiKeys = async (params, options) => {
|
|
131
|
+
const res = await fetch(getListOrganizationApiKeysUrl(params), {
|
|
237
132
|
...options,
|
|
238
133
|
method: "GET"
|
|
239
134
|
});
|
|
240
135
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
241
136
|
const data = body ? JSON.parse(body) : {};
|
|
242
|
-
return {
|
|
137
|
+
return {
|
|
138
|
+
data,
|
|
139
|
+
status: res.status,
|
|
140
|
+
headers: res.headers
|
|
141
|
+
};
|
|
243
142
|
};
|
|
244
|
-
const
|
|
245
|
-
|
|
143
|
+
const getListOrganizationApiKeysKey = (params) => [
|
|
144
|
+
`https://api.workos.com/_widgets/ApiKeys/organization-api-keys`,
|
|
145
|
+
...params ? [params] : []
|
|
146
|
+
];
|
|
147
|
+
const useListOrganizationApiKeys = (params, options) => {
|
|
246
148
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
247
149
|
const isEnabled = swrOptions?.enabled !== false;
|
|
248
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
249
|
-
const swrFn = () =>
|
|
150
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListOrganizationApiKeysKey(params) : null);
|
|
151
|
+
const swrFn = () => listOrganizationApiKeys(params, fetchOptions);
|
|
250
152
|
const query = useSwr(
|
|
251
153
|
swrKey,
|
|
252
154
|
swrFn,
|
|
@@ -257,11 +159,18 @@ const useRoles = (options) => {
|
|
|
257
159
|
...query
|
|
258
160
|
};
|
|
259
161
|
};
|
|
260
|
-
const
|
|
261
|
-
|
|
162
|
+
const getListOrganizationApiKeyPermissionsUrl = (params) => {
|
|
163
|
+
const normalizedParams = new URLSearchParams();
|
|
164
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
165
|
+
if (value !== void 0) {
|
|
166
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
const stringifiedParams = normalizedParams.toString();
|
|
170
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
262
171
|
};
|
|
263
|
-
const
|
|
264
|
-
const res = await fetch(
|
|
172
|
+
const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
173
|
+
const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {
|
|
265
174
|
...options,
|
|
266
175
|
method: "GET"
|
|
267
176
|
});
|
|
@@ -273,12 +182,15 @@ const rolesAndConfig = async (options) => {
|
|
|
273
182
|
headers: res.headers
|
|
274
183
|
};
|
|
275
184
|
};
|
|
276
|
-
const
|
|
277
|
-
|
|
185
|
+
const getListOrganizationApiKeyPermissionsKey = (params) => [
|
|
186
|
+
`https://api.workos.com/_widgets/ApiKeys/permissions`,
|
|
187
|
+
...params ? [params] : []
|
|
188
|
+
];
|
|
189
|
+
const useListOrganizationApiKeyPermissions = (params, options) => {
|
|
278
190
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
279
191
|
const isEnabled = swrOptions?.enabled !== false;
|
|
280
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
281
|
-
const swrFn = () =>
|
|
192
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListOrganizationApiKeyPermissionsKey(params) : null);
|
|
193
|
+
const swrFn = () => listOrganizationApiKeyPermissions(params, fetchOptions);
|
|
282
194
|
const query = useSwr(
|
|
283
195
|
swrKey,
|
|
284
196
|
swrFn,
|
|
@@ -289,15 +201,13 @@ const useRolesAndConfig = (options) => {
|
|
|
289
201
|
...query
|
|
290
202
|
};
|
|
291
203
|
};
|
|
292
|
-
const
|
|
293
|
-
return `https://api.workos.com/_widgets/
|
|
204
|
+
const getDeleteOrganizationApiKeyUrl = (apiKeyId) => {
|
|
205
|
+
return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;
|
|
294
206
|
};
|
|
295
|
-
const
|
|
296
|
-
const res = await fetch(
|
|
207
|
+
const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
208
|
+
const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {
|
|
297
209
|
...options,
|
|
298
|
-
method: "
|
|
299
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
300
|
-
body: JSON.stringify(inviteMemberBody)
|
|
210
|
+
method: "DELETE"
|
|
301
211
|
});
|
|
302
212
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
303
213
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -307,29 +217,32 @@ const inviteMember = async (inviteMemberBody, options) => {
|
|
|
307
217
|
headers: res.headers
|
|
308
218
|
};
|
|
309
219
|
};
|
|
310
|
-
const
|
|
311
|
-
return (_,
|
|
312
|
-
return
|
|
220
|
+
const getDeleteOrganizationApiKeyMutationFetcher = (apiKeyId, options) => {
|
|
221
|
+
return (_, __) => {
|
|
222
|
+
return deleteOrganizationApiKey(apiKeyId, options);
|
|
313
223
|
};
|
|
314
224
|
};
|
|
315
|
-
const
|
|
316
|
-
const
|
|
225
|
+
const getDeleteOrganizationApiKeyMutationKey = (apiKeyId) => [`https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`];
|
|
226
|
+
const useDeleteOrganizationApiKey = (apiKeyId, options) => {
|
|
317
227
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
318
|
-
const swrKey = swrOptions?.swrKey ??
|
|
319
|
-
const swrFn =
|
|
228
|
+
const swrKey = swrOptions?.swrKey ?? getDeleteOrganizationApiKeyMutationKey(apiKeyId);
|
|
229
|
+
const swrFn = getDeleteOrganizationApiKeyMutationFetcher(
|
|
230
|
+
apiKeyId,
|
|
231
|
+
fetchOptions
|
|
232
|
+
);
|
|
320
233
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
321
234
|
return {
|
|
322
235
|
swrKey,
|
|
323
236
|
...query
|
|
324
237
|
};
|
|
325
238
|
};
|
|
326
|
-
const
|
|
327
|
-
return `https://api.workos.com/_widgets/
|
|
239
|
+
const getDeleteDataInstallationUrl = (installationId) => {
|
|
240
|
+
return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;
|
|
328
241
|
};
|
|
329
|
-
const
|
|
330
|
-
const res = await fetch(
|
|
242
|
+
const deleteDataInstallation = async (installationId, options) => {
|
|
243
|
+
const res = await fetch(getDeleteDataInstallationUrl(installationId), {
|
|
331
244
|
...options,
|
|
332
|
-
method: "
|
|
245
|
+
method: "DELETE"
|
|
333
246
|
});
|
|
334
247
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
335
248
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -339,31 +252,34 @@ const resendInvite = async (userId, options) => {
|
|
|
339
252
|
headers: res.headers
|
|
340
253
|
};
|
|
341
254
|
};
|
|
342
|
-
const
|
|
255
|
+
const getDeleteDataInstallationMutationFetcher = (installationId, options) => {
|
|
343
256
|
return (_, __) => {
|
|
344
|
-
return
|
|
257
|
+
return deleteDataInstallation(installationId, options);
|
|
345
258
|
};
|
|
346
259
|
};
|
|
347
|
-
const
|
|
348
|
-
`https://api.workos.com/_widgets/
|
|
260
|
+
const getDeleteDataInstallationMutationKey = (installationId) => [
|
|
261
|
+
`https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`
|
|
349
262
|
];
|
|
350
|
-
const
|
|
263
|
+
const useDeleteDataInstallation = (installationId, options) => {
|
|
351
264
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
352
|
-
const swrKey = swrOptions?.swrKey ??
|
|
353
|
-
const swrFn =
|
|
265
|
+
const swrKey = swrOptions?.swrKey ?? getDeleteDataInstallationMutationKey(installationId);
|
|
266
|
+
const swrFn = getDeleteDataInstallationMutationFetcher(
|
|
267
|
+
installationId,
|
|
268
|
+
fetchOptions
|
|
269
|
+
);
|
|
354
270
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
355
271
|
return {
|
|
356
272
|
swrKey,
|
|
357
273
|
...query
|
|
358
274
|
};
|
|
359
275
|
};
|
|
360
|
-
const
|
|
361
|
-
return `https://api.workos.com/_widgets/
|
|
276
|
+
const getMyDataIntegrationsUrl = () => {
|
|
277
|
+
return `https://api.workos.com/_widgets/DataIntegrations/mine`;
|
|
362
278
|
};
|
|
363
|
-
const
|
|
364
|
-
const res = await fetch(
|
|
279
|
+
const myDataIntegrations = async (options) => {
|
|
280
|
+
const res = await fetch(getMyDataIntegrationsUrl(), {
|
|
365
281
|
...options,
|
|
366
|
-
method: "
|
|
282
|
+
method: "GET"
|
|
367
283
|
});
|
|
368
284
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
369
285
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -373,30 +289,33 @@ const revokeInvite = async (userId, options) => {
|
|
|
373
289
|
headers: res.headers
|
|
374
290
|
};
|
|
375
291
|
};
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
return revokeInvite(userId, options);
|
|
379
|
-
};
|
|
380
|
-
};
|
|
381
|
-
const getRevokeInviteMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/invites/${userId}`];
|
|
382
|
-
const useRevokeInvite = (userId, options) => {
|
|
292
|
+
const getMyDataIntegrationsKey = () => [`https://api.workos.com/_widgets/DataIntegrations/mine`];
|
|
293
|
+
const useMyDataIntegrations = (options) => {
|
|
383
294
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
384
|
-
const
|
|
385
|
-
const
|
|
386
|
-
const
|
|
295
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
296
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getMyDataIntegrationsKey() : null);
|
|
297
|
+
const swrFn = () => myDataIntegrations(fetchOptions);
|
|
298
|
+
const query = useSwr(
|
|
299
|
+
swrKey,
|
|
300
|
+
swrFn,
|
|
301
|
+
swrOptions
|
|
302
|
+
);
|
|
387
303
|
return {
|
|
388
304
|
swrKey,
|
|
389
305
|
...query
|
|
390
306
|
};
|
|
391
307
|
};
|
|
392
|
-
const
|
|
393
|
-
return `https://api.workos.com/_widgets/
|
|
308
|
+
const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
|
|
309
|
+
return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
|
|
394
310
|
};
|
|
395
|
-
const
|
|
396
|
-
const res = await fetch(
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
311
|
+
const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state, options) => {
|
|
312
|
+
const res = await fetch(
|
|
313
|
+
getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),
|
|
314
|
+
{
|
|
315
|
+
...options,
|
|
316
|
+
method: "GET"
|
|
317
|
+
}
|
|
318
|
+
);
|
|
400
319
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
401
320
|
const data = body ? JSON.parse(body) : {};
|
|
402
321
|
return {
|
|
@@ -405,61 +324,40 @@ const removeMember = async (userId, options) => {
|
|
|
405
324
|
headers: res.headers
|
|
406
325
|
};
|
|
407
326
|
};
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
};
|
|
413
|
-
const getRemoveMemberMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/members/${userId}`];
|
|
414
|
-
const useRemoveMember = (userId, options) => {
|
|
327
|
+
const getGetDataInstallationAuthorizationStatusKey = (dataIntegrationId, state) => [
|
|
328
|
+
`https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`
|
|
329
|
+
];
|
|
330
|
+
const useGetDataInstallationAuthorizationStatus = (dataIntegrationId, state, options) => {
|
|
415
331
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
416
|
-
const
|
|
417
|
-
const
|
|
418
|
-
const
|
|
332
|
+
const isEnabled = swrOptions?.enabled !== false && !!(dataIntegrationId && state);
|
|
333
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetDataInstallationAuthorizationStatusKey(dataIntegrationId, state) : null);
|
|
334
|
+
const swrFn = () => getDataInstallationAuthorizationStatus(
|
|
335
|
+
dataIntegrationId,
|
|
336
|
+
state,
|
|
337
|
+
fetchOptions
|
|
338
|
+
);
|
|
339
|
+
const query = useSwr(
|
|
340
|
+
swrKey,
|
|
341
|
+
swrFn,
|
|
342
|
+
swrOptions
|
|
343
|
+
);
|
|
419
344
|
return {
|
|
420
345
|
swrKey,
|
|
421
346
|
...query
|
|
422
347
|
};
|
|
423
348
|
};
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
method: "POST",
|
|
431
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
432
|
-
body: JSON.stringify(updateMemberBody)
|
|
349
|
+
const getGetDataIntegrationAuthorizeUrlUrl = (slug, params) => {
|
|
350
|
+
const normalizedParams = new URLSearchParams();
|
|
351
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
352
|
+
if (value !== void 0) {
|
|
353
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
354
|
+
}
|
|
433
355
|
});
|
|
434
|
-
const
|
|
435
|
-
|
|
436
|
-
return {
|
|
437
|
-
data,
|
|
438
|
-
status: res.status,
|
|
439
|
-
headers: res.headers
|
|
440
|
-
};
|
|
441
|
-
};
|
|
442
|
-
const getUpdateMemberMutationFetcher = (userId, options) => {
|
|
443
|
-
return (_, { arg }) => {
|
|
444
|
-
return updateMember(userId, arg, options);
|
|
445
|
-
};
|
|
446
|
-
};
|
|
447
|
-
const getUpdateMemberMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/members/${userId}`];
|
|
448
|
-
const useUpdateMember = (userId, options) => {
|
|
449
|
-
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
450
|
-
const swrKey = swrOptions?.swrKey ?? getUpdateMemberMutationKey(userId);
|
|
451
|
-
const swrFn = getUpdateMemberMutationFetcher(userId, fetchOptions);
|
|
452
|
-
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
453
|
-
return {
|
|
454
|
-
swrKey,
|
|
455
|
-
...query
|
|
456
|
-
};
|
|
457
|
-
};
|
|
458
|
-
const getOrganizationsUrl = () => {
|
|
459
|
-
return `https://api.workos.com/_widgets/UserManagement/organizations`;
|
|
356
|
+
const stringifiedParams = normalizedParams.toString();
|
|
357
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
460
358
|
};
|
|
461
|
-
const
|
|
462
|
-
const res = await fetch(
|
|
359
|
+
const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
360
|
+
const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {
|
|
463
361
|
...options,
|
|
464
362
|
method: "GET"
|
|
465
363
|
});
|
|
@@ -471,40 +369,15 @@ const organizations = async (options) => {
|
|
|
471
369
|
headers: res.headers
|
|
472
370
|
};
|
|
473
371
|
};
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
const swrFn = () => organizations(fetchOptions);
|
|
480
|
-
const query = useSwr(
|
|
481
|
-
swrKey,
|
|
482
|
-
swrFn,
|
|
483
|
-
swrOptions
|
|
484
|
-
);
|
|
485
|
-
return {
|
|
486
|
-
swrKey,
|
|
487
|
-
...query
|
|
488
|
-
};
|
|
489
|
-
};
|
|
490
|
-
const getMeUrl = () => {
|
|
491
|
-
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
492
|
-
};
|
|
493
|
-
const me = async (options) => {
|
|
494
|
-
const res = await fetch(getMeUrl(), {
|
|
495
|
-
...options,
|
|
496
|
-
method: "GET"
|
|
497
|
-
});
|
|
498
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
499
|
-
const data = body ? JSON.parse(body) : {};
|
|
500
|
-
return { data, status: res.status, headers: res.headers };
|
|
501
|
-
};
|
|
502
|
-
const getMeKey = () => [`https://api.workos.com/_widgets/UserProfile/me`];
|
|
503
|
-
const useMe = (options) => {
|
|
372
|
+
const getGetDataIntegrationAuthorizeUrlKey = (slug, params) => [
|
|
373
|
+
`https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`,
|
|
374
|
+
...params ? [params] : []
|
|
375
|
+
];
|
|
376
|
+
const useGetDataIntegrationAuthorizeUrl = (slug, params, options) => {
|
|
504
377
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
505
|
-
const isEnabled = swrOptions?.enabled !== false;
|
|
506
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
507
|
-
const swrFn = () =>
|
|
378
|
+
const isEnabled = swrOptions?.enabled !== false && !!slug;
|
|
379
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetDataIntegrationAuthorizeUrlKey(slug, params) : null);
|
|
380
|
+
const swrFn = () => getDataIntegrationAuthorizeUrl(slug, params, fetchOptions);
|
|
508
381
|
const query = useSwr(
|
|
509
382
|
swrKey,
|
|
510
383
|
swrFn,
|
|
@@ -515,43 +388,15 @@ const useMe = (options) => {
|
|
|
515
388
|
...query
|
|
516
389
|
};
|
|
517
390
|
};
|
|
518
|
-
const
|
|
519
|
-
return `https://api.workos.com/_widgets/
|
|
391
|
+
const getInviteMemberUrl = () => {
|
|
392
|
+
return `https://api.workos.com/_widgets/UserManagement/invite-user`;
|
|
520
393
|
};
|
|
521
|
-
const
|
|
522
|
-
const res = await fetch(
|
|
394
|
+
const inviteMember = async (inviteMemberBody, options) => {
|
|
395
|
+
const res = await fetch(getInviteMemberUrl(), {
|
|
523
396
|
...options,
|
|
524
397
|
method: "POST",
|
|
525
398
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
526
|
-
body: JSON.stringify(
|
|
527
|
-
});
|
|
528
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
529
|
-
const data = body ? JSON.parse(body) : {};
|
|
530
|
-
return { data, status: res.status, headers: res.headers };
|
|
531
|
-
};
|
|
532
|
-
const getUpdateMeMutationFetcher = (options) => {
|
|
533
|
-
return (_, { arg }) => {
|
|
534
|
-
return updateMe(arg, options);
|
|
535
|
-
};
|
|
536
|
-
};
|
|
537
|
-
const getUpdateMeMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/me`];
|
|
538
|
-
const useUpdateMe = (options) => {
|
|
539
|
-
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
540
|
-
const swrKey = swrOptions?.swrKey ?? getUpdateMeMutationKey();
|
|
541
|
-
const swrFn = getUpdateMeMutationFetcher(fetchOptions);
|
|
542
|
-
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
543
|
-
return {
|
|
544
|
-
swrKey,
|
|
545
|
-
...query
|
|
546
|
-
};
|
|
547
|
-
};
|
|
548
|
-
const getCreateTotpFactorUrl = () => {
|
|
549
|
-
return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
|
|
550
|
-
};
|
|
551
|
-
const createTotpFactor = async (options) => {
|
|
552
|
-
const res = await fetch(getCreateTotpFactorUrl(), {
|
|
553
|
-
...options,
|
|
554
|
-
method: "POST"
|
|
399
|
+
body: JSON.stringify(inviteMemberBody)
|
|
555
400
|
});
|
|
556
401
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
557
402
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -561,31 +406,29 @@ const createTotpFactor = async (options) => {
|
|
|
561
406
|
headers: res.headers
|
|
562
407
|
};
|
|
563
408
|
};
|
|
564
|
-
const
|
|
565
|
-
return (_,
|
|
566
|
-
return
|
|
409
|
+
const getInviteMemberMutationFetcher = (options) => {
|
|
410
|
+
return (_, { arg }) => {
|
|
411
|
+
return inviteMember(arg, options);
|
|
567
412
|
};
|
|
568
413
|
};
|
|
569
|
-
const
|
|
570
|
-
const
|
|
414
|
+
const getInviteMemberMutationKey = () => [`https://api.workos.com/_widgets/UserManagement/invite-user`];
|
|
415
|
+
const useInviteMember = (options) => {
|
|
571
416
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
572
|
-
const swrKey = swrOptions?.swrKey ??
|
|
573
|
-
const swrFn =
|
|
417
|
+
const swrKey = swrOptions?.swrKey ?? getInviteMemberMutationKey();
|
|
418
|
+
const swrFn = getInviteMemberMutationFetcher(fetchOptions);
|
|
574
419
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
575
420
|
return {
|
|
576
421
|
swrKey,
|
|
577
422
|
...query
|
|
578
423
|
};
|
|
579
424
|
};
|
|
580
|
-
const
|
|
581
|
-
return `https://api.workos.com/_widgets/
|
|
425
|
+
const getRevokeInviteUrl = (userId) => {
|
|
426
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;
|
|
582
427
|
};
|
|
583
|
-
const
|
|
584
|
-
const res = await fetch(
|
|
428
|
+
const revokeInvite = async (userId, options) => {
|
|
429
|
+
const res = await fetch(getRevokeInviteUrl(userId), {
|
|
585
430
|
...options,
|
|
586
|
-
method: "
|
|
587
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
588
|
-
body: JSON.stringify(verifyTotpFactorRequest)
|
|
431
|
+
method: "DELETE"
|
|
589
432
|
});
|
|
590
433
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
591
434
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -595,29 +438,29 @@ const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
|
595
438
|
headers: res.headers
|
|
596
439
|
};
|
|
597
440
|
};
|
|
598
|
-
const
|
|
599
|
-
return (_,
|
|
600
|
-
return
|
|
441
|
+
const getRevokeInviteMutationFetcher = (userId, options) => {
|
|
442
|
+
return (_, __) => {
|
|
443
|
+
return revokeInvite(userId, options);
|
|
601
444
|
};
|
|
602
445
|
};
|
|
603
|
-
const
|
|
604
|
-
const
|
|
446
|
+
const getRevokeInviteMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/invites/${userId}`];
|
|
447
|
+
const useRevokeInvite = (userId, options) => {
|
|
605
448
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
606
|
-
const swrKey = swrOptions?.swrKey ??
|
|
607
|
-
const swrFn =
|
|
449
|
+
const swrKey = swrOptions?.swrKey ?? getRevokeInviteMutationKey(userId);
|
|
450
|
+
const swrFn = getRevokeInviteMutationFetcher(userId, fetchOptions);
|
|
608
451
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
609
452
|
return {
|
|
610
453
|
swrKey,
|
|
611
454
|
...query
|
|
612
455
|
};
|
|
613
456
|
};
|
|
614
|
-
const
|
|
615
|
-
return `https://api.workos.com/_widgets/
|
|
457
|
+
const getResendInviteUrl = (userId) => {
|
|
458
|
+
return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;
|
|
616
459
|
};
|
|
617
|
-
const
|
|
618
|
-
const res = await fetch(
|
|
460
|
+
const resendInvite = async (userId, options) => {
|
|
461
|
+
const res = await fetch(getResendInviteUrl(userId), {
|
|
619
462
|
...options,
|
|
620
|
-
method: "
|
|
463
|
+
method: "POST"
|
|
621
464
|
});
|
|
622
465
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
623
466
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -627,46 +470,52 @@ const deleteTotpFactors = async (options) => {
|
|
|
627
470
|
headers: res.headers
|
|
628
471
|
};
|
|
629
472
|
};
|
|
630
|
-
const
|
|
473
|
+
const getResendInviteMutationFetcher = (userId, options) => {
|
|
631
474
|
return (_, __) => {
|
|
632
|
-
return
|
|
475
|
+
return resendInvite(userId, options);
|
|
633
476
|
};
|
|
634
477
|
};
|
|
635
|
-
const
|
|
636
|
-
|
|
478
|
+
const getResendInviteMutationKey = (userId) => [
|
|
479
|
+
`https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`
|
|
480
|
+
];
|
|
481
|
+
const useResendInvite = (userId, options) => {
|
|
637
482
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
638
|
-
const swrKey = swrOptions?.swrKey ??
|
|
639
|
-
const swrFn =
|
|
483
|
+
const swrKey = swrOptions?.swrKey ?? getResendInviteMutationKey(userId);
|
|
484
|
+
const swrFn = getResendInviteMutationFetcher(userId, fetchOptions);
|
|
640
485
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
641
486
|
return {
|
|
642
487
|
swrKey,
|
|
643
488
|
...query
|
|
644
489
|
};
|
|
645
490
|
};
|
|
646
|
-
const
|
|
647
|
-
|
|
491
|
+
const getMembersUrl = (params) => {
|
|
492
|
+
const normalizedParams = new URLSearchParams();
|
|
493
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
494
|
+
if (value !== void 0) {
|
|
495
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
const stringifiedParams = normalizedParams.toString();
|
|
499
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}` : `https://api.workos.com/_widgets/UserManagement/members`;
|
|
648
500
|
};
|
|
649
|
-
const
|
|
650
|
-
const res = await fetch(
|
|
501
|
+
const members = async (params, options) => {
|
|
502
|
+
const res = await fetch(getMembersUrl(params), {
|
|
651
503
|
...options,
|
|
652
504
|
method: "GET"
|
|
653
505
|
});
|
|
654
506
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
655
507
|
const data = body ? JSON.parse(body) : {};
|
|
656
|
-
return {
|
|
657
|
-
data,
|
|
658
|
-
status: res.status,
|
|
659
|
-
headers: res.headers
|
|
660
|
-
};
|
|
508
|
+
return { data, status: res.status, headers: res.headers };
|
|
661
509
|
};
|
|
662
|
-
const
|
|
663
|
-
`https://api.workos.com/_widgets/
|
|
510
|
+
const getMembersKey = (params) => [
|
|
511
|
+
`https://api.workos.com/_widgets/UserManagement/members`,
|
|
512
|
+
...params ? [params] : []
|
|
664
513
|
];
|
|
665
|
-
const
|
|
514
|
+
const useMembers = (params, options) => {
|
|
666
515
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
667
516
|
const isEnabled = swrOptions?.enabled !== false;
|
|
668
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
669
|
-
const swrFn = () =>
|
|
517
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getMembersKey(params) : null);
|
|
518
|
+
const swrFn = () => members(params, fetchOptions);
|
|
670
519
|
const query = useSwr(
|
|
671
520
|
swrKey,
|
|
672
521
|
swrFn,
|
|
@@ -677,15 +526,13 @@ const useAuthenticationInformation = (options) => {
|
|
|
677
526
|
...query
|
|
678
527
|
};
|
|
679
528
|
};
|
|
680
|
-
const
|
|
681
|
-
return `https://api.workos.com/_widgets/
|
|
529
|
+
const getRemoveMemberUrl = (userId) => {
|
|
530
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
682
531
|
};
|
|
683
|
-
const
|
|
684
|
-
const res = await fetch(
|
|
532
|
+
const removeMember = async (userId, options) => {
|
|
533
|
+
const res = await fetch(getRemoveMemberUrl(userId), {
|
|
685
534
|
...options,
|
|
686
|
-
method: "
|
|
687
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
688
|
-
body: JSON.stringify(createPasswordRequest)
|
|
535
|
+
method: "DELETE"
|
|
689
536
|
});
|
|
690
537
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
691
538
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -695,31 +542,31 @@ const createPassword = async (createPasswordRequest, options) => {
|
|
|
695
542
|
headers: res.headers
|
|
696
543
|
};
|
|
697
544
|
};
|
|
698
|
-
const
|
|
699
|
-
return (_,
|
|
700
|
-
return
|
|
545
|
+
const getRemoveMemberMutationFetcher = (userId, options) => {
|
|
546
|
+
return (_, __) => {
|
|
547
|
+
return removeMember(userId, options);
|
|
701
548
|
};
|
|
702
549
|
};
|
|
703
|
-
const
|
|
704
|
-
const
|
|
550
|
+
const getRemoveMemberMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/members/${userId}`];
|
|
551
|
+
const useRemoveMember = (userId, options) => {
|
|
705
552
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
706
|
-
const swrKey = swrOptions?.swrKey ??
|
|
707
|
-
const swrFn =
|
|
553
|
+
const swrKey = swrOptions?.swrKey ?? getRemoveMemberMutationKey(userId);
|
|
554
|
+
const swrFn = getRemoveMemberMutationFetcher(userId, fetchOptions);
|
|
708
555
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
709
556
|
return {
|
|
710
557
|
swrKey,
|
|
711
558
|
...query
|
|
712
559
|
};
|
|
713
560
|
};
|
|
714
|
-
const
|
|
715
|
-
return `https://api.workos.com/_widgets/
|
|
561
|
+
const getUpdateMemberUrl = (userId) => {
|
|
562
|
+
return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;
|
|
716
563
|
};
|
|
717
|
-
const
|
|
718
|
-
const res = await fetch(
|
|
564
|
+
const updateMember = async (userId, updateMemberBody, options) => {
|
|
565
|
+
const res = await fetch(getUpdateMemberUrl(userId), {
|
|
719
566
|
...options,
|
|
720
567
|
method: "POST",
|
|
721
568
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
722
|
-
body: JSON.stringify(
|
|
569
|
+
body: JSON.stringify(updateMemberBody)
|
|
723
570
|
});
|
|
724
571
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
725
572
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -729,31 +576,29 @@ const updatePassword = async (updatePasswordRequest, options) => {
|
|
|
729
576
|
headers: res.headers
|
|
730
577
|
};
|
|
731
578
|
};
|
|
732
|
-
const
|
|
579
|
+
const getUpdateMemberMutationFetcher = (userId, options) => {
|
|
733
580
|
return (_, { arg }) => {
|
|
734
|
-
return
|
|
581
|
+
return updateMember(userId, arg, options);
|
|
735
582
|
};
|
|
736
583
|
};
|
|
737
|
-
const
|
|
738
|
-
const
|
|
584
|
+
const getUpdateMemberMutationKey = (userId) => [`https://api.workos.com/_widgets/UserManagement/members/${userId}`];
|
|
585
|
+
const useUpdateMember = (userId, options) => {
|
|
739
586
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
740
|
-
const swrKey = swrOptions?.swrKey ??
|
|
741
|
-
const swrFn =
|
|
587
|
+
const swrKey = swrOptions?.swrKey ?? getUpdateMemberMutationKey(userId);
|
|
588
|
+
const swrFn = getUpdateMemberMutationFetcher(userId, fetchOptions);
|
|
742
589
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
743
590
|
return {
|
|
744
591
|
swrKey,
|
|
745
592
|
...query
|
|
746
593
|
};
|
|
747
594
|
};
|
|
748
|
-
const
|
|
749
|
-
return `https://api.workos.com/_widgets/
|
|
595
|
+
const getOrganizationsUrl = () => {
|
|
596
|
+
return `https://api.workos.com/_widgets/UserManagement/organizations`;
|
|
750
597
|
};
|
|
751
|
-
const
|
|
752
|
-
const res = await fetch(
|
|
598
|
+
const organizations = async (options) => {
|
|
599
|
+
const res = await fetch(getOrganizationsUrl(), {
|
|
753
600
|
...options,
|
|
754
|
-
method: "
|
|
755
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
756
|
-
body: JSON.stringify(revokeAllSessionsRequest)
|
|
601
|
+
method: "GET"
|
|
757
602
|
});
|
|
758
603
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
759
604
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -763,29 +608,57 @@ const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
|
763
608
|
headers: res.headers
|
|
764
609
|
};
|
|
765
610
|
};
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
|
|
611
|
+
const getOrganizationsKey = () => [`https://api.workos.com/_widgets/UserManagement/organizations`];
|
|
612
|
+
const useOrganizations = (options) => {
|
|
613
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
614
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
615
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getOrganizationsKey() : null);
|
|
616
|
+
const swrFn = () => organizations(fetchOptions);
|
|
617
|
+
const query = useSwr(
|
|
618
|
+
swrKey,
|
|
619
|
+
swrFn,
|
|
620
|
+
swrOptions
|
|
621
|
+
);
|
|
622
|
+
return {
|
|
623
|
+
swrKey,
|
|
624
|
+
...query
|
|
769
625
|
};
|
|
770
626
|
};
|
|
771
|
-
const
|
|
772
|
-
|
|
627
|
+
const getRolesUrl = () => {
|
|
628
|
+
return `https://api.workos.com/_widgets/UserManagement/roles`;
|
|
629
|
+
};
|
|
630
|
+
const roles = async (options) => {
|
|
631
|
+
const res = await fetch(getRolesUrl(), {
|
|
632
|
+
...options,
|
|
633
|
+
method: "GET"
|
|
634
|
+
});
|
|
635
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
636
|
+
const data = body ? JSON.parse(body) : {};
|
|
637
|
+
return { data, status: res.status, headers: res.headers };
|
|
638
|
+
};
|
|
639
|
+
const getRolesKey = () => [`https://api.workos.com/_widgets/UserManagement/roles`];
|
|
640
|
+
const useRoles = (options) => {
|
|
773
641
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
774
|
-
const
|
|
775
|
-
const
|
|
776
|
-
const
|
|
642
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
643
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getRolesKey() : null);
|
|
644
|
+
const swrFn = () => roles(fetchOptions);
|
|
645
|
+
const query = useSwr(
|
|
646
|
+
swrKey,
|
|
647
|
+
swrFn,
|
|
648
|
+
swrOptions
|
|
649
|
+
);
|
|
777
650
|
return {
|
|
778
651
|
swrKey,
|
|
779
652
|
...query
|
|
780
653
|
};
|
|
781
654
|
};
|
|
782
|
-
const
|
|
783
|
-
return `https://api.workos.com/_widgets/
|
|
655
|
+
const getRolesAndConfigUrl = () => {
|
|
656
|
+
return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;
|
|
784
657
|
};
|
|
785
|
-
const
|
|
786
|
-
const res = await fetch(
|
|
658
|
+
const rolesAndConfig = async (options) => {
|
|
659
|
+
const res = await fetch(getRolesAndConfigUrl(), {
|
|
787
660
|
...options,
|
|
788
|
-
method: "
|
|
661
|
+
method: "GET"
|
|
789
662
|
});
|
|
790
663
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
791
664
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -795,42 +668,46 @@ const revokeSession = async (sessionId, options) => {
|
|
|
795
668
|
headers: res.headers
|
|
796
669
|
};
|
|
797
670
|
};
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
return revokeSession(sessionId, options);
|
|
801
|
-
};
|
|
802
|
-
};
|
|
803
|
-
const getRevokeSessionMutationKey = (sessionId) => [
|
|
804
|
-
`https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`
|
|
805
|
-
];
|
|
806
|
-
const useRevokeSession = (sessionId, options) => {
|
|
671
|
+
const getRolesAndConfigKey = () => [`https://api.workos.com/_widgets/UserManagement/roles-and-config`];
|
|
672
|
+
const useRolesAndConfig = (options) => {
|
|
807
673
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
808
|
-
const
|
|
809
|
-
const
|
|
810
|
-
const
|
|
674
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
675
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getRolesAndConfigKey() : null);
|
|
676
|
+
const swrFn = () => rolesAndConfig(fetchOptions);
|
|
677
|
+
const query = useSwr(
|
|
678
|
+
swrKey,
|
|
679
|
+
swrFn,
|
|
680
|
+
swrOptions
|
|
681
|
+
);
|
|
811
682
|
return {
|
|
812
683
|
swrKey,
|
|
813
684
|
...query
|
|
814
685
|
};
|
|
815
686
|
};
|
|
816
|
-
const
|
|
817
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
687
|
+
const getAuthenticationInformationUrl = () => {
|
|
688
|
+
return `https://api.workos.com/_widgets/UserProfile/authentication-information`;
|
|
818
689
|
};
|
|
819
|
-
const
|
|
820
|
-
const res = await fetch(
|
|
690
|
+
const authenticationInformation = async (options) => {
|
|
691
|
+
const res = await fetch(getAuthenticationInformationUrl(), {
|
|
821
692
|
...options,
|
|
822
693
|
method: "GET"
|
|
823
694
|
});
|
|
824
695
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
825
696
|
const data = body ? JSON.parse(body) : {};
|
|
826
|
-
return {
|
|
697
|
+
return {
|
|
698
|
+
data,
|
|
699
|
+
status: res.status,
|
|
700
|
+
headers: res.headers
|
|
701
|
+
};
|
|
827
702
|
};
|
|
828
|
-
const
|
|
829
|
-
|
|
703
|
+
const getAuthenticationInformationKey = () => [
|
|
704
|
+
`https://api.workos.com/_widgets/UserProfile/authentication-information`
|
|
705
|
+
];
|
|
706
|
+
const useAuthenticationInformation = (options) => {
|
|
830
707
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
831
708
|
const isEnabled = swrOptions?.enabled !== false;
|
|
832
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
833
|
-
const swrFn = () =>
|
|
709
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getAuthenticationInformationKey() : null);
|
|
710
|
+
const swrFn = () => authenticationInformation(fetchOptions);
|
|
834
711
|
const query = useSwr(
|
|
835
712
|
swrKey,
|
|
836
713
|
swrFn,
|
|
@@ -841,11 +718,45 @@ const useSessions = (options) => {
|
|
|
841
718
|
...query
|
|
842
719
|
};
|
|
843
720
|
};
|
|
844
|
-
const
|
|
845
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
721
|
+
const getCreatePasswordUrl = () => {
|
|
722
|
+
return `https://api.workos.com/_widgets/UserProfile/create-password`;
|
|
846
723
|
};
|
|
847
|
-
const
|
|
848
|
-
const res = await fetch(
|
|
724
|
+
const createPassword = async (createPasswordRequest, options) => {
|
|
725
|
+
const res = await fetch(getCreatePasswordUrl(), {
|
|
726
|
+
...options,
|
|
727
|
+
method: "POST",
|
|
728
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
729
|
+
body: JSON.stringify(createPasswordRequest)
|
|
730
|
+
});
|
|
731
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
732
|
+
const data = body ? JSON.parse(body) : {};
|
|
733
|
+
return {
|
|
734
|
+
data,
|
|
735
|
+
status: res.status,
|
|
736
|
+
headers: res.headers
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
const getCreatePasswordMutationFetcher = (options) => {
|
|
740
|
+
return (_, { arg }) => {
|
|
741
|
+
return createPassword(arg, options);
|
|
742
|
+
};
|
|
743
|
+
};
|
|
744
|
+
const getCreatePasswordMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/create-password`];
|
|
745
|
+
const useCreatePassword = (options) => {
|
|
746
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
747
|
+
const swrKey = swrOptions?.swrKey ?? getCreatePasswordMutationKey();
|
|
748
|
+
const swrFn = getCreatePasswordMutationFetcher(fetchOptions);
|
|
749
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
750
|
+
return {
|
|
751
|
+
swrKey,
|
|
752
|
+
...query
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
const getCreateTotpFactorUrl = () => {
|
|
756
|
+
return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;
|
|
757
|
+
};
|
|
758
|
+
const createTotpFactor = async (options) => {
|
|
759
|
+
const res = await fetch(getCreateTotpFactorUrl(), {
|
|
849
760
|
...options,
|
|
850
761
|
method: "POST"
|
|
851
762
|
});
|
|
@@ -857,46 +768,74 @@ const sendVerification = async (options) => {
|
|
|
857
768
|
headers: res.headers
|
|
858
769
|
};
|
|
859
770
|
};
|
|
860
|
-
const
|
|
771
|
+
const getCreateTotpFactorMutationFetcher = (options) => {
|
|
861
772
|
return (_, __) => {
|
|
862
|
-
return
|
|
773
|
+
return createTotpFactor(options);
|
|
863
774
|
};
|
|
864
775
|
};
|
|
865
|
-
const
|
|
866
|
-
const
|
|
776
|
+
const getCreateTotpFactorMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/create-totp-factor`];
|
|
777
|
+
const useCreateTotpFactor = (options) => {
|
|
778
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
779
|
+
const swrKey = swrOptions?.swrKey ?? getCreateTotpFactorMutationKey();
|
|
780
|
+
const swrFn = getCreateTotpFactorMutationFetcher(fetchOptions);
|
|
781
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
782
|
+
return {
|
|
783
|
+
swrKey,
|
|
784
|
+
...query
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
const getMeUrl = () => {
|
|
788
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
789
|
+
};
|
|
790
|
+
const me = async (options) => {
|
|
791
|
+
const res = await fetch(getMeUrl(), {
|
|
792
|
+
...options,
|
|
793
|
+
method: "GET"
|
|
794
|
+
});
|
|
795
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
796
|
+
const data = body ? JSON.parse(body) : {};
|
|
797
|
+
return { data, status: res.status, headers: res.headers };
|
|
798
|
+
};
|
|
799
|
+
const getMeKey = () => [`https://api.workos.com/_widgets/UserProfile/me`];
|
|
800
|
+
const useMe = (options) => {
|
|
867
801
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
868
|
-
const
|
|
869
|
-
const
|
|
870
|
-
const
|
|
802
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
803
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getMeKey() : null);
|
|
804
|
+
const swrFn = () => me(fetchOptions);
|
|
805
|
+
const query = useSwr(
|
|
806
|
+
swrKey,
|
|
807
|
+
swrFn,
|
|
808
|
+
swrOptions
|
|
809
|
+
);
|
|
871
810
|
return {
|
|
872
811
|
swrKey,
|
|
873
812
|
...query
|
|
874
813
|
};
|
|
875
814
|
};
|
|
876
|
-
const
|
|
877
|
-
return `https://api.workos.com/_widgets/UserProfile/
|
|
815
|
+
const getUpdateMeUrl = () => {
|
|
816
|
+
return `https://api.workos.com/_widgets/UserProfile/me`;
|
|
878
817
|
};
|
|
879
|
-
const
|
|
880
|
-
const res = await fetch(
|
|
818
|
+
const updateMe = async (updateMeBody, options) => {
|
|
819
|
+
const res = await fetch(getUpdateMeUrl(), {
|
|
881
820
|
...options,
|
|
882
821
|
method: "POST",
|
|
883
822
|
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
884
|
-
body: JSON.stringify(
|
|
823
|
+
body: JSON.stringify(updateMeBody)
|
|
885
824
|
});
|
|
886
825
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
887
826
|
const data = body ? JSON.parse(body) : {};
|
|
888
827
|
return { data, status: res.status, headers: res.headers };
|
|
889
828
|
};
|
|
890
|
-
const
|
|
829
|
+
const getUpdateMeMutationFetcher = (options) => {
|
|
891
830
|
return (_, { arg }) => {
|
|
892
|
-
return
|
|
831
|
+
return updateMe(arg, options);
|
|
893
832
|
};
|
|
894
833
|
};
|
|
895
|
-
const
|
|
896
|
-
const
|
|
834
|
+
const getUpdateMeMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/me`];
|
|
835
|
+
const useUpdateMe = (options) => {
|
|
897
836
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
898
|
-
const swrKey = swrOptions?.swrKey ??
|
|
899
|
-
const swrFn =
|
|
837
|
+
const swrKey = swrOptions?.swrKey ?? getUpdateMeMutationKey();
|
|
838
|
+
const swrFn = getUpdateMeMutationFetcher(fetchOptions);
|
|
900
839
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
901
840
|
return {
|
|
902
841
|
swrKey,
|
|
@@ -1003,11 +942,43 @@ const useDeletePasskey = (passkeyId, options) => {
|
|
|
1003
942
|
...query
|
|
1004
943
|
};
|
|
1005
944
|
};
|
|
1006
|
-
const
|
|
1007
|
-
return `https://api.workos.com/_widgets/
|
|
945
|
+
const getSendVerificationUrl = () => {
|
|
946
|
+
return `https://api.workos.com/_widgets/UserProfile/send-verification`;
|
|
1008
947
|
};
|
|
1009
|
-
const
|
|
1010
|
-
const res = await fetch(
|
|
948
|
+
const sendVerification = async (options) => {
|
|
949
|
+
const res = await fetch(getSendVerificationUrl(), {
|
|
950
|
+
...options,
|
|
951
|
+
method: "POST"
|
|
952
|
+
});
|
|
953
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
954
|
+
const data = body ? JSON.parse(body) : {};
|
|
955
|
+
return {
|
|
956
|
+
data,
|
|
957
|
+
status: res.status,
|
|
958
|
+
headers: res.headers
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
const getSendVerificationMutationFetcher = (options) => {
|
|
962
|
+
return (_, __) => {
|
|
963
|
+
return sendVerification(options);
|
|
964
|
+
};
|
|
965
|
+
};
|
|
966
|
+
const getSendVerificationMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/send-verification`];
|
|
967
|
+
const useSendVerification = (options) => {
|
|
968
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
969
|
+
const swrKey = swrOptions?.swrKey ?? getSendVerificationMutationKey();
|
|
970
|
+
const swrFn = getSendVerificationMutationFetcher(fetchOptions);
|
|
971
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
972
|
+
return {
|
|
973
|
+
swrKey,
|
|
974
|
+
...query
|
|
975
|
+
};
|
|
976
|
+
};
|
|
977
|
+
const getSessionsUrl = () => {
|
|
978
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions`;
|
|
979
|
+
};
|
|
980
|
+
const sessions = async (options) => {
|
|
981
|
+
const res = await fetch(getSessionsUrl(), {
|
|
1011
982
|
...options,
|
|
1012
983
|
method: "GET"
|
|
1013
984
|
});
|
|
@@ -1015,12 +986,12 @@ const settings = async (options) => {
|
|
|
1015
986
|
const data = body ? JSON.parse(body) : {};
|
|
1016
987
|
return { data, status: res.status, headers: res.headers };
|
|
1017
988
|
};
|
|
1018
|
-
const
|
|
1019
|
-
const
|
|
989
|
+
const getSessionsKey = () => [`https://api.workos.com/_widgets/UserProfile/sessions`];
|
|
990
|
+
const useSessions = (options) => {
|
|
1020
991
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1021
992
|
const isEnabled = swrOptions?.enabled !== false;
|
|
1022
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
1023
|
-
const swrFn = () =>
|
|
993
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getSessionsKey() : null);
|
|
994
|
+
const swrFn = () => sessions(fetchOptions);
|
|
1024
995
|
const query = useSwr(
|
|
1025
996
|
swrKey,
|
|
1026
997
|
swrFn,
|
|
@@ -1031,13 +1002,15 @@ const useSettings = (options) => {
|
|
|
1031
1002
|
...query
|
|
1032
1003
|
};
|
|
1033
1004
|
};
|
|
1034
|
-
const
|
|
1035
|
-
return `https://api.workos.com/_widgets/
|
|
1005
|
+
const getRevokeAllSessionsUrl = () => {
|
|
1006
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;
|
|
1036
1007
|
};
|
|
1037
|
-
const
|
|
1038
|
-
const res = await fetch(
|
|
1008
|
+
const revokeAllSessions = async (revokeAllSessionsRequest, options) => {
|
|
1009
|
+
const res = await fetch(getRevokeAllSessionsUrl(), {
|
|
1039
1010
|
...options,
|
|
1040
|
-
method: "
|
|
1011
|
+
method: "DELETE",
|
|
1012
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1013
|
+
body: JSON.stringify(revokeAllSessionsRequest)
|
|
1041
1014
|
});
|
|
1042
1015
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1043
1016
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1047,38 +1020,29 @@ const listOrganizationDomains = async (options) => {
|
|
|
1047
1020
|
headers: res.headers
|
|
1048
1021
|
};
|
|
1049
1022
|
};
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1023
|
+
const getRevokeAllSessionsMutationFetcher = (options) => {
|
|
1024
|
+
return (_, { arg }) => {
|
|
1025
|
+
return revokeAllSessions(arg, options);
|
|
1026
|
+
};
|
|
1027
|
+
};
|
|
1028
|
+
const getRevokeAllSessionsMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`];
|
|
1029
|
+
const useRevokeAllSessions = (options) => {
|
|
1054
1030
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1055
|
-
const
|
|
1056
|
-
const
|
|
1057
|
-
const
|
|
1058
|
-
const query = useSwr(
|
|
1059
|
-
swrKey,
|
|
1060
|
-
swrFn,
|
|
1061
|
-
swrOptions
|
|
1062
|
-
);
|
|
1031
|
+
const swrKey = swrOptions?.swrKey ?? getRevokeAllSessionsMutationKey();
|
|
1032
|
+
const swrFn = getRevokeAllSessionsMutationFetcher(fetchOptions);
|
|
1033
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1063
1034
|
return {
|
|
1064
1035
|
swrKey,
|
|
1065
1036
|
...query
|
|
1066
1037
|
};
|
|
1067
1038
|
};
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1070
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1071
|
-
if (value !== void 0) {
|
|
1072
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1073
|
-
}
|
|
1074
|
-
});
|
|
1075
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1076
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
1039
|
+
const getRevokeSessionUrl = (sessionId) => {
|
|
1040
|
+
return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;
|
|
1077
1041
|
};
|
|
1078
|
-
const
|
|
1079
|
-
const res = await fetch(
|
|
1042
|
+
const revokeSession = async (sessionId, options) => {
|
|
1043
|
+
const res = await fetch(getRevokeSessionUrl(sessionId), {
|
|
1080
1044
|
...options,
|
|
1081
|
-
method: "
|
|
1045
|
+
method: "DELETE"
|
|
1082
1046
|
});
|
|
1083
1047
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1084
1048
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1088,30 +1052,29 @@ const generateAdminPortalLink = async (params, options) => {
|
|
|
1088
1052
|
headers: res.headers
|
|
1089
1053
|
};
|
|
1090
1054
|
};
|
|
1091
|
-
const
|
|
1055
|
+
const getRevokeSessionMutationFetcher = (sessionId, options) => {
|
|
1092
1056
|
return (_, __) => {
|
|
1093
|
-
return
|
|
1057
|
+
return revokeSession(sessionId, options);
|
|
1094
1058
|
};
|
|
1095
1059
|
};
|
|
1096
|
-
const
|
|
1097
|
-
`https://api.workos.com/_widgets/
|
|
1098
|
-
...params ? [params] : []
|
|
1060
|
+
const getRevokeSessionMutationKey = (sessionId) => [
|
|
1061
|
+
`https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`
|
|
1099
1062
|
];
|
|
1100
|
-
const
|
|
1063
|
+
const useRevokeSession = (sessionId, options) => {
|
|
1101
1064
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1102
|
-
const swrKey = swrOptions?.swrKey ??
|
|
1103
|
-
const swrFn =
|
|
1065
|
+
const swrKey = swrOptions?.swrKey ?? getRevokeSessionMutationKey(sessionId);
|
|
1066
|
+
const swrFn = getRevokeSessionMutationFetcher(sessionId, fetchOptions);
|
|
1104
1067
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1105
1068
|
return {
|
|
1106
1069
|
swrKey,
|
|
1107
1070
|
...query
|
|
1108
1071
|
};
|
|
1109
1072
|
};
|
|
1110
|
-
const
|
|
1111
|
-
return `https://api.workos.com/_widgets/
|
|
1073
|
+
const getDeleteTotpFactorsUrl = () => {
|
|
1074
|
+
return `https://api.workos.com/_widgets/UserProfile/totp-factors`;
|
|
1112
1075
|
};
|
|
1113
|
-
const
|
|
1114
|
-
const res = await fetch(
|
|
1076
|
+
const deleteTotpFactors = async (options) => {
|
|
1077
|
+
const res = await fetch(getDeleteTotpFactorsUrl(), {
|
|
1115
1078
|
...options,
|
|
1116
1079
|
method: "DELETE"
|
|
1117
1080
|
});
|
|
@@ -1123,34 +1086,95 @@ const deleteOrganizationDomain = async (domainId, options) => {
|
|
|
1123
1086
|
headers: res.headers
|
|
1124
1087
|
};
|
|
1125
1088
|
};
|
|
1126
|
-
const
|
|
1089
|
+
const getDeleteTotpFactorsMutationFetcher = (options) => {
|
|
1127
1090
|
return (_, __) => {
|
|
1128
|
-
return
|
|
1091
|
+
return deleteTotpFactors(options);
|
|
1129
1092
|
};
|
|
1130
1093
|
};
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
];
|
|
1134
|
-
const useDeleteOrganizationDomain = (domainId, options) => {
|
|
1094
|
+
const getDeleteTotpFactorsMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/totp-factors`];
|
|
1095
|
+
const useDeleteTotpFactors = (options) => {
|
|
1135
1096
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1136
|
-
const swrKey = swrOptions?.swrKey ??
|
|
1137
|
-
const swrFn =
|
|
1138
|
-
domainId,
|
|
1139
|
-
fetchOptions
|
|
1140
|
-
);
|
|
1097
|
+
const swrKey = swrOptions?.swrKey ?? getDeleteTotpFactorsMutationKey();
|
|
1098
|
+
const swrFn = getDeleteTotpFactorsMutationFetcher(fetchOptions);
|
|
1141
1099
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1142
1100
|
return {
|
|
1143
1101
|
swrKey,
|
|
1144
1102
|
...query
|
|
1145
1103
|
};
|
|
1146
1104
|
};
|
|
1147
|
-
const
|
|
1148
|
-
return `https://api.workos.com/_widgets/
|
|
1105
|
+
const getUpdatePasswordUrl = () => {
|
|
1106
|
+
return `https://api.workos.com/_widgets/UserProfile/update-password`;
|
|
1149
1107
|
};
|
|
1150
|
-
const
|
|
1151
|
-
const res = await fetch(
|
|
1108
|
+
const updatePassword = async (updatePasswordRequest, options) => {
|
|
1109
|
+
const res = await fetch(getUpdatePasswordUrl(), {
|
|
1152
1110
|
...options,
|
|
1153
|
-
method: "POST"
|
|
1111
|
+
method: "POST",
|
|
1112
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1113
|
+
body: JSON.stringify(updatePasswordRequest)
|
|
1114
|
+
});
|
|
1115
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1116
|
+
const data = body ? JSON.parse(body) : {};
|
|
1117
|
+
return {
|
|
1118
|
+
data,
|
|
1119
|
+
status: res.status,
|
|
1120
|
+
headers: res.headers
|
|
1121
|
+
};
|
|
1122
|
+
};
|
|
1123
|
+
const getUpdatePasswordMutationFetcher = (options) => {
|
|
1124
|
+
return (_, { arg }) => {
|
|
1125
|
+
return updatePassword(arg, options);
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
1128
|
+
const getUpdatePasswordMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/update-password`];
|
|
1129
|
+
const useUpdatePassword = (options) => {
|
|
1130
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1131
|
+
const swrKey = swrOptions?.swrKey ?? getUpdatePasswordMutationKey();
|
|
1132
|
+
const swrFn = getUpdatePasswordMutationFetcher(fetchOptions);
|
|
1133
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1134
|
+
return {
|
|
1135
|
+
swrKey,
|
|
1136
|
+
...query
|
|
1137
|
+
};
|
|
1138
|
+
};
|
|
1139
|
+
const getVerifyUrl = () => {
|
|
1140
|
+
return `https://api.workos.com/_widgets/UserProfile/verify`;
|
|
1141
|
+
};
|
|
1142
|
+
const verify = async (verifyRequest, options) => {
|
|
1143
|
+
const res = await fetch(getVerifyUrl(), {
|
|
1144
|
+
...options,
|
|
1145
|
+
method: "POST",
|
|
1146
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1147
|
+
body: JSON.stringify(verifyRequest)
|
|
1148
|
+
});
|
|
1149
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1150
|
+
const data = body ? JSON.parse(body) : {};
|
|
1151
|
+
return { data, status: res.status, headers: res.headers };
|
|
1152
|
+
};
|
|
1153
|
+
const getVerifyMutationFetcher = (options) => {
|
|
1154
|
+
return (_, { arg }) => {
|
|
1155
|
+
return verify(arg, options);
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
const getVerifyMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/verify`];
|
|
1159
|
+
const useVerify = (options) => {
|
|
1160
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1161
|
+
const swrKey = swrOptions?.swrKey ?? getVerifyMutationKey();
|
|
1162
|
+
const swrFn = getVerifyMutationFetcher(fetchOptions);
|
|
1163
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1164
|
+
return {
|
|
1165
|
+
swrKey,
|
|
1166
|
+
...query
|
|
1167
|
+
};
|
|
1168
|
+
};
|
|
1169
|
+
const getVerifyTotpFactorUrl = () => {
|
|
1170
|
+
return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;
|
|
1171
|
+
};
|
|
1172
|
+
const verifyTotpFactor = async (verifyTotpFactorRequest, options) => {
|
|
1173
|
+
const res = await fetch(getVerifyTotpFactorUrl(), {
|
|
1174
|
+
...options,
|
|
1175
|
+
method: "POST",
|
|
1176
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1177
|
+
body: JSON.stringify(verifyTotpFactorRequest)
|
|
1154
1178
|
});
|
|
1155
1179
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1156
1180
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1160,32 +1184,27 @@ const reverifyOrganizationDomain = async (domainId, options) => {
|
|
|
1160
1184
|
headers: res.headers
|
|
1161
1185
|
};
|
|
1162
1186
|
};
|
|
1163
|
-
const
|
|
1164
|
-
return (_,
|
|
1165
|
-
return
|
|
1187
|
+
const getVerifyTotpFactorMutationFetcher = (options) => {
|
|
1188
|
+
return (_, { arg }) => {
|
|
1189
|
+
return verifyTotpFactor(arg, options);
|
|
1166
1190
|
};
|
|
1167
1191
|
};
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1170
|
-
];
|
|
1171
|
-
const useReverifyOrganizationDomain = (domainId, options) => {
|
|
1192
|
+
const getVerifyTotpFactorMutationKey = () => [`https://api.workos.com/_widgets/UserProfile/verify-totp-factor`];
|
|
1193
|
+
const useVerifyTotpFactor = (options) => {
|
|
1172
1194
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1173
|
-
const swrKey = swrOptions?.swrKey ??
|
|
1174
|
-
const swrFn =
|
|
1175
|
-
domainId,
|
|
1176
|
-
fetchOptions
|
|
1177
|
-
);
|
|
1195
|
+
const swrKey = swrOptions?.swrKey ?? getVerifyTotpFactorMutationKey();
|
|
1196
|
+
const swrFn = getVerifyTotpFactorMutationFetcher(fetchOptions);
|
|
1178
1197
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1179
1198
|
return {
|
|
1180
1199
|
swrKey,
|
|
1181
1200
|
...query
|
|
1182
1201
|
};
|
|
1183
1202
|
};
|
|
1184
|
-
const
|
|
1185
|
-
return `https://api.workos.com/_widgets/admin-portal/
|
|
1203
|
+
const getGetAuditLogStreamUrl = () => {
|
|
1204
|
+
return `https://api.workos.com/_widgets/admin-portal/audit-log-stream`;
|
|
1186
1205
|
};
|
|
1187
|
-
const
|
|
1188
|
-
const res = await fetch(
|
|
1206
|
+
const getAuditLogStream = async (options) => {
|
|
1207
|
+
const res = await fetch(getGetAuditLogStreamUrl(), {
|
|
1189
1208
|
...options,
|
|
1190
1209
|
method: "GET"
|
|
1191
1210
|
});
|
|
@@ -1197,12 +1216,12 @@ const listSsoConnections = async (options) => {
|
|
|
1197
1216
|
headers: res.headers
|
|
1198
1217
|
};
|
|
1199
1218
|
};
|
|
1200
|
-
const
|
|
1201
|
-
const
|
|
1219
|
+
const getGetAuditLogStreamKey = () => [`https://api.workos.com/_widgets/admin-portal/audit-log-stream`];
|
|
1220
|
+
const useGetAuditLogStream = (options) => {
|
|
1202
1221
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1203
1222
|
const isEnabled = swrOptions?.enabled !== false;
|
|
1204
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
1205
|
-
const swrFn = () =>
|
|
1223
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetAuditLogStreamKey() : null);
|
|
1224
|
+
const swrFn = () => getAuditLogStream(fetchOptions);
|
|
1206
1225
|
const query = useSwr(
|
|
1207
1226
|
swrKey,
|
|
1208
1227
|
swrFn,
|
|
@@ -1213,15 +1232,20 @@ const useListSsoConnections = (options) => {
|
|
|
1213
1232
|
...query
|
|
1214
1233
|
};
|
|
1215
1234
|
};
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1235
|
+
const getGenerateAdminPortalLinkUrl = (params) => {
|
|
1236
|
+
const normalizedParams = new URLSearchParams();
|
|
1237
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1238
|
+
if (value !== void 0) {
|
|
1239
|
+
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1242
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1243
|
+
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}` : `https://api.workos.com/_widgets/admin-portal/generate-link`;
|
|
1218
1244
|
};
|
|
1219
|
-
const
|
|
1220
|
-
const res = await fetch(
|
|
1245
|
+
const generateAdminPortalLink = async (params, options) => {
|
|
1246
|
+
const res = await fetch(getGenerateAdminPortalLinkUrl(params), {
|
|
1221
1247
|
...options,
|
|
1222
|
-
method: "POST"
|
|
1223
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1224
|
-
body: JSON.stringify(createOrganizationApiKeyRequest)
|
|
1248
|
+
method: "POST"
|
|
1225
1249
|
});
|
|
1226
1250
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1227
1251
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1231,34 +1255,30 @@ const createOrganizationApiKey = async (createOrganizationApiKeyRequest, options
|
|
|
1231
1255
|
headers: res.headers
|
|
1232
1256
|
};
|
|
1233
1257
|
};
|
|
1234
|
-
const
|
|
1235
|
-
return (_,
|
|
1236
|
-
return
|
|
1258
|
+
const getGenerateAdminPortalLinkMutationFetcher = (params, options) => {
|
|
1259
|
+
return (_, __) => {
|
|
1260
|
+
return generateAdminPortalLink(params, options);
|
|
1237
1261
|
};
|
|
1238
1262
|
};
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1263
|
+
const getGenerateAdminPortalLinkMutationKey = (params) => [
|
|
1264
|
+
`https://api.workos.com/_widgets/admin-portal/generate-link`,
|
|
1265
|
+
...params ? [params] : []
|
|
1266
|
+
];
|
|
1267
|
+
const useGenerateAdminPortalLink = (params, options) => {
|
|
1241
1268
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1242
|
-
const swrKey = swrOptions?.swrKey ??
|
|
1243
|
-
const swrFn =
|
|
1269
|
+
const swrKey = swrOptions?.swrKey ?? getGenerateAdminPortalLinkMutationKey(params);
|
|
1270
|
+
const swrFn = getGenerateAdminPortalLinkMutationFetcher(params, fetchOptions);
|
|
1244
1271
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1245
1272
|
return {
|
|
1246
1273
|
swrKey,
|
|
1247
1274
|
...query
|
|
1248
1275
|
};
|
|
1249
1276
|
};
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1253
|
-
if (value !== void 0) {
|
|
1254
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1258
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;
|
|
1277
|
+
const getListOrganizationDomainsUrl = () => {
|
|
1278
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains`;
|
|
1259
1279
|
};
|
|
1260
|
-
const
|
|
1261
|
-
const res = await fetch(
|
|
1280
|
+
const listOrganizationDomains = async (options) => {
|
|
1281
|
+
const res = await fetch(getListOrganizationDomainsUrl(), {
|
|
1262
1282
|
...options,
|
|
1263
1283
|
method: "GET"
|
|
1264
1284
|
});
|
|
@@ -1270,15 +1290,14 @@ const listOrganizationApiKeys = async (params, options) => {
|
|
|
1270
1290
|
headers: res.headers
|
|
1271
1291
|
};
|
|
1272
1292
|
};
|
|
1273
|
-
const
|
|
1274
|
-
`https://api.workos.com/_widgets/
|
|
1275
|
-
...params ? [params] : []
|
|
1293
|
+
const getListOrganizationDomainsKey = () => [
|
|
1294
|
+
`https://api.workos.com/_widgets/admin-portal/organization-domains`
|
|
1276
1295
|
];
|
|
1277
|
-
const
|
|
1296
|
+
const useListOrganizationDomains = (options) => {
|
|
1278
1297
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1279
1298
|
const isEnabled = swrOptions?.enabled !== false;
|
|
1280
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
1281
|
-
const swrFn = () =>
|
|
1299
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListOrganizationDomainsKey() : null);
|
|
1300
|
+
const swrFn = () => listOrganizationDomains(fetchOptions);
|
|
1282
1301
|
const query = useSwr(
|
|
1283
1302
|
swrKey,
|
|
1284
1303
|
swrFn,
|
|
@@ -1289,20 +1308,13 @@ const useListOrganizationApiKeys = (params, options) => {
|
|
|
1289
1308
|
...query
|
|
1290
1309
|
};
|
|
1291
1310
|
};
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1294
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1295
|
-
if (value !== void 0) {
|
|
1296
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1297
|
-
}
|
|
1298
|
-
});
|
|
1299
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1300
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}` : `https://api.workos.com/_widgets/ApiKeys/permissions`;
|
|
1311
|
+
const getDeleteOrganizationDomainUrl = (domainId) => {
|
|
1312
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;
|
|
1301
1313
|
};
|
|
1302
|
-
const
|
|
1303
|
-
const res = await fetch(
|
|
1314
|
+
const deleteOrganizationDomain = async (domainId, options) => {
|
|
1315
|
+
const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {
|
|
1304
1316
|
...options,
|
|
1305
|
-
method: "
|
|
1317
|
+
method: "DELETE"
|
|
1306
1318
|
});
|
|
1307
1319
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1308
1320
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1312,32 +1324,34 @@ const listOrganizationApiKeyPermissions = async (params, options) => {
|
|
|
1312
1324
|
headers: res.headers
|
|
1313
1325
|
};
|
|
1314
1326
|
};
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
|
|
1327
|
+
const getDeleteOrganizationDomainMutationFetcher = (domainId, options) => {
|
|
1328
|
+
return (_, __) => {
|
|
1329
|
+
return deleteOrganizationDomain(domainId, options);
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
const getDeleteOrganizationDomainMutationKey = (domainId) => [
|
|
1333
|
+
`https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`
|
|
1318
1334
|
];
|
|
1319
|
-
const
|
|
1335
|
+
const useDeleteOrganizationDomain = (domainId, options) => {
|
|
1320
1336
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1321
|
-
const
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
swrKey,
|
|
1326
|
-
swrFn,
|
|
1327
|
-
swrOptions
|
|
1337
|
+
const swrKey = swrOptions?.swrKey ?? getDeleteOrganizationDomainMutationKey(domainId);
|
|
1338
|
+
const swrFn = getDeleteOrganizationDomainMutationFetcher(
|
|
1339
|
+
domainId,
|
|
1340
|
+
fetchOptions
|
|
1328
1341
|
);
|
|
1342
|
+
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1329
1343
|
return {
|
|
1330
1344
|
swrKey,
|
|
1331
1345
|
...query
|
|
1332
1346
|
};
|
|
1333
1347
|
};
|
|
1334
|
-
const
|
|
1335
|
-
return `https://api.workos.com/_widgets/
|
|
1348
|
+
const getReverifyOrganizationDomainUrl = (domainId) => {
|
|
1349
|
+
return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;
|
|
1336
1350
|
};
|
|
1337
|
-
const
|
|
1338
|
-
const res = await fetch(
|
|
1351
|
+
const reverifyOrganizationDomain = async (domainId, options) => {
|
|
1352
|
+
const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {
|
|
1339
1353
|
...options,
|
|
1340
|
-
method: "
|
|
1354
|
+
method: "POST"
|
|
1341
1355
|
});
|
|
1342
1356
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1343
1357
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -1347,17 +1361,19 @@ const deleteOrganizationApiKey = async (apiKeyId, options) => {
|
|
|
1347
1361
|
headers: res.headers
|
|
1348
1362
|
};
|
|
1349
1363
|
};
|
|
1350
|
-
const
|
|
1364
|
+
const getReverifyOrganizationDomainMutationFetcher = (domainId, options) => {
|
|
1351
1365
|
return (_, __) => {
|
|
1352
|
-
return
|
|
1366
|
+
return reverifyOrganizationDomain(domainId, options);
|
|
1353
1367
|
};
|
|
1354
1368
|
};
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1369
|
+
const getReverifyOrganizationDomainMutationKey = (domainId) => [
|
|
1370
|
+
`https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`
|
|
1371
|
+
];
|
|
1372
|
+
const useReverifyOrganizationDomain = (domainId, options) => {
|
|
1357
1373
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1358
|
-
const swrKey = swrOptions?.swrKey ??
|
|
1359
|
-
const swrFn =
|
|
1360
|
-
|
|
1374
|
+
const swrKey = swrOptions?.swrKey ?? getReverifyOrganizationDomainMutationKey(domainId);
|
|
1375
|
+
const swrFn = getReverifyOrganizationDomainMutationFetcher(
|
|
1376
|
+
domainId,
|
|
1361
1377
|
fetchOptions
|
|
1362
1378
|
);
|
|
1363
1379
|
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
@@ -1366,11 +1382,11 @@ const useDeleteOrganizationApiKey = (apiKeyId, options) => {
|
|
|
1366
1382
|
...query
|
|
1367
1383
|
};
|
|
1368
1384
|
};
|
|
1369
|
-
const
|
|
1370
|
-
return `https://api.workos.com/_widgets/
|
|
1385
|
+
const getListSsoConnectionsUrl = () => {
|
|
1386
|
+
return `https://api.workos.com/_widgets/admin-portal/sso-connections`;
|
|
1371
1387
|
};
|
|
1372
|
-
const
|
|
1373
|
-
const res = await fetch(
|
|
1388
|
+
const listSsoConnections = async (options) => {
|
|
1389
|
+
const res = await fetch(getListSsoConnectionsUrl(), {
|
|
1374
1390
|
...options,
|
|
1375
1391
|
method: "GET"
|
|
1376
1392
|
});
|
|
@@ -1382,12 +1398,12 @@ const myDataIntegrations = async (options) => {
|
|
|
1382
1398
|
headers: res.headers
|
|
1383
1399
|
};
|
|
1384
1400
|
};
|
|
1385
|
-
const
|
|
1386
|
-
const
|
|
1401
|
+
const getListSsoConnectionsKey = () => [`https://api.workos.com/_widgets/admin-portal/sso-connections`];
|
|
1402
|
+
const useListSsoConnections = (options) => {
|
|
1387
1403
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1388
1404
|
const isEnabled = swrOptions?.enabled !== false;
|
|
1389
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
1390
|
-
const swrFn = () =>
|
|
1405
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListSsoConnectionsKey() : null);
|
|
1406
|
+
const swrFn = () => listSsoConnections(fetchOptions);
|
|
1391
1407
|
const query = useSwr(
|
|
1392
1408
|
swrKey,
|
|
1393
1409
|
swrFn,
|
|
@@ -1398,18 +1414,11 @@ const useMyDataIntegrations = (options) => {
|
|
|
1398
1414
|
...query
|
|
1399
1415
|
};
|
|
1400
1416
|
};
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1403
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1404
|
-
if (value !== void 0) {
|
|
1405
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1406
|
-
}
|
|
1407
|
-
});
|
|
1408
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1409
|
-
return stringifiedParams.length > 0 ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}` : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;
|
|
1417
|
+
const getListDirectoriesUrl = () => {
|
|
1418
|
+
return `https://api.workos.com/_widgets/directory-sync/directories`;
|
|
1410
1419
|
};
|
|
1411
|
-
const
|
|
1412
|
-
const res = await fetch(
|
|
1420
|
+
const listDirectories = async (options) => {
|
|
1421
|
+
const res = await fetch(getListDirectoriesUrl(), {
|
|
1413
1422
|
...options,
|
|
1414
1423
|
method: "GET"
|
|
1415
1424
|
});
|
|
@@ -1421,15 +1430,12 @@ const getDataIntegrationAuthorizeUrl = async (slug, params, options) => {
|
|
|
1421
1430
|
headers: res.headers
|
|
1422
1431
|
};
|
|
1423
1432
|
};
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1426
|
-
...params ? [params] : []
|
|
1427
|
-
];
|
|
1428
|
-
const useGetDataIntegrationAuthorizeUrl = (slug, params, options) => {
|
|
1433
|
+
const getListDirectoriesKey = () => [`https://api.workos.com/_widgets/directory-sync/directories`];
|
|
1434
|
+
const useListDirectories = (options) => {
|
|
1429
1435
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1430
|
-
const isEnabled = swrOptions?.enabled !== false
|
|
1431
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
1432
|
-
const swrFn = () =>
|
|
1436
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
1437
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListDirectoriesKey() : null);
|
|
1438
|
+
const swrFn = () => listDirectories(fetchOptions);
|
|
1433
1439
|
const query = useSwr(
|
|
1434
1440
|
swrKey,
|
|
1435
1441
|
swrFn,
|
|
@@ -1440,17 +1446,14 @@ const useGetDataIntegrationAuthorizeUrl = (slug, params, options) => {
|
|
|
1440
1446
|
...query
|
|
1441
1447
|
};
|
|
1442
1448
|
};
|
|
1443
|
-
const
|
|
1444
|
-
return `https://api.workos.com/_widgets/
|
|
1449
|
+
const getGetDirectoryUrl = (directoryId) => {
|
|
1450
|
+
return `https://api.workos.com/_widgets/directory-sync/directories/${directoryId}`;
|
|
1445
1451
|
};
|
|
1446
|
-
const
|
|
1447
|
-
const res = await fetch(
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
method: "GET"
|
|
1452
|
-
}
|
|
1453
|
-
);
|
|
1452
|
+
const getDirectory = async (directoryId, options) => {
|
|
1453
|
+
const res = await fetch(getGetDirectoryUrl(directoryId), {
|
|
1454
|
+
...options,
|
|
1455
|
+
method: "GET"
|
|
1456
|
+
});
|
|
1454
1457
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1455
1458
|
const data = body ? JSON.parse(body) : {};
|
|
1456
1459
|
return {
|
|
@@ -1459,18 +1462,14 @@ const getDataInstallationAuthorizationStatus = async (dataIntegrationId, state,
|
|
|
1459
1462
|
headers: res.headers
|
|
1460
1463
|
};
|
|
1461
1464
|
};
|
|
1462
|
-
const
|
|
1463
|
-
`https://api.workos.com/_widgets/
|
|
1465
|
+
const getGetDirectoryKey = (directoryId) => [
|
|
1466
|
+
`https://api.workos.com/_widgets/directory-sync/directories/${directoryId}`
|
|
1464
1467
|
];
|
|
1465
|
-
const
|
|
1468
|
+
const useGetDirectory = (directoryId, options) => {
|
|
1466
1469
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1467
|
-
const isEnabled = swrOptions?.enabled !== false && !!
|
|
1468
|
-
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ?
|
|
1469
|
-
const swrFn = () =>
|
|
1470
|
-
dataIntegrationId,
|
|
1471
|
-
state,
|
|
1472
|
-
fetchOptions
|
|
1473
|
-
);
|
|
1470
|
+
const isEnabled = swrOptions?.enabled !== false && !!directoryId;
|
|
1471
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetDirectoryKey(directoryId) : null);
|
|
1472
|
+
const swrFn = () => getDirectory(directoryId, fetchOptions);
|
|
1474
1473
|
const query = useSwr(
|
|
1475
1474
|
swrKey,
|
|
1476
1475
|
swrFn,
|
|
@@ -1481,56 +1480,37 @@ const useGetDataInstallationAuthorizationStatus = (dataIntegrationId, state, opt
|
|
|
1481
1480
|
...query
|
|
1482
1481
|
};
|
|
1483
1482
|
};
|
|
1484
|
-
const
|
|
1485
|
-
return `https://api.workos.com/_widgets/
|
|
1483
|
+
const getSettingsUrl = () => {
|
|
1484
|
+
return `https://api.workos.com/_widgets/settings`;
|
|
1486
1485
|
};
|
|
1487
|
-
const
|
|
1488
|
-
const res = await fetch(
|
|
1486
|
+
const settings = async (options) => {
|
|
1487
|
+
const res = await fetch(getSettingsUrl(), {
|
|
1489
1488
|
...options,
|
|
1490
|
-
method: "
|
|
1489
|
+
method: "GET"
|
|
1491
1490
|
});
|
|
1492
1491
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1493
1492
|
const data = body ? JSON.parse(body) : {};
|
|
1494
|
-
return {
|
|
1495
|
-
data,
|
|
1496
|
-
status: res.status,
|
|
1497
|
-
headers: res.headers
|
|
1498
|
-
};
|
|
1499
|
-
};
|
|
1500
|
-
const getDeleteDataInstallationMutationFetcher = (installationId, options) => {
|
|
1501
|
-
return (_, __) => {
|
|
1502
|
-
return deleteDataInstallation(installationId, options);
|
|
1503
|
-
};
|
|
1493
|
+
return { data, status: res.status, headers: res.headers };
|
|
1504
1494
|
};
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1507
|
-
];
|
|
1508
|
-
const useDeleteDataInstallation = (installationId, options) => {
|
|
1495
|
+
const getSettingsKey = () => [`https://api.workos.com/_widgets/settings`];
|
|
1496
|
+
const useSettings = (options) => {
|
|
1509
1497
|
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1510
|
-
const
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1513
|
-
|
|
1498
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
1499
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getSettingsKey() : null);
|
|
1500
|
+
const swrFn = () => settings(fetchOptions);
|
|
1501
|
+
const query = useSwr(
|
|
1502
|
+
swrKey,
|
|
1503
|
+
swrFn,
|
|
1504
|
+
swrOptions
|
|
1514
1505
|
);
|
|
1515
|
-
const query = useSWRMutation(swrKey, swrFn, swrOptions);
|
|
1516
1506
|
return {
|
|
1517
1507
|
swrKey,
|
|
1518
1508
|
...query
|
|
1519
1509
|
};
|
|
1520
1510
|
};
|
|
1521
1511
|
export {
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
AuthenticationInformationResponseDataVerificationMethodsPasswordProvider,
|
|
1525
|
-
CreateTotpFactorResponseAuthenticationChallengeAllOfObject,
|
|
1526
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfObject,
|
|
1527
|
-
CreateTotpFactorResponseAuthenticationFactorAllOfType,
|
|
1528
|
-
DataInstallationObject,
|
|
1529
|
-
DataInstallationState,
|
|
1530
|
-
DataIntegrationCredentialsType,
|
|
1531
|
-
DataIntegrationIntegrationType,
|
|
1532
|
-
DataIntegrationObject,
|
|
1533
|
-
DataIntegrationOwnership,
|
|
1512
|
+
DirectoryState,
|
|
1513
|
+
DirectoryType,
|
|
1534
1514
|
DomainVerificationNameServer,
|
|
1535
1515
|
GenerateAdminPortalLinkIntent,
|
|
1536
1516
|
MemberActionsItem,
|
|
@@ -1538,14 +1518,6 @@ export {
|
|
|
1538
1518
|
OidcSessionState,
|
|
1539
1519
|
OrganizationDomainState,
|
|
1540
1520
|
SamlSessionState,
|
|
1541
|
-
SendVerificationResponseType,
|
|
1542
|
-
SettingsResponseObject,
|
|
1543
|
-
SsoConnectionAnyOfEightAllOfProviderTag,
|
|
1544
|
-
SsoConnectionAnyOfEightAllOfState,
|
|
1545
|
-
SsoConnectionAnyOfEightAllOfType,
|
|
1546
|
-
SsoConnectionAnyOfProviderTag,
|
|
1547
|
-
SsoConnectionAnyOfState,
|
|
1548
|
-
SsoConnectionAnyOfType,
|
|
1549
1521
|
SsoConnectionSessionJSONState,
|
|
1550
1522
|
authenticationInformation,
|
|
1551
1523
|
createOrganizationApiKey,
|
|
@@ -1557,6 +1529,7 @@ export {
|
|
|
1557
1529
|
deletePasskey,
|
|
1558
1530
|
deleteTotpFactors,
|
|
1559
1531
|
generateAdminPortalLink,
|
|
1532
|
+
getAuditLogStream,
|
|
1560
1533
|
getAuthenticationInformationKey,
|
|
1561
1534
|
getAuthenticationInformationUrl,
|
|
1562
1535
|
getCreateOrganizationApiKeyMutationFetcher,
|
|
@@ -1585,16 +1558,23 @@ export {
|
|
|
1585
1558
|
getDeleteTotpFactorsMutationFetcher,
|
|
1586
1559
|
getDeleteTotpFactorsMutationKey,
|
|
1587
1560
|
getDeleteTotpFactorsUrl,
|
|
1561
|
+
getDirectory,
|
|
1588
1562
|
getGenerateAdminPortalLinkMutationFetcher,
|
|
1589
1563
|
getGenerateAdminPortalLinkMutationKey,
|
|
1590
1564
|
getGenerateAdminPortalLinkUrl,
|
|
1565
|
+
getGetAuditLogStreamKey,
|
|
1566
|
+
getGetAuditLogStreamUrl,
|
|
1591
1567
|
getGetDataInstallationAuthorizationStatusKey,
|
|
1592
1568
|
getGetDataInstallationAuthorizationStatusUrl,
|
|
1593
1569
|
getGetDataIntegrationAuthorizeUrlKey,
|
|
1594
1570
|
getGetDataIntegrationAuthorizeUrlUrl,
|
|
1571
|
+
getGetDirectoryKey,
|
|
1572
|
+
getGetDirectoryUrl,
|
|
1595
1573
|
getInviteMemberMutationFetcher,
|
|
1596
1574
|
getInviteMemberMutationKey,
|
|
1597
1575
|
getInviteMemberUrl,
|
|
1576
|
+
getListDirectoriesKey,
|
|
1577
|
+
getListDirectoriesUrl,
|
|
1598
1578
|
getListOrganizationApiKeyPermissionsKey,
|
|
1599
1579
|
getListOrganizationApiKeyPermissionsUrl,
|
|
1600
1580
|
getListOrganizationApiKeysKey,
|
|
@@ -1662,6 +1642,7 @@ export {
|
|
|
1662
1642
|
getVerifyTotpFactorUrl,
|
|
1663
1643
|
getVerifyUrl,
|
|
1664
1644
|
inviteMember,
|
|
1645
|
+
listDirectories,
|
|
1665
1646
|
listOrganizationApiKeyPermissions,
|
|
1666
1647
|
listOrganizationApiKeys,
|
|
1667
1648
|
listOrganizationDomains,
|
|
@@ -1695,9 +1676,12 @@ export {
|
|
|
1695
1676
|
useDeletePasskey,
|
|
1696
1677
|
useDeleteTotpFactors,
|
|
1697
1678
|
useGenerateAdminPortalLink,
|
|
1679
|
+
useGetAuditLogStream,
|
|
1698
1680
|
useGetDataInstallationAuthorizationStatus,
|
|
1699
1681
|
useGetDataIntegrationAuthorizeUrl,
|
|
1682
|
+
useGetDirectory,
|
|
1700
1683
|
useInviteMember,
|
|
1684
|
+
useListDirectories,
|
|
1701
1685
|
useListOrganizationApiKeyPermissions,
|
|
1702
1686
|
useListOrganizationApiKeys,
|
|
1703
1687
|
useListOrganizationDomains,
|