@newfold/huapi-js 1.2.8 → 1.2.9
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 +51 -3
- package/dist/index.d.ts +197 -41
- package/dist/index.js +226 -44
- package/dist/index.msw.d.ts +71 -8
- package/dist/index.msw.js +57 -17
- package/dist/models/addonsCodeguardBackupRestore200.d.ts +10 -0
- package/dist/models/addonsCodeguardBackupRestore200.js +9 -0
- package/dist/models/addonsCodeguardBackupRestoreBody.d.ts +17 -0
- package/dist/models/addonsCodeguardBackupRestoreBody.js +9 -0
- package/dist/models/addonsCodeguardBackups200.d.ts +11 -0
- package/dist/models/addonsCodeguardBackups200.js +2 -0
- package/dist/models/addonsCodeguardBackups200BackupsItem.d.ts +13 -0
- package/dist/models/addonsCodeguardBackups200BackupsItem.js +2 -0
- package/dist/models/addonsCodeguardBackups200BackupsItemDatabaseBackupsItem.d.ts +13 -0
- package/dist/models/addonsCodeguardBackups200BackupsItemDatabaseBackupsItem.js +9 -0
- package/dist/models/addonsCodeguardBackupsParams.d.ts +10 -0
- package/dist/models/addonsCodeguardBackupsParams.js +9 -0
- package/dist/models/addonsCodeguardDatabaseBackupCreate200.d.ts +10 -0
- package/dist/models/addonsCodeguardDatabaseBackupCreate200.js +9 -0
- package/dist/models/addonsCodeguardDatabaseBackupCreateBody.d.ts +13 -0
- package/dist/models/addonsCodeguardDatabaseBackupCreateBody.js +9 -0
- package/dist/models/addonsCodeguardDatabaseBackupList200.d.ts +11 -0
- package/dist/models/addonsCodeguardDatabaseBackupList200.js +2 -0
- package/dist/models/addonsCodeguardDatabaseBackupList200BackupsItem.d.ts +11 -0
- package/dist/models/addonsCodeguardDatabaseBackupList200BackupsItem.js +9 -0
- package/dist/models/addonsCodeguardDatabaseBackupListParams.d.ts +11 -0
- package/dist/models/addonsCodeguardDatabaseBackupListParams.js +9 -0
- package/dist/models/addonsCodeguardDatabaseBackupRestore200.d.ts +10 -0
- package/dist/models/addonsCodeguardDatabaseBackupRestore200.js +9 -0
- package/dist/models/addonsCodeguardDatabaseBackupRestoreBody.d.ts +15 -0
- package/dist/models/addonsCodeguardDatabaseBackupRestoreBody.js +9 -0
- package/dist/models/addonsCodeguardDatabaseList200.d.ts +12 -0
- package/dist/models/addonsCodeguardDatabaseList200.js +2 -0
- package/dist/models/addonsCodeguardDatabaseList200DatabasesItem.d.ts +11 -0
- package/dist/models/addonsCodeguardDatabaseList200DatabasesItem.js +2 -0
- package/dist/models/addonsCodeguardDatabaseList200DatabasesItemDatabaseBackup.d.ts +13 -0
- package/dist/models/addonsCodeguardDatabaseList200DatabasesItemDatabaseBackup.js +9 -0
- package/dist/models/addonsCodeguardLoginLinkGenerate200.d.ts +10 -0
- package/dist/models/addonsCodeguardLoginLinkGenerate200.js +9 -0
- package/dist/models/addonsCodeguardWebsiteBackupCreate200.d.ts +10 -0
- package/dist/models/addonsCodeguardWebsiteBackupCreate200.js +9 -0
- package/dist/models/addonsCodeguardWebsiteBackupCreateBody.d.ts +11 -0
- package/dist/models/addonsCodeguardWebsiteBackupCreateBody.js +9 -0
- package/dist/models/addonsCodeguardWebsiteBackupList200.d.ts +11 -0
- package/dist/models/addonsCodeguardWebsiteBackupList200.js +2 -0
- package/dist/models/addonsCodeguardWebsiteBackupList200BackupsItem.d.ts +13 -0
- package/dist/models/addonsCodeguardWebsiteBackupList200BackupsItem.js +9 -0
- package/dist/models/addonsCodeguardWebsiteBackupListParams.d.ts +10 -0
- package/dist/models/addonsCodeguardWebsiteBackupListParams.js +9 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestore200.d.ts +10 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestore200.js +9 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestore400.d.ts +12 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestore400.js +2 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestore400Error.d.ts +10 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestore400Error.js +9 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestoreBody.d.ts +13 -0
- package/dist/models/addonsCodeguardWebsiteBackupRestoreBody.js +9 -0
- package/dist/models/addonsCodeguardWebsiteList200.d.ts +11 -0
- package/dist/models/addonsCodeguardWebsiteList200.js +2 -0
- package/dist/models/addonsCodeguardWebsiteList200WebsiteListItem.d.ts +11 -0
- package/dist/models/addonsCodeguardWebsiteList200WebsiteListItem.js +2 -0
- package/dist/models/addonsCodeguardWebsiteList200WebsiteListItemWebsite.d.ts +12 -0
- package/dist/models/addonsCodeguardWebsiteList200WebsiteListItemWebsite.js +9 -0
- package/dist/models/hostingAddons200.d.ts +11 -0
- package/dist/models/hostingAddons200.js +2 -0
- package/dist/models/hostingAddons200RowsItem.d.ts +13 -0
- package/dist/models/hostingAddons200RowsItem.js +9 -0
- package/dist/models/hostingAddonsParams.d.ts +12 -0
- package/dist/models/hostingAddonsParams.js +9 -0
- package/dist/models/hostingFtpList200.d.ts +11 -0
- package/dist/models/hostingFtpList200.js +2 -0
- package/dist/models/hostingFtpList200FtpAccountItem.d.ts +11 -0
- package/dist/models/hostingFtpList200FtpAccountItem.js +9 -0
- package/dist/models/hostingInfo200.d.ts +2 -2
- package/dist/models/hostingInfo200.js +2 -2
- package/dist/models/hostingSites200.d.ts +2 -2
- package/dist/models/hostingSites200RowsItem.d.ts +2 -2
- package/dist/models/hostingSites200RowsItem.js +2 -2
- package/dist/models/index.d.ts +35 -0
- package/dist/models/index.js +35 -0
- package/dist/models/sitesInfo200.d.ts +20 -0
- package/dist/models/sitesInfo200.js +9 -0
- package/dist/models/sitesSso200.d.ts +2 -2
- package/dist/models/sitesSso200.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useHostingSites = exports.getHostingSitesQueryKey = exports.hostingSites = exports.
|
|
6
|
+
exports.useHostingSites = exports.getHostingSitesQueryKey = exports.hostingSites = exports.useSitesInfo = exports.getSitesInfoQueryKey = exports.sitesInfo = exports.useSitesSso = exports.getSitesSsoQueryKey = exports.sitesSso = exports.useHostingFtpList = exports.getHostingFtpListQueryKey = exports.hostingFtpList = exports.useHostingAddons = exports.getHostingAddonsQueryKey = exports.hostingAddons = exports.useHostingInfo = exports.getHostingInfoQueryKey = exports.hostingInfo = exports.useAddonsCodeguardDatabaseBackupRestore = exports.addonsCodeguardDatabaseBackupRestore = exports.useAddonsCodeguardWebsiteBackupRestore = exports.addonsCodeguardWebsiteBackupRestore = exports.useAddonsCodeguardBackupRestore = exports.addonsCodeguardBackupRestore = exports.useAddonsCodeguardDatabaseBackupList = exports.getAddonsCodeguardDatabaseBackupListQueryKey = exports.addonsCodeguardDatabaseBackupList = exports.useAddonsCodeguardWebsiteBackupList = exports.getAddonsCodeguardWebsiteBackupListQueryKey = exports.addonsCodeguardWebsiteBackupList = exports.useAddonsCodeguardDatabaseList = exports.getAddonsCodeguardDatabaseListQueryKey = exports.addonsCodeguardDatabaseList = exports.useAddonsCodeguardWebsiteBackupCreate = exports.addonsCodeguardWebsiteBackupCreate = exports.useAddonsCodeguardDatabaseBackupCreate = exports.addonsCodeguardDatabaseBackupCreate = exports.useAddonsCodeguardLoginLinkGenerate = exports.getAddonsCodeguardLoginLinkGenerateQueryKey = exports.addonsCodeguardLoginLinkGenerate = exports.useAddonsCodeguardBackups = exports.getAddonsCodeguardBackupsQueryKey = exports.addonsCodeguardBackups = exports.useAddonsCodeguardWebsiteList = exports.getAddonsCodeguardWebsiteListQueryKey = exports.addonsCodeguardWebsiteList = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Generated by orval v6.7.1 🍺
|
|
9
9
|
* Do not edit manually.
|
|
10
10
|
* Hosting UAPI
|
|
11
|
-
* Hosting UAPI
|
|
12
|
-
* OpenAPI spec version: 0.0
|
|
11
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
12
|
+
* OpenAPI spec version: 0.1.0
|
|
13
13
|
*/
|
|
14
14
|
const axios_1 = __importDefault(require("axios"));
|
|
15
15
|
const react_query_1 = require("react-query");
|
|
@@ -17,21 +17,201 @@ const react_query_1 = require("react-query");
|
|
|
17
17
|
* Return all website records CodeGuard maintains for this user's account.
|
|
18
18
|
* @summary addons codeguard website_list
|
|
19
19
|
*/
|
|
20
|
-
const
|
|
20
|
+
const addonsCodeguardWebsiteList = (addonId, options) => {
|
|
21
21
|
return axios_1.default.get(`/v1/addons/codeguard/${addonId}/website_list`, options);
|
|
22
22
|
};
|
|
23
|
-
exports.
|
|
24
|
-
const
|
|
25
|
-
exports.
|
|
26
|
-
const
|
|
23
|
+
exports.addonsCodeguardWebsiteList = addonsCodeguardWebsiteList;
|
|
24
|
+
const getAddonsCodeguardWebsiteListQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/website_list`];
|
|
25
|
+
exports.getAddonsCodeguardWebsiteListQueryKey = getAddonsCodeguardWebsiteListQueryKey;
|
|
26
|
+
const useAddonsCodeguardWebsiteList = (addonId, options) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
29
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getAddonsCodeguardWebsiteListQueryKey)(addonId);
|
|
30
|
+
const queryFn = () => (0, exports.addonsCodeguardWebsiteList)(addonId, axiosOptions);
|
|
31
|
+
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(addonId) }, queryOptions));
|
|
32
|
+
return Object.assign({ queryKey }, query);
|
|
33
|
+
};
|
|
34
|
+
exports.useAddonsCodeguardWebsiteList = useAddonsCodeguardWebsiteList;
|
|
35
|
+
/**
|
|
36
|
+
* Returns a combined backup list with website commit ids and corresponding database commits
|
|
37
|
+
* @summary addons codeguard backups
|
|
38
|
+
*/
|
|
39
|
+
const addonsCodeguardBackups = (addonId, params, options) => {
|
|
40
|
+
return axios_1.default.get(`/v1/addons/codeguard/${addonId}/backups`, Object.assign({ params }, options));
|
|
41
|
+
};
|
|
42
|
+
exports.addonsCodeguardBackups = addonsCodeguardBackups;
|
|
43
|
+
const getAddonsCodeguardBackupsQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/backups`, ...(params ? [params] : [])];
|
|
44
|
+
exports.getAddonsCodeguardBackupsQueryKey = getAddonsCodeguardBackupsQueryKey;
|
|
45
|
+
const useAddonsCodeguardBackups = (addonId, params, options) => {
|
|
46
|
+
var _a;
|
|
47
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
48
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getAddonsCodeguardBackupsQueryKey)(addonId, params);
|
|
49
|
+
const queryFn = () => (0, exports.addonsCodeguardBackups)(addonId, params, axiosOptions);
|
|
50
|
+
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(addonId) }, queryOptions));
|
|
51
|
+
return Object.assign({ queryKey }, query);
|
|
52
|
+
};
|
|
53
|
+
exports.useAddonsCodeguardBackups = useAddonsCodeguardBackups;
|
|
54
|
+
/**
|
|
55
|
+
* Returns an oauth login URL that can be used to access CodeGuard dashboard for a user.
|
|
56
|
+
* @summary addons codeguard login_link_generate
|
|
57
|
+
*/
|
|
58
|
+
const addonsCodeguardLoginLinkGenerate = (addonId, options) => {
|
|
59
|
+
return axios_1.default.get(`/v1/addons/codeguard/${addonId}/login_link_generate`, options);
|
|
60
|
+
};
|
|
61
|
+
exports.addonsCodeguardLoginLinkGenerate = addonsCodeguardLoginLinkGenerate;
|
|
62
|
+
const getAddonsCodeguardLoginLinkGenerateQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/login_link_generate`];
|
|
63
|
+
exports.getAddonsCodeguardLoginLinkGenerateQueryKey = getAddonsCodeguardLoginLinkGenerateQueryKey;
|
|
64
|
+
const useAddonsCodeguardLoginLinkGenerate = (addonId, options) => {
|
|
65
|
+
var _a;
|
|
66
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
67
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getAddonsCodeguardLoginLinkGenerateQueryKey)(addonId);
|
|
68
|
+
const queryFn = () => (0, exports.addonsCodeguardLoginLinkGenerate)(addonId, axiosOptions);
|
|
69
|
+
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(addonId) }, queryOptions));
|
|
70
|
+
return Object.assign({ queryKey }, query);
|
|
71
|
+
};
|
|
72
|
+
exports.useAddonsCodeguardLoginLinkGenerate = useAddonsCodeguardLoginLinkGenerate;
|
|
73
|
+
/**
|
|
74
|
+
* Queue the creation of a database backup.
|
|
75
|
+
* @summary addons codeguard database_backup_create
|
|
76
|
+
*/
|
|
77
|
+
const addonsCodeguardDatabaseBackupCreate = (addonId, addonsCodeguardDatabaseBackupCreateBody, options) => {
|
|
78
|
+
return axios_1.default.post(`/v1/addons/codeguard/${addonId}/database_backup_create`, addonsCodeguardDatabaseBackupCreateBody, options);
|
|
79
|
+
};
|
|
80
|
+
exports.addonsCodeguardDatabaseBackupCreate = addonsCodeguardDatabaseBackupCreate;
|
|
81
|
+
const useAddonsCodeguardDatabaseBackupCreate = (options) => {
|
|
82
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
83
|
+
const mutationFn = (props) => {
|
|
84
|
+
const { addonId, data } = props || {};
|
|
85
|
+
return (0, exports.addonsCodeguardDatabaseBackupCreate)(addonId, data, axiosOptions);
|
|
86
|
+
};
|
|
87
|
+
return (0, react_query_1.useMutation)(mutationFn, mutationOptions);
|
|
88
|
+
};
|
|
89
|
+
exports.useAddonsCodeguardDatabaseBackupCreate = useAddonsCodeguardDatabaseBackupCreate;
|
|
90
|
+
/**
|
|
91
|
+
* Initiate the creation of a new backup for a given website
|
|
92
|
+
* @summary addons codeguard website_backup_create
|
|
93
|
+
*/
|
|
94
|
+
const addonsCodeguardWebsiteBackupCreate = (addonId, addonsCodeguardWebsiteBackupCreateBody, options) => {
|
|
95
|
+
return axios_1.default.post(`/v1/addons/codeguard/${addonId}/website_backup_create`, addonsCodeguardWebsiteBackupCreateBody, options);
|
|
96
|
+
};
|
|
97
|
+
exports.addonsCodeguardWebsiteBackupCreate = addonsCodeguardWebsiteBackupCreate;
|
|
98
|
+
const useAddonsCodeguardWebsiteBackupCreate = (options) => {
|
|
99
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
100
|
+
const mutationFn = (props) => {
|
|
101
|
+
const { addonId, data } = props || {};
|
|
102
|
+
return (0, exports.addonsCodeguardWebsiteBackupCreate)(addonId, data, axiosOptions);
|
|
103
|
+
};
|
|
104
|
+
return (0, react_query_1.useMutation)(mutationFn, mutationOptions);
|
|
105
|
+
};
|
|
106
|
+
exports.useAddonsCodeguardWebsiteBackupCreate = useAddonsCodeguardWebsiteBackupCreate;
|
|
107
|
+
/**
|
|
108
|
+
* Return all database records CodeGuard maintains for this user's account.
|
|
109
|
+
* @summary addons codeguard database_list
|
|
110
|
+
*/
|
|
111
|
+
const addonsCodeguardDatabaseList = (addonId, options) => {
|
|
112
|
+
return axios_1.default.get(`/v1/addons/codeguard/${addonId}/database_list`, options);
|
|
113
|
+
};
|
|
114
|
+
exports.addonsCodeguardDatabaseList = addonsCodeguardDatabaseList;
|
|
115
|
+
const getAddonsCodeguardDatabaseListQueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/database_list`];
|
|
116
|
+
exports.getAddonsCodeguardDatabaseListQueryKey = getAddonsCodeguardDatabaseListQueryKey;
|
|
117
|
+
const useAddonsCodeguardDatabaseList = (addonId, options) => {
|
|
27
118
|
var _a;
|
|
28
119
|
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
29
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.
|
|
30
|
-
const queryFn = () => (0, exports.
|
|
120
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getAddonsCodeguardDatabaseListQueryKey)(addonId);
|
|
121
|
+
const queryFn = () => (0, exports.addonsCodeguardDatabaseList)(addonId, axiosOptions);
|
|
31
122
|
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(addonId) }, queryOptions));
|
|
32
123
|
return Object.assign({ queryKey }, query);
|
|
33
124
|
};
|
|
34
|
-
exports.
|
|
125
|
+
exports.useAddonsCodeguardDatabaseList = useAddonsCodeguardDatabaseList;
|
|
126
|
+
/**
|
|
127
|
+
* Return all website backup records CodeGuard maintains for this user's account.
|
|
128
|
+
* @summary addons codeguard website backup list
|
|
129
|
+
*/
|
|
130
|
+
const addonsCodeguardWebsiteBackupList = (addonId, params, options) => {
|
|
131
|
+
return axios_1.default.get(`/v1/addons/codeguard/${addonId}/website_backup_list`, Object.assign({ params }, options));
|
|
132
|
+
};
|
|
133
|
+
exports.addonsCodeguardWebsiteBackupList = addonsCodeguardWebsiteBackupList;
|
|
134
|
+
const getAddonsCodeguardWebsiteBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/website_backup_list`, ...(params ? [params] : [])];
|
|
135
|
+
exports.getAddonsCodeguardWebsiteBackupListQueryKey = getAddonsCodeguardWebsiteBackupListQueryKey;
|
|
136
|
+
const useAddonsCodeguardWebsiteBackupList = (addonId, params, options) => {
|
|
137
|
+
var _a;
|
|
138
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
139
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getAddonsCodeguardWebsiteBackupListQueryKey)(addonId, params);
|
|
140
|
+
const queryFn = () => (0, exports.addonsCodeguardWebsiteBackupList)(addonId, params, axiosOptions);
|
|
141
|
+
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(addonId) }, queryOptions));
|
|
142
|
+
return Object.assign({ queryKey }, query);
|
|
143
|
+
};
|
|
144
|
+
exports.useAddonsCodeguardWebsiteBackupList = useAddonsCodeguardWebsiteBackupList;
|
|
145
|
+
/**
|
|
146
|
+
* Return all database backup records CodeGuard maintains for this user's account.
|
|
147
|
+
* @summary addons codeguard database backup list
|
|
148
|
+
*/
|
|
149
|
+
const addonsCodeguardDatabaseBackupList = (addonId, params, options) => {
|
|
150
|
+
return axios_1.default.get(`/v1/addons/codeguard/${addonId}/database_backup_list`, Object.assign({ params }, options));
|
|
151
|
+
};
|
|
152
|
+
exports.addonsCodeguardDatabaseBackupList = addonsCodeguardDatabaseBackupList;
|
|
153
|
+
const getAddonsCodeguardDatabaseBackupListQueryKey = (addonId, params) => [`/v1/addons/codeguard/${addonId}/database_backup_list`, ...(params ? [params] : [])];
|
|
154
|
+
exports.getAddonsCodeguardDatabaseBackupListQueryKey = getAddonsCodeguardDatabaseBackupListQueryKey;
|
|
155
|
+
const useAddonsCodeguardDatabaseBackupList = (addonId, params, options) => {
|
|
156
|
+
var _a;
|
|
157
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
158
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getAddonsCodeguardDatabaseBackupListQueryKey)(addonId, params);
|
|
159
|
+
const queryFn = () => (0, exports.addonsCodeguardDatabaseBackupList)(addonId, params, axiosOptions);
|
|
160
|
+
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(addonId) }, queryOptions));
|
|
161
|
+
return Object.assign({ queryKey }, query);
|
|
162
|
+
};
|
|
163
|
+
exports.useAddonsCodeguardDatabaseBackupList = useAddonsCodeguardDatabaseBackupList;
|
|
164
|
+
/**
|
|
165
|
+
* Restores the website backup
|
|
166
|
+
* @summary addons codeguard website backup restore
|
|
167
|
+
*/
|
|
168
|
+
const addonsCodeguardBackupRestore = (addonId, addonsCodeguardBackupRestoreBody, options) => {
|
|
169
|
+
return axios_1.default.post(`/v1/addons/codeguard/${addonId}/backup_restore`, addonsCodeguardBackupRestoreBody, options);
|
|
170
|
+
};
|
|
171
|
+
exports.addonsCodeguardBackupRestore = addonsCodeguardBackupRestore;
|
|
172
|
+
const useAddonsCodeguardBackupRestore = (options) => {
|
|
173
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
174
|
+
const mutationFn = (props) => {
|
|
175
|
+
const { addonId, data } = props || {};
|
|
176
|
+
return (0, exports.addonsCodeguardBackupRestore)(addonId, data, axiosOptions);
|
|
177
|
+
};
|
|
178
|
+
return (0, react_query_1.useMutation)(mutationFn, mutationOptions);
|
|
179
|
+
};
|
|
180
|
+
exports.useAddonsCodeguardBackupRestore = useAddonsCodeguardBackupRestore;
|
|
181
|
+
/**
|
|
182
|
+
* Restores the website backup
|
|
183
|
+
* @summary addons codeguard website backup restore
|
|
184
|
+
*/
|
|
185
|
+
const addonsCodeguardWebsiteBackupRestore = (addonId, addonsCodeguardWebsiteBackupRestoreBody, options) => {
|
|
186
|
+
return axios_1.default.post(`/v1/addons/codeguard/${addonId}/website_backup_restore`, addonsCodeguardWebsiteBackupRestoreBody, options);
|
|
187
|
+
};
|
|
188
|
+
exports.addonsCodeguardWebsiteBackupRestore = addonsCodeguardWebsiteBackupRestore;
|
|
189
|
+
const useAddonsCodeguardWebsiteBackupRestore = (options) => {
|
|
190
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
191
|
+
const mutationFn = (props) => {
|
|
192
|
+
const { addonId, data } = props || {};
|
|
193
|
+
return (0, exports.addonsCodeguardWebsiteBackupRestore)(addonId, data, axiosOptions);
|
|
194
|
+
};
|
|
195
|
+
return (0, react_query_1.useMutation)(mutationFn, mutationOptions);
|
|
196
|
+
};
|
|
197
|
+
exports.useAddonsCodeguardWebsiteBackupRestore = useAddonsCodeguardWebsiteBackupRestore;
|
|
198
|
+
/**
|
|
199
|
+
* Restores the database backup
|
|
200
|
+
* @summary addons codeguard database backup restore
|
|
201
|
+
*/
|
|
202
|
+
const addonsCodeguardDatabaseBackupRestore = (addonId, addonsCodeguardDatabaseBackupRestoreBody, options) => {
|
|
203
|
+
return axios_1.default.post(`/v1/addons/codeguard/${addonId}/database_backup_restore`, addonsCodeguardDatabaseBackupRestoreBody, options);
|
|
204
|
+
};
|
|
205
|
+
exports.addonsCodeguardDatabaseBackupRestore = addonsCodeguardDatabaseBackupRestore;
|
|
206
|
+
const useAddonsCodeguardDatabaseBackupRestore = (options) => {
|
|
207
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options || {};
|
|
208
|
+
const mutationFn = (props) => {
|
|
209
|
+
const { addonId, data } = props || {};
|
|
210
|
+
return (0, exports.addonsCodeguardDatabaseBackupRestore)(addonId, data, axiosOptions);
|
|
211
|
+
};
|
|
212
|
+
return (0, react_query_1.useMutation)(mutationFn, mutationOptions);
|
|
213
|
+
};
|
|
214
|
+
exports.useAddonsCodeguardDatabaseBackupRestore = useAddonsCodeguardDatabaseBackupRestore;
|
|
35
215
|
/**
|
|
36
216
|
* Return info about a specific account
|
|
37
217
|
* @summary hosting info
|
|
@@ -52,41 +232,43 @@ const useHostingInfo = (hostingId, options) => {
|
|
|
52
232
|
};
|
|
53
233
|
exports.useHostingInfo = useHostingInfo;
|
|
54
234
|
/**
|
|
55
|
-
*
|
|
56
|
-
* @summary
|
|
235
|
+
* Obtain a list of addons.
|
|
236
|
+
* @summary hosting addons
|
|
57
237
|
*/
|
|
58
|
-
const
|
|
59
|
-
return axios_1.default.get(`/v1/hosting/${hostingId}/
|
|
238
|
+
const hostingAddons = (hostingId, params, options) => {
|
|
239
|
+
return axios_1.default.get(`/v1/hosting/${hostingId}/addons`, Object.assign({ params }, options));
|
|
60
240
|
};
|
|
61
|
-
exports.
|
|
62
|
-
const
|
|
63
|
-
exports.
|
|
64
|
-
const
|
|
241
|
+
exports.hostingAddons = hostingAddons;
|
|
242
|
+
const getHostingAddonsQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/addons`, ...(params ? [params] : [])];
|
|
243
|
+
exports.getHostingAddonsQueryKey = getHostingAddonsQueryKey;
|
|
244
|
+
const useHostingAddons = (hostingId, params, options) => {
|
|
65
245
|
var _a;
|
|
66
246
|
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
67
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.
|
|
68
|
-
const queryFn = () => (0, exports.
|
|
247
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getHostingAddonsQueryKey)(hostingId, params);
|
|
248
|
+
const queryFn = () => (0, exports.hostingAddons)(hostingId, params, axiosOptions);
|
|
69
249
|
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(hostingId) }, queryOptions));
|
|
70
250
|
return Object.assign({ queryKey }, query);
|
|
71
251
|
};
|
|
72
|
-
exports.
|
|
252
|
+
exports.useHostingAddons = useHostingAddons;
|
|
73
253
|
/**
|
|
74
|
-
*
|
|
75
|
-
* @summary
|
|
254
|
+
* List FTP accounts.
|
|
255
|
+
* @summary hosting ftp list
|
|
76
256
|
*/
|
|
77
|
-
const
|
|
78
|
-
return axios_1.default.
|
|
257
|
+
const hostingFtpList = (hostingId, options) => {
|
|
258
|
+
return axios_1.default.get(`/v1/hosting/${hostingId}/ftp/list`, options);
|
|
79
259
|
};
|
|
80
|
-
exports.
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
260
|
+
exports.hostingFtpList = hostingFtpList;
|
|
261
|
+
const getHostingFtpListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ftp/list`];
|
|
262
|
+
exports.getHostingFtpListQueryKey = getHostingFtpListQueryKey;
|
|
263
|
+
const useHostingFtpList = (hostingId, options) => {
|
|
264
|
+
var _a;
|
|
265
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
266
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getHostingFtpListQueryKey)(hostingId);
|
|
267
|
+
const queryFn = () => (0, exports.hostingFtpList)(hostingId, axiosOptions);
|
|
268
|
+
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(hostingId) }, queryOptions));
|
|
269
|
+
return Object.assign({ queryKey }, query);
|
|
88
270
|
};
|
|
89
|
-
exports.
|
|
271
|
+
exports.useHostingFtpList = useHostingFtpList;
|
|
90
272
|
/**
|
|
91
273
|
* Return an SSO token or login URL for this site (if supported).
|
|
92
274
|
* @summary sites sso
|
|
@@ -108,23 +290,23 @@ const useSitesSso = (siteId, options) => {
|
|
|
108
290
|
exports.useSitesSso = useSitesSso;
|
|
109
291
|
/**
|
|
110
292
|
* Return info about a specific site
|
|
111
|
-
* @summary
|
|
293
|
+
* @summary sites info
|
|
112
294
|
*/
|
|
113
|
-
const
|
|
295
|
+
const sitesInfo = (siteId, options) => {
|
|
114
296
|
return axios_1.default.get(`/v1/sites/${siteId}/info`, options);
|
|
115
297
|
};
|
|
116
|
-
exports.
|
|
117
|
-
const
|
|
118
|
-
exports.
|
|
119
|
-
const
|
|
298
|
+
exports.sitesInfo = sitesInfo;
|
|
299
|
+
const getSitesInfoQueryKey = (siteId) => [`/v1/sites/${siteId}/info`];
|
|
300
|
+
exports.getSitesInfoQueryKey = getSitesInfoQueryKey;
|
|
301
|
+
const useSitesInfo = (siteId, options) => {
|
|
120
302
|
var _a;
|
|
121
303
|
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
122
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.
|
|
123
|
-
const queryFn = () => (0, exports.
|
|
304
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getSitesInfoQueryKey)(siteId);
|
|
305
|
+
const queryFn = () => (0, exports.sitesInfo)(siteId, axiosOptions);
|
|
124
306
|
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(siteId) }, queryOptions));
|
|
125
307
|
return Object.assign({ queryKey }, query);
|
|
126
308
|
};
|
|
127
|
-
exports.
|
|
309
|
+
exports.useSitesInfo = useSitesInfo;
|
|
128
310
|
/**
|
|
129
311
|
* Obtain a list of sites.
|
|
130
312
|
* @summary hosting sites
|
package/dist/index.msw.d.ts
CHANGED
|
@@ -1,36 +1,99 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const getAddonsCodeguardWebsiteListMock: () => {
|
|
2
2
|
website_list: {
|
|
3
3
|
website: {
|
|
4
|
+
id: number | undefined;
|
|
5
|
+
activated: boolean | undefined;
|
|
4
6
|
url: string | undefined;
|
|
5
7
|
} | undefined;
|
|
6
8
|
}[] | undefined;
|
|
7
9
|
};
|
|
10
|
+
export declare const getAddonsCodeguardBackupsMock: () => {
|
|
11
|
+
backups: {
|
|
12
|
+
website_commit_id: string | undefined;
|
|
13
|
+
event_time: string | undefined;
|
|
14
|
+
database_backups: {
|
|
15
|
+
id: number | undefined;
|
|
16
|
+
commit_id: string | undefined;
|
|
17
|
+
event_time: string | undefined;
|
|
18
|
+
recommended: string | undefined;
|
|
19
|
+
}[] | undefined;
|
|
20
|
+
}[] | undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare const getAddonsCodeguardLoginLinkGenerateMock: () => {
|
|
23
|
+
link: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const getAddonsCodeguardDatabaseBackupCreateMock: () => {
|
|
26
|
+
status: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare const getAddonsCodeguardWebsiteBackupCreateMock: () => {
|
|
29
|
+
status: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare const getAddonsCodeguardDatabaseListMock: () => {
|
|
32
|
+
status: number | undefined;
|
|
33
|
+
databases: {
|
|
34
|
+
database_backup: {
|
|
35
|
+
id: number | undefined;
|
|
36
|
+
account: string | undefined;
|
|
37
|
+
website_id: number | undefined;
|
|
38
|
+
commit_id: string | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
}[] | undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare const getAddonsCodeguardWebsiteBackupListMock: () => {
|
|
43
|
+
backups: {
|
|
44
|
+
commit_id: string | undefined;
|
|
45
|
+
event_time: string | undefined;
|
|
46
|
+
modifications: number | undefined;
|
|
47
|
+
new_content: boolean | undefined;
|
|
48
|
+
}[] | undefined;
|
|
49
|
+
};
|
|
50
|
+
export declare const getAddonsCodeguardDatabaseBackupListMock: () => {
|
|
51
|
+
backups: {
|
|
52
|
+
commit_id: string | undefined;
|
|
53
|
+
event_time: string | undefined;
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
};
|
|
56
|
+
export declare const getAddonsCodeguardBackupRestoreMock: () => {
|
|
57
|
+
status: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
export declare const getAddonsCodeguardWebsiteBackupRestoreMock: () => {
|
|
60
|
+
status: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
export declare const getAddonsCodeguardDatabaseBackupRestoreMock: () => {
|
|
63
|
+
status: string | undefined;
|
|
64
|
+
};
|
|
8
65
|
export declare const getHostingInfoMock: () => {
|
|
9
66
|
id: string;
|
|
10
67
|
};
|
|
11
|
-
export declare const
|
|
68
|
+
export declare const getHostingAddonsMock: () => {
|
|
69
|
+
rows: {
|
|
70
|
+
id: string | undefined;
|
|
71
|
+
type: string | undefined;
|
|
72
|
+
subtype: string | undefined;
|
|
73
|
+
status: string | undefined;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
};
|
|
76
|
+
export declare const getHostingFtpListMock: () => {
|
|
12
77
|
ftp_account: {
|
|
13
78
|
user: string | undefined;
|
|
14
79
|
homedir: string | undefined;
|
|
15
80
|
}[] | undefined;
|
|
16
81
|
};
|
|
17
|
-
export declare const getPostHostingFtpV1Mock: () => {
|
|
18
|
-
user: string | undefined;
|
|
19
|
-
pass: string | undefined;
|
|
20
|
-
};
|
|
21
82
|
export declare const getSitesSsoMock: () => {
|
|
22
83
|
sso: string | undefined;
|
|
23
84
|
};
|
|
24
|
-
export declare const
|
|
85
|
+
export declare const getSitesInfoMock: () => {
|
|
86
|
+
id: string;
|
|
25
87
|
docroot: string;
|
|
26
88
|
uuid: string;
|
|
27
89
|
date_added: string;
|
|
28
90
|
date_modified: string;
|
|
91
|
+
name: string;
|
|
29
92
|
type: string;
|
|
30
93
|
subtype: string;
|
|
31
94
|
status: string;
|
|
32
95
|
url: string;
|
|
33
|
-
|
|
96
|
+
version: string;
|
|
34
97
|
};
|
|
35
98
|
export declare const getHostingSitesMock: () => {
|
|
36
99
|
rows: {
|
package/dist/index.msw.js
CHANGED
|
@@ -1,42 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHostingUAPIMSW = exports.getHostingSitesMock = exports.
|
|
3
|
+
exports.getHostingUAPIMSW = exports.getHostingSitesMock = exports.getSitesInfoMock = exports.getSitesSsoMock = exports.getHostingFtpListMock = exports.getHostingAddonsMock = exports.getHostingInfoMock = exports.getAddonsCodeguardDatabaseBackupRestoreMock = exports.getAddonsCodeguardWebsiteBackupRestoreMock = exports.getAddonsCodeguardBackupRestoreMock = exports.getAddonsCodeguardDatabaseBackupListMock = exports.getAddonsCodeguardWebsiteBackupListMock = exports.getAddonsCodeguardDatabaseListMock = exports.getAddonsCodeguardWebsiteBackupCreateMock = exports.getAddonsCodeguardDatabaseBackupCreateMock = exports.getAddonsCodeguardLoginLinkGenerateMock = exports.getAddonsCodeguardBackupsMock = exports.getAddonsCodeguardWebsiteListMock = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Generated by orval v6.7.1 🍺
|
|
6
6
|
* Do not edit manually.
|
|
7
7
|
* Hosting UAPI
|
|
8
|
-
* Hosting UAPI
|
|
9
|
-
* OpenAPI spec version: 0.0
|
|
8
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
9
|
+
* OpenAPI spec version: 0.1.0
|
|
10
10
|
*/
|
|
11
11
|
const msw_1 = require("msw");
|
|
12
12
|
const faker_1 = require("@faker-js/faker");
|
|
13
|
-
const
|
|
14
|
-
exports.
|
|
13
|
+
const getAddonsCodeguardWebsiteListMock = () => ({ website_list: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ website: faker_1.faker.helpers.randomize([{ id: faker_1.faker.helpers.randomize([faker_1.faker.datatype.number(), undefined]), activated: faker_1.faker.helpers.randomize([faker_1.faker.datatype.boolean(), undefined]), url: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) }, undefined]) })), undefined]) });
|
|
14
|
+
exports.getAddonsCodeguardWebsiteListMock = getAddonsCodeguardWebsiteListMock;
|
|
15
|
+
const getAddonsCodeguardBackupsMock = () => ({ backups: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ website_commit_id: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), event_time: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), database_backups: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ id: faker_1.faker.helpers.randomize([faker_1.faker.datatype.number(), undefined]), commit_id: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), event_time: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), recommended: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) })), undefined]) })), undefined]) });
|
|
16
|
+
exports.getAddonsCodeguardBackupsMock = getAddonsCodeguardBackupsMock;
|
|
17
|
+
const getAddonsCodeguardLoginLinkGenerateMock = () => ({ link: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
18
|
+
exports.getAddonsCodeguardLoginLinkGenerateMock = getAddonsCodeguardLoginLinkGenerateMock;
|
|
19
|
+
const getAddonsCodeguardDatabaseBackupCreateMock = () => ({ status: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
20
|
+
exports.getAddonsCodeguardDatabaseBackupCreateMock = getAddonsCodeguardDatabaseBackupCreateMock;
|
|
21
|
+
const getAddonsCodeguardWebsiteBackupCreateMock = () => ({ status: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
22
|
+
exports.getAddonsCodeguardWebsiteBackupCreateMock = getAddonsCodeguardWebsiteBackupCreateMock;
|
|
23
|
+
const getAddonsCodeguardDatabaseListMock = () => ({ status: faker_1.faker.helpers.randomize([faker_1.faker.datatype.number(), undefined]), databases: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ database_backup: faker_1.faker.helpers.randomize([{ id: faker_1.faker.helpers.randomize([faker_1.faker.datatype.number(), undefined]), account: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), website_id: faker_1.faker.helpers.randomize([faker_1.faker.datatype.number(), undefined]), commit_id: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) }, undefined]) })), undefined]) });
|
|
24
|
+
exports.getAddonsCodeguardDatabaseListMock = getAddonsCodeguardDatabaseListMock;
|
|
25
|
+
const getAddonsCodeguardWebsiteBackupListMock = () => ({ backups: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ commit_id: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), event_time: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), modifications: faker_1.faker.helpers.randomize([faker_1.faker.datatype.number(), undefined]), new_content: faker_1.faker.helpers.randomize([faker_1.faker.datatype.boolean(), undefined]) })), undefined]) });
|
|
26
|
+
exports.getAddonsCodeguardWebsiteBackupListMock = getAddonsCodeguardWebsiteBackupListMock;
|
|
27
|
+
const getAddonsCodeguardDatabaseBackupListMock = () => ({ backups: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ commit_id: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), event_time: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) })), undefined]) });
|
|
28
|
+
exports.getAddonsCodeguardDatabaseBackupListMock = getAddonsCodeguardDatabaseBackupListMock;
|
|
29
|
+
const getAddonsCodeguardBackupRestoreMock = () => ({ status: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
30
|
+
exports.getAddonsCodeguardBackupRestoreMock = getAddonsCodeguardBackupRestoreMock;
|
|
31
|
+
const getAddonsCodeguardWebsiteBackupRestoreMock = () => ({ status: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
32
|
+
exports.getAddonsCodeguardWebsiteBackupRestoreMock = getAddonsCodeguardWebsiteBackupRestoreMock;
|
|
33
|
+
const getAddonsCodeguardDatabaseBackupRestoreMock = () => ({ status: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
34
|
+
exports.getAddonsCodeguardDatabaseBackupRestoreMock = getAddonsCodeguardDatabaseBackupRestoreMock;
|
|
15
35
|
const getHostingInfoMock = () => ({ id: faker_1.faker.random.word() });
|
|
16
36
|
exports.getHostingInfoMock = getHostingInfoMock;
|
|
17
|
-
const
|
|
18
|
-
exports.
|
|
19
|
-
const
|
|
20
|
-
exports.
|
|
37
|
+
const getHostingAddonsMock = () => ({ rows: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ id: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), type: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), subtype: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), status: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) })), undefined]) });
|
|
38
|
+
exports.getHostingAddonsMock = getHostingAddonsMock;
|
|
39
|
+
const getHostingFtpListMock = () => ({ ftp_account: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ user: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), homedir: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) })), undefined]) });
|
|
40
|
+
exports.getHostingFtpListMock = getHostingFtpListMock;
|
|
21
41
|
const getSitesSsoMock = () => ({ sso: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
22
42
|
exports.getSitesSsoMock = getSitesSsoMock;
|
|
23
|
-
const
|
|
24
|
-
exports.
|
|
43
|
+
const getSitesInfoMock = () => ({ id: faker_1.faker.random.word(), docroot: faker_1.faker.random.word(), uuid: faker_1.faker.random.word(), date_added: faker_1.faker.random.word(), date_modified: faker_1.faker.random.word(), name: faker_1.faker.random.word(), type: faker_1.faker.random.word(), subtype: faker_1.faker.random.word(), status: faker_1.faker.random.word(), url: faker_1.faker.random.word(), version: faker_1.faker.random.word() });
|
|
44
|
+
exports.getSitesInfoMock = getSitesInfoMock;
|
|
25
45
|
const getHostingSitesMock = () => ({ rows: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ id: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), name: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), url: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) })), undefined]) });
|
|
26
46
|
exports.getHostingSitesMock = getHostingSitesMock;
|
|
27
47
|
const getHostingUAPIMSW = () => [
|
|
28
48
|
msw_1.rest.get('*/v1/addons/codeguard/:addonid/website_list', (_req, res, ctx) => {
|
|
29
|
-
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.
|
|
49
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardWebsiteListMock)()));
|
|
50
|
+
}), msw_1.rest.get('*/v1/addons/codeguard/:addonid/backups', (_req, res, ctx) => {
|
|
51
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardBackupsMock)()));
|
|
52
|
+
}), msw_1.rest.get('*/v1/addons/codeguard/:addonid/login_link_generate', (_req, res, ctx) => {
|
|
53
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardLoginLinkGenerateMock)()));
|
|
54
|
+
}), msw_1.rest.post('*/v1/addons/codeguard/:addonid/database_backup_create', (_req, res, ctx) => {
|
|
55
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardDatabaseBackupCreateMock)()));
|
|
56
|
+
}), msw_1.rest.post('*/v1/addons/codeguard/:addonid/website_backup_create', (_req, res, ctx) => {
|
|
57
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardWebsiteBackupCreateMock)()));
|
|
58
|
+
}), msw_1.rest.get('*/v1/addons/codeguard/:addonid/database_list', (_req, res, ctx) => {
|
|
59
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardDatabaseListMock)()));
|
|
60
|
+
}), msw_1.rest.get('*/v1/addons/codeguard/:addonid/website_backup_list', (_req, res, ctx) => {
|
|
61
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardWebsiteBackupListMock)()));
|
|
62
|
+
}), msw_1.rest.get('*/v1/addons/codeguard/:addonid/database_backup_list', (_req, res, ctx) => {
|
|
63
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardDatabaseBackupListMock)()));
|
|
64
|
+
}), msw_1.rest.post('*/v1/addons/codeguard/:addonid/backup_restore', (_req, res, ctx) => {
|
|
65
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardBackupRestoreMock)()));
|
|
66
|
+
}), msw_1.rest.post('*/v1/addons/codeguard/:addonid/website_backup_restore', (_req, res, ctx) => {
|
|
67
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardWebsiteBackupRestoreMock)()));
|
|
68
|
+
}), msw_1.rest.post('*/v1/addons/codeguard/:addonid/database_backup_restore', (_req, res, ctx) => {
|
|
69
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getAddonsCodeguardDatabaseBackupRestoreMock)()));
|
|
30
70
|
}), msw_1.rest.get('*/v1/hosting/:hostingid/info', (_req, res, ctx) => {
|
|
31
71
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getHostingInfoMock)()));
|
|
32
|
-
}), msw_1.rest.get('*/v1/hosting/:hostingid/
|
|
33
|
-
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.
|
|
34
|
-
}), msw_1.rest.
|
|
35
|
-
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.
|
|
72
|
+
}), msw_1.rest.get('*/v1/hosting/:hostingid/addons', (_req, res, ctx) => {
|
|
73
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getHostingAddonsMock)()));
|
|
74
|
+
}), msw_1.rest.get('*/v1/hosting/:hostingid/ftp/list', (_req, res, ctx) => {
|
|
75
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getHostingFtpListMock)()));
|
|
36
76
|
}), msw_1.rest.get('*/v1/sites/:siteid/sso', (_req, res, ctx) => {
|
|
37
77
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getSitesSsoMock)()));
|
|
38
78
|
}), msw_1.rest.get('*/v1/sites/:siteid/info', (_req, res, ctx) => {
|
|
39
|
-
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.
|
|
79
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getSitesInfoMock)()));
|
|
40
80
|
}), msw_1.rest.get('*/v1/hosting/:hostingid/sites', (_req, res, ctx) => {
|
|
41
81
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getHostingSitesMock)()));
|
|
42
82
|
}),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
export declare type AddonsCodeguardBackupRestore200 = {
|
|
9
|
+
status?: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by orval v6.7.1 🍺
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
7
|
+
* OpenAPI spec version: 0.1.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
export declare type AddonsCodeguardBackupRestoreBody = {
|
|
9
|
+
/** The id of the website the given database is associated with. */
|
|
10
|
+
website_id?: number;
|
|
11
|
+
/** The commit id to restore the website from. */
|
|
12
|
+
website_commit_id?: string;
|
|
13
|
+
/** The id of the database the given database is associated with. */
|
|
14
|
+
database_id?: number;
|
|
15
|
+
/** The commit id to restore the database from. */
|
|
16
|
+
database_commit_id?: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by orval v6.7.1 🍺
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
7
|
+
* OpenAPI spec version: 0.1.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { AddonsCodeguardBackups200BackupsItem } from './addonsCodeguardBackups200BackupsItem';
|
|
9
|
+
export declare type AddonsCodeguardBackups200 = {
|
|
10
|
+
backups?: AddonsCodeguardBackups200BackupsItem[];
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { AddonsCodeguardBackups200BackupsItemDatabaseBackupsItem } from './addonsCodeguardBackups200BackupsItemDatabaseBackupsItem';
|
|
9
|
+
export declare type AddonsCodeguardBackups200BackupsItem = {
|
|
10
|
+
website_commit_id?: string;
|
|
11
|
+
event_time?: string;
|
|
12
|
+
database_backups?: AddonsCodeguardBackups200BackupsItemDatabaseBackupsItem[];
|
|
13
|
+
};
|