@adminforth/bulk-ai-flow 1.5.1 → 1.5.3
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.js +8 -5
- package/index.ts +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -197,8 +197,9 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
197
197
|
method: 'POST',
|
|
198
198
|
path: `/plugin/${this.pluginInstanceId}/analyze`,
|
|
199
199
|
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers }) {
|
|
200
|
+
var _b;
|
|
200
201
|
const selectedIds = body.selectedIds || [];
|
|
201
|
-
if (typeof (this.options.rateLimits.fillFieldsFromImages) === 'string') {
|
|
202
|
+
if (typeof ((_b = this.options.rateLimits) === null || _b === void 0 ? void 0 : _b.fillFieldsFromImages) === 'string') {
|
|
202
203
|
if (this.checkRateLimit("fillFieldsFromImages", this.options.rateLimits.fillFieldsFromImages, headers)) {
|
|
203
204
|
return { error: "Rate limit exceeded" };
|
|
204
205
|
}
|
|
@@ -239,8 +240,9 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
239
240
|
method: 'POST',
|
|
240
241
|
path: `/plugin/${this.pluginInstanceId}/analyze_no_images`,
|
|
241
242
|
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers }) {
|
|
243
|
+
var _b;
|
|
242
244
|
const selectedIds = body.selectedIds || [];
|
|
243
|
-
if (typeof (this.options.rateLimits.fillPlainFields) === 'string') {
|
|
245
|
+
if (typeof ((_b = this.options.rateLimits) === null || _b === void 0 ? void 0 : _b.fillPlainFields) === 'string') {
|
|
244
246
|
if (this.checkRateLimit("fillPlainFields", this.options.rateLimits.fillPlainFields, headers)) {
|
|
245
247
|
return { error: "Rate limit exceeded" };
|
|
246
248
|
}
|
|
@@ -367,7 +369,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
367
369
|
return { error: "Rate limit exceeded" };
|
|
368
370
|
}
|
|
369
371
|
const start = +new Date();
|
|
370
|
-
const STUB_MODE =
|
|
372
|
+
const STUB_MODE = false;
|
|
371
373
|
const record = yield this.adminforth.resource(this.resourceConfig.resourceId).get([Filters.EQ((_b = this.resourceConfig.columns.find(c => c.primaryKey)) === null || _b === void 0 ? void 0 : _b.name, Id)]);
|
|
372
374
|
let attachmentFiles;
|
|
373
375
|
if (!this.options.attachFiles) {
|
|
@@ -405,9 +407,10 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
405
407
|
method: 'POST',
|
|
406
408
|
path: `/plugin/${this.pluginInstanceId}/initial_image_generate`,
|
|
407
409
|
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, headers }) {
|
|
410
|
+
var _b;
|
|
408
411
|
const selectedIds = body.selectedIds || [];
|
|
409
|
-
const STUB_MODE =
|
|
410
|
-
if (typeof (this.options.rateLimits.generateImages) === 'string') {
|
|
412
|
+
const STUB_MODE = false;
|
|
413
|
+
if (typeof ((_b = this.options.rateLimits) === null || _b === void 0 ? void 0 : _b.generateImages) === 'string') {
|
|
411
414
|
if (this.checkRateLimit("generateImages", this.options.rateLimits.generateImages, headers)) {
|
|
412
415
|
return { error: "Rate limit exceeded" };
|
|
413
416
|
}
|
package/index.ts
CHANGED
|
@@ -225,7 +225,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
225
225
|
path: `/plugin/${this.pluginInstanceId}/analyze`,
|
|
226
226
|
handler: async ({ body, adminUser, headers }) => {
|
|
227
227
|
const selectedIds = body.selectedIds || [];
|
|
228
|
-
if (typeof(this.options.rateLimits
|
|
228
|
+
if (typeof(this.options.rateLimits?.fillFieldsFromImages) === 'string'){
|
|
229
229
|
if (this.checkRateLimit("fillFieldsFromImages" ,this.options.rateLimits.fillFieldsFromImages, headers)) {
|
|
230
230
|
return { error: "Rate limit exceeded" };
|
|
231
231
|
}
|
|
@@ -275,7 +275,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
275
275
|
path: `/plugin/${this.pluginInstanceId}/analyze_no_images`,
|
|
276
276
|
handler: async ({ body, adminUser, headers }) => {
|
|
277
277
|
const selectedIds = body.selectedIds || [];
|
|
278
|
-
if (typeof(this.options.rateLimits
|
|
278
|
+
if (typeof(this.options.rateLimits?.fillPlainFields) === 'string'){
|
|
279
279
|
if (this.checkRateLimit("fillPlainFields", this.options.rateLimits.fillPlainFields, headers)) {
|
|
280
280
|
return { error: "Rate limit exceeded" };
|
|
281
281
|
}
|
|
@@ -415,7 +415,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
415
415
|
return { error: "Rate limit exceeded" };
|
|
416
416
|
}
|
|
417
417
|
const start = +new Date();
|
|
418
|
-
const STUB_MODE =
|
|
418
|
+
const STUB_MODE = false;
|
|
419
419
|
const record = await this.adminforth.resource(this.resourceConfig.resourceId).get([Filters.EQ(this.resourceConfig.columns.find(c => c.primaryKey)?.name, Id)]);
|
|
420
420
|
let attachmentFiles
|
|
421
421
|
if(!this.options.attachFiles){
|
|
@@ -460,8 +460,8 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
460
460
|
path: `/plugin/${this.pluginInstanceId}/initial_image_generate`,
|
|
461
461
|
handler: async ({ body, headers }) => {
|
|
462
462
|
const selectedIds = body.selectedIds || [];
|
|
463
|
-
const STUB_MODE =
|
|
464
|
-
if (typeof(this.options.rateLimits
|
|
463
|
+
const STUB_MODE = false;
|
|
464
|
+
if (typeof(this.options.rateLimits?.generateImages) === 'string'){
|
|
465
465
|
if (this.checkRateLimit("generateImages", this.options.rateLimits.generateImages, headers)) {
|
|
466
466
|
return { error: "Rate limit exceeded" };
|
|
467
467
|
}
|