@newfold/huapi-js 1.2.8-alpha → 1.2.8-alpha.1
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/dist/index.d.ts +38 -22
- package/dist/index.js +49 -28
- package/dist/index.msw.d.ts +14 -3
- package/dist/index.msw.js +16 -10
- package/dist/models/getAddonsCodeguardWebsiteListV1200.d.ts +2 -0
- package/dist/models/getAddonsCodeguardWebsiteListV1200WebsiteListItem.d.ts +2 -0
- package/dist/models/getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite.d.ts +2 -0
- package/dist/models/getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite.js +2 -0
- package/dist/models/getHostingFtpV1200.d.ts +2 -0
- package/dist/models/getHostingFtpV1200FtpAccountItem.d.ts +2 -0
- package/dist/models/getHostingFtpV1200FtpAccountItem.js +2 -0
- package/dist/models/getSitesInfoV1200.d.ts +18 -0
- package/dist/models/getSitesInfoV1200.js +9 -0
- package/dist/models/hostingInfo200.d.ts +10 -0
- package/dist/models/hostingInfo200.js +9 -0
- package/dist/models/hostingSites200.d.ts +11 -0
- package/dist/models/hostingSites200.js +2 -0
- package/dist/models/hostingSites200RowsItem.d.ts +12 -0
- package/dist/models/hostingSites200RowsItem.js +9 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/dist/models/postHostingFtpV1200.d.ts +2 -0
- package/dist/models/postHostingFtpV1200.js +2 -0
- package/dist/models/postHostingFtpV1Body.d.ts +2 -0
- package/dist/models/postHostingFtpV1Body.js +2 -0
- package/dist/models/sitesSso200.d.ts +10 -0
- package/dist/models/sitesSso200.js +9 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* OpenAPI spec version: 0.0.1
|
|
5
7
|
*/
|
|
6
8
|
import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
7
9
|
import { UseQueryOptions, UseMutationOptions, UseQueryResult, QueryKey } from 'react-query';
|
|
8
|
-
import type { GetAddonsCodeguardWebsiteListV1200,
|
|
10
|
+
import type { GetAddonsCodeguardWebsiteListV1200, HostingInfo200, GetHostingFtpV1200, PostHostingFtpV1200, PostHostingFtpV1Body, SitesSso200, GetSitesInfoV1200, HostingSites200 } from './models';
|
|
9
11
|
declare type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
|
|
10
12
|
/**
|
|
11
13
|
* Return all website records CodeGuard maintains for this user's account.
|
|
@@ -23,14 +25,14 @@ export declare const useGetAddonsCodeguardWebsiteListV1: <TData = AxiosResponse<
|
|
|
23
25
|
};
|
|
24
26
|
/**
|
|
25
27
|
* Return info about a specific account
|
|
26
|
-
* @summary
|
|
28
|
+
* @summary hosting info
|
|
27
29
|
*/
|
|
28
|
-
export declare const
|
|
29
|
-
export declare const
|
|
30
|
-
export declare type
|
|
31
|
-
export declare type
|
|
32
|
-
export declare const
|
|
33
|
-
query?: UseQueryOptions<AxiosResponse<
|
|
30
|
+
export declare const hostingInfo: (hostingId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<HostingInfo200>>;
|
|
31
|
+
export declare const getHostingInfoQueryKey: (hostingId: number) => string[];
|
|
32
|
+
export declare type HostingInfoQueryResult = NonNullable<AsyncReturnType<typeof hostingInfo>>;
|
|
33
|
+
export declare type HostingInfoQueryError = AxiosError<unknown>;
|
|
34
|
+
export declare const useHostingInfo: <TData = AxiosResponse<HostingInfo200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
|
|
35
|
+
query?: UseQueryOptions<AxiosResponse<HostingInfo200, any>, TError, TData, QueryKey> | undefined;
|
|
34
36
|
axios?: AxiosRequestConfig<any> | undefined;
|
|
35
37
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
36
38
|
queryKey: QueryKey;
|
|
@@ -69,28 +71,42 @@ export declare const usePostHostingFtpV1: <TError = AxiosError<unknown, any>, TC
|
|
|
69
71
|
}, TContext>;
|
|
70
72
|
/**
|
|
71
73
|
* Return an SSO token or login URL for this site (if supported).
|
|
72
|
-
* @summary
|
|
74
|
+
* @summary sites sso
|
|
75
|
+
*/
|
|
76
|
+
export declare const sitesSso: (siteId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<SitesSso200>>;
|
|
77
|
+
export declare const getSitesSsoQueryKey: (siteId: number) => string[];
|
|
78
|
+
export declare type SitesSsoQueryResult = NonNullable<AsyncReturnType<typeof sitesSso>>;
|
|
79
|
+
export declare type SitesSsoQueryError = AxiosError<unknown>;
|
|
80
|
+
export declare const useSitesSso: <TData = AxiosResponse<SitesSso200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
|
|
81
|
+
query?: UseQueryOptions<AxiosResponse<SitesSso200, any>, TError, TData, QueryKey> | undefined;
|
|
82
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
83
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
84
|
+
queryKey: QueryKey;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Return info about a specific site
|
|
88
|
+
* @summary sites info
|
|
73
89
|
*/
|
|
74
|
-
export declare const
|
|
75
|
-
export declare const
|
|
76
|
-
export declare type
|
|
77
|
-
export declare type
|
|
78
|
-
export declare const
|
|
79
|
-
query?: UseQueryOptions<AxiosResponse<
|
|
90
|
+
export declare const getSitesInfoV1: (siteId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<GetSitesInfoV1200>>;
|
|
91
|
+
export declare const getGetSitesInfoV1QueryKey: (siteId: number) => string[];
|
|
92
|
+
export declare type GetSitesInfoV1QueryResult = NonNullable<AsyncReturnType<typeof getSitesInfoV1>>;
|
|
93
|
+
export declare type GetSitesInfoV1QueryError = AxiosError<unknown>;
|
|
94
|
+
export declare const useGetSitesInfoV1: <TData = AxiosResponse<GetSitesInfoV1200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
|
|
95
|
+
query?: UseQueryOptions<AxiosResponse<GetSitesInfoV1200, any>, TError, TData, QueryKey> | undefined;
|
|
80
96
|
axios?: AxiosRequestConfig<any> | undefined;
|
|
81
97
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
82
98
|
queryKey: QueryKey;
|
|
83
99
|
};
|
|
84
100
|
/**
|
|
85
101
|
* Obtain a list of sites.
|
|
86
|
-
* @summary
|
|
102
|
+
* @summary hosting sites
|
|
87
103
|
*/
|
|
88
|
-
export declare const
|
|
89
|
-
export declare const
|
|
90
|
-
export declare type
|
|
91
|
-
export declare type
|
|
92
|
-
export declare const
|
|
93
|
-
query?: UseQueryOptions<AxiosResponse<
|
|
104
|
+
export declare const hostingSites: (hostingId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<HostingSites200>>;
|
|
105
|
+
export declare const getHostingSitesQueryKey: (hostingId: number) => string[];
|
|
106
|
+
export declare type HostingSitesQueryResult = NonNullable<AsyncReturnType<typeof hostingSites>>;
|
|
107
|
+
export declare type HostingSitesQueryError = AxiosError<unknown>;
|
|
108
|
+
export declare const useHostingSites: <TData = AxiosResponse<HostingSites200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
|
|
109
|
+
query?: UseQueryOptions<AxiosResponse<HostingSites200, any>, TError, TData, QueryKey> | undefined;
|
|
94
110
|
axios?: AxiosRequestConfig<any> | undefined;
|
|
95
111
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
96
112
|
queryKey: QueryKey;
|
package/dist/index.js
CHANGED
|
@@ -3,11 +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.
|
|
6
|
+
exports.useHostingSites = exports.getHostingSitesQueryKey = exports.hostingSites = exports.useGetSitesInfoV1 = exports.getGetSitesInfoV1QueryKey = exports.getSitesInfoV1 = exports.useSitesSso = exports.getSitesSsoQueryKey = exports.sitesSso = exports.usePostHostingFtpV1 = exports.postHostingFtpV1 = exports.useGetHostingFtpV1 = exports.getGetHostingFtpV1QueryKey = exports.getHostingFtpV1 = exports.useHostingInfo = exports.getHostingInfoQueryKey = exports.hostingInfo = exports.useGetAddonsCodeguardWebsiteListV1 = exports.getGetAddonsCodeguardWebsiteListV1QueryKey = exports.getAddonsCodeguardWebsiteListV1 = 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.1
|
|
11
13
|
*/
|
|
12
14
|
const axios_1 = __importDefault(require("axios"));
|
|
13
15
|
const react_query_1 = require("react-query");
|
|
@@ -32,23 +34,23 @@ const useGetAddonsCodeguardWebsiteListV1 = (addonId, options) => {
|
|
|
32
34
|
exports.useGetAddonsCodeguardWebsiteListV1 = useGetAddonsCodeguardWebsiteListV1;
|
|
33
35
|
/**
|
|
34
36
|
* Return info about a specific account
|
|
35
|
-
* @summary
|
|
37
|
+
* @summary hosting info
|
|
36
38
|
*/
|
|
37
|
-
const
|
|
39
|
+
const hostingInfo = (hostingId, options) => {
|
|
38
40
|
return axios_1.default.get(`/v1/hosting/${hostingId}/info`, options);
|
|
39
41
|
};
|
|
40
|
-
exports.
|
|
41
|
-
const
|
|
42
|
-
exports.
|
|
43
|
-
const
|
|
42
|
+
exports.hostingInfo = hostingInfo;
|
|
43
|
+
const getHostingInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info`];
|
|
44
|
+
exports.getHostingInfoQueryKey = getHostingInfoQueryKey;
|
|
45
|
+
const useHostingInfo = (hostingId, options) => {
|
|
44
46
|
var _a;
|
|
45
47
|
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
46
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.
|
|
47
|
-
const queryFn = () => (0, exports.
|
|
48
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getHostingInfoQueryKey)(hostingId);
|
|
49
|
+
const queryFn = () => (0, exports.hostingInfo)(hostingId, axiosOptions);
|
|
48
50
|
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(hostingId) }, queryOptions));
|
|
49
51
|
return Object.assign({ queryKey }, query);
|
|
50
52
|
};
|
|
51
|
-
exports.
|
|
53
|
+
exports.useHostingInfo = useHostingInfo;
|
|
52
54
|
/**
|
|
53
55
|
* List FTP accounts.
|
|
54
56
|
* @summary hosting ftp
|
|
@@ -87,39 +89,58 @@ const usePostHostingFtpV1 = (options) => {
|
|
|
87
89
|
exports.usePostHostingFtpV1 = usePostHostingFtpV1;
|
|
88
90
|
/**
|
|
89
91
|
* Return an SSO token or login URL for this site (if supported).
|
|
90
|
-
* @summary
|
|
92
|
+
* @summary sites sso
|
|
91
93
|
*/
|
|
92
|
-
const
|
|
94
|
+
const sitesSso = (siteId, options) => {
|
|
93
95
|
return axios_1.default.get(`/v1/sites/${siteId}/sso`, options);
|
|
94
96
|
};
|
|
95
|
-
exports.
|
|
96
|
-
const
|
|
97
|
-
exports.
|
|
98
|
-
const
|
|
97
|
+
exports.sitesSso = sitesSso;
|
|
98
|
+
const getSitesSsoQueryKey = (siteId) => [`/v1/sites/${siteId}/sso`];
|
|
99
|
+
exports.getSitesSsoQueryKey = getSitesSsoQueryKey;
|
|
100
|
+
const useSitesSso = (siteId, options) => {
|
|
101
|
+
var _a;
|
|
102
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
103
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getSitesSsoQueryKey)(siteId);
|
|
104
|
+
const queryFn = () => (0, exports.sitesSso)(siteId, axiosOptions);
|
|
105
|
+
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(siteId) }, queryOptions));
|
|
106
|
+
return Object.assign({ queryKey }, query);
|
|
107
|
+
};
|
|
108
|
+
exports.useSitesSso = useSitesSso;
|
|
109
|
+
/**
|
|
110
|
+
* Return info about a specific site
|
|
111
|
+
* @summary sites info
|
|
112
|
+
*/
|
|
113
|
+
const getSitesInfoV1 = (siteId, options) => {
|
|
114
|
+
return axios_1.default.get(`/v1/sites/${siteId}/info`, options);
|
|
115
|
+
};
|
|
116
|
+
exports.getSitesInfoV1 = getSitesInfoV1;
|
|
117
|
+
const getGetSitesInfoV1QueryKey = (siteId) => [`/v1/sites/${siteId}/info`];
|
|
118
|
+
exports.getGetSitesInfoV1QueryKey = getGetSitesInfoV1QueryKey;
|
|
119
|
+
const useGetSitesInfoV1 = (siteId, options) => {
|
|
99
120
|
var _a;
|
|
100
121
|
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
101
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.
|
|
102
|
-
const queryFn = () => (0, exports.
|
|
122
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getGetSitesInfoV1QueryKey)(siteId);
|
|
123
|
+
const queryFn = () => (0, exports.getSitesInfoV1)(siteId, axiosOptions);
|
|
103
124
|
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(siteId) }, queryOptions));
|
|
104
125
|
return Object.assign({ queryKey }, query);
|
|
105
126
|
};
|
|
106
|
-
exports.
|
|
127
|
+
exports.useGetSitesInfoV1 = useGetSitesInfoV1;
|
|
107
128
|
/**
|
|
108
129
|
* Obtain a list of sites.
|
|
109
|
-
* @summary
|
|
130
|
+
* @summary hosting sites
|
|
110
131
|
*/
|
|
111
|
-
const
|
|
132
|
+
const hostingSites = (hostingId, options) => {
|
|
112
133
|
return axios_1.default.get(`/v1/hosting/${hostingId}/sites`, options);
|
|
113
134
|
};
|
|
114
|
-
exports.
|
|
115
|
-
const
|
|
116
|
-
exports.
|
|
117
|
-
const
|
|
135
|
+
exports.hostingSites = hostingSites;
|
|
136
|
+
const getHostingSitesQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/sites`];
|
|
137
|
+
exports.getHostingSitesQueryKey = getHostingSitesQueryKey;
|
|
138
|
+
const useHostingSites = (hostingId, options) => {
|
|
118
139
|
var _a;
|
|
119
140
|
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
120
|
-
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.
|
|
121
|
-
const queryFn = () => (0, exports.
|
|
141
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getHostingSitesQueryKey)(hostingId);
|
|
142
|
+
const queryFn = () => (0, exports.hostingSites)(hostingId, axiosOptions);
|
|
122
143
|
const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(hostingId) }, queryOptions));
|
|
123
144
|
return Object.assign({ queryKey }, query);
|
|
124
145
|
};
|
|
125
|
-
exports.
|
|
146
|
+
exports.useHostingSites = useHostingSites;
|
package/dist/index.msw.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const getGetAddonsCodeguardWebsiteListV1Mock: () => {
|
|
|
5
5
|
} | undefined;
|
|
6
6
|
}[] | undefined;
|
|
7
7
|
};
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const getHostingInfoMock: () => {
|
|
9
9
|
id: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const getGetHostingFtpV1Mock: () => {
|
|
@@ -18,10 +18,21 @@ export declare const getPostHostingFtpV1Mock: () => {
|
|
|
18
18
|
user: string | undefined;
|
|
19
19
|
pass: string | undefined;
|
|
20
20
|
};
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const getSitesSsoMock: () => {
|
|
22
22
|
sso: string | undefined;
|
|
23
23
|
};
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const getGetSitesInfoV1Mock: () => {
|
|
25
|
+
docroot: string;
|
|
26
|
+
uuid: string;
|
|
27
|
+
date_added: string;
|
|
28
|
+
date_modified: string;
|
|
29
|
+
type: string;
|
|
30
|
+
subtype: string;
|
|
31
|
+
status: string;
|
|
32
|
+
url: string;
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const getHostingSitesMock: () => {
|
|
25
36
|
rows: {
|
|
26
37
|
id: string | undefined;
|
|
27
38
|
name: string | undefined;
|
package/dist/index.msw.js
CHANGED
|
@@ -1,38 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHostingUAPIMSW = exports.
|
|
3
|
+
exports.getHostingUAPIMSW = exports.getHostingSitesMock = exports.getGetSitesInfoV1Mock = exports.getSitesSsoMock = exports.getPostHostingFtpV1Mock = exports.getGetHostingFtpV1Mock = exports.getHostingInfoMock = exports.getGetAddonsCodeguardWebsiteListV1Mock = 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.1
|
|
8
10
|
*/
|
|
9
11
|
const msw_1 = require("msw");
|
|
10
12
|
const faker_1 = require("@faker-js/faker");
|
|
11
13
|
const getGetAddonsCodeguardWebsiteListV1Mock = () => ({ website_list: faker_1.faker.helpers.randomize([[...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ website: faker_1.faker.helpers.randomize([{ url: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) }, undefined]) })), undefined]) });
|
|
12
14
|
exports.getGetAddonsCodeguardWebsiteListV1Mock = getGetAddonsCodeguardWebsiteListV1Mock;
|
|
13
|
-
const
|
|
14
|
-
exports.
|
|
15
|
+
const getHostingInfoMock = () => ({ id: faker_1.faker.random.word() });
|
|
16
|
+
exports.getHostingInfoMock = getHostingInfoMock;
|
|
15
17
|
const getGetHostingFtpV1Mock = () => ({ 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]) });
|
|
16
18
|
exports.getGetHostingFtpV1Mock = getGetHostingFtpV1Mock;
|
|
17
19
|
const getPostHostingFtpV1Mock = () => ({ user: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]), pass: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
18
20
|
exports.getPostHostingFtpV1Mock = getPostHostingFtpV1Mock;
|
|
19
|
-
const
|
|
20
|
-
exports.
|
|
21
|
-
const
|
|
22
|
-
exports.
|
|
21
|
+
const getSitesSsoMock = () => ({ sso: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
|
|
22
|
+
exports.getSitesSsoMock = getSitesSsoMock;
|
|
23
|
+
const getGetSitesInfoV1Mock = () => ({ 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(), type: faker_1.faker.random.word(), subtype: faker_1.faker.random.word(), status: faker_1.faker.random.word(), url: faker_1.faker.random.word(), name: faker_1.faker.random.word() });
|
|
24
|
+
exports.getGetSitesInfoV1Mock = getGetSitesInfoV1Mock;
|
|
25
|
+
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
|
+
exports.getHostingSitesMock = getHostingSitesMock;
|
|
23
27
|
const getHostingUAPIMSW = () => [
|
|
24
28
|
msw_1.rest.get('*/v1/addons/codeguard/:addonid/website_list', (_req, res, ctx) => {
|
|
25
29
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getGetAddonsCodeguardWebsiteListV1Mock)()));
|
|
26
30
|
}), msw_1.rest.get('*/v1/hosting/:hostingid/info', (_req, res, ctx) => {
|
|
27
|
-
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.
|
|
31
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getHostingInfoMock)()));
|
|
28
32
|
}), msw_1.rest.get('*/v1/hosting/:hostingid/ftp', (_req, res, ctx) => {
|
|
29
33
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getGetHostingFtpV1Mock)()));
|
|
30
34
|
}), msw_1.rest.post('*/v1/hosting/:hostingid/ftp', (_req, res, ctx) => {
|
|
31
35
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getPostHostingFtpV1Mock)()));
|
|
32
36
|
}), msw_1.rest.get('*/v1/sites/:siteid/sso', (_req, res, ctx) => {
|
|
33
|
-
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.
|
|
37
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getSitesSsoMock)()));
|
|
38
|
+
}), 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.getGetSitesInfoV1Mock)()));
|
|
34
40
|
}), msw_1.rest.get('*/v1/hosting/:hostingid/sites', (_req, res, ctx) => {
|
|
35
|
-
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.
|
|
41
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getHostingSitesMock)()));
|
|
36
42
|
}),
|
|
37
43
|
];
|
|
38
44
|
exports.getHostingUAPIMSW = getHostingUAPIMSW;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* OpenAPI spec version: 0.0.1
|
|
5
7
|
*/
|
|
6
8
|
import type { GetAddonsCodeguardWebsiteListV1200WebsiteListItem } from './getAddonsCodeguardWebsiteListV1200WebsiteListItem';
|
|
7
9
|
export declare type GetAddonsCodeguardWebsiteListV1200 = {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* OpenAPI spec version: 0.0.1
|
|
5
7
|
*/
|
|
6
8
|
import type { GetAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite } from './getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite';
|
|
7
9
|
export declare type GetAddonsCodeguardWebsiteListV1200WebsiteListItem = {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* OpenAPI spec version: 0.0.1
|
|
7
|
+
*/
|
|
8
|
+
export declare type GetSitesInfoV1200 = {
|
|
9
|
+
docroot: string;
|
|
10
|
+
uuid: string;
|
|
11
|
+
date_added: string;
|
|
12
|
+
date_modified: string;
|
|
13
|
+
type: string;
|
|
14
|
+
subtype: string;
|
|
15
|
+
status: string;
|
|
16
|
+
url: string;
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* OpenAPI spec version: 0.0.1
|
|
7
|
+
*/
|
|
8
|
+
import type { HostingSites200RowsItem } from './hostingSites200RowsItem';
|
|
9
|
+
export declare type HostingSites200 = {
|
|
10
|
+
rows?: HostingSites200RowsItem[];
|
|
11
|
+
};
|
package/dist/models/index.d.ts
CHANGED
|
@@ -15,3 +15,8 @@ export * from './getHostingSitesV1200';
|
|
|
15
15
|
export * from './getAddonsCodeguardWebsiteListV1200WebsiteListItem';
|
|
16
16
|
export * from './getAddonsCodeguardWebsiteListV1200';
|
|
17
17
|
export * from './getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite';
|
|
18
|
+
export * from './getSitesInfoV1200';
|
|
19
|
+
export * from './hostingInfo200';
|
|
20
|
+
export * from './sitesSso200';
|
|
21
|
+
export * from './hostingSites200';
|
|
22
|
+
export * from './hostingSites200RowsItem';
|
package/dist/models/index.js
CHANGED
|
@@ -31,3 +31,8 @@ __exportStar(require("./getHostingSitesV1200"), exports);
|
|
|
31
31
|
__exportStar(require("./getAddonsCodeguardWebsiteListV1200WebsiteListItem"), exports);
|
|
32
32
|
__exportStar(require("./getAddonsCodeguardWebsiteListV1200"), exports);
|
|
33
33
|
__exportStar(require("./getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite"), exports);
|
|
34
|
+
__exportStar(require("./getSitesInfoV1200"), exports);
|
|
35
|
+
__exportStar(require("./hostingInfo200"), exports);
|
|
36
|
+
__exportStar(require("./sitesSso200"), exports);
|
|
37
|
+
__exportStar(require("./hostingSites200"), exports);
|
|
38
|
+
__exportStar(require("./hostingSites200RowsItem"), exports);
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
|
+
* Hosting UAPI
|
|
6
|
+
* OpenAPI spec version: 0.0.1
|
|
5
7
|
*/
|
|
6
8
|
export declare type PostHostingFtpV1Body = {
|
|
7
9
|
/** Optional username. If not included then type is required and will generate a random username. Good for temp ftp user. Do not append domain. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newfold/huapi-js",
|
|
3
|
-
"version": "1.2.8-alpha",
|
|
3
|
+
"version": "1.2.8-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"get-schema": "curl -O https://beta-hosting-uapi.apps.provo1.endurancemb.com/openapi.json",
|
|
26
26
|
"clean": "rm -rf ./dist",
|
|
27
27
|
"orval": "orval",
|
|
28
|
-
"
|
|
29
|
-
"build": "yarn clean && yarn get-schema && yarn orval && yarn
|
|
28
|
+
"typescript": "npx tsc",
|
|
29
|
+
"build": "yarn clean && yarn get-schema && yarn orval && yarn typescript"
|
|
30
30
|
}
|
|
31
31
|
}
|