@newfold/huapi-js 1.897.0 → 1.905.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/orval.config.d.ts +0 -0
- package/orval.config.js +0 -3
- package/package.json +3 -3
- package/src/index.d.ts +1660 -159
- package/src/index.js +1615 -455
- package/src/index.schemas.d.ts +580 -319
- package/src/index.schemas.js +6 -0
- package/src/index.msw.d.ts +0 -979
- package/src/index.msw.js +0 -430
package/src/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.31.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
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.
|
|
6
|
+
* OpenAPI spec version: 1.905.0
|
|
7
7
|
*/
|
|
8
|
+
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
|
8
9
|
import axios from 'axios';
|
|
9
|
-
import { useQuery, useInfiniteQuery, useMutation } from '@tanstack/react-query';
|
|
10
10
|
/**
|
|
11
11
|
* Returns a hosting account list
|
|
12
12
|
* @summary Hosting account list for a customer
|
|
@@ -14,14 +14,23 @@ import { useQuery, useInfiniteQuery, useMutation } from '@tanstack/react-query';
|
|
|
14
14
|
export const accountHostingList = (options) => {
|
|
15
15
|
return axios.get(`/v1/account/hosting`, options);
|
|
16
16
|
};
|
|
17
|
-
export const getAccountHostingListQueryKey = () =>
|
|
18
|
-
|
|
17
|
+
export const getAccountHostingListQueryKey = () => {
|
|
18
|
+
return [`/v1/account/hosting`];
|
|
19
|
+
};
|
|
20
|
+
export const getAccountHostingListQueryOptions = (options) => {
|
|
19
21
|
var _a;
|
|
20
22
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
21
23
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountHostingListQueryKey();
|
|
22
24
|
const queryFn = ({ signal }) => accountHostingList(Object.assign({ signal }, axiosOptions));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @summary Hosting account list for a customer
|
|
29
|
+
*/
|
|
30
|
+
export const useAccountHostingList = (options) => {
|
|
31
|
+
const queryOptions = getAccountHostingListQueryOptions(options);
|
|
32
|
+
const query = useQuery(queryOptions);
|
|
33
|
+
query.queryKey = queryOptions.queryKey;
|
|
25
34
|
return query;
|
|
26
35
|
};
|
|
27
36
|
/**
|
|
@@ -31,14 +40,23 @@ export const useAccountHostingList = (options) => {
|
|
|
31
40
|
export const codeguardBackupList = (addonId, params, options) => {
|
|
32
41
|
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) }));
|
|
33
42
|
};
|
|
34
|
-
export const getCodeguardBackupListQueryKey = (addonId, params) =>
|
|
35
|
-
|
|
43
|
+
export const getCodeguardBackupListQueryKey = (addonId, params) => {
|
|
44
|
+
return [`/v1/addons/codeguard/${addonId}/backups`, ...(params ? [params] : [])];
|
|
45
|
+
};
|
|
46
|
+
export const getCodeguardBackupListQueryOptions = (addonId, params, options) => {
|
|
36
47
|
var _a;
|
|
37
48
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
38
49
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardBackupListQueryKey(addonId, params);
|
|
39
50
|
const queryFn = ({ signal }) => codeguardBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @summary backup list
|
|
55
|
+
*/
|
|
56
|
+
export const useCodeguardBackupList = (addonId, params, options) => {
|
|
57
|
+
const queryOptions = getCodeguardBackupListQueryOptions(addonId, params, options);
|
|
58
|
+
const query = useQuery(queryOptions);
|
|
59
|
+
query.queryKey = queryOptions.queryKey;
|
|
42
60
|
return query;
|
|
43
61
|
};
|
|
44
62
|
/**
|
|
@@ -48,13 +66,20 @@ export const useCodeguardBackupList = (addonId, params, options) => {
|
|
|
48
66
|
export const codeguardBackupCreate = (addonId, codeguardBackupCreateBody, options) => {
|
|
49
67
|
return axios.post(`/v1/addons/codeguard/${addonId}/backups`, codeguardBackupCreateBody, options);
|
|
50
68
|
};
|
|
51
|
-
export const
|
|
69
|
+
export const getCodeguardBackupCreateMutationOptions = (options) => {
|
|
52
70
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
53
71
|
const mutationFn = (props) => {
|
|
54
72
|
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
55
73
|
return codeguardBackupCreate(addonId, data, axiosOptions);
|
|
56
74
|
};
|
|
57
|
-
return
|
|
75
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @summary backup create
|
|
79
|
+
*/
|
|
80
|
+
export const useCodeguardBackupCreate = (options) => {
|
|
81
|
+
const mutationOptions = getCodeguardBackupCreateMutationOptions(options);
|
|
82
|
+
return useMutation(mutationOptions);
|
|
58
83
|
};
|
|
59
84
|
/**
|
|
60
85
|
* Queues the backup download.
|
|
@@ -63,13 +88,20 @@ export const useCodeguardBackupCreate = (options) => {
|
|
|
63
88
|
export const codeguardBackupDownload = (addonId, codeguardBackupDownloadBody, options) => {
|
|
64
89
|
return axios.post(`/v1/addons/codeguard/${addonId}/backups/download`, codeguardBackupDownloadBody, options);
|
|
65
90
|
};
|
|
66
|
-
export const
|
|
91
|
+
export const getCodeguardBackupDownloadMutationOptions = (options) => {
|
|
67
92
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
68
93
|
const mutationFn = (props) => {
|
|
69
94
|
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
70
95
|
return codeguardBackupDownload(addonId, data, axiosOptions);
|
|
71
96
|
};
|
|
72
|
-
return
|
|
97
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* @summary backup download
|
|
101
|
+
*/
|
|
102
|
+
export const useCodeguardBackupDownload = (options) => {
|
|
103
|
+
const mutationOptions = getCodeguardBackupDownloadMutationOptions(options);
|
|
104
|
+
return useMutation(mutationOptions);
|
|
73
105
|
};
|
|
74
106
|
/**
|
|
75
107
|
* Restores a website and database backup
|
|
@@ -78,13 +110,20 @@ export const useCodeguardBackupDownload = (options) => {
|
|
|
78
110
|
export const codeguardBackupRestore = (addonId, codeguardBackupRestoreBody, options) => {
|
|
79
111
|
return axios.post(`/v1/addons/codeguard/${addonId}/backups/restore`, codeguardBackupRestoreBody, options);
|
|
80
112
|
};
|
|
81
|
-
export const
|
|
113
|
+
export const getCodeguardBackupRestoreMutationOptions = (options) => {
|
|
82
114
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
83
115
|
const mutationFn = (props) => {
|
|
84
116
|
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
85
117
|
return codeguardBackupRestore(addonId, data, axiosOptions);
|
|
86
118
|
};
|
|
87
|
-
return
|
|
119
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* @summary backups restore
|
|
123
|
+
*/
|
|
124
|
+
export const useCodeguardBackupRestore = (options) => {
|
|
125
|
+
const mutationOptions = getCodeguardBackupRestoreMutationOptions(options);
|
|
126
|
+
return useMutation(mutationOptions);
|
|
88
127
|
};
|
|
89
128
|
/**
|
|
90
129
|
* Returns all database records CodeGuard maintains for this user's account.
|
|
@@ -93,14 +132,23 @@ export const useCodeguardBackupRestore = (options) => {
|
|
|
93
132
|
export const codeguardDatabaseList = (addonId, options) => {
|
|
94
133
|
return axios.get(`/v1/addons/codeguard/${addonId}/databases`, options);
|
|
95
134
|
};
|
|
96
|
-
export const getCodeguardDatabaseListQueryKey = (addonId) =>
|
|
97
|
-
|
|
135
|
+
export const getCodeguardDatabaseListQueryKey = (addonId) => {
|
|
136
|
+
return [`/v1/addons/codeguard/${addonId}/databases`];
|
|
137
|
+
};
|
|
138
|
+
export const getCodeguardDatabaseListQueryOptions = (addonId, options) => {
|
|
98
139
|
var _a;
|
|
99
140
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
100
141
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseListQueryKey(addonId);
|
|
101
142
|
const queryFn = ({ signal }) => codeguardDatabaseList(addonId, Object.assign({ signal }, axiosOptions));
|
|
102
|
-
|
|
103
|
-
|
|
143
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* @summary database list
|
|
147
|
+
*/
|
|
148
|
+
export const useCodeguardDatabaseList = (addonId, options) => {
|
|
149
|
+
const queryOptions = getCodeguardDatabaseListQueryOptions(addonId, options);
|
|
150
|
+
const query = useQuery(queryOptions);
|
|
151
|
+
query.queryKey = queryOptions.queryKey;
|
|
104
152
|
return query;
|
|
105
153
|
};
|
|
106
154
|
/**
|
|
@@ -110,14 +158,23 @@ export const useCodeguardDatabaseList = (addonId, options) => {
|
|
|
110
158
|
export const codeguardDatabaseBackupList = (addonId, params, options) => {
|
|
111
159
|
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) }));
|
|
112
160
|
};
|
|
113
|
-
export const getCodeguardDatabaseBackupListQueryKey = (addonId, params) =>
|
|
114
|
-
|
|
161
|
+
export const getCodeguardDatabaseBackupListQueryKey = (addonId, params) => {
|
|
162
|
+
return [`/v1/addons/codeguard/${addonId}/databases/backups`, ...(params ? [params] : [])];
|
|
163
|
+
};
|
|
164
|
+
export const getCodeguardDatabaseBackupListQueryOptions = (addonId, params, options) => {
|
|
115
165
|
var _a;
|
|
116
166
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
117
167
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardDatabaseBackupListQueryKey(addonId, params);
|
|
118
168
|
const queryFn = ({ signal }) => codeguardDatabaseBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
119
|
-
|
|
120
|
-
|
|
169
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* @summary database backup list
|
|
173
|
+
*/
|
|
174
|
+
export const useCodeguardDatabaseBackupList = (addonId, params, options) => {
|
|
175
|
+
const queryOptions = getCodeguardDatabaseBackupListQueryOptions(addonId, params, options);
|
|
176
|
+
const query = useQuery(queryOptions);
|
|
177
|
+
query.queryKey = queryOptions.queryKey;
|
|
121
178
|
return query;
|
|
122
179
|
};
|
|
123
180
|
/**
|
|
@@ -127,13 +184,20 @@ export const useCodeguardDatabaseBackupList = (addonId, params, options) => {
|
|
|
127
184
|
export const codeguardDatabaseBackupCreate = (addonId, codeguardDatabaseBackupCreateBody, options) => {
|
|
128
185
|
return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups`, codeguardDatabaseBackupCreateBody, options);
|
|
129
186
|
};
|
|
130
|
-
export const
|
|
187
|
+
export const getCodeguardDatabaseBackupCreateMutationOptions = (options) => {
|
|
131
188
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
132
189
|
const mutationFn = (props) => {
|
|
133
190
|
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
134
191
|
return codeguardDatabaseBackupCreate(addonId, data, axiosOptions);
|
|
135
192
|
};
|
|
136
|
-
return
|
|
193
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* @summary database backup create
|
|
197
|
+
*/
|
|
198
|
+
export const useCodeguardDatabaseBackupCreate = (options) => {
|
|
199
|
+
const mutationOptions = getCodeguardDatabaseBackupCreateMutationOptions(options);
|
|
200
|
+
return useMutation(mutationOptions);
|
|
137
201
|
};
|
|
138
202
|
/**
|
|
139
203
|
* Restores a database backup
|
|
@@ -142,13 +206,20 @@ export const useCodeguardDatabaseBackupCreate = (options) => {
|
|
|
142
206
|
export const codeguardDatabaseBackupRestore = (addonId, codeguardDatabaseBackupRestoreBody, options) => {
|
|
143
207
|
return axios.post(`/v1/addons/codeguard/${addonId}/databases/backups/restore`, codeguardDatabaseBackupRestoreBody, options);
|
|
144
208
|
};
|
|
145
|
-
export const
|
|
209
|
+
export const getCodeguardDatabaseBackupRestoreMutationOptions = (options) => {
|
|
146
210
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
147
211
|
const mutationFn = (props) => {
|
|
148
212
|
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
149
213
|
return codeguardDatabaseBackupRestore(addonId, data, axiosOptions);
|
|
150
214
|
};
|
|
151
|
-
return
|
|
215
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* @summary database backup restore
|
|
219
|
+
*/
|
|
220
|
+
export const useCodeguardDatabaseBackupRestore = (options) => {
|
|
221
|
+
const mutationOptions = getCodeguardDatabaseBackupRestoreMutationOptions(options);
|
|
222
|
+
return useMutation(mutationOptions);
|
|
152
223
|
};
|
|
153
224
|
/**
|
|
154
225
|
* Returns an oauth login URL that can be used to access CodeGuard dashboard for a user.
|
|
@@ -157,14 +228,23 @@ export const useCodeguardDatabaseBackupRestore = (options) => {
|
|
|
157
228
|
export const codeguardLoginLink = (addonId, options) => {
|
|
158
229
|
return axios.get(`/v1/addons/codeguard/${addonId}/login`, options);
|
|
159
230
|
};
|
|
160
|
-
export const getCodeguardLoginLinkQueryKey = (addonId) =>
|
|
161
|
-
|
|
231
|
+
export const getCodeguardLoginLinkQueryKey = (addonId) => {
|
|
232
|
+
return [`/v1/addons/codeguard/${addonId}/login`];
|
|
233
|
+
};
|
|
234
|
+
export const getCodeguardLoginLinkQueryOptions = (addonId, options) => {
|
|
162
235
|
var _a;
|
|
163
236
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
164
237
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardLoginLinkQueryKey(addonId);
|
|
165
238
|
const queryFn = ({ signal }) => codeguardLoginLink(addonId, Object.assign({ signal }, axiosOptions));
|
|
166
|
-
|
|
167
|
-
|
|
239
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* @summary login link
|
|
243
|
+
*/
|
|
244
|
+
export const useCodeguardLoginLink = (addonId, options) => {
|
|
245
|
+
const queryOptions = getCodeguardLoginLinkQueryOptions(addonId, options);
|
|
246
|
+
const query = useQuery(queryOptions);
|
|
247
|
+
query.queryKey = queryOptions.queryKey;
|
|
168
248
|
return query;
|
|
169
249
|
};
|
|
170
250
|
/**
|
|
@@ -174,14 +254,23 @@ export const useCodeguardLoginLink = (addonId, options) => {
|
|
|
174
254
|
export const codeguardPlanInfo = (addonId, options) => {
|
|
175
255
|
return axios.get(`/v1/addons/codeguard/${addonId}/plan`, options);
|
|
176
256
|
};
|
|
177
|
-
export const getCodeguardPlanInfoQueryKey = (addonId) =>
|
|
178
|
-
|
|
257
|
+
export const getCodeguardPlanInfoQueryKey = (addonId) => {
|
|
258
|
+
return [`/v1/addons/codeguard/${addonId}/plan`];
|
|
259
|
+
};
|
|
260
|
+
export const getCodeguardPlanInfoQueryOptions = (addonId, options) => {
|
|
179
261
|
var _a;
|
|
180
262
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
181
263
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardPlanInfoQueryKey(addonId);
|
|
182
264
|
const queryFn = ({ signal }) => codeguardPlanInfo(addonId, Object.assign({ signal }, axiosOptions));
|
|
183
|
-
|
|
184
|
-
|
|
265
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* @summary plan info
|
|
269
|
+
*/
|
|
270
|
+
export const useCodeguardPlanInfo = (addonId, options) => {
|
|
271
|
+
const queryOptions = getCodeguardPlanInfoQueryOptions(addonId, options);
|
|
272
|
+
const query = useQuery(queryOptions);
|
|
273
|
+
query.queryKey = queryOptions.queryKey;
|
|
185
274
|
return query;
|
|
186
275
|
};
|
|
187
276
|
/**
|
|
@@ -191,14 +280,23 @@ export const useCodeguardPlanInfo = (addonId, options) => {
|
|
|
191
280
|
export const codeguardWebsiteList = (addonId, options) => {
|
|
192
281
|
return axios.get(`/v1/addons/codeguard/${addonId}/websites`, options);
|
|
193
282
|
};
|
|
194
|
-
export const getCodeguardWebsiteListQueryKey = (addonId) =>
|
|
195
|
-
|
|
283
|
+
export const getCodeguardWebsiteListQueryKey = (addonId) => {
|
|
284
|
+
return [`/v1/addons/codeguard/${addonId}/websites`];
|
|
285
|
+
};
|
|
286
|
+
export const getCodeguardWebsiteListQueryOptions = (addonId, options) => {
|
|
196
287
|
var _a;
|
|
197
288
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
198
289
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardWebsiteListQueryKey(addonId);
|
|
199
290
|
const queryFn = ({ signal }) => codeguardWebsiteList(addonId, Object.assign({ signal }, axiosOptions));
|
|
200
|
-
|
|
201
|
-
|
|
291
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* @summary website list
|
|
295
|
+
*/
|
|
296
|
+
export const useCodeguardWebsiteList = (addonId, options) => {
|
|
297
|
+
const queryOptions = getCodeguardWebsiteListQueryOptions(addonId, options);
|
|
298
|
+
const query = useQuery(queryOptions);
|
|
299
|
+
query.queryKey = queryOptions.queryKey;
|
|
202
300
|
return query;
|
|
203
301
|
};
|
|
204
302
|
/**
|
|
@@ -208,14 +306,23 @@ export const useCodeguardWebsiteList = (addonId, options) => {
|
|
|
208
306
|
export const codeguardWebsiteBackupList = (addonId, params, options) => {
|
|
209
307
|
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) }));
|
|
210
308
|
};
|
|
211
|
-
export const getCodeguardWebsiteBackupListQueryKey = (addonId, params) =>
|
|
212
|
-
|
|
309
|
+
export const getCodeguardWebsiteBackupListQueryKey = (addonId, params) => {
|
|
310
|
+
return [`/v1/addons/codeguard/${addonId}/websites/backups`, ...(params ? [params] : [])];
|
|
311
|
+
};
|
|
312
|
+
export const getCodeguardWebsiteBackupListQueryOptions = (addonId, params, options) => {
|
|
213
313
|
var _a;
|
|
214
314
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
215
315
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getCodeguardWebsiteBackupListQueryKey(addonId, params);
|
|
216
316
|
const queryFn = ({ signal }) => codeguardWebsiteBackupList(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
217
|
-
|
|
218
|
-
|
|
317
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* @summary website backup list
|
|
321
|
+
*/
|
|
322
|
+
export const useCodeguardWebsiteBackupList = (addonId, params, options) => {
|
|
323
|
+
const queryOptions = getCodeguardWebsiteBackupListQueryOptions(addonId, params, options);
|
|
324
|
+
const query = useQuery(queryOptions);
|
|
325
|
+
query.queryKey = queryOptions.queryKey;
|
|
219
326
|
return query;
|
|
220
327
|
};
|
|
221
328
|
/**
|
|
@@ -225,13 +332,20 @@ export const useCodeguardWebsiteBackupList = (addonId, params, options) => {
|
|
|
225
332
|
export const codeguardWebsiteBackupCreate = (addonId, codeguardWebsiteBackupCreateBody, options) => {
|
|
226
333
|
return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups`, codeguardWebsiteBackupCreateBody, options);
|
|
227
334
|
};
|
|
228
|
-
export const
|
|
335
|
+
export const getCodeguardWebsiteBackupCreateMutationOptions = (options) => {
|
|
229
336
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
230
337
|
const mutationFn = (props) => {
|
|
231
338
|
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
232
339
|
return codeguardWebsiteBackupCreate(addonId, data, axiosOptions);
|
|
233
340
|
};
|
|
234
|
-
return
|
|
341
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* @summary website backup create
|
|
345
|
+
*/
|
|
346
|
+
export const useCodeguardWebsiteBackupCreate = (options) => {
|
|
347
|
+
const mutationOptions = getCodeguardWebsiteBackupCreateMutationOptions(options);
|
|
348
|
+
return useMutation(mutationOptions);
|
|
235
349
|
};
|
|
236
350
|
/**
|
|
237
351
|
* Restores a website backup
|
|
@@ -240,13 +354,20 @@ export const useCodeguardWebsiteBackupCreate = (options) => {
|
|
|
240
354
|
export const codeguardWebsiteBackupRestore = (addonId, codeguardWebsiteBackupRestoreBody, options) => {
|
|
241
355
|
return axios.post(`/v1/addons/codeguard/${addonId}/websites/backups/restore`, codeguardWebsiteBackupRestoreBody, options);
|
|
242
356
|
};
|
|
243
|
-
export const
|
|
357
|
+
export const getCodeguardWebsiteBackupRestoreMutationOptions = (options) => {
|
|
244
358
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
245
359
|
const mutationFn = (props) => {
|
|
246
360
|
const { addonId, data } = props !== null && props !== void 0 ? props : {};
|
|
247
361
|
return codeguardWebsiteBackupRestore(addonId, data, axiosOptions);
|
|
248
362
|
};
|
|
249
|
-
return
|
|
363
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* @summary website backup restore
|
|
367
|
+
*/
|
|
368
|
+
export const useCodeguardWebsiteBackupRestore = (options) => {
|
|
369
|
+
const mutationOptions = getCodeguardWebsiteBackupRestoreMutationOptions(options);
|
|
370
|
+
return useMutation(mutationOptions);
|
|
250
371
|
};
|
|
251
372
|
/**
|
|
252
373
|
* Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
|
|
@@ -255,14 +376,23 @@ export const useCodeguardWebsiteBackupRestore = (options) => {
|
|
|
255
376
|
export const addonsSitelockSso = (addonId, options) => {
|
|
256
377
|
return axios.get(`/v1/addons/sitelock/${addonId}/sso`, options);
|
|
257
378
|
};
|
|
258
|
-
export const getAddonsSitelockSsoQueryKey = (addonId) =>
|
|
259
|
-
|
|
379
|
+
export const getAddonsSitelockSsoQueryKey = (addonId) => {
|
|
380
|
+
return [`/v1/addons/sitelock/${addonId}/sso`];
|
|
381
|
+
};
|
|
382
|
+
export const getAddonsSitelockSsoQueryOptions = (addonId, options) => {
|
|
260
383
|
var _a;
|
|
261
384
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
262
385
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSitelockSsoQueryKey(addonId);
|
|
263
386
|
const queryFn = ({ signal }) => addonsSitelockSso(addonId, Object.assign({ signal }, axiosOptions));
|
|
264
|
-
|
|
265
|
-
|
|
387
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* @summary sso
|
|
391
|
+
*/
|
|
392
|
+
export const useAddonsSitelockSso = (addonId, options) => {
|
|
393
|
+
const queryOptions = getAddonsSitelockSsoQueryOptions(addonId, options);
|
|
394
|
+
const query = useQuery(queryOptions);
|
|
395
|
+
query.queryKey = queryOptions.queryKey;
|
|
266
396
|
return query;
|
|
267
397
|
};
|
|
268
398
|
/**
|
|
@@ -272,13 +402,20 @@ export const useAddonsSitelockSso = (addonId, options) => {
|
|
|
272
402
|
export const addonsCloudflare = (addonId, options) => {
|
|
273
403
|
return axios.delete(`/v1/addons/${addonId}/cloudflare`, options);
|
|
274
404
|
};
|
|
275
|
-
export const
|
|
405
|
+
export const getAddonsCloudflareMutationOptions = (options) => {
|
|
276
406
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
277
407
|
const mutationFn = (props) => {
|
|
278
408
|
const { addonId } = props !== null && props !== void 0 ? props : {};
|
|
279
409
|
return addonsCloudflare(addonId, axiosOptions);
|
|
280
410
|
};
|
|
281
|
-
return
|
|
411
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* @summary Uninstall cloudflare basic addon
|
|
415
|
+
*/
|
|
416
|
+
export const useAddonsCloudflare = (options) => {
|
|
417
|
+
const mutationOptions = getAddonsCloudflareMutationOptions(options);
|
|
418
|
+
return useMutation(mutationOptions);
|
|
282
419
|
};
|
|
283
420
|
/**
|
|
284
421
|
* Returns addon information
|
|
@@ -287,14 +424,23 @@ export const useAddonsCloudflare = (options) => {
|
|
|
287
424
|
export const addonsInfo = (addonId, options) => {
|
|
288
425
|
return axios.get(`/v1/addons/${addonId}/info`, options);
|
|
289
426
|
};
|
|
290
|
-
export const getAddonsInfoQueryKey = (addonId) =>
|
|
291
|
-
|
|
427
|
+
export const getAddonsInfoQueryKey = (addonId) => {
|
|
428
|
+
return [`/v1/addons/${addonId}/info`];
|
|
429
|
+
};
|
|
430
|
+
export const getAddonsInfoQueryOptions = (addonId, options) => {
|
|
292
431
|
var _a;
|
|
293
432
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
294
433
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsInfoQueryKey(addonId);
|
|
295
434
|
const queryFn = ({ signal }) => addonsInfo(addonId, Object.assign({ signal }, axiosOptions));
|
|
296
|
-
|
|
297
|
-
|
|
435
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
* @summary info
|
|
439
|
+
*/
|
|
440
|
+
export const useAddonsInfo = (addonId, options) => {
|
|
441
|
+
const queryOptions = getAddonsInfoQueryOptions(addonId, options);
|
|
442
|
+
const query = useQuery(queryOptions);
|
|
443
|
+
query.queryKey = queryOptions.queryKey;
|
|
298
444
|
return query;
|
|
299
445
|
};
|
|
300
446
|
/**
|
|
@@ -304,14 +450,23 @@ export const useAddonsInfo = (addonId, options) => {
|
|
|
304
450
|
export const addonsSpamexpertsSso = (addonId, options) => {
|
|
305
451
|
return axios.get(`/v1/addons/${addonId}/spamexperts/sso`, options);
|
|
306
452
|
};
|
|
307
|
-
export const getAddonsSpamexpertsSsoQueryKey = (addonId) =>
|
|
308
|
-
|
|
453
|
+
export const getAddonsSpamexpertsSsoQueryKey = (addonId) => {
|
|
454
|
+
return [`/v1/addons/${addonId}/spamexperts/sso`];
|
|
455
|
+
};
|
|
456
|
+
export const getAddonsSpamexpertsSsoQueryOptions = (addonId, options) => {
|
|
309
457
|
var _a;
|
|
310
458
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
311
459
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSpamexpertsSsoQueryKey(addonId);
|
|
312
460
|
const queryFn = ({ signal }) => addonsSpamexpertsSso(addonId, Object.assign({ signal }, axiosOptions));
|
|
313
|
-
|
|
314
|
-
|
|
461
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* @summary info
|
|
465
|
+
*/
|
|
466
|
+
export const useAddonsSpamexpertsSso = (addonId, options) => {
|
|
467
|
+
const queryOptions = getAddonsSpamexpertsSsoQueryOptions(addonId, options);
|
|
468
|
+
const query = useQuery(queryOptions);
|
|
469
|
+
query.queryKey = queryOptions.queryKey;
|
|
315
470
|
return query;
|
|
316
471
|
};
|
|
317
472
|
/**
|
|
@@ -321,14 +476,23 @@ export const useAddonsSpamexpertsSso = (addonId, options) => {
|
|
|
321
476
|
export const webzaiSso = (addonId, options) => {
|
|
322
477
|
return axios.get(`/v1/addons/${addonId}/webzai/sso`, options);
|
|
323
478
|
};
|
|
324
|
-
export const getWebzaiSsoQueryKey = (addonId) =>
|
|
325
|
-
|
|
479
|
+
export const getWebzaiSsoQueryKey = (addonId) => {
|
|
480
|
+
return [`/v1/addons/${addonId}/webzai/sso`];
|
|
481
|
+
};
|
|
482
|
+
export const getWebzaiSsoQueryOptions = (addonId, options) => {
|
|
326
483
|
var _a;
|
|
327
484
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
328
485
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getWebzaiSsoQueryKey(addonId);
|
|
329
486
|
const queryFn = ({ signal }) => webzaiSso(addonId, Object.assign({ signal }, axiosOptions));
|
|
330
|
-
|
|
331
|
-
|
|
487
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
488
|
+
};
|
|
489
|
+
/**
|
|
490
|
+
* @summary webzai sso
|
|
491
|
+
*/
|
|
492
|
+
export const useWebzaiSso = (addonId, options) => {
|
|
493
|
+
const queryOptions = getWebzaiSsoQueryOptions(addonId, options);
|
|
494
|
+
const query = useQuery(queryOptions);
|
|
495
|
+
query.queryKey = queryOptions.queryKey;
|
|
332
496
|
return query;
|
|
333
497
|
};
|
|
334
498
|
/**
|
|
@@ -338,14 +502,23 @@ export const useWebzaiSso = (addonId, options) => {
|
|
|
338
502
|
export const weeblySso = (addonId, options) => {
|
|
339
503
|
return axios.get(`/v1/addons/${addonId}/weebly/sso`, options);
|
|
340
504
|
};
|
|
341
|
-
export const getWeeblySsoQueryKey = (addonId) =>
|
|
342
|
-
|
|
505
|
+
export const getWeeblySsoQueryKey = (addonId) => {
|
|
506
|
+
return [`/v1/addons/${addonId}/weebly/sso`];
|
|
507
|
+
};
|
|
508
|
+
export const getWeeblySsoQueryOptions = (addonId, options) => {
|
|
343
509
|
var _a;
|
|
344
510
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
345
511
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getWeeblySsoQueryKey(addonId);
|
|
346
512
|
const queryFn = ({ signal }) => weeblySso(addonId, Object.assign({ signal }, axiosOptions));
|
|
347
|
-
|
|
348
|
-
|
|
513
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
514
|
+
};
|
|
515
|
+
/**
|
|
516
|
+
* @summary weebly sso
|
|
517
|
+
*/
|
|
518
|
+
export const useWeeblySso = (addonId, options) => {
|
|
519
|
+
const queryOptions = getWeeblySsoQueryOptions(addonId, options);
|
|
520
|
+
const query = useQuery(queryOptions);
|
|
521
|
+
query.queryKey = queryOptions.queryKey;
|
|
349
522
|
return query;
|
|
350
523
|
};
|
|
351
524
|
/**
|
|
@@ -355,14 +528,23 @@ export const useWeeblySso = (addonId, options) => {
|
|
|
355
528
|
export const domainInfo = (domainId, options) => {
|
|
356
529
|
return axios.get(`/v1/domains/${domainId}`, options);
|
|
357
530
|
};
|
|
358
|
-
export const getDomainInfoQueryKey = (domainId) =>
|
|
359
|
-
|
|
531
|
+
export const getDomainInfoQueryKey = (domainId) => {
|
|
532
|
+
return [`/v1/domains/${domainId}`];
|
|
533
|
+
};
|
|
534
|
+
export const getDomainInfoQueryOptions = (domainId, options) => {
|
|
360
535
|
var _a;
|
|
361
536
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
362
537
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainInfoQueryKey(domainId);
|
|
363
538
|
const queryFn = ({ signal }) => domainInfo(domainId, Object.assign({ signal }, axiosOptions));
|
|
364
|
-
|
|
365
|
-
|
|
539
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(domainId) }, queryOptions);
|
|
540
|
+
};
|
|
541
|
+
/**
|
|
542
|
+
* @summary domain info
|
|
543
|
+
*/
|
|
544
|
+
export const useDomainInfo = (domainId, options) => {
|
|
545
|
+
const queryOptions = getDomainInfoQueryOptions(domainId, options);
|
|
546
|
+
const query = useQuery(queryOptions);
|
|
547
|
+
query.queryKey = queryOptions.queryKey;
|
|
366
548
|
return query;
|
|
367
549
|
};
|
|
368
550
|
/**
|
|
@@ -372,13 +554,20 @@ export const useDomainInfo = (domainId, options) => {
|
|
|
372
554
|
export const domainUnassign = (domainId, options) => {
|
|
373
555
|
return axios.post(`/v1/domains/${domainId}/unassign`, undefined, options);
|
|
374
556
|
};
|
|
375
|
-
export const
|
|
557
|
+
export const getDomainUnassignMutationOptions = (options) => {
|
|
376
558
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
377
559
|
const mutationFn = (props) => {
|
|
378
560
|
const { domainId } = props !== null && props !== void 0 ? props : {};
|
|
379
561
|
return domainUnassign(domainId, axiosOptions);
|
|
380
562
|
};
|
|
381
|
-
return
|
|
563
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* @summary domain unassign
|
|
567
|
+
*/
|
|
568
|
+
export const useDomainUnassign = (options) => {
|
|
569
|
+
const mutationOptions = getDomainUnassignMutationOptions(options);
|
|
570
|
+
return useMutation(mutationOptions);
|
|
382
571
|
};
|
|
383
572
|
/**
|
|
384
573
|
* Returns HAL hosting account-level information
|
|
@@ -387,14 +576,23 @@ export const useDomainUnassign = (options) => {
|
|
|
387
576
|
export const hostingAccount = (hostingId, options) => {
|
|
388
577
|
return axios.get(`/v1/hosting/${hostingId}`, options);
|
|
389
578
|
};
|
|
390
|
-
export const getHostingAccountQueryKey = (hostingId) =>
|
|
391
|
-
|
|
579
|
+
export const getHostingAccountQueryKey = (hostingId) => {
|
|
580
|
+
return [`/v1/hosting/${hostingId}`];
|
|
581
|
+
};
|
|
582
|
+
export const getHostingAccountQueryOptions = (hostingId, options) => {
|
|
392
583
|
var _a;
|
|
393
584
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
394
585
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAccountQueryKey(hostingId);
|
|
395
586
|
const queryFn = ({ signal }) => hostingAccount(hostingId, Object.assign({ signal }, axiosOptions));
|
|
396
|
-
|
|
397
|
-
|
|
587
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
588
|
+
};
|
|
589
|
+
/**
|
|
590
|
+
* @summary HAL Hosting Account Info
|
|
591
|
+
*/
|
|
592
|
+
export const useHostingAccount = (hostingId, options) => {
|
|
593
|
+
const queryOptions = getHostingAccountQueryOptions(hostingId, options);
|
|
594
|
+
const query = useQuery(queryOptions);
|
|
595
|
+
query.queryKey = queryOptions.queryKey;
|
|
398
596
|
return query;
|
|
399
597
|
};
|
|
400
598
|
/**
|
|
@@ -404,14 +602,23 @@ export const useHostingAccount = (hostingId, options) => {
|
|
|
404
602
|
export const hostingAddons = (hostingId, params, options) => {
|
|
405
603
|
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) }));
|
|
406
604
|
};
|
|
407
|
-
export const getHostingAddonsQueryKey = (hostingId, params) =>
|
|
408
|
-
|
|
605
|
+
export const getHostingAddonsQueryKey = (hostingId, params) => {
|
|
606
|
+
return [`/v1/hosting/${hostingId}/addons`, ...(params ? [params] : [])];
|
|
607
|
+
};
|
|
608
|
+
export const getHostingAddonsQueryOptions = (hostingId, params, options) => {
|
|
409
609
|
var _a;
|
|
410
610
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
411
611
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAddonsQueryKey(hostingId, params);
|
|
412
612
|
const queryFn = ({ signal }) => hostingAddons(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
413
|
-
|
|
414
|
-
|
|
613
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* @summary addon list
|
|
617
|
+
*/
|
|
618
|
+
export const useHostingAddons = (hostingId, params, options) => {
|
|
619
|
+
const queryOptions = getHostingAddonsQueryOptions(hostingId, params, options);
|
|
620
|
+
const query = useQuery(queryOptions);
|
|
621
|
+
query.queryKey = queryOptions.queryKey;
|
|
415
622
|
return query;
|
|
416
623
|
};
|
|
417
624
|
/**
|
|
@@ -421,14 +628,23 @@ export const useHostingAddons = (hostingId, params, options) => {
|
|
|
421
628
|
export const hostingAdvancedServer = (hostingId, options) => {
|
|
422
629
|
return axios.get(`/v1/hosting/${hostingId}/advanced/server`, options);
|
|
423
630
|
};
|
|
424
|
-
export const getHostingAdvancedServerQueryKey = (hostingId) =>
|
|
425
|
-
|
|
631
|
+
export const getHostingAdvancedServerQueryKey = (hostingId) => {
|
|
632
|
+
return [`/v1/hosting/${hostingId}/advanced/server`];
|
|
633
|
+
};
|
|
634
|
+
export const getHostingAdvancedServerQueryOptions = (hostingId, options) => {
|
|
426
635
|
var _a;
|
|
427
636
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
428
637
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedServerQueryKey(hostingId);
|
|
429
638
|
const queryFn = ({ signal }) => hostingAdvancedServer(hostingId, Object.assign({ signal }, axiosOptions));
|
|
430
|
-
|
|
431
|
-
|
|
639
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
640
|
+
};
|
|
641
|
+
/**
|
|
642
|
+
* @summary server status/info
|
|
643
|
+
*/
|
|
644
|
+
export const useHostingAdvancedServer = (hostingId, options) => {
|
|
645
|
+
const queryOptions = getHostingAdvancedServerQueryOptions(hostingId, options);
|
|
646
|
+
const query = useQuery(queryOptions);
|
|
647
|
+
query.queryKey = queryOptions.queryKey;
|
|
432
648
|
return query;
|
|
433
649
|
};
|
|
434
650
|
/**
|
|
@@ -438,13 +654,20 @@ export const useHostingAdvancedServer = (hostingId, options) => {
|
|
|
438
654
|
export const hostingAdvancedServerStatus = (hostingId, hostingAdvancedServerStatusBody, options) => {
|
|
439
655
|
return axios.put(`/v1/hosting/${hostingId}/advanced/server`, hostingAdvancedServerStatusBody, options);
|
|
440
656
|
};
|
|
441
|
-
export const
|
|
657
|
+
export const getHostingAdvancedServerStatusMutationOptions = (options) => {
|
|
442
658
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
443
659
|
const mutationFn = (props) => {
|
|
444
660
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
445
661
|
return hostingAdvancedServerStatus(hostingId, data, axiosOptions);
|
|
446
662
|
};
|
|
447
|
-
return
|
|
663
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* @summary server_status
|
|
667
|
+
*/
|
|
668
|
+
export const useHostingAdvancedServerStatus = (options) => {
|
|
669
|
+
const mutationOptions = getHostingAdvancedServerStatusMutationOptions(options);
|
|
670
|
+
return useMutation(mutationOptions);
|
|
448
671
|
};
|
|
449
672
|
/**
|
|
450
673
|
* Update user account's password
|
|
@@ -453,13 +676,20 @@ export const useHostingAdvancedServerStatus = (options) => {
|
|
|
453
676
|
export const hostingAdvancedPassword = (hostingId, hostingAdvancedPasswordBody, options) => {
|
|
454
677
|
return axios.put(`/v1/hosting/${hostingId}/advanced/server/password`, hostingAdvancedPasswordBody, options);
|
|
455
678
|
};
|
|
456
|
-
export const
|
|
679
|
+
export const getHostingAdvancedPasswordMutationOptions = (options) => {
|
|
457
680
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
458
681
|
const mutationFn = (props) => {
|
|
459
682
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
460
683
|
return hostingAdvancedPassword(hostingId, data, axiosOptions);
|
|
461
684
|
};
|
|
462
|
-
return
|
|
685
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
686
|
+
};
|
|
687
|
+
/**
|
|
688
|
+
* @summary Update user account password
|
|
689
|
+
*/
|
|
690
|
+
export const useHostingAdvancedPassword = (options) => {
|
|
691
|
+
const mutationOptions = getHostingAdvancedPasswordMutationOptions(options);
|
|
692
|
+
return useMutation(mutationOptions);
|
|
463
693
|
};
|
|
464
694
|
/**
|
|
465
695
|
* Returns the hosting sso_whm login url
|
|
@@ -468,14 +698,23 @@ export const useHostingAdvancedPassword = (options) => {
|
|
|
468
698
|
export const hostingAdvancedSsoWhm = (hostingId, options) => {
|
|
469
699
|
return axios.get(`/v1/hosting/${hostingId}/advanced/sso_whm`, options);
|
|
470
700
|
};
|
|
471
|
-
export const getHostingAdvancedSsoWhmQueryKey = (hostingId) =>
|
|
472
|
-
|
|
701
|
+
export const getHostingAdvancedSsoWhmQueryKey = (hostingId) => {
|
|
702
|
+
return [`/v1/hosting/${hostingId}/advanced/sso_whm`];
|
|
703
|
+
};
|
|
704
|
+
export const getHostingAdvancedSsoWhmQueryOptions = (hostingId, options) => {
|
|
473
705
|
var _a;
|
|
474
706
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
475
707
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSsoWhmQueryKey(hostingId);
|
|
476
708
|
const queryFn = ({ signal }) => hostingAdvancedSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
|
|
477
|
-
|
|
478
|
-
|
|
709
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
710
|
+
};
|
|
711
|
+
/**
|
|
712
|
+
* @summary hosting sso_whm
|
|
713
|
+
*/
|
|
714
|
+
export const useHostingAdvancedSsoWhm = (hostingId, options) => {
|
|
715
|
+
const queryOptions = getHostingAdvancedSsoWhmQueryOptions(hostingId, options);
|
|
716
|
+
const query = useQuery(queryOptions);
|
|
717
|
+
query.queryKey = queryOptions.queryKey;
|
|
479
718
|
return query;
|
|
480
719
|
};
|
|
481
720
|
/**
|
|
@@ -485,14 +724,23 @@ export const useHostingAdvancedSsoWhm = (hostingId, options) => {
|
|
|
485
724
|
export const hostingAdvancedSystemConsole = (hostingId, options) => {
|
|
486
725
|
return axios.get(`/v1/hosting/${hostingId}/advanced/system-console`, options);
|
|
487
726
|
};
|
|
488
|
-
export const getHostingAdvancedSystemConsoleQueryKey = (hostingId) =>
|
|
489
|
-
|
|
727
|
+
export const getHostingAdvancedSystemConsoleQueryKey = (hostingId) => {
|
|
728
|
+
return [`/v1/hosting/${hostingId}/advanced/system-console`];
|
|
729
|
+
};
|
|
730
|
+
export const getHostingAdvancedSystemConsoleQueryOptions = (hostingId, options) => {
|
|
490
731
|
var _a;
|
|
491
732
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
492
733
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedSystemConsoleQueryKey(hostingId);
|
|
493
734
|
const queryFn = ({ signal }) => hostingAdvancedSystemConsole(hostingId, Object.assign({ signal }, axiosOptions));
|
|
494
|
-
|
|
495
|
-
|
|
735
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
736
|
+
};
|
|
737
|
+
/**
|
|
738
|
+
* @summary hosting system_console
|
|
739
|
+
*/
|
|
740
|
+
export const useHostingAdvancedSystemConsole = (hostingId, options) => {
|
|
741
|
+
const queryOptions = getHostingAdvancedSystemConsoleQueryOptions(hostingId, options);
|
|
742
|
+
const query = useQuery(queryOptions);
|
|
743
|
+
query.queryKey = queryOptions.queryKey;
|
|
496
744
|
return query;
|
|
497
745
|
};
|
|
498
746
|
/**
|
|
@@ -502,14 +750,23 @@ export const useHostingAdvancedSystemConsole = (hostingId, options) => {
|
|
|
502
750
|
export const hostingCapabilities = (hostingId, options) => {
|
|
503
751
|
return axios.get(`/v1/hosting/${hostingId}/capabilities`, options);
|
|
504
752
|
};
|
|
505
|
-
export const getHostingCapabilitiesQueryKey = (hostingId) =>
|
|
506
|
-
|
|
753
|
+
export const getHostingCapabilitiesQueryKey = (hostingId) => {
|
|
754
|
+
return [`/v1/hosting/${hostingId}/capabilities`];
|
|
755
|
+
};
|
|
756
|
+
export const getHostingCapabilitiesQueryOptions = (hostingId, options) => {
|
|
507
757
|
var _a;
|
|
508
758
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
509
759
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingCapabilitiesQueryKey(hostingId);
|
|
510
760
|
const queryFn = ({ signal }) => hostingCapabilities(hostingId, Object.assign({ signal }, axiosOptions));
|
|
511
|
-
|
|
512
|
-
|
|
761
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
762
|
+
};
|
|
763
|
+
/**
|
|
764
|
+
* @summary hosting capabilities
|
|
765
|
+
*/
|
|
766
|
+
export const useHostingCapabilities = (hostingId, options) => {
|
|
767
|
+
const queryOptions = getHostingCapabilitiesQueryOptions(hostingId, options);
|
|
768
|
+
const query = useQuery(queryOptions);
|
|
769
|
+
query.queryKey = queryOptions.queryKey;
|
|
513
770
|
return query;
|
|
514
771
|
};
|
|
515
772
|
/**
|
|
@@ -520,13 +777,21 @@ export const useHostingCapabilities = (hostingId, options) => {
|
|
|
520
777
|
export const addonCloudflare = (hostingId, addonCloudflareBody, options) => {
|
|
521
778
|
return axios.post(`/v1/hosting/${hostingId}/cloudflare`, addonCloudflareBody, options);
|
|
522
779
|
};
|
|
523
|
-
export const
|
|
780
|
+
export const getAddonCloudflareMutationOptions = (options) => {
|
|
524
781
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
525
782
|
const mutationFn = (props) => {
|
|
526
783
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
527
784
|
return addonCloudflare(hostingId, data, axiosOptions);
|
|
528
785
|
};
|
|
529
|
-
return
|
|
786
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
787
|
+
};
|
|
788
|
+
/**
|
|
789
|
+
* @deprecated
|
|
790
|
+
* @summary Deprecated - Install cloudflare basic addon
|
|
791
|
+
*/
|
|
792
|
+
export const useAddonCloudflare = (options) => {
|
|
793
|
+
const mutationOptions = getAddonCloudflareMutationOptions(options);
|
|
794
|
+
return useMutation(mutationOptions);
|
|
530
795
|
};
|
|
531
796
|
/**
|
|
532
797
|
* Returns a list of cron jobs
|
|
@@ -535,14 +800,23 @@ export const useAddonCloudflare = (options) => {
|
|
|
535
800
|
export const listCrons = (hostingId, options) => {
|
|
536
801
|
return axios.get(`/v1/hosting/${hostingId}/crontab`, options);
|
|
537
802
|
};
|
|
538
|
-
export const getListCronsQueryKey = (hostingId) =>
|
|
539
|
-
|
|
803
|
+
export const getListCronsQueryKey = (hostingId) => {
|
|
804
|
+
return [`/v1/hosting/${hostingId}/crontab`];
|
|
805
|
+
};
|
|
806
|
+
export const getListCronsQueryOptions = (hostingId, options) => {
|
|
540
807
|
var _a;
|
|
541
808
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
542
809
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getListCronsQueryKey(hostingId);
|
|
543
810
|
const queryFn = ({ signal }) => listCrons(hostingId, Object.assign({ signal }, axiosOptions));
|
|
544
|
-
|
|
545
|
-
|
|
811
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
812
|
+
};
|
|
813
|
+
/**
|
|
814
|
+
* @summary cron_list
|
|
815
|
+
*/
|
|
816
|
+
export const useListCrons = (hostingId, options) => {
|
|
817
|
+
const queryOptions = getListCronsQueryOptions(hostingId, options);
|
|
818
|
+
const query = useQuery(queryOptions);
|
|
819
|
+
query.queryKey = queryOptions.queryKey;
|
|
546
820
|
return query;
|
|
547
821
|
};
|
|
548
822
|
/**
|
|
@@ -552,13 +826,20 @@ export const useListCrons = (hostingId, options) => {
|
|
|
552
826
|
export const addCron = (hostingId, addCronBody, options) => {
|
|
553
827
|
return axios.post(`/v1/hosting/${hostingId}/crontab`, addCronBody, options);
|
|
554
828
|
};
|
|
555
|
-
export const
|
|
829
|
+
export const getAddCronMutationOptions = (options) => {
|
|
556
830
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
557
831
|
const mutationFn = (props) => {
|
|
558
832
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
559
833
|
return addCron(hostingId, data, axiosOptions);
|
|
560
834
|
};
|
|
561
|
-
return
|
|
835
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
836
|
+
};
|
|
837
|
+
/**
|
|
838
|
+
* @summary cron_add
|
|
839
|
+
*/
|
|
840
|
+
export const useAddCron = (options) => {
|
|
841
|
+
const mutationOptions = getAddCronMutationOptions(options);
|
|
842
|
+
return useMutation(mutationOptions);
|
|
562
843
|
};
|
|
563
844
|
/**
|
|
564
845
|
* Updates a cron job
|
|
@@ -567,13 +848,20 @@ export const useAddCron = (options) => {
|
|
|
567
848
|
export const updateCron = (hostingId, updateCronBody, options) => {
|
|
568
849
|
return axios.put(`/v1/hosting/${hostingId}/crontab`, updateCronBody, options);
|
|
569
850
|
};
|
|
570
|
-
export const
|
|
851
|
+
export const getUpdateCronMutationOptions = (options) => {
|
|
571
852
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
572
853
|
const mutationFn = (props) => {
|
|
573
854
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
574
855
|
return updateCron(hostingId, data, axiosOptions);
|
|
575
856
|
};
|
|
576
|
-
return
|
|
857
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
858
|
+
};
|
|
859
|
+
/**
|
|
860
|
+
* @summary cron_update
|
|
861
|
+
*/
|
|
862
|
+
export const useUpdateCron = (options) => {
|
|
863
|
+
const mutationOptions = getUpdateCronMutationOptions(options);
|
|
864
|
+
return useMutation(mutationOptions);
|
|
577
865
|
};
|
|
578
866
|
/**
|
|
579
867
|
* Deletes a cron job
|
|
@@ -582,13 +870,20 @@ export const useUpdateCron = (options) => {
|
|
|
582
870
|
export const cron = (hostingId, cronBody, options) => {
|
|
583
871
|
return axios.delete(`/v1/hosting/${hostingId}/crontab`, Object.assign({ data: cronBody }, options));
|
|
584
872
|
};
|
|
585
|
-
export const
|
|
873
|
+
export const getCronMutationOptions = (options) => {
|
|
586
874
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
587
875
|
const mutationFn = (props) => {
|
|
588
876
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
589
877
|
return cron(hostingId, data, axiosOptions);
|
|
590
878
|
};
|
|
591
|
-
return
|
|
879
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
880
|
+
};
|
|
881
|
+
/**
|
|
882
|
+
* @summary cron_delete
|
|
883
|
+
*/
|
|
884
|
+
export const useCron = (options) => {
|
|
885
|
+
const mutationOptions = getCronMutationOptions(options);
|
|
886
|
+
return useMutation(mutationOptions);
|
|
592
887
|
};
|
|
593
888
|
/**
|
|
594
889
|
* Add a new db to an account
|
|
@@ -597,13 +892,20 @@ export const useCron = (options) => {
|
|
|
597
892
|
export const dbAdd = (hostingId, dbAddBody, options) => {
|
|
598
893
|
return axios.post(`/v1/hosting/${hostingId}/db`, dbAddBody, options);
|
|
599
894
|
};
|
|
600
|
-
export const
|
|
895
|
+
export const getDbAddMutationOptions = (options) => {
|
|
601
896
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
602
897
|
const mutationFn = (props) => {
|
|
603
898
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
604
899
|
return dbAdd(hostingId, data, axiosOptions);
|
|
605
900
|
};
|
|
606
|
-
return
|
|
901
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
902
|
+
};
|
|
903
|
+
/**
|
|
904
|
+
* @summary Create a database for an account
|
|
905
|
+
*/
|
|
906
|
+
export const useDbAdd = (options) => {
|
|
907
|
+
const mutationOptions = getDbAddMutationOptions(options);
|
|
908
|
+
return useMutation(mutationOptions);
|
|
607
909
|
};
|
|
608
910
|
/**
|
|
609
911
|
* Delete db account
|
|
@@ -612,13 +914,20 @@ export const useDbAdd = (options) => {
|
|
|
612
914
|
export const db = (hostingId, dbBody, options) => {
|
|
613
915
|
return axios.delete(`/v1/hosting/${hostingId}/db`, Object.assign({ data: dbBody }, options));
|
|
614
916
|
};
|
|
615
|
-
export const
|
|
917
|
+
export const getDbMutationOptions = (options) => {
|
|
616
918
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
617
919
|
const mutationFn = (props) => {
|
|
618
920
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
619
921
|
return db(hostingId, data, axiosOptions);
|
|
620
922
|
};
|
|
621
|
-
return
|
|
923
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
924
|
+
};
|
|
925
|
+
/**
|
|
926
|
+
* @summary Delete db account
|
|
927
|
+
*/
|
|
928
|
+
export const useDb = (options) => {
|
|
929
|
+
const mutationOptions = getDbMutationOptions(options);
|
|
930
|
+
return useMutation(mutationOptions);
|
|
622
931
|
};
|
|
623
932
|
/**
|
|
624
933
|
* List all DB name
|
|
@@ -627,14 +936,23 @@ export const useDb = (options) => {
|
|
|
627
936
|
export const dbList = (hostingId, options) => {
|
|
628
937
|
return axios.get(`/v1/hosting/${hostingId}/db`, options);
|
|
629
938
|
};
|
|
630
|
-
export const getDbListQueryKey = (hostingId) =>
|
|
631
|
-
|
|
939
|
+
export const getDbListQueryKey = (hostingId) => {
|
|
940
|
+
return [`/v1/hosting/${hostingId}/db`];
|
|
941
|
+
};
|
|
942
|
+
export const getDbListQueryOptions = (hostingId, options) => {
|
|
632
943
|
var _a;
|
|
633
944
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
634
945
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbListQueryKey(hostingId);
|
|
635
946
|
const queryFn = ({ signal }) => dbList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
636
|
-
|
|
637
|
-
|
|
947
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
948
|
+
};
|
|
949
|
+
/**
|
|
950
|
+
* @summary Get list of database name
|
|
951
|
+
*/
|
|
952
|
+
export const useDbList = (hostingId, options) => {
|
|
953
|
+
const queryOptions = getDbListQueryOptions(hostingId, options);
|
|
954
|
+
const query = useQuery(queryOptions);
|
|
955
|
+
query.queryKey = queryOptions.queryKey;
|
|
638
956
|
return query;
|
|
639
957
|
};
|
|
640
958
|
/**
|
|
@@ -644,14 +962,23 @@ export const useDbList = (hostingId, options) => {
|
|
|
644
962
|
export const dbUsage = (hostingId, options) => {
|
|
645
963
|
return axios.get(`/v1/hosting/${hostingId}/db/usage`, options);
|
|
646
964
|
};
|
|
647
|
-
export const getDbUsageQueryKey = (hostingId) =>
|
|
648
|
-
|
|
965
|
+
export const getDbUsageQueryKey = (hostingId) => {
|
|
966
|
+
return [`/v1/hosting/${hostingId}/db/usage`];
|
|
967
|
+
};
|
|
968
|
+
export const getDbUsageQueryOptions = (hostingId, options) => {
|
|
649
969
|
var _a;
|
|
650
970
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
651
971
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUsageQueryKey(hostingId);
|
|
652
972
|
const queryFn = ({ signal }) => dbUsage(hostingId, Object.assign({ signal }, axiosOptions));
|
|
653
|
-
|
|
654
|
-
|
|
973
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
974
|
+
};
|
|
975
|
+
/**
|
|
976
|
+
* @summary DB usage
|
|
977
|
+
*/
|
|
978
|
+
export const useDbUsage = (hostingId, options) => {
|
|
979
|
+
const queryOptions = getDbUsageQueryOptions(hostingId, options);
|
|
980
|
+
const query = useQuery(queryOptions);
|
|
981
|
+
query.queryKey = queryOptions.queryKey;
|
|
655
982
|
return query;
|
|
656
983
|
};
|
|
657
984
|
/**
|
|
@@ -661,14 +988,23 @@ export const useDbUsage = (hostingId, options) => {
|
|
|
661
988
|
export const dbUserPrivsGet = (hostingId, params, options) => {
|
|
662
989
|
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) }));
|
|
663
990
|
};
|
|
664
|
-
export const getDbUserPrivsGetQueryKey = (hostingId, params) =>
|
|
665
|
-
|
|
991
|
+
export const getDbUserPrivsGetQueryKey = (hostingId, params) => {
|
|
992
|
+
return [`/v1/hosting/${hostingId}/db/user/privileges`, ...(params ? [params] : [])];
|
|
993
|
+
};
|
|
994
|
+
export const getDbUserPrivsGetQueryOptions = (hostingId, params, options) => {
|
|
666
995
|
var _a;
|
|
667
996
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
668
997
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserPrivsGetQueryKey(hostingId, params);
|
|
669
998
|
const queryFn = ({ signal }) => dbUserPrivsGet(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
670
|
-
|
|
671
|
-
|
|
999
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1000
|
+
};
|
|
1001
|
+
/**
|
|
1002
|
+
* @summary Get user privileges on a database.
|
|
1003
|
+
*/
|
|
1004
|
+
export const useDbUserPrivsGet = (hostingId, params, options) => {
|
|
1005
|
+
const queryOptions = getDbUserPrivsGetQueryOptions(hostingId, params, options);
|
|
1006
|
+
const query = useQuery(queryOptions);
|
|
1007
|
+
query.queryKey = queryOptions.queryKey;
|
|
672
1008
|
return query;
|
|
673
1009
|
};
|
|
674
1010
|
/**
|
|
@@ -678,13 +1014,20 @@ export const useDbUserPrivsGet = (hostingId, params, options) => {
|
|
|
678
1014
|
export const dbUserAdd = (hostingId, dbUserAddBody, options) => {
|
|
679
1015
|
return axios.post(`/v1/hosting/${hostingId}/db/users`, dbUserAddBody, options);
|
|
680
1016
|
};
|
|
681
|
-
export const
|
|
1017
|
+
export const getDbUserAddMutationOptions = (options) => {
|
|
682
1018
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
683
1019
|
const mutationFn = (props) => {
|
|
684
1020
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
685
1021
|
return dbUserAdd(hostingId, data, axiosOptions);
|
|
686
1022
|
};
|
|
687
|
-
return
|
|
1023
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1024
|
+
};
|
|
1025
|
+
/**
|
|
1026
|
+
* @summary Create a database user
|
|
1027
|
+
*/
|
|
1028
|
+
export const useDbUserAdd = (options) => {
|
|
1029
|
+
const mutationOptions = getDbUserAddMutationOptions(options);
|
|
1030
|
+
return useMutation(mutationOptions);
|
|
688
1031
|
};
|
|
689
1032
|
/**
|
|
690
1033
|
* Delete db user
|
|
@@ -693,13 +1036,20 @@ export const useDbUserAdd = (options) => {
|
|
|
693
1036
|
export const dbUserDelete = (hostingId, dbUserDeleteBody, options) => {
|
|
694
1037
|
return axios.delete(`/v1/hosting/${hostingId}/db/users`, Object.assign({ data: dbUserDeleteBody }, options));
|
|
695
1038
|
};
|
|
696
|
-
export const
|
|
1039
|
+
export const getDbUserDeleteMutationOptions = (options) => {
|
|
697
1040
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
698
1041
|
const mutationFn = (props) => {
|
|
699
1042
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
700
1043
|
return dbUserDelete(hostingId, data, axiosOptions);
|
|
701
1044
|
};
|
|
702
|
-
return
|
|
1045
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1046
|
+
};
|
|
1047
|
+
/**
|
|
1048
|
+
* @summary Delete db user
|
|
1049
|
+
*/
|
|
1050
|
+
export const useDbUserDelete = (options) => {
|
|
1051
|
+
const mutationOptions = getDbUserDeleteMutationOptions(options);
|
|
1052
|
+
return useMutation(mutationOptions);
|
|
703
1053
|
};
|
|
704
1054
|
/**
|
|
705
1055
|
* List all DB users
|
|
@@ -708,14 +1058,23 @@ export const useDbUserDelete = (options) => {
|
|
|
708
1058
|
export const dbUserList = (hostingId, options) => {
|
|
709
1059
|
return axios.get(`/v1/hosting/${hostingId}/db/users`, options);
|
|
710
1060
|
};
|
|
711
|
-
export const getDbUserListQueryKey = (hostingId) =>
|
|
712
|
-
|
|
1061
|
+
export const getDbUserListQueryKey = (hostingId) => {
|
|
1062
|
+
return [`/v1/hosting/${hostingId}/db/users`];
|
|
1063
|
+
};
|
|
1064
|
+
export const getDbUserListQueryOptions = (hostingId, options) => {
|
|
713
1065
|
var _a;
|
|
714
1066
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
715
1067
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserListQueryKey(hostingId);
|
|
716
1068
|
const queryFn = ({ signal }) => dbUserList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
717
|
-
|
|
718
|
-
|
|
1069
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1070
|
+
};
|
|
1071
|
+
/**
|
|
1072
|
+
* @summary Get list of db users
|
|
1073
|
+
*/
|
|
1074
|
+
export const useDbUserList = (hostingId, options) => {
|
|
1075
|
+
const queryOptions = getDbUserListQueryOptions(hostingId, options);
|
|
1076
|
+
const query = useQuery(queryOptions);
|
|
1077
|
+
query.queryKey = queryOptions.queryKey;
|
|
719
1078
|
return query;
|
|
720
1079
|
};
|
|
721
1080
|
/**
|
|
@@ -725,30 +1084,46 @@ export const useDbUserList = (hostingId, options) => {
|
|
|
725
1084
|
export const domains = (hostingId, params, options) => {
|
|
726
1085
|
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) }));
|
|
727
1086
|
};
|
|
728
|
-
export const getDomainsQueryKey = (hostingId, params) =>
|
|
729
|
-
|
|
1087
|
+
export const getDomainsQueryKey = (hostingId, params) => {
|
|
1088
|
+
return [`/v1/hosting/${hostingId}/domains`, ...(params ? [params] : [])];
|
|
1089
|
+
};
|
|
1090
|
+
export const getDomainsQueryOptions = (hostingId, params, options) => {
|
|
730
1091
|
var _a;
|
|
731
1092
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
732
1093
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDomainsQueryKey(hostingId, params);
|
|
733
1094
|
const queryFn = ({ signal }) => domains(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
734
|
-
|
|
735
|
-
query.queryKey = queryKey;
|
|
736
|
-
return query;
|
|
1095
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
737
1096
|
};
|
|
738
1097
|
/**
|
|
739
|
-
*
|
|
740
|
-
|
|
1098
|
+
* @summary domain list
|
|
1099
|
+
*/
|
|
1100
|
+
export const useDomains = (hostingId, params, options) => {
|
|
1101
|
+
const queryOptions = getDomainsQueryOptions(hostingId, params, options);
|
|
1102
|
+
const query = useQuery(queryOptions);
|
|
1103
|
+
query.queryKey = queryOptions.queryKey;
|
|
1104
|
+
return query;
|
|
1105
|
+
};
|
|
1106
|
+
/**
|
|
1107
|
+
* Unassign the domain associated with the hosting account
|
|
1108
|
+
* @summary Unassign the domain
|
|
741
1109
|
*/
|
|
742
1110
|
export const hostingDomainsUnassign = (hostingId, hostingDomainsUnassignBody, options) => {
|
|
743
1111
|
return axios.post(`/v1/hosting/${hostingId}/domains/unassign`, hostingDomainsUnassignBody, options);
|
|
744
1112
|
};
|
|
745
|
-
export const
|
|
1113
|
+
export const getHostingDomainsUnassignMutationOptions = (options) => {
|
|
746
1114
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
747
1115
|
const mutationFn = (props) => {
|
|
748
1116
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
749
1117
|
return hostingDomainsUnassign(hostingId, data, axiosOptions);
|
|
750
1118
|
};
|
|
751
|
-
return
|
|
1119
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* @summary Unassign the domain
|
|
1123
|
+
*/
|
|
1124
|
+
export const useHostingDomainsUnassign = (options) => {
|
|
1125
|
+
const mutationOptions = getHostingDomainsUnassignMutationOptions(options);
|
|
1126
|
+
return useMutation(mutationOptions);
|
|
752
1127
|
};
|
|
753
1128
|
/**
|
|
754
1129
|
* Returns info about an existing ecommerce addon otherwise it returns null
|
|
@@ -757,14 +1132,23 @@ export const useHostingDomainsUnassign = (options) => {
|
|
|
757
1132
|
export const hostingEcommerceInfo = (hostingId, options) => {
|
|
758
1133
|
return axios.get(`/v1/hosting/${hostingId}/ecommerce`, options);
|
|
759
1134
|
};
|
|
760
|
-
export const getHostingEcommerceInfoQueryKey = (hostingId) =>
|
|
761
|
-
|
|
1135
|
+
export const getHostingEcommerceInfoQueryKey = (hostingId) => {
|
|
1136
|
+
return [`/v1/hosting/${hostingId}/ecommerce`];
|
|
1137
|
+
};
|
|
1138
|
+
export const getHostingEcommerceInfoQueryOptions = (hostingId, options) => {
|
|
762
1139
|
var _a;
|
|
763
1140
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
764
1141
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingEcommerceInfoQueryKey(hostingId);
|
|
765
1142
|
const queryFn = ({ signal }) => hostingEcommerceInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
766
|
-
|
|
767
|
-
|
|
1143
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1144
|
+
};
|
|
1145
|
+
/**
|
|
1146
|
+
* @summary ecommerce info
|
|
1147
|
+
*/
|
|
1148
|
+
export const useHostingEcommerceInfo = (hostingId, options) => {
|
|
1149
|
+
const queryOptions = getHostingEcommerceInfoQueryOptions(hostingId, options);
|
|
1150
|
+
const query = useQuery(queryOptions);
|
|
1151
|
+
query.queryKey = queryOptions.queryKey;
|
|
768
1152
|
return query;
|
|
769
1153
|
};
|
|
770
1154
|
/**
|
|
@@ -774,14 +1158,23 @@ export const useHostingEcommerceInfo = (hostingId, options) => {
|
|
|
774
1158
|
export const hostingFtpList = (hostingId, options) => {
|
|
775
1159
|
return axios.get(`/v1/hosting/${hostingId}/ftp`, options);
|
|
776
1160
|
};
|
|
777
|
-
export const getHostingFtpListQueryKey = (hostingId) =>
|
|
778
|
-
|
|
1161
|
+
export const getHostingFtpListQueryKey = (hostingId) => {
|
|
1162
|
+
return [`/v1/hosting/${hostingId}/ftp`];
|
|
1163
|
+
};
|
|
1164
|
+
export const getHostingFtpListQueryOptions = (hostingId, options) => {
|
|
779
1165
|
var _a;
|
|
780
1166
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
781
1167
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingFtpListQueryKey(hostingId);
|
|
782
1168
|
const queryFn = ({ signal }) => hostingFtpList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
783
|
-
|
|
784
|
-
|
|
1169
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1170
|
+
};
|
|
1171
|
+
/**
|
|
1172
|
+
* @summary ftp list
|
|
1173
|
+
*/
|
|
1174
|
+
export const useHostingFtpList = (hostingId, options) => {
|
|
1175
|
+
const queryOptions = getHostingFtpListQueryOptions(hostingId, options);
|
|
1176
|
+
const query = useQuery(queryOptions);
|
|
1177
|
+
query.queryKey = queryOptions.queryKey;
|
|
785
1178
|
return query;
|
|
786
1179
|
};
|
|
787
1180
|
/**
|
|
@@ -791,13 +1184,20 @@ export const useHostingFtpList = (hostingId, options) => {
|
|
|
791
1184
|
export const hostingFtpAdd = (hostingId, hostingFtpAddBody, options) => {
|
|
792
1185
|
return axios.post(`/v1/hosting/${hostingId}/ftp`, hostingFtpAddBody, options);
|
|
793
1186
|
};
|
|
794
|
-
export const
|
|
1187
|
+
export const getHostingFtpAddMutationOptions = (options) => {
|
|
795
1188
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
796
1189
|
const mutationFn = (props) => {
|
|
797
1190
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
798
1191
|
return hostingFtpAdd(hostingId, data, axiosOptions);
|
|
799
1192
|
};
|
|
800
|
-
return
|
|
1193
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1194
|
+
};
|
|
1195
|
+
/**
|
|
1196
|
+
* @summary Add ftp account
|
|
1197
|
+
*/
|
|
1198
|
+
export const useHostingFtpAdd = (options) => {
|
|
1199
|
+
const mutationOptions = getHostingFtpAddMutationOptions(options);
|
|
1200
|
+
return useMutation(mutationOptions);
|
|
801
1201
|
};
|
|
802
1202
|
/**
|
|
803
1203
|
* Update ftp account
|
|
@@ -806,13 +1206,20 @@ export const useHostingFtpAdd = (options) => {
|
|
|
806
1206
|
export const hostingFtpUpdate = (hostingId, hostingFtpUpdateBody, options) => {
|
|
807
1207
|
return axios.put(`/v1/hosting/${hostingId}/ftp`, hostingFtpUpdateBody, options);
|
|
808
1208
|
};
|
|
809
|
-
export const
|
|
1209
|
+
export const getHostingFtpUpdateMutationOptions = (options) => {
|
|
810
1210
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
811
1211
|
const mutationFn = (props) => {
|
|
812
1212
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
813
1213
|
return hostingFtpUpdate(hostingId, data, axiosOptions);
|
|
814
1214
|
};
|
|
815
|
-
return
|
|
1215
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1216
|
+
};
|
|
1217
|
+
/**
|
|
1218
|
+
* @summary Update ftp account
|
|
1219
|
+
*/
|
|
1220
|
+
export const useHostingFtpUpdate = (options) => {
|
|
1221
|
+
const mutationOptions = getHostingFtpUpdateMutationOptions(options);
|
|
1222
|
+
return useMutation(mutationOptions);
|
|
816
1223
|
};
|
|
817
1224
|
/**
|
|
818
1225
|
* Delete ftp account
|
|
@@ -821,13 +1228,20 @@ export const useHostingFtpUpdate = (options) => {
|
|
|
821
1228
|
export const hostingFtp = (hostingId, hostingFtpBody, options) => {
|
|
822
1229
|
return axios.delete(`/v1/hosting/${hostingId}/ftp`, Object.assign({ data: hostingFtpBody }, options));
|
|
823
1230
|
};
|
|
824
|
-
export const
|
|
1231
|
+
export const getHostingFtpMutationOptions = (options) => {
|
|
825
1232
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
826
1233
|
const mutationFn = (props) => {
|
|
827
1234
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
828
1235
|
return hostingFtp(hostingId, data, axiosOptions);
|
|
829
1236
|
};
|
|
830
|
-
return
|
|
1237
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1238
|
+
};
|
|
1239
|
+
/**
|
|
1240
|
+
* @summary Delete ftp account
|
|
1241
|
+
*/
|
|
1242
|
+
export const useHostingFtp = (options) => {
|
|
1243
|
+
const mutationOptions = getHostingFtpMutationOptions(options);
|
|
1244
|
+
return useMutation(mutationOptions);
|
|
831
1245
|
};
|
|
832
1246
|
/**
|
|
833
1247
|
* Returns hosting account info
|
|
@@ -836,14 +1250,23 @@ export const useHostingFtp = (options) => {
|
|
|
836
1250
|
export const hostingInfo = (hostingId, options) => {
|
|
837
1251
|
return axios.get(`/v1/hosting/${hostingId}/info`, options);
|
|
838
1252
|
};
|
|
839
|
-
export const getHostingInfoQueryKey = (hostingId) =>
|
|
840
|
-
|
|
1253
|
+
export const getHostingInfoQueryKey = (hostingId) => {
|
|
1254
|
+
return [`/v1/hosting/${hostingId}/info`];
|
|
1255
|
+
};
|
|
1256
|
+
export const getHostingInfoQueryOptions = (hostingId, options) => {
|
|
841
1257
|
var _a;
|
|
842
1258
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
843
1259
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoQueryKey(hostingId);
|
|
844
1260
|
const queryFn = ({ signal }) => hostingInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
845
|
-
|
|
846
|
-
|
|
1261
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1262
|
+
};
|
|
1263
|
+
/**
|
|
1264
|
+
* @summary Hosting info
|
|
1265
|
+
*/
|
|
1266
|
+
export const useHostingInfo = (hostingId, options) => {
|
|
1267
|
+
const queryOptions = getHostingInfoQueryOptions(hostingId, options);
|
|
1268
|
+
const query = useQuery(queryOptions);
|
|
1269
|
+
query.queryKey = queryOptions.queryKey;
|
|
847
1270
|
return query;
|
|
848
1271
|
};
|
|
849
1272
|
/**
|
|
@@ -853,14 +1276,23 @@ export const useHostingInfo = (hostingId, options) => {
|
|
|
853
1276
|
export const hostingInfoDiskUsage = (hostingId, options) => {
|
|
854
1277
|
return axios.get(`/v1/hosting/${hostingId}/info/diskusage`, options);
|
|
855
1278
|
};
|
|
856
|
-
export const getHostingInfoDiskUsageQueryKey = (hostingId) =>
|
|
857
|
-
|
|
1279
|
+
export const getHostingInfoDiskUsageQueryKey = (hostingId) => {
|
|
1280
|
+
return [`/v1/hosting/${hostingId}/info/diskusage`];
|
|
1281
|
+
};
|
|
1282
|
+
export const getHostingInfoDiskUsageQueryOptions = (hostingId, options) => {
|
|
858
1283
|
var _a;
|
|
859
1284
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
860
1285
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingInfoDiskUsageQueryKey(hostingId);
|
|
861
1286
|
const queryFn = ({ signal }) => hostingInfoDiskUsage(hostingId, Object.assign({ signal }, axiosOptions));
|
|
862
|
-
|
|
863
|
-
|
|
1287
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1288
|
+
};
|
|
1289
|
+
/**
|
|
1290
|
+
* @summary info disk usage
|
|
1291
|
+
*/
|
|
1292
|
+
export const useHostingInfoDiskUsage = (hostingId, options) => {
|
|
1293
|
+
const queryOptions = getHostingInfoDiskUsageQueryOptions(hostingId, options);
|
|
1294
|
+
const query = useQuery(queryOptions);
|
|
1295
|
+
query.queryKey = queryOptions.queryKey;
|
|
864
1296
|
return query;
|
|
865
1297
|
};
|
|
866
1298
|
/**
|
|
@@ -870,13 +1302,20 @@ export const useHostingInfoDiskUsage = (hostingId, options) => {
|
|
|
870
1302
|
export const hostingLead = (hostingId, params, options) => {
|
|
871
1303
|
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) }));
|
|
872
1304
|
};
|
|
873
|
-
export const
|
|
1305
|
+
export const getHostingLeadMutationOptions = (options) => {
|
|
874
1306
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
875
1307
|
const mutationFn = (props) => {
|
|
876
1308
|
const { hostingId, params } = props !== null && props !== void 0 ? props : {};
|
|
877
1309
|
return hostingLead(hostingId, params, axiosOptions);
|
|
878
1310
|
};
|
|
879
|
-
return
|
|
1311
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1312
|
+
};
|
|
1313
|
+
/**
|
|
1314
|
+
* @summary Lead info
|
|
1315
|
+
*/
|
|
1316
|
+
export const useHostingLead = (options) => {
|
|
1317
|
+
const mutationOptions = getHostingLeadMutationOptions(options);
|
|
1318
|
+
return useMutation(mutationOptions);
|
|
880
1319
|
};
|
|
881
1320
|
/**
|
|
882
1321
|
* Gets the Wordpress migration status
|
|
@@ -885,14 +1324,23 @@ export const useHostingLead = (options) => {
|
|
|
885
1324
|
export const hostingMigrationStatus = (hostingId, options) => {
|
|
886
1325
|
return axios.get(`/v1/hosting/${hostingId}/migrations`, options);
|
|
887
1326
|
};
|
|
888
|
-
export const getHostingMigrationStatusQueryKey = (hostingId) =>
|
|
889
|
-
|
|
1327
|
+
export const getHostingMigrationStatusQueryKey = (hostingId) => {
|
|
1328
|
+
return [`/v1/hosting/${hostingId}/migrations`];
|
|
1329
|
+
};
|
|
1330
|
+
export const getHostingMigrationStatusQueryOptions = (hostingId, options) => {
|
|
890
1331
|
var _a;
|
|
891
1332
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
892
1333
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationStatusQueryKey(hostingId);
|
|
893
1334
|
const queryFn = ({ signal }) => hostingMigrationStatus(hostingId, Object.assign({ signal }, axiosOptions));
|
|
894
|
-
|
|
895
|
-
|
|
1335
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1336
|
+
};
|
|
1337
|
+
/**
|
|
1338
|
+
* @summary Wordpress migration status
|
|
1339
|
+
*/
|
|
1340
|
+
export const useHostingMigrationStatus = (hostingId, options) => {
|
|
1341
|
+
const queryOptions = getHostingMigrationStatusQueryOptions(hostingId, options);
|
|
1342
|
+
const query = useQuery(queryOptions);
|
|
1343
|
+
query.queryKey = queryOptions.queryKey;
|
|
896
1344
|
return query;
|
|
897
1345
|
};
|
|
898
1346
|
/**
|
|
@@ -902,13 +1350,20 @@ export const useHostingMigrationStatus = (hostingId, options) => {
|
|
|
902
1350
|
export const hostingMigrations = (hostingId, hostingMigrationsBody, options) => {
|
|
903
1351
|
return axios.post(`/v1/hosting/${hostingId}/migrations`, hostingMigrationsBody, options);
|
|
904
1352
|
};
|
|
905
|
-
export const
|
|
1353
|
+
export const getHostingMigrationsMutationOptions = (options) => {
|
|
906
1354
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
907
1355
|
const mutationFn = (props) => {
|
|
908
1356
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
909
1357
|
return hostingMigrations(hostingId, data, axiosOptions);
|
|
910
1358
|
};
|
|
911
|
-
return
|
|
1359
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1360
|
+
};
|
|
1361
|
+
/**
|
|
1362
|
+
* @summary start the migration process for a site
|
|
1363
|
+
*/
|
|
1364
|
+
export const useHostingMigrations = (options) => {
|
|
1365
|
+
const mutationOptions = getHostingMigrationsMutationOptions(options);
|
|
1366
|
+
return useMutation(mutationOptions);
|
|
912
1367
|
};
|
|
913
1368
|
/**
|
|
914
1369
|
* Checks if Migration ID exists, indicating the site migration is in progress or completed
|
|
@@ -918,14 +1373,24 @@ export const useHostingMigrations = (options) => {
|
|
|
918
1373
|
export const hostingMigrationsCheck = (hostingId, params, options) => {
|
|
919
1374
|
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) }));
|
|
920
1375
|
};
|
|
921
|
-
export const getHostingMigrationsCheckQueryKey = (hostingId, params) =>
|
|
922
|
-
|
|
1376
|
+
export const getHostingMigrationsCheckQueryKey = (hostingId, params) => {
|
|
1377
|
+
return [`/v1/hosting/${hostingId}/migrations/check`, ...(params ? [params] : [])];
|
|
1378
|
+
};
|
|
1379
|
+
export const getHostingMigrationsCheckQueryOptions = (hostingId, params, options) => {
|
|
923
1380
|
var _a;
|
|
924
1381
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
925
1382
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationsCheckQueryKey(hostingId, params);
|
|
926
1383
|
const queryFn = ({ signal }) => hostingMigrationsCheck(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
927
|
-
|
|
928
|
-
|
|
1384
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1385
|
+
};
|
|
1386
|
+
/**
|
|
1387
|
+
* @deprecated
|
|
1388
|
+
* @summary Deprecated Migration ID check
|
|
1389
|
+
*/
|
|
1390
|
+
export const useHostingMigrationsCheck = (hostingId, params, options) => {
|
|
1391
|
+
const queryOptions = getHostingMigrationsCheckQueryOptions(hostingId, params, options);
|
|
1392
|
+
const query = useQuery(queryOptions);
|
|
1393
|
+
query.queryKey = queryOptions.queryKey;
|
|
929
1394
|
return query;
|
|
930
1395
|
};
|
|
931
1396
|
/**
|
|
@@ -935,13 +1400,20 @@ export const useHostingMigrationsCheck = (hostingId, params, options) => {
|
|
|
935
1400
|
export const hostingMigrationsEvent = (hostingId, hostingMigrationsEventBody, options) => {
|
|
936
1401
|
return axios.post(`/v1/hosting/${hostingId}/migrations/event`, hostingMigrationsEventBody, options);
|
|
937
1402
|
};
|
|
938
|
-
export const
|
|
1403
|
+
export const getHostingMigrationsEventMutationOptions = (options) => {
|
|
939
1404
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
940
1405
|
const mutationFn = (props) => {
|
|
941
1406
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
942
1407
|
return hostingMigrationsEvent(hostingId, data, axiosOptions);
|
|
943
1408
|
};
|
|
944
|
-
return
|
|
1409
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1410
|
+
};
|
|
1411
|
+
/**
|
|
1412
|
+
* @summary hosting migrations event
|
|
1413
|
+
*/
|
|
1414
|
+
export const useHostingMigrationsEvent = (options) => {
|
|
1415
|
+
const mutationOptions = getHostingMigrationsEventMutationOptions(options);
|
|
1416
|
+
return useMutation(mutationOptions);
|
|
945
1417
|
};
|
|
946
1418
|
/**
|
|
947
1419
|
* Gets the Wordpress migration information
|
|
@@ -950,14 +1422,23 @@ export const useHostingMigrationsEvent = (options) => {
|
|
|
950
1422
|
export const hostingMigrationInfo = (hostingId, params, options) => {
|
|
951
1423
|
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) }));
|
|
952
1424
|
};
|
|
953
|
-
export const getHostingMigrationInfoQueryKey = (hostingId, params) =>
|
|
954
|
-
|
|
1425
|
+
export const getHostingMigrationInfoQueryKey = (hostingId, params) => {
|
|
1426
|
+
return [`/v1/hosting/${hostingId}/migrations/info`, ...(params ? [params] : [])];
|
|
1427
|
+
};
|
|
1428
|
+
export const getHostingMigrationInfoQueryOptions = (hostingId, params, options) => {
|
|
955
1429
|
var _a;
|
|
956
1430
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
957
1431
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationInfoQueryKey(hostingId, params);
|
|
958
1432
|
const queryFn = ({ signal }) => hostingMigrationInfo(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
959
|
-
|
|
960
|
-
|
|
1433
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1434
|
+
};
|
|
1435
|
+
/**
|
|
1436
|
+
* @summary Wordpress migration information
|
|
1437
|
+
*/
|
|
1438
|
+
export const useHostingMigrationInfo = (hostingId, params, options) => {
|
|
1439
|
+
const queryOptions = getHostingMigrationInfoQueryOptions(hostingId, params, options);
|
|
1440
|
+
const query = useQuery(queryOptions);
|
|
1441
|
+
query.queryKey = queryOptions.queryKey;
|
|
961
1442
|
return query;
|
|
962
1443
|
};
|
|
963
1444
|
/**
|
|
@@ -967,14 +1448,23 @@ export const useHostingMigrationInfo = (hostingId, params, options) => {
|
|
|
967
1448
|
export const hostingMigrationSiteScanStatus = (hostingId, params, options) => {
|
|
968
1449
|
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) }));
|
|
969
1450
|
};
|
|
970
|
-
export const getHostingMigrationSiteScanStatusQueryKey = (hostingId, params) =>
|
|
971
|
-
|
|
1451
|
+
export const getHostingMigrationSiteScanStatusQueryKey = (hostingId, params) => {
|
|
1452
|
+
return [`/v1/hosting/${hostingId}/migrations/site-scan`, ...(params ? [params] : [])];
|
|
1453
|
+
};
|
|
1454
|
+
export const getHostingMigrationSiteScanStatusQueryOptions = (hostingId, params, options) => {
|
|
972
1455
|
var _a;
|
|
973
1456
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
974
1457
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationSiteScanStatusQueryKey(hostingId, params);
|
|
975
1458
|
const queryFn = ({ signal }) => hostingMigrationSiteScanStatus(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
976
|
-
|
|
977
|
-
|
|
1459
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1460
|
+
};
|
|
1461
|
+
/**
|
|
1462
|
+
* @summary SiteMigration site_scan status
|
|
1463
|
+
*/
|
|
1464
|
+
export const useHostingMigrationSiteScanStatus = (hostingId, params, options) => {
|
|
1465
|
+
const queryOptions = getHostingMigrationSiteScanStatusQueryOptions(hostingId, params, options);
|
|
1466
|
+
const query = useQuery(queryOptions);
|
|
1467
|
+
query.queryKey = queryOptions.queryKey;
|
|
978
1468
|
return query;
|
|
979
1469
|
};
|
|
980
1470
|
/**
|
|
@@ -985,14 +1475,24 @@ export const useHostingMigrationSiteScanStatus = (hostingId, params, options) =>
|
|
|
985
1475
|
export const hostingNameservers = (hostingId, options) => {
|
|
986
1476
|
return axios.get(`/v1/hosting/${hostingId}/nameservers`, options);
|
|
987
1477
|
};
|
|
988
|
-
export const getHostingNameserversQueryKey = (hostingId) =>
|
|
989
|
-
|
|
1478
|
+
export const getHostingNameserversQueryKey = (hostingId) => {
|
|
1479
|
+
return [`/v1/hosting/${hostingId}/nameservers`];
|
|
1480
|
+
};
|
|
1481
|
+
export const getHostingNameserversQueryOptions = (hostingId, options) => {
|
|
990
1482
|
var _a;
|
|
991
1483
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
992
1484
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversQueryKey(hostingId);
|
|
993
1485
|
const queryFn = ({ signal }) => hostingNameservers(hostingId, Object.assign({ signal }, axiosOptions));
|
|
994
|
-
|
|
995
|
-
|
|
1486
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1487
|
+
};
|
|
1488
|
+
/**
|
|
1489
|
+
* @deprecated
|
|
1490
|
+
* @summary hosting nameservers
|
|
1491
|
+
*/
|
|
1492
|
+
export const useHostingNameservers = (hostingId, options) => {
|
|
1493
|
+
const queryOptions = getHostingNameserversQueryOptions(hostingId, options);
|
|
1494
|
+
const query = useQuery(queryOptions);
|
|
1495
|
+
query.queryKey = queryOptions.queryKey;
|
|
996
1496
|
return query;
|
|
997
1497
|
};
|
|
998
1498
|
/**
|
|
@@ -1002,14 +1502,23 @@ export const useHostingNameservers = (hostingId, options) => {
|
|
|
1002
1502
|
export const hostingOnboardingData = (hostingId, options) => {
|
|
1003
1503
|
return axios.get(`/v1/hosting/${hostingId}/onboarding`, options);
|
|
1004
1504
|
};
|
|
1005
|
-
export const getHostingOnboardingDataQueryKey = (hostingId) =>
|
|
1006
|
-
|
|
1505
|
+
export const getHostingOnboardingDataQueryKey = (hostingId) => {
|
|
1506
|
+
return [`/v1/hosting/${hostingId}/onboarding`];
|
|
1507
|
+
};
|
|
1508
|
+
export const getHostingOnboardingDataQueryOptions = (hostingId, options) => {
|
|
1007
1509
|
var _a;
|
|
1008
1510
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1009
1511
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingOnboardingDataQueryKey(hostingId);
|
|
1010
1512
|
const queryFn = ({ signal }) => hostingOnboardingData(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1011
|
-
|
|
1012
|
-
|
|
1513
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1514
|
+
};
|
|
1515
|
+
/**
|
|
1516
|
+
* @summary Returns hosting onboarding data
|
|
1517
|
+
*/
|
|
1518
|
+
export const useHostingOnboardingData = (hostingId, options) => {
|
|
1519
|
+
const queryOptions = getHostingOnboardingDataQueryOptions(hostingId, options);
|
|
1520
|
+
const query = useQuery(queryOptions);
|
|
1521
|
+
query.queryKey = queryOptions.queryKey;
|
|
1013
1522
|
return query;
|
|
1014
1523
|
};
|
|
1015
1524
|
/**
|
|
@@ -1018,13 +1527,20 @@ export const useHostingOnboardingData = (hostingId, options) => {
|
|
|
1018
1527
|
export const hostingOnboardingDataUpdate = (hostingId, hostingOnboardingDataUpdateBody, options) => {
|
|
1019
1528
|
return axios.put(`/v1/hosting/${hostingId}/onboarding`, hostingOnboardingDataUpdateBody, options);
|
|
1020
1529
|
};
|
|
1021
|
-
export const
|
|
1530
|
+
export const getHostingOnboardingDataUpdateMutationOptions = (options) => {
|
|
1022
1531
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1023
1532
|
const mutationFn = (props) => {
|
|
1024
1533
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1025
1534
|
return hostingOnboardingDataUpdate(hostingId, data, axiosOptions);
|
|
1026
1535
|
};
|
|
1027
|
-
return
|
|
1536
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1537
|
+
};
|
|
1538
|
+
/**
|
|
1539
|
+
* @summary Updates hosting onboarding data
|
|
1540
|
+
*/
|
|
1541
|
+
export const useHostingOnboardingDataUpdate = (options) => {
|
|
1542
|
+
const mutationOptions = getHostingOnboardingDataUpdateMutationOptions(options);
|
|
1543
|
+
return useMutation(mutationOptions);
|
|
1028
1544
|
};
|
|
1029
1545
|
/**
|
|
1030
1546
|
* Returns the hosting sso_whm login url
|
|
@@ -1033,14 +1549,23 @@ export const useHostingOnboardingDataUpdate = (options) => {
|
|
|
1033
1549
|
export const hostingResellerSsoWhm = (hostingId, options) => {
|
|
1034
1550
|
return axios.get(`/v1/hosting/${hostingId}/reseller/sso/whm`, options);
|
|
1035
1551
|
};
|
|
1036
|
-
export const getHostingResellerSsoWhmQueryKey = (hostingId) =>
|
|
1037
|
-
|
|
1552
|
+
export const getHostingResellerSsoWhmQueryKey = (hostingId) => {
|
|
1553
|
+
return [`/v1/hosting/${hostingId}/reseller/sso/whm`];
|
|
1554
|
+
};
|
|
1555
|
+
export const getHostingResellerSsoWhmQueryOptions = (hostingId, options) => {
|
|
1038
1556
|
var _a;
|
|
1039
1557
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1040
1558
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingResellerSsoWhmQueryKey(hostingId);
|
|
1041
1559
|
const queryFn = ({ signal }) => hostingResellerSsoWhm(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1042
|
-
|
|
1043
|
-
|
|
1560
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1561
|
+
};
|
|
1562
|
+
/**
|
|
1563
|
+
* @summary hosting sso_whm
|
|
1564
|
+
*/
|
|
1565
|
+
export const useHostingResellerSsoWhm = (hostingId, options) => {
|
|
1566
|
+
const queryOptions = getHostingResellerSsoWhmQueryOptions(hostingId, options);
|
|
1567
|
+
const query = useQuery(queryOptions);
|
|
1568
|
+
query.queryKey = queryOptions.queryKey;
|
|
1044
1569
|
return query;
|
|
1045
1570
|
};
|
|
1046
1571
|
/**
|
|
@@ -1050,13 +1575,20 @@ export const useHostingResellerSsoWhm = (hostingId, options) => {
|
|
|
1050
1575
|
export const hostingShellToggle = (hostingId, hostingShellToggleBody, options) => {
|
|
1051
1576
|
return axios.put(`/v1/hosting/${hostingId}/shell`, hostingShellToggleBody, options);
|
|
1052
1577
|
};
|
|
1053
|
-
export const
|
|
1578
|
+
export const getHostingShellToggleMutationOptions = (options) => {
|
|
1054
1579
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1055
1580
|
const mutationFn = (props) => {
|
|
1056
1581
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1057
1582
|
return hostingShellToggle(hostingId, data, axiosOptions);
|
|
1058
1583
|
};
|
|
1059
|
-
return
|
|
1584
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1585
|
+
};
|
|
1586
|
+
/**
|
|
1587
|
+
* @summary hosting shell toggle
|
|
1588
|
+
*/
|
|
1589
|
+
export const useHostingShellToggle = (options) => {
|
|
1590
|
+
const mutationOptions = getHostingShellToggleMutationOptions(options);
|
|
1591
|
+
return useMutation(mutationOptions);
|
|
1060
1592
|
};
|
|
1061
1593
|
/**
|
|
1062
1594
|
* Determine shell access status for an account.
|
|
@@ -1065,14 +1597,23 @@ export const useHostingShellToggle = (options) => {
|
|
|
1065
1597
|
export const hostingShellInfo = (hostingId, options) => {
|
|
1066
1598
|
return axios.get(`/v1/hosting/${hostingId}/shell`, options);
|
|
1067
1599
|
};
|
|
1068
|
-
export const getHostingShellInfoQueryKey = (hostingId) =>
|
|
1069
|
-
|
|
1600
|
+
export const getHostingShellInfoQueryKey = (hostingId) => {
|
|
1601
|
+
return [`/v1/hosting/${hostingId}/shell`];
|
|
1602
|
+
};
|
|
1603
|
+
export const getHostingShellInfoQueryOptions = (hostingId, options) => {
|
|
1070
1604
|
var _a;
|
|
1071
1605
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1072
1606
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingShellInfoQueryKey(hostingId);
|
|
1073
1607
|
const queryFn = ({ signal }) => hostingShellInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1074
|
-
|
|
1075
|
-
|
|
1608
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1609
|
+
};
|
|
1610
|
+
/**
|
|
1611
|
+
* @summary hosting shell_status
|
|
1612
|
+
*/
|
|
1613
|
+
export const useHostingShellInfo = (hostingId, options) => {
|
|
1614
|
+
const queryOptions = getHostingShellInfoQueryOptions(hostingId, options);
|
|
1615
|
+
const query = useQuery(queryOptions);
|
|
1616
|
+
query.queryKey = queryOptions.queryKey;
|
|
1076
1617
|
return query;
|
|
1077
1618
|
};
|
|
1078
1619
|
/**
|
|
@@ -1082,13 +1623,20 @@ export const useHostingShellInfo = (hostingId, options) => {
|
|
|
1082
1623
|
export const hostingSiteAdd = (hostingId, hostingSiteAddBody, options) => {
|
|
1083
1624
|
return axios.post(`/v1/hosting/${hostingId}/sites`, hostingSiteAddBody, options);
|
|
1084
1625
|
};
|
|
1085
|
-
export const
|
|
1626
|
+
export const getHostingSiteAddMutationOptions = (options) => {
|
|
1086
1627
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1087
1628
|
const mutationFn = (props) => {
|
|
1088
1629
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1089
1630
|
return hostingSiteAdd(hostingId, data, axiosOptions);
|
|
1090
1631
|
};
|
|
1091
|
-
return
|
|
1632
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1633
|
+
};
|
|
1634
|
+
/**
|
|
1635
|
+
* @summary sites add
|
|
1636
|
+
*/
|
|
1637
|
+
export const useHostingSiteAdd = (options) => {
|
|
1638
|
+
const mutationOptions = getHostingSiteAddMutationOptions(options);
|
|
1639
|
+
return useMutation(mutationOptions);
|
|
1092
1640
|
};
|
|
1093
1641
|
/**
|
|
1094
1642
|
* Update Sites in batches.
|
|
@@ -1097,13 +1645,20 @@ export const useHostingSiteAdd = (options) => {
|
|
|
1097
1645
|
export const sitesBatch = (hostingId, sitesBatchBody, options) => {
|
|
1098
1646
|
return axios.put(`/v1/hosting/${hostingId}/sites/batch`, sitesBatchBody, options);
|
|
1099
1647
|
};
|
|
1100
|
-
export const
|
|
1648
|
+
export const getSitesBatchMutationOptions = (options) => {
|
|
1101
1649
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1102
1650
|
const mutationFn = (props) => {
|
|
1103
1651
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1104
1652
|
return sitesBatch(hostingId, data, axiosOptions);
|
|
1105
1653
|
};
|
|
1106
|
-
return
|
|
1654
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1655
|
+
};
|
|
1656
|
+
/**
|
|
1657
|
+
* @summary sites update batch
|
|
1658
|
+
*/
|
|
1659
|
+
export const useSitesBatch = (options) => {
|
|
1660
|
+
const mutationOptions = getSitesBatchMutationOptions(options);
|
|
1661
|
+
return useMutation(mutationOptions);
|
|
1107
1662
|
};
|
|
1108
1663
|
/**
|
|
1109
1664
|
* Returns the hosting account's SSH information
|
|
@@ -1112,14 +1667,23 @@ export const useSitesBatch = (options) => {
|
|
|
1112
1667
|
export const hostingSshInfo = (hostingId, options) => {
|
|
1113
1668
|
return axios.get(`/v1/hosting/${hostingId}/ssh`, options);
|
|
1114
1669
|
};
|
|
1115
|
-
export const getHostingSshInfoQueryKey = (hostingId) =>
|
|
1116
|
-
|
|
1670
|
+
export const getHostingSshInfoQueryKey = (hostingId) => {
|
|
1671
|
+
return [`/v1/hosting/${hostingId}/ssh`];
|
|
1672
|
+
};
|
|
1673
|
+
export const getHostingSshInfoQueryOptions = (hostingId, options) => {
|
|
1117
1674
|
var _a;
|
|
1118
1675
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1119
1676
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSshInfoQueryKey(hostingId);
|
|
1120
1677
|
const queryFn = ({ signal }) => hostingSshInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1121
|
-
|
|
1122
|
-
|
|
1678
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1679
|
+
};
|
|
1680
|
+
/**
|
|
1681
|
+
* @summary ssh info
|
|
1682
|
+
*/
|
|
1683
|
+
export const useHostingSshInfo = (hostingId, options) => {
|
|
1684
|
+
const queryOptions = getHostingSshInfoQueryOptions(hostingId, options);
|
|
1685
|
+
const query = useQuery(queryOptions);
|
|
1686
|
+
query.queryKey = queryOptions.queryKey;
|
|
1123
1687
|
return query;
|
|
1124
1688
|
};
|
|
1125
1689
|
/**
|
|
@@ -1129,14 +1693,23 @@ export const useHostingSshInfo = (hostingId, options) => {
|
|
|
1129
1693
|
export const sshKeyFetch = (hostingId, params, options) => {
|
|
1130
1694
|
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) }));
|
|
1131
1695
|
};
|
|
1132
|
-
export const getSshKeyFetchQueryKey = (hostingId, params) =>
|
|
1133
|
-
|
|
1696
|
+
export const getSshKeyFetchQueryKey = (hostingId, params) => {
|
|
1697
|
+
return [`/v1/hosting/${hostingId}/ssh/fetch`, ...(params ? [params] : [])];
|
|
1698
|
+
};
|
|
1699
|
+
export const getSshKeyFetchQueryOptions = (hostingId, params, options) => {
|
|
1134
1700
|
var _a;
|
|
1135
1701
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1136
1702
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyFetchQueryKey(hostingId, params);
|
|
1137
1703
|
const queryFn = ({ signal }) => sshKeyFetch(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
1138
|
-
|
|
1139
|
-
|
|
1704
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1705
|
+
};
|
|
1706
|
+
/**
|
|
1707
|
+
* @summary ssh key fetch
|
|
1708
|
+
*/
|
|
1709
|
+
export const useSshKeyFetch = (hostingId, params, options) => {
|
|
1710
|
+
const queryOptions = getSshKeyFetchQueryOptions(hostingId, params, options);
|
|
1711
|
+
const query = useQuery(queryOptions);
|
|
1712
|
+
query.queryKey = queryOptions.queryKey;
|
|
1140
1713
|
return query;
|
|
1141
1714
|
};
|
|
1142
1715
|
/**
|
|
@@ -1146,13 +1719,20 @@ export const useSshKeyFetch = (hostingId, params, options) => {
|
|
|
1146
1719
|
export const sshKeyImport = (hostingId, sshKeyImportBody, options) => {
|
|
1147
1720
|
return axios.post(`/v1/hosting/${hostingId}/ssh/import`, sshKeyImportBody, options);
|
|
1148
1721
|
};
|
|
1149
|
-
export const
|
|
1722
|
+
export const getSshKeyImportMutationOptions = (options) => {
|
|
1150
1723
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1151
1724
|
const mutationFn = (props) => {
|
|
1152
1725
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1153
1726
|
return sshKeyImport(hostingId, data, axiosOptions);
|
|
1154
1727
|
};
|
|
1155
|
-
return
|
|
1728
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1729
|
+
};
|
|
1730
|
+
/**
|
|
1731
|
+
* @summary Import ssh key
|
|
1732
|
+
*/
|
|
1733
|
+
export const useSshKeyImport = (options) => {
|
|
1734
|
+
const mutationOptions = getSshKeyImportMutationOptions(options);
|
|
1735
|
+
return useMutation(mutationOptions);
|
|
1156
1736
|
};
|
|
1157
1737
|
/**
|
|
1158
1738
|
* List all SSH keys on a server or account. Finds all keys in user's .ssh/ diretory.
|
|
@@ -1162,14 +1742,24 @@ export const useSshKeyImport = (options) => {
|
|
|
1162
1742
|
export const sshKeyList = (hostingId, options) => {
|
|
1163
1743
|
return axios.get(`/v1/hosting/${hostingId}/ssh/keys`, options);
|
|
1164
1744
|
};
|
|
1165
|
-
export const getSshKeyListQueryKey = (hostingId) =>
|
|
1166
|
-
|
|
1745
|
+
export const getSshKeyListQueryKey = (hostingId) => {
|
|
1746
|
+
return [`/v1/hosting/${hostingId}/ssh/keys`];
|
|
1747
|
+
};
|
|
1748
|
+
export const getSshKeyListQueryOptions = (hostingId, options) => {
|
|
1167
1749
|
var _a;
|
|
1168
1750
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1169
1751
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListQueryKey(hostingId);
|
|
1170
1752
|
const queryFn = ({ signal }) => sshKeyList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1171
|
-
|
|
1172
|
-
|
|
1753
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1754
|
+
};
|
|
1755
|
+
/**
|
|
1756
|
+
* @deprecated
|
|
1757
|
+
* @summary Deprecated - ssh keys list
|
|
1758
|
+
*/
|
|
1759
|
+
export const useSshKeyList = (hostingId, options) => {
|
|
1760
|
+
const queryOptions = getSshKeyListQueryOptions(hostingId, options);
|
|
1761
|
+
const query = useQuery(queryOptions);
|
|
1762
|
+
query.queryKey = queryOptions.queryKey;
|
|
1173
1763
|
return query;
|
|
1174
1764
|
};
|
|
1175
1765
|
/**
|
|
@@ -1179,13 +1769,20 @@ export const useSshKeyList = (hostingId, options) => {
|
|
|
1179
1769
|
export const sshKey = (hostingId, sshKeyBody, options) => {
|
|
1180
1770
|
return axios.delete(`/v1/hosting/${hostingId}/ssh/keys`, Object.assign({ data: sshKeyBody }, options));
|
|
1181
1771
|
};
|
|
1182
|
-
export const
|
|
1772
|
+
export const getSshKeyMutationOptions = (options) => {
|
|
1183
1773
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1184
1774
|
const mutationFn = (props) => {
|
|
1185
1775
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1186
1776
|
return sshKey(hostingId, data, axiosOptions);
|
|
1187
1777
|
};
|
|
1188
|
-
return
|
|
1778
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1779
|
+
};
|
|
1780
|
+
/**
|
|
1781
|
+
* @summary ssh key delete
|
|
1782
|
+
*/
|
|
1783
|
+
export const useSshKey = (options) => {
|
|
1784
|
+
const mutationOptions = getSshKeyMutationOptions(options);
|
|
1785
|
+
return useMutation(mutationOptions);
|
|
1189
1786
|
};
|
|
1190
1787
|
/**
|
|
1191
1788
|
* Generates public/private ssh keys
|
|
@@ -1194,13 +1791,20 @@ export const useSshKey = (options) => {
|
|
|
1194
1791
|
export const sshKeyGenerate = (hostingId, sshKeyGenerateBody, options) => {
|
|
1195
1792
|
return axios.post(`/v1/hosting/${hostingId}/ssh/keys`, sshKeyGenerateBody, options);
|
|
1196
1793
|
};
|
|
1197
|
-
export const
|
|
1794
|
+
export const getSshKeyGenerateMutationOptions = (options) => {
|
|
1198
1795
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1199
1796
|
const mutationFn = (props) => {
|
|
1200
1797
|
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1201
1798
|
return sshKeyGenerate(hostingId, data, axiosOptions);
|
|
1202
1799
|
};
|
|
1203
|
-
return
|
|
1800
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1801
|
+
};
|
|
1802
|
+
/**
|
|
1803
|
+
* @summary Generate ssh key
|
|
1804
|
+
*/
|
|
1805
|
+
export const useSshKeyGenerate = (options) => {
|
|
1806
|
+
const mutationOptions = getSshKeyGenerateMutationOptions(options);
|
|
1807
|
+
return useMutation(mutationOptions);
|
|
1204
1808
|
};
|
|
1205
1809
|
/**
|
|
1206
1810
|
* 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.
|
|
@@ -1209,14 +1813,23 @@ export const useSshKeyGenerate = (options) => {
|
|
|
1209
1813
|
export const sso = (hostingId, params, options) => {
|
|
1210
1814
|
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) }));
|
|
1211
1815
|
};
|
|
1212
|
-
export const getSsoQueryKey = (hostingId, params) =>
|
|
1213
|
-
|
|
1816
|
+
export const getSsoQueryKey = (hostingId, params) => {
|
|
1817
|
+
return [`/v1/hosting/${hostingId}/sso`, ...(params ? [params] : [])];
|
|
1818
|
+
};
|
|
1819
|
+
export const getSsoQueryOptions = (hostingId, params, options) => {
|
|
1214
1820
|
var _a;
|
|
1215
1821
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1216
1822
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSsoQueryKey(hostingId, params);
|
|
1217
1823
|
const queryFn = ({ signal }) => sso(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
1218
|
-
|
|
1219
|
-
|
|
1824
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
1825
|
+
};
|
|
1826
|
+
/**
|
|
1827
|
+
* @summary sso
|
|
1828
|
+
*/
|
|
1829
|
+
export const useSso = (hostingId, params, options) => {
|
|
1830
|
+
const queryOptions = getSsoQueryOptions(hostingId, params, options);
|
|
1831
|
+
const query = useQuery(queryOptions);
|
|
1832
|
+
query.queryKey = queryOptions.queryKey;
|
|
1220
1833
|
return query;
|
|
1221
1834
|
};
|
|
1222
1835
|
/**
|
|
@@ -1226,14 +1839,23 @@ export const useSso = (hostingId, params, options) => {
|
|
|
1226
1839
|
export const sitesList = (options) => {
|
|
1227
1840
|
return axios.get(`/v1/sites`, options);
|
|
1228
1841
|
};
|
|
1229
|
-
export const getSitesListQueryKey = () =>
|
|
1230
|
-
|
|
1842
|
+
export const getSitesListQueryKey = () => {
|
|
1843
|
+
return [`/v1/sites`];
|
|
1844
|
+
};
|
|
1845
|
+
export const getSitesListQueryOptions = (options) => {
|
|
1231
1846
|
var _a;
|
|
1232
1847
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1233
1848
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListQueryKey();
|
|
1234
1849
|
const queryFn = ({ signal }) => sitesList(Object.assign({ signal }, axiosOptions));
|
|
1235
|
-
|
|
1236
|
-
|
|
1850
|
+
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
1851
|
+
};
|
|
1852
|
+
/**
|
|
1853
|
+
* @summary Site list for an account
|
|
1854
|
+
*/
|
|
1855
|
+
export const useSitesList = (options) => {
|
|
1856
|
+
const queryOptions = getSitesListQueryOptions(options);
|
|
1857
|
+
const query = useQuery(queryOptions);
|
|
1858
|
+
query.queryKey = queryOptions.queryKey;
|
|
1237
1859
|
return query;
|
|
1238
1860
|
};
|
|
1239
1861
|
/**
|
|
@@ -1243,14 +1865,23 @@ export const useSitesList = (options) => {
|
|
|
1243
1865
|
export const sitesInfo = (siteId, options) => {
|
|
1244
1866
|
return axios.get(`/v1/sites/${siteId}`, options);
|
|
1245
1867
|
};
|
|
1246
|
-
export const getSitesInfoQueryKey = (siteId) =>
|
|
1247
|
-
|
|
1868
|
+
export const getSitesInfoQueryKey = (siteId) => {
|
|
1869
|
+
return [`/v1/sites/${siteId}`];
|
|
1870
|
+
};
|
|
1871
|
+
export const getSitesInfoQueryOptions = (siteId, options) => {
|
|
1248
1872
|
var _a;
|
|
1249
1873
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1250
1874
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesInfoQueryKey(siteId);
|
|
1251
1875
|
const queryFn = ({ signal }) => sitesInfo(siteId, Object.assign({ signal }, axiosOptions));
|
|
1252
|
-
|
|
1253
|
-
|
|
1876
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
1877
|
+
};
|
|
1878
|
+
/**
|
|
1879
|
+
* @summary info
|
|
1880
|
+
*/
|
|
1881
|
+
export const useSitesInfo = (siteId, options) => {
|
|
1882
|
+
const queryOptions = getSitesInfoQueryOptions(siteId, options);
|
|
1883
|
+
const query = useQuery(queryOptions);
|
|
1884
|
+
query.queryKey = queryOptions.queryKey;
|
|
1254
1885
|
return query;
|
|
1255
1886
|
};
|
|
1256
1887
|
/**
|
|
@@ -1260,13 +1891,20 @@ export const useSitesInfo = (siteId, options) => {
|
|
|
1260
1891
|
export const siteUpdate = (siteId, siteUpdateBody, options) => {
|
|
1261
1892
|
return axios.put(`/v1/sites/${siteId}`, siteUpdateBody, options);
|
|
1262
1893
|
};
|
|
1263
|
-
export const
|
|
1894
|
+
export const getSiteUpdateMutationOptions = (options) => {
|
|
1264
1895
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1265
1896
|
const mutationFn = (props) => {
|
|
1266
1897
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1267
1898
|
return siteUpdate(siteId, data, axiosOptions);
|
|
1268
1899
|
};
|
|
1269
|
-
return
|
|
1900
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1901
|
+
};
|
|
1902
|
+
/**
|
|
1903
|
+
* @summary site update
|
|
1904
|
+
*/
|
|
1905
|
+
export const useSiteUpdate = (options) => {
|
|
1906
|
+
const mutationOptions = getSiteUpdateMutationOptions(options);
|
|
1907
|
+
return useMutation(mutationOptions);
|
|
1270
1908
|
};
|
|
1271
1909
|
/**
|
|
1272
1910
|
* Allows deleting a site
|
|
@@ -1275,13 +1913,20 @@ export const useSiteUpdate = (options) => {
|
|
|
1275
1913
|
export const site = (siteId, options) => {
|
|
1276
1914
|
return axios.delete(`/v1/sites/${siteId}`, options);
|
|
1277
1915
|
};
|
|
1278
|
-
export const
|
|
1916
|
+
export const getSiteMutationOptions = (options) => {
|
|
1279
1917
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1280
1918
|
const mutationFn = (props) => {
|
|
1281
1919
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1282
1920
|
return site(siteId, axiosOptions);
|
|
1283
1921
|
};
|
|
1284
|
-
return
|
|
1922
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1923
|
+
};
|
|
1924
|
+
/**
|
|
1925
|
+
* @summary site delete
|
|
1926
|
+
*/
|
|
1927
|
+
export const useSite = (options) => {
|
|
1928
|
+
const mutationOptions = getSiteMutationOptions(options);
|
|
1929
|
+
return useMutation(mutationOptions);
|
|
1285
1930
|
};
|
|
1286
1931
|
/**
|
|
1287
1932
|
* Returns the autoupdate status of the site's core, themes, and plugins
|
|
@@ -1290,14 +1935,23 @@ export const useSite = (options) => {
|
|
|
1290
1935
|
export const sitesAutoupdatesInfo = (siteId, options) => {
|
|
1291
1936
|
return axios.get(`/v1/sites/${siteId}/autoupdates`, options);
|
|
1292
1937
|
};
|
|
1293
|
-
export const getSitesAutoupdatesInfoQueryKey = (siteId) =>
|
|
1294
|
-
|
|
1938
|
+
export const getSitesAutoupdatesInfoQueryKey = (siteId) => {
|
|
1939
|
+
return [`/v1/sites/${siteId}/autoupdates`];
|
|
1940
|
+
};
|
|
1941
|
+
export const getSitesAutoupdatesInfoQueryOptions = (siteId, options) => {
|
|
1295
1942
|
var _a;
|
|
1296
1943
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1297
1944
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAutoupdatesInfoQueryKey(siteId);
|
|
1298
1945
|
const queryFn = ({ signal }) => sitesAutoupdatesInfo(siteId, Object.assign({ signal }, axiosOptions));
|
|
1299
|
-
|
|
1300
|
-
|
|
1946
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
1947
|
+
};
|
|
1948
|
+
/**
|
|
1949
|
+
* @summary settings autoupdates
|
|
1950
|
+
*/
|
|
1951
|
+
export const useSitesAutoupdatesInfo = (siteId, options) => {
|
|
1952
|
+
const queryOptions = getSitesAutoupdatesInfoQueryOptions(siteId, options);
|
|
1953
|
+
const query = useQuery(queryOptions);
|
|
1954
|
+
query.queryKey = queryOptions.queryKey;
|
|
1301
1955
|
return query;
|
|
1302
1956
|
};
|
|
1303
1957
|
/**
|
|
@@ -1307,13 +1961,20 @@ export const useSitesAutoupdatesInfo = (siteId, options) => {
|
|
|
1307
1961
|
export const sitesAutoupdatesUpdate = (siteId, sitesAutoupdatesUpdateBody, options) => {
|
|
1308
1962
|
return axios.put(`/v1/sites/${siteId}/autoupdates`, sitesAutoupdatesUpdateBody, options);
|
|
1309
1963
|
};
|
|
1310
|
-
export const
|
|
1964
|
+
export const getSitesAutoupdatesUpdateMutationOptions = (options) => {
|
|
1311
1965
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1312
1966
|
const mutationFn = (props) => {
|
|
1313
1967
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1314
1968
|
return sitesAutoupdatesUpdate(siteId, data, axiosOptions);
|
|
1315
1969
|
};
|
|
1316
|
-
return
|
|
1970
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
1971
|
+
};
|
|
1972
|
+
/**
|
|
1973
|
+
* @summary settings autoupdates toggle
|
|
1974
|
+
*/
|
|
1975
|
+
export const useSitesAutoupdatesUpdate = (options) => {
|
|
1976
|
+
const mutationOptions = getSitesAutoupdatesUpdateMutationOptions(options);
|
|
1977
|
+
return useMutation(mutationOptions);
|
|
1317
1978
|
};
|
|
1318
1979
|
/**
|
|
1319
1980
|
* Returns whether the site has either Codeguard or Jetpack-backup.
|
|
@@ -1323,14 +1984,24 @@ export const useSitesAutoupdatesUpdate = (options) => {
|
|
|
1323
1984
|
export const sitesBackups = (siteId, options) => {
|
|
1324
1985
|
return axios.get(`/v1/sites/${siteId}/backups`, options);
|
|
1325
1986
|
};
|
|
1326
|
-
export const getSitesBackupsQueryKey = (siteId) =>
|
|
1327
|
-
|
|
1987
|
+
export const getSitesBackupsQueryKey = (siteId) => {
|
|
1988
|
+
return [`/v1/sites/${siteId}/backups`];
|
|
1989
|
+
};
|
|
1990
|
+
export const getSitesBackupsQueryOptions = (siteId, options) => {
|
|
1328
1991
|
var _a;
|
|
1329
1992
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1330
1993
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsQueryKey(siteId);
|
|
1331
1994
|
const queryFn = ({ signal }) => sitesBackups(siteId, Object.assign({ signal }, axiosOptions));
|
|
1332
|
-
|
|
1333
|
-
|
|
1995
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
1996
|
+
};
|
|
1997
|
+
/**
|
|
1998
|
+
* @deprecated
|
|
1999
|
+
* @summary Deprecated - has backup
|
|
2000
|
+
*/
|
|
2001
|
+
export const useSitesBackups = (siteId, options) => {
|
|
2002
|
+
const queryOptions = getSitesBackupsQueryOptions(siteId, options);
|
|
2003
|
+
const query = useQuery(queryOptions);
|
|
2004
|
+
query.queryKey = queryOptions.queryKey;
|
|
1334
2005
|
return query;
|
|
1335
2006
|
};
|
|
1336
2007
|
/**
|
|
@@ -1340,14 +2011,23 @@ export const useSitesBackups = (siteId, options) => {
|
|
|
1340
2011
|
export const sitesHasBackups = (siteId, options) => {
|
|
1341
2012
|
return axios.get(`/v1/sites/${siteId}/backups/check`, options);
|
|
1342
2013
|
};
|
|
1343
|
-
export const getSitesHasBackupsQueryKey = (siteId) =>
|
|
1344
|
-
|
|
2014
|
+
export const getSitesHasBackupsQueryKey = (siteId) => {
|
|
2015
|
+
return [`/v1/sites/${siteId}/backups/check`];
|
|
2016
|
+
};
|
|
2017
|
+
export const getSitesHasBackupsQueryOptions = (siteId, options) => {
|
|
1345
2018
|
var _a;
|
|
1346
2019
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1347
2020
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesHasBackupsQueryKey(siteId);
|
|
1348
2021
|
const queryFn = ({ signal }) => sitesHasBackups(siteId, Object.assign({ signal }, axiosOptions));
|
|
1349
|
-
|
|
1350
|
-
|
|
2022
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2023
|
+
};
|
|
2024
|
+
/**
|
|
2025
|
+
* @summary has backups
|
|
2026
|
+
*/
|
|
2027
|
+
export const useSitesHasBackups = (siteId, options) => {
|
|
2028
|
+
const queryOptions = getSitesHasBackupsQueryOptions(siteId, options);
|
|
2029
|
+
const query = useQuery(queryOptions);
|
|
2030
|
+
query.queryKey = queryOptions.queryKey;
|
|
1351
2031
|
return query;
|
|
1352
2032
|
};
|
|
1353
2033
|
/**
|
|
@@ -1357,13 +2037,20 @@ export const useSitesHasBackups = (siteId, options) => {
|
|
|
1357
2037
|
export const sitesBackupsCodeguard = (siteId, options) => {
|
|
1358
2038
|
return axios.post(`/v1/sites/${siteId}/backups/codeguard`, undefined, options);
|
|
1359
2039
|
};
|
|
1360
|
-
export const
|
|
2040
|
+
export const getSitesBackupsCodeguardMutationOptions = (options) => {
|
|
1361
2041
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1362
2042
|
const mutationFn = (props) => {
|
|
1363
2043
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1364
2044
|
return sitesBackupsCodeguard(siteId, axiosOptions);
|
|
1365
2045
|
};
|
|
1366
|
-
return
|
|
2046
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2047
|
+
};
|
|
2048
|
+
/**
|
|
2049
|
+
* @summary Add additional sites to codeguard
|
|
2050
|
+
*/
|
|
2051
|
+
export const useSitesBackupsCodeguard = (options) => {
|
|
2052
|
+
const mutationOptions = getSitesBackupsCodeguardMutationOptions(options);
|
|
2053
|
+
return useMutation(mutationOptions);
|
|
1367
2054
|
};
|
|
1368
2055
|
/**
|
|
1369
2056
|
* 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.
|
|
@@ -1372,14 +2059,23 @@ export const useSitesBackupsCodeguard = (options) => {
|
|
|
1372
2059
|
export const sitesBackupsDetails = (siteId, options) => {
|
|
1373
2060
|
return axios.get(`/v1/sites/${siteId}/backups/details`, options);
|
|
1374
2061
|
};
|
|
1375
|
-
export const getSitesBackupsDetailsQueryKey = (siteId) =>
|
|
1376
|
-
|
|
2062
|
+
export const getSitesBackupsDetailsQueryKey = (siteId) => {
|
|
2063
|
+
return [`/v1/sites/${siteId}/backups/details`];
|
|
2064
|
+
};
|
|
2065
|
+
export const getSitesBackupsDetailsQueryOptions = (siteId, options) => {
|
|
1377
2066
|
var _a;
|
|
1378
2067
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1379
2068
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesBackupsDetailsQueryKey(siteId);
|
|
1380
2069
|
const queryFn = ({ signal }) => sitesBackupsDetails(siteId, Object.assign({ signal }, axiosOptions));
|
|
1381
|
-
|
|
1382
|
-
|
|
2070
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2071
|
+
};
|
|
2072
|
+
/**
|
|
2073
|
+
* @summary site backup details
|
|
2074
|
+
*/
|
|
2075
|
+
export const useSitesBackupsDetails = (siteId, options) => {
|
|
2076
|
+
const queryOptions = getSitesBackupsDetailsQueryOptions(siteId, options);
|
|
2077
|
+
const query = useQuery(queryOptions);
|
|
2078
|
+
query.queryKey = queryOptions.queryKey;
|
|
1383
2079
|
return query;
|
|
1384
2080
|
};
|
|
1385
2081
|
/**
|
|
@@ -1389,14 +2085,23 @@ export const useSitesBackupsDetails = (siteId, options) => {
|
|
|
1389
2085
|
export const jetpackBackupStatus = (siteId, options) => {
|
|
1390
2086
|
return axios.get(`/v1/sites/${siteId}/backups/jetpack`, options);
|
|
1391
2087
|
};
|
|
1392
|
-
export const getJetpackBackupStatusQueryKey = (siteId) =>
|
|
1393
|
-
|
|
2088
|
+
export const getJetpackBackupStatusQueryKey = (siteId) => {
|
|
2089
|
+
return [`/v1/sites/${siteId}/backups/jetpack`];
|
|
2090
|
+
};
|
|
2091
|
+
export const getJetpackBackupStatusQueryOptions = (siteId, options) => {
|
|
1394
2092
|
var _a;
|
|
1395
2093
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1396
2094
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getJetpackBackupStatusQueryKey(siteId);
|
|
1397
2095
|
const queryFn = ({ signal }) => jetpackBackupStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
1398
|
-
|
|
1399
|
-
|
|
2096
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2097
|
+
};
|
|
2098
|
+
/**
|
|
2099
|
+
* @summary Returns the status of the jetpack-backup product
|
|
2100
|
+
*/
|
|
2101
|
+
export const useJetpackBackupStatus = (siteId, options) => {
|
|
2102
|
+
const queryOptions = getJetpackBackupStatusQueryOptions(siteId, options);
|
|
2103
|
+
const query = useQuery(queryOptions);
|
|
2104
|
+
query.queryKey = queryOptions.queryKey;
|
|
1400
2105
|
return query;
|
|
1401
2106
|
};
|
|
1402
2107
|
/**
|
|
@@ -1406,13 +2111,20 @@ export const useJetpackBackupStatus = (siteId, options) => {
|
|
|
1406
2111
|
export const backupsJetpackBackup = (siteId, options) => {
|
|
1407
2112
|
return axios.put(`/v1/sites/${siteId}/backups/jetpack`, undefined, options);
|
|
1408
2113
|
};
|
|
1409
|
-
export const
|
|
2114
|
+
export const getBackupsJetpackBackupMutationOptions = (options) => {
|
|
1410
2115
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1411
2116
|
const mutationFn = (props) => {
|
|
1412
2117
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1413
2118
|
return backupsJetpackBackup(siteId, axiosOptions);
|
|
1414
2119
|
};
|
|
1415
|
-
return
|
|
2120
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2121
|
+
};
|
|
2122
|
+
/**
|
|
2123
|
+
* @summary Toggles the pending_upgrade meta of the provided jetpackbackup HAL addon
|
|
2124
|
+
*/
|
|
2125
|
+
export const useBackupsJetpackBackup = (options) => {
|
|
2126
|
+
const mutationOptions = getBackupsJetpackBackupMutationOptions(options);
|
|
2127
|
+
return useMutation(mutationOptions);
|
|
1416
2128
|
};
|
|
1417
2129
|
/**
|
|
1418
2130
|
* Creates cloudflare basic addon using site_id
|
|
@@ -1421,13 +2133,20 @@ export const useBackupsJetpackBackup = (options) => {
|
|
|
1421
2133
|
export const siteAddonCloudflare = (siteId, options) => {
|
|
1422
2134
|
return axios.post(`/v1/sites/${siteId}/cloudflare`, undefined, options);
|
|
1423
2135
|
};
|
|
1424
|
-
export const
|
|
2136
|
+
export const getSiteAddonCloudflareMutationOptions = (options) => {
|
|
1425
2137
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1426
2138
|
const mutationFn = (props) => {
|
|
1427
2139
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1428
2140
|
return siteAddonCloudflare(siteId, axiosOptions);
|
|
1429
2141
|
};
|
|
1430
|
-
return
|
|
2142
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2143
|
+
};
|
|
2144
|
+
/**
|
|
2145
|
+
* @summary Install cloudflare basic addon using site_id
|
|
2146
|
+
*/
|
|
2147
|
+
export const useSiteAddonCloudflare = (options) => {
|
|
2148
|
+
const mutationOptions = getSiteAddonCloudflareMutationOptions(options);
|
|
2149
|
+
return useMutation(mutationOptions);
|
|
1431
2150
|
};
|
|
1432
2151
|
/**
|
|
1433
2152
|
* Get info about site database
|
|
@@ -1436,15 +2155,24 @@ export const useSiteAddonCloudflare = (options) => {
|
|
|
1436
2155
|
export const sitesDatabaseInfo = (siteId, options) => {
|
|
1437
2156
|
return axios.get(`/v1/sites/${siteId}/database`, options);
|
|
1438
2157
|
};
|
|
1439
|
-
export const getSitesDatabaseInfoQueryKey = (siteId) =>
|
|
1440
|
-
|
|
2158
|
+
export const getSitesDatabaseInfoQueryKey = (siteId) => {
|
|
2159
|
+
return [`/v1/sites/${siteId}/database`];
|
|
2160
|
+
};
|
|
2161
|
+
export const getSitesDatabaseInfoQueryOptions = (siteId, options) => {
|
|
1441
2162
|
var _a;
|
|
1442
2163
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1443
2164
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDatabaseInfoQueryKey(siteId);
|
|
1444
2165
|
const queryFn = ({ signal }) => sitesDatabaseInfo(siteId, Object.assign({ signal }, axiosOptions));
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
2166
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2167
|
+
};
|
|
2168
|
+
/**
|
|
2169
|
+
* @summary site - database info
|
|
2170
|
+
*/
|
|
2171
|
+
export const useSitesDatabaseInfo = (siteId, options) => {
|
|
2172
|
+
const queryOptions = getSitesDatabaseInfoQueryOptions(siteId, options);
|
|
2173
|
+
const query = useQuery(queryOptions);
|
|
2174
|
+
query.queryKey = queryOptions.queryKey;
|
|
2175
|
+
return query;
|
|
1448
2176
|
};
|
|
1449
2177
|
/**
|
|
1450
2178
|
* Resync database password with whats in wp-config
|
|
@@ -1453,13 +2181,20 @@ export const useSitesDatabaseInfo = (siteId, options) => {
|
|
|
1453
2181
|
export const sitesDatabasePasswordsync = (siteId, options) => {
|
|
1454
2182
|
return axios.post(`/v1/sites/${siteId}/database/password-sync`, undefined, options);
|
|
1455
2183
|
};
|
|
1456
|
-
export const
|
|
2184
|
+
export const getSitesDatabasePasswordsyncMutationOptions = (options) => {
|
|
1457
2185
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1458
2186
|
const mutationFn = (props) => {
|
|
1459
2187
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1460
2188
|
return sitesDatabasePasswordsync(siteId, axiosOptions);
|
|
1461
2189
|
};
|
|
1462
|
-
return
|
|
2190
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2191
|
+
};
|
|
2192
|
+
/**
|
|
2193
|
+
* @summary site - database - password sync
|
|
2194
|
+
*/
|
|
2195
|
+
export const useSitesDatabasePasswordsync = (options) => {
|
|
2196
|
+
const mutationOptions = getSitesDatabasePasswordsyncMutationOptions(options);
|
|
2197
|
+
return useMutation(mutationOptions);
|
|
1463
2198
|
};
|
|
1464
2199
|
/**
|
|
1465
2200
|
* Returns a list of DNS records for the site's domain.
|
|
@@ -1468,14 +2203,23 @@ export const useSitesDatabasePasswordsync = (options) => {
|
|
|
1468
2203
|
export const sitesDns = (siteId, params, options) => {
|
|
1469
2204
|
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) }));
|
|
1470
2205
|
};
|
|
1471
|
-
export const getSitesDnsQueryKey = (siteId, params) =>
|
|
1472
|
-
|
|
2206
|
+
export const getSitesDnsQueryKey = (siteId, params) => {
|
|
2207
|
+
return [`/v1/sites/${siteId}/dns`, ...(params ? [params] : [])];
|
|
2208
|
+
};
|
|
2209
|
+
export const getSitesDnsQueryOptions = (siteId, params, options) => {
|
|
1473
2210
|
var _a;
|
|
1474
2211
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1475
2212
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDnsQueryKey(siteId, params);
|
|
1476
2213
|
const queryFn = ({ signal }) => sitesDns(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
1477
|
-
|
|
1478
|
-
|
|
2214
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2215
|
+
};
|
|
2216
|
+
/**
|
|
2217
|
+
* @summary dns
|
|
2218
|
+
*/
|
|
2219
|
+
export const useSitesDns = (siteId, params, options) => {
|
|
2220
|
+
const queryOptions = getSitesDnsQueryOptions(siteId, params, options);
|
|
2221
|
+
const query = useQuery(queryOptions);
|
|
2222
|
+
query.queryKey = queryOptions.queryKey;
|
|
1479
2223
|
return query;
|
|
1480
2224
|
};
|
|
1481
2225
|
/**
|
|
@@ -1485,14 +2229,23 @@ export const useSitesDns = (siteId, params, options) => {
|
|
|
1485
2229
|
export const sitesDomain = (siteId, params, options) => {
|
|
1486
2230
|
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) }));
|
|
1487
2231
|
};
|
|
1488
|
-
export const getSitesDomainQueryKey = (siteId, params) =>
|
|
1489
|
-
|
|
2232
|
+
export const getSitesDomainQueryKey = (siteId, params) => {
|
|
2233
|
+
return [`/v1/sites/${siteId}/domain`, ...(params ? [params] : [])];
|
|
2234
|
+
};
|
|
2235
|
+
export const getSitesDomainQueryOptions = (siteId, params, options) => {
|
|
1490
2236
|
var _a;
|
|
1491
2237
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1492
2238
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainQueryKey(siteId, params);
|
|
1493
2239
|
const queryFn = ({ signal }) => sitesDomain(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
1494
|
-
|
|
1495
|
-
|
|
2240
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2241
|
+
};
|
|
2242
|
+
/**
|
|
2243
|
+
* @summary Domain DNS setup for site
|
|
2244
|
+
*/
|
|
2245
|
+
export const useSitesDomain = (siteId, params, options) => {
|
|
2246
|
+
const queryOptions = getSitesDomainQueryOptions(siteId, params, options);
|
|
2247
|
+
const query = useQuery(queryOptions);
|
|
2248
|
+
query.queryKey = queryOptions.queryKey;
|
|
1496
2249
|
return query;
|
|
1497
2250
|
};
|
|
1498
2251
|
/**
|
|
@@ -1502,13 +2255,20 @@ export const useSitesDomain = (siteId, params, options) => {
|
|
|
1502
2255
|
export const sitesDomainUrl = (siteId, sitesDomainUrlBody, options) => {
|
|
1503
2256
|
return axios.post(`/v1/sites/${siteId}/domain`, sitesDomainUrlBody, options);
|
|
1504
2257
|
};
|
|
1505
|
-
export const
|
|
2258
|
+
export const getSitesDomainUrlMutationOptions = (options) => {
|
|
1506
2259
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1507
2260
|
const mutationFn = (props) => {
|
|
1508
2261
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1509
2262
|
return sitesDomainUrl(siteId, data, axiosOptions);
|
|
1510
2263
|
};
|
|
1511
|
-
return
|
|
2264
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2265
|
+
};
|
|
2266
|
+
/**
|
|
2267
|
+
* @summary Add pending site url
|
|
2268
|
+
*/
|
|
2269
|
+
export const useSitesDomainUrl = (options) => {
|
|
2270
|
+
const mutationOptions = getSitesDomainUrlMutationOptions(options);
|
|
2271
|
+
return useMutation(mutationOptions);
|
|
1512
2272
|
};
|
|
1513
2273
|
/**
|
|
1514
2274
|
* Add the domain
|
|
@@ -1517,13 +2277,20 @@ export const useSitesDomainUrl = (options) => {
|
|
|
1517
2277
|
export const sitesDomainsCreate = (siteId, sitesDomainsCreateBody, options) => {
|
|
1518
2278
|
return axios.post(`/v1/sites/${siteId}/domains`, sitesDomainsCreateBody, options);
|
|
1519
2279
|
};
|
|
1520
|
-
export const
|
|
2280
|
+
export const getSitesDomainsCreateMutationOptions = (options) => {
|
|
1521
2281
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1522
2282
|
const mutationFn = (props) => {
|
|
1523
2283
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1524
2284
|
return sitesDomainsCreate(siteId, data, axiosOptions);
|
|
1525
2285
|
};
|
|
1526
|
-
return
|
|
2286
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2287
|
+
};
|
|
2288
|
+
/**
|
|
2289
|
+
* @summary Add domain for the site
|
|
2290
|
+
*/
|
|
2291
|
+
export const useSitesDomainsCreate = (options) => {
|
|
2292
|
+
const mutationOptions = getSitesDomainsCreateMutationOptions(options);
|
|
2293
|
+
return useMutation(mutationOptions);
|
|
1527
2294
|
};
|
|
1528
2295
|
/**
|
|
1529
2296
|
* Returns site access logs.
|
|
@@ -1532,23 +2299,39 @@ export const useSitesDomainsCreate = (options) => {
|
|
|
1532
2299
|
export const sitesAccessLogs = (siteId, params, options) => {
|
|
1533
2300
|
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) }));
|
|
1534
2301
|
};
|
|
1535
|
-
export const getSitesAccessLogsQueryKey = (siteId, params) =>
|
|
1536
|
-
|
|
2302
|
+
export const getSitesAccessLogsQueryKey = (siteId, params) => {
|
|
2303
|
+
return [`/v1/sites/${siteId}/logs/access`, ...(params ? [params] : [])];
|
|
2304
|
+
};
|
|
2305
|
+
export const getSitesAccessLogsInfiniteQueryOptions = (siteId, params, options) => {
|
|
1537
2306
|
var _a;
|
|
1538
2307
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1539
2308
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
|
|
1540
|
-
const queryFn = ({
|
|
1541
|
-
|
|
1542
|
-
|
|
2309
|
+
const queryFn = ({ signal }) => sitesAccessLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2310
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2311
|
+
};
|
|
2312
|
+
/**
|
|
2313
|
+
* @summary Site access logs
|
|
2314
|
+
*/
|
|
2315
|
+
export const useSitesAccessLogsInfinite = (siteId, params, options) => {
|
|
2316
|
+
const queryOptions = getSitesAccessLogsInfiniteQueryOptions(siteId, params, options);
|
|
2317
|
+
const query = useInfiniteQuery(queryOptions);
|
|
2318
|
+
query.queryKey = queryOptions.queryKey;
|
|
1543
2319
|
return query;
|
|
1544
2320
|
};
|
|
1545
|
-
export const
|
|
2321
|
+
export const getSitesAccessLogsQueryOptions = (siteId, params, options) => {
|
|
1546
2322
|
var _a;
|
|
1547
2323
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1548
2324
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
|
|
1549
|
-
const queryFn = () => sitesAccessLogs(siteId, params, axiosOptions);
|
|
1550
|
-
|
|
1551
|
-
|
|
2325
|
+
const queryFn = ({ signal }) => sitesAccessLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2326
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2327
|
+
};
|
|
2328
|
+
/**
|
|
2329
|
+
* @summary Site access logs
|
|
2330
|
+
*/
|
|
2331
|
+
export const useSitesAccessLogs = (siteId, params, options) => {
|
|
2332
|
+
const queryOptions = getSitesAccessLogsQueryOptions(siteId, params, options);
|
|
2333
|
+
const query = useQuery(queryOptions);
|
|
2334
|
+
query.queryKey = queryOptions.queryKey;
|
|
1552
2335
|
return query;
|
|
1553
2336
|
};
|
|
1554
2337
|
/**
|
|
@@ -1558,14 +2341,23 @@ export const useSitesAccessLogs = (siteId, params, options) => {
|
|
|
1558
2341
|
export const sitesAccessLogsDownload = (siteId, params, options) => {
|
|
1559
2342
|
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) }));
|
|
1560
2343
|
};
|
|
1561
|
-
export const getSitesAccessLogsDownloadQueryKey = (siteId, params) =>
|
|
1562
|
-
|
|
2344
|
+
export const getSitesAccessLogsDownloadQueryKey = (siteId, params) => {
|
|
2345
|
+
return [`/v1/sites/${siteId}/logs/access/download`, ...(params ? [params] : [])];
|
|
2346
|
+
};
|
|
2347
|
+
export const getSitesAccessLogsDownloadQueryOptions = (siteId, params, options) => {
|
|
1563
2348
|
var _a;
|
|
1564
2349
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1565
2350
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsDownloadQueryKey(siteId, params);
|
|
1566
2351
|
const queryFn = ({ signal }) => sitesAccessLogsDownload(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
1567
|
-
|
|
1568
|
-
|
|
2352
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2353
|
+
};
|
|
2354
|
+
/**
|
|
2355
|
+
* @summary Site access logs
|
|
2356
|
+
*/
|
|
2357
|
+
export const useSitesAccessLogsDownload = (siteId, params, options) => {
|
|
2358
|
+
const queryOptions = getSitesAccessLogsDownloadQueryOptions(siteId, params, options);
|
|
2359
|
+
const query = useQuery(queryOptions);
|
|
2360
|
+
query.queryKey = queryOptions.queryKey;
|
|
1569
2361
|
return query;
|
|
1570
2362
|
};
|
|
1571
2363
|
/**
|
|
@@ -1575,23 +2367,39 @@ export const useSitesAccessLogsDownload = (siteId, params, options) => {
|
|
|
1575
2367
|
export const sitesErrorLogs = (siteId, params, options) => {
|
|
1576
2368
|
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) }));
|
|
1577
2369
|
};
|
|
1578
|
-
export const getSitesErrorLogsQueryKey = (siteId, params) =>
|
|
1579
|
-
|
|
2370
|
+
export const getSitesErrorLogsQueryKey = (siteId, params) => {
|
|
2371
|
+
return [`/v1/sites/${siteId}/logs/error`, ...(params ? [params] : [])];
|
|
2372
|
+
};
|
|
2373
|
+
export const getSitesErrorLogsInfiniteQueryOptions = (siteId, params, options) => {
|
|
1580
2374
|
var _a;
|
|
1581
2375
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1582
2376
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
|
|
1583
|
-
const queryFn = ({
|
|
1584
|
-
|
|
1585
|
-
|
|
2377
|
+
const queryFn = ({ signal }) => sitesErrorLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2378
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2379
|
+
};
|
|
2380
|
+
/**
|
|
2381
|
+
* @summary Site error logs
|
|
2382
|
+
*/
|
|
2383
|
+
export const useSitesErrorLogsInfinite = (siteId, params, options) => {
|
|
2384
|
+
const queryOptions = getSitesErrorLogsInfiniteQueryOptions(siteId, params, options);
|
|
2385
|
+
const query = useInfiniteQuery(queryOptions);
|
|
2386
|
+
query.queryKey = queryOptions.queryKey;
|
|
1586
2387
|
return query;
|
|
1587
2388
|
};
|
|
1588
|
-
export const
|
|
2389
|
+
export const getSitesErrorLogsQueryOptions = (siteId, params, options) => {
|
|
1589
2390
|
var _a;
|
|
1590
2391
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1591
2392
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
|
|
1592
|
-
const queryFn = () => sitesErrorLogs(siteId, params, axiosOptions);
|
|
1593
|
-
|
|
1594
|
-
|
|
2393
|
+
const queryFn = ({ signal }) => sitesErrorLogs(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2394
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2395
|
+
};
|
|
2396
|
+
/**
|
|
2397
|
+
* @summary Site error logs
|
|
2398
|
+
*/
|
|
2399
|
+
export const useSitesErrorLogs = (siteId, params, options) => {
|
|
2400
|
+
const queryOptions = getSitesErrorLogsQueryOptions(siteId, params, options);
|
|
2401
|
+
const query = useQuery(queryOptions);
|
|
2402
|
+
query.queryKey = queryOptions.queryKey;
|
|
1595
2403
|
return query;
|
|
1596
2404
|
};
|
|
1597
2405
|
/**
|
|
@@ -1601,14 +2409,23 @@ export const useSitesErrorLogs = (siteId, params, options) => {
|
|
|
1601
2409
|
export const sitesErrorLogsDownload = (siteId, params, options) => {
|
|
1602
2410
|
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) }));
|
|
1603
2411
|
};
|
|
1604
|
-
export const getSitesErrorLogsDownloadQueryKey = (siteId, params) =>
|
|
1605
|
-
|
|
2412
|
+
export const getSitesErrorLogsDownloadQueryKey = (siteId, params) => {
|
|
2413
|
+
return [`/v1/sites/${siteId}/logs/error/download`, ...(params ? [params] : [])];
|
|
2414
|
+
};
|
|
2415
|
+
export const getSitesErrorLogsDownloadQueryOptions = (siteId, params, options) => {
|
|
1606
2416
|
var _a;
|
|
1607
2417
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1608
2418
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsDownloadQueryKey(siteId, params);
|
|
1609
2419
|
const queryFn = ({ signal }) => sitesErrorLogsDownload(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
1610
|
-
|
|
1611
|
-
|
|
2420
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2421
|
+
};
|
|
2422
|
+
/**
|
|
2423
|
+
* @summary Site error logs
|
|
2424
|
+
*/
|
|
2425
|
+
export const useSitesErrorLogsDownload = (siteId, params, options) => {
|
|
2426
|
+
const queryOptions = getSitesErrorLogsDownloadQueryOptions(siteId, params, options);
|
|
2427
|
+
const query = useQuery(queryOptions);
|
|
2428
|
+
query.queryKey = queryOptions.queryKey;
|
|
1612
2429
|
return query;
|
|
1613
2430
|
};
|
|
1614
2431
|
/**
|
|
@@ -1618,14 +2435,23 @@ export const useSitesErrorLogsDownload = (siteId, params, options) => {
|
|
|
1618
2435
|
export const siteMalwareStatus = (siteId, options) => {
|
|
1619
2436
|
return axios.get(`/v1/sites/${siteId}/malware-status`, options);
|
|
1620
2437
|
};
|
|
1621
|
-
export const getSiteMalwareStatusQueryKey = (siteId) =>
|
|
1622
|
-
|
|
2438
|
+
export const getSiteMalwareStatusQueryKey = (siteId) => {
|
|
2439
|
+
return [`/v1/sites/${siteId}/malware-status`];
|
|
2440
|
+
};
|
|
2441
|
+
export const getSiteMalwareStatusQueryOptions = (siteId, options) => {
|
|
1623
2442
|
var _a;
|
|
1624
2443
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1625
2444
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteMalwareStatusQueryKey(siteId);
|
|
1626
2445
|
const queryFn = ({ signal }) => siteMalwareStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
1627
|
-
|
|
1628
|
-
|
|
2446
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2447
|
+
};
|
|
2448
|
+
/**
|
|
2449
|
+
* @summary malware status of atomic site
|
|
2450
|
+
*/
|
|
2451
|
+
export const useSiteMalwareStatus = (siteId, options) => {
|
|
2452
|
+
const queryOptions = getSiteMalwareStatusQueryOptions(siteId, options);
|
|
2453
|
+
const query = useQuery(queryOptions);
|
|
2454
|
+
query.queryKey = queryOptions.queryKey;
|
|
1629
2455
|
return query;
|
|
1630
2456
|
};
|
|
1631
2457
|
/**
|
|
@@ -1635,13 +2461,20 @@ export const useSiteMalwareStatus = (siteId, options) => {
|
|
|
1635
2461
|
export const sitePendingDomainDelete = (siteId, options) => {
|
|
1636
2462
|
return axios.delete(`/v1/sites/${siteId}/pending-domain`, options);
|
|
1637
2463
|
};
|
|
1638
|
-
export const
|
|
2464
|
+
export const getSitePendingDomainDeleteMutationOptions = (options) => {
|
|
1639
2465
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1640
2466
|
const mutationFn = (props) => {
|
|
1641
2467
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1642
2468
|
return sitePendingDomainDelete(siteId, axiosOptions);
|
|
1643
2469
|
};
|
|
1644
|
-
return
|
|
2470
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2471
|
+
};
|
|
2472
|
+
/**
|
|
2473
|
+
* @summary Delete pending domain
|
|
2474
|
+
*/
|
|
2475
|
+
export const useSitePendingDomainDelete = (options) => {
|
|
2476
|
+
const mutationOptions = getSitePendingDomainDeleteMutationOptions(options);
|
|
2477
|
+
return useMutation(mutationOptions);
|
|
1645
2478
|
};
|
|
1646
2479
|
/**
|
|
1647
2480
|
* cache purge site and url
|
|
@@ -1650,13 +2483,20 @@ export const useSitePendingDomainDelete = (options) => {
|
|
|
1650
2483
|
export const sitesPerformanceCachepurge = (siteId, sitesPerformanceCachepurgeBody, options) => {
|
|
1651
2484
|
return axios.post(`/v1/sites/${siteId}/performance/cachepurge`, sitesPerformanceCachepurgeBody, options);
|
|
1652
2485
|
};
|
|
1653
|
-
export const
|
|
2486
|
+
export const getSitesPerformanceCachepurgeMutationOptions = (options) => {
|
|
1654
2487
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1655
2488
|
const mutationFn = (props) => {
|
|
1656
2489
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1657
2490
|
return sitesPerformanceCachepurge(siteId, data, axiosOptions);
|
|
1658
2491
|
};
|
|
1659
|
-
return
|
|
2492
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2493
|
+
};
|
|
2494
|
+
/**
|
|
2495
|
+
* @summary cache purge url
|
|
2496
|
+
*/
|
|
2497
|
+
export const useSitesPerformanceCachepurge = (options) => {
|
|
2498
|
+
const mutationOptions = getSitesPerformanceCachepurgeMutationOptions(options);
|
|
2499
|
+
return useMutation(mutationOptions);
|
|
1660
2500
|
};
|
|
1661
2501
|
/**
|
|
1662
2502
|
* Update the edge cache
|
|
@@ -1665,13 +2505,20 @@ export const useSitesPerformanceCachepurge = (options) => {
|
|
|
1665
2505
|
export const sitesPerformanceEdgecache = (siteId, sitesPerformanceEdgecacheBody, options) => {
|
|
1666
2506
|
return axios.put(`/v1/sites/${siteId}/performance/edge_cache`, sitesPerformanceEdgecacheBody, options);
|
|
1667
2507
|
};
|
|
1668
|
-
export const
|
|
2508
|
+
export const getSitesPerformanceEdgecacheMutationOptions = (options) => {
|
|
1669
2509
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1670
2510
|
const mutationFn = (props) => {
|
|
1671
2511
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1672
2512
|
return sitesPerformanceEdgecache(siteId, data, axiosOptions);
|
|
1673
2513
|
};
|
|
1674
|
-
return
|
|
2514
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2515
|
+
};
|
|
2516
|
+
/**
|
|
2517
|
+
* @summary edge cache toggle for atomic site
|
|
2518
|
+
*/
|
|
2519
|
+
export const useSitesPerformanceEdgecache = (options) => {
|
|
2520
|
+
const mutationOptions = getSitesPerformanceEdgecacheMutationOptions(options);
|
|
2521
|
+
return useMutation(mutationOptions);
|
|
1675
2522
|
};
|
|
1676
2523
|
/**
|
|
1677
2524
|
* Returns the status of endurance_cache_level
|
|
@@ -1680,14 +2527,23 @@ export const useSitesPerformanceEdgecache = (options) => {
|
|
|
1680
2527
|
export const sitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
|
|
1681
2528
|
return axios.get(`/v1/sites/${siteId}/performance/endurance_cache_level`, options);
|
|
1682
2529
|
};
|
|
1683
|
-
export const getSitesPerformanceEnduranceCacheLevelStatusQueryKey = (siteId) =>
|
|
1684
|
-
|
|
2530
|
+
export const getSitesPerformanceEnduranceCacheLevelStatusQueryKey = (siteId) => {
|
|
2531
|
+
return [`/v1/sites/${siteId}/performance/endurance_cache_level`];
|
|
2532
|
+
};
|
|
2533
|
+
export const getSitesPerformanceEnduranceCacheLevelStatusQueryOptions = (siteId, options) => {
|
|
1685
2534
|
var _a;
|
|
1686
2535
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1687
2536
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesPerformanceEnduranceCacheLevelStatusQueryKey(siteId);
|
|
1688
2537
|
const queryFn = ({ signal }) => sitesPerformanceEnduranceCacheLevelStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
1689
|
-
|
|
1690
|
-
|
|
2538
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2539
|
+
};
|
|
2540
|
+
/**
|
|
2541
|
+
* @summary Get status of endurance cache level
|
|
2542
|
+
*/
|
|
2543
|
+
export const useSitesPerformanceEnduranceCacheLevelStatus = (siteId, options) => {
|
|
2544
|
+
const queryOptions = getSitesPerformanceEnduranceCacheLevelStatusQueryOptions(siteId, options);
|
|
2545
|
+
const query = useQuery(queryOptions);
|
|
2546
|
+
query.queryKey = queryOptions.queryKey;
|
|
1691
2547
|
return query;
|
|
1692
2548
|
};
|
|
1693
2549
|
/**
|
|
@@ -1697,13 +2553,20 @@ export const useSitesPerformanceEnduranceCacheLevelStatus = (siteId, options) =>
|
|
|
1697
2553
|
export const sitesPerformanceEnduranceCacheLevel = (siteId, sitesPerformanceEnduranceCacheLevelBody, options) => {
|
|
1698
2554
|
return axios.post(`/v1/sites/${siteId}/performance/endurance_cache_level`, sitesPerformanceEnduranceCacheLevelBody, options);
|
|
1699
2555
|
};
|
|
1700
|
-
export const
|
|
2556
|
+
export const getSitesPerformanceEnduranceCacheLevelMutationOptions = (options) => {
|
|
1701
2557
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1702
2558
|
const mutationFn = (props) => {
|
|
1703
2559
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1704
2560
|
return sitesPerformanceEnduranceCacheLevel(siteId, data, axiosOptions);
|
|
1705
2561
|
};
|
|
1706
|
-
return
|
|
2562
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2563
|
+
};
|
|
2564
|
+
/**
|
|
2565
|
+
* @summary Set endurance cache level
|
|
2566
|
+
*/
|
|
2567
|
+
export const useSitesPerformanceEnduranceCacheLevel = (options) => {
|
|
2568
|
+
const mutationOptions = getSitesPerformanceEnduranceCacheLevelMutationOptions(options);
|
|
2569
|
+
return useMutation(mutationOptions);
|
|
1707
2570
|
};
|
|
1708
2571
|
/**
|
|
1709
2572
|
* Update the endurance page cache
|
|
@@ -1712,13 +2575,20 @@ export const useSitesPerformanceEnduranceCacheLevel = (options) => {
|
|
|
1712
2575
|
export const sitesPerformanceEndurancePageCache = (siteId, options) => {
|
|
1713
2576
|
return axios.put(`/v1/sites/${siteId}/performance/endurance_page_cache`, undefined, options);
|
|
1714
2577
|
};
|
|
1715
|
-
export const
|
|
2578
|
+
export const getSitesPerformanceEndurancePageCacheMutationOptions = (options) => {
|
|
1716
2579
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1717
2580
|
const mutationFn = (props) => {
|
|
1718
2581
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1719
2582
|
return sitesPerformanceEndurancePageCache(siteId, axiosOptions);
|
|
1720
2583
|
};
|
|
1721
|
-
return
|
|
2584
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2585
|
+
};
|
|
2586
|
+
/**
|
|
2587
|
+
* @summary update the endurance cache page
|
|
2588
|
+
*/
|
|
2589
|
+
export const useSitesPerformanceEndurancePageCache = (options) => {
|
|
2590
|
+
const mutationOptions = getSitesPerformanceEndurancePageCacheMutationOptions(options);
|
|
2591
|
+
return useMutation(mutationOptions);
|
|
1722
2592
|
};
|
|
1723
2593
|
/**
|
|
1724
2594
|
* Returns a list of the site's plugins
|
|
@@ -1727,14 +2597,23 @@ export const useSitesPerformanceEndurancePageCache = (options) => {
|
|
|
1727
2597
|
export const sitePlugins = (siteId, params, options) => {
|
|
1728
2598
|
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) }));
|
|
1729
2599
|
};
|
|
1730
|
-
export const getSitePluginsQueryKey = (siteId, params) =>
|
|
1731
|
-
|
|
2600
|
+
export const getSitePluginsQueryKey = (siteId, params) => {
|
|
2601
|
+
return [`/v1/sites/${siteId}/plugins`, ...(params ? [params] : [])];
|
|
2602
|
+
};
|
|
2603
|
+
export const getSitePluginsQueryOptions = (siteId, params, options) => {
|
|
1732
2604
|
var _a;
|
|
1733
2605
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1734
2606
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitePluginsQueryKey(siteId, params);
|
|
1735
2607
|
const queryFn = ({ signal }) => sitePlugins(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
1736
|
-
|
|
1737
|
-
|
|
2608
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2609
|
+
};
|
|
2610
|
+
/**
|
|
2611
|
+
* @summary plugins
|
|
2612
|
+
*/
|
|
2613
|
+
export const useSitePlugins = (siteId, params, options) => {
|
|
2614
|
+
const queryOptions = getSitePluginsQueryOptions(siteId, params, options);
|
|
2615
|
+
const query = useQuery(queryOptions);
|
|
2616
|
+
query.queryKey = queryOptions.queryKey;
|
|
1738
2617
|
return query;
|
|
1739
2618
|
};
|
|
1740
2619
|
/**
|
|
@@ -1744,13 +2623,20 @@ export const useSitePlugins = (siteId, params, options) => {
|
|
|
1744
2623
|
export const sitePluginUpdate = (siteId, sitePluginUpdateBody, options) => {
|
|
1745
2624
|
return axios.put(`/v1/sites/${siteId}/plugins`, sitePluginUpdateBody, options);
|
|
1746
2625
|
};
|
|
1747
|
-
export const
|
|
2626
|
+
export const getSitePluginUpdateMutationOptions = (options) => {
|
|
1748
2627
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1749
2628
|
const mutationFn = (props) => {
|
|
1750
2629
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1751
2630
|
return sitePluginUpdate(siteId, data, axiosOptions);
|
|
1752
2631
|
};
|
|
1753
|
-
return
|
|
2632
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2633
|
+
};
|
|
2634
|
+
/**
|
|
2635
|
+
* @summary plugins toggle
|
|
2636
|
+
*/
|
|
2637
|
+
export const useSitePluginUpdate = (options) => {
|
|
2638
|
+
const mutationOptions = getSitePluginUpdateMutationOptions(options);
|
|
2639
|
+
return useMutation(mutationOptions);
|
|
1754
2640
|
};
|
|
1755
2641
|
/**
|
|
1756
2642
|
* Enables / disables plugin auto-updates
|
|
@@ -1760,13 +2646,21 @@ export const useSitePluginUpdate = (options) => {
|
|
|
1760
2646
|
export const sitePluginsAutoupdate = (siteId, sitePluginsAutoupdateBody, options) => {
|
|
1761
2647
|
return axios.post(`/v1/sites/${siteId}/plugins/autoupdate`, sitePluginsAutoupdateBody, options);
|
|
1762
2648
|
};
|
|
1763
|
-
export const
|
|
2649
|
+
export const getSitePluginsAutoupdateMutationOptions = (options) => {
|
|
1764
2650
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1765
2651
|
const mutationFn = (props) => {
|
|
1766
2652
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1767
2653
|
return sitePluginsAutoupdate(siteId, data, axiosOptions);
|
|
1768
2654
|
};
|
|
1769
|
-
return
|
|
2655
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2656
|
+
};
|
|
2657
|
+
/**
|
|
2658
|
+
* @deprecated
|
|
2659
|
+
* @summary plugins autoupdate
|
|
2660
|
+
*/
|
|
2661
|
+
export const useSitePluginsAutoupdate = (options) => {
|
|
2662
|
+
const mutationOptions = getSitePluginsAutoupdateMutationOptions(options);
|
|
2663
|
+
return useMutation(mutationOptions);
|
|
1770
2664
|
};
|
|
1771
2665
|
/**
|
|
1772
2666
|
* Enables / disables a plugin
|
|
@@ -1776,13 +2670,21 @@ export const useSitePluginsAutoupdate = (options) => {
|
|
|
1776
2670
|
export const sitePluginsToggle = (siteId, sitePluginsToggleBody, options) => {
|
|
1777
2671
|
return axios.post(`/v1/sites/${siteId}/plugins/toggle`, sitePluginsToggleBody, options);
|
|
1778
2672
|
};
|
|
1779
|
-
export const
|
|
2673
|
+
export const getSitePluginsToggleMutationOptions = (options) => {
|
|
1780
2674
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1781
2675
|
const mutationFn = (props) => {
|
|
1782
2676
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1783
2677
|
return sitePluginsToggle(siteId, data, axiosOptions);
|
|
1784
2678
|
};
|
|
1785
|
-
return
|
|
2679
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2680
|
+
};
|
|
2681
|
+
/**
|
|
2682
|
+
* @deprecated
|
|
2683
|
+
* @summary Deprecated - plugins toggle
|
|
2684
|
+
*/
|
|
2685
|
+
export const useSitePluginsToggle = (options) => {
|
|
2686
|
+
const mutationOptions = getSitePluginsToggleMutationOptions(options);
|
|
2687
|
+
return useMutation(mutationOptions);
|
|
1786
2688
|
};
|
|
1787
2689
|
/**
|
|
1788
2690
|
* Updates a plugin
|
|
@@ -1791,13 +2693,20 @@ export const useSitePluginsToggle = (options) => {
|
|
|
1791
2693
|
export const sitePluginsUpdate = (siteId, sitePluginsUpdateBody, options) => {
|
|
1792
2694
|
return axios.post(`/v1/sites/${siteId}/plugins/update`, sitePluginsUpdateBody, options);
|
|
1793
2695
|
};
|
|
1794
|
-
export const
|
|
2696
|
+
export const getSitePluginsUpdateMutationOptions = (options) => {
|
|
1795
2697
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1796
2698
|
const mutationFn = (props) => {
|
|
1797
2699
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1798
2700
|
return sitePluginsUpdate(siteId, data, axiosOptions);
|
|
1799
2701
|
};
|
|
1800
|
-
return
|
|
2702
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2703
|
+
};
|
|
2704
|
+
/**
|
|
2705
|
+
* @summary plugins update
|
|
2706
|
+
*/
|
|
2707
|
+
export const useSitePluginsUpdate = (options) => {
|
|
2708
|
+
const mutationOptions = getSitePluginsUpdateMutationOptions(options);
|
|
2709
|
+
return useMutation(mutationOptions);
|
|
1801
2710
|
};
|
|
1802
2711
|
/**
|
|
1803
2712
|
* Resets a site - deletes/reinstalls the site.
|
|
@@ -1806,13 +2715,20 @@ export const useSitePluginsUpdate = (options) => {
|
|
|
1806
2715
|
export const resetSite = (siteId, resetSiteBody, options) => {
|
|
1807
2716
|
return axios.post(`/v1/sites/${siteId}/reset`, resetSiteBody, options);
|
|
1808
2717
|
};
|
|
1809
|
-
export const
|
|
2718
|
+
export const getResetSiteMutationOptions = (options) => {
|
|
1810
2719
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1811
2720
|
const mutationFn = (props) => {
|
|
1812
2721
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1813
2722
|
return resetSite(siteId, data, axiosOptions);
|
|
1814
2723
|
};
|
|
1815
|
-
return
|
|
2724
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2725
|
+
};
|
|
2726
|
+
/**
|
|
2727
|
+
* @summary reset site
|
|
2728
|
+
*/
|
|
2729
|
+
export const useResetSite = (options) => {
|
|
2730
|
+
const mutationOptions = getResetSiteMutationOptions(options);
|
|
2731
|
+
return useMutation(mutationOptions);
|
|
1816
2732
|
};
|
|
1817
2733
|
/**
|
|
1818
2734
|
* Performs a checksum of the site's core files to verify integrity.
|
|
@@ -1821,14 +2737,23 @@ export const useResetSite = (options) => {
|
|
|
1821
2737
|
export const sitesSecurityCheckCore = (siteId, options) => {
|
|
1822
2738
|
return axios.get(`/v1/sites/${siteId}/security/core/check`, options);
|
|
1823
2739
|
};
|
|
1824
|
-
export const getSitesSecurityCheckCoreQueryKey = (siteId) =>
|
|
1825
|
-
|
|
2740
|
+
export const getSitesSecurityCheckCoreQueryKey = (siteId) => {
|
|
2741
|
+
return [`/v1/sites/${siteId}/security/core/check`];
|
|
2742
|
+
};
|
|
2743
|
+
export const getSitesSecurityCheckCoreQueryOptions = (siteId, options) => {
|
|
1826
2744
|
var _a;
|
|
1827
2745
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1828
2746
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityCheckCoreQueryKey(siteId);
|
|
1829
2747
|
const queryFn = ({ signal }) => sitesSecurityCheckCore(siteId, Object.assign({ signal }, axiosOptions));
|
|
1830
|
-
|
|
1831
|
-
|
|
2748
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2749
|
+
};
|
|
2750
|
+
/**
|
|
2751
|
+
* @summary core files checksum
|
|
2752
|
+
*/
|
|
2753
|
+
export const useSitesSecurityCheckCore = (siteId, options) => {
|
|
2754
|
+
const queryOptions = getSitesSecurityCheckCoreQueryOptions(siteId, options);
|
|
2755
|
+
const query = useQuery(queryOptions);
|
|
2756
|
+
query.queryKey = queryOptions.queryKey;
|
|
1832
2757
|
return query;
|
|
1833
2758
|
};
|
|
1834
2759
|
/**
|
|
@@ -1838,13 +2763,20 @@ export const useSitesSecurityCheckCore = (siteId, options) => {
|
|
|
1838
2763
|
export const sitesSecurityResetCoreFiles = (siteId, options) => {
|
|
1839
2764
|
return axios.post(`/v1/sites/${siteId}/security/core/reset`, undefined, options);
|
|
1840
2765
|
};
|
|
1841
|
-
export const
|
|
2766
|
+
export const getSitesSecurityResetCoreFilesMutationOptions = (options) => {
|
|
1842
2767
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1843
2768
|
const mutationFn = (props) => {
|
|
1844
2769
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1845
2770
|
return sitesSecurityResetCoreFiles(siteId, axiosOptions);
|
|
1846
2771
|
};
|
|
1847
|
-
return
|
|
2772
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2773
|
+
};
|
|
2774
|
+
/**
|
|
2775
|
+
* @summary core files reset
|
|
2776
|
+
*/
|
|
2777
|
+
export const useSitesSecurityResetCoreFiles = (options) => {
|
|
2778
|
+
const mutationOptions = getSitesSecurityResetCoreFilesMutationOptions(options);
|
|
2779
|
+
return useMutation(mutationOptions);
|
|
1848
2780
|
};
|
|
1849
2781
|
/**
|
|
1850
2782
|
* Returns the HTTPS redirection status.
|
|
@@ -1853,14 +2785,23 @@ export const useSitesSecurityResetCoreFiles = (options) => {
|
|
|
1853
2785
|
export const sitesSecurityHttpsRedirectionStatus = (siteId, options) => {
|
|
1854
2786
|
return axios.get(`/v1/sites/${siteId}/security/https`, options);
|
|
1855
2787
|
};
|
|
1856
|
-
export const getSitesSecurityHttpsRedirectionStatusQueryKey = (siteId) =>
|
|
1857
|
-
|
|
2788
|
+
export const getSitesSecurityHttpsRedirectionStatusQueryKey = (siteId) => {
|
|
2789
|
+
return [`/v1/sites/${siteId}/security/https`];
|
|
2790
|
+
};
|
|
2791
|
+
export const getSitesSecurityHttpsRedirectionStatusQueryOptions = (siteId, options) => {
|
|
1858
2792
|
var _a;
|
|
1859
2793
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1860
2794
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecurityHttpsRedirectionStatusQueryKey(siteId);
|
|
1861
2795
|
const queryFn = ({ signal }) => sitesSecurityHttpsRedirectionStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
1862
|
-
|
|
1863
|
-
|
|
2796
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2797
|
+
};
|
|
2798
|
+
/**
|
|
2799
|
+
* @summary https redirection status
|
|
2800
|
+
*/
|
|
2801
|
+
export const useSitesSecurityHttpsRedirectionStatus = (siteId, options) => {
|
|
2802
|
+
const queryOptions = getSitesSecurityHttpsRedirectionStatusQueryOptions(siteId, options);
|
|
2803
|
+
const query = useQuery(queryOptions);
|
|
2804
|
+
query.queryKey = queryOptions.queryKey;
|
|
1864
2805
|
return query;
|
|
1865
2806
|
};
|
|
1866
2807
|
/**
|
|
@@ -1870,13 +2811,20 @@ export const useSitesSecurityHttpsRedirectionStatus = (siteId, options) => {
|
|
|
1870
2811
|
export const sitesSecurityHttpsEnableDisableSsl = (siteId, sitesSecurityHttpsEnableDisableSslBody, options) => {
|
|
1871
2812
|
return axios.post(`/v1/sites/${siteId}/security/https`, sitesSecurityHttpsEnableDisableSslBody, options);
|
|
1872
2813
|
};
|
|
1873
|
-
export const
|
|
2814
|
+
export const getSitesSecurityHttpsEnableDisableSslMutationOptions = (options) => {
|
|
1874
2815
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1875
2816
|
const mutationFn = (props) => {
|
|
1876
2817
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1877
2818
|
return sitesSecurityHttpsEnableDisableSsl(siteId, data, axiosOptions);
|
|
1878
2819
|
};
|
|
1879
|
-
return
|
|
2820
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2821
|
+
};
|
|
2822
|
+
/**
|
|
2823
|
+
* @summary https redirection toggle
|
|
2824
|
+
*/
|
|
2825
|
+
export const useSitesSecurityHttpsEnableDisableSsl = (options) => {
|
|
2826
|
+
const mutationOptions = getSitesSecurityHttpsEnableDisableSslMutationOptions(options);
|
|
2827
|
+
return useMutation(mutationOptions);
|
|
1880
2828
|
};
|
|
1881
2829
|
/**
|
|
1882
2830
|
* Returns the site's sitelock information.
|
|
@@ -1885,14 +2833,23 @@ export const useSitesSecurityHttpsEnableDisableSsl = (options) => {
|
|
|
1885
2833
|
export const sitesSecuritySitelock = (siteId, options) => {
|
|
1886
2834
|
return axios.get(`/v1/sites/${siteId}/security/sitelock`, options);
|
|
1887
2835
|
};
|
|
1888
|
-
export const getSitesSecuritySitelockQueryKey = (siteId) =>
|
|
1889
|
-
|
|
2836
|
+
export const getSitesSecuritySitelockQueryKey = (siteId) => {
|
|
2837
|
+
return [`/v1/sites/${siteId}/security/sitelock`];
|
|
2838
|
+
};
|
|
2839
|
+
export const getSitesSecuritySitelockQueryOptions = (siteId, options) => {
|
|
1890
2840
|
var _a;
|
|
1891
2841
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1892
2842
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockQueryKey(siteId);
|
|
1893
2843
|
const queryFn = ({ signal }) => sitesSecuritySitelock(siteId, Object.assign({ signal }, axiosOptions));
|
|
1894
|
-
|
|
1895
|
-
|
|
2844
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2845
|
+
};
|
|
2846
|
+
/**
|
|
2847
|
+
* @summary sitelock info
|
|
2848
|
+
*/
|
|
2849
|
+
export const useSitesSecuritySitelock = (siteId, options) => {
|
|
2850
|
+
const queryOptions = getSitesSecuritySitelockQueryOptions(siteId, options);
|
|
2851
|
+
const query = useQuery(queryOptions);
|
|
2852
|
+
query.queryKey = queryOptions.queryKey;
|
|
1896
2853
|
return query;
|
|
1897
2854
|
};
|
|
1898
2855
|
/**
|
|
@@ -1902,13 +2859,20 @@ export const useSitesSecuritySitelock = (siteId, options) => {
|
|
|
1902
2859
|
export const sitesSecuritySslAcme = (siteId, options) => {
|
|
1903
2860
|
return axios.post(`/v1/sites/${siteId}/security/ssl/acme`, undefined, options);
|
|
1904
2861
|
};
|
|
1905
|
-
export const
|
|
2862
|
+
export const getSitesSecuritySslAcmeMutationOptions = (options) => {
|
|
1906
2863
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1907
2864
|
const mutationFn = (props) => {
|
|
1908
2865
|
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1909
2866
|
return sitesSecuritySslAcme(siteId, axiosOptions);
|
|
1910
2867
|
};
|
|
1911
|
-
return
|
|
2868
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2869
|
+
};
|
|
2870
|
+
/**
|
|
2871
|
+
* @summary ssl lets encrypt toggle
|
|
2872
|
+
*/
|
|
2873
|
+
export const useSitesSecuritySslAcme = (options) => {
|
|
2874
|
+
const mutationOptions = getSitesSecuritySslAcmeMutationOptions(options);
|
|
2875
|
+
return useMutation(mutationOptions);
|
|
1912
2876
|
};
|
|
1913
2877
|
/**
|
|
1914
2878
|
* Returns the site's SSL Status
|
|
@@ -1918,14 +2882,24 @@ export const useSitesSecuritySslAcme = (options) => {
|
|
|
1918
2882
|
export const sitesSecuritySslStatus = (siteId, options) => {
|
|
1919
2883
|
return axios.get(`/v1/sites/${siteId}/security/ssl/status`, options);
|
|
1920
2884
|
};
|
|
1921
|
-
export const getSitesSecuritySslStatusQueryKey = (siteId) =>
|
|
1922
|
-
|
|
2885
|
+
export const getSitesSecuritySslStatusQueryKey = (siteId) => {
|
|
2886
|
+
return [`/v1/sites/${siteId}/security/ssl/status`];
|
|
2887
|
+
};
|
|
2888
|
+
export const getSitesSecuritySslStatusQueryOptions = (siteId, options) => {
|
|
1923
2889
|
var _a;
|
|
1924
2890
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1925
2891
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySslStatusQueryKey(siteId);
|
|
1926
2892
|
const queryFn = ({ signal }) => sitesSecuritySslStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
1927
|
-
|
|
1928
|
-
|
|
2893
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2894
|
+
};
|
|
2895
|
+
/**
|
|
2896
|
+
* @deprecated
|
|
2897
|
+
* @summary ssl status
|
|
2898
|
+
*/
|
|
2899
|
+
export const useSitesSecuritySslStatus = (siteId, options) => {
|
|
2900
|
+
const queryOptions = getSitesSecuritySslStatusQueryOptions(siteId, options);
|
|
2901
|
+
const query = useQuery(queryOptions);
|
|
2902
|
+
query.queryKey = queryOptions.queryKey;
|
|
1929
2903
|
return query;
|
|
1930
2904
|
};
|
|
1931
2905
|
/**
|
|
@@ -1935,14 +2909,23 @@ export const useSitesSecuritySslStatus = (siteId, options) => {
|
|
|
1935
2909
|
export const sitesSettingsComingSoon = (siteId, options) => {
|
|
1936
2910
|
return axios.get(`/v1/sites/${siteId}/settings/coming-soon`, options);
|
|
1937
2911
|
};
|
|
1938
|
-
export const getSitesSettingsComingSoonQueryKey = (siteId) =>
|
|
1939
|
-
|
|
2912
|
+
export const getSitesSettingsComingSoonQueryKey = (siteId) => {
|
|
2913
|
+
return [`/v1/sites/${siteId}/settings/coming-soon`];
|
|
2914
|
+
};
|
|
2915
|
+
export const getSitesSettingsComingSoonQueryOptions = (siteId, options) => {
|
|
1940
2916
|
var _a;
|
|
1941
2917
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1942
2918
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsComingSoonQueryKey(siteId);
|
|
1943
2919
|
const queryFn = ({ signal }) => sitesSettingsComingSoon(siteId, Object.assign({ signal }, axiosOptions));
|
|
1944
|
-
|
|
1945
|
-
|
|
2920
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2921
|
+
};
|
|
2922
|
+
/**
|
|
2923
|
+
* @summary settings coming soon page status
|
|
2924
|
+
*/
|
|
2925
|
+
export const useSitesSettingsComingSoon = (siteId, options) => {
|
|
2926
|
+
const queryOptions = getSitesSettingsComingSoonQueryOptions(siteId, options);
|
|
2927
|
+
const query = useQuery(queryOptions);
|
|
2928
|
+
query.queryKey = queryOptions.queryKey;
|
|
1946
2929
|
return query;
|
|
1947
2930
|
};
|
|
1948
2931
|
/**
|
|
@@ -1952,13 +2935,20 @@ export const useSitesSettingsComingSoon = (siteId, options) => {
|
|
|
1952
2935
|
export const sitesSettingsComingSoonToggle = (siteId, sitesSettingsComingSoonToggleBody, options) => {
|
|
1953
2936
|
return axios.post(`/v1/sites/${siteId}/settings/coming-soon`, sitesSettingsComingSoonToggleBody, options);
|
|
1954
2937
|
};
|
|
1955
|
-
export const
|
|
2938
|
+
export const getSitesSettingsComingSoonToggleMutationOptions = (options) => {
|
|
1956
2939
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1957
2940
|
const mutationFn = (props) => {
|
|
1958
2941
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1959
2942
|
return sitesSettingsComingSoonToggle(siteId, data, axiosOptions);
|
|
1960
2943
|
};
|
|
1961
|
-
return
|
|
2944
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2945
|
+
};
|
|
2946
|
+
/**
|
|
2947
|
+
* @summary settings coming soon toggle
|
|
2948
|
+
*/
|
|
2949
|
+
export const useSitesSettingsComingSoonToggle = (options) => {
|
|
2950
|
+
const mutationOptions = getSitesSettingsComingSoonToggleMutationOptions(options);
|
|
2951
|
+
return useMutation(mutationOptions);
|
|
1962
2952
|
};
|
|
1963
2953
|
/**
|
|
1964
2954
|
* Returns the site's debug mode status
|
|
@@ -1967,14 +2957,23 @@ export const useSitesSettingsComingSoonToggle = (options) => {
|
|
|
1967
2957
|
export const sitesSettingsDebug = (siteId, options) => {
|
|
1968
2958
|
return axios.get(`/v1/sites/${siteId}/settings/debug`, options);
|
|
1969
2959
|
};
|
|
1970
|
-
export const getSitesSettingsDebugQueryKey = (siteId) =>
|
|
1971
|
-
|
|
2960
|
+
export const getSitesSettingsDebugQueryKey = (siteId) => {
|
|
2961
|
+
return [`/v1/sites/${siteId}/settings/debug`];
|
|
2962
|
+
};
|
|
2963
|
+
export const getSitesSettingsDebugQueryOptions = (siteId, options) => {
|
|
1972
2964
|
var _a;
|
|
1973
2965
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1974
2966
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsDebugQueryKey(siteId);
|
|
1975
2967
|
const queryFn = ({ signal }) => sitesSettingsDebug(siteId, Object.assign({ signal }, axiosOptions));
|
|
1976
|
-
|
|
1977
|
-
|
|
2968
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
2969
|
+
};
|
|
2970
|
+
/**
|
|
2971
|
+
* @summary settings debug status
|
|
2972
|
+
*/
|
|
2973
|
+
export const useSitesSettingsDebug = (siteId, options) => {
|
|
2974
|
+
const queryOptions = getSitesSettingsDebugQueryOptions(siteId, options);
|
|
2975
|
+
const query = useQuery(queryOptions);
|
|
2976
|
+
query.queryKey = queryOptions.queryKey;
|
|
1978
2977
|
return query;
|
|
1979
2978
|
};
|
|
1980
2979
|
/**
|
|
@@ -1984,13 +2983,20 @@ export const useSitesSettingsDebug = (siteId, options) => {
|
|
|
1984
2983
|
export const sitesSettingsDebugToggle = (siteId, sitesSettingsDebugToggleBody, options) => {
|
|
1985
2984
|
return axios.post(`/v1/sites/${siteId}/settings/debug`, sitesSettingsDebugToggleBody, options);
|
|
1986
2985
|
};
|
|
1987
|
-
export const
|
|
2986
|
+
export const getSitesSettingsDebugToggleMutationOptions = (options) => {
|
|
1988
2987
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1989
2988
|
const mutationFn = (props) => {
|
|
1990
2989
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
1991
2990
|
return sitesSettingsDebugToggle(siteId, data, axiosOptions);
|
|
1992
2991
|
};
|
|
1993
|
-
return
|
|
2992
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
2993
|
+
};
|
|
2994
|
+
/**
|
|
2995
|
+
* @summary settings debug toggle
|
|
2996
|
+
*/
|
|
2997
|
+
export const useSitesSettingsDebugToggle = (options) => {
|
|
2998
|
+
const mutationOptions = getSitesSettingsDebugToggleMutationOptions(options);
|
|
2999
|
+
return useMutation(mutationOptions);
|
|
1994
3000
|
};
|
|
1995
3001
|
/**
|
|
1996
3002
|
* Updates the site's PHP version
|
|
@@ -1999,13 +3005,20 @@ export const useSitesSettingsDebugToggle = (options) => {
|
|
|
1999
3005
|
export const sitesSettingsPhpVersionUpdate = (siteId, sitesSettingsPhpVersionUpdateBody, options) => {
|
|
2000
3006
|
return axios.post(`/v1/sites/${siteId}/settings/php-version`, sitesSettingsPhpVersionUpdateBody, options);
|
|
2001
3007
|
};
|
|
2002
|
-
export const
|
|
3008
|
+
export const getSitesSettingsPhpVersionUpdateMutationOptions = (options) => {
|
|
2003
3009
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2004
3010
|
const mutationFn = (props) => {
|
|
2005
3011
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2006
3012
|
return sitesSettingsPhpVersionUpdate(siteId, data, axiosOptions);
|
|
2007
3013
|
};
|
|
2008
|
-
return
|
|
3014
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
3015
|
+
};
|
|
3016
|
+
/**
|
|
3017
|
+
* @summary settings php version update
|
|
3018
|
+
*/
|
|
3019
|
+
export const useSitesSettingsPhpVersionUpdate = (options) => {
|
|
3020
|
+
const mutationOptions = getSitesSettingsPhpVersionUpdateMutationOptions(options);
|
|
3021
|
+
return useMutation(mutationOptions);
|
|
2009
3022
|
};
|
|
2010
3023
|
/**
|
|
2011
3024
|
* Gets the list of PHP versions available/installed
|
|
@@ -2014,14 +3027,23 @@ export const useSitesSettingsPhpVersionUpdate = (options) => {
|
|
|
2014
3027
|
export const sitesSettingsPhpVersions = (siteId, options) => {
|
|
2015
3028
|
return axios.get(`/v1/sites/${siteId}/settings/php-versions`, options);
|
|
2016
3029
|
};
|
|
2017
|
-
export const getSitesSettingsPhpVersionsQueryKey = (siteId) =>
|
|
2018
|
-
|
|
3030
|
+
export const getSitesSettingsPhpVersionsQueryKey = (siteId) => {
|
|
3031
|
+
return [`/v1/sites/${siteId}/settings/php-versions`];
|
|
3032
|
+
};
|
|
3033
|
+
export const getSitesSettingsPhpVersionsQueryOptions = (siteId, options) => {
|
|
2019
3034
|
var _a;
|
|
2020
3035
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2021
3036
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSettingsPhpVersionsQueryKey(siteId);
|
|
2022
3037
|
const queryFn = ({ signal }) => sitesSettingsPhpVersions(siteId, Object.assign({ signal }, axiosOptions));
|
|
2023
|
-
|
|
2024
|
-
|
|
3038
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3039
|
+
};
|
|
3040
|
+
/**
|
|
3041
|
+
* @summary settings php versions list
|
|
3042
|
+
*/
|
|
3043
|
+
export const useSitesSettingsPhpVersions = (siteId, options) => {
|
|
3044
|
+
const queryOptions = getSitesSettingsPhpVersionsQueryOptions(siteId, options);
|
|
3045
|
+
const query = useQuery(queryOptions);
|
|
3046
|
+
query.queryKey = queryOptions.queryKey;
|
|
2025
3047
|
return query;
|
|
2026
3048
|
};
|
|
2027
3049
|
/**
|
|
@@ -2031,14 +3053,23 @@ export const useSitesSettingsPhpVersions = (siteId, options) => {
|
|
|
2031
3053
|
export const sitesSshUserList = (siteId, options) => {
|
|
2032
3054
|
return axios.get(`/v1/sites/${siteId}/ssh-users`, options);
|
|
2033
3055
|
};
|
|
2034
|
-
export const getSitesSshUserListQueryKey = (siteId) =>
|
|
2035
|
-
|
|
3056
|
+
export const getSitesSshUserListQueryKey = (siteId) => {
|
|
3057
|
+
return [`/v1/sites/${siteId}/ssh-users`];
|
|
3058
|
+
};
|
|
3059
|
+
export const getSitesSshUserListQueryOptions = (siteId, options) => {
|
|
2036
3060
|
var _a;
|
|
2037
3061
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2038
3062
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSshUserListQueryKey(siteId);
|
|
2039
3063
|
const queryFn = ({ signal }) => sitesSshUserList(siteId, Object.assign({ signal }, axiosOptions));
|
|
2040
|
-
|
|
2041
|
-
|
|
3064
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3065
|
+
};
|
|
3066
|
+
/**
|
|
3067
|
+
* @summary site - ssh - list users
|
|
3068
|
+
*/
|
|
3069
|
+
export const useSitesSshUserList = (siteId, options) => {
|
|
3070
|
+
const queryOptions = getSitesSshUserListQueryOptions(siteId, options);
|
|
3071
|
+
const query = useQuery(queryOptions);
|
|
3072
|
+
query.queryKey = queryOptions.queryKey;
|
|
2042
3073
|
return query;
|
|
2043
3074
|
};
|
|
2044
3075
|
/**
|
|
@@ -2048,13 +3079,20 @@ export const useSitesSshUserList = (siteId, options) => {
|
|
|
2048
3079
|
export const sitesSshUserCreate = (siteId, sitesSshUserCreateBody, options) => {
|
|
2049
3080
|
return axios.post(`/v1/sites/${siteId}/ssh-users`, sitesSshUserCreateBody, options);
|
|
2050
3081
|
};
|
|
2051
|
-
export const
|
|
3082
|
+
export const getSitesSshUserCreateMutationOptions = (options) => {
|
|
2052
3083
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2053
3084
|
const mutationFn = (props) => {
|
|
2054
3085
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2055
3086
|
return sitesSshUserCreate(siteId, data, axiosOptions);
|
|
2056
3087
|
};
|
|
2057
|
-
return
|
|
3088
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
3089
|
+
};
|
|
3090
|
+
/**
|
|
3091
|
+
* @summary site - ssh - create user
|
|
3092
|
+
*/
|
|
3093
|
+
export const useSitesSshUserCreate = (options) => {
|
|
3094
|
+
const mutationOptions = getSitesSshUserCreateMutationOptions(options);
|
|
3095
|
+
return useMutation(mutationOptions);
|
|
2058
3096
|
};
|
|
2059
3097
|
/**
|
|
2060
3098
|
* delete ssh user
|
|
@@ -2063,13 +3101,20 @@ export const useSitesSshUserCreate = (options) => {
|
|
|
2063
3101
|
export const sitesSshUserDelete = (siteId, sitesSshUserDeleteBody, options) => {
|
|
2064
3102
|
return axios.delete(`/v1/sites/${siteId}/ssh-users`, Object.assign({ data: sitesSshUserDeleteBody }, options));
|
|
2065
3103
|
};
|
|
2066
|
-
export const
|
|
3104
|
+
export const getSitesSshUserDeleteMutationOptions = (options) => {
|
|
2067
3105
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2068
3106
|
const mutationFn = (props) => {
|
|
2069
3107
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2070
3108
|
return sitesSshUserDelete(siteId, data, axiosOptions);
|
|
2071
3109
|
};
|
|
2072
|
-
return
|
|
3110
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
3111
|
+
};
|
|
3112
|
+
/**
|
|
3113
|
+
* @summary site - ssh - delete user
|
|
3114
|
+
*/
|
|
3115
|
+
export const useSitesSshUserDelete = (options) => {
|
|
3116
|
+
const mutationOptions = getSitesSshUserDeleteMutationOptions(options);
|
|
3117
|
+
return useMutation(mutationOptions);
|
|
2073
3118
|
};
|
|
2074
3119
|
/**
|
|
2075
3120
|
* update ssh user
|
|
@@ -2078,13 +3123,20 @@ export const useSitesSshUserDelete = (options) => {
|
|
|
2078
3123
|
export const sitesSshUserUpdate = (siteId, sitesSshUserUpdateBody, options) => {
|
|
2079
3124
|
return axios.put(`/v1/sites/${siteId}/ssh-users`, sitesSshUserUpdateBody, options);
|
|
2080
3125
|
};
|
|
2081
|
-
export const
|
|
3126
|
+
export const getSitesSshUserUpdateMutationOptions = (options) => {
|
|
2082
3127
|
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2083
3128
|
const mutationFn = (props) => {
|
|
2084
3129
|
const { siteId, data } = props !== null && props !== void 0 ? props : {};
|
|
2085
3130
|
return sitesSshUserUpdate(siteId, data, axiosOptions);
|
|
2086
3131
|
};
|
|
2087
|
-
return
|
|
3132
|
+
return Object.assign({ mutationFn }, mutationOptions);
|
|
3133
|
+
};
|
|
3134
|
+
/**
|
|
3135
|
+
* @summary site - ssh - update user
|
|
3136
|
+
*/
|
|
3137
|
+
export const useSitesSshUserUpdate = (options) => {
|
|
3138
|
+
const mutationOptions = getSitesSshUserUpdateMutationOptions(options);
|
|
3139
|
+
return useMutation(mutationOptions);
|
|
2088
3140
|
};
|
|
2089
3141
|
/**
|
|
2090
3142
|
* Returns information about the site domain's SSL/TLS certificate
|
|
@@ -2093,14 +3145,23 @@ export const useSitesSshUserUpdate = (options) => {
|
|
|
2093
3145
|
export const sitesSsl = (siteId, options) => {
|
|
2094
3146
|
return axios.get(`/v1/sites/${siteId}/ssl`, options);
|
|
2095
3147
|
};
|
|
2096
|
-
export const getSitesSslQueryKey = (siteId) =>
|
|
2097
|
-
|
|
3148
|
+
export const getSitesSslQueryKey = (siteId) => {
|
|
3149
|
+
return [`/v1/sites/${siteId}/ssl`];
|
|
3150
|
+
};
|
|
3151
|
+
export const getSitesSslQueryOptions = (siteId, options) => {
|
|
2098
3152
|
var _a;
|
|
2099
3153
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2100
3154
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSslQueryKey(siteId);
|
|
2101
3155
|
const queryFn = ({ signal }) => sitesSsl(siteId, Object.assign({ signal }, axiosOptions));
|
|
2102
|
-
|
|
2103
|
-
|
|
3156
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3157
|
+
};
|
|
3158
|
+
/**
|
|
3159
|
+
* @summary Site domain SSL cert info
|
|
3160
|
+
*/
|
|
3161
|
+
export const useSitesSsl = (siteId, options) => {
|
|
3162
|
+
const queryOptions = getSitesSslQueryOptions(siteId, options);
|
|
3163
|
+
const query = useQuery(queryOptions);
|
|
3164
|
+
query.queryKey = queryOptions.queryKey;
|
|
2104
3165
|
return query;
|
|
2105
3166
|
};
|
|
2106
3167
|
/**
|
|
@@ -2110,14 +3171,23 @@ export const useSitesSsl = (siteId, options) => {
|
|
|
2110
3171
|
export const sitesSso = (siteId, params, options) => {
|
|
2111
3172
|
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) }));
|
|
2112
3173
|
};
|
|
2113
|
-
export const getSitesSsoQueryKey = (siteId, params) =>
|
|
2114
|
-
|
|
3174
|
+
export const getSitesSsoQueryKey = (siteId, params) => {
|
|
3175
|
+
return [`/v1/sites/${siteId}/sso`, ...(params ? [params] : [])];
|
|
3176
|
+
};
|
|
3177
|
+
export const getSitesSsoQueryOptions = (siteId, params, options) => {
|
|
2115
3178
|
var _a;
|
|
2116
3179
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2117
3180
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSsoQueryKey(siteId, params);
|
|
2118
3181
|
const queryFn = ({ signal }) => sitesSso(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2119
|
-
|
|
2120
|
-
|
|
3182
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3183
|
+
};
|
|
3184
|
+
/**
|
|
3185
|
+
* @summary sso
|
|
3186
|
+
*/
|
|
3187
|
+
export const useSitesSso = (siteId, params, options) => {
|
|
3188
|
+
const queryOptions = getSitesSsoQueryOptions(siteId, params, options);
|
|
3189
|
+
const query = useQuery(queryOptions);
|
|
3190
|
+
query.queryKey = queryOptions.queryKey;
|
|
2121
3191
|
return query;
|
|
2122
3192
|
};
|
|
2123
3193
|
/**
|
|
@@ -2126,14 +3196,23 @@ export const useSitesSso = (siteId, params, options) => {
|
|
|
2126
3196
|
export const siteStatus = (siteId, options) => {
|
|
2127
3197
|
return axios.get(`/v1/sites/${siteId}/status`, options);
|
|
2128
3198
|
};
|
|
2129
|
-
export const getSiteStatusQueryKey = (siteId) =>
|
|
2130
|
-
|
|
3199
|
+
export const getSiteStatusQueryKey = (siteId) => {
|
|
3200
|
+
return [`/v1/sites/${siteId}/status`];
|
|
3201
|
+
};
|
|
3202
|
+
export const getSiteStatusQueryOptions = (siteId, options) => {
|
|
2131
3203
|
var _a;
|
|
2132
3204
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2133
3205
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteStatusQueryKey(siteId);
|
|
2134
3206
|
const queryFn = ({ signal }) => siteStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
2135
|
-
|
|
2136
|
-
|
|
3207
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3208
|
+
};
|
|
3209
|
+
/**
|
|
3210
|
+
* @summary site status
|
|
3211
|
+
*/
|
|
3212
|
+
export const useSiteStatus = (siteId, options) => {
|
|
3213
|
+
const queryOptions = getSiteStatusQueryOptions(siteId, options);
|
|
3214
|
+
const query = useQuery(queryOptions);
|
|
3215
|
+
query.queryKey = queryOptions.queryKey;
|
|
2137
3216
|
return query;
|
|
2138
3217
|
};
|
|
2139
3218
|
/**
|
|
@@ -2143,14 +3222,23 @@ export const useSiteStatus = (siteId, options) => {
|
|
|
2143
3222
|
export const siteUsers = (siteId, options) => {
|
|
2144
3223
|
return axios.get(`/v1/sites/${siteId}/users`, options);
|
|
2145
3224
|
};
|
|
2146
|
-
export const getSiteUsersQueryKey = (siteId) =>
|
|
2147
|
-
|
|
3225
|
+
export const getSiteUsersQueryKey = (siteId) => {
|
|
3226
|
+
return [`/v1/sites/${siteId}/users`];
|
|
3227
|
+
};
|
|
3228
|
+
export const getSiteUsersQueryOptions = (siteId, options) => {
|
|
2148
3229
|
var _a;
|
|
2149
3230
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2150
3231
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteUsersQueryKey(siteId);
|
|
2151
3232
|
const queryFn = ({ signal }) => siteUsers(siteId, Object.assign({ signal }, axiosOptions));
|
|
2152
|
-
|
|
2153
|
-
|
|
3233
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3234
|
+
};
|
|
3235
|
+
/**
|
|
3236
|
+
* @summary users
|
|
3237
|
+
*/
|
|
3238
|
+
export const useSiteUsers = (siteId, options) => {
|
|
3239
|
+
const queryOptions = getSiteUsersQueryOptions(siteId, options);
|
|
3240
|
+
const query = useQuery(queryOptions);
|
|
3241
|
+
query.queryKey = queryOptions.queryKey;
|
|
2154
3242
|
return query;
|
|
2155
3243
|
};
|
|
2156
3244
|
/**
|
|
@@ -2160,14 +3248,23 @@ export const useSiteUsers = (siteId, options) => {
|
|
|
2160
3248
|
export const sitesVersion = (siteId, options) => {
|
|
2161
3249
|
return axios.get(`/v1/sites/${siteId}/version`, options);
|
|
2162
3250
|
};
|
|
2163
|
-
export const getSitesVersionQueryKey = (siteId) =>
|
|
2164
|
-
|
|
3251
|
+
export const getSitesVersionQueryKey = (siteId) => {
|
|
3252
|
+
return [`/v1/sites/${siteId}/version`];
|
|
3253
|
+
};
|
|
3254
|
+
export const getSitesVersionQueryOptions = (siteId, options) => {
|
|
2165
3255
|
var _a;
|
|
2166
3256
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2167
3257
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesVersionQueryKey(siteId);
|
|
2168
3258
|
const queryFn = ({ signal }) => sitesVersion(siteId, Object.assign({ signal }, axiosOptions));
|
|
2169
|
-
|
|
2170
|
-
|
|
3259
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3260
|
+
};
|
|
3261
|
+
/**
|
|
3262
|
+
* @summary version
|
|
3263
|
+
*/
|
|
3264
|
+
export const useSitesVersion = (siteId, options) => {
|
|
3265
|
+
const queryOptions = getSitesVersionQueryOptions(siteId, options);
|
|
3266
|
+
const query = useQuery(queryOptions);
|
|
3267
|
+
query.queryKey = queryOptions.queryKey;
|
|
2171
3268
|
return query;
|
|
2172
3269
|
};
|
|
2173
3270
|
/**
|
|
@@ -2177,14 +3274,23 @@ export const useSitesVersion = (siteId, options) => {
|
|
|
2177
3274
|
export const addonsSitelockSsoV2 = (addonId, params, options) => {
|
|
2178
3275
|
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) }));
|
|
2179
3276
|
};
|
|
2180
|
-
export const getAddonsSitelockSsoV2QueryKey = (addonId, params) =>
|
|
2181
|
-
|
|
3277
|
+
export const getAddonsSitelockSsoV2QueryKey = (addonId, params) => {
|
|
3278
|
+
return [`/v2/addons/sitelock/${addonId}/sso`, ...(params ? [params] : [])];
|
|
3279
|
+
};
|
|
3280
|
+
export const getAddonsSitelockSsoV2QueryOptions = (addonId, params, options) => {
|
|
2182
3281
|
var _a;
|
|
2183
3282
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2184
3283
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSitelockSsoV2QueryKey(addonId, params);
|
|
2185
3284
|
const queryFn = ({ signal }) => addonsSitelockSsoV2(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
2186
|
-
|
|
2187
|
-
|
|
3285
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions);
|
|
3286
|
+
};
|
|
3287
|
+
/**
|
|
3288
|
+
* @summary sso
|
|
3289
|
+
*/
|
|
3290
|
+
export const useAddonsSitelockSsoV2 = (addonId, params, options) => {
|
|
3291
|
+
const queryOptions = getAddonsSitelockSsoV2QueryOptions(addonId, params, options);
|
|
3292
|
+
const query = useQuery(queryOptions);
|
|
3293
|
+
query.queryKey = queryOptions.queryKey;
|
|
2188
3294
|
return query;
|
|
2189
3295
|
};
|
|
2190
3296
|
/**
|
|
@@ -2194,14 +3300,23 @@ export const useAddonsSitelockSsoV2 = (addonId, params, options) => {
|
|
|
2194
3300
|
export const hostingNameserversV2 = (hostingId, options) => {
|
|
2195
3301
|
return axios.get(`/v2/hosting/${hostingId}/nameservers`, options);
|
|
2196
3302
|
};
|
|
2197
|
-
export const getHostingNameserversV2QueryKey = (hostingId) =>
|
|
2198
|
-
|
|
3303
|
+
export const getHostingNameserversV2QueryKey = (hostingId) => {
|
|
3304
|
+
return [`/v2/hosting/${hostingId}/nameservers`];
|
|
3305
|
+
};
|
|
3306
|
+
export const getHostingNameserversV2QueryOptions = (hostingId, options) => {
|
|
2199
3307
|
var _a;
|
|
2200
3308
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2201
3309
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversV2QueryKey(hostingId);
|
|
2202
3310
|
const queryFn = ({ signal }) => hostingNameserversV2(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2203
|
-
|
|
2204
|
-
|
|
3311
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
3312
|
+
};
|
|
3313
|
+
/**
|
|
3314
|
+
* @summary hosting server nameservers info
|
|
3315
|
+
*/
|
|
3316
|
+
export const useHostingNameserversV2 = (hostingId, options) => {
|
|
3317
|
+
const queryOptions = getHostingNameserversV2QueryOptions(hostingId, options);
|
|
3318
|
+
const query = useQuery(queryOptions);
|
|
3319
|
+
query.queryKey = queryOptions.queryKey;
|
|
2205
3320
|
return query;
|
|
2206
3321
|
};
|
|
2207
3322
|
/**
|
|
@@ -2211,14 +3326,23 @@ export const useHostingNameserversV2 = (hostingId, options) => {
|
|
|
2211
3326
|
export const hostingSitesV2 = (hostingId, options) => {
|
|
2212
3327
|
return axios.get(`/v2/hosting/${hostingId}/sites`, options);
|
|
2213
3328
|
};
|
|
2214
|
-
export const getHostingSitesV2QueryKey = (hostingId) =>
|
|
2215
|
-
|
|
3329
|
+
export const getHostingSitesV2QueryKey = (hostingId) => {
|
|
3330
|
+
return [`/v2/hosting/${hostingId}/sites`];
|
|
3331
|
+
};
|
|
3332
|
+
export const getHostingSitesV2QueryOptions = (hostingId, options) => {
|
|
2216
3333
|
var _a;
|
|
2217
3334
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2218
3335
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingSitesV2QueryKey(hostingId);
|
|
2219
3336
|
const queryFn = ({ signal }) => hostingSitesV2(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2220
|
-
|
|
2221
|
-
|
|
3337
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
3338
|
+
};
|
|
3339
|
+
/**
|
|
3340
|
+
* @summary sites list v2
|
|
3341
|
+
*/
|
|
3342
|
+
export const useHostingSitesV2 = (hostingId, options) => {
|
|
3343
|
+
const queryOptions = getHostingSitesV2QueryOptions(hostingId, options);
|
|
3344
|
+
const query = useQuery(queryOptions);
|
|
3345
|
+
query.queryKey = queryOptions.queryKey;
|
|
2222
3346
|
return query;
|
|
2223
3347
|
};
|
|
2224
3348
|
/**
|
|
@@ -2228,14 +3352,23 @@ export const useHostingSitesV2 = (hostingId, options) => {
|
|
|
2228
3352
|
export const sshKeyListV2 = (hostingId, options) => {
|
|
2229
3353
|
return axios.get(`/v2/hosting/${hostingId}/ssh/keys`, options);
|
|
2230
3354
|
};
|
|
2231
|
-
export const getSshKeyListV2QueryKey = (hostingId) =>
|
|
2232
|
-
|
|
3355
|
+
export const getSshKeyListV2QueryKey = (hostingId) => {
|
|
3356
|
+
return [`/v2/hosting/${hostingId}/ssh/keys`];
|
|
3357
|
+
};
|
|
3358
|
+
export const getSshKeyListV2QueryOptions = (hostingId, options) => {
|
|
2233
3359
|
var _a;
|
|
2234
3360
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2235
3361
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSshKeyListV2QueryKey(hostingId);
|
|
2236
3362
|
const queryFn = ({ signal }) => sshKeyListV2(hostingId, Object.assign({ signal }, axiosOptions));
|
|
2237
|
-
|
|
2238
|
-
|
|
3363
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions);
|
|
3364
|
+
};
|
|
3365
|
+
/**
|
|
3366
|
+
* @summary ssh keys list
|
|
3367
|
+
*/
|
|
3368
|
+
export const useSshKeyListV2 = (hostingId, options) => {
|
|
3369
|
+
const queryOptions = getSshKeyListV2QueryOptions(hostingId, options);
|
|
3370
|
+
const query = useQuery(queryOptions);
|
|
3371
|
+
query.queryKey = queryOptions.queryKey;
|
|
2239
3372
|
return query;
|
|
2240
3373
|
};
|
|
2241
3374
|
/**
|
|
@@ -2245,14 +3378,23 @@ export const useSshKeyListV2 = (hostingId, options) => {
|
|
|
2245
3378
|
export const sitesListV2 = (options) => {
|
|
2246
3379
|
return axios.get(`/v2/sites`, options);
|
|
2247
3380
|
};
|
|
2248
|
-
export const getSitesListV2QueryKey = () =>
|
|
2249
|
-
|
|
3381
|
+
export const getSitesListV2QueryKey = () => {
|
|
3382
|
+
return [`/v2/sites`];
|
|
3383
|
+
};
|
|
3384
|
+
export const getSitesListV2QueryOptions = (options) => {
|
|
2250
3385
|
var _a;
|
|
2251
3386
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2252
3387
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesListV2QueryKey();
|
|
2253
3388
|
const queryFn = ({ signal }) => sitesListV2(Object.assign({ signal }, axiosOptions));
|
|
2254
|
-
|
|
2255
|
-
|
|
3389
|
+
return Object.assign({ queryKey, queryFn }, queryOptions);
|
|
3390
|
+
};
|
|
3391
|
+
/**
|
|
3392
|
+
* @summary Site list for an account v2
|
|
3393
|
+
*/
|
|
3394
|
+
export const useSitesListV2 = (options) => {
|
|
3395
|
+
const queryOptions = getSitesListV2QueryOptions(options);
|
|
3396
|
+
const query = useQuery(queryOptions);
|
|
3397
|
+
query.queryKey = queryOptions.queryKey;
|
|
2256
3398
|
return query;
|
|
2257
3399
|
};
|
|
2258
3400
|
/**
|
|
@@ -2262,14 +3404,23 @@ export const useSitesListV2 = (options) => {
|
|
|
2262
3404
|
export const sitesDomainsV2 = (siteId, params, options) => {
|
|
2263
3405
|
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) }));
|
|
2264
3406
|
};
|
|
2265
|
-
export const getSitesDomainsV2QueryKey = (siteId, params) =>
|
|
2266
|
-
|
|
3407
|
+
export const getSitesDomainsV2QueryKey = (siteId, params) => {
|
|
3408
|
+
return [`/v2/sites/${siteId}/domains`, ...(params ? [params] : [])];
|
|
3409
|
+
};
|
|
3410
|
+
export const getSitesDomainsV2QueryOptions = (siteId, params, options) => {
|
|
2267
3411
|
var _a;
|
|
2268
3412
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2269
3413
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainsV2QueryKey(siteId, params);
|
|
2270
3414
|
const queryFn = ({ signal }) => sitesDomainsV2(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2271
|
-
|
|
2272
|
-
|
|
3415
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3416
|
+
};
|
|
3417
|
+
/**
|
|
3418
|
+
* @summary Domains list for the site
|
|
3419
|
+
*/
|
|
3420
|
+
export const useSitesDomainsV2 = (siteId, params, options) => {
|
|
3421
|
+
const queryOptions = getSitesDomainsV2QueryOptions(siteId, params, options);
|
|
3422
|
+
const query = useQuery(queryOptions);
|
|
3423
|
+
query.queryKey = queryOptions.queryKey;
|
|
2273
3424
|
return query;
|
|
2274
3425
|
};
|
|
2275
3426
|
/**
|
|
@@ -2279,13 +3430,22 @@ export const useSitesDomainsV2 = (siteId, params, options) => {
|
|
|
2279
3430
|
export const sitesSecuritySitelockV2 = (siteId, params, options) => {
|
|
2280
3431
|
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) }));
|
|
2281
3432
|
};
|
|
2282
|
-
export const getSitesSecuritySitelockV2QueryKey = (siteId, params) =>
|
|
2283
|
-
|
|
3433
|
+
export const getSitesSecuritySitelockV2QueryKey = (siteId, params) => {
|
|
3434
|
+
return [`/v2/sites/${siteId}/security/sitelock`, ...(params ? [params] : [])];
|
|
3435
|
+
};
|
|
3436
|
+
export const getSitesSecuritySitelockV2QueryOptions = (siteId, params, options) => {
|
|
2284
3437
|
var _a;
|
|
2285
3438
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2286
3439
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSecuritySitelockV2QueryKey(siteId, params);
|
|
2287
3440
|
const queryFn = ({ signal }) => sitesSecuritySitelockV2(siteId, params, Object.assign({ signal }, axiosOptions));
|
|
2288
|
-
|
|
2289
|
-
|
|
3441
|
+
return Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions);
|
|
3442
|
+
};
|
|
3443
|
+
/**
|
|
3444
|
+
* @summary sitelock info
|
|
3445
|
+
*/
|
|
3446
|
+
export const useSitesSecuritySitelockV2 = (siteId, params, options) => {
|
|
3447
|
+
const queryOptions = getSitesSecuritySitelockV2QueryOptions(siteId, params, options);
|
|
3448
|
+
const query = useQuery(queryOptions);
|
|
3449
|
+
query.queryKey = queryOptions.queryKey;
|
|
2290
3450
|
return query;
|
|
2291
3451
|
};
|