@newfold/huapi-js 1.487.0 → 1.513.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 DELETED
@@ -1,1754 +0,0 @@
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.487.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 HAL hosting account-level information
285
- * @summary HAL Hosting Account Info
286
- */
287
- export const hostingAccount = (hostingId, options) => {
288
- return axios.get(`/v1/hosting/${hostingId}`, options);
289
- };
290
- export const getHostingAccountQueryKey = (hostingId) => [`/v1/hosting/${hostingId}`];
291
- export const useHostingAccount = (hostingId, 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 : getHostingAccountQueryKey(hostingId);
295
- const queryFn = ({ signal }) => hostingAccount(hostingId, Object.assign({ signal }, axiosOptions));
296
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
297
- query.queryKey = queryKey;
298
- return query;
299
- };
300
- /**
301
- * Returns a list of addons.
302
- * @summary addon list
303
- */
304
- export const hostingAddons = (hostingId, params, options) => {
305
- 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) }));
306
- };
307
- export const getHostingAddonsQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/addons`, ...(params ? [params] : [])];
308
- export const useHostingAddons = (hostingId, params, 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 : getHostingAddonsQueryKey(hostingId, params);
312
- const queryFn = ({ signal }) => hostingAddons(hostingId, params, 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 the hosting server info
319
- * @summary server status/info
320
- */
321
- export const hostingAdvancedServer = (hostingId, options) => {
322
- return axios.get(`/v1/hosting/${hostingId}/advanced/server`, options);
323
- };
324
- export const getHostingAdvancedServerQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/server`];
325
- export const useHostingAdvancedServer = (hostingId, 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 : getHostingAdvancedServerQueryKey(hostingId);
329
- const queryFn = ({ signal }) => hostingAdvancedServer(hostingId, 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
- * Allows for managing server status
336
- * @summary server_status
337
- */
338
- export const hostingAdvancedServerStatus = (hostingId, hostingAdvancedServerStatusBody, options) => {
339
- return axios.put(`/v1/hosting/${hostingId}/advanced/server`, hostingAdvancedServerStatusBody, options);
340
- };
341
- export const useHostingAdvancedServerStatus = (options) => {
342
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
343
- const mutationFn = (props) => {
344
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
345
- return hostingAdvancedServerStatus(hostingId, data, axiosOptions);
346
- };
347
- return useMutation(mutationFn, mutationOptions);
348
- };
349
- /**
350
- * Update user account's password
351
- * @summary Update user account password
352
- */
353
- export const hostingAdvancedPassword = (hostingId, hostingAdvancedPasswordBody, options) => {
354
- return axios.put(`/v1/hosting/${hostingId}/advanced/server/password`, hostingAdvancedPasswordBody, options);
355
- };
356
- export const useHostingAdvancedPassword = (options) => {
357
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
358
- const mutationFn = (props) => {
359
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
360
- return hostingAdvancedPassword(hostingId, data, axiosOptions);
361
- };
362
- return useMutation(mutationFn, mutationOptions);
363
- };
364
- /**
365
- * Returns the hosting sso_whm login url
366
- * @summary hosting sso_whm
367
- */
368
- export const hostingAdvancedSsoWhm = (hostingId, options) => {
369
- return axios.get(`/v1/hosting/${hostingId}/advanced/sso_whm`, options);
370
- };
371
- export const getHostingAdvancedSsoWhmQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/sso_whm`];
372
- export const useHostingAdvancedSsoWhm = (hostingId, options) => {
373
- var _a;
374
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
375
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSsoWhmQueryKey(hostingId);
376
- const queryFn = ({ signal }) => hostingAdvancedSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
377
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
378
- query.queryKey = queryKey;
379
- return query;
380
- };
381
- /**
382
- * Returns the hosting system_console url
383
- * @summary hosting system_console
384
- */
385
- export const hostingAdvancedSystemConsole = (hostingId, options) => {
386
- return axios.get(`/v1/hosting/${hostingId}/advanced/system-console`, options);
387
- };
388
- export const getHostingAdvancedSystemConsoleQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/system-console`];
389
- export const useHostingAdvancedSystemConsole = (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 : getHostingAdvancedSystemConsoleQueryKey(hostingId);
393
- const queryFn = ({ signal }) => hostingAdvancedSystemConsole(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 capabilities
400
- * @summary hosting capabilities
401
- */
402
- export const hostingCapabilities = (hostingId, options) => {
403
- return axios.get(`/v1/hosting/${hostingId}/capabilities`, options);
404
- };
405
- export const getHostingCapabilitiesQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/capabilities`];
406
- export const useHostingCapabilities = (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 : getHostingCapabilitiesQueryKey(hostingId);
410
- const queryFn = ({ signal }) => hostingCapabilities(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
- * Creates cloudflare basic addon
417
- * @summary Install cloudflare basic addon
418
- */
419
- export const addonCloudflare = (hostingId, addonCloudflareBody, options) => {
420
- return axios.post(`/v1/hosting/${hostingId}/cloudflare`, addonCloudflareBody, options);
421
- };
422
- export const useAddonCloudflare = (options) => {
423
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
424
- const mutationFn = (props) => {
425
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
426
- return addonCloudflare(hostingId, data, axiosOptions);
427
- };
428
- return useMutation(mutationFn, mutationOptions);
429
- };
430
- /**
431
- * Returns a list of cron jobs
432
- * @summary cron_list
433
- */
434
- export const listCrons = (hostingId, options) => {
435
- return axios.get(`/v1/hosting/${hostingId}/crontab`, options);
436
- };
437
- export const getListCronsQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/crontab`];
438
- export const useListCrons = (hostingId, options) => {
439
- var _a;
440
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
441
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getListCronsQueryKey(hostingId);
442
- const queryFn = ({ signal }) => listCrons(hostingId, Object.assign({ signal }, axiosOptions));
443
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
444
- query.queryKey = queryKey;
445
- return query;
446
- };
447
- /**
448
- * Adds a new cron job
449
- * @summary cron_add
450
- */
451
- export const addCron = (hostingId, addCronBody, options) => {
452
- return axios.post(`/v1/hosting/${hostingId}/crontab`, addCronBody, options);
453
- };
454
- export const useAddCron = (options) => {
455
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
456
- const mutationFn = (props) => {
457
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
458
- return addCron(hostingId, data, axiosOptions);
459
- };
460
- return useMutation(mutationFn, mutationOptions);
461
- };
462
- /**
463
- * Updates a cron job
464
- * @summary cron_update
465
- */
466
- export const updateCron = (hostingId, updateCronBody, options) => {
467
- return axios.put(`/v1/hosting/${hostingId}/crontab`, updateCronBody, options);
468
- };
469
- export const useUpdateCron = (options) => {
470
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
471
- const mutationFn = (props) => {
472
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
473
- return updateCron(hostingId, data, axiosOptions);
474
- };
475
- return useMutation(mutationFn, mutationOptions);
476
- };
477
- /**
478
- * Deletes a cron job
479
- * @summary cron_delete
480
- */
481
- export const cron = (hostingId, cronBody, options) => {
482
- return axios.delete(`/v1/hosting/${hostingId}/crontab`, Object.assign({ data: cronBody }, options));
483
- };
484
- export const useCron = (options) => {
485
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
486
- const mutationFn = (props) => {
487
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
488
- return cron(hostingId, data, axiosOptions);
489
- };
490
- return useMutation(mutationFn, mutationOptions);
491
- };
492
- /**
493
- * Add a new db to an account
494
- * @summary Create a database for an account
495
- */
496
- export const dbAdd = (hostingId, dbAddBody, options) => {
497
- return axios.post(`/v1/hosting/${hostingId}/db`, dbAddBody, options);
498
- };
499
- export const useDbAdd = (options) => {
500
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
501
- const mutationFn = (props) => {
502
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
503
- return dbAdd(hostingId, data, axiosOptions);
504
- };
505
- return useMutation(mutationFn, mutationOptions);
506
- };
507
- /**
508
- * Delete db account
509
- * @summary Delete db account
510
- */
511
- export const db = (hostingId, dbBody, options) => {
512
- return axios.delete(`/v1/hosting/${hostingId}/db`, Object.assign({ data: dbBody }, options));
513
- };
514
- export const useDb = (options) => {
515
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
516
- const mutationFn = (props) => {
517
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
518
- return db(hostingId, data, axiosOptions);
519
- };
520
- return useMutation(mutationFn, mutationOptions);
521
- };
522
- /**
523
- * List all DB name
524
- * @summary Get list of database name
525
- */
526
- export const dbList = (hostingId, options) => {
527
- return axios.get(`/v1/hosting/${hostingId}/db`, options);
528
- };
529
- export const getDbListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db`];
530
- export const useDbList = (hostingId, options) => {
531
- var _a;
532
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
533
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbListQueryKey(hostingId);
534
- const queryFn = ({ signal }) => dbList(hostingId, Object.assign({ signal }, axiosOptions));
535
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
536
- query.queryKey = queryKey;
537
- return query;
538
- };
539
- /**
540
- * List all DB users
541
- * @summary Get list of db users
542
- */
543
- export const dbUserList = (hostingId, options) => {
544
- return axios.get(`/v1/hosting/${hostingId}/db/users`, options);
545
- };
546
- export const getDbUserListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db/users`];
547
- export const useDbUserList = (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 : getDbUserListQueryKey(hostingId);
551
- const queryFn = ({ signal }) => dbUserList(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
- * Returns a list of domains
558
- * @summary domain list
559
- */
560
- export const domains = (hostingId, params, options) => {
561
- 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) }));
562
- };
563
- export const getDomainsQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/domains`, ...(params ? [params] : [])];
564
- export const useDomains = (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 : getDomainsQueryKey(hostingId, params);
568
- const queryFn = ({ signal }) => domains(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
- * Returns info about an existing ecommerce addon otherwise it returns null
575
- * @summary ecommerce info
576
- */
577
- export const hostingEcommerceInfo = (hostingId, options) => {
578
- return axios.get(`/v1/hosting/${hostingId}/ecommerce`, options);
579
- };
580
- export const getHostingEcommerceInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ecommerce`];
581
- export const useHostingEcommerceInfo = (hostingId, options) => {
582
- var _a;
583
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
584
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingEcommerceInfoQueryKey(hostingId);
585
- const queryFn = ({ signal }) => hostingEcommerceInfo(hostingId, Object.assign({ signal }, axiosOptions));
586
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
587
- query.queryKey = queryKey;
588
- return query;
589
- };
590
- /**
591
- * Returns a list of FTP accounts.
592
- * @summary ftp list
593
- */
594
- export const hostingFtpList = (hostingId, options) => {
595
- return axios.get(`/v1/hosting/${hostingId}/ftp`, options);
596
- };
597
- export const getHostingFtpListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ftp`];
598
- export const useHostingFtpList = (hostingId, options) => {
599
- var _a;
600
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
601
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingFtpListQueryKey(hostingId);
602
- const queryFn = ({ signal }) => hostingFtpList(hostingId, Object.assign({ signal }, axiosOptions));
603
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
604
- query.queryKey = queryKey;
605
- return query;
606
- };
607
- /**
608
- * Add ftp account
609
- * @summary Add ftp account
610
- */
611
- export const hostingFtpAdd = (hostingId, hostingFtpAddBody, options) => {
612
- return axios.post(`/v1/hosting/${hostingId}/ftp`, hostingFtpAddBody, options);
613
- };
614
- export const useHostingFtpAdd = (options) => {
615
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
616
- const mutationFn = (props) => {
617
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
618
- return hostingFtpAdd(hostingId, data, axiosOptions);
619
- };
620
- return useMutation(mutationFn, mutationOptions);
621
- };
622
- /**
623
- * Update ftp account
624
- * @summary Update ftp account
625
- */
626
- export const hostingFtpUpdate = (hostingId, hostingFtpUpdateBody, options) => {
627
- return axios.put(`/v1/hosting/${hostingId}/ftp`, hostingFtpUpdateBody, options);
628
- };
629
- export const useHostingFtpUpdate = (options) => {
630
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
631
- const mutationFn = (props) => {
632
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
633
- return hostingFtpUpdate(hostingId, data, axiosOptions);
634
- };
635
- return useMutation(mutationFn, mutationOptions);
636
- };
637
- /**
638
- * Delete ftp account
639
- * @summary Delete ftp account
640
- */
641
- export const hostingFtp = (hostingId, hostingFtpBody, options) => {
642
- return axios.delete(`/v1/hosting/${hostingId}/ftp`, Object.assign({ data: hostingFtpBody }, options));
643
- };
644
- export const useHostingFtp = (options) => {
645
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
646
- const mutationFn = (props) => {
647
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
648
- return hostingFtp(hostingId, data, axiosOptions);
649
- };
650
- return useMutation(mutationFn, mutationOptions);
651
- };
652
- /**
653
- * Returns hosting account info
654
- * @summary Hosting info
655
- */
656
- export const hostingInfo = (hostingId, options) => {
657
- return axios.get(`/v1/hosting/${hostingId}/info`, options);
658
- };
659
- export const getHostingInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info`];
660
- export const useHostingInfo = (hostingId, options) => {
661
- var _a;
662
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
663
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoQueryKey(hostingId);
664
- const queryFn = ({ signal }) => hostingInfo(hostingId, Object.assign({ signal }, axiosOptions));
665
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
666
- query.queryKey = queryKey;
667
- return query;
668
- };
669
- /**
670
- * Returns the hosting account's disk usage
671
- * @summary info disk usage
672
- */
673
- export const hostingInfoDiskUsage = (hostingId, options) => {
674
- return axios.get(`/v1/hosting/${hostingId}/info/diskusage`, options);
675
- };
676
- export const getHostingInfoDiskUsageQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info/diskusage`];
677
- export const useHostingInfoDiskUsage = (hostingId, options) => {
678
- var _a;
679
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
680
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoDiskUsageQueryKey(hostingId);
681
- const queryFn = ({ signal }) => hostingInfoDiskUsage(hostingId, Object.assign({ signal }, axiosOptions));
682
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
683
- query.queryKey = queryKey;
684
- return query;
685
- };
686
- /**
687
- * Gets the Wordpress migration status
688
- * @summary Wordpress migration status
689
- */
690
- export const hostingMigrationStatus = (hostingId, options) => {
691
- return axios.get(`/v1/hosting/${hostingId}/migrations`, options);
692
- };
693
- export const getHostingMigrationStatusQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/migrations`];
694
- export const useHostingMigrationStatus = (hostingId, options) => {
695
- var _a;
696
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
697
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationStatusQueryKey(hostingId);
698
- const queryFn = ({ signal }) => hostingMigrationStatus(hostingId, Object.assign({ signal }, axiosOptions));
699
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
700
- query.queryKey = queryKey;
701
- return query;
702
- };
703
- /**
704
- * Adds the wordpressmigrate addon for a given migration id and hosting account
705
- * @summary start the migration process for a site
706
- */
707
- export const hostingMigrations = (hostingId, hostingMigrationsBody, options) => {
708
- return axios.post(`/v1/hosting/${hostingId}/migrations`, hostingMigrationsBody, options);
709
- };
710
- export const useHostingMigrations = (options) => {
711
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
712
- const mutationFn = (props) => {
713
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
714
- return hostingMigrations(hostingId, data, axiosOptions);
715
- };
716
- return useMutation(mutationFn, mutationOptions);
717
- };
718
- /**
719
- * Post migration event to CWM
720
- * @summary hosting migrations event
721
- */
722
- export const hostingMigrationsEvent = (hostingId, hostingMigrationsEventBody, options) => {
723
- return axios.post(`/v1/hosting/${hostingId}/migrations/event`, hostingMigrationsEventBody, options);
724
- };
725
- export const useHostingMigrationsEvent = (options) => {
726
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
727
- const mutationFn = (props) => {
728
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
729
- return hostingMigrationsEvent(hostingId, data, axiosOptions);
730
- };
731
- return useMutation(mutationFn, mutationOptions);
732
- };
733
- /**
734
- * Gets the Wordpress migration information
735
- * @summary Wordpress migration information
736
- */
737
- export const hostingMigrationInfo = (hostingId, params, options) => {
738
- 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) }));
739
- };
740
- export const getHostingMigrationInfoQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/info`, ...(params ? [params] : [])];
741
- export const useHostingMigrationInfo = (hostingId, params, 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 : getHostingMigrationInfoQueryKey(hostingId, params);
745
- const queryFn = ({ signal }) => hostingMigrationInfo(hostingId, params, 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
- * Provides the status of SiteMigration site_scan and deeplink to WordPress admin page
752
- * @summary SiteMigration site_scan status
753
- */
754
- export const hostingMigrationSiteScanStatus = (hostingId, params, options) => {
755
- 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) }));
756
- };
757
- export const getHostingMigrationSiteScanStatusQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/site-scan`, ...(params ? [params] : [])];
758
- export const useHostingMigrationSiteScanStatus = (hostingId, params, options) => {
759
- var _a;
760
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
761
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationSiteScanStatusQueryKey(hostingId, params);
762
- const queryFn = ({ signal }) => hostingMigrationSiteScanStatus(hostingId, params, Object.assign({ signal }, axiosOptions));
763
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
764
- query.queryKey = queryKey;
765
- return query;
766
- };
767
- /**
768
- * Returns the hosting brand nameservers
769
- * @summary hosting nameservers
770
- */
771
- export const hostingNameservers = (hostingId, options) => {
772
- return axios.get(`/v1/hosting/${hostingId}/nameservers`, options);
773
- };
774
- export const getHostingNameserversQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/nameservers`];
775
- export const useHostingNameservers = (hostingId, options) => {
776
- var _a;
777
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
778
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversQueryKey(hostingId);
779
- const queryFn = ({ signal }) => hostingNameservers(hostingId, Object.assign({ signal }, axiosOptions));
780
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
781
- query.queryKey = queryKey;
782
- return query;
783
- };
784
- /**
785
- * Returns onboarding data
786
- * @summary Returns hosting onboarding data
787
- */
788
- export const hostingOnboardingData = (hostingId, options) => {
789
- return axios.get(`/v1/hosting/${hostingId}/onboarding`, options);
790
- };
791
- export const getHostingOnboardingDataQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/onboarding`];
792
- export const useHostingOnboardingData = (hostingId, options) => {
793
- var _a;
794
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
795
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingOnboardingDataQueryKey(hostingId);
796
- const queryFn = ({ signal }) => hostingOnboardingData(hostingId, Object.assign({ signal }, axiosOptions));
797
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
798
- query.queryKey = queryKey;
799
- return query;
800
- };
801
- /**
802
- * @summary Updates hosting onboarding data
803
- */
804
- export const hostingOnboardingDataUpdate = (hostingId, hostingOnboardingDataUpdateBody, options) => {
805
- return axios.put(`/v1/hosting/${hostingId}/onboarding`, hostingOnboardingDataUpdateBody, options);
806
- };
807
- export const useHostingOnboardingDataUpdate = (options) => {
808
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
809
- const mutationFn = (props) => {
810
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
811
- return hostingOnboardingDataUpdate(hostingId, data, axiosOptions);
812
- };
813
- return useMutation(mutationFn, mutationOptions);
814
- };
815
- /**
816
- * Enable or disable shell access on an account by setting the shell.SSH key access must be established separately.
817
- * @summary hosting shell toggle
818
- */
819
- export const hostingShellToggle = (hostingId, hostingShellToggleBody, options) => {
820
- return axios.put(`/v1/hosting/${hostingId}/shell`, hostingShellToggleBody, options);
821
- };
822
- export const useHostingShellToggle = (options) => {
823
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
824
- const mutationFn = (props) => {
825
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
826
- return hostingShellToggle(hostingId, data, axiosOptions);
827
- };
828
- return useMutation(mutationFn, mutationOptions);
829
- };
830
- /**
831
- * Determine shell access status for an account.
832
- * @summary hosting shell_status
833
- */
834
- export const hostingShellInfo = (hostingId, options) => {
835
- return axios.get(`/v1/hosting/${hostingId}/shell`, options);
836
- };
837
- export const getHostingShellInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/shell`];
838
- export const useHostingShellInfo = (hostingId, options) => {
839
- var _a;
840
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
841
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingShellInfoQueryKey(hostingId);
842
- const queryFn = ({ signal }) => hostingShellInfo(hostingId, Object.assign({ signal }, axiosOptions));
843
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
844
- query.queryKey = queryKey;
845
- return query;
846
- };
847
- /**
848
- * Returns a list of sites.
849
- * @summary sites list
850
- */
851
- export const hostingSites = (hostingId, options) => {
852
- return axios.get(`/v1/hosting/${hostingId}/sites`, options);
853
- };
854
- export const getHostingSitesQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/sites`];
855
- export const useHostingSites = (hostingId, options) => {
856
- var _a;
857
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
858
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSitesQueryKey(hostingId);
859
- const queryFn = ({ signal }) => hostingSites(hostingId, Object.assign({ signal }, axiosOptions));
860
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
861
- query.queryKey = queryKey;
862
- return query;
863
- };
864
- /**
865
- * Add a site to the current hosting.
866
- * @summary sites add
867
- */
868
- export const hostingSiteAdd = (hostingId, hostingSiteAddBody, options) => {
869
- return axios.post(`/v1/hosting/${hostingId}/sites`, hostingSiteAddBody, options);
870
- };
871
- export const useHostingSiteAdd = (options) => {
872
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
873
- const mutationFn = (props) => {
874
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
875
- return hostingSiteAdd(hostingId, data, axiosOptions);
876
- };
877
- return useMutation(mutationFn, mutationOptions);
878
- };
879
- /**
880
- * Returns the hosting account's SSH information
881
- * @summary ssh info
882
- */
883
- export const hostingSshInfo = (hostingId, options) => {
884
- return axios.get(`/v1/hosting/${hostingId}/ssh`, options);
885
- };
886
- export const getHostingSshInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ssh`];
887
- export const useHostingSshInfo = (hostingId, options) => {
888
- var _a;
889
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
890
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSshInfoQueryKey(hostingId);
891
- const queryFn = ({ signal }) => hostingSshInfo(hostingId, Object.assign({ signal }, axiosOptions));
892
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
893
- query.queryKey = queryKey;
894
- return query;
895
- };
896
- /**
897
- * Fetches an SSH public (or optionally private) key.
898
- * @summary ssh key fetch
899
- */
900
- export const sshKeyFetch = (hostingId, params, options) => {
901
- 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) }));
902
- };
903
- export const getSshKeyFetchQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/ssh/fetch`, ...(params ? [params] : [])];
904
- export const useSshKeyFetch = (hostingId, params, options) => {
905
- var _a;
906
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
907
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyFetchQueryKey(hostingId, params);
908
- const queryFn = ({ signal }) => sshKeyFetch(hostingId, params, Object.assign({ signal }, axiosOptions));
909
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
910
- query.queryKey = queryKey;
911
- return query;
912
- };
913
- /**
914
- * Import public/private ssh key
915
- * @summary Import ssh key
916
- */
917
- export const sshKeyImport = (hostingId, sshKeyImportBody, options) => {
918
- return axios.post(`/v1/hosting/${hostingId}/ssh/import`, sshKeyImportBody, options);
919
- };
920
- export const useSshKeyImport = (options) => {
921
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
922
- const mutationFn = (props) => {
923
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
924
- return sshKeyImport(hostingId, data, axiosOptions);
925
- };
926
- return useMutation(mutationFn, mutationOptions);
927
- };
928
- /**
929
- * List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
930
- * @deprecated
931
- * @summary Deprecated - ssh keys list
932
- */
933
- export const sshKeyList = (hostingId, options) => {
934
- return axios.get(`/v1/hosting/${hostingId}/ssh/keys`, options);
935
- };
936
- export const getSshKeyListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ssh/keys`];
937
- export const useSshKeyList = (hostingId, options) => {
938
- var _a;
939
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
940
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListQueryKey(hostingId);
941
- const queryFn = ({ signal }) => sshKeyList(hostingId, Object.assign({ signal }, axiosOptions));
942
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
943
- query.queryKey = queryKey;
944
- return query;
945
- };
946
- /**
947
- * Deletes an SSH key
948
- * @summary ssh key delete
949
- */
950
- export const sshKey = (hostingId, sshKeyBody, options) => {
951
- return axios.delete(`/v1/hosting/${hostingId}/ssh/keys`, Object.assign({ data: sshKeyBody }, options));
952
- };
953
- export const useSshKey = (options) => {
954
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
955
- const mutationFn = (props) => {
956
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
957
- return sshKey(hostingId, data, axiosOptions);
958
- };
959
- return useMutation(mutationFn, mutationOptions);
960
- };
961
- /**
962
- * Generates public/private ssh keys
963
- * @summary Generate ssh key
964
- */
965
- export const sshKeyGenerate = (hostingId, sshKeyGenerateBody, options) => {
966
- return axios.post(`/v1/hosting/${hostingId}/ssh/keys`, sshKeyGenerateBody, options);
967
- };
968
- export const useSshKeyGenerate = (options) => {
969
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
970
- const mutationFn = (props) => {
971
- const { hostingId, data } = props !== null && props !== void 0 ? props : {};
972
- return sshKeyGenerate(hostingId, data, axiosOptions);
973
- };
974
- return useMutation(mutationFn, mutationOptions);
975
- };
976
- /**
977
- * 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.
978
- * @summary sso
979
- */
980
- export const sso = (hostingId, params, options) => {
981
- 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) }));
982
- };
983
- export const getSsoQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/sso`, ...(params ? [params] : [])];
984
- export const useSso = (hostingId, params, options) => {
985
- var _a;
986
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
987
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSsoQueryKey(hostingId, params);
988
- const queryFn = ({ signal }) => sso(hostingId, params, Object.assign({ signal }, axiosOptions));
989
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
990
- query.queryKey = queryKey;
991
- return query;
992
- };
993
- /**
994
- * Returns site list.
995
- * @summary Site list for an account
996
- */
997
- export const sitesList = (options) => {
998
- return axios.get(`/v1/sites`, options);
999
- };
1000
- export const getSitesListQueryKey = () => [`/v1/sites`];
1001
- export const useSitesList = (options) => {
1002
- var _a;
1003
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1004
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListQueryKey();
1005
- const queryFn = ({ signal }) => sitesList(Object.assign({ signal }, axiosOptions));
1006
- const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
1007
- query.queryKey = queryKey;
1008
- return query;
1009
- };
1010
- /**
1011
- * Returns site information.
1012
- * @summary info
1013
- */
1014
- export const sitesInfo = (siteId, options) => {
1015
- return axios.get(`/v1/sites/${siteId}`, options);
1016
- };
1017
- export const getSitesInfoQueryKey = (siteId) => [`/v1/sites/${siteId}`];
1018
- export const useSitesInfo = (siteId, options) => {
1019
- var _a;
1020
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1021
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesInfoQueryKey(siteId);
1022
- const queryFn = ({ signal }) => sitesInfo(siteId, Object.assign({ signal }, axiosOptions));
1023
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1024
- query.queryKey = queryKey;
1025
- return query;
1026
- };
1027
- /**
1028
- * Allows for updating a site's attributes
1029
- * @summary site update
1030
- */
1031
- export const siteUpdate = (siteId, siteUpdateBody, options) => {
1032
- return axios.put(`/v1/sites/${siteId}`, siteUpdateBody, options);
1033
- };
1034
- export const useSiteUpdate = (options) => {
1035
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1036
- const mutationFn = (props) => {
1037
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1038
- return siteUpdate(siteId, data, axiosOptions);
1039
- };
1040
- return useMutation(mutationFn, mutationOptions);
1041
- };
1042
- /**
1043
- * Allows deleting a site
1044
- * @summary site delete
1045
- */
1046
- export const site = (siteId, options) => {
1047
- return axios.delete(`/v1/sites/${siteId}`, options);
1048
- };
1049
- export const useSite = (options) => {
1050
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1051
- const mutationFn = (props) => {
1052
- const { siteId } = props !== null && props !== void 0 ? props : {};
1053
- return site(siteId, axiosOptions);
1054
- };
1055
- return useMutation(mutationFn, mutationOptions);
1056
- };
1057
- /**
1058
- * Returns the autoupdate status of the site's core, themes, and plugins
1059
- * @summary settings autoupdates
1060
- */
1061
- export const sitesAutoupdatesInfo = (siteId, options) => {
1062
- return axios.get(`/v1/sites/${siteId}/autoupdates`, options);
1063
- };
1064
- export const getSitesAutoupdatesInfoQueryKey = (siteId) => [`/v1/sites/${siteId}/autoupdates`];
1065
- export const useSitesAutoupdatesInfo = (siteId, options) => {
1066
- var _a;
1067
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1068
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAutoupdatesInfoQueryKey(siteId);
1069
- const queryFn = ({ signal }) => sitesAutoupdatesInfo(siteId, Object.assign({ signal }, axiosOptions));
1070
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1071
- query.queryKey = queryKey;
1072
- return query;
1073
- };
1074
- /**
1075
- * Enable / disable core, themes, or plugins autoupdates
1076
- * @summary settings autoupdates toggle
1077
- */
1078
- export const sitesAutoupdatesUpdate = (siteId, sitesAutoupdatesUpdateBody, options) => {
1079
- return axios.put(`/v1/sites/${siteId}/autoupdates`, sitesAutoupdatesUpdateBody, options);
1080
- };
1081
- export const useSitesAutoupdatesUpdate = (options) => {
1082
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1083
- const mutationFn = (props) => {
1084
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1085
- return sitesAutoupdatesUpdate(siteId, data, axiosOptions);
1086
- };
1087
- return useMutation(mutationFn, mutationOptions);
1088
- };
1089
- /**
1090
- * Returns whether the site has either Codeguard or Jetpack-backup.
1091
- * @deprecated
1092
- * @summary Deprecated - has backup
1093
- */
1094
- export const sitesBackups = (siteId, options) => {
1095
- return axios.get(`/v1/sites/${siteId}/backups`, options);
1096
- };
1097
- export const getSitesBackupsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups`];
1098
- export const useSitesBackups = (siteId, options) => {
1099
- var _a;
1100
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1101
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsQueryKey(siteId);
1102
- const queryFn = ({ signal }) => sitesBackups(siteId, Object.assign({ signal }, axiosOptions));
1103
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1104
- query.queryKey = queryKey;
1105
- return query;
1106
- };
1107
- /**
1108
- * Returns whether the site has either Codeguard or Jetpack-backup.
1109
- * @summary has backups
1110
- */
1111
- export const sitesHasBackups = (siteId, options) => {
1112
- return axios.get(`/v1/sites/${siteId}/backups/check`, options);
1113
- };
1114
- export const getSitesHasBackupsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/check`];
1115
- export const useSitesHasBackups = (siteId, options) => {
1116
- var _a;
1117
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1118
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesHasBackupsQueryKey(siteId);
1119
- const queryFn = ({ signal }) => sitesHasBackups(siteId, Object.assign({ signal }, axiosOptions));
1120
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1121
- query.queryKey = queryKey;
1122
- return query;
1123
- };
1124
- /**
1125
- * Adds the site to the codeguard
1126
- * @summary Add additional sites to codeguard
1127
- */
1128
- export const sitesBackupsCodeguard = (siteId, options) => {
1129
- return axios.post(`/v1/sites/${siteId}/backups/codeguard`, undefined, options);
1130
- };
1131
- export const useSitesBackupsCodeguard = (options) => {
1132
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1133
- const mutationFn = (props) => {
1134
- const { siteId } = props !== null && props !== void 0 ? props : {};
1135
- return sitesBackupsCodeguard(siteId, axiosOptions);
1136
- };
1137
- return useMutation(mutationFn, mutationOptions);
1138
- };
1139
- /**
1140
- * 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.
1141
- * @summary site backup details
1142
- */
1143
- export const sitesBackupsDetails = (siteId, options) => {
1144
- return axios.get(`/v1/sites/${siteId}/backups/details`, options);
1145
- };
1146
- export const getSitesBackupsDetailsQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/details`];
1147
- export const useSitesBackupsDetails = (siteId, options) => {
1148
- var _a;
1149
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1150
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsDetailsQueryKey(siteId);
1151
- const queryFn = ({ signal }) => sitesBackupsDetails(siteId, Object.assign({ signal }, axiosOptions));
1152
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1153
- query.queryKey = queryKey;
1154
- return query;
1155
- };
1156
- /**
1157
- * The products supported jetpack-backup addon and jetpack-backup plugin
1158
- * @summary Returns the status of the jetpack-backup product
1159
- */
1160
- export const jetpackBackupStatus = (siteId, options) => {
1161
- return axios.get(`/v1/sites/${siteId}/backups/jetpack`, options);
1162
- };
1163
- export const getJetpackBackupStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/backups/jetpack`];
1164
- export const useJetpackBackupStatus = (siteId, options) => {
1165
- var _a;
1166
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1167
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getJetpackBackupStatusQueryKey(siteId);
1168
- const queryFn = ({ signal }) => jetpackBackupStatus(siteId, Object.assign({ signal }, axiosOptions));
1169
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1170
- query.queryKey = queryKey;
1171
- return query;
1172
- };
1173
- /**
1174
- * Returns a list of DNS records for the site's domain.
1175
- * @summary dns
1176
- */
1177
- export const sitesDns = (siteId, params, options) => {
1178
- 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) }));
1179
- };
1180
- export const getSitesDnsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/dns`, ...(params ? [params] : [])];
1181
- export const useSitesDns = (siteId, params, options) => {
1182
- var _a;
1183
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1184
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDnsQueryKey(siteId, params);
1185
- const queryFn = ({ signal }) => sitesDns(siteId, params, Object.assign({ signal }, axiosOptions));
1186
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1187
- query.queryKey = queryKey;
1188
- return query;
1189
- };
1190
- /**
1191
- * Determines if the domain has the correct DNS setup for site
1192
- * @summary Domain DNS setup for site
1193
- */
1194
- export const sitesDomain = (siteId, options) => {
1195
- return axios.get(`/v1/sites/${siteId}/domain`, options);
1196
- };
1197
- export const getSitesDomainQueryKey = (siteId) => [`/v1/sites/${siteId}/domain`];
1198
- export const useSitesDomain = (siteId, options) => {
1199
- var _a;
1200
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1201
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainQueryKey(siteId);
1202
- const queryFn = ({ signal }) => sitesDomain(siteId, Object.assign({ signal }, axiosOptions));
1203
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1204
- query.queryKey = queryKey;
1205
- return query;
1206
- };
1207
- /**
1208
- * Add or promote pending site url
1209
- * @summary Add pending site url
1210
- */
1211
- export const sitesDomainUrl = (siteId, sitesDomainUrlBody, options) => {
1212
- return axios.post(`/v1/sites/${siteId}/domain`, sitesDomainUrlBody, options);
1213
- };
1214
- export const useSitesDomainUrl = (options) => {
1215
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1216
- const mutationFn = (props) => {
1217
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1218
- return sitesDomainUrl(siteId, data, axiosOptions);
1219
- };
1220
- return useMutation(mutationFn, mutationOptions);
1221
- };
1222
- /**
1223
- * Delete pending domain
1224
- * @summary Delete pending domain
1225
- */
1226
- export const sitePendingDomainDelete = (siteId, options) => {
1227
- return axios.delete(`/v1/sites/${siteId}/pending-domain`, options);
1228
- };
1229
- export const useSitePendingDomainDelete = (options) => {
1230
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1231
- const mutationFn = (props) => {
1232
- const { siteId } = props !== null && props !== void 0 ? props : {};
1233
- return sitePendingDomainDelete(siteId, axiosOptions);
1234
- };
1235
- return useMutation(mutationFn, mutationOptions);
1236
- };
1237
- /**
1238
- * cache purge site and url
1239
- * @summary cache purge url
1240
- */
1241
- export const sitesPerformanceCachepurge = (siteId, sitesPerformanceCachepurgeBody, options) => {
1242
- return axios.post(`/v1/sites/${siteId}/performance/cachepurge`, sitesPerformanceCachepurgeBody, options);
1243
- };
1244
- export const useSitesPerformanceCachepurge = (options) => {
1245
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1246
- const mutationFn = (props) => {
1247
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1248
- return sitesPerformanceCachepurge(siteId, data, axiosOptions);
1249
- };
1250
- return useMutation(mutationFn, mutationOptions);
1251
- };
1252
- /**
1253
- * Returns the status of endurance_cache_level
1254
- * @summary Get status of endurance cache level
1255
- */
1256
- export const sitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
1257
- return axios.get(`/v1/sites/${siteId}/performance/endurance_cache_level`, options);
1258
- };
1259
- export const getSitesPerformanceEnduranceCacheLevelStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/performance/endurance_cache_level`];
1260
- export const useSitesPerformanceEnduranceCacheLevelStatus = (siteId, 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 : getSitesPerformanceEnduranceCacheLevelStatusQueryKey(siteId);
1264
- const queryFn = ({ signal }) => sitesPerformanceEnduranceCacheLevelStatus(siteId, 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
- * Set endurance cache level to 0, 1,2 or 3
1271
- * @summary Set endurance cache level
1272
- */
1273
- export const sitesPerformanceEnduranceCacheLevel = (siteId, sitesPerformanceEnduranceCacheLevelBody, options) => {
1274
- return axios.post(`/v1/sites/${siteId}/performance/endurance_cache_level`, sitesPerformanceEnduranceCacheLevelBody, options);
1275
- };
1276
- export const useSitesPerformanceEnduranceCacheLevel = (options) => {
1277
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1278
- const mutationFn = (props) => {
1279
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1280
- return sitesPerformanceEnduranceCacheLevel(siteId, data, axiosOptions);
1281
- };
1282
- return useMutation(mutationFn, mutationOptions);
1283
- };
1284
- /**
1285
- * Update the endurance page cache
1286
- * @summary update the endurance cache page
1287
- */
1288
- export const sitesPerformanceEndurancePageCache = (siteId, options) => {
1289
- return axios.put(`/v1/sites/${siteId}/performance/endurance_page_cache`, undefined, options);
1290
- };
1291
- export const useSitesPerformanceEndurancePageCache = (options) => {
1292
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1293
- const mutationFn = (props) => {
1294
- const { siteId } = props !== null && props !== void 0 ? props : {};
1295
- return sitesPerformanceEndurancePageCache(siteId, axiosOptions);
1296
- };
1297
- return useMutation(mutationFn, mutationOptions);
1298
- };
1299
- /**
1300
- * Returns a list of the site's plugins
1301
- * @summary plugins
1302
- */
1303
- export const sitePlugins = (siteId, options) => {
1304
- return axios.get(`/v1/sites/${siteId}/plugins`, options);
1305
- };
1306
- export const getSitePluginsQueryKey = (siteId) => [`/v1/sites/${siteId}/plugins`];
1307
- export const useSitePlugins = (siteId, options) => {
1308
- var _a;
1309
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1310
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitePluginsQueryKey(siteId);
1311
- const queryFn = ({ signal }) => sitePlugins(siteId, Object.assign({ signal }, axiosOptions));
1312
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1313
- query.queryKey = queryKey;
1314
- return query;
1315
- };
1316
- /**
1317
- * Enables / disables plugin auto-updates
1318
- * @deprecated
1319
- * @summary plugins autoupdate
1320
- */
1321
- export const sitePluginsAutoupdate = (siteId, sitePluginsAutoupdateBody, options) => {
1322
- return axios.post(`/v1/sites/${siteId}/plugins/autoupdate`, sitePluginsAutoupdateBody, options);
1323
- };
1324
- export const useSitePluginsAutoupdate = (options) => {
1325
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1326
- const mutationFn = (props) => {
1327
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1328
- return sitePluginsAutoupdate(siteId, data, axiosOptions);
1329
- };
1330
- return useMutation(mutationFn, mutationOptions);
1331
- };
1332
- /**
1333
- * Enables / disables a plugin
1334
- * @summary plugins toggle
1335
- */
1336
- export const sitePluginsToggle = (siteId, sitePluginsToggleBody, options) => {
1337
- return axios.post(`/v1/sites/${siteId}/plugins/toggle`, sitePluginsToggleBody, options);
1338
- };
1339
- export const useSitePluginsToggle = (options) => {
1340
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1341
- const mutationFn = (props) => {
1342
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1343
- return sitePluginsToggle(siteId, data, axiosOptions);
1344
- };
1345
- return useMutation(mutationFn, mutationOptions);
1346
- };
1347
- /**
1348
- * Updates a plugin
1349
- * @summary plugins update
1350
- */
1351
- export const sitePluginsUpdate = (siteId, sitePluginsUpdateBody, options) => {
1352
- return axios.post(`/v1/sites/${siteId}/plugins/update`, sitePluginsUpdateBody, options);
1353
- };
1354
- export const useSitePluginsUpdate = (options) => {
1355
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1356
- const mutationFn = (props) => {
1357
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1358
- return sitePluginsUpdate(siteId, data, axiosOptions);
1359
- };
1360
- return useMutation(mutationFn, mutationOptions);
1361
- };
1362
- /**
1363
- * Resets a site - deletes/reinstalls the site.
1364
- * @summary reset site
1365
- */
1366
- export const resetSite = (siteId, options) => {
1367
- return axios.post(`/v1/sites/${siteId}/reset`, undefined, options);
1368
- };
1369
- export const useResetSite = (options) => {
1370
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1371
- const mutationFn = (props) => {
1372
- const { siteId } = props !== null && props !== void 0 ? props : {};
1373
- return resetSite(siteId, axiosOptions);
1374
- };
1375
- return useMutation(mutationFn, mutationOptions);
1376
- };
1377
- /**
1378
- * Performs a checksum of the site's core files to verify integrity.
1379
- * @summary core files checksum
1380
- */
1381
- export const sitesSecurityCheckCore = (siteId, options) => {
1382
- return axios.get(`/v1/sites/${siteId}/security/core/check`, options);
1383
- };
1384
- export const getSitesSecurityCheckCoreQueryKey = (siteId) => [`/v1/sites/${siteId}/security/core/check`];
1385
- export const useSitesSecurityCheckCore = (siteId, options) => {
1386
- var _a;
1387
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1388
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityCheckCoreQueryKey(siteId);
1389
- const queryFn = ({ signal }) => sitesSecurityCheckCore(siteId, Object.assign({ signal }, axiosOptions));
1390
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1391
- query.queryKey = queryKey;
1392
- return query;
1393
- };
1394
- /**
1395
- * Resets the site's core files.
1396
- * @summary core files reset
1397
- */
1398
- export const sitesSecurityResetCoreFiles = (siteId, options) => {
1399
- return axios.post(`/v1/sites/${siteId}/security/core/reset`, undefined, options);
1400
- };
1401
- export const useSitesSecurityResetCoreFiles = (options) => {
1402
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1403
- const mutationFn = (props) => {
1404
- const { siteId } = props !== null && props !== void 0 ? props : {};
1405
- return sitesSecurityResetCoreFiles(siteId, axiosOptions);
1406
- };
1407
- return useMutation(mutationFn, mutationOptions);
1408
- };
1409
- /**
1410
- * Returns the HTTPS redirection status.
1411
- * @summary https redirection status
1412
- */
1413
- export const sitesSecurityHttpsRedirectionStatus = (siteId, options) => {
1414
- return axios.get(`/v1/sites/${siteId}/security/https`, options);
1415
- };
1416
- export const getSitesSecurityHttpsRedirectionStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/security/https`];
1417
- export const useSitesSecurityHttpsRedirectionStatus = (siteId, options) => {
1418
- var _a;
1419
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1420
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityHttpsRedirectionStatusQueryKey(siteId);
1421
- const queryFn = ({ signal }) => sitesSecurityHttpsRedirectionStatus(siteId, Object.assign({ signal }, axiosOptions));
1422
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1423
- query.queryKey = queryKey;
1424
- return query;
1425
- };
1426
- /**
1427
- * Enables / disables HTTPS redirection.
1428
- * @summary https redirection toggle
1429
- */
1430
- export const sitesSecurityHttpsEnableDisableSsl = (siteId, sitesSecurityHttpsEnableDisableSslBody, options) => {
1431
- return axios.post(`/v1/sites/${siteId}/security/https`, sitesSecurityHttpsEnableDisableSslBody, options);
1432
- };
1433
- export const useSitesSecurityHttpsEnableDisableSsl = (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 sitesSecurityHttpsEnableDisableSsl(siteId, data, axiosOptions);
1438
- };
1439
- return useMutation(mutationFn, mutationOptions);
1440
- };
1441
- /**
1442
- * Returns the site's sitelock information.
1443
- * @summary sitelock info
1444
- */
1445
- export const sitesSecuritySitelock = (siteId, options) => {
1446
- return axios.get(`/v1/sites/${siteId}/security/sitelock`, options);
1447
- };
1448
- export const getSitesSecuritySitelockQueryKey = (siteId) => [`/v1/sites/${siteId}/security/sitelock`];
1449
- export const useSitesSecuritySitelock = (siteId, options) => {
1450
- var _a;
1451
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1452
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockQueryKey(siteId);
1453
- const queryFn = ({ signal }) => sitesSecuritySitelock(siteId, Object.assign({ signal }, axiosOptions));
1454
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1455
- query.queryKey = queryKey;
1456
- return query;
1457
- };
1458
- /**
1459
- * Disables / enables cPanel to generate Let's Encrypt SSLs for the site.
1460
- * @summary ssl lets encrypt toggle
1461
- */
1462
- export const sitesSecuritySslAcme = (siteId, options) => {
1463
- return axios.post(`/v1/sites/${siteId}/security/ssl/acme`, undefined, options);
1464
- };
1465
- export const useSitesSecuritySslAcme = (options) => {
1466
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1467
- const mutationFn = (props) => {
1468
- const { siteId } = props !== null && props !== void 0 ? props : {};
1469
- return sitesSecuritySslAcme(siteId, axiosOptions);
1470
- };
1471
- return useMutation(mutationFn, mutationOptions);
1472
- };
1473
- /**
1474
- * Returns the site's SSL Status
1475
- * @summary ssl status
1476
- */
1477
- export const sitesSecuritySslStatus = (siteId, options) => {
1478
- return axios.get(`/v1/sites/${siteId}/security/ssl/status`, options);
1479
- };
1480
- export const getSitesSecuritySslStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/security/ssl/status`];
1481
- export const useSitesSecuritySslStatus = (siteId, options) => {
1482
- var _a;
1483
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1484
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySslStatusQueryKey(siteId);
1485
- const queryFn = ({ signal }) => sitesSecuritySslStatus(siteId, Object.assign({ signal }, axiosOptions));
1486
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1487
- query.queryKey = queryKey;
1488
- return query;
1489
- };
1490
- /**
1491
- * Returns status of plugin autoupdate for site
1492
- * @deprecated
1493
- * @summary plugins autoupdate status
1494
- */
1495
- export const siteSettingsAutoupdatePlugins = (siteId, options) => {
1496
- return axios.get(`/v1/sites/${siteId}/settings/autoupdate/plugins`, options);
1497
- };
1498
- export const getSiteSettingsAutoupdatePluginsQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/autoupdate/plugins`];
1499
- export const useSiteSettingsAutoupdatePlugins = (siteId, options) => {
1500
- var _a;
1501
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1502
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteSettingsAutoupdatePluginsQueryKey(siteId);
1503
- const queryFn = ({ signal }) => siteSettingsAutoupdatePlugins(siteId, Object.assign({ signal }, axiosOptions));
1504
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1505
- query.queryKey = queryKey;
1506
- return query;
1507
- };
1508
- /**
1509
- * Returns the autoupdate status of the site's core, themes, and plugins
1510
- * @deprecated
1511
- * @summary settings autoupdates
1512
- */
1513
- export const sitesSettingsAutoupdates = (siteId, options) => {
1514
- return axios.get(`/v1/sites/${siteId}/settings/autoupdates`, options);
1515
- };
1516
- export const getSitesSettingsAutoupdatesQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/autoupdates`];
1517
- export const useSitesSettingsAutoupdates = (siteId, options) => {
1518
- var _a;
1519
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1520
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsAutoupdatesQueryKey(siteId);
1521
- const queryFn = ({ signal }) => sitesSettingsAutoupdates(siteId, Object.assign({ signal }, axiosOptions));
1522
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1523
- query.queryKey = queryKey;
1524
- return query;
1525
- };
1526
- /**
1527
- * Enables WP Core autoupdates
1528
- * @deprecated
1529
- * @summary settings autoupdates core enable
1530
- */
1531
- export const sitesSettingsAutoupdatesCore = (siteId, sitesSettingsAutoupdatesCoreBody, options) => {
1532
- return axios.post(`/v1/sites/${siteId}/settings/autoupdates/core`, sitesSettingsAutoupdatesCoreBody, options);
1533
- };
1534
- export const useSitesSettingsAutoupdatesCore = (options) => {
1535
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1536
- const mutationFn = (props) => {
1537
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1538
- return sitesSettingsAutoupdatesCore(siteId, data, axiosOptions);
1539
- };
1540
- return useMutation(mutationFn, mutationOptions);
1541
- };
1542
- /**
1543
- * Enables theme autoupdates
1544
- * @deprecated
1545
- * @summary settings autoupdate theme enable
1546
- */
1547
- export const sitesSettingsAutoupdatesTheme = (siteId, sitesSettingsAutoupdatesThemeBody, options) => {
1548
- return axios.post(`/v1/sites/${siteId}/settings/autoupdates/theme`, sitesSettingsAutoupdatesThemeBody, options);
1549
- };
1550
- export const useSitesSettingsAutoupdatesTheme = (options) => {
1551
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1552
- const mutationFn = (props) => {
1553
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1554
- return sitesSettingsAutoupdatesTheme(siteId, data, axiosOptions);
1555
- };
1556
- return useMutation(mutationFn, mutationOptions);
1557
- };
1558
- /**
1559
- * Returns whether the coming soon setting is enable or disabled
1560
- * @summary settings coming soon page status
1561
- */
1562
- export const sitesSettingsComingSoon = (siteId, options) => {
1563
- return axios.get(`/v1/sites/${siteId}/settings/coming-soon`, options);
1564
- };
1565
- export const getSitesSettingsComingSoonQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/coming-soon`];
1566
- export const useSitesSettingsComingSoon = (siteId, options) => {
1567
- var _a;
1568
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1569
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsComingSoonQueryKey(siteId);
1570
- const queryFn = ({ signal }) => sitesSettingsComingSoon(siteId, Object.assign({ signal }, axiosOptions));
1571
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1572
- query.queryKey = queryKey;
1573
- return query;
1574
- };
1575
- /**
1576
- * Enables/disables the coming soon (under-construction) page
1577
- * @summary settings coming soon toggle
1578
- */
1579
- export const sitesSettingsComingSoonToggle = (siteId, sitesSettingsComingSoonToggleBody, options) => {
1580
- return axios.post(`/v1/sites/${siteId}/settings/coming-soon`, sitesSettingsComingSoonToggleBody, options);
1581
- };
1582
- export const useSitesSettingsComingSoonToggle = (options) => {
1583
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1584
- const mutationFn = (props) => {
1585
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1586
- return sitesSettingsComingSoonToggle(siteId, data, axiosOptions);
1587
- };
1588
- return useMutation(mutationFn, mutationOptions);
1589
- };
1590
- /**
1591
- * Returns the site's debug mode status
1592
- * @summary settings debug status
1593
- */
1594
- export const sitesSettingsDebug = (siteId, options) => {
1595
- return axios.get(`/v1/sites/${siteId}/settings/debug`, options);
1596
- };
1597
- export const getSitesSettingsDebugQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/debug`];
1598
- export const useSitesSettingsDebug = (siteId, options) => {
1599
- var _a;
1600
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1601
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsDebugQueryKey(siteId);
1602
- const queryFn = ({ signal }) => sitesSettingsDebug(siteId, Object.assign({ signal }, axiosOptions));
1603
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1604
- query.queryKey = queryKey;
1605
- return query;
1606
- };
1607
- /**
1608
- * Enables or disables the output and display of site generated errors on the site
1609
- * @summary settings debug toggle
1610
- */
1611
- export const sitesSettingsDebugToggle = (siteId, sitesSettingsDebugToggleBody, options) => {
1612
- return axios.post(`/v1/sites/${siteId}/settings/debug`, sitesSettingsDebugToggleBody, options);
1613
- };
1614
- export const useSitesSettingsDebugToggle = (options) => {
1615
- const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1616
- const mutationFn = (props) => {
1617
- const { siteId, data } = props !== null && props !== void 0 ? props : {};
1618
- return sitesSettingsDebugToggle(siteId, data, axiosOptions);
1619
- };
1620
- return useMutation(mutationFn, mutationOptions);
1621
- };
1622
- /**
1623
- * Updates the site's PHP version
1624
- * @summary settings php version update
1625
- */
1626
- export const sitesSettingsPhpVersionUpdate = (siteId, sitesSettingsPhpVersionUpdateBody, options) => {
1627
- return axios.post(`/v1/sites/${siteId}/settings/php-version`, sitesSettingsPhpVersionUpdateBody, options);
1628
- };
1629
- export const useSitesSettingsPhpVersionUpdate = (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 sitesSettingsPhpVersionUpdate(siteId, data, axiosOptions);
1634
- };
1635
- return useMutation(mutationFn, mutationOptions);
1636
- };
1637
- /**
1638
- * Gets the list of PHP versions available/installed
1639
- * @summary settings php versions list
1640
- */
1641
- export const sitesSettingsPhpVersions = (siteId, options) => {
1642
- return axios.get(`/v1/sites/${siteId}/settings/php-versions`, options);
1643
- };
1644
- export const getSitesSettingsPhpVersionsQueryKey = (siteId) => [`/v1/sites/${siteId}/settings/php-versions`];
1645
- export const useSitesSettingsPhpVersions = (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 : getSitesSettingsPhpVersionsQueryKey(siteId);
1649
- const queryFn = ({ signal }) => sitesSettingsPhpVersions(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
- * Returns an SSO token or login URL for the site (if supported).
1656
- * @summary sso
1657
- */
1658
- export const sitesSso = (siteId, params, options) => {
1659
- 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) }));
1660
- };
1661
- export const getSitesSsoQueryKey = (siteId, params) => [`/v1/sites/${siteId}/sso`, ...(params ? [params] : [])];
1662
- export const useSitesSso = (siteId, params, options) => {
1663
- var _a;
1664
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1665
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSsoQueryKey(siteId, params);
1666
- const queryFn = ({ signal }) => sitesSso(siteId, params, Object.assign({ signal }, axiosOptions));
1667
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1668
- query.queryKey = queryKey;
1669
- return query;
1670
- };
1671
- /**
1672
- * @summary site status
1673
- */
1674
- export const siteStatus = (siteId, options) => {
1675
- return axios.get(`/v1/sites/${siteId}/status`, options);
1676
- };
1677
- export const getSiteStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/status`];
1678
- export const useSiteStatus = (siteId, options) => {
1679
- var _a;
1680
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1681
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteStatusQueryKey(siteId);
1682
- const queryFn = ({ signal }) => siteStatus(siteId, Object.assign({ signal }, axiosOptions));
1683
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1684
- query.queryKey = queryKey;
1685
- return query;
1686
- };
1687
- /**
1688
- * Returns a list of the site's users
1689
- * @summary users
1690
- */
1691
- export const siteUsers = (siteId, options) => {
1692
- return axios.get(`/v1/sites/${siteId}/users`, options);
1693
- };
1694
- export const getSiteUsersQueryKey = (siteId) => [`/v1/sites/${siteId}/users`];
1695
- export const useSiteUsers = (siteId, options) => {
1696
- var _a;
1697
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1698
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteUsersQueryKey(siteId);
1699
- const queryFn = ({ signal }) => siteUsers(siteId, Object.assign({ signal }, axiosOptions));
1700
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1701
- query.queryKey = queryKey;
1702
- return query;
1703
- };
1704
- /**
1705
- * Returns site version information.
1706
- * @summary version
1707
- */
1708
- export const sitesVersion = (siteId, options) => {
1709
- return axios.get(`/v1/sites/${siteId}/version`, options);
1710
- };
1711
- export const getSitesVersionQueryKey = (siteId) => [`/v1/sites/${siteId}/version`];
1712
- export const useSitesVersion = (siteId, options) => {
1713
- var _a;
1714
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1715
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesVersionQueryKey(siteId);
1716
- const queryFn = ({ signal }) => sitesVersion(siteId, Object.assign({ signal }, axiosOptions));
1717
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1718
- query.queryKey = queryKey;
1719
- return query;
1720
- };
1721
- /**
1722
- * Returns a list of sites.
1723
- * @summary sites list v2
1724
- */
1725
- export const hostingSitesV2 = (hostingId, options) => {
1726
- return axios.get(`/v2/hosting/${hostingId}/sites`, options);
1727
- };
1728
- export const getHostingSitesV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/sites`];
1729
- export const useHostingSitesV2 = (hostingId, options) => {
1730
- var _a;
1731
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1732
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSitesV2QueryKey(hostingId);
1733
- const queryFn = ({ signal }) => hostingSitesV2(hostingId, Object.assign({ signal }, axiosOptions));
1734
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1735
- query.queryKey = queryKey;
1736
- return query;
1737
- };
1738
- /**
1739
- * List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
1740
- * @summary ssh keys list
1741
- */
1742
- export const sshKeyListV2 = (hostingId, options) => {
1743
- return axios.get(`/v2/hosting/${hostingId}/ssh/keys`, options);
1744
- };
1745
- export const getSshKeyListV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/ssh/keys`];
1746
- export const useSshKeyListV2 = (hostingId, options) => {
1747
- var _a;
1748
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1749
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListV2QueryKey(hostingId);
1750
- const queryFn = ({ signal }) => sshKeyListV2(hostingId, Object.assign({ signal }, axiosOptions));
1751
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
1752
- query.queryKey = queryKey;
1753
- return query;
1754
- };