@divvydiary/divvydiary-json-schemas 0.10.4 → 0.11.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/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  const article = require("./src/schemas/article.json");
2
- const defs = require("./src/schemas/defs.json");
2
+ const defs = require("./src/schemas/_defs.json");
3
3
  const depot = require("./src/schemas/depot.json");
4
4
  const dividend = require("./src/schemas/dividend.json");
5
+ const portfolio = require("./src/schemas/portfolio.json");
5
6
  const split = require("./src/schemas/split.json");
6
7
  const symbol = require("./src/schemas/symbol.json");
7
8
  const user = require("./src/schemas/user.json");
@@ -11,6 +12,7 @@ module.exports = {
11
12
  defs,
12
13
  depot,
13
14
  dividend,
15
+ portfolio,
14
16
  split,
15
17
  symbol,
16
18
  user,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divvydiary/divvydiary-json-schemas",
3
- "version": "0.10.4",
3
+ "version": "0.11.1",
4
4
  "description": "JSON Schemas for DivvyDiary.com",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -324,6 +324,11 @@
324
324
  "type": "number",
325
325
  "minimum": 0,
326
326
  "example": 1.1604
327
+ },
328
+ "unsignedInt": {
329
+ "type": "integer",
330
+ "minimum": 1,
331
+ "maximum": 4294967295
327
332
  }
328
333
  }
329
334
  }
@@ -4,9 +4,7 @@
4
4
  "title": "Article",
5
5
  "properties": {
6
6
  "id": {
7
- "type": "number",
8
- "minimum": 1,
9
- "maximum": 4294967295
7
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
10
8
  },
11
9
  "date": {
12
10
  "type": "string",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$id": "https://divvydiary.com/schemas/depot.json",
3
- "title": "Definitions",
3
+ "title": "Depot",
4
4
  "type": "array",
5
5
  "items": {
6
6
  "type": "object",
@@ -4,8 +4,7 @@
4
4
  "title": "Dividend",
5
5
  "properties": {
6
6
  "id": {
7
- "type": "integer",
8
- "minimum": 1
7
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
9
8
  },
10
9
  "exDate": {
11
10
  "type": "string",
@@ -57,6 +56,9 @@
57
56
  },
58
57
  "currency": {
59
58
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/currency"
59
+ },
60
+ "portfolioId": {
61
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
60
62
  }
61
63
  }
62
64
  }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$id": "https://divvydiary.com/schemas/portfolio.json",
3
+ "title": "Portfolio",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
8
+ },
9
+ "shared": { "type": "boolean" },
10
+ "notifications": { "type": "boolean" },
11
+ "name": { "type": "string", "minLength": 1, "maxLength": 50 },
12
+ "currency": {
13
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/currency"
14
+ },
15
+ "securities": {
16
+ "$ref": "https://divvydiary.com/schemas/depot.json"
17
+ },
18
+ "dividendsHistory": {
19
+ "type": "object",
20
+ "properties": {
21
+ "dividends": {
22
+ "type": "array",
23
+ "items": {
24
+ "$ref": "https://divvydiary.com/schemas/dividend.json"
25
+ }
26
+ },
27
+ "stubs": {
28
+ "type": "array",
29
+ "items": {
30
+ "$ref": "https://divvydiary.com/schemas/dividend.json"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
@@ -4,23 +4,17 @@
4
4
  "title": "Stock Split",
5
5
  "properties": {
6
6
  "id": {
7
- "type": "integer",
8
- "minimum": 1,
9
- "maximum": 4294967295
7
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
10
8
  },
11
9
  "date": {
12
10
  "type": "string",
13
11
  "format": "date"
14
12
  },
15
13
  "ratioFrom": {
16
- "type": "integer",
17
- "minimum": 1,
18
- "maximum": 4294967295
14
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
19
15
  },
20
16
  "ratioTo": {
21
- "type": "integer",
22
- "minimum": 1,
23
- "maximum": 4294967295
17
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
24
18
  }
25
19
  }
26
20
  }
@@ -4,9 +4,7 @@
4
4
  "title": "User",
5
5
  "properties": {
6
6
  "id": {
7
- "type": "integer",
8
- "minimum": 1,
9
- "maximum": 4294967295
7
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
10
8
  },
11
9
  "email": {
12
10
  "type": "string",
@@ -57,6 +55,20 @@
57
55
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/taxRate"
58
56
  },
59
57
  "taxesType": { "type": "string", "enum": ["homo", "hetero"] },
60
- "askReview": { "type": "boolean" }
58
+ "askReview": { "type": "boolean" },
59
+ "selectedPortfolio": {
60
+ "oneOf": [
61
+ {
62
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/unsignedInt"
63
+ },
64
+ { "type": "null" }
65
+ ]
66
+ },
67
+ "portfolios": {
68
+ "type": "array",
69
+ "items": {
70
+ "$ref": "https://divvydiary.com/schemas/portfolio.json"
71
+ }
72
+ }
61
73
  }
62
74
  }