@newfold/huapi-js 1.2.7 → 1.2.8-alpha

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.
Files changed (36) hide show
  1. package/dist/handlers/sites/getHostingSitesHandler.js +1 -1
  2. package/dist/index.d.ts +77 -20
  3. package/dist/index.js +96 -22
  4. package/dist/index.msw.d.ts +28 -12
  5. package/dist/index.msw.js +25 -11
  6. package/dist/models/getAddonsCodeguardWebsiteListV1200.d.ts +9 -0
  7. package/dist/models/getAddonsCodeguardWebsiteListV1200.js +2 -0
  8. package/dist/models/getAddonsCodeguardWebsiteListV1200WebsiteListItem.d.ts +9 -0
  9. package/dist/models/getAddonsCodeguardWebsiteListV1200WebsiteListItem.js +2 -0
  10. package/dist/models/getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite.d.ts +8 -0
  11. package/dist/models/getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite.js +7 -0
  12. package/dist/models/getAddonsCodeguardWebsitesV1200.d.ts +9 -0
  13. package/dist/models/getAddonsCodeguardWebsitesV1200.js +2 -0
  14. package/dist/models/getAddonsCodeguardWebsitesV1200WebsiteListItem.d.ts +9 -0
  15. package/dist/models/getAddonsCodeguardWebsitesV1200WebsiteListItem.js +2 -0
  16. package/dist/models/getAddonsCodeguardWebsitesV1200WebsiteListItemWebsite.d.ts +9 -0
  17. package/dist/models/getAddonsCodeguardWebsitesV1200WebsiteListItemWebsite.js +7 -0
  18. package/dist/models/getHostingFtpV1200.d.ts +9 -0
  19. package/dist/models/getHostingFtpV1200.js +2 -0
  20. package/dist/models/getHostingFtpV1200FtpAccountItem.d.ts +9 -0
  21. package/dist/models/getHostingFtpV1200FtpAccountItem.js +7 -0
  22. package/dist/models/getHostingInfoV1200.d.ts +8 -0
  23. package/dist/models/getHostingInfoV1200.js +7 -0
  24. package/dist/models/getHostingSitesV1200.d.ts +9 -0
  25. package/dist/models/getHostingSitesV1200.js +2 -0
  26. package/dist/models/getHostingSitesV1200RowsItem.d.ts +10 -0
  27. package/dist/models/getHostingSitesV1200RowsItem.js +7 -0
  28. package/dist/models/getSitesSsoV1200.d.ts +8 -0
  29. package/dist/models/getSitesSsoV1200.js +7 -0
  30. package/dist/models/index.d.ts +15 -1
  31. package/dist/models/index.js +15 -1
  32. package/dist/models/postHostingFtpV1200.d.ts +9 -0
  33. package/dist/models/postHostingFtpV1200.js +7 -0
  34. package/dist/models/postHostingFtpV1Body.d.ts +9 -0
  35. package/dist/models/postHostingFtpV1Body.js +7 -0
  36. package/package.json +4 -2
@@ -12,6 +12,6 @@ const sites_1 = require("./data/sites");
12
12
  */
13
13
  function getHostingSitesHandler(responseKey = '1', // int or string
14
14
  status = 200, delay = 1000) {
15
- return msw_1.rest.get('*/hosting/:hostingId/sites', (req, res, ctx) => res(ctx.delay(delay), ctx.status(status, 'Mocked status'), ctx.json((0, sites_1.getResponseByStatus)(responseKey, status))));
15
+ return msw_1.rest.get('*/v1/hosting/:hostingId/sites', (req, res, ctx) => res(ctx.delay(delay), ctx.status(status, 'Mocked status'), ctx.json((0, sites_1.getResponseByStatus)(responseKey, status))));
16
16
  }
17
17
  exports.getHostingSitesHandler = getHostingSitesHandler;
package/dist/index.d.ts CHANGED
@@ -2,38 +2,95 @@
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.1.0
7
5
  */
8
6
  import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
