@adminforth/bulk-ai-flow 2.0.0 → 2.0.1

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
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { AdminForthFilterOperators, AdminForthPlugin, Filters, interpretResource, ActionCheckSource, AllowedActionsEnum } from "adminforth";
11
- import { suggestIfTypo, filtersTools } from "adminforth";
11
+ import { suggestIfTypo, filtersTools, rejectApiRawFilters } from "adminforth";
12
12
  import Handlebars from 'handlebars';
13
13
  import { RateLimiter } from "adminforth";
14
14
  import { randomUUID } from "crypto";
@@ -1371,6 +1371,10 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
1371
1371
  if (listAllowed !== true) {
1372
1372
  return { ok: false, error: typeof listAllowed === 'string' ? listAllowed : 'You are not allowed to list records in this resource' };
1373
1373
  }
1374
+ const rawFilterError = rejectApiRawFilters(body.filters);
1375
+ if (rawFilterError) {
1376
+ return rawFilterError;
1377
+ }
1374
1378
  for (const hook of ((_c = (_b = resource.hooks) === null || _b === void 0 ? void 0 : _b.list) === null || _c === void 0 ? void 0 : _c.beforeDatasourceRequest) || []) {
1375
1379
  const filterTools = filtersTools.get(body);
1376
1380
  body.filtersTools = filterTools;
package/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AdminForthFilterOperators, AdminForthPlugin, Filters, interpretResource, ActionCheckSource, AllowedActionsEnum } from "adminforth";
2
2
  import type { IAdminForth, IHttpServer, AdminForthComponentDeclaration, AdminForthResource, AdminUser } from "adminforth";
3
- import { suggestIfTypo, filtersTools } from "adminforth";
3
+ import { suggestIfTypo, filtersTools, rejectApiRawFilters } from "adminforth";
4
4
  import type { PluginOptions } from './types.js';
5
5
  import Handlebars from 'handlebars';
6
6
  import { RateLimiter } from "adminforth";
@@ -1453,6 +1453,10 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
1453
1453
  if (listAllowed !== true) {
1454
1454
  return { ok: false, error: typeof listAllowed === 'string' ? listAllowed : 'You are not allowed to list records in this resource' };
1455
1455
  }
1456
+ const rawFilterError = rejectApiRawFilters(body.filters);
1457
+ if (rawFilterError) {
1458
+ return rawFilterError;
1459
+ }
1456
1460
 
1457
1461
  for (const hook of resource.hooks?.list?.beforeDatasourceRequest || []) {
1458
1462
  const filterTools = filtersTools.get(body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },