ac-sanitizer 4.0.8 → 4.0.10
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/CHANGELOG.md +20 -0
- package/index.js +3 -3
- package/package.json +4 -4
- package/test/tests/error.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
<a name="4.0.10"></a>
|
|
2
|
+
|
|
3
|
+
## [4.0.10](https://github.com/mmpro/ac-sanitizer/compare/v4.0.9..v4.0.10) (2024-06-05 14:05:35)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fix
|
|
7
|
+
|
|
8
|
+
* **App:** Check adminLevel and omitFields on nested field definitions | MP | [47ed625b7bc8e903f55f1151052a44b4f5e0fb50](https://github.com/mmpro/ac-sanitizer/commit/47ed625b7bc8e903f55f1151052a44b4f5e0fb50)
|
|
9
|
+
If a nested field has omitFields or adminLevel defined, check that instead of the root values
|
|
10
|
+
Related issues: [undefined/undefined#master](undefined/browse/master)
|
|
11
|
+
<a name="4.0.9"></a>
|
|
12
|
+
|
|
13
|
+
## [4.0.9](https://github.com/mmpro/ac-sanitizer/compare/v4.0.8..v4.0.9) (2024-02-26 07:33:14)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fix
|
|
17
|
+
|
|
18
|
+
* **App:** Package updates | MP | [8e13ef778380b6bb2d1808cf9659668dde5acede](https://github.com/mmpro/ac-sanitizer/commit/8e13ef778380b6bb2d1808cf9659668dde5acede)
|
|
19
|
+
Package updates
|
|
20
|
+
Related issues: [undefined/undefined#master](undefined/browse/master)
|
|
1
21
|
<a name="4.0.8"></a>
|
|
2
22
|
|
|
3
23
|
## [4.0.8](https://github.com/mmpro/ac-sanitizer/compare/v4.0.7..v4.0.8) (2024-01-27 18:18:31)
|
package/index.js
CHANGED
|
@@ -193,7 +193,7 @@ const sanitizer = function() {
|
|
|
193
193
|
})
|
|
194
194
|
}
|
|
195
195
|
else {
|
|
196
|
-
error = { message:
|
|
196
|
+
error = { message: `${fieldName}_adminLevelNotSufficient`, additionalInfo: { adminLevel, required: _.get(field, 'adminLevel') } }
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
else if (_.indexOf(['number', 'integer', 'long', 'short', 'float'], field.type) > -1) {
|
|
@@ -312,8 +312,8 @@ const sanitizer = function() {
|
|
|
312
312
|
params: value,
|
|
313
313
|
fields: _.get(field, 'properties'),
|
|
314
314
|
prefix: fieldName,
|
|
315
|
-
adminLevel,
|
|
316
|
-
omitFields
|
|
315
|
+
adminLevel: _.get(field, 'adminLevel', adminLevel),
|
|
316
|
+
omitFields: _.get(field, 'omitFields', omitFields)
|
|
317
317
|
}
|
|
318
318
|
const check = checkAndSanitizeValues(fieldsToCheck)
|
|
319
319
|
if (_.get(check, 'error')) error = _.get(check, 'error')
|
package/package.json
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"author": "Mark Poepping (https://www.admiralcloud.com)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "admiralcloud/ac-sanitizer",
|
|
7
|
-
"version": "4.0.
|
|
7
|
+
"version": "4.0.10",
|
|
8
8
|
"homepage": "https://www.admiralcloud.com",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"ac-countrylist": "^1.0.11",
|
|
11
11
|
"ac-file-extensions": "^2.0.8",
|
|
12
|
-
"ac-ip": "^3.1.
|
|
12
|
+
"ac-ip": "^3.1.1",
|
|
13
13
|
"chai": "^4.4.1",
|
|
14
14
|
"date-and-time": "^3.1.1",
|
|
15
15
|
"hashids": "^2.3.0",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"ac-semantic-release": "^0.4.2",
|
|
21
21
|
"c8": "^9.1.0",
|
|
22
|
-
"eslint": "^8.
|
|
23
|
-
"mocha": "^10.
|
|
22
|
+
"eslint": "^8.57.0",
|
|
23
|
+
"mocha": "^10.3.0"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"test": "mocha --reporter spec",
|
package/test/tests/error.js
CHANGED
|
@@ -7,7 +7,7 @@ module.exports = {
|
|
|
7
7
|
|
|
8
8
|
const baseTests = [
|
|
9
9
|
{ name: 'Non-existing type', type: 'xyt', value: 'abc', error: 'errorField_typeCheck_xyt_notDefined' },
|
|
10
|
-
{ name: 'AdminLevel not sufficient', type: 'string', value: 'abc', adminLevel: 10, error: '
|
|
10
|
+
{ name: 'AdminLevel not sufficient', type: 'string', value: 'abc', adminLevel: 10, error: 'errorField_adminLevelNotSufficient' },
|
|
11
11
|
{ name: 'AdminLevel not sufficient, omit fields', omitFields: true, type: 'string', value: 'abc', adminLevel: 10, expected: undefined }
|
|
12
12
|
]
|
|
13
13
|
|