@newfold/huapi-js 1.886.0 → 1.889.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/orval.config.js +2 -0
- package/package.json +1 -1
- package/src/index.d.ts +16 -2
- package/src/index.js +20 -3
- package/src/index.msw.d.ts +5 -0
- package/src/index.msw.js +4 -1
- package/src/index.schemas.d.ts +24 -13
package/orval.config.js
CHANGED
|
@@ -18,12 +18,14 @@ export default defineConfig({
|
|
|
18
18
|
query: {
|
|
19
19
|
useQuery: true,
|
|
20
20
|
useInfinite: true,
|
|
21
|
+
useInfiniteQueryParam: 'scroll_id',
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
sites_access_logs: {
|
|
24
25
|
query: {
|
|
25
26
|
useQuery: true,
|
|
26
27
|
useInfinite: true,
|
|
28
|
+
useInfiniteQueryParam: 'scroll_id',
|
|
27
29
|
},
|
|
28
30
|
},
|
|
29
31
|
},
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.889.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import type { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
10
10
|
import type { UseQueryOptions, UseInfiniteQueryOptions, UseMutationOptions, UseQueryResult, UseInfiniteQueryResult, QueryKey } from '@tanstack/react-query';
|
|
11
|
-
import type { AccountHostingList200, CodeguardBackupList200, CodeguardBackupListParams, CodeguardBackupCreate200, CodeguardBackupCreateBody, CodeguardBackupDownload200, CodeguardBackupDownloadBody, CodeguardBackupRestore200, CodeguardBackupRestoreBody, CodeguardDatabaseList200, CodeguardDatabaseBackupList200, CodeguardDatabaseBackupListParams, CodeguardDatabaseBackupCreate200, CodeguardDatabaseBackupCreateBody, CodeguardDatabaseBackupRestore200, CodeguardDatabaseBackupRestoreBody, CodeguardLoginLink200, CodeguardPlanInfo200, CodeguardWebsiteList200, CodeguardWebsiteBackupList200, CodeguardWebsiteBackupListParams, CodeguardWebsiteBackupCreate200, CodeguardWebsiteBackupCreateBody, CodeguardWebsiteBackupRestore200, CodeguardWebsiteBackupRestoreBody, AddonsSitelockSso200, AddonsCloudflare200, AddonsInfo200, AddonsSpamexpertsSso200, WebzaiSso200, WeeblySso200, DomainInfo200, DomainUnassign200, HostingAccount200, HostingAddons200, HostingAddonsParams, HostingAdvancedServer200, HostingAdvancedServerStatus200, HostingAdvancedServerStatusBody, HostingAdvancedPassword200, HostingAdvancedPasswordBody, HostingAdvancedSsoWhm200, HostingAdvancedSystemConsole200, HostingCapabilities200, AddonCloudflare200, AddonCloudflareBody, ListCrons200, AddCron200, AddCron400, AddCronBody, UpdateCron200, UpdateCronBody, Cron200, CronBody, DbAdd200, DbAddBody, Db200, DbBody, DbList200, DbUsage200, DbUserPrivsGet200, DbUserPrivsGetParams, DbUserAdd200, DbUserAddBody, DbUserDelete200, DbUserDeleteBody, DbUserList200, Domains200, DomainsParams, HostingDomainsUnassign200, HostingDomainsUnassignBody, HostingEcommerceInfo200, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingLead200, HostingLead400, HostingLeadParams, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsCheck200, HostingMigrationsCheckParams, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, HostingOnboardingData200, HostingOnboardingDataUpdate200, HostingOnboardingDataUpdateBody, HostingResellerSsoWhm200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSiteAdd200, HostingSiteAddBody, HostingSshInfo200, SshKeyFetch200, SshKeyFetchParams, SshKeyImport200, SshKeyImportBody, SshKeyList200, SshKey200, SshKeyBody, SshKeyGenerate200, SshKeyGenerateBody, Sso200, SsoParams, SitesList200, SitesInfo200, SiteUpdate200, SiteUpdate400, SiteUpdateBody, Site200, SitesAutoupdatesResponse, SitesAutoupdatesUpdateBody, SitesBackups200, SitesHasBackups200, SitesBackupsCodeguard200, SitesBackupsDetails200, JetpackBackupStatus200, BackupsJetpackBackup200, SiteAddonCloudflare200, SiteAddonCloudflare400, SitesDatabaseInfo200, SitesDatabasePasswordsync200, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainParams, SitesDomainUrl200, SitesDomainUrlBody, SitesDomainsCreate200, SitesDomainsCreateBody, SitesAccessLogs200, SitesAccessLogsParams, SitesErrorLogs200, SitesErrorLogsParams, SiteMalwareStatus200, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsParams, SitePluginUpdate200, SitePluginUpdateBody, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, ResetSiteBody, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSshUserList200, SitesSshUserCreate200, SitesSshUserCreateBody, SitesSshUserDelete200, SitesSshUserDeleteBody, SitesSshUserUpdate200, SitesSshUserUpdateBody, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params } from './index.schemas';
|
|
11
|
+
import type { AccountHostingList200, CodeguardBackupList200, CodeguardBackupListParams, CodeguardBackupCreate200, CodeguardBackupCreateBody, CodeguardBackupDownload200, CodeguardBackupDownloadBody, CodeguardBackupRestore200, CodeguardBackupRestoreBody, CodeguardDatabaseList200, CodeguardDatabaseBackupList200, CodeguardDatabaseBackupListParams, CodeguardDatabaseBackupCreate200, CodeguardDatabaseBackupCreateBody, CodeguardDatabaseBackupRestore200, CodeguardDatabaseBackupRestoreBody, CodeguardLoginLink200, CodeguardPlanInfo200, CodeguardWebsiteList200, CodeguardWebsiteBackupList200, CodeguardWebsiteBackupListParams, CodeguardWebsiteBackupCreate200, CodeguardWebsiteBackupCreateBody, CodeguardWebsiteBackupRestore200, CodeguardWebsiteBackupRestoreBody, AddonsSitelockSso200, AddonsCloudflare200, AddonsInfo200, AddonsSpamexpertsSso200, WebzaiSso200, WeeblySso200, DomainInfo200, DomainUnassign200, HostingAccount200, HostingAddons200, HostingAddonsParams, HostingAdvancedServer200, HostingAdvancedServerStatus200, HostingAdvancedServerStatusBody, HostingAdvancedPassword200, HostingAdvancedPasswordBody, HostingAdvancedSsoWhm200, HostingAdvancedSystemConsole200, HostingCapabilities200, AddonCloudflare200, AddonCloudflareBody, ListCrons200, AddCron200, AddCron400, AddCronBody, UpdateCron200, UpdateCronBody, Cron200, CronBody, DbAdd200, DbAddBody, Db200, DbBody, DbList200, DbUsage200, DbUserPrivsGet200, DbUserPrivsGetParams, DbUserAdd200, DbUserAddBody, DbUserDelete200, DbUserDeleteBody, DbUserList200, Domains200, DomainsParams, HostingDomainsUnassign200, HostingDomainsUnassignBody, HostingEcommerceInfo200, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingLead200, HostingLead400, HostingLeadParams, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsCheck200, HostingMigrationsCheckParams, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, HostingOnboardingData200, HostingOnboardingDataUpdate200, HostingOnboardingDataUpdateBody, HostingResellerSsoWhm200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSiteAdd200, HostingSiteAddBody, HostingSshInfo200, SshKeyFetch200, SshKeyFetchParams, SshKeyImport200, SshKeyImportBody, SshKeyList200, SshKey200, SshKeyBody, SshKeyGenerate200, SshKeyGenerateBody, Sso200, SsoParams, SitesList200, SitesInfo200, SiteUpdate200, SiteUpdate400, SiteUpdateBody, Site200, SitesAutoupdatesResponse, SitesAutoupdatesUpdateBody, SitesBackups200, SitesHasBackups200, SitesBackupsCodeguard200, SitesBackupsDetails200, JetpackBackupStatus200, BackupsJetpackBackup200, SiteAddonCloudflare200, SiteAddonCloudflare400, SitesDatabaseInfo200, SitesDatabasePasswordsync200, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainParams, SitesDomainUrl200, SitesDomainUrlBody, SitesDomainsCreate200, SitesDomainsCreateBody, SitesAccessLogs200, SitesAccessLogsParams, SitesErrorLogs200, SitesErrorLogsParams, SiteMalwareStatus200, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsParams, SitePluginUpdate200, SitePluginUpdateBody, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, ResetSiteBody, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSshUserList200, SitesSshUserCreate200, SitesSshUserCreateBody, SitesSshUserDelete200, SitesSshUserDeleteBody, SitesSshUserUpdate200, SitesSshUserUpdateBody, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, AddonsSitelockSsoV2200, AddonsSitelockSsoV2Params, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params } from './index.schemas';
|
|
12
12
|
declare type AwaitedInput<T> = PromiseLike<T> | T;
|
|
13
13
|
declare type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
14
14
|
/**
|
|
@@ -2059,6 +2059,20 @@ export declare const useSitesVersion: <TData = AxiosResponse<SitesVersion200, an
|
|
|
2059
2059
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
2060
2060
|
queryKey: QueryKey;
|
|
2061
2061
|
};
|
|
2062
|
+
/**
|
|
2063
|
+
* Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
|
|
2064
|
+
* @summary sso
|
|
2065
|
+
*/
|
|
2066
|
+
export declare const addonsSitelockSsoV2: (addonId: number, params?: AddonsSitelockSsoV2Params, options?: AxiosRequestConfig) => Promise<AxiosResponse<AddonsSitelockSsoV2200>>;
|
|
2067
|
+
export declare const getAddonsSitelockSsoV2QueryKey: (addonId: number, params?: AddonsSitelockSsoV2Params) => (string | AddonsSitelockSsoV2Params)[];
|
|
2068
|
+
export declare type AddonsSitelockSsoV2QueryResult = NonNullable<Awaited<ReturnType<typeof addonsSitelockSsoV2>>>;
|
|
2069
|
+
export declare type AddonsSitelockSsoV2QueryError = AxiosError<unknown>;
|
|
2070
|
+
export declare const useAddonsSitelockSsoV2: <TData = AxiosResponse<AddonsSitelockSsoV2200, any>, TError = AxiosError<unknown, any>>(addonId: number, params?: AddonsSitelockSsoV2Params, options?: {
|
|
2071
|
+
query?: UseQueryOptions<AxiosResponse<AddonsSitelockSsoV2200, any>, TError, TData, QueryKey> | undefined;
|
|
2072
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
2073
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
2074
|
+
queryKey: QueryKey;
|
|
2075
|
+
};
|
|
2062
2076
|
/**
|
|
2063
2077
|
* Returns the hosting server nameservers information
|
|
2064
2078
|
* @summary hosting server nameservers info
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.889.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useInfiniteQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -1522,7 +1522,7 @@ export const useSitesAccessLogsInfinite = (siteId, params, options) => {
|
|
|
1522
1522
|
var _a;
|
|
1523
1523
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1524
1524
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
|
|
1525
|
-
const queryFn = () => sitesAccessLogs(siteId, params, axiosOptions);
|
|
1525
|
+
const queryFn = ({ pageParam }) => sitesAccessLogs(siteId, Object.assign({ scroll_id: pageParam }, params), axiosOptions);
|
|
1526
1526
|
const query = useInfiniteQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
|
|
1527
1527
|
query.queryKey = queryKey;
|
|
1528
1528
|
return query;
|
|
@@ -1548,7 +1548,7 @@ export const useSitesErrorLogsInfinite = (siteId, params, options) => {
|
|
|
1548
1548
|
var _a;
|
|
1549
1549
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1550
1550
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
|
|
1551
|
-
const queryFn = () => sitesErrorLogs(siteId, params, axiosOptions);
|
|
1551
|
+
const queryFn = ({ pageParam }) => sitesErrorLogs(siteId, Object.assign({ scroll_id: pageParam }, params), axiosOptions);
|
|
1552
1552
|
const query = useInfiniteQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
|
|
1553
1553
|
query.queryKey = queryKey;
|
|
1554
1554
|
return query;
|
|
@@ -2121,6 +2121,23 @@ export const useSitesVersion = (siteId, options) => {
|
|
|
2121
2121
|
query.queryKey = queryKey;
|
|
2122
2122
|
return query;
|
|
2123
2123
|
};
|
|
2124
|
+
/**
|
|
2125
|
+
* Returns an oauth login URL that can be used to access Sitelock dashboard for a user.
|
|
2126
|
+
* @summary sso
|
|
2127
|
+
*/
|
|
2128
|
+
export const addonsSitelockSsoV2 = (addonId, params, options) => {
|
|
2129
|
+
return axios.get(`/v2/addons/sitelock/${addonId}/sso`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
2130
|
+
};
|
|
2131
|
+
export const getAddonsSitelockSsoV2QueryKey = (addonId, params) => [`/v2/addons/sitelock/${addonId}/sso`, ...(params ? [params] : [])];
|
|
2132
|
+
export const useAddonsSitelockSsoV2 = (addonId, params, options) => {
|
|
2133
|
+
var _a;
|
|
2134
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
2135
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAddonsSitelockSsoV2QueryKey(addonId, params);
|
|
2136
|
+
const queryFn = ({ signal }) => addonsSitelockSsoV2(addonId, params, Object.assign({ signal }, axiosOptions));
|
|
2137
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(addonId) }, queryOptions));
|
|
2138
|
+
query.queryKey = queryKey;
|
|
2139
|
+
return query;
|
|
2140
|
+
};
|
|
2124
2141
|
/**
|
|
2125
2142
|
* Returns the hosting server nameservers information
|
|
2126
2143
|
* @summary hosting server nameservers info
|
package/src/index.msw.d.ts
CHANGED
|
@@ -802,6 +802,11 @@ export declare const getSitesVersionMock: () => {
|
|
|
802
802
|
latest: string | undefined;
|
|
803
803
|
update: boolean | undefined;
|
|
804
804
|
};
|
|
805
|
+
export declare const getAddonsSitelockSsoV2Mock: () => {
|
|
806
|
+
site_url: string | null | undefined;
|
|
807
|
+
sitelock_id: string | undefined;
|
|
808
|
+
url: string | undefined;
|
|
809
|
+
};
|
|
805
810
|
export declare const getHostingNameserversV2Mock: () => {
|
|
806
811
|
id: number;
|
|
807
812
|
is_default: string | undefined;
|
package/src/index.msw.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.889.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -137,6 +137,7 @@ export const getSitesSsoMock = () => ({ sso: faker.helpers.arrayElement([faker.h
|
|
|
137
137
|
export const getSiteStatusMock = () => ({ url: faker.helpers.arrayElement([faker.random.word(), undefined]), pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]), cloudflare_ready: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
138
138
|
export const getSiteUsersMock = () => ({ users: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ display_name: faker.helpers.arrayElement([faker.random.word(), undefined]), id: faker.datatype.number({ min: undefined, max: undefined }), meta: faker.helpers.arrayElement([{ maestro_web_pro: faker.helpers.arrayElement([faker.random.word(), undefined]), maestro_wpp_identifier: faker.helpers.arrayElement([faker.random.word(), undefined]) }, undefined]), post_count: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), role: faker.random.word(), user_email: faker.random.word(), user_id: faker.datatype.number({ min: undefined, max: undefined }), user_login: faker.random.word(), user_nicename: faker.random.word() })) });
|
|
139
139
|
export const getSitesVersionMock = () => ({ current: faker.helpers.arrayElement([faker.random.word(), undefined]), latest: faker.helpers.arrayElement([faker.random.word(), undefined]), update: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
140
|
+
export const getAddonsSitelockSsoV2Mock = () => ({ site_url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), sitelock_id: faker.helpers.arrayElement([faker.random.word(), undefined]), url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
140
141
|
export const getHostingNameserversV2Mock = () => ({ id: faker.datatype.number({ min: undefined, max: undefined }), is_default: faker.helpers.arrayElement([faker.random.word(), undefined]), brand: faker.random.word(), hosts: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ host: faker.helpers.arrayElement([faker.random.word(), undefined]), ips: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) })) });
|
|
141
142
|
export const getHostingSitesV2Mock = () => ({ total: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), page: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), limit: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), max_sites: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]), used_sites: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), available_sites: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]), items: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), account_back_ref: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), account_id: faker.helpers.arrayElement([faker.random.word(), undefined]), confirmed: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), datacenter: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), date_added: faker.helpers.arrayElement([faker.random.word(), undefined]), date_modified: faker.helpers.arrayElement([faker.random.word(), undefined]), detected_type: faker.helpers.arrayElement([faker.random.word(), undefined]), docroot: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), edge_cache: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), is_primary: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), path: faker.helpers.arrayElement([faker.random.word(), undefined]), handler_404: faker.helpers.arrayElement([faker.random.word(), undefined]), domain: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), base_domain: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), last_error: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), migration_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), php_version: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), url_is_provisional: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), version: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), installed_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_url_data: faker.helpers.arrayElement([{ error: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), stage: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), domain: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), base_domain: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), is_temp: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) }, undefined]), version_ptr: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), resources: faker.helpers.arrayElement([{ storage: faker.helpers.arrayElement([{ available: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]), total: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]), unit: faker.helpers.arrayElement([faker.random.word(), undefined]), used: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]) }, undefined]), workers: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]) }, undefined]) })), undefined]) });
|
|
142
143
|
export const getSshKeyListV2Mock = () => ({ rows: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ name: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), mtime: faker.helpers.arrayElement([faker.random.word(), undefined]), key: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
@@ -403,6 +404,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
403
404
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSiteUsersMock()));
|
|
404
405
|
}), rest.get('*/v1/sites/:siteId/version', (_req, res, ctx) => {
|
|
405
406
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesVersionMock()));
|
|
407
|
+
}), rest.get('*/v2/addons/sitelock/:addonId/sso', (_req, res, ctx) => {
|
|
408
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getAddonsSitelockSsoV2Mock()));
|
|
406
409
|
}), rest.get('*/v2/hosting/:hostingId/nameservers', (_req, res, ctx) => {
|
|
407
410
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingNameserversV2Mock()));
|
|
408
411
|
}), rest.get('*/v2/hosting/:hostingId/sites', (_req, res, ctx) => {
|
package/src/index.schemas.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.889.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SitesDomainsV2200DomainsItem = {
|
|
9
9
|
id?: number;
|
|
@@ -106,18 +106,6 @@ export declare type SshKeyListV2200RowsItem = {
|
|
|
106
106
|
export declare type SshKeyListV2200 = {
|
|
107
107
|
rows?: SshKeyListV2200RowsItem[];
|
|
108
108
|
};
|
|
109
|
-
export declare type HostingSitesV2200 = {
|
|
110
|
-
total?: number;
|
|
111
|
-
page?: number;
|
|
112
|
-
limit?: number;
|
|
113
|
-
/** Maximum number of sites the customer can have. Null means 'unlimited'. */
|
|
114
|
-
max_sites?: number | null;
|
|
115
|
-
/** Current number of sites in use by the customer. its normal for this value to be different than the total number of sites in the list. */
|
|
116
|
-
used_sites?: number;
|
|
117
|
-
/** Remaining number of sites the customer can create. Max sites - used sites. Null means 'unlimited'. */
|
|
118
|
-
available_sites?: number | null;
|
|
119
|
-
items?: HostingSitesV2200ItemsItem[];
|
|
120
|
-
};
|
|
121
109
|
export declare type HostingSitesV2200ItemsItemResourcesStorage = {
|
|
122
110
|
available?: number | null;
|
|
123
111
|
total?: number | null;
|
|
@@ -174,6 +162,18 @@ export declare type HostingSitesV2200ItemsItem = {
|
|
|
174
162
|
version_ptr?: string | null;
|
|
175
163
|
resources?: HostingSitesV2200ItemsItemResources;
|
|
176
164
|
};
|
|
165
|
+
export declare type HostingSitesV2200 = {
|
|
166
|
+
total?: number;
|
|
167
|
+
page?: number;
|
|
168
|
+
limit?: number;
|
|
169
|
+
/** Maximum number of sites the customer can have. Null means 'unlimited'. */
|
|
170
|
+
max_sites?: number | null;
|
|
171
|
+
/** Current number of sites in use by the customer. its normal for this value to be different than the total number of sites in the list. */
|
|
172
|
+
used_sites?: number;
|
|
173
|
+
/** Remaining number of sites the customer can create. Max sites - used sites. Null means 'unlimited'. */
|
|
174
|
+
available_sites?: number | null;
|
|
175
|
+
items?: HostingSitesV2200ItemsItem[];
|
|
176
|
+
};
|
|
177
177
|
export declare type HostingNameserversV2200HostsItem = {
|
|
178
178
|
host?: string;
|
|
179
179
|
ips?: string[];
|
|
@@ -184,6 +184,17 @@ export declare type HostingNameserversV2200 = {
|
|
|
184
184
|
brand: string;
|
|
185
185
|
hosts: HostingNameserversV2200HostsItem[];
|
|
186
186
|
};
|
|
187
|
+
export declare type AddonsSitelockSsoV2200 = {
|
|
188
|
+
site_url?: string | null;
|
|
189
|
+
sitelock_id?: string;
|
|
190
|
+
url?: string;
|
|
191
|
+
};
|
|
192
|
+
export declare type AddonsSitelockSsoV2Params = {
|
|
193
|
+
/**
|
|
194
|
+
* fetch the sso data based on source(fg/hal)
|
|
195
|
+
*/
|
|
196
|
+
source?: string;
|
|
197
|
+
};
|
|
187
198
|
export declare type SitesVersion200 = {
|
|
188
199
|
current?: string;
|
|
189
200
|
latest?: string;
|