@base44-preview/cli 0.0.37-pr.357.8ea004a → 0.0.37-pr.357.9a73e6e
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.
|
@@ -4,6 +4,7 @@ var scriptPath = Deno.env.get("SCRIPT_PATH");
|
|
|
4
4
|
var appId = Deno.env.get("BASE44_APP_ID");
|
|
5
5
|
var accessToken = Deno.env.get("BASE44_ACCESS_TOKEN");
|
|
6
6
|
var apiUrl = Deno.env.get("BASE44_API_URL");
|
|
7
|
+
var appBaseUrl = Deno.env.get("BASE44_APP_BASE_URL");
|
|
7
8
|
if (!scriptPath) {
|
|
8
9
|
console.error("SCRIPT_PATH environment variable is required");
|
|
9
10
|
Deno.exit(1);
|
|
@@ -15,7 +16,7 @@ if (!appId || !accessToken) {
|
|
|
15
16
|
var base44 = createClient({
|
|
16
17
|
appId,
|
|
17
18
|
token: accessToken,
|
|
18
|
-
serverUrl: apiUrl || "https://app.base44.com"
|
|
19
|
+
serverUrl: appBaseUrl || apiUrl || "https://app.base44.com"
|
|
19
20
|
});
|
|
20
21
|
globalThis.base44 = base44;
|
|
21
22
|
try {
|
|
@@ -23,6 +24,8 @@ try {
|
|
|
23
24
|
} catch (error) {
|
|
24
25
|
console.error("Failed to execute script:", error);
|
|
25
26
|
Deno.exit(1);
|
|
27
|
+
} finally {
|
|
28
|
+
base44.cleanup();
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
//# debugId=
|
|
31
|
+
//# debugId=97E9663DBA65019D64756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../deno-runtime/exec.ts"],
|
|
4
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"
|
|
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 * - BASE44_APP_BASE_URL: App's published URL / subdomain (optional, used for function calls)\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\");\nconst appBaseUrl = Deno.env.get(\"BASE44_APP_BASE_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\n// Use the app's published URL (subdomain) as serverUrl when available so that\n// function invocations route through the app domain instead of the platform.\nconst base44 = createClient({\n appId,\n token: accessToken,\n serverUrl: appBaseUrl || 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} finally {\n // Clean up the SDK client (clears analytics heartbeat interval,\n // disconnects socket) so the process can exit naturally.\n base44.cleanup();\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";AAgCA;AAhBA,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;AAC5C,IAAM,aAAa,KAAK,IAAI,IAAI,qBAAqB;AAErD,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;AAMA,IAAM,SAAS,aAAa;AAAA,EAC1B;AAAA,EACA,OAAO;AAAA,EACP,WAAW,cAAc,UAAU;AACrC,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,UACX;AAAA,EAGA,OAAO,QAAQ;AAAA;",
|
|
8
|
+
"debugId": "97E9663DBA65019D64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|