@base44-preview/cli 0.0.41-pr.380.395c56d → 0.0.41-pr.380.4e690c1
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 +18 -15
- package/dist/cli/index.js.map +5 -5
- package/package.json +3 -2
package/dist/cli/index.js
CHANGED
|
@@ -161575,7 +161575,7 @@ var require_is_promise = __commonJS((exports, module) => {
|
|
|
161575
161575
|
}
|
|
161576
161576
|
});
|
|
161577
161577
|
|
|
161578
|
-
// ../../node_modules/
|
|
161578
|
+
// ../../node_modules/path-to-regexp/dist/index.js
|
|
161579
161579
|
var require_dist = __commonJS((exports) => {
|
|
161580
161580
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
161581
161581
|
exports.PathError = exports.TokenData = undefined;
|
|
@@ -238460,6 +238460,8 @@ var package_default = {
|
|
|
238460
238460
|
start: "./bin/run.js",
|
|
238461
238461
|
clean: "rm -rf dist && mkdir -p dist",
|
|
238462
238462
|
test: "vitest run",
|
|
238463
|
+
"test:npm": "CLI_TEST_RUNNER=npm vitest run",
|
|
238464
|
+
"test:binary": "CLI_TEST_RUNNER=binary vitest run",
|
|
238463
238465
|
"test:watch": "vitest",
|
|
238464
238466
|
lint: "cd ../.. && bun run lint",
|
|
238465
238467
|
"lint:fix": "cd ../.. && bun run lint:fix",
|
|
@@ -238508,7 +238510,6 @@ var package_default = {
|
|
|
238508
238510
|
json5: "^2.2.3",
|
|
238509
238511
|
ky: "^1.14.2",
|
|
238510
238512
|
lodash: "^4.17.23",
|
|
238511
|
-
msw: "^2.12.10",
|
|
238512
238513
|
multer: "^2.0.0",
|
|
238513
238514
|
nanoid: "^5.1.6",
|
|
238514
238515
|
open: "^11.0.0",
|
|
@@ -247965,7 +247966,16 @@ async function getAllFunctionNames() {
|
|
|
247965
247966
|
const { functions } = await readProjectConfig();
|
|
247966
247967
|
return functions.map((fn) => fn.name);
|
|
247967
247968
|
}
|
|
247969
|
+
function validateLimit(limit) {
|
|
247970
|
+
if (limit === undefined)
|
|
247971
|
+
return;
|
|
247972
|
+
const n2 = Number.parseInt(limit, 10);
|
|
247973
|
+
if (Number.isNaN(n2) || n2 < 1 || n2 > 1000) {
|
|
247974
|
+
throw new InvalidInputError(`Invalid limit: "${limit}". Must be a number between 1 and 1000.`);
|
|
247975
|
+
}
|
|
247976
|
+
}
|
|
247968
247977
|
async function logsAction(options) {
|
|
247978
|
+
validateLimit(options.limit);
|
|
247969
247979
|
const specifiedFunctions = parseFunctionNames(options.function);
|
|
247970
247980
|
const allProjectFunctions = await getAllFunctionNames();
|
|
247971
247981
|
const functionNames = specifiedFunctions.length > 0 ? specifiedFunctions : allProjectFunctions;
|
|
@@ -247982,13 +247992,7 @@ async function logsAction(options) {
|
|
|
247982
247992
|
return { outroMessage: "Fetched logs", stdout: logsOutput };
|
|
247983
247993
|
}
|
|
247984
247994
|
function getLogsCommand(context) {
|
|
247985
|
-
return new Command("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)", (
|
|
247986
|
-
const n2 = Number.parseInt(v, 10);
|
|
247987
|
-
if (Number.isNaN(n2) || n2 < 1 || n2 > 1000) {
|
|
247988
|
-
throw new InvalidInputError(`Invalid limit: "${v}". Must be a number between 1 and 1000.`);
|
|
247989
|
-
}
|
|
247990
|
-
return v;
|
|
247991
|
-
}).addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).action(async (options) => {
|
|
247995
|
+
return new Command("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(async (options) => {
|
|
247992
247996
|
await runCommand(() => logsAction(options), { requireAuth: true }, context);
|
|
247993
247997
|
});
|
|
247994
247998
|
}
|
|
@@ -248054,11 +248058,9 @@ function parseEntries(entries) {
|
|
|
248054
248058
|
}
|
|
248055
248059
|
return secrets;
|
|
248056
248060
|
}
|
|
248057
|
-
function validateInput(
|
|
248058
|
-
const entries = command.args;
|
|
248059
|
-
const { envFile } = command.opts();
|
|
248061
|
+
function validateInput(entries, options) {
|
|
248060
248062
|
const hasEntries = entries.length > 0;
|
|
248061
|
-
const hasEnvFile = Boolean(envFile);
|
|
248063
|
+
const hasEnvFile = Boolean(options.envFile);
|
|
248062
248064
|
if (!hasEntries && !hasEnvFile) {
|
|
248063
248065
|
throw new InvalidInputError("Provide KEY=VALUE pairs or use --env-file. Example: base44 secrets set KEY1=VALUE1 KEY2=VALUE2");
|
|
248064
248066
|
}
|
|
@@ -248067,6 +248069,7 @@ function validateInput(command) {
|
|
|
248067
248069
|
}
|
|
248068
248070
|
}
|
|
248069
248071
|
async function setSecretsAction(entries, options) {
|
|
248072
|
+
validateInput(entries, options);
|
|
248070
248073
|
let secrets;
|
|
248071
248074
|
if (options.envFile) {
|
|
248072
248075
|
secrets = await parseEnvFile(resolve3(options.envFile));
|
|
@@ -248089,7 +248092,7 @@ async function setSecretsAction(entries, options) {
|
|
|
248089
248092
|
};
|
|
248090
248093
|
}
|
|
248091
248094
|
function getSecretsSetCommand(context) {
|
|
248092
|
-
return new Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").
|
|
248095
|
+
return new Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").action(async (entries, options) => {
|
|
248093
248096
|
await runCommand(() => setSecretsAction(entries, options), { requireAuth: true }, context);
|
|
248094
248097
|
});
|
|
248095
248098
|
}
|
|
@@ -255242,4 +255245,4 @@ export {
|
|
|
255242
255245
|
CLIExitError
|
|
255243
255246
|
};
|
|
255244
255247
|
|
|
255245
|
-
//# debugId=
|
|
255248
|
+
//# debugId=12B152DDECFC5AB864756E2164756E21
|