@newfold/huapi-js 1.630.0 → 1.642.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 +13 -0
- package/src/index.msw.js +6 -3
- package/src/index.schemas.d.ts +18 -1
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -3,14 +3,28 @@
|
|
|
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.642.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, 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, BackupsJetpackBackup200, 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, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200 } from './index.schemas';
|
|
11
|
+
import type { AccountHostingList200, 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, 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, BackupsJetpackBackup200, 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, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200 } 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
|
+
/**
|
|
15
|
+
* Returns a hosting account list
|
|
16
|
+
* @summary Hosting account list for a customer
|
|
17
|
+
*/
|
|
18
|
+
export declare const accountHostingList: (options?: AxiosRequestConfig) => Promise<AxiosResponse<AccountHostingList200>>;
|
|
19
|
+
export declare const getAccountHostingListQueryKey: () => string[];
|
|
20
|
+
export declare type AccountHostingListQueryResult = NonNullable<Awaited<ReturnType<typeof accountHostingList>>>;
|
|
21
|
+
export declare type AccountHostingListQueryError = AxiosError<unknown>;
|
|
22
|
+
export declare const useAccountHostingList: <TData = AxiosResponse<AccountHostingList200, any>, TError = AxiosError<unknown, any>>(options?: {
|
|
23
|
+
query?: UseQueryOptions<AxiosResponse<AccountHostingList200, any>, TError, TData, QueryKey> | undefined;
|
|
24
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
25
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
26
|
+
queryKey: QueryKey;
|
|
27
|
+
};
|
|
14
28
|
/**
|
|
15
29
|
* Returns a combined backup list with website commit ids and corresponding database commits
|
|
16
30
|
* @summary backup list
|
package/src/index.js
CHANGED
|
@@ -3,10 +3,27 @@
|
|
|
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.642.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
10
|
+
/**
|
|
11
|
+
* Returns a hosting account list
|
|
12
|
+
* @summary Hosting account list for a customer
|
|
13
|
+
*/
|
|
14
|
+
export const accountHostingList = (options) => {
|
|
15
|
+
return axios.get(`/v1/account/hosting`, options);
|
|
16
|
+
};
|
|
17
|
+
export const getAccountHostingListQueryKey = () => [`/v1/account/hosting`];
|
|
18
|
+
export const useAccountHostingList = (options) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
21
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getAccountHostingListQueryKey();
|
|
22
|
+
const queryFn = ({ signal }) => accountHostingList(Object.assign({ signal }, axiosOptions));
|
|
23
|
+
const query = useQuery(Object.assign({ queryKey, queryFn }, queryOptions));
|
|
24
|
+
query.queryKey = queryKey;
|
|
25
|
+
return query;
|
|
26
|
+
};
|
|
10
27
|
/**
|
|
11
28
|
* Returns a combined backup list with website commit ids and corresponding database commits
|
|
12
29
|
* @summary backup list
|
package/src/index.msw.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
export declare const getAccountHostingListMock: () => {
|
|
2
|
+
accounts: {
|
|
3
|
+
prod_inst_id: string | undefined;
|
|
4
|
+
feature_set: string | undefined;
|
|
5
|
+
status: string | undefined;
|
|
6
|
+
hosting_id: string | undefined;
|
|
7
|
+
platform: string | undefined;
|
|
8
|
+
account_id: string | undefined;
|
|
9
|
+
current_sites: number | undefined;
|
|
10
|
+
max_sites: string | undefined;
|
|
11
|
+
}[] | undefined;
|
|
12
|
+
};
|
|
1
13
|
export declare const getCodeguardBackupListMock: () => {
|
|
2
14
|
backups: {
|
|
3
15
|
website_commit_id: string | undefined;
|
|
@@ -384,6 +396,7 @@ export declare const getSitesListMock: () => {
|
|
|
384
396
|
export declare const getSitesInfoMock: () => {
|
|
385
397
|
id: number | undefined;
|
|
386
398
|
account_back_ref: string | null | undefined;
|
|
399
|
+
account_id: string | undefined;
|
|
387
400
|
date_added: string | undefined;
|
|
388
401
|
date_modified: string | undefined;
|
|
389
402
|
detected_type: string | undefined;
|
package/src/index.msw.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
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.642.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
10
|
+
export const getAccountHostingListMock = () => ({ accounts: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ prod_inst_id: faker.helpers.arrayElement([faker.random.word(), undefined]), feature_set: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), hosting_id: faker.helpers.arrayElement([faker.random.word(), undefined]), platform: faker.helpers.arrayElement([faker.random.word(), undefined]), account_id: faker.helpers.arrayElement([faker.random.word(), undefined]), current_sites: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), max_sites: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
10
11
|
export const getCodeguardBackupListMock = () => ({ backups: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ website_commit_id: faker.helpers.arrayElement([faker.random.word(), undefined]), event_time: faker.helpers.arrayElement([faker.random.word(), undefined]), database_backups: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), commit_id: faker.helpers.arrayElement([faker.random.word(), undefined]), event_time: faker.helpers.arrayElement([faker.random.word(), undefined]), recommended: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) })), undefined]) })), undefined]) });
|
|
11
12
|
export const getCodeguardBackupCreateMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
12
13
|
export const getCodeguardBackupDownloadMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
@@ -76,7 +77,7 @@ export const getSshKeyMock = () => ({ deleted: faker.helpers.arrayElement([faker
|
|
|
76
77
|
export const getSshKeyGenerateMock = () => ({ key_name: faker.helpers.arrayElement([faker.random.word(), undefined]), private_key_path: faker.helpers.arrayElement([faker.random.word(), undefined]), public_key_path: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
77
78
|
export const getSsoMock = () => ({ url: faker.random.word() });
|
|
78
79
|
export const getSitesListMock = () => ({ items: 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]) })), undefined]) });
|
|
79
|
-
export const getSitesInfoMock = () => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), account_back_ref: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), date_added: faker.helpers.arrayElement([faker.random.word(), undefined]), date_modified: faker.helpers.arrayElement([faker.random.word(), undefined]), detected_type: faker.helpers.arrayElement([faker.random.word(), undefined]), docroot: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), domain: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), php_version: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), url_is_provisional: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), version: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
|
|
80
|
+
export const getSitesInfoMock = () => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), account_back_ref: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), account_id: faker.helpers.arrayElement([faker.random.word(), undefined]), date_added: faker.helpers.arrayElement([faker.random.word(), undefined]), date_modified: faker.helpers.arrayElement([faker.random.word(), undefined]), detected_type: faker.helpers.arrayElement([faker.random.word(), undefined]), docroot: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), domain: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), php_version: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), url_is_provisional: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), version: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
|
|
80
81
|
export const getSiteUpdateMock = () => ({ success: faker.datatype.boolean() });
|
|
81
82
|
export const getSiteMock = () => ({ success: faker.datatype.boolean() });
|
|
82
83
|
export const getSitesAutoupdatesInfoMock = () => ({ plugins: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), core: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), themes: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
@@ -128,7 +129,9 @@ export const getHostingSitesV2Mock = () => ({ total: faker.helpers.arrayElement(
|
|
|
128
129
|
export const getSshKeyListV2Mock = () => ({ rows: 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]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), mtime: faker.helpers.arrayElement([faker.random.word(), undefined]), key: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
129
130
|
export const getSitesListV2Mock = () => ({ total: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), page: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), limit: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), items: 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]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]), migration_id: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
130
131
|
export const getHostingUAPIMSW = () => [
|
|
131
|
-
rest.get('*/v1/
|
|
132
|
+
rest.get('*/v1/account/hosting', (_req, res, ctx) => {
|
|
133
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getAccountHostingListMock()));
|
|
134
|
+
}), rest.get('*/v1/addons/codeguard/:addonId/backups', (_req, res, ctx) => {
|
|
132
135
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getCodeguardBackupListMock()));
|
|
133
136
|
}), rest.post('*/v1/addons/codeguard/:addonId/backups', (_req, res, ctx) => {
|
|
134
137
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getCodeguardBackupCreateMock()));
|
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.642.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SitesListV2200ItemsItem = {
|
|
9
9
|
id?: string;
|
|
@@ -420,6 +420,7 @@ export declare type SiteUpdateBody = {
|
|
|
420
420
|
export declare type SitesInfo200 = {
|
|
421
421
|
id?: number;
|
|
422
422
|
account_back_ref?: string | null;
|
|
423
|
+
account_id?: string;
|
|
423
424
|
date_added?: string;
|
|
424
425
|
date_modified?: string;
|
|
425
426
|
detected_type?: string;
|
|
@@ -1222,6 +1223,22 @@ export declare type CodeguardBackupList200 = {
|
|
|
1222
1223
|
export declare type CodeguardBackupListParams = {
|
|
1223
1224
|
website_id: number;
|
|
1224
1225
|
};
|
|
1226
|
+
export declare type AccountHostingList200AccountsItem = {
|
|
1227
|
+
/** HAL Account back_reference */
|
|
1228
|
+
prod_inst_id?: string;
|
|
1229
|
+
feature_set?: string;
|
|
1230
|
+
status?: string;
|
|
1231
|
+
/** HAL Account ID */
|
|
1232
|
+
hosting_id?: string;
|
|
1233
|
+
platform?: string;
|
|
1234
|
+
/** Jarvis Account ID, HAL tenant_back_ref */
|
|
1235
|
+
account_id?: string;
|
|
1236
|
+
current_sites?: number;
|
|
1237
|
+
max_sites?: string;
|
|
1238
|
+
};
|
|
1239
|
+
export declare type AccountHostingList200 = {
|
|
1240
|
+
accounts?: AccountHostingList200AccountsItem[];
|
|
1241
|
+
};
|
|
1225
1242
|
export interface SitesAutoupdatesResponse {
|
|
1226
1243
|
plugins?: boolean | null;
|
|
1227
1244
|
core?: boolean | null;
|