@newfold/huapi-js 2.0.0-alpha.1 → 2.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +10 -0
- package/.eslintrc.json +18 -0
- package/Jenkinsfile +205 -0
- package/cicd/deploy-major-prerelease.sh +11 -0
- package/cicd/deploy.sh +10 -0
- package/cicd/test.sh +5 -0
- package/deploy/alpha.yaml +1 -0
- package/deploy/base.yaml +14 -0
- package/deploy/beta.yaml +1 -0
- package/deploy/branch.yaml +1 -0
- package/deploy/prod.yaml +2 -0
- package/deploy/staging.yaml +1 -0
- package/deploy/test-prod.yaml +1 -0
- package/deploy/test-staging.yaml +1 -0
- package/jest.config.ts +15 -0
- package/orval.config.ts +39 -0
- package/package.json +5 -9
- package/project.json +69 -0
- package/scripts/update-version.js +43 -0
- package/src/tests/huapi-js.spec.ts +7 -0
- package/tsconfig.json +24 -0
- package/tsconfig.lib.json +10 -0
- package/tsconfig.spec.json +9 -0
- package/orval.config.d.ts +0 -2
- package/orval.config.js +0 -33
- package/src/index.d.ts +0 -5392
- package/src/index.js +0 -4349
- package/src/index.msw.d.ts +0 -343
- package/src/index.msw.js +0 -4310
- package/src/index.schemas.d.ts +0 -2886
- package/src/index.schemas.js +0 -163
package/src/index.js
DELETED
|
@@ -1,4349 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by orval v7.1.1 🍺
|
|
3
|
-
* Do not edit manually.
|
|
4
|
-
* Hosting UAPI
|
|
5
|
-
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.1037.0
|
|
7
|
-
*/
|
|
8
|
-
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
|
9
|
-
import axios from 'axios';
|
|
10
|
-
/**
|
|
11
|
-
* Returns a list of events across a tenant
|
|
12
|
-
* @summary Event list for all accounts under a tenant
|
|
13
|
-
*/
|
|
14
|
-
export const accountEventList = (params, options) => {
|
|
15
|
-
return axios.get(`/v1/account/events`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
16
|
-
};
|
|
17
|
-
export const getAccountEventListQueryKey = (params) => {
|
|
18
|
-
return [`/v1/account/events`, ...(params ? [params] : [])];
|
|
19
|
-
};
|
|
20
|
-
export const getAccountEventListQueryOptions = (params, options) => {
|
|
21
|
-
var _a;
|
|
22
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
23
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountEventListQueryKey(params);
|
|
24
|
-
const queryFn = ({ signal }) => accountEventList(params, Object.assign({ signal }, axiosOptions));
|
|
25
|
-
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* @summary Event list for all accounts under a tenant
|
|
29
|
-
*/
|
|
30
|
-
export function useAccountEventList(params, options) {
|
|
31
|
-
const queryOptions = getAccountEventListQueryOptions(params, options);
|
|
32
|
-
const query = useQuery(queryOptions);
|
|
33
|
-
query.queryKey = queryOptions.queryKey;
|
|
34
|
-
return query;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Returns a hosting account list
|
|
38
|
-
* @summary Hosting account list for a customer
|
|
39
|
-
*/
|
|
40
|
-
export const accountHostingList = (options) => {
|
|
41
|
-
return axios.get(`/v1/account/hosting`, options);
|
|
42
|
-
};
|
|
43
|
-
export const getAccountHostingListQueryKey = () => {
|
|
44
|
-
return [`/v1/account/hosting`];
|
|
45
|
-
};
|
|
46
|
-
export const getAccountHostingListQueryOptions = (options) => {
|
|
47
|
-
var _a;
|
|
48
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
49
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountHostingListQueryKey();
|
|
50
|
-
const queryFn = ({ signal }) => accountHostingList(Object.assign({ signal }, axiosOptions));
|
|
51
|
-
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* @summary Hosting account list for a customer
|
|
55
|
-
*/
|
|
56
|
-
export function useAccountHostingList(options) {
|
|
57
|
-
const queryOptions = getAccountHostingListQueryOptions(options);
|
|
58
|
-
const query = useQuery(queryOptions);
|
|
59
|
-
query.queryKey = queryOptions.queryKey;
|
|
60
|
-
return query;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Returns the account public key list
|
|
64
|
-
* @summary Account public key list
|
|
65
|
-
*/
|
|
66
|
-
export const accountPublicKeys = (options) => {
|
|
67
|
-
return axios.get(`/v1/account/public-keys`, options);
|
|
68
|
-
};
|
|
69
|
-
export const getAccountPublicKeysQueryKey = () => {
|
|
70
|
-
return [`/v1/account/public-keys`];
|
|
71
|
-
};
|
|
72
|
-
export const getAccountPublicKeysQueryOptions = (options) => {
|
|
73
|
-
var _a;
|
|
74
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
75
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountPublicKeysQueryKey();
|
|
76
|
-
const queryFn = ({ signal }) => accountPublicKeys(Object.assign({ signal }, axiosOptions));
|
|
77
|
-
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* @summary Account public key list
|
|
81
|
-
*/
|
|
82
|
-
export function useAccountPublicKeys(options) {
|
|
83
|
-
const queryOptions = getAccountPublicKeysQueryOptions(options);
|
|
84
|
-
const query = useQuery(queryOptions);
|
|
85
|
-
query.queryKey = queryOptions.queryKey;
|
|
86
|
-
return query;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Create an account public key
|
|
90
|
-
* @summary Account public key creation
|
|
91
|
-
*/
|
|
92
|
-
export const accountPublicKeyCreate = (accountPublicKeyCreateBody, options) => {
|
|
93
|
-
return axios.post(`/v1/account/public-keys`, accountPublicKeyCreateBody, options);
|
|
94
|
-
};
|
|
95
|
-
export const getAccountPublicKeyCreateMutationOptions = (options) => {
|
|
96
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
97
|
-
const mutationFn = (props) => {
|
|
98
|
-
const { data } = props !== null && props !== void 0 ? props : {};
|
|
99
|
-
return accountPublicKeyCreate(data, axiosOptions);
|
|
100
|
-
};
|
|
101
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* @summary Account public key creation
|
|
105
|
-
*/
|
|
106
|
-
export const useAccountPublicKeyCreate = (options) => {
|
|
107
|
-
const mutationOptions = getAccountPublicKeyCreateMutationOptions(options);
|
|
108
|
-
return useMutation(mutationOptions);
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Returns an account public key
|
|
112
|
-
* @summary Account public key info
|
|
113
|
-
*/
|
|
114
|
-
export const accountPublicKey = (publicKeyId, options) => {
|
|
115
|
-
return axios.get(`/v1/account/public-keys/${publicKeyId}`, options);
|
|
116
|
-
};
|
|
117
|
-
export const getAccountPublicKeyQueryKey = (publicKeyId) => {
|
|
118
|
-
return [`/v1/account/public-keys/${publicKeyId}`];
|
|
119
|
-
};
|
|
120
|
-
export const getAccountPublicKeyQueryOptions = (publicKeyId, options) => {
|
|
121
|
-
var _a;
|
|
122
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
123
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountPublicKeyQueryKey(publicKeyId);
|
|
124
|
-
const queryFn = ({ signal }) => accountPublicKey(publicKeyId, Object.assign({ signal }, axiosOptions));
|
|
125
|
-
return Object.assign({ queryKey,
|
|
126
|
-
queryFn, enabled: !!publicKeyId }, queryOptions);
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* @summary Account public key info
|
|
130
|
-
*/
|
|
131
|
-
export function useAccountPublicKey(publicKeyId, options) {
|
|
132
|
-
const queryOptions = getAccountPublicKeyQueryOptions(publicKeyId, options);
|
|
133
|
-
const query = useQuery(queryOptions);
|
|
134
|
-
query.queryKey = queryOptions.queryKey;
|
|
135
|
-
return query;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Delete an account public key
|
|
139
|
-
* @summary Account public key deletion
|
|
140
|
-
*/
|
|
141
|
-
export const accountPublicKeyDelete = (publicKeyId, options) => {
|
|
142
|
-
return axios.delete(`/v1/account/public-keys/${publicKeyId}`, options);
|
|
143
|
-
};
|
|
144
|
-
export const getAccountPublicKeyDeleteMutationOptions = (options) => {
|
|
145
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
146
|
-
const mutationFn = (props) => {
|
|
147
|
-
const { publicKeyId } = props !== null && props !== void 0 ? props : {};
|
|
148
|
-
return accountPublicKeyDelete(publicKeyId, axiosOptions);
|
|
149
|
-
};
|
|
150
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* @summary Account public key deletion
|
|
154
|
-
*/
|
|
155
|
-
export const useAccountPublicKeyDelete = (options) => {
|
|
156
|
-
const mutationOptions = getAccountPublicKeyDeleteMutationOptions(options);
|
|
157
|
-
return useMutation(mutationOptions);
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Returns a combined backup list with website commit ids and corresponding database commits
|
|
161
|
-
* @summary backup list
|
|
162
|
-
*/
|
|
163
|
-
export const codeguardBackupList = (addonId, params, options) => {
|
|
164
|
-
return axios.get(`/v1/addons/codeguard/${addonId}/backups`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
165
|
-
};
|
|
166
|
-
export const getCodeguardBackupListQueryKey = (addonId, params) => {
|
|
167
|
-
return [
|
|
168
|
-
`/v1/addons/codeguard/${addonId}/backups`,
|
|
169
|
-
...(params ? [params] : []),
|
|
170
|
-
];
|
|
171
|
-
};
|
|
172
|
-
export const getCodeguardBackupListQueryOptions = (addonId, params, options) => {
|
|
173
|
-
var _a;
|
|
174
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
175
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardBackupListQueryKey(addonId, params);
|
|
176
|
-
const queryFn = ({ signal }) => codeguardBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
177
|
-
return Object.assign({ queryKey,
|
|
178
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* @summary backup list
|
|
182
|
-
*/
|
|
183
|
-
export function useCodeguardBackupList(addonId, params, options) {
|
|
184
|
-
const queryOptions = getCodeguardBackupListQueryOptions(addonId, params, options);
|
|
185
|
-
const query = useQuery(queryOptions);
|
|
186
|
-
query.queryKey = queryOptions.queryKey;
|
|
187
|
-
return query;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Creates the website backup
|
|
191
|
-
* @summary backup create
|
|
192
|
-
*/
|
|
193
|
-
export const codeguardBackupCreate = (addonId, codeguardBackupCreateBody, options) => {
|
|
194
|
-
return axios.post(`/v1/addons/codeguard/${addonId}/backups`, codeguardBackupCreateBody, options);
|
|
195
|
-
};
|
|
196
|
-
export const getCodeguardBackupCreateMutationOptions = (options) => {
|
|
197
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
198
|
-
const mutationFn = (props) => {
|
|
199
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
200
|
-
return codeguardBackupCreate(addonId, data, axiosOptions);
|
|
201
|
-
};
|
|
202
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* @summary backup create
|
|
206
|
-
*/
|
|
207
|
-
export const useCodeguardBackupCreate = (options) => {
|
|
208
|
-
const mutationOptions = getCodeguardBackupCreateMutationOptions(options);
|
|
209
|
-
return useMutation(mutationOptions);
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
212
|
-
* Queues the backup download.
|
|
213
|
-
* @summary backup download
|
|
214
|
-
*/
|
|
215
|
-
export const codeguardBackupDownload = (addonId, codeguardBackupDownloadBody, options) => {
|
|
216
|
-
return axios.post(`/v1/addons/codeguard/${addonId}/backups/download`, codeguardBackupDownloadBody, options);
|
|
217
|
-
};
|
|
218
|
-
export const getCodeguardBackupDownloadMutationOptions = (options) => {
|
|
219
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
220
|
-
const mutationFn = (props) => {
|
|
221
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
222
|
-
return codeguardBackupDownload(addonId, data, axiosOptions);
|
|
223
|
-
};
|
|
224
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
225
|
-
};
|
|
226
|
-
/**
|
|
227
|
-
* @summary backup download
|
|
228
|
-
*/
|
|
229
|
-
export const useCodeguardBackupDownload = (options) => {
|
|
230
|
-
const mutationOptions = getCodeguardBackupDownloadMutationOptions(options);
|
|
231
|
-
return useMutation(mutationOptions);
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Restores a website and database backup
|
|
235
|
-
* @summary backups restore
|
|
236
|
-
*/
|
|
237
|
-
export const codeguardBackupRestore = (addonId, codeguardBackupRestoreBody, options) => {
|
|
238
|
-
return axios.post(`/v1/addons/codeguard/${addonId}/backups/restore`, codeguardBackupRestoreBody, options);
|
|
239
|
-
};
|
|
240
|
-
export const getCodeguardBackupRestoreMutationOptions = (options) => {
|
|
241
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
242
|
-
const mutationFn = (props) => {
|
|
243
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
244
|
-
return codeguardBackupRestore(addonId, data, axiosOptions);
|
|
245
|
-
};
|
|
246
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
247
|
-
};
|
|
248
|
-
/**
|
|
249
|
-
* @summary backups restore
|
|
250
|
-
*/
|
|
251
|
-
export const useCodeguardBackupRestore = (options) => {
|
|
252
|
-
const mutationOptions = getCodeguardBackupRestoreMutationOptions(options);
|
|
253
|
-
return useMutation(mutationOptions);
|
|
254
|
-
};
|
|
255
|
-
/**
|
|
256
|
-
* Returns all database records CodeGuard maintains for this user's account.
|
|
257
|
-
* @summary database list
|
|
258
|
-
*/
|
|
259
|
-
export const codeguardDatabaseList = (addonId, options) => {
|
|
260
|
-
return axios.get(`/v1/addons/codeguard/${addonId}/databases`, options);
|
|
261
|
-
};
|
|
262
|
-
export const getCodeguardDatabaseListQueryKey = (addonId) => {
|
|
263
|
-
return [`/v1/addons/codeguard/${addonId}/databases`];
|
|
264
|
-
};
|
|
265
|
-
export const getCodeguardDatabaseListQueryOptions = (addonId, options) => {
|
|
266
|
-
var _a;
|
|
267
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
268
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseListQueryKey(addonId);
|
|
269
|
-
const queryFn = ({ signal }) => codeguardDatabaseList(addonId, Object.assign({ signal }, axiosOptions));
|
|
270
|
-
return Object.assign({ queryKey,
|
|
271
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
272
|
-
};
|
|
273
|
-
/**
|
|
274
|
-
* @summary database list
|
|
275
|
-
*/
|
|
276
|
-
export function useCodeguardDatabaseList(addonId, options) {
|
|
277
|
-
const queryOptions = getCodeguardDatabaseListQueryOptions(addonId, options);
|
|
278
|
-
const query = useQuery(queryOptions);
|
|
279
|
-
query.queryKey = queryOptions.queryKey;
|
|
280
|
-
return query;
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Returns all database backup records CodeGuard maintains for this user's account.
|
|
284
|
-
* @summary database backup list
|
|
285
|
-
*/
|
|
286
|
-
export const codeguardDatabaseBackupList = (addonId, params, options) => {
|
|
287
|
-
return axios.get(`/v1/addons/codeguard/${addonId}/databases/backups`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
288
|
-
};
|
|
289
|
-
export const getCodeguardDatabaseBackupListQueryKey = (addonId, params) => {
|
|
290
|
-
return [
|
|
291
|
-
`/v1/addons/codeguard/${addonId}/databases/backups`,
|
|
292
|
-
...(params ? [params] : []),
|
|
293
|
-
];
|
|
294
|
-
};
|
|
295
|
-
export const getCodeguardDatabaseBackupListQueryOptions = (addonId, params, options) => {
|
|
296
|
-
var _a;
|
|
297
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
298
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseBackupListQueryKey(addonId, params);
|
|
299
|
-
const queryFn = ({ signal }) => codeguardDatabaseBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
300
|
-
return Object.assign({ queryKey,
|
|
301
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
302
|
-
};
|
|
303
|
-
/**
|
|
304
|
-
* @summary database backup list
|
|
305
|
-
*/
|
|
306
|
-
export function useCodeguardDatabaseBackupList(addonId, params, options) {
|
|
307
|
-
const queryOptions = getCodeguardDatabaseBackupListQueryOptions(addonId, params, options);
|
|
308
|
-
const query = useQuery(queryOptions);
|
|
309
|
-
query.queryKey = queryOptions.queryKey;
|
|
310
|
-
return query;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Queue the creation of a database backup.
|
|
314
|
-
* @summary database backup create
|
|
315
|
-
*/
|
|
316
|
-
export const codeguardDatabaseBackupCreate = (addonId, codeguardDatabaseBackupCreateBody, options) => {
|
|
317
|
-
return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups`, codeguardDatabaseBackupCreateBody, options);
|
|
318
|
-
};
|
|
319
|
-
export const getCodeguardDatabaseBackupCreateMutationOptions = (options) => {
|
|
320
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
321
|
-
const mutationFn = (props) => {
|
|
322
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
323
|
-
return codeguardDatabaseBackupCreate(addonId, data, axiosOptions);
|
|
324
|
-
};
|
|
325
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* @summary database backup create
|
|
329
|
-
*/
|
|
330
|
-
export const useCodeguardDatabaseBackupCreate = (options) => {
|
|
331
|
-
const mutationOptions = getCodeguardDatabaseBackupCreateMutationOptions(options);
|
|
332
|
-
return useMutation(mutationOptions);
|
|
333
|
-
};
|
|
334
|
-
/**
|
|
335
|
-
* Restores a database backup
|
|
336
|
-
* @summary database backup restore
|
|
337
|
-
*/
|
|
338
|
-
export const codeguardDatabaseBackupRestore = (addonId, codeguardDatabaseBackupRestoreBody, options) => {
|
|
339
|
-
return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups/restore`, codeguardDatabaseBackupRestoreBody, options);
|
|
340
|
-
};
|
|
341
|
-
export const getCodeguardDatabaseBackupRestoreMutationOptions = (options) => {
|
|
342
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
343
|
-
const mutationFn = (props) => {
|
|
344
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
345
|
-
return codeguardDatabaseBackupRestore(addonId, data, axiosOptions);
|
|
346
|
-
};
|
|
347
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
348
|
-
};
|
|
349
|
-
/**
|
|
350
|
-
* @summary database backup restore
|
|
351
|
-
*/
|
|
352
|
-
export const useCodeguardDatabaseBackupRestore = (options) => {
|
|
353
|
-
const mutationOptions = getCodeguardDatabaseBackupRestoreMutationOptions(options);
|
|
354
|
-
return useMutation(mutationOptions);
|
|
355
|
-
};
|
|
356
|
-
/**
|
|
357
|
-
* Returns an oauth login URL that can be used to access CodeGuard dashboard for a user.
|
|
358
|
-
* @summary login link
|
|
359
|
-
*/
|
|
360
|
-
export const codeguardLoginLink = (addonId, options) => {
|
|
361
|
-
return axios.get(`/v1/addons/codeguard/${addonId}/login`, options);
|
|
362
|
-
};
|
|
363
|
-
export const getCodeguardLoginLinkQueryKey = (addonId) => {
|
|
364
|
-
return [`/v1/addons/codeguard/${addonId}/login`];
|
|
365
|
-
};
|
|
366
|
-
export const getCodeguardLoginLinkQueryOptions = (addonId, options) => {
|
|
367
|
-
var _a;
|
|
368
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
369
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardLoginLinkQueryKey(addonId);
|
|
370
|
-
const queryFn = ({ signal }) => codeguardLoginLink(addonId, Object.assign({ signal }, axiosOptions));
|
|
371
|
-
return Object.assign({ queryKey,
|
|
372
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
373
|
-
};
|
|
374
|
-
/**
|
|
375
|
-
* @summary login link
|
|
376
|
-
*/
|
|
377
|
-
export function useCodeguardLoginLink(addonId, options) {
|
|
378
|
-
const queryOptions = getCodeguardLoginLinkQueryOptions(addonId, options);
|
|
379
|
-
const query = useQuery(queryOptions);
|
|
380
|
-
query.queryKey = queryOptions.queryKey;
|
|
381
|
-
return query;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Returns the subscribed plan and usage info
|
|
385
|
-
* @summary plan info
|
|
386
|
-
*/
|
|
387
|
-
export const codeguardPlanInfo = (addonId, options) => {
|
|
388
|
-
return axios.get(`/v1/addons/codeguard/${addonId}/plan`, options);
|
|
389
|
-
};
|
|
390
|
-
export const getCodeguardPlanInfoQueryKey = (addonId) => {
|
|
391
|
-
return [`/v1/addons/codeguard/${addonId}/plan`];
|
|
392
|
-
};
|
|
393
|
-
export const getCodeguardPlanInfoQueryOptions = (addonId, options) => {
|
|
394
|
-
var _a;
|
|
395
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
396
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardPlanInfoQueryKey(addonId);
|
|
397
|
-
const queryFn = ({ signal }) => codeguardPlanInfo(addonId, Object.assign({ signal }, axiosOptions));
|
|
398
|
-
return Object.assign({ queryKey,
|
|
399
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
400
|
-
};
|
|
401
|
-
/**
|
|
402
|
-
* @summary plan info
|
|
403
|
-
*/
|
|
404
|
-
export function useCodeguardPlanInfo(addonId, options) {
|
|
405
|
-
const queryOptions = getCodeguardPlanInfoQueryOptions(addonId, options);
|
|
406
|
-
const query = useQuery(queryOptions);
|
|
407
|
-
query.queryKey = queryOptions.queryKey;
|
|
408
|
-
return query;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Returns all website records CodeGuard maintains for this user's account.
|
|
412
|
-
* @summary website list
|
|
413
|
-
*/
|
|
414
|
-
export const codeguardWebsiteList = (addonId, options) => {
|
|
415
|
-
return axios.get(`/v1/addons/codeguard/${addonId}/websites`, options);
|
|
416
|
-
};
|
|
417
|
-
export const getCodeguardWebsiteListQueryKey = (addonId) => {
|
|
418
|
-
return [`/v1/addons/codeguard/${addonId}/websites`];
|
|
419
|
-
};
|
|
420
|
-
export const getCodeguardWebsiteListQueryOptions = (addonId, options) => {
|
|
421
|
-
var _a;
|
|
422
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
423
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardWebsiteListQueryKey(addonId);
|
|
424
|
-
const queryFn = ({ signal }) => codeguardWebsiteList(addonId, Object.assign({ signal }, axiosOptions));
|
|
425
|
-
return Object.assign({ queryKey,
|
|
426
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
427
|
-
};
|
|
428
|
-
/**
|
|
429
|
-
* @summary website list
|
|
430
|
-
*/
|
|
431
|
-
export function useCodeguardWebsiteList(addonId, options) {
|
|
432
|
-
const queryOptions = getCodeguardWebsiteListQueryOptions(addonId, options);
|
|
433
|
-
const query = useQuery(queryOptions);
|
|
434
|
-
query.queryKey = queryOptions.queryKey;
|
|
435
|
-
return query;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Returns all website backup records CodeGuard maintains for this user's account.
|
|
439
|
-
* @summary website backup list
|
|
440
|
-
*/
|
|
441
|
-
export const codeguardWebsiteBackupList = (addonId, params, options) => {
|
|
442
|
-
return axios.get(`/v1/addons/codeguard/${addonId}/websites/backups`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
443
|
-
};
|
|
444
|
-
export const getCodeguardWebsiteBackupListQueryKey = (addonId, params) => {
|
|
445
|
-
return [
|
|
446
|
-
`/v1/addons/codeguard/${addonId}/websites/backups`,
|
|
447
|
-
...(params ? [params] : []),
|
|
448
|
-
];
|
|
449
|
-
};
|
|
450
|
-
export const getCodeguardWebsiteBackupListQueryOptions = (addonId, params, options) => {
|
|
451
|
-
var _a;
|
|
452
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
453
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardWebsiteBackupListQueryKey(addonId, params);
|
|
454
|
-
const queryFn = ({ signal }) => codeguardWebsiteBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
455
|
-
return Object.assign({ queryKey,
|
|
456
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
457
|
-
};
|
|
458
|
-
/**
|
|
459
|
-
* @summary website backup list
|
|
460
|
-
*/
|
|
461
|
-
export function useCodeguardWebsiteBackupList(addonId, params, options) {
|
|
462
|
-
const queryOptions = getCodeguardWebsiteBackupListQueryOptions(addonId, params, options);
|
|
463
|
-
const query = useQuery(queryOptions);
|
|
464
|
-
query.queryKey = queryOptions.queryKey;
|
|
465
|
-
return query;
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Initiate the creation of a new backup for a given website
|
|
469
|
-
* @summary website backup create
|
|
470
|
-
*/
|
|
471
|
-
export const codeguardWebsiteBackupCreate = (addonId, codeguardWebsiteBackupCreateBody, options) => {
|
|
472
|
-
return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups`, codeguardWebsiteBackupCreateBody, options);
|
|
473
|
-
};
|
|
474
|
-
export const getCodeguardWebsiteBackupCreateMutationOptions = (options) => {
|
|
475
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
476
|
-
const mutationFn = (props) => {
|
|
477
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
478
|
-
return codeguardWebsiteBackupCreate(addonId, data, axiosOptions);
|
|
479
|
-
};
|
|
480
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
481
|
-
};
|
|
482
|
-
/**
|
|
483
|
-
* @summary website backup create
|
|
484
|
-
*/
|
|
485
|
-
export const useCodeguardWebsiteBackupCreate = (options) => {
|
|
486
|
-
const mutationOptions = getCodeguardWebsiteBackupCreateMutationOptions(options);
|
|
487
|
-
return useMutation(mutationOptions);
|
|
488
|
-
};
|
|
489
|
-
/**
|
|
490
|
-
* Restores a website backup
|
|
491
|
-
* @summary website backup restore
|
|
492
|
-
*/
|
|
493
|
-
export const codeguardWebsiteBackupRestore = (addonId, codeguardWebsiteBackupRestoreBody, options) => {
|
|
494
|
-
return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups/restore`, codeguardWebsiteBackupRestoreBody, options);
|
|
495
|
-
};
|
|
496
|
-
export const getCodeguardWebsiteBackupRestoreMutationOptions = (options) => {
|
|
497
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
498
|
-
const mutationFn = (props) => {
|
|
499
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
500
|
-
return codeguardWebsiteBackupRestore(addonId, data, axiosOptions);
|
|
501
|
-
};
|
|
502
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
503
|
-
};
|
|
504
|
-
/**
|
|
505
|
-
* @summary website backup restore
|
|
506
|
-
*/
|
|
507
|
-
export const useCodeguardWebsiteBackupRestore = (options) => {
|
|
508
|
-
const mutationOptions = getCodeguardWebsiteBackupRestoreMutationOptions(options);
|
|
509
|
-
return useMutation(mutationOptions);
|
|
510
|
-
};
|
|
511
|
-
/**
|
|
512
|
-
* Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
|
|
513
|
-
* @summary sso
|
|
514
|
-
*/
|
|
515
|
-
export const addonsSitelockSso = (addonId, options) => {
|
|
516
|
-
return axios.get(`/v1/addons/sitelock/${addonId}/sso`, options);
|
|
517
|
-
};
|
|
518
|
-
export const getAddonsSitelockSsoQueryKey = (addonId) => {
|
|
519
|
-
return [`/v1/addons/sitelock/${addonId}/sso`];
|
|
520
|
-
};
|
|
521
|
-
export const getAddonsSitelockSsoQueryOptions = (addonId, options) => {
|
|
522
|
-
var _a;
|
|
523
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
524
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSitelockSsoQueryKey(addonId);
|
|
525
|
-
const queryFn = ({ signal }) => addonsSitelockSso(addonId, Object.assign({ signal }, axiosOptions));
|
|
526
|
-
return Object.assign({ queryKey,
|
|
527
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
528
|
-
};
|
|
529
|
-
/**
|
|
530
|
-
* @summary sso
|
|
531
|
-
*/
|
|
532
|
-
export function useAddonsSitelockSso(addonId, options) {
|
|
533
|
-
const queryOptions = getAddonsSitelockSsoQueryOptions(addonId, options);
|
|
534
|
-
const query = useQuery(queryOptions);
|
|
535
|
-
query.queryKey = queryOptions.queryKey;
|
|
536
|
-
return query;
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Backup initiate
|
|
540
|
-
* @summary Backup initiate
|
|
541
|
-
*/
|
|
542
|
-
export const backupInitiate = (addonId, backupInitiateBody, options) => {
|
|
543
|
-
return axios.post(`/v1/addons/${addonId}/backup`, backupInitiateBody, options);
|
|
544
|
-
};
|
|
545
|
-
export const getBackupInitiateMutationOptions = (options) => {
|
|
546
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
547
|
-
const mutationFn = (props) => {
|
|
548
|
-
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
549
|
-
return backupInitiate(addonId, data, axiosOptions);
|
|
550
|
-
};
|
|
551
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
552
|
-
};
|
|
553
|
-
/**
|
|
554
|
-
* @summary Backup initiate
|
|
555
|
-
*/
|
|
556
|
-
export const useBackupInitiate = (options) => {
|
|
557
|
-
const mutationOptions = getBackupInitiateMutationOptions(options);
|
|
558
|
-
return useMutation(mutationOptions);
|
|
559
|
-
};
|
|
560
|
-
/**
|
|
561
|
-
* Backup status
|
|
562
|
-
* @summary Backup status
|
|
563
|
-
*/
|
|
564
|
-
export const backupStatus = (addonId, params, options) => {
|
|
565
|
-
return axios.get(`/v1/addons/${addonId}/backup`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
566
|
-
};
|
|
567
|
-
export const getBackupStatusQueryKey = (addonId, params) => {
|
|
568
|
-
return [`/v1/addons/${addonId}/backup`, ...(params ? [params] : [])];
|
|
569
|
-
};
|
|
570
|
-
export const getBackupStatusQueryOptions = (addonId, params, options) => {
|
|
571
|
-
var _a;
|
|
572
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
573
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getBackupStatusQueryKey(addonId, params);
|
|
574
|
-
const queryFn = ({ signal, }) => backupStatus(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
575
|
-
return Object.assign({ queryKey,
|
|
576
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
577
|
-
};
|
|
578
|
-
/**
|
|
579
|
-
* @summary Backup status
|
|
580
|
-
*/
|
|
581
|
-
export function useBackupStatus(addonId, params, options) {
|
|
582
|
-
const queryOptions = getBackupStatusQueryOptions(addonId, params, options);
|
|
583
|
-
const query = useQuery(queryOptions);
|
|
584
|
-
query.queryKey = queryOptions.queryKey;
|
|
585
|
-
return query;
|
|
586
|
-
}
|
|
587
|
-
/**
|
|
588
|
-
* Returns backup list
|
|
589
|
-
* @summary Backup list
|
|
590
|
-
*/
|
|
591
|
-
export const backupList = (addonId, params, options) => {
|
|
592
|
-
return axios.get(`/v1/addons/${addonId}/backup/list`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
593
|
-
};
|
|
594
|
-
export const getBackupListQueryKey = (addonId, params) => {
|
|
595
|
-
return [
|
|
596
|
-
`/v1/addons/${addonId}/backup/list`,
|
|
597
|
-
...(params ? [params] : []),
|
|
598
|
-
];
|
|
599
|
-
};
|
|
600
|
-
export const getBackupListQueryOptions = (addonId, params, options) => {
|
|
601
|
-
var _a;
|
|
602
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
603
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getBackupListQueryKey(addonId, params);
|
|
604
|
-
const queryFn = ({ signal, }) => backupList(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
605
|
-
return Object.assign({ queryKey,
|
|
606
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
607
|
-
};
|
|
608
|
-
/**
|
|
609
|
-
* @summary Backup list
|
|
610
|
-
*/
|
|
611
|
-
export function useBackupList(addonId, params, options) {
|
|
612
|
-
const queryOptions = getBackupListQueryOptions(addonId, params, options);
|
|
613
|
-
const query = useQuery(queryOptions);
|
|
614
|
-
query.queryKey = queryOptions.queryKey;
|
|
615
|
-
return query;
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* Decom and delete cloudflare basic addon
|
|
619
|
-
* @summary Uninstall cloudflare basic addon
|
|
620
|
-
*/
|
|
621
|
-
export const addonsCloudflare = (addonId, options) => {
|
|
622
|
-
return axios.delete(`/v1/addons/${addonId}/cloudflare`, options);
|
|
623
|
-
};
|
|
624
|
-
export const getAddonsCloudflareMutationOptions = (options) => {
|
|
625
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
626
|
-
const mutationFn = (props) => {
|
|
627
|
-
const { addonId } = props !== null && props !== void 0 ? props : {};
|
|
628
|
-
return addonsCloudflare(addonId, axiosOptions);
|
|
629
|
-
};
|
|
630
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
631
|
-
};
|
|
632
|
-
/**
|
|
633
|
-
* @summary Uninstall cloudflare basic addon
|
|
634
|
-
*/
|
|
635
|
-
export const useAddonsCloudflare = (options) => {
|
|
636
|
-
const mutationOptions = getAddonsCloudflareMutationOptions(options);
|
|
637
|
-
return useMutation(mutationOptions);
|
|
638
|
-
};
|
|
639
|
-
/**
|
|
640
|
-
* Returns addon information
|
|
641
|
-
* @summary info
|
|
642
|
-
*/
|
|
643
|
-
export const addonsInfo = (addonId, options) => {
|
|
644
|
-
return axios.get(`/v1/addons/${addonId}/info`, options);
|
|
645
|
-
};
|
|
646
|
-
export const getAddonsInfoQueryKey = (addonId) => {
|
|
647
|
-
return [`/v1/addons/${addonId}/info`];
|
|
648
|
-
};
|
|
649
|
-
export const getAddonsInfoQueryOptions = (addonId, options) => {
|
|
650
|
-
var _a;
|
|
651
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
652
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsInfoQueryKey(addonId);
|
|
653
|
-
const queryFn = ({ signal, }) => addonsInfo(addonId, Object.assign({ signal }, axiosOptions));
|
|
654
|
-
return Object.assign({ queryKey,
|
|
655
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
656
|
-
};
|
|
657
|
-
/**
|
|
658
|
-
* @summary info
|
|
659
|
-
*/
|
|
660
|
-
export function useAddonsInfo(addonId, options) {
|
|
661
|
-
const queryOptions = getAddonsInfoQueryOptions(addonId, options);
|
|
662
|
-
const query = useQuery(queryOptions);
|
|
663
|
-
query.queryKey = queryOptions.queryKey;
|
|
664
|
-
return query;
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Returns spamexperts sso url
|
|
668
|
-
* @summary info
|
|
669
|
-
*/
|
|
670
|
-
export const addonsSpamexpertsSso = (addonId, options) => {
|
|
671
|
-
return axios.get(`/v1/addons/${addonId}/spamexperts/sso`, options);
|
|
672
|
-
};
|
|
673
|
-
export const getAddonsSpamexpertsSsoQueryKey = (addonId) => {
|
|
674
|
-
return [`/v1/addons/${addonId}/spamexperts/sso`];
|
|
675
|
-
};
|
|
676
|
-
export const getAddonsSpamexpertsSsoQueryOptions = (addonId, options) => {
|
|
677
|
-
var _a;
|
|
678
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
679
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSpamexpertsSsoQueryKey(addonId);
|
|
680
|
-
const queryFn = ({ signal }) => addonsSpamexpertsSso(addonId, Object.assign({ signal }, axiosOptions));
|
|
681
|
-
return Object.assign({ queryKey,
|
|
682
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
683
|
-
};
|
|
684
|
-
/**
|
|
685
|
-
* @summary info
|
|
686
|
-
*/
|
|
687
|
-
export function useAddonsSpamexpertsSso(addonId, options) {
|
|
688
|
-
const queryOptions = getAddonsSpamexpertsSsoQueryOptions(addonId, options);
|
|
689
|
-
const query = useQuery(queryOptions);
|
|
690
|
-
query.queryKey = queryOptions.queryKey;
|
|
691
|
-
return query;
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* Returns WebZai SSO URL
|
|
695
|
-
* @summary webzai sso
|
|
696
|
-
*/
|
|
697
|
-
export const webzaiSso = (addonId, options) => {
|
|
698
|
-
return axios.get(`/v1/addons/${addonId}/webzai/sso`, options);
|
|
699
|
-
};
|
|
700
|
-
export const getWebzaiSsoQueryKey = (addonId) => {
|
|
701
|
-
return [`/v1/addons/${addonId}/webzai/sso`];
|
|
702
|
-
};
|
|
703
|
-
export const getWebzaiSsoQueryOptions = (addonId, options) => {
|
|
704
|
-
var _a;
|
|
705
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
706
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getWebzaiSsoQueryKey(addonId);
|
|
707
|
-
const queryFn = ({ signal, }) => webzaiSso(addonId, Object.assign({ signal }, axiosOptions));
|
|
708
|
-
return Object.assign({ queryKey,
|
|
709
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
710
|
-
};
|
|
711
|
-
/**
|
|
712
|
-
* @summary webzai sso
|
|
713
|
-
*/
|
|
714
|
-
export function useWebzaiSso(addonId, options) {
|
|
715
|
-
const queryOptions = getWebzaiSsoQueryOptions(addonId, options);
|
|
716
|
-
const query = useQuery(queryOptions);
|
|
717
|
-
query.queryKey = queryOptions.queryKey;
|
|
718
|
-
return query;
|
|
719
|
-
}
|
|
720
|
-
/**
|
|
721
|
-
* Returns Weebly SSO URL
|
|
722
|
-
* @summary weebly sso
|
|
723
|
-
*/
|
|
724
|
-
export const weeblySso = (addonId, options) => {
|
|
725
|
-
return axios.get(`/v1/addons/${addonId}/weebly/sso`, options);
|
|
726
|
-
};
|
|
727
|
-
export const getWeeblySsoQueryKey = (addonId) => {
|
|
728
|
-
return [`/v1/addons/${addonId}/weebly/sso`];
|
|
729
|
-
};
|
|
730
|
-
export const getWeeblySsoQueryOptions = (addonId, options) => {
|
|
731
|
-
var _a;
|
|
732
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
733
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getWeeblySsoQueryKey(addonId);
|
|
734
|
-
const queryFn = ({ signal, }) => weeblySso(addonId, Object.assign({ signal }, axiosOptions));
|
|
735
|
-
return Object.assign({ queryKey,
|
|
736
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
737
|
-
};
|
|
738
|
-
/**
|
|
739
|
-
* @summary weebly sso
|
|
740
|
-
*/
|
|
741
|
-
export function useWeeblySso(addonId, options) {
|
|
742
|
-
const queryOptions = getWeeblySsoQueryOptions(addonId, options);
|
|
743
|
-
const query = useQuery(queryOptions);
|
|
744
|
-
query.queryKey = queryOptions.queryKey;
|
|
745
|
-
return query;
|
|
746
|
-
}
|
|
747
|
-
/**
|
|
748
|
-
* Get domain info
|
|
749
|
-
* @summary domain info
|
|
750
|
-
*/
|
|
751
|
-
export const domainInfo = (domainId, options) => {
|
|
752
|
-
return axios.get(`/v1/domains/${domainId}`, options);
|
|
753
|
-
};
|
|
754
|
-
export const getDomainInfoQueryKey = (domainId) => {
|
|
755
|
-
return [`/v1/domains/${domainId}`];
|
|
756
|
-
};
|
|
757
|
-
export const getDomainInfoQueryOptions = (domainId, options) => {
|
|
758
|
-
var _a;
|
|
759
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
760
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainInfoQueryKey(domainId);
|
|
761
|
-
const queryFn = ({ signal, }) => domainInfo(domainId, Object.assign({ signal }, axiosOptions));
|
|
762
|
-
return Object.assign({ queryKey,
|
|
763
|
-
queryFn, enabled: !!domainId }, queryOptions);
|
|
764
|
-
};
|
|
765
|
-
/**
|
|
766
|
-
* @summary domain info
|
|
767
|
-
*/
|
|
768
|
-
export function useDomainInfo(domainId, options) {
|
|
769
|
-
const queryOptions = getDomainInfoQueryOptions(domainId, options);
|
|
770
|
-
const query = useQuery(queryOptions);
|
|
771
|
-
query.queryKey = queryOptions.queryKey;
|
|
772
|
-
return query;
|
|
773
|
-
}
|
|
774
|
-
/**
|
|
775
|
-
* Returns the certificates for a given domain name or id
|
|
776
|
-
* @summary domain cert list
|
|
777
|
-
*/
|
|
778
|
-
export const domainCerts = (domainId, options) => {
|
|
779
|
-
return axios.get(`/v1/domains/${domainId}/certs`, options);
|
|
780
|
-
};
|
|
781
|
-
export const getDomainCertsQueryKey = (domainId) => {
|
|
782
|
-
return [`/v1/domains/${domainId}/certs`];
|
|
783
|
-
};
|
|
784
|
-
export const getDomainCertsQueryOptions = (domainId, options) => {
|
|
785
|
-
var _a;
|
|
786
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
787
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainCertsQueryKey(domainId);
|
|
788
|
-
const queryFn = ({ signal, }) => domainCerts(domainId, Object.assign({ signal }, axiosOptions));
|
|
789
|
-
return Object.assign({ queryKey,
|
|
790
|
-
queryFn, enabled: !!domainId }, queryOptions);
|
|
791
|
-
};
|
|
792
|
-
/**
|
|
793
|
-
* @summary domain cert list
|
|
794
|
-
*/
|
|
795
|
-
export function useDomainCerts(domainId, options) {
|
|
796
|
-
const queryOptions = getDomainCertsQueryOptions(domainId, options);
|
|
797
|
-
const query = useQuery(queryOptions);
|
|
798
|
-
query.queryKey = queryOptions.queryKey;
|
|
799
|
-
return query;
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* Install and enable a certificate for a given domain
|
|
803
|
-
* @summary domain cert install
|
|
804
|
-
*/
|
|
805
|
-
export const domainCertInstall = (domainId, domainCertInstallBody, options) => {
|
|
806
|
-
return axios.post(`/v1/domains/${domainId}/certs`, domainCertInstallBody, options);
|
|
807
|
-
};
|
|
808
|
-
export const getDomainCertInstallMutationOptions = (options) => {
|
|
809
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
810
|
-
const mutationFn = (props) => {
|
|
811
|
-
const { domainId, data } = props !== null && props !== void 0 ? props : {};
|
|
812
|
-
return domainCertInstall(domainId, data, axiosOptions);
|
|
813
|
-
};
|
|
814
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
815
|
-
};
|
|
816
|
-
/**
|
|
817
|
-
* @summary domain cert install
|
|
818
|
-
*/
|
|
819
|
-
export const useDomainCertInstall = (options) => {
|
|
820
|
-
const mutationOptions = getDomainCertInstallMutationOptions(options);
|
|
821
|
-
return useMutation(mutationOptions);
|
|
822
|
-
};
|
|
823
|
-
/**
|
|
824
|
-
* Install a certificate for a given domain name or id
|
|
825
|
-
* @summary domain certs
|
|
826
|
-
*/
|
|
827
|
-
export const domainCertUpdate = (domainId, domainCertUpdateBody, options) => {
|
|
828
|
-
return axios.put(`/v1/domains/${domainId}/certs`, domainCertUpdateBody, options);
|
|
829
|
-
};
|
|
830
|
-
export const getDomainCertUpdateMutationOptions = (options) => {
|
|
831
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
832
|
-
const mutationFn = (props) => {
|
|
833
|
-
const { domainId, data } = props !== null && props !== void 0 ? props : {};
|
|
834
|
-
return domainCertUpdate(domainId, data, axiosOptions);
|
|
835
|
-
};
|
|
836
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
837
|
-
};
|
|
838
|
-
/**
|
|
839
|
-
* @summary domain certs
|
|
840
|
-
*/
|
|
841
|
-
export const useDomainCertUpdate = (options) => {
|
|
842
|
-
const mutationOptions = getDomainCertUpdateMutationOptions(options);
|
|
843
|
-
return useMutation(mutationOptions);
|
|
844
|
-
};
|
|
845
|
-
/**
|
|
846
|
-
* Uninstall a certificate for a given domain name or id
|
|
847
|
-
* @summary domain cert uninstall
|
|
848
|
-
*/
|
|
849
|
-
export const domainCertUninstall = (domainId, options) => {
|
|
850
|
-
return axios.delete(`/v1/domains/${domainId}/certs`, options);
|
|
851
|
-
};
|
|
852
|
-
export const getDomainCertUninstallMutationOptions = (options) => {
|
|
853
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
854
|
-
const mutationFn = (props) => {
|
|
855
|
-
const { domainId } = props !== null && props !== void 0 ? props : {};
|
|
856
|
-
return domainCertUninstall(domainId, axiosOptions);
|
|
857
|
-
};
|
|
858
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
859
|
-
};
|
|
860
|
-
/**
|
|
861
|
-
* @summary domain cert uninstall
|
|
862
|
-
*/
|
|
863
|
-
export const useDomainCertUninstall = (options) => {
|
|
864
|
-
const mutationOptions = getDomainCertUninstallMutationOptions(options);
|
|
865
|
-
return useMutation(mutationOptions);
|
|
866
|
-
};
|
|
867
|
-
/**
|
|
868
|
-
* Unassign a domain name
|
|
869
|
-
* @summary domain unassign
|
|
870
|
-
*/
|
|
871
|
-
export const domainUnassign = (domainId, options) => {
|
|
872
|
-
return axios.post(`/v1/domains/${domainId}/unassign`, undefined, options);
|
|
873
|
-
};
|
|
874
|
-
export const getDomainUnassignMutationOptions = (options) => {
|
|
875
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
876
|
-
const mutationFn = (props) => {
|
|
877
|
-
const { domainId } = props !== null && props !== void 0 ? props : {};
|
|
878
|
-
return domainUnassign(domainId, axiosOptions);
|
|
879
|
-
};
|
|
880
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
881
|
-
};
|
|
882
|
-
/**
|
|
883
|
-
* @summary domain unassign
|
|
884
|
-
*/
|
|
885
|
-
export const useDomainUnassign = (options) => {
|
|
886
|
-
const mutationOptions = getDomainUnassignMutationOptions(options);
|
|
887
|
-
return useMutation(mutationOptions);
|
|
888
|
-
};
|
|
889
|
-
/**
|
|
890
|
-
* Returns HAL hosting account-level information
|
|
891
|
-
* @summary HAL Hosting Account Info
|
|
892
|
-
*/
|
|
893
|
-
export const hostingAccount = (hostingId, options) => {
|
|
894
|
-
return axios.get(`/v1/hosting/${hostingId}`, options);
|
|
895
|
-
};
|
|
896
|
-
export const getHostingAccountQueryKey = (hostingId) => {
|
|
897
|
-
return [`/v1/hosting/${hostingId}`];
|
|
898
|
-
};
|
|
899
|
-
export const getHostingAccountQueryOptions = (hostingId, options) => {
|
|
900
|
-
var _a;
|
|
901
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
902
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAccountQueryKey(hostingId);
|
|
903
|
-
const queryFn = ({ signal, }) => hostingAccount(hostingId, Object.assign({ signal }, axiosOptions));
|
|
904
|
-
return Object.assign({ queryKey,
|
|
905
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
906
|
-
};
|
|
907
|
-
/**
|
|
908
|
-
* @summary HAL Hosting Account Info
|
|
909
|
-
*/
|
|
910
|
-
export function useHostingAccount(hostingId, options) {
|
|
911
|
-
const queryOptions = getHostingAccountQueryOptions(hostingId, options);
|
|
912
|
-
const query = useQuery(queryOptions);
|
|
913
|
-
query.queryKey = queryOptions.queryKey;
|
|
914
|
-
return query;
|
|
915
|
-
}
|
|
916
|
-
/**
|
|
917
|
-
* Returns a list of addons.
|
|
918
|
-
* @summary addon list
|
|
919
|
-
*/
|
|
920
|
-
export const hostingAddons = (hostingId, params, options) => {
|
|
921
|
-
return axios.get(`/v1/hosting/${hostingId}/addons`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
922
|
-
};
|
|
923
|
-
export const getHostingAddonsQueryKey = (hostingId, params) => {
|
|
924
|
-
return [
|
|
925
|
-
`/v1/hosting/${hostingId}/addons`,
|
|
926
|
-
...(params ? [params] : []),
|
|
927
|
-
];
|
|
928
|
-
};
|
|
929
|
-
export const getHostingAddonsQueryOptions = (hostingId, params, options) => {
|
|
930
|
-
var _a;
|
|
931
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
932
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAddonsQueryKey(hostingId, params);
|
|
933
|
-
const queryFn = ({ signal, }) => hostingAddons(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
934
|
-
return Object.assign({ queryKey,
|
|
935
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
936
|
-
};
|
|
937
|
-
/**
|
|
938
|
-
* @summary addon list
|
|
939
|
-
*/
|
|
940
|
-
export function useHostingAddons(hostingId, params, options) {
|
|
941
|
-
const queryOptions = getHostingAddonsQueryOptions(hostingId, params, options);
|
|
942
|
-
const query = useQuery(queryOptions);
|
|
943
|
-
query.queryKey = queryOptions.queryKey;
|
|
944
|
-
return query;
|
|
945
|
-
}
|
|
946
|
-
/**
|
|
947
|
-
* To check for the domain services configuration
|
|
948
|
-
* @summary Domain services configuration check
|
|
949
|
-
*/
|
|
950
|
-
export const hostingAdvancedDomainServicesCheck = (hostingId, options) => {
|
|
951
|
-
return axios.get(`/v1/hosting/${hostingId}/advanced/domain/services`, options);
|
|
952
|
-
};
|
|
953
|
-
export const getHostingAdvancedDomainServicesCheckQueryKey = (hostingId) => {
|
|
954
|
-
return [`/v1/hosting/${hostingId}/advanced/domain/services`];
|
|
955
|
-
};
|
|
956
|
-
export const getHostingAdvancedDomainServicesCheckQueryOptions = (hostingId, options) => {
|
|
957
|
-
var _a;
|
|
958
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
959
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedDomainServicesCheckQueryKey(hostingId);
|
|
960
|
-
const queryFn = ({ signal }) => hostingAdvancedDomainServicesCheck(hostingId, Object.assign({ signal }, axiosOptions));
|
|
961
|
-
return Object.assign({ queryKey,
|
|
962
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
963
|
-
};
|
|
964
|
-
/**
|
|
965
|
-
* @summary Domain services configuration check
|
|
966
|
-
*/
|
|
967
|
-
export function useHostingAdvancedDomainServicesCheck(hostingId, options) {
|
|
968
|
-
const queryOptions = getHostingAdvancedDomainServicesCheckQueryOptions(hostingId, options);
|
|
969
|
-
const query = useQuery(queryOptions);
|
|
970
|
-
query.queryKey = queryOptions.queryKey;
|
|
971
|
-
return query;
|
|
972
|
-
}
|
|
973
|
-
/**
|
|
974
|
-
* To configure domain services
|
|
975
|
-
* @summary Domain services configuration
|
|
976
|
-
*/
|
|
977
|
-
export const hostingAdvancedDomainServices = (hostingId, hostingAdvancedDomainServicesBody, options) => {
|
|
978
|
-
return axios.post(`/v1/hosting/${hostingId}/advanced/domain/services`, hostingAdvancedDomainServicesBody, options);
|
|
979
|
-
};
|
|
980
|
-
export const getHostingAdvancedDomainServicesMutationOptions = (options) => {
|
|
981
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
982
|
-
const mutationFn = (props) => {
|
|
983
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
984
|
-
return hostingAdvancedDomainServices(hostingId, data, axiosOptions);
|
|
985
|
-
};
|
|
986
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
987
|
-
};
|
|
988
|
-
/**
|
|
989
|
-
* @summary Domain services configuration
|
|
990
|
-
*/
|
|
991
|
-
export const useHostingAdvancedDomainServices = (options) => {
|
|
992
|
-
const mutationOptions = getHostingAdvancedDomainServicesMutationOptions(options);
|
|
993
|
-
return useMutation(mutationOptions);
|
|
994
|
-
};
|
|
995
|
-
/**
|
|
996
|
-
* Returns the hosting server info
|
|
997
|
-
* @summary server status/info
|
|
998
|
-
*/
|
|
999
|
-
export const hostingAdvancedServer = (hostingId, options) => {
|
|
1000
|
-
return axios.get(`/v1/hosting/${hostingId}/advanced/server`, options);
|
|
1001
|
-
};
|
|
1002
|
-
export const getHostingAdvancedServerQueryKey = (hostingId) => {
|
|
1003
|
-
return [`/v1/hosting/${hostingId}/advanced/server`];
|
|
1004
|
-
};
|
|
1005
|
-
export const getHostingAdvancedServerQueryOptions = (hostingId, options) => {
|
|
1006
|
-
var _a;
|
|
1007
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1008
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedServerQueryKey(hostingId);
|
|
1009
|
-
const queryFn = ({ signal }) => hostingAdvancedServer(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1010
|
-
return Object.assign({ queryKey,
|
|
1011
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1012
|
-
};
|
|
1013
|
-
/**
|
|
1014
|
-
* @summary server status/info
|
|
1015
|
-
*/
|
|
1016
|
-
export function useHostingAdvancedServer(hostingId, options) {
|
|
1017
|
-
const queryOptions = getHostingAdvancedServerQueryOptions(hostingId, options);
|
|
1018
|
-
const query = useQuery(queryOptions);
|
|
1019
|
-
query.queryKey = queryOptions.queryKey;
|
|
1020
|
-
return query;
|
|
1021
|
-
}
|
|
1022
|
-
/**
|
|
1023
|
-
* Allows for managing server status
|
|
1024
|
-
* @summary server_status
|
|
1025
|
-
*/
|
|
1026
|
-
export const hostingAdvancedServerStatus = (hostingId, hostingAdvancedServerStatusBody, options) => {
|
|
1027
|
-
return axios.put(`/v1/hosting/${hostingId}/advanced/server`, hostingAdvancedServerStatusBody, options);
|
|
1028
|
-
};
|
|
1029
|
-
export const getHostingAdvancedServerStatusMutationOptions = (options) => {
|
|
1030
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1031
|
-
const mutationFn = (props) => {
|
|
1032
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1033
|
-
return hostingAdvancedServerStatus(hostingId, data, axiosOptions);
|
|
1034
|
-
};
|
|
1035
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1036
|
-
};
|
|
1037
|
-
/**
|
|
1038
|
-
* @summary server_status
|
|
1039
|
-
*/
|
|
1040
|
-
export const useHostingAdvancedServerStatus = (options) => {
|
|
1041
|
-
const mutationOptions = getHostingAdvancedServerStatusMutationOptions(options);
|
|
1042
|
-
return useMutation(mutationOptions);
|
|
1043
|
-
};
|
|
1044
|
-
/**
|
|
1045
|
-
* Update user account's password
|
|
1046
|
-
* @summary Update user account password
|
|
1047
|
-
*/
|
|
1048
|
-
export const hostingAdvancedPassword = (hostingId, hostingAdvancedPasswordBody, options) => {
|
|
1049
|
-
return axios.put(`/v1/hosting/${hostingId}/advanced/server/password`, hostingAdvancedPasswordBody, options);
|
|
1050
|
-
};
|
|
1051
|
-
export const getHostingAdvancedPasswordMutationOptions = (options) => {
|
|
1052
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1053
|
-
const mutationFn = (props) => {
|
|
1054
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1055
|
-
return hostingAdvancedPassword(hostingId, data, axiosOptions);
|
|
1056
|
-
};
|
|
1057
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1058
|
-
};
|
|
1059
|
-
/**
|
|
1060
|
-
* @summary Update user account password
|
|
1061
|
-
*/
|
|
1062
|
-
export const useHostingAdvancedPassword = (options) => {
|
|
1063
|
-
const mutationOptions = getHostingAdvancedPasswordMutationOptions(options);
|
|
1064
|
-
return useMutation(mutationOptions);
|
|
1065
|
-
};
|
|
1066
|
-
/**
|
|
1067
|
-
* Returns the hosting sso_whm login url
|
|
1068
|
-
* @summary hosting sso_whm
|
|
1069
|
-
*/
|
|
1070
|
-
export const hostingAdvancedSsoWhm = (hostingId, options) => {
|
|
1071
|
-
return axios.get(`/v1/hosting/${hostingId}/advanced/sso_whm`, options);
|
|
1072
|
-
};
|
|
1073
|
-
export const getHostingAdvancedSsoWhmQueryKey = (hostingId) => {
|
|
1074
|
-
return [`/v1/hosting/${hostingId}/advanced/sso_whm`];
|
|
1075
|
-
};
|
|
1076
|
-
export const getHostingAdvancedSsoWhmQueryOptions = (hostingId, options) => {
|
|
1077
|
-
var _a;
|
|
1078
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1079
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSsoWhmQueryKey(hostingId);
|
|
1080
|
-
const queryFn = ({ signal }) => hostingAdvancedSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1081
|
-
return Object.assign({ queryKey,
|
|
1082
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1083
|
-
};
|
|
1084
|
-
/**
|
|
1085
|
-
* @summary hosting sso_whm
|
|
1086
|
-
*/
|
|
1087
|
-
export function useHostingAdvancedSsoWhm(hostingId, options) {
|
|
1088
|
-
const queryOptions = getHostingAdvancedSsoWhmQueryOptions(hostingId, options);
|
|
1089
|
-
const query = useQuery(queryOptions);
|
|
1090
|
-
query.queryKey = queryOptions.queryKey;
|
|
1091
|
-
return query;
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* Returns the hosting system_console url
|
|
1095
|
-
* @summary hosting system_console
|
|
1096
|
-
*/
|
|
1097
|
-
export const hostingAdvancedSystemConsole = (hostingId, options) => {
|
|
1098
|
-
return axios.get(`/v1/hosting/${hostingId}/advanced/system-console`, options);
|
|
1099
|
-
};
|
|
1100
|
-
export const getHostingAdvancedSystemConsoleQueryKey = (hostingId) => {
|
|
1101
|
-
return [`/v1/hosting/${hostingId}/advanced/system-console`];
|
|
1102
|
-
};
|
|
1103
|
-
export const getHostingAdvancedSystemConsoleQueryOptions = (hostingId, options) => {
|
|
1104
|
-
var _a;
|
|
1105
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1106
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSystemConsoleQueryKey(hostingId);
|
|
1107
|
-
const queryFn = ({ signal }) => hostingAdvancedSystemConsole(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1108
|
-
return Object.assign({ queryKey,
|
|
1109
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1110
|
-
};
|
|
1111
|
-
/**
|
|
1112
|
-
* @summary hosting system_console
|
|
1113
|
-
*/
|
|
1114
|
-
export function useHostingAdvancedSystemConsole(hostingId, options) {
|
|
1115
|
-
const queryOptions = getHostingAdvancedSystemConsoleQueryOptions(hostingId, options);
|
|
1116
|
-
const query = useQuery(queryOptions);
|
|
1117
|
-
query.queryKey = queryOptions.queryKey;
|
|
1118
|
-
return query;
|
|
1119
|
-
}
|
|
1120
|
-
/**
|
|
1121
|
-
* Returns the hosting capabilities
|
|
1122
|
-
* @summary hosting capabilities
|
|
1123
|
-
*/
|
|
1124
|
-
export const hostingCapabilities = (hostingId, options) => {
|
|
1125
|
-
return axios.get(`/v1/hosting/${hostingId}/capabilities`, options);
|
|
1126
|
-
};
|
|
1127
|
-
export const getHostingCapabilitiesQueryKey = (hostingId) => {
|
|
1128
|
-
return [`/v1/hosting/${hostingId}/capabilities`];
|
|
1129
|
-
};
|
|
1130
|
-
export const getHostingCapabilitiesQueryOptions = (hostingId, options) => {
|
|
1131
|
-
var _a;
|
|
1132
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1133
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingCapabilitiesQueryKey(hostingId);
|
|
1134
|
-
const queryFn = ({ signal }) => hostingCapabilities(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1135
|
-
return Object.assign({ queryKey,
|
|
1136
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1137
|
-
};
|
|
1138
|
-
/**
|
|
1139
|
-
* @summary hosting capabilities
|
|
1140
|
-
*/
|
|
1141
|
-
export function useHostingCapabilities(hostingId, options) {
|
|
1142
|
-
const queryOptions = getHostingCapabilitiesQueryOptions(hostingId, options);
|
|
1143
|
-
const query = useQuery(queryOptions);
|
|
1144
|
-
query.queryKey = queryOptions.queryKey;
|
|
1145
|
-
return query;
|
|
1146
|
-
}
|
|
1147
|
-
/**
|
|
1148
|
-
* Creates cloudflare basic addon
|
|
1149
|
-
* @deprecated
|
|
1150
|
-
* @summary Deprecated - Install cloudflare basic addon
|
|
1151
|
-
*/
|
|
1152
|
-
export const addonCloudflare = (hostingId, addonCloudflareBody, options) => {
|
|
1153
|
-
return axios.post(`/v1/hosting/${hostingId}/cloudflare`, addonCloudflareBody, options);
|
|
1154
|
-
};
|
|
1155
|
-
export const getAddonCloudflareMutationOptions = (options) => {
|
|
1156
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1157
|
-
const mutationFn = (props) => {
|
|
1158
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1159
|
-
return addonCloudflare(hostingId, data, axiosOptions);
|
|
1160
|
-
};
|
|
1161
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1162
|
-
};
|
|
1163
|
-
/**
|
|
1164
|
-
* @deprecated
|
|
1165
|
-
* @summary Deprecated - Install cloudflare basic addon
|
|
1166
|
-
*/
|
|
1167
|
-
export const useAddonCloudflare = (options) => {
|
|
1168
|
-
const mutationOptions = getAddonCloudflareMutationOptions(options);
|
|
1169
|
-
return useMutation(mutationOptions);
|
|
1170
|
-
};
|
|
1171
|
-
/**
|
|
1172
|
-
* Returns a list of cron jobs
|
|
1173
|
-
* @summary cron_list
|
|
1174
|
-
*/
|
|
1175
|
-
export const listCrons = (hostingId, options) => {
|
|
1176
|
-
return axios.get(`/v1/hosting/${hostingId}/crontab`, options);
|
|
1177
|
-
};
|
|
1178
|
-
export const getListCronsQueryKey = (hostingId) => {
|
|
1179
|
-
return [`/v1/hosting/${hostingId}/crontab`];
|
|
1180
|
-
};
|
|
1181
|
-
export const getListCronsQueryOptions = (hostingId, options) => {
|
|
1182
|
-
var _a;
|
|
1183
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1184
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getListCronsQueryKey(hostingId);
|
|
1185
|
-
const queryFn = ({ signal, }) => listCrons(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1186
|
-
return Object.assign({ queryKey,
|
|
1187
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1188
|
-
};
|
|
1189
|
-
/**
|
|
1190
|
-
* @summary cron_list
|
|
1191
|
-
*/
|
|
1192
|
-
export function useListCrons(hostingId, options) {
|
|
1193
|
-
const queryOptions = getListCronsQueryOptions(hostingId, options);
|
|
1194
|
-
const query = useQuery(queryOptions);
|
|
1195
|
-
query.queryKey = queryOptions.queryKey;
|
|
1196
|
-
return query;
|
|
1197
|
-
}
|
|
1198
|
-
/**
|
|
1199
|
-
* Adds a new cron job
|
|
1200
|
-
* @summary cron_add
|
|
1201
|
-
*/
|
|
1202
|
-
export const addCron = (hostingId, addCronBody, options) => {
|
|
1203
|
-
return axios.post(`/v1/hosting/${hostingId}/crontab`, addCronBody, options);
|
|
1204
|
-
};
|
|
1205
|
-
export const getAddCronMutationOptions = (options) => {
|
|
1206
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1207
|
-
const mutationFn = (props) => {
|
|
1208
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1209
|
-
return addCron(hostingId, data, axiosOptions);
|
|
1210
|
-
};
|
|
1211
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1212
|
-
};
|
|
1213
|
-
/**
|
|
1214
|
-
* @summary cron_add
|
|
1215
|
-
*/
|
|
1216
|
-
export const useAddCron = (options) => {
|
|
1217
|
-
const mutationOptions = getAddCronMutationOptions(options);
|
|
1218
|
-
return useMutation(mutationOptions);
|
|
1219
|
-
};
|
|
1220
|
-
/**
|
|
1221
|
-
* Updates a cron job
|
|
1222
|
-
* @summary cron_update
|
|
1223
|
-
*/
|
|
1224
|
-
export const updateCron = (hostingId, updateCronBody, options) => {
|
|
1225
|
-
return axios.put(`/v1/hosting/${hostingId}/crontab`, updateCronBody, options);
|
|
1226
|
-
};
|
|
1227
|
-
export const getUpdateCronMutationOptions = (options) => {
|
|
1228
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1229
|
-
const mutationFn = (props) => {
|
|
1230
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1231
|
-
return updateCron(hostingId, data, axiosOptions);
|
|
1232
|
-
};
|
|
1233
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1234
|
-
};
|
|
1235
|
-
/**
|
|
1236
|
-
* @summary cron_update
|
|
1237
|
-
*/
|
|
1238
|
-
export const useUpdateCron = (options) => {
|
|
1239
|
-
const mutationOptions = getUpdateCronMutationOptions(options);
|
|
1240
|
-
return useMutation(mutationOptions);
|
|
1241
|
-
};
|
|
1242
|
-
/**
|
|
1243
|
-
* Deletes a cron job
|
|
1244
|
-
* @summary cron_delete
|
|
1245
|
-
*/
|
|
1246
|
-
export const cron = (hostingId, cronBody, options) => {
|
|
1247
|
-
return axios.delete(`/v1/hosting/${hostingId}/crontab`, Object.assign({ data: cronBody }, options));
|
|
1248
|
-
};
|
|
1249
|
-
export const getCronMutationOptions = (options) => {
|
|
1250
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1251
|
-
const mutationFn = (props) => {
|
|
1252
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1253
|
-
return cron(hostingId, data, axiosOptions);
|
|
1254
|
-
};
|
|
1255
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1256
|
-
};
|
|
1257
|
-
/**
|
|
1258
|
-
* @summary cron_delete
|
|
1259
|
-
*/
|
|
1260
|
-
export const useCron = (options) => {
|
|
1261
|
-
const mutationOptions = getCronMutationOptions(options);
|
|
1262
|
-
return useMutation(mutationOptions);
|
|
1263
|
-
};
|
|
1264
|
-
/**
|
|
1265
|
-
* Add a new db to an account
|
|
1266
|
-
* @summary Create a database for an account
|
|
1267
|
-
*/
|
|
1268
|
-
export const dbAdd = (hostingId, dbAddBody, options) => {
|
|
1269
|
-
return axios.post(`/v1/hosting/${hostingId}/db`, dbAddBody, options);
|
|
1270
|
-
};
|
|
1271
|
-
export const getDbAddMutationOptions = (options) => {
|
|
1272
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1273
|
-
const mutationFn = (props) => {
|
|
1274
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1275
|
-
return dbAdd(hostingId, data, axiosOptions);
|
|
1276
|
-
};
|
|
1277
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1278
|
-
};
|
|
1279
|
-
/**
|
|
1280
|
-
* @summary Create a database for an account
|
|
1281
|
-
*/
|
|
1282
|
-
export const useDbAdd = (options) => {
|
|
1283
|
-
const mutationOptions = getDbAddMutationOptions(options);
|
|
1284
|
-
return useMutation(mutationOptions);
|
|
1285
|
-
};
|
|
1286
|
-
/**
|
|
1287
|
-
* Delete db account
|
|
1288
|
-
* @summary Delete db account
|
|
1289
|
-
*/
|
|
1290
|
-
export const db = (hostingId, dbBody, options) => {
|
|
1291
|
-
return axios.delete(`/v1/hosting/${hostingId}/db`, Object.assign({ data: dbBody }, options));
|
|
1292
|
-
};
|
|
1293
|
-
export const getDbMutationOptions = (options) => {
|
|
1294
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1295
|
-
const mutationFn = (props) => {
|
|
1296
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1297
|
-
return db(hostingId, data, axiosOptions);
|
|
1298
|
-
};
|
|
1299
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1300
|
-
};
|
|
1301
|
-
/**
|
|
1302
|
-
* @summary Delete db account
|
|
1303
|
-
*/
|
|
1304
|
-
export const useDb = (options) => {
|
|
1305
|
-
const mutationOptions = getDbMutationOptions(options);
|
|
1306
|
-
return useMutation(mutationOptions);
|
|
1307
|
-
};
|
|
1308
|
-
/**
|
|
1309
|
-
* List all DB name
|
|
1310
|
-
* @summary Get list of database name
|
|
1311
|
-
*/
|
|
1312
|
-
export const dbList = (hostingId, options) => {
|
|
1313
|
-
return axios.get(`/v1/hosting/${hostingId}/db`, options);
|
|
1314
|
-
};
|
|
1315
|
-
export const getDbListQueryKey = (hostingId) => {
|
|
1316
|
-
return [`/v1/hosting/${hostingId}/db`];
|
|
1317
|
-
};
|
|
1318
|
-
export const getDbListQueryOptions = (hostingId, options) => {
|
|
1319
|
-
var _a;
|
|
1320
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1321
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbListQueryKey(hostingId);
|
|
1322
|
-
const queryFn = ({ signal, }) => dbList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1323
|
-
return Object.assign({ queryKey,
|
|
1324
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1325
|
-
};
|
|
1326
|
-
/**
|
|
1327
|
-
* @summary Get list of database name
|
|
1328
|
-
*/
|
|
1329
|
-
export function useDbList(hostingId, options) {
|
|
1330
|
-
const queryOptions = getDbListQueryOptions(hostingId, options);
|
|
1331
|
-
const query = useQuery(queryOptions);
|
|
1332
|
-
query.queryKey = queryOptions.queryKey;
|
|
1333
|
-
return query;
|
|
1334
|
-
}
|
|
1335
|
-
/**
|
|
1336
|
-
* Check database.
|
|
1337
|
-
* @summary Check database.
|
|
1338
|
-
*/
|
|
1339
|
-
export const dbCheckDatabase = (hostingId, dbCheckDatabaseBody, options) => {
|
|
1340
|
-
return axios.post(`/v1/hosting/${hostingId}/db/check`, dbCheckDatabaseBody, options);
|
|
1341
|
-
};
|
|
1342
|
-
export const getDbCheckDatabaseMutationOptions = (options) => {
|
|
1343
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1344
|
-
const mutationFn = (props) => {
|
|
1345
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1346
|
-
return dbCheckDatabase(hostingId, data, axiosOptions);
|
|
1347
|
-
};
|
|
1348
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1349
|
-
};
|
|
1350
|
-
/**
|
|
1351
|
-
* @summary Check database.
|
|
1352
|
-
*/
|
|
1353
|
-
export const useDbCheckDatabase = (options) => {
|
|
1354
|
-
const mutationOptions = getDbCheckDatabaseMutationOptions(options);
|
|
1355
|
-
return useMutation(mutationOptions);
|
|
1356
|
-
};
|
|
1357
|
-
/**
|
|
1358
|
-
* Returns a list of db and table limits and usage.
|
|
1359
|
-
* @summary DB usage
|
|
1360
|
-
*/
|
|
1361
|
-
export const dbUsage = (hostingId, options) => {
|
|
1362
|
-
return axios.get(`/v1/hosting/${hostingId}/db/usage`, options);
|
|
1363
|
-
};
|
|
1364
|
-
export const getDbUsageQueryKey = (hostingId) => {
|
|
1365
|
-
return [`/v1/hosting/${hostingId}/db/usage`];
|
|
1366
|
-
};
|
|
1367
|
-
export const getDbUsageQueryOptions = (hostingId, options) => {
|
|
1368
|
-
var _a;
|
|
1369
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1370
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUsageQueryKey(hostingId);
|
|
1371
|
-
const queryFn = ({ signal, }) => dbUsage(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1372
|
-
return Object.assign({ queryKey,
|
|
1373
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1374
|
-
};
|
|
1375
|
-
/**
|
|
1376
|
-
* @summary DB usage
|
|
1377
|
-
*/
|
|
1378
|
-
export function useDbUsage(hostingId, options) {
|
|
1379
|
-
const queryOptions = getDbUsageQueryOptions(hostingId, options);
|
|
1380
|
-
const query = useQuery(queryOptions);
|
|
1381
|
-
query.queryKey = queryOptions.queryKey;
|
|
1382
|
-
return query;
|
|
1383
|
-
}
|
|
1384
|
-
/**
|
|
1385
|
-
* Update database user password
|
|
1386
|
-
* @summary Update database user password
|
|
1387
|
-
*/
|
|
1388
|
-
export const dbUserPasswordSet = (hostingId, dbUserPasswordSetBody, options) => {
|
|
1389
|
-
return axios.post(`/v1/hosting/${hostingId}/db/user/password`, dbUserPasswordSetBody, options);
|
|
1390
|
-
};
|
|
1391
|
-
export const getDbUserPasswordSetMutationOptions = (options) => {
|
|
1392
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1393
|
-
const mutationFn = (props) => {
|
|
1394
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1395
|
-
return dbUserPasswordSet(hostingId, data, axiosOptions);
|
|
1396
|
-
};
|
|
1397
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1398
|
-
};
|
|
1399
|
-
/**
|
|
1400
|
-
* @summary Update database user password
|
|
1401
|
-
*/
|
|
1402
|
-
export const useDbUserPasswordSet = (options) => {
|
|
1403
|
-
const mutationOptions = getDbUserPasswordSetMutationOptions(options);
|
|
1404
|
-
return useMutation(mutationOptions);
|
|
1405
|
-
};
|
|
1406
|
-
/**
|
|
1407
|
-
* Get user privileges on a database.
|
|
1408
|
-
* @summary Get user privileges on a database.
|
|
1409
|
-
*/
|
|
1410
|
-
export const dbUserPrivsGet = (hostingId, params, options) => {
|
|
1411
|
-
return axios.get(`/v1/hosting/${hostingId}/db/user/privileges`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
1412
|
-
};
|
|
1413
|
-
export const getDbUserPrivsGetQueryKey = (hostingId, params) => {
|
|
1414
|
-
return [
|
|
1415
|
-
`/v1/hosting/${hostingId}/db/user/privileges`,
|
|
1416
|
-
...(params ? [params] : []),
|
|
1417
|
-
];
|
|
1418
|
-
};
|
|
1419
|
-
export const getDbUserPrivsGetQueryOptions = (hostingId, params, options) => {
|
|
1420
|
-
var _a;
|
|
1421
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1422
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserPrivsGetQueryKey(hostingId, params);
|
|
1423
|
-
const queryFn = ({ signal, }) => dbUserPrivsGet(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
1424
|
-
return Object.assign({ queryKey,
|
|
1425
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1426
|
-
};
|
|
1427
|
-
/**
|
|
1428
|
-
* @summary Get user privileges on a database.
|
|
1429
|
-
*/
|
|
1430
|
-
export function useDbUserPrivsGet(hostingId, params, options) {
|
|
1431
|
-
const queryOptions = getDbUserPrivsGetQueryOptions(hostingId, params, options);
|
|
1432
|
-
const query = useQuery(queryOptions);
|
|
1433
|
-
query.queryKey = queryOptions.queryKey;
|
|
1434
|
-
return query;
|
|
1435
|
-
}
|
|
1436
|
-
/**
|
|
1437
|
-
* Add/Update user privileges on a database.
|
|
1438
|
-
* @summary Add/Update user privileges on a database.
|
|
1439
|
-
*/
|
|
1440
|
-
export const dbUserPrivsSet = (hostingId, dbUserPrivsSetBody, options) => {
|
|
1441
|
-
return axios.post(`/v1/hosting/${hostingId}/db/user/privileges`, dbUserPrivsSetBody, options);
|
|
1442
|
-
};
|
|
1443
|
-
export const getDbUserPrivsSetMutationOptions = (options) => {
|
|
1444
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1445
|
-
const mutationFn = (props) => {
|
|
1446
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1447
|
-
return dbUserPrivsSet(hostingId, data, axiosOptions);
|
|
1448
|
-
};
|
|
1449
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1450
|
-
};
|
|
1451
|
-
/**
|
|
1452
|
-
* @summary Add/Update user privileges on a database.
|
|
1453
|
-
*/
|
|
1454
|
-
export const useDbUserPrivsSet = (options) => {
|
|
1455
|
-
const mutationOptions = getDbUserPrivsSetMutationOptions(options);
|
|
1456
|
-
return useMutation(mutationOptions);
|
|
1457
|
-
};
|
|
1458
|
-
/**
|
|
1459
|
-
* Creates a database user with privileges. The final username cannot exceed 16 characters, and will have the cpanel account username's first eight characters prepended to it.
|
|
1460
|
-
* @summary Create a database user with privileges
|
|
1461
|
-
*/
|
|
1462
|
-
export const dbUserAdd = (hostingId, dbUserAddBody, options) => {
|
|
1463
|
-
return axios.post(`/v1/hosting/${hostingId}/db/users`, dbUserAddBody, options);
|
|
1464
|
-
};
|
|
1465
|
-
export const getDbUserAddMutationOptions = (options) => {
|
|
1466
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1467
|
-
const mutationFn = (props) => {
|
|
1468
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1469
|
-
return dbUserAdd(hostingId, data, axiosOptions);
|
|
1470
|
-
};
|
|
1471
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1472
|
-
};
|
|
1473
|
-
/**
|
|
1474
|
-
* @summary Create a database user with privileges
|
|
1475
|
-
*/
|
|
1476
|
-
export const useDbUserAdd = (options) => {
|
|
1477
|
-
const mutationOptions = getDbUserAddMutationOptions(options);
|
|
1478
|
-
return useMutation(mutationOptions);
|
|
1479
|
-
};
|
|
1480
|
-
/**
|
|
1481
|
-
* Delete db user
|
|
1482
|
-
* @summary Delete db user
|
|
1483
|
-
*/
|
|
1484
|
-
export const dbUserDelete = (hostingId, dbUserDeleteBody, options) => {
|
|
1485
|
-
return axios.delete(`/v1/hosting/${hostingId}/db/users`, Object.assign({ data: dbUserDeleteBody }, options));
|
|
1486
|
-
};
|
|
1487
|
-
export const getDbUserDeleteMutationOptions = (options) => {
|
|
1488
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1489
|
-
const mutationFn = (props) => {
|
|
1490
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1491
|
-
return dbUserDelete(hostingId, data, axiosOptions);
|
|
1492
|
-
};
|
|
1493
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1494
|
-
};
|
|
1495
|
-
/**
|
|
1496
|
-
* @summary Delete db user
|
|
1497
|
-
*/
|
|
1498
|
-
export const useDbUserDelete = (options) => {
|
|
1499
|
-
const mutationOptions = getDbUserDeleteMutationOptions(options);
|
|
1500
|
-
return useMutation(mutationOptions);
|
|
1501
|
-
};
|
|
1502
|
-
/**
|
|
1503
|
-
* List all DB users
|
|
1504
|
-
* @summary Get list of db users
|
|
1505
|
-
*/
|
|
1506
|
-
export const dbUserList = (hostingId, options) => {
|
|
1507
|
-
return axios.get(`/v1/hosting/${hostingId}/db/users`, options);
|
|
1508
|
-
};
|
|
1509
|
-
export const getDbUserListQueryKey = (hostingId) => {
|
|
1510
|
-
return [`/v1/hosting/${hostingId}/db/users`];
|
|
1511
|
-
};
|
|
1512
|
-
export const getDbUserListQueryOptions = (hostingId, options) => {
|
|
1513
|
-
var _a;
|
|
1514
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1515
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserListQueryKey(hostingId);
|
|
1516
|
-
const queryFn = ({ signal, }) => dbUserList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1517
|
-
return Object.assign({ queryKey,
|
|
1518
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1519
|
-
};
|
|
1520
|
-
/**
|
|
1521
|
-
* @summary Get list of db users
|
|
1522
|
-
*/
|
|
1523
|
-
export function useDbUserList(hostingId, options) {
|
|
1524
|
-
const queryOptions = getDbUserListQueryOptions(hostingId, options);
|
|
1525
|
-
const query = useQuery(queryOptions);
|
|
1526
|
-
query.queryKey = queryOptions.queryKey;
|
|
1527
|
-
return query;
|
|
1528
|
-
}
|
|
1529
|
-
/**
|
|
1530
|
-
* Rename db user
|
|
1531
|
-
* @summary Rename db user
|
|
1532
|
-
*/
|
|
1533
|
-
export const dbUserRename = (hostingId, dbUserRenameBody, options) => {
|
|
1534
|
-
return axios.put(`/v1/hosting/${hostingId}/db/users`, dbUserRenameBody, options);
|
|
1535
|
-
};
|
|
1536
|
-
export const getDbUserRenameMutationOptions = (options) => {
|
|
1537
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1538
|
-
const mutationFn = (props) => {
|
|
1539
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1540
|
-
return dbUserRename(hostingId, data, axiosOptions);
|
|
1541
|
-
};
|
|
1542
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1543
|
-
};
|
|
1544
|
-
/**
|
|
1545
|
-
* @summary Rename db user
|
|
1546
|
-
*/
|
|
1547
|
-
export const useDbUserRename = (options) => {
|
|
1548
|
-
const mutationOptions = getDbUserRenameMutationOptions(options);
|
|
1549
|
-
return useMutation(mutationOptions);
|
|
1550
|
-
};
|
|
1551
|
-
/**
|
|
1552
|
-
* Returns a list of domains
|
|
1553
|
-
* @summary domain list
|
|
1554
|
-
*/
|
|
1555
|
-
export const domains = (hostingId, params, options) => {
|
|
1556
|
-
return axios.get(`/v1/hosting/${hostingId}/domains`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
1557
|
-
};
|
|
1558
|
-
export const getDomainsQueryKey = (hostingId, params) => {
|
|
1559
|
-
return [
|
|
1560
|
-
`/v1/hosting/${hostingId}/domains`,
|
|
1561
|
-
...(params ? [params] : []),
|
|
1562
|
-
];
|
|
1563
|
-
};
|
|
1564
|
-
export const getDomainsQueryOptions = (hostingId, params, options) => {
|
|
1565
|
-
var _a;
|
|
1566
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1567
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainsQueryKey(hostingId, params);
|
|
1568
|
-
const queryFn = ({ signal, }) => domains(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
1569
|
-
return Object.assign({ queryKey,
|
|
1570
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1571
|
-
};
|
|
1572
|
-
/**
|
|
1573
|
-
* @summary domain list
|
|
1574
|
-
*/
|
|
1575
|
-
export function useDomains(hostingId, params, options) {
|
|
1576
|
-
const queryOptions = getDomainsQueryOptions(hostingId, params, options);
|
|
1577
|
-
const query = useQuery(queryOptions);
|
|
1578
|
-
query.queryKey = queryOptions.queryKey;
|
|
1579
|
-
return query;
|
|
1580
|
-
}
|
|
1581
|
-
/**
|
|
1582
|
-
* Unassign the domain associated with the hosting account
|
|
1583
|
-
* @summary Unassign the domain
|
|
1584
|
-
*/
|
|
1585
|
-
export const hostingDomainsUnassign = (hostingId, hostingDomainsUnassignBody, options) => {
|
|
1586
|
-
return axios.post(`/v1/hosting/${hostingId}/domains/unassign`, hostingDomainsUnassignBody, options);
|
|
1587
|
-
};
|
|
1588
|
-
export const getHostingDomainsUnassignMutationOptions = (options) => {
|
|
1589
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1590
|
-
const mutationFn = (props) => {
|
|
1591
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1592
|
-
return hostingDomainsUnassign(hostingId, data, axiosOptions);
|
|
1593
|
-
};
|
|
1594
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1595
|
-
};
|
|
1596
|
-
/**
|
|
1597
|
-
* @summary Unassign the domain
|
|
1598
|
-
*/
|
|
1599
|
-
export const useHostingDomainsUnassign = (options) => {
|
|
1600
|
-
const mutationOptions = getHostingDomainsUnassignMutationOptions(options);
|
|
1601
|
-
return useMutation(mutationOptions);
|
|
1602
|
-
};
|
|
1603
|
-
/**
|
|
1604
|
-
* Returns info about an existing ecommerce addon otherwise it returns null
|
|
1605
|
-
* @summary ecommerce info
|
|
1606
|
-
*/
|
|
1607
|
-
export const hostingEcommerceInfo = (hostingId, options) => {
|
|
1608
|
-
return axios.get(`/v1/hosting/${hostingId}/ecommerce`, options);
|
|
1609
|
-
};
|
|
1610
|
-
export const getHostingEcommerceInfoQueryKey = (hostingId) => {
|
|
1611
|
-
return [`/v1/hosting/${hostingId}/ecommerce`];
|
|
1612
|
-
};
|
|
1613
|
-
export const getHostingEcommerceInfoQueryOptions = (hostingId, options) => {
|
|
1614
|
-
var _a;
|
|
1615
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1616
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingEcommerceInfoQueryKey(hostingId);
|
|
1617
|
-
const queryFn = ({ signal }) => hostingEcommerceInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1618
|
-
return Object.assign({ queryKey,
|
|
1619
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1620
|
-
};
|
|
1621
|
-
/**
|
|
1622
|
-
* @summary ecommerce info
|
|
1623
|
-
*/
|
|
1624
|
-
export function useHostingEcommerceInfo(hostingId, options) {
|
|
1625
|
-
const queryOptions = getHostingEcommerceInfoQueryOptions(hostingId, options);
|
|
1626
|
-
const query = useQuery(queryOptions);
|
|
1627
|
-
query.queryKey = queryOptions.queryKey;
|
|
1628
|
-
return query;
|
|
1629
|
-
}
|
|
1630
|
-
/**
|
|
1631
|
-
* Returns a list of FTP accounts.
|
|
1632
|
-
* @summary ftp list
|
|
1633
|
-
*/
|
|
1634
|
-
export const hostingFtpList = (hostingId, options) => {
|
|
1635
|
-
return axios.get(`/v1/hosting/${hostingId}/ftp`, options);
|
|
1636
|
-
};
|
|
1637
|
-
export const getHostingFtpListQueryKey = (hostingId) => {
|
|
1638
|
-
return [`/v1/hosting/${hostingId}/ftp`];
|
|
1639
|
-
};
|
|
1640
|
-
export const getHostingFtpListQueryOptions = (hostingId, options) => {
|
|
1641
|
-
var _a;
|
|
1642
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1643
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingFtpListQueryKey(hostingId);
|
|
1644
|
-
const queryFn = ({ signal, }) => hostingFtpList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1645
|
-
return Object.assign({ queryKey,
|
|
1646
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1647
|
-
};
|
|
1648
|
-
/**
|
|
1649
|
-
* @summary ftp list
|
|
1650
|
-
*/
|
|
1651
|
-
export function useHostingFtpList(hostingId, options) {
|
|
1652
|
-
const queryOptions = getHostingFtpListQueryOptions(hostingId, options);
|
|
1653
|
-
const query = useQuery(queryOptions);
|
|
1654
|
-
query.queryKey = queryOptions.queryKey;
|
|
1655
|
-
return query;
|
|
1656
|
-
}
|
|
1657
|
-
/**
|
|
1658
|
-
* Add ftp account
|
|
1659
|
-
* @summary Add ftp account
|
|
1660
|
-
*/
|
|
1661
|
-
export const hostingFtpAdd = (hostingId, hostingFtpAddBody, options) => {
|
|
1662
|
-
return axios.post(`/v1/hosting/${hostingId}/ftp`, hostingFtpAddBody, options);
|
|
1663
|
-
};
|
|
1664
|
-
export const getHostingFtpAddMutationOptions = (options) => {
|
|
1665
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1666
|
-
const mutationFn = (props) => {
|
|
1667
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1668
|
-
return hostingFtpAdd(hostingId, data, axiosOptions);
|
|
1669
|
-
};
|
|
1670
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1671
|
-
};
|
|
1672
|
-
/**
|
|
1673
|
-
* @summary Add ftp account
|
|
1674
|
-
*/
|
|
1675
|
-
export const useHostingFtpAdd = (options) => {
|
|
1676
|
-
const mutationOptions = getHostingFtpAddMutationOptions(options);
|
|
1677
|
-
return useMutation(mutationOptions);
|
|
1678
|
-
};
|
|
1679
|
-
/**
|
|
1680
|
-
* Update ftp account
|
|
1681
|
-
* @summary Update ftp account
|
|
1682
|
-
*/
|
|
1683
|
-
export const hostingFtpUpdate = (hostingId, hostingFtpUpdateBody, options) => {
|
|
1684
|
-
return axios.put(`/v1/hosting/${hostingId}/ftp`, hostingFtpUpdateBody, options);
|
|
1685
|
-
};
|
|
1686
|
-
export const getHostingFtpUpdateMutationOptions = (options) => {
|
|
1687
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1688
|
-
const mutationFn = (props) => {
|
|
1689
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1690
|
-
return hostingFtpUpdate(hostingId, data, axiosOptions);
|
|
1691
|
-
};
|
|
1692
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1693
|
-
};
|
|
1694
|
-
/**
|
|
1695
|
-
* @summary Update ftp account
|
|
1696
|
-
*/
|
|
1697
|
-
export const useHostingFtpUpdate = (options) => {
|
|
1698
|
-
const mutationOptions = getHostingFtpUpdateMutationOptions(options);
|
|
1699
|
-
return useMutation(mutationOptions);
|
|
1700
|
-
};
|
|
1701
|
-
/**
|
|
1702
|
-
* Delete ftp account
|
|
1703
|
-
* @summary Delete ftp account
|
|
1704
|
-
*/
|
|
1705
|
-
export const hostingFtp = (hostingId, hostingFtpBody, options) => {
|
|
1706
|
-
return axios.delete(`/v1/hosting/${hostingId}/ftp`, Object.assign({ data: hostingFtpBody }, options));
|
|
1707
|
-
};
|
|
1708
|
-
export const getHostingFtpMutationOptions = (options) => {
|
|
1709
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1710
|
-
const mutationFn = (props) => {
|
|
1711
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1712
|
-
return hostingFtp(hostingId, data, axiosOptions);
|
|
1713
|
-
};
|
|
1714
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1715
|
-
};
|
|
1716
|
-
/**
|
|
1717
|
-
* @summary Delete ftp account
|
|
1718
|
-
*/
|
|
1719
|
-
export const useHostingFtp = (options) => {
|
|
1720
|
-
const mutationOptions = getHostingFtpMutationOptions(options);
|
|
1721
|
-
return useMutation(mutationOptions);
|
|
1722
|
-
};
|
|
1723
|
-
/**
|
|
1724
|
-
* Returns hosting account info
|
|
1725
|
-
* @summary Hosting info
|
|
1726
|
-
*/
|
|
1727
|
-
export const hostingInfo = (hostingId, options) => {
|
|
1728
|
-
return axios.get(`/v1/hosting/${hostingId}/info`, options);
|
|
1729
|
-
};
|
|
1730
|
-
export const getHostingInfoQueryKey = (hostingId) => {
|
|
1731
|
-
return [`/v1/hosting/${hostingId}/info`];
|
|
1732
|
-
};
|
|
1733
|
-
export const getHostingInfoQueryOptions = (hostingId, options) => {
|
|
1734
|
-
var _a;
|
|
1735
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1736
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoQueryKey(hostingId);
|
|
1737
|
-
const queryFn = ({ signal, }) => hostingInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1738
|
-
return Object.assign({ queryKey,
|
|
1739
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1740
|
-
};
|
|
1741
|
-
/**
|
|
1742
|
-
* @summary Hosting info
|
|
1743
|
-
*/
|
|
1744
|
-
export function useHostingInfo(hostingId, options) {
|
|
1745
|
-
const queryOptions = getHostingInfoQueryOptions(hostingId, options);
|
|
1746
|
-
const query = useQuery(queryOptions);
|
|
1747
|
-
query.queryKey = queryOptions.queryKey;
|
|
1748
|
-
return query;
|
|
1749
|
-
}
|
|
1750
|
-
/**
|
|
1751
|
-
* Returns the hosting account's disk usage
|
|
1752
|
-
* @summary info disk usage
|
|
1753
|
-
*/
|
|
1754
|
-
export const hostingInfoDiskUsage = (hostingId, options) => {
|
|
1755
|
-
return axios.get(`/v1/hosting/${hostingId}/info/diskusage`, options);
|
|
1756
|
-
};
|
|
1757
|
-
export const getHostingInfoDiskUsageQueryKey = (hostingId) => {
|
|
1758
|
-
return [`/v1/hosting/${hostingId}/info/diskusage`];
|
|
1759
|
-
};
|
|
1760
|
-
export const getHostingInfoDiskUsageQueryOptions = (hostingId, options) => {
|
|
1761
|
-
var _a;
|
|
1762
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1763
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoDiskUsageQueryKey(hostingId);
|
|
1764
|
-
const queryFn = ({ signal }) => hostingInfoDiskUsage(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1765
|
-
return Object.assign({ queryKey,
|
|
1766
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1767
|
-
};
|
|
1768
|
-
/**
|
|
1769
|
-
* @summary info disk usage
|
|
1770
|
-
*/
|
|
1771
|
-
export function useHostingInfoDiskUsage(hostingId, options) {
|
|
1772
|
-
const queryOptions = getHostingInfoDiskUsageQueryOptions(hostingId, options);
|
|
1773
|
-
const query = useQuery(queryOptions);
|
|
1774
|
-
query.queryKey = queryOptions.queryKey;
|
|
1775
|
-
return query;
|
|
1776
|
-
}
|
|
1777
|
-
/**
|
|
1778
|
-
* Returns lead info for the user of the hosting account
|
|
1779
|
-
* @summary Lead info
|
|
1780
|
-
*/
|
|
1781
|
-
export const hostingLead = (hostingId, params, options) => {
|
|
1782
|
-
return axios.post(`/v1/hosting/${hostingId}/lead`, undefined, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
1783
|
-
};
|
|
1784
|
-
export const getHostingLeadMutationOptions = (options) => {
|
|
1785
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1786
|
-
const mutationFn = (props) => {
|
|
1787
|
-
const { hostingId, params } = props !== null && props !== void 0 ? props : {};
|
|
1788
|
-
return hostingLead(hostingId, params, axiosOptions);
|
|
1789
|
-
};
|
|
1790
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1791
|
-
};
|
|
1792
|
-
/**
|
|
1793
|
-
* @summary Lead info
|
|
1794
|
-
*/
|
|
1795
|
-
export const useHostingLead = (options) => {
|
|
1796
|
-
const mutationOptions = getHostingLeadMutationOptions(options);
|
|
1797
|
-
return useMutation(mutationOptions);
|
|
1798
|
-
};
|
|
1799
|
-
/**
|
|
1800
|
-
* Gets the Wordpress migration status
|
|
1801
|
-
* @summary Wordpress migration status
|
|
1802
|
-
*/
|
|
1803
|
-
export const hostingMigrationStatus = (hostingId, options) => {
|
|
1804
|
-
return axios.get(`/v1/hosting/${hostingId}/migrations`, options);
|
|
1805
|
-
};
|
|
1806
|
-
export const getHostingMigrationStatusQueryKey = (hostingId) => {
|
|
1807
|
-
return [`/v1/hosting/${hostingId}/migrations`];
|
|
1808
|
-
};
|
|
1809
|
-
export const getHostingMigrationStatusQueryOptions = (hostingId, options) => {
|
|
1810
|
-
var _a;
|
|
1811
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1812
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationStatusQueryKey(hostingId);
|
|
1813
|
-
const queryFn = ({ signal }) => hostingMigrationStatus(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1814
|
-
return Object.assign({ queryKey,
|
|
1815
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1816
|
-
};
|
|
1817
|
-
/**
|
|
1818
|
-
* @summary Wordpress migration status
|
|
1819
|
-
*/
|
|
1820
|
-
export function useHostingMigrationStatus(hostingId, options) {
|
|
1821
|
-
const queryOptions = getHostingMigrationStatusQueryOptions(hostingId, options);
|
|
1822
|
-
const query = useQuery(queryOptions);
|
|
1823
|
-
query.queryKey = queryOptions.queryKey;
|
|
1824
|
-
return query;
|
|
1825
|
-
}
|
|
1826
|
-
/**
|
|
1827
|
-
* Adds the wordpressmigrate addon for a given migration id and hosting account
|
|
1828
|
-
* @summary start the migration process for a site
|
|
1829
|
-
*/
|
|
1830
|
-
export const hostingMigrations = (hostingId, hostingMigrationsBody, options) => {
|
|
1831
|
-
return axios.post(`/v1/hosting/${hostingId}/migrations`, hostingMigrationsBody, options);
|
|
1832
|
-
};
|
|
1833
|
-
export const getHostingMigrationsMutationOptions = (options) => {
|
|
1834
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1835
|
-
const mutationFn = (props) => {
|
|
1836
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1837
|
-
return hostingMigrations(hostingId, data, axiosOptions);
|
|
1838
|
-
};
|
|
1839
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1840
|
-
};
|
|
1841
|
-
/**
|
|
1842
|
-
* @summary start the migration process for a site
|
|
1843
|
-
*/
|
|
1844
|
-
export const useHostingMigrations = (options) => {
|
|
1845
|
-
const mutationOptions = getHostingMigrationsMutationOptions(options);
|
|
1846
|
-
return useMutation(mutationOptions);
|
|
1847
|
-
};
|
|
1848
|
-
/**
|
|
1849
|
-
* Checks if Migration ID exists, indicating the site migration is in progress or completed
|
|
1850
|
-
* @deprecated
|
|
1851
|
-
* @summary Deprecated Migration ID check
|
|
1852
|
-
*/
|
|
1853
|
-
export const hostingMigrationsCheck = (hostingId, params, options) => {
|
|
1854
|
-
return axios.get(`/v1/hosting/${hostingId}/migrations/check`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
1855
|
-
};
|
|
1856
|
-
export const getHostingMigrationsCheckQueryKey = (hostingId, params) => {
|
|
1857
|
-
return [
|
|
1858
|
-
`/v1/hosting/${hostingId}/migrations/check`,
|
|
1859
|
-
...(params ? [params] : []),
|
|
1860
|
-
];
|
|
1861
|
-
};
|
|
1862
|
-
export const getHostingMigrationsCheckQueryOptions = (hostingId, params, options) => {
|
|
1863
|
-
var _a;
|
|
1864
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1865
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationsCheckQueryKey(hostingId, params);
|
|
1866
|
-
const queryFn = ({ signal }) => hostingMigrationsCheck(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
1867
|
-
return Object.assign({ queryKey,
|
|
1868
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1869
|
-
};
|
|
1870
|
-
/**
|
|
1871
|
-
* @deprecated
|
|
1872
|
-
* @summary Deprecated Migration ID check
|
|
1873
|
-
*/
|
|
1874
|
-
export function useHostingMigrationsCheck(hostingId, params, options) {
|
|
1875
|
-
const queryOptions = getHostingMigrationsCheckQueryOptions(hostingId, params, options);
|
|
1876
|
-
const query = useQuery(queryOptions);
|
|
1877
|
-
query.queryKey = queryOptions.queryKey;
|
|
1878
|
-
return query;
|
|
1879
|
-
}
|
|
1880
|
-
/**
|
|
1881
|
-
* Post migration event to CWM
|
|
1882
|
-
* @summary hosting migrations event
|
|
1883
|
-
*/
|
|
1884
|
-
export const hostingMigrationsEvent = (hostingId, hostingMigrationsEventBody, options) => {
|
|
1885
|
-
return axios.post(`/v1/hosting/${hostingId}/migrations/event`, hostingMigrationsEventBody, options);
|
|
1886
|
-
};
|
|
1887
|
-
export const getHostingMigrationsEventMutationOptions = (options) => {
|
|
1888
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1889
|
-
const mutationFn = (props) => {
|
|
1890
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1891
|
-
return hostingMigrationsEvent(hostingId, data, axiosOptions);
|
|
1892
|
-
};
|
|
1893
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
1894
|
-
};
|
|
1895
|
-
/**
|
|
1896
|
-
* @summary hosting migrations event
|
|
1897
|
-
*/
|
|
1898
|
-
export const useHostingMigrationsEvent = (options) => {
|
|
1899
|
-
const mutationOptions = getHostingMigrationsEventMutationOptions(options);
|
|
1900
|
-
return useMutation(mutationOptions);
|
|
1901
|
-
};
|
|
1902
|
-
/**
|
|
1903
|
-
* Gets the Wordpress migration information
|
|
1904
|
-
* @summary Wordpress migration information
|
|
1905
|
-
*/
|
|
1906
|
-
export const hostingMigrationInfo = (hostingId, params, options) => {
|
|
1907
|
-
return axios.get(`/v1/hosting/${hostingId}/migrations/info`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
1908
|
-
};
|
|
1909
|
-
export const getHostingMigrationInfoQueryKey = (hostingId, params) => {
|
|
1910
|
-
return [
|
|
1911
|
-
`/v1/hosting/${hostingId}/migrations/info`,
|
|
1912
|
-
...(params ? [params] : []),
|
|
1913
|
-
];
|
|
1914
|
-
};
|
|
1915
|
-
export const getHostingMigrationInfoQueryOptions = (hostingId, params, options) => {
|
|
1916
|
-
var _a;
|
|
1917
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1918
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationInfoQueryKey(hostingId, params);
|
|
1919
|
-
const queryFn = ({ signal }) => hostingMigrationInfo(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
1920
|
-
return Object.assign({ queryKey,
|
|
1921
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1922
|
-
};
|
|
1923
|
-
/**
|
|
1924
|
-
* @summary Wordpress migration information
|
|
1925
|
-
*/
|
|
1926
|
-
export function useHostingMigrationInfo(hostingId, params, options) {
|
|
1927
|
-
const queryOptions = getHostingMigrationInfoQueryOptions(hostingId, params, options);
|
|
1928
|
-
const query = useQuery(queryOptions);
|
|
1929
|
-
query.queryKey = queryOptions.queryKey;
|
|
1930
|
-
return query;
|
|
1931
|
-
}
|
|
1932
|
-
/**
|
|
1933
|
-
* Provides the status of SiteMigration site_scan and deeplink to WordPress admin page
|
|
1934
|
-
* @summary SiteMigration site_scan status
|
|
1935
|
-
*/
|
|
1936
|
-
export const hostingMigrationSiteScanStatus = (hostingId, params, options) => {
|
|
1937
|
-
return axios.get(`/v1/hosting/${hostingId}/migrations/site-scan`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
1938
|
-
};
|
|
1939
|
-
export const getHostingMigrationSiteScanStatusQueryKey = (hostingId, params) => {
|
|
1940
|
-
return [
|
|
1941
|
-
`/v1/hosting/${hostingId}/migrations/site-scan`,
|
|
1942
|
-
...(params ? [params] : []),
|
|
1943
|
-
];
|
|
1944
|
-
};
|
|
1945
|
-
export const getHostingMigrationSiteScanStatusQueryOptions = (hostingId, params, options) => {
|
|
1946
|
-
var _a;
|
|
1947
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1948
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationSiteScanStatusQueryKey(hostingId, params);
|
|
1949
|
-
const queryFn = ({ signal }) => hostingMigrationSiteScanStatus(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
1950
|
-
return Object.assign({ queryKey,
|
|
1951
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1952
|
-
};
|
|
1953
|
-
/**
|
|
1954
|
-
* @summary SiteMigration site_scan status
|
|
1955
|
-
*/
|
|
1956
|
-
export function useHostingMigrationSiteScanStatus(hostingId, params, options) {
|
|
1957
|
-
const queryOptions = getHostingMigrationSiteScanStatusQueryOptions(hostingId, params, options);
|
|
1958
|
-
const query = useQuery(queryOptions);
|
|
1959
|
-
query.queryKey = queryOptions.queryKey;
|
|
1960
|
-
return query;
|
|
1961
|
-
}
|
|
1962
|
-
/**
|
|
1963
|
-
* Returns the hosting brand nameservers
|
|
1964
|
-
* @deprecated
|
|
1965
|
-
* @summary hosting nameservers
|
|
1966
|
-
*/
|
|
1967
|
-
export const hostingNameservers = (hostingId, options) => {
|
|
1968
|
-
return axios.get(`/v1/hosting/${hostingId}/nameservers`, options);
|
|
1969
|
-
};
|
|
1970
|
-
export const getHostingNameserversQueryKey = (hostingId) => {
|
|
1971
|
-
return [`/v1/hosting/${hostingId}/nameservers`];
|
|
1972
|
-
};
|
|
1973
|
-
export const getHostingNameserversQueryOptions = (hostingId, options) => {
|
|
1974
|
-
var _a;
|
|
1975
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1976
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversQueryKey(hostingId);
|
|
1977
|
-
const queryFn = ({ signal }) => hostingNameservers(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1978
|
-
return Object.assign({ queryKey,
|
|
1979
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
1980
|
-
};
|
|
1981
|
-
/**
|
|
1982
|
-
* @deprecated
|
|
1983
|
-
* @summary hosting nameservers
|
|
1984
|
-
*/
|
|
1985
|
-
export function useHostingNameservers(hostingId, options) {
|
|
1986
|
-
const queryOptions = getHostingNameserversQueryOptions(hostingId, options);
|
|
1987
|
-
const query = useQuery(queryOptions);
|
|
1988
|
-
query.queryKey = queryOptions.queryKey;
|
|
1989
|
-
return query;
|
|
1990
|
-
}
|
|
1991
|
-
/**
|
|
1992
|
-
* Returns onboarding data
|
|
1993
|
-
* @summary Returns hosting onboarding data
|
|
1994
|
-
*/
|
|
1995
|
-
export const hostingOnboardingData = (hostingId, options) => {
|
|
1996
|
-
return axios.get(`/v1/hosting/${hostingId}/onboarding`, options);
|
|
1997
|
-
};
|
|
1998
|
-
export const getHostingOnboardingDataQueryKey = (hostingId) => {
|
|
1999
|
-
return [`/v1/hosting/${hostingId}/onboarding`];
|
|
2000
|
-
};
|
|
2001
|
-
export const getHostingOnboardingDataQueryOptions = (hostingId, options) => {
|
|
2002
|
-
var _a;
|
|
2003
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2004
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingOnboardingDataQueryKey(hostingId);
|
|
2005
|
-
const queryFn = ({ signal }) => hostingOnboardingData(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2006
|
-
return Object.assign({ queryKey,
|
|
2007
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2008
|
-
};
|
|
2009
|
-
/**
|
|
2010
|
-
* @summary Returns hosting onboarding data
|
|
2011
|
-
*/
|
|
2012
|
-
export function useHostingOnboardingData(hostingId, options) {
|
|
2013
|
-
const queryOptions = getHostingOnboardingDataQueryOptions(hostingId, options);
|
|
2014
|
-
const query = useQuery(queryOptions);
|
|
2015
|
-
query.queryKey = queryOptions.queryKey;
|
|
2016
|
-
return query;
|
|
2017
|
-
}
|
|
2018
|
-
/**
|
|
2019
|
-
* @summary Updates hosting onboarding data
|
|
2020
|
-
*/
|
|
2021
|
-
export const hostingOnboardingDataUpdate = (hostingId, hostingOnboardingDataUpdateBody, options) => {
|
|
2022
|
-
return axios.put(`/v1/hosting/${hostingId}/onboarding`, hostingOnboardingDataUpdateBody, options);
|
|
2023
|
-
};
|
|
2024
|
-
export const getHostingOnboardingDataUpdateMutationOptions = (options) => {
|
|
2025
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2026
|
-
const mutationFn = (props) => {
|
|
2027
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2028
|
-
return hostingOnboardingDataUpdate(hostingId, data, axiosOptions);
|
|
2029
|
-
};
|
|
2030
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2031
|
-
};
|
|
2032
|
-
/**
|
|
2033
|
-
* @summary Updates hosting onboarding data
|
|
2034
|
-
*/
|
|
2035
|
-
export const useHostingOnboardingDataUpdate = (options) => {
|
|
2036
|
-
const mutationOptions = getHostingOnboardingDataUpdateMutationOptions(options);
|
|
2037
|
-
return useMutation(mutationOptions);
|
|
2038
|
-
};
|
|
2039
|
-
/**
|
|
2040
|
-
* Returns the list of site's redirects
|
|
2041
|
-
* @summary List redirects
|
|
2042
|
-
*/
|
|
2043
|
-
export const hostingRedirects = (hostingId, options) => {
|
|
2044
|
-
return axios.get(`/v1/hosting/${hostingId}/redirects`, options);
|
|
2045
|
-
};
|
|
2046
|
-
export const getHostingRedirectsQueryKey = (hostingId) => {
|
|
2047
|
-
return [`/v1/hosting/${hostingId}/redirects`];
|
|
2048
|
-
};
|
|
2049
|
-
export const getHostingRedirectsQueryOptions = (hostingId, options) => {
|
|
2050
|
-
var _a;
|
|
2051
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2052
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingRedirectsQueryKey(hostingId);
|
|
2053
|
-
const queryFn = ({ signal }) => hostingRedirects(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2054
|
-
return Object.assign({ queryKey,
|
|
2055
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2056
|
-
};
|
|
2057
|
-
/**
|
|
2058
|
-
* @summary List redirects
|
|
2059
|
-
*/
|
|
2060
|
-
export function useHostingRedirects(hostingId, options) {
|
|
2061
|
-
const queryOptions = getHostingRedirectsQueryOptions(hostingId, options);
|
|
2062
|
-
const query = useQuery(queryOptions);
|
|
2063
|
-
query.queryKey = queryOptions.queryKey;
|
|
2064
|
-
return query;
|
|
2065
|
-
}
|
|
2066
|
-
/**
|
|
2067
|
-
* Delete the user site redirect
|
|
2068
|
-
* @summary Delete redirects
|
|
2069
|
-
*/
|
|
2070
|
-
export const hostingRedirect = (hostingId, hostingRedirectBody, options) => {
|
|
2071
|
-
return axios.delete(`/v1/hosting/${hostingId}/redirects`, Object.assign({ data: hostingRedirectBody }, options));
|
|
2072
|
-
};
|
|
2073
|
-
export const getHostingRedirectMutationOptions = (options) => {
|
|
2074
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2075
|
-
const mutationFn = (props) => {
|
|
2076
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2077
|
-
return hostingRedirect(hostingId, data, axiosOptions);
|
|
2078
|
-
};
|
|
2079
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2080
|
-
};
|
|
2081
|
-
/**
|
|
2082
|
-
* @summary Delete redirects
|
|
2083
|
-
*/
|
|
2084
|
-
export const useHostingRedirect = (options) => {
|
|
2085
|
-
const mutationOptions = getHostingRedirectMutationOptions(options);
|
|
2086
|
-
return useMutation(mutationOptions);
|
|
2087
|
-
};
|
|
2088
|
-
/**
|
|
2089
|
-
* Add the redirect url path for the site
|
|
2090
|
-
* @summary Add redirects
|
|
2091
|
-
*/
|
|
2092
|
-
export const addHostingRedirects = (hostingId, addHostingRedirectsBody, options) => {
|
|
2093
|
-
return axios.post(`/v1/hosting/${hostingId}/redirects`, addHostingRedirectsBody, options);
|
|
2094
|
-
};
|
|
2095
|
-
export const getAddHostingRedirectsMutationOptions = (options) => {
|
|
2096
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2097
|
-
const mutationFn = (props) => {
|
|
2098
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2099
|
-
return addHostingRedirects(hostingId, data, axiosOptions);
|
|
2100
|
-
};
|
|
2101
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2102
|
-
};
|
|
2103
|
-
/**
|
|
2104
|
-
* @summary Add redirects
|
|
2105
|
-
*/
|
|
2106
|
-
export const useAddHostingRedirects = (options) => {
|
|
2107
|
-
const mutationOptions = getAddHostingRedirectsMutationOptions(options);
|
|
2108
|
-
return useMutation(mutationOptions);
|
|
2109
|
-
};
|
|
2110
|
-
/**
|
|
2111
|
-
* Returns the hosting sso_whm login url
|
|
2112
|
-
* @summary hosting sso_whm
|
|
2113
|
-
*/
|
|
2114
|
-
export const hostingResellerSsoWhm = (hostingId, options) => {
|
|
2115
|
-
return axios.get(`/v1/hosting/${hostingId}/reseller/sso/whm`, options);
|
|
2116
|
-
};
|
|
2117
|
-
export const getHostingResellerSsoWhmQueryKey = (hostingId) => {
|
|
2118
|
-
return [`/v1/hosting/${hostingId}/reseller/sso/whm`];
|
|
2119
|
-
};
|
|
2120
|
-
export const getHostingResellerSsoWhmQueryOptions = (hostingId, options) => {
|
|
2121
|
-
var _a;
|
|
2122
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2123
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingResellerSsoWhmQueryKey(hostingId);
|
|
2124
|
-
const queryFn = ({ signal }) => hostingResellerSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2125
|
-
return Object.assign({ queryKey,
|
|
2126
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2127
|
-
};
|
|
2128
|
-
/**
|
|
2129
|
-
* @summary hosting sso_whm
|
|
2130
|
-
*/
|
|
2131
|
-
export function useHostingResellerSsoWhm(hostingId, options) {
|
|
2132
|
-
const queryOptions = getHostingResellerSsoWhmQueryOptions(hostingId, options);
|
|
2133
|
-
const query = useQuery(queryOptions);
|
|
2134
|
-
query.queryKey = queryOptions.queryKey;
|
|
2135
|
-
return query;
|
|
2136
|
-
}
|
|
2137
|
-
/**
|
|
2138
|
-
* Enable or disable shell access on an account by setting the shell.SSH key access must be established separately.
|
|
2139
|
-
* @summary hosting shell toggle
|
|
2140
|
-
*/
|
|
2141
|
-
export const hostingShellToggle = (hostingId, hostingShellToggleBody, options) => {
|
|
2142
|
-
return axios.put(`/v1/hosting/${hostingId}/shell`, hostingShellToggleBody, options);
|
|
2143
|
-
};
|
|
2144
|
-
export const getHostingShellToggleMutationOptions = (options) => {
|
|
2145
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2146
|
-
const mutationFn = (props) => {
|
|
2147
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2148
|
-
return hostingShellToggle(hostingId, data, axiosOptions);
|
|
2149
|
-
};
|
|
2150
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2151
|
-
};
|
|
2152
|
-
/**
|
|
2153
|
-
* @summary hosting shell toggle
|
|
2154
|
-
*/
|
|
2155
|
-
export const useHostingShellToggle = (options) => {
|
|
2156
|
-
const mutationOptions = getHostingShellToggleMutationOptions(options);
|
|
2157
|
-
return useMutation(mutationOptions);
|
|
2158
|
-
};
|
|
2159
|
-
/**
|
|
2160
|
-
* Determine shell access status for an account.
|
|
2161
|
-
* @summary hosting shell_status
|
|
2162
|
-
*/
|
|
2163
|
-
export const hostingShellInfo = (hostingId, options) => {
|
|
2164
|
-
return axios.get(`/v1/hosting/${hostingId}/shell`, options);
|
|
2165
|
-
};
|
|
2166
|
-
export const getHostingShellInfoQueryKey = (hostingId) => {
|
|
2167
|
-
return [`/v1/hosting/${hostingId}/shell`];
|
|
2168
|
-
};
|
|
2169
|
-
export const getHostingShellInfoQueryOptions = (hostingId, options) => {
|
|
2170
|
-
var _a;
|
|
2171
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2172
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingShellInfoQueryKey(hostingId);
|
|
2173
|
-
const queryFn = ({ signal }) => hostingShellInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2174
|
-
return Object.assign({ queryKey,
|
|
2175
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2176
|
-
};
|
|
2177
|
-
/**
|
|
2178
|
-
* @summary hosting shell_status
|
|
2179
|
-
*/
|
|
2180
|
-
export function useHostingShellInfo(hostingId, options) {
|
|
2181
|
-
const queryOptions = getHostingShellInfoQueryOptions(hostingId, options);
|
|
2182
|
-
const query = useQuery(queryOptions);
|
|
2183
|
-
query.queryKey = queryOptions.queryKey;
|
|
2184
|
-
return query;
|
|
2185
|
-
}
|
|
2186
|
-
/**
|
|
2187
|
-
* Add a site to the current hosting.
|
|
2188
|
-
* @summary sites add
|
|
2189
|
-
*/
|
|
2190
|
-
export const hostingSiteAdd = (hostingId, hostingSiteAddBody, options) => {
|
|
2191
|
-
return axios.post(`/v1/hosting/${hostingId}/sites`, hostingSiteAddBody, options);
|
|
2192
|
-
};
|
|
2193
|
-
export const getHostingSiteAddMutationOptions = (options) => {
|
|
2194
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2195
|
-
const mutationFn = (props) => {
|
|
2196
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2197
|
-
return hostingSiteAdd(hostingId, data, axiosOptions);
|
|
2198
|
-
};
|
|
2199
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2200
|
-
};
|
|
2201
|
-
/**
|
|
2202
|
-
* @summary sites add
|
|
2203
|
-
*/
|
|
2204
|
-
export const useHostingSiteAdd = (options) => {
|
|
2205
|
-
const mutationOptions = getHostingSiteAddMutationOptions(options);
|
|
2206
|
-
return useMutation(mutationOptions);
|
|
2207
|
-
};
|
|
2208
|
-
/**
|
|
2209
|
-
* Update Sites in batches.
|
|
2210
|
-
* @summary sites update batch
|
|
2211
|
-
*/
|
|
2212
|
-
export const sitesBatch = (hostingId, sitesBatchBody, options) => {
|
|
2213
|
-
return axios.put(`/v1/hosting/${hostingId}/sites/batch`, sitesBatchBody, options);
|
|
2214
|
-
};
|
|
2215
|
-
export const getSitesBatchMutationOptions = (options) => {
|
|
2216
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2217
|
-
const mutationFn = (props) => {
|
|
2218
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2219
|
-
return sitesBatch(hostingId, data, axiosOptions);
|
|
2220
|
-
};
|
|
2221
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2222
|
-
};
|
|
2223
|
-
/**
|
|
2224
|
-
* @summary sites update batch
|
|
2225
|
-
*/
|
|
2226
|
-
export const useSitesBatch = (options) => {
|
|
2227
|
-
const mutationOptions = getSitesBatchMutationOptions(options);
|
|
2228
|
-
return useMutation(mutationOptions);
|
|
2229
|
-
};
|
|
2230
|
-
/**
|
|
2231
|
-
* Returns the hosting account's SSH information
|
|
2232
|
-
* @summary ssh info
|
|
2233
|
-
*/
|
|
2234
|
-
export const hostingSshInfo = (hostingId, options) => {
|
|
2235
|
-
return axios.get(`/v1/hosting/${hostingId}/ssh`, options);
|
|
2236
|
-
};
|
|
2237
|
-
export const getHostingSshInfoQueryKey = (hostingId) => {
|
|
2238
|
-
return [`/v1/hosting/${hostingId}/ssh`];
|
|
2239
|
-
};
|
|
2240
|
-
export const getHostingSshInfoQueryOptions = (hostingId, options) => {
|
|
2241
|
-
var _a;
|
|
2242
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2243
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSshInfoQueryKey(hostingId);
|
|
2244
|
-
const queryFn = ({ signal, }) => hostingSshInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2245
|
-
return Object.assign({ queryKey,
|
|
2246
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2247
|
-
};
|
|
2248
|
-
/**
|
|
2249
|
-
* @summary ssh info
|
|
2250
|
-
*/
|
|
2251
|
-
export function useHostingSshInfo(hostingId, options) {
|
|
2252
|
-
const queryOptions = getHostingSshInfoQueryOptions(hostingId, options);
|
|
2253
|
-
const query = useQuery(queryOptions);
|
|
2254
|
-
query.queryKey = queryOptions.queryKey;
|
|
2255
|
-
return query;
|
|
2256
|
-
}
|
|
2257
|
-
/**
|
|
2258
|
-
* Fetches an SSH public (or optionally private) key.
|
|
2259
|
-
* @summary ssh key fetch
|
|
2260
|
-
*/
|
|
2261
|
-
export const sshKeyFetch = (hostingId, params, options) => {
|
|
2262
|
-
return axios.get(`/v1/hosting/${hostingId}/ssh/fetch`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
2263
|
-
};
|
|
2264
|
-
export const getSshKeyFetchQueryKey = (hostingId, params) => {
|
|
2265
|
-
return [
|
|
2266
|
-
`/v1/hosting/${hostingId}/ssh/fetch`,
|
|
2267
|
-
...(params ? [params] : []),
|
|
2268
|
-
];
|
|
2269
|
-
};
|
|
2270
|
-
export const getSshKeyFetchQueryOptions = (hostingId, params, options) => {
|
|
2271
|
-
var _a;
|
|
2272
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2273
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyFetchQueryKey(hostingId, params);
|
|
2274
|
-
const queryFn = ({ signal, }) => sshKeyFetch(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
2275
|
-
return Object.assign({ queryKey,
|
|
2276
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2277
|
-
};
|
|
2278
|
-
/**
|
|
2279
|
-
* @summary ssh key fetch
|
|
2280
|
-
*/
|
|
2281
|
-
export function useSshKeyFetch(hostingId, params, options) {
|
|
2282
|
-
const queryOptions = getSshKeyFetchQueryOptions(hostingId, params, options);
|
|
2283
|
-
const query = useQuery(queryOptions);
|
|
2284
|
-
query.queryKey = queryOptions.queryKey;
|
|
2285
|
-
return query;
|
|
2286
|
-
}
|
|
2287
|
-
/**
|
|
2288
|
-
* Import public/private ssh key
|
|
2289
|
-
* @deprecated
|
|
2290
|
-
* @summary Import ssh key
|
|
2291
|
-
*/
|
|
2292
|
-
export const sshKeyImport = (hostingId, sshKeyImportBody, options) => {
|
|
2293
|
-
return axios.post(`/v1/hosting/${hostingId}/ssh/import`, sshKeyImportBody, options);
|
|
2294
|
-
};
|
|
2295
|
-
export const getSshKeyImportMutationOptions = (options) => {
|
|
2296
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2297
|
-
const mutationFn = (props) => {
|
|
2298
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2299
|
-
return sshKeyImport(hostingId, data, axiosOptions);
|
|
2300
|
-
};
|
|
2301
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2302
|
-
};
|
|
2303
|
-
/**
|
|
2304
|
-
* @deprecated
|
|
2305
|
-
* @summary Import ssh key
|
|
2306
|
-
*/
|
|
2307
|
-
export const useSshKeyImport = (options) => {
|
|
2308
|
-
const mutationOptions = getSshKeyImportMutationOptions(options);
|
|
2309
|
-
return useMutation(mutationOptions);
|
|
2310
|
-
};
|
|
2311
|
-
/**
|
|
2312
|
-
* List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
|
|
2313
|
-
* @deprecated
|
|
2314
|
-
* @summary Deprecated - ssh keys list
|
|
2315
|
-
*/
|
|
2316
|
-
export const sshKeyList = (hostingId, options) => {
|
|
2317
|
-
return axios.get(`/v1/hosting/${hostingId}/ssh/keys`, options);
|
|
2318
|
-
};
|
|
2319
|
-
export const getSshKeyListQueryKey = (hostingId) => {
|
|
2320
|
-
return [`/v1/hosting/${hostingId}/ssh/keys`];
|
|
2321
|
-
};
|
|
2322
|
-
export const getSshKeyListQueryOptions = (hostingId, options) => {
|
|
2323
|
-
var _a;
|
|
2324
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2325
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListQueryKey(hostingId);
|
|
2326
|
-
const queryFn = ({ signal, }) => sshKeyList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2327
|
-
return Object.assign({ queryKey,
|
|
2328
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2329
|
-
};
|
|
2330
|
-
/**
|
|
2331
|
-
* @deprecated
|
|
2332
|
-
* @summary Deprecated - ssh keys list
|
|
2333
|
-
*/
|
|
2334
|
-
export function useSshKeyList(hostingId, options) {
|
|
2335
|
-
const queryOptions = getSshKeyListQueryOptions(hostingId, options);
|
|
2336
|
-
const query = useQuery(queryOptions);
|
|
2337
|
-
query.queryKey = queryOptions.queryKey;
|
|
2338
|
-
return query;
|
|
2339
|
-
}
|
|
2340
|
-
/**
|
|
2341
|
-
* Deletes an SSH key
|
|
2342
|
-
* @summary ssh key delete
|
|
2343
|
-
*/
|
|
2344
|
-
export const sshKey = (hostingId, sshKeyBody, options) => {
|
|
2345
|
-
return axios.delete(`/v1/hosting/${hostingId}/ssh/keys`, Object.assign({ data: sshKeyBody }, options));
|
|
2346
|
-
};
|
|
2347
|
-
export const getSshKeyMutationOptions = (options) => {
|
|
2348
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2349
|
-
const mutationFn = (props) => {
|
|
2350
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2351
|
-
return sshKey(hostingId, data, axiosOptions);
|
|
2352
|
-
};
|
|
2353
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2354
|
-
};
|
|
2355
|
-
/**
|
|
2356
|
-
* @summary ssh key delete
|
|
2357
|
-
*/
|
|
2358
|
-
export const useSshKey = (options) => {
|
|
2359
|
-
const mutationOptions = getSshKeyMutationOptions(options);
|
|
2360
|
-
return useMutation(mutationOptions);
|
|
2361
|
-
};
|
|
2362
|
-
/**
|
|
2363
|
-
* Generates public/private ssh keys
|
|
2364
|
-
* @summary Generate ssh key
|
|
2365
|
-
*/
|
|
2366
|
-
export const sshKeyGenerate = (hostingId, sshKeyGenerateBody, options) => {
|
|
2367
|
-
return axios.post(`/v1/hosting/${hostingId}/ssh/keys`, sshKeyGenerateBody, options);
|
|
2368
|
-
};
|
|
2369
|
-
export const getSshKeyGenerateMutationOptions = (options) => {
|
|
2370
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2371
|
-
const mutationFn = (props) => {
|
|
2372
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
2373
|
-
return sshKeyGenerate(hostingId, data, axiosOptions);
|
|
2374
|
-
};
|
|
2375
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2376
|
-
};
|
|
2377
|
-
/**
|
|
2378
|
-
* @summary Generate ssh key
|
|
2379
|
-
*/
|
|
2380
|
-
export const useSshKeyGenerate = (options) => {
|
|
2381
|
-
const mutationOptions = getSshKeyGenerateMutationOptions(options);
|
|
2382
|
-
return useMutation(mutationOptions);
|
|
2383
|
-
};
|
|
2384
|
-
/**
|
|
2385
|
-
* Returns a SSO login token for a hosting account by default, or directly to various apps within the hosting account by using the optional query parameter.
|
|
2386
|
-
* @summary sso
|
|
2387
|
-
*/
|
|
2388
|
-
export const sso = (hostingId, params, options) => {
|
|
2389
|
-
return axios.get(`/v1/hosting/${hostingId}/sso`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
2390
|
-
};
|
|
2391
|
-
export const getSsoQueryKey = (hostingId, params) => {
|
|
2392
|
-
return [`/v1/hosting/${hostingId}/sso`, ...(params ? [params] : [])];
|
|
2393
|
-
};
|
|
2394
|
-
export const getSsoQueryOptions = (hostingId, params, options) => {
|
|
2395
|
-
var _a;
|
|
2396
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2397
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSsoQueryKey(hostingId, params);
|
|
2398
|
-
const queryFn = ({ signal, }) => sso(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
2399
|
-
return Object.assign({ queryKey,
|
|
2400
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
2401
|
-
};
|
|
2402
|
-
/**
|
|
2403
|
-
* @summary sso
|
|
2404
|
-
*/
|
|
2405
|
-
export function useSso(hostingId, params, options) {
|
|
2406
|
-
const queryOptions = getSsoQueryOptions(hostingId, params, options);
|
|
2407
|
-
const query = useQuery(queryOptions);
|
|
2408
|
-
query.queryKey = queryOptions.queryKey;
|
|
2409
|
-
return query;
|
|
2410
|
-
}
|
|
2411
|
-
/**
|
|
2412
|
-
* Deprecated - use sites_list_v3 instead
|
|
2413
|
-
* @deprecated
|
|
2414
|
-
* @summary Site list for an account
|
|
2415
|
-
*/
|
|
2416
|
-
export const sitesList = (options) => {
|
|
2417
|
-
return axios.get(`/v1/sites`, options);
|
|
2418
|
-
};
|
|
2419
|
-
export const getSitesListQueryKey = () => {
|
|
2420
|
-
return [`/v1/sites`];
|
|
2421
|
-
};
|
|
2422
|
-
export const getSitesListQueryOptions = (options) => {
|
|
2423
|
-
var _a;
|
|
2424
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2425
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListQueryKey();
|
|
2426
|
-
const queryFn = ({ signal, }) => sitesList(Object.assign({ signal }, axiosOptions));
|
|
2427
|
-
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
2428
|
-
};
|
|
2429
|
-
/**
|
|
2430
|
-
* @deprecated
|
|
2431
|
-
* @summary Site list for an account
|
|
2432
|
-
*/
|
|
2433
|
-
export function useSitesList(options) {
|
|
2434
|
-
const queryOptions = getSitesListQueryOptions(options);
|
|
2435
|
-
const query = useQuery(queryOptions);
|
|
2436
|
-
query.queryKey = queryOptions.queryKey;
|
|
2437
|
-
return query;
|
|
2438
|
-
}
|
|
2439
|
-
/**
|
|
2440
|
-
* Returns site information.
|
|
2441
|
-
* @summary info
|
|
2442
|
-
*/
|
|
2443
|
-
export const sitesInfo = (siteId, options) => {
|
|
2444
|
-
return axios.get(`/v1/sites/${siteId}`, options);
|
|
2445
|
-
};
|
|
2446
|
-
export const getSitesInfoQueryKey = (siteId) => {
|
|
2447
|
-
return [`/v1/sites/${siteId}`];
|
|
2448
|
-
};
|
|
2449
|
-
export const getSitesInfoQueryOptions = (siteId, options) => {
|
|
2450
|
-
var _a;
|
|
2451
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2452
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesInfoQueryKey(siteId);
|
|
2453
|
-
const queryFn = ({ signal, }) => sitesInfo(siteId, Object.assign({ signal }, axiosOptions));
|
|
2454
|
-
return Object.assign({ queryKey,
|
|
2455
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2456
|
-
};
|
|
2457
|
-
/**
|
|
2458
|
-
* @summary info
|
|
2459
|
-
*/
|
|
2460
|
-
export function useSitesInfo(siteId, options) {
|
|
2461
|
-
const queryOptions = getSitesInfoQueryOptions(siteId, options);
|
|
2462
|
-
const query = useQuery(queryOptions);
|
|
2463
|
-
query.queryKey = queryOptions.queryKey;
|
|
2464
|
-
return query;
|
|
2465
|
-
}
|
|
2466
|
-
/**
|
|
2467
|
-
* Allows for updating a site's attributes
|
|
2468
|
-
* @summary site update
|
|
2469
|
-
*/
|
|
2470
|
-
export const siteUpdate = (siteId, siteUpdateBody, options) => {
|
|
2471
|
-
return axios.put(`/v1/sites/${siteId}`, siteUpdateBody, options);
|
|
2472
|
-
};
|
|
2473
|
-
export const getSiteUpdateMutationOptions = (options) => {
|
|
2474
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2475
|
-
const mutationFn = (props) => {
|
|
2476
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2477
|
-
return siteUpdate(siteId, data, axiosOptions);
|
|
2478
|
-
};
|
|
2479
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2480
|
-
};
|
|
2481
|
-
/**
|
|
2482
|
-
* @summary site update
|
|
2483
|
-
*/
|
|
2484
|
-
export const useSiteUpdate = (options) => {
|
|
2485
|
-
const mutationOptions = getSiteUpdateMutationOptions(options);
|
|
2486
|
-
return useMutation(mutationOptions);
|
|
2487
|
-
};
|
|
2488
|
-
/**
|
|
2489
|
-
* Allows deleting a site
|
|
2490
|
-
* @summary site delete
|
|
2491
|
-
*/
|
|
2492
|
-
export const site = (siteId, options) => {
|
|
2493
|
-
return axios.delete(`/v1/sites/${siteId}`, options);
|
|
2494
|
-
};
|
|
2495
|
-
export const getSiteMutationOptions = (options) => {
|
|
2496
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2497
|
-
const mutationFn = (props) => {
|
|
2498
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
2499
|
-
return site(siteId, axiosOptions);
|
|
2500
|
-
};
|
|
2501
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2502
|
-
};
|
|
2503
|
-
/**
|
|
2504
|
-
* @summary site delete
|
|
2505
|
-
*/
|
|
2506
|
-
export const useSite = (options) => {
|
|
2507
|
-
const mutationOptions = getSiteMutationOptions(options);
|
|
2508
|
-
return useMutation(mutationOptions);
|
|
2509
|
-
};
|
|
2510
|
-
/**
|
|
2511
|
-
* Returns the autoupdate status of the site's core, themes, and plugins
|
|
2512
|
-
* @summary settings autoupdates
|
|
2513
|
-
*/
|
|
2514
|
-
export const sitesAutoupdatesInfo = (siteId, options) => {
|
|
2515
|
-
return axios.get(`/v1/sites/${siteId}/autoupdates`, options);
|
|
2516
|
-
};
|
|
2517
|
-
export const getSitesAutoupdatesInfoQueryKey = (siteId) => {
|
|
2518
|
-
return [`/v1/sites/${siteId}/autoupdates`];
|
|
2519
|
-
};
|
|
2520
|
-
export const getSitesAutoupdatesInfoQueryOptions = (siteId, options) => {
|
|
2521
|
-
var _a;
|
|
2522
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2523
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAutoupdatesInfoQueryKey(siteId);
|
|
2524
|
-
const queryFn = ({ signal }) => sitesAutoupdatesInfo(siteId, Object.assign({ signal }, axiosOptions));
|
|
2525
|
-
return Object.assign({ queryKey,
|
|
2526
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2527
|
-
};
|
|
2528
|
-
/**
|
|
2529
|
-
* @summary settings autoupdates
|
|
2530
|
-
*/
|
|
2531
|
-
export function useSitesAutoupdatesInfo(siteId, options) {
|
|
2532
|
-
const queryOptions = getSitesAutoupdatesInfoQueryOptions(siteId, options);
|
|
2533
|
-
const query = useQuery(queryOptions);
|
|
2534
|
-
query.queryKey = queryOptions.queryKey;
|
|
2535
|
-
return query;
|
|
2536
|
-
}
|
|
2537
|
-
/**
|
|
2538
|
-
* Enable / disable core, themes, or plugins autoupdates
|
|
2539
|
-
* @summary settings autoupdates toggle
|
|
2540
|
-
*/
|
|
2541
|
-
export const sitesAutoupdatesUpdate = (siteId, sitesAutoupdatesUpdateBody, options) => {
|
|
2542
|
-
return axios.put(`/v1/sites/${siteId}/autoupdates`, sitesAutoupdatesUpdateBody, options);
|
|
2543
|
-
};
|
|
2544
|
-
export const getSitesAutoupdatesUpdateMutationOptions = (options) => {
|
|
2545
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2546
|
-
const mutationFn = (props) => {
|
|
2547
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2548
|
-
return sitesAutoupdatesUpdate(siteId, data, axiosOptions);
|
|
2549
|
-
};
|
|
2550
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2551
|
-
};
|
|
2552
|
-
/**
|
|
2553
|
-
* @summary settings autoupdates toggle
|
|
2554
|
-
*/
|
|
2555
|
-
export const useSitesAutoupdatesUpdate = (options) => {
|
|
2556
|
-
const mutationOptions = getSitesAutoupdatesUpdateMutationOptions(options);
|
|
2557
|
-
return useMutation(mutationOptions);
|
|
2558
|
-
};
|
|
2559
|
-
/**
|
|
2560
|
-
* Returns whether the site has either Codeguard or Jetpack-backup.
|
|
2561
|
-
* @deprecated
|
|
2562
|
-
* @summary Deprecated - has backup
|
|
2563
|
-
*/
|
|
2564
|
-
export const sitesBackups = (siteId, options) => {
|
|
2565
|
-
return axios.get(`/v1/sites/${siteId}/backups`, options);
|
|
2566
|
-
};
|
|
2567
|
-
export const getSitesBackupsQueryKey = (siteId) => {
|
|
2568
|
-
return [`/v1/sites/${siteId}/backups`];
|
|
2569
|
-
};
|
|
2570
|
-
export const getSitesBackupsQueryOptions = (siteId, options) => {
|
|
2571
|
-
var _a;
|
|
2572
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2573
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsQueryKey(siteId);
|
|
2574
|
-
const queryFn = ({ signal, }) => sitesBackups(siteId, Object.assign({ signal }, axiosOptions));
|
|
2575
|
-
return Object.assign({ queryKey,
|
|
2576
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2577
|
-
};
|
|
2578
|
-
/**
|
|
2579
|
-
* @deprecated
|
|
2580
|
-
* @summary Deprecated - has backup
|
|
2581
|
-
*/
|
|
2582
|
-
export function useSitesBackups(siteId, options) {
|
|
2583
|
-
const queryOptions = getSitesBackupsQueryOptions(siteId, options);
|
|
2584
|
-
const query = useQuery(queryOptions);
|
|
2585
|
-
query.queryKey = queryOptions.queryKey;
|
|
2586
|
-
return query;
|
|
2587
|
-
}
|
|
2588
|
-
/**
|
|
2589
|
-
* Returns whether the site has either Codeguard or Jetpack-backup.
|
|
2590
|
-
* @summary has backups
|
|
2591
|
-
*/
|
|
2592
|
-
export const sitesHasBackups = (siteId, options) => {
|
|
2593
|
-
return axios.get(`/v1/sites/${siteId}/backups/check`, options);
|
|
2594
|
-
};
|
|
2595
|
-
export const getSitesHasBackupsQueryKey = (siteId) => {
|
|
2596
|
-
return [`/v1/sites/${siteId}/backups/check`];
|
|
2597
|
-
};
|
|
2598
|
-
export const getSitesHasBackupsQueryOptions = (siteId, options) => {
|
|
2599
|
-
var _a;
|
|
2600
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2601
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesHasBackupsQueryKey(siteId);
|
|
2602
|
-
const queryFn = ({ signal, }) => sitesHasBackups(siteId, Object.assign({ signal }, axiosOptions));
|
|
2603
|
-
return Object.assign({ queryKey,
|
|
2604
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2605
|
-
};
|
|
2606
|
-
/**
|
|
2607
|
-
* @summary has backups
|
|
2608
|
-
*/
|
|
2609
|
-
export function useSitesHasBackups(siteId, options) {
|
|
2610
|
-
const queryOptions = getSitesHasBackupsQueryOptions(siteId, options);
|
|
2611
|
-
const query = useQuery(queryOptions);
|
|
2612
|
-
query.queryKey = queryOptions.queryKey;
|
|
2613
|
-
return query;
|
|
2614
|
-
}
|
|
2615
|
-
/**
|
|
2616
|
-
* Adds the site to the codeguard
|
|
2617
|
-
* @summary Add additional sites to codeguard
|
|
2618
|
-
*/
|
|
2619
|
-
export const sitesBackupsCodeguard = (siteId, options) => {
|
|
2620
|
-
return axios.post(`/v1/sites/${siteId}/backups/codeguard`, undefined, options);
|
|
2621
|
-
};
|
|
2622
|
-
export const getSitesBackupsCodeguardMutationOptions = (options) => {
|
|
2623
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2624
|
-
const mutationFn = (props) => {
|
|
2625
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
2626
|
-
return sitesBackupsCodeguard(siteId, axiosOptions);
|
|
2627
|
-
};
|
|
2628
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2629
|
-
};
|
|
2630
|
-
/**
|
|
2631
|
-
* @summary Add additional sites to codeguard
|
|
2632
|
-
*/
|
|
2633
|
-
export const useSitesBackupsCodeguard = (options) => {
|
|
2634
|
-
const mutationOptions = getSitesBackupsCodeguardMutationOptions(options);
|
|
2635
|
-
return useMutation(mutationOptions);
|
|
2636
|
-
};
|
|
2637
|
-
/**
|
|
2638
|
-
* Returns details about the backup options available for the site, i.e. details about the codeguard backup addon and the jetpack based on if one or both of them are added to the account.
|
|
2639
|
-
* @summary site backup details
|
|
2640
|
-
*/
|
|
2641
|
-
export const sitesBackupsDetails = (siteId, options) => {
|
|
2642
|
-
return axios.get(`/v1/sites/${siteId}/backups/details`, options);
|
|
2643
|
-
};
|
|
2644
|
-
export const getSitesBackupsDetailsQueryKey = (siteId) => {
|
|
2645
|
-
return [`/v1/sites/${siteId}/backups/details`];
|
|
2646
|
-
};
|
|
2647
|
-
export const getSitesBackupsDetailsQueryOptions = (siteId, options) => {
|
|
2648
|
-
var _a;
|
|
2649
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2650
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsDetailsQueryKey(siteId);
|
|
2651
|
-
const queryFn = ({ signal }) => sitesBackupsDetails(siteId, Object.assign({ signal }, axiosOptions));
|
|
2652
|
-
return Object.assign({ queryKey,
|
|
2653
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2654
|
-
};
|
|
2655
|
-
/**
|
|
2656
|
-
* @summary site backup details
|
|
2657
|
-
*/
|
|
2658
|
-
export function useSitesBackupsDetails(siteId, options) {
|
|
2659
|
-
const queryOptions = getSitesBackupsDetailsQueryOptions(siteId, options);
|
|
2660
|
-
const query = useQuery(queryOptions);
|
|
2661
|
-
query.queryKey = queryOptions.queryKey;
|
|
2662
|
-
return query;
|
|
2663
|
-
}
|
|
2664
|
-
/**
|
|
2665
|
-
* The products supported jetpack-backup addon and jetpack-backup plugin
|
|
2666
|
-
* @summary Returns the status of the jetpack-backup product
|
|
2667
|
-
*/
|
|
2668
|
-
export const jetpackBackupStatus = (siteId, options) => {
|
|
2669
|
-
return axios.get(`/v1/sites/${siteId}/backups/jetpack`, options);
|
|
2670
|
-
};
|
|
2671
|
-
export const getJetpackBackupStatusQueryKey = (siteId) => {
|
|
2672
|
-
return [`/v1/sites/${siteId}/backups/jetpack`];
|
|
2673
|
-
};
|
|
2674
|
-
export const getJetpackBackupStatusQueryOptions = (siteId, options) => {
|
|
2675
|
-
var _a;
|
|
2676
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2677
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getJetpackBackupStatusQueryKey(siteId);
|
|
2678
|
-
const queryFn = ({ signal }) => jetpackBackupStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
2679
|
-
return Object.assign({ queryKey,
|
|
2680
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2681
|
-
};
|
|
2682
|
-
/**
|
|
2683
|
-
* @summary Returns the status of the jetpack-backup product
|
|
2684
|
-
*/
|
|
2685
|
-
export function useJetpackBackupStatus(siteId, options) {
|
|
2686
|
-
const queryOptions = getJetpackBackupStatusQueryOptions(siteId, options);
|
|
2687
|
-
const query = useQuery(queryOptions);
|
|
2688
|
-
query.queryKey = queryOptions.queryKey;
|
|
2689
|
-
return query;
|
|
2690
|
-
}
|
|
2691
|
-
/**
|
|
2692
|
-
* Toggles the pending_upgrade meta of the provided jetpackbackup HAL addon
|
|
2693
|
-
* @summary Toggles the pending_upgrade meta of the provided jetpackbackup HAL addon
|
|
2694
|
-
*/
|
|
2695
|
-
export const backupsJetpackBackup = (siteId, options) => {
|
|
2696
|
-
return axios.put(`/v1/sites/${siteId}/backups/jetpack`, undefined, options);
|
|
2697
|
-
};
|
|
2698
|
-
export const getBackupsJetpackBackupMutationOptions = (options) => {
|
|
2699
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2700
|
-
const mutationFn = (props) => {
|
|
2701
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
2702
|
-
return backupsJetpackBackup(siteId, axiosOptions);
|
|
2703
|
-
};
|
|
2704
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2705
|
-
};
|
|
2706
|
-
/**
|
|
2707
|
-
* @summary Toggles the pending_upgrade meta of the provided jetpackbackup HAL addon
|
|
2708
|
-
*/
|
|
2709
|
-
export const useBackupsJetpackBackup = (options) => {
|
|
2710
|
-
const mutationOptions = getBackupsJetpackBackupMutationOptions(options);
|
|
2711
|
-
return useMutation(mutationOptions);
|
|
2712
|
-
};
|
|
2713
|
-
/**
|
|
2714
|
-
* Creates cloudflare basic addon using site_id
|
|
2715
|
-
* @summary Install cloudflare basic addon using site_id
|
|
2716
|
-
*/
|
|
2717
|
-
export const siteAddonCloudflare = (siteId, options) => {
|
|
2718
|
-
return axios.post(`/v1/sites/${siteId}/cloudflare`, undefined, options);
|
|
2719
|
-
};
|
|
2720
|
-
export const getSiteAddonCloudflareMutationOptions = (options) => {
|
|
2721
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2722
|
-
const mutationFn = (props) => {
|
|
2723
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
2724
|
-
return siteAddonCloudflare(siteId, axiosOptions);
|
|
2725
|
-
};
|
|
2726
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2727
|
-
};
|
|
2728
|
-
/**
|
|
2729
|
-
* @summary Install cloudflare basic addon using site_id
|
|
2730
|
-
*/
|
|
2731
|
-
export const useSiteAddonCloudflare = (options) => {
|
|
2732
|
-
const mutationOptions = getSiteAddonCloudflareMutationOptions(options);
|
|
2733
|
-
return useMutation(mutationOptions);
|
|
2734
|
-
};
|
|
2735
|
-
/**
|
|
2736
|
-
* Get info about site database
|
|
2737
|
-
* @summary site - database info
|
|
2738
|
-
*/
|
|
2739
|
-
export const sitesDatabaseInfo = (siteId, options) => {
|
|
2740
|
-
return axios.get(`/v1/sites/${siteId}/database`, options);
|
|
2741
|
-
};
|
|
2742
|
-
export const getSitesDatabaseInfoQueryKey = (siteId) => {
|
|
2743
|
-
return [`/v1/sites/${siteId}/database`];
|
|
2744
|
-
};
|
|
2745
|
-
export const getSitesDatabaseInfoQueryOptions = (siteId, options) => {
|
|
2746
|
-
var _a;
|
|
2747
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2748
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDatabaseInfoQueryKey(siteId);
|
|
2749
|
-
const queryFn = ({ signal }) => sitesDatabaseInfo(siteId, Object.assign({ signal }, axiosOptions));
|
|
2750
|
-
return Object.assign({ queryKey,
|
|
2751
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2752
|
-
};
|
|
2753
|
-
/**
|
|
2754
|
-
* @summary site - database info
|
|
2755
|
-
*/
|
|
2756
|
-
export function useSitesDatabaseInfo(siteId, options) {
|
|
2757
|
-
const queryOptions = getSitesDatabaseInfoQueryOptions(siteId, options);
|
|
2758
|
-
const query = useQuery(queryOptions);
|
|
2759
|
-
query.queryKey = queryOptions.queryKey;
|
|
2760
|
-
return query;
|
|
2761
|
-
}
|
|
2762
|
-
/**
|
|
2763
|
-
* Resync database password with whats in wp-config
|
|
2764
|
-
* @summary site - database - password sync
|
|
2765
|
-
*/
|
|
2766
|
-
export const sitesDatabasePasswordsync = (siteId, options) => {
|
|
2767
|
-
return axios.post(`/v1/sites/${siteId}/database/password-sync`, undefined, options);
|
|
2768
|
-
};
|
|
2769
|
-
export const getSitesDatabasePasswordsyncMutationOptions = (options) => {
|
|
2770
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2771
|
-
const mutationFn = (props) => {
|
|
2772
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
2773
|
-
return sitesDatabasePasswordsync(siteId, axiosOptions);
|
|
2774
|
-
};
|
|
2775
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2776
|
-
};
|
|
2777
|
-
/**
|
|
2778
|
-
* @summary site - database - password sync
|
|
2779
|
-
*/
|
|
2780
|
-
export const useSitesDatabasePasswordsync = (options) => {
|
|
2781
|
-
const mutationOptions = getSitesDatabasePasswordsyncMutationOptions(options);
|
|
2782
|
-
return useMutation(mutationOptions);
|
|
2783
|
-
};
|
|
2784
|
-
/**
|
|
2785
|
-
* Returns a list of DNS records for the site's domain.
|
|
2786
|
-
* @summary dns
|
|
2787
|
-
*/
|
|
2788
|
-
export const sitesDns = (siteId, params, options) => {
|
|
2789
|
-
return axios.get(`/v1/sites/${siteId}/dns`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
2790
|
-
};
|
|
2791
|
-
export const getSitesDnsQueryKey = (siteId, params) => {
|
|
2792
|
-
return [`/v1/sites/${siteId}/dns`, ...(params ? [params] : [])];
|
|
2793
|
-
};
|
|
2794
|
-
export const getSitesDnsQueryOptions = (siteId, params, options) => {
|
|
2795
|
-
var _a;
|
|
2796
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2797
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDnsQueryKey(siteId, params);
|
|
2798
|
-
const queryFn = ({ signal, }) => sitesDns(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2799
|
-
return Object.assign({ queryKey,
|
|
2800
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2801
|
-
};
|
|
2802
|
-
/**
|
|
2803
|
-
* @summary dns
|
|
2804
|
-
*/
|
|
2805
|
-
export function useSitesDns(siteId, params, options) {
|
|
2806
|
-
const queryOptions = getSitesDnsQueryOptions(siteId, params, options);
|
|
2807
|
-
const query = useQuery(queryOptions);
|
|
2808
|
-
query.queryKey = queryOptions.queryKey;
|
|
2809
|
-
return query;
|
|
2810
|
-
}
|
|
2811
|
-
/**
|
|
2812
|
-
* Determines if the domain has the correct DNS setup for site
|
|
2813
|
-
* @summary Domain DNS setup for site
|
|
2814
|
-
*/
|
|
2815
|
-
export const sitesDomain = (siteId, params, options) => {
|
|
2816
|
-
return axios.get(`/v1/sites/${siteId}/domain`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
2817
|
-
};
|
|
2818
|
-
export const getSitesDomainQueryKey = (siteId, params) => {
|
|
2819
|
-
return [`/v1/sites/${siteId}/domain`, ...(params ? [params] : [])];
|
|
2820
|
-
};
|
|
2821
|
-
export const getSitesDomainQueryOptions = (siteId, params, options) => {
|
|
2822
|
-
var _a;
|
|
2823
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2824
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainQueryKey(siteId, params);
|
|
2825
|
-
const queryFn = ({ signal, }) => sitesDomain(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2826
|
-
return Object.assign({ queryKey,
|
|
2827
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2828
|
-
};
|
|
2829
|
-
/**
|
|
2830
|
-
* @summary Domain DNS setup for site
|
|
2831
|
-
*/
|
|
2832
|
-
export function useSitesDomain(siteId, params, options) {
|
|
2833
|
-
const queryOptions = getSitesDomainQueryOptions(siteId, params, options);
|
|
2834
|
-
const query = useQuery(queryOptions);
|
|
2835
|
-
query.queryKey = queryOptions.queryKey;
|
|
2836
|
-
return query;
|
|
2837
|
-
}
|
|
2838
|
-
/**
|
|
2839
|
-
* Add or promote pending site url
|
|
2840
|
-
* @summary Add pending site url
|
|
2841
|
-
*/
|
|
2842
|
-
export const sitesDomainUrl = (siteId, sitesDomainUrlBody, options) => {
|
|
2843
|
-
return axios.post(`/v1/sites/${siteId}/domain`, sitesDomainUrlBody, options);
|
|
2844
|
-
};
|
|
2845
|
-
export const getSitesDomainUrlMutationOptions = (options) => {
|
|
2846
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2847
|
-
const mutationFn = (props) => {
|
|
2848
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2849
|
-
return sitesDomainUrl(siteId, data, axiosOptions);
|
|
2850
|
-
};
|
|
2851
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2852
|
-
};
|
|
2853
|
-
/**
|
|
2854
|
-
* @summary Add pending site url
|
|
2855
|
-
*/
|
|
2856
|
-
export const useSitesDomainUrl = (options) => {
|
|
2857
|
-
const mutationOptions = getSitesDomainUrlMutationOptions(options);
|
|
2858
|
-
return useMutation(mutationOptions);
|
|
2859
|
-
};
|
|
2860
|
-
/**
|
|
2861
|
-
* Add the domain
|
|
2862
|
-
* @summary Add domain for the site
|
|
2863
|
-
*/
|
|
2864
|
-
export const sitesDomainsCreate = (siteId, sitesDomainsCreateBody, options) => {
|
|
2865
|
-
return axios.post(`/v1/sites/${siteId}/domains`, sitesDomainsCreateBody, options);
|
|
2866
|
-
};
|
|
2867
|
-
export const getSitesDomainsCreateMutationOptions = (options) => {
|
|
2868
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2869
|
-
const mutationFn = (props) => {
|
|
2870
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2871
|
-
return sitesDomainsCreate(siteId, data, axiosOptions);
|
|
2872
|
-
};
|
|
2873
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2874
|
-
};
|
|
2875
|
-
/**
|
|
2876
|
-
* @summary Add domain for the site
|
|
2877
|
-
*/
|
|
2878
|
-
export const useSitesDomainsCreate = (options) => {
|
|
2879
|
-
const mutationOptions = getSitesDomainsCreateMutationOptions(options);
|
|
2880
|
-
return useMutation(mutationOptions);
|
|
2881
|
-
};
|
|
2882
|
-
/**
|
|
2883
|
-
* Returns the list of blocked ipaddress
|
|
2884
|
-
* @summary List blocked IPAddress
|
|
2885
|
-
*/
|
|
2886
|
-
export const siteIpaddressList = (siteId, options) => {
|
|
2887
|
-
return axios.get(`/v1/sites/${siteId}/ipblocker`, options);
|
|
2888
|
-
};
|
|
2889
|
-
export const getSiteIpaddressListQueryKey = (siteId) => {
|
|
2890
|
-
return [`/v1/sites/${siteId}/ipblocker`];
|
|
2891
|
-
};
|
|
2892
|
-
export const getSiteIpaddressListQueryOptions = (siteId, options) => {
|
|
2893
|
-
var _a;
|
|
2894
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2895
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteIpaddressListQueryKey(siteId);
|
|
2896
|
-
const queryFn = ({ signal }) => siteIpaddressList(siteId, Object.assign({ signal }, axiosOptions));
|
|
2897
|
-
return Object.assign({ queryKey,
|
|
2898
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2899
|
-
};
|
|
2900
|
-
/**
|
|
2901
|
-
* @summary List blocked IPAddress
|
|
2902
|
-
*/
|
|
2903
|
-
export function useSiteIpaddressList(siteId, options) {
|
|
2904
|
-
const queryOptions = getSiteIpaddressListQueryOptions(siteId, options);
|
|
2905
|
-
const query = useQuery(queryOptions);
|
|
2906
|
-
query.queryKey = queryOptions.queryKey;
|
|
2907
|
-
return query;
|
|
2908
|
-
}
|
|
2909
|
-
/**
|
|
2910
|
-
* Delete the user site ipaddress
|
|
2911
|
-
* @summary Delete ipAddress
|
|
2912
|
-
*/
|
|
2913
|
-
export const siteIpaddress = (siteId, siteIpaddressBody, options) => {
|
|
2914
|
-
return axios.delete(`/v1/sites/${siteId}/ipblocker`, Object.assign({ data: siteIpaddressBody }, options));
|
|
2915
|
-
};
|
|
2916
|
-
export const getSiteIpaddressMutationOptions = (options) => {
|
|
2917
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2918
|
-
const mutationFn = (props) => {
|
|
2919
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2920
|
-
return siteIpaddress(siteId, data, axiosOptions);
|
|
2921
|
-
};
|
|
2922
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2923
|
-
};
|
|
2924
|
-
/**
|
|
2925
|
-
* @summary Delete ipAddress
|
|
2926
|
-
*/
|
|
2927
|
-
export const useSiteIpaddress = (options) => {
|
|
2928
|
-
const mutationOptions = getSiteIpaddressMutationOptions(options);
|
|
2929
|
-
return useMutation(mutationOptions);
|
|
2930
|
-
};
|
|
2931
|
-
/**
|
|
2932
|
-
* Add the ipaddress url for the site
|
|
2933
|
-
* @summary Add blocked ipaddress
|
|
2934
|
-
*/
|
|
2935
|
-
export const addSiteIpaddress = (siteId, addSiteIpaddressBody, options) => {
|
|
2936
|
-
return axios.post(`/v1/sites/${siteId}/ipblocker`, addSiteIpaddressBody, options);
|
|
2937
|
-
};
|
|
2938
|
-
export const getAddSiteIpaddressMutationOptions = (options) => {
|
|
2939
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2940
|
-
const mutationFn = (props) => {
|
|
2941
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2942
|
-
return addSiteIpaddress(siteId, data, axiosOptions);
|
|
2943
|
-
};
|
|
2944
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
2945
|
-
};
|
|
2946
|
-
/**
|
|
2947
|
-
* @summary Add blocked ipaddress
|
|
2948
|
-
*/
|
|
2949
|
-
export const useAddSiteIpaddress = (options) => {
|
|
2950
|
-
const mutationOptions = getAddSiteIpaddressMutationOptions(options);
|
|
2951
|
-
return useMutation(mutationOptions);
|
|
2952
|
-
};
|
|
2953
|
-
/**
|
|
2954
|
-
* Returns site access logs.
|
|
2955
|
-
* @summary Site access logs
|
|
2956
|
-
*/
|
|
2957
|
-
export const sitesAccessLogs = (siteId, params, options) => {
|
|
2958
|
-
return axios.get(`/v1/sites/${siteId}/logs/access`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
2959
|
-
};
|
|
2960
|
-
export const getSitesAccessLogsQueryKey = (siteId, params) => {
|
|
2961
|
-
return [
|
|
2962
|
-
`/v1/sites/${siteId}/logs/access`,
|
|
2963
|
-
...(params ? [params] : []),
|
|
2964
|
-
];
|
|
2965
|
-
};
|
|
2966
|
-
export const getSitesAccessLogsInfiniteQueryOptions = (siteId, params, options) => {
|
|
2967
|
-
var _a;
|
|
2968
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2969
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
|
|
2970
|
-
const queryFn = ({ signal, }) => sitesAccessLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2971
|
-
return Object.assign({ queryKey,
|
|
2972
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2973
|
-
};
|
|
2974
|
-
/**
|
|
2975
|
-
* @summary Site access logs
|
|
2976
|
-
*/
|
|
2977
|
-
export function useSitesAccessLogsInfinite(siteId, params, options) {
|
|
2978
|
-
const queryOptions = getSitesAccessLogsInfiniteQueryOptions(siteId, params, options);
|
|
2979
|
-
const query = useInfiniteQuery(queryOptions);
|
|
2980
|
-
query.queryKey = queryOptions.queryKey;
|
|
2981
|
-
return query;
|
|
2982
|
-
}
|
|
2983
|
-
export const getSitesAccessLogsQueryOptions = (siteId, params, options) => {
|
|
2984
|
-
var _a;
|
|
2985
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2986
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
|
|
2987
|
-
const queryFn = ({ signal, }) => sitesAccessLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2988
|
-
return Object.assign({ queryKey,
|
|
2989
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
2990
|
-
};
|
|
2991
|
-
/**
|
|
2992
|
-
* @summary Site access logs
|
|
2993
|
-
*/
|
|
2994
|
-
export function useSitesAccessLogs(siteId, params, options) {
|
|
2995
|
-
const queryOptions = getSitesAccessLogsQueryOptions(siteId, params, options);
|
|
2996
|
-
const query = useQuery(queryOptions);
|
|
2997
|
-
query.queryKey = queryOptions.queryKey;
|
|
2998
|
-
return query;
|
|
2999
|
-
}
|
|
3000
|
-
/**
|
|
3001
|
-
* Returns site access logs.
|
|
3002
|
-
* @summary Site access logs
|
|
3003
|
-
*/
|
|
3004
|
-
export const sitesAccessLogsDownload = (siteId, params, options) => {
|
|
3005
|
-
return axios.get(`/v1/sites/${siteId}/logs/access/download`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3006
|
-
};
|
|
3007
|
-
export const getSitesAccessLogsDownloadQueryKey = (siteId, params) => {
|
|
3008
|
-
return [
|
|
3009
|
-
`/v1/sites/${siteId}/logs/access/download`,
|
|
3010
|
-
...(params ? [params] : []),
|
|
3011
|
-
];
|
|
3012
|
-
};
|
|
3013
|
-
export const getSitesAccessLogsDownloadQueryOptions = (siteId, params, options) => {
|
|
3014
|
-
var _a;
|
|
3015
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3016
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsDownloadQueryKey(siteId, params);
|
|
3017
|
-
const queryFn = ({ signal }) => sitesAccessLogsDownload(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
3018
|
-
return Object.assign({ queryKey,
|
|
3019
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3020
|
-
};
|
|
3021
|
-
/**
|
|
3022
|
-
* @summary Site access logs
|
|
3023
|
-
*/
|
|
3024
|
-
export function useSitesAccessLogsDownload(siteId, params, options) {
|
|
3025
|
-
const queryOptions = getSitesAccessLogsDownloadQueryOptions(siteId, params, options);
|
|
3026
|
-
const query = useQuery(queryOptions);
|
|
3027
|
-
query.queryKey = queryOptions.queryKey;
|
|
3028
|
-
return query;
|
|
3029
|
-
}
|
|
3030
|
-
/**
|
|
3031
|
-
* Returns site error logs.
|
|
3032
|
-
* @summary Site error logs
|
|
3033
|
-
*/
|
|
3034
|
-
export const sitesErrorLogs = (siteId, params, options) => {
|
|
3035
|
-
return axios.get(`/v1/sites/${siteId}/logs/error`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3036
|
-
};
|
|
3037
|
-
export const getSitesErrorLogsQueryKey = (siteId, params) => {
|
|
3038
|
-
return [
|
|
3039
|
-
`/v1/sites/${siteId}/logs/error`,
|
|
3040
|
-
...(params ? [params] : []),
|
|
3041
|
-
];
|
|
3042
|
-
};
|
|
3043
|
-
export const getSitesErrorLogsInfiniteQueryOptions = (siteId, params, options) => {
|
|
3044
|
-
var _a;
|
|
3045
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3046
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
|
|
3047
|
-
const queryFn = ({ signal, }) => sitesErrorLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
3048
|
-
return Object.assign({ queryKey,
|
|
3049
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3050
|
-
};
|
|
3051
|
-
/**
|
|
3052
|
-
* @summary Site error logs
|
|
3053
|
-
*/
|
|
3054
|
-
export function useSitesErrorLogsInfinite(siteId, params, options) {
|
|
3055
|
-
const queryOptions = getSitesErrorLogsInfiniteQueryOptions(siteId, params, options);
|
|
3056
|
-
const query = useInfiniteQuery(queryOptions);
|
|
3057
|
-
query.queryKey = queryOptions.queryKey;
|
|
3058
|
-
return query;
|
|
3059
|
-
}
|
|
3060
|
-
export const getSitesErrorLogsQueryOptions = (siteId, params, options) => {
|
|
3061
|
-
var _a;
|
|
3062
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3063
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
|
|
3064
|
-
const queryFn = ({ signal, }) => sitesErrorLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
3065
|
-
return Object.assign({ queryKey,
|
|
3066
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3067
|
-
};
|
|
3068
|
-
/**
|
|
3069
|
-
* @summary Site error logs
|
|
3070
|
-
*/
|
|
3071
|
-
export function useSitesErrorLogs(siteId, params, options) {
|
|
3072
|
-
const queryOptions = getSitesErrorLogsQueryOptions(siteId, params, options);
|
|
3073
|
-
const query = useQuery(queryOptions);
|
|
3074
|
-
query.queryKey = queryOptions.queryKey;
|
|
3075
|
-
return query;
|
|
3076
|
-
}
|
|
3077
|
-
/**
|
|
3078
|
-
* Returns site error logs.
|
|
3079
|
-
* @summary Site error logs
|
|
3080
|
-
*/
|
|
3081
|
-
export const sitesErrorLogsDownload = (siteId, params, options) => {
|
|
3082
|
-
return axios.get(`/v1/sites/${siteId}/logs/error/download`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3083
|
-
};
|
|
3084
|
-
export const getSitesErrorLogsDownloadQueryKey = (siteId, params) => {
|
|
3085
|
-
return [
|
|
3086
|
-
`/v1/sites/${siteId}/logs/error/download`,
|
|
3087
|
-
...(params ? [params] : []),
|
|
3088
|
-
];
|
|
3089
|
-
};
|
|
3090
|
-
export const getSitesErrorLogsDownloadQueryOptions = (siteId, params, options) => {
|
|
3091
|
-
var _a;
|
|
3092
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3093
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsDownloadQueryKey(siteId, params);
|
|
3094
|
-
const queryFn = ({ signal }) => sitesErrorLogsDownload(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
3095
|
-
return Object.assign({ queryKey,
|
|
3096
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3097
|
-
};
|
|
3098
|
-
/**
|
|
3099
|
-
* @summary Site error logs
|
|
3100
|
-
*/
|
|
3101
|
-
export function useSitesErrorLogsDownload(siteId, params, options) {
|
|
3102
|
-
const queryOptions = getSitesErrorLogsDownloadQueryOptions(siteId, params, options);
|
|
3103
|
-
const query = useQuery(queryOptions);
|
|
3104
|
-
query.queryKey = queryOptions.queryKey;
|
|
3105
|
-
return query;
|
|
3106
|
-
}
|
|
3107
|
-
/**
|
|
3108
|
-
* Returns malware status of atomic site
|
|
3109
|
-
* @summary malware status of atomic site
|
|
3110
|
-
*/
|
|
3111
|
-
export const siteMalwareStatus = (siteId, options) => {
|
|
3112
|
-
return axios.get(`/v1/sites/${siteId}/malware-status`, options);
|
|
3113
|
-
};
|
|
3114
|
-
export const getSiteMalwareStatusQueryKey = (siteId) => {
|
|
3115
|
-
return [`/v1/sites/${siteId}/malware-status`];
|
|
3116
|
-
};
|
|
3117
|
-
export const getSiteMalwareStatusQueryOptions = (siteId, options) => {
|
|
3118
|
-
var _a;
|
|
3119
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3120
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteMalwareStatusQueryKey(siteId);
|
|
3121
|
-
const queryFn = ({ signal }) => siteMalwareStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
3122
|
-
return Object.assign({ queryKey,
|
|
3123
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3124
|
-
};
|
|
3125
|
-
/**
|
|
3126
|
-
* @summary malware status of atomic site
|
|
3127
|
-
*/
|
|
3128
|
-
export function useSiteMalwareStatus(siteId, options) {
|
|
3129
|
-
const queryOptions = getSiteMalwareStatusQueryOptions(siteId, options);
|
|
3130
|
-
const query = useQuery(queryOptions);
|
|
3131
|
-
query.queryKey = queryOptions.queryKey;
|
|
3132
|
-
return query;
|
|
3133
|
-
}
|
|
3134
|
-
/**
|
|
3135
|
-
* Returns site metrics summary
|
|
3136
|
-
* @summary metrics
|
|
3137
|
-
*/
|
|
3138
|
-
export const sitesMetricsDimensionAveraged = (siteId, params, dimension = 'http_host', options) => {
|
|
3139
|
-
return axios.get(`/v1/sites/${siteId}/metrics/dimension/${dimension}/averaged`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3140
|
-
};
|
|
3141
|
-
export const getSitesMetricsDimensionAveragedQueryKey = (siteId, params, dimension = 'http_host') => {
|
|
3142
|
-
return [
|
|
3143
|
-
`/v1/sites/${siteId}/metrics/dimension/${dimension}/averaged`,
|
|
3144
|
-
...(params ? [params] : []),
|
|
3145
|
-
];
|
|
3146
|
-
};
|
|
3147
|
-
export const getSitesMetricsDimensionAveragedQueryOptions = (siteId, params, dimension = 'http_host', options) => {
|
|
3148
|
-
var _a;
|
|
3149
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3150
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesMetricsDimensionAveragedQueryKey(siteId, params, dimension);
|
|
3151
|
-
const queryFn = ({ signal }) => sitesMetricsDimensionAveraged(siteId, params, dimension, Object.assign({ signal }, axiosOptions));
|
|
3152
|
-
return Object.assign({ queryKey,
|
|
3153
|
-
queryFn, enabled: !!(siteId && dimension) }, queryOptions);
|
|
3154
|
-
};
|
|
3155
|
-
/**
|
|
3156
|
-
* @summary metrics
|
|
3157
|
-
*/
|
|
3158
|
-
export function useSitesMetricsDimensionAveraged(siteId, params, dimension = 'http_host', options) {
|
|
3159
|
-
const queryOptions = getSitesMetricsDimensionAveragedQueryOptions(siteId, params, dimension, options);
|
|
3160
|
-
const query = useQuery(queryOptions);
|
|
3161
|
-
query.queryKey = queryOptions.queryKey;
|
|
3162
|
-
return query;
|
|
3163
|
-
}
|
|
3164
|
-
/**
|
|
3165
|
-
* Returns site metrics.
|
|
3166
|
-
* @summary metrics
|
|
3167
|
-
*/
|
|
3168
|
-
export const sitesMetricDimensions = (siteId, metric, params, options) => {
|
|
3169
|
-
return axios.get(`/v1/sites/${siteId}/metrics/${metric}/dimensions`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3170
|
-
};
|
|
3171
|
-
export const getSitesMetricDimensionsQueryKey = (siteId, metric, params) => {
|
|
3172
|
-
return [
|
|
3173
|
-
`/v1/sites/${siteId}/metrics/${metric}/dimensions`,
|
|
3174
|
-
...(params ? [params] : []),
|
|
3175
|
-
];
|
|
3176
|
-
};
|
|
3177
|
-
export const getSitesMetricDimensionsQueryOptions = (siteId, metric, params, options) => {
|
|
3178
|
-
var _a;
|
|
3179
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3180
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesMetricDimensionsQueryKey(siteId, metric, params);
|
|
3181
|
-
const queryFn = ({ signal }) => sitesMetricDimensions(siteId, metric, params, Object.assign({ signal }, axiosOptions));
|
|
3182
|
-
return Object.assign({ queryKey,
|
|
3183
|
-
queryFn, enabled: !!(siteId && metric) }, queryOptions);
|
|
3184
|
-
};
|
|
3185
|
-
/**
|
|
3186
|
-
* @summary metrics
|
|
3187
|
-
*/
|
|
3188
|
-
export function useSitesMetricDimensions(siteId, metric, params, options) {
|
|
3189
|
-
const queryOptions = getSitesMetricDimensionsQueryOptions(siteId, metric, params, options);
|
|
3190
|
-
const query = useQuery(queryOptions);
|
|
3191
|
-
query.queryKey = queryOptions.queryKey;
|
|
3192
|
-
return query;
|
|
3193
|
-
}
|
|
3194
|
-
/**
|
|
3195
|
-
* Delete pending domain
|
|
3196
|
-
* @summary Delete pending domain
|
|
3197
|
-
*/
|
|
3198
|
-
export const sitePendingDomainDelete = (siteId, options) => {
|
|
3199
|
-
return axios.delete(`/v1/sites/${siteId}/pending-domain`, options);
|
|
3200
|
-
};
|
|
3201
|
-
export const getSitePendingDomainDeleteMutationOptions = (options) => {
|
|
3202
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3203
|
-
const mutationFn = (props) => {
|
|
3204
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
3205
|
-
return sitePendingDomainDelete(siteId, axiosOptions);
|
|
3206
|
-
};
|
|
3207
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3208
|
-
};
|
|
3209
|
-
/**
|
|
3210
|
-
* @summary Delete pending domain
|
|
3211
|
-
*/
|
|
3212
|
-
export const useSitePendingDomainDelete = (options) => {
|
|
3213
|
-
const mutationOptions = getSitePendingDomainDeleteMutationOptions(options);
|
|
3214
|
-
return useMutation(mutationOptions);
|
|
3215
|
-
};
|
|
3216
|
-
/**
|
|
3217
|
-
* cache purge site and url
|
|
3218
|
-
* @summary cache purge url
|
|
3219
|
-
*/
|
|
3220
|
-
export const sitesPerformanceCachepurge = (siteId, sitesPerformanceCachepurgeBody, options) => {
|
|
3221
|
-
return axios.post(`/v1/sites/${siteId}/performance/cachepurge`, sitesPerformanceCachepurgeBody, options);
|
|
3222
|
-
};
|
|
3223
|
-
export const getSitesPerformanceCachepurgeMutationOptions = (options) => {
|
|
3224
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3225
|
-
const mutationFn = (props) => {
|
|
3226
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3227
|
-
return sitesPerformanceCachepurge(siteId, data, axiosOptions);
|
|
3228
|
-
};
|
|
3229
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3230
|
-
};
|
|
3231
|
-
/**
|
|
3232
|
-
* @summary cache purge url
|
|
3233
|
-
*/
|
|
3234
|
-
export const useSitesPerformanceCachepurge = (options) => {
|
|
3235
|
-
const mutationOptions = getSitesPerformanceCachepurgeMutationOptions(options);
|
|
3236
|
-
return useMutation(mutationOptions);
|
|
3237
|
-
};
|
|
3238
|
-
/**
|
|
3239
|
-
* Update the edge cache
|
|
3240
|
-
* @summary edge cache toggle for atomic site
|
|
3241
|
-
*/
|
|
3242
|
-
export const sitesPerformanceEdgecache = (siteId, sitesPerformanceEdgecacheBody, options) => {
|
|
3243
|
-
return axios.put(`/v1/sites/${siteId}/performance/edge_cache`, sitesPerformanceEdgecacheBody, options);
|
|
3244
|
-
};
|
|
3245
|
-
export const getSitesPerformanceEdgecacheMutationOptions = (options) => {
|
|
3246
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3247
|
-
const mutationFn = (props) => {
|
|
3248
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3249
|
-
return sitesPerformanceEdgecache(siteId, data, axiosOptions);
|
|
3250
|
-
};
|
|
3251
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3252
|
-
};
|
|
3253
|
-
/**
|
|
3254
|
-
* @summary edge cache toggle for atomic site
|
|
3255
|
-
*/
|
|
3256
|
-
export const useSitesPerformanceEdgecache = (options) => {
|
|
3257
|
-
const mutationOptions = getSitesPerformanceEdgecacheMutationOptions(options);
|
|
3258
|
-
return useMutation(mutationOptions);
|
|
3259
|
-
};
|
|
3260
|
-
/**
|
|
3261
|
-
* Returns the status of endurance_cache_level
|
|
3262
|
-
* @summary Get status of endurance cache level
|
|
3263
|
-
*/
|
|
3264
|
-
export const sitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
|
|
3265
|
-
return axios.get(`/v1/sites/${siteId}/performance/endurance_cache_level`, options);
|
|
3266
|
-
};
|
|
3267
|
-
export const getSitesPerformanceEnduranceCacheLevelStatusQueryKey = (siteId) => {
|
|
3268
|
-
return [`/v1/sites/${siteId}/performance/endurance_cache_level`];
|
|
3269
|
-
};
|
|
3270
|
-
export const getSitesPerformanceEnduranceCacheLevelStatusQueryOptions = (siteId, options) => {
|
|
3271
|
-
var _a;
|
|
3272
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3273
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesPerformanceEnduranceCacheLevelStatusQueryKey(siteId);
|
|
3274
|
-
const queryFn = ({ signal }) => sitesPerformanceEnduranceCacheLevelStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
3275
|
-
return Object.assign({ queryKey,
|
|
3276
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3277
|
-
};
|
|
3278
|
-
/**
|
|
3279
|
-
* @summary Get status of endurance cache level
|
|
3280
|
-
*/
|
|
3281
|
-
export function useSitesPerformanceEnduranceCacheLevelStatus(siteId, options) {
|
|
3282
|
-
const queryOptions = getSitesPerformanceEnduranceCacheLevelStatusQueryOptions(siteId, options);
|
|
3283
|
-
const query = useQuery(queryOptions);
|
|
3284
|
-
query.queryKey = queryOptions.queryKey;
|
|
3285
|
-
return query;
|
|
3286
|
-
}
|
|
3287
|
-
/**
|
|
3288
|
-
* Set endurance cache level to 0, 1,2 or 3
|
|
3289
|
-
* @summary Set endurance cache level
|
|
3290
|
-
*/
|
|
3291
|
-
export const sitesPerformanceEnduranceCacheLevel = (siteId, sitesPerformanceEnduranceCacheLevelBody, options) => {
|
|
3292
|
-
return axios.post(`/v1/sites/${siteId}/performance/endurance_cache_level`, sitesPerformanceEnduranceCacheLevelBody, options);
|
|
3293
|
-
};
|
|
3294
|
-
export const getSitesPerformanceEnduranceCacheLevelMutationOptions = (options) => {
|
|
3295
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3296
|
-
const mutationFn = (props) => {
|
|
3297
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3298
|
-
return sitesPerformanceEnduranceCacheLevel(siteId, data, axiosOptions);
|
|
3299
|
-
};
|
|
3300
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3301
|
-
};
|
|
3302
|
-
/**
|
|
3303
|
-
* @summary Set endurance cache level
|
|
3304
|
-
*/
|
|
3305
|
-
export const useSitesPerformanceEnduranceCacheLevel = (options) => {
|
|
3306
|
-
const mutationOptions = getSitesPerformanceEnduranceCacheLevelMutationOptions(options);
|
|
3307
|
-
return useMutation(mutationOptions);
|
|
3308
|
-
};
|
|
3309
|
-
/**
|
|
3310
|
-
* Update the endurance page cache
|
|
3311
|
-
* @summary update the endurance cache page
|
|
3312
|
-
*/
|
|
3313
|
-
export const sitesPerformanceEndurancePageCache = (siteId, options) => {
|
|
3314
|
-
return axios.put(`/v1/sites/${siteId}/performance/endurance_page_cache`, undefined, options);
|
|
3315
|
-
};
|
|
3316
|
-
export const getSitesPerformanceEndurancePageCacheMutationOptions = (options) => {
|
|
3317
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3318
|
-
const mutationFn = (props) => {
|
|
3319
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
3320
|
-
return sitesPerformanceEndurancePageCache(siteId, axiosOptions);
|
|
3321
|
-
};
|
|
3322
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3323
|
-
};
|
|
3324
|
-
/**
|
|
3325
|
-
* @summary update the endurance cache page
|
|
3326
|
-
*/
|
|
3327
|
-
export const useSitesPerformanceEndurancePageCache = (options) => {
|
|
3328
|
-
const mutationOptions = getSitesPerformanceEndurancePageCacheMutationOptions(options);
|
|
3329
|
-
return useMutation(mutationOptions);
|
|
3330
|
-
};
|
|
3331
|
-
/**
|
|
3332
|
-
* Create php info for a site
|
|
3333
|
-
* @summary Create php info for a site
|
|
3334
|
-
*/
|
|
3335
|
-
export const createPhpInfo = (siteId, options) => {
|
|
3336
|
-
return axios.post(`/v1/sites/${siteId}/php-info`, undefined, options);
|
|
3337
|
-
};
|
|
3338
|
-
export const getCreatePhpInfoMutationOptions = (options) => {
|
|
3339
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3340
|
-
const mutationFn = (props) => {
|
|
3341
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
3342
|
-
return createPhpInfo(siteId, axiosOptions);
|
|
3343
|
-
};
|
|
3344
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3345
|
-
};
|
|
3346
|
-
/**
|
|
3347
|
-
* @summary Create php info for a site
|
|
3348
|
-
*/
|
|
3349
|
-
export const useCreatePhpInfo = (options) => {
|
|
3350
|
-
const mutationOptions = getCreatePhpInfoMutationOptions(options);
|
|
3351
|
-
return useMutation(mutationOptions);
|
|
3352
|
-
};
|
|
3353
|
-
/**
|
|
3354
|
-
* Returns a list of the site's plugins
|
|
3355
|
-
* @summary plugins
|
|
3356
|
-
*/
|
|
3357
|
-
export const sitePlugins = (siteId, params, options) => {
|
|
3358
|
-
return axios.get(`/v1/sites/${siteId}/plugins`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3359
|
-
};
|
|
3360
|
-
export const getSitePluginsQueryKey = (siteId, params) => {
|
|
3361
|
-
return [`/v1/sites/${siteId}/plugins`, ...(params ? [params] : [])];
|
|
3362
|
-
};
|
|
3363
|
-
export const getSitePluginsQueryOptions = (siteId, params, options) => {
|
|
3364
|
-
var _a;
|
|
3365
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3366
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitePluginsQueryKey(siteId, params);
|
|
3367
|
-
const queryFn = ({ signal, }) => sitePlugins(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
3368
|
-
return Object.assign({ queryKey,
|
|
3369
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3370
|
-
};
|
|
3371
|
-
/**
|
|
3372
|
-
* @summary plugins
|
|
3373
|
-
*/
|
|
3374
|
-
export function useSitePlugins(siteId, params, options) {
|
|
3375
|
-
const queryOptions = getSitePluginsQueryOptions(siteId, params, options);
|
|
3376
|
-
const query = useQuery(queryOptions);
|
|
3377
|
-
query.queryKey = queryOptions.queryKey;
|
|
3378
|
-
return query;
|
|
3379
|
-
}
|
|
3380
|
-
/**
|
|
3381
|
-
* Enables / disables a plugin
|
|
3382
|
-
* @summary plugins toggle
|
|
3383
|
-
*/
|
|
3384
|
-
export const sitePluginUpdate = (siteId, sitePluginUpdateBody, options) => {
|
|
3385
|
-
return axios.put(`/v1/sites/${siteId}/plugins`, sitePluginUpdateBody, options);
|
|
3386
|
-
};
|
|
3387
|
-
export const getSitePluginUpdateMutationOptions = (options) => {
|
|
3388
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3389
|
-
const mutationFn = (props) => {
|
|
3390
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3391
|
-
return sitePluginUpdate(siteId, data, axiosOptions);
|
|
3392
|
-
};
|
|
3393
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3394
|
-
};
|
|
3395
|
-
/**
|
|
3396
|
-
* @summary plugins toggle
|
|
3397
|
-
*/
|
|
3398
|
-
export const useSitePluginUpdate = (options) => {
|
|
3399
|
-
const mutationOptions = getSitePluginUpdateMutationOptions(options);
|
|
3400
|
-
return useMutation(mutationOptions);
|
|
3401
|
-
};
|
|
3402
|
-
/**
|
|
3403
|
-
* Enables / disables plugin auto-updates
|
|
3404
|
-
* @deprecated
|
|
3405
|
-
* @summary plugins autoupdate
|
|
3406
|
-
*/
|
|
3407
|
-
export const sitePluginsAutoupdate = (siteId, sitePluginsAutoupdateBody, options) => {
|
|
3408
|
-
return axios.post(`/v1/sites/${siteId}/plugins/autoupdate`, sitePluginsAutoupdateBody, options);
|
|
3409
|
-
};
|
|
3410
|
-
export const getSitePluginsAutoupdateMutationOptions = (options) => {
|
|
3411
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3412
|
-
const mutationFn = (props) => {
|
|
3413
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3414
|
-
return sitePluginsAutoupdate(siteId, data, axiosOptions);
|
|
3415
|
-
};
|
|
3416
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3417
|
-
};
|
|
3418
|
-
/**
|
|
3419
|
-
* @deprecated
|
|
3420
|
-
* @summary plugins autoupdate
|
|
3421
|
-
*/
|
|
3422
|
-
export const useSitePluginsAutoupdate = (options) => {
|
|
3423
|
-
const mutationOptions = getSitePluginsAutoupdateMutationOptions(options);
|
|
3424
|
-
return useMutation(mutationOptions);
|
|
3425
|
-
};
|
|
3426
|
-
/**
|
|
3427
|
-
* Enables / disables a plugin
|
|
3428
|
-
* @deprecated
|
|
3429
|
-
* @summary Deprecated - plugins toggle
|
|
3430
|
-
*/
|
|
3431
|
-
export const sitePluginsToggle = (siteId, sitePluginsToggleBody, options) => {
|
|
3432
|
-
return axios.post(`/v1/sites/${siteId}/plugins/toggle`, sitePluginsToggleBody, options);
|
|
3433
|
-
};
|
|
3434
|
-
export const getSitePluginsToggleMutationOptions = (options) => {
|
|
3435
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3436
|
-
const mutationFn = (props) => {
|
|
3437
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3438
|
-
return sitePluginsToggle(siteId, data, axiosOptions);
|
|
3439
|
-
};
|
|
3440
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3441
|
-
};
|
|
3442
|
-
/**
|
|
3443
|
-
* @deprecated
|
|
3444
|
-
* @summary Deprecated - plugins toggle
|
|
3445
|
-
*/
|
|
3446
|
-
export const useSitePluginsToggle = (options) => {
|
|
3447
|
-
const mutationOptions = getSitePluginsToggleMutationOptions(options);
|
|
3448
|
-
return useMutation(mutationOptions);
|
|
3449
|
-
};
|
|
3450
|
-
/**
|
|
3451
|
-
* Updates a plugin
|
|
3452
|
-
* @summary plugins update
|
|
3453
|
-
*/
|
|
3454
|
-
export const sitePluginsUpdate = (siteId, sitePluginsUpdateBody, options) => {
|
|
3455
|
-
return axios.post(`/v1/sites/${siteId}/plugins/update`, sitePluginsUpdateBody, options);
|
|
3456
|
-
};
|
|
3457
|
-
export const getSitePluginsUpdateMutationOptions = (options) => {
|
|
3458
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3459
|
-
const mutationFn = (props) => {
|
|
3460
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3461
|
-
return sitePluginsUpdate(siteId, data, axiosOptions);
|
|
3462
|
-
};
|
|
3463
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3464
|
-
};
|
|
3465
|
-
/**
|
|
3466
|
-
* @summary plugins update
|
|
3467
|
-
*/
|
|
3468
|
-
export const useSitePluginsUpdate = (options) => {
|
|
3469
|
-
const mutationOptions = getSitePluginsUpdateMutationOptions(options);
|
|
3470
|
-
return useMutation(mutationOptions);
|
|
3471
|
-
};
|
|
3472
|
-
/**
|
|
3473
|
-
* Resets a site - deletes/reinstalls the site.
|
|
3474
|
-
* @summary reset site
|
|
3475
|
-
*/
|
|
3476
|
-
export const resetSite = (siteId, resetSiteBody, options) => {
|
|
3477
|
-
return axios.post(`/v1/sites/${siteId}/reset`, resetSiteBody, options);
|
|
3478
|
-
};
|
|
3479
|
-
export const getResetSiteMutationOptions = (options) => {
|
|
3480
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3481
|
-
const mutationFn = (props) => {
|
|
3482
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3483
|
-
return resetSite(siteId, data, axiosOptions);
|
|
3484
|
-
};
|
|
3485
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3486
|
-
};
|
|
3487
|
-
/**
|
|
3488
|
-
* @summary reset site
|
|
3489
|
-
*/
|
|
3490
|
-
export const useResetSite = (options) => {
|
|
3491
|
-
const mutationOptions = getResetSiteMutationOptions(options);
|
|
3492
|
-
return useMutation(mutationOptions);
|
|
3493
|
-
};
|
|
3494
|
-
/**
|
|
3495
|
-
* if security bundle to be enabled.
|
|
3496
|
-
* @summary security bundle
|
|
3497
|
-
*/
|
|
3498
|
-
export const sitesSecurityBundle = (siteId, options) => {
|
|
3499
|
-
return axios.get(`/v1/sites/${siteId}/security/bundle`, options);
|
|
3500
|
-
};
|
|
3501
|
-
export const getSitesSecurityBundleQueryKey = (siteId) => {
|
|
3502
|
-
return [`/v1/sites/${siteId}/security/bundle`];
|
|
3503
|
-
};
|
|
3504
|
-
export const getSitesSecurityBundleQueryOptions = (siteId, options) => {
|
|
3505
|
-
var _a;
|
|
3506
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3507
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityBundleQueryKey(siteId);
|
|
3508
|
-
const queryFn = ({ signal }) => sitesSecurityBundle(siteId, Object.assign({ signal }, axiosOptions));
|
|
3509
|
-
return Object.assign({ queryKey,
|
|
3510
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3511
|
-
};
|
|
3512
|
-
/**
|
|
3513
|
-
* @summary security bundle
|
|
3514
|
-
*/
|
|
3515
|
-
export function useSitesSecurityBundle(siteId, options) {
|
|
3516
|
-
const queryOptions = getSitesSecurityBundleQueryOptions(siteId, options);
|
|
3517
|
-
const query = useQuery(queryOptions);
|
|
3518
|
-
query.queryKey = queryOptions.queryKey;
|
|
3519
|
-
return query;
|
|
3520
|
-
}
|
|
3521
|
-
/**
|
|
3522
|
-
* Performs a checksum of the site's core files to verify integrity.
|
|
3523
|
-
* @summary core files checksum
|
|
3524
|
-
*/
|
|
3525
|
-
export const sitesSecurityCheckCore = (siteId, options) => {
|
|
3526
|
-
return axios.get(`/v1/sites/${siteId}/security/core/check`, options);
|
|
3527
|
-
};
|
|
3528
|
-
export const getSitesSecurityCheckCoreQueryKey = (siteId) => {
|
|
3529
|
-
return [`/v1/sites/${siteId}/security/core/check`];
|
|
3530
|
-
};
|
|
3531
|
-
export const getSitesSecurityCheckCoreQueryOptions = (siteId, options) => {
|
|
3532
|
-
var _a;
|
|
3533
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3534
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityCheckCoreQueryKey(siteId);
|
|
3535
|
-
const queryFn = ({ signal }) => sitesSecurityCheckCore(siteId, Object.assign({ signal }, axiosOptions));
|
|
3536
|
-
return Object.assign({ queryKey,
|
|
3537
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3538
|
-
};
|
|
3539
|
-
/**
|
|
3540
|
-
* @summary core files checksum
|
|
3541
|
-
*/
|
|
3542
|
-
export function useSitesSecurityCheckCore(siteId, options) {
|
|
3543
|
-
const queryOptions = getSitesSecurityCheckCoreQueryOptions(siteId, options);
|
|
3544
|
-
const query = useQuery(queryOptions);
|
|
3545
|
-
query.queryKey = queryOptions.queryKey;
|
|
3546
|
-
return query;
|
|
3547
|
-
}
|
|
3548
|
-
/**
|
|
3549
|
-
* Resets the site's core files.
|
|
3550
|
-
* @summary core files reset
|
|
3551
|
-
*/
|
|
3552
|
-
export const sitesSecurityResetCoreFiles = (siteId, options) => {
|
|
3553
|
-
return axios.post(`/v1/sites/${siteId}/security/core/reset`, undefined, options);
|
|
3554
|
-
};
|
|
3555
|
-
export const getSitesSecurityResetCoreFilesMutationOptions = (options) => {
|
|
3556
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3557
|
-
const mutationFn = (props) => {
|
|
3558
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
3559
|
-
return sitesSecurityResetCoreFiles(siteId, axiosOptions);
|
|
3560
|
-
};
|
|
3561
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3562
|
-
};
|
|
3563
|
-
/**
|
|
3564
|
-
* @summary core files reset
|
|
3565
|
-
*/
|
|
3566
|
-
export const useSitesSecurityResetCoreFiles = (options) => {
|
|
3567
|
-
const mutationOptions = getSitesSecurityResetCoreFilesMutationOptions(options);
|
|
3568
|
-
return useMutation(mutationOptions);
|
|
3569
|
-
};
|
|
3570
|
-
/**
|
|
3571
|
-
* Returns the HTTPS redirection status.
|
|
3572
|
-
* @summary https redirection status
|
|
3573
|
-
*/
|
|
3574
|
-
export const sitesSecurityHttpsRedirectionStatus = (siteId, options) => {
|
|
3575
|
-
return axios.get(`/v1/sites/${siteId}/security/https`, options);
|
|
3576
|
-
};
|
|
3577
|
-
export const getSitesSecurityHttpsRedirectionStatusQueryKey = (siteId) => {
|
|
3578
|
-
return [`/v1/sites/${siteId}/security/https`];
|
|
3579
|
-
};
|
|
3580
|
-
export const getSitesSecurityHttpsRedirectionStatusQueryOptions = (siteId, options) => {
|
|
3581
|
-
var _a;
|
|
3582
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3583
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityHttpsRedirectionStatusQueryKey(siteId);
|
|
3584
|
-
const queryFn = ({ signal }) => sitesSecurityHttpsRedirectionStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
3585
|
-
return Object.assign({ queryKey,
|
|
3586
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3587
|
-
};
|
|
3588
|
-
/**
|
|
3589
|
-
* @summary https redirection status
|
|
3590
|
-
*/
|
|
3591
|
-
export function useSitesSecurityHttpsRedirectionStatus(siteId, options) {
|
|
3592
|
-
const queryOptions = getSitesSecurityHttpsRedirectionStatusQueryOptions(siteId, options);
|
|
3593
|
-
const query = useQuery(queryOptions);
|
|
3594
|
-
query.queryKey = queryOptions.queryKey;
|
|
3595
|
-
return query;
|
|
3596
|
-
}
|
|
3597
|
-
/**
|
|
3598
|
-
* Enables / disables HTTPS redirection.
|
|
3599
|
-
* @summary https redirection toggle
|
|
3600
|
-
*/
|
|
3601
|
-
export const sitesSecurityHttpsEnableDisableSsl = (siteId, sitesSecurityHttpsEnableDisableSslBody, options) => {
|
|
3602
|
-
return axios.post(`/v1/sites/${siteId}/security/https`, sitesSecurityHttpsEnableDisableSslBody, options);
|
|
3603
|
-
};
|
|
3604
|
-
export const getSitesSecurityHttpsEnableDisableSslMutationOptions = (options) => {
|
|
3605
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3606
|
-
const mutationFn = (props) => {
|
|
3607
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3608
|
-
return sitesSecurityHttpsEnableDisableSsl(siteId, data, axiosOptions);
|
|
3609
|
-
};
|
|
3610
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3611
|
-
};
|
|
3612
|
-
/**
|
|
3613
|
-
* @summary https redirection toggle
|
|
3614
|
-
*/
|
|
3615
|
-
export const useSitesSecurityHttpsEnableDisableSsl = (options) => {
|
|
3616
|
-
const mutationOptions = getSitesSecurityHttpsEnableDisableSslMutationOptions(options);
|
|
3617
|
-
return useMutation(mutationOptions);
|
|
3618
|
-
};
|
|
3619
|
-
/**
|
|
3620
|
-
* Returns the site's sitelock information.
|
|
3621
|
-
* @summary sitelock info
|
|
3622
|
-
*/
|
|
3623
|
-
export const sitesSecuritySitelock = (siteId, options) => {
|
|
3624
|
-
return axios.get(`/v1/sites/${siteId}/security/sitelock`, options);
|
|
3625
|
-
};
|
|
3626
|
-
export const getSitesSecuritySitelockQueryKey = (siteId) => {
|
|
3627
|
-
return [`/v1/sites/${siteId}/security/sitelock`];
|
|
3628
|
-
};
|
|
3629
|
-
export const getSitesSecuritySitelockQueryOptions = (siteId, options) => {
|
|
3630
|
-
var _a;
|
|
3631
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3632
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockQueryKey(siteId);
|
|
3633
|
-
const queryFn = ({ signal }) => sitesSecuritySitelock(siteId, Object.assign({ signal }, axiosOptions));
|
|
3634
|
-
return Object.assign({ queryKey,
|
|
3635
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3636
|
-
};
|
|
3637
|
-
/**
|
|
3638
|
-
* @summary sitelock info
|
|
3639
|
-
*/
|
|
3640
|
-
export function useSitesSecuritySitelock(siteId, options) {
|
|
3641
|
-
const queryOptions = getSitesSecuritySitelockQueryOptions(siteId, options);
|
|
3642
|
-
const query = useQuery(queryOptions);
|
|
3643
|
-
query.queryKey = queryOptions.queryKey;
|
|
3644
|
-
return query;
|
|
3645
|
-
}
|
|
3646
|
-
/**
|
|
3647
|
-
* Disables / enables cPanel to generate Let's Encrypt SSLs for the site.
|
|
3648
|
-
* @summary ssl lets encrypt toggle
|
|
3649
|
-
*/
|
|
3650
|
-
export const sitesSecuritySslAcme = (siteId, options) => {
|
|
3651
|
-
return axios.post(`/v1/sites/${siteId}/security/ssl/acme`, undefined, options);
|
|
3652
|
-
};
|
|
3653
|
-
export const getSitesSecuritySslAcmeMutationOptions = (options) => {
|
|
3654
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3655
|
-
const mutationFn = (props) => {
|
|
3656
|
-
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
3657
|
-
return sitesSecuritySslAcme(siteId, axiosOptions);
|
|
3658
|
-
};
|
|
3659
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3660
|
-
};
|
|
3661
|
-
/**
|
|
3662
|
-
* @summary ssl lets encrypt toggle
|
|
3663
|
-
*/
|
|
3664
|
-
export const useSitesSecuritySslAcme = (options) => {
|
|
3665
|
-
const mutationOptions = getSitesSecuritySslAcmeMutationOptions(options);
|
|
3666
|
-
return useMutation(mutationOptions);
|
|
3667
|
-
};
|
|
3668
|
-
/**
|
|
3669
|
-
* Returns the site's SSL Status
|
|
3670
|
-
* @deprecated
|
|
3671
|
-
* @summary ssl status
|
|
3672
|
-
*/
|
|
3673
|
-
export const sitesSecuritySslStatus = (siteId, params, options) => {
|
|
3674
|
-
return axios.get(`/v1/sites/${siteId}/security/ssl/status`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3675
|
-
};
|
|
3676
|
-
export const getSitesSecuritySslStatusQueryKey = (siteId, params) => {
|
|
3677
|
-
return [
|
|
3678
|
-
`/v1/sites/${siteId}/security/ssl/status`,
|
|
3679
|
-
...(params ? [params] : []),
|
|
3680
|
-
];
|
|
3681
|
-
};
|
|
3682
|
-
export const getSitesSecuritySslStatusQueryOptions = (siteId, params, options) => {
|
|
3683
|
-
var _a;
|
|
3684
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3685
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySslStatusQueryKey(siteId, params);
|
|
3686
|
-
const queryFn = ({ signal }) => sitesSecuritySslStatus(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
3687
|
-
return Object.assign({ queryKey,
|
|
3688
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3689
|
-
};
|
|
3690
|
-
/**
|
|
3691
|
-
* @deprecated
|
|
3692
|
-
* @summary ssl status
|
|
3693
|
-
*/
|
|
3694
|
-
export function useSitesSecuritySslStatus(siteId, params, options) {
|
|
3695
|
-
const queryOptions = getSitesSecuritySslStatusQueryOptions(siteId, params, options);
|
|
3696
|
-
const query = useQuery(queryOptions);
|
|
3697
|
-
query.queryKey = queryOptions.queryKey;
|
|
3698
|
-
return query;
|
|
3699
|
-
}
|
|
3700
|
-
/**
|
|
3701
|
-
* Returns whether the coming soon setting is enable or disabled
|
|
3702
|
-
* @summary settings coming soon page status
|
|
3703
|
-
*/
|
|
3704
|
-
export const sitesSettingsComingSoon = (siteId, options) => {
|
|
3705
|
-
return axios.get(`/v1/sites/${siteId}/settings/coming-soon`, options);
|
|
3706
|
-
};
|
|
3707
|
-
export const getSitesSettingsComingSoonQueryKey = (siteId) => {
|
|
3708
|
-
return [`/v1/sites/${siteId}/settings/coming-soon`];
|
|
3709
|
-
};
|
|
3710
|
-
export const getSitesSettingsComingSoonQueryOptions = (siteId, options) => {
|
|
3711
|
-
var _a;
|
|
3712
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3713
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsComingSoonQueryKey(siteId);
|
|
3714
|
-
const queryFn = ({ signal }) => sitesSettingsComingSoon(siteId, Object.assign({ signal }, axiosOptions));
|
|
3715
|
-
return Object.assign({ queryKey,
|
|
3716
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3717
|
-
};
|
|
3718
|
-
/**
|
|
3719
|
-
* @summary settings coming soon page status
|
|
3720
|
-
*/
|
|
3721
|
-
export function useSitesSettingsComingSoon(siteId, options) {
|
|
3722
|
-
const queryOptions = getSitesSettingsComingSoonQueryOptions(siteId, options);
|
|
3723
|
-
const query = useQuery(queryOptions);
|
|
3724
|
-
query.queryKey = queryOptions.queryKey;
|
|
3725
|
-
return query;
|
|
3726
|
-
}
|
|
3727
|
-
/**
|
|
3728
|
-
* Enables/disables the coming soon (under-construction) page
|
|
3729
|
-
* @summary settings coming soon toggle
|
|
3730
|
-
*/
|
|
3731
|
-
export const sitesSettingsComingSoonToggle = (siteId, sitesSettingsComingSoonToggleBody, options) => {
|
|
3732
|
-
return axios.post(`/v1/sites/${siteId}/settings/coming-soon`, sitesSettingsComingSoonToggleBody, options);
|
|
3733
|
-
};
|
|
3734
|
-
export const getSitesSettingsComingSoonToggleMutationOptions = (options) => {
|
|
3735
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3736
|
-
const mutationFn = (props) => {
|
|
3737
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3738
|
-
return sitesSettingsComingSoonToggle(siteId, data, axiosOptions);
|
|
3739
|
-
};
|
|
3740
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3741
|
-
};
|
|
3742
|
-
/**
|
|
3743
|
-
* @summary settings coming soon toggle
|
|
3744
|
-
*/
|
|
3745
|
-
export const useSitesSettingsComingSoonToggle = (options) => {
|
|
3746
|
-
const mutationOptions = getSitesSettingsComingSoonToggleMutationOptions(options);
|
|
3747
|
-
return useMutation(mutationOptions);
|
|
3748
|
-
};
|
|
3749
|
-
/**
|
|
3750
|
-
* Returns the site's debug mode status
|
|
3751
|
-
* @summary settings debug status
|
|
3752
|
-
*/
|
|
3753
|
-
export const sitesSettingsDebug = (siteId, options) => {
|
|
3754
|
-
return axios.get(`/v1/sites/${siteId}/settings/debug`, options);
|
|
3755
|
-
};
|
|
3756
|
-
export const getSitesSettingsDebugQueryKey = (siteId) => {
|
|
3757
|
-
return [`/v1/sites/${siteId}/settings/debug`];
|
|
3758
|
-
};
|
|
3759
|
-
export const getSitesSettingsDebugQueryOptions = (siteId, options) => {
|
|
3760
|
-
var _a;
|
|
3761
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3762
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsDebugQueryKey(siteId);
|
|
3763
|
-
const queryFn = ({ signal }) => sitesSettingsDebug(siteId, Object.assign({ signal }, axiosOptions));
|
|
3764
|
-
return Object.assign({ queryKey,
|
|
3765
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3766
|
-
};
|
|
3767
|
-
/**
|
|
3768
|
-
* @summary settings debug status
|
|
3769
|
-
*/
|
|
3770
|
-
export function useSitesSettingsDebug(siteId, options) {
|
|
3771
|
-
const queryOptions = getSitesSettingsDebugQueryOptions(siteId, options);
|
|
3772
|
-
const query = useQuery(queryOptions);
|
|
3773
|
-
query.queryKey = queryOptions.queryKey;
|
|
3774
|
-
return query;
|
|
3775
|
-
}
|
|
3776
|
-
/**
|
|
3777
|
-
* Enables or disables the output and display of site generated errors on the site
|
|
3778
|
-
* @summary settings debug toggle
|
|
3779
|
-
*/
|
|
3780
|
-
export const sitesSettingsDebugToggle = (siteId, sitesSettingsDebugToggleBody, options) => {
|
|
3781
|
-
return axios.post(`/v1/sites/${siteId}/settings/debug`, sitesSettingsDebugToggleBody, options);
|
|
3782
|
-
};
|
|
3783
|
-
export const getSitesSettingsDebugToggleMutationOptions = (options) => {
|
|
3784
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3785
|
-
const mutationFn = (props) => {
|
|
3786
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3787
|
-
return sitesSettingsDebugToggle(siteId, data, axiosOptions);
|
|
3788
|
-
};
|
|
3789
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3790
|
-
};
|
|
3791
|
-
/**
|
|
3792
|
-
* @summary settings debug toggle
|
|
3793
|
-
*/
|
|
3794
|
-
export const useSitesSettingsDebugToggle = (options) => {
|
|
3795
|
-
const mutationOptions = getSitesSettingsDebugToggleMutationOptions(options);
|
|
3796
|
-
return useMutation(mutationOptions);
|
|
3797
|
-
};
|
|
3798
|
-
/**
|
|
3799
|
-
* Updates the site's PHP version
|
|
3800
|
-
* @summary settings php version update
|
|
3801
|
-
*/
|
|
3802
|
-
export const sitesSettingsPhpVersionUpdate = (siteId, sitesSettingsPhpVersionUpdateBody, options) => {
|
|
3803
|
-
return axios.post(`/v1/sites/${siteId}/settings/php-version`, sitesSettingsPhpVersionUpdateBody, options);
|
|
3804
|
-
};
|
|
3805
|
-
export const getSitesSettingsPhpVersionUpdateMutationOptions = (options) => {
|
|
3806
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3807
|
-
const mutationFn = (props) => {
|
|
3808
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3809
|
-
return sitesSettingsPhpVersionUpdate(siteId, data, axiosOptions);
|
|
3810
|
-
};
|
|
3811
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3812
|
-
};
|
|
3813
|
-
/**
|
|
3814
|
-
* @summary settings php version update
|
|
3815
|
-
*/
|
|
3816
|
-
export const useSitesSettingsPhpVersionUpdate = (options) => {
|
|
3817
|
-
const mutationOptions = getSitesSettingsPhpVersionUpdateMutationOptions(options);
|
|
3818
|
-
return useMutation(mutationOptions);
|
|
3819
|
-
};
|
|
3820
|
-
/**
|
|
3821
|
-
* Gets the list of PHP versions available/installed
|
|
3822
|
-
* @summary settings php versions list
|
|
3823
|
-
*/
|
|
3824
|
-
export const sitesSettingsPhpVersions = (siteId, options) => {
|
|
3825
|
-
return axios.get(`/v1/sites/${siteId}/settings/php-versions`, options);
|
|
3826
|
-
};
|
|
3827
|
-
export const getSitesSettingsPhpVersionsQueryKey = (siteId) => {
|
|
3828
|
-
return [`/v1/sites/${siteId}/settings/php-versions`];
|
|
3829
|
-
};
|
|
3830
|
-
export const getSitesSettingsPhpVersionsQueryOptions = (siteId, options) => {
|
|
3831
|
-
var _a;
|
|
3832
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3833
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsPhpVersionsQueryKey(siteId);
|
|
3834
|
-
const queryFn = ({ signal }) => sitesSettingsPhpVersions(siteId, Object.assign({ signal }, axiosOptions));
|
|
3835
|
-
return Object.assign({ queryKey,
|
|
3836
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3837
|
-
};
|
|
3838
|
-
/**
|
|
3839
|
-
* @summary settings php versions list
|
|
3840
|
-
*/
|
|
3841
|
-
export function useSitesSettingsPhpVersions(siteId, options) {
|
|
3842
|
-
const queryOptions = getSitesSettingsPhpVersionsQueryOptions(siteId, options);
|
|
3843
|
-
const query = useQuery(queryOptions);
|
|
3844
|
-
query.queryKey = queryOptions.queryKey;
|
|
3845
|
-
return query;
|
|
3846
|
-
}
|
|
3847
|
-
/**
|
|
3848
|
-
* List ssh users
|
|
3849
|
-
* @deprecated
|
|
3850
|
-
* @summary site - ssh - list users
|
|
3851
|
-
*/
|
|
3852
|
-
export const sitesSshUserList = (siteId, options) => {
|
|
3853
|
-
return axios.get(`/v1/sites/${siteId}/ssh-users`, options);
|
|
3854
|
-
};
|
|
3855
|
-
export const getSitesSshUserListQueryKey = (siteId) => {
|
|
3856
|
-
return [`/v1/sites/${siteId}/ssh-users`];
|
|
3857
|
-
};
|
|
3858
|
-
export const getSitesSshUserListQueryOptions = (siteId, options) => {
|
|
3859
|
-
var _a;
|
|
3860
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3861
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSshUserListQueryKey(siteId);
|
|
3862
|
-
const queryFn = ({ signal }) => sitesSshUserList(siteId, Object.assign({ signal }, axiosOptions));
|
|
3863
|
-
return Object.assign({ queryKey,
|
|
3864
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3865
|
-
};
|
|
3866
|
-
/**
|
|
3867
|
-
* @deprecated
|
|
3868
|
-
* @summary site - ssh - list users
|
|
3869
|
-
*/
|
|
3870
|
-
export function useSitesSshUserList(siteId, options) {
|
|
3871
|
-
const queryOptions = getSitesSshUserListQueryOptions(siteId, options);
|
|
3872
|
-
const query = useQuery(queryOptions);
|
|
3873
|
-
query.queryKey = queryOptions.queryKey;
|
|
3874
|
-
return query;
|
|
3875
|
-
}
|
|
3876
|
-
/**
|
|
3877
|
-
* Create ssh user
|
|
3878
|
-
* @summary site - ssh - create user
|
|
3879
|
-
*/
|
|
3880
|
-
export const sitesSshUserCreate = (siteId, sitesSshUserCreateBody, options) => {
|
|
3881
|
-
return axios.post(`/v1/sites/${siteId}/ssh-users`, sitesSshUserCreateBody, options);
|
|
3882
|
-
};
|
|
3883
|
-
export const getSitesSshUserCreateMutationOptions = (options) => {
|
|
3884
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3885
|
-
const mutationFn = (props) => {
|
|
3886
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3887
|
-
return sitesSshUserCreate(siteId, data, axiosOptions);
|
|
3888
|
-
};
|
|
3889
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3890
|
-
};
|
|
3891
|
-
/**
|
|
3892
|
-
* @summary site - ssh - create user
|
|
3893
|
-
*/
|
|
3894
|
-
export const useSitesSshUserCreate = (options) => {
|
|
3895
|
-
const mutationOptions = getSitesSshUserCreateMutationOptions(options);
|
|
3896
|
-
return useMutation(mutationOptions);
|
|
3897
|
-
};
|
|
3898
|
-
/**
|
|
3899
|
-
* delete ssh user
|
|
3900
|
-
* @summary site - ssh - delete user
|
|
3901
|
-
*/
|
|
3902
|
-
export const sitesSshUserDelete = (siteId, sitesSshUserDeleteBody, options) => {
|
|
3903
|
-
return axios.delete(`/v1/sites/${siteId}/ssh-users`, Object.assign({ data: sitesSshUserDeleteBody }, options));
|
|
3904
|
-
};
|
|
3905
|
-
export const getSitesSshUserDeleteMutationOptions = (options) => {
|
|
3906
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3907
|
-
const mutationFn = (props) => {
|
|
3908
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3909
|
-
return sitesSshUserDelete(siteId, data, axiosOptions);
|
|
3910
|
-
};
|
|
3911
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3912
|
-
};
|
|
3913
|
-
/**
|
|
3914
|
-
* @summary site - ssh - delete user
|
|
3915
|
-
*/
|
|
3916
|
-
export const useSitesSshUserDelete = (options) => {
|
|
3917
|
-
const mutationOptions = getSitesSshUserDeleteMutationOptions(options);
|
|
3918
|
-
return useMutation(mutationOptions);
|
|
3919
|
-
};
|
|
3920
|
-
/**
|
|
3921
|
-
* update ssh user
|
|
3922
|
-
* @summary site - ssh - update user
|
|
3923
|
-
*/
|
|
3924
|
-
export const sitesSshUserUpdate = (siteId, sitesSshUserUpdateBody, options) => {
|
|
3925
|
-
return axios.put(`/v1/sites/${siteId}/ssh-users`, sitesSshUserUpdateBody, options);
|
|
3926
|
-
};
|
|
3927
|
-
export const getSitesSshUserUpdateMutationOptions = (options) => {
|
|
3928
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3929
|
-
const mutationFn = (props) => {
|
|
3930
|
-
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
3931
|
-
return sitesSshUserUpdate(siteId, data, axiosOptions);
|
|
3932
|
-
};
|
|
3933
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
3934
|
-
};
|
|
3935
|
-
/**
|
|
3936
|
-
* @summary site - ssh - update user
|
|
3937
|
-
*/
|
|
3938
|
-
export const useSitesSshUserUpdate = (options) => {
|
|
3939
|
-
const mutationOptions = getSitesSshUserUpdateMutationOptions(options);
|
|
3940
|
-
return useMutation(mutationOptions);
|
|
3941
|
-
};
|
|
3942
|
-
/**
|
|
3943
|
-
* Returns information about the site domain's SSL/TLS certificate
|
|
3944
|
-
* @summary Site domain SSL cert info
|
|
3945
|
-
*/
|
|
3946
|
-
export const sitesSsl = (siteId, options) => {
|
|
3947
|
-
return axios.get(`/v1/sites/${siteId}/ssl`, options);
|
|
3948
|
-
};
|
|
3949
|
-
export const getSitesSslQueryKey = (siteId) => {
|
|
3950
|
-
return [`/v1/sites/${siteId}/ssl`];
|
|
3951
|
-
};
|
|
3952
|
-
export const getSitesSslQueryOptions = (siteId, options) => {
|
|
3953
|
-
var _a;
|
|
3954
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3955
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSslQueryKey(siteId);
|
|
3956
|
-
const queryFn = ({ signal, }) => sitesSsl(siteId, Object.assign({ signal }, axiosOptions));
|
|
3957
|
-
return Object.assign({ queryKey,
|
|
3958
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3959
|
-
};
|
|
3960
|
-
/**
|
|
3961
|
-
* @summary Site domain SSL cert info
|
|
3962
|
-
*/
|
|
3963
|
-
export function useSitesSsl(siteId, options) {
|
|
3964
|
-
const queryOptions = getSitesSslQueryOptions(siteId, options);
|
|
3965
|
-
const query = useQuery(queryOptions);
|
|
3966
|
-
query.queryKey = queryOptions.queryKey;
|
|
3967
|
-
return query;
|
|
3968
|
-
}
|
|
3969
|
-
/**
|
|
3970
|
-
* Returns an SSO token or login URL for the site (if supported).
|
|
3971
|
-
* @summary sso
|
|
3972
|
-
*/
|
|
3973
|
-
export const sitesSso = (siteId, params, options) => {
|
|
3974
|
-
return axios.get(`/v1/sites/${siteId}/sso`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
3975
|
-
};
|
|
3976
|
-
export const getSitesSsoQueryKey = (siteId, params) => {
|
|
3977
|
-
return [`/v1/sites/${siteId}/sso`, ...(params ? [params] : [])];
|
|
3978
|
-
};
|
|
3979
|
-
export const getSitesSsoQueryOptions = (siteId, params, options) => {
|
|
3980
|
-
var _a;
|
|
3981
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
3982
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSsoQueryKey(siteId, params);
|
|
3983
|
-
const queryFn = ({ signal, }) => sitesSso(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
3984
|
-
return Object.assign({ queryKey,
|
|
3985
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
3986
|
-
};
|
|
3987
|
-
/**
|
|
3988
|
-
* @summary sso
|
|
3989
|
-
*/
|
|
3990
|
-
export function useSitesSso(siteId, params, options) {
|
|
3991
|
-
const queryOptions = getSitesSsoQueryOptions(siteId, params, options);
|
|
3992
|
-
const query = useQuery(queryOptions);
|
|
3993
|
-
query.queryKey = queryOptions.queryKey;
|
|
3994
|
-
return query;
|
|
3995
|
-
}
|
|
3996
|
-
/**
|
|
3997
|
-
* @summary site status
|
|
3998
|
-
*/
|
|
3999
|
-
export const siteStatus = (siteId, options) => {
|
|
4000
|
-
return axios.get(`/v1/sites/${siteId}/status`, options);
|
|
4001
|
-
};
|
|
4002
|
-
export const getSiteStatusQueryKey = (siteId) => {
|
|
4003
|
-
return [`/v1/sites/${siteId}/status`];
|
|
4004
|
-
};
|
|
4005
|
-
export const getSiteStatusQueryOptions = (siteId, options) => {
|
|
4006
|
-
var _a;
|
|
4007
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4008
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteStatusQueryKey(siteId);
|
|
4009
|
-
const queryFn = ({ signal, }) => siteStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
4010
|
-
return Object.assign({ queryKey,
|
|
4011
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
4012
|
-
};
|
|
4013
|
-
/**
|
|
4014
|
-
* @summary site status
|
|
4015
|
-
*/
|
|
4016
|
-
export function useSiteStatus(siteId, options) {
|
|
4017
|
-
const queryOptions = getSiteStatusQueryOptions(siteId, options);
|
|
4018
|
-
const query = useQuery(queryOptions);
|
|
4019
|
-
query.queryKey = queryOptions.queryKey;
|
|
4020
|
-
return query;
|
|
4021
|
-
}
|
|
4022
|
-
/**
|
|
4023
|
-
* Returns a list of the site's users
|
|
4024
|
-
* @summary users
|
|
4025
|
-
*/
|
|
4026
|
-
export const siteUsers = (siteId, options) => {
|
|
4027
|
-
return axios.get(`/v1/sites/${siteId}/users`, options);
|
|
4028
|
-
};
|
|
4029
|
-
export const getSiteUsersQueryKey = (siteId) => {
|
|
4030
|
-
return [`/v1/sites/${siteId}/users`];
|
|
4031
|
-
};
|
|
4032
|
-
export const getSiteUsersQueryOptions = (siteId, options) => {
|
|
4033
|
-
var _a;
|
|
4034
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4035
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteUsersQueryKey(siteId);
|
|
4036
|
-
const queryFn = ({ signal, }) => siteUsers(siteId, Object.assign({ signal }, axiosOptions));
|
|
4037
|
-
return Object.assign({ queryKey,
|
|
4038
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
4039
|
-
};
|
|
4040
|
-
/**
|
|
4041
|
-
* @summary users
|
|
4042
|
-
*/
|
|
4043
|
-
export function useSiteUsers(siteId, options) {
|
|
4044
|
-
const queryOptions = getSiteUsersQueryOptions(siteId, options);
|
|
4045
|
-
const query = useQuery(queryOptions);
|
|
4046
|
-
query.queryKey = queryOptions.queryKey;
|
|
4047
|
-
return query;
|
|
4048
|
-
}
|
|
4049
|
-
/**
|
|
4050
|
-
* Returns site version information.
|
|
4051
|
-
* @summary version
|
|
4052
|
-
*/
|
|
4053
|
-
export const sitesVersion = (siteId, options) => {
|
|
4054
|
-
return axios.get(`/v1/sites/${siteId}/version`, options);
|
|
4055
|
-
};
|
|
4056
|
-
export const getSitesVersionQueryKey = (siteId) => {
|
|
4057
|
-
return [`/v1/sites/${siteId}/version`];
|
|
4058
|
-
};
|
|
4059
|
-
export const getSitesVersionQueryOptions = (siteId, options) => {
|
|
4060
|
-
var _a;
|
|
4061
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4062
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesVersionQueryKey(siteId);
|
|
4063
|
-
const queryFn = ({ signal, }) => sitesVersion(siteId, Object.assign({ signal }, axiosOptions));
|
|
4064
|
-
return Object.assign({ queryKey,
|
|
4065
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
4066
|
-
};
|
|
4067
|
-
/**
|
|
4068
|
-
* @summary version
|
|
4069
|
-
*/
|
|
4070
|
-
export function useSitesVersion(siteId, options) {
|
|
4071
|
-
const queryOptions = getSitesVersionQueryOptions(siteId, options);
|
|
4072
|
-
const query = useQuery(queryOptions);
|
|
4073
|
-
query.queryKey = queryOptions.queryKey;
|
|
4074
|
-
return query;
|
|
4075
|
-
}
|
|
4076
|
-
/**
|
|
4077
|
-
* Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
|
|
4078
|
-
* @summary sso
|
|
4079
|
-
*/
|
|
4080
|
-
export const addonsSitelockSsoV2 = (addonId, params, options) => {
|
|
4081
|
-
return axios.get(`/v2/addons/sitelock/${addonId}/sso`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
4082
|
-
};
|
|
4083
|
-
export const getAddonsSitelockSsoV2QueryKey = (addonId, params) => {
|
|
4084
|
-
return [
|
|
4085
|
-
`/v2/addons/sitelock/${addonId}/sso`,
|
|
4086
|
-
...(params ? [params] : []),
|
|
4087
|
-
];
|
|
4088
|
-
};
|
|
4089
|
-
export const getAddonsSitelockSsoV2QueryOptions = (addonId, params, options) => {
|
|
4090
|
-
var _a;
|
|
4091
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4092
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSitelockSsoV2QueryKey(addonId, params);
|
|
4093
|
-
const queryFn = ({ signal }) => addonsSitelockSsoV2(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
4094
|
-
return Object.assign({ queryKey,
|
|
4095
|
-
queryFn, enabled: !!addonId }, queryOptions);
|
|
4096
|
-
};
|
|
4097
|
-
/**
|
|
4098
|
-
* @summary sso
|
|
4099
|
-
*/
|
|
4100
|
-
export function useAddonsSitelockSsoV2(addonId, params, options) {
|
|
4101
|
-
const queryOptions = getAddonsSitelockSsoV2QueryOptions(addonId, params, options);
|
|
4102
|
-
const query = useQuery(queryOptions);
|
|
4103
|
-
query.queryKey = queryOptions.queryKey;
|
|
4104
|
-
return query;
|
|
4105
|
-
}
|
|
4106
|
-
/**
|
|
4107
|
-
* Returns the hosting server nameservers information
|
|
4108
|
-
* @summary hosting server nameservers info
|
|
4109
|
-
*/
|
|
4110
|
-
export const hostingNameserversV2 = (hostingId, options) => {
|
|
4111
|
-
return axios.get(`/v2/hosting/${hostingId}/nameservers`, options);
|
|
4112
|
-
};
|
|
4113
|
-
export const getHostingNameserversV2QueryKey = (hostingId) => {
|
|
4114
|
-
return [`/v2/hosting/${hostingId}/nameservers`];
|
|
4115
|
-
};
|
|
4116
|
-
export const getHostingNameserversV2QueryOptions = (hostingId, options) => {
|
|
4117
|
-
var _a;
|
|
4118
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4119
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversV2QueryKey(hostingId);
|
|
4120
|
-
const queryFn = ({ signal }) => hostingNameserversV2(hostingId, Object.assign({ signal }, axiosOptions));
|
|
4121
|
-
return Object.assign({ queryKey,
|
|
4122
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
4123
|
-
};
|
|
4124
|
-
/**
|
|
4125
|
-
* @summary hosting server nameservers info
|
|
4126
|
-
*/
|
|
4127
|
-
export function useHostingNameserversV2(hostingId, options) {
|
|
4128
|
-
const queryOptions = getHostingNameserversV2QueryOptions(hostingId, options);
|
|
4129
|
-
const query = useQuery(queryOptions);
|
|
4130
|
-
query.queryKey = queryOptions.queryKey;
|
|
4131
|
-
return query;
|
|
4132
|
-
}
|
|
4133
|
-
/**
|
|
4134
|
-
* Returns a list of sites.
|
|
4135
|
-
* @summary sites list v2
|
|
4136
|
-
*/
|
|
4137
|
-
export const hostingSitesV2 = (hostingId, params, options) => {
|
|
4138
|
-
return axios.get(`/v2/hosting/${hostingId}/sites`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
4139
|
-
};
|
|
4140
|
-
export const getHostingSitesV2QueryKey = (hostingId, params) => {
|
|
4141
|
-
return [
|
|
4142
|
-
`/v2/hosting/${hostingId}/sites`,
|
|
4143
|
-
...(params ? [params] : []),
|
|
4144
|
-
];
|
|
4145
|
-
};
|
|
4146
|
-
export const getHostingSitesV2QueryOptions = (hostingId, params, options) => {
|
|
4147
|
-
var _a;
|
|
4148
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4149
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSitesV2QueryKey(hostingId, params);
|
|
4150
|
-
const queryFn = ({ signal, }) => hostingSitesV2(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
4151
|
-
return Object.assign({ queryKey,
|
|
4152
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
4153
|
-
};
|
|
4154
|
-
/**
|
|
4155
|
-
* @summary sites list v2
|
|
4156
|
-
*/
|
|
4157
|
-
export function useHostingSitesV2(hostingId, params, options) {
|
|
4158
|
-
const queryOptions = getHostingSitesV2QueryOptions(hostingId, params, options);
|
|
4159
|
-
const query = useQuery(queryOptions);
|
|
4160
|
-
query.queryKey = queryOptions.queryKey;
|
|
4161
|
-
return query;
|
|
4162
|
-
}
|
|
4163
|
-
/**
|
|
4164
|
-
* Import public/private ssh key
|
|
4165
|
-
* @summary Import ssh key
|
|
4166
|
-
*/
|
|
4167
|
-
export const sshKeyImportV2 = (hostingId, sshKeyImportV2Body, options) => {
|
|
4168
|
-
return axios.post(`/v2/hosting/${hostingId}/ssh/import`, sshKeyImportV2Body, options);
|
|
4169
|
-
};
|
|
4170
|
-
export const getSshKeyImportV2MutationOptions = (options) => {
|
|
4171
|
-
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4172
|
-
const mutationFn = (props) => {
|
|
4173
|
-
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
4174
|
-
return sshKeyImportV2(hostingId, data, axiosOptions);
|
|
4175
|
-
};
|
|
4176
|
-
return Object.assign({ mutationFn }, mutationOptions);
|
|
4177
|
-
};
|
|
4178
|
-
/**
|
|
4179
|
-
* @summary Import ssh key
|
|
4180
|
-
*/
|
|
4181
|
-
export const useSshKeyImportV2 = (options) => {
|
|
4182
|
-
const mutationOptions = getSshKeyImportV2MutationOptions(options);
|
|
4183
|
-
return useMutation(mutationOptions);
|
|
4184
|
-
};
|
|
4185
|
-
/**
|
|
4186
|
-
* List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
|
|
4187
|
-
* @summary ssh keys list
|
|
4188
|
-
*/
|
|
4189
|
-
export const sshKeyListV2 = (hostingId, options) => {
|
|
4190
|
-
return axios.get(`/v2/hosting/${hostingId}/ssh/keys`, options);
|
|
4191
|
-
};
|
|
4192
|
-
export const getSshKeyListV2QueryKey = (hostingId) => {
|
|
4193
|
-
return [`/v2/hosting/${hostingId}/ssh/keys`];
|
|
4194
|
-
};
|
|
4195
|
-
export const getSshKeyListV2QueryOptions = (hostingId, options) => {
|
|
4196
|
-
var _a;
|
|
4197
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4198
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListV2QueryKey(hostingId);
|
|
4199
|
-
const queryFn = ({ signal, }) => sshKeyListV2(hostingId, Object.assign({ signal }, axiosOptions));
|
|
4200
|
-
return Object.assign({ queryKey,
|
|
4201
|
-
queryFn, enabled: !!hostingId }, queryOptions);
|
|
4202
|
-
};
|
|
4203
|
-
/**
|
|
4204
|
-
* @summary ssh keys list
|
|
4205
|
-
*/
|
|
4206
|
-
export function useSshKeyListV2(hostingId, options) {
|
|
4207
|
-
const queryOptions = getSshKeyListV2QueryOptions(hostingId, options);
|
|
4208
|
-
const query = useQuery(queryOptions);
|
|
4209
|
-
query.queryKey = queryOptions.queryKey;
|
|
4210
|
-
return query;
|
|
4211
|
-
}
|
|
4212
|
-
/**
|
|
4213
|
-
* Deprecated - use sites_list_v3 instead
|
|
4214
|
-
* @deprecated
|
|
4215
|
-
* @summary Site list for an account v2
|
|
4216
|
-
*/
|
|
4217
|
-
export const sitesListV2 = (options) => {
|
|
4218
|
-
return axios.get(`/v2/sites`, options);
|
|
4219
|
-
};
|
|
4220
|
-
export const getSitesListV2QueryKey = () => {
|
|
4221
|
-
return [`/v2/sites`];
|
|
4222
|
-
};
|
|
4223
|
-
export const getSitesListV2QueryOptions = (options) => {
|
|
4224
|
-
var _a;
|
|
4225
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4226
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListV2QueryKey();
|
|
4227
|
-
const queryFn = ({ signal, }) => sitesListV2(Object.assign({ signal }, axiosOptions));
|
|
4228
|
-
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
4229
|
-
};
|
|
4230
|
-
/**
|
|
4231
|
-
* @deprecated
|
|
4232
|
-
* @summary Site list for an account v2
|
|
4233
|
-
*/
|
|
4234
|
-
export function useSitesListV2(options) {
|
|
4235
|
-
const queryOptions = getSitesListV2QueryOptions(options);
|
|
4236
|
-
const query = useQuery(queryOptions);
|
|
4237
|
-
query.queryKey = queryOptions.queryKey;
|
|
4238
|
-
return query;
|
|
4239
|
-
}
|
|
4240
|
-
/**
|
|
4241
|
-
* Provides the domains list associated with the site
|
|
4242
|
-
* @summary Domains list for the site
|
|
4243
|
-
*/
|
|
4244
|
-
export const sitesDomainsV2 = (siteId, params, options) => {
|
|
4245
|
-
return axios.get(`/v2/sites/${siteId}/domains`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
4246
|
-
};
|
|
4247
|
-
export const getSitesDomainsV2QueryKey = (siteId, params) => {
|
|
4248
|
-
return [`/v2/sites/${siteId}/domains`, ...(params ? [params] : [])];
|
|
4249
|
-
};
|
|
4250
|
-
export const getSitesDomainsV2QueryOptions = (siteId, params, options) => {
|
|
4251
|
-
var _a;
|
|
4252
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4253
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainsV2QueryKey(siteId, params);
|
|
4254
|
-
const queryFn = ({ signal, }) => sitesDomainsV2(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
4255
|
-
return Object.assign({ queryKey,
|
|
4256
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
4257
|
-
};
|
|
4258
|
-
/**
|
|
4259
|
-
* @summary Domains list for the site
|
|
4260
|
-
*/
|
|
4261
|
-
export function useSitesDomainsV2(siteId, params, options) {
|
|
4262
|
-
const queryOptions = getSitesDomainsV2QueryOptions(siteId, params, options);
|
|
4263
|
-
const query = useQuery(queryOptions);
|
|
4264
|
-
query.queryKey = queryOptions.queryKey;
|
|
4265
|
-
return query;
|
|
4266
|
-
}
|
|
4267
|
-
/**
|
|
4268
|
-
* Returns the site's sitelock information.
|
|
4269
|
-
* @summary sitelock info
|
|
4270
|
-
*/
|
|
4271
|
-
export const sitesSecuritySitelockV2 = (siteId, params, options) => {
|
|
4272
|
-
return axios.get(`/v2/sites/${siteId}/security/sitelock`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
4273
|
-
};
|
|
4274
|
-
export const getSitesSecuritySitelockV2QueryKey = (siteId, params) => {
|
|
4275
|
-
return [
|
|
4276
|
-
`/v2/sites/${siteId}/security/sitelock`,
|
|
4277
|
-
...(params ? [params] : []),
|
|
4278
|
-
];
|
|
4279
|
-
};
|
|
4280
|
-
export const getSitesSecuritySitelockV2QueryOptions = (siteId, params, options) => {
|
|
4281
|
-
var _a;
|
|
4282
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4283
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockV2QueryKey(siteId, params);
|
|
4284
|
-
const queryFn = ({ signal }) => sitesSecuritySitelockV2(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
4285
|
-
return Object.assign({ queryKey,
|
|
4286
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
4287
|
-
};
|
|
4288
|
-
/**
|
|
4289
|
-
* @summary sitelock info
|
|
4290
|
-
*/
|
|
4291
|
-
export function useSitesSecuritySitelockV2(siteId, params, options) {
|
|
4292
|
-
const queryOptions = getSitesSecuritySitelockV2QueryOptions(siteId, params, options);
|
|
4293
|
-
const query = useQuery(queryOptions);
|
|
4294
|
-
query.queryKey = queryOptions.queryKey;
|
|
4295
|
-
return query;
|
|
4296
|
-
}
|
|
4297
|
-
/**
|
|
4298
|
-
* List ssh users V2
|
|
4299
|
-
* @summary site - ssh - list users v2
|
|
4300
|
-
*/
|
|
4301
|
-
export const sitesSshUserListV2 = (siteId, options) => {
|
|
4302
|
-
return axios.get(`/v2/sites/${siteId}/ssh-users`, options);
|
|
4303
|
-
};
|
|
4304
|
-
export const getSitesSshUserListV2QueryKey = (siteId) => {
|
|
4305
|
-
return [`/v2/sites/${siteId}/ssh-users`];
|
|
4306
|
-
};
|
|
4307
|
-
export const getSitesSshUserListV2QueryOptions = (siteId, options) => {
|
|
4308
|
-
var _a;
|
|
4309
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4310
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSshUserListV2QueryKey(siteId);
|
|
4311
|
-
const queryFn = ({ signal }) => sitesSshUserListV2(siteId, Object.assign({ signal }, axiosOptions));
|
|
4312
|
-
return Object.assign({ queryKey,
|
|
4313
|
-
queryFn, enabled: !!siteId }, queryOptions);
|
|
4314
|
-
};
|
|
4315
|
-
/**
|
|
4316
|
-
* @summary site - ssh - list users v2
|
|
4317
|
-
*/
|
|
4318
|
-
export function useSitesSshUserListV2(siteId, options) {
|
|
4319
|
-
const queryOptions = getSitesSshUserListV2QueryOptions(siteId, options);
|
|
4320
|
-
const query = useQuery(queryOptions);
|
|
4321
|
-
query.queryKey = queryOptions.queryKey;
|
|
4322
|
-
return query;
|
|
4323
|
-
}
|
|
4324
|
-
/**
|
|
4325
|
-
* Returns site list.
|
|
4326
|
-
* @summary Site list for an account v3
|
|
4327
|
-
*/
|
|
4328
|
-
export const sitesListV3 = (params, options) => {
|
|
4329
|
-
return axios.get(`/v3/sites`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
4330
|
-
};
|
|
4331
|
-
export const getSitesListV3QueryKey = (params) => {
|
|
4332
|
-
return [`/v3/sites`, ...(params ? [params] : [])];
|
|
4333
|
-
};
|
|
4334
|
-
export const getSitesListV3QueryOptions = (params, options) => {
|
|
4335
|
-
var _a;
|
|
4336
|
-
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
4337
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListV3QueryKey(params);
|
|
4338
|
-
const queryFn = ({ signal, }) => sitesListV3(params, Object.assign({ signal }, axiosOptions));
|
|
4339
|
-
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
4340
|
-
};
|
|
4341
|
-
/**
|
|
4342
|
-
* @summary Site list for an account v3
|
|
4343
|
-
*/
|
|
4344
|
-
export function useSitesListV3(params, options) {
|
|
4345
|
-
const queryOptions = getSitesListV3QueryOptions(params, options);
|
|
4346
|
-
const query = useQuery(queryOptions);
|
|
4347
|
-
query.queryKey = queryOptions.queryKey;
|
|
4348
|
-
return query;
|
|
4349
|
-
}
|