@newfold/huapi-js 1.852.0 → 1.857.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "tslib": "2.4.0"
11
11
  },
12
12
  "module": "dist/index.ts",
13
- "version": "1.852.0",
13
+ "version": "1.857.0",
14
14
  "sideEffects": false,
15
15
  "main": "./src/index.js",
16
16
  "types": "./src/index.d.ts",
package/src/index.d.ts CHANGED
@@ -3,12 +3,12 @@
3
3
  * Do not edit manually.
4
4
  * Hosting UAPI
5
5
  * Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
6
- * OpenAPI spec version: 1.852.0
6
+ * OpenAPI spec version: 1.857.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 { 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, SitesDomains200, SitesDomainsCreate200, SitesDomainsCreateBody, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, 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, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params } 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, 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, SitesDomains200, SitesDomainsCreate200, SitesDomainsCreateBody, SitesAccessLogs200, SitesAccessLogsParams, SitesErrorLogs200, SitesErrorLogsParams, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, 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, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params } 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
  /**
@@ -1473,6 +1473,34 @@ export declare const useSitesDomainsCreate: <TError = AxiosError<unknown, any>,
1473
1473
  siteId: number;
1474
1474
  data: SitesDomainsCreateBody;
1475
1475
  }, TContext>;
1476
+ /**
1477
+ * Returns site access logs.
1478
+ * @summary Site access logs
1479
+ */
1480
+ export declare const sitesAccessLogs: (siteId: number, params?: SitesAccessLogsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesAccessLogs200>>;
1481
+ export declare const getSitesAccessLogsQueryKey: (siteId: number, params?: SitesAccessLogsParams) => (string | SitesAccessLogsParams)[];
1482
+ export declare type SitesAccessLogsQueryResult = NonNullable<Awaited<ReturnType<typeof sitesAccessLogs>>>;
1483
+ export declare type SitesAccessLogsQueryError = AxiosError<unknown>;
1484
+ export declare const useSitesAccessLogs: <TData = AxiosResponse<SitesAccessLogs200, any>, TError = AxiosError<unknown, any>>(siteId: number, params?: SitesAccessLogsParams, options?: {
1485
+ query?: UseQueryOptions<AxiosResponse<SitesAccessLogs200, any>, TError, TData, QueryKey> | undefined;
1486
+ axios?: AxiosRequestConfig<any> | undefined;
1487
+ } | undefined) => UseQueryResult<TData, TError> & {
1488
+ queryKey: QueryKey;
1489
+ };
1490
+ /**
1491
+ * Returns site error logs.
1492
+ * @summary Site error logs
1493
+ */
1494
+ export declare const sitesErrorLogs: (siteId: number, params?: SitesErrorLogsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesErrorLogs200>>;
1495
+ export declare const getSitesErrorLogsQueryKey: (siteId: number, params?: SitesErrorLogsParams) => (string | SitesErrorLogsParams)[];
1496
+ export declare type SitesErrorLogsQueryResult = NonNullable<Awaited<ReturnType<typeof sitesErrorLogs>>>;
1497
+ export declare type SitesErrorLogsQueryError = AxiosError<unknown>;
1498
+ export declare const useSitesErrorLogs: <TData = AxiosResponse<SitesErrorLogs200, any>, TError = AxiosError<unknown, any>>(siteId: number, params?: SitesErrorLogsParams, options?: {
1499
+ query?: UseQueryOptions<AxiosResponse<SitesErrorLogs200, any>, TError, TData, QueryKey> | undefined;
1500
+ axios?: AxiosRequestConfig<any> | undefined;
1501
+ } | undefined) => UseQueryResult<TData, TError> & {
1502
+ queryKey: QueryKey;
1503
+ };
1476
1504
  /**
1477
1505
  * Delete pending domain
1478
1506
  * @summary Delete pending domain
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.852.0
6
+ * OpenAPI spec version: 1.857.0
7
7
  */
8
8
  import axios from 'axios';
9
9
  import { useQuery, useMutation } from '@tanstack/react-query';
@@ -1527,6 +1527,40 @@ export const useSitesDomainsCreate = (options) => {
1527
1527
  };
1528
1528
  return useMutation(mutationFn, mutationOptions);
1529
1529
  };
1530
+ /**
1531
+ * Returns site access logs.
1532
+ * @summary Site access logs
1533
+ */
1534
+ export const sitesAccessLogs = (siteId, params, options) => {
1535
+ return axios.get(`/v1/sites/${siteId}/logs/access`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
1536
+ };
1537
+ export const getSitesAccessLogsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/logs/access`, ...(params ? [params] : [])];
1538
+ export const useSitesAccessLogs = (siteId, params, options) => {
1539
+ var _a;
1540
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1541
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesAccessLogsQueryKey(siteId, params);
1542
+ const queryFn = ({ signal }) => sitesAccessLogs(siteId, params, Object.assign({ signal }, axiosOptions));
1543
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1544
+ query.queryKey = queryKey;
1545
+ return query;
1546
+ };
1547
+ /**
1548
+ * Returns site error logs.
1549
+ * @summary Site error logs
1550
+ */
1551
+ export const sitesErrorLogs = (siteId, params, options) => {
1552
+ return axios.get(`/v1/sites/${siteId}/logs/error`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
1553
+ };
1554
+ export const getSitesErrorLogsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/logs/error`, ...(params ? [params] : [])];
1555
+ export const useSitesErrorLogs = (siteId, params, options) => {
1556
+ var _a;
1557
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1558
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesErrorLogsQueryKey(siteId, params);
1559
+ const queryFn = ({ signal }) => sitesErrorLogs(siteId, params, Object.assign({ signal }, axiosOptions));
1560
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1561
+ query.queryKey = queryKey;
1562
+ return query;
1563
+ };
1530
1564
  /**
1531
1565
  * Delete pending domain
1532
1566
  * @summary Delete pending domain
@@ -609,6 +609,46 @@ export declare const getSitesDomainsCreateMock: () => {
609
609
  id: number | undefined;
610
610
  status: string | undefined;
611
611
  };
612
+ export declare const getSitesAccessLogsMock: () => {
613
+ date_end: string | undefined;
614
+ date_start: string | undefined;
615
+ scroll_id: string | null | undefined;
616
+ total: number | undefined;
617
+ logs: {
618
+ body_bytes_sent: number | undefined;
619
+ cached: string | undefined;
620
+ date: string | undefined;
621
+ http_host: string | undefined;
622
+ http_referrer: string | undefined;
623
+ http_user_agent: string | undefined;
624
+ http_x_forwarded_for: string | undefined;
625
+ renderer: string | undefined;
626
+ request_completion: string | undefined;
627
+ request_time: number | undefined;
628
+ request_type: string | undefined;
629
+ request_url: string | undefined;
630
+ scheme: string | undefined;
631
+ status: number | undefined;
632
+ timestamp: number | undefined;
633
+ type: string | undefined;
634
+ user_ip: string | undefined;
635
+ }[] | undefined;
636
+ };
637
+ export declare const getSitesErrorLogsMock: () => {
638
+ date_end: string | undefined;
639
+ date_start: string | undefined;
640
+ scroll_id: string | null | undefined;
641
+ total: number | undefined;
642
+ logs: {
643
+ file: string | undefined;
644
+ kind: string | undefined;
645
+ line: number | undefined;
646
+ message: string | undefined;
647
+ name: string | undefined;
648
+ severity: string | undefined;
649
+ timestamp: string | undefined;
650
+ }[] | undefined;
651
+ };
612
652
  export declare const getSitePendingDomainDeleteMock: () => {};
613
653
  export declare const getSitesPerformanceCachepurgeMock: () => {
614
654
  success: boolean | 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.852.0
6
+ * OpenAPI spec version: 1.857.0
7
7
  */
8
8
  import { rest } from 'msw';
9
9
  import { faker } from '@faker-js/faker';
@@ -101,6 +101,8 @@ export const getSitesDomainMock = () => ({ connected: faker.helpers.arrayElement
101
101
  export const getSitesDomainUrlMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
102
102
  export const getSitesDomainsMock = () => ({ domains: 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]), autogen_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), authoritative: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), dns_status: faker.helpers.arrayElement([faker.random.word(), undefined]), docroot: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), domain: faker.helpers.arrayElement([faker.random.word(), undefined]), base_domain: faker.helpers.arrayElement([faker.random.word(), undefined]), ssl_type: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
