@newfold/huapi-js 1.538.0 → 1.542.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 +16 -2
- package/src/index.js +18 -1
- package/src/index.msw.d.ts +4 -0
- package/src/index.msw.js +4 -1
- package/src/index.schemas.d.ts +11 -1
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.542.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, 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
|
/**
|
|
@@ -799,6 +799,20 @@ export declare const useHostingMigrations: <TError = AxiosError<unknown, any>, T
|
|
|
799
799
|
hostingId: string;
|
|
800
800
|
data: HostingMigrationsBody;
|
|
801
801
|
}, TContext>;
|
|
802
|
+
/**
|
|
803
|
+
* Checks if Migration ID exists, indicating the site migration is in progress or completed
|
|
804
|
+
* @summary Migration ID check
|
|
805
|
+
*/
|
|
806
|
+
export declare const hostingMigrationsCheck: (hostingId: number, params: HostingMigrationsCheckParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingMigrationsCheck200>>;
|
|
807
|
+
export declare const getHostingMigrationsCheckQueryKey: (hostingId: number, params: HostingMigrationsCheckParams) => (string | HostingMigrationsCheckParams)[];
|
|
808
|
+
export declare type HostingMigrationsCheckQueryResult = NonNullable<Awaited<ReturnType<typeof hostingMigrationsCheck>>>;
|
|
809
|
+
export declare type HostingMigrationsCheckQueryError = AxiosError<unknown>;
|
|
810
|
+
export declare const useHostingMigrationsCheck: <TData = AxiosResponse<HostingMigrationsCheck200, any>, TError = AxiosError<unknown, any>>(hostingId: number, params: HostingMigrationsCheckParams, options?: {
|
|
811
|
+
query?: UseQueryOptions<AxiosResponse<HostingMigrationsCheck200, any>, TError, TData, QueryKey> | undefined;
|
|
812
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
813
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
814
|
+
queryKey: QueryKey;
|
|
815
|
+
};
|
|
802
816
|
/**
|
|
803
817
|
* Post migration event to CWM
|
|
804
818
|
* @summary hosting migrations event
|
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.542.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -811,6 +811,23 @@ export const useHostingMigrations = (options) => {
|
|
|
811
811
|
};
|
|
812
812
|
return useMutation(mutationFn, mutationOptions);
|
|
813
813
|
};
|
|
814
|
+
/**
|
|
815
|
+
* Checks if Migration ID exists, indicating the site migration is in progress or completed
|
|
816
|
+
* @summary Migration ID check
|
|
817
|
+
*/
|
|
818
|
+
export const hostingMigrationsCheck = (hostingId, params, options) => {
|
|
819
|
+
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) }));
|
|
820
|
+
};
|
|
821
|
+
export const getHostingMigrationsCheckQueryKey = (hostingId, params) => [`/v1/hosting/${hostingId}/migrations/check`, ...(params ? [params] : [])];
|
|
822
|
+
export const useHostingMigrationsCheck = (hostingId, params, options) => {
|
|
823
|
+
var _a;
|
|
824
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
825
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingMigrationsCheckQueryKey(hostingId, params);
|
|
826
|
+
const queryFn = ({ signal }) => hostingMigrationsCheck(hostingId, params, Object.assign({ signal }, axiosOptions));
|
|
827
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
|
|
828
|
+
query.queryKey = queryKey;
|
|
829
|
+
return query;
|
|
830
|
+
};
|
|
814
831
|
/**
|
|
815
832
|
* Post migration event to CWM
|
|
816
833
|
* @summary hosting migrations event
|
package/src/index.msw.d.ts
CHANGED
|
@@ -297,6 +297,10 @@ export declare const getHostingMigrationStatusMock: () => {
|
|
|
297
297
|
export declare const getHostingMigrationsMock: () => {
|
|
298
298
|
success: boolean | undefined;
|
|
299
299
|
};
|
|
300
|
+
export declare const getHostingMigrationsCheckMock: () => {
|
|
301
|
+
transferable: boolean | undefined;
|
|
302
|
+
description: string | undefined;
|
|
303
|
+
};
|
|
300
304
|
export declare const getHostingMigrationsEventMock: () => {
|
|
301
305
|
success: boolean | undefined;
|
|
302
306
|
};
|
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.542.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -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]) });
|
|
@@ -224,6 +225,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
224
225
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationStatusMock()));
|
|
225
226
|
}), rest.post('*/v1/hosting/:hostingId/migrations', (_req, res, ctx) => {
|
|
226
227
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationsMock()));
|
|
228
|
+
}), rest.get('*/v1/hosting/:hostingId/migrations/check', (_req, res, ctx) => {
|
|
229
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationsCheckMock()));
|
|
227
230
|
}), rest.post('*/v1/hosting/:hostingId/migrations/event', (_req, res, ctx) => {
|
|
228
231
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationsEventMock()));
|
|
229
232
|
}), rest.get('*/v1/hosting/:hostingId/migrations/info', (_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.542.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SshKeyListV2200RowsItem = {
|
|
9
9
|
name?: string;
|
|
@@ -617,6 +617,16 @@ export declare type HostingMigrationsEventBody = {
|
|
|
617
617
|
migration_id: string;
|
|
618
618
|
event_name: HostingMigrationsEventBodyEventName;
|
|
619
619
|
};
|
|
620
|
+
export declare type HostingMigrationsCheck200 = {
|
|
621
|
+
transferable?: boolean;
|
|
622
|
+
description?: string;
|
|
623
|
+
};
|
|
624
|
+
export declare type HostingMigrationsCheckParams = {
|
|
625
|
+
/**
|
|
626
|
+
* Migration ID to be checked if already used to migrate site on the hosting account
|
|
627
|
+
*/
|
|
628
|
+
migration_id: string;
|
|
629
|
+
};
|
|
620
630
|
export declare type HostingMigrations200 = {
|
|
621
631
|
success?: boolean;
|
|
622
632
|
};
|