mtmsdk 0.0.7 → 0.0.9
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/dist/gomtmapi/@tanstack/react-query.gen.d.ts +2883 -0
- package/dist/gomtmapi/@tanstack/react-query.gen.d.ts.map +1 -0
- package/dist/gomtmapi/@tanstack/react-query.gen.js +2990 -0
- package/dist/gomtmapi/@tanstack/react-query.gen.js.map +1 -0
- package/dist/gomtmapi/client/client.d.ts +3 -0
- package/dist/gomtmapi/client/client.d.ts.map +1 -0
- package/dist/gomtmapi/client/client.js +146 -0
- package/dist/gomtmapi/client/client.js.map +1 -0
- package/dist/gomtmapi/client/index.d.ts +8 -0
- package/dist/gomtmapi/client/index.d.ts.map +1 -0
- package/dist/gomtmapi/client/index.js +5 -0
- package/dist/gomtmapi/client/index.js.map +1 -0
- package/dist/gomtmapi/client/types.d.ts +120 -0
- package/dist/gomtmapi/client/types.d.ts.map +1 -0
- package/dist/gomtmapi/client/types.js +2 -0
- package/dist/gomtmapi/client/types.js.map +1 -0
- package/dist/gomtmapi/client/utils.d.ts +46 -0
- package/dist/gomtmapi/client/utils.d.ts.map +1 -0
- package/dist/gomtmapi/client/utils.js +285 -0
- package/dist/gomtmapi/client/utils.js.map +1 -0
- package/dist/gomtmapi/client.gen.d.ts +13 -0
- package/dist/gomtmapi/client.gen.d.ts.map +1 -0
- package/dist/gomtmapi/client.gen.js +4 -0
- package/dist/gomtmapi/client.gen.js.map +1 -0
- package/dist/gomtmapi/core/auth.d.ts +19 -0
- package/dist/gomtmapi/core/auth.d.ts.map +1 -0
- package/dist/gomtmapi/core/auth.js +14 -0
- package/dist/gomtmapi/core/auth.js.map +1 -0
- package/dist/gomtmapi/core/bodySerializer.d.ts +18 -0
- package/dist/gomtmapi/core/bodySerializer.d.ts.map +1 -0
- package/dist/gomtmapi/core/bodySerializer.js +54 -0
- package/dist/gomtmapi/core/bodySerializer.js.map +1 -0
- package/dist/gomtmapi/core/params.d.ts +24 -0
- package/dist/gomtmapi/core/params.d.ts.map +1 -0
- package/dist/gomtmapi/core/params.js +88 -0
- package/dist/gomtmapi/core/params.js.map +1 -0
- package/dist/gomtmapi/core/pathSerializer.d.ts +34 -0
- package/dist/gomtmapi/core/pathSerializer.d.ts.map +1 -0
- package/dist/gomtmapi/core/pathSerializer.js +114 -0
- package/dist/gomtmapi/core/pathSerializer.js.map +1 -0
- package/dist/gomtmapi/core/types.d.ts +74 -0
- package/dist/gomtmapi/core/types.d.ts.map +1 -0
- package/dist/gomtmapi/core/types.js +2 -0
- package/dist/gomtmapi/core/types.js.map +1 -0
- package/dist/gomtmapi/index.d.ts +3 -0
- package/dist/gomtmapi/index.d.ts.map +1 -0
- package/dist/gomtmapi/index.js +4 -0
- package/dist/gomtmapi/index.js.map +1 -0
- package/dist/gomtmapi/schemas.gen.d.ts +4385 -0
- package/dist/gomtmapi/schemas.gen.d.ts.map +1 -0
- package/dist/gomtmapi/schemas.gen.js +4521 -0
- package/dist/gomtmapi/schemas.gen.js.map +1 -0
- package/dist/gomtmapi/sdk.gen.d.ts +574 -0
- package/dist/gomtmapi/sdk.gen.d.ts.map +1 -0
- package/dist/gomtmapi/sdk.gen.js +2259 -0
- package/dist/gomtmapi/sdk.gen.js.map +1 -0
- package/dist/gomtmapi/types.gen.d.ts +6480 -0
- package/dist/gomtmapi/types.gen.d.ts.map +1 -0
- package/dist/gomtmapi/types.gen.js +70 -0
- package/dist/gomtmapi/types.gen.js.map +1 -0
- package/dist/gomtmapi/zod.gen.d.ts +5324 -0
- package/dist/gomtmapi/zod.gen.d.ts.map +1 -0
- package/dist/gomtmapi/zod.gen.js +2534 -0
- package/dist/gomtmapi/zod.gen.js.map +1 -0
- package/dist/gomtmapi_v2/@tanstack/react-query.gen.d.ts +2260 -0
- package/dist/gomtmapi_v2/@tanstack/react-query.gen.d.ts.map +1 -0
- package/dist/gomtmapi_v2/@tanstack/react-query.gen.js +2413 -0
- package/dist/gomtmapi_v2/@tanstack/react-query.gen.js.map +1 -0
- package/dist/gomtmapi_v2/client/client.d.ts +3 -0
- package/dist/gomtmapi_v2/client/client.d.ts.map +1 -0
- package/dist/gomtmapi_v2/client/client.js +146 -0
- package/dist/gomtmapi_v2/client/client.js.map +1 -0
- package/dist/gomtmapi_v2/client/index.d.ts +8 -0
- package/dist/gomtmapi_v2/client/index.d.ts.map +1 -0
- package/dist/gomtmapi_v2/client/index.js +5 -0
- package/dist/gomtmapi_v2/client/index.js.map +1 -0
- package/dist/gomtmapi_v2/client/types.d.ts +120 -0
- package/dist/gomtmapi_v2/client/types.d.ts.map +1 -0
- package/dist/gomtmapi_v2/client/types.js +2 -0
- package/dist/gomtmapi_v2/client/types.js.map +1 -0
- package/dist/gomtmapi_v2/client/utils.d.ts +46 -0
- package/dist/gomtmapi_v2/client/utils.d.ts.map +1 -0
- package/dist/gomtmapi_v2/client/utils.js +285 -0
- package/dist/gomtmapi_v2/client/utils.js.map +1 -0
- package/dist/gomtmapi_v2/client.gen.d.ts +13 -0
- package/dist/gomtmapi_v2/client.gen.d.ts.map +1 -0
- package/dist/gomtmapi_v2/client.gen.js +4 -0
- package/dist/gomtmapi_v2/client.gen.js.map +1 -0
- package/dist/gomtmapi_v2/core/auth.d.ts +19 -0
- package/dist/gomtmapi_v2/core/auth.d.ts.map +1 -0
- package/dist/gomtmapi_v2/core/auth.js +14 -0
- package/dist/gomtmapi_v2/core/auth.js.map +1 -0
- package/dist/gomtmapi_v2/core/bodySerializer.d.ts +18 -0
- package/dist/gomtmapi_v2/core/bodySerializer.d.ts.map +1 -0
- package/dist/gomtmapi_v2/core/bodySerializer.js +54 -0
- package/dist/gomtmapi_v2/core/bodySerializer.js.map +1 -0
- package/dist/gomtmapi_v2/core/params.d.ts +24 -0
- package/dist/gomtmapi_v2/core/params.d.ts.map +1 -0
- package/dist/gomtmapi_v2/core/params.js +88 -0
- package/dist/gomtmapi_v2/core/params.js.map +1 -0
- package/dist/gomtmapi_v2/core/pathSerializer.d.ts +34 -0
- package/dist/gomtmapi_v2/core/pathSerializer.d.ts.map +1 -0
- package/dist/gomtmapi_v2/core/pathSerializer.js +114 -0
- package/dist/gomtmapi_v2/core/pathSerializer.js.map +1 -0
- package/dist/gomtmapi_v2/core/types.d.ts +74 -0
- package/dist/gomtmapi_v2/core/types.d.ts.map +1 -0
- package/dist/gomtmapi_v2/core/types.js +2 -0
- package/dist/gomtmapi_v2/core/types.js.map +1 -0
- package/dist/gomtmapi_v2/index.d.ts +3 -0
- package/dist/gomtmapi_v2/index.d.ts.map +1 -0
- package/dist/gomtmapi_v2/index.js +4 -0
- package/dist/gomtmapi_v2/index.js.map +1 -0
- package/dist/gomtmapi_v2/schemas.gen.d.ts +2371 -0
- package/dist/gomtmapi_v2/schemas.gen.d.ts.map +1 -0
- package/dist/gomtmapi_v2/schemas.gen.js +2372 -0
- package/dist/gomtmapi_v2/schemas.gen.js.map +1 -0
- package/dist/gomtmapi_v2/sdk.gen.d.ts +974 -0
- package/dist/gomtmapi_v2/sdk.gen.d.ts.map +1 -0
- package/dist/gomtmapi_v2/sdk.gen.js +1345 -0
- package/dist/gomtmapi_v2/sdk.gen.js.map +1 -0
- package/dist/gomtmapi_v2/types.gen.d.ts +2964 -0
- package/dist/gomtmapi_v2/types.gen.d.ts.map +1 -0
- package/dist/gomtmapi_v2/types.gen.js +3 -0
- package/dist/gomtmapi_v2/types.gen.js.map +1 -0
- package/dist/gomtmapi_v2/zod.gen.d.ts +2327 -0
- package/dist/gomtmapi_v2/zod.gen.d.ts.map +1 -0
- package/dist/gomtmapi_v2/zod.gen.js +1768 -0
- package/dist/gomtmapi_v2/zod.gen.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/adk-utils.d.ts +24 -0
- package/dist/lib/adk-utils.d.ts.map +1 -0
- package/dist/lib/adk-utils.js +51 -0
- package/dist/lib/adk-utils.js.map +1 -0
- package/dist/lib/constants.d.ts +40 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +40 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/d1-utils.d.ts +5 -0
- package/dist/lib/d1-utils.d.ts.map +1 -0
- package/dist/lib/d1-utils.js +36 -0
- package/dist/lib/d1-utils.js.map +1 -0
- package/dist/lib/get-query-client.d.ts +3 -0
- package/dist/lib/get-query-client.d.ts.map +1 -0
- package/dist/lib/get-query-client.js +43 -0
- package/dist/lib/get-query-client.js.map +1 -0
- package/dist/lib/mtmutils.d.ts +2 -0
- package/dist/lib/mtmutils.d.ts.map +1 -0
- package/dist/lib/mtmutils.js +9 -0
- package/dist/lib/mtmutils.js.map +1 -0
- package/dist/mtgate_api/zod.gen.d.ts +48 -48
- package/dist/mtmai_api/@tanstack/react-query.gen.d.ts +1286 -0
- package/dist/mtmai_api/@tanstack/react-query.gen.d.ts.map +1 -0
- package/dist/mtmai_api/@tanstack/react-query.gen.js +1321 -0
- package/dist/mtmai_api/@tanstack/react-query.gen.js.map +1 -0
- package/dist/mtmai_api/client/client.d.ts +3 -0
- package/dist/mtmai_api/client/client.d.ts.map +1 -0
- package/dist/mtmai_api/client/client.js +146 -0
- package/dist/mtmai_api/client/client.js.map +1 -0
- package/dist/mtmai_api/client/index.d.ts +8 -0
- package/dist/mtmai_api/client/index.d.ts.map +1 -0
- package/dist/mtmai_api/client/index.js +5 -0
- package/dist/mtmai_api/client/index.js.map +1 -0
- package/dist/mtmai_api/client/types.d.ts +120 -0
- package/dist/mtmai_api/client/types.d.ts.map +1 -0
- package/dist/mtmai_api/client/types.js +2 -0
- package/dist/mtmai_api/client/types.js.map +1 -0
- package/dist/mtmai_api/client/utils.d.ts +46 -0
- package/dist/mtmai_api/client/utils.d.ts.map +1 -0
- package/dist/mtmai_api/client/utils.js +285 -0
- package/dist/mtmai_api/client/utils.js.map +1 -0
- package/dist/mtmai_api/client.gen.d.ts +13 -0
- package/dist/mtmai_api/client.gen.d.ts.map +1 -0
- package/dist/mtmai_api/client.gen.js +4 -0
- package/dist/mtmai_api/client.gen.js.map +1 -0
- package/dist/mtmai_api/core/auth.d.ts +19 -0
- package/dist/mtmai_api/core/auth.d.ts.map +1 -0
- package/dist/mtmai_api/core/auth.js +14 -0
- package/dist/mtmai_api/core/auth.js.map +1 -0
- package/dist/mtmai_api/core/bodySerializer.d.ts +18 -0
- package/dist/mtmai_api/core/bodySerializer.d.ts.map +1 -0
- package/dist/mtmai_api/core/bodySerializer.js +54 -0
- package/dist/mtmai_api/core/bodySerializer.js.map +1 -0
- package/dist/mtmai_api/core/params.d.ts +24 -0
- package/dist/mtmai_api/core/params.d.ts.map +1 -0
- package/dist/mtmai_api/core/params.js +88 -0
- package/dist/mtmai_api/core/params.js.map +1 -0
- package/dist/mtmai_api/core/pathSerializer.d.ts +34 -0
- package/dist/mtmai_api/core/pathSerializer.d.ts.map +1 -0
- package/dist/mtmai_api/core/pathSerializer.js +114 -0
- package/dist/mtmai_api/core/pathSerializer.js.map +1 -0
- package/dist/mtmai_api/core/types.d.ts +74 -0
- package/dist/mtmai_api/core/types.d.ts.map +1 -0
- package/dist/mtmai_api/core/types.js +2 -0
- package/dist/mtmai_api/core/types.js.map +1 -0
- package/dist/mtmai_api/index.d.ts +3 -0
- package/dist/mtmai_api/index.d.ts.map +1 -0
- package/dist/mtmai_api/index.js +4 -0
- package/dist/mtmai_api/index.js.map +1 -0
- package/dist/mtmai_api/schemas.gen.d.ts +7364 -0
- package/dist/mtmai_api/schemas.gen.d.ts.map +1 -0
- package/dist/mtmai_api/schemas.gen.js +9574 -0
- package/dist/mtmai_api/schemas.gen.js.map +1 -0
- package/dist/mtmai_api/sdk.gen.d.ts +264 -0
- package/dist/mtmai_api/sdk.gen.d.ts.map +1 -0
- package/dist/mtmai_api/sdk.gen.js +598 -0
- package/dist/mtmai_api/sdk.gen.js.map +1 -0
- package/dist/mtmai_api/types.gen.d.ts +6376 -0
- package/dist/mtmai_api/types.gen.d.ts.map +1 -0
- package/dist/mtmai_api/types.gen.js +240 -0
- package/dist/mtmai_api/types.gen.js.map +1 -0
- package/dist/mtmai_api/zod.gen.d.ts +35067 -0
- package/dist/mtmai_api/zod.gen.d.ts.map +1 -0
- package/dist/mtmai_api/zod.gen.js +2930 -0
- package/dist/mtmai_api/zod.gen.js.map +1 -0
- package/dist/store/MtmsdkProvider.d.ts +15 -0
- package/dist/store/MtmsdkProvider.d.ts.map +1 -0
- package/dist/store/MtmsdkProvider.js +50 -0
- package/dist/store/MtmsdkProvider.js.map +1 -0
- package/dist/store/ReactQueryApiV2Provider.d.ts +10 -0
- package/dist/store/ReactQueryApiV2Provider.d.ts.map +1 -0
- package/dist/store/ReactQueryApiV2Provider.js +24 -0
- package/dist/store/ReactQueryApiV2Provider.js.map +1 -0
- package/dist/store/ReactQueryCfApiProvider.d.ts +9 -0
- package/dist/store/ReactQueryCfApiProvider.d.ts.map +1 -0
- package/dist/store/ReactQueryCfApiProvider.js +26 -0
- package/dist/store/ReactQueryCfApiProvider.js.map +1 -0
- package/dist/store/ReactQueryMtmaiApiProvider.d.ts +10 -0
- package/dist/store/ReactQueryMtmaiApiProvider.d.ts.map +1 -0
- package/dist/store/ReactQueryMtmaiApiProvider.js +23 -0
- package/dist/store/ReactQueryMtmaiApiProvider.js.map +1 -0
- package/dist/store/ReactQueryProvider.d.ts +10 -0
- package/dist/store/ReactQueryProvider.d.ts.map +1 -0
- package/dist/store/ReactQueryProvider.js +24 -0
- package/dist/store/ReactQueryProvider.js.map +1 -0
- package/package.json +69 -15
|
@@ -0,0 +1,2990 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { readinessGet, livenessGet, healthGet, metadataGet, metadataListIntegrations, userUpdateLogin, userUpdateGoogleOauthStart, userUpdateGoogleOauthCallback, userUpdateGithubOauthStart, userUpdateGithubOauthCallback, alertEmailGroupList, alertEmailGroupCreate, tenantResourcePolicyGet, alertEmailGroupDelete, alertEmailGroupUpdate, userUpdatePassword, userCreate, userUpdateLogout, tenantMembershipsList, userListTenantInvites, tenantInviteAccept, tenantInviteReject, userGetGithubRepos, adminUsersList, adminUserCreate, adminUserGet, adminUserUpdate, adminUserDelete, adminRolesList, adminUserRoles, adminUserAssignRole, adminUserRemoveRole, userSettingsGet, userSettingsCreate, userSettingsUpdate, userSettingsExport, userSettingsImport, serviceList, serviceGet, serviceStart, serviceStop, serviceGetLogs, serviceGetDiagnostics, serviceGetConfig, serviceUpdateConfig, tenantCreate, tenantUpdate, tenantAlertingSettingsGet, tenantInviteList, tenantInviteCreate, tenantInviteDelete, tenantInviteUpdate, apiTokenList, apiTokenCreate, apiTokenUpdateRevoke, tenantMemberList, tenantMemberDelete, tenantExport, infoGetVersion, infoGet, siteList, siteCreate, siteDelete, siteGet, siteUpdate, siteGetByHost, siteHostList, siteHostCreate, siteHostGet, siteHostUpdate, frontendGetConfig, endpointList, endpointUpdate, mtworkerGetTasks, workflowGetWorkers, workflowStartWorker, workflowStopWorker, workflowGetWorkerStatus, workflowGetAvailableWorkflows, workflowRunWorkflow, toolsRunContainer, postListPublic, postDelete, postGet, postUpdate, postList, postCreate, scriptsByName, singboxGetWorkerProfile, singboxSubscribe, singboxGeoipCnSrs, singboxGetOutbounds, singboxCreateOutbound, singboxDeleteOutbound, singboxGetOutbound, singboxUpdateOutbound, singboxImportOutbounds, browserList, browserCreate, browserExport, browserImport, browserDelete, browserGet, browserUpdate, browserLaunch, browserClose, browserStatus, browserCookies, browserUpdateCookies, browserGetState, browserUpdateState, botList, botGet, botHeartbeat, systemSetup, systemGetLogs, systemGetOAuthConfig, systemUpdateOAuthConfig, systemGetPerformanceMetrics, systemGetSystemSettings, systemUpdateSystemSettings, systemExportSystemSettings, systemImportSystemSettings, } from "../sdk.gen";
|
|
3
|
+
import { queryOptions, infiniteQueryOptions, } from "@tanstack/react-query";
|
|
4
|
+
import { client as _heyApiClient } from "../client.gen";
|
|
5
|
+
const createQueryKey = (id, options, infinite) => {
|
|
6
|
+
const params = {
|
|
7
|
+
_id: id,
|
|
8
|
+
baseUrl: (options?.client ?? _heyApiClient).getConfig().baseUrl,
|
|
9
|
+
};
|
|
10
|
+
if (infinite) {
|
|
11
|
+
params._infinite = infinite;
|
|
12
|
+
}
|
|
13
|
+
if (options?.body) {
|
|
14
|
+
params.body = options.body;
|
|
15
|
+
}
|
|
16
|
+
if (options?.headers) {
|
|
17
|
+
params.headers = options.headers;
|
|
18
|
+
}
|
|
19
|
+
if (options?.path) {
|
|
20
|
+
params.path = options.path;
|
|
21
|
+
}
|
|
22
|
+
if (options?.query) {
|
|
23
|
+
params.query = options.query;
|
|
24
|
+
}
|
|
25
|
+
return [params];
|
|
26
|
+
};
|
|
27
|
+
export const readinessGetQueryKey = (options) => createQueryKey("readinessGet", options);
|
|
28
|
+
/**
|
|
29
|
+
* Get readiness
|
|
30
|
+
* Gets the readiness status
|
|
31
|
+
*/
|
|
32
|
+
export const readinessGetOptions = (options) => {
|
|
33
|
+
return queryOptions({
|
|
34
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
35
|
+
const { data } = await readinessGet({
|
|
36
|
+
...options,
|
|
37
|
+
...queryKey[0],
|
|
38
|
+
signal,
|
|
39
|
+
throwOnError: true,
|
|
40
|
+
});
|
|
41
|
+
return data;
|
|
42
|
+
},
|
|
43
|
+
queryKey: readinessGetQueryKey(options),
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export const livenessGetQueryKey = (options) => createQueryKey("livenessGet", options);
|
|
47
|
+
/**
|
|
48
|
+
* Get liveness
|
|
49
|
+
* Gets the liveness status
|
|
50
|
+
*/
|
|
51
|
+
export const livenessGetOptions = (options) => {
|
|
52
|
+
return queryOptions({
|
|
53
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
54
|
+
const { data } = await livenessGet({
|
|
55
|
+
...options,
|
|
56
|
+
...queryKey[0],
|
|
57
|
+
signal,
|
|
58
|
+
throwOnError: true,
|
|
59
|
+
});
|
|
60
|
+
return data;
|
|
61
|
+
},
|
|
62
|
+
queryKey: livenessGetQueryKey(options),
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export const healthGetQueryKey = (options) => createQueryKey("healthGet", options);
|
|
66
|
+
/**
|
|
67
|
+
* Get health status
|
|
68
|
+
* Gets the health status of the API service
|
|
69
|
+
*/
|
|
70
|
+
export const healthGetOptions = (options) => {
|
|
71
|
+
return queryOptions({
|
|
72
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
73
|
+
const { data } = await healthGet({
|
|
74
|
+
...options,
|
|
75
|
+
...queryKey[0],
|
|
76
|
+
signal,
|
|
77
|
+
throwOnError: true,
|
|
78
|
+
});
|
|
79
|
+
return data;
|
|
80
|
+
},
|
|
81
|
+
queryKey: healthGetQueryKey(options),
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
export const metadataGetQueryKey = (options) => createQueryKey("metadataGet", options);
|
|
85
|
+
/**
|
|
86
|
+
* Get metadata
|
|
87
|
+
* Gets metadata for the Hatchet instance
|
|
88
|
+
*/
|
|
89
|
+
export const metadataGetOptions = (options) => {
|
|
90
|
+
return queryOptions({
|
|
91
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
92
|
+
const { data } = await metadataGet({
|
|
93
|
+
...options,
|
|
94
|
+
...queryKey[0],
|
|
95
|
+
signal,
|
|
96
|
+
throwOnError: true,
|
|
97
|
+
});
|
|
98
|
+
return data;
|
|
99
|
+
},
|
|
100
|
+
queryKey: metadataGetQueryKey(options),
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
export const metadataListIntegrationsQueryKey = (options) => createQueryKey("metadataListIntegrations", options);
|
|
104
|
+
/**
|
|
105
|
+
* List integrations
|
|
106
|
+
* List all integrations
|
|
107
|
+
*/
|
|
108
|
+
export const metadataListIntegrationsOptions = (options) => {
|
|
109
|
+
return queryOptions({
|
|
110
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
111
|
+
const { data } = await metadataListIntegrations({
|
|
112
|
+
...options,
|
|
113
|
+
...queryKey[0],
|
|
114
|
+
signal,
|
|
115
|
+
throwOnError: true,
|
|
116
|
+
});
|
|
117
|
+
return data;
|
|
118
|
+
},
|
|
119
|
+
queryKey: metadataListIntegrationsQueryKey(options),
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
export const userUpdateLoginQueryKey = (options) => createQueryKey("userUpdateLogin", options);
|
|
123
|
+
/**
|
|
124
|
+
* Login user
|
|
125
|
+
* Logs in a user.
|
|
126
|
+
*/
|
|
127
|
+
export const userUpdateLoginOptions = (options) => {
|
|
128
|
+
return queryOptions({
|
|
129
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
130
|
+
const { data } = await userUpdateLogin({
|
|
131
|
+
...options,
|
|
132
|
+
...queryKey[0],
|
|
133
|
+
signal,
|
|
134
|
+
throwOnError: true,
|
|
135
|
+
});
|
|
136
|
+
return data;
|
|
137
|
+
},
|
|
138
|
+
queryKey: userUpdateLoginQueryKey(options),
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Login user
|
|
143
|
+
* Logs in a user.
|
|
144
|
+
*/
|
|
145
|
+
export const userUpdateLoginMutation = (options) => {
|
|
146
|
+
const mutationOptions = {
|
|
147
|
+
mutationFn: async (localOptions) => {
|
|
148
|
+
const { data } = await userUpdateLogin({
|
|
149
|
+
...options,
|
|
150
|
+
...localOptions,
|
|
151
|
+
throwOnError: true,
|
|
152
|
+
});
|
|
153
|
+
return data;
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
return mutationOptions;
|
|
157
|
+
};
|
|
158
|
+
export const userUpdateGoogleOauthStartQueryKey = (options) => createQueryKey("userUpdateGoogleOauthStart", options);
|
|
159
|
+
/**
|
|
160
|
+
* Start OAuth flow
|
|
161
|
+
* Starts the OAuth flow
|
|
162
|
+
*/
|
|
163
|
+
export const userUpdateGoogleOauthStartOptions = (options) => {
|
|
164
|
+
return queryOptions({
|
|
165
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
166
|
+
const { data } = await userUpdateGoogleOauthStart({
|
|
167
|
+
...options,
|
|
168
|
+
...queryKey[0],
|
|
169
|
+
signal,
|
|
170
|
+
throwOnError: true,
|
|
171
|
+
});
|
|
172
|
+
return data;
|
|
173
|
+
},
|
|
174
|
+
queryKey: userUpdateGoogleOauthStartQueryKey(options),
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
export const userUpdateGoogleOauthCallbackQueryKey = (options) => createQueryKey("userUpdateGoogleOauthCallback", options);
|
|
178
|
+
/**
|
|
179
|
+
* Complete OAuth flow
|
|
180
|
+
* Completes the OAuth flow
|
|
181
|
+
*/
|
|
182
|
+
export const userUpdateGoogleOauthCallbackOptions = (options) => {
|
|
183
|
+
return queryOptions({
|
|
184
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
185
|
+
const { data } = await userUpdateGoogleOauthCallback({
|
|
186
|
+
...options,
|
|
187
|
+
...queryKey[0],
|
|
188
|
+
signal,
|
|
189
|
+
throwOnError: true,
|
|
190
|
+
});
|
|
191
|
+
return data;
|
|
192
|
+
},
|
|
193
|
+
queryKey: userUpdateGoogleOauthCallbackQueryKey(options),
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
export const userUpdateGithubOauthStartQueryKey = (options) => createQueryKey("userUpdateGithubOauthStart", options);
|
|
197
|
+
/**
|
|
198
|
+
* Start OAuth flow
|
|
199
|
+
* Starts the OAuth flow
|
|
200
|
+
*/
|
|
201
|
+
export const userUpdateGithubOauthStartOptions = (options) => {
|
|
202
|
+
return queryOptions({
|
|
203
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
204
|
+
const { data } = await userUpdateGithubOauthStart({
|
|
205
|
+
...options,
|
|
206
|
+
...queryKey[0],
|
|
207
|
+
signal,
|
|
208
|
+
throwOnError: true,
|
|
209
|
+
});
|
|
210
|
+
return data;
|
|
211
|
+
},
|
|
212
|
+
queryKey: userUpdateGithubOauthStartQueryKey(options),
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
export const userUpdateGithubOauthCallbackQueryKey = (options) => createQueryKey("userUpdateGithubOauthCallback", options);
|
|
216
|
+
/**
|
|
217
|
+
* Complete OAuth flow
|
|
218
|
+
* Completes the OAuth flow
|
|
219
|
+
*/
|
|
220
|
+
export const userUpdateGithubOauthCallbackOptions = (options) => {
|
|
221
|
+
return queryOptions({
|
|
222
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
223
|
+
const { data } = await userUpdateGithubOauthCallback({
|
|
224
|
+
...options,
|
|
225
|
+
...queryKey[0],
|
|
226
|
+
signal,
|
|
227
|
+
throwOnError: true,
|
|
228
|
+
});
|
|
229
|
+
return data;
|
|
230
|
+
},
|
|
231
|
+
queryKey: userUpdateGithubOauthCallbackQueryKey(options),
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
export const alertEmailGroupListQueryKey = (options) => createQueryKey("alertEmailGroupList", options);
|
|
235
|
+
/**
|
|
236
|
+
* List tenant alert email groups
|
|
237
|
+
* Gets a list of tenant alert email groups
|
|
238
|
+
*/
|
|
239
|
+
export const alertEmailGroupListOptions = (options) => {
|
|
240
|
+
return queryOptions({
|
|
241
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
242
|
+
const { data } = await alertEmailGroupList({
|
|
243
|
+
...options,
|
|
244
|
+
...queryKey[0],
|
|
245
|
+
signal,
|
|
246
|
+
throwOnError: true,
|
|
247
|
+
});
|
|
248
|
+
return data;
|
|
249
|
+
},
|
|
250
|
+
queryKey: alertEmailGroupListQueryKey(options),
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
export const alertEmailGroupCreateQueryKey = (options) => createQueryKey("alertEmailGroupCreate", options);
|
|
254
|
+
/**
|
|
255
|
+
* Create tenant alert email group
|
|
256
|
+
* Creates a new tenant alert email group
|
|
257
|
+
*/
|
|
258
|
+
export const alertEmailGroupCreateOptions = (options) => {
|
|
259
|
+
return queryOptions({
|
|
260
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
261
|
+
const { data } = await alertEmailGroupCreate({
|
|
262
|
+
...options,
|
|
263
|
+
...queryKey[0],
|
|
264
|
+
signal,
|
|
265
|
+
throwOnError: true,
|
|
266
|
+
});
|
|
267
|
+
return data;
|
|
268
|
+
},
|
|
269
|
+
queryKey: alertEmailGroupCreateQueryKey(options),
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Create tenant alert email group
|
|
274
|
+
* Creates a new tenant alert email group
|
|
275
|
+
*/
|
|
276
|
+
export const alertEmailGroupCreateMutation = (options) => {
|
|
277
|
+
const mutationOptions = {
|
|
278
|
+
mutationFn: async (localOptions) => {
|
|
279
|
+
const { data } = await alertEmailGroupCreate({
|
|
280
|
+
...options,
|
|
281
|
+
...localOptions,
|
|
282
|
+
throwOnError: true,
|
|
283
|
+
});
|
|
284
|
+
return data;
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
return mutationOptions;
|
|
288
|
+
};
|
|
289
|
+
export const tenantResourcePolicyGetQueryKey = (options) => createQueryKey("tenantResourcePolicyGet", options);
|
|
290
|
+
/**
|
|
291
|
+
* Create tenant alert email group
|
|
292
|
+
* Gets the resource policy for a tenant
|
|
293
|
+
*/
|
|
294
|
+
export const tenantResourcePolicyGetOptions = (options) => {
|
|
295
|
+
return queryOptions({
|
|
296
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
297
|
+
const { data } = await tenantResourcePolicyGet({
|
|
298
|
+
...options,
|
|
299
|
+
...queryKey[0],
|
|
300
|
+
signal,
|
|
301
|
+
throwOnError: true,
|
|
302
|
+
});
|
|
303
|
+
return data;
|
|
304
|
+
},
|
|
305
|
+
queryKey: tenantResourcePolicyGetQueryKey(options),
|
|
306
|
+
});
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Delete tenant alert email group
|
|
310
|
+
* Deletes a tenant alert email group
|
|
311
|
+
*/
|
|
312
|
+
export const alertEmailGroupDeleteMutation = (options) => {
|
|
313
|
+
const mutationOptions = {
|
|
314
|
+
mutationFn: async (localOptions) => {
|
|
315
|
+
const { data } = await alertEmailGroupDelete({
|
|
316
|
+
...options,
|
|
317
|
+
...localOptions,
|
|
318
|
+
throwOnError: true,
|
|
319
|
+
});
|
|
320
|
+
return data;
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
return mutationOptions;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Update tenant alert email group
|
|
327
|
+
* Updates a tenant alert email group
|
|
328
|
+
*/
|
|
329
|
+
export const alertEmailGroupUpdateMutation = (options) => {
|
|
330
|
+
const mutationOptions = {
|
|
331
|
+
mutationFn: async (localOptions) => {
|
|
332
|
+
const { data } = await alertEmailGroupUpdate({
|
|
333
|
+
...options,
|
|
334
|
+
...localOptions,
|
|
335
|
+
throwOnError: true,
|
|
336
|
+
});
|
|
337
|
+
return data;
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
return mutationOptions;
|
|
341
|
+
};
|
|
342
|
+
export const userUpdatePasswordQueryKey = (options) => createQueryKey("userUpdatePassword", options);
|
|
343
|
+
/**
|
|
344
|
+
* Change user password
|
|
345
|
+
* Update a user password.
|
|
346
|
+
*/
|
|
347
|
+
export const userUpdatePasswordOptions = (options) => {
|
|
348
|
+
return queryOptions({
|
|
349
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
350
|
+
const { data } = await userUpdatePassword({
|
|
351
|
+
...options,
|
|
352
|
+
...queryKey[0],
|
|
353
|
+
signal,
|
|
354
|
+
throwOnError: true,
|
|
355
|
+
});
|
|
356
|
+
return data;
|
|
357
|
+
},
|
|
358
|
+
queryKey: userUpdatePasswordQueryKey(options),
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* Change user password
|
|
363
|
+
* Update a user password.
|
|
364
|
+
*/
|
|
365
|
+
export const userUpdatePasswordMutation = (options) => {
|
|
366
|
+
const mutationOptions = {
|
|
367
|
+
mutationFn: async (localOptions) => {
|
|
368
|
+
const { data } = await userUpdatePassword({
|
|
369
|
+
...options,
|
|
370
|
+
...localOptions,
|
|
371
|
+
throwOnError: true,
|
|
372
|
+
});
|
|
373
|
+
return data;
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
return mutationOptions;
|
|
377
|
+
};
|
|
378
|
+
export const userCreateQueryKey = (options) => createQueryKey("userCreate", options);
|
|
379
|
+
/**
|
|
380
|
+
* Register user
|
|
381
|
+
* Registers a user.
|
|
382
|
+
*/
|
|
383
|
+
export const userCreateOptions = (options) => {
|
|
384
|
+
return queryOptions({
|
|
385
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
386
|
+
const { data } = await userCreate({
|
|
387
|
+
...options,
|
|
388
|
+
...queryKey[0],
|
|
389
|
+
signal,
|
|
390
|
+
throwOnError: true,
|
|
391
|
+
});
|
|
392
|
+
return data;
|
|
393
|
+
},
|
|
394
|
+
queryKey: userCreateQueryKey(options),
|
|
395
|
+
});
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* Register user
|
|
399
|
+
* Registers a user.
|
|
400
|
+
*/
|
|
401
|
+
export const userCreateMutation = (options) => {
|
|
402
|
+
const mutationOptions = {
|
|
403
|
+
mutationFn: async (localOptions) => {
|
|
404
|
+
const { data } = await userCreate({
|
|
405
|
+
...options,
|
|
406
|
+
...localOptions,
|
|
407
|
+
throwOnError: true,
|
|
408
|
+
});
|
|
409
|
+
return data;
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
return mutationOptions;
|
|
413
|
+
};
|
|
414
|
+
export const userUpdateLogoutQueryKey = (options) => createQueryKey("userUpdateLogout", options);
|
|
415
|
+
/**
|
|
416
|
+
* Logout user
|
|
417
|
+
* Logs out a user.
|
|
418
|
+
*/
|
|
419
|
+
export const userUpdateLogoutOptions = (options) => {
|
|
420
|
+
return queryOptions({
|
|
421
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
422
|
+
const { data } = await userUpdateLogout({
|
|
423
|
+
...options,
|
|
424
|
+
...queryKey[0],
|
|
425
|
+
signal,
|
|
426
|
+
throwOnError: true,
|
|
427
|
+
});
|
|
428
|
+
return data;
|
|
429
|
+
},
|
|
430
|
+
queryKey: userUpdateLogoutQueryKey(options),
|
|
431
|
+
});
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* Logout user
|
|
435
|
+
* Logs out a user.
|
|
436
|
+
*/
|
|
437
|
+
export const userUpdateLogoutMutation = (options) => {
|
|
438
|
+
const mutationOptions = {
|
|
439
|
+
mutationFn: async (localOptions) => {
|
|
440
|
+
const { data } = await userUpdateLogout({
|
|
441
|
+
...options,
|
|
442
|
+
...localOptions,
|
|
443
|
+
throwOnError: true,
|
|
444
|
+
});
|
|
445
|
+
return data;
|
|
446
|
+
},
|
|
447
|
+
};
|
|
448
|
+
return mutationOptions;
|
|
449
|
+
};
|
|
450
|
+
export const tenantMembershipsListQueryKey = (options) => createQueryKey("tenantMembershipsList", options);
|
|
451
|
+
/**
|
|
452
|
+
* List tenant memberships
|
|
453
|
+
* Lists all tenant memberships for the current user
|
|
454
|
+
*/
|
|
455
|
+
export const tenantMembershipsListOptions = (options) => {
|
|
456
|
+
return queryOptions({
|
|
457
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
458
|
+
const { data } = await tenantMembershipsList({
|
|
459
|
+
...options,
|
|
460
|
+
...queryKey[0],
|
|
461
|
+
signal,
|
|
462
|
+
throwOnError: true,
|
|
463
|
+
});
|
|
464
|
+
return data;
|
|
465
|
+
},
|
|
466
|
+
queryKey: tenantMembershipsListQueryKey(options),
|
|
467
|
+
});
|
|
468
|
+
};
|
|
469
|
+
export const userListTenantInvitesQueryKey = (options) => createQueryKey("userListTenantInvites", options);
|
|
470
|
+
/**
|
|
471
|
+
* List tenant invites
|
|
472
|
+
* Lists all tenant invites for the current user
|
|
473
|
+
*/
|
|
474
|
+
export const userListTenantInvitesOptions = (options) => {
|
|
475
|
+
return queryOptions({
|
|
476
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
477
|
+
const { data } = await userListTenantInvites({
|
|
478
|
+
...options,
|
|
479
|
+
...queryKey[0],
|
|
480
|
+
signal,
|
|
481
|
+
throwOnError: true,
|
|
482
|
+
});
|
|
483
|
+
return data;
|
|
484
|
+
},
|
|
485
|
+
queryKey: userListTenantInvitesQueryKey(options),
|
|
486
|
+
});
|
|
487
|
+
};
|
|
488
|
+
export const tenantInviteAcceptQueryKey = (options) => createQueryKey("tenantInviteAccept", options);
|
|
489
|
+
/**
|
|
490
|
+
* Accept tenant invite
|
|
491
|
+
* Accepts a tenant invite
|
|
492
|
+
*/
|
|
493
|
+
export const tenantInviteAcceptOptions = (options) => {
|
|
494
|
+
return queryOptions({
|
|
495
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
496
|
+
const { data } = await tenantInviteAccept({
|
|
497
|
+
...options,
|
|
498
|
+
...queryKey[0],
|
|
499
|
+
signal,
|
|
500
|
+
throwOnError: true,
|
|
501
|
+
});
|
|
502
|
+
return data;
|
|
503
|
+
},
|
|
504
|
+
queryKey: tenantInviteAcceptQueryKey(options),
|
|
505
|
+
});
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* Accept tenant invite
|
|
509
|
+
* Accepts a tenant invite
|
|
510
|
+
*/
|
|
511
|
+
export const tenantInviteAcceptMutation = (options) => {
|
|
512
|
+
const mutationOptions = {
|
|
513
|
+
mutationFn: async (localOptions) => {
|
|
514
|
+
const { data } = await tenantInviteAccept({
|
|
515
|
+
...options,
|
|
516
|
+
...localOptions,
|
|
517
|
+
throwOnError: true,
|
|
518
|
+
});
|
|
519
|
+
return data;
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
return mutationOptions;
|
|
523
|
+
};
|
|
524
|
+
export const tenantInviteRejectQueryKey = (options) => createQueryKey("tenantInviteReject", options);
|
|
525
|
+
/**
|
|
526
|
+
* Reject tenant invite
|
|
527
|
+
* Rejects a tenant invite
|
|
528
|
+
*/
|
|
529
|
+
export const tenantInviteRejectOptions = (options) => {
|
|
530
|
+
return queryOptions({
|
|
531
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
532
|
+
const { data } = await tenantInviteReject({
|
|
533
|
+
...options,
|
|
534
|
+
...queryKey[0],
|
|
535
|
+
signal,
|
|
536
|
+
throwOnError: true,
|
|
537
|
+
});
|
|
538
|
+
return data;
|
|
539
|
+
},
|
|
540
|
+
queryKey: tenantInviteRejectQueryKey(options),
|
|
541
|
+
});
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* Reject tenant invite
|
|
545
|
+
* Rejects a tenant invite
|
|
546
|
+
*/
|
|
547
|
+
export const tenantInviteRejectMutation = (options) => {
|
|
548
|
+
const mutationOptions = {
|
|
549
|
+
mutationFn: async (localOptions) => {
|
|
550
|
+
const { data } = await tenantInviteReject({
|
|
551
|
+
...options,
|
|
552
|
+
...localOptions,
|
|
553
|
+
throwOnError: true,
|
|
554
|
+
});
|
|
555
|
+
return data;
|
|
556
|
+
},
|
|
557
|
+
};
|
|
558
|
+
return mutationOptions;
|
|
559
|
+
};
|
|
560
|
+
export const userGetGithubReposQueryKey = (options) => createQueryKey("userGetGithubRepos", options);
|
|
561
|
+
/**
|
|
562
|
+
* Get user's GitHub repositories
|
|
563
|
+
* Gets the current user's GitHub repositories
|
|
564
|
+
*/
|
|
565
|
+
export const userGetGithubReposOptions = (options) => {
|
|
566
|
+
return queryOptions({
|
|
567
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
568
|
+
const { data } = await userGetGithubRepos({
|
|
569
|
+
...options,
|
|
570
|
+
...queryKey[0],
|
|
571
|
+
signal,
|
|
572
|
+
throwOnError: true,
|
|
573
|
+
});
|
|
574
|
+
return data;
|
|
575
|
+
},
|
|
576
|
+
queryKey: userGetGithubReposQueryKey(options),
|
|
577
|
+
});
|
|
578
|
+
};
|
|
579
|
+
export const adminUsersListQueryKey = (options) => createQueryKey("adminUsersList", options);
|
|
580
|
+
/**
|
|
581
|
+
* List all users (admin only)
|
|
582
|
+
* Lists all users in the system (admin only)
|
|
583
|
+
*/
|
|
584
|
+
export const adminUsersListOptions = (options) => {
|
|
585
|
+
return queryOptions({
|
|
586
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
587
|
+
const { data } = await adminUsersList({
|
|
588
|
+
...options,
|
|
589
|
+
...queryKey[0],
|
|
590
|
+
signal,
|
|
591
|
+
throwOnError: true,
|
|
592
|
+
});
|
|
593
|
+
return data;
|
|
594
|
+
},
|
|
595
|
+
queryKey: adminUsersListQueryKey(options),
|
|
596
|
+
});
|
|
597
|
+
};
|
|
598
|
+
const createInfiniteParams = (queryKey, page) => {
|
|
599
|
+
const params = {
|
|
600
|
+
...queryKey[0],
|
|
601
|
+
};
|
|
602
|
+
if (page.body) {
|
|
603
|
+
params.body = {
|
|
604
|
+
...queryKey[0].body,
|
|
605
|
+
...page.body,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
if (page.headers) {
|
|
609
|
+
params.headers = {
|
|
610
|
+
...queryKey[0].headers,
|
|
611
|
+
...page.headers,
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
if (page.path) {
|
|
615
|
+
params.path = {
|
|
616
|
+
...queryKey[0].path,
|
|
617
|
+
...page.path,
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
if (page.query) {
|
|
621
|
+
params.query = {
|
|
622
|
+
...queryKey[0].query,
|
|
623
|
+
...page.query,
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
return params;
|
|
627
|
+
};
|
|
628
|
+
export const adminUsersListInfiniteQueryKey = (options) => createQueryKey("adminUsersList", options, true);
|
|
629
|
+
/**
|
|
630
|
+
* List all users (admin only)
|
|
631
|
+
* Lists all users in the system (admin only)
|
|
632
|
+
*/
|
|
633
|
+
export const adminUsersListInfiniteOptions = (options) => {
|
|
634
|
+
return infiniteQueryOptions(
|
|
635
|
+
// @ts-ignore
|
|
636
|
+
{
|
|
637
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
638
|
+
// @ts-ignore
|
|
639
|
+
const page = typeof pageParam === "object"
|
|
640
|
+
? pageParam
|
|
641
|
+
: {
|
|
642
|
+
query: {
|
|
643
|
+
offset: pageParam,
|
|
644
|
+
},
|
|
645
|
+
};
|
|
646
|
+
const params = createInfiniteParams(queryKey, page);
|
|
647
|
+
const { data } = await adminUsersList({
|
|
648
|
+
...options,
|
|
649
|
+
...params,
|
|
650
|
+
signal,
|
|
651
|
+
throwOnError: true,
|
|
652
|
+
});
|
|
653
|
+
return data;
|
|
654
|
+
},
|
|
655
|
+
queryKey: adminUsersListInfiniteQueryKey(options),
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
export const adminUserCreateQueryKey = (options) => createQueryKey("adminUserCreate", options);
|
|
659
|
+
/**
|
|
660
|
+
* Create new user (admin only)
|
|
661
|
+
* Creates a new user (admin only)
|
|
662
|
+
*/
|
|
663
|
+
export const adminUserCreateOptions = (options) => {
|
|
664
|
+
return queryOptions({
|
|
665
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
666
|
+
const { data } = await adminUserCreate({
|
|
667
|
+
...options,
|
|
668
|
+
...queryKey[0],
|
|
669
|
+
signal,
|
|
670
|
+
throwOnError: true,
|
|
671
|
+
});
|
|
672
|
+
return data;
|
|
673
|
+
},
|
|
674
|
+
queryKey: adminUserCreateQueryKey(options),
|
|
675
|
+
});
|
|
676
|
+
};
|
|
677
|
+
/**
|
|
678
|
+
* Create new user (admin only)
|
|
679
|
+
* Creates a new user (admin only)
|
|
680
|
+
*/
|
|
681
|
+
export const adminUserCreateMutation = (options) => {
|
|
682
|
+
const mutationOptions = {
|
|
683
|
+
mutationFn: async (localOptions) => {
|
|
684
|
+
const { data } = await adminUserCreate({
|
|
685
|
+
...options,
|
|
686
|
+
...localOptions,
|
|
687
|
+
throwOnError: true,
|
|
688
|
+
});
|
|
689
|
+
return data;
|
|
690
|
+
},
|
|
691
|
+
};
|
|
692
|
+
return mutationOptions;
|
|
693
|
+
};
|
|
694
|
+
export const adminUserGetQueryKey = (options) => createQueryKey("adminUserGet", options);
|
|
695
|
+
/**
|
|
696
|
+
* Get user by ID (admin only)
|
|
697
|
+
* Gets a specific user by ID (admin only)
|
|
698
|
+
*/
|
|
699
|
+
export const adminUserGetOptions = (options) => {
|
|
700
|
+
return queryOptions({
|
|
701
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
702
|
+
const { data } = await adminUserGet({
|
|
703
|
+
...options,
|
|
704
|
+
...queryKey[0],
|
|
705
|
+
signal,
|
|
706
|
+
throwOnError: true,
|
|
707
|
+
});
|
|
708
|
+
return data;
|
|
709
|
+
},
|
|
710
|
+
queryKey: adminUserGetQueryKey(options),
|
|
711
|
+
});
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* Update user (admin only)
|
|
715
|
+
* Updates a user (admin only)
|
|
716
|
+
*/
|
|
717
|
+
export const adminUserUpdateMutation = (options) => {
|
|
718
|
+
const mutationOptions = {
|
|
719
|
+
mutationFn: async (localOptions) => {
|
|
720
|
+
const { data } = await adminUserUpdate({
|
|
721
|
+
...options,
|
|
722
|
+
...localOptions,
|
|
723
|
+
throwOnError: true,
|
|
724
|
+
});
|
|
725
|
+
return data;
|
|
726
|
+
},
|
|
727
|
+
};
|
|
728
|
+
return mutationOptions;
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* Delete user (admin only)
|
|
732
|
+
* Deletes a user (admin only)
|
|
733
|
+
*/
|
|
734
|
+
export const adminUserDeleteMutation = (options) => {
|
|
735
|
+
const mutationOptions = {
|
|
736
|
+
mutationFn: async (localOptions) => {
|
|
737
|
+
const { data } = await adminUserDelete({
|
|
738
|
+
...options,
|
|
739
|
+
...localOptions,
|
|
740
|
+
throwOnError: true,
|
|
741
|
+
});
|
|
742
|
+
return data;
|
|
743
|
+
},
|
|
744
|
+
};
|
|
745
|
+
return mutationOptions;
|
|
746
|
+
};
|
|
747
|
+
export const adminRolesListQueryKey = (options) => createQueryKey("adminRolesList", options);
|
|
748
|
+
/**
|
|
749
|
+
* List all roles (admin only)
|
|
750
|
+
* Lists all system roles (admin only)
|
|
751
|
+
*/
|
|
752
|
+
export const adminRolesListOptions = (options) => {
|
|
753
|
+
return queryOptions({
|
|
754
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
755
|
+
const { data } = await adminRolesList({
|
|
756
|
+
...options,
|
|
757
|
+
...queryKey[0],
|
|
758
|
+
signal,
|
|
759
|
+
throwOnError: true,
|
|
760
|
+
});
|
|
761
|
+
return data;
|
|
762
|
+
},
|
|
763
|
+
queryKey: adminRolesListQueryKey(options),
|
|
764
|
+
});
|
|
765
|
+
};
|
|
766
|
+
export const adminUserRolesQueryKey = (options) => createQueryKey("adminUserRoles", options);
|
|
767
|
+
/**
|
|
768
|
+
* List roles of a user (admin only)
|
|
769
|
+
* Lists all roles of a specific user (admin only)
|
|
770
|
+
*/
|
|
771
|
+
export const adminUserRolesOptions = (options) => {
|
|
772
|
+
return queryOptions({
|
|
773
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
774
|
+
const { data } = await adminUserRoles({
|
|
775
|
+
...options,
|
|
776
|
+
...queryKey[0],
|
|
777
|
+
signal,
|
|
778
|
+
throwOnError: true,
|
|
779
|
+
});
|
|
780
|
+
return data;
|
|
781
|
+
},
|
|
782
|
+
queryKey: adminUserRolesQueryKey(options),
|
|
783
|
+
});
|
|
784
|
+
};
|
|
785
|
+
export const adminUserAssignRoleQueryKey = (options) => createQueryKey("adminUserAssignRole", options);
|
|
786
|
+
/**
|
|
787
|
+
* Assign role to user (admin only)
|
|
788
|
+
* Assigns a role to a user (admin only)
|
|
789
|
+
*/
|
|
790
|
+
export const adminUserAssignRoleOptions = (options) => {
|
|
791
|
+
return queryOptions({
|
|
792
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
793
|
+
const { data } = await adminUserAssignRole({
|
|
794
|
+
...options,
|
|
795
|
+
...queryKey[0],
|
|
796
|
+
signal,
|
|
797
|
+
throwOnError: true,
|
|
798
|
+
});
|
|
799
|
+
return data;
|
|
800
|
+
},
|
|
801
|
+
queryKey: adminUserAssignRoleQueryKey(options),
|
|
802
|
+
});
|
|
803
|
+
};
|
|
804
|
+
/**
|
|
805
|
+
* Assign role to user (admin only)
|
|
806
|
+
* Assigns a role to a user (admin only)
|
|
807
|
+
*/
|
|
808
|
+
export const adminUserAssignRoleMutation = (options) => {
|
|
809
|
+
const mutationOptions = {
|
|
810
|
+
mutationFn: async (localOptions) => {
|
|
811
|
+
const { data } = await adminUserAssignRole({
|
|
812
|
+
...options,
|
|
813
|
+
...localOptions,
|
|
814
|
+
throwOnError: true,
|
|
815
|
+
});
|
|
816
|
+
return data;
|
|
817
|
+
},
|
|
818
|
+
};
|
|
819
|
+
return mutationOptions;
|
|
820
|
+
};
|
|
821
|
+
/**
|
|
822
|
+
* Remove role from user (admin only)
|
|
823
|
+
* Removes a role from a user (admin only)
|
|
824
|
+
*/
|
|
825
|
+
export const adminUserRemoveRoleMutation = (options) => {
|
|
826
|
+
const mutationOptions = {
|
|
827
|
+
mutationFn: async (localOptions) => {
|
|
828
|
+
const { data } = await adminUserRemoveRole({
|
|
829
|
+
...options,
|
|
830
|
+
...localOptions,
|
|
831
|
+
throwOnError: true,
|
|
832
|
+
});
|
|
833
|
+
return data;
|
|
834
|
+
},
|
|
835
|
+
};
|
|
836
|
+
return mutationOptions;
|
|
837
|
+
};
|
|
838
|
+
export const userSettingsGetQueryKey = (options) => createQueryKey("userSettingsGet", options);
|
|
839
|
+
/**
|
|
840
|
+
* Get user settings for the current user and tenant
|
|
841
|
+
*/
|
|
842
|
+
export const userSettingsGetOptions = (options) => {
|
|
843
|
+
return queryOptions({
|
|
844
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
845
|
+
const { data } = await userSettingsGet({
|
|
846
|
+
...options,
|
|
847
|
+
...queryKey[0],
|
|
848
|
+
signal,
|
|
849
|
+
throwOnError: true,
|
|
850
|
+
});
|
|
851
|
+
return data;
|
|
852
|
+
},
|
|
853
|
+
queryKey: userSettingsGetQueryKey(options),
|
|
854
|
+
});
|
|
855
|
+
};
|
|
856
|
+
export const userSettingsCreateQueryKey = (options) => createQueryKey("userSettingsCreate", options);
|
|
857
|
+
/**
|
|
858
|
+
* Create user settings for the current user and tenant
|
|
859
|
+
*/
|
|
860
|
+
export const userSettingsCreateOptions = (options) => {
|
|
861
|
+
return queryOptions({
|
|
862
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
863
|
+
const { data } = await userSettingsCreate({
|
|
864
|
+
...options,
|
|
865
|
+
...queryKey[0],
|
|
866
|
+
signal,
|
|
867
|
+
throwOnError: true,
|
|
868
|
+
});
|
|
869
|
+
return data;
|
|
870
|
+
},
|
|
871
|
+
queryKey: userSettingsCreateQueryKey(options),
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
/**
|
|
875
|
+
* Create user settings for the current user and tenant
|
|
876
|
+
*/
|
|
877
|
+
export const userSettingsCreateMutation = (options) => {
|
|
878
|
+
const mutationOptions = {
|
|
879
|
+
mutationFn: async (localOptions) => {
|
|
880
|
+
const { data } = await userSettingsCreate({
|
|
881
|
+
...options,
|
|
882
|
+
...localOptions,
|
|
883
|
+
throwOnError: true,
|
|
884
|
+
});
|
|
885
|
+
return data;
|
|
886
|
+
},
|
|
887
|
+
};
|
|
888
|
+
return mutationOptions;
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* Update user settings for the current user and tenant
|
|
892
|
+
*/
|
|
893
|
+
export const userSettingsUpdateMutation = (options) => {
|
|
894
|
+
const mutationOptions = {
|
|
895
|
+
mutationFn: async (localOptions) => {
|
|
896
|
+
const { data } = await userSettingsUpdate({
|
|
897
|
+
...options,
|
|
898
|
+
...localOptions,
|
|
899
|
+
throwOnError: true,
|
|
900
|
+
});
|
|
901
|
+
return data;
|
|
902
|
+
},
|
|
903
|
+
};
|
|
904
|
+
return mutationOptions;
|
|
905
|
+
};
|
|
906
|
+
export const userSettingsExportQueryKey = (options) => createQueryKey("userSettingsExport", options);
|
|
907
|
+
/**
|
|
908
|
+
* Export user settings as YAML for the current user and tenant
|
|
909
|
+
*/
|
|
910
|
+
export const userSettingsExportOptions = (options) => {
|
|
911
|
+
return queryOptions({
|
|
912
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
913
|
+
const { data } = await userSettingsExport({
|
|
914
|
+
...options,
|
|
915
|
+
...queryKey[0],
|
|
916
|
+
signal,
|
|
917
|
+
throwOnError: true,
|
|
918
|
+
});
|
|
919
|
+
return data;
|
|
920
|
+
},
|
|
921
|
+
queryKey: userSettingsExportQueryKey(options),
|
|
922
|
+
});
|
|
923
|
+
};
|
|
924
|
+
export const userSettingsImportQueryKey = (options) => createQueryKey("userSettingsImport", options);
|
|
925
|
+
/**
|
|
926
|
+
* Import user settings from YAML for the current user and tenant
|
|
927
|
+
*/
|
|
928
|
+
export const userSettingsImportOptions = (options) => {
|
|
929
|
+
return queryOptions({
|
|
930
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
931
|
+
const { data } = await userSettingsImport({
|
|
932
|
+
...options,
|
|
933
|
+
...queryKey[0],
|
|
934
|
+
signal,
|
|
935
|
+
throwOnError: true,
|
|
936
|
+
});
|
|
937
|
+
return data;
|
|
938
|
+
},
|
|
939
|
+
queryKey: userSettingsImportQueryKey(options),
|
|
940
|
+
});
|
|
941
|
+
};
|
|
942
|
+
/**
|
|
943
|
+
* Import user settings from YAML for the current user and tenant
|
|
944
|
+
*/
|
|
945
|
+
export const userSettingsImportMutation = (options) => {
|
|
946
|
+
const mutationOptions = {
|
|
947
|
+
mutationFn: async (localOptions) => {
|
|
948
|
+
const { data } = await userSettingsImport({
|
|
949
|
+
...options,
|
|
950
|
+
...localOptions,
|
|
951
|
+
throwOnError: true,
|
|
952
|
+
});
|
|
953
|
+
return data;
|
|
954
|
+
},
|
|
955
|
+
};
|
|
956
|
+
return mutationOptions;
|
|
957
|
+
};
|
|
958
|
+
export const serviceListQueryKey = (options) => createQueryKey("serviceList", options);
|
|
959
|
+
/**
|
|
960
|
+
* Get list of all services and their status
|
|
961
|
+
*/
|
|
962
|
+
export const serviceListOptions = (options) => {
|
|
963
|
+
return queryOptions({
|
|
964
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
965
|
+
const { data } = await serviceList({
|
|
966
|
+
...options,
|
|
967
|
+
...queryKey[0],
|
|
968
|
+
signal,
|
|
969
|
+
throwOnError: true,
|
|
970
|
+
});
|
|
971
|
+
return data;
|
|
972
|
+
},
|
|
973
|
+
queryKey: serviceListQueryKey(options),
|
|
974
|
+
});
|
|
975
|
+
};
|
|
976
|
+
export const serviceGetQueryKey = (options) => createQueryKey("serviceGet", options);
|
|
977
|
+
/**
|
|
978
|
+
* Get specific service status
|
|
979
|
+
*/
|
|
980
|
+
export const serviceGetOptions = (options) => {
|
|
981
|
+
return queryOptions({
|
|
982
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
983
|
+
const { data } = await serviceGet({
|
|
984
|
+
...options,
|
|
985
|
+
...queryKey[0],
|
|
986
|
+
signal,
|
|
987
|
+
throwOnError: true,
|
|
988
|
+
});
|
|
989
|
+
return data;
|
|
990
|
+
},
|
|
991
|
+
queryKey: serviceGetQueryKey(options),
|
|
992
|
+
});
|
|
993
|
+
};
|
|
994
|
+
export const serviceStartQueryKey = (options) => createQueryKey("serviceStart", options);
|
|
995
|
+
/**
|
|
996
|
+
* Start a service
|
|
997
|
+
*/
|
|
998
|
+
export const serviceStartOptions = (options) => {
|
|
999
|
+
return queryOptions({
|
|
1000
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1001
|
+
const { data } = await serviceStart({
|
|
1002
|
+
...options,
|
|
1003
|
+
...queryKey[0],
|
|
1004
|
+
signal,
|
|
1005
|
+
throwOnError: true,
|
|
1006
|
+
});
|
|
1007
|
+
return data;
|
|
1008
|
+
},
|
|
1009
|
+
queryKey: serviceStartQueryKey(options),
|
|
1010
|
+
});
|
|
1011
|
+
};
|
|
1012
|
+
/**
|
|
1013
|
+
* Start a service
|
|
1014
|
+
*/
|
|
1015
|
+
export const serviceStartMutation = (options) => {
|
|
1016
|
+
const mutationOptions = {
|
|
1017
|
+
mutationFn: async (localOptions) => {
|
|
1018
|
+
const { data } = await serviceStart({
|
|
1019
|
+
...options,
|
|
1020
|
+
...localOptions,
|
|
1021
|
+
throwOnError: true,
|
|
1022
|
+
});
|
|
1023
|
+
return data;
|
|
1024
|
+
},
|
|
1025
|
+
};
|
|
1026
|
+
return mutationOptions;
|
|
1027
|
+
};
|
|
1028
|
+
export const serviceStopQueryKey = (options) => createQueryKey("serviceStop", options);
|
|
1029
|
+
/**
|
|
1030
|
+
* Stop a service
|
|
1031
|
+
*/
|
|
1032
|
+
export const serviceStopOptions = (options) => {
|
|
1033
|
+
return queryOptions({
|
|
1034
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1035
|
+
const { data } = await serviceStop({
|
|
1036
|
+
...options,
|
|
1037
|
+
...queryKey[0],
|
|
1038
|
+
signal,
|
|
1039
|
+
throwOnError: true,
|
|
1040
|
+
});
|
|
1041
|
+
return data;
|
|
1042
|
+
},
|
|
1043
|
+
queryKey: serviceStopQueryKey(options),
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
/**
|
|
1047
|
+
* Stop a service
|
|
1048
|
+
*/
|
|
1049
|
+
export const serviceStopMutation = (options) => {
|
|
1050
|
+
const mutationOptions = {
|
|
1051
|
+
mutationFn: async (localOptions) => {
|
|
1052
|
+
const { data } = await serviceStop({
|
|
1053
|
+
...options,
|
|
1054
|
+
...localOptions,
|
|
1055
|
+
throwOnError: true,
|
|
1056
|
+
});
|
|
1057
|
+
return data;
|
|
1058
|
+
},
|
|
1059
|
+
};
|
|
1060
|
+
return mutationOptions;
|
|
1061
|
+
};
|
|
1062
|
+
export const serviceGetLogsQueryKey = (options) => createQueryKey("serviceGetLogs", options);
|
|
1063
|
+
/**
|
|
1064
|
+
* Get service logs
|
|
1065
|
+
*/
|
|
1066
|
+
export const serviceGetLogsOptions = (options) => {
|
|
1067
|
+
return queryOptions({
|
|
1068
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1069
|
+
const { data } = await serviceGetLogs({
|
|
1070
|
+
...options,
|
|
1071
|
+
...queryKey[0],
|
|
1072
|
+
signal,
|
|
1073
|
+
throwOnError: true,
|
|
1074
|
+
});
|
|
1075
|
+
return data;
|
|
1076
|
+
},
|
|
1077
|
+
queryKey: serviceGetLogsQueryKey(options),
|
|
1078
|
+
});
|
|
1079
|
+
};
|
|
1080
|
+
export const serviceGetDiagnosticsQueryKey = (options) => createQueryKey("serviceGetDiagnostics", options);
|
|
1081
|
+
/**
|
|
1082
|
+
* Get service diagnostics information
|
|
1083
|
+
*/
|
|
1084
|
+
export const serviceGetDiagnosticsOptions = (options) => {
|
|
1085
|
+
return queryOptions({
|
|
1086
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1087
|
+
const { data } = await serviceGetDiagnostics({
|
|
1088
|
+
...options,
|
|
1089
|
+
...queryKey[0],
|
|
1090
|
+
signal,
|
|
1091
|
+
throwOnError: true,
|
|
1092
|
+
});
|
|
1093
|
+
return data;
|
|
1094
|
+
},
|
|
1095
|
+
queryKey: serviceGetDiagnosticsQueryKey(options),
|
|
1096
|
+
});
|
|
1097
|
+
};
|
|
1098
|
+
export const serviceGetConfigQueryKey = (options) => createQueryKey("serviceGetConfig", options);
|
|
1099
|
+
/**
|
|
1100
|
+
* Get service configuration
|
|
1101
|
+
*/
|
|
1102
|
+
export const serviceGetConfigOptions = (options) => {
|
|
1103
|
+
return queryOptions({
|
|
1104
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1105
|
+
const { data } = await serviceGetConfig({
|
|
1106
|
+
...options,
|
|
1107
|
+
...queryKey[0],
|
|
1108
|
+
signal,
|
|
1109
|
+
throwOnError: true,
|
|
1110
|
+
});
|
|
1111
|
+
return data;
|
|
1112
|
+
},
|
|
1113
|
+
queryKey: serviceGetConfigQueryKey(options),
|
|
1114
|
+
});
|
|
1115
|
+
};
|
|
1116
|
+
/**
|
|
1117
|
+
* Update service configuration
|
|
1118
|
+
*/
|
|
1119
|
+
export const serviceUpdateConfigMutation = (options) => {
|
|
1120
|
+
const mutationOptions = {
|
|
1121
|
+
mutationFn: async (localOptions) => {
|
|
1122
|
+
const { data } = await serviceUpdateConfig({
|
|
1123
|
+
...options,
|
|
1124
|
+
...localOptions,
|
|
1125
|
+
throwOnError: true,
|
|
1126
|
+
});
|
|
1127
|
+
return data;
|
|
1128
|
+
},
|
|
1129
|
+
};
|
|
1130
|
+
return mutationOptions;
|
|
1131
|
+
};
|
|
1132
|
+
export const tenantCreateQueryKey = (options) => createQueryKey("tenantCreate", options);
|
|
1133
|
+
/**
|
|
1134
|
+
* Create tenant
|
|
1135
|
+
* Creates a new tenant
|
|
1136
|
+
*/
|
|
1137
|
+
export const tenantCreateOptions = (options) => {
|
|
1138
|
+
return queryOptions({
|
|
1139
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1140
|
+
const { data } = await tenantCreate({
|
|
1141
|
+
...options,
|
|
1142
|
+
...queryKey[0],
|
|
1143
|
+
signal,
|
|
1144
|
+
throwOnError: true,
|
|
1145
|
+
});
|
|
1146
|
+
return data;
|
|
1147
|
+
},
|
|
1148
|
+
queryKey: tenantCreateQueryKey(options),
|
|
1149
|
+
});
|
|
1150
|
+
};
|
|
1151
|
+
/**
|
|
1152
|
+
* Create tenant
|
|
1153
|
+
* Creates a new tenant
|
|
1154
|
+
*/
|
|
1155
|
+
export const tenantCreateMutation = (options) => {
|
|
1156
|
+
const mutationOptions = {
|
|
1157
|
+
mutationFn: async (localOptions) => {
|
|
1158
|
+
const { data } = await tenantCreate({
|
|
1159
|
+
...options,
|
|
1160
|
+
...localOptions,
|
|
1161
|
+
throwOnError: true,
|
|
1162
|
+
});
|
|
1163
|
+
return data;
|
|
1164
|
+
},
|
|
1165
|
+
};
|
|
1166
|
+
return mutationOptions;
|
|
1167
|
+
};
|
|
1168
|
+
/**
|
|
1169
|
+
* Update tenant
|
|
1170
|
+
* Update an existing tenant
|
|
1171
|
+
*/
|
|
1172
|
+
export const tenantUpdateMutation = (options) => {
|
|
1173
|
+
const mutationOptions = {
|
|
1174
|
+
mutationFn: async (localOptions) => {
|
|
1175
|
+
const { data } = await tenantUpdate({
|
|
1176
|
+
...options,
|
|
1177
|
+
...localOptions,
|
|
1178
|
+
throwOnError: true,
|
|
1179
|
+
});
|
|
1180
|
+
return data;
|
|
1181
|
+
},
|
|
1182
|
+
};
|
|
1183
|
+
return mutationOptions;
|
|
1184
|
+
};
|
|
1185
|
+
export const tenantAlertingSettingsGetQueryKey = (options) => createQueryKey("tenantAlertingSettingsGet", options);
|
|
1186
|
+
/**
|
|
1187
|
+
* Get tenant alerting settings
|
|
1188
|
+
* Gets the alerting settings for a tenant
|
|
1189
|
+
*/
|
|
1190
|
+
export const tenantAlertingSettingsGetOptions = (options) => {
|
|
1191
|
+
return queryOptions({
|
|
1192
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1193
|
+
const { data } = await tenantAlertingSettingsGet({
|
|
1194
|
+
...options,
|
|
1195
|
+
...queryKey[0],
|
|
1196
|
+
signal,
|
|
1197
|
+
throwOnError: true,
|
|
1198
|
+
});
|
|
1199
|
+
return data;
|
|
1200
|
+
},
|
|
1201
|
+
queryKey: tenantAlertingSettingsGetQueryKey(options),
|
|
1202
|
+
});
|
|
1203
|
+
};
|
|
1204
|
+
export const tenantInviteListQueryKey = (options) => createQueryKey("tenantInviteList", options);
|
|
1205
|
+
/**
|
|
1206
|
+
* List tenant invites
|
|
1207
|
+
* Gets a list of tenant invites
|
|
1208
|
+
*/
|
|
1209
|
+
export const tenantInviteListOptions = (options) => {
|
|
1210
|
+
return queryOptions({
|
|
1211
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1212
|
+
const { data } = await tenantInviteList({
|
|
1213
|
+
...options,
|
|
1214
|
+
...queryKey[0],
|
|
1215
|
+
signal,
|
|
1216
|
+
throwOnError: true,
|
|
1217
|
+
});
|
|
1218
|
+
return data;
|
|
1219
|
+
},
|
|
1220
|
+
queryKey: tenantInviteListQueryKey(options),
|
|
1221
|
+
});
|
|
1222
|
+
};
|
|
1223
|
+
export const tenantInviteCreateQueryKey = (options) => createQueryKey("tenantInviteCreate", options);
|
|
1224
|
+
/**
|
|
1225
|
+
* Create tenant invite
|
|
1226
|
+
* Creates a new tenant invite
|
|
1227
|
+
*/
|
|
1228
|
+
export const tenantInviteCreateOptions = (options) => {
|
|
1229
|
+
return queryOptions({
|
|
1230
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1231
|
+
const { data } = await tenantInviteCreate({
|
|
1232
|
+
...options,
|
|
1233
|
+
...queryKey[0],
|
|
1234
|
+
signal,
|
|
1235
|
+
throwOnError: true,
|
|
1236
|
+
});
|
|
1237
|
+
return data;
|
|
1238
|
+
},
|
|
1239
|
+
queryKey: tenantInviteCreateQueryKey(options),
|
|
1240
|
+
});
|
|
1241
|
+
};
|
|
1242
|
+
/**
|
|
1243
|
+
* Create tenant invite
|
|
1244
|
+
* Creates a new tenant invite
|
|
1245
|
+
*/
|
|
1246
|
+
export const tenantInviteCreateMutation = (options) => {
|
|
1247
|
+
const mutationOptions = {
|
|
1248
|
+
mutationFn: async (localOptions) => {
|
|
1249
|
+
const { data } = await tenantInviteCreate({
|
|
1250
|
+
...options,
|
|
1251
|
+
...localOptions,
|
|
1252
|
+
throwOnError: true,
|
|
1253
|
+
});
|
|
1254
|
+
return data;
|
|
1255
|
+
},
|
|
1256
|
+
};
|
|
1257
|
+
return mutationOptions;
|
|
1258
|
+
};
|
|
1259
|
+
/**
|
|
1260
|
+
* Delete invite
|
|
1261
|
+
* Deletes a tenant invite
|
|
1262
|
+
*/
|
|
1263
|
+
export const tenantInviteDeleteMutation = (options) => {
|
|
1264
|
+
const mutationOptions = {
|
|
1265
|
+
mutationFn: async (localOptions) => {
|
|
1266
|
+
const { data } = await tenantInviteDelete({
|
|
1267
|
+
...options,
|
|
1268
|
+
...localOptions,
|
|
1269
|
+
throwOnError: true,
|
|
1270
|
+
});
|
|
1271
|
+
return data;
|
|
1272
|
+
},
|
|
1273
|
+
};
|
|
1274
|
+
return mutationOptions;
|
|
1275
|
+
};
|
|
1276
|
+
/**
|
|
1277
|
+
* Update invite
|
|
1278
|
+
* Updates a tenant invite
|
|
1279
|
+
*/
|
|
1280
|
+
export const tenantInviteUpdateMutation = (options) => {
|
|
1281
|
+
const mutationOptions = {
|
|
1282
|
+
mutationFn: async (localOptions) => {
|
|
1283
|
+
const { data } = await tenantInviteUpdate({
|
|
1284
|
+
...options,
|
|
1285
|
+
...localOptions,
|
|
1286
|
+
throwOnError: true,
|
|
1287
|
+
});
|
|
1288
|
+
return data;
|
|
1289
|
+
},
|
|
1290
|
+
};
|
|
1291
|
+
return mutationOptions;
|
|
1292
|
+
};
|
|
1293
|
+
export const apiTokenListQueryKey = (options) => createQueryKey("apiTokenList", options);
|
|
1294
|
+
/**
|
|
1295
|
+
* List API Tokens
|
|
1296
|
+
* List API tokens for a tenant
|
|
1297
|
+
*/
|
|
1298
|
+
export const apiTokenListOptions = (options) => {
|
|
1299
|
+
return queryOptions({
|
|
1300
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1301
|
+
const { data } = await apiTokenList({
|
|
1302
|
+
...options,
|
|
1303
|
+
...queryKey[0],
|
|
1304
|
+
signal,
|
|
1305
|
+
throwOnError: true,
|
|
1306
|
+
});
|
|
1307
|
+
return data;
|
|
1308
|
+
},
|
|
1309
|
+
queryKey: apiTokenListQueryKey(options),
|
|
1310
|
+
});
|
|
1311
|
+
};
|
|
1312
|
+
export const apiTokenCreateQueryKey = (options) => createQueryKey("apiTokenCreate", options);
|
|
1313
|
+
/**
|
|
1314
|
+
* Create API Token
|
|
1315
|
+
* Create an API token for a tenant
|
|
1316
|
+
*/
|
|
1317
|
+
export const apiTokenCreateOptions = (options) => {
|
|
1318
|
+
return queryOptions({
|
|
1319
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1320
|
+
const { data } = await apiTokenCreate({
|
|
1321
|
+
...options,
|
|
1322
|
+
...queryKey[0],
|
|
1323
|
+
signal,
|
|
1324
|
+
throwOnError: true,
|
|
1325
|
+
});
|
|
1326
|
+
return data;
|
|
1327
|
+
},
|
|
1328
|
+
queryKey: apiTokenCreateQueryKey(options),
|
|
1329
|
+
});
|
|
1330
|
+
};
|
|
1331
|
+
/**
|
|
1332
|
+
* Create API Token
|
|
1333
|
+
* Create an API token for a tenant
|
|
1334
|
+
*/
|
|
1335
|
+
export const apiTokenCreateMutation = (options) => {
|
|
1336
|
+
const mutationOptions = {
|
|
1337
|
+
mutationFn: async (localOptions) => {
|
|
1338
|
+
const { data } = await apiTokenCreate({
|
|
1339
|
+
...options,
|
|
1340
|
+
...localOptions,
|
|
1341
|
+
throwOnError: true,
|
|
1342
|
+
});
|
|
1343
|
+
return data;
|
|
1344
|
+
},
|
|
1345
|
+
};
|
|
1346
|
+
return mutationOptions;
|
|
1347
|
+
};
|
|
1348
|
+
export const apiTokenUpdateRevokeQueryKey = (options) => createQueryKey("apiTokenUpdateRevoke", options);
|
|
1349
|
+
/**
|
|
1350
|
+
* Revoke API Token
|
|
1351
|
+
* Revoke an API token for a tenant
|
|
1352
|
+
*/
|
|
1353
|
+
export const apiTokenUpdateRevokeOptions = (options) => {
|
|
1354
|
+
return queryOptions({
|
|
1355
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1356
|
+
const { data } = await apiTokenUpdateRevoke({
|
|
1357
|
+
...options,
|
|
1358
|
+
...queryKey[0],
|
|
1359
|
+
signal,
|
|
1360
|
+
throwOnError: true,
|
|
1361
|
+
});
|
|
1362
|
+
return data;
|
|
1363
|
+
},
|
|
1364
|
+
queryKey: apiTokenUpdateRevokeQueryKey(options),
|
|
1365
|
+
});
|
|
1366
|
+
};
|
|
1367
|
+
/**
|
|
1368
|
+
* Revoke API Token
|
|
1369
|
+
* Revoke an API token for a tenant
|
|
1370
|
+
*/
|
|
1371
|
+
export const apiTokenUpdateRevokeMutation = (options) => {
|
|
1372
|
+
const mutationOptions = {
|
|
1373
|
+
mutationFn: async (localOptions) => {
|
|
1374
|
+
const { data } = await apiTokenUpdateRevoke({
|
|
1375
|
+
...options,
|
|
1376
|
+
...localOptions,
|
|
1377
|
+
throwOnError: true,
|
|
1378
|
+
});
|
|
1379
|
+
return data;
|
|
1380
|
+
},
|
|
1381
|
+
};
|
|
1382
|
+
return mutationOptions;
|
|
1383
|
+
};
|
|
1384
|
+
export const tenantMemberListQueryKey = (options) => createQueryKey("tenantMemberList", options);
|
|
1385
|
+
/**
|
|
1386
|
+
* List tenant members
|
|
1387
|
+
* Gets a list of tenant members
|
|
1388
|
+
*/
|
|
1389
|
+
export const tenantMemberListOptions = (options) => {
|
|
1390
|
+
return queryOptions({
|
|
1391
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1392
|
+
const { data } = await tenantMemberList({
|
|
1393
|
+
...options,
|
|
1394
|
+
...queryKey[0],
|
|
1395
|
+
signal,
|
|
1396
|
+
throwOnError: true,
|
|
1397
|
+
});
|
|
1398
|
+
return data;
|
|
1399
|
+
},
|
|
1400
|
+
queryKey: tenantMemberListQueryKey(options),
|
|
1401
|
+
});
|
|
1402
|
+
};
|
|
1403
|
+
/**
|
|
1404
|
+
* Delete a tenant member
|
|
1405
|
+
* Delete a member from a tenant
|
|
1406
|
+
*/
|
|
1407
|
+
export const tenantMemberDeleteMutation = (options) => {
|
|
1408
|
+
const mutationOptions = {
|
|
1409
|
+
mutationFn: async (localOptions) => {
|
|
1410
|
+
const { data } = await tenantMemberDelete({
|
|
1411
|
+
...options,
|
|
1412
|
+
...localOptions,
|
|
1413
|
+
throwOnError: true,
|
|
1414
|
+
});
|
|
1415
|
+
return data;
|
|
1416
|
+
},
|
|
1417
|
+
};
|
|
1418
|
+
return mutationOptions;
|
|
1419
|
+
};
|
|
1420
|
+
export const tenantExportQueryKey = (options) => createQueryKey("tenantExport", options);
|
|
1421
|
+
/**
|
|
1422
|
+
* Export tenant information
|
|
1423
|
+
* Export tenant information including basic info and members
|
|
1424
|
+
*/
|
|
1425
|
+
export const tenantExportOptions = (options) => {
|
|
1426
|
+
return queryOptions({
|
|
1427
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1428
|
+
const { data } = await tenantExport({
|
|
1429
|
+
...options,
|
|
1430
|
+
...queryKey[0],
|
|
1431
|
+
signal,
|
|
1432
|
+
throwOnError: true,
|
|
1433
|
+
});
|
|
1434
|
+
return data;
|
|
1435
|
+
},
|
|
1436
|
+
queryKey: tenantExportQueryKey(options),
|
|
1437
|
+
});
|
|
1438
|
+
};
|
|
1439
|
+
export const infoGetVersionQueryKey = (options) => createQueryKey("infoGetVersion", options);
|
|
1440
|
+
/**
|
|
1441
|
+
* We return the version for the currently running server
|
|
1442
|
+
* Get the version of the server
|
|
1443
|
+
*/
|
|
1444
|
+
export const infoGetVersionOptions = (options) => {
|
|
1445
|
+
return queryOptions({
|
|
1446
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1447
|
+
const { data } = await infoGetVersion({
|
|
1448
|
+
...options,
|
|
1449
|
+
...queryKey[0],
|
|
1450
|
+
signal,
|
|
1451
|
+
throwOnError: true,
|
|
1452
|
+
});
|
|
1453
|
+
return data;
|
|
1454
|
+
},
|
|
1455
|
+
queryKey: infoGetVersionQueryKey(options),
|
|
1456
|
+
});
|
|
1457
|
+
};
|
|
1458
|
+
export const infoGetQueryKey = (options) => createQueryKey("infoGet", options);
|
|
1459
|
+
/**
|
|
1460
|
+
* Returns public server information including frontend configuration
|
|
1461
|
+
* Get public server information
|
|
1462
|
+
*/
|
|
1463
|
+
export const infoGetOptions = (options) => {
|
|
1464
|
+
return queryOptions({
|
|
1465
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1466
|
+
const { data } = await infoGet({
|
|
1467
|
+
...options,
|
|
1468
|
+
...queryKey[0],
|
|
1469
|
+
signal,
|
|
1470
|
+
throwOnError: true,
|
|
1471
|
+
});
|
|
1472
|
+
return data;
|
|
1473
|
+
},
|
|
1474
|
+
queryKey: infoGetQueryKey(options),
|
|
1475
|
+
});
|
|
1476
|
+
};
|
|
1477
|
+
export const siteListQueryKey = (options) => createQueryKey("siteList", options);
|
|
1478
|
+
/**
|
|
1479
|
+
* Get the sites for the tenant
|
|
1480
|
+
*/
|
|
1481
|
+
export const siteListOptions = (options) => {
|
|
1482
|
+
return queryOptions({
|
|
1483
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1484
|
+
const { data } = await siteList({
|
|
1485
|
+
...options,
|
|
1486
|
+
...queryKey[0],
|
|
1487
|
+
signal,
|
|
1488
|
+
throwOnError: true,
|
|
1489
|
+
});
|
|
1490
|
+
return data;
|
|
1491
|
+
},
|
|
1492
|
+
queryKey: siteListQueryKey(options),
|
|
1493
|
+
});
|
|
1494
|
+
};
|
|
1495
|
+
export const siteCreateQueryKey = (options) => createQueryKey("siteCreate", options);
|
|
1496
|
+
/**
|
|
1497
|
+
* create site
|
|
1498
|
+
*/
|
|
1499
|
+
export const siteCreateOptions = (options) => {
|
|
1500
|
+
return queryOptions({
|
|
1501
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1502
|
+
const { data } = await siteCreate({
|
|
1503
|
+
...options,
|
|
1504
|
+
...queryKey[0],
|
|
1505
|
+
signal,
|
|
1506
|
+
throwOnError: true,
|
|
1507
|
+
});
|
|
1508
|
+
return data;
|
|
1509
|
+
},
|
|
1510
|
+
queryKey: siteCreateQueryKey(options),
|
|
1511
|
+
});
|
|
1512
|
+
};
|
|
1513
|
+
/**
|
|
1514
|
+
* create site
|
|
1515
|
+
*/
|
|
1516
|
+
export const siteCreateMutation = (options) => {
|
|
1517
|
+
const mutationOptions = {
|
|
1518
|
+
mutationFn: async (localOptions) => {
|
|
1519
|
+
const { data } = await siteCreate({
|
|
1520
|
+
...options,
|
|
1521
|
+
...localOptions,
|
|
1522
|
+
throwOnError: true,
|
|
1523
|
+
});
|
|
1524
|
+
return data;
|
|
1525
|
+
},
|
|
1526
|
+
};
|
|
1527
|
+
return mutationOptions;
|
|
1528
|
+
};
|
|
1529
|
+
/**
|
|
1530
|
+
* Delete site
|
|
1531
|
+
* Delete a site
|
|
1532
|
+
*/
|
|
1533
|
+
export const siteDeleteMutation = (options) => {
|
|
1534
|
+
const mutationOptions = {
|
|
1535
|
+
mutationFn: async (localOptions) => {
|
|
1536
|
+
const { data } = await siteDelete({
|
|
1537
|
+
...options,
|
|
1538
|
+
...localOptions,
|
|
1539
|
+
throwOnError: true,
|
|
1540
|
+
});
|
|
1541
|
+
return data;
|
|
1542
|
+
},
|
|
1543
|
+
};
|
|
1544
|
+
return mutationOptions;
|
|
1545
|
+
};
|
|
1546
|
+
export const siteGetQueryKey = (options) => createQueryKey("siteGet", options);
|
|
1547
|
+
/**
|
|
1548
|
+
* Get the site for the tenant
|
|
1549
|
+
*/
|
|
1550
|
+
export const siteGetOptions = (options) => {
|
|
1551
|
+
return queryOptions({
|
|
1552
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1553
|
+
const { data } = await siteGet({
|
|
1554
|
+
...options,
|
|
1555
|
+
...queryKey[0],
|
|
1556
|
+
signal,
|
|
1557
|
+
throwOnError: true,
|
|
1558
|
+
});
|
|
1559
|
+
return data;
|
|
1560
|
+
},
|
|
1561
|
+
queryKey: siteGetQueryKey(options),
|
|
1562
|
+
});
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
* Update site
|
|
1566
|
+
* Update an existing site
|
|
1567
|
+
*/
|
|
1568
|
+
export const siteUpdateMutation = (options) => {
|
|
1569
|
+
const mutationOptions = {
|
|
1570
|
+
mutationFn: async (localOptions) => {
|
|
1571
|
+
const { data } = await siteUpdate({
|
|
1572
|
+
...options,
|
|
1573
|
+
...localOptions,
|
|
1574
|
+
throwOnError: true,
|
|
1575
|
+
});
|
|
1576
|
+
return data;
|
|
1577
|
+
},
|
|
1578
|
+
};
|
|
1579
|
+
return mutationOptions;
|
|
1580
|
+
};
|
|
1581
|
+
export const siteGetByHostQueryKey = (options) => createQueryKey("siteGetByHost", options);
|
|
1582
|
+
/**
|
|
1583
|
+
* 前端根据域名获取site公开数据
|
|
1584
|
+
*/
|
|
1585
|
+
export const siteGetByHostOptions = (options) => {
|
|
1586
|
+
return queryOptions({
|
|
1587
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1588
|
+
const { data } = await siteGetByHost({
|
|
1589
|
+
...options,
|
|
1590
|
+
...queryKey[0],
|
|
1591
|
+
signal,
|
|
1592
|
+
throwOnError: true,
|
|
1593
|
+
});
|
|
1594
|
+
return data;
|
|
1595
|
+
},
|
|
1596
|
+
queryKey: siteGetByHostQueryKey(options),
|
|
1597
|
+
});
|
|
1598
|
+
};
|
|
1599
|
+
export const siteHostListQueryKey = (options) => createQueryKey("siteHostList", options);
|
|
1600
|
+
/**
|
|
1601
|
+
* Get the site-hosts for the tenant
|
|
1602
|
+
*/
|
|
1603
|
+
export const siteHostListOptions = (options) => {
|
|
1604
|
+
return queryOptions({
|
|
1605
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1606
|
+
const { data } = await siteHostList({
|
|
1607
|
+
...options,
|
|
1608
|
+
...queryKey[0],
|
|
1609
|
+
signal,
|
|
1610
|
+
throwOnError: true,
|
|
1611
|
+
});
|
|
1612
|
+
return data;
|
|
1613
|
+
},
|
|
1614
|
+
queryKey: siteHostListQueryKey(options),
|
|
1615
|
+
});
|
|
1616
|
+
};
|
|
1617
|
+
export const siteHostListInfiniteQueryKey = (options) => createQueryKey("siteHostList", options, true);
|
|
1618
|
+
/**
|
|
1619
|
+
* Get the site-hosts for the tenant
|
|
1620
|
+
*/
|
|
1621
|
+
export const siteHostListInfiniteOptions = (options) => {
|
|
1622
|
+
return infiniteQueryOptions(
|
|
1623
|
+
// @ts-ignore
|
|
1624
|
+
{
|
|
1625
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1626
|
+
// @ts-ignore
|
|
1627
|
+
const page = typeof pageParam === "object"
|
|
1628
|
+
? pageParam
|
|
1629
|
+
: {
|
|
1630
|
+
query: {
|
|
1631
|
+
offset: pageParam,
|
|
1632
|
+
},
|
|
1633
|
+
};
|
|
1634
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1635
|
+
const { data } = await siteHostList({
|
|
1636
|
+
...options,
|
|
1637
|
+
...params,
|
|
1638
|
+
signal,
|
|
1639
|
+
throwOnError: true,
|
|
1640
|
+
});
|
|
1641
|
+
return data;
|
|
1642
|
+
},
|
|
1643
|
+
queryKey: siteHostListInfiniteQueryKey(options),
|
|
1644
|
+
});
|
|
1645
|
+
};
|
|
1646
|
+
export const siteHostCreateQueryKey = (options) => createQueryKey("siteHostCreate", options);
|
|
1647
|
+
/**
|
|
1648
|
+
* create site-host
|
|
1649
|
+
*/
|
|
1650
|
+
export const siteHostCreateOptions = (options) => {
|
|
1651
|
+
return queryOptions({
|
|
1652
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1653
|
+
const { data } = await siteHostCreate({
|
|
1654
|
+
...options,
|
|
1655
|
+
...queryKey[0],
|
|
1656
|
+
signal,
|
|
1657
|
+
throwOnError: true,
|
|
1658
|
+
});
|
|
1659
|
+
return data;
|
|
1660
|
+
},
|
|
1661
|
+
queryKey: siteHostCreateQueryKey(options),
|
|
1662
|
+
});
|
|
1663
|
+
};
|
|
1664
|
+
/**
|
|
1665
|
+
* create site-host
|
|
1666
|
+
*/
|
|
1667
|
+
export const siteHostCreateMutation = (options) => {
|
|
1668
|
+
const mutationOptions = {
|
|
1669
|
+
mutationFn: async (localOptions) => {
|
|
1670
|
+
const { data } = await siteHostCreate({
|
|
1671
|
+
...options,
|
|
1672
|
+
...localOptions,
|
|
1673
|
+
throwOnError: true,
|
|
1674
|
+
});
|
|
1675
|
+
return data;
|
|
1676
|
+
},
|
|
1677
|
+
};
|
|
1678
|
+
return mutationOptions;
|
|
1679
|
+
};
|
|
1680
|
+
export const siteHostGetQueryKey = (options) => createQueryKey("siteHostGet", options);
|
|
1681
|
+
/**
|
|
1682
|
+
* Get the site-host for the tenant
|
|
1683
|
+
*/
|
|
1684
|
+
export const siteHostGetOptions = (options) => {
|
|
1685
|
+
return queryOptions({
|
|
1686
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1687
|
+
const { data } = await siteHostGet({
|
|
1688
|
+
...options,
|
|
1689
|
+
...queryKey[0],
|
|
1690
|
+
signal,
|
|
1691
|
+
throwOnError: true,
|
|
1692
|
+
});
|
|
1693
|
+
return data;
|
|
1694
|
+
},
|
|
1695
|
+
queryKey: siteHostGetQueryKey(options),
|
|
1696
|
+
});
|
|
1697
|
+
};
|
|
1698
|
+
/**
|
|
1699
|
+
* Update tenant
|
|
1700
|
+
* Update an existing site-host
|
|
1701
|
+
*/
|
|
1702
|
+
export const siteHostUpdateMutation = (options) => {
|
|
1703
|
+
const mutationOptions = {
|
|
1704
|
+
mutationFn: async (localOptions) => {
|
|
1705
|
+
const { data } = await siteHostUpdate({
|
|
1706
|
+
...options,
|
|
1707
|
+
...localOptions,
|
|
1708
|
+
throwOnError: true,
|
|
1709
|
+
});
|
|
1710
|
+
return data;
|
|
1711
|
+
},
|
|
1712
|
+
};
|
|
1713
|
+
return mutationOptions;
|
|
1714
|
+
};
|
|
1715
|
+
export const frontendGetConfigQueryKey = (options) => createQueryKey("frontendGetConfig", options);
|
|
1716
|
+
export const frontendGetConfigOptions = (options) => {
|
|
1717
|
+
return queryOptions({
|
|
1718
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1719
|
+
const { data } = await frontendGetConfig({
|
|
1720
|
+
...options,
|
|
1721
|
+
...queryKey[0],
|
|
1722
|
+
signal,
|
|
1723
|
+
throwOnError: true,
|
|
1724
|
+
});
|
|
1725
|
+
return data;
|
|
1726
|
+
},
|
|
1727
|
+
queryKey: frontendGetConfigQueryKey(options),
|
|
1728
|
+
});
|
|
1729
|
+
};
|
|
1730
|
+
export const endpointListQueryKey = (options) => createQueryKey("endpointList", options);
|
|
1731
|
+
export const endpointListOptions = (options) => {
|
|
1732
|
+
return queryOptions({
|
|
1733
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1734
|
+
const { data } = await endpointList({
|
|
1735
|
+
...options,
|
|
1736
|
+
...queryKey[0],
|
|
1737
|
+
signal,
|
|
1738
|
+
throwOnError: true,
|
|
1739
|
+
});
|
|
1740
|
+
return data;
|
|
1741
|
+
},
|
|
1742
|
+
queryKey: endpointListQueryKey(options),
|
|
1743
|
+
});
|
|
1744
|
+
};
|
|
1745
|
+
/**
|
|
1746
|
+
* Update endpoint
|
|
1747
|
+
* Update an endpoint
|
|
1748
|
+
*/
|
|
1749
|
+
export const endpointUpdateMutation = (options) => {
|
|
1750
|
+
const mutationOptions = {
|
|
1751
|
+
mutationFn: async (localOptions) => {
|
|
1752
|
+
const { data } = await endpointUpdate({
|
|
1753
|
+
...options,
|
|
1754
|
+
...localOptions,
|
|
1755
|
+
throwOnError: true,
|
|
1756
|
+
});
|
|
1757
|
+
return data;
|
|
1758
|
+
},
|
|
1759
|
+
};
|
|
1760
|
+
return mutationOptions;
|
|
1761
|
+
};
|
|
1762
|
+
export const mtworkerGetTasksQueryKey = (options) => createQueryKey("mtworkerGetTasks", options);
|
|
1763
|
+
/**
|
|
1764
|
+
* 获取mtworker任务
|
|
1765
|
+
* 获取mtworker任务
|
|
1766
|
+
*/
|
|
1767
|
+
export const mtworkerGetTasksOptions = (options) => {
|
|
1768
|
+
return queryOptions({
|
|
1769
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1770
|
+
const { data } = await mtworkerGetTasks({
|
|
1771
|
+
...options,
|
|
1772
|
+
...queryKey[0],
|
|
1773
|
+
signal,
|
|
1774
|
+
throwOnError: true,
|
|
1775
|
+
});
|
|
1776
|
+
return data;
|
|
1777
|
+
},
|
|
1778
|
+
queryKey: mtworkerGetTasksQueryKey(options),
|
|
1779
|
+
});
|
|
1780
|
+
};
|
|
1781
|
+
export const workflowGetWorkersQueryKey = (options) => createQueryKey("workflowGetWorkers", options);
|
|
1782
|
+
/**
|
|
1783
|
+
* 获取工作流Worker列表
|
|
1784
|
+
* 获取当前运行的工作流Worker列表
|
|
1785
|
+
*/
|
|
1786
|
+
export const workflowGetWorkersOptions = (options) => {
|
|
1787
|
+
return queryOptions({
|
|
1788
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1789
|
+
const { data } = await workflowGetWorkers({
|
|
1790
|
+
...options,
|
|
1791
|
+
...queryKey[0],
|
|
1792
|
+
signal,
|
|
1793
|
+
throwOnError: true,
|
|
1794
|
+
});
|
|
1795
|
+
return data;
|
|
1796
|
+
},
|
|
1797
|
+
queryKey: workflowGetWorkersQueryKey(options),
|
|
1798
|
+
});
|
|
1799
|
+
};
|
|
1800
|
+
export const workflowStartWorkerQueryKey = (options) => createQueryKey("workflowStartWorker", options);
|
|
1801
|
+
/**
|
|
1802
|
+
* 启动工作流Worker
|
|
1803
|
+
* 启动一个新的工作流Worker实例
|
|
1804
|
+
*/
|
|
1805
|
+
export const workflowStartWorkerOptions = (options) => {
|
|
1806
|
+
return queryOptions({
|
|
1807
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1808
|
+
const { data } = await workflowStartWorker({
|
|
1809
|
+
...options,
|
|
1810
|
+
...queryKey[0],
|
|
1811
|
+
signal,
|
|
1812
|
+
throwOnError: true,
|
|
1813
|
+
});
|
|
1814
|
+
return data;
|
|
1815
|
+
},
|
|
1816
|
+
queryKey: workflowStartWorkerQueryKey(options),
|
|
1817
|
+
});
|
|
1818
|
+
};
|
|
1819
|
+
/**
|
|
1820
|
+
* 启动工作流Worker
|
|
1821
|
+
* 启动一个新的工作流Worker实例
|
|
1822
|
+
*/
|
|
1823
|
+
export const workflowStartWorkerMutation = (options) => {
|
|
1824
|
+
const mutationOptions = {
|
|
1825
|
+
mutationFn: async (localOptions) => {
|
|
1826
|
+
const { data } = await workflowStartWorker({
|
|
1827
|
+
...options,
|
|
1828
|
+
...localOptions,
|
|
1829
|
+
throwOnError: true,
|
|
1830
|
+
});
|
|
1831
|
+
return data;
|
|
1832
|
+
},
|
|
1833
|
+
};
|
|
1834
|
+
return mutationOptions;
|
|
1835
|
+
};
|
|
1836
|
+
export const workflowStopWorkerQueryKey = (options) => createQueryKey("workflowStopWorker", options);
|
|
1837
|
+
/**
|
|
1838
|
+
* 停止工作流Worker
|
|
1839
|
+
* 停止指定的工作流Worker实例
|
|
1840
|
+
*/
|
|
1841
|
+
export const workflowStopWorkerOptions = (options) => {
|
|
1842
|
+
return queryOptions({
|
|
1843
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1844
|
+
const { data } = await workflowStopWorker({
|
|
1845
|
+
...options,
|
|
1846
|
+
...queryKey[0],
|
|
1847
|
+
signal,
|
|
1848
|
+
throwOnError: true,
|
|
1849
|
+
});
|
|
1850
|
+
return data;
|
|
1851
|
+
},
|
|
1852
|
+
queryKey: workflowStopWorkerQueryKey(options),
|
|
1853
|
+
});
|
|
1854
|
+
};
|
|
1855
|
+
/**
|
|
1856
|
+
* 停止工作流Worker
|
|
1857
|
+
* 停止指定的工作流Worker实例
|
|
1858
|
+
*/
|
|
1859
|
+
export const workflowStopWorkerMutation = (options) => {
|
|
1860
|
+
const mutationOptions = {
|
|
1861
|
+
mutationFn: async (localOptions) => {
|
|
1862
|
+
const { data } = await workflowStopWorker({
|
|
1863
|
+
...options,
|
|
1864
|
+
...localOptions,
|
|
1865
|
+
throwOnError: true,
|
|
1866
|
+
});
|
|
1867
|
+
return data;
|
|
1868
|
+
},
|
|
1869
|
+
};
|
|
1870
|
+
return mutationOptions;
|
|
1871
|
+
};
|
|
1872
|
+
export const workflowGetWorkerStatusQueryKey = (options) => createQueryKey("workflowGetWorkerStatus", options);
|
|
1873
|
+
/**
|
|
1874
|
+
* 获取Worker状态
|
|
1875
|
+
* 获取所有Worker的运行状态
|
|
1876
|
+
*/
|
|
1877
|
+
export const workflowGetWorkerStatusOptions = (options) => {
|
|
1878
|
+
return queryOptions({
|
|
1879
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1880
|
+
const { data } = await workflowGetWorkerStatus({
|
|
1881
|
+
...options,
|
|
1882
|
+
...queryKey[0],
|
|
1883
|
+
signal,
|
|
1884
|
+
throwOnError: true,
|
|
1885
|
+
});
|
|
1886
|
+
return data;
|
|
1887
|
+
},
|
|
1888
|
+
queryKey: workflowGetWorkerStatusQueryKey(options),
|
|
1889
|
+
});
|
|
1890
|
+
};
|
|
1891
|
+
export const workflowGetAvailableWorkflowsQueryKey = (options) => createQueryKey("workflowGetAvailableWorkflows", options);
|
|
1892
|
+
/**
|
|
1893
|
+
* 获取可用工作流列表
|
|
1894
|
+
* 获取本机可用的工作流组件列表
|
|
1895
|
+
*/
|
|
1896
|
+
export const workflowGetAvailableWorkflowsOptions = (options) => {
|
|
1897
|
+
return queryOptions({
|
|
1898
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1899
|
+
const { data } = await workflowGetAvailableWorkflows({
|
|
1900
|
+
...options,
|
|
1901
|
+
...queryKey[0],
|
|
1902
|
+
signal,
|
|
1903
|
+
throwOnError: true,
|
|
1904
|
+
});
|
|
1905
|
+
return data;
|
|
1906
|
+
},
|
|
1907
|
+
queryKey: workflowGetAvailableWorkflowsQueryKey(options),
|
|
1908
|
+
});
|
|
1909
|
+
};
|
|
1910
|
+
export const workflowRunWorkflowQueryKey = (options) => createQueryKey("workflowRunWorkflow", options);
|
|
1911
|
+
/**
|
|
1912
|
+
* 运行工作流
|
|
1913
|
+
* 触发执行指定的工作流
|
|
1914
|
+
*/
|
|
1915
|
+
export const workflowRunWorkflowOptions = (options) => {
|
|
1916
|
+
return queryOptions({
|
|
1917
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1918
|
+
const { data } = await workflowRunWorkflow({
|
|
1919
|
+
...options,
|
|
1920
|
+
...queryKey[0],
|
|
1921
|
+
signal,
|
|
1922
|
+
throwOnError: true,
|
|
1923
|
+
});
|
|
1924
|
+
return data;
|
|
1925
|
+
},
|
|
1926
|
+
queryKey: workflowRunWorkflowQueryKey(options),
|
|
1927
|
+
});
|
|
1928
|
+
};
|
|
1929
|
+
/**
|
|
1930
|
+
* 运行工作流
|
|
1931
|
+
* 触发执行指定的工作流
|
|
1932
|
+
*/
|
|
1933
|
+
export const workflowRunWorkflowMutation = (options) => {
|
|
1934
|
+
const mutationOptions = {
|
|
1935
|
+
mutationFn: async (localOptions) => {
|
|
1936
|
+
const { data } = await workflowRunWorkflow({
|
|
1937
|
+
...options,
|
|
1938
|
+
...localOptions,
|
|
1939
|
+
throwOnError: true,
|
|
1940
|
+
});
|
|
1941
|
+
return data;
|
|
1942
|
+
},
|
|
1943
|
+
};
|
|
1944
|
+
return mutationOptions;
|
|
1945
|
+
};
|
|
1946
|
+
export const toolsRunContainerQueryKey = (options) => createQueryKey("toolsRunContainer", options);
|
|
1947
|
+
/**
|
|
1948
|
+
* Run a container with specified configuration
|
|
1949
|
+
*/
|
|
1950
|
+
export const toolsRunContainerOptions = (options) => {
|
|
1951
|
+
return queryOptions({
|
|
1952
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1953
|
+
const { data } = await toolsRunContainer({
|
|
1954
|
+
...options,
|
|
1955
|
+
...queryKey[0],
|
|
1956
|
+
signal,
|
|
1957
|
+
throwOnError: true,
|
|
1958
|
+
});
|
|
1959
|
+
return data;
|
|
1960
|
+
},
|
|
1961
|
+
queryKey: toolsRunContainerQueryKey(options),
|
|
1962
|
+
});
|
|
1963
|
+
};
|
|
1964
|
+
/**
|
|
1965
|
+
* Run a container with specified configuration
|
|
1966
|
+
*/
|
|
1967
|
+
export const toolsRunContainerMutation = (options) => {
|
|
1968
|
+
const mutationOptions = {
|
|
1969
|
+
mutationFn: async (localOptions) => {
|
|
1970
|
+
const { data } = await toolsRunContainer({
|
|
1971
|
+
...options,
|
|
1972
|
+
...localOptions,
|
|
1973
|
+
throwOnError: true,
|
|
1974
|
+
});
|
|
1975
|
+
return data;
|
|
1976
|
+
},
|
|
1977
|
+
};
|
|
1978
|
+
return mutationOptions;
|
|
1979
|
+
};
|
|
1980
|
+
export const postListPublicQueryKey = (options) => createQueryKey("postListPublic", options);
|
|
1981
|
+
/**
|
|
1982
|
+
* Get the posts for the site
|
|
1983
|
+
*/
|
|
1984
|
+
export const postListPublicOptions = (options) => {
|
|
1985
|
+
return queryOptions({
|
|
1986
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1987
|
+
const { data } = await postListPublic({
|
|
1988
|
+
...options,
|
|
1989
|
+
...queryKey[0],
|
|
1990
|
+
signal,
|
|
1991
|
+
throwOnError: true,
|
|
1992
|
+
});
|
|
1993
|
+
return data;
|
|
1994
|
+
},
|
|
1995
|
+
queryKey: postListPublicQueryKey(options),
|
|
1996
|
+
});
|
|
1997
|
+
};
|
|
1998
|
+
/**
|
|
1999
|
+
* Delete post
|
|
2000
|
+
*/
|
|
2001
|
+
export const postDeleteMutation = (options) => {
|
|
2002
|
+
const mutationOptions = {
|
|
2003
|
+
mutationFn: async (localOptions) => {
|
|
2004
|
+
const { data } = await postDelete({
|
|
2005
|
+
...options,
|
|
2006
|
+
...localOptions,
|
|
2007
|
+
throwOnError: true,
|
|
2008
|
+
});
|
|
2009
|
+
return data;
|
|
2010
|
+
},
|
|
2011
|
+
};
|
|
2012
|
+
return mutationOptions;
|
|
2013
|
+
};
|
|
2014
|
+
export const postGetQueryKey = (options) => createQueryKey("postGet", options);
|
|
2015
|
+
/**
|
|
2016
|
+
* Get the post for the tenant
|
|
2017
|
+
*/
|
|
2018
|
+
export const postGetOptions = (options) => {
|
|
2019
|
+
return queryOptions({
|
|
2020
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2021
|
+
const { data } = await postGet({
|
|
2022
|
+
...options,
|
|
2023
|
+
...queryKey[0],
|
|
2024
|
+
signal,
|
|
2025
|
+
throwOnError: true,
|
|
2026
|
+
});
|
|
2027
|
+
return data;
|
|
2028
|
+
},
|
|
2029
|
+
queryKey: postGetQueryKey(options),
|
|
2030
|
+
});
|
|
2031
|
+
};
|
|
2032
|
+
/**
|
|
2033
|
+
* Update post
|
|
2034
|
+
*/
|
|
2035
|
+
export const postUpdateMutation = (options) => {
|
|
2036
|
+
const mutationOptions = {
|
|
2037
|
+
mutationFn: async (localOptions) => {
|
|
2038
|
+
const { data } = await postUpdate({
|
|
2039
|
+
...options,
|
|
2040
|
+
...localOptions,
|
|
2041
|
+
throwOnError: true,
|
|
2042
|
+
});
|
|
2043
|
+
return data;
|
|
2044
|
+
},
|
|
2045
|
+
};
|
|
2046
|
+
return mutationOptions;
|
|
2047
|
+
};
|
|
2048
|
+
export const postListQueryKey = (options) => createQueryKey("postList", options);
|
|
2049
|
+
/**
|
|
2050
|
+
* Get the posts for the site
|
|
2051
|
+
*/
|
|
2052
|
+
export const postListOptions = (options) => {
|
|
2053
|
+
return queryOptions({
|
|
2054
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2055
|
+
const { data } = await postList({
|
|
2056
|
+
...options,
|
|
2057
|
+
...queryKey[0],
|
|
2058
|
+
signal,
|
|
2059
|
+
throwOnError: true,
|
|
2060
|
+
});
|
|
2061
|
+
return data;
|
|
2062
|
+
},
|
|
2063
|
+
queryKey: postListQueryKey(options),
|
|
2064
|
+
});
|
|
2065
|
+
};
|
|
2066
|
+
export const postCreateQueryKey = (options) => createQueryKey("postCreate", options);
|
|
2067
|
+
/**
|
|
2068
|
+
* create post
|
|
2069
|
+
*/
|
|
2070
|
+
export const postCreateOptions = (options) => {
|
|
2071
|
+
return queryOptions({
|
|
2072
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2073
|
+
const { data } = await postCreate({
|
|
2074
|
+
...options,
|
|
2075
|
+
...queryKey[0],
|
|
2076
|
+
signal,
|
|
2077
|
+
throwOnError: true,
|
|
2078
|
+
});
|
|
2079
|
+
return data;
|
|
2080
|
+
},
|
|
2081
|
+
queryKey: postCreateQueryKey(options),
|
|
2082
|
+
});
|
|
2083
|
+
};
|
|
2084
|
+
/**
|
|
2085
|
+
* create post
|
|
2086
|
+
*/
|
|
2087
|
+
export const postCreateMutation = (options) => {
|
|
2088
|
+
const mutationOptions = {
|
|
2089
|
+
mutationFn: async (localOptions) => {
|
|
2090
|
+
const { data } = await postCreate({
|
|
2091
|
+
...options,
|
|
2092
|
+
...localOptions,
|
|
2093
|
+
throwOnError: true,
|
|
2094
|
+
});
|
|
2095
|
+
return data;
|
|
2096
|
+
},
|
|
2097
|
+
};
|
|
2098
|
+
return mutationOptions;
|
|
2099
|
+
};
|
|
2100
|
+
export const scriptsByNameQueryKey = (options) => createQueryKey("scriptsByName", options);
|
|
2101
|
+
/**
|
|
2102
|
+
* Get a script by name
|
|
2103
|
+
* Get a script by name
|
|
2104
|
+
*/
|
|
2105
|
+
export const scriptsByNameOptions = (options) => {
|
|
2106
|
+
return queryOptions({
|
|
2107
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2108
|
+
const { data } = await scriptsByName({
|
|
2109
|
+
...options,
|
|
2110
|
+
...queryKey[0],
|
|
2111
|
+
signal,
|
|
2112
|
+
throwOnError: true,
|
|
2113
|
+
});
|
|
2114
|
+
return data;
|
|
2115
|
+
},
|
|
2116
|
+
queryKey: scriptsByNameQueryKey(options),
|
|
2117
|
+
});
|
|
2118
|
+
};
|
|
2119
|
+
export const singboxGetWorkerProfileQueryKey = (options) => createQueryKey("singboxGetWorkerProfile", options);
|
|
2120
|
+
/**
|
|
2121
|
+
* 获取sing-box worker profile
|
|
2122
|
+
* 获取sing-box worker profile
|
|
2123
|
+
*/
|
|
2124
|
+
export const singboxGetWorkerProfileOptions = (options) => {
|
|
2125
|
+
return queryOptions({
|
|
2126
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2127
|
+
const { data } = await singboxGetWorkerProfile({
|
|
2128
|
+
...options,
|
|
2129
|
+
...queryKey[0],
|
|
2130
|
+
signal,
|
|
2131
|
+
throwOnError: true,
|
|
2132
|
+
});
|
|
2133
|
+
return data;
|
|
2134
|
+
},
|
|
2135
|
+
queryKey: singboxGetWorkerProfileQueryKey(options),
|
|
2136
|
+
});
|
|
2137
|
+
};
|
|
2138
|
+
export const singboxSubscribeQueryKey = (options) => createQueryKey("singboxSubscribe", options);
|
|
2139
|
+
/**
|
|
2140
|
+
* 获取sing-box订阅
|
|
2141
|
+
* 获取sing-box订阅
|
|
2142
|
+
*/
|
|
2143
|
+
export const singboxSubscribeOptions = (options) => {
|
|
2144
|
+
return queryOptions({
|
|
2145
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2146
|
+
const { data } = await singboxSubscribe({
|
|
2147
|
+
...options,
|
|
2148
|
+
...queryKey[0],
|
|
2149
|
+
signal,
|
|
2150
|
+
throwOnError: true,
|
|
2151
|
+
});
|
|
2152
|
+
return data;
|
|
2153
|
+
},
|
|
2154
|
+
queryKey: singboxSubscribeQueryKey(options),
|
|
2155
|
+
});
|
|
2156
|
+
};
|
|
2157
|
+
export const singboxGeoipCnSrsQueryKey = (options) => createQueryKey("singboxGeoipCnSrs", options);
|
|
2158
|
+
/**
|
|
2159
|
+
* 获取sing-box geoip-cn.srs文件
|
|
2160
|
+
* 获取sing-box geoip-cn.srs文件
|
|
2161
|
+
*/
|
|
2162
|
+
export const singboxGeoipCnSrsOptions = (options) => {
|
|
2163
|
+
return queryOptions({
|
|
2164
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2165
|
+
const { data } = await singboxGeoipCnSrs({
|
|
2166
|
+
...options,
|
|
2167
|
+
...queryKey[0],
|
|
2168
|
+
signal,
|
|
2169
|
+
throwOnError: true,
|
|
2170
|
+
});
|
|
2171
|
+
return data;
|
|
2172
|
+
},
|
|
2173
|
+
queryKey: singboxGeoipCnSrsQueryKey(options),
|
|
2174
|
+
});
|
|
2175
|
+
};
|
|
2176
|
+
export const singboxGetOutboundsQueryKey = (options) => createQueryKey("singboxGetOutbounds", options);
|
|
2177
|
+
/**
|
|
2178
|
+
* 获取所有sing-box outbound
|
|
2179
|
+
* 获取所有sing-box outbound配置
|
|
2180
|
+
*/
|
|
2181
|
+
export const singboxGetOutboundsOptions = (options) => {
|
|
2182
|
+
return queryOptions({
|
|
2183
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2184
|
+
const { data } = await singboxGetOutbounds({
|
|
2185
|
+
...options,
|
|
2186
|
+
...queryKey[0],
|
|
2187
|
+
signal,
|
|
2188
|
+
throwOnError: true,
|
|
2189
|
+
});
|
|
2190
|
+
return data;
|
|
2191
|
+
},
|
|
2192
|
+
queryKey: singboxGetOutboundsQueryKey(options),
|
|
2193
|
+
});
|
|
2194
|
+
};
|
|
2195
|
+
export const singboxCreateOutboundQueryKey = (options) => createQueryKey("singboxCreateOutbound", options);
|
|
2196
|
+
/**
|
|
2197
|
+
* 创建sing-box outbound
|
|
2198
|
+
* 创建新的sing-box outbound配置
|
|
2199
|
+
*/
|
|
2200
|
+
export const singboxCreateOutboundOptions = (options) => {
|
|
2201
|
+
return queryOptions({
|
|
2202
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2203
|
+
const { data } = await singboxCreateOutbound({
|
|
2204
|
+
...options,
|
|
2205
|
+
...queryKey[0],
|
|
2206
|
+
signal,
|
|
2207
|
+
throwOnError: true,
|
|
2208
|
+
});
|
|
2209
|
+
return data;
|
|
2210
|
+
},
|
|
2211
|
+
queryKey: singboxCreateOutboundQueryKey(options),
|
|
2212
|
+
});
|
|
2213
|
+
};
|
|
2214
|
+
/**
|
|
2215
|
+
* 创建sing-box outbound
|
|
2216
|
+
* 创建新的sing-box outbound配置
|
|
2217
|
+
*/
|
|
2218
|
+
export const singboxCreateOutboundMutation = (options) => {
|
|
2219
|
+
const mutationOptions = {
|
|
2220
|
+
mutationFn: async (localOptions) => {
|
|
2221
|
+
const { data } = await singboxCreateOutbound({
|
|
2222
|
+
...options,
|
|
2223
|
+
...localOptions,
|
|
2224
|
+
throwOnError: true,
|
|
2225
|
+
});
|
|
2226
|
+
return data;
|
|
2227
|
+
},
|
|
2228
|
+
};
|
|
2229
|
+
return mutationOptions;
|
|
2230
|
+
};
|
|
2231
|
+
/**
|
|
2232
|
+
* 删除指定sing-box outbound
|
|
2233
|
+
* 删除指定的sing-box outbound配置
|
|
2234
|
+
*/
|
|
2235
|
+
export const singboxDeleteOutboundMutation = (options) => {
|
|
2236
|
+
const mutationOptions = {
|
|
2237
|
+
mutationFn: async (localOptions) => {
|
|
2238
|
+
const { data } = await singboxDeleteOutbound({
|
|
2239
|
+
...options,
|
|
2240
|
+
...localOptions,
|
|
2241
|
+
throwOnError: true,
|
|
2242
|
+
});
|
|
2243
|
+
return data;
|
|
2244
|
+
},
|
|
2245
|
+
};
|
|
2246
|
+
return mutationOptions;
|
|
2247
|
+
};
|
|
2248
|
+
export const singboxGetOutboundQueryKey = (options) => createQueryKey("singboxGetOutbound", options);
|
|
2249
|
+
/**
|
|
2250
|
+
* 获取指定sing-box outbound
|
|
2251
|
+
* 获取指定的sing-box outbound配置
|
|
2252
|
+
*/
|
|
2253
|
+
export const singboxGetOutboundOptions = (options) => {
|
|
2254
|
+
return queryOptions({
|
|
2255
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2256
|
+
const { data } = await singboxGetOutbound({
|
|
2257
|
+
...options,
|
|
2258
|
+
...queryKey[0],
|
|
2259
|
+
signal,
|
|
2260
|
+
throwOnError: true,
|
|
2261
|
+
});
|
|
2262
|
+
return data;
|
|
2263
|
+
},
|
|
2264
|
+
queryKey: singboxGetOutboundQueryKey(options),
|
|
2265
|
+
});
|
|
2266
|
+
};
|
|
2267
|
+
/**
|
|
2268
|
+
* 更新指定sing-box outbound
|
|
2269
|
+
* 更新指定的sing-box outbound配置
|
|
2270
|
+
*/
|
|
2271
|
+
export const singboxUpdateOutboundMutation = (options) => {
|
|
2272
|
+
const mutationOptions = {
|
|
2273
|
+
mutationFn: async (localOptions) => {
|
|
2274
|
+
const { data } = await singboxUpdateOutbound({
|
|
2275
|
+
...options,
|
|
2276
|
+
...localOptions,
|
|
2277
|
+
throwOnError: true,
|
|
2278
|
+
});
|
|
2279
|
+
return data;
|
|
2280
|
+
},
|
|
2281
|
+
};
|
|
2282
|
+
return mutationOptions;
|
|
2283
|
+
};
|
|
2284
|
+
export const singboxImportOutboundsQueryKey = (options) => createQueryKey("singboxImportOutbounds", options);
|
|
2285
|
+
/**
|
|
2286
|
+
* 导入sing-box outbound
|
|
2287
|
+
* 导入sing-box outbound
|
|
2288
|
+
*/
|
|
2289
|
+
export const singboxImportOutboundsOptions = (options) => {
|
|
2290
|
+
return queryOptions({
|
|
2291
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2292
|
+
const { data } = await singboxImportOutbounds({
|
|
2293
|
+
...options,
|
|
2294
|
+
...queryKey[0],
|
|
2295
|
+
signal,
|
|
2296
|
+
throwOnError: true,
|
|
2297
|
+
});
|
|
2298
|
+
return data;
|
|
2299
|
+
},
|
|
2300
|
+
queryKey: singboxImportOutboundsQueryKey(options),
|
|
2301
|
+
});
|
|
2302
|
+
};
|
|
2303
|
+
/**
|
|
2304
|
+
* 导入sing-box outbound
|
|
2305
|
+
* 导入sing-box outbound
|
|
2306
|
+
*/
|
|
2307
|
+
export const singboxImportOutboundsMutation = (options) => {
|
|
2308
|
+
const mutationOptions = {
|
|
2309
|
+
mutationFn: async (localOptions) => {
|
|
2310
|
+
const { data } = await singboxImportOutbounds({
|
|
2311
|
+
...options,
|
|
2312
|
+
...localOptions,
|
|
2313
|
+
throwOnError: true,
|
|
2314
|
+
});
|
|
2315
|
+
return data;
|
|
2316
|
+
},
|
|
2317
|
+
};
|
|
2318
|
+
return mutationOptions;
|
|
2319
|
+
};
|
|
2320
|
+
export const browserListQueryKey = (options) => createQueryKey("browserList", options);
|
|
2321
|
+
/**
|
|
2322
|
+
* 获取浏览器配置列表
|
|
2323
|
+
*/
|
|
2324
|
+
export const browserListOptions = (options) => {
|
|
2325
|
+
return queryOptions({
|
|
2326
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2327
|
+
const { data } = await browserList({
|
|
2328
|
+
...options,
|
|
2329
|
+
...queryKey[0],
|
|
2330
|
+
signal,
|
|
2331
|
+
throwOnError: true,
|
|
2332
|
+
});
|
|
2333
|
+
return data;
|
|
2334
|
+
},
|
|
2335
|
+
queryKey: browserListQueryKey(options),
|
|
2336
|
+
});
|
|
2337
|
+
};
|
|
2338
|
+
export const browserListInfiniteQueryKey = (options) => createQueryKey("browserList", options, true);
|
|
2339
|
+
/**
|
|
2340
|
+
* 获取浏览器配置列表
|
|
2341
|
+
*/
|
|
2342
|
+
export const browserListInfiniteOptions = (options) => {
|
|
2343
|
+
return infiniteQueryOptions(
|
|
2344
|
+
// @ts-ignore
|
|
2345
|
+
{
|
|
2346
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2347
|
+
// @ts-ignore
|
|
2348
|
+
const page = typeof pageParam === "object"
|
|
2349
|
+
? pageParam
|
|
2350
|
+
: {
|
|
2351
|
+
query: {
|
|
2352
|
+
page: pageParam,
|
|
2353
|
+
},
|
|
2354
|
+
};
|
|
2355
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2356
|
+
const { data } = await browserList({
|
|
2357
|
+
...options,
|
|
2358
|
+
...params,
|
|
2359
|
+
signal,
|
|
2360
|
+
throwOnError: true,
|
|
2361
|
+
});
|
|
2362
|
+
return data;
|
|
2363
|
+
},
|
|
2364
|
+
queryKey: browserListInfiniteQueryKey(options),
|
|
2365
|
+
});
|
|
2366
|
+
};
|
|
2367
|
+
export const browserCreateQueryKey = (options) => createQueryKey("browserCreate", options);
|
|
2368
|
+
/**
|
|
2369
|
+
* 创建新的浏览器配置
|
|
2370
|
+
*/
|
|
2371
|
+
export const browserCreateOptions = (options) => {
|
|
2372
|
+
return queryOptions({
|
|
2373
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2374
|
+
const { data } = await browserCreate({
|
|
2375
|
+
...options,
|
|
2376
|
+
...queryKey[0],
|
|
2377
|
+
signal,
|
|
2378
|
+
throwOnError: true,
|
|
2379
|
+
});
|
|
2380
|
+
return data;
|
|
2381
|
+
},
|
|
2382
|
+
queryKey: browserCreateQueryKey(options),
|
|
2383
|
+
});
|
|
2384
|
+
};
|
|
2385
|
+
/**
|
|
2386
|
+
* 创建新的浏览器配置
|
|
2387
|
+
*/
|
|
2388
|
+
export const browserCreateMutation = (options) => {
|
|
2389
|
+
const mutationOptions = {
|
|
2390
|
+
mutationFn: async (localOptions) => {
|
|
2391
|
+
const { data } = await browserCreate({
|
|
2392
|
+
...options,
|
|
2393
|
+
...localOptions,
|
|
2394
|
+
throwOnError: true,
|
|
2395
|
+
});
|
|
2396
|
+
return data;
|
|
2397
|
+
},
|
|
2398
|
+
};
|
|
2399
|
+
return mutationOptions;
|
|
2400
|
+
};
|
|
2401
|
+
export const browserExportQueryKey = (options) => createQueryKey("browserExport", options);
|
|
2402
|
+
/**
|
|
2403
|
+
* 导出租户的所有浏览器配置,支持完整数据导出
|
|
2404
|
+
*/
|
|
2405
|
+
export const browserExportOptions = (options) => {
|
|
2406
|
+
return queryOptions({
|
|
2407
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2408
|
+
const { data } = await browserExport({
|
|
2409
|
+
...options,
|
|
2410
|
+
...queryKey[0],
|
|
2411
|
+
signal,
|
|
2412
|
+
throwOnError: true,
|
|
2413
|
+
});
|
|
2414
|
+
return data;
|
|
2415
|
+
},
|
|
2416
|
+
queryKey: browserExportQueryKey(options),
|
|
2417
|
+
});
|
|
2418
|
+
};
|
|
2419
|
+
export const browserImportQueryKey = (options) => createQueryKey("browserImport", options);
|
|
2420
|
+
/**
|
|
2421
|
+
* 导入浏览器配置
|
|
2422
|
+
*/
|
|
2423
|
+
export const browserImportOptions = (options) => {
|
|
2424
|
+
return queryOptions({
|
|
2425
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2426
|
+
const { data } = await browserImport({
|
|
2427
|
+
...options,
|
|
2428
|
+
...queryKey[0],
|
|
2429
|
+
signal,
|
|
2430
|
+
throwOnError: true,
|
|
2431
|
+
});
|
|
2432
|
+
return data;
|
|
2433
|
+
},
|
|
2434
|
+
queryKey: browserImportQueryKey(options),
|
|
2435
|
+
});
|
|
2436
|
+
};
|
|
2437
|
+
/**
|
|
2438
|
+
* 导入浏览器配置
|
|
2439
|
+
*/
|
|
2440
|
+
export const browserImportMutation = (options) => {
|
|
2441
|
+
const mutationOptions = {
|
|
2442
|
+
mutationFn: async (localOptions) => {
|
|
2443
|
+
const { data } = await browserImport({
|
|
2444
|
+
...options,
|
|
2445
|
+
...localOptions,
|
|
2446
|
+
throwOnError: true,
|
|
2447
|
+
});
|
|
2448
|
+
return data;
|
|
2449
|
+
},
|
|
2450
|
+
};
|
|
2451
|
+
return mutationOptions;
|
|
2452
|
+
};
|
|
2453
|
+
/**
|
|
2454
|
+
* 删除浏览器配置
|
|
2455
|
+
*/
|
|
2456
|
+
export const browserDeleteMutation = (options) => {
|
|
2457
|
+
const mutationOptions = {
|
|
2458
|
+
mutationFn: async (localOptions) => {
|
|
2459
|
+
const { data } = await browserDelete({
|
|
2460
|
+
...options,
|
|
2461
|
+
...localOptions,
|
|
2462
|
+
throwOnError: true,
|
|
2463
|
+
});
|
|
2464
|
+
return data;
|
|
2465
|
+
},
|
|
2466
|
+
};
|
|
2467
|
+
return mutationOptions;
|
|
2468
|
+
};
|
|
2469
|
+
export const browserGetQueryKey = (options) => createQueryKey("browserGet", options);
|
|
2470
|
+
/**
|
|
2471
|
+
* 获取指定的浏览器配置
|
|
2472
|
+
*/
|
|
2473
|
+
export const browserGetOptions = (options) => {
|
|
2474
|
+
return queryOptions({
|
|
2475
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2476
|
+
const { data } = await browserGet({
|
|
2477
|
+
...options,
|
|
2478
|
+
...queryKey[0],
|
|
2479
|
+
signal,
|
|
2480
|
+
throwOnError: true,
|
|
2481
|
+
});
|
|
2482
|
+
return data;
|
|
2483
|
+
},
|
|
2484
|
+
queryKey: browserGetQueryKey(options),
|
|
2485
|
+
});
|
|
2486
|
+
};
|
|
2487
|
+
/**
|
|
2488
|
+
* 更新浏览器配置
|
|
2489
|
+
*/
|
|
2490
|
+
export const browserUpdateMutation = (options) => {
|
|
2491
|
+
const mutationOptions = {
|
|
2492
|
+
mutationFn: async (localOptions) => {
|
|
2493
|
+
const { data } = await browserUpdate({
|
|
2494
|
+
...options,
|
|
2495
|
+
...localOptions,
|
|
2496
|
+
throwOnError: true,
|
|
2497
|
+
});
|
|
2498
|
+
return data;
|
|
2499
|
+
},
|
|
2500
|
+
};
|
|
2501
|
+
return mutationOptions;
|
|
2502
|
+
};
|
|
2503
|
+
export const browserLaunchQueryKey = (options) => createQueryKey("browserLaunch", options);
|
|
2504
|
+
/**
|
|
2505
|
+
* 启动指定的浏览器配置
|
|
2506
|
+
*/
|
|
2507
|
+
export const browserLaunchOptions = (options) => {
|
|
2508
|
+
return queryOptions({
|
|
2509
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2510
|
+
const { data } = await browserLaunch({
|
|
2511
|
+
...options,
|
|
2512
|
+
...queryKey[0],
|
|
2513
|
+
signal,
|
|
2514
|
+
throwOnError: true,
|
|
2515
|
+
});
|
|
2516
|
+
return data;
|
|
2517
|
+
},
|
|
2518
|
+
queryKey: browserLaunchQueryKey(options),
|
|
2519
|
+
});
|
|
2520
|
+
};
|
|
2521
|
+
/**
|
|
2522
|
+
* 启动指定的浏览器配置
|
|
2523
|
+
*/
|
|
2524
|
+
export const browserLaunchMutation = (options) => {
|
|
2525
|
+
const mutationOptions = {
|
|
2526
|
+
mutationFn: async (localOptions) => {
|
|
2527
|
+
const { data } = await browserLaunch({
|
|
2528
|
+
...options,
|
|
2529
|
+
...localOptions,
|
|
2530
|
+
throwOnError: true,
|
|
2531
|
+
});
|
|
2532
|
+
return data;
|
|
2533
|
+
},
|
|
2534
|
+
};
|
|
2535
|
+
return mutationOptions;
|
|
2536
|
+
};
|
|
2537
|
+
export const browserCloseQueryKey = (options) => createQueryKey("browserClose", options);
|
|
2538
|
+
/**
|
|
2539
|
+
* 关闭指定的浏览器实例
|
|
2540
|
+
*/
|
|
2541
|
+
export const browserCloseOptions = (options) => {
|
|
2542
|
+
return queryOptions({
|
|
2543
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2544
|
+
const { data } = await browserClose({
|
|
2545
|
+
...options,
|
|
2546
|
+
...queryKey[0],
|
|
2547
|
+
signal,
|
|
2548
|
+
throwOnError: true,
|
|
2549
|
+
});
|
|
2550
|
+
return data;
|
|
2551
|
+
},
|
|
2552
|
+
queryKey: browserCloseQueryKey(options),
|
|
2553
|
+
});
|
|
2554
|
+
};
|
|
2555
|
+
/**
|
|
2556
|
+
* 关闭指定的浏览器实例
|
|
2557
|
+
*/
|
|
2558
|
+
export const browserCloseMutation = (options) => {
|
|
2559
|
+
const mutationOptions = {
|
|
2560
|
+
mutationFn: async (localOptions) => {
|
|
2561
|
+
const { data } = await browserClose({
|
|
2562
|
+
...options,
|
|
2563
|
+
...localOptions,
|
|
2564
|
+
throwOnError: true,
|
|
2565
|
+
});
|
|
2566
|
+
return data;
|
|
2567
|
+
},
|
|
2568
|
+
};
|
|
2569
|
+
return mutationOptions;
|
|
2570
|
+
};
|
|
2571
|
+
export const browserStatusQueryKey = (options) => createQueryKey("browserStatus", options);
|
|
2572
|
+
/**
|
|
2573
|
+
* 获取指定浏览器实例的运行状态
|
|
2574
|
+
*/
|
|
2575
|
+
export const browserStatusOptions = (options) => {
|
|
2576
|
+
return queryOptions({
|
|
2577
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2578
|
+
const { data } = await browserStatus({
|
|
2579
|
+
...options,
|
|
2580
|
+
...queryKey[0],
|
|
2581
|
+
signal,
|
|
2582
|
+
throwOnError: true,
|
|
2583
|
+
});
|
|
2584
|
+
return data;
|
|
2585
|
+
},
|
|
2586
|
+
queryKey: browserStatusQueryKey(options),
|
|
2587
|
+
});
|
|
2588
|
+
};
|
|
2589
|
+
export const browserCookiesQueryKey = (options) => createQueryKey("browserCookies", options);
|
|
2590
|
+
/**
|
|
2591
|
+
* 获取指定浏览器实例的cookies信息,按域名分组
|
|
2592
|
+
*/
|
|
2593
|
+
export const browserCookiesOptions = (options) => {
|
|
2594
|
+
return queryOptions({
|
|
2595
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2596
|
+
const { data } = await browserCookies({
|
|
2597
|
+
...options,
|
|
2598
|
+
...queryKey[0],
|
|
2599
|
+
signal,
|
|
2600
|
+
throwOnError: true,
|
|
2601
|
+
});
|
|
2602
|
+
return data;
|
|
2603
|
+
},
|
|
2604
|
+
queryKey: browserCookiesQueryKey(options),
|
|
2605
|
+
});
|
|
2606
|
+
};
|
|
2607
|
+
/**
|
|
2608
|
+
* 更新指定浏览器实例的cookies
|
|
2609
|
+
*/
|
|
2610
|
+
export const browserUpdateCookiesMutation = (options) => {
|
|
2611
|
+
const mutationOptions = {
|
|
2612
|
+
mutationFn: async (localOptions) => {
|
|
2613
|
+
const { data } = await browserUpdateCookies({
|
|
2614
|
+
...options,
|
|
2615
|
+
...localOptions,
|
|
2616
|
+
throwOnError: true,
|
|
2617
|
+
});
|
|
2618
|
+
return data;
|
|
2619
|
+
},
|
|
2620
|
+
};
|
|
2621
|
+
return mutationOptions;
|
|
2622
|
+
};
|
|
2623
|
+
export const browserGetStateQueryKey = (options) => createQueryKey("browserGetState", options);
|
|
2624
|
+
/**
|
|
2625
|
+
* 获取浏览器的持久化状态信息
|
|
2626
|
+
*/
|
|
2627
|
+
export const browserGetStateOptions = (options) => {
|
|
2628
|
+
return queryOptions({
|
|
2629
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2630
|
+
const { data } = await browserGetState({
|
|
2631
|
+
...options,
|
|
2632
|
+
...queryKey[0],
|
|
2633
|
+
signal,
|
|
2634
|
+
throwOnError: true,
|
|
2635
|
+
});
|
|
2636
|
+
return data;
|
|
2637
|
+
},
|
|
2638
|
+
queryKey: browserGetStateQueryKey(options),
|
|
2639
|
+
});
|
|
2640
|
+
};
|
|
2641
|
+
/**
|
|
2642
|
+
* 更新浏览器的持久化状态信息
|
|
2643
|
+
*/
|
|
2644
|
+
export const browserUpdateStateMutation = (options) => {
|
|
2645
|
+
const mutationOptions = {
|
|
2646
|
+
mutationFn: async (localOptions) => {
|
|
2647
|
+
const { data } = await browserUpdateState({
|
|
2648
|
+
...options,
|
|
2649
|
+
...localOptions,
|
|
2650
|
+
throwOnError: true,
|
|
2651
|
+
});
|
|
2652
|
+
return data;
|
|
2653
|
+
},
|
|
2654
|
+
};
|
|
2655
|
+
return mutationOptions;
|
|
2656
|
+
};
|
|
2657
|
+
export const botListQueryKey = (options) => createQueryKey("botList", options);
|
|
2658
|
+
/**
|
|
2659
|
+
* Get bot list for a tenant.
|
|
2660
|
+
*/
|
|
2661
|
+
export const botListOptions = (options) => {
|
|
2662
|
+
return queryOptions({
|
|
2663
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2664
|
+
const { data } = await botList({
|
|
2665
|
+
...options,
|
|
2666
|
+
...queryKey[0],
|
|
2667
|
+
signal,
|
|
2668
|
+
throwOnError: true,
|
|
2669
|
+
});
|
|
2670
|
+
return data;
|
|
2671
|
+
},
|
|
2672
|
+
queryKey: botListQueryKey(options),
|
|
2673
|
+
});
|
|
2674
|
+
};
|
|
2675
|
+
export const botGetQueryKey = (options) => createQueryKey("botGet", options);
|
|
2676
|
+
/**
|
|
2677
|
+
* Get bot by id.
|
|
2678
|
+
*/
|
|
2679
|
+
export const botGetOptions = (options) => {
|
|
2680
|
+
return queryOptions({
|
|
2681
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2682
|
+
const { data } = await botGet({
|
|
2683
|
+
...options,
|
|
2684
|
+
...queryKey[0],
|
|
2685
|
+
signal,
|
|
2686
|
+
throwOnError: true,
|
|
2687
|
+
});
|
|
2688
|
+
return data;
|
|
2689
|
+
},
|
|
2690
|
+
queryKey: botGetQueryKey(options),
|
|
2691
|
+
});
|
|
2692
|
+
};
|
|
2693
|
+
export const botHeartbeatQueryKey = (options) => createQueryKey("botHeartbeat", options);
|
|
2694
|
+
/**
|
|
2695
|
+
* Heartbeat
|
|
2696
|
+
* Heartbeat for bot.
|
|
2697
|
+
*/
|
|
2698
|
+
export const botHeartbeatOptions = (options) => {
|
|
2699
|
+
return queryOptions({
|
|
2700
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2701
|
+
const { data } = await botHeartbeat({
|
|
2702
|
+
...options,
|
|
2703
|
+
...queryKey[0],
|
|
2704
|
+
signal,
|
|
2705
|
+
throwOnError: true,
|
|
2706
|
+
});
|
|
2707
|
+
return data;
|
|
2708
|
+
},
|
|
2709
|
+
queryKey: botHeartbeatQueryKey(options),
|
|
2710
|
+
});
|
|
2711
|
+
};
|
|
2712
|
+
/**
|
|
2713
|
+
* Heartbeat
|
|
2714
|
+
* Heartbeat for bot.
|
|
2715
|
+
*/
|
|
2716
|
+
export const botHeartbeatMutation = (options) => {
|
|
2717
|
+
const mutationOptions = {
|
|
2718
|
+
mutationFn: async (localOptions) => {
|
|
2719
|
+
const { data } = await botHeartbeat({
|
|
2720
|
+
...options,
|
|
2721
|
+
...localOptions,
|
|
2722
|
+
throwOnError: true,
|
|
2723
|
+
});
|
|
2724
|
+
return data;
|
|
2725
|
+
},
|
|
2726
|
+
};
|
|
2727
|
+
return mutationOptions;
|
|
2728
|
+
};
|
|
2729
|
+
export const systemSetupQueryKey = (options) => createQueryKey("systemSetup", options);
|
|
2730
|
+
/**
|
|
2731
|
+
* Unified system setup (SSE)
|
|
2732
|
+
* Initialize system with database URL and super admin password.
|
|
2733
|
+
* Returns progress via Server-Sent Events (SSE).
|
|
2734
|
+
*
|
|
2735
|
+
*/
|
|
2736
|
+
export const systemSetupOptions = (options) => {
|
|
2737
|
+
return queryOptions({
|
|
2738
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2739
|
+
const { data } = await systemSetup({
|
|
2740
|
+
...options,
|
|
2741
|
+
...queryKey[0],
|
|
2742
|
+
signal,
|
|
2743
|
+
throwOnError: true,
|
|
2744
|
+
});
|
|
2745
|
+
return data;
|
|
2746
|
+
},
|
|
2747
|
+
queryKey: systemSetupQueryKey(options),
|
|
2748
|
+
});
|
|
2749
|
+
};
|
|
2750
|
+
/**
|
|
2751
|
+
* Unified system setup (SSE)
|
|
2752
|
+
* Initialize system with database URL and super admin password.
|
|
2753
|
+
* Returns progress via Server-Sent Events (SSE).
|
|
2754
|
+
*
|
|
2755
|
+
*/
|
|
2756
|
+
export const systemSetupMutation = (options) => {
|
|
2757
|
+
const mutationOptions = {
|
|
2758
|
+
mutationFn: async (localOptions) => {
|
|
2759
|
+
const { data } = await systemSetup({
|
|
2760
|
+
...options,
|
|
2761
|
+
...localOptions,
|
|
2762
|
+
throwOnError: true,
|
|
2763
|
+
});
|
|
2764
|
+
return data;
|
|
2765
|
+
},
|
|
2766
|
+
};
|
|
2767
|
+
return mutationOptions;
|
|
2768
|
+
};
|
|
2769
|
+
export const systemGetLogsQueryKey = (options) => createQueryKey("systemGetLogs", options);
|
|
2770
|
+
/**
|
|
2771
|
+
* Get system logs with filtering options
|
|
2772
|
+
*/
|
|
2773
|
+
export const systemGetLogsOptions = (options) => {
|
|
2774
|
+
return queryOptions({
|
|
2775
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2776
|
+
const { data } = await systemGetLogs({
|
|
2777
|
+
...options,
|
|
2778
|
+
...queryKey[0],
|
|
2779
|
+
signal,
|
|
2780
|
+
throwOnError: true,
|
|
2781
|
+
});
|
|
2782
|
+
return data;
|
|
2783
|
+
},
|
|
2784
|
+
queryKey: systemGetLogsQueryKey(options),
|
|
2785
|
+
});
|
|
2786
|
+
};
|
|
2787
|
+
export const systemGetLogsInfiniteQueryKey = (options) => createQueryKey("systemGetLogs", options, true);
|
|
2788
|
+
/**
|
|
2789
|
+
* Get system logs with filtering options
|
|
2790
|
+
*/
|
|
2791
|
+
export const systemGetLogsInfiniteOptions = (options) => {
|
|
2792
|
+
return infiniteQueryOptions(
|
|
2793
|
+
// @ts-ignore
|
|
2794
|
+
{
|
|
2795
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2796
|
+
// @ts-ignore
|
|
2797
|
+
const page = typeof pageParam === "object"
|
|
2798
|
+
? pageParam
|
|
2799
|
+
: {
|
|
2800
|
+
query: {
|
|
2801
|
+
offset: pageParam,
|
|
2802
|
+
},
|
|
2803
|
+
};
|
|
2804
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2805
|
+
const { data } = await systemGetLogs({
|
|
2806
|
+
...options,
|
|
2807
|
+
...params,
|
|
2808
|
+
signal,
|
|
2809
|
+
throwOnError: true,
|
|
2810
|
+
});
|
|
2811
|
+
return data;
|
|
2812
|
+
},
|
|
2813
|
+
queryKey: systemGetLogsInfiniteQueryKey(options),
|
|
2814
|
+
});
|
|
2815
|
+
};
|
|
2816
|
+
export const systemGetOAuthConfigQueryKey = (options) => createQueryKey("systemGetOAuthConfig", options);
|
|
2817
|
+
/**
|
|
2818
|
+
* Get OAuth configuration
|
|
2819
|
+
*/
|
|
2820
|
+
export const systemGetOAuthConfigOptions = (options) => {
|
|
2821
|
+
return queryOptions({
|
|
2822
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2823
|
+
const { data } = await systemGetOAuthConfig({
|
|
2824
|
+
...options,
|
|
2825
|
+
...queryKey[0],
|
|
2826
|
+
signal,
|
|
2827
|
+
throwOnError: true,
|
|
2828
|
+
});
|
|
2829
|
+
return data;
|
|
2830
|
+
},
|
|
2831
|
+
queryKey: systemGetOAuthConfigQueryKey(options),
|
|
2832
|
+
});
|
|
2833
|
+
};
|
|
2834
|
+
export const systemUpdateOAuthConfigQueryKey = (options) => createQueryKey("systemUpdateOAuthConfig", options);
|
|
2835
|
+
/**
|
|
2836
|
+
* Update OAuth configuration
|
|
2837
|
+
*/
|
|
2838
|
+
export const systemUpdateOAuthConfigOptions = (options) => {
|
|
2839
|
+
return queryOptions({
|
|
2840
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2841
|
+
const { data } = await systemUpdateOAuthConfig({
|
|
2842
|
+
...options,
|
|
2843
|
+
...queryKey[0],
|
|
2844
|
+
signal,
|
|
2845
|
+
throwOnError: true,
|
|
2846
|
+
});
|
|
2847
|
+
return data;
|
|
2848
|
+
},
|
|
2849
|
+
queryKey: systemUpdateOAuthConfigQueryKey(options),
|
|
2850
|
+
});
|
|
2851
|
+
};
|
|
2852
|
+
/**
|
|
2853
|
+
* Update OAuth configuration
|
|
2854
|
+
*/
|
|
2855
|
+
export const systemUpdateOAuthConfigMutation = (options) => {
|
|
2856
|
+
const mutationOptions = {
|
|
2857
|
+
mutationFn: async (localOptions) => {
|
|
2858
|
+
const { data } = await systemUpdateOAuthConfig({
|
|
2859
|
+
...options,
|
|
2860
|
+
...localOptions,
|
|
2861
|
+
throwOnError: true,
|
|
2862
|
+
});
|
|
2863
|
+
return data;
|
|
2864
|
+
},
|
|
2865
|
+
};
|
|
2866
|
+
return mutationOptions;
|
|
2867
|
+
};
|
|
2868
|
+
export const systemGetPerformanceMetricsQueryKey = (options) => createQueryKey("systemGetPerformanceMetrics", options);
|
|
2869
|
+
/**
|
|
2870
|
+
* Get system performance metrics including CPU, memory, and disk usage
|
|
2871
|
+
*/
|
|
2872
|
+
export const systemGetPerformanceMetricsOptions = (options) => {
|
|
2873
|
+
return queryOptions({
|
|
2874
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2875
|
+
const { data } = await systemGetPerformanceMetrics({
|
|
2876
|
+
...options,
|
|
2877
|
+
...queryKey[0],
|
|
2878
|
+
signal,
|
|
2879
|
+
throwOnError: true,
|
|
2880
|
+
});
|
|
2881
|
+
return data;
|
|
2882
|
+
},
|
|
2883
|
+
queryKey: systemGetPerformanceMetricsQueryKey(options),
|
|
2884
|
+
});
|
|
2885
|
+
};
|
|
2886
|
+
export const systemGetSystemSettingsQueryKey = (options) => createQueryKey("systemGetSystemSettings", options);
|
|
2887
|
+
/**
|
|
2888
|
+
* Get system settings
|
|
2889
|
+
*/
|
|
2890
|
+
export const systemGetSystemSettingsOptions = (options) => {
|
|
2891
|
+
return queryOptions({
|
|
2892
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2893
|
+
const { data } = await systemGetSystemSettings({
|
|
2894
|
+
...options,
|
|
2895
|
+
...queryKey[0],
|
|
2896
|
+
signal,
|
|
2897
|
+
throwOnError: true,
|
|
2898
|
+
});
|
|
2899
|
+
return data;
|
|
2900
|
+
},
|
|
2901
|
+
queryKey: systemGetSystemSettingsQueryKey(options),
|
|
2902
|
+
});
|
|
2903
|
+
};
|
|
2904
|
+
export const systemUpdateSystemSettingsQueryKey = (options) => createQueryKey("systemUpdateSystemSettings", options);
|
|
2905
|
+
/**
|
|
2906
|
+
* Update system settings
|
|
2907
|
+
*/
|
|
2908
|
+
export const systemUpdateSystemSettingsOptions = (options) => {
|
|
2909
|
+
return queryOptions({
|
|
2910
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2911
|
+
const { data } = await systemUpdateSystemSettings({
|
|
2912
|
+
...options,
|
|
2913
|
+
...queryKey[0],
|
|
2914
|
+
signal,
|
|
2915
|
+
throwOnError: true,
|
|
2916
|
+
});
|
|
2917
|
+
return data;
|
|
2918
|
+
},
|
|
2919
|
+
queryKey: systemUpdateSystemSettingsQueryKey(options),
|
|
2920
|
+
});
|
|
2921
|
+
};
|
|
2922
|
+
/**
|
|
2923
|
+
* Update system settings
|
|
2924
|
+
*/
|
|
2925
|
+
export const systemUpdateSystemSettingsMutation = (options) => {
|
|
2926
|
+
const mutationOptions = {
|
|
2927
|
+
mutationFn: async (localOptions) => {
|
|
2928
|
+
const { data } = await systemUpdateSystemSettings({
|
|
2929
|
+
...options,
|
|
2930
|
+
...localOptions,
|
|
2931
|
+
throwOnError: true,
|
|
2932
|
+
});
|
|
2933
|
+
return data;
|
|
2934
|
+
},
|
|
2935
|
+
};
|
|
2936
|
+
return mutationOptions;
|
|
2937
|
+
};
|
|
2938
|
+
export const systemExportSystemSettingsQueryKey = (options) => createQueryKey("systemExportSystemSettings", options);
|
|
2939
|
+
/**
|
|
2940
|
+
* Export system settings as YAML
|
|
2941
|
+
*/
|
|
2942
|
+
export const systemExportSystemSettingsOptions = (options) => {
|
|
2943
|
+
return queryOptions({
|
|
2944
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2945
|
+
const { data } = await systemExportSystemSettings({
|
|
2946
|
+
...options,
|
|
2947
|
+
...queryKey[0],
|
|
2948
|
+
signal,
|
|
2949
|
+
throwOnError: true,
|
|
2950
|
+
});
|
|
2951
|
+
return data;
|
|
2952
|
+
},
|
|
2953
|
+
queryKey: systemExportSystemSettingsQueryKey(options),
|
|
2954
|
+
});
|
|
2955
|
+
};
|
|
2956
|
+
export const systemImportSystemSettingsQueryKey = (options) => createQueryKey("systemImportSystemSettings", options);
|
|
2957
|
+
/**
|
|
2958
|
+
* Import system settings from YAML
|
|
2959
|
+
*/
|
|
2960
|
+
export const systemImportSystemSettingsOptions = (options) => {
|
|
2961
|
+
return queryOptions({
|
|
2962
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2963
|
+
const { data } = await systemImportSystemSettings({
|
|
2964
|
+
...options,
|
|
2965
|
+
...queryKey[0],
|
|
2966
|
+
signal,
|
|
2967
|
+
throwOnError: true,
|
|
2968
|
+
});
|
|
2969
|
+
return data;
|
|
2970
|
+
},
|
|
2971
|
+
queryKey: systemImportSystemSettingsQueryKey(options),
|
|
2972
|
+
});
|
|
2973
|
+
};
|
|
2974
|
+
/**
|
|
2975
|
+
* Import system settings from YAML
|
|
2976
|
+
*/
|
|
2977
|
+
export const systemImportSystemSettingsMutation = (options) => {
|
|
2978
|
+
const mutationOptions = {
|
|
2979
|
+
mutationFn: async (localOptions) => {
|
|
2980
|
+
const { data } = await systemImportSystemSettings({
|
|
2981
|
+
...options,
|
|
2982
|
+
...localOptions,
|
|
2983
|
+
throwOnError: true,
|
|
2984
|
+
});
|
|
2985
|
+
return data;
|
|
2986
|
+
},
|
|
2987
|
+
};
|
|
2988
|
+
return mutationOptions;
|
|
2989
|
+
};
|
|
2990
|
+
//# sourceMappingURL=react-query.gen.js.map
|