@newfold/huapi-js 1.515.0 → 1.516.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,1833 @@
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.516.0
7
+ */
8
+ import axios from 'axios';
9
+ import { useQuery, useMutation } from '@tanstack/react-query';
10
+ /**
11
+ * Returns a combined backup list with website commit ids and corresponding database commits
12
+ * @summary backup list
13
+ */
14
+ export const codeguardBackupList = (addonId, params, options) => {
15
+ 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) }));
16
+ };
17
+ export const getCodeguardBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/backups`, ...(params ? [params] : [])];
18
+ export const useCodeguardBackupList = (addonId, 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 : getCodeguardBackupListQueryKey(addonId, params);
22
+ const queryFn = ({ signal }) => codeguardBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
23
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
24
+ query.queryKey = queryKey;
25
+ return query;
26
+ };
27
+ /**
28
+ * Creates the website backup
29
+ * @summary backup create
30
+ */
31
+ export const codeguardBackupCreate = (addonId, codeguardBackupCreateBody, options) => {
32
+ return axios.post(`/v1/addons/codeguard/${addonId}/backups`, codeguardBackupCreateBody, options);
33
+ };
34
+ export const useCodeguardBackupCreate = (options) => {
35
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
36
+ const mutationFn = (props) => {
37
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
38
+ return codeguardBackupCreate(addonId, data, axiosOptions);
39
+ };
40
+ return useMutation(mutationFn, mutationOptions);
41
+ };
42
+ /**
43
+ * Queues the backup download.
44
+ * @summary backup download
45
+ */
46
+ export const codeguardBackupDownload = (addonId, codeguardBackupDownloadBody, options) => {
47
+ return axios.post(`/v1/addons/codeguard/${addonId}/backups/download`, codeguardBackupDownloadBody, options);
48
+ };
49
+ export const useCodeguardBackupDownload = (options) => {
50
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
51
+ const mutationFn = (props) => {
52
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
53
+ return codeguardBackupDownload(addonId, data, axiosOptions);
54
+ };
55
+ return useMutation(mutationFn, mutationOptions);
56
+ };
57
+ /**
58
+ * Restores a website and database backup
59
+ * @summary backups restore
60
+ */
61
+ export const codeguardBackupRestore = (addonId, codeguardBackupRestoreBody, options) => {
62
+ return axios.post(`/v1/addons/codeguard/${addonId}/backups/restore`, codeguardBackupRestoreBody, options);
63
+ };
64
+ export const useCodeguardBackupRestore = (options) => {
65
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
66
+ const mutationFn = (props) => {
67
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
68
+ return codeguardBackupRestore(addonId, data, axiosOptions);
69
+ };
70
+ return useMutation(mutationFn, mutationOptions);
71
+ };
72
+ /**
73
+ * Returns all database records CodeGuard maintains for this user's account.
74
+ * @summary database list
75
+ */
76
+ export const codeguardDatabaseList = (addonId, options) => {
77
+ return axios.get(`/v1/addons/codeguard/${addonId}/databases`, options);
78
+ };
79
+ export const getCodeguardDatabaseListQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/databases`];
80
+ export const useCodeguardDatabaseList = (addonId, options) => {
81
+ var _a;
82
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
83
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseListQueryKey(addonId);
84
+ const queryFn = ({ signal }) => codeguardDatabaseList(addonId, Object.assign({ signal }, axiosOptions));
85
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
86
+ query.queryKey = queryKey;
87
+ return query;
88
+ };
89
+ /**
90
+ * Returns all database backup records CodeGuard maintains for this user's account.
91
+ * @summary database backup list
92
+ */
93
+ export const codeguardDatabaseBackupList = (addonId, params, options) => {
94
+ 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) }));
95
+ };
96
+ export const getCodeguardDatabaseBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/databases/backups`, ...(params ? [params] : [])];
97
+ export const useCodeguardDatabaseBackupList = (addonId, params, options) => {
98
+ var _a;
99
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
100
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseBackupListQueryKey(addonId, params);
101
+ const queryFn = ({ signal }) => codeguardDatabaseBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
102
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
103
+ query.queryKey = queryKey;
104
+ return query;
105
+ };
106
+ /**
107
+ * Queue the creation of a database backup.
108
+ * @summary database backup create
109
+ */
110
+ export const codeguardDatabaseBackupCreate = (addonId, codeguardDatabaseBackupCreateBody, options) => {
111
+ return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups`, codeguardDatabaseBackupCreateBody, options);
112
+ };
113
+ export const useCodeguardDatabaseBackupCreate = (options) => {
114
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
115
+ const mutationFn = (props) => {
116
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
117
+ return codeguardDatabaseBackupCreate(addonId, data, axiosOptions);
118
+ };
119
+ return useMutation(mutationFn, mutationOptions);
120
+ };
121
+ /**
122
+ * Restores a database backup
123
+ * @summary database backup restore
124
+ */
125
+ export const codeguardDatabaseBackupRestore = (addonId, codeguardDatabaseBackupRestoreBody, options) => {
126
+ return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups/restore`, codeguardDatabaseBackupRestoreBody, options);
127
+ };
128
+ export const useCodeguardDatabaseBackupRestore = (options) => {
129
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
130
+ const mutationFn = (props) => {
131
+ const { addonId, data } = props !== null && props !== void 0 ? props : {};
132
+ return codeguardDatabaseBackupRestore(addonId, data, axiosOptions);
133
+ };
134
+ return useMutation(mutationFn, mutationOptions);
135
+ };
136
+ /**
137
+ * Returns an oauth login URL that can be used to access CodeGuard dashboard for a user.
138
+ * @summary login link
139
+ */
140
+ export const codeguardLoginLink = (addonId, options) => {
141
+ return axios.get(`/v1/addons/codeguard/${addonId}/login`, options);
142
+ };
143
+ export const getCodeguardLoginLinkQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/login`];
144
+ export const useCodeguardLoginLink = (addonId, options) => {
145
+ var _a;
146
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
147
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardLoginLinkQueryKey(addonId);
148
+ const queryFn = ({ signal }) => codeguardLoginLink(addonId, Object.assign({ signal }, axiosOptions));
149
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
150
+ query.queryKey = queryKey;
151
+ return query;
152
+ };
153
+ /**
154
+ * Returns the subscribed plan and usage info
155
+ * @summary plan info
156
+ */
157
+ export const codeguardPlanInfo = (addonId, options) => {
158
+ return axios.get(`/v1/addons/codeguard/${addonId}/plan`, options);
159
+ };
160
+ export const getCodeguardPlanInfoQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/plan`];
161
+ export const useCodeguardPlanInfo = (addonId, options) => {
162
+ var _a;
163
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
164
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardPlanInfoQueryKey(addonId);
165
+ const queryFn = ({ signal }) => codeguardPlanInfo(addonId, Object.assign({ signal }, axiosOptions));
166
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
167
+ query.queryKey = queryKey;
168
+ return query;
169
+ };
170
+ /**
171
+ * Returns all website records CodeGuard maintains for this user's account.
172
+ * @summary website list
173
+ */
174
+ export const codeguardWebsiteList = (addonId, options) => {
175
+ return axios.get(`/v1/addons/codeguard/${addonId}/websites`, options);
176
+ };
177
+ export const getCodeguardWebsiteListQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/websites`];
178
+ export const useCodeguardWebsiteList = (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 : getCodeguardWebsiteListQueryKey(addonId);
182
+ const queryFn = ({ signal }) => codeguardWebsiteList(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 website backup records CodeGuard maintains for this user's account.
189
+ * @summary website backup list
190
+ */
191
+ export const codeguardWebsiteBackupList = (addonId, params, options) => {
192
+ 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) }));
193
+ };
194
+ export const getCodeguardWebsiteBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/websites/backups`, ...(params ? [params] : [])];
195
+ export const useCodeguardWebsiteBackupList = (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 : getCodeguardWebsiteBackupListQueryKey(addonId, params);
199
+ const queryFn = ({ signal }) => codeguardWebsiteBackupList(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
+ * Initiate the creation of a new backup for a given website
206
+ * @summary website backup create
207
+ */
208
+ export const codeguardWebsiteBackupCreate = (addonId, codeguardWebsiteBackupCreateBody, options) => {
209
+ return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups`, codeguardWebsiteBackupCreateBody, options);
210
+ };
211
+ export const useCodeguardWebsiteBackupCreate = (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 codeguardWebsiteBackupCreate(addonId, data, axiosOptions);
216
+ };
217
+ return useMutation(mutationFn, mutationOptions);
218
+ };
219
+ /**
220
+ * Restores a website backup
221
+ * @summary website backup restore
222
+ */
223
+ export const codeguardWebsiteBackupRestore = (addonId, codeguardWebsiteBackupRestoreBody, options) => {
224
+ return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups/restore`, codeguardWebsiteBackupRestoreBody, options);
225
+ };
226
+ export const useCodeguardWebsiteBackupRestore = (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 codeguardWebsiteBackupRestore(addonId, data, axiosOptions);
231
+ };
232
+ return useMutation(mutationFn, mutationOptions);
233
+ };
234
+ /**
235
+ * Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
236
+ * @summary sso
237
+ */
238
+ export const addonsSitelockSso = (addonId, options) => {
239
+ return axios.get(`/v1/addons/sitelock/${addonId}/sso`, options);
240
+ };
241
+ export const getAddonsSitelockSsoQueryKey = (addonId) => [`/v1/addons/sitelock/${addonId}/sso`];
242
+ export const useAddonsSitelockSso = (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 : getAddonsSitelockSsoQueryKey(addonId);
246
+ const queryFn = ({ signal }) => addonsSitelockSso(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
+ * Decom and delete cloudflare basic addon
253
+ * @summary Uninstall cloudflare basic addon
254
+ */
255
+ export const addonsCloudflare = (addonId, options) => {
256
+ return axios.delete(`/v1/addons/${addonId}/cloudflare`, options);
257
+ };
258
+ export const useAddonsCloudflare = (options) => {
259
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
260
+ const mutationFn = (props) => {
261
+ const { addonId } = props !== null && props !== void 0 ? props : {};
262
+ return addonsCloudflare(addonId, axiosOptions);
263
+ };
264
+ return useMutation(mutationFn, mutationOptions);
265
+ };
266
+ /**
267
+ * Returns addon information
268
+ * @summary info
269
+ */
270
+ export const addonsInfo = (addonId, options) => {
271
+ return axios.get(`/v1/addons/${addonId}/info`, options);
272
+ };
273
+ export const getAddonsInfoQueryKey = (addonId) => [`/v1/addons/${addonId}/info`];
274
+ export const useAddonsInfo = (addonId, options) => {
275
+ var _a;
276
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
277
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsInfoQueryKey(addonId);
278
+ const queryFn = ({ signal }) => addonsInfo(addonId, Object.assign({ signal }, axiosOptions));
279
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
280
+ query.queryKey = queryKey;
281
+ return query;
282
+ };
283
+ /**
284
+ * Returns spamexperts sso url
285
+ * @summary info
286
+ */
287
+ export const addonsSpamexpertsSso = (addonId, options) => {
288
+ return axios.get(`/v1/addons/${addonId}/spamexperts/sso`, options);
289
+ };
290
+ export const getAddonsSpamexpertsSsoQueryKey = (addonId) => [`/v1/addons/${addonId}/spamexperts/sso`];
291
+ export const useAddonsSpamexpertsSso = (addonId, options) => {
292
+ var _a;
293
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
294
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSpamexpertsSsoQueryKey(addonId);
295
+ const queryFn = ({ signal }) => addonsSpamexpertsSso(addonId, Object.assign({ signal }, axiosOptions));
296
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
297
+ query.queryKey = queryKey;
298
+ return query;
299
+ };
300
+ /**
301
+ * Returns HAL hosting account-level information
302
+ * @summary HAL Hosting Account Info
303
+ */
304
+ export const hostingAccount = (hostingId, options) => {
305
+ return axios.get(`/v1/hosting/${hostingId}`, options);
306
+ };
307
+ export const getHostingAccountQueryKey = (hostingId) => [`/v1/hosting/${hostingId}`];
308
+ export const useHostingAccount = (hostingId, options) => {
309
+ var _a;
310
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
311
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAccountQueryKey(hostingId);
312
+ const queryFn = ({ signal }) => hostingAccount(hostingId, Object.assign({ signal }, axiosOptions));
313
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
314
+ query.queryKey = queryKey;
315
+ return query;
316
+ };
317
+ /**
318
+ * Returns a list of addons.
319
+ * @summary addon list
320
+ */
321
+ export const hostingAddons = (hostingId, params, options) => {
322
+ 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) }));
323
+ };
324
+ export const getHostingAddonsQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/addons`, ...(params ? [params] : [])];
325
+ export const useHostingAddons = (hostingId, params, options) => {
326
+ var _a;
327
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
328
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAddonsQueryKey(hostingId, params);
329
+ const queryFn = ({ signal }) => hostingAddons(hostingId, params, Object.assign({ signal }, axiosOptions));
330
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
331
+ query.queryKey = queryKey;
332
+ return query;
333
+ };
334
+ /**
335
+ * Returns the hosting server info
336
+ * @summary server status/info
337
+ */
338
+ export const hostingAdvancedServer = (hostingId, options) => {
339
+ return axios.get(`/v1/hosting/${hostingId}/advanced/server`, options);
340
+ };
341
+ export const getHostingAdvancedServerQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/server`];
342
+ export const useHostingAdvancedServer = (hostingId, options) => {
343
+ var _a;
344
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
345
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedServerQueryKey(hostingId);
346
+ const queryFn = ({ signal }) => hostingAdvancedServer(hostingId, Object.assign({ signal }, axiosOptions));
347
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
348
+ query.queryKey = queryKey;
349
+ return query;
350
+ };
351
+ /**
352
+ * Allows for managing server status
353
+ * @summary server_status
354
+ */
355
+ export const hostingAdvancedServerStatus = (hostingId, hostingAdvancedServerStatusBody, options) => {
356
+ return axios.put(`/v1/hosting/${hostingId}/advanced/server`, hostingAdvancedServerStatusBody, options);
357
+ };
358
+ export const useHostingAdvancedServerStatus = (options) => {
359
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
360
+ const mutationFn = (props) => {
361
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
362
+ return hostingAdvancedServerStatus(hostingId, data, axiosOptions);
363
+ };
364
+ return useMutation(mutationFn, mutationOptions);
365
+ };
366
+ /**
367
+ * Update user account's password
368
+ * @summary Update user account password
369
+ */
370
+ export const hostingAdvancedPassword = (hostingId, hostingAdvancedPasswordBody, options) => {
371
+ return axios.put(`/v1/hosting/${hostingId}/advanced/server/password`, hostingAdvancedPasswordBody, options);
372
+ };
373
+ export const useHostingAdvancedPassword = (options) => {
374
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
375
+ const mutationFn = (props) => {
376
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
377
+ return hostingAdvancedPassword(hostingId, data, axiosOptions);
378
+ };
379
+ return useMutation(mutationFn, mutationOptions);
380
+ };
381
+ /**
382
+ * Returns the hosting sso_whm login url
383
+ * @summary hosting sso_whm
384
+ */
385
+ export const hostingAdvancedSsoWhm = (hostingId, options) => {
386
+ return axios.get(`/v1/hosting/${hostingId}/advanced/sso_whm`, options);
387
+ };
388
+ export const getHostingAdvancedSsoWhmQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/sso_whm`];
389
+ export const useHostingAdvancedSsoWhm = (hostingId, 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 : getHostingAdvancedSsoWhmQueryKey(hostingId);
393
+ const queryFn = ({ signal }) => hostingAdvancedSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
394
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
395
+ query.queryKey = queryKey;
396
+ return query;
397
+ };
398
+ /**
399
+ * Returns the hosting system_console url
400
+ * @summary hosting system_console
401
+ */
402
+ export const hostingAdvancedSystemConsole = (hostingId, options) => {
403
+ return axios.get(`/v1/hosting/${hostingId}/advanced/system-console`, options);
404
+ };
405
+ export const getHostingAdvancedSystemConsoleQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/system-console`];
406
+ export const useHostingAdvancedSystemConsole = (hostingId, options) => {
407
+ var _a;
408
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
409
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSystemConsoleQueryKey(hostingId);
410
+ const queryFn = ({ signal }) => hostingAdvancedSystemConsole(hostingId, Object.assign({ signal }, axiosOptions));
411
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
412
+ query.queryKey = queryKey;
413
+ return query;
414
+ };
415
+ /**
416
+ * Returns the hosting capabilities
417
+ * @summary hosting capabilities
418
+ */
419
+ export const hostingCapabilities = (hostingId, options) => {
420
+ return axios.get(`/v1/hosting/${hostingId}/capabilities`, options);
421
+ };
422
+ export const getHostingCapabilitiesQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/capabilities`];
423
+ export const useHostingCapabilities = (hostingId, options) => {
424
+ var _a;
425
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
426
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingCapabilitiesQueryKey(hostingId);
427
+ const queryFn = ({ signal }) => hostingCapabilities(hostingId, Object.assign({ signal }, axiosOptions));
428
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
429
+ query.queryKey = queryKey;
430
+ return query;
431
+ };
432
+ /**
433
+ * Creates cloudflare basic addon
434
+ * @summary Install cloudflare basic addon
435
+ */
436
+ export const addonCloudflare = (hostingId, addonCloudflareBody, options) => {
437
+ return axios.post(`/v1/hosting/${hostingId}/cloudflare`, addonCloudflareBody, options);
438
+ };
439
+ export const useAddonCloudflare = (options) => {
440
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
441
+ const mutationFn = (props) => {
442
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
443
+ return addonCloudflare(hostingId, data, axiosOptions);
444
+ };
445
+ return useMutation(mutationFn, mutationOptions);
446
+ };
447
+ /**
448
+ * Returns a list of cron jobs
449
+ * @summary cron_list
450
+ */
451
+ export const listCrons = (hostingId, options) => {
452
+ return axios.get(`/v1/hosting/${hostingId}/crontab`, options);
453
+ };
454
+ export const getListCronsQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/crontab`];
455
+ export const useListCrons = (hostingId, 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 : getListCronsQueryKey(hostingId);
459
+ const queryFn = ({ signal }) => listCrons(hostingId, Object.assign({ signal }, axiosOptions));
460
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
461
+ query.queryKey = queryKey;
462
+ return query;
463
+ };
464
+ /**
465
+ * Adds a new cron job
466
+ * @summary cron_add
467
+ */
468
+ export const addCron = (hostingId, addCronBody, options) => {
469
+ return axios.post(`/v1/hosting/${hostingId}/crontab`, addCronBody, options);
470
+ };
471
+ export const useAddCron = (options) => {
472
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
473
+ const mutationFn = (props) => {
474
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
475
+ return addCron(hostingId, data, axiosOptions);
476
+ };
477
+ return useMutation(mutationFn, mutationOptions);
478
+ };
479
+ /**
480
+ * Updates a cron job
481
+ * @summary cron_update
482
+ */
483
+ export const updateCron = (hostingId, updateCronBody, options) => {
484
+ return axios.put(`/v1/hosting/${hostingId}/crontab`, updateCronBody, options);
485
+ };
486
+ export const useUpdateCron = (options) => {
487
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
488
+ const mutationFn = (props) => {
489
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
490
+ return updateCron(hostingId, data, axiosOptions);
491
+ };
492
+ return useMutation(mutationFn, mutationOptions);
493
+ };
494
+ /**
495
+ * Deletes a cron job
496
+ * @summary cron_delete
497
+ */
498
+ export const cron = (hostingId, cronBody, options) => {
499
+ return axios.delete(`/v1/hosting/${hostingId}/crontab`, Object.assign({ data: cronBody }, options));
500
+ };
501
+ export const useCron = (options) => {
502
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
503
+ const mutationFn = (props) => {
504
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
505
+ return cron(hostingId, data, axiosOptions);
506
+ };
507
+ return useMutation(mutationFn, mutationOptions);
508
+ };
509
+ /**
510
+ * Add a new db to an account
511
+ * @summary Create a database for an account
512
+ */
513
+ export const dbAdd = (hostingId, dbAddBody, options) => {
514
+ return axios.post(`/v1/hosting/${hostingId}/db`, dbAddBody, options);
515
+ };
516
+ export const useDbAdd = (options) => {
517
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
518
+ const mutationFn = (props) => {
519
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
520
+ return dbAdd(hostingId, data, axiosOptions);
521
+ };
522
+ return useMutation(mutationFn, mutationOptions);
523
+ };
524
+ /**
525
+ * Delete db account
526
+ * @summary Delete db account
527
+ */
528
+ export const db = (hostingId, dbBody, options) => {
529
+ return axios.delete(`/v1/hosting/${hostingId}/db`, Object.assign({ data: dbBody }, options));
530
+ };
531
+ export const useDb = (options) => {
532
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
533
+ const mutationFn = (props) => {
534
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
535
+ return db(hostingId, data, axiosOptions);
536
+ };
537
+ return useMutation(mutationFn, mutationOptions);
538
+ };
539
+ /**
540
+ * List all DB name
541
+ * @summary Get list of database name
542
+ */
543
+ export const dbList = (hostingId, options) => {
544
+ return axios.get(`/v1/hosting/${hostingId}/db`, options);
545
+ };
546
+ export const getDbListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db`];
547
+ export const useDbList = (hostingId, options) => {
548
+ var _a;
549
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
550
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbListQueryKey(hostingId);
551
+ const queryFn = ({ signal }) => dbList(hostingId, Object.assign({ signal }, axiosOptions));
552
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
553
+ query.queryKey = queryKey;
554
+ return query;
555
+ };
556
+ /**
557
+ * Get user privileges on a database.
558
+ * @summary Get user privileges on a database.
559
+ */
560
+ export const dbUserPrivsGet = (hostingId, params, options) => {
561
+ 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) }));
562
+ };
563
+ export const getDbUserPrivsGetQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/db/user/privileges`, ...(params ? [params] : [])];
564
+ export const useDbUserPrivsGet = (hostingId, params, options) => {
565
+ var _a;
566
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
567
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserPrivsGetQueryKey(hostingId, params);
568
+ const queryFn = ({ signal }) => dbUserPrivsGet(hostingId, params, Object.assign({ signal }, axiosOptions));
569
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
570
+ query.queryKey = queryKey;
571
+ return query;
572
+ };
573
+ /**
574
+ * Creates a database user. The final username cannot exceed 16 characters, and will have the cpanel account username's first eight characters prepended to it.
575
+ * @summary Create a database user
576
+ */
577
+ export const dbUserAdd = (hostingId, dbUserAddBody, options) => {
578
+ return axios.post(`/v1/hosting/${hostingId}/db/users`, dbUserAddBody, options);
579
+ };
580
+ export const useDbUserAdd = (options) => {
581
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
582
+ const mutationFn = (props) => {
583
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
584
+ return dbUserAdd(hostingId, data, axiosOptions);
585
+ };
586
+ return useMutation(mutationFn, mutationOptions);
587
+ };
588
+ /**
589
+ * Delete db user
590
+ * @summary Delete db user
591
+ */
592
+ export const dbUserDelete = (hostingId, dbUserDeleteBody, options) => {
593
+ return axios.delete(`/v1/hosting/${hostingId}/db/users`, Object.assign({ data: dbUserDeleteBody }, options));
594
+ };
595
+ export const useDbUserDelete = (options) => {
596
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
597
+ const mutationFn = (props) => {
598
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
599
+ return dbUserDelete(hostingId, data, axiosOptions);
600
+ };
601
+ return useMutation(mutationFn, mutationOptions);
602
+ };
603
+ /**
604
+ * List all DB users
605
+ * @summary Get list of db users
606
+ */
607
+ export const dbUserList = (hostingId, options) => {
608
+ return axios.get(`/v1/hosting/${hostingId}/db/users`, options);
609
+ };
610
+ export const getDbUserListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db/users`];
611
+ export const useDbUserList = (hostingId, options) => {
612
+ var _a;
613
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
614
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserListQueryKey(hostingId);
615
+ const queryFn = ({ signal }) => dbUserList(hostingId, Object.assign({ signal }, axiosOptions));
616
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
617
+ query.queryKey = queryKey;
618
+ return query;
619
+ };
620
+ /**
621
+ * Returns a list of domains
622
+ * @summary domain list
623
+ */
624
+ export const domains = (hostingId, params, options) => {
625
+ 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) }));
626
+ };
627
+ export const getDomainsQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/domains`, ...(params ? [params] : [])];
628
+ export const useDomains = (hostingId, params, options) => {
629
+ var _a;
630
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
631
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainsQueryKey(hostingId, params);
632
+ const queryFn = ({ signal }) => domains(hostingId, params, Object.assign({ signal }, axiosOptions));
633
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
634
+ query.queryKey = queryKey;
635
+ return query;
636
+ };
637
+ /**
638
+ * Returns info about an existing ecommerce addon otherwise it returns null
639
+ * @summary ecommerce info
640
+ */
641
+ export const hostingEcommerceInfo = (hostingId, options) => {
642
+ return axios.get(`/v1/hosting/${hostingId}/ecommerce`, options);
643
+ };
644
+ export const getHostingEcommerceInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ecommerce`];
645
+ export const useHostingEcommerceInfo = (hostingId, options) => {
646
+ var _a;
647
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
648
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingEcommerceInfoQueryKey(hostingId);
649
+ const queryFn = ({ signal }) => hostingEcommerceInfo(hostingId, Object.assign({ signal }, axiosOptions));
650
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
651
+ query.queryKey = queryKey;
652
+ return query;
653
+ };
654
+ /**
655
+ * Returns a list of FTP accounts.
656
+ * @summary ftp list
657
+ */
658
+ export const hostingFtpList = (hostingId, options) => {
659
+ return axios.get(`/v1/hosting/${hostingId}/ftp`, options);
660
+ };
661
+ export const getHostingFtpListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ftp`];
662
+ export const useHostingFtpList = (hostingId, options) => {
663
+ var _a;
664
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
665
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingFtpListQueryKey(hostingId);
666
+ const queryFn = ({ signal }) => hostingFtpList(hostingId, Object.assign({ signal }, axiosOptions));
667
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
668
+ query.queryKey = queryKey;
669
+ return query;
670
+ };
671
+ /**
672
+ * Add ftp account
673
+ * @summary Add ftp account
674
+ */
675
+ export const hostingFtpAdd = (hostingId, hostingFtpAddBody, options) => {
676
+ return axios.post(`/v1/hosting/${hostingId}/ftp`, hostingFtpAddBody, options);
677
+ };
678
+ export const useHostingFtpAdd = (options) => {
679
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
680
+ const mutationFn = (props) => {
681
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
682
+ return hostingFtpAdd(hostingId, data, axiosOptions);
683
+ };
684
+ return useMutation(mutationFn, mutationOptions);
685
+ };
686
+ /**
687
+ * Update ftp account
688
+ * @summary Update ftp account
689
+ */
690
+ export const hostingFtpUpdate = (hostingId, hostingFtpUpdateBody, options) => {
691
+ return axios.put(`/v1/hosting/${hostingId}/ftp`, hostingFtpUpdateBody, options);
692
+ };
693
+ export const useHostingFtpUpdate = (options) => {
694
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
695
+ const mutationFn = (props) => {
696
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
697
+ return hostingFtpUpdate(hostingId, data, axiosOptions);
698
+ };
699
+ return useMutation(mutationFn, mutationOptions);
700
+ };
701
+ /**
702
+ * Delete ftp account
703
+ * @summary Delete ftp account
704
+ */
705
+ export const hostingFtp = (hostingId, hostingFtpBody, options) => {
706
+ return axios.delete(`/v1/hosting/${hostingId}/ftp`, Object.assign({ data: hostingFtpBody }, options));
707
+ };
708
+ export const useHostingFtp = (options) => {
709
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
710
+ const mutationFn = (props) => {
711
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
712
+ return hostingFtp(hostingId, data, axiosOptions);
713
+ };
714
+ return useMutation(mutationFn, mutationOptions);
715
+ };
716
+ /**
717
+ * Returns hosting account info
718
+ * @summary Hosting info
719
+ */
720
+ export const hostingInfo = (hostingId, options) => {
721
+ return axios.get(`/v1/hosting/${hostingId}/info`, options);
722
+ };
723
+ export const getHostingInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info`];
724
+ export const useHostingInfo = (hostingId, options) => {
725
+ var _a;
726
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
727
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoQueryKey(hostingId);
728
+ const queryFn = ({ signal }) => hostingInfo(hostingId, Object.assign({ signal }, axiosOptions));
729
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
730
+ query.queryKey = queryKey;
731
+ return query;
732
+ };
733
+ /**
734
+ * Returns the hosting account's disk usage
735
+ * @summary info disk usage
736
+ */
737
+ export const hostingInfoDiskUsage = (hostingId, options) => {
738
+ return axios.get(`/v1/hosting/${hostingId}/info/diskusage`, options);
739
+ };
740
+ export const getHostingInfoDiskUsageQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info/diskusage`];
741
+ export const useHostingInfoDiskUsage = (hostingId, options) => {
742
+ var _a;
743
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
744
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoDiskUsageQueryKey(hostingId);
745
+ const queryFn = ({ signal }) => hostingInfoDiskUsage(hostingId, Object.assign({ signal }, axiosOptions));
746
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
747
+ query.queryKey = queryKey;
748
+ return query;
749
+ };
750
+ /**
751
+ * Returns lead info for the user of the hosting account
752
+ * @summary Lead info
753
+ */
754
+ export const hostingLead = (hostingId, params, options) => {
755
+ 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) }));
756
+ };
757
+ export const useHostingLead = (options) => {
758
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
759
+ const mutationFn = (props) => {
760
+ const { hostingId, params } = props !== null && props !== void 0 ? props : {};
761
+ return hostingLead(hostingId, params, axiosOptions);
762
+ };
763
+ return useMutation(mutationFn, mutationOptions);
764
+ };
765
+ /**
766
+ * Gets the Wordpress migration status
767
+ * @summary Wordpress migration status
768
+ */
769
+ export const hostingMigrationStatus = (hostingId, options) => {
770
+ return axios.get(`/v1/hosting/${hostingId}/migrations`, options);
771
+ };
772
+ export const getHostingMigrationStatusQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/migrations`];
773
+ export const useHostingMigrationStatus = (hostingId, options) => {
774
+ var _a;
775
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
776
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationStatusQueryKey(hostingId);
777
+ const queryFn = ({ signal }) => hostingMigrationStatus(hostingId, Object.assign({ signal }, axiosOptions));
778
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
779
+ query.queryKey = queryKey;
780
+ return query;
781
+ };
782
+ /**
783
+ * Adds the wordpressmigrate addon for a given migration id and hosting account
784
+ * @summary start the migration process for a site
785
+ */
786
+ export const hostingMigrations = (hostingId, hostingMigrationsBody, options) => {
787
+ return axios.post(`/v1/hosting/${hostingId}/migrations`, hostingMigrationsBody, options);
788
+ };
789
+ export const useHostingMigrations = (options) => {
790
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
791
+ const mutationFn = (props) => {
792
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
793
+ return hostingMigrations(hostingId, data, axiosOptions);
794
+ };
795
+ return useMutation(mutationFn, mutationOptions);
796
+ };
797
+ /**
798
+ * Post migration event to CWM
799
+ * @summary hosting migrations event
800
+ */
801
+ export const hostingMigrationsEvent = (hostingId, hostingMigrationsEventBody, options) => {
802
+ return axios.post(`/v1/hosting/${hostingId}/migrations/event`, hostingMigrationsEventBody, options);
803
+ };
804
+ export const useHostingMigrationsEvent = (options) => {
805
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
806
+ const mutationFn = (props) => {
807
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
808
+ return hostingMigrationsEvent(hostingId, data, axiosOptions);
809
+ };
810
+ return useMutation(mutationFn, mutationOptions);
811
+ };
812
+ /**
813
+ * Gets the Wordpress migration information
814
+ * @summary Wordpress migration information
815
+ */
816
+ export const hostingMigrationInfo = (hostingId, params, options) => {
817
+ 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) }));
818
+ };
819
+ export const getHostingMigrationInfoQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/info`, ...(params ? [params] : [])];
820
+ export const useHostingMigrationInfo = (hostingId, params, options) => {
821
+ var _a;
822
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
823
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationInfoQueryKey(hostingId, params);
824
+ const queryFn = ({ signal }) => hostingMigrationInfo(hostingId, params, Object.assign({ signal }, axiosOptions));
825
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
826
+ query.queryKey = queryKey;
827
+ return query;
828
+ };
829
+ /**
830
+ * Provides the status of SiteMigration site_scan and deeplink to WordPress admin page
831
+ * @summary SiteMigration site_scan status
832
+ */
833
+ export const hostingMigrationSiteScanStatus = (hostingId, params, options) => {
834
+ 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) }));
835
+ };
836
+ export const getHostingMigrationSiteScanStatusQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/site-scan`, ...(params ? [params] : [])];
837
+ export const useHostingMigrationSiteScanStatus = (hostingId, params, options) => {
838
+ var _a;
839
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
840
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationSiteScanStatusQueryKey(hostingId, params);
841
+ const queryFn = ({ signal }) => hostingMigrationSiteScanStatus(hostingId, params, Object.assign({ signal }, axiosOptions));
842
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
843
+ query.queryKey = queryKey;
844
+ return query;
845
+ };
846
+ /**
847
+ * Returns the hosting brand nameservers
848
+ * @summary hosting nameservers
849
+ */
850
+ export const hostingNameservers = (hostingId, options) => {
851
+ return axios.get(`/v1/hosting/${hostingId}/nameservers`, options);
852
+ };
853
+ export const getHostingNameserversQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/nameservers`];
854
+ export const useHostingNameservers = (hostingId, options) => {
855
+ var _a;
856
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
857
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversQueryKey(hostingId);
858
+ const queryFn = ({ signal }) => hostingNameservers(hostingId, Object.assign({ signal }, axiosOptions));
859
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
860
+ query.queryKey = queryKey;
861
+ return query;
862
+ };
863
+ /**
864
+ * Returns onboarding data
865
+ * @summary Returns hosting onboarding data
866
+ */
867
+ export const hostingOnboardingData = (hostingId, options) => {
868
+ return axios.get(`/v1/hosting/${hostingId}/onboarding`, options);
869
+ };
870
+ export const getHostingOnboardingDataQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/onboarding`];
871
+ export const useHostingOnboardingData = (hostingId, options) => {
872
+ var _a;
873
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
874
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingOnboardingDataQueryKey(hostingId);
875
+ const queryFn = ({ signal }) => hostingOnboardingData(hostingId, Object.assign({ signal }, axiosOptions));
876
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
877
+ query.queryKey = queryKey;
878
+ return query;
879
+ };
880
+ /**
881
+ * @summary Updates hosting onboarding data
882
+ */
883
+ export const hostingOnboardingDataUpdate = (hostingId, hostingOnboardingDataUpdateBody, options) => {
884
+ return axios.put(`/v1/hosting/${hostingId}/onboarding`, hostingOnboardingDataUpdateBody, options);
885
+ };
886
+ export const useHostingOnboardingDataUpdate = (options) => {
887
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
888
+ const mutationFn = (props) => {
889
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
890
+ return hostingOnboardingDataUpdate(hostingId, data, axiosOptions);
891
+ };
892
+ return useMutation(mutationFn, mutationOptions);
893
+ };
894
+ /**
895
+ * Enable or disable shell access on an account by setting the shell.SSH key access must be established separately.
896
+ * @summary hosting shell toggle
897
+ */
898
+ export const hostingShellToggle = (hostingId, hostingShellToggleBody, options) => {
899
+ return axios.put(`/v1/hosting/${hostingId}/shell`, hostingShellToggleBody, options);
900
+ };
901
+ export const useHostingShellToggle = (options) => {
902
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
903
+ const mutationFn = (props) => {
904
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
905
+ return hostingShellToggle(hostingId, data, axiosOptions);
906
+ };
907
+ return useMutation(mutationFn, mutationOptions);
908
+ };
909
+ /**
910
+ * Determine shell access status for an account.
911
+ * @summary hosting shell_status
912
+ */
913
+ export const hostingShellInfo = (hostingId, options) => {
914
+ return axios.get(`/v1/hosting/${hostingId}/shell`, options);
915
+ };
916
+ export const getHostingShellInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/shell`];
917
+ export const useHostingShellInfo = (hostingId, options) => {
918
+ var _a;
919
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
920
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingShellInfoQueryKey(hostingId);
921
+ const queryFn = ({ signal }) => hostingShellInfo(hostingId, Object.assign({ signal }, axiosOptions));
922
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
923
+ query.queryKey = queryKey;
924
+ return query;
925
+ };
926
+ /**
927
+ * Returns a list of sites.
928
+ * @summary sites list
929
+ */
930
+ export const hostingSites = (hostingId, options) => {
931
+ return axios.get(`/v1/hosting/${hostingId}/sites`, options);
932
+ };
933
+ export const getHostingSitesQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/sites`];
934
+ export const useHostingSites = (hostingId, options) => {
935
+ var _a;
936
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
937
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSitesQueryKey(hostingId);
938
+ const queryFn = ({ signal }) => hostingSites(hostingId, Object.assign({ signal }, axiosOptions));
939
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
940
+ query.queryKey = queryKey;
941
+ return query;
942
+ };
943
+ /**
944
+ * Add a site to the current hosting.
945
+ * @summary sites add
946
+ */
947
+ export const hostingSiteAdd = (hostingId, hostingSiteAddBody, options) => {
948
+ return axios.post(`/v1/hosting/${hostingId}/sites`, hostingSiteAddBody, options);
949
+ };
950
+ export const useHostingSiteAdd = (options) => {
951
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
952
+ const mutationFn = (props) => {
953
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
954
+ return hostingSiteAdd(hostingId, data, axiosOptions);
955
+ };
956
+ return useMutation(mutationFn, mutationOptions);
957
+ };
958
+ /**
959
+ * Returns the hosting account's SSH information
960
+ * @summary ssh info
961
+ */
962
+ export const hostingSshInfo = (hostingId, options) => {
963
+ return axios.get(`/v1/hosting/${hostingId}/ssh`, options);
964
+ };
965
+ export const getHostingSshInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ssh`];
966
+ export const useHostingSshInfo = (hostingId, options) => {
967
+ var _a;
968
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
969
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSshInfoQueryKey(hostingId);
970
+ const queryFn = ({ signal }) => hostingSshInfo(hostingId, Object.assign({ signal }, axiosOptions));
971
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
972
+ query.queryKey = queryKey;
973
+ return query;
974
+ };
975
+ /**
976
+ * Fetches an SSH public (or optionally private) key.
977
+ * @summary ssh key fetch
978
+ */
979
+ export const sshKeyFetch = (hostingId, params, options) => {
980
+ 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) }));
981
+ };
982
+ export const getSshKeyFetchQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/ssh/fetch`, ...(params ? [params] : [])];
983
+ export const useSshKeyFetch = (hostingId, params, options) => {
984
+ var _a;
985
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
986
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyFetchQueryKey(hostingId, params);
987
+ const queryFn = ({ signal }) => sshKeyFetch(hostingId, params, Object.assign({ signal }, axiosOptions));
988
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
989
+ query.queryKey = queryKey;
990
+ return query;
991
+ };
992
+ /**
993
+ * Import public/private ssh key
994
+ * @summary Import ssh key
995
+ */
996
+ export const sshKeyImport = (hostingId, sshKeyImportBody, options) => {
997
+ return axios.post(`/v1/hosting/${hostingId}/ssh/import`, sshKeyImportBody, options);
998
+ };
999
+ export const useSshKeyImport = (options) => {
1000
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1001
+ const mutationFn = (props) => {
1002
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1003
+ return sshKeyImport(hostingId, data, axiosOptions);
1004
+ };
1005
+ return useMutation(mutationFn, mutationOptions);
1006
+ };
1007
+ /**
1008
+ * List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
1009
+ * @deprecated
1010
+ * @summary Deprecated - ssh keys list
1011
+ */
1012
+ export const sshKeyList = (hostingId, options) => {
1013
+ return axios.get(`/v1/hosting/${hostingId}/ssh/keys`, options);
1014
+ };
1015
+ export const getSshKeyListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ssh/keys`];
1016
+ export const useSshKeyList = (hostingId, options) => {
1017
+ var _a;
1018
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1019
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListQueryKey(hostingId);
1020
+ const queryFn = ({ signal }) => sshKeyList(hostingId, Object.assign({ signal }, axiosOptions));
1021
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1022
+ query.queryKey = queryKey;
1023
+ return query;
1024
+ };
1025
+ /**
1026
+ * Deletes an SSH key
1027
+ * @summary ssh key delete
1028
+ */
1029
+ export const sshKey = (hostingId, sshKeyBody, options) => {
1030
+ return axios.delete(`/v1/hosting/${hostingId}/ssh/keys`, Object.assign({ data: sshKeyBody }, options));
1031
+ };
1032
+ export const useSshKey = (options) => {
1033
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1034
+ const mutationFn = (props) => {
1035
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1036
+ return sshKey(hostingId, data, axiosOptions);
1037
+ };
1038
+ return useMutation(mutationFn, mutationOptions);
1039
+ };
1040
+ /**
1041
+ * Generates public/private ssh keys
1042
+ * @summary Generate ssh key
1043
+ */
1044
+ export const sshKeyGenerate = (hostingId, sshKeyGenerateBody, options) => {
1045
+ return axios.post(`/v1/hosting/${hostingId}/ssh/keys`, sshKeyGenerateBody, options);
1046
+ };
1047
+ export const useSshKeyGenerate = (options) => {
1048
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1049
+ const mutationFn = (props) => {
1050
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
1051
+ return sshKeyGenerate(hostingId, data, axiosOptions);
1052
+ };
1053
+ return useMutation(mutationFn, mutationOptions);
1054
+ };
1055
+ /**
1056
+ * 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.
1057
+ * @summary sso
1058
+ */
1059
+ export const sso = (hostingId, params, options) => {
1060
+ 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) }));
1061
+ };
1062
+ export const getSsoQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/sso`, ...(params ? [params] : [])];
1063
+ export const useSso = (hostingId, params, options) => {
1064
+ var _a;
1065
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1066
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSsoQueryKey(hostingId, params);
1067
+ const queryFn = ({ signal }) => sso(hostingId, params, Object.assign({ signal }, axiosOptions));
1068
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1069
+ query.queryKey = queryKey;
1070
+ return query;
1071
+ };
1072
+ /**
1073
+ * Returns site list.
1074
+ * @summary Site list for an account
1075
+ */
1076
+ export const sitesList = (options) => {
1077
+ return axios.get(`/v1/sites`, options);
1078
+ };
1079
+ export const getSitesListQueryKey = () => [`/v1/sites`];
1080
+ export const useSitesList = (options) => {
1081
+ var _a;
1082
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1083
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListQueryKey();
1084
+ const queryFn = ({ signal }) => sitesList(Object.assign({ signal }, axiosOptions));
1085
+ const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
1086
+ query.queryKey = queryKey;
1087
+ return query;
1088
+ };
1089
+ /**
1090
+ * Returns site information.
1091
+ * @summary info
1092
+ */
1093
+ export const sitesInfo = (siteId, options) => {
1094
+ return axios.get(`/v1/sites/${siteId}`, options);
1095
+ };
1096
+ export const getSitesInfoQueryKey = (siteId) => [`/v1/sites/${siteId}`];
1097
+ export const useSitesInfo = (siteId, options) => {
1098
+ var _a;
1099
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1100
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesInfoQueryKey(siteId);
1101
+ const queryFn = ({ signal }) => sitesInfo(siteId, Object.assign({ signal }, axiosOptions));
1102
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1103
+ query.queryKey = queryKey;
1104
+ return query;
1105
+ };
1106
+ /**
1107
+ * Allows for updating a site's attributes
1108
+ * @summary site update
1109
+ */
1110
+ export const siteUpdate = (siteId, siteUpdateBody, options) => {
1111
+ return axios.put(`/v1/sites/${siteId}`, siteUpdateBody, options);
1112
+ };
1113
+ export const useSiteUpdate = (options) => {
1114
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1115
+ const mutationFn = (props) => {
1116
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1117
+ return siteUpdate(siteId, data, axiosOptions);
1118
+ };
1119
+ return useMutation(mutationFn, mutationOptions);
1120
+ };
1121
+ /**
1122
+ * Allows deleting a site
1123
+ * @summary site delete
1124
+ */
1125
+ export const site = (siteId, options) => {
1126
+ return axios.delete(`/v1/sites/${siteId}`, options);
1127
+ };
1128
+ export const useSite = (options) => {
1129
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1130
+ const mutationFn = (props) => {
1131
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1132
+ return site(siteId, axiosOptions);
1133
+ };
1134
+ return useMutation(mutationFn, mutationOptions);
1135
+ };
1136
+ /**
1137
+ * Returns the autoupdate status of the site's core, themes, and plugins
1138
+ * @summary settings autoupdates
1139
+ */
1140
+ export const sitesAutoupdatesInfo = (siteId, options) => {
1141
+ return axios.get(`/v1/sites/${siteId}/autoupdates`, options);
1142
+ };
1143
+ export const getSitesAutoupdatesInfoQueryKey = (siteId) => [`/v1/sites/${siteId}/autoupdates`];
1144
+ export const useSitesAutoupdatesInfo = (siteId, options) => {
1145
+ var _a;
1146
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1147
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAutoupdatesInfoQueryKey(siteId);
1148
+ const queryFn = ({ signal }) => sitesAutoupdatesInfo(siteId, Object.assign({ signal }, axiosOptions));
1149
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1150
+ query.queryKey = queryKey;
1151
+ return query;
1152
+ };
1153
+ /**
1154
+ * Enable / disable core, themes, or plugins autoupdates
1155
+ * @summary settings autoupdates toggle
1156
+ */
1157
+ export const sitesAutoupdatesUpdate = (siteId, sitesAutoupdatesUpdateBody, options) => {
1158
+ return axios.put(`/v1/sites/${siteId}/autoupdates`, sitesAutoupdatesUpdateBody, options);
1159
+ };
1160
+ export const useSitesAutoupdatesUpdate = (options) => {
1161
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1162
+ const mutationFn = (props) => {
1163
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1164
+ return sitesAutoupdatesUpdate(siteId, data, axiosOptions);
1165
+ };
1166
+ return useMutation(mutationFn, mutationOptions);
1167
+ };
1168
+ /**
1169
+ * Returns whether the site has either Codeguard or Jetpack-backup.
1170
+ * @deprecated
1171
+ * @summary Deprecated - has backup
1172
+ */
1173
+ export const sitesBackups = (siteId, options) => {
1174
+ return axios.get(`/v1/sites/${siteId}/backups`, options);
1175
+ };
1176
+ export const getSitesBackupsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups`];
1177
+ export const useSitesBackups = (siteId, options) => {
1178
+ var _a;
1179
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1180
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsQueryKey(siteId);
1181
+ const queryFn = ({ signal }) => sitesBackups(siteId, Object.assign({ signal }, axiosOptions));
1182
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1183
+ query.queryKey = queryKey;
1184
+ return query;
1185
+ };
1186
+ /**
1187
+ * Returns whether the site has either Codeguard or Jetpack-backup.
1188
+ * @summary has backups
1189
+ */
1190
+ export const sitesHasBackups = (siteId, options) => {
1191
+ return axios.get(`/v1/sites/${siteId}/backups/check`, options);
1192
+ };
1193
+ export const getSitesHasBackupsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/check`];
1194
+ export const useSitesHasBackups = (siteId, options) => {
1195
+ var _a;
1196
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1197
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesHasBackupsQueryKey(siteId);
1198
+ const queryFn = ({ signal }) => sitesHasBackups(siteId, Object.assign({ signal }, axiosOptions));
1199
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1200
+ query.queryKey = queryKey;
1201
+ return query;
1202
+ };
1203
+ /**
1204
+ * Adds the site to the codeguard
1205
+ * @summary Add additional sites to codeguard
1206
+ */
1207
+ export const sitesBackupsCodeguard = (siteId, options) => {
1208
+ return axios.post(`/v1/sites/${siteId}/backups/codeguard`, undefined, options);
1209
+ };
1210
+ export const useSitesBackupsCodeguard = (options) => {
1211
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1212
+ const mutationFn = (props) => {
1213
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1214
+ return sitesBackupsCodeguard(siteId, axiosOptions);
1215
+ };
1216
+ return useMutation(mutationFn, mutationOptions);
1217
+ };
1218
+ /**
1219
+ * 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.
1220
+ * @summary site backup details
1221
+ */
1222
+ export const sitesBackupsDetails = (siteId, options) => {
1223
+ return axios.get(`/v1/sites/${siteId}/backups/details`, options);
1224
+ };
1225
+ export const getSitesBackupsDetailsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/details`];
1226
+ export const useSitesBackupsDetails = (siteId, options) => {
1227
+ var _a;
1228
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1229
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsDetailsQueryKey(siteId);
1230
+ const queryFn = ({ signal }) => sitesBackupsDetails(siteId, Object.assign({ signal }, axiosOptions));
1231
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1232
+ query.queryKey = queryKey;
1233
+ return query;
1234
+ };
1235
+ /**
1236
+ * The products supported jetpack-backup addon and jetpack-backup plugin
1237
+ * @summary Returns the status of the jetpack-backup product
1238
+ */
1239
+ export const jetpackBackupStatus = (siteId, options) => {
1240
+ return axios.get(`/v1/sites/${siteId}/backups/jetpack`, options);
1241
+ };
1242
+ export const getJetpackBackupStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/jetpack`];
1243
+ export const useJetpackBackupStatus = (siteId, options) => {
1244
+ var _a;
1245
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1246
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getJetpackBackupStatusQueryKey(siteId);
1247
+ const queryFn = ({ signal }) => jetpackBackupStatus(siteId, Object.assign({ signal }, axiosOptions));
1248
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1249
+ query.queryKey = queryKey;
1250
+ return query;
1251
+ };
1252
+ /**
1253
+ * Returns a list of DNS records for the site's domain.
1254
+ * @summary dns
1255
+ */
1256
+ export const sitesDns = (siteId, params, options) => {
1257
+ 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) }));
1258
+ };
1259
+ export const getSitesDnsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/dns`, ...(params ? [params] : [])];
1260
+ export const useSitesDns = (siteId, params, options) => {
1261
+ var _a;
1262
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1263
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDnsQueryKey(siteId, params);
1264
+ const queryFn = ({ signal }) => sitesDns(siteId, params, Object.assign({ signal }, axiosOptions));
1265
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1266
+ query.queryKey = queryKey;
1267
+ return query;
1268
+ };
1269
+ /**
1270
+ * Determines if the domain has the correct DNS setup for site
1271
+ * @summary Domain DNS setup for site
1272
+ */
1273
+ export const sitesDomain = (siteId, options) => {
1274
+ return axios.get(`/v1/sites/${siteId}/domain`, options);
1275
+ };
1276
+ export const getSitesDomainQueryKey = (siteId) => [`/v1/sites/${siteId}/domain`];
1277
+ export const useSitesDomain = (siteId, options) => {
1278
+ var _a;
1279
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1280
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainQueryKey(siteId);
1281
+ const queryFn = ({ signal }) => sitesDomain(siteId, Object.assign({ signal }, axiosOptions));
1282
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1283
+ query.queryKey = queryKey;
1284
+ return query;
1285
+ };
1286
+ /**
1287
+ * Add or promote pending site url
1288
+ * @summary Add pending site url
1289
+ */
1290
+ export const sitesDomainUrl = (siteId, sitesDomainUrlBody, options) => {
1291
+ return axios.post(`/v1/sites/${siteId}/domain`, sitesDomainUrlBody, options);
1292
+ };
1293
+ export const useSitesDomainUrl = (options) => {
1294
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1295
+ const mutationFn = (props) => {
1296
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1297
+ return sitesDomainUrl(siteId, data, axiosOptions);
1298
+ };
1299
+ return useMutation(mutationFn, mutationOptions);
1300
+ };
1301
+ /**
1302
+ * Delete pending domain
1303
+ * @summary Delete pending domain
1304
+ */
1305
+ export const sitePendingDomainDelete = (siteId, options) => {
1306
+ return axios.delete(`/v1/sites/${siteId}/pending-domain`, options);
1307
+ };
1308
+ export const useSitePendingDomainDelete = (options) => {
1309
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1310
+ const mutationFn = (props) => {
1311
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1312
+ return sitePendingDomainDelete(siteId, axiosOptions);
1313
+ };
1314
+ return useMutation(mutationFn, mutationOptions);
1315
+ };
1316
+ /**
1317
+ * cache purge site and url
1318
+ * @summary cache purge url
1319
+ */
1320
+ export const sitesPerformanceCachepurge = (siteId, sitesPerformanceCachepurgeBody, options) => {
1321
+ return axios.post(`/v1/sites/${siteId}/performance/cachepurge`, sitesPerformanceCachepurgeBody, options);
1322
+ };
1323
+ export const useSitesPerformanceCachepurge = (options) => {
1324
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1325
+ const mutationFn = (props) => {
1326
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1327
+ return sitesPerformanceCachepurge(siteId, data, axiosOptions);
1328
+ };
1329
+ return useMutation(mutationFn, mutationOptions);
1330
+ };
1331
+ /**
1332
+ * Returns the status of endurance_cache_level
1333
+ * @summary Get status of endurance cache level
1334
+ */
1335
+ export const sitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
1336
+ return axios.get(`/v1/sites/${siteId}/performance/endurance_cache_level`, options);
1337
+ };
1338
+ export const getSitesPerformanceEnduranceCacheLevelStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/performance/endurance_cache_level`];
1339
+ export const useSitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
1340
+ var _a;
1341
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1342
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesPerformanceEnduranceCacheLevelStatusQueryKey(siteId);
1343
+ const queryFn = ({ signal }) => sitesPerformanceEnduranceCacheLevelStatus(siteId, Object.assign({ signal }, axiosOptions));
1344
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1345
+ query.queryKey = queryKey;
1346
+ return query;
1347
+ };
1348
+ /**
1349
+ * Set endurance cache level to 0, 1,2 or 3
1350
+ * @summary Set endurance cache level
1351
+ */
1352
+ export const sitesPerformanceEnduranceCacheLevel = (siteId, sitesPerformanceEnduranceCacheLevelBody, options) => {
1353
+ return axios.post(`/v1/sites/${siteId}/performance/endurance_cache_level`, sitesPerformanceEnduranceCacheLevelBody, options);
1354
+ };
1355
+ export const useSitesPerformanceEnduranceCacheLevel = (options) => {
1356
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1357
+ const mutationFn = (props) => {
1358
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1359
+ return sitesPerformanceEnduranceCacheLevel(siteId, data, axiosOptions);
1360
+ };
1361
+ return useMutation(mutationFn, mutationOptions);
1362
+ };
1363
+ /**
1364
+ * Update the endurance page cache
1365
+ * @summary update the endurance cache page
1366
+ */
1367
+ export const sitesPerformanceEndurancePageCache = (siteId, options) => {
1368
+ return axios.put(`/v1/sites/${siteId}/performance/endurance_page_cache`, undefined, options);
1369
+ };
1370
+ export const useSitesPerformanceEndurancePageCache = (options) => {
1371
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1372
+ const mutationFn = (props) => {
1373
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1374
+ return sitesPerformanceEndurancePageCache(siteId, axiosOptions);
1375
+ };
1376
+ return useMutation(mutationFn, mutationOptions);
1377
+ };
1378
+ /**
1379
+ * Returns a list of the site's plugins
1380
+ * @summary plugins
1381
+ */
1382
+ export const sitePlugins = (siteId, options) => {
1383
+ return axios.get(`/v1/sites/${siteId}/plugins`, options);
1384
+ };
1385
+ export const getSitePluginsQueryKey = (siteId) => [`/v1/sites/${siteId}/plugins`];
1386
+ export const useSitePlugins = (siteId, options) => {
1387
+ var _a;
1388
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1389
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitePluginsQueryKey(siteId);
1390
+ const queryFn = ({ signal }) => sitePlugins(siteId, Object.assign({ signal }, axiosOptions));
1391
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1392
+ query.queryKey = queryKey;
1393
+ return query;
1394
+ };
1395
+ /**
1396
+ * Enables / disables plugin auto-updates
1397
+ * @deprecated
1398
+ * @summary plugins autoupdate
1399
+ */
1400
+ export const sitePluginsAutoupdate = (siteId, sitePluginsAutoupdateBody, options) => {
1401
+ return axios.post(`/v1/sites/${siteId}/plugins/autoupdate`, sitePluginsAutoupdateBody, options);
1402
+ };
1403
+ export const useSitePluginsAutoupdate = (options) => {
1404
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1405
+ const mutationFn = (props) => {
1406
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1407
+ return sitePluginsAutoupdate(siteId, data, axiosOptions);
1408
+ };
1409
+ return useMutation(mutationFn, mutationOptions);
1410
+ };
1411
+ /**
1412
+ * Enables / disables a plugin
1413
+ * @summary plugins toggle
1414
+ */
1415
+ export const sitePluginsToggle = (siteId, sitePluginsToggleBody, options) => {
1416
+ return axios.post(`/v1/sites/${siteId}/plugins/toggle`, sitePluginsToggleBody, options);
1417
+ };
1418
+ export const useSitePluginsToggle = (options) => {
1419
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1420
+ const mutationFn = (props) => {
1421
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1422
+ return sitePluginsToggle(siteId, data, axiosOptions);
1423
+ };
1424
+ return useMutation(mutationFn, mutationOptions);
1425
+ };
1426
+ /**
1427
+ * Updates a plugin
1428
+ * @summary plugins update
1429
+ */
1430
+ export const sitePluginsUpdate = (siteId, sitePluginsUpdateBody, options) => {
1431
+ return axios.post(`/v1/sites/${siteId}/plugins/update`, sitePluginsUpdateBody, options);
1432
+ };
1433
+ export const useSitePluginsUpdate = (options) => {
1434
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1435
+ const mutationFn = (props) => {
1436
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1437
+ return sitePluginsUpdate(siteId, data, axiosOptions);
1438
+ };
1439
+ return useMutation(mutationFn, mutationOptions);
1440
+ };
1441
+ /**
1442
+ * Resets a site - deletes/reinstalls the site.
1443
+ * @summary reset site
1444
+ */
1445
+ export const resetSite = (siteId, options) => {
1446
+ return axios.post(`/v1/sites/${siteId}/reset`, undefined, options);
1447
+ };
1448
+ export const useResetSite = (options) => {
1449
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1450
+ const mutationFn = (props) => {
1451
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1452
+ return resetSite(siteId, axiosOptions);
1453
+ };
1454
+ return useMutation(mutationFn, mutationOptions);
1455
+ };
1456
+ /**
1457
+ * Performs a checksum of the site's core files to verify integrity.
1458
+ * @summary core files checksum
1459
+ */
1460
+ export const sitesSecurityCheckCore = (siteId, options) => {
1461
+ return axios.get(`/v1/sites/${siteId}/security/core/check`, options);
1462
+ };
1463
+ export const getSitesSecurityCheckCoreQueryKey = (siteId) => [`/v1/sites/${siteId}/security/core/check`];
1464
+ export const useSitesSecurityCheckCore = (siteId, options) => {
1465
+ var _a;
1466
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1467
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityCheckCoreQueryKey(siteId);
1468
+ const queryFn = ({ signal }) => sitesSecurityCheckCore(siteId, Object.assign({ signal }, axiosOptions));
1469
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1470
+ query.queryKey = queryKey;
1471
+ return query;
1472
+ };
1473
+ /**
1474
+ * Resets the site's core files.
1475
+ * @summary core files reset
1476
+ */
1477
+ export const sitesSecurityResetCoreFiles = (siteId, options) => {
1478
+ return axios.post(`/v1/sites/${siteId}/security/core/reset`, undefined, options);
1479
+ };
1480
+ export const useSitesSecurityResetCoreFiles = (options) => {
1481
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1482
+ const mutationFn = (props) => {
1483
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1484
+ return sitesSecurityResetCoreFiles(siteId, axiosOptions);
1485
+ };
1486
+ return useMutation(mutationFn, mutationOptions);
1487
+ };
1488
+ /**
1489
+ * Returns the HTTPS redirection status.
1490
+ * @summary https redirection status
1491
+ */
1492
+ export const sitesSecurityHttpsRedirectionStatus = (siteId, options) => {
1493
+ return axios.get(`/v1/sites/${siteId}/security/https`, options);
1494
+ };
1495
+ export const getSitesSecurityHttpsRedirectionStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/security/https`];
1496
+ export const useSitesSecurityHttpsRedirectionStatus = (siteId, options) => {
1497
+ var _a;
1498
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1499
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityHttpsRedirectionStatusQueryKey(siteId);
1500
+ const queryFn = ({ signal }) => sitesSecurityHttpsRedirectionStatus(siteId, Object.assign({ signal }, axiosOptions));
1501
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1502
+ query.queryKey = queryKey;
1503
+ return query;
1504
+ };
1505
+ /**
1506
+ * Enables / disables HTTPS redirection.
1507
+ * @summary https redirection toggle
1508
+ */
1509
+ export const sitesSecurityHttpsEnableDisableSsl = (siteId, sitesSecurityHttpsEnableDisableSslBody, options) => {
1510
+ return axios.post(`/v1/sites/${siteId}/security/https`, sitesSecurityHttpsEnableDisableSslBody, options);
1511
+ };
1512
+ export const useSitesSecurityHttpsEnableDisableSsl = (options) => {
1513
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1514
+ const mutationFn = (props) => {
1515
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1516
+ return sitesSecurityHttpsEnableDisableSsl(siteId, data, axiosOptions);
1517
+ };
1518
+ return useMutation(mutationFn, mutationOptions);
1519
+ };
1520
+ /**
1521
+ * Returns the site's sitelock information.
1522
+ * @summary sitelock info
1523
+ */
1524
+ export const sitesSecuritySitelock = (siteId, options) => {
1525
+ return axios.get(`/v1/sites/${siteId}/security/sitelock`, options);
1526
+ };
1527
+ export const getSitesSecuritySitelockQueryKey = (siteId) => [`/v1/sites/${siteId}/security/sitelock`];
1528
+ export const useSitesSecuritySitelock = (siteId, options) => {
1529
+ var _a;
1530
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1531
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockQueryKey(siteId);
1532
+ const queryFn = ({ signal }) => sitesSecuritySitelock(siteId, Object.assign({ signal }, axiosOptions));
1533
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1534
+ query.queryKey = queryKey;
1535
+ return query;
1536
+ };
1537
+ /**
1538
+ * Disables / enables cPanel to generate Let's Encrypt SSLs for the site.
1539
+ * @summary ssl lets encrypt toggle
1540
+ */
1541
+ export const sitesSecuritySslAcme = (siteId, options) => {
1542
+ return axios.post(`/v1/sites/${siteId}/security/ssl/acme`, undefined, options);
1543
+ };
1544
+ export const useSitesSecuritySslAcme = (options) => {
1545
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1546
+ const mutationFn = (props) => {
1547
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1548
+ return sitesSecuritySslAcme(siteId, axiosOptions);
1549
+ };
1550
+ return useMutation(mutationFn, mutationOptions);
1551
+ };
1552
+ /**
1553
+ * Returns the site's SSL Status
1554
+ * @summary ssl status
1555
+ */
1556
+ export const sitesSecuritySslStatus = (siteId, options) => {
1557
+ return axios.get(`/v1/sites/${siteId}/security/ssl/status`, options);
1558
+ };
1559
+ export const getSitesSecuritySslStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/security/ssl/status`];
1560
+ export const useSitesSecuritySslStatus = (siteId, options) => {
1561
+ var _a;
1562
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1563
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySslStatusQueryKey(siteId);
1564
+ const queryFn = ({ signal }) => sitesSecuritySslStatus(siteId, Object.assign({ signal }, axiosOptions));
1565
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1566
+ query.queryKey = queryKey;
1567
+ return query;
1568
+ };
1569
+ /**
1570
+ * Returns status of plugin autoupdate for site
1571
+ * @deprecated
1572
+ * @summary plugins autoupdate status
1573
+ */
1574
+ export const siteSettingsAutoupdatePlugins = (siteId, options) => {
1575
+ return axios.get(`/v1/sites/${siteId}/settings/autoupdate/plugins`, options);
1576
+ };
1577
+ export const getSiteSettingsAutoupdatePluginsQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/autoupdate/plugins`];
1578
+ export const useSiteSettingsAutoupdatePlugins = (siteId, options) => {
1579
+ var _a;
1580
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1581
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteSettingsAutoupdatePluginsQueryKey(siteId);
1582
+ const queryFn = ({ signal }) => siteSettingsAutoupdatePlugins(siteId, Object.assign({ signal }, axiosOptions));
1583
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1584
+ query.queryKey = queryKey;
1585
+ return query;
1586
+ };
1587
+ /**
1588
+ * Returns the autoupdate status of the site's core, themes, and plugins
1589
+ * @deprecated
1590
+ * @summary settings autoupdates
1591
+ */
1592
+ export const sitesSettingsAutoupdates = (siteId, options) => {
1593
+ return axios.get(`/v1/sites/${siteId}/settings/autoupdates`, options);
1594
+ };
1595
+ export const getSitesSettingsAutoupdatesQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/autoupdates`];
1596
+ export const useSitesSettingsAutoupdates = (siteId, options) => {
1597
+ var _a;
1598
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1599
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsAutoupdatesQueryKey(siteId);
1600
+ const queryFn = ({ signal }) => sitesSettingsAutoupdates(siteId, Object.assign({ signal }, axiosOptions));
1601
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1602
+ query.queryKey = queryKey;
1603
+ return query;
1604
+ };
1605
+ /**
1606
+ * Enables WP Core autoupdates
1607
+ * @deprecated
1608
+ * @summary settings autoupdates core enable
1609
+ */
1610
+ export const sitesSettingsAutoupdatesCore = (siteId, sitesSettingsAutoupdatesCoreBody, options) => {
1611
+ return axios.post(`/v1/sites/${siteId}/settings/autoupdates/core`, sitesSettingsAutoupdatesCoreBody, options);
1612
+ };
1613
+ export const useSitesSettingsAutoupdatesCore = (options) => {
1614
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1615
+ const mutationFn = (props) => {
1616
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1617
+ return sitesSettingsAutoupdatesCore(siteId, data, axiosOptions);
1618
+ };
1619
+ return useMutation(mutationFn, mutationOptions);
1620
+ };
1621
+ /**
1622
+ * Enables theme autoupdates
1623
+ * @deprecated
1624
+ * @summary settings autoupdate theme enable
1625
+ */
1626
+ export const sitesSettingsAutoupdatesTheme = (siteId, sitesSettingsAutoupdatesThemeBody, options) => {
1627
+ return axios.post(`/v1/sites/${siteId}/settings/autoupdates/theme`, sitesSettingsAutoupdatesThemeBody, options);
1628
+ };
1629
+ export const useSitesSettingsAutoupdatesTheme = (options) => {
1630
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1631
+ const mutationFn = (props) => {
1632
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1633
+ return sitesSettingsAutoupdatesTheme(siteId, data, axiosOptions);
1634
+ };
1635
+ return useMutation(mutationFn, mutationOptions);
1636
+ };
1637
+ /**
1638
+ * Returns whether the coming soon setting is enable or disabled
1639
+ * @summary settings coming soon page status
1640
+ */
1641
+ export const sitesSettingsComingSoon = (siteId, options) => {
1642
+ return axios.get(`/v1/sites/${siteId}/settings/coming-soon`, options);
1643
+ };
1644
+ export const getSitesSettingsComingSoonQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/coming-soon`];
1645
+ export const useSitesSettingsComingSoon = (siteId, options) => {
1646
+ var _a;
1647
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1648
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsComingSoonQueryKey(siteId);
1649
+ const queryFn = ({ signal }) => sitesSettingsComingSoon(siteId, Object.assign({ signal }, axiosOptions));
1650
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1651
+ query.queryKey = queryKey;
1652
+ return query;
1653
+ };
1654
+ /**
1655
+ * Enables/disables the coming soon (under-construction) page
1656
+ * @summary settings coming soon toggle
1657
+ */
1658
+ export const sitesSettingsComingSoonToggle = (siteId, sitesSettingsComingSoonToggleBody, options) => {
1659
+ return axios.post(`/v1/sites/${siteId}/settings/coming-soon`, sitesSettingsComingSoonToggleBody, options);
1660
+ };
1661
+ export const useSitesSettingsComingSoonToggle = (options) => {
1662
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1663
+ const mutationFn = (props) => {
1664
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1665
+ return sitesSettingsComingSoonToggle(siteId, data, axiosOptions);
1666
+ };
1667
+ return useMutation(mutationFn, mutationOptions);
1668
+ };
1669
+ /**
1670
+ * Returns the site's debug mode status
1671
+ * @summary settings debug status
1672
+ */
1673
+ export const sitesSettingsDebug = (siteId, options) => {
1674
+ return axios.get(`/v1/sites/${siteId}/settings/debug`, options);
1675
+ };
1676
+ export const getSitesSettingsDebugQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/debug`];
1677
+ export const useSitesSettingsDebug = (siteId, options) => {
1678
+ var _a;
1679
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1680
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsDebugQueryKey(siteId);
1681
+ const queryFn = ({ signal }) => sitesSettingsDebug(siteId, Object.assign({ signal }, axiosOptions));
1682
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1683
+ query.queryKey = queryKey;
1684
+ return query;
1685
+ };
1686
+ /**
1687
+ * Enables or disables the output and display of site generated errors on the site
1688
+ * @summary settings debug toggle
1689
+ */
1690
+ export const sitesSettingsDebugToggle = (siteId, sitesSettingsDebugToggleBody, options) => {
1691
+ return axios.post(`/v1/sites/${siteId}/settings/debug`, sitesSettingsDebugToggleBody, options);
1692
+ };
1693
+ export const useSitesSettingsDebugToggle = (options) => {
1694
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1695
+ const mutationFn = (props) => {
1696
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1697
+ return sitesSettingsDebugToggle(siteId, data, axiosOptions);
1698
+ };
1699
+ return useMutation(mutationFn, mutationOptions);
1700
+ };
1701
+ /**
1702
+ * Updates the site's PHP version
1703
+ * @summary settings php version update
1704
+ */
1705
+ export const sitesSettingsPhpVersionUpdate = (siteId, sitesSettingsPhpVersionUpdateBody, options) => {
1706
+ return axios.post(`/v1/sites/${siteId}/settings/php-version`, sitesSettingsPhpVersionUpdateBody, options);
1707
+ };
1708
+ export const useSitesSettingsPhpVersionUpdate = (options) => {
1709
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1710
+ const mutationFn = (props) => {
1711
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1712
+ return sitesSettingsPhpVersionUpdate(siteId, data, axiosOptions);
1713
+ };
1714
+ return useMutation(mutationFn, mutationOptions);
1715
+ };
1716
+ /**
1717
+ * Gets the list of PHP versions available/installed
1718
+ * @summary settings php versions list
1719
+ */
1720
+ export const sitesSettingsPhpVersions = (siteId, options) => {
1721
+ return axios.get(`/v1/sites/${siteId}/settings/php-versions`, options);
1722
+ };
1723
+ export const getSitesSettingsPhpVersionsQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/php-versions`];
1724
+ export const useSitesSettingsPhpVersions = (siteId, options) => {
1725
+ var _a;
1726
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1727
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsPhpVersionsQueryKey(siteId);
1728
+ const queryFn = ({ signal }) => sitesSettingsPhpVersions(siteId, Object.assign({ signal }, axiosOptions));
1729
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1730
+ query.queryKey = queryKey;
1731
+ return query;
1732
+ };
1733
+ /**
1734
+ * Returns an SSO token or login URL for the site (if supported).
1735
+ * @summary sso
1736
+ */
1737
+ export const sitesSso = (siteId, params, options) => {
1738
+ 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) }));
1739
+ };
1740
+ export const getSitesSsoQueryKey = (siteId, params) => [`/v1/sites/${siteId}/sso`, ...(params ? [params] : [])];
1741
+ export const useSitesSso = (siteId, params, options) => {
1742
+ var _a;
1743
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1744
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSsoQueryKey(siteId, params);
1745
+ const queryFn = ({ signal }) => sitesSso(siteId, params, Object.assign({ signal }, axiosOptions));
1746
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1747
+ query.queryKey = queryKey;
1748
+ return query;
1749
+ };
1750
+ /**
1751
+ * @summary site status
1752
+ */
1753
+ export const siteStatus = (siteId, options) => {
1754
+ return axios.get(`/v1/sites/${siteId}/status`, options);
1755
+ };
1756
+ export const getSiteStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/status`];
1757
+ export const useSiteStatus = (siteId, options) => {
1758
+ var _a;
1759
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1760
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteStatusQueryKey(siteId);
1761
+ const queryFn = ({ signal }) => siteStatus(siteId, Object.assign({ signal }, axiosOptions));
1762
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1763
+ query.queryKey = queryKey;
1764
+ return query;
1765
+ };
1766
+ /**
1767
+ * Returns a list of the site's users
1768
+ * @summary users
1769
+ */
1770
+ export const siteUsers = (siteId, options) => {
1771
+ return axios.get(`/v1/sites/${siteId}/users`, options);
1772
+ };
1773
+ export const getSiteUsersQueryKey = (siteId) => [`/v1/sites/${siteId}/users`];
1774
+ export const useSiteUsers = (siteId, options) => {
1775
+ var _a;
1776
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1777
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteUsersQueryKey(siteId);
1778
+ const queryFn = ({ signal }) => siteUsers(siteId, Object.assign({ signal }, axiosOptions));
1779
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1780
+ query.queryKey = queryKey;
1781
+ return query;
1782
+ };
1783
+ /**
1784
+ * Returns site version information.
1785
+ * @summary version
1786
+ */
1787
+ export const sitesVersion = (siteId, options) => {
1788
+ return axios.get(`/v1/sites/${siteId}/version`, options);
1789
+ };
1790
+ export const getSitesVersionQueryKey = (siteId) => [`/v1/sites/${siteId}/version`];
1791
+ export const useSitesVersion = (siteId, options) => {
1792
+ var _a;
1793
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1794
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesVersionQueryKey(siteId);
1795
+ const queryFn = ({ signal }) => sitesVersion(siteId, Object.assign({ signal }, axiosOptions));
1796
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1797
+ query.queryKey = queryKey;
1798
+ return query;
1799
+ };
1800
+ /**
1801
+ * Returns a list of sites.
1802
+ * @summary sites list v2
1803
+ */
1804
+ export const hostingSitesV2 = (hostingId, options) => {
1805
+ return axios.get(`/v2/hosting/${hostingId}/sites`, options);
1806
+ };
1807
+ export const getHostingSitesV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/sites`];
1808
+ export const useHostingSitesV2 = (hostingId, options) => {
1809
+ var _a;
1810
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1811
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSitesV2QueryKey(hostingId);
1812
+ const queryFn = ({ signal }) => hostingSitesV2(hostingId, Object.assign({ signal }, axiosOptions));
1813
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1814
+ query.queryKey = queryKey;
1815
+ return query;
1816
+ };
1817
+ /**
1818
+ * List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
1819
+ * @summary ssh keys list
1820
+ */
1821
+ export const sshKeyListV2 = (hostingId, options) => {
1822
+ return axios.get(`/v2/hosting/${hostingId}/ssh/keys`, options);
1823
+ };
1824
+ export const getSshKeyListV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/ssh/keys`];
1825
+ export const useSshKeyListV2 = (hostingId, options) => {
1826
+ var _a;
1827
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1828
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListV2QueryKey(hostingId);
1829
+ const queryFn = ({ signal }) => sshKeyListV2(hostingId, Object.assign({ signal }, axiosOptions));
1830
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1831
+ query.queryKey = queryKey;
1832
+ return query;
1833
+ };