@adminforth/upload 2.15.9 → 2.15.11
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/build.log +1 -1
- package/dist/index.js +12 -3
- package/index.ts +13 -3
- package/package.json +3 -3
package/build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -414,14 +414,23 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
414
414
|
server.endpoint({
|
|
415
415
|
method: 'POST',
|
|
416
416
|
path: `/plugin/${this.pluginInstanceId}/get-image-generation-job-status`,
|
|
417
|
-
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers }) {
|
|
417
|
+
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers, response }) {
|
|
418
418
|
const jobId = body.jobId;
|
|
419
419
|
if (!jobId) {
|
|
420
|
-
|
|
420
|
+
response.setStatus(400);
|
|
421
|
+
return { ok: false, error: "Can't find job id" };
|
|
421
422
|
}
|
|
422
423
|
const job = jobs.get(jobId);
|
|
423
424
|
if (!job) {
|
|
424
|
-
|
|
425
|
+
response.setStatus(404);
|
|
426
|
+
return { ok: false, error: "Job not found" };
|
|
427
|
+
}
|
|
428
|
+
if (job.status === 'failed' || job.error) {
|
|
429
|
+
response.setStatus(500);
|
|
430
|
+
return {
|
|
431
|
+
ok: false,
|
|
432
|
+
job,
|
|
433
|
+
};
|
|
425
434
|
}
|
|
426
435
|
return { ok: true, job };
|
|
427
436
|
})
|
package/index.ts
CHANGED
|
@@ -472,14 +472,24 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
472
472
|
server.endpoint({
|
|
473
473
|
method: 'POST',
|
|
474
474
|
path: `/plugin/${this.pluginInstanceId}/get-image-generation-job-status`,
|
|
475
|
-
handler: async ({ body, adminUser, headers }) => {
|
|
475
|
+
handler: async ({ body, adminUser, headers, response }) => {
|
|
476
476
|
const jobId = body.jobId;
|
|
477
477
|
if (!jobId) {
|
|
478
|
-
|
|
478
|
+
response.setStatus(400);
|
|
479
|
+
return { ok: false, error: "Can't find job id" };
|
|
479
480
|
}
|
|
480
481
|
const job = jobs.get(jobId);
|
|
481
482
|
if (!job) {
|
|
482
|
-
|
|
483
|
+
response.setStatus(404);
|
|
484
|
+
return { ok: false, error: "Job not found" };
|
|
485
|
+
}
|
|
486
|
+
if (job.status === 'failed' || job.error) {
|
|
487
|
+
response.setStatus(500);
|
|
488
|
+
|
|
489
|
+
return {
|
|
490
|
+
ok: false,
|
|
491
|
+
job,
|
|
492
|
+
};
|
|
483
493
|
}
|
|
484
494
|
return { ok: true, job };
|
|
485
495
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/upload",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.11",
|
|
4
4
|
"description": "Plugin for uploading files for adminforth",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@aws-sdk/s3-request-presigner": "^3.629.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"adminforth": "^2.
|
|
26
|
+
"adminforth": "^2.70.0"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"adminforth",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/node": "^22.10.7",
|
|
63
|
-
"adminforth": "
|
|
63
|
+
"adminforth": "2.70.0",
|
|
64
64
|
"semantic-release": "^24.2.1",
|
|
65
65
|
"semantic-release-slack-bot": "^4.0.2",
|
|
66
66
|
"typescript": "^5.7.3"
|