@exulu/backend 5.8.1 → 5.8.2
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/index.cjs +9 -2
- package/dist/index.js +9 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -40292,6 +40292,10 @@ ${style.markdown}` : params.prompt;
|
|
|
40292
40292
|
return "";
|
|
40293
40293
|
};
|
|
40294
40294
|
const UUID_RE3 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
40295
|
+
const stripBucketPrefix = (key, cfg) => {
|
|
40296
|
+
const bucket = cfg.fileUploads?.s3Bucket;
|
|
40297
|
+
return bucket ? key.replace(`${bucket}/`, "") : key;
|
|
40298
|
+
};
|
|
40295
40299
|
const getGuestAgentById = async (id) => {
|
|
40296
40300
|
if (!UUID_RE3.test(id)) return void 0;
|
|
40297
40301
|
const { db: db2 } = await postgresClient();
|
|
@@ -40336,7 +40340,10 @@ ${style.markdown}` : params.prompt;
|
|
|
40336
40340
|
}
|
|
40337
40341
|
let bytes;
|
|
40338
40342
|
try {
|
|
40339
|
-
bytes = await getS3ObjectBytes(
|
|
40343
|
+
bytes = await getS3ObjectBytes(
|
|
40344
|
+
stripBucketPrefix(row.guest_cover_image, config),
|
|
40345
|
+
config
|
|
40346
|
+
);
|
|
40340
40347
|
} catch (e) {
|
|
40341
40348
|
if (e?.name === "NoSuchKey" || e?.name === "NotFound" || e?.$metadata?.httpStatusCode === 404) {
|
|
40342
40349
|
res.status(404).json({ detail: "Cover not found." });
|
|
@@ -40369,7 +40376,7 @@ ${style.markdown}` : params.prompt;
|
|
|
40369
40376
|
}
|
|
40370
40377
|
let bytes;
|
|
40371
40378
|
try {
|
|
40372
|
-
bytes = await getS3ObjectBytes(key, config);
|
|
40379
|
+
bytes = await getS3ObjectBytes(stripBucketPrefix(key, config), config);
|
|
40373
40380
|
} catch (e) {
|
|
40374
40381
|
if (e?.name === "NoSuchKey" || e?.name === "NotFound" || e?.$metadata?.httpStatusCode === 404) {
|
|
40375
40382
|
res.status(404).json({ detail: "Animation not found." });
|
package/dist/index.js
CHANGED
|
@@ -21432,6 +21432,10 @@ ${style.markdown}` : params.prompt;
|
|
|
21432
21432
|
return "";
|
|
21433
21433
|
};
|
|
21434
21434
|
const UUID_RE3 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
21435
|
+
const stripBucketPrefix = (key, cfg) => {
|
|
21436
|
+
const bucket = cfg.fileUploads?.s3Bucket;
|
|
21437
|
+
return bucket ? key.replace(`${bucket}/`, "") : key;
|
|
21438
|
+
};
|
|
21435
21439
|
const getGuestAgentById = async (id) => {
|
|
21436
21440
|
if (!UUID_RE3.test(id)) return void 0;
|
|
21437
21441
|
const { db } = await postgresClient();
|
|
@@ -21476,7 +21480,10 @@ ${style.markdown}` : params.prompt;
|
|
|
21476
21480
|
}
|
|
21477
21481
|
let bytes;
|
|
21478
21482
|
try {
|
|
21479
|
-
bytes = await getS3ObjectBytes(
|
|
21483
|
+
bytes = await getS3ObjectBytes(
|
|
21484
|
+
stripBucketPrefix(row.guest_cover_image, config),
|
|
21485
|
+
config
|
|
21486
|
+
);
|
|
21480
21487
|
} catch (e) {
|
|
21481
21488
|
if (e?.name === "NoSuchKey" || e?.name === "NotFound" || e?.$metadata?.httpStatusCode === 404) {
|
|
21482
21489
|
res.status(404).json({ detail: "Cover not found." });
|
|
@@ -21509,7 +21516,7 @@ ${style.markdown}` : params.prompt;
|
|
|
21509
21516
|
}
|
|
21510
21517
|
let bytes;
|
|
21511
21518
|
try {
|
|
21512
|
-
bytes = await getS3ObjectBytes(key, config);
|
|
21519
|
+
bytes = await getS3ObjectBytes(stripBucketPrefix(key, config), config);
|
|
21513
21520
|
} catch (e) {
|
|
21514
21521
|
if (e?.name === "NoSuchKey" || e?.name === "NotFound" || e?.$metadata?.httpStatusCode === 404) {
|
|
21515
21522
|
res.status(404).json({ detail: "Animation not found." });
|