@divvydiary/divvydiary-json-schemas 0.10.0 → 0.10.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/package.json +3 -4
- package/src/schemas/defs.json +4 -3
- package/src/schemas/user.json +2 -1
- package/test.js +9 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@divvydiary/divvydiary-json-schemas",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "JSON Schemas for DivvyDiary.com",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@adobe/jsonschema2md": "^6.1.1",
|
|
29
|
-
"ajv": "^
|
|
30
|
-
"ajv-
|
|
31
|
-
"ajv-keywords": "^5.1.0",
|
|
29
|
+
"ajv": "^6.12.6",
|
|
30
|
+
"ajv-keywords": "^3.5.2",
|
|
32
31
|
"glob": "^7.1.7",
|
|
33
32
|
"husky": "^7.0.1",
|
|
34
33
|
"prettier": "^2.3.2",
|
package/src/schemas/defs.json
CHANGED
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
"type": "string",
|
|
257
257
|
"minLength": 12,
|
|
258
258
|
"maxLength": 12,
|
|
259
|
-
"pattern": "^[A-
|
|
259
|
+
"pattern": "^[A-Za-z]{2}[A-Za-z0-9]{9}[0-9]{1}$",
|
|
260
260
|
"example": "US88160R1014",
|
|
261
261
|
"transform": ["trim", "toUpperCase"]
|
|
262
262
|
},
|
|
@@ -274,8 +274,9 @@
|
|
|
274
274
|
"type": "string",
|
|
275
275
|
"minLength": 6,
|
|
276
276
|
"maxLength": 6,
|
|
277
|
-
"pattern": "^[A-
|
|
278
|
-
"example": "A1CX3T"
|
|
277
|
+
"pattern": "^[A-Za-z0-9]{6}$",
|
|
278
|
+
"example": "A1CX3T",
|
|
279
|
+
"transform": ["trim", "toUpperCase"]
|
|
279
280
|
},
|
|
280
281
|
"dividendFrequency": {
|
|
281
282
|
"type": "string",
|
package/src/schemas/user.json
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"defaultTaxRate": {
|
|
57
57
|
"$ref": "https://divvydiary.com/schemas/defs.json#/properties/taxRate"
|
|
58
58
|
},
|
|
59
|
-
"taxesType": { "type": "string", "enum": ["homo", "hetero"] }
|
|
59
|
+
"taxesType": { "type": "string", "enum": ["homo", "hetero"] },
|
|
60
|
+
"askReview": { "type": "boolean" }
|
|
60
61
|
}
|
|
61
62
|
}
|
package/test.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
const Ajv = require("ajv")
|
|
2
|
-
const addFormats = require("ajv-formats").default;
|
|
1
|
+
const Ajv = require("ajv");
|
|
3
2
|
|
|
4
3
|
const glob = require("glob");
|
|
5
4
|
const path = require("path");
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
removeAdditional: true,
|
|
9
|
-
useDefaults: true,
|
|
6
|
+
const ajv = new Ajv({
|
|
10
7
|
coerceTypes: true,
|
|
8
|
+
useDefaults: true,
|
|
9
|
+
removeAdditional: true,
|
|
10
|
+
// Explicitly set allErrors to `false`.
|
|
11
|
+
// When set to `true`, a DoS attack is possible.
|
|
12
|
+
allErrors: false,
|
|
13
|
+
nullable: true,
|
|
11
14
|
});
|
|
12
15
|
|
|
13
|
-
require("ajv-keywords")(ajv);
|
|
16
|
+
require("ajv-keywords")(ajv, "transform");
|
|
14
17
|
|
|
15
18
|
ajv.addKeyword("example");
|
|
16
19
|
|
|
17
|
-
addFormats(ajv);
|
|
18
|
-
|
|
19
20
|
glob.sync(`${__dirname}/src/schemas/*.json`).forEach((file) => {
|
|
20
21
|
console.log(file);
|
|
21
22
|
|