@newfold/huapi-js 1.731.0 → 1.740.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.731.0",
13
+ "version": "1.740.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.731.0
6
+ * OpenAPI spec version: 1.740.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, 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, 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, SitesDns200, SitesDnsParams, SitesDomain200, SitesDomainUrl200, SitesDomainUrlBody, SitesDomains200, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, 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, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200 } from './index.schemas';
11
+ import type { AccountHostingList200, CodeguardBackupList200, CodeguardBackupListParams, CodeguardBackupCreate200, CodeguardBackupCreateBody, CodeguardBackupDownload200, CodeguardBackupDownloadBody, CodeguardBackupRestore200, CodeguardBackupRestoreBody, CodeguardDatabaseList200, CodeguardDatabaseBackupList200, CodeguardDatabaseBackupListParams, CodeguardDatabaseBackupCreate200, CodeguardDatabaseBackupCreateBody, CodeguardDatabaseBackupRestore200, CodeguardDatabaseBackupRestoreBody, CodeguardLoginLink200, CodeguardPlanInfo200, CodeguardWebsiteList200, CodeguardWebsiteBackupList200, CodeguardWebsiteBackupListParams, CodeguardWebsiteBackupCreate200, CodeguardWebsiteBackupCreateBody, CodeguardWebsiteBackupRestore200, CodeguardWebsiteBackupRestoreBody, AddonsSitelockSso200, AddonsCloudflare200, AddonsInfo200, AddonsSpamexpertsSso200, WebzaiSso200, WeeblySso200, 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, 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, SitesDomainUrl200, SitesDomainUrlBody, SitesDomains200, SitesDomainsCreate200, SitesDomainsCreateBody, SitePendingDomainDelete200, SitesPerformanceCachepurge200, SitesPerformanceCachepurgeBody, 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, SitesSsl200, SitesSso200, SitesSsoParams, SiteStatus200, SiteUsers200, SitesVersion200, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200 } from './index.schemas';
12
12
  declare type AwaitedInput<T> = PromiseLike<T> | T;
13
13
  declare type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
