@newfold/huapi-js 1.542.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 +19 -3
- package/src/index.js +18 -2
- package/src/index.msw.d.ts +6 -3
- package/src/index.msw.js +6 -3
- package/src/index.schemas.d.ts +10 -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, 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, 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>>>;
|
|
@@ -1258,6 +1259,21 @@ export declare const useJetpackBackupStatus: <TData = AxiosResponse<JetpackBacku
|
|
|
1258
1259
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
1259
1260
|
queryKey: QueryKey;
|
|
1260
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>;
|
|
1261
1277
|
/**
|
|
1262
1278
|
* Returns a list of DNS records for the site's domain.
|
|
1263
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);
|
|
@@ -1300,6 +1301,21 @@ export const useJetpackBackupStatus = (siteId, options) => {
|
|
|
1300
1301
|
query.queryKey = queryKey;
|
|
1301
1302
|
return query;
|
|
1302
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
|
+
};
|
|
1303
1319
|
/**
|
|
1304
1320
|
* Returns a list of DNS records for the site's domain.
|
|
1305
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: {
|
|
@@ -476,6 +475,9 @@ export declare const getJetpackBackupStatusMock: () => {
|
|
|
476
475
|
has_active_addon: boolean | undefined;
|
|
477
476
|
addon_back_reference: string | null | undefined;
|
|
478
477
|
};
|
|
478
|
+
export declare const getSiteAddonCloudflareMock: () => {
|
|
479
|
+
addon_id: number | undefined;
|
|
480
|
+
};
|
|
479
481
|
export declare const getSitesDnsMock: () => {
|
|
480
482
|
success: boolean | undefined;
|
|
481
483
|
source: string | undefined;
|
|
@@ -613,10 +615,11 @@ export declare const getSitesSslMock: () => {
|
|
|
613
615
|
domain: string | undefined;
|
|
614
616
|
domain_dns_status: string | undefined;
|
|
615
617
|
expiration: string | null | undefined;
|
|
616
|
-
issuer: string | undefined;
|
|
617
|
-
product: string | undefined;
|
|
618
|
+
issuer: string | null | undefined;
|
|
619
|
+
product: string | null | undefined;
|
|
618
620
|
provider: string | null | undefined;
|
|
619
621
|
status: string | undefined;
|
|
622
|
+
type: string | null | undefined;
|
|
620
623
|
upgradeable: boolean | undefined;
|
|
621
624
|
};
|
|
622
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]) });
|
|
@@ -87,6 +87,7 @@ export const getSitesHasBackupsMock = () => ({ has_backups: faker.helpers.arrayE
|
|
|
87
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]) });
|
|
88
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]) });
|
|
89
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]) });
|
|
90
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]) });
|
|
91
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]) });
|
|
92
93
|
export const getSitesDomainUrlMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
@@ -117,7 +118,7 @@ export const getSitesSettingsDebugMock = () => ({ status: faker.helpers.arrayEle
|
|
|
117
118
|
export const getSitesSettingsDebugToggleMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
118
119
|
export const getSitesSettingsPhpVersionUpdateMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
119
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]) });
|
|
120
|
-
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]) });
|
|
121
122
|
export const getSitesSsoMock = () => ({ sso: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
122
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]) });
|
|
123
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() })) });
|
|
@@ -285,6 +286,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
285
286
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesBackupsDetailsMock()));
|
|
286
287
|
}), rest.get('*/v1/sites/:siteId/backups/jetpack', (_req, res, ctx) => {
|
|
287
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()));
|
|
288
291
|
}), rest.get('*/v1/sites/:siteId/dns', (_req, res, ctx) => {
|
|
289
292
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDnsMock()));
|
|
290
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;
|
|
@@ -1024,7 +1031,6 @@ export declare type HostingAccount200 = {
|
|
|
1024
1031
|
billing?: HostingAccount200Billing;
|
|
1025
1032
|
panel?: string;
|
|
1026
1033
|
plan_key?: string;
|
|
1027
|
-
server_subtype?: string;
|
|
1028
1034
|
};
|
|
1029
1035
|
export declare type AddonsSpamexpertsSso200 = {
|
|
1030
1036
|
url?: string;
|