@newfold/huapi-js 1.847.0 → 1.853.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/README.md +0 -0
- package/orval.config.d.ts +0 -0
- package/orval.config.js +0 -0
- package/package.json +2 -2
- package/src/index.d.ts +30 -2
- package/src/index.js +35 -1
- package/src/index.msw.d.ts +40 -0
- package/src/index.msw.js +7 -1
- package/src/index.schemas.d.ts +93 -1
- package/src/index.schemas.js +10 -0
package/README.md
CHANGED
|
File without changes
|
package/orval.config.d.ts
CHANGED
|
File without changes
|
package/orval.config.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"name": "@newfold/huapi-js",
|
|
3
3
|
"peerDependencies": {
|
|
4
4
|
"@faker-js/faker": "^6.1.2",
|
|
5
|
+
"@tanstack/react-query": "^4.26.1",
|
|
5
6
|
"axios": "^0.27.2",
|
|
6
7
|
"msw": "^0.42.1",
|
|
7
8
|
"react": "^17.0.0 || ^18.0.0",
|
|
8
9
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
9
|
-
"@tanstack/react-query": "^4.26.1",
|
|
10
10
|
"tslib": "2.4.0"
|
|
11
11
|
},
|
|
12
12
|
"module": "dist/index.ts",
|
|
13
|
-
"version": "1.
|
|
13
|
+
"version": "1.853.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.
|
|
6
|
+
* OpenAPI spec version: 0.1.0-unknown
|
|
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 } 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 } 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 error 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.
|
|
6
|
+
* OpenAPI spec version: 0.1.0-unknown
|
|
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 error 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
|
package/src/index.msw.d.ts
CHANGED
|
@@ -607,6 +607,46 @@ export declare const getSitesDomainsCreateMock: () => {
|
|
|
607
607
|
id: number | undefined;
|
|
608
608
|
status: string | undefined;
|
|
609
609
|
};
|
|
610
|
+
export declare const getSitesAccessLogsMock: () => {
|
|
611
|
+
date_end: string | undefined;
|
|
612
|
+
date_start: string | undefined;
|
|
613
|
+
scroll_id: string | null | undefined;
|
|
614
|
+
total: number | undefined;
|
|
615
|
+
logs: {
|
|
616
|
+
body_bytes_sent: number | undefined;
|
|
617
|
+
cached: boolean | undefined;
|
|
618
|
+
date: string | undefined;
|
|
619
|
+
http_host: string | undefined;
|
|
620
|
+
http_referrer: string | undefined;
|
|
621
|
+
http_user_agent: string | undefined;
|
|
622
|
+
http_x_forwarded_for: string | undefined;
|
|
623
|
+
renderer: string | undefined;
|
|
624
|
+
request_completion: string | undefined;
|
|
625
|
+
request_time: number | undefined;
|
|
626
|
+
request_type: string | undefined;
|
|
627
|
+
request_url: string | undefined;
|
|
628
|
+
scheme: string | undefined;
|
|
629
|
+
status: number | undefined;
|
|
630
|
+
timestamp: number | undefined;
|
|
631
|
+
type: string | undefined;
|
|
632
|
+
user_ip: string | undefined;
|
|
633
|
+
}[] | undefined;
|
|
634
|
+
};
|
|
635
|
+
export declare const getSitesErrorLogsMock: () => {
|
|
636
|
+
date_end: string | undefined;
|
|
637
|
+
date_start: string | undefined;
|
|
638
|
+
scroll_id: string | null | undefined;
|
|
639
|
+
total: number | undefined;
|
|
640
|
+
logs: {
|
|
641
|
+
file: string | undefined;
|
|
642
|
+
kind: string | undefined;
|
|
643
|
+
line: number | undefined;
|
|
644
|
+
message: string | undefined;
|
|
645
|
+
name: string | undefined;
|
|
646
|
+
severity: string | undefined;
|
|
647
|
+
timestamp: string | undefined;
|
|
648
|
+
}[] | undefined;
|
|
649
|
+
};
|
|
610
650
|
export declare const getSitePendingDomainDeleteMock: () => {};
|
|
611
651
|
export declare const getSitesPerformanceCachepurgeMock: () => {
|
|
612
652
|
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.
|
|
6
|
+
* OpenAPI spec version: 0.1.0-unknown
|
|
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.datatype.boolean(), 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 = () => ({});
|
|
@@ -327,6 +329,10 @@ export const getHostingUAPIMSW = () => [
|
|
|
327
329
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsMock()));
|
|
328
330
|
}), rest.post('*/v1/sites/:siteId/domains', (_req, res, ctx) => {
|
|
329
331
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsCreateMock()));
|
|
332
|
+
}), rest.get('*/v1/sites/:siteId/logs/access', (_req, res, ctx) => {
|
|
333
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesAccessLogsMock()));
|
|
334
|
+
}), rest.get('*/v1/sites/:siteId/logs/error', (_req, res, ctx) => {
|
|
335
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesErrorLogsMock()));
|
|
330
336
|
}), rest.delete('*/v1/sites/:siteId/pending-domain', (_req, res, ctx) => {
|
|
331
337
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitePendingDomainDeleteMock()));
|
|
332
338
|
}), rest.post('*/v1/sites/:siteId/performance/cachepurge', (_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: 0.1.0-unknown
|
|
7
7
|
*/
|
|
8
8
|
export declare type SitesListV2200ItemsItemResourcesStorage = {
|
|
9
9
|
available?: number | null;
|
|
@@ -417,6 +417,98 @@ export declare type SitesPerformanceCachepurgeBody = {
|
|
|
417
417
|
export declare type SitePendingDomainDelete200 = {
|
|
418
418
|
[key: string]: any;
|
|
419
419
|
};
|
|
420
|
+
export declare type SitesErrorLogs200LogsItem = {
|
|
421
|
+
file?: string;
|
|
422
|
+
kind?: string;
|
|
423
|
+
line?: number;
|
|
424
|
+
message?: string;
|
|
425
|
+
name?: string;
|
|
426
|
+
severity?: string;
|
|
427
|
+
timestamp?: string;
|
|
428
|
+
};
|
|
429
|
+
export declare type SitesErrorLogs200 = {
|
|
430
|
+
date_end?: string;
|
|
431
|
+
date_start?: string;
|
|
432
|
+
scroll_id?: string | null;
|
|
433
|
+
total?: number;
|
|
434
|
+
logs?: SitesErrorLogs200LogsItem[];
|
|
435
|
+
};
|
|
436
|
+
export declare type SitesErrorLogsSort = typeof SitesErrorLogsSort[keyof typeof SitesErrorLogsSort];
|
|
437
|
+
export declare const SitesErrorLogsSort: {
|
|
438
|
+
readonly asc: "asc";
|
|
439
|
+
readonly desc: "desc";
|
|
440
|
+
};
|
|
441
|
+
export declare type SitesErrorLogsParams = {
|
|
442
|
+
/**
|
|
443
|
+
* Start time. Can be a unix time, a timestamp, or a {n}[dhm] format. Default is -1 day.
|
|
444
|
+
*/
|
|
445
|
+
start?: string;
|
|
446
|
+
/**
|
|
447
|
+
* End time. Can be a unix time, a timestamp, now, or a {n}[dhm] format. Default is now.
|
|
448
|
+
*/
|
|
449
|
+
end?: string;
|
|
450
|
+
limit?: number;
|
|
451
|
+
sort?: SitesErrorLogsSort;
|
|
452
|
+
/**
|
|
453
|
+
* Items to filter on. Supported filters include: severity
|
|
454
|
+
*/
|
|
455
|
+
filter?: {
|
|
456
|
+
severity?: string[];
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
export declare type SitesAccessLogs200LogsItem = {
|
|
460
|
+
body_bytes_sent?: number;
|
|
461
|
+
cached?: boolean;
|
|
462
|
+
date?: string;
|
|
463
|
+
http_host?: string;
|
|
464
|
+
http_referrer?: string;
|
|
465
|
+
http_user_agent?: string;
|
|
466
|
+
http_x_forwarded_for?: string;
|
|
467
|
+
renderer?: string;
|
|
468
|
+
request_completion?: string;
|
|
469
|
+
request_time?: number;
|
|
470
|
+
request_type?: string;
|
|
471
|
+
request_url?: string;
|
|
472
|
+
scheme?: string;
|
|
473
|
+
status?: number;
|
|
474
|
+
timestamp?: number;
|
|
475
|
+
type?: string;
|
|
476
|
+
user_ip?: string;
|
|
477
|
+
};
|
|
478
|
+
export declare type SitesAccessLogs200 = {
|
|
479
|
+
date_end?: string;
|
|
480
|
+
date_start?: string;
|
|
481
|
+
scroll_id?: string | null;
|
|
482
|
+
total?: number;
|
|
483
|
+
logs?: SitesAccessLogs200LogsItem[];
|
|
484
|
+
};
|
|
485
|
+
export declare type SitesAccessLogsSort = typeof SitesAccessLogsSort[keyof typeof SitesAccessLogsSort];
|
|
486
|
+
export declare const SitesAccessLogsSort: {
|
|
487
|
+
readonly asc: "asc";
|
|
488
|
+
readonly desc: "desc";
|
|
489
|
+
};
|
|
490
|
+
export declare type SitesAccessLogsParams = {
|
|
491
|
+
/**
|
|
492
|
+
* Start time. Can be a unix time, a timestamp, or a {n}[dhm] format.
|
|
493
|
+
*/
|
|
494
|
+
start?: string;
|
|
495
|
+
/**
|
|
496
|
+
* End time. Can be a unix time, a timestamp, now, or a {n}[dhm] format.
|
|
497
|
+
*/
|
|
498
|
+
end?: string;
|
|
499
|
+
limit?: number;
|
|
500
|
+
sort?: SitesAccessLogsSort;
|
|
501
|
+
/**
|
|
502
|
+
* Items to filter on. Supported filters include: cached, renderer, request_type, status, user_ip
|
|
503
|
+
*/
|
|
504
|
+
filter?: {
|
|
505
|
+
cached?: boolean[];
|
|
506
|
+
renderer?: string[];
|
|
507
|
+
request_type?: string[];
|
|
508
|
+
status?: number[];
|
|
509
|
+
user_ip?: string[];
|
|
510
|
+
};
|
|
511
|
+
};
|
|
420
512
|
export declare type SitesDomainsCreate200 = {
|
|
421
513
|
id?: number;
|
|
422
514
|
status?: string;
|
package/src/index.schemas.js
CHANGED
|
@@ -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',
|