9
7
  import { UseQueryOptions, UseMutationOptions, UseQueryResult, QueryKey } from 'react-query';
10
- import type { SiteSso, SiteList } from './models';
8
+ import type { GetAddonsCodeguardWebsiteListV1200, GetHostingInfoV1200, GetHostingFtpV1200, PostHostingFtpV1200, PostHostingFtpV1Body, GetSitesSsoV1200, GetHostingSitesV1200 } from './models';
11
9
  declare type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
12
10
  /**
13
- * TODO
14
- * @summary Get SSO token
11
+ * Return all website records CodeGuard maintains for this user's account.
12
+ * @summary addons codeguard website_list
13
+ */
14
+ export declare const getAddonsCodeguardWebsiteListV1: (addonId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<GetAddonsCodeguardWebsiteListV1200>>;
15
+ export declare const getGetAddonsCodeguardWebsiteListV1QueryKey: (addonId: number) => string[];
16
+ export declare type GetAddonsCodeguardWebsiteListV1QueryResult = NonNullable<AsyncReturnType<typeof getAddonsCodeguardWebsiteListV1>>;
17
+ export declare type GetAddonsCodeguardWebsiteListV1QueryError = AxiosError<unknown>;
18
+ export declare const useGetAddonsCodeguardWebsiteListV1: <TData = AxiosResponse<GetAddonsCodeguardWebsiteListV1200, any>, TError = AxiosError<unknown, any>>(addonId: number, options?: {
19
+ query?: UseQueryOptions<AxiosResponse<GetAddonsCodeguardWebsiteListV1200, any>, TError, TData, QueryKey> | undefined;
20
+ axios?: AxiosRequestConfig<any> | undefined;
21
+ } | undefined) => UseQueryResult<TData, TError> & {
22
+ queryKey: QueryKey;
23
+ };
24
+ /**
25
+ * Return info about a specific account
26
+ * @summary hosting info
27
+ */
28
+ export declare const getHostingInfoV1: (hostingId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<GetHostingInfoV1200>>;
29
+ export declare const getGetHostingInfoV1QueryKey: (hostingId: number) => string[];
30
+ export declare type GetHostingInfoV1QueryResult = NonNullable<AsyncReturnType<typeof getHostingInfoV1>>;
31
+ export declare type GetHostingInfoV1QueryError = AxiosError<unknown>;
32
+ export declare const useGetHostingInfoV1: <TData = AxiosResponse<GetHostingInfoV1200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
33
+ query?: UseQueryOptions<AxiosResponse<GetHostingInfoV1200, any>, TError, TData, QueryKey> | undefined;
34
+ axios?: AxiosRequestConfig<any> | undefined;
35
+ } | undefined) => UseQueryResult<TData, TError> & {
36
+ queryKey: QueryKey;
37
+ };
38
+ /**
39
+ * List FTP accounts.
40
+ * @summary hosting ftp
15
41
  */