14
14
  /**
@@ -1319,6 +1319,35 @@ export declare const useSiteAddonCloudflare: <TError = AxiosError<SiteAddonCloud
1319
1319
  } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SiteAddonCloudflare200, any>, TError, {
1320
1320
  siteId: number;
1321
1321
  }, TContext>;
1322
+ /**
1323
+ * Get info about site database
1324
+ * @summary site - database info
1325
+ */
1326
+ export declare const sitesDatabaseInfo: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesDatabaseInfo200>>;
1327
+ export declare const getSitesDatabaseInfoQueryKey: (siteId: number) => string[];
1328
+ export declare type SitesDatabaseInfoQueryResult = NonNullable<Awaited<ReturnType<typeof sitesDatabaseInfo>>>;
1329
+ export declare type SitesDatabaseInfoQueryError = AxiosError<unknown>;
1330
+ export declare const useSitesDatabaseInfo: <TData = AxiosResponse<SitesDatabaseInfo200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
1331
+ query?: UseQueryOptions<AxiosResponse<SitesDatabaseInfo200, any>, TError, TData, QueryKey> | undefined;
1332
+ axios?: AxiosRequestConfig<any> | undefined;
1333
+ } | undefined) => UseQueryResult<TData, TError> & {
1334
+ queryKey: QueryKey;
1335
+ };
1336
+ /**
1337
+ * Resync database password with whats in wp-config
1338
+ * @summary site - database - password sync
1339
+ */
1340
+ export declare const sitesDatabasePasswordsync: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesDatabasePasswordsync200>>;
1341
+ export declare type SitesDatabasePasswordsyncMutationResult = NonNullable<Awaited<ReturnType<typeof sitesDatabasePasswordsync>>>;
1342
+ export declare type SitesDatabasePasswordsyncMutationError = AxiosError<unknown>;
1343
+ export declare const useSitesDatabasePasswordsync: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
1344
+ mutation?: UseMutationOptions<AxiosResponse<SitesDatabasePasswordsync200, any>, TError, {
1345
+ siteId: number;
1346
+ }, TContext> | undefined;
1347
+ axios?: AxiosRequestConfig<any> | undefined;
1348
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitesDatabasePasswordsync200, any>, TError, {
1349
+ siteId: number;
1350
+ }, TContext>;
1322
1351
  /**
1323
1352
  * Returns a list of DNS records for the site's domain.
1324
1353
  * @summary dns
@@ -1379,6 +1408,24 @@ export declare const useSitesDomains: <TData = AxiosResponse<SitesDomains200, an
1379
1408
  } | undefined) => UseQueryResult<TData, TError> & {
1380
1409
  queryKey: QueryKey;
1381
1410
  };
1411
+ /**
1412
+ * Add the domain
1413
+ * @summary Add domain for the site
1414
+ */
1415
+ export declare const sitesDomainsCreate: (siteId: number, sitesDomainsCreateBody: SitesDomainsCreateBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesDomainsCreate200>>;
1416
+ export declare type SitesDomainsCreateMutationResult = NonNullable<Awaited<ReturnType<typeof sitesDomainsCreate>>>;
1417
+ export declare type SitesDomainsCreateMutationBody = SitesDomainsCreateBody;
1418
+ export declare type SitesDomainsCreateMutationError = AxiosError<unknown>;
1419
+ export declare const useSitesDomainsCreate: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
1420
+ mutation?: UseMutationOptions<AxiosResponse<SitesDomainsCreate200, any>, TError, {
1421
+ siteId: number;
1422
+ data: SitesDomainsCreateBody;
1423
+ }, TContext> | undefined;
1424
+ axios?: AxiosRequestConfig<any> | undefined;
1425
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitesDomainsCreate200, any>, TError, {
1426
+ siteId: number;
1427
+ data: SitesDomainsCreateBody;
1428
+ }, TContext>;
1382
1429
  /**
1383
1430
  * Delete pending domain
1384
1431
  * @summary Delete pending domain
@@ -1747,6 +1794,56 @@ export declare const useSitesSettingsPhpVersions: <TData = AxiosResponse<SitesSe
1747
1794
  } | undefined) => UseQueryResult<TData, TError> & {
1748
1795
  queryKey: QueryKey;
1749
1796
  };
1797
+ /**
1798
+ * List ssh users
1799
+ * @summary site - ssh - list users
1800
+ */
1801
+ export declare const sitesSshUserList: (siteId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesSshUserList200>>;
1802
+ export declare const getSitesSshUserListQueryKey: (siteId: number) => string[];
1803
+ export declare type SitesSshUserListQueryResult = NonNullable<Awaited<ReturnType<typeof sitesSshUserList>>>;
1804
+ export declare type SitesSshUserListQueryError = AxiosError<unknown>;
1805
+ export declare const useSitesSshUserList: <TData = AxiosResponse<SitesSshUserList200, any>, TError = AxiosError<unknown, any>>(siteId: number, options?: {
1806
+ query?: UseQueryOptions<AxiosResponse<SitesSshUserList200, any>, TError, TData, QueryKey> | undefined;
1807
+ axios?: AxiosRequestConfig<any> | undefined;
1808
+ } | undefined) => UseQueryResult<TData, TError> & {
1809
+ queryKey: QueryKey;
1810
+ };
1811
+ /**
1812
+ * Create ssh user
1813
+ * @summary site - ssh - create user
1814
+ */
1815
+ export declare const sitesSshUserCreate: (siteId: number, sitesSshUserCreateBody: SitesSshUserCreateBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesSshUserCreate200>>;
1816
+ export declare type SitesSshUserCreateMutationResult = NonNullable<Awaited<ReturnType<typeof sitesSshUserCreate>>>;
1817
+ export declare type SitesSshUserCreateMutationBody = SitesSshUserCreateBody;
1818
+ export declare type SitesSshUserCreateMutationError = AxiosError<unknown>;
1819
+ export declare const useSitesSshUserCreate: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
1820
+ mutation?: UseMutationOptions<AxiosResponse<SitesSshUserCreate200, any>, TError, {
1821
+ siteId: number;
1822
+ data: SitesSshUserCreateBody;
1823
+ }, TContext> | undefined;
1824
+ axios?: AxiosRequestConfig<any> | undefined;
1825
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitesSshUserCreate200, any>, TError, {
1826
+ siteId: number;
1827
+ data: SitesSshUserCreateBody;
1828
+ }, TContext>;
1829
+ /**
1830
+ * delete ssh user
1831
+ * @summary site - ssh - delete user
1832
+ */
1833
+ export declare const sitesSshUserDelete: (siteId: number, sitesSshUserDeleteBody: SitesSshUserDeleteBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<SitesSshUserDelete200>>;
1834
+ export declare type SitesSshUserDeleteMutationResult = NonNullable<Awaited<ReturnType<typeof sitesSshUserDelete>>>;
1835
+ export declare type SitesSshUserDeleteMutationBody = SitesSshUserDeleteBody;
1836
+ export declare type SitesSshUserDeleteMutationError = AxiosError<unknown>;
1837
+ export declare const useSitesSshUserDelete: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
1838
+ mutation?: UseMutationOptions<AxiosResponse<SitesSshUserDelete200, any>, TError, {
1839
+ siteId: number;
1840
+ data: SitesSshUserDeleteBody;
1841
+ }, TContext> | undefined;
1842
+ axios?: AxiosRequestConfig<any> | undefined;
1843
+ } | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<SitesSshUserDelete200, any>, TError, {
1844
+ siteId: number;
1845
+ data: SitesSshUserDeleteBody;
1846
+ }, TContext>;
1750
1847
  /**
1751
1848
  * Returns information about the site domain's SSL/TLS certificate
1752
1849
  * @summary Site domain SSL cert info
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.731.0
6
+ * OpenAPI spec version: 1.740.0
7
7
  */
8
8
  import axios from 'axios';
9
9
  import { useQuery, useMutation } from '@tanstack/react-query';
@@ -1367,6 +1367,38 @@ export const useSiteAddonCloudflare = (options) => {
1367
1367
  };
1368
1368
  return useMutation(mutationFn, mutationOptions);
1369
1369
  };
1370
+ /**
1371
+ * Get info about site database
1372
+ * @summary site - database info
1373
+ */
1374
+ export const sitesDatabaseInfo = (siteId, options) => {
1375
+ return axios.get(`/v1/sites/${siteId}/database`, options);
1376
+ };
1377
+ export const getSitesDatabaseInfoQueryKey = (siteId) => [`/v1/sites/${siteId}/database`];
1378
+ export const useSitesDatabaseInfo = (siteId, options) => {
1379
+ var _a;
1380
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1381
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesDatabaseInfoQueryKey(siteId);
1382
+ const queryFn = ({ signal }) => sitesDatabaseInfo(siteId, Object.assign({ signal }, axiosOptions));
1383
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1384
+ query.queryKey = queryKey;
1385
+ return query;
1386
+ };
1387
+ /**
1388
+ * Resync database password with whats in wp-config
1389
+ * @summary site - database - password sync
1390
+ */
1391
+ export const sitesDatabasePasswordsync = (siteId, options) => {
1392
+ return axios.post(`/v1/sites/${siteId}/database/password-sync`, undefined, options);
1393
+ };
1394
+ export const useSitesDatabasePasswordsync = (options) => {
1395
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1396
+ const mutationFn = (props) => {
1397
+ const { siteId } = props !== null && props !== void 0 ? props : {};
1398
+ return sitesDatabasePasswordsync(siteId, axiosOptions);
1399
+ };
1400
+ return useMutation(mutationFn, mutationOptions);
1401
+ };
1370
1402
  /**
1371
1403
  * Returns a list of DNS records for the site's domain.
1372
1404
  * @summary dns
@@ -1433,6 +1465,21 @@ export const useSitesDomains = (siteId, options) => {
1433
1465
  query.queryKey = queryKey;
1434
1466
  return query;
1435
1467
  };
1468
+ /**
1469
+ * Add the domain
1470
+ * @summary Add domain for the site
1471
+ */
1472
+ export const sitesDomainsCreate = (siteId, sitesDomainsCreateBody, options) => {
1473
+ return axios.post(`/v1/sites/${siteId}/domains`, sitesDomainsCreateBody, options);
1474
+ };
1475
+ export const useSitesDomainsCreate = (options) => {
1476
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1477
+ const mutationFn = (props) => {
1478
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1479
+ return sitesDomainsCreate(siteId, data, axiosOptions);
1480
+ };
1481
+ return useMutation(mutationFn, mutationOptions);
1482
+ };
1436
1483
  /**
1437
1484
  * Delete pending domain
1438
1485
  * @summary Delete pending domain
@@ -1798,6 +1845,53 @@ export const useSitesSettingsPhpVersions = (siteId, options) => {
1798
1845
  query.queryKey = queryKey;
1799
1846
  return query;
1800
1847
  };
1848
+ /**
1849
+ * List ssh users
1850
+ * @summary site - ssh - list users
1851
+ */
1852
+ export const sitesSshUserList = (siteId, options) => {
1853
+ return axios.get(`/v1/sites/${siteId}/ssh-users`, options);
1854
+ };
1855
+ export const getSitesSshUserListQueryKey = (siteId) => [`/v1/sites/${siteId}/ssh-users`];
1856
+ export const useSitesSshUserList = (siteId, options) => {
1857
+ var _a;
1858
+ const { query: queryOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1859
+ const queryKey = (_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.queryKey) !== null && _a !== void 0 ? _a : getSitesSshUserListQueryKey(siteId);
1860
+ const queryFn = ({ signal }) => sitesSshUserList(siteId, Object.assign({ signal }, axiosOptions));
1861
+ const query = useQuery(Object.assign({ queryKey, queryFn, enabled: !!(siteId) }, queryOptions));
1862
+ query.queryKey = queryKey;
1863
+ return query;
1864
+ };
1865
+ /**
1866
+ * Create ssh user
1867
+ * @summary site - ssh - create user
1868
+ */
1869
+ export const sitesSshUserCreate = (siteId, sitesSshUserCreateBody, options) => {
1870
+ return axios.post(`/v1/sites/${siteId}/ssh-users`, sitesSshUserCreateBody, options);
1871
+ };
1872
+ export const useSitesSshUserCreate = (options) => {
1873
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1874
+ const mutationFn = (props) => {
1875
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1876
+ return sitesSshUserCreate(siteId, data, axiosOptions);
1877
+ };
1878
+ return useMutation(mutationFn, mutationOptions);
1879
+ };
1880
+ /**
1881
+ * delete ssh user
1882
+ * @summary site - ssh - delete user
1883
+ */
1884
+ export const sitesSshUserDelete = (siteId, sitesSshUserDeleteBody, options) => {
1885
+ return axios.delete(`/v1/sites/${siteId}/ssh-users`, Object.assign({ data: sitesSshUserDeleteBody }, options));
1886
+ };
1887
+ export const useSitesSshUserDelete = (options) => {
1888
+ const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
1889
+ const mutationFn = (props) => {
1890
+ const { siteId, data } = props !== null && props !== void 0 ? props : {};
1891
+ return sitesSshUserDelete(siteId, data, axiosOptions);
1892
+ };
1893
+ return useMutation(mutationFn, mutationOptions);
1894
+ };
1801
1895
  /**
1802
1896
  * Returns information about the site domain's SSL/TLS certificate
1803
1897
  * @summary Site domain SSL cert info
@@ -520,6 +520,11 @@ export declare const getBackupsJetpackBackupMock: () => {};
520
520
  export declare const getSiteAddonCloudflareMock: () => {
521
521
  addon_id: number | undefined;
522
522
  };
523
+ export declare const getSitesDatabaseInfoMock: () => {
524
+ collation: string | undefined;
525
+ charset: string | undefined;
526
+ };
527
+ export declare const getSitesDatabasePasswordsyncMock: () => {};
523
528
  export declare const getSitesDnsMock: () => {
524
529
  success: boolean | undefined;
525
530
  source: string | undefined;
@@ -559,6 +564,10 @@ export declare const getSitesDomainsMock: () => {
559
564
  status: string | undefined;
560
565
  }[] | undefined;
561
566
  };
567
+ export declare const getSitesDomainsCreateMock: () => {
568
+ id: number | undefined;
569
+ status: string | undefined;
570
+ };
562
571
  export declare const getSitePendingDomainDeleteMock: () => {};
563
572
  export declare const getSitesPerformanceCachepurgeMock: () => {
564
573
  success: boolean | undefined;
@@ -655,6 +664,9 @@ export declare const getSitesSettingsPhpVersionUpdateMock: () => {
655
664
  export declare const getSitesSettingsPhpVersionsMock: () => {
656
665
  versions: string[] | undefined;
657
666
  };
667
+ export declare const getSitesSshUserListMock: () => {};
668
+ export declare const getSitesSshUserCreateMock: () => {};
669
+ export declare const getSitesSshUserDeleteMock: () => {};
658
670
  export declare const getSitesSslMock: () => {
659
671
  domain: string | undefined;
660
672
  domain_dns_status: 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.731.0
6
+ * OpenAPI spec version: 1.740.0
7
7
  */
8
8
  import { rest } from 'msw';
9
9
  import { faker } from '@faker-js/faker';
@@ -91,10 +91,13 @@ export const getSitesBackupsDetailsMock = () => ({ codeguard: faker.helpers.arra
91
91
  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]) });
92
92
  export const getBackupsJetpackBackupMock = () => ({});
93
93
  export const getSiteAddonCloudflareMock = () => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
94
+ export const getSitesDatabaseInfoMock = () => ({ collation: faker.helpers.arrayElement([faker.random.word(), undefined]), charset: faker.helpers.arrayElement([faker.random.word(), undefined]) });
95
+ export const getSitesDatabasePasswordsyncMock = () => ({});
94
96
  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]) });
