@divvydiary/divvydiary-json-schemas 0.7.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/.husky/pre-commit +5 -0
- package/.prettierrc +3 -0
- package/LICENSE +21 -0
- package/index.js +15 -0
- package/package.json +36 -0
- package/src/schemas/article.json +30 -0
- package/src/schemas/defs.json +284 -0
- package/src/schemas/dividend.json +57 -0
- package/src/schemas/split.json +26 -0
- package/src/schemas/symbol.json +68 -0
- package/src/schemas/user.json +60 -0
- package/test.js +20 -0
package/.prettierrc
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 DivvyDiary
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const article = require("./src/schemas/article.json");
|
|
2
|
+
const defs = require("./src/schemas/defs.json");
|
|
3
|
+
const dividend = require("./src/schemas/dividend.json");
|
|
4
|
+
const split = require("./src/schemas/split.json");
|
|
5
|
+
const symbol = require("./src/schemas/symbol.json");
|
|
6
|
+
const user = require("./src/schemas/user.json");
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
article,
|
|
10
|
+
defs,
|
|
11
|
+
dividend,
|
|
12
|
+
split,
|
|
13
|
+
symbol,
|
|
14
|
+
user,
|
|
15
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@divvydiary/divvydiary-json-schemas",
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "JSON Schemas for DivvyDiary.com",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"docs": "jsonschema2md -d src/schemas -o docs -e json -x -",
|
|
8
|
+
"preversion": "npm test",
|
|
9
|
+
"version": "npm run docs && git add -A docs",
|
|
10
|
+
"postversion": "git push && git push --tags",
|
|
11
|
+
"test": "node test.js",
|
|
12
|
+
"prepare": "husky install"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/DivvyDiary/divvydiary-json-schemas.git"
|
|
17
|
+
},
|
|
18
|
+
"author": "DivvyDiary <info@divvydiary.com> (https://divvydiary.com)",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/DivvyDiary/divvydiary-json-schemas/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/DivvyDiary/divvydiary-json-schemas#readme",
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@adobe/jsonschema2md": "^6.1.1",
|
|
29
|
+
"ajv": "^8.6.2",
|
|
30
|
+
"ajv-formats": "^2.1.1",
|
|
31
|
+
"glob": "^7.1.7",
|
|
32
|
+
"husky": "^7.0.1",
|
|
33
|
+
"prettier": "^2.3.2",
|
|
34
|
+
"pretty-quick": "^3.1.1"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://divvydiary.com/schemas/article.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"title": "Article",
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "number",
|
|
8
|
+
"minimum": 1,
|
|
9
|
+
"maximum": 4294967295
|
|
10
|
+
},
|
|
11
|
+
"date": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"format": "date-time"
|
|
14
|
+
},
|
|
15
|
+
"title": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 3,
|
|
18
|
+
"maxLength": 255
|
|
19
|
+
},
|
|
20
|
+
"abstract": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 3
|
|
23
|
+
},
|
|
24
|
+
"fulltext": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 3
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": ["abstract", "date", "fulltext", "id", "title"]
|
|
30
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://divvydiary.com/schemas/defs.json",
|
|
3
|
+
"title": "Definitions",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"currency": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"enum": [
|
|
8
|
+
"AED",
|
|
9
|
+
"AFN",
|
|
10
|
+
"ALL",
|
|
11
|
+
"AMD",
|
|
12
|
+
"ANG",
|
|
13
|
+
"AOA",
|
|
14
|
+
"ARS",
|
|
15
|
+
"AUD",
|
|
16
|
+
"AWG",
|
|
17
|
+
"AZN",
|
|
18
|
+
"BAM",
|
|
19
|
+
"BBD",
|
|
20
|
+
"BDT",
|
|
21
|
+
"BGN",
|
|
22
|
+
"BHD",
|
|
23
|
+
"BIF",
|
|
24
|
+
"BMD",
|
|
25
|
+
"BND",
|
|
26
|
+
"BOB",
|
|
27
|
+
"BRL",
|
|
28
|
+
"BSD",
|
|
29
|
+
"BTC",
|
|
30
|
+
"BTN",
|
|
31
|
+
"BWP",
|
|
32
|
+
"BYN",
|
|
33
|
+
"BYR",
|
|
34
|
+
"BZD",
|
|
35
|
+
"CAD",
|
|
36
|
+
"CDF",
|
|
37
|
+
"CHF",
|
|
38
|
+
"CLF",
|
|
39
|
+
"CLP",
|
|
40
|
+
"CNY",
|
|
41
|
+
"COP",
|
|
42
|
+
"CRC",
|
|
43
|
+
"CUC",
|
|
44
|
+
"CUP",
|
|
45
|
+
"CVE",
|
|
46
|
+
"CZK",
|
|
47
|
+
"DJF",
|
|
48
|
+
"DKK",
|
|
49
|
+
"DOP",
|
|
50
|
+
"DZD",
|
|
51
|
+
"EGP",
|
|
52
|
+
"ERN",
|
|
53
|
+
"ETB",
|
|
54
|
+
"EUR",
|
|
55
|
+
"FJD",
|
|
56
|
+
"FKP",
|
|
57
|
+
"GBP",
|
|
58
|
+
"GEL",
|
|
59
|
+
"GGP",
|
|
60
|
+
"GHS",
|
|
61
|
+
"GIP",
|
|
62
|
+
"GMD",
|
|
63
|
+
"GNF",
|
|
64
|
+
"GTQ",
|
|
65
|
+
"GYD",
|
|
66
|
+
"HKD",
|
|
67
|
+
"HNL",
|
|
68
|
+
"HRK",
|
|
69
|
+
"HTG",
|
|
70
|
+
"HUF",
|
|
71
|
+
"IDR",
|
|
72
|
+
"ILS",
|
|
73
|
+
"IMP",
|
|
74
|
+
"INR",
|
|
75
|
+
"IQD",
|
|
76
|
+
"IRR",
|
|
77
|
+
"ISK",
|
|
78
|
+
"JEP",
|
|
79
|
+
"JMD",
|
|
80
|
+
"JOD",
|
|
81
|
+
"JPY",
|
|
82
|
+
"KES",
|
|
83
|
+
"KGS",
|
|
84
|
+
"KHR",
|
|
85
|
+
"KMF",
|
|
86
|
+
"KPW",
|
|
87
|
+
"KRW",
|
|
88
|
+
"KWD",
|
|
89
|
+
"KYD",
|
|
90
|
+
"KZT",
|
|
91
|
+
"LAK",
|
|
92
|
+
"LBP",
|
|
93
|
+
"LKR",
|
|
94
|
+
"LRD",
|
|
95
|
+
"LSL",
|
|
96
|
+
"LTL",
|
|
97
|
+
"LVL",
|
|
98
|
+
"LYD",
|
|
99
|
+
"MAD",
|
|
100
|
+
"MDL",
|
|
101
|
+
"MGA",
|
|
102
|
+
"MKD",
|
|
103
|
+
"MMK",
|
|
104
|
+
"MNT",
|
|
105
|
+
"MOP",
|
|
106
|
+
"MRO",
|
|
107
|
+
"MUR",
|
|
108
|
+
"MVR",
|
|
109
|
+
"MWK",
|
|
110
|
+
"MXN",
|
|
111
|
+
"MYR",
|
|
112
|
+
"MZN",
|
|
113
|
+
"NAD",
|
|
114
|
+
"NGN",
|
|
115
|
+
"NIO",
|
|
116
|
+
"NOK",
|
|
117
|
+
"NPR",
|
|
118
|
+
"NZD",
|
|
119
|
+
"OMR",
|
|
120
|
+
"PAB",
|
|
121
|
+
"PEN",
|
|
122
|
+
"PGK",
|
|
123
|
+
"PHP",
|
|
124
|
+
"PKR",
|
|
125
|
+
"PLN",
|
|
126
|
+
"PYG",
|
|
127
|
+
"QAR",
|
|
128
|
+
"RON",
|
|
129
|
+
"RSD",
|
|
130
|
+
"RUB",
|
|
131
|
+
"RWF",
|
|
132
|
+
"SAR",
|
|
133
|
+
"SBD",
|
|
134
|
+
"SCR",
|
|
135
|
+
"SDG",
|
|
136
|
+
"SEK",
|
|
137
|
+
"SGD",
|
|
138
|
+
"SHP",
|
|
139
|
+
"SLL",
|
|
140
|
+
"SOS",
|
|
141
|
+
"SRD",
|
|
142
|
+
"STD",
|
|
143
|
+
"SVC",
|
|
144
|
+
"SYP",
|
|
145
|
+
"SZL",
|
|
146
|
+
"THB",
|
|
147
|
+
"TJS",
|
|
148
|
+
"TMT",
|
|
149
|
+
"TND",
|
|
150
|
+
"TOP",
|
|
151
|
+
"TRY",
|
|
152
|
+
"TTD",
|
|
153
|
+
"TWD",
|
|
154
|
+
"TZS",
|
|
155
|
+
"UAH",
|
|
156
|
+
"UGX",
|
|
157
|
+
"USD",
|
|
158
|
+
"UYU",
|
|
159
|
+
"UZS",
|
|
160
|
+
"VEF",
|
|
161
|
+
"VND",
|
|
162
|
+
"VUV",
|
|
163
|
+
"WST",
|
|
164
|
+
"XAF",
|
|
165
|
+
"XAG",
|
|
166
|
+
"XAU",
|
|
167
|
+
"XCD",
|
|
168
|
+
"XDR",
|
|
169
|
+
"XOF",
|
|
170
|
+
"XPF",
|
|
171
|
+
"YER",
|
|
172
|
+
"ZAR",
|
|
173
|
+
"ZMK",
|
|
174
|
+
"ZMW",
|
|
175
|
+
"ZWL"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"exchange": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"enum": [
|
|
181
|
+
"BATS",
|
|
182
|
+
"BVCA",
|
|
183
|
+
"BVMF",
|
|
184
|
+
"DSMD",
|
|
185
|
+
"LTS",
|
|
186
|
+
"MISX",
|
|
187
|
+
"NEOE",
|
|
188
|
+
"OTC",
|
|
189
|
+
"ROCO",
|
|
190
|
+
"XAMS",
|
|
191
|
+
"XASX",
|
|
192
|
+
"XBER",
|
|
193
|
+
"XBKK",
|
|
194
|
+
"XBRN",
|
|
195
|
+
"XBRU",
|
|
196
|
+
"XBUD",
|
|
197
|
+
"XBUE",
|
|
198
|
+
"XCBO",
|
|
199
|
+
"XCNQ",
|
|
200
|
+
"XCSE",
|
|
201
|
+
"XDUB",
|
|
202
|
+
"XDUS",
|
|
203
|
+
"XETR",
|
|
204
|
+
"XFKA",
|
|
205
|
+
"XFRA",
|
|
206
|
+
"XHAM",
|
|
207
|
+
"XHAN",
|
|
208
|
+
"XHEL",
|
|
209
|
+
"XHKG",
|
|
210
|
+
"XICE",
|
|
211
|
+
"XIDX",
|
|
212
|
+
"XIST",
|
|
213
|
+
"XJSE",
|
|
214
|
+
"XKLS",
|
|
215
|
+
"XKRX",
|
|
216
|
+
"XLIS",
|
|
217
|
+
"XLIT",
|
|
218
|
+
"XLON",
|
|
219
|
+
"XMAD",
|
|
220
|
+
"XMEX",
|
|
221
|
+
"XMIL",
|
|
222
|
+
"XMOS",
|
|
223
|
+
"XMUN",
|
|
224
|
+
"XNAS",
|
|
225
|
+
"XNSE",
|
|
226
|
+
"XNXC",
|
|
227
|
+
"XNYS",
|
|
228
|
+
"XNZE",
|
|
229
|
+
"XOSL",
|
|
230
|
+
"XPAR",
|
|
231
|
+
"XPRA",
|
|
232
|
+
"XRIS",
|
|
233
|
+
"XSAP",
|
|
234
|
+
"XSAU",
|
|
235
|
+
"XSES",
|
|
236
|
+
"XSGO",
|
|
237
|
+
"XSHE",
|
|
238
|
+
"XSHG",
|
|
239
|
+
"XSTO",
|
|
240
|
+
"XSTU",
|
|
241
|
+
"XSWX",
|
|
242
|
+
"XTAE",
|
|
243
|
+
"XTAI",
|
|
244
|
+
"XTAL",
|
|
245
|
+
"XTKS",
|
|
246
|
+
"XTSE",
|
|
247
|
+
"XTSX",
|
|
248
|
+
"XWAR",
|
|
249
|
+
"XWBO"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
"isin": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"minLength": 12,
|
|
255
|
+
"maxLength": 12,
|
|
256
|
+
"pattern": "^[A-Z]{2}[A-Z0-9]{9}[0-9]{1}$"
|
|
257
|
+
},
|
|
258
|
+
"password": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"minLength": 6
|
|
261
|
+
},
|
|
262
|
+
"uuid": {
|
|
263
|
+
"type": "string",
|
|
264
|
+
"minLength": 36,
|
|
265
|
+
"maxLength": 36,
|
|
266
|
+
"format": "uuid"
|
|
267
|
+
},
|
|
268
|
+
"wkn": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"minLength": 6,
|
|
271
|
+
"maxLength": 6,
|
|
272
|
+
"pattern": "^[A-Z0-9]{6}$"
|
|
273
|
+
},
|
|
274
|
+
"dividendFrequency": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"enum": ["none", "any", "monthly", "quarterly", "biannually", "annually"]
|
|
277
|
+
},
|
|
278
|
+
"taxRate": {
|
|
279
|
+
"type": "number",
|
|
280
|
+
"minimum": 0,
|
|
281
|
+
"maximum": 1
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://divvydiary.com/schemas/dividend.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"title": "Dividend",
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "integer",
|
|
8
|
+
"minimum": 1
|
|
9
|
+
},
|
|
10
|
+
"exDate": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "date"
|
|
13
|
+
},
|
|
14
|
+
"payDate": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"format": "date"
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"maxLength": 255
|
|
21
|
+
},
|
|
22
|
+
"symbol": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1,
|
|
25
|
+
"maxLength": 6
|
|
26
|
+
},
|
|
27
|
+
"amount": {
|
|
28
|
+
"type": "number",
|
|
29
|
+
"minimum": 0,
|
|
30
|
+
"multipleOf": 0.000001
|
|
31
|
+
},
|
|
32
|
+
"quantity": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"minimum": 0.000001,
|
|
35
|
+
"multipleOf": 0.000001
|
|
36
|
+
},
|
|
37
|
+
"exchangeRate": {
|
|
38
|
+
"type": "number",
|
|
39
|
+
"minimum": 0
|
|
40
|
+
},
|
|
41
|
+
"taxRate": {
|
|
42
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/taxRate"
|
|
43
|
+
},
|
|
44
|
+
"isin": {
|
|
45
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/isin"
|
|
46
|
+
},
|
|
47
|
+
"wkn": {
|
|
48
|
+
"oneOf": [
|
|
49
|
+
{ "$ref": "https://divvydiary.com/schemas/defs.json#/definitions/wkn" },
|
|
50
|
+
{ "type": "null" }
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"currency": {
|
|
54
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/currency"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://divvydiary.com/schemas/split.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"title": "Stock Split",
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "integer",
|
|
8
|
+
"minimum": 1,
|
|
9
|
+
"maximum": 4294967295
|
|
10
|
+
},
|
|
11
|
+
"date": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"format": "date"
|
|
14
|
+
},
|
|
15
|
+
"ratioFrom": {
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"minimum": 1,
|
|
18
|
+
"maximum": 4294967295
|
|
19
|
+
},
|
|
20
|
+
"ratioTo": {
|
|
21
|
+
"type": "integer",
|
|
22
|
+
"minimum": 1,
|
|
23
|
+
"maximum": 4294967295
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://divvydiary.com/schemas/symbol.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"title": "Symbol",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"maxLength": 255
|
|
9
|
+
},
|
|
10
|
+
"symbol": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"maxLength": 6
|
|
14
|
+
},
|
|
15
|
+
"isin": {
|
|
16
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/isin"
|
|
17
|
+
},
|
|
18
|
+
"wkn": {
|
|
19
|
+
"oneOf": [
|
|
20
|
+
{ "$ref": "https://divvydiary.com/schemas/defs.json#/definitions/wkn" },
|
|
21
|
+
{ "type": "null" }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"exchange": {
|
|
25
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/exchange"
|
|
26
|
+
},
|
|
27
|
+
"dividendFrequency": {
|
|
28
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/dividendFrequency"
|
|
29
|
+
},
|
|
30
|
+
"taxRate": {
|
|
31
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/taxRate"
|
|
32
|
+
},
|
|
33
|
+
"payoutRatio": {
|
|
34
|
+
"type": ["number", "null"],
|
|
35
|
+
"minimum": 0,
|
|
36
|
+
"description": "Payout Ratio *aristocrats only*",
|
|
37
|
+
"nullable": true
|
|
38
|
+
},
|
|
39
|
+
"dividendRate": {
|
|
40
|
+
"type": ["number", "null"],
|
|
41
|
+
"minimum": 0,
|
|
42
|
+
"description": "Forward Annual Payout (FWD) *aristocrats only*",
|
|
43
|
+
"nullable": true
|
|
44
|
+
},
|
|
45
|
+
"dividendYield": {
|
|
46
|
+
"type": ["number", "null"],
|
|
47
|
+
"minimum": 0,
|
|
48
|
+
"description": "Forward Dividend Yield (FWD) *aristocrats only*",
|
|
49
|
+
"nullable": true
|
|
50
|
+
},
|
|
51
|
+
"dividendCagr": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"description": "Dividend Growth Rate (CAGR) *aristocrats only*",
|
|
54
|
+
"properties": {
|
|
55
|
+
"1Y": { "type": ["number", "null"] },
|
|
56
|
+
"2Y": { "type": ["number", "null"] },
|
|
57
|
+
"3Y": { "type": ["number", "null"] },
|
|
58
|
+
"4Y": { "type": ["number", "null"] },
|
|
59
|
+
"5Y": { "type": ["number", "null"] },
|
|
60
|
+
"6Y": { "type": ["number", "null"] },
|
|
61
|
+
"7Y": { "type": ["number", "null"] },
|
|
62
|
+
"8Y": { "type": ["number", "null"] },
|
|
63
|
+
"9Y": { "type": ["number", "null"] },
|
|
64
|
+
"10Y": { "type": ["number", "null"] }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://divvydiary.com/schemas/user.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"title": "User",
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "integer",
|
|
8
|
+
"minimum": 1,
|
|
9
|
+
"maximum": 4294967295
|
|
10
|
+
},
|
|
11
|
+
"email": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"format": "email",
|
|
14
|
+
"maxLength": 255
|
|
15
|
+
},
|
|
16
|
+
"forename": { "type": "string", "maxLength": 255 },
|
|
17
|
+
"newsletter": { "type": "boolean" },
|
|
18
|
+
"emailConfirmed": { "type": "boolean" },
|
|
19
|
+
"currency": {
|
|
20
|
+
"oneOf": [
|
|
21
|
+
{
|
|
22
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/currency"
|
|
23
|
+
},
|
|
24
|
+
{ "type": "null" }
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"apiKey": {
|
|
28
|
+
"oneOf": [
|
|
29
|
+
{
|
|
30
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/uuid"
|
|
31
|
+
},
|
|
32
|
+
{ "type": "null" }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"calendarToken": {
|
|
36
|
+
"oneOf": [
|
|
37
|
+
{
|
|
38
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/uuid"
|
|
39
|
+
},
|
|
40
|
+
{ "type": "null" }
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"emailNotificationDaily": { "type": "boolean" },
|
|
44
|
+
"emailNotificationWeekly": { "type": "boolean" },
|
|
45
|
+
"emailNotificationMonthly": { "type": "boolean" },
|
|
46
|
+
"pushNotificationDaily": { "type": "boolean" },
|
|
47
|
+
"shared": { "type": "boolean" },
|
|
48
|
+
"supporter": { "type": "boolean" },
|
|
49
|
+
"stripeId": {
|
|
50
|
+
"type": ["string", "null"],
|
|
51
|
+
"maxLength": 255
|
|
52
|
+
},
|
|
53
|
+
"plan": { "type": "string", "enum": ["free", "monthly", "yearly"] },
|
|
54
|
+
"taxes": { "type": "boolean" },
|
|
55
|
+
"defaultTaxRate": {
|
|
56
|
+
"$ref": "https://divvydiary.com/schemas/defs.json#/definitions/taxRate"
|
|
57
|
+
},
|
|
58
|
+
"taxesType": { "type": "string", "enum": ["homo", "hetero"] }
|
|
59
|
+
}
|
|
60
|
+
}
|
package/test.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Ajv = require("ajv").default;
|
|
2
|
+
const addFormats = require("ajv-formats").default;
|
|
3
|
+
|
|
4
|
+
const glob = require("glob");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
var ajv = new Ajv({
|
|
8
|
+
removeAdditional: true,
|
|
9
|
+
useDefaults: true,
|
|
10
|
+
coerceTypes: true,
|
|
11
|
+
});
|
|
12
|
+
addFormats(ajv);
|
|
13
|
+
|
|
14
|
+
glob.sync(`${__dirname}/src/schemas/*.json`).forEach((file) => {
|
|
15
|
+
console.log(file);
|
|
16
|
+
|
|
17
|
+
const schema = require(path.resolve(file));
|
|
18
|
+
|
|
19
|
+
ajv.compile(schema);
|
|
20
|
+
});
|