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