95
97
  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]) });
96
98
  export const getSitesDomainUrlMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
97
99
  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]) });
100
+ export const getSitesDomainsCreateMock = () => ({ id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]) });
98
101
  export const getSitePendingDomainDeleteMock = () => ({});
99
102
  export const getSitesPerformanceCachepurgeMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
100
103
  export const getSitesPerformanceEnduranceCacheLevelStatusMock = () => ({ endurance_cache_level: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
@@ -118,6 +121,9 @@ export const getSitesSettingsDebugMock = () => ({ status: faker.helpers.arrayEle
118
121
  export const getSitesSettingsDebugToggleMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
119
122
  export const getSitesSettingsPhpVersionUpdateMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
120
123
  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]) });
124
+ export const getSitesSshUserListMock = () => ({});
125
+ export const getSitesSshUserCreateMock = () => ({});
126
+ export const getSitesSshUserDeleteMock = () => ({});
121
127
  export const getSitesSslMock = () => ({ domain: faker.helpers.arrayElement([faker.random.word(), undefined]), domain_dns_status: faker.helpers.arrayElement([faker.random.word(), undefined]), expiration: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), issuer: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), product: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), provider: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), upgradeable: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
122
128
  export const getSitesSsoMock = () => ({ sso: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), type: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), other: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.random.word(), undefined]), domain: faker.helpers.arrayElement([faker.random.word(), undefined]), added: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
