@newfold/huapi-js 1.413.0 → 1.419.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.413.0",
13
+ "version": "1.419.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.413.0
6
+ * OpenAPI spec version: 1.419.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, HostingAdvancedCrontab200, HostingAdvancedServer200, HostingAdvancedServerStatus200, HostingAdvancedServerStatusBody, HostingAdvancedPassword200, HostingAdvancedPasswordBody, HostingAdvancedSsoWhm200, HostingAdvancedSystemConsole200, HostingCapabilities200, AddonCloudflare200, AddonCloudflareBody, 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, 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, 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';
12
12
  declare type AwaitedInput<T> = PromiseLike<T> | T;
13
13
  declare type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
14
14
  /**
@@ -306,20 +306,6 @@ export declare const useHostingAddons: <TData = AxiosResponse<HostingAddons200,
306
306
  } | undefined) => UseQueryResult<TData, TError> & {
307
307
  queryKey: QueryKey;
308
308
  };
309
- /**
310
- * Returns a list of cron jobs
311
- * @summary cron_list
312
- */
313
- export declare const hostingAdvancedCrontab: (hostingId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<HostingAdvancedCrontab200>>;
314
- export declare const getHostingAdvancedCrontabQueryKey: (hostingId: number) => string[];
315
- export declare type HostingAdvancedCrontabQueryResult = NonNullable<Awaited<ReturnType<typeof hostingAdvancedCrontab>>>;
316
- export declare type HostingAdvancedCrontabQueryError = AxiosError<unknown>;
317
- export declare const useHostingAdvancedCrontab: <TData = AxiosResponse<HostingAdvancedCrontab200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
318
- query?: UseQueryOptions<AxiosResponse<HostingAdvancedCrontab200, any>, TError, TData, QueryKey> | undefined;
319
- axios?: AxiosRequestConfig<any> | undefined;
320
- } | undefined) => UseQueryResult<TData, TError> & {
321
- queryKey: QueryKey;
322
- };
323
309
  /**
324
310
  * Returns the hosting server info
325
311
  * @summary server status/info
@@ -430,6 +416,74 @@ export declare const useAddonCloudflare: <TError = AxiosError<unknown, any>, TCo
430
416
  hostingId: number;
431
417
  data: AddonCloudflareBody;
432
418
  }, TContext>;
419
+ /**
420
+ * Returns a list of cron jobs
421
+ * @summary cron_list
422
+ */
423
+ export declare const listCrons: (hostingId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<ListCrons200>>;
424
+ export declare const getListCronsQueryKey: (hostingId: number) => string[];
425
+ export declare type ListCronsQueryResult = NonNullable<Awaited<ReturnType<typeof listCrons>>>;
426
+ export declare type ListCronsQueryError = AxiosError<unknown>;
427
+ export declare const useListCrons: <TData = AxiosResponse<ListCrons200, any>, TError = AxiosError<unknown, any>>(hostingId: number, options?: {
428
+ query?: UseQueryOptions<AxiosResponse<ListCrons200, any>, TError, TData, QueryKey> | undefined;
429
+ axios?: AxiosRequestConfig<any> | undefined;
430
+ } | undefined) => UseQueryResult<TData, TError> & {
431
+ queryKey: QueryKey;
432
+ };
433
+ /**
434
+ * Adds a new cron job
435
+ * @summary cron_add
436
+ */
437
+ export declare const addCron: (hostingId: number, addCronBody: AddCronBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<AddCron200>>;
438
+ export declare type AddCronMutationResult = NonNullable<Awaited<ReturnType<typeof addCron>>>;
439
+ export declare type AddCronMutationBody = AddCronBody;
440
+ export declare type AddCronMutationError = AxiosError<AddCron400>;
441
+ export declare const useAddCron: <TError = AxiosError<AddCron400, any>, TContext = unknown>(options?: {
442
+ mutation?: UseMutationOptions<AxiosResponse<AddCron200, any>, TError, {
443
+ hostingId: number;
444
+ data: AddCronBody;
445
+ }, TContext> | undefined;
446
+ axios?: AxiosRequestConfig<any> | undefined;
447
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<AddCron200, any>, TError, {
448
+ hostingId: number;
449
+ data: AddCronBody;
450
+ }, TContext>;
451
+ /**
452
+ * Updates a cron job
453
+ * @summary cron_update
454
+ */
455
+ export declare const updateCron: (hostingId: number, updateCronBody: UpdateCronBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<UpdateCron200>>;
456
+ export declare type UpdateCronMutationResult = NonNullable<Awaited<ReturnType<typeof updateCron>>>;
457
+ export declare type UpdateCronMutationBody = UpdateCronBody;
458
+ export declare type UpdateCronMutationError = AxiosError<unknown>;
459
+ export declare const useUpdateCron: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
460
+ mutation?: UseMutationOptions<AxiosResponse<UpdateCron200, any>, TError, {
461
+ hostingId: number;
462
+ data: UpdateCronBody;
463
+ }, TContext> | undefined;
464
+ axios?: AxiosRequestConfig<any> | undefined;
465
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<UpdateCron200, any>, TError, {
466
+ hostingId: number;
467
+ data: UpdateCronBody;
468
+ }, TContext>;
469
+ /**
470
+ * Deletes a cron job
471
+ * @summary cron_delete
472
+ */
473
+ export declare const cron: (hostingId: number, cronBody: CronBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<Cron200>>;
474
+ export declare type CronMutationResult = NonNullable<Awaited<ReturnType<typeof cron>>>;
475
+ export declare type CronMutationBody = CronBody;
476
+ export declare type CronMutationError = AxiosError<unknown>;
477
+ export declare const useCron: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
478
+ mutation?: UseMutationOptions<AxiosResponse<Cron200, any>, TError, {
479
+ hostingId: number;
480
+ data: CronBody;
481
+ }, TContext> | undefined;
482
+ axios?: AxiosRequestConfig<any> | undefined;
483
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<Cron200, any>, TError, {
484
+ hostingId: number;
485
+ data: CronBody;
486
+ }, TContext>;
433
487
  /**
434
488
  * Add a new db to an account
435
489
  * @summary Create a database for an account
@@ -979,6 +1033,21 @@ export declare const useSitesHasBackups: <TData = AxiosResponse<SitesHasBackups2
979
1033
  } | undefined) => UseQueryResult<TData, TError> & {
980
1034
  queryKey: QueryKey;
981
1035
  };
1036
+ /**
1037
+ * Adds the site to the codeguard
1038
+ * @summary Add additional sites to codeguard
1039
+ */
1040
+ export declare const sitesBackupsCodeguard: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesBackupsCodeguard200>>;
1041
+ export declare type SitesBackupsCodeguardMutationResult = NonNullable<Awaited<ReturnType<typeof sitesBackupsCodeguard>>>;
1042
+ export declare type SitesBackupsCodeguardMutationError = AxiosError<unknown>;
1043
+ export declare const useSitesBackupsCodeguard: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
1044
+ mutation?: UseMutationOptions<AxiosResponse<SitesBackupsCodeguard200, any>, TError, {
1045
+ siteId: number;
1046
+ }, TContext> | undefined;
1047
+ axios?: AxiosRequestConfig<any> | undefined;
1048
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitesBackupsCodeguard200, any>, TError, {
1049
+ siteId: number;
1050
+ }, TContext>;
982
1051
  /**
983
1052
  * Returns details about the backup options available for the site, i.e. details about the codeguard backup addon and the jetpack based on if one or both of them are added to the account.
984
1053
  * @summary site backup details
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.413.0
6
+ * OpenAPI spec version: 1.419.0
7
7
  */
8
8
  import axios from 'axios';
9
9
  import { useQuery, useMutation } from '@tanstack/react-query';
@@ -314,23 +314,6 @@ export const useHostingAddons = (hostingId, params, options) => {
314
314
  query.queryKey = queryKey;
315
315
  return query;
316
316
  };
317
- /**
318
- * Returns a list of cron jobs
319
- * @summary cron_list
320
- */
321
- export const hostingAdvancedCrontab = (hostingId, options) => {
322
- return axios.get(`/v1/hosting/${hostingId}/advanced/crontab`, options);
323
- };
324
- export const getHostingAdvancedCrontabQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/advanced/crontab`];
325
- export const useHostingAdvancedCrontab = (hostingId, options) => {
326
- var _a;
327
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
328
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getHostingAdvancedCrontabQueryKey(hostingId);
329
- const queryFn = ({ signal }) => hostingAdvancedCrontab(hostingId, Object.assign({ signal }, axiosOptions));
330
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
331
- query.queryKey = queryKey;
332
- return query;
333
- };
334
317
  /**
335
318
  * Returns the hosting server info
336
319
  * @summary server status/info
@@ -444,6 +427,68 @@ export const useAddonCloudflare = (options) => {
444
427
  };
445
428
  return useMutation(mutationFn, mutationOptions);
446
429
  };
430
+ /**
431
+ * Returns a list of cron jobs
432
+ * @summary cron_list
433
+ */
434
+ export const listCrons = (hostingId, options) => {
435
+ return axios.get(`/v1/hosting/${hostingId}/crontab`, options);
436
+ };
437
+ export const getListCronsQueryKey = (hostingId) => [`/v1/hosting/${hostingId}/crontab`];
438
+ export const useListCrons = (hostingId, options) => {
439
+ var _a;
440
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
441
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getListCronsQueryKey(hostingId);
442
+ const queryFn = ({ signal }) => listCrons(hostingId, Object.assign({ signal }, axiosOptions));
443
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(hostingId) }, queryOptions));
444
+ query.queryKey = queryKey;
445
+ return query;
446
+ };
447
+ /**
448
+ * Adds a new cron job
449
+ * @summary cron_add
450
+ */
451
+ export const addCron = (hostingId, addCronBody, options) => {
452
+ return axios.post(`/v1/hosting/${hostingId}/crontab`, addCronBody, options);
453
+ };
454
+ export const useAddCron = (options) => {
455
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
456
+ const mutationFn = (props) => {
457
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
458
+ return addCron(hostingId, data, axiosOptions);
459
+ };
460
+ return useMutation(mutationFn, mutationOptions);
461
+ };
462
+ /**
463
+ * Updates a cron job
464
+ * @summary cron_update
465
+ */
466
+ export const updateCron = (hostingId, updateCronBody, options) => {
467
+ return axios.put(`/v1/hosting/${hostingId}/crontab`, updateCronBody, options);
468
+ };
469
+ export const useUpdateCron = (options) => {
470
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
471
+ const mutationFn = (props) => {
472
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
473
+ return updateCron(hostingId, data, axiosOptions);
474
+ };
475
+ return useMutation(mutationFn, mutationOptions);
476
+ };
477
+ /**
478
+ * Deletes a cron job
479
+ * @summary cron_delete
480
+ */
481
+ export const cron = (hostingId, cronBody, options) => {
482
+ return axios.delete(`/v1/hosting/${hostingId}/crontab`, Object.assign({ data: cronBody }, options));
483
+ };
484
+ export const useCron = (options) => {
485
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
486
+ const mutationFn = (props) => {
487
+ const { hostingId, data } = props !== null && props !== void 0 ? props : {};
488
+ return cron(hostingId, data, axiosOptions);
489
+ };
490
+ return useMutation(mutationFn, mutationOptions);
491
+ };
447
492
  /**
448
493
  * Add a new db to an account
449
494
  * @summary Create a database for an account
@@ -1011,6 +1056,21 @@ export const useSitesHasBackups = (siteId, options) => {
1011
1056
  query.queryKey = queryKey;
1012
1057
  return query;
1013
1058
  };
1059
+ /**
1060
+ * Adds the site to the codeguard
1061
+ * @summary Add additional sites to codeguard
1062
+ */
1063
+ export const sitesBackupsCodeguard = (siteId, options) => {
1064
+ return axios.post(`/v1/sites/${siteId}/backups/codeguard`, undefined, options);
1065
+ };
1066
+ export const useSitesBackupsCodeguard = (options) => {
1067
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1068
+ const mutationFn = (props) => {
1069
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1070
+ return sitesBackupsCodeguard(siteId, axiosOptions);
1071
+ };
1072
+ return useMutation(mutationFn, mutationOptions);
1073
+ };
1014
1074
  /**
1015
1075
  * Returns details about the backup options available for the site, i.e. details about the codeguard backup addon and the jetpack based on if one or both of them are added to the account.
1016
1076
  * @summary site backup details
@@ -113,19 +113,6 @@ export declare const getHostingAddonsMock: () => {
113
113
  status_user: string | undefined;
114
114
  }[] | undefined;
115
115
  };
116
- export declare const getHostingAdvancedCrontabMock: () => {
117
- rows: {
118
- command: string | undefined;
119
- day: string | undefined;
120
- hour: string | undefined;
121
- key: string | undefined;
122
- line: string | undefined;
123
- minute: string | undefined;
124
- month: string | undefined;
125
- type: string | undefined;
126
- weekday: string | undefined;
127
- }[] | undefined;
128
- };
129
116
  export declare const getHostingAdvancedServerMock: () => {
130
117
  status: string | undefined;
131
118
  uptime: string | undefined;
@@ -158,6 +145,28 @@ export declare const getAddonCloudflareMock: () => {
158
145
  status: string | undefined;
159
146
  addon_id: number | undefined;
160
147
  };
148
+ export declare const getListCronsMock: () => {
149
+ rows: {
150
+ command: string | undefined;
151
+ day: string | undefined;
152
+ hour: string | undefined;
153
+ key: string | undefined;
154
+ line: string | undefined;
155
+ minute: string | undefined;
156
+ month: string | undefined;
157
+ type: string | undefined;
158
+ weekday: string | undefined;
159
+ }[] | undefined;
160
+ };
161
+ export declare const getAddCronMock: () => {
162
+ key: string | undefined;
163
+ };
164
+ export declare const getUpdateCronMock: () => {
165
+ key: number | undefined;
166
+ };
167
+ export declare const getCronMock: () => {
168
+ success: boolean | undefined;
169
+ };
161
170
  export declare const getDbAddMock: () => {
162
171
  dbname: string | undefined;
163
172
  status: number | undefined;
@@ -367,6 +376,11 @@ export declare const getSitesBackupsMock: () => {
367
376
  export declare const getSitesHasBackupsMock: () => {
368
377
  has_backups: boolean | undefined;
369
378
  };
379
+ export declare const getSitesBackupsCodeguardMock: () => {
380
+ website_id: number | undefined;
381
+ database_id: number | undefined;
382
+ success: number | undefined;
383
+ };
370
384
  export declare const getSitesBackupsDetailsMock: () => {
371
385
  codeguard: {
372
386
  addon_id: 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.413.0
6
+ * OpenAPI spec version: 1.419.0
7
7
  */
8
8
  import { rest } from 'msw';
9
9
  import { faker } from '@faker-js/faker';
@@ -26,7 +26,6 @@ export const getAddonsCloudflareMock = () => ({ status: faker.helpers.arrayEleme
26
26
  export const getAddonsInfoMock = () => ({ id: faker.helpers.arrayElement([faker.random.word(), undefined]) });
27
27
  export const getHostingAccountMock = () => ({ id: faker.helpers.arrayElement([faker.random.word(), undefined]), account_id: faker.helpers.arrayElement([faker.random.word(), undefined]), brand: faker.helpers.arrayElement([faker.random.word(), undefined]), platform: faker.helpers.arrayElement([faker.random.word(), undefined]), username: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), advanced: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), plan: faker.helpers.arrayElement([faker.random.word(), undefined]) });
28
28
  export const getHostingAddonsMock = () => ({ rows: 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]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), status_user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
29
- export const getHostingAdvancedCrontabMock = () => ({ 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]) });
30
29
  export const getHostingAdvancedServerMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime_seconds: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), actions: faker.helpers.arrayElement([{}, undefined]) });
31
30
  export const getHostingAdvancedServerStatusMock = () => ({ status: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime: faker.helpers.arrayElement([faker.random.word(), undefined]), uptime_seconds: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), actions: faker.helpers.arrayElement([{}, undefined]) });
32
31
  export const getHostingAdvancedPasswordMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
@@ -34,6 +33,10 @@ export const getHostingAdvancedSsoWhmMock = () => ({ url: faker.helpers.arrayEle
34
33
  export const getHostingAdvancedSystemConsoleMock = () => ({ url: faker.helpers.arrayElement([faker.random.word(), undefined]) });
35
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]) });
36
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]) });
37
+ export const getAddCronMock = () => ({ key: faker.helpers.arrayElement([faker.random.word(), undefined]) });
38
+ export const getUpdateCronMock = () => ({ key: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
39
+ export const getCronMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
37
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]) });
38
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]) });
39
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]) });
@@ -69,6 +72,7 @@ export const getSitesAutoupdatesInfoMock = () => ({ plugins: faker.helpers.array
69
72
  export const getSitesAutoupdatesUpdateMock = () => ({ plugins: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), core: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), themes: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
70
73
  export const getSitesBackupsMock = () => ({ has_backups: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
71
74
  export const getSitesHasBackupsMock = () => ({ has_backups: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
75
+ export const getSitesBackupsCodeguardMock = () => ({ website_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), database_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
72
76
  export const getSitesBackupsDetailsMock = () => ({ codeguard: faker.helpers.arrayElement([{ addon_id: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), seats_available: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), seats_count: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), website_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), database_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), activated: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) }, undefined]), jetpack: faker.helpers.arrayElement([{ plugin_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) }, undefined]) });
73
77
  export const getJetpackBackupStatusMock = () => ({ has_active_plugin: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_addon: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
74
78
  export const getSitesDnsMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), source: faker.helpers.arrayElement([faker.random.word(), undefined]), records: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ name: faker.helpers.arrayElement([faker.random.word(), undefined]), value: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
@@ -144,8 +148,6 @@ export const getHostingUAPIMSW = () => [
144
148
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingAccountMock()));
145
149
  }), rest.get('*/v1/hosting/:hostingId/addons', (_req, res, ctx) => {
146
150
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingAddonsMock()));
147
- }), rest.get('*/v1/hosting/:hostingId/advanced/crontab', (_req, res, ctx) => {
148
- return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingAdvancedCrontabMock()));
149
151
  }), rest.get('*/v1/hosting/:hostingId/advanced/server', (_req, res, ctx) => {
150
152
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingAdvancedServerMock()));
151
153
  }), rest.put('*/v1/hosting/:hostingId/advanced/server', (_req, res, ctx) => {
@@ -160,6 +162,14 @@ export const getHostingUAPIMSW = () => [
160
162
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getHostingCapabilitiesMock()));
161
163
  }), rest.post('*/v1/hosting/:hostingId/cloudflare', (_req, res, ctx) => {
162
164
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getAddonCloudflareMock()));
165
+ }), rest.get('*/v1/hosting/:hostingId/crontab', (_req, res, ctx) => {
166
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getListCronsMock()));
167
+ }), rest.post('*/v1/hosting/:hostingId/crontab', (_req, res, ctx) => {
168
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getAddCronMock()));
169
+ }), rest.put('*/v1/hosting/:hostingId/crontab', (_req, res, ctx) => {
170
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getUpdateCronMock()));
171
+ }), rest.delete('*/v1/hosting/:hostingId/crontab', (_req, res, ctx) => {
172
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getCronMock()));
163
173
  }), rest.post('*/v1/hosting/:hostingId/db', (_req, res, ctx) => {
164
174
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbAddMock()));
165
175
  }), rest.delete('*/v1/hosting/:hostingId/db', (_req, res, ctx) => {
@@ -230,6 +240,8 @@ export const getHostingUAPIMSW = () => [
230
240
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesBackupsMock()));
231
241
  }), rest.get('*/v1/sites/:siteId/backups/check', (_req, res, ctx) => {
232
242
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesHasBackupsMock()));
243
+ }), rest.post('*/v1/sites/:siteId/backups/codeguard', (_req, res, ctx) => {
244
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesBackupsCodeguardMock()));
233
245
  }), rest.get('*/v1/sites/:siteId/backups/details', (_req, res, ctx) => {
234
246
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesBackupsDetailsMock()));
235
247
  }), rest.get('*/v1/sites/:siteId/backups/jetpack', (_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.413.0
6
+ * OpenAPI spec version: 1.419.0
7
7
  */
8
8
  export declare type SshKeyListV2200RowsItem = {
9
9
  name?: string;
@@ -285,6 +285,11 @@ export declare type SitesBackupsDetails200 = {
285
285
  codeguard?: SitesBackupsDetails200Codeguard;
286
286
  jetpack?: SitesBackupsDetails200Jetpack;
287
287
  };
288
+ export declare type SitesBackupsCodeguard200 = {
289
+ website_id?: number;
290
+ database_id?: number;
291
+ success?: number;
292
+ };
288
293
  export declare type SitesHasBackups200 = {
289
294
  has_backups?: boolean;
290
295
  };
@@ -486,6 +491,9 @@ export declare type HostingSiteAddBody = {
486
491
  /** title of the site to be added */
487
492
  title: string;
488
493
  };
494
+ export declare type HostingSites200RowsItemMeta = {
495
+ pending_url?: string;
496
+ } | null;
489
497
  export declare type HostingSites200RowsItem = {
490
498
  id?: string;
491
499
  name?: string;
@@ -507,9 +515,6 @@ export declare type HostingSites200 = {
507
515
  available_sites?: number;
508
516
  rows?: HostingSites200RowsItem[];
509
517
  };
510
- export declare type HostingSites200RowsItemMeta = {
511
- pending_url?: string;
512
- } | null;
513
518
  export declare type HostingShellInfo200 = {
514
519
  enabled?: boolean;
515
520
  };
@@ -735,6 +740,70 @@ export declare type DbAddBody = {
735
740
  /** Type of database to add */
736
741
  type?: DbAddBodyType;
737
742
  };
743
+ export declare type Cron200 = {
744
+ success?: boolean;
745
+ };
746
+ export declare type CronBody = {
747
+ /** unique key for cron that is being updated (one of key or line is required) */
748
+ key: number;
749
+ };
750
+ export declare type UpdateCron200 = {
751
+ key?: number;
752
+ };
753
+ export declare type UpdateCronBody = {
754
+ /** unique key for cron that is being updated (one of key or line is required) */
755
+ key?: number;
756
+ /** line number for cron that is being updated (one of key or line is required) */
757
+ line?: number;
758
+ /** command to run as a cron, needs to be a valid string */
759
+ command: string;
760
+ /** The day of the month on which the cron job runs. An integer between 1 and 31. * - Every day. *\/2 - Every other day. 1,15 - On the 1st and 15th of the month. */
761
+ day: string;
762
+ /** The hour of the day on which the cron job runs. An integer between 0 and 23. * - Every hour. *\/2 - Every other hour. 0,12 - Every 12 hours. */
763
+ hour: string;
764
+ /** The minute of the hour on which the cron job runs. An integer between 0 and 59. * - Once per minute. *\/2 - Every other minute. *\/10 - Every 10 minutes. 0,30 - Every 30 minutes. */
765
+ minute: string;
766
+ /** The month of the year on which the cron job runs. An integer between 1 and 12. * - Every month. *\/2 - Every other month. *\/6 - Every six months. */
767
+ month: string;
768
+ /** The day of the week on which the cron job runs, 0-6. 0 - Sunday. 1 - Monday. 2 - Tuesday. 3 - Wednesday. 4 - Thursday. 5 - Friday. 6 - Saturday. * - Every day. */
769
+ weekday: string;
770
+ /** Type of line (command, variable, comment, blank, unparsed) */
771
+ type?: string;
772
+ };
773
+ export declare type AddCron400 = {
774
+ error?: string;
775
+ };
776
+ export declare type AddCron200 = {
777
+ key?: string;
778
+ };
779
+ export declare type AddCronBody = {
780
+ /** command to run as a cron, needs to be a valid string */
781
+ command: string;
782
+ /** The day of the month on which the cron job runs. An integer between 1 and 31. * - Every day. *\/2 - Every other day. 1,15 - On the 1st and 15th of the month. */
783
+ day?: string;
784
+ /** The hour of the day on which the cron job runs. An integer between 0 and 23. * - Every hour. *\/2 - Every other hour. 0,12 - Every 12 hours. */
785
+ hour?: string;
786
+ /** The minute of the hour on which the cron job runs. An integer between 0 and 59. * - Once per minute. *\/2 - Every other minute. *\/10 - Every 10 minutes. 0,30 - Every 30 minutes. */
787
+ minute?: string;
788
+ /** The month of the year on which the cron job runs. An integer between 1 and 12. * - Every month. *\/2 - Every other month. *\/6 - Every six months. */
789
+ month?: string;
790
+ /** The day of the week on which the cron job runs, 0-6. 0 - Sunday. 1 - Monday. 2 - Tuesday. 3 - Wednesday. 4 - Thursday. 5 - Friday. 6 - Saturday. * - Every day. */
791
+ weekday?: string;
792
+ };
793
+ export declare type ListCrons200RowsItem = {
794
+ command?: string;
795
+ day?: string;
796
+ hour?: string;
797
+ key?: string;
798
+ line?: string;
799
+ minute?: string;
800
+ month?: string;
801
+ type?: string;
802
+ weekday?: string;
803
+ };
804
+ export declare type ListCrons200 = {
805
+ rows?: ListCrons200RowsItem[];
806
+ };
738
807
  export declare type AddonCloudflare200 = {
739
808
  status?: string;
740
809
  addon_id?: number;
@@ -787,20 +856,6 @@ export declare type HostingAdvancedServer200 = {
787
856
  uptime_seconds?: number;
788
857
  actions?: HostingAdvancedServer200Actions;
789
858
  };
790
- export declare type HostingAdvancedCrontab200RowsItem = {
791
- command?: string;
792
- day?: string;
793
- hour?: string;
794
- key?: string;
795
- line?: string;
796
- minute?: string;
797
- month?: string;
798
- type?: string;
799
- weekday?: string;
800
- };
801
- export declare type HostingAdvancedCrontab200 = {
802
- rows?: HostingAdvancedCrontab200RowsItem[];
803
- };
804
859
  export declare type HostingAddons200RowsItem = {
805
860
  id?: string;
806
861
  type?: string;