@newfold/huapi-js 1.471.0 → 1.487.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 +28 -14
- package/src/index.js +18 -1
- package/src/index.msw.d.ts +15 -0
- package/src/index.msw.js +7 -4
- package/src/index.schemas.d.ts +18 -2
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.487.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, 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';
|
|
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, HostingEcommerceInfo200, 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
|
/**
|
|
@@ -296,11 +296,11 @@ export declare const useHostingAccount: <TData = AxiosResponse<HostingAccount200
|
|
|
296
296
|
* Returns a list of addons.
|
|
297
297
|
* @summary addon list
|
|
298
298
|
*/
|
|
299
|
-
export declare const hostingAddons: (hostingId:
|
|
300
|
-
export declare const getHostingAddonsQueryKey: (hostingId:
|
|
299
|
+
export declare const hostingAddons: (hostingId: string, params?: HostingAddonsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingAddons200>>;
|
|
300
|
+
export declare const getHostingAddonsQueryKey: (hostingId: string, params?: HostingAddonsParams) => (string | HostingAddonsParams)[];
|
|
301
301
|
export declare type HostingAddonsQueryResult = NonNullable<Awaited<ReturnType<typeof hostingAddons>>>;
|
|
302
302
|
export declare type HostingAddonsQueryError = AxiosError<unknown>;
|
|
303
|
-
export declare const useHostingAddons: <TData = AxiosResponse<HostingAddons200, any>, TError = AxiosError<unknown, any>>(hostingId:
|
|
303
|
+
export declare const useHostingAddons: <TData = AxiosResponse<HostingAddons200, any>, TError = AxiosError<unknown, any>>(hostingId: string, params?: HostingAddonsParams, options?: {
|
|
304
304
|
query?: UseQueryOptions<AxiosResponse<HostingAddons200, any>, TError, TData, QueryKey> | undefined;
|
|
305
305
|
axios?: AxiosRequestConfig<any> | undefined;
|
|
306
306
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -388,11 +388,11 @@ export declare const useHostingAdvancedSystemConsole: <TData = AxiosResponse<Hos
|
|
|
388
388
|
* Returns the hosting capabilities
|
|
389
389
|
* @summary hosting capabilities
|
|
390
390
|
*/
|
|
391
|
-
export declare const hostingCapabilities: (hostingId:
|
|
392
|
-
export declare const getHostingCapabilitiesQueryKey: (hostingId:
|
|
391
|
+
export declare const hostingCapabilities: (hostingId: string, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingCapabilities200>>;
|
|
392
|
+
export declare const getHostingCapabilitiesQueryKey: (hostingId: string) => string[];
|
|
393
393
|
export declare type HostingCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof hostingCapabilities>>>;
|
|
394
394
|
export declare type HostingCapabilitiesQueryError = AxiosError<unknown>;
|
|
395
|
-
export declare const useHostingCapabilities: <TData = AxiosResponse<HostingCapabilities200, any>, TError = AxiosError<unknown, any>>(hostingId:
|
|
395
|
+
export declare const useHostingCapabilities: <TData = AxiosResponse<HostingCapabilities200, any>, TError = AxiosError<unknown, any>>(hostingId: string, options?: {
|
|
396
396
|
query?: UseQueryOptions<AxiosResponse<HostingCapabilities200, any>, TError, TData, QueryKey> | undefined;
|
|
397
397
|
axios?: AxiosRequestConfig<any> | undefined;
|
|
398
398
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -552,16 +552,30 @@ export declare const useDbUserList: <TData = AxiosResponse<DbUserList200, any>,
|
|
|
552
552
|
* Returns a list of domains
|
|
553
553
|
* @summary domain list
|
|
554
554
|
*/
|
|
555
|
-
export declare const domains: (hostingId:
|
|
556
|
-
export declare const getDomainsQueryKey: (hostingId:
|
|
555
|
+
export declare const domains: (hostingId: string, params?: DomainsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<Domains200>>;
|
|
556
|
+
export declare const getDomainsQueryKey: (hostingId: string, params?: DomainsParams) => (string | DomainsParams)[];
|
|
557
557
|
export declare type DomainsQueryResult = NonNullable<Awaited<ReturnType<typeof domains>>>;
|
|
558
558
|
export declare type DomainsQueryError = AxiosError<unknown>;
|
|
559
|
-
export declare const useDomains: <TData = AxiosResponse<Domains200, any>, TError = AxiosError<unknown, any>>(hostingId:
|
|
559
|
+
export declare const useDomains: <TData = AxiosResponse<Domains200, any>, TError = AxiosError<unknown, any>>(hostingId: string, params?: DomainsParams, options?: {
|
|
560
560
|
query?: UseQueryOptions<AxiosResponse<Domains200, any>, TError, TData, QueryKey> | undefined;
|
|
561
561
|
axios?: AxiosRequestConfig<any> | undefined;
|
|
562
562
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
563
563
|
queryKey: QueryKey;
|
|
564
564
|
};
|
|
565
|
+
/**
|
|
566
|
+
* Returns info about an existing ecommerce addon otherwise it returns null
|
|
567
|
+
* @summary ecommerce info
|
|
568
|
+
*/
|
|
569
|
+
export declare const hostingEcommerceInfo: (hostingId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingEcommerceInfo200>>;
|
|
570
|
+
export declare const getHostingEcommerceInfoQueryKey: (hostingId: number) => string[];
|
|
571
|
+
export declare type HostingEcommerceInfoQueryResult = NonNullable<Awaited<ReturnType<typeof hostingEcommerceInfo>>>;
|
|
572
|
+
export declare type HostingEcommerceInfoQueryError = AxiosError<unknown>;
|
|
573
|
+
export declare const useHostingEcommerceInfo: <TData = AxiosResponse<HostingEcommerceInfo200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
|
|
574
|
+
query?: UseQueryOptions<AxiosResponse<HostingEcommerceInfo200, any>, TError, TData, QueryKey> | undefined;
|
|
575
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
576
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
577
|
+
queryKey: QueryKey;
|
|
578
|
+
};
|
|
565
579
|
/**
|
|
566
580
|
* Returns a list of FTP accounts.
|
|
567
581
|
* @summary ftp list
|
|
@@ -849,11 +863,11 @@ export declare const useHostingSiteAdd: <TError = AxiosError<unknown, any>, TCon
|
|
|
849
863
|
* Returns the hosting account's SSH information
|
|
850
864
|
* @summary ssh info
|
|
851
865
|
*/
|
|
852
|
-
export declare const hostingSshInfo: (hostingId:
|
|
853
|
-
export declare const getHostingSshInfoQueryKey: (hostingId:
|
|
866
|
+
export declare const hostingSshInfo: (hostingId: string, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingSshInfo200>>;
|
|
867
|
+
export declare const getHostingSshInfoQueryKey: (hostingId: string) => string[];
|
|
854
868
|
export declare type HostingSshInfoQueryResult = NonNullable<Awaited<ReturnType<typeof hostingSshInfo>>>;
|
|
855
869
|
export declare type HostingSshInfoQueryError = AxiosError<unknown>;
|
|
856
|
-
export declare const useHostingSshInfo: <TData = AxiosResponse<HostingSshInfo200, any>, TError = AxiosError<unknown, any>>(hostingId:
|
|
870
|
+
export declare const useHostingSshInfo: <TData = AxiosResponse<HostingSshInfo200, any>, TError = AxiosError<unknown, any>>(hostingId: string, options?: {
|
|
857
871
|
query?: UseQueryOptions<AxiosResponse<HostingSshInfo200, any>, TError, TData, QueryKey> | undefined;
|
|
858
872
|
axios?: AxiosRequestConfig<any> | undefined;
|
|
859
873
|
} | undefined) => UseQueryResult<TData, TError> & {
|
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.487.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -570,6 +570,23 @@ export const useDomains = (hostingId, params, options) => {
|
|
|
570
570
|
query.queryKey = queryKey;
|
|
571
571
|
return query;
|
|
572
572
|
};
|
|
573
|
+
/**
|
|
574
|
+
* Returns info about an existing ecommerce addon otherwise it returns null
|
|
575
|
+
* @summary ecommerce info
|
|
576
|
+
*/
|
|
577
|
+
export const hostingEcommerceInfo = (hostingId, options) => {
|
|
578
|
+
return axios.get(`/v1/hosting/${hostingId}/ecommerce`, options);
|
|
579
|
+
};
|
|
580
|
+
export const getHostingEcommerceInfoQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/ecommerce`];
|
|
581
|
+
export const useHostingEcommerceInfo = (hostingId, options) => {
|
|
582
|
+
var _a;
|
|
583
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
584
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingEcommerceInfoQueryKey(hostingId);
|
|
585
|
+
const queryFn = ({ signal }) => hostingEcommerceInfo(hostingId, Object.assign({ signal }, axiosOptions));
|
|
586
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
|
|
587
|
+
query.queryKey = queryKey;
|
|
588
|
+
return query;
|
|
589
|
+
};
|
|
573
590
|
/**
|
|
574
591
|
* Returns a list of FTP accounts.
|
|
575
592
|
* @summary ftp list
|
package/src/index.msw.d.ts
CHANGED
|
@@ -103,6 +103,11 @@ export declare const getHostingAccountMock: () => {
|
|
|
103
103
|
type: string | undefined;
|
|
104
104
|
advanced: boolean | undefined;
|
|
105
105
|
plan: string | undefined;
|
|
106
|
+
billing: {
|
|
107
|
+
product_name: string | undefined;
|
|
108
|
+
} | undefined;
|
|
109
|
+
panel: string | undefined;
|
|
110
|
+
plan_key: string | undefined;
|
|
106
111
|
};
|
|
107
112
|
export declare const getHostingAddonsMock: () => {
|
|
108
113
|
rows: {
|
|
@@ -182,6 +187,7 @@ export declare const getDbListMock: () => {
|
|
|
182
187
|
status: boolean | undefined;
|
|
183
188
|
databases: {
|
|
184
189
|
db: string | undefined;
|
|
190
|
+
sitename: string | undefined;
|
|
185
191
|
size: string | undefined;
|
|
186
192
|
sizemeg: string | undefined;
|
|
187
193
|
usercount: number | undefined;
|
|
@@ -206,6 +212,14 @@ export declare const getDomainsMock: () => {
|
|
|
206
212
|
id: number;
|
|
207
213
|
}[];
|
|
208
214
|
};
|
|
215
|
+
export declare const getHostingEcommerceInfoMock: () => {
|
|
216
|
+
addon_id: number | undefined;
|
|
217
|
+
level: string | undefined;
|
|
218
|
+
name: string | undefined;
|
|
219
|
+
type: string | undefined;
|
|
220
|
+
status: string | undefined;
|
|
221
|
+
subtype: string | null | undefined;
|
|
222
|
+
};
|
|
209
223
|
export declare const getHostingFtpListMock: () => {
|
|
210
224
|
ftp_accounts: {
|
|
211
225
|
user: string | undefined;
|
|
@@ -221,6 +235,7 @@ export declare const getHostingFtpListMock: () => {
|
|
|
221
235
|
account: string | undefined;
|
|
222
236
|
domain: string | undefined;
|
|
223
237
|
}[] | undefined;
|
|
238
|
+
server_name: string | undefined;
|
|
224
239
|
};
|
|
225
240
|
export declare const getHostingFtpAddMock: () => {
|
|
226
241
|
user: string | undefined;
|
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.487.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -24,7 +24,7 @@ export const getCodeguardWebsiteBackupRestoreMock = () => ({ status: faker.helpe
|
|
|
24
24
|
export const getAddonsSitelockSsoMock = () => ({ site_url: faker.helpers.arrayElement([faker.random.word(), undefined]), sitelock_id: faker.helpers.arrayElement([faker.random.word(), undefined]), url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
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
|
-
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]), plan: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
27
|
+
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]), plan: faker.helpers.arrayElement([faker.random.word(), 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
28
|
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]) });
|
|
29
29
|
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]) });
|
|
30
30
|
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]) });
|
|
@@ -39,10 +39,11 @@ export const getUpdateCronMock = () => ({ key: faker.helpers.arrayElement([faker
|
|
|
39
39
|
export const getCronMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
40
40
|
export const getDbAddMock = () => ({ dbname: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
41
41
|
export const getDbMock = () => ({ dbname: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
42
|
-
export const getDbListMock = () => ({ status: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), databases: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ db: faker.helpers.arrayElement([faker.random.word(), undefined]), size: faker.helpers.arrayElement([faker.random.word(), undefined]), sizemeg: faker.helpers.arrayElement([faker.random.word(), undefined]), usercount: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), userlist: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ db: faker.helpers.arrayElement([faker.random.word(), undefined]), user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) })), undefined]) });
|
|
42
|
+
export const getDbListMock = () => ({ status: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), databases: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ db: faker.helpers.arrayElement([faker.random.word(), undefined]), sitename: faker.helpers.arrayElement([faker.random.word(), undefined]), size: faker.helpers.arrayElement([faker.random.word(), undefined]), sizemeg: faker.helpers.arrayElement([faker.random.word(), undefined]), usercount: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), userlist: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ db: faker.helpers.arrayElement([faker.random.word(), undefined]), user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) })), undefined]) });
|
|
43
43
|
export const getDbUserListMock = () => ({ users: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dblist: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), shortuser: faker.helpers.arrayElement([faker.random.word(), undefined]), user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
44
44
|
export const getDomainsMock = () => ({ domains: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ docroot: faker.random.word(), domain: faker.random.word(), type: faker.random.word(), id: faker.datatype.number({ min: undefined, max: undefined }) })) });
|
|
45
|
-
export const
|
|
45
|
+
export const getHostingEcommerceInfoMock = () => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), level: faker.helpers.arrayElement([faker.random.word(), undefined]), name: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
|
|
46
|
+
export const getHostingFtpListMock = () => ({ ftp_accounts: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ user: faker.helpers.arrayElement([faker.random.word(), undefined]), homedir: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), account: faker.helpers.arrayElement([faker.random.word(), undefined]), domain: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]), special_ftp_accounts: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ user: faker.helpers.arrayElement([faker.random.word(), undefined]), homedir: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), account: faker.helpers.arrayElement([faker.random.word(), undefined]), domain: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]), server_name: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
46
47
|
export const getHostingFtpAddMock = () => ({ user: faker.helpers.arrayElement([faker.random.word(), undefined]), pass: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
47
48
|
export const getHostingFtpUpdateMock = () => ({ status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
48
49
|
export const getHostingFtpMock = () => ({ status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), user: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
@@ -185,6 +186,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
185
186
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbUserListMock()));
|
|
186
187
|
}), rest.get('*/v1/hosting/:hostingId/domains', (_req, res, ctx) => {
|
|
187
188
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDomainsMock()));
|
|
189
|
+
}), rest.get('*/v1/hosting/:hostingId/ecommerce', (_req, res, ctx) => {
|
|
190
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingEcommerceInfoMock()));
|
|
188
191
|
}), rest.get('*/v1/hosting/:hostingId/ftp', (_req, res, ctx) => {
|
|
189
192
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingFtpListMock()));
|
|
190
193
|
}), rest.post('*/v1/hosting/:hostingId/ftp', (_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.487.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SshKeyListV2200RowsItem = {
|
|
9
9
|
name?: string;
|
|
@@ -535,7 +535,7 @@ export declare type HostingOnboardingDataUpdateBody = {
|
|
|
535
535
|
completed?: boolean;
|
|
536
536
|
};
|
|
537
537
|
export declare type HostingOnboardingData200 = {
|
|
538
|
-
completed?: boolean;
|
|
538
|
+
completed?: boolean | null;
|
|
539
539
|
};
|
|
540
540
|
export declare type HostingNameservers200 = {
|
|
541
541
|
nameservers: string[];
|
|
@@ -678,7 +678,16 @@ export declare type HostingFtpList200FtpAccountsItem = {
|
|
|
678
678
|
export declare type HostingFtpList200 = {
|
|
679
679
|
ftp_accounts?: HostingFtpList200FtpAccountsItem[];
|
|
680
680
|
special_ftp_accounts?: HostingFtpList200SpecialFtpAccountsItem[];
|
|
681
|
+
server_name?: string;
|
|
681
682
|
};
|
|
683
|
+
export declare type HostingEcommerceInfo200 = {
|
|
684
|
+
addon_id?: number;
|
|
685
|
+
level?: string;
|
|
686
|
+
name?: string;
|
|
687
|
+
type?: string;
|
|
688
|
+
status?: string;
|
|
689
|
+
subtype?: string | null;
|
|
690
|
+
} | null;
|
|
682
691
|
export declare type Domains200DomainsItem = {
|
|
683
692
|
docroot: string;
|
|
684
693
|
domain: string;
|
|
@@ -713,6 +722,7 @@ export declare type DbList200DatabasesItemUserlistItem = {
|
|
|
713
722
|
};
|
|
714
723
|
export declare type DbList200DatabasesItem = {
|
|
715
724
|
db?: string;
|
|
725
|
+
sitename?: string;
|
|
716
726
|
size?: string;
|
|
717
727
|
sizemeg?: string;
|
|
718
728
|
usercount?: number;
|
|
@@ -890,6 +900,9 @@ export declare type HostingAddonsParams = {
|
|
|
890
900
|
subtype?: string;
|
|
891
901
|
type?: string;
|
|
892
902
|
};
|
|
903
|
+
export declare type HostingAccount200Billing = {
|
|
904
|
+
product_name?: string;
|
|
905
|
+
};
|
|
893
906
|
export declare type HostingAccount200 = {
|
|
894
907
|
id?: string;
|
|
895
908
|
account_id?: string;
|
|
@@ -900,6 +913,9 @@ export declare type HostingAccount200 = {
|
|
|
900
913
|
type?: string;
|
|
901
914
|
advanced?: boolean;
|
|
902
915
|
plan?: string;
|
|
916
|
+
billing?: HostingAccount200Billing;
|
|
917
|
+
panel?: string;
|
|
918
|
+
plan_key?: string;
|
|
903
919
|
};
|
|
904
920
|
export declare type AddonsInfo200 = {
|
|
905
921
|
id?: string;
|