103
103
  export const getSitesDomainsCreateMock = () => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), status: 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]), scroll_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]), scroll_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]) });
104
106
  export const getSitePendingDomainDeleteMock = () => ({});
105
107
  export const getSitesPerformanceCachepurgeMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
106
108
  export const getSitesPerformanceEdgecacheMock = () => ({});
@@ -328,6 +330,10 @@ export const getHostingUAPIMSW = () => [
328
330
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsMock()));
329
331
  }), rest.post('*/v1/sites/:siteId/domains', (_req, res, ctx) => {
330
332
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsCreateMock()));
333
+ }), rest.get('*/v1/sites/:siteId/logs/access', (_req, res, ctx) => {
334
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesAccessLogsMock()));
335
+ }), rest.get('*/v1/sites/:siteId/logs/error', (_req, res, ctx) => {
336
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesErrorLogsMock()));
331
337
  }), rest.delete('*/v1/sites/:siteId/pending-domain', (_req, res, ctx) => {
332
338
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitePendingDomainDeleteMock()));
333
339
  }), rest.post('*/v1/sites/:siteId/performance/cachepurge', (_req, res, ctx) => {
@@ -3,7 +3,7 @@
3
3
  * Do not edit manually.
4
4
  * Hosting UAPI
5
5
  * Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
6
- * OpenAPI spec version: 1.852.0
6
+ * OpenAPI spec version: 1.857.0
7
7
  */
8
8
  export declare type SitesDomainsV2200DomainsItem = {
9
9
  id?: number;
@@ -447,6 +447,106 @@ export declare type SitesPerformanceCachepurgeBody = {
447
447
  export declare type SitePendingDomainDelete200 = {
448
448
  [key: string]: any;
449
449
  };
450
+ export declare type SitesErrorLogs200LogsItem = {
451
+ file?: string;
452
+ kind?: string;
453
+ line?: number;
454
+ message?: string;
455
+ name?: string;
456
+ severity?: string;
457
+ timestamp?: string;
458
+ };
459
+ export declare type SitesErrorLogs200 = {
460
+ date_end?: string;
461
+ date_start?: string;
462
+ scroll_id?: string | null;
463
+ total?: number;
464
+ logs?: SitesErrorLogs200LogsItem[];
465
+ };
466
+ export declare type SitesErrorLogsSort = typeof SitesErrorLogsSort[keyof typeof SitesErrorLogsSort];
467
+ export declare const SitesErrorLogsSort: {
468
+ readonly asc: "asc";
469
+ readonly desc: "desc";
470
+ };
471
+ export declare type SitesErrorLogsParams = {
472
+ /**
473
+ * Start time. Can be a unix time, a timestamp, or a {n}[dhm] format. Default is -1 day.
474
+ */
475
+ start?: string;
476
+ /**
477
+ * End time. Can be a unix time, a timestamp, now, or a {n}[dhm] format. Default is now.
478
+ */
479
+ end?: string;
480
+ /**
481
+ * max number of logs to return (default: 25)
482
+ */
483
+ limit?: number;
484
+ scroll_id?: string;
485
+ sort?: SitesErrorLogsSort;
486
+ /**
487
+ * Items to filter on. Supported filters include: severity
488
+ */
489
+ filter?: {
490
+ severity?: string[];
491
+ };
492
+ };
493
+ export declare type SitesAccessLogs200LogsItem = {
494
+ body_bytes_sent?: number;
495
+ cached?: string;
496
+ date?: string;
497
+ http_host?: string;
498
+ http_referrer?: string;
499
+ http_user_agent?: string;
500
+ http_x_forwarded_for?: string;
501
+ renderer?: string;
502
+ request_completion?: string;
503
+ request_time?: number;
504
+ request_type?: string;
505
+ request_url?: string;
506
+ scheme?: string;
507
+ status?: number;
508
+ timestamp?: number;
509
+ type?: string;
510
+ user_ip?: string;
511
+ };
512
+ export declare type SitesAccessLogs200 = {
513
+ date_end?: string;
514
+ date_start?: string;
515
+ scroll_id?: string | null;
516
+ total?: number;
517
+ logs?: SitesAccessLogs200LogsItem[];
518
+ };
519
+ export declare type SitesAccessLogsSort = typeof SitesAccessLogsSort[keyof typeof SitesAccessLogsSort];
520
+ export declare const SitesAccessLogsSort: {
521
+ readonly asc: "asc";
522
+ readonly desc: "desc";
523
+ };
524
+ export declare type SitesAccessLogsParams = {
525
+ /**
526
+ * Start time. Can be a unix time, a timestamp, or a {n}[dhm] format.
527
+ */
528
+ start?: string;
529
+ /**
530
+ * End time. Can be a unix time, a timestamp, now, or a {n}[dhm] format.
531
+ */
532
+ end?: string;
533
+ /**
534
+ * max number of logs to return (default: 25)
535
+ */
536
+ limit?: number;
537
+ scroll_id?: string;
538
+ sort?: SitesAccessLogsSort;
539
+ /**
540
+ * Items to filter on. Supported filters include: cached, renderer, request_type, status, user_ip
541
+ */
542
+ filter?: {
543
+ cached?: string[];
544
+ renderer?: string[];
545
+ request_type?: string[];
546
+ status?: number[];
547
+ user_ip?: string[];
548
+ };
549
+ };
450
550
  export declare type SitesDomainsCreate200 = {
451
551
  id?: number;
452
552
  status?: string;
@@ -14,6 +14,16 @@ export const SitesSsoBounceName = {
14
14
  wpmigration: 'wpmigration',
15
15
  };
16
16
  // eslint-disable-next-line @typescript-eslint/no-redeclare
17
+ export const SitesErrorLogsSort = {
18
+ asc: 'asc',
19
+ desc: 'desc',
20
+ };
21
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
22
+ export const SitesAccessLogsSort = {
23
+ asc: 'asc',
24
+ desc: 'desc',
25
+ };
26
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
17
27
  export const SitesAutoupdatesUpdateBodyType = {
18
28
  core: 'core',
19
29
  plugins: 'plugins',