@newfold/huapi-js 1.468.0 → 1.472.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 CHANGED
@@ -10,7 +10,7 @@
10
10
  "tslib": "2.4.0"
11
11
  },
12
12
  "module": "dist/index.ts",
13
- "version": "1.468.0",
13
+ "version": "1.472.0",
14
14
  "sideEffects": false,
15
15
  "main": "./src/index.js",
16
16
  "types": "./src/index.d.ts",
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.468.0
6
+ * OpenAPI spec version: 1.472.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, 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';
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
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.468.0
6
+ * OpenAPI spec version: 1.472.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
@@ -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
  };
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.468.0
6
+ * OpenAPI spec version: 1.472.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]) });
@@ -207,6 +209,10 @@ export const getHostingUAPIMSW = () => [
207
209
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingMigrationSiteScanStatusMock()));
208
210
  }), rest.get('*/v1/hosting/:hostingId/nameservers', (_req, res, ctx) => {
209
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()));
210
216
  }), rest.put('*/v1/hosting/:hostingId/shell', (_req, res, ctx) => {
211
217
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingShellToggleMock()));
212
218
  }), rest.get('*/v1/hosting/:hostingId/shell', (_req, res, ctx) => {
@@ -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.468.0
6
+ * OpenAPI spec version: 1.472.0
7
7
  */
8
8
  export declare type SshKeyListV2200RowsItem = {
9
9
  name?: string;
@@ -528,6 +528,15 @@ export declare type HostingShellToggleBody = {
528
528
  /** boolean flag to enable or disable hosting shell */
529
529
  enabled: boolean;
530
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 | null;
539
+ };
531
540
  export declare type HostingNameservers200 = {
532
541
  nameservers: string[];
533
542
  };