@base44-preview/cli 0.1.10-pr.607.841a324 → 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 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.10",
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`, { body: formData, timeout: 180000 });
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
@@ -258369,32 +258375,6 @@ function normalizeLogEntry(entry, functionName) {
258369
258375
  source: functionName
258370
258376
  };
258371
258377
  }
258372
- async function getRemoteFunctionNames() {
258373
- const { functions } = await listDeployedFunctions();
258374
- return functions.map((fn) => fn.name);
258375
- }
258376
- async function getFunctionNamesForHint(availableFunctionNames, logsError) {
258377
- if (availableFunctionNames.length > 0)
258378
- return availableFunctionNames;
258379
- try {
258380
- return await getRemoteFunctionNames();
258381
- } catch {
258382
- throw logsError;
258383
- }
258384
- }
258385
- function createFunctionNotFoundError(functionName, availableFunctionNames, logsError) {
258386
- const available = availableFunctionNames.join(", ");
258387
- return new InvalidInputError(`Function "${functionName}" was not found in this app`, {
258388
- cause: logsError,
258389
- hints: [
258390
- { message: `Available functions in this app: ${available}` },
258391
- {
258392
- message: "Make sure the function has been deployed before fetching logs",
258393
- command: "base44 functions deploy"
258394
- }
258395
- ]
258396
- });
258397
- }
258398
258378
  async function fetchLogsForFunctions(functionNames, options, availableFunctionNames) {
258399
258379
  const filters = parseFunctionFilters(options);
258400
258380
  const allEntries = [];
@@ -258403,12 +258383,25 @@ async function fetchLogsForFunctions(functionNames, options, availableFunctionNa
258403
258383
  try {
258404
258384
  logs = await fetchFunctionLogs(functionName, filters);
258405
258385
  } catch (error48) {
258406
- if (!(error48 instanceof ApiError) || error48.statusCode !== 404)
258407
- throw error48;
258408
- const namesForHint = await getFunctionNamesForHint(availableFunctionNames, error48);
258409
- if (namesForHint.length === 0)
258410
- throw error48;
258411
- throw createFunctionNotFoundError(functionName, namesForHint, error48);
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
+ }
258403
+ }
258404
+ throw error48;
258412
258405
  }
258413
258406
  const matchingLogs = filters.level ? logs.filter((entry) => entry.level === filters.level) : logs;
258414
258407
  allEntries.push(...matchingLogs.map((entry) => normalizeLogEntry(entry, functionName)));
@@ -258419,6 +258412,19 @@ async function fetchLogsForFunctions(functionNames, options, availableFunctionNa
258419
258412
  }
258420
258413
  return allEntries;
258421
258414
  }
258415
+ async function getRemoteFunctionNames() {
258416
+ const { functions } = await listDeployedFunctions();
258417
+ return functions.map((fn) => fn.name);
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
+ }
258422
258428
  function validateLimit(limit) {
258423
258429
  if (limit === undefined)
258424
258430
  return;
@@ -268092,4 +268098,4 @@ export {
268092
268098
  runCLI
268093
268099
  };
268094
268100
 
268095
- //# debugId=85D146C5204055CA64756E2164756E21
268101
+ //# debugId=A79A364B5E1F19E564756E2164756E21