diff --git a/app/client/package.json b/app/client/package.json index 642ec189c7..4ea39be357 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -61,6 +61,7 @@ "instantsearch.js": "^4.4.1", "interweave": "^12.1.1", "interweave-autolink": "^4.0.1", + "js-base64": "^3.4.5", "json-fn": "^1.1.1", "lint-staged": "^9.2.5", "localforage": "^1.7.3", @@ -199,4 +200,4 @@ "pre-commit": "lint-staged" } } -} \ No newline at end of file +} diff --git a/app/client/src/jsExecution/JSExecutionManagerSingleton.ts b/app/client/src/jsExecution/JSExecutionManagerSingleton.ts index df0240c910..f10d0d2f8c 100644 --- a/app/client/src/jsExecution/JSExecutionManagerSingleton.ts +++ b/app/client/src/jsExecution/JSExecutionManagerSingleton.ts @@ -1,6 +1,7 @@ import RealmExecutor from "./RealmExecutor"; import moment from "moment-timezone"; import { ActionDescription } from "entities/DataTree/dataTreeFactory"; +import { btoa, atob } from "js-base64"; export type JSExecutorGlobal = Record; export type JSExecutorResult = { @@ -30,6 +31,14 @@ export const extraLibraries = [ accessor: "moment", lib: moment, }, + { + accessor: "btoa", + lib: btoa, + }, + { + accessor: "atob", + lib: atob, + }, ]; class JSExecutionManager { diff --git a/app/client/yarn.lock b/app/client/yarn.lock index 5319f4a0ea..c37745e1e7 100644 --- a/app/client/yarn.lock +++ b/app/client/yarn.lock @@ -10372,6 +10372,11 @@ js-base64@^2.1.8: version "2.5.1" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" +js-base64@^3.4.5: + version "3.4.5" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.4.5.tgz#6d1921e65a172cfd924604e1416dfaff45752c3e" + integrity sha512-Ub/AANierdcT8nm4ndBn3KzpZQ3MdHX4a+bwoVdjgeHCZ0ZEcP+UB4nmR4Z5lR6SH3Y+qAPmgVR0RxKJNHNHEg== + js-string-escape@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef"