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