@base44-preview/cli 0.3.1-pr.693.36e994c → 0.3.1-pr.694.b9f40b5
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.
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - SCRIPT_PATH: Absolute path (or file:// URL) to the user's script
|
|
9
9
|
* - BASE44_APP_ID: App identifier from .app.jsonc
|
|
10
10
|
* - BASE44_ACCESS_TOKEN: User's access token
|
|
11
|
-
* - BASE44_APP_BASE_URL: App's published URL
|
|
11
|
+
* - BASE44_APP_BASE_URL: App's published URL / subdomain (used for function calls)
|
|
12
12
|
* - BASE44_PRIVILEGED: When "true", adds the X-Bypass-RLS header (bypass RLS)
|
|
13
13
|
* - BASE44_DATA_ENV: When set, adds the X-Data-Env header (target data environment)
|
|
14
14
|
* - BASE44_SERVICE_TOKEN: When set, passed as `serviceToken` (enables `base44.asServiceRole`)
|
package/dist/cli/index.js
CHANGED
|
@@ -228514,6 +228514,21 @@ class DependencyNotFoundError extends UserError {
|
|
|
228514
228514
|
});
|
|
228515
228515
|
}
|
|
228516
228516
|
}
|
|
228517
|
+
|
|
228518
|
+
class AppNotPublishedError extends UserError {
|
|
228519
|
+
code = "APP_NOT_PUBLISHED";
|
|
228520
|
+
constructor(message = "This app has not been published yet, so it has no site URL", options) {
|
|
228521
|
+
super(message, {
|
|
228522
|
+
hints: options?.hints ?? [
|
|
228523
|
+
{
|
|
228524
|
+
message: "Publish the app in the Base44 builder, or deploy its site with 'base44 deploy'",
|
|
228525
|
+
command: "base44 deploy"
|
|
228526
|
+
}
|
|
228527
|
+
],
|
|
228528
|
+
cause: options?.cause
|
|
228529
|
+
});
|
|
228530
|
+
}
|
|
228531
|
+
}
|
|
228517
228532
|
var MAX_RESPONSE_TEXT_CHARS = 500;
|
|
228518
228533
|
async function readResponseText(response) {
|
|
228519
228534
|
try {
|
|
@@ -266128,10 +266143,18 @@ function getSiteInstallCommand() {
|
|
|
266128
266143
|
}
|
|
266129
266144
|
|
|
266130
266145
|
// src/cli/commands/site/open.ts
|
|
266146
|
+
var isAppNotPublished = (error) => error instanceof ApiError && error.statusCode === 404;
|
|
266147
|
+
async function getPublishedSiteUrl() {
|
|
266148
|
+
try {
|
|
266149
|
+
return await getSiteUrl();
|
|
266150
|
+
} catch (error) {
|
|
266151
|
+
throw isAppNotPublished(error) ? new AppNotPublishedError : error;
|
|
266152
|
+
}
|
|
266153
|
+
}
|
|
266131
266154
|
async function openAction({
|
|
266132
266155
|
isNonInteractive
|
|
266133
266156
|
}) {
|
|
266134
|
-
const siteUrl = await
|
|
266157
|
+
const siteUrl = await getPublishedSiteUrl();
|
|
266135
266158
|
if (!isNonInteractive) {
|
|
266136
266159
|
await open_default(siteUrl);
|
|
266137
266160
|
}
|
|
@@ -270697,17 +270720,6 @@ function inheritedEnv() {
|
|
|
270697
270720
|
}
|
|
270698
270721
|
return env;
|
|
270699
270722
|
}
|
|
270700
|
-
var appPreviewUrl = (appId) => `https://preview--${appId}.base44.app`;
|
|
270701
|
-
async function resolveAppBaseUrl(appId) {
|
|
270702
|
-
try {
|
|
270703
|
-
return await getSiteUrl();
|
|
270704
|
-
} catch (error) {
|
|
270705
|
-
if (error instanceof ApiError && error.statusCode === 404) {
|
|
270706
|
-
return appPreviewUrl(appId);
|
|
270707
|
-
}
|
|
270708
|
-
throw error;
|
|
270709
|
-
}
|
|
270710
|
-
}
|
|
270711
270723
|
async function runScript(options) {
|
|
270712
270724
|
const { appId, code, local, privileged, dataEnv, serviceToken, sdkVersion } = options;
|
|
270713
270725
|
verifyDenoInstalled("to run scripts with exec");
|
|
@@ -270716,7 +270728,7 @@ async function runScript(options) {
|
|
|
270716
270728
|
cleanupFns.push(tempScript.cleanup);
|
|
270717
270729
|
writeFileSync3(tempScript.path, code, "utf-8");
|
|
270718
270730
|
const scriptPath = `file://${tempScript.path}`;
|
|
270719
|
-
const [appUserToken, appBaseUrl] = local ? [local.token, local.serverUrl] : await Promise.all([getAppUserToken(),
|
|
270731
|
+
const [appUserToken, appBaseUrl] = local ? [local.token, local.serverUrl] : await Promise.all([getAppUserToken(), getSiteUrl()]);
|
|
270720
270732
|
const tempWrapper = await $file({ postfix: ".ts" });
|
|
270721
270733
|
cleanupFns.push(tempWrapper.cleanup);
|
|
270722
270734
|
writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
|
|
@@ -275053,4 +275065,4 @@ export {
|
|
|
275053
275065
|
runCLI
|
|
275054
275066
|
};
|
|
275055
275067
|
|
|
275056
|
-
//# debugId=
|
|
275068
|
+
//# debugId=11789D5167933FD664756E2164756E21
|