123
129
  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]) });
@@ -296,6 +302,10 @@ export const getHostingUAPIMSW = () => [
296
302
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getBackupsJetpackBackupMock()));
297
303
  }), rest.post('*/v1/sites/:siteId/cloudflare', (_req, res, ctx) => {
298
304
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSiteAddonCloudflareMock()));
305
+ }), rest.get('*/v1/sites/:siteId/database', (_req, res, ctx) => {
306
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDatabaseInfoMock()));
307
+ }), rest.post('*/v1/sites/:siteId/database/password-sync', (_req, res, ctx) => {
308
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDatabasePasswordsyncMock()));
299
309
  }), rest.get('*/v1/sites/:siteId/dns', (_req, res, ctx) => {
300
310
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDnsMock()));
301
311
  }), rest.get('*/v1/sites/:siteId/domain', (_req, res, ctx) => {
@@ -304,6 +314,8 @@ export const getHostingUAPIMSW = () => [
304
314
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainUrlMock()));
305
315
  }), rest.get('*/v1/sites/:siteId/domains', (_req, res, ctx) => {
306
316
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsMock()));
317
+ }), rest.post('*/v1/sites/:siteId/domains', (_req, res, ctx) => {
318
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesDomainsCreateMock()));
307
319
  }), rest.delete('*/v1/sites/:siteId/pending-domain', (_req, res, ctx) => {
308
320
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitePendingDomainDeleteMock()));
309
321
  }), rest.post('*/v1/sites/:siteId/performance/cachepurge', (_req, res, ctx) => {
@@ -350,6 +362,12 @@ export const getHostingUAPIMSW = () => [
350
362
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSettingsPhpVersionUpdateMock()));
351
363
  }), rest.get('*/v1/sites/:siteId/settings/php-versions', (_req, res, ctx) => {
352
364
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSettingsPhpVersionsMock()));
365
+ }), rest.get('*/v1/sites/:siteId/ssh-users', (_req, res, ctx) => {
366
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSshUserListMock()));
367
+ }), rest.post('*/v1/sites/:siteId/ssh-users', (_req, res, ctx) => {
368
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSshUserCreateMock()));
369
+ }), rest.delete('*/v1/sites/:siteId/ssh-users', (_req, res, ctx) => {
370
+ return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSshUserDeleteMock()));
353
371
  }), rest.get('*/v1/sites/:siteId/ssl', (_req, res, ctx) => {
354
372
  return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getSitesSslMock()));
