@newfold/huapi-js 1.954.0 → 1.956.0

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/src/index.js ADDED
@@ -0,0 +1,2552 @@
1
+ /**
2
+ * Generated by orval v6.12.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.956.0
7
+ */
8
+ import axios from 'axios';
9
+ import { useQuery, useInfiniteQuery, useMutation } from '@tanstack/react-query';
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) => [`/v1/account/events`, ...(params ? [params] : [])];
18
+ export const useAccountEventList = (params, options) => {
19
+ var _a;
20
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
21
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountEventListQueryKey(params);
22
+ const queryFn = ({ signal }) => accountEventList(params, Object.assign({ signal }, axiosOptions));
23
+ const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
24
+ query.queryKey = queryKey;
25
+ return query;
26
+ };
27
+ /**
28
+ * Returns a hosting account list
29
+ * @summary Hosting account list for a customer
30
+ */
31
+ export const accountHostingList = (options) => {
32
+ return axios.get(`/v1/account/hosting`, options);
33
+ };
34
+ export const getAccountHostingListQueryKey = () => [`/v1/account/hosting`];
35
+ export const useAccountHostingList = (options) => {
36
+ var _a;
37
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
38
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountHostingListQueryKey();
39
+ const queryFn = ({ signal }) => accountHostingList(Object.assign({ signal }, axiosOptions));
40
+ const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
41
+ query.queryKey = queryKey;
42
+ return query;
43
+ };
44
+ /**
45
+ * Returns the account public key list
46
+ * @summary Account public key list
47
+ */
48
+ export const accountPublicKeys = (options) => {
49
+ return axios.get(`/v1/account/public-keys`, options);
50
+ };
51
+ export const getAccountPublicKeysQueryKey = () => [`/v1/account/public-keys`];
52
+ export const useAccountPublicKeys = (options) => {
53
+ var _a;
54
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
55
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountPublicKeysQueryKey();
56
+ const queryFn = ({ signal }) => accountPublicKeys(Object.assign({ signal }, axiosOptions));
57
+ const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
58
+ query.queryKey = queryKey;
59
+ return query;
60
+ };
61
+ /**
62
+ * Create an account public key
63
+ * @summary Account public key creation
64
+ */
65
+ export const accountPublicKeyCreate = (accountPublicKeyCreateBody, options) => {
66
+ return axios.post(`/v1/account/public-keys`, accountPublicKeyCreateBody, options);
67
+ };
68
+ export const useAccountPublicKeyCreate = (options) => {
69
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
70
+ const mutationFn = (props) => {
71
+ const { data } = props !== null && props !== void 0 ? props : {};
72
+ return accountPublicKeyCreate(data, axiosOptions);
73
+ };
74
+ return useMutation(mutationFn, mutationOptions);
75
+ };
76
+ /**
77
+ * Returns an account public key
78
+ * @summary Account public key info
79
+ */
80
+ export const accountPublicKey = (publicKeyId, options) => {
81
+ return axios.get(`/v1/account/public-keys/${publicKeyId}`, options);
82
+ };
83
+ export const getAccountPublicKeyQueryKey = (publicKeyId) => [`/v1/account/public-keys/${publicKeyId}`];
84
+ export const useAccountPublicKey = (publicKeyId, options) => {
85
+ var _a;
86
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
87
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountPublicKeyQueryKey(publicKeyId);
88
+ const queryFn = ({ signal }) => accountPublicKey(publicKeyId, Object.assign({ signal }, axiosOptions));
89
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(publicKeyId) }, queryOptions));
90
+ query.queryKey = queryKey;
91
+ return query;
92
+ };
93
+ /**
94
+ * Delete an account public key
95
+ * @summary Account public key deletion
96
+ */
97
+ export const accountPublicKeyDelete = (publicKeyId, options) => {
98
+ return axios.delete(`/v1/account/public-keys/${publicKeyId}`, options);
99
+ };
100
+ export const useAccountPublicKeyDelete = (options) => {
101
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
102
+ const mutationFn = (props) => {
103
+ const { publicKeyId } = props !== null && props !== void 0 ? props : {};
104
+ return accountPublicKeyDelete(publicKeyId, axiosOptions);
105
+ };
106
+ return useMutation(mutationFn, mutationOptions);
107
+ };
108
+ /**
109
+ * Returns a combined backup list with website commit ids and corresponding database commits
110
+ * @summary backup list
111
+ */
112
+ export const codeguardBackupList = (addonId, params, options) => {
113
+ 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) }));
114
+ };
115
+ export const getCodeguardBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/backups`, ...(params ? [params] : [])];
116
+ export const useCodeguardBackupList = (addonId, params, options) => {
117
+ var _a;
118
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
119
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardBackupListQueryKey(addonId, params);
120
+ const queryFn = ({ signal }) => codeguardBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
121
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
122
+ query.queryKey = queryKey;
123
+ return query;
124
+ };
125
+ /**
126
+ * Creates the website backup
127
+ * @summary backup create
128
+ */
129
+ export const codeguardBackupCreate = (addonId, codeguardBackupCreateBody, options) => {
130
+ return axios.post(`/v1/addons/codeguard/${addonId}/backups`, codeguardBackupCreateBody, options);
131
+ };
132
+ export const useCodeguardBackupCreate = (options) => {
133
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
134
+ const mutationFn = (props) => {
135
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
136
+ return codeguardBackupCreate(addonId, data, axiosOptions);
137
+ };
138
+ return useMutation(mutationFn, mutationOptions);
139
+ };
140
+ /**
141
+ * Queues the backup download.
142
+ * @summary backup download
143
+ */
144
+ export const codeguardBackupDownload = (addonId, codeguardBackupDownloadBody, options) => {
145
+ return axios.post(`/v1/addons/codeguard/${addonId}/backups/download`, codeguardBackupDownloadBody, options);
146
+ };
147
+ export const useCodeguardBackupDownload = (options) => {
148
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
149
+ const mutationFn = (props) => {
150
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
151
+ return codeguardBackupDownload(addonId, data, axiosOptions);
152
+ };
153
+ return useMutation(mutationFn, mutationOptions);
154
+ };
155
+ /**
156
+ * Restores a website and database backup
157
+ * @summary backups restore
158
+ */
159
+ export const codeguardBackupRestore = (addonId, codeguardBackupRestoreBody, options) => {
160
+ return axios.post(`/v1/addons/codeguard/${addonId}/backups/restore`, codeguardBackupRestoreBody, options);
161
+ };
162
+ export const useCodeguardBackupRestore = (options) => {
163
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
164
+ const mutationFn = (props) => {
165
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
166
+ return codeguardBackupRestore(addonId, data, axiosOptions);
167
+ };
168
+ return useMutation(mutationFn, mutationOptions);
169
+ };
170
+ /**
171
+ * Returns all database records CodeGuard maintains for this user's account.
172
+ * @summary database list
173
+ */
174
+ export const codeguardDatabaseList = (addonId, options) => {
175
+ return axios.get(`/v1/addons/codeguard/${addonId}/databases`, options);
176
+ };
177
+ export const getCodeguardDatabaseListQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/databases`];
178
+ export const useCodeguardDatabaseList = (addonId, options) => {
179
+ var _a;
180
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
181
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseListQueryKey(addonId);
182
+ const queryFn = ({ signal }) => codeguardDatabaseList(addonId, Object.assign({ signal }, axiosOptions));
183
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
184
+ query.queryKey = queryKey;
185
+ return query;
186
+ };
187
+ /**
188
+ * Returns all database backup records CodeGuard maintains for this user's account.
189
+ * @summary database backup list
190
+ */
191
+ export const codeguardDatabaseBackupList = (addonId, params, options) => {
192
+ 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) }));
193
+ };
194
+ export const getCodeguardDatabaseBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/databases/backups`, ...(params ? [params] : [])];
195
+ export const useCodeguardDatabaseBackupList = (addonId, params, options) => {
196
+ var _a;
197
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
198
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseBackupListQueryKey(addonId, params);
199
+ const queryFn = ({ signal }) => codeguardDatabaseBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
200
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
201
+ query.queryKey = queryKey;
202
+ return query;
203
+ };
204
+ /**
205
+ * Queue the creation of a database backup.
206
+ * @summary database backup create
207
+ */
208
+ export const codeguardDatabaseBackupCreate = (addonId, codeguardDatabaseBackupCreateBody, options) => {
209
+ return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups`, codeguardDatabaseBackupCreateBody, options);
210
+ };
211
+ export const useCodeguardDatabaseBackupCreate = (options) => {
212
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
213
+ const mutationFn = (props) => {
214
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
215
+ return codeguardDatabaseBackupCreate(addonId, data, axiosOptions);
216
+ };
217
+ return useMutation(mutationFn, mutationOptions);
218
+ };
219
+ /**
220
+ * Restores a database backup
221
+ * @summary database backup restore
222
+ */
223
+ export const codeguardDatabaseBackupRestore = (addonId, codeguardDatabaseBackupRestoreBody, options) => {
224
+ return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups/restore`, codeguardDatabaseBackupRestoreBody, options);
225
+ };
226
+ export const useCodeguardDatabaseBackupRestore = (options) => {
227
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
228
+ const mutationFn = (props) => {
229
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
230
+ return codeguardDatabaseBackupRestore(addonId, data, axiosOptions);
231
+ };
232
+ return useMutation(mutationFn, mutationOptions);
233
+ };
234
+ /**
235
+ * Returns an oauth login URL that can be used to access CodeGuard dashboard for a user.
236
+ * @summary login link
237
+ */
238
+ export const codeguardLoginLink = (addonId, options) => {
239
+ return axios.get(`/v1/addons/codeguard/${addonId}/login`, options);
240
+ };
241
+ export const getCodeguardLoginLinkQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/login`];
242
+ export const useCodeguardLoginLink = (addonId, options) => {
243
+ var _a;
244
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
245
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardLoginLinkQueryKey(addonId);
246
+ const queryFn = ({ signal }) => codeguardLoginLink(addonId, Object.assign({ signal }, axiosOptions));
247
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
248
+ query.queryKey = queryKey;
249
+ return query;
250
+ };
251
+ /**
252
+ * Returns the subscribed plan and usage info
253
+ * @summary plan info
254
+ */
255
+ export const codeguardPlanInfo = (addonId, options) => {
256
+ return axios.get(`/v1/addons/codeguard/${addonId}/plan`, options);
257
+ };
258
+ export const getCodeguardPlanInfoQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/plan`];
259
+ export const useCodeguardPlanInfo = (addonId, options) => {
260
+ var _a;
261
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
262
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardPlanInfoQueryKey(addonId);
263
+ const queryFn = ({ signal }) => codeguardPlanInfo(addonId, Object.assign({ signal }, axiosOptions));
264
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
265
+ query.queryKey = queryKey;
266
+ return query;
267
+ };
268
+ /**
269
+ * Returns all website records CodeGuard maintains for this user's account.
270
+ * @summary website list
271
+ */
272
+ export const codeguardWebsiteList = (addonId, options) => {
273
+ return axios.get(`/v1/addons/codeguard/${addonId}/websites`, options);
274
+ };
275
+ export const getCodeguardWebsiteListQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/websites`];
276
+ export const useCodeguardWebsiteList = (addonId, options) => {
277
+ var _a;
278
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
279
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardWebsiteListQueryKey(addonId);
280
+ const queryFn = ({ signal }) => codeguardWebsiteList(addonId, Object.assign({ signal }, axiosOptions));
281
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
282
+ query.queryKey = queryKey;
283
+ return query;
284
+ };
285
+ /**
286
+ * Returns all website backup records CodeGuard maintains for this user's account.
287
+ * @summary website backup list
288
+ */
289
+ export const codeguardWebsiteBackupList = (addonId, params, options) => {
290
+ 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) }));
291
+ };
292
+ export const getCodeguardWebsiteBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/websites/backups`, ...(params ? [params] : [])];
293
+ export const useCodeguardWebsiteBackupList = (addonId, params, options) => {
294
+ var _a;
295
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
296
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardWebsiteBackupListQueryKey(addonId, params);
297
+ const queryFn = ({ signal }) => codeguardWebsiteBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
298
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
299
+ query.queryKey = queryKey;
300
+ return query;
301
+ };
302
+ /**
303
+ * Initiate the creation of a new backup for a given website
304
+ * @summary website backup create
305
+ */
306
+ export const codeguardWebsiteBackupCreate = (addonId, codeguardWebsiteBackupCreateBody, options) => {
307
+ return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups`, codeguardWebsiteBackupCreateBody, options);
308
+ };
309
+ export const useCodeguardWebsiteBackupCreate = (options) => {
310
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
311
+ const mutationFn = (props) => {
312
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
313
+ return codeguardWebsiteBackupCreate(addonId, data, axiosOptions);
314
+ };
315
+ return useMutation(mutationFn, mutationOptions);
316
+ };
317
+ /**
318
+ * Restores a website backup
319
+ * @summary website backup restore
320
+ */
321
+ export const codeguardWebsiteBackupRestore = (addonId, codeguardWebsiteBackupRestoreBody, options) => {
322
+ return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups/restore`, codeguardWebsiteBackupRestoreBody, options);
323
+ };
324
+ export const useCodeguardWebsiteBackupRestore = (options) => {
325
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
326
+ const mutationFn = (props) => {
327
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
328
+ return codeguardWebsiteBackupRestore(addonId, data, axiosOptions);
329
+ };
330
+ return useMutation(mutationFn, mutationOptions);
331
+ };
332
+ /**
333
+ * Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
334
+ * @summary sso
335
+ */
336
+ export const addonsSitelockSso = (addonId, options) => {
337
+ return axios.get(`/v1/addons/sitelock/${addonId}/sso`, options);
338
+ };
339
+ export const getAddonsSitelockSsoQueryKey = (addonId) => [`/v1/addons/sitelock/${addonId}/sso`];
340
+ export const useAddonsSitelockSso = (addonId, options) => {
341
+ var _a;
342
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
343
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSitelockSsoQueryKey(addonId);
344
+ const queryFn = ({ signal }) => addonsSitelockSso(addonId, Object.assign({ signal }, axiosOptions));
345
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
346
+ query.queryKey = queryKey;
347
+ return query;
348
+ };
349
+ /**
350
+ * Backup initiate
351
+ * @summary Backup initiate
352
+ */
353
+ export const backupInitiate = (addonId, backupInitiateBody, options) => {
354
+ return axios.post(`/v1/addons/${addonId}/backup`, backupInitiateBody, options);
355
+ };
356
+ export const useBackupInitiate = (options) => {
357
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
358
+ const mutationFn = (props) => {
359
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
360
+ return backupInitiate(addonId, data, axiosOptions);
361
+ };
362
+ return useMutation(mutationFn, mutationOptions);
363
+ };
364
+ /**
365
+ * Backup status
366
+ * @summary Backup status
367
+ */
368
+ export const backupStatus = (addonId, params, options) => {
369
+ 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) }));
370
+ };
371
+ export const getBackupStatusQueryKey = (addonId, params) => [`/v1/addons/${addonId}/backup`, ...(params ? [params] : [])];
372
+ export const useBackupStatus = (addonId, params, options) => {
373
+ var _a;
374
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
375
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getBackupStatusQueryKey(addonId, params);
376
+ const queryFn = ({ signal }) => backupStatus(addonId, params, Object.assign({ signal }, axiosOptions));
377
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
378
+ query.queryKey = queryKey;
379
+ return query;
380
+ };
381
+ /**
382
+ * Returns backup list
383
+ * @summary Backup list
384
+ */
385
+ export const backupList = (addonId, params, options) => {
386
+ 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) }));
387
+ };
388
+ export const getBackupListQueryKey = (addonId, params) => [`/v1/addons/${addonId}/backup/list`, ...(params ? [params] : [])];
389
+ export const useBackupList = (addonId, params, options) => {
390
+ var _a;
391
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
392
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getBackupListQueryKey(addonId, params);
393
+ const queryFn = ({ signal }) => backupList(addonId, params, Object.assign({ signal }, axiosOptions));
394
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
395
+ query.queryKey = queryKey;
396
+ return query;
397
+ };
398
+ /**
399
+ * Decom and delete cloudflare basic addon
400
+ * @summary Uninstall cloudflare basic addon
401
+ */
402
+ export const addonsCloudflare = (addonId, options) => {
403
+ return axios.delete(`/v1/addons/${addonId}/cloudflare`, options);
404
+ };
405
+ export const useAddonsCloudflare = (options) => {
406
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
407
+ const mutationFn = (props) => {
408
+ const { addonId } = props !== null && props !== void 0 ? props : {};
409
+ return addonsCloudflare(addonId, axiosOptions);
410
+ };
411
+ return useMutation(mutationFn, mutationOptions);
412
+ };
413
+ /**
414
+ * Returns addon information
415
+ * @summary info
416
+ */
417
+ export const addonsInfo = (addonId, options) => {
418
+ return axios.get(`/v1/addons/${addonId}/info`, options);
419
+ };
420
+ export const getAddonsInfoQueryKey = (addonId) => [`/v1/addons/${addonId}/info`];
421
+ export const useAddonsInfo = (addonId, options) => {
422
+ var _a;
423
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
424
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsInfoQueryKey(addonId);
425
+ const queryFn = ({ signal }) => addonsInfo(addonId, Object.assign({ signal }, axiosOptions));
426
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
427
+ query.queryKey = queryKey;
428
+ return query;
429
+ };
430
+ /**
431
+ * Returns spamexperts sso url
432
+ * @summary info
433
+ */
434
+ export const addonsSpamexpertsSso = (addonId, options) => {
435
+ return axios.get(`/v1/addons/${addonId}/spamexperts/sso`, options);
436
+ };
437
+ export const getAddonsSpamexpertsSsoQueryKey = (addonId) => [`/v1/addons/${addonId}/spamexperts/sso`];
438
+ export const useAddonsSpamexpertsSso = (addonId, options) => {
439
+ var _a;
440
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
441
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSpamexpertsSsoQueryKey(addonId);
442
+ const queryFn = ({ signal }) => addonsSpamexpertsSso(addonId, Object.assign({ signal }, axiosOptions));
443
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
444
+ query.queryKey = queryKey;
445
+ return query;
446
+ };
447
+ /**
448
+ * Returns WebZai SSO URL
449
+ * @summary webzai sso
450
+ */
451
+ export const webzaiSso = (addonId, options) => {
452
+ return axios.get(`/v1/addons/${addonId}/webzai/sso`, options);
453
+ };
454
+ export const getWebzaiSsoQueryKey = (addonId) => [`/v1/addons/${addonId}/webzai/sso`];
455
+ export const useWebzaiSso = (addonId, options) => {
456
+ var _a;
457
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
458
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getWebzaiSsoQueryKey(addonId);
459
+ const queryFn = ({ signal }) => webzaiSso(addonId, Object.assign({ signal }, axiosOptions));
460
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
461
+ query.queryKey = queryKey;
462
+ return query;
463
+ };
464
+ /**
465
+ * Returns Weebly SSO URL
466
+ * @summary weebly sso
467
+ */
468
+ export const weeblySso = (addonId, options) => {
469
+ return axios.get(`/v1/addons/${addonId}/weebly/sso`, options);
470
+ };
471
+ export const getWeeblySsoQueryKey = (addonId) => [`/v1/addons/${addonId}/weebly/sso`];
472
+ export const useWeeblySso = (addonId, options) => {
473
+ var _a;
474
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
475
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getWeeblySsoQueryKey(addonId);
476
+ const queryFn = ({ signal }) => weeblySso(addonId, Object.assign({ signal }, axiosOptions));
477
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
478
+ query.queryKey = queryKey;
479
+ return query;
480
+ };
481
+ /**
482
+ * Get domain info
483
+ * @summary domain info
484
+ */
485
+ export const domainInfo = (domainId, options) => {
486
+ return axios.get(`/v1/domains/${domainId}`, options);
487
+ };
488
+ export const getDomainInfoQueryKey = (domainId) => [`/v1/domains/${domainId}`];
489
+ export const useDomainInfo = (domainId, options) => {
490
+ var _a;
491
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
492
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainInfoQueryKey(domainId);
493
+ const queryFn = ({ signal }) => domainInfo(domainId, Object.assign({ signal }, axiosOptions));
494
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(domainId) }, queryOptions));
495
+ query.queryKey = queryKey;
496
+ return query;
497
+ };
498
+ /**
499
+ * Unassign a domain name
500
+ * @summary domain unassign
501
+ */
502
+ export const domainUnassign = (domainId, options) => {
503
+ return axios.post(`/v1/domains/${domainId}/unassign`, undefined, options);
504
+ };
505
+ export const useDomainUnassign = (options) => {
506
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
507
+ const mutationFn = (props) => {
508
+ const { domainId } = props !== null && props !== void 0 ? props : {};
509
+ return domainUnassign(domainId, axiosOptions);
510
+ };
511
+ return useMutation(mutationFn, mutationOptions);
512
+ };
513
+ /**
514
+ * Returns HAL hosting account-level information
515
+ * @summary HAL Hosting Account Info
516
+ */
517
+ export const hostingAccount = (hostingId, options) => {
518
+ return axios.get(`/v1/hosting/${hostingId}`, options);
519
+ };
520
+ export const getHostingAccountQueryKey = (hostingId) => [`/v1/hosting/${hostingId}`];
521
+ export const useHostingAccount = (hostingId, 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 : getHostingAccountQueryKey(hostingId);
525
+ const queryFn = ({ signal }) => hostingAccount(hostingId, Object.assign({ signal }, axiosOptions));
526
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
527
+ query.queryKey = queryKey;
528
+ return query;
529
+ };
530
+ /**
531
+ * Returns a list of addons.
532
+ * @summary addon list
533
+ */
534
+ export const hostingAddons = (hostingId, params, options) => {
535
+ 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) }));
536
+ };
537
+ export const getHostingAddonsQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/addons`, ...(params ? [params] : [])];
538
+ export const useHostingAddons = (hostingId, params, options) => {
539
+ var _a;
540
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
541
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAddonsQueryKey(hostingId, params);
542
+ const queryFn = ({ signal }) => hostingAddons(hostingId, params, Object.assign({ signal }, axiosOptions));
543
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
544
+ query.queryKey = queryKey;
545
+ return query;
546
+ };
547
+ /**
548
+ * Returns the hosting server info
549
+ * @summary server status/info
550
+ */
551
+ export const hostingAdvancedServer = (hostingId, options) => {
552
+ return axios.get(`/v1/hosting/${hostingId}/advanced/server`, options);
553
+ };
554
+ export const getHostingAdvancedServerQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/server`];
555
+ export const useHostingAdvancedServer = (hostingId, options) => {
556
+ var _a;
557
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
558
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedServerQueryKey(hostingId);
559
+ const queryFn = ({ signal }) => hostingAdvancedServer(hostingId, Object.assign({ signal }, axiosOptions));
560
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
561
+ query.queryKey = queryKey;
562
+ return query;
563
+ };
564
+ /**
565
+ * Allows for managing server status
566
+ * @summary server_status
567
+ */
568
+ export const hostingAdvancedServerStatus = (hostingId, hostingAdvancedServerStatusBody, options) => {
569
+ return axios.put(`/v1/hosting/${hostingId}/advanced/server`, hostingAdvancedServerStatusBody, options);
570
+ };
571
+ export const useHostingAdvancedServerStatus = (options) => {
572
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
573
+ const mutationFn = (props) => {
574
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
575
+ return hostingAdvancedServerStatus(hostingId, data, axiosOptions);
576
+ };
577
+ return useMutation(mutationFn, mutationOptions);
578
+ };
579
+ /**
580
+ * Update user account's password
581
+ * @summary Update user account password
582
+ */
583
+ export const hostingAdvancedPassword = (hostingId, hostingAdvancedPasswordBody, options) => {
584
+ return axios.put(`/v1/hosting/${hostingId}/advanced/server/password`, hostingAdvancedPasswordBody, options);
585
+ };
586
+ export const useHostingAdvancedPassword = (options) => {
587
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
588
+ const mutationFn = (props) => {
589
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
590
+ return hostingAdvancedPassword(hostingId, data, axiosOptions);
591
+ };
592
+ return useMutation(mutationFn, mutationOptions);
593
+ };
594
+ /**
595
+ * Returns the hosting sso_whm login url
596
+ * @summary hosting sso_whm
597
+ */
598
+ export const hostingAdvancedSsoWhm = (hostingId, options) => {
599
+ return axios.get(`/v1/hosting/${hostingId}/advanced/sso_whm`, options);
600
+ };
601
+ export const getHostingAdvancedSsoWhmQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/sso_whm`];
602
+ export const useHostingAdvancedSsoWhm = (hostingId, options) => {
603
+ var _a;
604
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
605
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSsoWhmQueryKey(hostingId);
606
+ const queryFn = ({ signal }) => hostingAdvancedSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
607
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
608
+ query.queryKey = queryKey;
609
+ return query;
610
+ };
611
+ /**
612
+ * Returns the hosting system_console url
613
+ * @summary hosting system_console
614
+ */
615
+ export const hostingAdvancedSystemConsole = (hostingId, options) => {
616
+ return axios.get(`/v1/hosting/${hostingId}/advanced/system-console`, options);
617
+ };
618
+ export const getHostingAdvancedSystemConsoleQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/system-console`];
619
+ export const useHostingAdvancedSystemConsole = (hostingId, options) => {
620
+ var _a;
621
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
622
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSystemConsoleQueryKey(hostingId);
623
+ const queryFn = ({ signal }) => hostingAdvancedSystemConsole(hostingId, Object.assign({ signal }, axiosOptions));
624
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
625
+ query.queryKey = queryKey;
626
+ return query;
627
+ };
628
+ /**
629
+ * Returns the hosting capabilities
630
+ * @summary hosting capabilities
631
+ */
632
+ export const hostingCapabilities = (hostingId, options) => {
633
+ return axios.get(`/v1/hosting/${hostingId}/capabilities`, options);
634
+ };
635
+ export const getHostingCapabilitiesQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/capabilities`];
636
+ export const useHostingCapabilities = (hostingId, options) => {
637
+ var _a;
638
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
639
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingCapabilitiesQueryKey(hostingId);
640
+ const queryFn = ({ signal }) => hostingCapabilities(hostingId, Object.assign({ signal }, axiosOptions));
641
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
642
+ query.queryKey = queryKey;
643
+ return query;
644
+ };
645
+ /**
646
+ * Creates cloudflare basic addon
647
+ * @deprecated
648
+ * @summary Deprecated - Install cloudflare basic addon
649
+ */
650
+ export const addonCloudflare = (hostingId, addonCloudflareBody, options) => {
651
+ return axios.post(`/v1/hosting/${hostingId}/cloudflare`, addonCloudflareBody, options);
652
+ };
653
+ export const useAddonCloudflare = (options) => {
654
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
655
+ const mutationFn = (props) => {
656
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
657
+ return addonCloudflare(hostingId, data, axiosOptions);
658
+ };
659
+ return useMutation(mutationFn, mutationOptions);
660
+ };
661
+ /**
662
+ * Returns a list of cron jobs
663
+ * @summary cron_list
664
+ */
665
+ export const listCrons = (hostingId, options) => {
666
+ return axios.get(`/v1/hosting/${hostingId}/crontab`, options);
667
+ };
668
+ export const getListCronsQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/crontab`];
669
+ export const useListCrons = (hostingId, options) => {
670
+ var _a;
671
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
672
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getListCronsQueryKey(hostingId);
673
+ const queryFn = ({ signal }) => listCrons(hostingId, Object.assign({ signal }, axiosOptions));
674
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
675
+ query.queryKey = queryKey;
676
+ return query;
677
+ };
678
+ /**
679
+ * Adds a new cron job
680
+ * @summary cron_add
681
+ */
682
+ export const addCron = (hostingId, addCronBody, options) => {
683
+ return axios.post(`/v1/hosting/${hostingId}/crontab`, addCronBody, options);
684
+ };
685
+ export const useAddCron = (options) => {
686
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
687
+ const mutationFn = (props) => {
688
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
689
+ return addCron(hostingId, data, axiosOptions);
690
+ };
691
+ return useMutation(mutationFn, mutationOptions);
692
+ };
693
+ /**
694
+ * Updates a cron job
695
+ * @summary cron_update
696
+ */
697
+ export const updateCron = (hostingId, updateCronBody, options) => {
698
+ return axios.put(`/v1/hosting/${hostingId}/crontab`, updateCronBody, options);
699
+ };
700
+ export const useUpdateCron = (options) => {
701
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
702
+ const mutationFn = (props) => {
703
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
704
+ return updateCron(hostingId, data, axiosOptions);
705
+ };
706
+ return useMutation(mutationFn, mutationOptions);
707
+ };
708
+ /**
709
+ * Deletes a cron job
710
+ * @summary cron_delete
711
+ */
712
+ export const cron = (hostingId, cronBody, options) => {
713
+ return axios.delete(`/v1/hosting/${hostingId}/crontab`, Object.assign({ data: cronBody }, options));
714
+ };
715
+ export const useCron = (options) => {
716
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
717
+ const mutationFn = (props) => {
718
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
719
+ return cron(hostingId, data, axiosOptions);
720
+ };
721
+ return useMutation(mutationFn, mutationOptions);
722
+ };
723
+ /**
724
+ * Add a new db to an account
725
+ * @summary Create a database for an account
726
+ */
727
+ export const dbAdd = (hostingId, dbAddBody, options) => {
728
+ return axios.post(`/v1/hosting/${hostingId}/db`, dbAddBody, options);
729
+ };
730
+ export const useDbAdd = (options) => {
731
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
732
+ const mutationFn = (props) => {
733
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
734
+ return dbAdd(hostingId, data, axiosOptions);
735
+ };
736
+ return useMutation(mutationFn, mutationOptions);
737
+ };
738
+ /**
739
+ * Delete db account
740
+ * @summary Delete db account
741
+ */
742
+ export const db = (hostingId, dbBody, options) => {
743
+ return axios.delete(`/v1/hosting/${hostingId}/db`, Object.assign({ data: dbBody }, options));
744
+ };
745
+ export const useDb = (options) => {
746
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
747
+ const mutationFn = (props) => {
748
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
749
+ return db(hostingId, data, axiosOptions);
750
+ };
751
+ return useMutation(mutationFn, mutationOptions);
752
+ };
753
+ /**
754
+ * List all DB name
755
+ * @summary Get list of database name
756
+ */
757
+ export const dbList = (hostingId, options) => {
758
+ return axios.get(`/v1/hosting/${hostingId}/db`, options);
759
+ };
760
+ export const getDbListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db`];
761
+ export const useDbList = (hostingId, options) => {
762
+ var _a;
763
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
764
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbListQueryKey(hostingId);
765
+ const queryFn = ({ signal }) => dbList(hostingId, Object.assign({ signal }, axiosOptions));
766
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
767
+ query.queryKey = queryKey;
768
+ return query;
769
+ };
770
+ /**
771
+ * Returns a list of db and table limits and usage.
772
+ * @summary DB usage
773
+ */
774
+ export const dbUsage = (hostingId, options) => {
775
+ return axios.get(`/v1/hosting/${hostingId}/db/usage`, options);
776
+ };
777
+ export const getDbUsageQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db/usage`];
778
+ export const useDbUsage = (hostingId, options) => {
779
+ var _a;
780
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
781
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUsageQueryKey(hostingId);
782
+ const queryFn = ({ signal }) => dbUsage(hostingId, Object.assign({ signal }, axiosOptions));
783
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
784
+ query.queryKey = queryKey;
785
+ return query;
786
+ };
787
+ /**
788
+ * Update database user password
789
+ * @summary Update database user password
790
+ */
791
+ export const dbUserPasswordSet = (hostingId, dbUserPasswordSetBody, options) => {
792
+ return axios.post(`/v1/hosting/${hostingId}/db/user/password`, dbUserPasswordSetBody, options);
793
+ };
794
+ export const useDbUserPasswordSet = (options) => {
795
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
796
+ const mutationFn = (props) => {
797
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
798
+ return dbUserPasswordSet(hostingId, data, axiosOptions);
799
+ };
800
+ return useMutation(mutationFn, mutationOptions);
801
+ };
802
+ /**
803
+ * Get user privileges on a database.
804
+ * @summary Get user privileges on a database.
805
+ */
806
+ export const dbUserPrivsGet = (hostingId, params, options) => {
807
+ 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) }));
808
+ };
809
+ export const getDbUserPrivsGetQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/db/user/privileges`, ...(params ? [params] : [])];
810
+ export const useDbUserPrivsGet = (hostingId, params, options) => {
811
+ var _a;
812
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
813
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserPrivsGetQueryKey(hostingId, params);
814
+ const queryFn = ({ signal }) => dbUserPrivsGet(hostingId, params, Object.assign({ signal }, axiosOptions));
815
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
816
+ query.queryKey = queryKey;
817
+ return query;
818
+ };
819
+ /**
820
+ * Add/Update user privileges on a database.
821
+ * @summary Add/Update user privileges on a database.
822
+ */
823
+ export const dbUserPrivsSet = (hostingId, dbUserPrivsSetBody, options) => {
824
+ return axios.post(`/v1/hosting/${hostingId}/db/user/privileges`, dbUserPrivsSetBody, options);
825
+ };
826
+ export const useDbUserPrivsSet = (options) => {
827
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
828
+ const mutationFn = (props) => {
829
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
830
+ return dbUserPrivsSet(hostingId, data, axiosOptions);
831
+ };
832
+ return useMutation(mutationFn, mutationOptions);
833
+ };
834
+ /**
835
+ * 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.
836
+ * @summary Create a database user with privileges
837
+ */
838
+ export const dbUserAdd = (hostingId, dbUserAddBody, options) => {
839
+ return axios.post(`/v1/hosting/${hostingId}/db/users`, dbUserAddBody, options);
840
+ };
841
+ export const useDbUserAdd = (options) => {
842
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
843
+ const mutationFn = (props) => {
844
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
845
+ return dbUserAdd(hostingId, data, axiosOptions);
846
+ };
847
+ return useMutation(mutationFn, mutationOptions);
848
+ };
849
+ /**
850
+ * Delete db user
851
+ * @summary Delete db user
852
+ */
853
+ export const dbUserDelete = (hostingId, dbUserDeleteBody, options) => {
854
+ return axios.delete(`/v1/hosting/${hostingId}/db/users`, Object.assign({ data: dbUserDeleteBody }, options));
855
+ };
856
+ export const useDbUserDelete = (options) => {
857
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
858
+ const mutationFn = (props) => {
859
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
860
+ return dbUserDelete(hostingId, data, axiosOptions);
861
+ };
862
+ return useMutation(mutationFn, mutationOptions);
863
+ };
864
+ /**
865
+ * List all DB users
866
+ * @summary Get list of db users
867
+ */
868
+ export const dbUserList = (hostingId, options) => {
869
+ return axios.get(`/v1/hosting/${hostingId}/db/users`, options);
870
+ };
871
+ export const getDbUserListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db/users`];
872
+ export const useDbUserList = (hostingId, options) => {
873
+ var _a;
874
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
875
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserListQueryKey(hostingId);
876
+ const queryFn = ({ signal }) => dbUserList(hostingId, Object.assign({ signal }, axiosOptions));
877
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
878
+ query.queryKey = queryKey;
879
+ return query;
880
+ };
881
+ /**
882
+ * Returns a list of domains
883
+ * @summary domain list
884
+ */
885
+ export const domains = (hostingId, params, options) => {
886
+ 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) }));
887
+ };
888
+ export const getDomainsQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/domains`, ...(params ? [params] : [])];
889
+ export const useDomains = (hostingId, params, options) => {
890
+ var _a;
891
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
892
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainsQueryKey(hostingId, params);
893
+ const queryFn = ({ signal }) => domains(hostingId, params, Object.assign({ signal }, axiosOptions));
894
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
895
+ query.queryKey = queryKey;
896
+ return query;
897
+ };
898
+ /**
899
+ * Unassign the domain associated with the hosting account
900
+ * @summary Unassign the domain
901
+ */
902
+ export const hostingDomainsUnassign = (hostingId, hostingDomainsUnassignBody, options) => {
903
+ return axios.post(`/v1/hosting/${hostingId}/domains/unassign`, hostingDomainsUnassignBody, options);
904
+ };
905
+ export const useHostingDomainsUnassign = (options) => {
906
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
907
+ const mutationFn = (props) => {
908
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
909
+ return hostingDomainsUnassign(hostingId, data, axiosOptions);
910
+ };
911
+ return useMutation(mutationFn, mutationOptions);
912
+ };
913
+ /**
914
+ * Returns info about an existing ecommerce addon otherwise it returns null
915
+ * @summary ecommerce info
916
+ */
917
+ export const hostingEcommerceInfo = (hostingId, options) => {
918
+ return axios.get(`/v1/hosting/${hostingId}/ecommerce`, options);
919
+ };
920
+ export const getHostingEcommerceInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ecommerce`];
921
+ export const useHostingEcommerceInfo = (hostingId, options) => {
922
+ var _a;
923
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
924
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingEcommerceInfoQueryKey(hostingId);
925
+ const queryFn = ({ signal }) => hostingEcommerceInfo(hostingId, Object.assign({ signal }, axiosOptions));
926
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
927
+ query.queryKey = queryKey;
928
+ return query;
929
+ };
930
+ /**
931
+ * Returns a list of FTP accounts.
932
+ * @summary ftp list
933
+ */
934
+ export const hostingFtpList = (hostingId, options) => {
935
+ return axios.get(`/v1/hosting/${hostingId}/ftp`, options);
936
+ };
937
+ export const getHostingFtpListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ftp`];
938
+ export const useHostingFtpList = (hostingId, options) => {
939
+ var _a;
940
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
941
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingFtpListQueryKey(hostingId);
942
+ const queryFn = ({ signal }) => hostingFtpList(hostingId, Object.assign({ signal }, axiosOptions));
943
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
944
+ query.queryKey = queryKey;
945
+ return query;
946
+ };
947
+ /**
948
+ * Add ftp account
949
+ * @summary Add ftp account
950
+ */
951
+ export const hostingFtpAdd = (hostingId, hostingFtpAddBody, options) => {
952
+ return axios.post(`/v1/hosting/${hostingId}/ftp`, hostingFtpAddBody, options);
953
+ };
954
+ export const useHostingFtpAdd = (options) => {
955
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
956
+ const mutationFn = (props) => {
957
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
958
+ return hostingFtpAdd(hostingId, data, axiosOptions);
959
+ };
960
+ return useMutation(mutationFn, mutationOptions);
961
+ };
962
+ /**
963
+ * Update ftp account
964
+ * @summary Update ftp account
965
+ */
966
+ export const hostingFtpUpdate = (hostingId, hostingFtpUpdateBody, options) => {
967
+ return axios.put(`/v1/hosting/${hostingId}/ftp`, hostingFtpUpdateBody, options);
968
+ };
969
+ export const useHostingFtpUpdate = (options) => {
970
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
971
+ const mutationFn = (props) => {
972
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
973
+ return hostingFtpUpdate(hostingId, data, axiosOptions);
974
+ };
975
+ return useMutation(mutationFn, mutationOptions);
976
+ };
977
+ /**
978
+ * Delete ftp account
979
+ * @summary Delete ftp account
980
+ */
981
+ export const hostingFtp = (hostingId, hostingFtpBody, options) => {
982
+ return axios.delete(`/v1/hosting/${hostingId}/ftp`, Object.assign({ data: hostingFtpBody }, options));
983
+ };
984
+ export const useHostingFtp = (options) => {
985
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
986
+ const mutationFn = (props) => {
987
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
988
+ return hostingFtp(hostingId, data, axiosOptions);
989
+ };
990
+ return useMutation(mutationFn, mutationOptions);
991
+ };
992
+ /**
993
+ * Returns hosting account info
994
+ * @summary Hosting info
995
+ */
996
+ export const hostingInfo = (hostingId, options) => {
997
+ return axios.get(`/v1/hosting/${hostingId}/info`, options);
998
+ };
999
+ export const getHostingInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info`];
1000
+ export const useHostingInfo = (hostingId, options) => {
1001
+ var _a;
1002
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1003
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoQueryKey(hostingId);
1004
+ const queryFn = ({ signal }) => hostingInfo(hostingId, Object.assign({ signal }, axiosOptions));
1005
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1006
+ query.queryKey = queryKey;
1007
+ return query;
1008
+ };
1009
+ /**
1010
+ * Returns the hosting account's disk usage
1011
+ * @summary info disk usage
1012
+ */
1013
+ export const hostingInfoDiskUsage = (hostingId, options) => {
1014
+ return axios.get(`/v1/hosting/${hostingId}/info/diskusage`, options);
1015
+ };
1016
+ export const getHostingInfoDiskUsageQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info/diskusage`];
1017
+ export const useHostingInfoDiskUsage = (hostingId, options) => {
1018
+ var _a;
1019
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1020
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoDiskUsageQueryKey(hostingId);
1021
+ const queryFn = ({ signal }) => hostingInfoDiskUsage(hostingId, Object.assign({ signal }, axiosOptions));
1022
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1023
+ query.queryKey = queryKey;
1024
+ return query;
1025
+ };
1026
+ /**
1027
+ * Returns lead info for the user of the hosting account
1028
+ * @summary Lead info
1029
+ */
1030
+ export const hostingLead = (hostingId, params, options) => {
1031
+ 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) }));
1032
+ };
1033
+ export const useHostingLead = (options) => {
1034
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1035
+ const mutationFn = (props) => {
1036
+ const { hostingId, params } = props !== null && props !== void 0 ? props : {};
1037
+ return hostingLead(hostingId, params, axiosOptions);
1038
+ };
1039
+ return useMutation(mutationFn, mutationOptions);
1040
+ };
1041
+ /**
1042
+ * Gets the Wordpress migration status
1043
+ * @summary Wordpress migration status
1044
+ */
1045
+ export const hostingMigrationStatus = (hostingId, options) => {
1046
+ return axios.get(`/v1/hosting/${hostingId}/migrations`, options);
1047
+ };
1048
+ export const getHostingMigrationStatusQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/migrations`];
1049
+ export const useHostingMigrationStatus = (hostingId, options) => {
1050
+ var _a;
1051
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1052
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationStatusQueryKey(hostingId);
1053
+ const queryFn = ({ signal }) => hostingMigrationStatus(hostingId, Object.assign({ signal }, axiosOptions));
1054
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1055
+ query.queryKey = queryKey;
1056
+ return query;
1057
+ };
1058
+ /**
1059
+ * Adds the wordpressmigrate addon for a given migration id and hosting account
1060
+ * @summary start the migration process for a site
1061
+ */
1062
+ export const hostingMigrations = (hostingId, hostingMigrationsBody, options) => {
1063
+ return axios.post(`/v1/hosting/${hostingId}/migrations`, hostingMigrationsBody, options);
1064
+ };
1065
+ export const useHostingMigrations = (options) => {
1066
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1067
+ const mutationFn = (props) => {
1068
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1069
+ return hostingMigrations(hostingId, data, axiosOptions);
1070
+ };
1071
+ return useMutation(mutationFn, mutationOptions);
1072
+ };
1073
+ /**
1074
+ * Checks if Migration ID exists, indicating the site migration is in progress or completed
1075
+ * @deprecated
1076
+ * @summary Deprecated Migration ID check
1077
+ */
1078
+ export const hostingMigrationsCheck = (hostingId, params, options) => {
1079
+ 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) }));
1080
+ };
1081
+ export const getHostingMigrationsCheckQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/check`, ...(params ? [params] : [])];
1082
+ export const useHostingMigrationsCheck = (hostingId, params, options) => {
1083
+ var _a;
1084
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1085
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationsCheckQueryKey(hostingId, params);
1086
+ const queryFn = ({ signal }) => hostingMigrationsCheck(hostingId, params, Object.assign({ signal }, axiosOptions));
1087
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1088
+ query.queryKey = queryKey;
1089
+ return query;
1090
+ };
1091
+ /**
1092
+ * Post migration event to CWM
1093
+ * @summary hosting migrations event
1094
+ */
1095
+ export const hostingMigrationsEvent = (hostingId, hostingMigrationsEventBody, options) => {
1096
+ return axios.post(`/v1/hosting/${hostingId}/migrations/event`, hostingMigrationsEventBody, options);
1097
+ };
1098
+ export const useHostingMigrationsEvent = (options) => {
1099
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1100
+ const mutationFn = (props) => {
1101
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1102
+ return hostingMigrationsEvent(hostingId, data, axiosOptions);
1103
+ };
1104
+ return useMutation(mutationFn, mutationOptions);
1105
+ };
1106
+ /**
1107
+ * Gets the Wordpress migration information
1108
+ * @summary Wordpress migration information
1109
+ */
1110
+ export const hostingMigrationInfo = (hostingId, params, options) => {
1111
+ 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) }));
1112
+ };
1113
+ export const getHostingMigrationInfoQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/info`, ...(params ? [params] : [])];
1114
+ export const useHostingMigrationInfo = (hostingId, params, options) => {
1115
+ var _a;
1116
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1117
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationInfoQueryKey(hostingId, params);
1118
+ const queryFn = ({ signal }) => hostingMigrationInfo(hostingId, params, Object.assign({ signal }, axiosOptions));
1119
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1120
+ query.queryKey = queryKey;
1121
+ return query;
1122
+ };
1123
+ /**
1124
+ * Provides the status of SiteMigration site_scan and deeplink to WordPress admin page
1125
+ * @summary SiteMigration site_scan status
1126
+ */
1127
+ export const hostingMigrationSiteScanStatus = (hostingId, params, options) => {
1128
+ 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) }));
1129
+ };
1130
+ export const getHostingMigrationSiteScanStatusQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/site-scan`, ...(params ? [params] : [])];
1131
+ export const useHostingMigrationSiteScanStatus = (hostingId, params, options) => {
1132
+ var _a;
1133
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1134
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationSiteScanStatusQueryKey(hostingId, params);
1135
+ const queryFn = ({ signal }) => hostingMigrationSiteScanStatus(hostingId, params, Object.assign({ signal }, axiosOptions));
1136
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1137
+ query.queryKey = queryKey;
1138
+ return query;
1139
+ };
1140
+ /**
1141
+ * Returns the hosting brand nameservers
1142
+ * @deprecated
1143
+ * @summary hosting nameservers
1144
+ */
1145
+ export const hostingNameservers = (hostingId, options) => {
1146
+ return axios.get(`/v1/hosting/${hostingId}/nameservers`, options);
1147
+ };
1148
+ export const getHostingNameserversQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/nameservers`];
1149
+ export const useHostingNameservers = (hostingId, options) => {
1150
+ var _a;
1151
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1152
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversQueryKey(hostingId);
1153
+ const queryFn = ({ signal }) => hostingNameservers(hostingId, Object.assign({ signal }, axiosOptions));
1154
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1155
+ query.queryKey = queryKey;
1156
+ return query;
1157
+ };
1158
+ /**
1159
+ * Returns onboarding data
1160
+ * @summary Returns hosting onboarding data
1161
+ */
1162
+ export const hostingOnboardingData = (hostingId, options) => {
1163
+ return axios.get(`/v1/hosting/${hostingId}/onboarding`, options);
1164
+ };
1165
+ export const getHostingOnboardingDataQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/onboarding`];
1166
+ export const useHostingOnboardingData = (hostingId, options) => {
1167
+ var _a;
1168
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1169
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingOnboardingDataQueryKey(hostingId);
1170
+ const queryFn = ({ signal }) => hostingOnboardingData(hostingId, Object.assign({ signal }, axiosOptions));
1171
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1172
+ query.queryKey = queryKey;
1173
+ return query;
1174
+ };
1175
+ /**
1176
+ * @summary Updates hosting onboarding data
1177
+ */
1178
+ export const hostingOnboardingDataUpdate = (hostingId, hostingOnboardingDataUpdateBody, options) => {
1179
+ return axios.put(`/v1/hosting/${hostingId}/onboarding`, hostingOnboardingDataUpdateBody, options);
1180
+ };
1181
+ export const useHostingOnboardingDataUpdate = (options) => {
1182
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1183
+ const mutationFn = (props) => {
1184
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1185
+ return hostingOnboardingDataUpdate(hostingId, data, axiosOptions);
1186
+ };
1187
+ return useMutation(mutationFn, mutationOptions);
1188
+ };
1189
+ /**
1190
+ * Returns the list of site's redirects
1191
+ * @summary List redirects
1192
+ */
1193
+ export const hostingRedirects = (hostingId, options) => {
1194
+ return axios.get(`/v1/hosting/${hostingId}/redirects`, options);
1195
+ };
1196
+ export const getHostingRedirectsQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/redirects`];
1197
+ export const useHostingRedirects = (hostingId, options) => {
1198
+ var _a;
1199
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1200
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingRedirectsQueryKey(hostingId);
1201
+ const queryFn = ({ signal }) => hostingRedirects(hostingId, Object.assign({ signal }, axiosOptions));
1202
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1203
+ query.queryKey = queryKey;
1204
+ return query;
1205
+ };
1206
+ /**
1207
+ * Delete the user site redirect
1208
+ * @summary Delete redirects
1209
+ */
1210
+ export const hostingRedirect = (hostingId, hostingRedirectBody, options) => {
1211
+ return axios.delete(`/v1/hosting/${hostingId}/redirects`, Object.assign({ data: hostingRedirectBody }, options));
1212
+ };
1213
+ export const useHostingRedirect = (options) => {
1214
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1215
+ const mutationFn = (props) => {
1216
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1217
+ return hostingRedirect(hostingId, data, axiosOptions);
1218
+ };
1219
+ return useMutation(mutationFn, mutationOptions);
1220
+ };
1221
+ /**
1222
+ * Returns the hosting sso_whm login url
1223
+ * @summary hosting sso_whm
1224
+ */
1225
+ export const hostingResellerSsoWhm = (hostingId, options) => {
1226
+ return axios.get(`/v1/hosting/${hostingId}/reseller/sso/whm`, options);
1227
+ };
1228
+ export const getHostingResellerSsoWhmQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/reseller/sso/whm`];
1229
+ export const useHostingResellerSsoWhm = (hostingId, options) => {
1230
+ var _a;
1231
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1232
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingResellerSsoWhmQueryKey(hostingId);
1233
+ const queryFn = ({ signal }) => hostingResellerSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
1234
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1235
+ query.queryKey = queryKey;
1236
+ return query;
1237
+ };
1238
+ /**
1239
+ * Enable or disable shell access on an account by setting the shell.SSH key access must be established separately.
1240
+ * @summary hosting shell toggle
1241
+ */
1242
+ export const hostingShellToggle = (hostingId, hostingShellToggleBody, options) => {
1243
+ return axios.put(`/v1/hosting/${hostingId}/shell`, hostingShellToggleBody, options);
1244
+ };
1245
+ export const useHostingShellToggle = (options) => {
1246
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1247
+ const mutationFn = (props) => {
1248
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1249
+ return hostingShellToggle(hostingId, data, axiosOptions);
1250
+ };
1251
+ return useMutation(mutationFn, mutationOptions);
1252
+ };
1253
+ /**
1254
+ * Determine shell access status for an account.
1255
+ * @summary hosting shell_status
1256
+ */
1257
+ export const hostingShellInfo = (hostingId, options) => {
1258
+ return axios.get(`/v1/hosting/${hostingId}/shell`, options);
1259
+ };
1260
+ export const getHostingShellInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/shell`];
1261
+ export const useHostingShellInfo = (hostingId, options) => {
1262
+ var _a;
1263
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1264
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingShellInfoQueryKey(hostingId);
1265
+ const queryFn = ({ signal }) => hostingShellInfo(hostingId, Object.assign({ signal }, axiosOptions));
1266
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1267
+ query.queryKey = queryKey;
1268
+ return query;
1269
+ };
1270
+ /**
1271
+ * Add a site to the current hosting.
1272
+ * @summary sites add
1273
+ */
1274
+ export const hostingSiteAdd = (hostingId, hostingSiteAddBody, options) => {
1275
+ return axios.post(`/v1/hosting/${hostingId}/sites`, hostingSiteAddBody, options);
1276
+ };
1277
+ export const useHostingSiteAdd = (options) => {
1278
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1279
+ const mutationFn = (props) => {
1280
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1281
+ return hostingSiteAdd(hostingId, data, axiosOptions);
1282
+ };
1283
+ return useMutation(mutationFn, mutationOptions);
1284
+ };
1285
+ /**
1286
+ * Update Sites in batches.
1287
+ * @summary sites update batch
1288
+ */
1289
+ export const sitesBatch = (hostingId, sitesBatchBody, options) => {
1290
+ return axios.put(`/v1/hosting/${hostingId}/sites/batch`, sitesBatchBody, options);
1291
+ };
1292
+ export const useSitesBatch = (options) => {
1293
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1294
+ const mutationFn = (props) => {
1295
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1296
+ return sitesBatch(hostingId, data, axiosOptions);
1297
+ };
1298
+ return useMutation(mutationFn, mutationOptions);
1299
+ };
1300
+ /**
1301
+ * Returns the hosting account's SSH information
1302
+ * @summary ssh info
1303
+ */
1304
+ export const hostingSshInfo = (hostingId, options) => {
1305
+ return axios.get(`/v1/hosting/${hostingId}/ssh`, options);
1306
+ };
1307
+ export const getHostingSshInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ssh`];
1308
+ export const useHostingSshInfo = (hostingId, options) => {
1309
+ var _a;
1310
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1311
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSshInfoQueryKey(hostingId);
1312
+ const queryFn = ({ signal }) => hostingSshInfo(hostingId, Object.assign({ signal }, axiosOptions));
1313
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1314
+ query.queryKey = queryKey;
1315
+ return query;
1316
+ };
1317
+ /**
1318
+ * Fetches an SSH public (or optionally private) key.
1319
+ * @summary ssh key fetch
1320
+ */
1321
+ export const sshKeyFetch = (hostingId, params, options) => {
1322
+ 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) }));
1323
+ };
1324
+ export const getSshKeyFetchQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/ssh/fetch`, ...(params ? [params] : [])];
1325
+ export const useSshKeyFetch = (hostingId, params, options) => {
1326
+ var _a;
1327
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1328
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyFetchQueryKey(hostingId, params);
1329
+ const queryFn = ({ signal }) => sshKeyFetch(hostingId, params, Object.assign({ signal }, axiosOptions));
1330
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1331
+ query.queryKey = queryKey;
1332
+ return query;
1333
+ };
1334
+ /**
1335
+ * Import public/private ssh key
1336
+ * @summary Import ssh key
1337
+ */
1338
+ export const sshKeyImport = (hostingId, sshKeyImportBody, options) => {
1339
+ return axios.post(`/v1/hosting/${hostingId}/ssh/import`, sshKeyImportBody, options);
1340
+ };
1341
+ export const useSshKeyImport = (options) => {
1342
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1343
+ const mutationFn = (props) => {
1344
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1345
+ return sshKeyImport(hostingId, data, axiosOptions);
1346
+ };
1347
+ return useMutation(mutationFn, mutationOptions);
1348
+ };
1349
+ /**
1350
+ * List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
1351
+ * @deprecated
1352
+ * @summary Deprecated - ssh keys list
1353
+ */
1354
+ export const sshKeyList = (hostingId, options) => {
1355
+ return axios.get(`/v1/hosting/${hostingId}/ssh/keys`, options);
1356
+ };
1357
+ export const getSshKeyListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ssh/keys`];
1358
+ export const useSshKeyList = (hostingId, options) => {
1359
+ var _a;
1360
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1361
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListQueryKey(hostingId);
1362
+ const queryFn = ({ signal }) => sshKeyList(hostingId, Object.assign({ signal }, axiosOptions));
1363
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1364
+ query.queryKey = queryKey;
1365
+ return query;
1366
+ };
1367
+ /**
1368
+ * Deletes an SSH key
1369
+ * @summary ssh key delete
1370
+ */
1371
+ export const sshKey = (hostingId, sshKeyBody, options) => {
1372
+ return axios.delete(`/v1/hosting/${hostingId}/ssh/keys`, Object.assign({ data: sshKeyBody }, options));
1373
+ };
1374
+ export const useSshKey = (options) => {
1375
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1376
+ const mutationFn = (props) => {
1377
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1378
+ return sshKey(hostingId, data, axiosOptions);
1379
+ };
1380
+ return useMutation(mutationFn, mutationOptions);
1381
+ };
1382
+ /**
1383
+ * Generates public/private ssh keys
1384
+ * @summary Generate ssh key
1385
+ */
1386
+ export const sshKeyGenerate = (hostingId, sshKeyGenerateBody, options) => {
1387
+ return axios.post(`/v1/hosting/${hostingId}/ssh/keys`, sshKeyGenerateBody, options);
1388
+ };
1389
+ export const useSshKeyGenerate = (options) => {
1390
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1391
+ const mutationFn = (props) => {
1392
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1393
+ return sshKeyGenerate(hostingId, data, axiosOptions);
1394
+ };
1395
+ return useMutation(mutationFn, mutationOptions);
1396
+ };
1397
+ /**
1398
+ * 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.
1399
+ * @summary sso
1400
+ */
1401
+ export const sso = (hostingId, params, options) => {
1402
+ 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) }));
1403
+ };
1404
+ export const getSsoQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/sso`, ...(params ? [params] : [])];
1405
+ export const useSso = (hostingId, params, options) => {
1406
+ var _a;
1407
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1408
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSsoQueryKey(hostingId, params);
1409
+ const queryFn = ({ signal }) => sso(hostingId, params, Object.assign({ signal }, axiosOptions));
1410
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1411
+ query.queryKey = queryKey;
1412
+ return query;
1413
+ };
1414
+ /**
1415
+ * Returns site list.
1416
+ * @summary Site list for an account
1417
+ */
1418
+ export const sitesList = (options) => {
1419
+ return axios.get(`/v1/sites`, options);
1420
+ };
1421
+ export const getSitesListQueryKey = () => [`/v1/sites`];
1422
+ export const useSitesList = (options) => {
1423
+ var _a;
1424
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1425
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListQueryKey();
1426
+ const queryFn = ({ signal }) => sitesList(Object.assign({ signal }, axiosOptions));
1427
+ const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
1428
+ query.queryKey = queryKey;
1429
+ return query;
1430
+ };
1431
+ /**
1432
+ * Returns site information.
1433
+ * @summary info
1434
+ */
1435
+ export const sitesInfo = (siteId, options) => {
1436
+ return axios.get(`/v1/sites/${siteId}`, options);
1437
+ };
1438
+ export const getSitesInfoQueryKey = (siteId) => [`/v1/sites/${siteId}`];
1439
+ export const useSitesInfo = (siteId, options) => {
1440
+ var _a;
1441
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1442
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesInfoQueryKey(siteId);
1443
+ const queryFn = ({ signal }) => sitesInfo(siteId, Object.assign({ signal }, axiosOptions));
1444
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1445
+ query.queryKey = queryKey;
1446
+ return query;
1447
+ };
1448
+ /**
1449
+ * Allows for updating a site's attributes
1450
+ * @summary site update
1451
+ */
1452
+ export const siteUpdate = (siteId, siteUpdateBody, options) => {
1453
+ return axios.put(`/v1/sites/${siteId}`, siteUpdateBody, options);
1454
+ };
1455
+ export const useSiteUpdate = (options) => {
1456
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1457
+ const mutationFn = (props) => {
1458
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1459
+ return siteUpdate(siteId, data, axiosOptions);
1460
+ };
1461
+ return useMutation(mutationFn, mutationOptions);
1462
+ };
1463
+ /**
1464
+ * Allows deleting a site
1465
+ * @summary site delete
1466
+ */
1467
+ export const site = (siteId, options) => {
1468
+ return axios.delete(`/v1/sites/${siteId}`, options);
1469
+ };
1470
+ export const useSite = (options) => {
1471
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1472
+ const mutationFn = (props) => {
1473
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1474
+ return site(siteId, axiosOptions);
1475
+ };
1476
+ return useMutation(mutationFn, mutationOptions);
1477
+ };
1478
+ /**
1479
+ * Returns the autoupdate status of the site's core, themes, and plugins
1480
+ * @summary settings autoupdates
1481
+ */
1482
+ export const sitesAutoupdatesInfo = (siteId, options) => {
1483
+ return axios.get(`/v1/sites/${siteId}/autoupdates`, options);
1484
+ };
1485
+ export const getSitesAutoupdatesInfoQueryKey = (siteId) => [`/v1/sites/${siteId}/autoupdates`];
1486
+ export const useSitesAutoupdatesInfo = (siteId, options) => {
1487
+ var _a;
1488
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1489
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAutoupdatesInfoQueryKey(siteId);
1490
+ const queryFn = ({ signal }) => sitesAutoupdatesInfo(siteId, Object.assign({ signal }, axiosOptions));
1491
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1492
+ query.queryKey = queryKey;
1493
+ return query;
1494
+ };
1495
+ /**
1496
+ * Enable / disable core, themes, or plugins autoupdates
1497
+ * @summary settings autoupdates toggle
1498
+ */
1499
+ export const sitesAutoupdatesUpdate = (siteId, sitesAutoupdatesUpdateBody, options) => {
1500
+ return axios.put(`/v1/sites/${siteId}/autoupdates`, sitesAutoupdatesUpdateBody, options);
1501
+ };
1502
+ export const useSitesAutoupdatesUpdate = (options) => {
1503
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1504
+ const mutationFn = (props) => {
1505
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1506
+ return sitesAutoupdatesUpdate(siteId, data, axiosOptions);
1507
+ };
1508
+ return useMutation(mutationFn, mutationOptions);
1509
+ };
1510
+ /**
1511
+ * Returns whether the site has either Codeguard or Jetpack-backup.
1512
+ * @deprecated
1513
+ * @summary Deprecated - has backup
1514
+ */
1515
+ export const sitesBackups = (siteId, options) => {
1516
+ return axios.get(`/v1/sites/${siteId}/backups`, options);
1517
+ };
1518
+ export const getSitesBackupsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups`];
1519
+ export const useSitesBackups = (siteId, options) => {
1520
+ var _a;
1521
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1522
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsQueryKey(siteId);
1523
+ const queryFn = ({ signal }) => sitesBackups(siteId, Object.assign({ signal }, axiosOptions));
1524
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1525
+ query.queryKey = queryKey;
1526
+ return query;
1527
+ };
1528
+ /**
1529
+ * Returns whether the site has either Codeguard or Jetpack-backup.
1530
+ * @summary has backups
1531
+ */
1532
+ export const sitesHasBackups = (siteId, options) => {
1533
+ return axios.get(`/v1/sites/${siteId}/backups/check`, options);
1534
+ };
1535
+ export const getSitesHasBackupsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/check`];
1536
+ export const useSitesHasBackups = (siteId, options) => {
1537
+ var _a;
1538
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1539
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesHasBackupsQueryKey(siteId);
1540
+ const queryFn = ({ signal }) => sitesHasBackups(siteId, Object.assign({ signal }, axiosOptions));
1541
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1542
+ query.queryKey = queryKey;
1543
+ return query;
1544
+ };
1545
+ /**
1546
+ * Adds the site to the codeguard
1547
+ * @summary Add additional sites to codeguard
1548
+ */
1549
+ export const sitesBackupsCodeguard = (siteId, options) => {
1550
+ return axios.post(`/v1/sites/${siteId}/backups/codeguard`, undefined, options);
1551
+ };
1552
+ export const useSitesBackupsCodeguard = (options) => {
1553
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1554
+ const mutationFn = (props) => {
1555
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1556
+ return sitesBackupsCodeguard(siteId, axiosOptions);
1557
+ };
1558
+ return useMutation(mutationFn, mutationOptions);
1559
+ };
1560
+ /**
1561
+ * 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.
1562
+ * @summary site backup details
1563
+ */
1564
+ export const sitesBackupsDetails = (siteId, options) => {
1565
+ return axios.get(`/v1/sites/${siteId}/backups/details`, options);
1566
+ };
1567
+ export const getSitesBackupsDetailsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/details`];
1568
+ export const useSitesBackupsDetails = (siteId, options) => {
1569
+ var _a;
1570
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1571
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsDetailsQueryKey(siteId);
1572
+ const queryFn = ({ signal }) => sitesBackupsDetails(siteId, Object.assign({ signal }, axiosOptions));
1573
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1574
+ query.queryKey = queryKey;
1575
+ return query;
1576
+ };
1577
+ /**
1578
+ * The products supported jetpack-backup addon and jetpack-backup plugin
1579
+ * @summary Returns the status of the jetpack-backup product
1580
+ */
1581
+ export const jetpackBackupStatus = (siteId, options) => {
1582
+ return axios.get(`/v1/sites/${siteId}/backups/jetpack`, options);
1583
+ };
1584
+ export const getJetpackBackupStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/jetpack`];
1585
+ export const useJetpackBackupStatus = (siteId, options) => {
1586
+ var _a;
1587
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1588
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getJetpackBackupStatusQueryKey(siteId);
1589
+ const queryFn = ({ signal }) => jetpackBackupStatus(siteId, Object.assign({ signal }, axiosOptions));
1590
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1591
+ query.queryKey = queryKey;
1592
+ return query;
1593
+ };
1594
+ /**
1595
+ * Toggles the pending_upgrade meta of the provided jetpackbackup HAL addon
1596
+ * @summary Toggles the pending_upgrade meta of the provided jetpackbackup HAL addon
1597
+ */
1598
+ export const backupsJetpackBackup = (siteId, options) => {
1599
+ return axios.put(`/v1/sites/${siteId}/backups/jetpack`, undefined, options);
1600
+ };
1601
+ export const useBackupsJetpackBackup = (options) => {
1602
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1603
+ const mutationFn = (props) => {
1604
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1605
+ return backupsJetpackBackup(siteId, axiosOptions);
1606
+ };
1607
+ return useMutation(mutationFn, mutationOptions);
1608
+ };
1609
+ /**
1610
+ * Creates cloudflare basic addon using site_id
1611
+ * @summary Install cloudflare basic addon using site_id
1612
+ */
1613
+ export const siteAddonCloudflare = (siteId, options) => {
1614
+ return axios.post(`/v1/sites/${siteId}/cloudflare`, undefined, options);
1615
+ };
1616
+ export const useSiteAddonCloudflare = (options) => {
1617
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1618
+ const mutationFn = (props) => {
1619
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1620
+ return siteAddonCloudflare(siteId, axiosOptions);
1621
+ };
1622
+ return useMutation(mutationFn, mutationOptions);
1623
+ };
1624
+ /**
1625
+ * Get info about site database
1626
+ * @summary site - database info
1627
+ */
1628
+ export const sitesDatabaseInfo = (siteId, options) => {
1629
+ return axios.get(`/v1/sites/${siteId}/database`, options);
1630
+ };
1631
+ export const getSitesDatabaseInfoQueryKey = (siteId) => [`/v1/sites/${siteId}/database`];
1632
+ export const useSitesDatabaseInfo = (siteId, options) => {
1633
+ var _a;
1634
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1635
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDatabaseInfoQueryKey(siteId);
1636
+ const queryFn = ({ signal }) => sitesDatabaseInfo(siteId, Object.assign({ signal }, axiosOptions));
1637
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1638
+ query.queryKey = queryKey;
1639
+ return query;
1640
+ };
1641
+ /**
1642
+ * Resync database password with whats in wp-config
1643
+ * @summary site - database - password sync
1644
+ */
1645
+ export const sitesDatabasePasswordsync = (siteId, options) => {
1646
+ return axios.post(`/v1/sites/${siteId}/database/password-sync`, undefined, options);
1647
+ };
1648
+ export const useSitesDatabasePasswordsync = (options) => {
1649
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1650
+ const mutationFn = (props) => {
1651
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1652
+ return sitesDatabasePasswordsync(siteId, axiosOptions);
1653
+ };
1654
+ return useMutation(mutationFn, mutationOptions);
1655
+ };
1656
+ /**
1657
+ * Returns a list of DNS records for the site's domain.
1658
+ * @summary dns
1659
+ */
1660
+ export const sitesDns = (siteId, params, options) => {
1661
+ 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) }));
1662
+ };
1663
+ export const getSitesDnsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/dns`, ...(params ? [params] : [])];
1664
+ export const useSitesDns = (siteId, params, options) => {
1665
+ var _a;
1666
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1667
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDnsQueryKey(siteId, params);
1668
+ const queryFn = ({ signal }) => sitesDns(siteId, params, Object.assign({ signal }, axiosOptions));
1669
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1670
+ query.queryKey = queryKey;
1671
+ return query;
1672
+ };
1673
+ /**
1674
+ * Determines if the domain has the correct DNS setup for site
1675
+ * @summary Domain DNS setup for site
1676
+ */
1677
+ export const sitesDomain = (siteId, params, options) => {
1678
+ 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) }));
1679
+ };
1680
+ export const getSitesDomainQueryKey = (siteId, params) => [`/v1/sites/${siteId}/domain`, ...(params ? [params] : [])];
1681
+ export const useSitesDomain = (siteId, params, options) => {
1682
+ var _a;
1683
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1684
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainQueryKey(siteId, params);
1685
+ const queryFn = ({ signal }) => sitesDomain(siteId, params, Object.assign({ signal }, axiosOptions));
1686
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1687
+ query.queryKey = queryKey;
1688
+ return query;
1689
+ };
1690
+ /**
1691
+ * Add or promote pending site url
1692
+ * @summary Add pending site url
1693
+ */
1694
+ export const sitesDomainUrl = (siteId, sitesDomainUrlBody, options) => {
1695
+ return axios.post(`/v1/sites/${siteId}/domain`, sitesDomainUrlBody, options);
1696
+ };
1697
+ export const useSitesDomainUrl = (options) => {
1698
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1699
+ const mutationFn = (props) => {
1700
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1701
+ return sitesDomainUrl(siteId, data, axiosOptions);
1702
+ };
1703
+ return useMutation(mutationFn, mutationOptions);
1704
+ };
1705
+ /**
1706
+ * Add the domain
1707
+ * @summary Add domain for the site
1708
+ */
1709
+ export const sitesDomainsCreate = (siteId, sitesDomainsCreateBody, options) => {
1710
+ return axios.post(`/v1/sites/${siteId}/domains`, sitesDomainsCreateBody, options);
1711
+ };
1712
+ export const useSitesDomainsCreate = (options) => {
1713
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1714
+ const mutationFn = (props) => {
1715
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1716
+ return sitesDomainsCreate(siteId, data, axiosOptions);
1717
+ };
1718
+ return useMutation(mutationFn, mutationOptions);
1719
+ };
1720
+ /**
1721
+ * Returns site access logs.
1722
+ * @summary Site access logs
1723
+ */
1724
+ export const sitesAccessLogs = (siteId, params, options) => {
1725
+ 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) }));
1726
+ };
1727
+ export const getSitesAccessLogsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/logs/access`, ...(params ? [params] : [])];
1728
+ export const useSitesAccessLogsInfinite = (siteId, params, options) => {
1729
+ var _a;
1730
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1731
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
1732
+ const queryFn = ({ pageParam }) => sitesAccessLogs(siteId, Object.assign({ page_id: pageParam }, params), axiosOptions);
1733
+ const query = useInfiniteQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1734
+ query.queryKey = queryKey;
1735
+ return query;
1736
+ };
1737
+ export const useSitesAccessLogs = (siteId, params, options) => {
1738
+ var _a;
1739
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1740
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
1741
+ const queryFn = () => sitesAccessLogs(siteId, params, axiosOptions);
1742
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1743
+ query.queryKey = queryKey;
1744
+ return query;
1745
+ };
1746
+ /**
1747
+ * Returns site access logs.
1748
+ * @summary Site access logs
1749
+ */
1750
+ export const sitesAccessLogsDownload = (siteId, params, options) => {
1751
+ 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) }));
1752
+ };
1753
+ export const getSitesAccessLogsDownloadQueryKey = (siteId, params) => [`/v1/sites/${siteId}/logs/access/download`, ...(params ? [params] : [])];
1754
+ export const useSitesAccessLogsDownload = (siteId, params, options) => {
1755
+ var _a;
1756
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1757
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsDownloadQueryKey(siteId, params);
1758
+ const queryFn = ({ signal }) => sitesAccessLogsDownload(siteId, params, Object.assign({ signal }, axiosOptions));
1759
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1760
+ query.queryKey = queryKey;
1761
+ return query;
1762
+ };
1763
+ /**
1764
+ * Returns site error logs.
1765
+ * @summary Site error logs
1766
+ */
1767
+ export const sitesErrorLogs = (siteId, params, options) => {
1768
+ 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) }));
1769
+ };
1770
+ export const getSitesErrorLogsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/logs/error`, ...(params ? [params] : [])];
1771
+ export const useSitesErrorLogsInfinite = (siteId, params, options) => {
1772
+ var _a;
1773
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1774
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
1775
+ const queryFn = ({ pageParam }) => sitesErrorLogs(siteId, Object.assign({ page_id: pageParam }, params), axiosOptions);
1776
+ const query = useInfiniteQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1777
+ query.queryKey = queryKey;
1778
+ return query;
1779
+ };
1780
+ export const useSitesErrorLogs = (siteId, params, options) => {
1781
+ var _a;
1782
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1783
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
1784
+ const queryFn = () => sitesErrorLogs(siteId, params, axiosOptions);
1785
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1786
+ query.queryKey = queryKey;
1787
+ return query;
1788
+ };
1789
+ /**
1790
+ * Returns site error logs.
1791
+ * @summary Site error logs
1792
+ */
1793
+ export const sitesErrorLogsDownload = (siteId, params, options) => {
1794
+ 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) }));
1795
+ };
1796
+ export const getSitesErrorLogsDownloadQueryKey = (siteId, params) => [`/v1/sites/${siteId}/logs/error/download`, ...(params ? [params] : [])];
1797
+ export const useSitesErrorLogsDownload = (siteId, params, options) => {
1798
+ var _a;
1799
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1800
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsDownloadQueryKey(siteId, params);
1801
+ const queryFn = ({ signal }) => sitesErrorLogsDownload(siteId, params, Object.assign({ signal }, axiosOptions));
1802
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1803
+ query.queryKey = queryKey;
1804
+ return query;
1805
+ };
1806
+ /**
1807
+ * Returns malware status of atomic site
1808
+ * @summary malware status of atomic site
1809
+ */
1810
+ export const siteMalwareStatus = (siteId, options) => {
1811
+ return axios.get(`/v1/sites/${siteId}/malware-status`, options);
1812
+ };
1813
+ export const getSiteMalwareStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/malware-status`];
1814
+ export const useSiteMalwareStatus = (siteId, options) => {
1815
+ var _a;
1816
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1817
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteMalwareStatusQueryKey(siteId);
1818
+ const queryFn = ({ signal }) => siteMalwareStatus(siteId, Object.assign({ signal }, axiosOptions));
1819
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1820
+ query.queryKey = queryKey;
1821
+ return query;
1822
+ };
1823
+ /**
1824
+ * Returns site metrics summary
1825
+ * @summary metrics
1826
+ */
1827
+ export const sitesMetricsDimensionAveraged = (siteId, params, dimension = 'http_host', options) => {
1828
+ 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) }));
1829
+ };
1830
+ export const getSitesMetricsDimensionAveragedQueryKey = (siteId, params, dimension = 'http_host') => [`/v1/sites/${siteId}/metrics/dimension/${dimension}/averaged`, ...(params ? [params] : [])];
1831
+ export const useSitesMetricsDimensionAveraged = (siteId, params, dimension = 'http_host', options) => {
1832
+ var _a;
1833
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1834
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesMetricsDimensionAveragedQueryKey(siteId, params, dimension);
1835
+ const queryFn = ({ signal }) => sitesMetricsDimensionAveraged(siteId, params, dimension, Object.assign({ signal }, axiosOptions));
1836
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId && dimension) }, queryOptions));
1837
+ query.queryKey = queryKey;
1838
+ return query;
1839
+ };
1840
+ /**
1841
+ * Returns site metrics.
1842
+ * @summary metrics
1843
+ */
1844
+ export const sitesMetricDimensions = (siteId, metric, params, options) => {
1845
+ 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) }));
1846
+ };
1847
+ export const getSitesMetricDimensionsQueryKey = (siteId, metric, params) => [`/v1/sites/${siteId}/metrics/${metric}/dimensions`, ...(params ? [params] : [])];
1848
+ export const useSitesMetricDimensions = (siteId, metric, params, options) => {
1849
+ var _a;
1850
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1851
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesMetricDimensionsQueryKey(siteId, metric, params);
1852
+ const queryFn = ({ signal }) => sitesMetricDimensions(siteId, metric, params, Object.assign({ signal }, axiosOptions));
1853
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId && metric) }, queryOptions));
1854
+ query.queryKey = queryKey;
1855
+ return query;
1856
+ };
1857
+ /**
1858
+ * Delete pending domain
1859
+ * @summary Delete pending domain
1860
+ */
1861
+ export const sitePendingDomainDelete = (siteId, options) => {
1862
+ return axios.delete(`/v1/sites/${siteId}/pending-domain`, options);
1863
+ };
1864
+ export const useSitePendingDomainDelete = (options) => {
1865
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1866
+ const mutationFn = (props) => {
1867
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1868
+ return sitePendingDomainDelete(siteId, axiosOptions);
1869
+ };
1870
+ return useMutation(mutationFn, mutationOptions);
1871
+ };
1872
+ /**
1873
+ * cache purge site and url
1874
+ * @summary cache purge url
1875
+ */
1876
+ export const sitesPerformanceCachepurge = (siteId, sitesPerformanceCachepurgeBody, options) => {
1877
+ return axios.post(`/v1/sites/${siteId}/performance/cachepurge`, sitesPerformanceCachepurgeBody, options);
1878
+ };
1879
+ export const useSitesPerformanceCachepurge = (options) => {
1880
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1881
+ const mutationFn = (props) => {
1882
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1883
+ return sitesPerformanceCachepurge(siteId, data, axiosOptions);
1884
+ };
1885
+ return useMutation(mutationFn, mutationOptions);
1886
+ };
1887
+ /**
1888
+ * Update the edge cache
1889
+ * @summary edge cache toggle for atomic site
1890
+ */
1891
+ export const sitesPerformanceEdgecache = (siteId, sitesPerformanceEdgecacheBody, options) => {
1892
+ return axios.put(`/v1/sites/${siteId}/performance/edge_cache`, sitesPerformanceEdgecacheBody, options);
1893
+ };
1894
+ export const useSitesPerformanceEdgecache = (options) => {
1895
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1896
+ const mutationFn = (props) => {
1897
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1898
+ return sitesPerformanceEdgecache(siteId, data, axiosOptions);
1899
+ };
1900
+ return useMutation(mutationFn, mutationOptions);
1901
+ };
1902
+ /**
1903
+ * Returns the status of endurance_cache_level
1904
+ * @summary Get status of endurance cache level
1905
+ */
1906
+ export const sitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
1907
+ return axios.get(`/v1/sites/${siteId}/performance/endurance_cache_level`, options);
1908
+ };
1909
+ export const getSitesPerformanceEnduranceCacheLevelStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/performance/endurance_cache_level`];
1910
+ export const useSitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
1911
+ var _a;
1912
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1913
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesPerformanceEnduranceCacheLevelStatusQueryKey(siteId);
1914
+ const queryFn = ({ signal }) => sitesPerformanceEnduranceCacheLevelStatus(siteId, Object.assign({ signal }, axiosOptions));
1915
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1916
+ query.queryKey = queryKey;
1917
+ return query;
1918
+ };
1919
+ /**
1920
+ * Set endurance cache level to 0, 1,2 or 3
1921
+ * @summary Set endurance cache level
1922
+ */
1923
+ export const sitesPerformanceEnduranceCacheLevel = (siteId, sitesPerformanceEnduranceCacheLevelBody, options) => {
1924
+ return axios.post(`/v1/sites/${siteId}/performance/endurance_cache_level`, sitesPerformanceEnduranceCacheLevelBody, options);
1925
+ };
1926
+ export const useSitesPerformanceEnduranceCacheLevel = (options) => {
1927
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1928
+ const mutationFn = (props) => {
1929
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1930
+ return sitesPerformanceEnduranceCacheLevel(siteId, data, axiosOptions);
1931
+ };
1932
+ return useMutation(mutationFn, mutationOptions);
1933
+ };
1934
+ /**
1935
+ * Update the endurance page cache
1936
+ * @summary update the endurance cache page
1937
+ */
1938
+ export const sitesPerformanceEndurancePageCache = (siteId, options) => {
1939
+ return axios.put(`/v1/sites/${siteId}/performance/endurance_page_cache`, undefined, options);
1940
+ };
1941
+ export const useSitesPerformanceEndurancePageCache = (options) => {
1942
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1943
+ const mutationFn = (props) => {
1944
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1945
+ return sitesPerformanceEndurancePageCache(siteId, axiosOptions);
1946
+ };
1947
+ return useMutation(mutationFn, mutationOptions);
1948
+ };
1949
+ /**
1950
+ * Returns a list of the site's plugins
1951
+ * @summary plugins
1952
+ */
1953
+ export const sitePlugins = (siteId, params, options) => {
1954
+ 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) }));
1955
+ };
1956
+ export const getSitePluginsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/plugins`, ...(params ? [params] : [])];
1957
+ export const useSitePlugins = (siteId, params, options) => {
1958
+ var _a;
1959
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1960
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitePluginsQueryKey(siteId, params);
1961
+ const queryFn = ({ signal }) => sitePlugins(siteId, params, Object.assign({ signal }, axiosOptions));
1962
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1963
+ query.queryKey = queryKey;
1964
+ return query;
1965
+ };
1966
+ /**
1967
+ * Enables / disables a plugin
1968
+ * @summary plugins toggle
1969
+ */
1970
+ export const sitePluginUpdate = (siteId, sitePluginUpdateBody, options) => {
1971
+ return axios.put(`/v1/sites/${siteId}/plugins`, sitePluginUpdateBody, options);
1972
+ };
1973
+ export const useSitePluginUpdate = (options) => {
1974
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1975
+ const mutationFn = (props) => {
1976
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1977
+ return sitePluginUpdate(siteId, data, axiosOptions);
1978
+ };
1979
+ return useMutation(mutationFn, mutationOptions);
1980
+ };
1981
+ /**
1982
+ * Enables / disables plugin auto-updates
1983
+ * @deprecated
1984
+ * @summary plugins autoupdate
1985
+ */
1986
+ export const sitePluginsAutoupdate = (siteId, sitePluginsAutoupdateBody, options) => {
1987
+ return axios.post(`/v1/sites/${siteId}/plugins/autoupdate`, sitePluginsAutoupdateBody, options);
1988
+ };
1989
+ export const useSitePluginsAutoupdate = (options) => {
1990
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1991
+ const mutationFn = (props) => {
1992
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1993
+ return sitePluginsAutoupdate(siteId, data, axiosOptions);
1994
+ };
1995
+ return useMutation(mutationFn, mutationOptions);
1996
+ };
1997
+ /**
1998
+ * Enables / disables a plugin
1999
+ * @deprecated
2000
+ * @summary Deprecated - plugins toggle
2001
+ */
2002
+ export const sitePluginsToggle = (siteId, sitePluginsToggleBody, options) => {
2003
+ return axios.post(`/v1/sites/${siteId}/plugins/toggle`, sitePluginsToggleBody, options);
2004
+ };
2005
+ export const useSitePluginsToggle = (options) => {
2006
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2007
+ const mutationFn = (props) => {
2008
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2009
+ return sitePluginsToggle(siteId, data, axiosOptions);
2010
+ };
2011
+ return useMutation(mutationFn, mutationOptions);
2012
+ };
2013
+ /**
2014
+ * Updates a plugin
2015
+ * @summary plugins update
2016
+ */
2017
+ export const sitePluginsUpdate = (siteId, sitePluginsUpdateBody, options) => {
2018
+ return axios.post(`/v1/sites/${siteId}/plugins/update`, sitePluginsUpdateBody, options);
2019
+ };
2020
+ export const useSitePluginsUpdate = (options) => {
2021
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2022
+ const mutationFn = (props) => {
2023
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2024
+ return sitePluginsUpdate(siteId, data, axiosOptions);
2025
+ };
2026
+ return useMutation(mutationFn, mutationOptions);
2027
+ };
2028
+ /**
2029
+ * Resets a site - deletes/reinstalls the site.
2030
+ * @summary reset site
2031
+ */
2032
+ export const resetSite = (siteId, resetSiteBody, options) => {
2033
+ return axios.post(`/v1/sites/${siteId}/reset`, resetSiteBody, options);
2034
+ };
2035
+ export const useResetSite = (options) => {
2036
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2037
+ const mutationFn = (props) => {
2038
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2039
+ return resetSite(siteId, data, axiosOptions);
2040
+ };
2041
+ return useMutation(mutationFn, mutationOptions);
2042
+ };
2043
+ /**
2044
+ * Performs a checksum of the site's core files to verify integrity.
2045
+ * @summary core files checksum
2046
+ */
2047
+ export const sitesSecurityCheckCore = (siteId, options) => {
2048
+ return axios.get(`/v1/sites/${siteId}/security/core/check`, options);
2049
+ };
2050
+ export const getSitesSecurityCheckCoreQueryKey = (siteId) => [`/v1/sites/${siteId}/security/core/check`];
2051
+ export const useSitesSecurityCheckCore = (siteId, options) => {
2052
+ var _a;
2053
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2054
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityCheckCoreQueryKey(siteId);
2055
+ const queryFn = ({ signal }) => sitesSecurityCheckCore(siteId, Object.assign({ signal }, axiosOptions));
2056
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2057
+ query.queryKey = queryKey;
2058
+ return query;
2059
+ };
2060
+ /**
2061
+ * Resets the site's core files.
2062
+ * @summary core files reset
2063
+ */
2064
+ export const sitesSecurityResetCoreFiles = (siteId, options) => {
2065
+ return axios.post(`/v1/sites/${siteId}/security/core/reset`, undefined, options);
2066
+ };
2067
+ export const useSitesSecurityResetCoreFiles = (options) => {
2068
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2069
+ const mutationFn = (props) => {
2070
+ const { siteId } = props !== null && props !== void 0 ? props : {};
2071
+ return sitesSecurityResetCoreFiles(siteId, axiosOptions);
2072
+ };
2073
+ return useMutation(mutationFn, mutationOptions);
2074
+ };
2075
+ /**
2076
+ * Returns the HTTPS redirection status.
2077
+ * @summary https redirection status
2078
+ */
2079
+ export const sitesSecurityHttpsRedirectionStatus = (siteId, options) => {
2080
+ return axios.get(`/v1/sites/${siteId}/security/https`, options);
2081
+ };
2082
+ export const getSitesSecurityHttpsRedirectionStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/security/https`];
2083
+ export const useSitesSecurityHttpsRedirectionStatus = (siteId, options) => {
2084
+ var _a;
2085
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2086
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityHttpsRedirectionStatusQueryKey(siteId);
2087
+ const queryFn = ({ signal }) => sitesSecurityHttpsRedirectionStatus(siteId, Object.assign({ signal }, axiosOptions));
2088
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2089
+ query.queryKey = queryKey;
2090
+ return query;
2091
+ };
2092
+ /**
2093
+ * Enables / disables HTTPS redirection.
2094
+ * @summary https redirection toggle
2095
+ */
2096
+ export const sitesSecurityHttpsEnableDisableSsl = (siteId, sitesSecurityHttpsEnableDisableSslBody, options) => {
2097
+ return axios.post(`/v1/sites/${siteId}/security/https`, sitesSecurityHttpsEnableDisableSslBody, options);
2098
+ };
2099
+ export const useSitesSecurityHttpsEnableDisableSsl = (options) => {
2100
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2101
+ const mutationFn = (props) => {
2102
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2103
+ return sitesSecurityHttpsEnableDisableSsl(siteId, data, axiosOptions);
2104
+ };
2105
+ return useMutation(mutationFn, mutationOptions);
2106
+ };
2107
+ /**
2108
+ * Returns the site's sitelock information.
2109
+ * @summary sitelock info
2110
+ */
2111
+ export const sitesSecuritySitelock = (siteId, options) => {
2112
+ return axios.get(`/v1/sites/${siteId}/security/sitelock`, options);
2113
+ };
2114
+ export const getSitesSecuritySitelockQueryKey = (siteId) => [`/v1/sites/${siteId}/security/sitelock`];
2115
+ export const useSitesSecuritySitelock = (siteId, options) => {
2116
+ var _a;
2117
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2118
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockQueryKey(siteId);
2119
+ const queryFn = ({ signal }) => sitesSecuritySitelock(siteId, Object.assign({ signal }, axiosOptions));
2120
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2121
+ query.queryKey = queryKey;
2122
+ return query;
2123
+ };
2124
+ /**
2125
+ * Disables / enables cPanel to generate Let's Encrypt SSLs for the site.
2126
+ * @summary ssl lets encrypt toggle
2127
+ */
2128
+ export const sitesSecuritySslAcme = (siteId, options) => {
2129
+ return axios.post(`/v1/sites/${siteId}/security/ssl/acme`, undefined, options);
2130
+ };
2131
+ export const useSitesSecuritySslAcme = (options) => {
2132
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2133
+ const mutationFn = (props) => {
2134
+ const { siteId } = props !== null && props !== void 0 ? props : {};
2135
+ return sitesSecuritySslAcme(siteId, axiosOptions);
2136
+ };
2137
+ return useMutation(mutationFn, mutationOptions);
2138
+ };
2139
+ /**
2140
+ * Returns the site's SSL Status
2141
+ * @deprecated
2142
+ * @summary ssl status
2143
+ */
2144
+ export const sitesSecuritySslStatus = (siteId, options) => {
2145
+ return axios.get(`/v1/sites/${siteId}/security/ssl/status`, options);
2146
+ };
2147
+ export const getSitesSecuritySslStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/security/ssl/status`];
2148
+ export const useSitesSecuritySslStatus = (siteId, options) => {
2149
+ var _a;
2150
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2151
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySslStatusQueryKey(siteId);
2152
+ const queryFn = ({ signal }) => sitesSecuritySslStatus(siteId, Object.assign({ signal }, axiosOptions));
2153
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2154
+ query.queryKey = queryKey;
2155
+ return query;
2156
+ };
2157
+ /**
2158
+ * Returns whether the coming soon setting is enable or disabled
2159
+ * @summary settings coming soon page status
2160
+ */
2161
+ export const sitesSettingsComingSoon = (siteId, options) => {
2162
+ return axios.get(`/v1/sites/${siteId}/settings/coming-soon`, options);
2163
+ };
2164
+ export const getSitesSettingsComingSoonQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/coming-soon`];
2165
+ export const useSitesSettingsComingSoon = (siteId, options) => {
2166
+ var _a;
2167
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2168
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsComingSoonQueryKey(siteId);
2169
+ const queryFn = ({ signal }) => sitesSettingsComingSoon(siteId, Object.assign({ signal }, axiosOptions));
2170
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2171
+ query.queryKey = queryKey;
2172
+ return query;
2173
+ };
2174
+ /**
2175
+ * Enables/disables the coming soon (under-construction) page
2176
+ * @summary settings coming soon toggle
2177
+ */
2178
+ export const sitesSettingsComingSoonToggle = (siteId, sitesSettingsComingSoonToggleBody, options) => {
2179
+ return axios.post(`/v1/sites/${siteId}/settings/coming-soon`, sitesSettingsComingSoonToggleBody, options);
2180
+ };
2181
+ export const useSitesSettingsComingSoonToggle = (options) => {
2182
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2183
+ const mutationFn = (props) => {
2184
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2185
+ return sitesSettingsComingSoonToggle(siteId, data, axiosOptions);
2186
+ };
2187
+ return useMutation(mutationFn, mutationOptions);
2188
+ };
2189
+ /**
2190
+ * Returns the site's debug mode status
2191
+ * @summary settings debug status
2192
+ */
2193
+ export const sitesSettingsDebug = (siteId, options) => {
2194
+ return axios.get(`/v1/sites/${siteId}/settings/debug`, options);
2195
+ };
2196
+ export const getSitesSettingsDebugQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/debug`];
2197
+ export const useSitesSettingsDebug = (siteId, options) => {
2198
+ var _a;
2199
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2200
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsDebugQueryKey(siteId);
2201
+ const queryFn = ({ signal }) => sitesSettingsDebug(siteId, Object.assign({ signal }, axiosOptions));
2202
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2203
+ query.queryKey = queryKey;
2204
+ return query;
2205
+ };
2206
+ /**
2207
+ * Enables or disables the output and display of site generated errors on the site
2208
+ * @summary settings debug toggle
2209
+ */
2210
+ export const sitesSettingsDebugToggle = (siteId, sitesSettingsDebugToggleBody, options) => {
2211
+ return axios.post(`/v1/sites/${siteId}/settings/debug`, sitesSettingsDebugToggleBody, options);
2212
+ };
2213
+ export const useSitesSettingsDebugToggle = (options) => {
2214
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2215
+ const mutationFn = (props) => {
2216
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2217
+ return sitesSettingsDebugToggle(siteId, data, axiosOptions);
2218
+ };
2219
+ return useMutation(mutationFn, mutationOptions);
2220
+ };
2221
+ /**
2222
+ * Updates the site's PHP version
2223
+ * @summary settings php version update
2224
+ */
2225
+ export const sitesSettingsPhpVersionUpdate = (siteId, sitesSettingsPhpVersionUpdateBody, options) => {
2226
+ return axios.post(`/v1/sites/${siteId}/settings/php-version`, sitesSettingsPhpVersionUpdateBody, options);
2227
+ };
2228
+ export const useSitesSettingsPhpVersionUpdate = (options) => {
2229
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2230
+ const mutationFn = (props) => {
2231
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2232
+ return sitesSettingsPhpVersionUpdate(siteId, data, axiosOptions);
2233
+ };
2234
+ return useMutation(mutationFn, mutationOptions);
2235
+ };
2236
+ /**
2237
+ * Gets the list of PHP versions available/installed
2238
+ * @summary settings php versions list
2239
+ */
2240
+ export const sitesSettingsPhpVersions = (siteId, options) => {
2241
+ return axios.get(`/v1/sites/${siteId}/settings/php-versions`, options);
2242
+ };
2243
+ export const getSitesSettingsPhpVersionsQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/php-versions`];
2244
+ export const useSitesSettingsPhpVersions = (siteId, options) => {
2245
+ var _a;
2246
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2247
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsPhpVersionsQueryKey(siteId);
2248
+ const queryFn = ({ signal }) => sitesSettingsPhpVersions(siteId, Object.assign({ signal }, axiosOptions));
2249
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2250
+ query.queryKey = queryKey;
2251
+ return query;
2252
+ };
2253
+ /**
2254
+ * List ssh users
2255
+ * @deprecated
2256
+ * @summary site - ssh - list users
2257
+ */
2258
+ export const sitesSshUserList = (siteId, options) => {
2259
+ return axios.get(`/v1/sites/${siteId}/ssh-users`, options);
2260
+ };
2261
+ export const getSitesSshUserListQueryKey = (siteId) => [`/v1/sites/${siteId}/ssh-users`];
2262
+ export const useSitesSshUserList = (siteId, options) => {
2263
+ var _a;
2264
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2265
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSshUserListQueryKey(siteId);
2266
+ const queryFn = ({ signal }) => sitesSshUserList(siteId, Object.assign({ signal }, axiosOptions));
2267
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2268
+ query.queryKey = queryKey;
2269
+ return query;
2270
+ };
2271
+ /**
2272
+ * Create ssh user
2273
+ * @summary site - ssh - create user
2274
+ */
2275
+ export const sitesSshUserCreate = (siteId, sitesSshUserCreateBody, options) => {
2276
+ return axios.post(`/v1/sites/${siteId}/ssh-users`, sitesSshUserCreateBody, options);
2277
+ };
2278
+ export const useSitesSshUserCreate = (options) => {
2279
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2280
+ const mutationFn = (props) => {
2281
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2282
+ return sitesSshUserCreate(siteId, data, axiosOptions);
2283
+ };
2284
+ return useMutation(mutationFn, mutationOptions);
2285
+ };
2286
+ /**
2287
+ * delete ssh user
2288
+ * @summary site - ssh - delete user
2289
+ */
2290
+ export const sitesSshUserDelete = (siteId, sitesSshUserDeleteBody, options) => {
2291
+ return axios.delete(`/v1/sites/${siteId}/ssh-users`, Object.assign({ data: sitesSshUserDeleteBody }, options));
2292
+ };
2293
+ export const useSitesSshUserDelete = (options) => {
2294
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2295
+ const mutationFn = (props) => {
2296
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2297
+ return sitesSshUserDelete(siteId, data, axiosOptions);
2298
+ };
2299
+ return useMutation(mutationFn, mutationOptions);
2300
+ };
2301
+ /**
2302
+ * update ssh user
2303
+ * @summary site - ssh - update user
2304
+ */
2305
+ export const sitesSshUserUpdate = (siteId, sitesSshUserUpdateBody, options) => {
2306
+ return axios.put(`/v1/sites/${siteId}/ssh-users`, sitesSshUserUpdateBody, options);
2307
+ };
2308
+ export const useSitesSshUserUpdate = (options) => {
2309
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2310
+ const mutationFn = (props) => {
2311
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
2312
+ return sitesSshUserUpdate(siteId, data, axiosOptions);
2313
+ };
2314
+ return useMutation(mutationFn, mutationOptions);
2315
+ };
2316
+ /**
2317
+ * Returns information about the site domain's SSL/TLS certificate
2318
+ * @summary Site domain SSL cert info
2319
+ */
2320
+ export const sitesSsl = (siteId, options) => {
2321
+ return axios.get(`/v1/sites/${siteId}/ssl`, options);
2322
+ };
2323
+ export const getSitesSslQueryKey = (siteId) => [`/v1/sites/${siteId}/ssl`];
2324
+ export const useSitesSsl = (siteId, options) => {
2325
+ var _a;
2326
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2327
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSslQueryKey(siteId);
2328
+ const queryFn = ({ signal }) => sitesSsl(siteId, Object.assign({ signal }, axiosOptions));
2329
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2330
+ query.queryKey = queryKey;
2331
+ return query;
2332
+ };
2333
+ /**
2334
+ * Returns an SSO token or login URL for the site (if supported).
2335
+ * @summary sso
2336
+ */
2337
+ export const sitesSso = (siteId, params, options) => {
2338
+ 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) }));
2339
+ };
2340
+ export const getSitesSsoQueryKey = (siteId, params) => [`/v1/sites/${siteId}/sso`, ...(params ? [params] : [])];
2341
+ export const useSitesSso = (siteId, params, options) => {
2342
+ var _a;
2343
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2344
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSsoQueryKey(siteId, params);
2345
+ const queryFn = ({ signal }) => sitesSso(siteId, params, Object.assign({ signal }, axiosOptions));
2346
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2347
+ query.queryKey = queryKey;
2348
+ return query;
2349
+ };
2350
+ /**
2351
+ * @summary site status
2352
+ */
2353
+ export const siteStatus = (siteId, options) => {
2354
+ return axios.get(`/v1/sites/${siteId}/status`, options);
2355
+ };
2356
+ export const getSiteStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/status`];
2357
+ export const useSiteStatus = (siteId, options) => {
2358
+ var _a;
2359
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2360
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteStatusQueryKey(siteId);
2361
+ const queryFn = ({ signal }) => siteStatus(siteId, Object.assign({ signal }, axiosOptions));
2362
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2363
+ query.queryKey = queryKey;
2364
+ return query;
2365
+ };
2366
+ /**
2367
+ * Returns a list of the site's users
2368
+ * @summary users
2369
+ */
2370
+ export const siteUsers = (siteId, options) => {
2371
+ return axios.get(`/v1/sites/${siteId}/users`, options);
2372
+ };
2373
+ export const getSiteUsersQueryKey = (siteId) => [`/v1/sites/${siteId}/users`];
2374
+ export const useSiteUsers = (siteId, options) => {
2375
+ var _a;
2376
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2377
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteUsersQueryKey(siteId);
2378
+ const queryFn = ({ signal }) => siteUsers(siteId, Object.assign({ signal }, axiosOptions));
2379
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2380
+ query.queryKey = queryKey;
2381
+ return query;
2382
+ };
2383
+ /**
2384
+ * Returns site version information.
2385
+ * @summary version
2386
+ */
2387
+ export const sitesVersion = (siteId, options) => {
2388
+ return axios.get(`/v1/sites/${siteId}/version`, options);
2389
+ };
2390
+ export const getSitesVersionQueryKey = (siteId) => [`/v1/sites/${siteId}/version`];
2391
+ export const useSitesVersion = (siteId, options) => {
2392
+ var _a;
2393
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2394
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesVersionQueryKey(siteId);
2395
+ const queryFn = ({ signal }) => sitesVersion(siteId, Object.assign({ signal }, axiosOptions));
2396
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2397
+ query.queryKey = queryKey;
2398
+ return query;
2399
+ };
2400
+ /**
2401
+ * Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
2402
+ * @summary sso
2403
+ */
2404
+ export const addonsSitelockSsoV2 = (addonId, params, options) => {
2405
+ 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) }));
2406
+ };
2407
+ export const getAddonsSitelockSsoV2QueryKey = (addonId, params) => [`/v2/addons/sitelock/${addonId}/sso`, ...(params ? [params] : [])];
2408
+ export const useAddonsSitelockSsoV2 = (addonId, params, options) => {
2409
+ var _a;
2410
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2411
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSitelockSsoV2QueryKey(addonId, params);
2412
+ const queryFn = ({ signal }) => addonsSitelockSsoV2(addonId, params, Object.assign({ signal }, axiosOptions));
2413
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
2414
+ query.queryKey = queryKey;
2415
+ return query;
2416
+ };
2417
+ /**
2418
+ * Returns the hosting server nameservers information
2419
+ * @summary hosting server nameservers info
2420
+ */
2421
+ export const hostingNameserversV2 = (hostingId, options) => {
2422
+ return axios.get(`/v2/hosting/${hostingId}/nameservers`, options);
2423
+ };
2424
+ export const getHostingNameserversV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/nameservers`];
2425
+ export const useHostingNameserversV2 = (hostingId, options) => {
2426
+ var _a;
2427
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2428
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversV2QueryKey(hostingId);
2429
+ const queryFn = ({ signal }) => hostingNameserversV2(hostingId, Object.assign({ signal }, axiosOptions));
2430
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
2431
+ query.queryKey = queryKey;
2432
+ return query;
2433
+ };
2434
+ /**
2435
+ * Returns a list of sites.
2436
+ * @summary sites list v2
2437
+ */
2438
+ export const hostingSitesV2 = (hostingId, options) => {
2439
+ return axios.get(`/v2/hosting/${hostingId}/sites`, options);
2440
+ };
2441
+ export const getHostingSitesV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/sites`];
2442
+ export const useHostingSitesV2 = (hostingId, options) => {
2443
+ var _a;
2444
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2445
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSitesV2QueryKey(hostingId);
2446
+ const queryFn = ({ signal }) => hostingSitesV2(hostingId, Object.assign({ signal }, axiosOptions));
2447
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
2448
+ query.queryKey = queryKey;
2449
+ return query;
2450
+ };
2451
+ /**
2452
+ * List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
2453
+ * @summary ssh keys list
2454
+ */
2455
+ export const sshKeyListV2 = (hostingId, options) => {
2456
+ return axios.get(`/v2/hosting/${hostingId}/ssh/keys`, options);
2457
+ };
2458
+ export const getSshKeyListV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/ssh/keys`];
2459
+ export const useSshKeyListV2 = (hostingId, options) => {
2460
+ var _a;
2461
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2462
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListV2QueryKey(hostingId);
2463
+ const queryFn = ({ signal }) => sshKeyListV2(hostingId, Object.assign({ signal }, axiosOptions));
2464
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
2465
+ query.queryKey = queryKey;
2466
+ return query;
2467
+ };
2468
+ /**
2469
+ * Returns site list.
2470
+ * @summary Site list for an account v2
2471
+ */
2472
+ export const sitesListV2 = (options) => {
2473
+ return axios.get(`/v2/sites`, options);
2474
+ };
2475
+ export const getSitesListV2QueryKey = () => [`/v2/sites`];
2476
+ export const useSitesListV2 = (options) => {
2477
+ var _a;
2478
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2479
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListV2QueryKey();
2480
+ const queryFn = ({ signal }) => sitesListV2(Object.assign({ signal }, axiosOptions));
2481
+ const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
2482
+ query.queryKey = queryKey;
2483
+ return query;
2484
+ };
2485
+ /**
2486
+ * Provides the domains list associated with the site
2487
+ * @summary Domains list for the site
2488
+ */
2489
+ export const sitesDomainsV2 = (siteId, params, options) => {
2490
+ 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) }));
2491
+ };
2492
+ export const getSitesDomainsV2QueryKey = (siteId, params) => [`/v2/sites/${siteId}/domains`, ...(params ? [params] : [])];
2493
+ export const useSitesDomainsV2 = (siteId, params, options) => {
2494
+ var _a;
2495
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2496
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainsV2QueryKey(siteId, params);
2497
+ const queryFn = ({ signal }) => sitesDomainsV2(siteId, params, Object.assign({ signal }, axiosOptions));
2498
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2499
+ query.queryKey = queryKey;
2500
+ return query;
2501
+ };
2502
+ /**
2503
+ * Returns the site's sitelock information.
2504
+ * @summary sitelock info
2505
+ */
2506
+ export const sitesSecuritySitelockV2 = (siteId, params, options) => {
2507
+ 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) }));
2508
+ };
2509
+ export const getSitesSecuritySitelockV2QueryKey = (siteId, params) => [`/v2/sites/${siteId}/security/sitelock`, ...(params ? [params] : [])];
2510
+ export const useSitesSecuritySitelockV2 = (siteId, params, options) => {
2511
+ var _a;
2512
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2513
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockV2QueryKey(siteId, params);
2514
+ const queryFn = ({ signal }) => sitesSecuritySitelockV2(siteId, params, Object.assign({ signal }, axiosOptions));
2515
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2516
+ query.queryKey = queryKey;
2517
+ return query;
2518
+ };
2519
+ /**
2520
+ * List ssh users V2
2521
+ * @summary site - ssh - list users v2
2522
+ */
2523
+ export const sitesSshUserListV2 = (siteId, options) => {
2524
+ return axios.get(`/v2/sites/${siteId}/ssh-users`, options);
2525
+ };
2526
+ export const getSitesSshUserListV2QueryKey = (siteId) => [`/v2/sites/${siteId}/ssh-users`];
2527
+ export const useSitesSshUserListV2 = (siteId, options) => {
2528
+ var _a;
2529
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2530
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSshUserListV2QueryKey(siteId);
2531
+ const queryFn = ({ signal }) => sitesSshUserListV2(siteId, Object.assign({ signal }, axiosOptions));
2532
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
2533
+ query.queryKey = queryKey;
2534
+ return query;
2535
+ };
2536
+ /**
2537
+ * Returns site list.
2538
+ * @summary Site list for an account v3
2539
+ */
2540
+ export const sitesListV3 = (options) => {
2541
+ return axios.get(`/v3/sites`, options);
2542
+ };
2543
+ export const getSitesListV3QueryKey = () => [`/v3/sites`];
2544
+ export const useSitesListV3 = (options) => {
2545
+ var _a;
2546
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
2547
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListV3QueryKey();
2548
+ const queryFn = ({ signal }) => sitesListV3(Object.assign({ signal }, axiosOptions));
2549
+ const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
2550
+ query.queryKey = queryKey;
2551
+ return query;
2552
+ };