@newfold/huapi-js 1.866.0 → 1.879.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.866.0",
13
+ "version": "1.879.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.866.0
6
+ * OpenAPI spec version: 1.879.0
7
7
  */
8
8
  import axios from 'axios';
9
9
  import type { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
10
10
  import type { UseQueryOptions, UseMutationOptions, UseQueryResult, QueryKey } from '@tanstack/react-query';
11
- import type { AccountHostingList200, CodeguardBackupList200, CodeguardBackupListParams, CodeguardBackupCreate200, CodeguardBackupCreateBody, CodeguardBackupDownload200, CodeguardBackupDownloadBody, CodeguardBackupRestore200, CodeguardBackupRestoreBody, CodeguardDatabaseList200, CodeguardDatabaseBackupList200, CodeguardDatabaseBackupListParams, CodeguardDatabaseBackupCreate200, CodeguardDatabaseBackupCreateBody, CodeguardDatabaseBackupRestore200, CodeguardDatabaseBackupRestoreBody, CodeguardLoginLink200, CodeguardPlanInfo200, CodeguardWebsiteList200, CodeguardWebsiteBackupList200, CodeguardWebsiteBackupListParams, CodeguardWebsiteBackupCreate200, CodeguardWebsiteBackupCreateBody, CodeguardWebsiteBackupRestore200, CodeguardWebsiteBackupRestoreBody, AddonsSitelockSso200, AddonsCloudflare200, AddonsInfo200, AddonsSpamexpertsSso200, WebzaiSso200, WeeblySso200, DomainInfo200, DomainUnassign200, HostingAccount200, HostingAddons200, HostingAddonsParams, HostingAdvancedServer200, HostingAdvancedServerStatus200, HostingAdvancedServerStatusBody, HostingAdvancedPassword200, HostingAdvancedPasswordBody, HostingAdvancedSsoWhm200, HostingAdvancedSystemConsole200, HostingCapabilities200, AddonCloudflare200, AddonCloudflareBody, ListCrons200, AddCron200, AddCron400, AddCronBody, UpdateCron200, UpdateCronBody, Cron200, CronBody, DbAdd200, DbAddBody, Db200, DbBody, DbList200, DbUsage200, DbUserPrivsGet200, DbUserPrivsGetParams, DbUserAdd200, DbUserAddBody, DbUserDelete200, DbUserDeleteBody, DbUserList200, Domains200, DomainsParams, HostingDomainsUnassign200, HostingDomainsUnassignBody, HostingEcommerceInfo200, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingLead200, HostingLead400, HostingLeadParams, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsCheck200, HostingMigrationsCheckParams, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, HostingOnboardingData200, HostingOnboardingDataUpdate200, HostingOnboardingDataUpdateBody, HostingResellerSsoWhm200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSiteAdd200, HostingSiteAddBody, HostingSshInfo200, SshKeyFetch200, SshKeyFetchParams, SshKeyImport200, SshKeyImportBody, SshKeyList200, SshKey200, SshKeyBody, SshKeyGenerate200, SshKeyGenerateBody, Sso200, SsoParams, SitesList200, SitesInfo200, SiteUpdate200, SiteUpdate400, SiteUpdateBody, Site200, SitesAutoupdatesResponse, SitesAutoupdatesUpdateBody, SitesBackups200, SitesHasBackups200, SitesBackupsCodeguard200, SitesBackupsDetails200, JetpackBackupStatus200, BackupsJetpackBackup200, SiteAddonCloudflare200, SiteAddonCloudflare400, SitesDatabaseInfo200, SitesDatabasePasswordsync200, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainParams, SitesDomainUrl200, SitesDomainUrlBody, SitesDomains200, SitesDomainsCreate200, SitesDomainsCreateBody, SitesAccessLogs200, SitesAccessLogsParams, SitesErrorLogs200, SitesErrorLogsParams, SiteMalwareStatus200, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, ResetSiteBody, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSshUserList200, SitesSshUserCreate200, SitesSshUserCreateBody, SitesSshUserDelete200, SitesSshUserDeleteBody, SitesSshUserUpdate200, SitesSshUserUpdateBody, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params } from './index.schemas';
11
+ import type { AccountHostingList200, CodeguardBackupList200, CodeguardBackupListParams, CodeguardBackupCreate200, CodeguardBackupCreateBody, CodeguardBackupDownload200, CodeguardBackupDownloadBody, CodeguardBackupRestore200, CodeguardBackupRestoreBody, CodeguardDatabaseList200, CodeguardDatabaseBackupList200, CodeguardDatabaseBackupListParams, CodeguardDatabaseBackupCreate200, CodeguardDatabaseBackupCreateBody, CodeguardDatabaseBackupRestore200, CodeguardDatabaseBackupRestoreBody, CodeguardLoginLink200, CodeguardPlanInfo200, CodeguardWebsiteList200, CodeguardWebsiteBackupList200, CodeguardWebsiteBackupListParams, CodeguardWebsiteBackupCreate200, CodeguardWebsiteBackupCreateBody, CodeguardWebsiteBackupRestore200, CodeguardWebsiteBackupRestoreBody, AddonsSitelockSso200, AddonsCloudflare200, AddonsInfo200, AddonsSpamexpertsSso200, WebzaiSso200, WeeblySso200, DomainInfo200, DomainUnassign200, HostingAccount200, HostingAddons200, HostingAddonsParams, HostingAdvancedServer200, HostingAdvancedServerStatus200, HostingAdvancedServerStatusBody, HostingAdvancedPassword200, HostingAdvancedPasswordBody, HostingAdvancedSsoWhm200, HostingAdvancedSystemConsole200, HostingCapabilities200, AddonCloudflare200, AddonCloudflareBody, ListCrons200, AddCron200, AddCron400, AddCronBody, UpdateCron200, UpdateCronBody, Cron200, CronBody, DbAdd200, DbAddBody, Db200, DbBody, DbList200, DbUsage200, DbUserPrivsGet200, DbUserPrivsGetParams, DbUserAdd200, DbUserAddBody, DbUserDelete200, DbUserDeleteBody, DbUserList200, Domains200, DomainsParams, HostingDomainsUnassign200, HostingDomainsUnassignBody, HostingEcommerceInfo200, HostingFtpList200, HostingFtpAdd200, HostingFtpAddBody, HostingFtpUpdate200, HostingFtpUpdateBody, HostingFtp200, HostingFtpBody, HostingInfo200, HostingInfoDiskUsage200, HostingLead200, HostingLead400, HostingLeadParams, HostingMigrationStatus200, HostingMigrations200, HostingMigrationsBody, HostingMigrationsCheck200, HostingMigrationsCheckParams, HostingMigrationsEvent200, HostingMigrationsEventBody, HostingMigrationInfo200, HostingMigrationInfoParams, HostingMigrationSiteScanStatus200, HostingMigrationSiteScanStatusParams, HostingNameservers200, HostingOnboardingData200, HostingOnboardingDataUpdate200, HostingOnboardingDataUpdateBody, HostingResellerSsoWhm200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSiteAdd200, HostingSiteAddBody, HostingSshInfo200, SshKeyFetch200, SshKeyFetchParams, SshKeyImport200, SshKeyImportBody, SshKeyList200, SshKey200, SshKeyBody, SshKeyGenerate200, SshKeyGenerateBody, Sso200, SsoParams, SitesList200, SitesInfo200, SiteUpdate200, SiteUpdate400, SiteUpdateBody, Site200, SitesAutoupdatesResponse, SitesAutoupdatesUpdateBody, SitesBackups200, SitesHasBackups200, SitesBackupsCodeguard200, SitesBackupsDetails200, JetpackBackupStatus200, BackupsJetpackBackup200, SiteAddonCloudflare200, SiteAddonCloudflare400, SitesDatabaseInfo200, SitesDatabasePasswordsync200, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainParams, SitesDomainUrl200, SitesDomainUrlBody, SitesDomainsCreate200, SitesDomainsCreateBody, SitesAccessLogs200, SitesAccessLogsParams, SitesErrorLogs200, SitesErrorLogsParams, SiteMalwareStatus200, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, SitesPerformanceEdgecache200, SitesPerformanceEdgecacheBody, SitesPerformanceEnduranceCacheLevelStatus200, SitesPerformanceEnduranceCacheLevel200, SitesPerformanceEnduranceCacheLevelBody, SitesPerformanceEndurancePageCache200, SitePlugins200, SitePluginsParams, SitePluginUpdate200, SitePluginUpdateBody, SitePluginsAutoupdate200, SitePluginsAutoupdateBody, SitePluginsToggle200, SitePluginsToggleBody, SitePluginsUpdate200, SitePluginsUpdateBody, ResetSite200, ResetSiteBody, SitesSecurityCheckCore200, SitesSecurityResetCoreFiles200, SitesSecurityHttpsRedirectionStatus200, SitesSecurityHttpsEnableDisableSsl200, SitesSecurityHttpsEnableDisableSslBody, SitesSecuritySitelock200, SitesSecuritySslAcme200, SitesSecuritySslStatus200, SitesSettingsComingSoon200, SitesSettingsComingSoonToggle200, SitesSettingsComingSoonToggleBody, SitesSettingsDebug200, SitesSettingsDebugToggle200, SitesSettingsDebugToggleBody, SitesSettingsPhpVersionUpdate200, SitesSettingsPhpVersionUpdateBody, SitesSettingsPhpVersions200, SitesSshUserList200, SitesSshUserCreate200, SitesSshUserCreateBody, SitesSshUserDelete200, SitesSshUserDeleteBody, SitesSshUserUpdate200, SitesSshUserUpdateBody, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params } from './index.schemas';
12
12
  declare type AwaitedInput<T> = PromiseLike<T> | T;
13
13
  declare type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
14
14
  /**
@@ -1441,20 +1441,6 @@ export declare const useSitesDomainUrl: <TError = AxiosError<unknown, any>, TCon
1441
1441
  siteId: number;
1442
1442
  data: SitesDomainUrlBody;
1443
1443
  }, TContext>;
1444
- /**
1445
- * Provides the domains list associated with the site
1446
- * @summary Domains list for the site
1447
- */
1448
- export declare const sitesDomains: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesDomains200>>;
1449
- export declare const getSitesDomainsQueryKey: (siteId: number) => string[];
1450
- export declare type SitesDomainsQueryResult = NonNullable<Awaited<ReturnType<typeof sitesDomains>>>;
1451
- export declare type SitesDomainsQueryError = AxiosError<unknown>;
1452
- export declare const useSitesDomains: <TData = AxiosResponse<SitesDomains200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
1453
- query?: UseQueryOptions<AxiosResponse<SitesDomains200, any>, TError, TData, QueryKey> | undefined;
1454
- axios?: AxiosRequestConfig<any> | undefined;
1455
- } | undefined) => UseQueryResult<TData, TError> & {
1456
- queryKey: QueryKey;
1457
- };
1458
1444
  /**
1459
1445
  * Add the domain
1460
1446
  * @summary Add domain for the site
@@ -1617,16 +1603,34 @@ export declare const useSitesPerformanceEndurancePageCache: <TError = AxiosError
1617
1603
  * Returns a list of the site's plugins
1618
1604
  * @summary plugins
1619
1605
  */
