@newfold/huapi-js 1.419.0 → 1.432.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 +29 -2
- package/src/index.js +34 -1
- package/src/index.msw.d.ts +14 -0
- package/src/index.msw.js +9 -3
- package/src/index.schemas.d.ts +17 -2
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.432.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import type { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
10
10
|
import type { UseQueryOptions, UseMutationOptions, UseQueryResult, QueryKey } from '@tanstack/react-query';
|
|
11
|
-
import type { CodeguardBackupList200, CodeguardBackupListParams, CodeguardBackupCreate200, CodeguardBackupCreateBody, CodeguardBackupDownload200, CodeguardBackupDownloadBody, CodeguardBackupRestore200, CodeguardBackupRestoreBody, CodeguardDatabaseList200, CodeguardDatabaseBackupList200, CodeguardDatabaseBackupListParams, CodeguardDatabaseBackupCreate200, CodeguardDatabaseBackupCreateBody, CodeguardDatabaseBackupRestore200, CodeguardDatabaseBackupRestoreBody, CodeguardLoginLink200, CodeguardPlanInfo200, CodeguardWebsiteList200, CodeguardWebsiteBackupList200, CodeguardWebsiteBackupListParams, CodeguardWebsiteBackupCreate200, CodeguardWebsiteBackupCreateBody, CodeguardWebsiteBackupRestore200, CodeguardWebsiteBackupRestoreBody, AddonsSitelockSso200, AddonsCloudflare200, AddonsInfo200, 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, Domains200, DomainsParams, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSites200, 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, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainUrl200, SitesDomainUrlBody, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SiteSettingsAutoupdatePlugins200, SitesSettingsAutoupdates200, SitesSettingsAutoupdatesCore200, SitesSettingsAutoupdatesCoreBody, SitesSettingsAutoupdatesTheme200, SitesSettingsAutoupdatesThemeBody, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSso200, SitesSsoParams, SiteUsers200, SitesVersion200, HostingSitesV2200, SshKeyListV2200 } from './index.schemas';
|
|
11
|
+
import type { CodeguardBackupList200, CodeguardBackupListParams, CodeguardBackupCreate200, CodeguardBackupCreateBody, CodeguardBackupDownload200, CodeguardBackupDownloadBody, CodeguardBackupRestore200, CodeguardBackupRestoreBody, CodeguardDatabaseList200, CodeguardDatabaseBackupList200, CodeguardDatabaseBackupListParams, CodeguardDatabaseBackupCreate200, CodeguardDatabaseBackupCreateBody, CodeguardDatabaseBackupRestore200, CodeguardDatabaseBackupRestoreBody, CodeguardLoginLink200, CodeguardPlanInfo200, CodeguardWebsiteList200, CodeguardWebsiteBackupList200, CodeguardWebsiteBackupListParams, CodeguardWebsiteBackupCreate200, CodeguardWebsiteBackupCreateBody, CodeguardWebsiteBackupRestore200, CodeguardWebsiteBackupRestoreBody, AddonsSitelockSso200, AddonsCloudflare200, AddonsInfo200, 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, DbUserList200, Domains200, DomainsParams, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSites200, 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, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainUrl200, SitesDomainUrlBody, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SiteSettingsAutoupdatePlugins200, SitesSettingsAutoupdates200, SitesSettingsAutoupdatesCore200, SitesSettingsAutoupdatesCoreBody, SitesSettingsAutoupdatesTheme200, SitesSettingsAutoupdatesThemeBody, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingSitesV2200, SshKeyListV2200 } 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
|
/**
|
|
@@ -534,6 +534,20 @@ export declare const useDbList: <TData = AxiosResponse<DbList200, any>, TError =
|
|
|
534
534
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
535
535
|
queryKey: QueryKey;
|
|
536
536
|
};
|
|
537
|
+
/**
|
|
538
|
+
* List all DB users
|
|
539
|
+
* @summary Get list of db users
|
|
540
|
+
*/
|
|
541
|
+
export declare const dbUserList: (hostingId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<DbUserList200>>;
|
|
542
|
+
export declare const getDbUserListQueryKey: (hostingId: number) => string[];
|
|
543
|
+
export declare type DbUserListQueryResult = NonNullable<Awaited<ReturnType<typeof dbUserList>>>;
|
|
544
|
+
export declare type DbUserListQueryError = AxiosError<unknown>;
|
|
545
|
+
export declare const useDbUserList: <TData = AxiosResponse<DbUserList200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
|
|
546
|
+
query?: UseQueryOptions<AxiosResponse<DbUserList200, any>, TError, TData, QueryKey> | undefined;
|
|
547
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
548
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
549
|
+
queryKey: QueryKey;
|
|
550
|
+
};
|
|
537
551
|
/**
|
|
538
552
|
* Returns a list of domains
|
|
539
553
|
* @summary domain list
|
|
@@ -1553,6 +1567,19 @@ export declare const useSitesSso: <TData = AxiosResponse<SitesSso200, any>, TErr
|
|
|
1553
1567
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
1554
1568
|
queryKey: QueryKey;
|
|
1555
1569
|
};
|
|
1570
|
+
/**
|
|
1571
|
+
* @summary site status
|
|
1572
|
+
*/
|
|
1573
|
+
export declare const siteStatus: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SiteStatus200>>;
|
|
1574
|
+
export declare const getSiteStatusQueryKey: (siteId: number) => string[];
|
|
1575
|
+
export declare type SiteStatusQueryResult = NonNullable<Awaited<ReturnType<typeof siteStatus>>>;
|
|
1576
|
+
export declare type SiteStatusQueryError = AxiosError<unknown>;
|
|
1577
|
+
export declare const useSiteStatus: <TData = AxiosResponse<SiteStatus200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
|
|
1578
|
+
query?: UseQueryOptions<AxiosResponse<SiteStatus200, any>, TError, TData, QueryKey> | undefined;
|
|
1579
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
1580
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
1581
|
+
queryKey: QueryKey;
|
|
1582
|
+
};
|
|
1556
1583
|
/**
|
|
1557
1584
|
* Returns a list of the site's users
|
|
1558
1585
|
* @summary users
|
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.432.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -536,6 +536,23 @@ export const useDbList = (hostingId, options) => {
|
|
|
536
536
|
query.queryKey = queryKey;
|
|
537
537
|
return query;
|
|
538
538
|
};
|
|
539
|
+
/**
|
|
540
|
+
* List all DB users
|
|
541
|
+
* @summary Get list of db users
|
|
542
|
+
*/
|
|
543
|
+
export const dbUserList = (hostingId, options) => {
|
|
544
|
+
return axios.get(`/v1/hosting/${hostingId}/db/users`, options);
|
|
545
|
+
};
|
|
546
|
+
export const getDbUserListQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/db/users`];
|
|
547
|
+
export const useDbUserList = (hostingId, options) => {
|
|
548
|
+
var _a;
|
|
549
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
550
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getDbUserListQueryKey(hostingId);
|
|
551
|
+
const queryFn = ({ signal }) => dbUserList(hostingId, Object.assign({ signal }, axiosOptions));
|
|
552
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
|
|
553
|
+
query.queryKey = queryKey;
|
|
554
|
+
return query;
|
|
555
|
+
};
|
|
539
556
|
/**
|
|
540
557
|
* Returns a list of domains
|
|
541
558
|
* @summary domain list
|
|
@@ -1588,6 +1605,22 @@ export const useSitesSso = (siteId, params, options) => {
|
|
|
1588
1605
|
query.queryKey = queryKey;
|
|
1589
1606
|
return query;
|
|
1590
1607
|
};
|
|
1608
|
+
/**
|
|
1609
|
+
* @summary site status
|
|
1610
|
+
*/
|
|
1611
|
+
export const siteStatus = (siteId, options) => {
|
|
1612
|
+
return axios.get(`/v1/sites/${siteId}/status`, options);
|
|
1613
|
+
};
|
|
1614
|
+
export const getSiteStatusQueryKey = (siteId) => [`/v1/sites/${siteId}/status`];
|
|
1615
|
+
export const useSiteStatus = (siteId, options) => {
|
|
1616
|
+
var _a;
|
|
1617
|
+
const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
1618
|
+
const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSiteStatusQueryKey(siteId);
|
|
1619
|
+
const queryFn = ({ signal }) => siteStatus(siteId, Object.assign({ signal }, axiosOptions));
|
|
1620
|
+
const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
|
|
1621
|
+
query.queryKey = queryKey;
|
|
1622
|
+
return query;
|
|
1623
|
+
};
|
|
1591
1624
|
/**
|
|
1592
1625
|
* Returns a list of the site's users
|
|
1593
1626
|
* @summary users
|
package/src/index.msw.d.ts
CHANGED
|
@@ -156,6 +156,7 @@ export declare const getListCronsMock: () => {
|
|
|
156
156
|
month: string | undefined;
|
|
157
157
|
type: string | undefined;
|
|
158
158
|
weekday: string | undefined;
|
|
159
|
+
email: string | undefined;
|
|
159
160
|
}[] | undefined;
|
|
160
161
|
};
|
|
161
162
|
export declare const getAddCronMock: () => {
|
|
@@ -190,6 +191,13 @@ export declare const getDbListMock: () => {
|
|
|
190
191
|
}[] | undefined;
|
|
191
192
|
}[] | undefined;
|
|
192
193
|
};
|
|
194
|
+
export declare const getDbUserListMock: () => {
|
|
195
|
+
users: {
|
|
196
|
+
dblist: string[] | undefined;
|
|
197
|
+
shortuser: string | undefined;
|
|
198
|
+
user: string | undefined;
|
|
199
|
+
}[] | undefined;
|
|
200
|
+
};
|
|
193
201
|
export declare const getDomainsMock: () => {
|
|
194
202
|
domains: {
|
|
195
203
|
docroot: string;
|
|
@@ -484,6 +492,7 @@ export declare const getSitesSecurityHttpsEnableDisableSslMock: () => {
|
|
|
484
492
|
export declare const getSitesSecuritySitelockMock: () => {
|
|
485
493
|
addon_id: number | undefined;
|
|
486
494
|
plan: string | undefined;
|
|
495
|
+
billing_code: string | undefined;
|
|
487
496
|
success: number | undefined;
|
|
488
497
|
subscription_id: string | undefined;
|
|
489
498
|
upgrade_levels: string[] | undefined;
|
|
@@ -531,6 +540,11 @@ export declare const getSitesSettingsPhpVersionsMock: () => {
|
|
|
531
540
|
export declare const getSitesSsoMock: () => {
|
|
532
541
|
sso: string | undefined;
|
|
533
542
|
};
|
|
543
|
+
export declare const getSiteStatusMock: () => {
|
|
544
|
+
url: string | undefined;
|
|
545
|
+
pending_url: string | undefined;
|
|
546
|
+
cloudflare_ready: boolean | undefined;
|
|
547
|
+
};
|
|
534
548
|
export declare const getSiteUsersMock: () => {
|
|
535
549
|
users: {
|
|
536
550
|
display_name: 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.432.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -33,13 +33,14 @@ export const getHostingAdvancedSsoWhmMock = () => ({ url: faker.helpers.arrayEle
|
|
|
33
33
|
export const getHostingAdvancedSystemConsoleMock = () => ({ url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
34
34
|
export const getHostingCapabilitiesMock = () => ({ server_controls: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), sites: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), cpanel: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), whm: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), advanced_hosting: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
35
35
|
export const getAddonCloudflareMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
36
|
-
export const getListCronsMock = () => ({ rows: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ command: faker.helpers.arrayElement([faker.random.word(), undefined]), day: faker.helpers.arrayElement([faker.random.word(), undefined]), hour: faker.helpers.arrayElement([faker.random.word(), undefined]), key: faker.helpers.arrayElement([faker.random.word(), undefined]), line: faker.helpers.arrayElement([faker.random.word(), undefined]), minute: faker.helpers.arrayElement([faker.random.word(), undefined]), month: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), weekday: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
36
|
+
export const getListCronsMock = () => ({ rows: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ command: faker.helpers.arrayElement([faker.random.word(), undefined]), day: faker.helpers.arrayElement([faker.random.word(), undefined]), hour: faker.helpers.arrayElement([faker.random.word(), undefined]), key: faker.helpers.arrayElement([faker.random.word(), undefined]), line: faker.helpers.arrayElement([faker.random.word(), undefined]), minute: faker.helpers.arrayElement([faker.random.word(), undefined]), month: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), weekday: faker.helpers.arrayElement([faker.random.word(), undefined]), email: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
37
37
|
export const getAddCronMock = () => ({ key: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
38
38
|
export const getUpdateCronMock = () => ({ key: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
39
39
|
export const getCronMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
40
40
|
export const getDbAddMock = () => ({ dbname: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
41
41
|
export const getDbMock = () => ({ dbname: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
42
42
|
export const getDbListMock = () => ({ status: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), databases: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ db: faker.helpers.arrayElement([faker.random.word(), undefined]), size: faker.helpers.arrayElement([faker.random.word(), undefined]), sizemeg: faker.helpers.arrayElement([faker.random.word(), undefined]), usercount: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), userlist: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ db: faker.helpers.arrayElement([faker.random.word(), undefined]), user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) })), undefined]) });
|
|
43
|
+
export const getDbUserListMock = () => ({ users: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dblist: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), shortuser: faker.helpers.arrayElement([faker.random.word(), undefined]), user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
43
44
|
export const getDomainsMock = () => ({ domains: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ docroot: faker.random.word(), domain: faker.random.word(), type: faker.random.word(), id: faker.datatype.number({ min: undefined, max: undefined }) })) });
|
|
44
45
|
export const getHostingFtpListMock = () => ({ ftp_accounts: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ user: faker.helpers.arrayElement([faker.random.word(), undefined]), homedir: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), account: faker.helpers.arrayElement([faker.random.word(), undefined]), domain: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]), special_ftp_accounts: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ user: faker.helpers.arrayElement([faker.random.word(), undefined]), homedir: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), account: faker.helpers.arrayElement([faker.random.word(), undefined]), domain: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
45
46
|
export const getHostingFtpAddMock = () => ({ user: faker.helpers.arrayElement([faker.random.word(), undefined]), pass: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
@@ -91,7 +92,7 @@ export const getSitesSecurityCheckCoreMock = () => ({ results: faker.helpers.arr
|
|
|
91
92
|
export const getSitesSecurityResetCoreFilesMock = () => ({ results: faker.helpers.arrayElement([faker.random.word(), undefined]), success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
92
93
|
export const getSitesSecurityHttpsRedirectionStatusMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), redirection_status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), message: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
93
94
|
export const getSitesSecurityHttpsEnableDisableSslMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), redirection_status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), message: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
94
|
-
export const getSitesSecuritySitelockMock = () => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), plan: faker.helpers.arrayElement([faker.random.word(), undefined]), success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), subscription_id: faker.helpers.arrayElement([faker.random.word(), undefined]), upgrade_levels: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) });
|
|
95
|
+
export const getSitesSecuritySitelockMock = () => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), plan: faker.helpers.arrayElement([faker.random.word(), undefined]), billing_code: faker.helpers.arrayElement([faker.random.word(), undefined]), success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), subscription_id: faker.helpers.arrayElement([faker.random.word(), undefined]), upgrade_levels: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) });
|
|
95
96
|
export const getSitesSecuritySslAcmeMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), message: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
96
97
|
export const getSitesSecuritySslStatusMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), message: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
97
98
|
export const getSiteSettingsAutoupdatePluginsMock = () => ({ status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
@@ -105,6 +106,7 @@ export const getSitesSettingsDebugToggleMock = () => ({ success: faker.helpers.a
|
|
|
105
106
|
export const getSitesSettingsPhpVersionUpdateMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
106
107
|
export const getSitesSettingsPhpVersionsMock = () => ({ versions: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) });
|
|
107
108
|
export const getSitesSsoMock = () => ({ sso: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
109
|
+
export const getSiteStatusMock = () => ({ url: faker.helpers.arrayElement([faker.random.word(), undefined]), pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]), cloudflare_ready: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
108
110
|
export const getSiteUsersMock = () => ({ users: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ display_name: faker.helpers.arrayElement([faker.random.word(), undefined]), id: faker.datatype.number({ min: undefined, max: undefined }), meta: faker.helpers.arrayElement([{ maestro_web_pro: faker.helpers.arrayElement([faker.random.word(), undefined]), maestro_wpp_identifier: faker.helpers.arrayElement([faker.random.word(), undefined]) }, undefined]), post_count: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), role: faker.random.word(), user_email: faker.random.word(), user_id: faker.datatype.number({ min: undefined, max: undefined }), user_login: faker.random.word(), user_nicename: faker.random.word() })) });
|
|
109
111
|
export const getSitesVersionMock = () => ({ current: faker.helpers.arrayElement([faker.random.word(), undefined]), latest: faker.helpers.arrayElement([faker.random.word(), undefined]), update: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
110
112
|
export const getHostingSitesV2Mock = () => ({ total: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), page: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), limit: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), max_sites: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]), used_sites: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), available_sites: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]), items: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ id: faker.helpers.arrayElement([faker.random.word(), undefined]), name: faker.helpers.arrayElement([faker.random.word(), undefined]), url: faker.helpers.arrayElement([faker.random.word(), undefined]), docroot: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), pending_url: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
@@ -176,6 +178,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
176
178
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbMock()));
|
|
177
179
|
}), rest.get('*/v1/hosting/:hostingId/db', (_req, res, ctx) => {
|
|
178
180
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbListMock()));
|
|
181
|
+
}), rest.get('*/v1/hosting/:hostingId/db/users', (_req, res, ctx) => {
|
|
182
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbUserListMock()));
|
|
179
183
|
}), rest.get('*/v1/hosting/:hostingId/domains', (_req, res, ctx) => {
|
|
180
184
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDomainsMock()));
|
|
181
185
|
}), rest.get('*/v1/hosting/:hostingId/ftp', (_req, res, ctx) => {
|
|
@@ -306,6 +310,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
306
310
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSettingsPhpVersionsMock()));
|
|
307
311
|
}), rest.get('*/v1/sites/:siteId/sso', (_req, res, ctx) => {
|
|
308
312
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSsoMock()));
|
|
313
|
+
}), rest.get('*/v1/sites/:siteId/status', (_req, res, ctx) => {
|
|
314
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSiteStatusMock()));
|
|
309
315
|
}), rest.get('*/v1/sites/:siteId/users', (_req, res, ctx) => {
|
|
310
316
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSiteUsersMock()));
|
|
311
317
|
}), rest.get('*/v1/sites/:siteId/version', (_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.432.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SshKeyListV2200RowsItem = {
|
|
9
9
|
name?: string;
|
|
@@ -57,6 +57,11 @@ export declare type SiteUsers200UsersItem = {
|
|
|
57
57
|
export declare type SiteUsers200 = {
|
|
58
58
|
users: SiteUsers200UsersItem[];
|
|
59
59
|
};
|
|
60
|
+
export declare type SiteStatus200 = {
|
|
61
|
+
url?: string;
|
|
62
|
+
pending_url?: string;
|
|
63
|
+
cloudflare_ready?: boolean;
|
|
64
|
+
};
|
|
60
65
|
export declare type SitesSso200 = {
|
|
61
66
|
sso?: string;
|
|
62
67
|
};
|
|
@@ -132,6 +137,7 @@ export declare type SitesSecuritySslAcme200 = {
|
|
|
132
137
|
export declare type SitesSecuritySitelock200 = {
|
|
133
138
|
addon_id?: number;
|
|
134
139
|
plan?: string;
|
|
140
|
+
billing_code?: string;
|
|
135
141
|
success?: number;
|
|
136
142
|
subscription_id?: string;
|
|
137
143
|
upgrade_levels?: string[];
|
|
@@ -687,6 +693,14 @@ export declare const DomainsType: {
|
|
|
687
693
|
export declare type DomainsParams = {
|
|
688
694
|
type?: DomainsType;
|
|
689
695
|
};
|
|
696
|
+
export declare type DbUserList200UsersItem = {
|
|
697
|
+
dblist?: string[];
|
|
698
|
+
shortuser?: string;
|
|
699
|
+
user?: string;
|
|
700
|
+
};
|
|
701
|
+
export declare type DbUserList200 = {
|
|
702
|
+
users?: DbUserList200UsersItem[];
|
|
703
|
+
};
|
|
690
704
|
export declare type DbList200DatabasesItemUserlistItem = {
|
|
691
705
|
db?: string;
|
|
692
706
|
user?: string;
|
|
@@ -800,6 +814,7 @@ export declare type ListCrons200RowsItem = {
|
|
|
800
814
|
month?: string;
|
|
801
815
|
type?: string;
|
|
802
816
|
weekday?: string;
|
|
817
|
+
email?: string;
|
|
803
818
|
};
|
|
804
819
|
export declare type ListCrons200 = {
|
|
805
820
|
rows?: ListCrons200RowsItem[];
|
|
@@ -830,7 +845,7 @@ export declare type HostingAdvancedPassword200 = {
|
|
|
830
845
|
};
|
|
831
846
|
export declare type HostingAdvancedPasswordBody = {
|
|
832
847
|
/** The username to be updated */
|
|
833
|
-
|
|
848
|
+
account_username?: string;
|
|
834
849
|
/** The password to be updated to */
|
|
835
850
|
password: string;
|
|
836
851
|
};
|