@newfold/huapi-js 1.538.0 → 1.558.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 +33 -3
- package/src/index.js +35 -2
- package/src/index.msw.d.ts +10 -3
- package/src/index.msw.js +9 -3
- package/src/index.schemas.d.ts +20 -4
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.558.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, 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, 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, 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
|
/**
|
|
@@ -414,7 +414,8 @@ export declare const useHostingCapabilities: <TData = AxiosResponse<HostingCapab
|
|
|
414
414
|
};
|
|
415
415
|
/**
|
|
416
416
|
* Creates cloudflare basic addon
|
|
417
|
-
* @
|
|
417
|
+
* @deprecated
|
|
418
|
+
* @summary Deprecated - Install cloudflare basic addon
|
|
418
419
|
*/
|
|
419
420
|
export declare const addonCloudflare: (hostingId: number, addonCloudflareBody: AddonCloudflareBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<AddonCloudflare200>>;
|
|
420
421
|
export declare type AddonCloudflareMutationResult = NonNullable<Awaited<ReturnType<typeof addonCloudflare>>>;
|
|
@@ -799,6 +800,20 @@ export declare const useHostingMigrations: <TError = AxiosError<unknown, any>, T
|
|
|
799
800
|
hostingId: string;
|
|
800
801
|
data: HostingMigrationsBody;
|
|
801
802
|
}, TContext>;
|
|
803
|
+
/**
|
|
804
|
+
* Checks if Migration ID exists, indicating the site migration is in progress or completed
|
|
805
|
+
* @summary Migration ID check
|
|
806
|
+
*/
|
|
807
|
+
export declare const hostingMigrationsCheck: (hostingId: number, params: HostingMigrationsCheckParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingMigrationsCheck200>>;
|
|
808
|
+
export declare const getHostingMigrationsCheckQueryKey: (hostingId: number, params: HostingMigrationsCheckParams) => (string | HostingMigrationsCheckParams)[];
|
|
809
|
+
export declare type HostingMigrationsCheckQueryResult = NonNullable<Awaited<ReturnType<typeof hostingMigrationsCheck>>>;
|
|
810
|
+
export declare type HostingMigrationsCheckQueryError = AxiosError<unknown>;
|
|
811
|
+
export declare const useHostingMigrationsCheck: <TData = AxiosResponse<HostingMigrationsCheck200, any>, TError = AxiosError<unknown, any>>(hostingId: number, params: HostingMigrationsCheckParams, options?: {
|
|
812
|
+
query?: UseQueryOptions<AxiosResponse<HostingMigrationsCheck200, any>, TError, TData, QueryKey> | undefined;
|
|
813
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
814
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
815
|
+
queryKey: QueryKey;
|
|
816
|
+
};
|
|
802
817
|
/**
|
|
803
818
|
* Post migration event to CWM
|
|
804
819
|
* @summary hosting migrations event
|
|
@@ -1244,6 +1259,21 @@ export declare const useJetpackBackupStatus: <TData = AxiosResponse<JetpackBacku
|
|
|
1244
1259
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
1245
1260
|
queryKey: QueryKey;
|
|
1246
1261
|
};
|
|
1262
|
+
/**
|
|
1263
|
+
* Creates cloudflare basic addon using site_id
|
|
1264
|
+
* @summary Install cloudflare basic addon using site_id
|
|
1265
|
+
*/
|
|
1266
|
+
export declare const siteAddonCloudflare: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SiteAddonCloudflare200>>;
|
|
1267
|
+
export declare type SiteAddonCloudflareMutationResult = NonNullable<Awaited<ReturnType<typeof siteAddonCloudflare>>>;
|
|
1268
|
+
export declare type SiteAddonCloudflareMutationError = AxiosError<SiteAddonCloudflare400>;
|
|
1269
|
+
export declare const useSiteAddonCloudflare: <TError = AxiosError<SiteAddonCloudflare400, any>, TContext = unknown>(options?: {
|
|
1270
|
+
mutation?: UseMutationOptions<AxiosResponse<SiteAddonCloudflare200, any>, TError, {
|
|
1271
|
+
siteId: number;
|
|
1272
|
+
}, TContext> | undefined;
|
|
1273
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
1274
|
+
} | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SiteAddonCloudflare200, any>, TError, {
|
|
1275
|
+
siteId: number;
|
|
1276
|
+
}, TContext>;
|
|
1247
1277
|
/**
|
|
1248
1278
|
* Returns a list of DNS records for the site's domain.
|
|
1249
1279
|
* @summary dns
|
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.558.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -431,7 +431,8 @@ export const useHostingCapabilities = (hostingId, options) => {
|
|
|
431
431
|
};
|
|
432
432
|
/**
|
|
433
433
|
* Creates cloudflare basic addon
|
|
434
|
-
* @
|
|
434
|
+
* @deprecated
|
|
435
|
+
* @summary Deprecated - Install cloudflare basic addon
|
|
435
436
|
*/
|
|
436
437
|
export const addonCloudflare = (hostingId, addonCloudflareBody, options) => {
|
|
437
438
|
return axios.post(`/v1/hosting/${hostingId}/cloudflare`, addonCloudflareBody, options);
|
|
@@ -811,6 +812,23 @@ export const useHostingMigrations = (options) => {
|
|
|
811
812
|
};
|
|
812
813
|
return useMutation(mutationFn, mutationOptions);
|
|
813
814
|
};
|
|
815
|
+
/**
|
|
816
|
+
* Checks if Migration ID exists, indicating the site migration is in progress or completed
|
|
817
|
+
* @summary Migration ID check
|
|
818
|
+
*/
|
|
819
|
+
export const hostingMigrationsCheck = (hostingId, params, options) => {
|
|
820
|
+
return axios.get(`/v1/hosting/${hostingId}/migrations/check`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
|
|
821
|
+
};
|
|
822
|
+
export const getHostingMigrationsCheckQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/check`, ...(params ? [params] : [])];
|
|
823
|
+
export const useHostingMigrationsCheck = (hostingId, params, options) => {
|
|
824
|
+
var _a;
|
|
825
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
826
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationsCheckQueryKey(hostingId, params);
|
|
827
|
+
const queryFn = ({ signal }) => hostingMigrationsCheck(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
828
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
|
|
829
|
+
query.queryKey = queryKey;
|
|
830
|
+
return query;
|
|
831
|
+
};
|
|
814
832
|
/**
|
|
815
833
|
* Post migration event to CWM
|
|
816
834
|
* @summary hosting migrations event
|
|
@@ -1283,6 +1301,21 @@ export const useJetpackBackupStatus = (siteId, options) => {
|
|
|
1283
1301
|
query.queryKey = queryKey;
|
|
1284
1302
|
return query;
|
|
1285
1303
|
};
|
|
1304
|
+
/**
|
|
1305
|
+
* Creates cloudflare basic addon using site_id
|
|
1306
|
+
* @summary Install cloudflare basic addon using site_id
|
|
1307
|
+
*/
|
|
1308
|
+
export const siteAddonCloudflare = (siteId, options) => {
|
|
1309
|
+
return axios.post(`/v1/sites/${siteId}/cloudflare`, undefined, options);
|
|
1310
|
+
};
|
|
1311
|
+
export const useSiteAddonCloudflare = (options) => {
|
|
1312
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1313
|
+
const mutationFn = (props) => {
|
|
1314
|
+
const { siteId } = props !== null && props !== void 0 ? props : {};
|
|
1315
|
+
return siteAddonCloudflare(siteId, axiosOptions);
|
|
1316
|
+
};
|
|
1317
|
+
return useMutation(mutationFn, mutationOptions);
|
|
1318
|
+
};
|
|
1286
1319
|
/**
|
|
1287
1320
|
* Returns a list of DNS records for the site's domain.
|
|
1288
1321
|
* @summary dns
|
package/src/index.msw.d.ts
CHANGED
|
@@ -112,7 +112,6 @@ export declare const getHostingAccountMock: () => {
|
|
|
112
112
|
} | undefined;
|
|
113
113
|
panel: string | undefined;
|
|
114
114
|
plan_key: string | undefined;
|
|
115
|
-
server_subtype: string | undefined;
|
|
116
115
|
};
|
|
117
116
|
export declare const getHostingAddonsMock: () => {
|
|
118
117
|
rows: {
|
|
@@ -297,6 +296,10 @@ export declare const getHostingMigrationStatusMock: () => {
|
|
|
297
296
|
export declare const getHostingMigrationsMock: () => {
|
|
298
297
|
success: boolean | undefined;
|
|
299
298
|
};
|
|
299
|
+
export declare const getHostingMigrationsCheckMock: () => {
|
|
300
|
+
transferable: boolean | undefined;
|
|
301
|
+
description: string | undefined;
|
|
302
|
+
};
|
|
300
303
|
export declare const getHostingMigrationsEventMock: () => {
|
|
301
304
|
success: boolean | undefined;
|
|
302
305
|
};
|
|
@@ -472,6 +475,9 @@ export declare const getJetpackBackupStatusMock: () => {
|
|
|
472
475
|
has_active_addon: boolean | undefined;
|
|
473
476
|
addon_back_reference: string | null | undefined;
|
|
474
477
|
};
|
|
478
|
+
export declare const getSiteAddonCloudflareMock: () => {
|
|
479
|
+
addon_id: number | undefined;
|
|
480
|
+
};
|
|
475
481
|
export declare const getSitesDnsMock: () => {
|
|
476
482
|
success: boolean | undefined;
|
|
477
483
|
source: string | undefined;
|
|
@@ -609,10 +615,11 @@ export declare const getSitesSslMock: () => {
|
|
|
609
615
|
domain: string | undefined;
|
|
610
616
|
domain_dns_status: string | undefined;
|
|
611
617
|
expiration: string | null | undefined;
|
|
612
|
-
issuer: string | undefined;
|
|
613
|
-
product: string | undefined;
|
|
618
|
+
issuer: string | null | undefined;
|
|
619
|
+
product: string | null | undefined;
|
|
614
620
|
provider: string | null | undefined;
|
|
615
621
|
status: string | undefined;
|
|
622
|
+
type: string | null | undefined;
|
|
616
623
|
upgradeable: boolean | undefined;
|
|
617
624
|
};
|
|
618
625
|
export declare const getSitesSsoMock: () => {
|
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.558.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -25,7 +25,7 @@ export const getAddonsSitelockSsoMock = () => ({ site_url: faker.helpers.arrayEl
|
|
|
25
25
|
export const getAddonsCloudflareMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
26
26
|
export const getAddonsInfoMock = () => ({ id: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
27
27
|
export const getAddonsSpamexpertsSsoMock = () => ({ url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
28
|
-
export const getHostingAccountMock = () => ({ id: faker.helpers.arrayElement([faker.random.word(), undefined]), account_id: faker.helpers.arrayElement([faker.random.word(), undefined]), brand: faker.helpers.arrayElement([faker.random.word(), undefined]), platform: faker.helpers.arrayElement([faker.random.word(), undefined]), username: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), advanced: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), billing: faker.helpers.arrayElement([{ product_name: faker.helpers.arrayElement([faker.random.word(), undefined]) }, undefined]), panel: faker.helpers.arrayElement([faker.random.word(), undefined]), plan_key: faker.helpers.arrayElement([faker.random.word(), undefined])
|
|
28
|
+
export const getHostingAccountMock = () => ({ id: faker.helpers.arrayElement([faker.random.word(), undefined]), account_id: faker.helpers.arrayElement([faker.random.word(), undefined]), brand: faker.helpers.arrayElement([faker.random.word(), undefined]), platform: faker.helpers.arrayElement([faker.random.word(), undefined]), username: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), advanced: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), billing: faker.helpers.arrayElement([{ product_name: faker.helpers.arrayElement([faker.random.word(), undefined]) }, undefined]), panel: faker.helpers.arrayElement([faker.random.word(), undefined]), plan_key: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
29
29
|
export const getHostingAddonsMock = () => ({ 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]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), status_user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
30
30
|
export const getHostingAdvancedServerMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime_seconds: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), actions: faker.helpers.arrayElement([{}, undefined]) });
|
|
31
31
|
export const getHostingAdvancedServerStatusMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime_seconds: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), actions: faker.helpers.arrayElement([{}, undefined]) });
|
|
@@ -57,6 +57,7 @@ export const getHostingInfoDiskUsageMock = () => ({ diskused: faker.helpers.arra
|
|
|
57
57
|
export const getHostingLeadMock = () => ({ response: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ providerApplicationName: faker.helpers.arrayElement([faker.random.word(), undefined]), clientRequestId: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), errors: faker.helpers.arrayElement([faker.random.word(), undefined]), data: faker.helpers.arrayElement([{ leadId: faker.helpers.arrayElement([faker.random.word(), undefined]), message: faker.helpers.arrayElement([faker.random.word(), undefined]) }, undefined]), messageId: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
58
58
|
export const getHostingMigrationStatusMock = () => ({ 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]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
59
59
|
export const getHostingMigrationsMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
60
|
+
export const getHostingMigrationsCheckMock = () => ({ transferable: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), description: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
60
61
|
export const getHostingMigrationsEventMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
61
62
|
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]), incoming_domain: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
62
63
|
export const getHostingMigrationSiteScanStatusMock = () => ({ transferable: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), callback_url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
@@ -86,6 +87,7 @@ export const getSitesHasBackupsMock = () => ({ has_backups: faker.helpers.arrayE
|
|
|
86
87
|
export const getSitesBackupsCodeguardMock = () => ({ website_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), database_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
87
88
|
export const getSitesBackupsDetailsMock = () => ({ codeguard: faker.helpers.arrayElement([{ addon_id: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), seats_available: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), seats_count: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), website_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), database_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), activated: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) }, undefined]), jetpack: faker.helpers.arrayElement([{ plugin_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), plan_name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), can_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_plugin: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_addon: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_back_reference: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) }, undefined]) });
|
|
88
89
|
export const getJetpackBackupStatusMock = () => ({ plugin_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), plan_name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), can_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_plugin: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_addon: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_back_reference: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
|
|
90
|
+
export const getSiteAddonCloudflareMock = () => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
89
91
|
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]) });
|
|
90
92
|
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]) });
|
|
91
93
|
export const getSitesDomainUrlMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
@@ -116,7 +118,7 @@ export const getSitesSettingsDebugMock = () => ({ status: faker.helpers.arrayEle
|
|
|
116
118
|
export const getSitesSettingsDebugToggleMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
117
119
|
export const getSitesSettingsPhpVersionUpdateMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
118
120
|
export const getSitesSettingsPhpVersionsMock = () => ({ versions: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) });
|
|
119
|
-
export const getSitesSslMock = () => ({ domain: faker.helpers.arrayElement([faker.random.word(), undefined]), domain_dns_status: faker.helpers.arrayElement([faker.random.word(), undefined]), expiration: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), issuer: faker.helpers.arrayElement([faker.random.word(), undefined]), product: faker.helpers.arrayElement([faker.random.word(), undefined]), provider: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), upgradeable: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
121
|
+
export const getSitesSslMock = () => ({ domain: faker.helpers.arrayElement([faker.random.word(), undefined]), domain_dns_status: faker.helpers.arrayElement([faker.random.word(), undefined]), expiration: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), issuer: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), product: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), provider: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), upgradeable: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
120
122
|
export const getSitesSsoMock = () => ({ sso: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
121
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]) });
|
|
122
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() })) });
|
|
@@ -224,6 +226,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
224
226
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationStatusMock()));
|
|
225
227
|
}), rest.post('*/v1/hosting/:hostingId/migrations', (_req, res, ctx) => {
|
|
226
228
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationsMock()));
|
|
229
|
+
}), rest.get('*/v1/hosting/:hostingId/migrations/check', (_req, res, ctx) => {
|
|
230
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationsCheckMock()));
|
|
227
231
|
}), rest.post('*/v1/hosting/:hostingId/migrations/event', (_req, res, ctx) => {
|
|
228
232
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationsEventMock()));
|
|
229
233
|
}), rest.get('*/v1/hosting/:hostingId/migrations/info', (_req, res, ctx) => {
|
|
@@ -282,6 +286,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
282
286
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesBackupsDetailsMock()));
|
|
283
287
|
}), rest.get('*/v1/sites/:siteId/backups/jetpack', (_req, res, ctx) => {
|
|
284
288
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getJetpackBackupStatusMock()));
|
|
289
|
+
}), rest.post('*/v1/sites/:siteId/cloudflare', (_req, res, ctx) => {
|
|
290
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSiteAddonCloudflareMock()));
|
|
285
291
|
}), rest.get('*/v1/sites/:siteId/dns', (_req, res, ctx) => {
|
|
286
292
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDnsMock()));
|
|
287
293
|
}), rest.get('*/v1/sites/:siteId/domain', (_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.558.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SshKeyListV2200RowsItem = {
|
|
9
9
|
name?: string;
|
|
@@ -83,10 +83,11 @@ export declare type SitesSsl200 = {
|
|
|
83
83
|
domain?: string;
|
|
84
84
|
domain_dns_status?: string;
|
|
85
85
|
expiration?: string | null;
|
|
86
|
-
issuer?: string;
|
|
87
|
-
product?: string;
|
|
86
|
+
issuer?: string | null;
|
|
87
|
+
product?: string | null;
|
|
88
88
|
provider?: string | null;
|
|
89
89
|
status?: string;
|
|
90
|
+
type?: string | null;
|
|
90
91
|
upgradeable?: boolean;
|
|
91
92
|
};
|
|
92
93
|
export declare type SitesSettingsPhpVersions200 = {
|
|
@@ -288,6 +289,12 @@ export declare type SitesDns200 = {
|
|
|
288
289
|
export declare type SitesDnsParams = {
|
|
289
290
|
type?: string;
|
|
290
291
|
};
|
|
292
|
+
export declare type SiteAddonCloudflare400 = {
|
|
293
|
+
error?: string;
|
|
294
|
+
};
|
|
295
|
+
export declare type SiteAddonCloudflare200 = {
|
|
296
|
+
addon_id?: number;
|
|
297
|
+
};
|
|
291
298
|
export declare type JetpackBackupStatus200 = {
|
|
292
299
|
plugin_exists?: boolean;
|
|
293
300
|
addon_exists?: boolean;
|
|
@@ -617,6 +624,16 @@ export declare type HostingMigrationsEventBody = {
|
|
|
617
624
|
migration_id: string;
|
|
618
625
|
event_name: HostingMigrationsEventBodyEventName;
|
|
619
626
|
};
|
|
627
|
+
export declare type HostingMigrationsCheck200 = {
|
|
628
|
+
transferable?: boolean;
|
|
629
|
+
description?: string;
|
|
630
|
+
};
|
|
631
|
+
export declare type HostingMigrationsCheckParams = {
|
|
632
|
+
/**
|
|
633
|
+
* Migration ID to be checked if already used to migrate site on the hosting account
|
|
634
|
+
*/
|
|
635
|
+
migration_id: string;
|
|
636
|
+
};
|
|
620
637
|
export declare type HostingMigrations200 = {
|
|
621
638
|
success?: boolean;
|
|
622
639
|
};
|
|
@@ -1014,7 +1031,6 @@ export declare type HostingAccount200 = {
|
|
|
1014
1031
|
billing?: HostingAccount200Billing;
|
|
1015
1032
|
panel?: string;
|
|
1016
1033
|
plan_key?: string;
|
|
1017
|
-
server_subtype?: string;
|
|
1018
1034
|
};
|
|
1019
1035
|
export declare type AddonsSpamexpertsSso200 = {
|
|
1020
1036
|
url?: string;
|