1620
- export declare const sitePlugins: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitePlugins200>>;
1621
- export declare const getSitePluginsQueryKey: (siteId: number) => string[];
1606
+ export declare const sitePlugins: (siteId: number, params?: SitePluginsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitePlugins200>>;
1607
+ export declare const getSitePluginsQueryKey: (siteId: number, params?: SitePluginsParams) => (string | SitePluginsParams)[];
1622
1608
  export declare type SitePluginsQueryResult = NonNullable<Awaited<ReturnType<typeof sitePlugins>>>;
1623
1609
  export declare type SitePluginsQueryError = AxiosError<unknown>;
1624
- export declare const useSitePlugins: <TData = AxiosResponse<SitePlugins200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
1610
+ export declare const useSitePlugins: <TData = AxiosResponse<SitePlugins200, any>, TError = AxiosError<unknown, any>>(siteId: number, params?: SitePluginsParams, options?: {
1625
1611
  query?: UseQueryOptions<AxiosResponse<SitePlugins200, any>, TError, TData, QueryKey> | undefined;
1626
1612
  axios?: AxiosRequestConfig<any> | undefined;
1627
1613
  } | undefined) => UseQueryResult<TData, TError> & {
1628
1614
  queryKey: QueryKey;
1629
1615
  };
1616
+ /**
1617
+ * Enables / disables a plugin
1618
+ * @summary plugins toggle
1619
+ */
1620
+ export declare const sitePluginUpdate: (siteId: string, sitePluginUpdateBody: SitePluginUpdateBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitePluginUpdate200>>;
1621
+ export declare type SitePluginUpdateMutationResult = NonNullable<Awaited<ReturnType<typeof sitePluginUpdate>>>;
1622
+ export declare type SitePluginUpdateMutationBody = SitePluginUpdateBody;
1623
+ export declare type SitePluginUpdateMutationError = AxiosError<unknown>;
1624
+ export declare const useSitePluginUpdate: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
1625
+ mutation?: UseMutationOptions<AxiosResponse<SitePluginUpdate200, any>, TError, {
1626
+ siteId: string;
1627
+ data: SitePluginUpdateBody;
1628
+ }, TContext> | undefined;
1629
+ axios?: AxiosRequestConfig<any> | undefined;
1630
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitePluginUpdate200, any>, TError, {
1631
+ siteId: string;
1632
+ data: SitePluginUpdateBody;
1633
+ }, TContext>;
1630
1634
  /**
1631
1635
  * Enables / disables plugin auto-updates
1632
1636
  * @deprecated
@@ -1648,7 +1652,8 @@ export declare const useSitePluginsAutoupdate: <TError = AxiosError<unknown, any
1648
1652
  }, TContext>;
1649
1653
  /**
1650
1654
  * Enables / disables a plugin
1651
- * @summary plugins toggle
1655
+ * @deprecated
1656
+ * @summary Deprecated - plugins toggle
1652
1657
  */
1653
1658
  export declare const sitePluginsToggle: (siteId: string, sitePluginsToggleBody: SitePluginsToggleBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitePluginsToggle200>>;
1654
1659
  export declare type SitePluginsToggleMutationResult = NonNullable<Awaited<ReturnType<typeof sitePluginsToggle>>>;
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.866.0
6
+ * OpenAPI spec version: 1.879.0
7
7
  */
8
8
  import axios from 'axios';
9
9
  import { useQuery, useMutation } from '@tanstack/react-query';
@@ -1495,23 +1495,6 @@ export const useSitesDomainUrl = (options) => {
1495
1495
  };
1496
1496
  return useMutation(mutationFn, mutationOptions);
1497
1497
  };
1498
- /**
1499
- * Provides the domains list associated with the site
1500
- * @summary Domains list for the site
1501
- */
1502
- export const sitesDomains = (siteId, options) => {
1503
- return axios.get(`/v1/sites/${siteId}/domains`, options);
1504
- };
1505
- export const getSitesDomainsQueryKey = (siteId) => [`/v1/sites/${siteId}/domains`];
1506
- export const useSitesDomains = (siteId, options) => {
1507
- var _a;
1508
- const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1509
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDomainsQueryKey(siteId);
1510
- const queryFn = ({ signal }) => sitesDomains(siteId, Object.assign({ signal }, axiosOptions));
1511
- const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1512
- query.queryKey = queryKey;
1513
- return query;
1514
- };
1515
1498
  /**
1516
1499
  * Add the domain
1517
1500
  * @summary Add domain for the site
@@ -1674,19 +1657,34 @@ export const useSitesPerformanceEndurancePageCache = (options) => {
1674
1657
  * Returns a list of the site's plugins
1675
1658
  * @summary plugins
1676
1659
  */
1677
- export const sitePlugins = (siteId, options) => {
1678
- return axios.get(`/v1/sites/${siteId}/plugins`, options);
1660
+ export const sitePlugins = (siteId, params, options) => {
1661
+ return axios.get(`/v1/sites/${siteId}/plugins`, Object.assign(Object.assign({}, options), { params: Object.assign(Object.assign({}, params), options === null || options === void 0 ? void 0 : options.params) }));
1679
1662
  };
1680
- export const getSitePluginsQueryKey = (siteId) => [`/v1/sites/${siteId}/plugins`];
1681
- export const useSitePlugins = (siteId, options) => {
1663
+ export const getSitePluginsQueryKey = (siteId, params) => [`/v1/sites/${siteId}/plugins`, ...(params ? [params] : [])];
1664
+ export const useSitePlugins = (siteId, params, options) => {
1682
1665
  var _a;
1683
1666
  const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1684
- const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitePluginsQueryKey(siteId);
1685
- const queryFn = ({ signal }) => sitePlugins(siteId, Object.assign({ signal }, axiosOptions));
1667
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitePluginsQueryKey(siteId, params);
1668
+ const queryFn = ({ signal }) => sitePlugins(siteId, params, Object.assign({ signal }, axiosOptions));
1686
1669
  const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1687
1670
  query.queryKey = queryKey;
1688
1671
  return query;
1689
1672
  };
1673
+ /**
1674
+ * Enables / disables a plugin
1675
+ * @summary plugins toggle
1676
+ */
1677
+ export const sitePluginUpdate = (siteId, sitePluginUpdateBody, options) => {
1678
+ return axios.put(`/v1/sites/${siteId}/plugins`, sitePluginUpdateBody, options);
1679
+ };
1680
+ export const useSitePluginUpdate = (options) => {
1681
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1682
+ const mutationFn = (props) => {
1683
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1684
+ return sitePluginUpdate(siteId, data, axiosOptions);
1685
+ };
1686
+ return useMutation(mutationFn, mutationOptions);
1687
+ };
1690
1688
  /**
1691
1689
  * Enables / disables plugin auto-updates
1692
1690
  * @deprecated
@@ -1705,7 +1703,8 @@ export const useSitePluginsAutoupdate = (options) => {
1705
1703
  };
1706
1704
  /**
1707
1705
  * Enables / disables a plugin
1708
- * @summary plugins toggle
1706
+ * @deprecated
1707
+ * @summary Deprecated - plugins toggle
1709
1708
  */
1710
1709
  export const sitePluginsToggle = (siteId, sitePluginsToggleBody, options) => {
1711
1710
  return axios.post(`/v1/sites/${siteId}/plugins/toggle`, sitePluginsToggleBody, options);
@@ -543,6 +543,7 @@ export declare const getSitesBackupsDetailsMock: () => {
543
543
  addon_back_reference: string | null | undefined;
544
544
  pending_upgrade: boolean | undefined;
545
545
  next_url: string | null | undefined;
546
+ last_backup_date: string | null | undefined;
546
547
  } | undefined;
547
548
  };
548
549
  export declare const getJetpackBackupStatusMock: () => {
@@ -592,20 +593,6 @@ export declare const getSitesDomainMock: () => {
592
593
  export declare const getSitesDomainUrlMock: () => {
593
594
  success: boolean | undefined;
594
595
  };
595
- export declare const getSitesDomainsMock: () => {
596
- domains: {
597
- id: string | undefined;
598
- autogen_id: string | null | undefined;
599
- authoritative: string | null | undefined;
600
- dns_status: string | undefined;
601
- docroot: string | null | undefined;
602
- domain: string | undefined;
603
- base_domain: string | undefined;
604
- ssl_type: string | null | undefined;
605
- type: string | undefined;
606
- status: string | undefined;
607
- }[] | undefined;
608
- };
609
596
  export declare const getSitesDomainsCreateMock: () => {
610
597
  id: number | undefined;
611
598
  status: string | undefined;
@@ -652,6 +639,7 @@ export declare const getSitesErrorLogsMock: () => {
652
639
  };
653
640
  export declare const getSiteMalwareStatusMock: () => {
654
641
  malware_status: string | null | undefined;
642
+ scanner_state: string | null | undefined;
655
643
  };
656
644
  export declare const getSitePendingDomainDeleteMock: () => {};
657
645
  export declare const getSitesPerformanceCachepurgeMock: () => {
@@ -676,8 +664,13 @@ export declare const getSitePluginsMock: () => {
676
664
  status: string;
677
665
  title: string;
678
666
  update: boolean;
667
+ version: string | undefined;
679
668
  }[];
680
669
  };
670
+ export declare const getSitePluginUpdateMock: () => {
671
+ id: string;
672
+ status: string;
673
+ };
681
674
  export declare const getSitePluginsAutoupdateMock: () => {
682
675
  success: boolean;
683
676
  };
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.866.0
6
+ * OpenAPI spec version: 1.879.0
7
7
  */
8
8
  import { rest } from 'msw';
9
9
  import { faker } from '@faker-js/faker';
@@ -90,7 +90,7 @@ export const getSitesAutoupdatesUpdateMock = () => ({ plugins: faker.helpers.arr
90
90
  export const getSitesBackupsMock = () => ({ has_backups: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
91
91
  export const getSitesHasBackupsMock = () => ({ has_backups: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
92
92
  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]) });
93
- 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]), addon_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), plan_name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), can_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_plugin: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_addon: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_back_reference: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), next_url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) }, undefined]) });
93
+ 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]), addon_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), plan_name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), can_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_plugin: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_addon: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_back_reference: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), next_url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), last_backup_date: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) }, undefined]) });
94
94
  export const getJetpackBackupStatusMock = () => ({ plugin_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_exists: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), plan_name: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), can_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_plugin: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), has_active_addon: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), addon_back_reference: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), pending_upgrade: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), next_url: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
