@base44-preview/cli 0.1.10-pr.608.09b4b41 → 0.1.11-pr.602.81713bc
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 +42 -30
- package/dist/cli/index.js.map +6 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -245541,6 +245541,7 @@ var PublishedUrlResponseSchema = exports_external.object({
|
|
|
245541
245541
|
});
|
|
245542
245542
|
var CreateDeploymentResponseSchema = exports_external.object({
|
|
245543
245543
|
deployment_id: exports_external.string(),
|
|
245544
|
+
session_id: exports_external.string(),
|
|
245544
245545
|
asset_uploads: exports_external.object({
|
|
245545
245546
|
type: exports_external.literal("s3"),
|
|
245546
245547
|
uploads: exports_external.array(exports_external.object({
|
|
@@ -245552,6 +245553,7 @@ var CreateDeploymentResponseSchema = exports_external.object({
|
|
|
245552
245553
|
}).nullable().optional()
|
|
245553
245554
|
}).transform((data) => ({
|
|
245554
245555
|
deploymentId: data.deployment_id,
|
|
245556
|
+
sessionId: data.session_id,
|
|
245555
245557
|
assetUploads: data.asset_uploads == null ? null : {
|
|
245556
245558
|
type: "s3",
|
|
245557
245559
|
uploads: data.asset_uploads.uploads.map((upload) => ({
|
|
@@ -247925,7 +247927,7 @@ import { join as join12 } from "node:path";
|
|
|
247925
247927
|
// package.json
|
|
247926
247928
|
var package_default = {
|
|
247927
247929
|
name: "base44",
|
|
247928
|
-
version: "0.1.
|
|
247930
|
+
version: "0.1.11",
|
|
247929
247931
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
247930
247932
|
type: "module",
|
|
247931
247933
|
bin: {
|
|
@@ -248191,16 +248193,20 @@ async function createDeployment(request) {
|
|
|
248191
248193
|
}
|
|
248192
248194
|
return result.data;
|
|
248193
248195
|
}
|
|
248194
|
-
async function finalizeStaticDeployment(deploymentId, indexHtml) {
|
|
248196
|
+
async function finalizeStaticDeployment(deploymentId, indexHtml, sessionId) {
|
|
248195
248197
|
const formData = new FormData;
|
|
248196
248198
|
formData.append("index.html", new File([indexHtml], "index.html", { type: "text/html" }));
|
|
248197
|
-
return await postFinalize(deploymentId, formData);
|
|
248199
|
+
return await postFinalize(deploymentId, formData, sessionId);
|
|
248198
248200
|
}
|
|
248199
|
-
async function postFinalize(deploymentId, formData) {
|
|
248201
|
+
async function postFinalize(deploymentId, formData, sessionId) {
|
|
248200
248202
|
const appClient = getAppClient();
|
|
248201
248203
|
let response;
|
|
248202
248204
|
try {
|
|
248203
|
-
response = await appClient.post(`deployments/${encodeURIComponent(deploymentId)}/finalize`, {
|
|
248205
|
+
response = await appClient.post(`deployments/${encodeURIComponent(deploymentId)}/finalize`, {
|
|
248206
|
+
body: formData,
|
|
248207
|
+
timeout: 180000,
|
|
248208
|
+
searchParams: { session_id: sessionId }
|
|
248209
|
+
});
|
|
248204
248210
|
} catch (error48) {
|
|
248205
248211
|
throw await ApiError.fromHttpError(error48, "finalizing deployment");
|
|
248206
248212
|
}
|
|
@@ -248490,7 +248496,7 @@ async function deployStaticSite(options) {
|
|
|
248490
248496
|
});
|
|
248491
248497
|
}
|
|
248492
248498
|
const indexHtml = await readFile4(join16(outputDir, "index.html"));
|
|
248493
|
-
const finalized = await finalizeStaticDeployment(created.deploymentId, new Uint8Array(indexHtml));
|
|
248499
|
+
const finalized = await finalizeStaticDeployment(created.deploymentId, new Uint8Array(indexHtml), created.sessionId);
|
|
248494
248500
|
return { deploymentId: finalized.deploymentId };
|
|
248495
248501
|
}
|
|
248496
248502
|
// src/core/project/deploy.ts
|
|
@@ -258377,19 +258383,23 @@ async function fetchLogsForFunctions(functionNames, options, availableFunctionNa
|
|
|
258377
258383
|
try {
|
|
258378
258384
|
logs = await fetchFunctionLogs(functionName, filters);
|
|
258379
258385
|
} catch (error48) {
|
|
258380
|
-
if (error48 instanceof ApiError && error48.statusCode === 404
|
|
258381
|
-
const
|
|
258382
|
-
|
|
258383
|
-
|
|
258384
|
-
|
|
258385
|
-
|
|
258386
|
-
|
|
258387
|
-
|
|
258388
|
-
|
|
258389
|
-
|
|
258390
|
-
|
|
258391
|
-
|
|
258392
|
-
|
|
258386
|
+
if (error48 instanceof ApiError && error48.statusCode === 404) {
|
|
258387
|
+
const namesForHint = await getFunctionNamesForHint(availableFunctionNames, error48);
|
|
258388
|
+
if (namesForHint.length > 0) {
|
|
258389
|
+
const available = namesForHint.join(", ");
|
|
258390
|
+
throw new InvalidInputError(`Function "${functionName}" was not found in this app`, {
|
|
258391
|
+
cause: error48,
|
|
258392
|
+
hints: [
|
|
258393
|
+
{
|
|
258394
|
+
message: `Available functions in this app: ${available}`
|
|
258395
|
+
},
|
|
258396
|
+
{
|
|
258397
|
+
message: "Make sure the function has been deployed before fetching logs",
|
|
258398
|
+
command: "base44 functions deploy"
|
|
258399
|
+
}
|
|
258400
|
+
]
|
|
258401
|
+
});
|
|
258402
|
+
}
|
|
258393
258403
|
}
|
|
258394
258404
|
throw error48;
|
|
258395
258405
|
}
|
|
@@ -258402,14 +258412,19 @@ async function fetchLogsForFunctions(functionNames, options, availableFunctionNa
|
|
|
258402
258412
|
}
|
|
258403
258413
|
return allEntries;
|
|
258404
258414
|
}
|
|
258405
|
-
async function getProjectFunctionNames(projectRoot) {
|
|
258406
|
-
const { functions } = await readProjectConfig(projectRoot);
|
|
258407
|
-
return functions.map((fn) => fn.name);
|
|
258408
|
-
}
|
|
258409
258415
|
async function getRemoteFunctionNames() {
|
|
258410
258416
|
const { functions } = await listDeployedFunctions();
|
|
258411
258417
|
return functions.map((fn) => fn.name);
|
|
258412
258418
|
}
|
|
258419
|
+
async function getFunctionNamesForHint(availableFunctionNames, logsError) {
|
|
258420
|
+
if (availableFunctionNames.length > 0)
|
|
258421
|
+
return availableFunctionNames;
|
|
258422
|
+
try {
|
|
258423
|
+
return await getRemoteFunctionNames();
|
|
258424
|
+
} catch {
|
|
258425
|
+
throw logsError;
|
|
258426
|
+
}
|
|
258427
|
+
}
|
|
258413
258428
|
function validateLimit(limit) {
|
|
258414
258429
|
if (limit === undefined)
|
|
258415
258430
|
return;
|
|
@@ -258421,13 +258436,10 @@ function validateLimit(limit) {
|
|
|
258421
258436
|
async function logsAction(ctx, options) {
|
|
258422
258437
|
validateLimit(options.limit);
|
|
258423
258438
|
const specifiedFunctions = parseFunctionNames(options.function);
|
|
258424
|
-
const
|
|
258425
|
-
const availableFunctionNames = localProjectRoot ? await getProjectFunctionNames(localProjectRoot) : await getRemoteFunctionNames();
|
|
258439
|
+
const availableFunctionNames = specifiedFunctions.length === 0 ? await getRemoteFunctionNames() : [];
|
|
258426
258440
|
const functionNames = specifiedFunctions.length > 0 ? specifiedFunctions : availableFunctionNames;
|
|
258427
258441
|
if (functionNames.length === 0) {
|
|
258428
|
-
return {
|
|
258429
|
-
outroMessage: localProjectRoot ? "No functions found in this project." : "No functions found in this app."
|
|
258430
|
-
};
|
|
258442
|
+
return { outroMessage: "No functions found in this app." };
|
|
258431
258443
|
}
|
|
258432
258444
|
if (options.follow) {
|
|
258433
258445
|
if (options.until) {
|
|
@@ -258454,7 +258466,7 @@ async function logsAction(ctx, options) {
|
|
|
258454
258466
|
};
|
|
258455
258467
|
}
|
|
258456
258468
|
function getLogsCommand() {
|
|
258457
|
-
return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all
|
|
258469
|
+
return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all deployed functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([
|
|
258458
258470
|
...LogLevelSchema.options
|
|
258459
258471
|
])).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").option("-f, --follow", "Stream new logs as they arrive").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option("--env <env>", "Which deployment to read logs from: preview (current draft) or prod (published). Default: preview").choices([...LogEnvSchema.options])).action(logsAction);
|
|
258460
258472
|
}
|
|
@@ -268086,4 +268098,4 @@ export {
|
|
|
268086
268098
|
runCLI
|
|
268087
268099
|
};
|
|
268088
268100
|
|
|
268089
|
-
//# debugId=
|
|
268101
|
+
//# debugId=A79A364B5E1F19E564756E2164756E21
|