@newfold/huapi-js 1.891.0 → 1.893.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/orval.config.js +2 -2
- package/package.json +1 -1
- package/src/index.d.ts +20 -2
- package/src/index.js +18 -3
- package/src/index.msw.d.ts +5 -2
- package/src/index.msw.js +6 -3
- package/src/index.schemas.d.ts +31 -17
package/orval.config.js
CHANGED
|
@@ -18,14 +18,14 @@ export default defineConfig({
|
|
|
18
18
|
query: {
|
|
19
19
|
useQuery: true,
|
|
20
20
|
useInfinite: true,
|
|
21
|
-
useInfiniteQueryParam: '
|
|
21
|
+
useInfiniteQueryParam: 'page_id',
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
sites_access_logs: {
|
|
25
25
|
query: {
|
|
26
26
|
useQuery: true,
|
|
27
27
|
useInfinite: true,
|
|
28
|
-
useInfiniteQueryParam: '
|
|
28
|
+
useInfiniteQueryParam: 'page_id',
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
},
|
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.893.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.893.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
|
|
@@ -1522,7 +1537,7 @@ export const useSitesAccessLogsInfinite = (siteId, params, options) => {
|
|
|
1522
1537
|
var _a;
|
|
1523
1538
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1524
1539
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
|
|
1525
|
-
const queryFn = ({ pageParam }) => sitesAccessLogs(siteId, Object.assign({
|
|
1540
|
+
const queryFn = ({ pageParam }) => sitesAccessLogs(siteId, Object.assign({ page_id: pageParam }, params), axiosOptions);
|
|
1526
1541
|
const query = useInfiniteQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
|
|
1527
1542
|
query.queryKey = queryKey;
|
|
1528
1543
|
return query;
|
|
@@ -1548,7 +1563,7 @@ export const useSitesErrorLogsInfinite = (siteId, params, options) => {
|
|
|
1548
1563
|
var _a;
|
|
1549
1564
|
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1550
1565
|
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
|
|
1551
|
-
const queryFn = ({ pageParam }) => sitesErrorLogs(siteId, Object.assign({
|
|
1566
|
+
const queryFn = ({ pageParam }) => sitesErrorLogs(siteId, Object.assign({ page_id: pageParam }, params), axiosOptions);
|
|
1552
1567
|
const query = useInfiniteQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
|
|
1553
1568
|
query.queryKey = queryKey;
|
|
1554
1569
|
return query;
|
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;
|
|
@@ -604,7 +607,7 @@ export declare const getSitesDomainsCreateMock: () => {
|
|
|
604
607
|
export declare const getSitesAccessLogsMock: () => {
|
|
605
608
|
date_end: string | undefined;
|
|
606
609
|
date_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;
|
|
@@ -629,7 +632,7 @@ export declare const getSitesAccessLogsMock: () => {
|
|
|
629
632
|
export declare const getSitesErrorLogsMock: () => {
|
|
630
633
|
date_end: string | undefined;
|
|
631
634
|
date_start: string | undefined;
|
|
632
|
-
|
|
635
|
+
page_id: string | null | undefined;
|
|
633
636
|
total: number | undefined;
|
|
634
637
|
logs: {
|
|
635
638
|
file: 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.893.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 = () => ({ date_end: faker.helpers.arrayElement([faker.random.word(), undefined]), date_start: faker.helpers.arrayElement([faker.random.word(), undefined]),
|
|
104
|
-
export const getSitesErrorLogsMock = () => ({ date_end: faker.helpers.arrayElement([faker.random.word(), undefined]), date_start: faker.helpers.arrayElement([faker.random.word(), undefined]),
|
|
104
|
+
export const getSitesAccessLogsMock = () => ({ date_end: faker.helpers.arrayElement([faker.random.word(), undefined]), date_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]), date: 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]), timestamp: 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 = () => ({ date_end: faker.helpers.arrayElement([faker.random.word(), undefined]), date_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(() => ({ 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]), timestamp: faker.helpers.arrayElement([faker.random.word(), 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.893.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[];
|
|
@@ -534,7 +534,7 @@ export declare type SitesErrorLogs200LogsItem = {
|
|
|
534
534
|
export declare type SitesErrorLogs200 = {
|
|
535
535
|
date_end?: string;
|
|
536
536
|
date_start?: string;
|
|
537
|
-
|
|
537
|
+
page_id?: string | null;
|
|
538
538
|
total?: number;
|
|
539
539
|
logs?: SitesErrorLogs200LogsItem[];
|
|
540
540
|
};
|
|
@@ -556,7 +556,7 @@ export declare type SitesErrorLogsParams = {
|
|
|
556
556
|
* max number of logs to return (default: 25)
|
|
557
557
|
*/
|
|
558
558
|
limit?: number;
|
|
559
|
-
|
|
559
|
+
page_id?: string;
|
|
560
560
|
sort?: SitesErrorLogsSort;
|
|
561
561
|
/**
|
|
562
562
|
* Items to filter on. Supported filters include: severity
|
|
@@ -587,7 +587,7 @@ export declare type SitesAccessLogs200LogsItem = {
|
|
|
587
587
|
export declare type SitesAccessLogs200 = {
|
|
588
588
|
date_end?: string;
|
|
589
589
|
date_start?: string;
|
|
590
|
-
|
|
590
|
+
page_id?: string | null;
|
|
591
591
|
total?: number;
|
|
592
592
|
logs?: SitesAccessLogs200LogsItem[];
|
|
593
593
|
};
|
|
@@ -609,7 +609,7 @@ export declare type SitesAccessLogsParams = {
|
|
|
609
609
|
* max number of logs to return (default: 25)
|
|
610
610
|
*/
|
|
611
611
|
limit?: number;
|
|
612
|
-
|
|
612
|
+
page_id?: string;
|
|
613
613
|
sort?: SitesAccessLogsSort;
|
|
614
614
|
/**
|
|
615
615
|
* Items to filter on. Supported filters include: cached, renderer, request_type, status, user_ip
|
|
@@ -987,6 +987,20 @@ export declare type HostingSshInfo200 = {
|
|
|
987
987
|
status?: string;
|
|
988
988
|
success?: boolean;
|
|
989
989
|
};
|
|
990
|
+
export declare type SitesBatch200 = {
|
|
991
|
+
success?: boolean;
|
|
992
|
+
};
|
|
993
|
+
export declare type SitesBatchBodySitesItem = {
|
|
994
|
+
/** site_id of the site to be updated */
|
|
995
|
+
site_id?: number;
|
|
996
|
+
/** Disk space in GiB */
|
|
997
|
+
disk_limit_gib?: number;
|
|
998
|
+
/** Number of PHP workers */
|
|
999
|
+
workers?: number;
|
|
1000
|
+
};
|
|
1001
|
+
export declare type SitesBatchBody = {
|
|
1002
|
+
sites?: SitesBatchBodySitesItem[];
|
|
1003
|
+
};
|
|
990
1004
|
export declare type HostingSiteAdd200 = {
|
|
991
1005
|
id?: number;
|
|
992
1006
|
status?: string;
|