@base44-preview/cli 0.0.36-pr.355.fd88cd2 → 0.0.37-pr.357.020ced4
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/dist/cli/index.js +141 -50
- package/dist/cli/index.js.map +9 -8
- package/dist/deno-runtime/exec.js +28 -0
- package/dist/deno-runtime/exec.js.map +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// deno-runtime/exec.ts
|
|
2
|
+
import { createClient } from "npm:@base44/sdk";
|
|
3
|
+
var scriptPath = Deno.env.get("SCRIPT_PATH");
|
|
4
|
+
var appId = Deno.env.get("BASE44_APP_ID");
|
|
5
|
+
var accessToken = Deno.env.get("BASE44_ACCESS_TOKEN");
|
|
6
|
+
var apiUrl = Deno.env.get("BASE44_API_URL");
|
|
7
|
+
if (!scriptPath) {
|
|
8
|
+
console.error("SCRIPT_PATH environment variable is required");
|
|
9
|
+
Deno.exit(1);
|
|
10
|
+
}
|
|
11
|
+
if (!appId || !accessToken) {
|
|
12
|
+
console.error("BASE44_APP_ID and BASE44_ACCESS_TOKEN are required");
|
|
13
|
+
Deno.exit(1);
|
|
14
|
+
}
|
|
15
|
+
var base44 = createClient({
|
|
16
|
+
appId,
|
|
17
|
+
token: accessToken,
|
|
18
|
+
serverUrl: apiUrl || "https://app.base44.com"
|
|
19
|
+
});
|
|
20
|
+
globalThis.base44 = base44;
|
|
21
|
+
try {
|
|
22
|
+
await import(scriptPath);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error("Failed to execute script:", error);
|
|
25
|
+
Deno.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# debugId=18F6B36C3A054F0A64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../deno-runtime/exec.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Deno Exec Wrapper\n *\n * This script is executed by Deno to run user scripts with the Base44 SDK\n * pre-authenticated and available as a global `base44` variable.\n *\n * Environment variables:\n * - SCRIPT_PATH: Absolute path (or file:// URL) to the user's script\n * - BASE44_APP_ID: App identifier from .app.jsonc\n * - BASE44_ACCESS_TOKEN: User's access token\n * - BASE44_API_URL: API endpoint (default: https://app.base44.com)\n */\n\nexport {};\n\nconst scriptPath = Deno.env.get(\"SCRIPT_PATH\");\nconst appId = Deno.env.get(\"BASE44_APP_ID\");\nconst accessToken = Deno.env.get(\"BASE44_ACCESS_TOKEN\");\nconst apiUrl = Deno.env.get(\"BASE44_API_URL\");\n\nif (!scriptPath) {\n console.error(\"SCRIPT_PATH environment variable is required\");\n Deno.exit(1);\n}\n\nif (!appId || !accessToken) {\n console.error(\"BASE44_APP_ID and BASE44_ACCESS_TOKEN are required\");\n Deno.exit(1);\n}\n\nimport { createClient } from \"npm:@base44/sdk\";\n\nconst base44 = createClient({\n appId,\n token: accessToken,\n serverUrl: apiUrl || \"https://app.base44.com\",\n});\n\n(globalThis as any).base44 = base44;\n\ntry {\n await import(scriptPath);\n} catch (error) {\n console.error(\"Failed to execute script:\", error);\n Deno.exit(1);\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AA8BA;AAfA,IAAM,aAAa,KAAK,IAAI,IAAI,aAAa;AAC7C,IAAM,QAAQ,KAAK,IAAI,IAAI,eAAe;AAC1C,IAAM,cAAc,KAAK,IAAI,IAAI,qBAAqB;AACtD,IAAM,SAAS,KAAK,IAAI,IAAI,gBAAgB;AAE5C,IAAI,CAAC,YAAY;AAAA,EACf,QAAQ,MAAM,8CAA8C;AAAA,EAC5D,KAAK,KAAK,CAAC;AACb;AAEA,IAAI,CAAC,SAAS,CAAC,aAAa;AAAA,EAC1B,QAAQ,MAAM,oDAAoD;AAAA,EAClE,KAAK,KAAK,CAAC;AACb;AAIA,IAAM,SAAS,aAAa;AAAA,EAC1B;AAAA,EACA,OAAO;AAAA,EACP,WAAW,UAAU;AACvB,CAAC;AAEA,WAAmB,SAAS;AAE7B,IAAI;AAAA,EACF,MAAa;AAAA,EACb,OAAO,OAAO;AAAA,EACd,QAAQ,MAAM,6BAA6B,KAAK;AAAA,EAChD,KAAK,KAAK,CAAC;AAAA;",
|
|
8
|
+
"debugId": "18F6B36C3A054F0A64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|