@newfold/huapi-js 1.432.0 → 1.471.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 +48 -2
- package/src/index.js +47 -1
- package/src/index.msw.d.ts +7 -5
- package/src/index.msw.js +11 -2
- package/src/index.schemas.d.ts +18 -14
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.471.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, 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, DbUserList200, Domains200, DomainsParams, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, 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, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainUrl200, SitesDomainUrlBody, 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, 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, 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, DbUserList200, Domains200, DomainsParams, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, HostingOnboardingData200, HostingOnboardingDataUpdate200, HostingOnboardingDataUpdateBody, 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, 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, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, 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
|
/**
|
|
@@ -750,6 +750,37 @@ export declare const useHostingNameservers: <TData = AxiosResponse<HostingNamese
|
|
|
750
750
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
751
751
|
queryKey: QueryKey;
|
|
752
752
|
};
|
|
753
|
+
/**
|
|
754
|
+
* Returns onboarding data
|
|
755
|
+
* @summary Returns hosting onboarding data
|
|
756
|
+
*/
|
|
757
|
+
export declare const hostingOnboardingData: (hostingId: string, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingOnboardingData200>>;
|
|
758
|
+
export declare const getHostingOnboardingDataQueryKey: (hostingId: string) => string[];
|
|
759
|
+
export declare type HostingOnboardingDataQueryResult = NonNullable<Awaited<ReturnType<typeof hostingOnboardingData>>>;
|
|
760
|
+
export declare type HostingOnboardingDataQueryError = AxiosError<unknown>;
|
|
761
|
+
export declare const useHostingOnboardingData: <TData = AxiosResponse<HostingOnboardingData200, any>, TError = AxiosError<unknown, any>>(hostingId: string, options?: {
|
|
762
|
+
query?: UseQueryOptions<AxiosResponse<HostingOnboardingData200, any>, TError, TData, QueryKey> | undefined;
|
|
763
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
764
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
765
|
+
queryKey: QueryKey;
|
|
766
|
+
};
|
|
767
|
+
/**
|
|
768
|
+
* @summary Updates hosting onboarding data
|
|
769
|
+
*/
|
|
770
|
+
export declare const hostingOnboardingDataUpdate: (hostingId: string, hostingOnboardingDataUpdateBody: HostingOnboardingDataUpdateBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingOnboardingDataUpdate200>>;
|
|
771
|
+
export declare type HostingOnboardingDataUpdateMutationResult = NonNullable<Awaited<ReturnType<typeof hostingOnboardingDataUpdate>>>;
|
|
772
|
+
export declare type HostingOnboardingDataUpdateMutationBody = HostingOnboardingDataUpdateBody;
|
|
773
|
+
export declare type HostingOnboardingDataUpdateMutationError = AxiosError<unknown>;
|
|
774
|
+
export declare const useHostingOnboardingDataUpdate: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
|
|
775
|
+
mutation?: UseMutationOptions<AxiosResponse<HostingOnboardingDataUpdate200, any>, TError, {
|
|
776
|
+
hostingId: string;
|
|
777
|
+
data: HostingOnboardingDataUpdateBody;
|
|
778
|
+
}, TContext> | undefined;
|
|
779
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
780
|
+
} | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<HostingOnboardingDataUpdate200, any>, TError, {
|
|
781
|
+
hostingId: string;
|
|
782
|
+
data: HostingOnboardingDataUpdateBody;
|
|
783
|
+
}, TContext>;
|
|
753
784
|
/**
|
|
754
785
|
* Enable or disable shell access on an account by setting the shell.SSH key access must be established separately.
|
|
755
786
|
* @summary hosting shell toggle
|
|
@@ -1136,6 +1167,21 @@ export declare const useSitesDomainUrl: <TError = AxiosError<unknown, any>, TCon
|
|
|
1136
1167
|
siteId: number;
|
|
1137
1168
|
data: SitesDomainUrlBody;
|
|
1138
1169
|
}, TContext>;
|
|
1170
|
+
/**
|
|
1171
|
+
* Delete pending domain
|
|
1172
|
+
* @summary Delete pending domain
|
|
1173
|
+
*/
|
|
1174
|
+
export declare const sitePendingDomainDelete: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitePendingDomainDelete200>>;
|
|
1175
|
+
export declare type SitePendingDomainDeleteMutationResult = NonNullable<Awaited<ReturnType<typeof sitePendingDomainDelete>>>;
|
|
1176
|
+
export declare type SitePendingDomainDeleteMutationError = AxiosError<unknown>;
|
|
1177
|
+
export declare const useSitePendingDomainDelete: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
|
|
1178
|
+
mutation?: UseMutationOptions<AxiosResponse<SitePendingDomainDelete200, any>, TError, {
|
|
1179
|
+
siteId: number;
|
|
1180
|
+
}, TContext> | undefined;
|
|
1181
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
1182
|
+
} | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitePendingDomainDelete200, any>, TError, {
|
|
1183
|
+
siteId: number;
|
|
1184
|
+
}, TContext>;
|
|
1139
1185
|
/**
|
|
1140
1186
|
* cache purge site and url
|
|
1141
1187
|
* @summary cache purge url
|
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.471.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -764,6 +764,37 @@ export const useHostingNameservers = (hostingId, options) => {
|
|
|
764
764
|
query.queryKey = queryKey;
|
|
765
765
|
return query;
|
|
766
766
|
};
|
|
767
|
+
/**
|
|
768
|
+
* Returns onboarding data
|
|
769
|
+
* @summary Returns hosting onboarding data
|
|
770
|
+
*/
|
|
771
|
+
export const hostingOnboardingData = (hostingId, options) => {
|
|
772
|
+
return axios.get(`/v1/hosting/${hostingId}/onboarding`, options);
|
|
773
|
+
};
|
|
774
|
+
export const getHostingOnboardingDataQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/onboarding`];
|
|
775
|
+
export const useHostingOnboardingData = (hostingId, options) => {
|
|
776
|
+
var _a;
|
|
777
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
778
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingOnboardingDataQueryKey(hostingId);
|
|
779
|
+
const queryFn = ({ signal }) => hostingOnboardingData(hostingId, Object.assign({ signal }, axiosOptions));
|
|
780
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
|
|
781
|
+
query.queryKey = queryKey;
|
|
782
|
+
return query;
|
|
783
|
+
};
|
|
784
|
+
/**
|
|
785
|
+
* @summary Updates hosting onboarding data
|
|
786
|
+
*/
|
|
787
|
+
export const hostingOnboardingDataUpdate = (hostingId, hostingOnboardingDataUpdateBody, options) => {
|
|
788
|
+
return axios.put(`/v1/hosting/${hostingId}/onboarding`, hostingOnboardingDataUpdateBody, options);
|
|
789
|
+
};
|
|
790
|
+
export const useHostingOnboardingDataUpdate = (options) => {
|
|
791
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
792
|
+
const mutationFn = (props) => {
|
|
793
|
+
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
794
|
+
return hostingOnboardingDataUpdate(hostingId, data, axiosOptions);
|
|
795
|
+
};
|
|
796
|
+
return useMutation(mutationFn, mutationOptions);
|
|
797
|
+
};
|
|
767
798
|
/**
|
|
768
799
|
* Enable or disable shell access on an account by setting the shell.SSH key access must be established separately.
|
|
769
800
|
* @summary hosting shell toggle
|
|
@@ -1171,6 +1202,21 @@ export const useSitesDomainUrl = (options) => {
|
|
|
1171
1202
|
};
|
|
1172
1203
|
return useMutation(mutationFn, mutationOptions);
|
|
1173
1204
|
};
|
|
1205
|
+
/**
|
|
1206
|
+
* Delete pending domain
|
|
1207
|
+
* @summary Delete pending domain
|
|
1208
|
+
*/
|
|
1209
|
+
export const sitePendingDomainDelete = (siteId, options) => {
|
|
1210
|
+
return axios.delete(`/v1/sites/${siteId}/pending-domain`, options);
|
|
1211
|
+
};
|
|
1212
|
+
export const useSitePendingDomainDelete = (options) => {
|
|
1213
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1214
|
+
const mutationFn = (props) => {
|
|
1215
|
+
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1216
|
+
return sitePendingDomainDelete(siteId, axiosOptions);
|
|
1217
|
+
};
|
|
1218
|
+
return useMutation(mutationFn, mutationOptions);
|
|
1219
|
+
};
|
|
1174
1220
|
/**
|
|
1175
1221
|
* cache purge site and url
|
|
1176
1222
|
* @summary cache purge url
|
package/src/index.msw.d.ts
CHANGED
|
@@ -271,6 +271,12 @@ export declare const getHostingMigrationSiteScanStatusMock: () => {
|
|
|
271
271
|
export declare const getHostingNameserversMock: () => {
|
|
272
272
|
nameservers: string[];
|
|
273
273
|
};
|
|
274
|
+
export declare const getHostingOnboardingDataMock: () => {
|
|
275
|
+
completed: boolean | undefined;
|
|
276
|
+
};
|
|
277
|
+
export declare const getHostingOnboardingDataUpdateMock: () => {
|
|
278
|
+
completed: boolean | undefined;
|
|
279
|
+
};
|
|
274
280
|
export declare const getHostingShellToggleMock: () => {
|
|
275
281
|
enabled: boolean | undefined;
|
|
276
282
|
};
|
|
@@ -354,13 +360,8 @@ export declare const getSitesInfoMock: () => {
|
|
|
354
360
|
status: string;
|
|
355
361
|
url: string;
|
|
356
362
|
version: string;
|
|
357
|
-
versionLatest: string | undefined;
|
|
358
363
|
php_version: string | null | undefined;
|
|
359
|
-
updatable: boolean | undefined;
|
|
360
364
|
pending_url: string | undefined;
|
|
361
|
-
meta: {
|
|
362
|
-
pending_url: string | undefined;
|
|
363
|
-
} | undefined;
|
|
364
365
|
};
|
|
365
366
|
export declare const getSiteUpdateMock: () => {
|
|
366
367
|
success: boolean;
|
|
@@ -434,6 +435,7 @@ export declare const getSitesDomainMock: () => {
|
|
|
434
435
|
export declare const getSitesDomainUrlMock: () => {
|
|
435
436
|
success: boolean | undefined;
|
|
436
437
|
};
|
|
438
|
+
export declare const getSitePendingDomainDeleteMock: () => {};
|
|
437
439
|
export declare const getSitesPerformanceCachepurgeMock: () => {
|
|
438
440
|
success: boolean | undefined;
|
|
439
441
|
};
|
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.471.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -54,6 +54,8 @@ export const getHostingMigrationsEventMock = () => ({ success: faker.helpers.arr
|
|
|
54
54
|
export const getHostingMigrationInfoMock = () => ({ migration_id: faker.helpers.arrayElement([faker.random.word(), undefined]), domain: faker.helpers.arrayElement([faker.random.word(), undefined]), site_url: faker.helpers.arrayElement([faker.random.word(), undefined]), hostname: faker.helpers.arrayElement([faker.random.word(), undefined]), feasible: faker.helpers.arrayElement([faker.random.word(), undefined]), source_type: faker.helpers.arrayElement([faker.random.word(), undefined]), product_type: faker.helpers.arrayElement([faker.random.word(), undefined]), incoming_domain: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
55
55
|
export const getHostingMigrationSiteScanStatusMock = () => ({ transferable: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), callback_url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
56
56
|
export const getHostingNameserversMock = () => ({ nameservers: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())) });
|
|
57
|
+
export const getHostingOnboardingDataMock = () => ({ completed: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
58
|
+
export const getHostingOnboardingDataUpdateMock = () => ({ completed: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
57
59
|
export const getHostingShellToggleMock = () => ({ enabled: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
58
60
|
export const getHostingShellInfoMock = () => ({ enabled: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
59
61
|
export const getHostingSitesMock = () => ({ n_rows: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), n_pages: 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.datatype.number({ min: undefined, max: undefined }), undefined]), rows: 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]), pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]), meta: faker.helpers.arrayElement([{ pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]) }, undefined]) })), undefined]) });
|
|
@@ -66,7 +68,7 @@ export const getSshKeyMock = () => ({ deleted: faker.helpers.arrayElement([faker
|
|
|
66
68
|
export const getSshKeyGenerateMock = () => ({ key_name: faker.helpers.arrayElement([faker.random.word(), undefined]), private_key_path: faker.helpers.arrayElement([faker.random.word(), undefined]), public_key_path: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
67
69
|
export const getSsoMock = () => ({ url: faker.random.word() });
|
|
68
70
|
export const getSitesListMock = () => ({ 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]) })), undefined]) });
|
|
69
|
-
export const getSitesInfoMock = () => ({ id: faker.random.word(), docroot: faker.random.word(), uuid: faker.random.word(), date_added: faker.random.word(), date_modified: faker.random.word(), name: faker.random.word(), type: faker.random.word(), subtype: faker.random.word(), status: faker.random.word(), url: faker.random.word(), version: faker.random.word(),
|
|
71
|
+
export const getSitesInfoMock = () => ({ id: faker.random.word(), docroot: faker.random.word(), uuid: faker.random.word(), date_added: faker.random.word(), date_modified: faker.random.word(), name: faker.random.word(), type: faker.random.word(), subtype: faker.random.word(), status: faker.random.word(), url: faker.random.word(), version: faker.random.word(), php_version: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
70
72
|
export const getSiteUpdateMock = () => ({ success: faker.datatype.boolean() });
|
|
71
73
|
export const getSiteMock = () => ({ success: faker.datatype.boolean() });
|
|
72
74
|
export const getSitesAutoupdatesInfoMock = () => ({ plugins: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), core: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), themes: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
@@ -79,6 +81,7 @@ export const getJetpackBackupStatusMock = () => ({ has_active_plugin: faker.help
|
|
|
79
81
|
export const getSitesDnsMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), source: faker.helpers.arrayElement([faker.random.word(), undefined]), records: 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]), value: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
80
82
|
export const getSitesDomainMock = () => ({ connected: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), a_match: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), nameserver_match: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), detected: faker.helpers.arrayElement([{ a: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), ns: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) }, undefined]), wanted: faker.helpers.arrayElement([{ a: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), ns: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) }, undefined]) });
|
|
81
83
|
export const getSitesDomainUrlMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
84
|
+
export const getSitePendingDomainDeleteMock = () => ({});
|
|
82
85
|
export const getSitesPerformanceCachepurgeMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
83
86
|
export const getSitesPerformanceEnduranceCacheLevelStatusMock = () => ({ endurance_cache_level: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
84
87
|
export const getSitesPerformanceEnduranceCacheLevelMock = () => ({ options: faker.helpers.arrayElement([{}, undefined]) });
|
|
@@ -206,6 +209,10 @@ export const getHostingUAPIMSW = () => [
|
|
|
206
209
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationSiteScanStatusMock()));
|
|
207
210
|
}), rest.get('*/v1/hosting/:hostingId/nameservers', (_req, res, ctx) => {
|
|
208
211
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingNameserversMock()));
|
|
212
|
+
}), rest.get('*/v1/hosting/:hostingId/onboarding', (_req, res, ctx) => {
|
|
213
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingOnboardingDataMock()));
|
|
214
|
+
}), rest.put('*/v1/hosting/:hostingId/onboarding', (_req, res, ctx) => {
|
|
215
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingOnboardingDataUpdateMock()));
|
|
209
216
|
}), rest.put('*/v1/hosting/:hostingId/shell', (_req, res, ctx) => {
|
|
210
217
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingShellToggleMock()));
|
|
211
218
|
}), rest.get('*/v1/hosting/:hostingId/shell', (_req, res, ctx) => {
|
|
@@ -256,6 +263,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
256
263
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainMock()));
|
|
257
264
|
}), rest.post('*/v1/sites/:siteId/domain', (_req, res, ctx) => {
|
|
258
265
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainUrlMock()));
|
|
266
|
+
}), rest.delete('*/v1/sites/:siteId/pending-domain', (_req, res, ctx) => {
|
|
267
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitePendingDomainDeleteMock()));
|
|
259
268
|
}), rest.post('*/v1/sites/:siteId/performance/cachepurge', (_req, res, ctx) => {
|
|
260
269
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesPerformanceCachepurgeMock()));
|
|
261
270
|
}), rest.get('*/v1/sites/:siteId/performance/endurance_cache_level', (_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.471.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SshKeyListV2200RowsItem = {
|
|
9
9
|
name?: string;
|
|
@@ -60,7 +60,7 @@ export declare type SiteUsers200 = {
|
|
|
60
60
|
export declare type SiteStatus200 = {
|
|
61
61
|
url?: string;
|
|
62
62
|
pending_url?: string;
|
|
63
|
-
cloudflare_ready?: boolean;
|
|
63
|
+
cloudflare_ready?: boolean | null;
|
|
64
64
|
};
|
|
65
65
|
export declare type SitesSso200 = {
|
|
66
66
|
sso?: string;
|
|
@@ -231,6 +231,9 @@ export declare type SitesPerformanceCachepurgeBody = {
|
|
|
231
231
|
/** Pass either 0 or 1 */
|
|
232
232
|
epc?: number;
|
|
233
233
|
};
|
|
234
|
+
export declare type SitePendingDomainDelete200 = {
|
|
235
|
+
[key: string]: any;
|
|
236
|
+
};
|
|
234
237
|
export declare type SitesDomainUrl200 = {
|
|
235
238
|
success?: boolean;
|
|
236
239
|
};
|
|
@@ -334,9 +337,6 @@ export declare type SiteUpdateBody = {
|
|
|
334
337
|
/** filesystem path that follows the domain in the url */
|
|
335
338
|
path?: string;
|
|
336
339
|
};
|
|
337
|
-
export declare type SitesInfo200Meta = {
|
|
338
|
-
pending_url?: string;
|
|
339
|
-
} | null;
|
|
340
340
|
export declare type SitesInfo200 = {
|
|
341
341
|
id: string;
|
|
342
342
|
docroot: string;
|
|
@@ -349,12 +349,9 @@ export declare type SitesInfo200 = {
|
|
|
349
349
|
status: string;
|
|
350
350
|
url: string;
|
|
351
351
|
version: string;
|
|
352
|
-
versionLatest?: string;
|
|
353
352
|
/** The Php Version. If unable to determine, it will be NULL */
|
|
354
353
|
php_version?: string | null;
|
|
355
|
-
updatable?: boolean;
|
|
356
354
|
pending_url?: string;
|
|
357
|
-
meta?: SitesInfo200Meta;
|
|
358
355
|
};
|
|
359
356
|
export declare type SitesList200ItemsItem = {
|
|
360
357
|
id?: string;
|
|
@@ -531,6 +528,15 @@ export declare type HostingShellToggleBody = {
|
|
|
531
528
|
/** boolean flag to enable or disable hosting shell */
|
|
532
529
|
enabled: boolean;
|
|
533
530
|
};
|
|
531
|
+
export declare type HostingOnboardingDataUpdate200 = {
|
|
532
|
+
completed?: boolean;
|
|
533
|
+
};
|
|
534
|
+
export declare type HostingOnboardingDataUpdateBody = {
|
|
535
|
+
completed?: boolean;
|
|
536
|
+
};
|
|
537
|
+
export declare type HostingOnboardingData200 = {
|
|
538
|
+
completed?: boolean;
|
|
539
|
+
};
|
|
534
540
|
export declare type HostingNameservers200 = {
|
|
535
541
|
nameservers: string[];
|
|
536
542
|
};
|
|
@@ -758,17 +764,15 @@ export declare type Cron200 = {
|
|
|
758
764
|
success?: boolean;
|
|
759
765
|
};
|
|
760
766
|
export declare type CronBody = {
|
|
761
|
-
/** unique key for cron that is being updated
|
|
767
|
+
/** unique key for cron that is being updated */
|
|
762
768
|
key: number;
|
|
763
769
|
};
|
|
764
770
|
export declare type UpdateCron200 = {
|
|
765
771
|
key?: number;
|
|
766
772
|
};
|
|
767
773
|
export declare type UpdateCronBody = {
|
|
768
|
-
/** unique key for cron that is being updated
|
|
769
|
-
key
|
|
770
|
-
/** line number for cron that is being updated (one of key or line is required) */
|
|
771
|
-
line?: number;
|
|
774
|
+
/** unique key for cron that is being updated */
|
|
775
|
+
key: number;
|
|
772
776
|
/** command to run as a cron, needs to be a valid string */
|
|
773
777
|
command: string;
|
|
774
778
|
/** The day of the month on which the cron job runs. An integer between 1 and 31. * - Every day. *\/2 - Every other day. 1,15 - On the 1st and 15th of the month. */
|
|
@@ -781,7 +785,7 @@ export declare type UpdateCronBody = {
|
|
|
781
785
|
month: string;
|
|
782
786
|
/** The day of the week on which the cron job runs, 0-6. 0 - Sunday. 1 - Monday. 2 - Tuesday. 3 - Wednesday. 4 - Thursday. 5 - Friday. 6 - Saturday. * - Every day. */
|
|
783
787
|
weekday: string;
|
|
784
|
-
/** Type of
|
|
788
|
+
/** Type of command (command, variable, comment, blank, unparsed) */
|
|
785
789
|
type?: string;
|
|
786
790
|
};
|
|
787
791
|
export declare type AddCron400 = {
|