16
- export declare const siteSso: (siteId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<SiteSso>>;
17
- export declare type SiteSsoMutationResult = NonNullable<AsyncReturnType<typeof siteSso>>;
18
- export declare type SiteSsoMutationError = AxiosError<unknown>;
19
- export declare const useSiteSso: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
20
- mutation?: UseMutationOptions<AxiosResponse<SiteSso, any>, TError, {
21
- siteId: number;
42
+ export declare const getHostingFtpV1: (hostingId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<GetHostingFtpV1200>>;
43
+ export declare const getGetHostingFtpV1QueryKey: (hostingId: number) => string[];
44
+ export declare type GetHostingFtpV1QueryResult = NonNullable<AsyncReturnType<typeof getHostingFtpV1>>;
45
+ export declare type GetHostingFtpV1QueryError = AxiosError<unknown>;
46
+ export declare const useGetHostingFtpV1: <TData = AxiosResponse<GetHostingFtpV1200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
47
+ query?: UseQueryOptions<AxiosResponse<GetHostingFtpV1200, any>, TError, TData, QueryKey> | undefined;
48
+ axios?: AxiosRequestConfig<any> | undefined;
49
+ } | undefined) => UseQueryResult<TData, TError> & {
50
+ queryKey: QueryKey;
51
+ };
52
+ /**
53
+ * Makes a FTP account and returns login credentials for it.
54
+ * @summary hosting ftp
55
+ */
56
+ export declare const postHostingFtpV1: (hostingId: number, postHostingFtpV1Body: PostHostingFtpV1Body, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<PostHostingFtpV1200>>;
57
+ export declare type PostHostingFtpV1MutationResult = NonNullable<AsyncReturnType<typeof postHostingFtpV1>>;
58
+ export declare type PostHostingFtpV1MutationBody = PostHostingFtpV1Body;
59
+ export declare type PostHostingFtpV1MutationError = AxiosError<unknown>;
60
+ export declare const usePostHostingFtpV1: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
61
+ mutation?: UseMutationOptions<AxiosResponse<PostHostingFtpV1200, any>, TError, {
62
+ hostingId: number;
63
+ data: PostHostingFtpV1Body;
22
64
  }, TContext> | undefined;
23
65
  axios?: AxiosRequestConfig<any> | undefined;
24
- } | undefined) => import("react-query").UseMutationResult<AxiosResponse<SiteSso, any>, TError, {
25
- siteId: number;
66
+ } | undefined) => import("react-query").UseMutationResult<AxiosResponse<PostHostingFtpV1200, any>, TError, {
67
+ hostingId: number;
68
+ data: PostHostingFtpV1Body;
26
69
  }, TContext>;
70
+ /**
71
+ * Return an SSO token or login URL for this site (if supported).
72
+ * @summary sites sso
73
+ */
74
+ export declare const getSitesSsoV1: (siteId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<GetSitesSsoV1200>>;
75
+ export declare const getGetSitesSsoV1QueryKey: (siteId: number) => string[];
76
+ export declare type GetSitesSsoV1QueryResult = NonNullable<AsyncReturnType<typeof getSitesSsoV1>>;
77
+ export declare type GetSitesSsoV1QueryError = AxiosError<unknown>;
78
+ export declare const useGetSitesSsoV1: <TData = AxiosResponse<GetSitesSsoV1200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
79
+ query?: UseQueryOptions<AxiosResponse<GetSitesSsoV1200, any>, TError, TData, QueryKey> | undefined;
80
+ axios?: AxiosRequestConfig<any> | undefined;
81
+ } | undefined) => UseQueryResult<TData, TError> & {
82
+ queryKey: QueryKey;
83
+ };
27
84
  /**
28
85
  * Obtain a list of sites.
29
- * @summary Get sites for a hosting id
86
+ * @summary hosting sites
30
87
  */
