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