@adminforth/i18n 3.1.3 → 3.1.4

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 CHANGED
@@ -20,5 +20,5 @@ custom/package.json
20
20
  custom/pnpm-lock.yaml
21
21
  custom/tsconfig.json
22
22
 
23
- sent 45,470 bytes received 305 bytes 91,550.00 bytes/sec
23
+ sent 45,486 bytes received 305 bytes 91,582.00 bytes/sec
24
24
  total size is 44,318 speedup is 0.97
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum } from "adminforth";
10
+ import { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum, rejectApiRawFilters } from "adminforth";
11
11
  import { I18nBase, getCountryCodeFromLangCode, getPrimaryLanguageCode, requiresSlavicPlurals, SLAVIC_PLURAL_EXAMPLES, SLAVIC_PLURAL_FORMS, SLAVIC_PLURAL_FORMS_HINT, SOURCE_LANGUAGE } from './base.js';
12
12
  import { z } from "zod";
13
13
  import iso6391 from 'iso-639-1';
@@ -949,6 +949,10 @@ export default class I18nPlugin extends I18nBase {
949
949
  handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser, headers, query, cookies, requestUrl, response }) {
950
950
  var _b, _c;
951
951
  const resource = this.resourceConfig;
952
+ const rawFilterError = rejectApiRawFilters(body.filters);
953
+ if (rawFilterError) {
954
+ return rawFilterError;
955
+ }
952
956
  for (const hook of ((_c = (_b = resource.hooks) === null || _b === void 0 ? void 0 : _b.list) === null || _c === void 0 ? void 0 : _c.beforeDatasourceRequest) || []) {
953
957
  const filterTools = filtersTools.get(body);
954
958
  body.filtersTools = filterTools;
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import AdminForth, { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum } from "adminforth";
1
+ import AdminForth, { Filters, suggestIfTypo, AdminForthDataTypes, RAMLock, filtersTools, AdminForthFilterOperators, interpretResource, ActionCheckSource, AllowedActionsEnum, rejectApiRawFilters } from "adminforth";
2
2
  import type { IAdminForth, IHttpServer, AdminForthComponentDeclaration, AdminForthResourceColumn, AdminForthResource, BeforeLoginConfirmationFunction, AdminForthConfigMenuItem, AdminUser } from "adminforth";
3
3
  import type { PluginOptions, SupportedLanguage } from './types.js';
4
4
  import { I18nBase, getCountryCodeFromLangCode, getPrimaryLanguageCode, requiresSlavicPlurals, SLAVIC_PLURAL_EXAMPLES, SLAVIC_PLURAL_FORMS, SLAVIC_PLURAL_FORMS_HINT, SOURCE_LANGUAGE } from './base.js';
@@ -1178,6 +1178,10 @@ export default class I18nPlugin extends I18nBase<PluginOptions> {
1178
1178
  request_schema: getFilteredIdsBodySchema,
1179
1179
  handler: async ({ body, adminUser, headers, query, cookies, requestUrl, response }) => {
1180
1180
  const resource = this.resourceConfig;
1181
+ const rawFilterError = rejectApiRawFilters(body.filters);
1182
+ if (rawFilterError) {
1183
+ return rawFilterError;
1184
+ }
1181
1185
 
1182
1186
  for (const hook of resource.hooks?.list?.beforeDatasourceRequest || []) {
1183
1187
  const filterTools = filtersTools.get(body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",