31
- export declare const hostingSites: (hostingId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<SiteList>>;
32
- export declare const getHostingSitesQueryKey: (hostingId: number) => string[];
33
- export declare type HostingSitesQueryResult = NonNullable<AsyncReturnType<typeof hostingSites>>;
34
- export declare type HostingSitesQueryError = AxiosError<unknown>;
35
- export declare const useHostingSites: <TData = AxiosResponse<SiteList, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
36
- query?: UseQueryOptions<AxiosResponse<SiteList, any>, TError, TData, QueryKey> | undefined;
88
+ export declare const getHostingSitesV1: (hostingId: number, options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<GetHostingSitesV1200>>;
89
+ export declare const getGetHostingSitesV1QueryKey: (hostingId: number) => string[];
90
+ export declare type GetHostingSitesV1QueryResult = NonNullable<AsyncReturnType<typeof getHostingSitesV1>>;
91
+ export declare type GetHostingSitesV1QueryError = AxiosError<unknown>;
92
+ export declare const useGetHostingSitesV1: <TData = AxiosResponse<GetHostingSitesV1200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
93
+ query?: UseQueryOptions<AxiosResponse<GetHostingSitesV1200, any>, TError, TData, QueryKey> | undefined;
37
94
  axios?: AxiosRequestConfig<any> | undefined;
38
95
  } | undefined) => UseQueryResult<TData, TError> & {
39
96
  queryKey: QueryKey;
package/dist/index.js CHANGED
@@ -3,49 +3,123 @@ 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.useSiteSso = exports.siteSso = void 0;
6
+ exports.useGetHostingSitesV1 = exports.getGetHostingSitesV1QueryKey = exports.getHostingSitesV1 = exports.useGetSitesSsoV1 = exports.getGetSitesSsoV1QueryKey = exports.getSitesSsoV1 = exports.usePostHostingFtpV1 = exports.postHostingFtpV1 = exports.useGetHostingFtpV1 = exports.getGetHostingFtpV1QueryKey = exports.getHostingFtpV1 = exports.useGetHostingInfoV1 = exports.getGetHostingInfoV1QueryKey = exports.getHostingInfoV1 = 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.1.0
13
11
  */
14
12
  const axios_1 = __importDefault(require("axios"));
15
13
  const react_query_1 = require("react-query");
16
14
  /**
17
- * TODO
18
- * @summary Get SSO token
15
+ * Return all website records CodeGuard maintains for this user's account.
16
+ * @summary addons codeguard website_list
17
+ */
18
+ const getAddonsCodeguardWebsiteListV1 = (addonId, options) => {
19
+ return axios_1.default.get(`/v1/addons/codeguard/${addonId}/website_list`, options);
20
+ };
21
+ exports.getAddonsCodeguardWebsiteListV1 = getAddonsCodeguardWebsiteListV1;
22
+ const getGetAddonsCodeguardWebsiteListV1QueryKey = (addonId) => [`/v1/addons/codeguard/${addonId}/website_list`];
23
+ exports.getGetAddonsCodeguardWebsiteListV1QueryKey = getGetAddonsCodeguardWebsiteListV1QueryKey;
24
+ const useGetAddonsCodeguardWebsiteListV1 = (addonId, options) => {
25
+ var _a;
26
+ const { query: queryOptions, axios: axiosOptions } = options || {};
27
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getGetAddonsCodeguardWebsiteListV1QueryKey)(addonId);
28
+ const queryFn = () => (0, exports.getAddonsCodeguardWebsiteListV1)(addonId, axiosOptions);
29
+ const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(addonId) }, queryOptions));
30
+ return Object.assign({ queryKey }, query);
31
+ };
32
+ exports.useGetAddonsCodeguardWebsiteListV1 = useGetAddonsCodeguardWebsiteListV1;
33
+ /**
34
+ * Return info about a specific account
35
+ * @summary hosting info
36
+ */
37
+ const getHostingInfoV1 = (hostingId, options) => {
38
+ return axios_1.default.get(`/v1/hosting/${hostingId}/info`, options);
39
+ };
40
+ exports.getHostingInfoV1 = getHostingInfoV1;
41
+ const getGetHostingInfoV1QueryKey = (hostingId) => [`/v1/hosting/${hostingId}/info`];
42
+ exports.getGetHostingInfoV1QueryKey = getGetHostingInfoV1QueryKey;
43
+ const useGetHostingInfoV1 = (hostingId, options) => {
44
+ var _a;
45
+ 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.getGetHostingInfoV1QueryKey)(hostingId);
47
+ const queryFn = () => (0, exports.getHostingInfoV1)(hostingId, axiosOptions);
48
+ const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(hostingId) }, queryOptions));
49
+ return Object.assign({ queryKey }, query);
50
+ };
51
+ exports.useGetHostingInfoV1 = useGetHostingInfoV1;
52
+ /**
53
+ * List FTP accounts.
54
+ * @summary hosting ftp
19
55
  */
