@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 +1 -1
- package/dist/index.js +5 -1
- package/index.ts +5 -1
- package/package.json +1 -1
package/build.log
CHANGED
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);
|