95
95
  export const getBackupsJetpackBackupMock = () => ({});
96
96
  export const getSiteAddonCloudflareMock = () => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
@@ -99,18 +99,18 @@ export const getSitesDatabasePasswordsyncMock = () => ({});
99
99
  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]) });
100
100
  export const getSitesDomainMock = () => ({ connected: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), a_match: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), nameserver_match: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]), detected: faker.helpers.arrayElement([{ a: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), ns: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) }, undefined]), wanted: faker.helpers.arrayElement([{ a: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), ns: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) }, undefined]) });
101
101
  export const getSitesDomainUrlMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
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
102
  export const getSitesDomainsCreateMock = () => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]) });
104
103
  export const getSitesAccessLogsMock = () => ({ date_end: faker.helpers.arrayElement([faker.random.word(), undefined]), date_start: faker.helpers.arrayElement([faker.random.word(), undefined]), scroll_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), total: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), logs: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ body_bytes_sent: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), cached: faker.helpers.arrayElement([faker.random.word(), undefined]), date: faker.helpers.arrayElement([faker.random.word(), undefined]), http_host: faker.helpers.arrayElement([faker.random.word(), undefined]), http_referrer: faker.helpers.arrayElement([faker.random.word(), undefined]), http_user_agent: faker.helpers.arrayElement([faker.random.word(), undefined]), http_x_forwarded_for: faker.helpers.arrayElement([faker.random.word(), undefined]), renderer: faker.helpers.arrayElement([faker.random.word(), undefined]), request_completion: faker.helpers.arrayElement([faker.random.word(), undefined]), request_time: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), request_type: faker.helpers.arrayElement([faker.random.word(), undefined]), request_url: faker.helpers.arrayElement([faker.random.word(), undefined]), scheme: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), user_ip: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
