@adminforth/bulk-ai-flow 1.5.2 → 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 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
  }
@@ -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
412
  const STUB_MODE = false;
410
- if (typeof (this.options.rateLimits.generateImages) === 'string') {
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.fillFieldsFromImages) === 'string'){
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.fillPlainFields) === 'string'){
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
  }
@@ -461,7 +461,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
461
461
  handler: async ({ body, headers }) => {
462
462
  const selectedIds = body.selectedIds || [];
463
463
  const STUB_MODE = false;
464
- if (typeof(this.options.rateLimits.generateImages) === 'string'){
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },