@base44-preview/cli 0.0.56-pr.550.7e7ee9d → 0.0.56-pr.551.d02ef77
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,9 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
{
|
|
6
6
|
"name": "<%= name %>"<% if (description) { %>,
|
|
7
|
-
"description": "<%= description %>"<% }
|
|
8
|
-
|
|
9
|
-
"visibility": "public"
|
|
7
|
+
"description": "<%= description %>"<% } %>
|
|
10
8
|
|
|
11
9
|
// Site/hosting configuration
|
|
12
10
|
// Docs: https://docs.base44.com/configuration/hosting
|
package/dist/cli/index.js
CHANGED
|
@@ -233809,9 +233809,6 @@ class ApiError extends SystemError {
|
|
|
233809
233809
|
}
|
|
233810
233810
|
];
|
|
233811
233811
|
}
|
|
233812
|
-
if (statusCode && statusCode < 500) {
|
|
233813
|
-
return [];
|
|
233814
|
-
}
|
|
233815
233812
|
return [{ message: "Check your network connection and try again" }];
|
|
233816
233813
|
}
|
|
233817
233814
|
static getReasonHints(parsedResponse) {
|
|
@@ -236015,13 +236012,11 @@ var PluginMetadataSchema = exports_external.object({
|
|
|
236015
236012
|
var PluginReferenceSchema = exports_external.object({
|
|
236016
236013
|
source: exports_external.string().min(1, "Plugin source cannot be empty")
|
|
236017
236014
|
});
|
|
236018
|
-
var VISIBILITY_LEVELS = ["public", "private", "workspace"];
|
|
236019
236015
|
var ProjectConfigSchema = exports_external.object({
|
|
236020
236016
|
name: exports_external.string({
|
|
236021
236017
|
error: "App name cannot be empty"
|
|
236022
236018
|
}).min(1, "App name cannot be empty"),
|
|
236023
236019
|
description: exports_external.string().optional(),
|
|
236024
|
-
visibility: exports_external.enum(VISIBILITY_LEVELS).optional(),
|
|
236025
236020
|
site: SiteConfigSchema.optional(),
|
|
236026
236021
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
236027
236022
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
@@ -243492,6 +243487,9 @@ function buildLogsQueryString(filters) {
|
|
|
243492
243487
|
if (filters.order) {
|
|
243493
243488
|
params.set("order", filters.order);
|
|
243494
243489
|
}
|
|
243490
|
+
if (filters.env) {
|
|
243491
|
+
params.set("env", filters.env);
|
|
243492
|
+
}
|
|
243495
243493
|
return params;
|
|
243496
243494
|
}
|
|
243497
243495
|
async function fetchFunctionLogs(functionName, filters = {}) {
|
|
@@ -244106,30 +244104,6 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
244106
244104
|
// src/core/project/deploy.ts
|
|
244107
244105
|
import { resolve as resolve2 } from "node:path";
|
|
244108
244106
|
|
|
244109
|
-
// src/core/project/visibility.ts
|
|
244110
|
-
var PUBLIC_SETTINGS = {
|
|
244111
|
-
public: "public_without_login",
|
|
244112
|
-
private: "private_with_login",
|
|
244113
|
-
workspace: "workspace_with_login"
|
|
244114
|
-
};
|
|
244115
|
-
async function setAppVisibility(visibility) {
|
|
244116
|
-
const { id } = getAppContext();
|
|
244117
|
-
try {
|
|
244118
|
-
await base44Client.put(`api/apps/${id}`, {
|
|
244119
|
-
json: { public_settings: PUBLIC_SETTINGS[visibility] }
|
|
244120
|
-
});
|
|
244121
|
-
} catch (error48) {
|
|
244122
|
-
throw await ApiError.fromHttpError(error48, "updating app visibility");
|
|
244123
|
-
}
|
|
244124
|
-
}
|
|
244125
|
-
async function writeVisibilityToConfig(configPath, visibility) {
|
|
244126
|
-
const text = await readTextFile(configPath);
|
|
244127
|
-
const existing = /("visibility"\s*:\s*")(?:public|private|workspace)(")/;
|
|
244128
|
-
const next = existing.test(text) ? text.replace(existing, `$1${visibility}$2`) : text.replace("{", `{
|
|
244129
|
-
"visibility": "${visibility}",`);
|
|
244130
|
-
await writeFile(configPath, next);
|
|
244131
|
-
}
|
|
244132
|
-
|
|
244133
244107
|
// src/core/site/api.ts
|
|
244134
244108
|
async function uploadSite(archivePath) {
|
|
244135
244109
|
const archiveBuffer = await readFile(archivePath);
|
|
@@ -244204,14 +244178,10 @@ function hasResourcesToDeploy(projectData) {
|
|
|
244204
244178
|
const hasAgents = agents.length > 0;
|
|
244205
244179
|
const hasConnectors = connectors.length > 0;
|
|
244206
244180
|
const hasAuthConfig = authConfig.length > 0;
|
|
244207
|
-
|
|
244208
|
-
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasVisibility || hasSite;
|
|
244181
|
+
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
|
|
244209
244182
|
}
|
|
244210
244183
|
async function deployAll(projectData, options) {
|
|
244211
244184
|
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244212
|
-
if (project.visibility) {
|
|
244213
|
-
await setAppVisibility(project.visibility);
|
|
244214
|
-
}
|
|
244215
244185
|
await entityResource.push(entities);
|
|
244216
244186
|
await deployFunctionsSequentially(functions, {
|
|
244217
244187
|
onStart: options?.onFunctionStart,
|
|
@@ -253273,9 +253243,6 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
253273
253243
|
if (authConfig.length > 0) {
|
|
253274
253244
|
summaryLines.push(" - Auth config");
|
|
253275
253245
|
}
|
|
253276
|
-
if (project2.visibility) {
|
|
253277
|
-
summaryLines.push(` - Visibility: ${project2.visibility}`);
|
|
253278
|
-
}
|
|
253279
253246
|
if (project2.site?.outputDirectory) {
|
|
253280
253247
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
253281
253248
|
}
|
|
@@ -253532,6 +253499,9 @@ function parseFunctionFilters(options) {
|
|
|
253532
253499
|
if (options.order) {
|
|
253533
253500
|
filters.order = options.order.toLowerCase();
|
|
253534
253501
|
}
|
|
253502
|
+
if (options.env) {
|
|
253503
|
+
filters.env = options.env;
|
|
253504
|
+
}
|
|
253535
253505
|
return filters;
|
|
253536
253506
|
}
|
|
253537
253507
|
function parseFunctionNames(option) {
|
|
@@ -253568,38 +253538,44 @@ function normalizeLogEntry(entry, functionName) {
|
|
|
253568
253538
|
source: functionName
|
|
253569
253539
|
};
|
|
253570
253540
|
}
|
|
253541
|
+
async function fetchLogsForFunction(functionName, filters, availableFunctionNames) {
|
|
253542
|
+
try {
|
|
253543
|
+
return await fetchFunctionLogs(functionName, filters);
|
|
253544
|
+
} catch (error48) {
|
|
253545
|
+
if (error48 instanceof ApiError && error48.statusCode === 404 && availableFunctionNames.length > 0) {
|
|
253546
|
+
const available = availableFunctionNames.join(", ");
|
|
253547
|
+
throw new InvalidInputError(`Function "${functionName}" was not found in this app`, {
|
|
253548
|
+
hints: [
|
|
253549
|
+
{ message: `Available functions in this project: ${available}` },
|
|
253550
|
+
{
|
|
253551
|
+
message: "Make sure the function has been deployed before fetching logs",
|
|
253552
|
+
command: "base44 functions deploy"
|
|
253553
|
+
}
|
|
253554
|
+
]
|
|
253555
|
+
});
|
|
253556
|
+
}
|
|
253557
|
+
throw error48;
|
|
253558
|
+
}
|
|
253559
|
+
}
|
|
253571
253560
|
async function fetchLogsForFunctions(functionNames, options, availableFunctionNames) {
|
|
253572
|
-
const
|
|
253561
|
+
const env3 = options.env ?? "all";
|
|
253562
|
+
const envs = env3 === "all" ? ["preview", "prod"] : [env3];
|
|
253573
253563
|
const allEntries = [];
|
|
253574
253564
|
for (const functionName of functionNames) {
|
|
253575
|
-
|
|
253576
|
-
|
|
253577
|
-
logs = await fetchFunctionLogs(functionName, filters);
|
|
253578
|
-
} catch (error48) {
|
|
253579
|
-
if (error48 instanceof ApiError && error48.statusCode === 404 && availableFunctionNames.length > 0) {
|
|
253580
|
-
const available = availableFunctionNames.join(", ");
|
|
253581
|
-
throw new InvalidInputError(`Function "${functionName}" was not found in this app`, {
|
|
253582
|
-
hints: [
|
|
253583
|
-
{
|
|
253584
|
-
message: `Available functions in this project: ${available}`
|
|
253585
|
-
},
|
|
253586
|
-
{
|
|
253587
|
-
message: "Make sure the function has been deployed before fetching logs",
|
|
253588
|
-
command: "base44 functions deploy"
|
|
253589
|
-
}
|
|
253590
|
-
]
|
|
253591
|
-
});
|
|
253592
|
-
}
|
|
253593
|
-
throw error48;
|
|
253594
|
-
}
|
|
253595
|
-
const entries = logs.map((entry) => normalizeLogEntry(entry, functionName));
|
|
253565
|
+
const logsPerEnv = await Promise.all(envs.map((e2) => fetchLogsForFunction(functionName, { ...parseFunctionFilters(options), env: e2 }, availableFunctionNames)));
|
|
253566
|
+
const entries = logsPerEnv.flat().map((entry) => normalizeLogEntry(entry, functionName));
|
|
253596
253567
|
allEntries.push(...entries);
|
|
253597
253568
|
}
|
|
253598
|
-
|
|
253599
|
-
|
|
253600
|
-
|
|
253601
|
-
|
|
253602
|
-
|
|
253569
|
+
const order = options.order?.toUpperCase() === "ASC" ? 1 : -1;
|
|
253570
|
+
allEntries.sort((a2, b) => order * a2.time.localeCompare(b.time));
|
|
253571
|
+
const seen = new Set;
|
|
253572
|
+
return allEntries.filter((e2) => {
|
|
253573
|
+
const key = `${e2.time}|${e2.source}|${e2.message}`;
|
|
253574
|
+
if (seen.has(key))
|
|
253575
|
+
return false;
|
|
253576
|
+
seen.add(key);
|
|
253577
|
+
return true;
|
|
253578
|
+
});
|
|
253603
253579
|
}
|
|
253604
253580
|
async function getProjectFunctionNames(projectRoot) {
|
|
253605
253581
|
const { functions } = await readProjectConfig(projectRoot);
|
|
@@ -253638,7 +253614,7 @@ async function logsAction(ctx, options) {
|
|
|
253638
253614
|
return { outroMessage: "Fetched logs", stdout: logsOutput };
|
|
253639
253615
|
}
|
|
253640
253616
|
function getLogsCommand() {
|
|
253641
|
-
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 project functions").option("--since <datetime>", "Show logs from this time (ISO format)", normalizeDatetime).option("--until <datetime>", "Show logs until this time (ISO format)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).action(logsAction);
|
|
253617
|
+
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 project functions").option("--since <datetime>", "Show logs from this time (ISO format)", normalizeDatetime).option("--until <datetime>", "Show logs until this time (ISO format)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option("--env <env>", "Filter by environment").choices(["preview", "prod", "all"]).default("all")).action(logsAction);
|
|
253642
253618
|
}
|
|
253643
253619
|
|
|
253644
253620
|
// src/cli/commands/project/scaffold.ts
|
|
@@ -253695,20 +253671,6 @@ Examples:
|
|
|
253695
253671
|
$ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
|
|
253696
253672
|
}
|
|
253697
253673
|
|
|
253698
|
-
// src/cli/commands/project/visibility.ts
|
|
253699
|
-
async function visibilityAction({ runTask: runTask2 }, level) {
|
|
253700
|
-
const { project: project2 } = await readProjectConfig();
|
|
253701
|
-
await runTask2("Updating local config", () => writeVisibilityToConfig(project2.configPath, level));
|
|
253702
|
-
return {
|
|
253703
|
-
outroMessage: `Visibility set to ${level} in local config. Run \`base44 deploy\` to apply.`
|
|
253704
|
-
};
|
|
253705
|
-
}
|
|
253706
|
-
function getVisibilityCommand() {
|
|
253707
|
-
return new Base44Command("visibility").description("Set app visibility (public, private, or workspace)").addArgument(new Argument("<level>", "Visibility level").choices([
|
|
253708
|
-
...VISIBILITY_LEVELS
|
|
253709
|
-
])).action(visibilityAction);
|
|
253710
|
-
}
|
|
253711
|
-
|
|
253712
253674
|
// src/cli/commands/secrets/delete.ts
|
|
253713
253675
|
async function deleteSecretAction({ runTask: runTask2 }, key) {
|
|
253714
253676
|
await runTask2(`Deleting secret "${key}"`, async () => {
|
|
@@ -257770,7 +257732,6 @@ function createProgram(context) {
|
|
|
257770
257732
|
program2.addCommand(getScaffoldCommand());
|
|
257771
257733
|
program2.addCommand(getDashboardCommand());
|
|
257772
257734
|
program2.addCommand(getDeployCommand2());
|
|
257773
|
-
program2.addCommand(getVisibilityCommand());
|
|
257774
257735
|
program2.addCommand(getLinkCommand());
|
|
257775
257736
|
program2.addCommand(getEjectCommand());
|
|
257776
257737
|
program2.addCommand(getEntitiesPushCommand());
|
|
@@ -262029,4 +261990,4 @@ export {
|
|
|
262029
261990
|
CLIExitError
|
|
262030
261991
|
};
|
|
262031
261992
|
|
|
262032
|
-
//# debugId=
|
|
261993
|
+
//# debugId=62D8AD80DEE0720E64756E2164756E21
|