@newfold/huapi-js 1.892.0 → 1.894.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 +20 -2
- package/src/index.js +16 -1
- package/src/index.msw.d.ts +11 -7
- package/src/index.msw.js +6 -3
- package/src/index.schemas.d.ts +35 -20
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.894.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import type { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
10
10
|
import type { UseQueryOptions, UseInfiniteQueryOptions, UseMutationOptions, UseQueryResult, UseInfiniteQueryResult, QueryKey } from '@tanstack/react-query';
|
|
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, WebzaiSso200, WeeblySso200, DomainInfo200, DomainUnassign200, 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, HostingDomainsUnassign200, HostingDomainsUnassignBody, 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, SitesDatabaseInfo200, SitesDatabasePasswordsync200, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainParams, SitesDomainUrl200, SitesDomainUrlBody, SitesDomainsCreate200, SitesDomainsCreateBody, SitesAccessLogs200, SitesAccessLogsParams, SitesErrorLogs200, SitesErrorLogsParams, SiteMalwareStatus200, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsParams, SitePluginUpdate200, SitePluginUpdateBody, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, ResetSiteBody, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSshUserList200, SitesSshUserCreate200, SitesSshUserCreateBody, SitesSshUserDelete200, SitesSshUserDeleteBody, SitesSshUserUpdate200, SitesSshUserUpdateBody, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, AddonsSitelockSsoV2200, AddonsSitelockSsoV2Params, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params, SitesSecuritySitelockV2200, SitesSecuritySitelockV2Params } 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, WebzaiSso200, WeeblySso200, DomainInfo200, DomainUnassign200, 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, HostingDomainsUnassign200, HostingDomainsUnassignBody, 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, SitesBatch200, SitesBatchBody, 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, SitesDatabaseInfo200, SitesDatabasePasswordsync200, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainParams, SitesDomainUrl200, SitesDomainUrlBody, SitesDomainsCreate200, SitesDomainsCreateBody, SitesAccessLogs200, SitesAccessLogsParams, SitesErrorLogs200, SitesErrorLogsParams, SiteMalwareStatus200, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsParams, SitePluginUpdate200, SitePluginUpdateBody, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, ResetSiteBody, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSshUserList200, SitesSshUserCreate200, SitesSshUserCreateBody, SitesSshUserDelete200, SitesSshUserDeleteBody, SitesSshUserUpdate200, SitesSshUserUpdateBody, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, AddonsSitelockSsoV2200, AddonsSitelockSsoV2Params, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params, SitesSecuritySitelockV2200, SitesSecuritySitelockV2Params } 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
|
/**
|
|
@@ -1060,6 +1060,24 @@ export declare const useHostingSiteAdd: <TError = AxiosError<unknown, any>, TCon
|
|
|
1060
1060
|
hostingId: number;
|
|
1061
1061
|
data: HostingSiteAddBody;
|
|
1062
1062
|
}, TContext>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Update Sites in batches.
|
|
1065
|
+
* @summary sites update batch
|
|
1066
|
+
*/
|
|
1067
|
+
export declare const sitesBatch: (hostingId: number, sitesBatchBody: SitesBatchBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesBatch200>>;
|
|
1068
|
+
export declare type SitesBatchMutationResult = NonNullable<Awaited<ReturnType<typeof sitesBatch>>>;
|
|
1069
|
+
export declare type SitesBatchMutationBody = SitesBatchBody;
|
|
1070
|
+
export declare type SitesBatchMutationError = AxiosError<unknown>;
|
|
1071
|
+
export declare const useSitesBatch: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
|
|
1072
|
+
mutation?: UseMutationOptions<AxiosResponse<SitesBatch200, any>, TError, {
|
|
1073
|
+
hostingId: number;
|
|
1074
|
+
data: SitesBatchBody;
|
|
1075
|
+
}, TContext> | undefined;
|
|
1076
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
1077
|
+
} | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitesBatch200, any>, TError, {
|
|
1078
|
+
hostingId: number;
|
|
1079
|
+
data: SitesBatchBody;
|
|
1080
|
+
}, TContext>;
|
|
1063
1081
|
/**
|
|
1064
1082
|
* Returns the hosting account's SSH information
|
|
1065
1083
|
* @summary ssh info
|
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.894.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useInfiniteQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -1090,6 +1090,21 @@ export const useHostingSiteAdd = (options) => {
|
|
|
1090
1090
|
};
|
|
1091
1091
|
return useMutation(mutationFn, mutationOptions);
|
|
1092
1092
|
};
|
|
1093
|
+
/**
|
|
1094
|
+
* Update Sites in batches.
|
|
1095
|
+
* @summary sites update batch
|
|
1096
|
+
*/
|
|
1097
|
+
export const sitesBatch = (hostingId, sitesBatchBody, options) => {
|
|
1098
|
+
return axios.put(`/v1/hosting/${hostingId}/sites/batch`, sitesBatchBody, options);
|
|
1099
|
+
};
|
|
1100
|
+
export const useSitesBatch = (options) => {
|
|
1101
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1102
|
+
const mutationFn = (props) => {
|
|
1103
|
+
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
1104
|
+
return sitesBatch(hostingId, data, axiosOptions);
|
|
1105
|
+
};
|
|
1106
|
+
return useMutation(mutationFn, mutationOptions);
|
|
1107
|
+
};
|
|
1093
1108
|
/**
|
|
1094
1109
|
* Returns the hosting account's SSH information
|
|
1095
1110
|
* @summary ssh info
|
package/src/index.msw.d.ts
CHANGED
|
@@ -409,6 +409,9 @@ export declare const getHostingSiteAddMock: () => {
|
|
|
409
409
|
status: string | undefined;
|
|
410
410
|
success: boolean;
|
|
411
411
|
};
|
|
412
|
+
export declare const getSitesBatchMock: () => {
|
|
413
|
+
success: boolean | undefined;
|
|
414
|
+
};
|
|
412
415
|
export declare const getHostingSshInfoMock: () => {
|
|
413
416
|
status: string | undefined;
|
|
414
417
|
success: boolean | undefined;
|
|
@@ -602,14 +605,14 @@ export declare const getSitesDomainsCreateMock: () => {
|
|
|
602
605
|
status: string | undefined;
|
|
603
606
|
};
|
|
604
607
|
export declare const getSitesAccessLogsMock: () => {
|
|
605
|
-
|
|
606
|
-
|
|
608
|
+
datetime_end: string | undefined;
|
|
609
|
+
datetime_start: string | undefined;
|
|
607
610
|
page_id: string | null | undefined;
|
|
608
611
|
total: number | undefined;
|
|
609
612
|
logs: {
|
|
610
613
|
body_bytes_sent: number | undefined;
|
|
611
614
|
cached: string | undefined;
|
|
612
|
-
|
|
615
|
+
datetime: string | undefined;
|
|
613
616
|
http_host: string | undefined;
|
|
614
617
|
http_referrer: string | undefined;
|
|
615
618
|
http_user_agent: string | undefined;
|
|
@@ -621,24 +624,25 @@ export declare const getSitesAccessLogsMock: () => {
|
|
|
621
624
|
request_url: string | undefined;
|
|
622
625
|
scheme: string | undefined;
|
|
623
626
|
status: number | undefined;
|
|
624
|
-
|
|
627
|
+
epoch: number | undefined;
|
|
625
628
|
type: string | undefined;
|
|
626
629
|
user_ip: string | undefined;
|
|
627
630
|
}[] | undefined;
|
|
628
631
|
};
|
|
629
632
|
export declare const getSitesErrorLogsMock: () => {
|
|
630
|
-
|
|
631
|
-
|
|
633
|
+
datetime_end: string | undefined;
|
|
634
|
+
datetime_start: string | undefined;
|
|
632
635
|
page_id: string | null | undefined;
|
|
633
636
|
total: number | undefined;
|
|
634
637
|
logs: {
|
|
638
|
+
datetime: string | undefined;
|
|
635
639
|
file: string | undefined;
|
|
636
640
|
kind: string | undefined;
|
|
637
641
|
line: number | undefined;
|
|
638
642
|
message: string | undefined;
|
|
639
643
|
name: string | undefined;
|
|
640
644
|
severity: string | undefined;
|
|
641
|
-
|
|
645
|
+
epoch: number | undefined;
|
|
642
646
|
}[] | undefined;
|
|
643
647
|
};
|
|
644
648
|
export declare const getSiteMalwareStatusMock: () => {
|
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.894.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -74,6 +74,7 @@ export const getHostingResellerSsoWhmMock = () => ({ url: faker.helpers.arrayEle
|
|
|
74
74
|
export const getHostingShellToggleMock = () => ({ enabled: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
75
75
|
export const getHostingShellInfoMock = () => ({ enabled: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
76
76
|
export const getHostingSiteAddMock = () => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), success: faker.datatype.boolean() });
|
|
77
|
+
export const getSitesBatchMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
77
78
|
export const getHostingSshInfoMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
78
79
|
export const getSshKeyFetchMock = () => ({ key_name: faker.helpers.arrayElement([faker.random.word(), undefined]), key: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
79
80
|
export const getSshKeyImportMock = () => ({ key_name: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
@@ -100,8 +101,8 @@ export const getSitesDnsMock = () => ({ success: faker.helpers.arrayElement([fak
|
|
|
100
101
|
export const getSitesDomainMock = () => ({ connected: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), a_match: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), nameserver_match: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), detected: faker.helpers.arrayElement([{ a: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), ns: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) }, undefined]), wanted: faker.helpers.arrayElement([{ a: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), ns: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) }, undefined]) });
|
|
101
102
|
export const getSitesDomainUrlMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
102
103
|
export const getSitesDomainsCreateMock = () => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
103
|
-
export const getSitesAccessLogsMock = () => ({
|
|
104
|
-
export const getSitesErrorLogsMock = () => ({
|
|
104
|
+
export const getSitesAccessLogsMock = () => ({ datetime_end: faker.helpers.arrayElement([faker.random.word(), undefined]), datetime_start: faker.helpers.arrayElement([faker.random.word(), undefined]), page_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), total: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), logs: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ body_bytes_sent: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), cached: faker.helpers.arrayElement([faker.random.word(), undefined]), datetime: faker.helpers.arrayElement([faker.random.word(), undefined]), http_host: faker.helpers.arrayElement([faker.random.word(), undefined]), http_referrer: faker.helpers.arrayElement([faker.random.word(), undefined]), http_user_agent: faker.helpers.arrayElement([faker.random.word(), undefined]), http_x_forwarded_for: faker.helpers.arrayElement([faker.random.word(), undefined]), renderer: faker.helpers.arrayElement([faker.random.word(), undefined]), request_completion: faker.helpers.arrayElement([faker.random.word(), undefined]), request_time: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), request_type: faker.helpers.arrayElement([faker.random.word(), undefined]), request_url: faker.helpers.arrayElement([faker.random.word(), undefined]), scheme: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), epoch: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), user_ip: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
105
|
+
export const getSitesErrorLogsMock = () => ({ datetime_end: faker.helpers.arrayElement([faker.random.word(), undefined]), datetime_start: faker.helpers.arrayElement([faker.random.word(), undefined]), page_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), total: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), logs: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ datetime: faker.helpers.arrayElement([faker.random.word(), undefined]), file: faker.helpers.arrayElement([faker.random.word(), undefined]), kind: faker.helpers.arrayElement([faker.random.word(), undefined]), line: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), message: faker.helpers.arrayElement([faker.random.word(), undefined]), name: faker.helpers.arrayElement([faker.random.word(), undefined]), severity: faker.helpers.arrayElement([faker.random.word(), undefined]), epoch: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]) });
|
|
105
106
|
export const getSiteMalwareStatusMock = () => ({ malware_status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), scanner_state: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
|
|
106
107
|
export const getSitePendingDomainDeleteMock = () => ({});
|
|
107
108
|
export const getSitesPerformanceCachepurgeMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
@@ -279,6 +280,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
279
280
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingShellInfoMock()));
|
|
280
281
|
}), rest.post('*/v1/hosting/:hostingId/sites', (_req, res, ctx) => {
|
|
281
282
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingSiteAddMock()));
|
|
283
|
+
}), rest.put('*/v1/hosting/:hostingId/sites/batch', (_req, res, ctx) => {
|
|
284
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesBatchMock()));
|
|
282
285
|
}), rest.get('*/v1/hosting/:hostingId/ssh', (_req, res, ctx) => {
|
|
283
286
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingSshInfoMock()));
|
|
284
287
|
}), rest.get('*/v1/hosting/:hostingId/ssh/fetch', (_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.894.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SitesSecuritySitelockV2200 = {
|
|
9
9
|
addon_id?: number | null;
|
|
@@ -135,6 +135,18 @@ export declare type SshKeyListV2200RowsItem = {
|
|
|
135
135
|
export declare type SshKeyListV2200 = {
|
|
136
136
|
rows?: SshKeyListV2200RowsItem[];
|
|
137
137
|
};
|
|
138
|
+
export declare type HostingSitesV2200 = {
|
|
139
|
+
total?: number;
|
|
140
|
+
page?: number;
|
|
141
|
+
limit?: number;
|
|
142
|
+
/** Maximum number of sites the customer can have. Null means 'unlimited'. */
|
|
143
|
+
max_sites?: number | null;
|
|
144
|
+
/** Current number of sites in use by the customer. its normal for this value to be different than the total number of sites in the list. */
|
|
145
|
+
used_sites?: number;
|
|
146
|
+
/** Remaining number of sites the customer can create. Max sites - used sites. Null means 'unlimited'. */
|
|
147
|
+
available_sites?: number | null;
|
|
148
|
+
items?: HostingSitesV2200ItemsItem[];
|
|
149
|
+
};
|
|
138
150
|
export declare type HostingSitesV2200ItemsItemResourcesStorage = {
|
|
139
151
|
available?: number | null;
|
|
140
152
|
total?: number | null;
|
|
@@ -199,18 +211,6 @@ export declare type HostingSitesV2200ItemsItem = {
|
|
|
199
211
|
jobs?: HostingSitesV2200ItemsItemJobs;
|
|
200
212
|
resources?: HostingSitesV2200ItemsItemResources;
|
|
201
213
|
};
|
|
202
|
-
export declare type HostingSitesV2200 = {
|
|
203
|
-
total?: number;
|
|
204
|
-
page?: number;
|
|
205
|
-
limit?: number;
|
|
206
|
-
/** Maximum number of sites the customer can have. Null means 'unlimited'. */
|
|
207
|
-
max_sites?: number | null;
|
|
208
|
-
/** Current number of sites in use by the customer. its normal for this value to be different than the total number of sites in the list. */
|
|
209
|
-
used_sites?: number;
|
|
210
|
-
/** Remaining number of sites the customer can create. Max sites - used sites. Null means 'unlimited'. */
|
|
211
|
-
available_sites?: number | null;
|
|
212
|
-
items?: HostingSitesV2200ItemsItem[];
|
|
213
|
-
};
|
|
214
214
|
export declare type HostingNameserversV2200HostsItem = {
|
|
215
215
|
host?: string;
|
|
216
216
|
ips?: string[];
|
|
@@ -523,17 +523,18 @@ export declare type SiteMalwareStatus200 = {
|
|
|
523
523
|
scanner_state?: string | null;
|
|
524
524
|
};
|
|
525
525
|
export declare type SitesErrorLogs200LogsItem = {
|
|
526
|
+
datetime?: string;
|
|
526
527
|
file?: string;
|
|
527
528
|
kind?: string;
|
|
528
529
|
line?: number;
|
|
529
530
|
message?: string;
|
|
530
531
|
name?: string;
|
|
531
532
|
severity?: string;
|
|
532
|
-
|
|
533
|
+
epoch?: number;
|
|
533
534
|
};
|
|
534
535
|
export declare type SitesErrorLogs200 = {
|
|
535
|
-
|
|
536
|
-
|
|
536
|
+
datetime_end?: string;
|
|
537
|
+
datetime_start?: string;
|
|
537
538
|
page_id?: string | null;
|
|
538
539
|
total?: number;
|
|
539
540
|
logs?: SitesErrorLogs200LogsItem[];
|
|
@@ -568,7 +569,7 @@ export declare type SitesErrorLogsParams = {
|
|
|
568
569
|
export declare type SitesAccessLogs200LogsItem = {
|
|
569
570
|
body_bytes_sent?: number;
|
|
570
571
|
cached?: string;
|
|
571
|
-
|
|
572
|
+
datetime?: string;
|
|
572
573
|
http_host?: string;
|
|
573
574
|
http_referrer?: string;
|
|
574
575
|
http_user_agent?: string;
|
|
@@ -580,13 +581,13 @@ export declare type SitesAccessLogs200LogsItem = {
|
|
|
580
581
|
request_url?: string;
|
|
581
582
|
scheme?: string;
|
|
582
583
|
status?: number;
|
|
583
|
-
|
|
584
|
+
epoch?: number;
|
|
584
585
|
type?: string;
|
|
585
586
|
user_ip?: string;
|
|
586
587
|
};
|
|
587
588
|
export declare type SitesAccessLogs200 = {
|
|
588
|
-
|
|
589
|
-
|
|
589
|
+
datetime_end?: string;
|
|
590
|
+
datetime_start?: string;
|
|
590
591
|
page_id?: string | null;
|
|
591
592
|
total?: number;
|
|
592
593
|
logs?: SitesAccessLogs200LogsItem[];
|
|
@@ -987,6 +988,20 @@ export declare type HostingSshInfo200 = {
|
|
|
987
988
|
status?: string;
|
|
988
989
|
success?: boolean;
|
|
989
990
|
};
|
|
991
|
+
export declare type SitesBatch200 = {
|
|
992
|
+
success?: boolean;
|
|
993
|
+
};
|
|
994
|
+
export declare type SitesBatchBodySitesItem = {
|
|
995
|
+
/** site_id of the site to be updated */
|
|
996
|
+
site_id?: number;
|
|
997
|
+
/** Disk space in GiB */
|
|
998
|
+
disk_limit_gib?: number;
|
|
999
|
+
/** Number of PHP workers */
|
|
1000
|
+
workers?: number;
|
|
1001
|
+
};
|
|
1002
|
+
export declare type SitesBatchBody = {
|
|
1003
|
+
sites?: SitesBatchBodySitesItem[];
|
|
1004
|
+
};
|
|
990
1005
|
export declare type HostingSiteAdd200 = {
|
|
991
1006
|
id?: number;
|
|
992
1007
|
status?: string;
|