@newfold/huapi-js 1.559.0 → 1.567.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/package.json +1 -1
- package/src/index.d.ts +17 -2
- package/src/index.js +19 -1
- package/src/index.msw.d.ts +10 -0
- package/src/index.msw.js +5 -2
- package/src/index.schemas.d.ts +12 -1
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.567.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import type { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
10
10
|
import type { UseQueryOptions, UseMutationOptions, UseQueryResult, QueryKey } from '@tanstack/react-query';
|
|
11
|
-
import type { 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, 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, 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, HostingSites200, 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, SiteAddonCloudflare200, SiteAddonCloudflare400, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainUrl200, SitesDomainUrlBody, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SiteSettingsAutoupdatePlugins200, SitesSettingsAutoupdates200, SitesSettingsAutoupdatesCore200, SitesSettingsAutoupdatesCoreBody, SitesSettingsAutoupdatesTheme200, SitesSettingsAutoupdatesThemeBody, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingSitesV2200, SshKeyListV2200 } from './index.schemas';
|
|
11
|
+
import type { 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, 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, 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, HostingSites200, 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, SiteAddonCloudflare200, SiteAddonCloudflare400, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainUrl200, SitesDomainUrlBody, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SiteSettingsAutoupdatePlugins200, SitesSettingsAutoupdates200, SitesSettingsAutoupdatesCore200, SitesSettingsAutoupdatesCoreBody, SitesSettingsAutoupdatesTheme200, SitesSettingsAutoupdatesThemeBody, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200 } 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
|
/**
|
|
@@ -862,6 +862,7 @@ export declare const useHostingMigrationSiteScanStatus: <TData = AxiosResponse<H
|
|
|
862
862
|
};
|
|
863
863
|
/**
|
|
864
864
|
* Returns the hosting brand nameservers
|
|
865
|
+
* @deprecated
|
|
865
866
|
* @summary hosting nameservers
|
|
866
867
|
*/
|
|
867
868
|
export declare const hostingNameservers: (hostingId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingNameservers200>>;
|
|
@@ -1822,6 +1823,20 @@ export declare const useSitesVersion: <TData = AxiosResponse<SitesVersion200, an
|
|
|
1822
1823
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
1823
1824
|
queryKey: QueryKey;
|
|
1824
1825
|
};
|
|
1826
|
+
/**
|
|
1827
|
+
* Returns the hosting server nameservers information
|
|
1828
|
+
* @summary hosting server nameservers info
|
|
1829
|
+
*/
|
|
1830
|
+
export declare const hostingNameserversV2: (hostingId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingNameserversV2200>>;
|
|
1831
|
+
export declare const getHostingNameserversV2QueryKey: (hostingId: number) => string[];
|
|
1832
|
+
export declare type HostingNameserversV2QueryResult = NonNullable<Awaited<ReturnType<typeof hostingNameserversV2>>>;
|
|
1833
|
+
export declare type HostingNameserversV2QueryError = AxiosError<unknown>;
|
|
1834
|
+
export declare const useHostingNameserversV2: <TData = AxiosResponse<HostingNameserversV2200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
|
|
1835
|
+
query?: UseQueryOptions<AxiosResponse<HostingNameserversV2200, any>, TError, TData, QueryKey> | undefined;
|
|
1836
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
1837
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
1838
|
+
queryKey: QueryKey;
|
|
1839
|
+
};
|
|
1825
1840
|
/**
|
|
1826
1841
|
* Returns a list of sites.
|
|
1827
1842
|
* @summary sites list v2
|
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.567.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -880,6 +880,7 @@ export const useHostingMigrationSiteScanStatus = (hostingId, params, options) =>
|
|
|
880
880
|
};
|
|
881
881
|
/**
|
|
882
882
|
* Returns the hosting brand nameservers
|
|
883
|
+
* @deprecated
|
|
883
884
|
* @summary hosting nameservers
|
|
884
885
|
*/
|
|
885
886
|
export const hostingNameservers = (hostingId, options) => {
|
|
@@ -1882,6 +1883,23 @@ export const useSitesVersion = (siteId, options) => {
|
|
|
1882
1883
|
query.queryKey = queryKey;
|
|
1883
1884
|
return query;
|
|
1884
1885
|
};
|
|
1886
|
+
/**
|
|
1887
|
+
* Returns the hosting server nameservers information
|
|
1888
|
+
* @summary hosting server nameservers info
|
|
1889
|
+
*/
|
|
1890
|
+
export const hostingNameserversV2 = (hostingId, options) => {
|
|
1891
|
+
return axios.get(`/v2/hosting/${hostingId}/nameservers`, options);
|
|
1892
|
+
};
|
|
1893
|
+
export const getHostingNameserversV2QueryKey = (hostingId) => [`/v2/hosting/${hostingId}/nameservers`];
|
|
1894
|
+
export const useHostingNameserversV2 = (hostingId, options) => {
|
|
1895
|
+
var _a;
|
|
1896
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1897
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingNameserversV2QueryKey(hostingId);
|
|
1898
|
+
const queryFn = ({ signal }) => hostingNameserversV2(hostingId, Object.assign({ signal }, axiosOptions));
|
|
1899
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
|
|
1900
|
+
query.queryKey = queryKey;
|
|
1901
|
+
return query;
|
|
1902
|
+
};
|
|
1885
1903
|
/**
|
|
1886
1904
|
* Returns a list of sites.
|
|
1887
1905
|
* @summary sites list v2
|
package/src/index.msw.d.ts
CHANGED
|
@@ -149,6 +149,7 @@ export declare const getHostingCapabilitiesMock: () => {
|
|
|
149
149
|
cpanel: boolean | undefined;
|
|
150
150
|
whm: boolean | undefined;
|
|
151
151
|
advanced_hosting: boolean | undefined;
|
|
152
|
+
reset_password: boolean | undefined;
|
|
152
153
|
};
|
|
153
154
|
export declare const getAddonCloudflareMock: () => {
|
|
154
155
|
status: string | undefined;
|
|
@@ -651,6 +652,15 @@ export declare const getSitesVersionMock: () => {
|
|
|
651
652
|
latest: string | undefined;
|
|
652
653
|
update: boolean | undefined;
|
|
653
654
|
};
|
|
655
|
+
export declare const getHostingNameserversV2Mock: () => {
|
|
656
|
+
id: number;
|
|
657
|
+
is_default: string | undefined;
|
|
658
|
+
brand: string;
|
|
659
|
+
hosts: {
|
|
660
|
+
host: string | undefined;
|
|
661
|
+
ips: string[] | undefined;
|
|
662
|
+
}[];
|
|
663
|
+
};
|
|
654
664
|
export declare const getHostingSitesV2Mock: () => {
|
|
655
665
|
total: number | undefined;
|
|
656
666
|
page: number | 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.567.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -32,7 +32,7 @@ export const getHostingAdvancedServerStatusMock = () => ({ status: faker.helpers
|
|
|
32
32
|
export const getHostingAdvancedPasswordMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
33
33
|
export const getHostingAdvancedSsoWhmMock = () => ({ url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
34
34
|
export const getHostingAdvancedSystemConsoleMock = () => ({ url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
35
|
-
export const getHostingCapabilitiesMock = () => ({ server_controls: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), sites: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), cpanel: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), whm: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), advanced_hosting: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
35
|
+
export const getHostingCapabilitiesMock = () => ({ server_controls: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), sites: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), cpanel: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), whm: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), advanced_hosting: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), reset_password: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
36
36
|
export const getAddonCloudflareMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
37
37
|
export const getListCronsMock = () => ({ rows: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ command: faker.helpers.arrayElement([faker.random.word(), undefined]), day: faker.helpers.arrayElement([faker.random.word(), undefined]), hour: faker.helpers.arrayElement([faker.random.word(), undefined]), key: faker.helpers.arrayElement([faker.random.word(), undefined]), line: faker.helpers.arrayElement([faker.random.word(), undefined]), minute: faker.helpers.arrayElement([faker.random.word(), undefined]), month: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), weekday: faker.helpers.arrayElement([faker.random.word(), undefined]), email: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
38
38
|
export const getAddCronMock = () => ({ key: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
@@ -123,6 +123,7 @@ export const getSitesSsoMock = () => ({ sso: faker.helpers.arrayElement([faker.r
|
|
|
123
123
|
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]) });
|
|
124
124
|
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() })) });
|
|
125
125
|
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]) });
|
|
126
|
+
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]) })) });
|
|
126
127
|
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.random.word(), undefined]), name: faker.helpers.arrayElement([faker.random.word(), undefined]), url: faker.helpers.arrayElement([faker.random.word(), undefined]), docroot: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]), migration_id: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
127
128
|
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]) });
|
|
128
129
|
export const getHostingUAPIMSW = () => [
|
|
@@ -358,6 +359,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
358
359
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSiteUsersMock()));
|
|
359
360
|
}), rest.get('*/v1/sites/:siteId/version', (_req, res, ctx) => {
|
|
360
361
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesVersionMock()));
|
|
362
|
+
}), rest.get('*/v2/hosting/:hostingId/nameservers', (_req, res, ctx) => {
|
|
363
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingNameserversV2Mock()));
|
|
361
364
|
}), rest.get('*/v2/hosting/:hostingId/sites', (_req, res, ctx) => {
|
|
362
365
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingSitesV2Mock()));
|
|
363
366
|
}), rest.get('*/v2/hosting/:hostingId/ssh/keys', (_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.567.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SshKeyListV2200RowsItem = {
|
|
9
9
|
name?: string;
|
|
@@ -36,6 +36,16 @@ export declare type HostingSitesV2200 = {
|
|
|
36
36
|
available_sites?: number | null;
|
|
37
37
|
items?: HostingSitesV2200ItemsItem[];
|
|
38
38
|
};
|
|
39
|
+
export declare type HostingNameserversV2200HostsItem = {
|
|
40
|
+
host?: string;
|
|
41
|
+
ips?: string[];
|
|
42
|
+
};
|
|
43
|
+
export declare type HostingNameserversV2200 = {
|
|
44
|
+
id: number;
|
|
45
|
+
is_default?: string;
|
|
46
|
+
brand: string;
|
|
47
|
+
hosts: HostingNameserversV2200HostsItem[];
|
|
48
|
+
};
|
|
39
49
|
export declare type SitesVersion200 = {
|
|
40
50
|
current?: string;
|
|
41
51
|
latest?: string;
|
|
@@ -963,6 +973,7 @@ export declare type HostingCapabilities200 = {
|
|
|
963
973
|
cpanel?: boolean;
|
|
964
974
|
whm?: boolean;
|
|
965
975
|
advanced_hosting?: boolean;
|
|
976
|
+
reset_password?: boolean;
|
|
966
977
|
};
|
|
967
978
|
export declare type HostingAdvancedSystemConsole200 = {
|
|
968
979
|
url?: string;
|