105
104
  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]) });
106
- export const getSiteMalwareStatusMock = () => ({ malware_status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
105
+ export const getSiteMalwareStatusMock = () => ({ malware_status: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), scanner_state: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
107
106
  export const getSitePendingDomainDeleteMock = () => ({});
108
107
  export const getSitesPerformanceCachepurgeMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
109
108
  export const getSitesPerformanceEdgecacheMock = () => ({});
110
109
  export const getSitesPerformanceEnduranceCacheLevelStatusMock = () => ({ endurance_cache_level: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
111
110
  export const getSitesPerformanceEnduranceCacheLevelMock = () => ({ options: faker.helpers.arrayElement([{}, undefined]) });
112
111
  export const getSitesPerformanceEndurancePageCacheMock = () => ({ result: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]) });
113
- export const getSitePluginsMock = () => ({ subtype: faker.random.word(), auto_update: faker.datatype.boolean(), plugins: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ id: faker.random.word(), status: faker.random.word(), title: faker.random.word(), update: faker.datatype.boolean() })) });
112
+ export const getSitePluginsMock = () => ({ subtype: faker.random.word(), auto_update: faker.datatype.boolean(), plugins: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ id: faker.random.word(), status: faker.random.word(), title: faker.random.word(), update: faker.datatype.boolean(), version: faker.helpers.arrayElement([faker.random.word(), undefined]) })) });
113
+ export const getSitePluginUpdateMock = () => ({ id: faker.random.word(), status: faker.random.word() });
114
114
  export const getSitePluginsAutoupdateMock = () => ({ success: faker.datatype.boolean() });
