@base44-preview/cli 0.2.3-pr.679.8a2af8d → 0.2.3-pr.682.9217d4b
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 +14 -7
- package/dist/cli/index.js.map +3 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -265008,6 +265008,7 @@ function getSecretsCommand() {
|
|
|
265008
265008
|
var import_ms2 = __toESM(require_ms(), 1);
|
|
265009
265009
|
|
|
265010
265010
|
// src/core/session-import/api.ts
|
|
265011
|
+
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
265011
265012
|
var MAX_SESSION_BYTES = 25 * 1024 * 1024;
|
|
265012
265013
|
var SessionImportResponseSchema = object({
|
|
265013
265014
|
branch_id: string2(),
|
|
@@ -265037,6 +265038,9 @@ function messageFor(status, code, details, viaToken) {
|
|
|
265037
265038
|
if (code === "branch_exists" && details?.branch_url) {
|
|
265038
265039
|
return `Base Code already has ${details.branch_name ?? "a branch for this session"}. Open it: ${new URL(details.branch_url, getBase44ApiUrl())}`;
|
|
265039
265040
|
}
|
|
265041
|
+
if (code === "idempotency_key_in_use") {
|
|
265042
|
+
return "An import of this session is still running. Wait a moment and try again.";
|
|
265043
|
+
}
|
|
265040
265044
|
if (code === "repository_not_connected") {
|
|
265041
265045
|
return "Connect this app to its GitHub repository in Base Code first.";
|
|
265042
265046
|
}
|
|
@@ -265084,17 +265088,20 @@ async function uploadSession(appId, content, { token, sourceBranch } = {}) {
|
|
|
265084
265088
|
form.append("file", new Blob([content]), "session.jsonl");
|
|
265085
265089
|
if (sourceBranch)
|
|
265086
265090
|
form.append("source_branch", sourceBranch);
|
|
265091
|
+
const idempotencyKey = randomUUID5();
|
|
265087
265092
|
let response;
|
|
265088
265093
|
try {
|
|
265089
265094
|
response = token ? await distribution_default.post(new URL(`/api/apps/${appId}/imported/session-imports`, getBase44ApiUrl()), {
|
|
265090
265095
|
body: form,
|
|
265091
265096
|
headers: {
|
|
265092
265097
|
Authorization: `Bearer ${token}`,
|
|
265093
|
-
"User-Agent": "Base44 CLI"
|
|
265098
|
+
"User-Agent": "Base44 CLI",
|
|
265099
|
+
"Idempotency-Key": idempotencyKey
|
|
265094
265100
|
},
|
|
265095
265101
|
timeout: 180000
|
|
265096
265102
|
}) : await getAppClient().post("imported/session-imports", {
|
|
265097
265103
|
body: form,
|
|
265104
|
+
headers: { "Idempotency-Key": idempotencyKey },
|
|
265098
265105
|
timeout: 180000
|
|
265099
265106
|
});
|
|
265100
265107
|
} catch (error) {
|
|
@@ -265916,11 +265923,11 @@ function getVersionCreateCommand() {
|
|
|
265916
265923
|
}
|
|
265917
265924
|
|
|
265918
265925
|
// src/cli/commands/versions/deploy.ts
|
|
265919
|
-
import { randomUUID as
|
|
265926
|
+
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
265920
265927
|
async function deployAction3({ runTask, jsonMode }, versionId, options) {
|
|
265921
265928
|
const environment = options.target ?? DEFAULT_ENVIRONMENT;
|
|
265922
265929
|
const result = await runTask(`Pointing ${environment} at ${versionId}...`, async () => await setEnvironmentVersion(environment, versionId, {
|
|
265923
|
-
idempotencyKey:
|
|
265930
|
+
idempotencyKey: randomUUID6()
|
|
265924
265931
|
}), {
|
|
265925
265932
|
successMessage: "Environment updated",
|
|
265926
265933
|
errorMessage: "Could not update the environment"
|
|
@@ -268185,7 +268192,7 @@ async function createEntityRoutes(db, logger, broadcast) {
|
|
|
268185
268192
|
// src/cli/dev/dev-server/routes/integrations.ts
|
|
268186
268193
|
var import_express5 = __toESM(require_express(), 1);
|
|
268187
268194
|
var import_multer = __toESM(require_multer(), 1);
|
|
268188
|
-
import { createHash as createHash4, randomUUID as
|
|
268195
|
+
import { createHash as createHash4, randomUUID as randomUUID7 } from "node:crypto";
|
|
268189
268196
|
import fs28 from "node:fs";
|
|
268190
268197
|
import path24 from "node:path";
|
|
268191
268198
|
function createFileToken(fileUri) {
|
|
@@ -268202,14 +268209,14 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
268202
268209
|
destination: mediaFilesDir,
|
|
268203
268210
|
filename: (_req, file, cb) => {
|
|
268204
268211
|
const ext = path24.extname(file.originalname);
|
|
268205
|
-
cb(null, `${
|
|
268212
|
+
cb(null, `${randomUUID7()}${ext}`);
|
|
268206
268213
|
}
|
|
268207
268214
|
});
|
|
268208
268215
|
const privateStorage = import_multer.default.diskStorage({
|
|
268209
268216
|
destination: privateFilesDir,
|
|
268210
268217
|
filename: (_req, file, cb) => {
|
|
268211
268218
|
const ext = path24.extname(file.originalname);
|
|
268212
|
-
cb(null, `${
|
|
268219
|
+
cb(null, `${randomUUID7()}${ext}`);
|
|
268213
268220
|
}
|
|
268214
268221
|
});
|
|
268215
268222
|
const upload = import_multer.default({ storage, limits: { fileSize: MAX_FILE_SIZE } });
|
|
@@ -274642,4 +274649,4 @@ export {
|
|
|
274642
274649
|
runCLI
|
|
274643
274650
|
};
|
|
274644
274651
|
|
|
274645
|
-
//# debugId=
|
|
274652
|
+
//# debugId=B7C73C57031F826A64756E2164756E21
|