@base44-preview/cli 0.0.38-pr.376.f197972 → 0.0.38-pr.378.7ddef38
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 +23 -9
- package/dist/cli/index.js.map +6 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -233897,11 +233897,12 @@ var AutomationSchema = exports_external.union([
|
|
|
233897
233897
|
EntityAutomationSchema
|
|
233898
233898
|
]);
|
|
233899
233899
|
var FunctionConfigSchema = exports_external.object({
|
|
233900
|
-
name: FunctionNameSchema,
|
|
233900
|
+
name: FunctionNameSchema.optional(),
|
|
233901
233901
|
entry: exports_external.string().min(1, "Entry point cannot be empty"),
|
|
233902
233902
|
automations: exports_external.array(AutomationSchema).optional()
|
|
233903
233903
|
});
|
|
233904
233904
|
var BackendFunctionSchema = FunctionConfigSchema.extend({
|
|
233905
|
+
name: FunctionNameSchema,
|
|
233905
233906
|
entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
|
|
233906
233907
|
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file")
|
|
233907
233908
|
});
|
|
@@ -233994,9 +233995,10 @@ async function readFunctionConfig(configPath) {
|
|
|
233994
233995
|
}
|
|
233995
233996
|
return result.data;
|
|
233996
233997
|
}
|
|
233997
|
-
async function readFunction(configPath) {
|
|
233998
|
+
async function readFunction(configPath, functionsDir) {
|
|
233998
233999
|
const config5 = await readFunctionConfig(configPath);
|
|
233999
234000
|
const functionDir = dirname4(configPath);
|
|
234001
|
+
const name2 = config5.name ?? relative(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
234000
234002
|
const entryPath = join5(functionDir, config5.entry);
|
|
234001
234003
|
if (!await pathExists(entryPath)) {
|
|
234002
234004
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
@@ -234007,7 +234009,7 @@ async function readFunction(configPath) {
|
|
|
234007
234009
|
cwd: functionDir,
|
|
234008
234010
|
absolute: true
|
|
234009
234011
|
});
|
|
234010
|
-
const functionData = { ...config5, entryPath, filePaths };
|
|
234012
|
+
const functionData = { ...config5, name: name2, entryPath, filePaths };
|
|
234011
234013
|
return functionData;
|
|
234012
234014
|
}
|
|
234013
234015
|
async function readAllFunctions(functionsDir) {
|
|
@@ -234025,7 +234027,7 @@ async function readAllFunctions(functionsDir) {
|
|
|
234025
234027
|
});
|
|
234026
234028
|
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
234027
234029
|
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
|
|
234028
|
-
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
234030
|
+
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath, functionsDir)));
|
|
234029
234031
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
234030
234032
|
const functionDir = dirname4(entryFile);
|
|
234031
234033
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
@@ -234431,8 +234433,12 @@ async function handleUnauthorized(request, _options, response) {
|
|
|
234431
234433
|
return;
|
|
234432
234434
|
}
|
|
234433
234435
|
retriedRequests.add(request);
|
|
234436
|
+
const requestId = request.headers.get("X-Request-ID");
|
|
234434
234437
|
return distribution_default(request.clone(), {
|
|
234435
|
-
headers: {
|
|
234438
|
+
headers: {
|
|
234439
|
+
...requestId && { "X-Request-ID": requestId },
|
|
234440
|
+
Authorization: `Bearer ${newAccessToken}`
|
|
234441
|
+
}
|
|
234436
234442
|
});
|
|
234437
234443
|
}
|
|
234438
234444
|
var base44Client = distribution_default.create({
|
|
@@ -234470,10 +234476,18 @@ function getAppClient() {
|
|
|
234470
234476
|
});
|
|
234471
234477
|
}
|
|
234472
234478
|
// src/core/clients/oauth-client.ts
|
|
234479
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
234473
234480
|
var oauthClient = distribution_default.create({
|
|
234474
234481
|
prefixUrl: getBase44ApiUrl(),
|
|
234475
234482
|
headers: {
|
|
234476
234483
|
"User-Agent": "Base44 CLI"
|
|
234484
|
+
},
|
|
234485
|
+
hooks: {
|
|
234486
|
+
beforeRequest: [
|
|
234487
|
+
(request) => {
|
|
234488
|
+
request.headers.set("X-Request-ID", randomUUID3());
|
|
234489
|
+
}
|
|
234490
|
+
]
|
|
234477
234491
|
}
|
|
234478
234492
|
});
|
|
234479
234493
|
// src/core/auth/api.ts
|
|
@@ -244591,7 +244605,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
244591
244605
|
// src/cli/dev/dev-server/routes/integrations.ts
|
|
244592
244606
|
var import_express3 = __toESM(require_express(), 1);
|
|
244593
244607
|
var import_multer = __toESM(require_multer(), 1);
|
|
244594
|
-
import { randomUUID as
|
|
244608
|
+
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
244595
244609
|
import fs28 from "node:fs";
|
|
244596
244610
|
import path18 from "node:path";
|
|
244597
244611
|
function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
@@ -244602,7 +244616,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
244602
244616
|
destination: mediaFilesDir,
|
|
244603
244617
|
filename: (_req, file2, cb2) => {
|
|
244604
244618
|
const ext = path18.extname(file2.originalname);
|
|
244605
|
-
cb2(null, `${
|
|
244619
|
+
cb2(null, `${randomUUID4()}${ext}`);
|
|
244606
244620
|
}
|
|
244607
244621
|
});
|
|
244608
244622
|
const MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
@@ -244629,7 +244643,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
244629
244643
|
res.status(400).json({ error: "file_uri is required" });
|
|
244630
244644
|
return;
|
|
244631
244645
|
}
|
|
244632
|
-
const signature =
|
|
244646
|
+
const signature = randomUUID4();
|
|
244633
244647
|
const signed_url = `${baseUrl}/media/${file_uri}?signature=${signature}`;
|
|
244634
244648
|
res.json({ signed_url });
|
|
244635
244649
|
});
|
|
@@ -250843,4 +250857,4 @@ export {
|
|
|
250843
250857
|
CLIExitError
|
|
250844
250858
|
};
|
|
250845
250859
|
|
|
250846
|
-
//# debugId=
|
|
250860
|
+
//# debugId=46902C4097C5377B64756E2164756E21
|