2022-12-21 17:14:47 +00:00
|
|
|
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
|
2024-01-24 06:44:16 +00:00
|
|
|
import type { ApiResponse } from "api/ApiResponses";
|
2023-10-20 05:38:47 +00:00
|
|
|
import type { JSLibrary } from "workers/common/JSLibrary";
|
2022-12-21 17:14:47 +00:00
|
|
|
|
2024-01-24 06:44:16 +00:00
|
|
|
export function fetchJSLibraries(
|
|
|
|
|
applicationId: string,
|
|
|
|
|
customJSLibraries?: ApiResponse,
|
|
|
|
|
) {
|
2022-12-21 17:14:47 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.FETCH_JS_LIBRARIES_INIT,
|
2024-01-24 06:44:16 +00:00
|
|
|
payload: { applicationId, customJSLibraries },
|
2022-12-21 17:14:47 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-20 05:38:47 +00:00
|
|
|
export function installLibraryInit(payload: Partial<JSLibrary>) {
|
2022-12-21 17:14:47 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.INSTALL_LIBRARY_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function toggleInstaller(payload: boolean) {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.TOGGLE_INSTALLER,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-20 05:38:47 +00:00
|
|
|
export function uninstallLibraryInit(payload: JSLibrary) {
|
2022-12-21 17:14:47 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.UNINSTALL_LIBRARY_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function clearInstalls() {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CLEAR_PROCESSED_INSTALLS,
|
|
|
|
|
};
|
|
|
|
|
}
|