115
115
  export const getSitePluginsToggleMock = () => ({ success: faker.datatype.boolean() });
116
116
  export const getSitePluginsUpdateMock = () => ({ success: faker.datatype.boolean() });
@@ -327,8 +327,6 @@ export const getHostingUAPIMSW = () => [
327
327
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainMock()));
328
328
  }), rest.post('*/v1/sites/:siteId/domain', (_req, res, ctx) => {
329
329
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainUrlMock()));
330
- }), rest.get('*/v1/sites/:siteId/domains', (_req, res, ctx) => {
331
- return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsMock()));
332
330
  }), rest.post('*/v1/sites/:siteId/domains', (_req, res, ctx) => {
333
331
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsCreateMock()));
334
332
  }), rest.get('*/v1/sites/:siteId/logs/access', (_req, res, ctx) => {
@@ -351,6 +349,8 @@ export const getHostingUAPIMSW = () => [
351
349
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesPerformanceEndurancePageCacheMock()));
352
350
  }), rest.get('*/v1/sites/:siteId/plugins', (_req, res, ctx) => {
353
351
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitePluginsMock()));
352
+ }), rest.put('*/v1/sites/:siteId/plugins', (_req, res, ctx) => {
353
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitePluginUpdateMock()));
354
354
  }), rest.post('*/v1/sites/:siteId/plugins/autoupdate', (_req, res, ctx) => {
355
355
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitePluginsAutoupdateMock()));
356
356
  }), rest.post('*/v1/sites/:siteId/plugins/toggle', (_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.866.0
6
+ * OpenAPI spec version: 1.879.0
7
7
  */
8
8
  export declare type SitesDomainsV2200DomainsItem = {
9
9
  id?: number;
@@ -401,17 +401,31 @@ export declare type SitePluginsAutoupdate200 = {
401
401
  export declare type SitePluginsAutoupdateBody = {
402
402
  enable: boolean;
403
403
  };
404
+ export declare type SitePluginUpdate200 = {
405
+ id: string;
406
+ status: string;
407
+ };
408
+ export declare type SitePluginUpdateBody = {
409
+ /** The plugin id */
410
+ id: string;
411
+ /** activate or deactivate the plugin */
412
+ activate: boolean;
413
+ };
404
414
  export declare type SitePlugins200PluginsItem = {
405
415
  id: string;
406
416
  status: string;
407
417
  title: string;
408
418
  update: boolean;
419
+ version?: string;
409
420
  };
410
421
  export declare type SitePlugins200 = {
411
422
  subtype: string;
412
423
  auto_update: boolean;
413
424
  plugins: SitePlugins200PluginsItem[];
414
425
  };
426
+ export declare type SitePluginsParams = {
427
+ plugin_id?: string;
428
+ };
415
429
  export declare type SitesPerformanceEndurancePageCache200 = {
416
430
  result?: string;
417
431
  status?: string;
@@ -454,6 +468,8 @@ export declare type SitePendingDomainDelete200 = {
454
468
  export declare type SiteMalwareStatus200 = {
455
469
  /** malware status given by jetpack protect addon */
456
470
  malware_status?: string | null;
471
+ /** scanner state */
472
+ scanner_state?: string | null;
457
473
  };
458
474
  export declare type SitesErrorLogs200LogsItem = {
459
475
  file?: string;
@@ -563,21 +579,6 @@ export declare type SitesDomainsCreateBody = {
563
579
  /** The new domain to be added */
564
580
  domain: string;
565
581
  };
566
- export declare type SitesDomains200DomainsItem = {
567
- id?: string;
568
- autogen_id?: string | null;
569
- authoritative?: string | null;
570
- dns_status?: string;
571
- docroot?: string | null;
572
- domain?: string;
573
- base_domain?: string;
574
- ssl_type?: string | null;
575
- type?: string;
576
- status?: string;
577
- };
578
- export declare type SitesDomains200 = {
579
- domains?: SitesDomains200DomainsItem[];
580
- };
581
582
  export declare type SitesDomainUrl200 = {
582
583
  success?: boolean;
583
584
  };
@@ -662,6 +663,7 @@ export declare type SitesBackupsDetails200Jetpack = {
662
663
  addon_back_reference?: string | null;
663
664
  pending_upgrade?: boolean;
664
665
  next_url?: string | null;
666
+ last_backup_date?: string | null;
665
667
  };
666
668
  export declare type SitesBackupsDetails200Codeguard = {
667
669
  addon_id?: string;