@newfold/huapi-js 1.966.0 → 1.968.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.d.ts +20 -2
- package/src/index.js +16 -1
- package/src/index.msw.d.ts +14 -10
- package/src/index.msw.js +15 -12
- package/src/index.schemas.d.ts +15 -2
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.968.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import type { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
10
10
|
import type { UseQueryOptions, UseInfiniteQueryOptions, UseMutationOptions, UseQueryResult, UseInfiniteQueryResult, QueryKey } from '@tanstack/react-query';
|
|
11
|
-
import type { AccountEventList200, AccountEventListParams, AccountHostingList200, AccountPublicKeys200, AccountPublicKeyCreate200, AccountPublicKeyCreate409, AccountPublicKeyCreateBody, AccountPublicKey200, AccountPublicKey404, AccountPublicKeyDelete200, AccountPublicKeyDelete404, 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, BackupInitiate200, BackupInitiateBody, BackupStatus200, BackupStatusParams, BackupList200, BackupListParams, 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, DbCheckDatabase200, DbCheckDatabaseBody, DbUsage200, DbUserPasswordSet200, DbUserPasswordSetBody, DbUserPrivsGet200, DbUserPrivsGetParams, DbUserPrivsSet200, DbUserPrivsSetBody, 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, HostingRedirects200Item, HostingRedirect200, HostingRedirectBody, AddHostingRedirects200, AddHostingRedirectsBody, HostingResellerSsoWhm200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSiteAdd200, HostingSiteAddBody, SitesBatch200, SitesBatchBody, 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, SitesAccessLogsDownloadParams, SitesErrorLogs200, SitesErrorLogsParams, SitesErrorLogsDownloadParams, SiteMalwareStatus200, SitesMetricsDimensionAveraged200, SitesMetricsDimensionAveragedParams, SitesMetricDimensions200, SitesMetricDimensionsParams, 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, AddonsSitelockSsoV2200, AddonsSitelockSsoV2Params, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params, SitesSecuritySitelockV2200, SitesSecuritySitelockV2Params, SitesSshUserListV2200, SitesListV3200 } from './index.schemas';
|
|
11
|
+
import type { AccountEventList200, AccountEventListParams, AccountHostingList200, AccountPublicKeys200, AccountPublicKeyCreate200, AccountPublicKeyCreate409, AccountPublicKeyCreateBody, AccountPublicKey200, AccountPublicKey404, AccountPublicKeyDelete200, AccountPublicKeyDelete404, 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, BackupInitiate200, BackupInitiateBody, BackupStatus200, BackupStatusParams, BackupList200, BackupListParams, 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, DbCheckDatabase200, DbCheckDatabaseBody, DbUsage200, DbUserPasswordSet200, DbUserPasswordSetBody, DbUserPrivsGet200, DbUserPrivsGetParams, DbUserPrivsSet200, DbUserPrivsSetBody, DbUserAdd200, DbUserAddBody, DbUserDelete200, DbUserDeleteBody, DbUserList200, DbUserRename200, DbUserRenameBody, 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, HostingRedirects200Item, HostingRedirect200, HostingRedirectBody, AddHostingRedirects200, AddHostingRedirectsBody, HostingResellerSsoWhm200, HostingShellToggle200, HostingShellToggleBody, HostingShellInfo200, HostingSiteAdd200, HostingSiteAddBody, SitesBatch200, SitesBatchBody, 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, SitesAccessLogsDownloadParams, SitesErrorLogs200, SitesErrorLogsParams, SitesErrorLogsDownloadParams, SiteMalwareStatus200, SitesMetricsDimensionAveraged200, SitesMetricsDimensionAveragedParams, SitesMetricDimensions200, SitesMetricDimensionsParams, 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, AddonsSitelockSsoV2200, AddonsSitelockSsoV2Params, HostingNameserversV2200, HostingSitesV2200, SshKeyListV2200, SitesListV2200, SitesDomainsV2200, SitesDomainsV2Params, SitesSecuritySitelockV2200, SitesSecuritySitelockV2Params, SitesSshUserListV2200, SitesListV3200 } 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
|
/**
|
|
@@ -871,6 +871,24 @@ export declare const useDbUserList: <TData = AxiosResponse<DbUserList200, any>,
|
|
|
871
871
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
872
872
|
queryKey: QueryKey;
|
|
873
873
|
};
|
|
874
|
+
/**
|
|
875
|
+
* Rename db user
|
|
876
|
+
* @summary Rename db user
|
|
877
|
+
*/
|
|
878
|
+
export declare const dbUserRename: (hostingId: number, dbUserRenameBody: DbUserRenameBody, options?: AxiosRequestConfig) => Promise<AxiosResponse<DbUserRename200>>;
|
|
879
|
+
export declare type DbUserRenameMutationResult = NonNullable<Awaited<ReturnType<typeof dbUserRename>>>;
|
|
880
|
+
export declare type DbUserRenameMutationBody = DbUserRenameBody;
|
|
881
|
+
export declare type DbUserRenameMutationError = AxiosError<unknown>;
|
|
882
|
+
export declare const useDbUserRename: <TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
|
|
883
|
+
mutation?: UseMutationOptions<AxiosResponse<DbUserRename200, any>, TError, {
|
|
884
|
+
hostingId: number;
|
|
885
|
+
data: DbUserRenameBody;
|
|
886
|
+
}, TContext> | undefined;
|
|
887
|
+
axios?: AxiosRequestConfig<any> | undefined;
|
|
888
|
+
} | undefined) => import("@tanstack/react-query").UseMutationResult<AxiosResponse<DbUserRename200, any>, TError, {
|
|
889
|
+
hostingId: number;
|
|
890
|
+
data: DbUserRenameBody;
|
|
891
|
+
}, TContext>;
|
|
874
892
|
/**
|
|
875
893
|
* Returns a list of domains
|
|
876
894
|
* @summary domain list
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.968.0
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import { useQuery, useInfiniteQuery, useMutation } from '@tanstack/react-query';
|
|
@@ -893,6 +893,21 @@ export const useDbUserList = (hostingId, options) => {
|
|
|
893
893
|
query.queryKey = queryKey;
|
|
894
894
|
return query;
|
|
895
895
|
};
|
|
896
|
+
/**
|
|
897
|
+
* Rename db user
|
|
898
|
+
* @summary Rename db user
|
|
899
|
+
*/
|
|
900
|
+
export const dbUserRename = (hostingId, dbUserRenameBody, options) => {
|
|
901
|
+
return axios.put(`/v1/hosting/${hostingId}/db/users`, dbUserRenameBody, options);
|
|
902
|
+
};
|
|
903
|
+
export const useDbUserRename = (options) => {
|
|
904
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options !== null && options !== void 0 ? options : {};
|
|
905
|
+
const mutationFn = (props) => {
|
|
906
|
+
const { hostingId, data } = props !== null && props !== void 0 ? props : {};
|
|
907
|
+
return dbUserRename(hostingId, data, axiosOptions);
|
|
908
|
+
};
|
|
909
|
+
return useMutation(mutationFn, mutationOptions);
|
|
910
|
+
};
|
|
896
911
|
/**
|
|
897
912
|
* Returns a list of domains
|
|
898
913
|
* @summary domain list
|
package/src/index.msw.d.ts
CHANGED
|
@@ -353,6 +353,9 @@ export declare const getDbUserListMock: () => {
|
|
|
353
353
|
user: string | undefined;
|
|
354
354
|
}[] | undefined;
|
|
355
355
|
};
|
|
356
|
+
export declare const getDbUserRenameMock: () => {
|
|
357
|
+
success: number | undefined;
|
|
358
|
+
};
|
|
356
359
|
export declare const getDomainsMock: () => {
|
|
357
360
|
domains: {
|
|
358
361
|
docroot: string;
|
|
@@ -758,61 +761,61 @@ export declare const getSitesMetricDimensionsMock: () => {
|
|
|
758
761
|
dimensions: {
|
|
759
762
|
http_version: {
|
|
760
763
|
dimension: {
|
|
761
|
-
|
|
764
|
+
cm0ez6a1k00001rlicplsg9x6: number;
|
|
762
765
|
} | undefined;
|
|
763
766
|
timestamp: number | undefined;
|
|
764
767
|
}[] | undefined;
|
|
765
768
|
http_verb: {
|
|
766
769
|
dimension: {
|
|
767
|
-
|
|
770
|
+
cm0ez6a1l00011rli7lxvhs4o: number;
|
|
768
771
|
} | undefined;
|
|
769
772
|
timestamp: number | undefined;
|
|
770
773
|
}[] | undefined;
|
|
771
774
|
http_host: {
|
|
772
775
|
dimension: {
|
|
773
|
-
|
|
776
|
+
cm0ez6a1l00021rli37vs4ecl: number;
|
|
774
777
|
} | undefined;
|
|
775
778
|
timestamp: number | undefined;
|
|
776
779
|
}[] | undefined;
|
|
777
780
|
http_status: {
|
|
778
781
|
dimension: {
|
|
779
|
-
|
|
782
|
+
cm0ez6a1l00031rli3qeubjea: number;
|
|
780
783
|
} | undefined;
|
|
781
784
|
timestamp: number | undefined;
|
|
782
785
|
}[] | undefined;
|
|
783
786
|
page_renderer: {
|
|
784
787
|
dimension: {
|
|
785
|
-
|
|
788
|
+
cm0ez6a1l00041rli583ahppt: number;
|
|
786
789
|
} | undefined;
|
|
787
790
|
timestamp: number | undefined;
|
|
788
791
|
}[] | undefined;
|
|
789
792
|
page_is_cached: {
|
|
790
793
|
dimension: {
|
|
791
|
-
|
|
794
|
+
cm0ez6a1l00051rli8uw9fjfk: number;
|
|
792
795
|
} | undefined;
|
|
793
796
|
timestamp: number | undefined;
|
|
794
797
|
}[] | undefined;
|
|
795
798
|
wp_admin_ajax_action: {
|
|
796
799
|
dimension: {
|
|
797
|
-
|
|
800
|
+
cm0ez6a1l00061rlig4j7fi24: number;
|
|
798
801
|
} | undefined;
|
|
799
802
|
timestamp: number | undefined;
|
|
800
803
|
}[] | undefined;
|
|
801
804
|
visitor_asn: {
|
|
802
805
|
dimension: {
|
|
803
|
-
|
|
806
|
+
cm0ez6a1l00071rliffw6hjt7: number;
|
|
804
807
|
} | undefined;
|
|
805
808
|
timestamp: number | undefined;
|
|
806
809
|
}[] | undefined;
|
|
807
810
|
visitor_country_code: {
|
|
808
811
|
dimension: {
|
|
809
|
-
|
|
812
|
+
cm0ez6a1l00081rli8s3788am: number;
|
|
810
813
|
} | undefined;
|
|
811
814
|
timestamp: number | undefined;
|
|
812
815
|
}[] | undefined;
|
|
813
816
|
visitor_is_crawler: {
|
|
814
817
|
dimension: {
|
|
815
|
-
|
|
818
|
+
cm0ez6a1l00091rli3jwx6urk: number;
|
|
816
819
|
} | undefined;
|
|
817
820
|
timestamp: number | undefined;
|
|
818
821
|
}[] | undefined;
|
|
@@ -929,6 +932,7 @@ export declare const getSitesSshUserListMock: () => {
|
|
|
929
932
|
export declare const getSitesSshUserCreateMock: () => {
|
|
930
933
|
public_key: string | null | undefined;
|
|
931
934
|
private_key: string | null | undefined;
|
|
935
|
+
public_key_id: number | null | undefined;
|
|
932
936
|
};
|
|
933
937
|
export declare const getSitesSshUserDeleteMock: () => {};
|
|
934
938
|
export declare const getSitesSshUserUpdateMock: () => {};
|
package/src/index.msw.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.968.0
|
|
7
7
|
*/
|
|
8
8
|
import { rest } from 'msw';
|
|
9
9
|
import { faker } from '@faker-js/faker';
|
|
@@ -62,6 +62,7 @@ export const getDbUserPrivsSetMock = () => ({ status: faker.helpers.arrayElement
|
|
|
62
62
|
export const getDbUserAddMock = () => ({ username: faker.helpers.arrayElement([faker.random.word(), undefined]), password: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
63
63
|
export const getDbUserDeleteMock = () => ({ dbuser: faker.helpers.arrayElement([faker.random.word(), undefined]) });
|
|
64
64
|
export const getDbUserListMock = () => ({ users: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dblist: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), shortuser: faker.helpers.arrayElement([faker.random.word(), undefined]), user: faker.helpers.arrayElement([faker.random.word(), undefined]) })), undefined]) });
|
|
65
|
+
export const getDbUserRenameMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
65
66
|
export const getDomainsMock = () => ({ domains: Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ docroot: faker.random.word(), domain: faker.random.word(), type: faker.random.word(), id: faker.datatype.number({ min: undefined, max: undefined }) })) });
|
|
66
67
|
export const getHostingDomainsUnassignMock = () => ({ queued: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
67
68
|
export const getHostingEcommerceInfoMock = () => ({ addon_id: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), back_ref: faker.helpers.arrayElement([faker.random.word(), undefined]), level: faker.helpers.arrayElement([faker.random.word(), undefined]), name: faker.helpers.arrayElement([faker.random.word(), undefined]), type: faker.helpers.arrayElement([faker.random.word(), undefined]), status: faker.helpers.arrayElement([faker.random.word(), undefined]), subtype: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
|
|
@@ -120,25 +121,25 @@ export const getSitesErrorLogsMock = () => ({ datetime_end: faker.helpers.arrayE
|
|
|
120
121
|
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]) });
|
|
121
122
|
export const getSitesMetricsDimensionAveragedMock = () => ({ date_end: faker.helpers.arrayElement([`${faker.date.past().toISOString().split('.')[0]}Z`, undefined]), date_start: faker.helpers.arrayElement([`${faker.date.past().toISOString().split('.')[0]}Z`, undefined]), dimension: faker.helpers.arrayElement([faker.random.word(), undefined]), elapsed: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), unit: faker.helpers.arrayElement([faker.random.word(), undefined]), metrics: faker.helpers.arrayElement([{ requests_persec: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.datatype.number({ min: undefined, max: undefined }))), undefined]), response_bytes_persec: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.datatype.number({ min: undefined, max: undefined }))), undefined]), response_bytes_average: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.datatype.number({ min: undefined, max: undefined }))), undefined]), response_time_average: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.datatype.number({ min: undefined, max: undefined }))), undefined]) }, undefined]) });
|
|
122
123
|
export const getSitesMetricDimensionsMock = () => ({ date_end: faker.helpers.arrayElement([`${faker.date.past().toISOString().split('.')[0]}Z`, undefined]), date_start: faker.helpers.arrayElement([`${faker.date.past().toISOString().split('.')[0]}Z`, undefined]), elapsed: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]), metric: faker.helpers.arrayElement([faker.random.word(), undefined]), dimensions: faker.helpers.arrayElement([{ http_version: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
123
|
-
'
|
|
124
|
+
'cm0ez6a1k00001rlicplsg9x6': faker.datatype.number({ min: undefined, max: undefined })
|
|
124
125
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), http_verb: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
125
|
-
'
|
|
126
|
+
'cm0ez6a1l00011rli7lxvhs4o': faker.datatype.number({ min: undefined, max: undefined })
|
|
126
127
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), http_host: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
127
|
-
'
|
|
128
|
+
'cm0ez6a1l00021rli37vs4ecl': faker.datatype.number({ min: undefined, max: undefined })
|
|
128
129
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), http_status: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
129
|
-
'
|
|
130
|
+
'cm0ez6a1l00031rli3qeubjea': faker.datatype.number({ min: undefined, max: undefined })
|
|
130
131
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), page_renderer: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
131
|
-
'
|
|
132
|
+
'cm0ez6a1l00041rli583ahppt': faker.datatype.number({ min: undefined, max: undefined })
|
|
132
133
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), page_is_cached: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
133
|
-
'
|
|
134
|
+
'cm0ez6a1l00051rli8uw9fjfk': faker.datatype.number({ min: undefined, max: undefined })
|
|
134
135
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), wp_admin_ajax_action: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
135
|
-
'
|
|
136
|
+
'cm0ez6a1l00061rlig4j7fi24': faker.datatype.number({ min: undefined, max: undefined })
|
|
136
137
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), visitor_asn: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
137
|
-
'
|
|
138
|
+
'cm0ez6a1l00071rliffw6hjt7': faker.datatype.number({ min: undefined, max: undefined })
|
|
138
139
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), visitor_country_code: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
139
|
-
'
|
|
140
|
+
'cm0ez6a1l00081rli8s3788am': faker.datatype.number({ min: undefined, max: undefined })
|
|
140
141
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]), visitor_is_crawler: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({ dimension: faker.helpers.arrayElement([{
|
|
141
|
-
'
|
|
142
|
+
'cm0ez6a1l00091rli3jwx6urk': faker.datatype.number({ min: undefined, max: undefined })
|
|
142
143
|
}, undefined]), timestamp: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) })), undefined]) }, undefined]) });
|
|
143
144
|
export const getSitePendingDomainDeleteMock = () => ({});
|
|
144
145
|
export const getSitesPerformanceCachepurgeMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.boolean(), undefined]) });
|
|
@@ -166,7 +167,7 @@ export const getSitesSettingsDebugToggleMock = () => ({ success: faker.helpers.a
|
|
|
166
167
|
export const getSitesSettingsPhpVersionUpdateMock = () => ({ success: faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), undefined]) });
|
|
167
168
|
export const getSitesSettingsPhpVersionsMock = () => ({ default: faker.helpers.arrayElement([faker.random.word(), undefined]), latest: faker.helpers.arrayElement([faker.random.word(), undefined]), versions: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]), deprecated: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) });
|
|
168
169
|
export const getSitesSshUserListMock = () => ({ users: faker.helpers.arrayElement([Array.from({ length: faker.datatype.number({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => (faker.random.word())), undefined]) });
|
|
169
|
-
export const getSitesSshUserCreateMock = () => ({ public_key: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), private_key: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]) });
|
|
170
|
+
export const getSitesSshUserCreateMock = () => ({ public_key: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), private_key: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.random.word(), null]), undefined]), public_key_id: faker.helpers.arrayElement([faker.helpers.arrayElement([faker.datatype.number({ min: undefined, max: undefined }), null]), undefined]) });
|
|
170
171
|
export const getSitesSshUserDeleteMock = () => ({});
|
|
171
172
|
export const getSitesSshUserUpdateMock = () => ({});
|
|
172
173
|
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]) });
|
|
@@ -294,6 +295,8 @@ export const getHostingUAPIMSW = () => [
|
|
|
294
295
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbUserDeleteMock()));
|
|
295
296
|
}), rest.get('*/v1/hosting/:hostingId/db/users', (_req, res, ctx) => {
|
|
296
297
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbUserListMock()));
|
|
298
|
+
}), rest.put('*/v1/hosting/:hostingId/db/users', (_req, res, ctx) => {
|
|
299
|
+
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDbUserRenameMock()));
|
|
297
300
|
}), rest.get('*/v1/hosting/:hostingId/domains', (_req, res, ctx) => {
|
|
298
301
|
return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getDomainsMock()));
|
|
299
302
|
}), rest.post('*/v1/hosting/:hostingId/domains/unassign', (_req, res, ctx) => {
|
package/src/index.schemas.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Hosting UAPI
|
|
5
5
|
* Hosting UAPI is an API to expose Hosting, Addons, and Site functionality to a customer-facing Front End such as (Account Manager).
|
|
6
|
-
* OpenAPI spec version: 1.
|
|
6
|
+
* OpenAPI spec version: 1.968.0
|
|
7
7
|
*/
|
|
8
8
|
export declare type SitesListV3200 = {
|
|
9
9
|
total?: number;
|
|
@@ -417,6 +417,8 @@ export declare type SitesSshUserCreate200 = {
|
|
|
417
417
|
public_key?: string | null;
|
|
418
418
|
/** optional private key */
|
|
419
419
|
private_key?: string | null;
|
|
420
|
+
/** global site public key id */
|
|
421
|
+
public_key_id?: number | null;
|
|
420
422
|
};
|
|
421
423
|
export declare type SitesSshUserCreateBody = {
|
|
422
424
|
/** username of user */
|
|
@@ -425,8 +427,10 @@ export declare type SitesSshUserCreateBody = {
|
|
|
425
427
|
pass?: string;
|
|
426
428
|
/** optional public key */
|
|
427
429
|
pubkey?: string;
|
|
428
|
-
/** optional auto-generate
|
|
430
|
+
/** optional auto-generate key pair flag */
|
|
429
431
|
generate_pubkey?: boolean;
|
|
432
|
+
/** Pass as true to create as a global public key */
|
|
433
|
+
is_global?: boolean;
|
|
430
434
|
};
|
|
431
435
|
export declare type SitesSshUserList200 = {
|
|
432
436
|
users?: string[];
|
|
@@ -1569,6 +1573,15 @@ export declare const DomainsType: {
|
|
|
1569
1573
|
export declare type DomainsParams = {
|
|
1570
1574
|
type?: DomainsType;
|
|
1571
1575
|
};
|
|
1576
|
+
export declare type DbUserRename200 = {
|
|
1577
|
+
success?: number;
|
|
1578
|
+
};
|
|
1579
|
+
export declare type DbUserRenameBody = {
|
|
1580
|
+
/** username mapped to DB */
|
|
1581
|
+
dbuser: string;
|
|
1582
|
+
/** updating username to new username in DB */
|
|
1583
|
+
new_dbuser: string;
|
|
1584
|
+
};
|
|
1572
1585
|
export declare type DbUserList200UsersItem = {
|
|
1573
1586
|
dblist?: string[];
|
|
1574
1587
|
shortuser?: string;
|