20
- const siteSso = (siteId, options) => {
21
- return axios_1.default.post(`/sites/${siteId}/sso`, undefined, options);
56
+ const getHostingFtpV1 = (hostingId, options) => {
57
+ return axios_1.default.get(`/v1/hosting/${hostingId}/ftp`, options);
22
58
  };
23
- exports.siteSso = siteSso;
24
- const useSiteSso = (options) => {
59
+ exports.getHostingFtpV1 = getHostingFtpV1;
60
+ const getGetHostingFtpV1QueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ftp`];
61
+ exports.getGetHostingFtpV1QueryKey = getGetHostingFtpV1QueryKey;
62
+ const useGetHostingFtpV1 = (hostingId, options) => {
63
+ var _a;
64
+ const { query: queryOptions, axios: axiosOptions } = options || {};
65
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getGetHostingFtpV1QueryKey)(hostingId);
66
+ const queryFn = () => (0, exports.getHostingFtpV1)(hostingId, axiosOptions);
67
+ const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(hostingId) }, queryOptions));
68
+ return Object.assign({ queryKey }, query);
69
+ };
70
+ exports.useGetHostingFtpV1 = useGetHostingFtpV1;
71
+ /**
72
+ * Makes a FTP account and returns login credentials for it.
73
+ * @summary hosting ftp
74
+ */
75
+ const postHostingFtpV1 = (hostingId, postHostingFtpV1Body, options) => {
76
+ return axios_1.default.post(`/v1/hosting/${hostingId}/ftp`, postHostingFtpV1Body, options);
77
+ };
78
+ exports.postHostingFtpV1 = postHostingFtpV1;
79
+ const usePostHostingFtpV1 = (options) => {
25
80
  const { mutation: mutationOptions, axios: axiosOptions } = options || {};
26
81
  const mutationFn = (props) => {
27
- const { siteId } = props || {};
28
- return (0, exports.siteSso)(siteId, axiosOptions);
82
+ const { hostingId, data } = props || {};
83
+ return (0, exports.postHostingFtpV1)(hostingId, data, axiosOptions);
29
84
  };
30
85
  return (0, react_query_1.useMutation)(mutationFn, mutationOptions);
31
86
  };
32
- exports.useSiteSso = useSiteSso;
87
+ exports.usePostHostingFtpV1 = usePostHostingFtpV1;
88
+ /**
89
+ * Return an SSO token or login URL for this site (if supported).
90
+ * @summary sites sso
91
+ */
92
+ const getSitesSsoV1 = (siteId, options) => {
93
+ return axios_1.default.get(`/v1/sites/${siteId}/sso`, options);
94
+ };
95
+ exports.getSitesSsoV1 = getSitesSsoV1;
96
+ const getGetSitesSsoV1QueryKey = (siteId) => [`/v1/sites/${siteId}/sso`];
97
+ exports.getGetSitesSsoV1QueryKey = getGetSitesSsoV1QueryKey;
98
+ const useGetSitesSsoV1 = (siteId, options) => {
99
+ var _a;
100
+ 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.getGetSitesSsoV1QueryKey)(siteId);
102
+ const queryFn = () => (0, exports.getSitesSsoV1)(siteId, axiosOptions);
103
+ const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(siteId) }, queryOptions));
104
+ return Object.assign({ queryKey }, query);
105
+ };
106
+ exports.useGetSitesSsoV1 = useGetSitesSsoV1;
33
107
  /**
34
108
  * Obtain a list of sites.
35
- * @summary Get sites for a hosting id
109
+ * @summary hosting sites
36
110
  */
37
- const hostingSites = (hostingId, options) => {
38
- return axios_1.default.get(`/hosting/${hostingId}/sites`, options);
111
+ const getHostingSitesV1 = (hostingId, options) => {
112
+ return axios_1.default.get(`/v1/hosting/${hostingId}/sites`, options);
39
113
  };
40
- exports.hostingSites = hostingSites;
41
- const getHostingSitesQueryKey = (hostingId) => [`/hosting/${hostingId}/sites`];
42
- exports.getHostingSitesQueryKey = getHostingSitesQueryKey;
43
- const useHostingSites = (hostingId, options) => {
114
+ exports.getHostingSitesV1 = getHostingSitesV1;
115
+ const getGetHostingSitesV1QueryKey = (hostingId) => [`/v1/hosting/${hostingId}/sites`];
116
+ exports.getGetHostingSitesV1QueryKey = getGetHostingSitesV1QueryKey;
117
+ const useGetHostingSitesV1 = (hostingId, options) => {
44
118
  var _a;
45
119
  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.getHostingSitesQueryKey)(hostingId);
47
- const queryFn = () => (0, exports.hostingSites)(hostingId, axiosOptions);
120
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : (0, exports.getGetHostingSitesV1QueryKey)(hostingId);
121
+ const queryFn = () => (0, exports.getHostingSitesV1)(hostingId, axiosOptions);
48
122
  const query = (0, react_query_1.useQuery)(queryKey, queryFn, Object.assign({ enabled: !!(hostingId) }, queryOptions));
49
123
  return Object.assign({ queryKey }, query);
50
124
  };
51
- exports.useHostingSites = useHostingSites;
125
+ exports.useGetHostingSitesV1 = useGetHostingSitesV1;
@@ -1,15 +1,31 @@
1
- export declare const getSiteSsoMock: () => {
2
- sso: string;
3
- };
4
- export declare const getHostingSitesMock: () => {
5
- limit: number;
6
- n_pages: number;
7
- n_rows: number;
8
- page: number;
1
+ export declare const getGetAddonsCodeguardWebsiteListV1Mock: () => {
2
+ website_list: {
3
+ website: {
4
+ url: string | undefined;
5
+ } | undefined;
6
+ }[] | undefined;
7
+ };
8
+ export declare const getGetHostingInfoV1Mock: () => {
9
+ id: string;
10
+ };
11
+ export declare const getGetHostingFtpV1Mock: () => {
12
+ ftp_account: {
13
+ user: string | undefined;
14
+ homedir: string | undefined;
15
+ }[] | undefined;
16
+ };
17
+ export declare const getPostHostingFtpV1Mock: () => {
18
+ user: string | undefined;
19
+ pass: string | undefined;
20
+ };
21
+ export declare const getGetSitesSsoV1Mock: () => {
22
+ sso: string | undefined;
23
+ };
24
+ export declare const getGetHostingSitesV1Mock: () => {
9
25
  rows: {
10
- id: string;
11
- name: string;
12
- url: string;
13
- }[];
26
+ id: string | undefined;
27
+ name: string | undefined;
28
+ url: string | undefined;
29
+ }[] | undefined;
14
30
  };
15
31
  export declare const getHostingUAPIMSW: () => import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultRequestBody>>[];
package/dist/index.msw.js CHANGED
@@ -1,24 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHostingUAPIMSW = exports.getHostingSitesMock = exports.getSiteSsoMock = void 0;
3
+ exports.getHostingUAPIMSW = exports.getGetHostingSitesV1Mock = exports.getGetSitesSsoV1Mock = exports.getPostHostingFtpV1Mock = exports.getGetHostingFtpV1Mock = exports.getGetHostingInfoV1Mock = 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.1.0
10
8
  */
11
9
  const msw_1 = require("msw");
12
10
  const faker_1 = require("@faker-js/faker");
13
- const getSiteSsoMock = () => ({ sso: faker_1.faker.random.word() });
14
- exports.getSiteSsoMock = getSiteSsoMock;
15
- const getHostingSitesMock = () => ({ limit: faker_1.faker.datatype.number(), n_pages: faker_1.faker.datatype.number(), n_rows: faker_1.faker.datatype.number(), page: faker_1.faker.datatype.number(), rows: [...Array(faker_1.faker.datatype.number({ min: 1, max: 10 }))].map(() => ({ id: faker_1.faker.random.word(), name: faker_1.faker.random.word(), url: faker_1.faker.random.word() })) });
16
- exports.getHostingSitesMock = getHostingSitesMock;
11
+ 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
+ exports.getGetAddonsCodeguardWebsiteListV1Mock = getGetAddonsCodeguardWebsiteListV1Mock;
13
+ const getGetHostingInfoV1Mock = () => ({ id: faker_1.faker.random.word() });
14
+ exports.getGetHostingInfoV1Mock = getGetHostingInfoV1Mock;
15
+ 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
+ exports.getGetHostingFtpV1Mock = getGetHostingFtpV1Mock;
17
+ 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
+ exports.getPostHostingFtpV1Mock = getPostHostingFtpV1Mock;
19
+ const getGetSitesSsoV1Mock = () => ({ sso: faker_1.faker.helpers.randomize([faker_1.faker.random.word(), undefined]) });
20
+ exports.getGetSitesSsoV1Mock = getGetSitesSsoV1Mock;
21
+ const getGetHostingSitesV1Mock = () => ({ 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]) });
22
+ exports.getGetHostingSitesV1Mock = getGetHostingSitesV1Mock;
17
23
  const getHostingUAPIMSW = () => [
18
- msw_1.rest.post('*/sites/:siteid/sso', (_req, res, ctx) => {
19
- return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getSiteSsoMock)()));
20
- }), msw_1.rest.get('*/hosting/:hostingid/sites', (_req, res, ctx) => {
21
- return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getHostingSitesMock)()));
24
+ msw_1.rest.get('*/v1/addons/codeguard/:addonid/website_list', (_req, res, ctx) => {
25
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getGetAddonsCodeguardWebsiteListV1Mock)()));
26
+ }), 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.getGetHostingInfoV1Mock)()));
28
+ }), msw_1.rest.get('*/v1/hosting/:hostingid/ftp', (_req, res, ctx) => {
29
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getGetHostingFtpV1Mock)()));
30
+ }), msw_1.rest.post('*/v1/hosting/:hostingid/ftp', (_req, res, ctx) => {
31
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json((0, exports.getPostHostingFtpV1Mock)()));
32
+ }), 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.getGetSitesSsoV1Mock)()));
34
+ }), 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.getGetHostingSitesV1Mock)()));
22
36
  }),
23
37
  ];
24
38
  exports.getHostingUAPIMSW = getHostingUAPIMSW;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ import type { GetAddonsCodeguardWebsiteListV1200WebsiteListItem } from './getAddonsCodeguardWebsiteListV1200WebsiteListItem';
7
+ export declare type GetAddonsCodeguardWebsiteListV1200 = {
8
+ website_list?: GetAddonsCodeguardWebsiteListV1200WebsiteListItem[];
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ import type { GetAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite } from './getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite';
7
+ export declare type GetAddonsCodeguardWebsiteListV1200WebsiteListItem = {
8
+ website?: GetAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type GetAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite = {
7
+ url?: string;
8
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ import type { GetAddonsCodeguardWebsitesV1200WebsiteListItem } from './getAddonsCodeguardWebsitesV1200WebsiteListItem';
7
+ export declare type GetAddonsCodeguardWebsitesV1200 = {
8
+ website_list?: GetAddonsCodeguardWebsitesV1200WebsiteListItem[];
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ import type { GetAddonsCodeguardWebsitesV1200WebsiteListItemWebsite } from './getAddonsCodeguardWebsitesV1200WebsiteListItemWebsite';
7
+ export declare type GetAddonsCodeguardWebsitesV1200WebsiteListItem = {
8
+ website?: GetAddonsCodeguardWebsitesV1200WebsiteListItemWebsite;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type GetAddonsCodeguardWebsitesV1200WebsiteListItemWebsite = {
7
+ id?: number;
8
+ url?: string;
9
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ import type { GetHostingFtpV1200FtpAccountItem } from './getHostingFtpV1200FtpAccountItem';
7
+ export declare type GetHostingFtpV1200 = {
8
+ ftp_account?: GetHostingFtpV1200FtpAccountItem[];
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type GetHostingFtpV1200FtpAccountItem = {
7
+ user?: string;
8
+ homedir?: string;
9
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type GetHostingInfoV1200 = {
7
+ id: string;
8
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ import type { GetHostingSitesV1200RowsItem } from './getHostingSitesV1200RowsItem';
7
+ export declare type GetHostingSitesV1200 = {
8
+ rows?: GetHostingSitesV1200RowsItem[];
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type GetHostingSitesV1200RowsItem = {
7
+ id?: string;
8
+ name?: string;
9
+ url?: string;
10
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type GetSitesSsoV1200 = {
7
+ sso?: string;
8
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,17 @@
1
- export * from './siteList';
2
1
  export * from './site';
2
+ export * from './siteList';
3
3
  export * from './siteSso';
4
+ export * from './getAddonsCodeguardWebsitesV1200WebsiteListItem';
5
+ export * from './getAddonsCodeguardWebsitesV1200WebsiteListItemWebsite';
6
+ export * from './getAddonsCodeguardWebsitesV1200';
7
+ export * from './getHostingFtpV1200FtpAccountItem';
8
+ export * from './postHostingFtpV1Body';
9
+ export * from './getHostingFtpV1200';
10
+ export * from './getHostingInfoV1200';
11
+ export * from './getSitesSsoV1200';
12
+ export * from './postHostingFtpV1200';
13
+ export * from './getHostingSitesV1200RowsItem';
14
+ export * from './getHostingSitesV1200';
15
+ export * from './getAddonsCodeguardWebsiteListV1200WebsiteListItem';
16
+ export * from './getAddonsCodeguardWebsiteListV1200';
17
+ export * from './getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite';
@@ -14,6 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./siteList"), exports);
18
17
  __exportStar(require("./site"), exports);
18
+ __exportStar(require("./siteList"), exports);
19
19
  __exportStar(require("./siteSso"), exports);
20
+ __exportStar(require("./getAddonsCodeguardWebsitesV1200WebsiteListItem"), exports);
21
+ __exportStar(require("./getAddonsCodeguardWebsitesV1200WebsiteListItemWebsite"), exports);
22
+ __exportStar(require("./getAddonsCodeguardWebsitesV1200"), exports);
23
+ __exportStar(require("./getHostingFtpV1200FtpAccountItem"), exports);
24
+ __exportStar(require("./postHostingFtpV1Body"), exports);
25
+ __exportStar(require("./getHostingFtpV1200"), exports);
26
+ __exportStar(require("./getHostingInfoV1200"), exports);
27
+ __exportStar(require("./getSitesSsoV1200"), exports);
28
+ __exportStar(require("./postHostingFtpV1200"), exports);
29
+ __exportStar(require("./getHostingSitesV1200RowsItem"), exports);
30
+ __exportStar(require("./getHostingSitesV1200"), exports);
31
+ __exportStar(require("./getAddonsCodeguardWebsiteListV1200WebsiteListItem"), exports);
32
+ __exportStar(require("./getAddonsCodeguardWebsiteListV1200"), exports);
33
+ __exportStar(require("./getAddonsCodeguardWebsiteListV1200WebsiteListItemWebsite"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type PostHostingFtpV1200 = {
7
+ user?: string;
8
+ pass?: string;
9
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v6.7.1 🍺
3
+ * Do not edit manually.
4
+ * Hosting UAPI
5
+ */
6
+ export declare type PostHostingFtpV1Body = {
7
+ /** Optional username. If not included then type is required and will generate a random username. Good for temp ftp user. Do not append domain. */
8
+ user?: string;
9
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by orval v6.7.1 🍺
4
+ * Do not edit manually.
5
+ * Hosting UAPI
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newfold/huapi-js",
3
- "version": "1.2.7",
3
+ "version": "1.2.8-alpha",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,8 +22,10 @@
22
22
  "react": "^17.0.0 || ^18.0.0"
23
23
  },
24
24
  "scripts": {
25
+ "get-schema": "curl -O https://beta-hosting-uapi.apps.provo1.endurancemb.com/openapi.json",
26
+ "clean": "rm -rf ./dist",
25
27
  "orval": "orval",
26
28
  "tsc": "npx tsc",
27
- "build": "yarn orval && yarn tsc"
29
+ "build": "yarn clean && yarn get-schema && yarn orval && yarn tsc"
28
30
  }
29
31
  }