355
373
  }), rest.get('*/v1/sites/:siteId/sso', (_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.731.0
6
+ * OpenAPI spec version: 1.740.0
7
7
  */
8
8
  export declare type SitesListV2200 = {
9
9
  total?: number;
@@ -168,6 +168,21 @@ export declare type SitesSsl200 = {
168
168
  type?: string | null;
169
169
  upgradeable?: boolean;
170
170
  };
171
+ export declare type SitesSshUserDelete200 = {
172
+ [key: string]: any;
173
+ };
174
+ export declare type SitesSshUserDeleteBody = {
175
+ ssh_user?: string;
176
+ };
177
+ export declare type SitesSshUserCreate200 = {
178
+ [key: string]: any;
179
+ };
180
+ export declare type SitesSshUserCreateBody = {
181
+ ssh_user?: string;
182
+ };
183
+ export declare type SitesSshUserList200 = {
184
+ [key: string]: any;
185
+ };
171
186
  export declare type SitesSettingsPhpVersions200 = {
172
187
  versions?: string[];
173
188
  };
@@ -318,6 +333,14 @@ export declare type SitesPerformanceCachepurgeBody = {
318
333
  export declare type SitePendingDomainDelete200 = {
319
334
  [key: string]: any;
320
335
  };
336
+ export declare type SitesDomainsCreate200 = {
337
+ id?: number;
338
+ status?: string;
339
+ };
340
+ export declare type SitesDomainsCreateBody = {
341
+ /** The new domain to be added */
342
+ domain: string;
343
+ };
321
344
  export declare type SitesDomains200DomainsItem = {
322
345
  id?: string;
323
346
  autogen_id?: string | null;
@@ -342,6 +365,8 @@ export declare type SitesDomainUrlBody = {
342
365
  temp_domain?: boolean;
343
366
  /** URL of the site to be updated */
344
367
  url?: string;
368
+ /** Optional to unassign the domain after switching to temporary domain */
369
+ unassign_domain?: boolean;
345
370
  };
346
371
  export declare type SitesDomain200Wanted = {
347
372
  a?: string[];
@@ -371,6 +396,13 @@ export declare type SitesDns200 = {
371
396
  export declare type SitesDnsParams = {
372
397
  type?: string;
373
398
  };
399
+ export declare type SitesDatabasePasswordsync200 = {
400
+ [key: string]: any;
401
+ };
402
+ export declare type SitesDatabaseInfo200 = {
403
+ collation?: string;
404
+ charset?: string;
405
+ };
374
406
  export declare type SiteAddonCloudflare400 = {
375
407
  error?: string;
376
408
  };