@tryghost/admin-api-schema 2.7.0 → 2.10.0

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.
@@ -12,6 +12,8 @@ module.exports = [
12
12
  'posts-edit',
13
13
  'products-add',
14
14
  'products-edit',
15
+ 'tiers-add',
16
+ 'tiers-edit',
15
17
  'snippets-add',
16
18
  'snippets-edit',
17
19
  'tags-add',
@@ -55,6 +55,9 @@
55
55
  "visibility_filter": {
56
56
  "type": ["string", "null"]
57
57
  },
58
+ "tiers": {
59
+ "$ref": "#/definitions/page-products"
60
+ },
58
61
  "meta_title": {
59
62
  "type": ["string", "null"],
60
63
  "maxLength": 300
@@ -168,6 +171,40 @@
168
171
  }
169
172
  }
170
173
  },
174
+ "page-products": {
175
+ "description": "Products of the post",
176
+ "type": "array",
177
+ "items": {
178
+ "anyOf": [
179
+ {
180
+ "type": "object",
181
+ "properties": {
182
+ "id": {
183
+ "type": "string",
184
+ "maxLength": 24
185
+ },
186
+ "name": {
187
+ "type": "string",
188
+ "maxLength": 191
189
+ },
190
+ "slug": {
191
+ "type": ["string", "null"],
192
+ "maxLength": 191
193
+ }
194
+ },
195
+ "anyOf": [
196
+ { "required": ["id"] },
197
+ { "required": ["name"] },
198
+ { "required": ["slug"] }
199
+ ]
200
+ },
201
+ {
202
+ "type": "string",
203
+ "maxLength": 191
204
+ }
205
+ ]
206
+ }
207
+ },
171
208
  "page-authors": {
172
209
  "description": "Authors of the page",
173
210
  "type": "array",
@@ -55,6 +55,9 @@
55
55
  "visibility_filter": {
56
56
  "type": ["string", "null"]
57
57
  },
58
+ "tiers": {
59
+ "$ref": "#/definitions/post-products"
60
+ },
58
61
  "meta_title": {
59
62
  "type": ["string", "null"],
60
63
  "maxLength": 300
@@ -190,6 +193,40 @@
190
193
  }
191
194
  }
192
195
  },
196
+ "post-products": {
197
+ "description": "Products of the post",
198
+ "type": "array",
199
+ "items": {
200
+ "anyOf": [
201
+ {
202
+ "type": "object",
203
+ "properties": {
204
+ "id": {
205
+ "type": "string",
206
+ "maxLength": 24
207
+ },
208
+ "name": {
209
+ "type": "string",
210
+ "maxLength": 191
211
+ },
212
+ "slug": {
213
+ "type": ["string", "null"],
214
+ "maxLength": 191
215
+ }
216
+ },
217
+ "anyOf": [
218
+ { "required": ["id"] },
219
+ { "required": ["name"] },
220
+ { "required": ["slug"] }
221
+ ]
222
+ },
223
+ {
224
+ "type": "string",
225
+ "maxLength": 191
226
+ }
227
+ ]
228
+ }
229
+ },
193
230
  "post-authors": {
194
231
  "description": "Authors of the post",
195
232
  "type": "array",
@@ -17,6 +17,10 @@
17
17
  "type": ["string", "null"],
18
18
  "maxLength": 191
19
19
  },
20
+ "welcome_page_url": {
21
+ "type": ["string", "null"],
22
+ "maxLength": 2000
23
+ },
20
24
  "active": {
21
25
  "type": "boolean"
22
26
  },
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "tiers.add.canary",
4
+ "title": "tiers.add",
5
+ "description": "Schema for tiers.add",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "tiers": {
10
+ "type": "array",
11
+ "minItems": 1,
12
+ "maxItems": 1,
13
+ "items": {
14
+ "type": "object",
15
+ "allOf": [{ "$ref": "tiers.canary#/definitions/tier" }]
16
+ }
17
+ }
18
+ },
19
+ "required": ["tiers"]
20
+ }
21
+
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "tiers.edit.canary",
4
+ "title": "tiers.edit",
5
+ "description": "Schema for tiers.edit",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "tiers": {
10
+ "type": "array",
11
+ "minItems": 1,
12
+ "maxItems": 1,
13
+ "items": {
14
+ "type": "object",
15
+ "allOf": [{ "$ref": "tiers.canary#/definitions/tier" }]
16
+ }
17
+ }
18
+ },
19
+ "required": ["tiers"]
20
+ }
21
+
@@ -0,0 +1,124 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "tiers.canary",
4
+ "title": "tiers",
5
+ "description": "Base Tier definitions",
6
+ "definitions": {
7
+ "tier": {
8
+ "description": "A Ghost Tier",
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "properties": {
12
+ "name": {
13
+ "type": "string",
14
+ "maxLength": 191
15
+ },
16
+ "slug": {
17
+ "type": ["string", "null"],
18
+ "maxLength": 191
19
+ },
20
+ "welcome_page_url": {
21
+ "type": ["string", "null"],
22
+ "maxLength": 2000
23
+ },
24
+ "active": {
25
+ "type": "boolean"
26
+ },
27
+ "updated_at": {
28
+ "strip": true
29
+ },
30
+ "created_at": {
31
+ "strip": true
32
+ },
33
+ "monthly_price": {
34
+ "$ref": "#/definitions/tier-price"
35
+ },
36
+ "yearly_price": {
37
+ "$ref": "#/definitions/tier-price"
38
+ },
39
+ "benefits": {
40
+ "type": ["array", "null"],
41
+ "items": {
42
+ "$ref": "#/definitions/tier-benefit"
43
+ }
44
+ }
45
+ }
46
+ },
47
+ "tier-price": {
48
+ "description": "A Stripe Price associated with a Tier",
49
+ "type": "object",
50
+ "properties": {
51
+ "id": {
52
+ "type": "string",
53
+ "maxLength": 24
54
+ },
55
+ "stripe_product_id": {
56
+ "type": ["string", "null"],
57
+ "maxLength": 255
58
+ },
59
+ "stripe_price_id": {
60
+ "type": "string",
61
+ "maxLength": 255
62
+ },
63
+ "nickname": {
64
+ "type": "string",
65
+ "maxLength": 50
66
+ },
67
+ "currency": {
68
+ "type": "string",
69
+ "maxLength": 3
70
+ },
71
+ "amount": {
72
+ "type": "number"
73
+ },
74
+ "active": {
75
+ "type": "boolean",
76
+ "default": true
77
+ },
78
+ "type": {
79
+ "type": "string",
80
+ "enum": ["recurring", "one_time"]
81
+ },
82
+ "interval": {
83
+ "type": ["string", "null"],
84
+ "enum": ["year", "month", "week", "day"]
85
+ },
86
+ "updated_at": {
87
+ "strip": true
88
+ },
89
+ "created_at": {
90
+ "strip": true
91
+ }
92
+ }
93
+ },
94
+ "tier-benefit": {
95
+ "description": "A Benefit associated with a Tier",
96
+ "type": "object",
97
+ "properties": {
98
+ "id": {
99
+ "type": "string",
100
+ "maxLength": 24
101
+ },
102
+ "name": {
103
+ "type": "string",
104
+ "maxLength": 191
105
+ },
106
+ "slug": {
107
+ "type": "string",
108
+ "maxLength": 191
109
+ },
110
+ "updated_at": {
111
+ "strip": true
112
+ },
113
+ "created_at": {
114
+ "strip": true
115
+ }
116
+ },
117
+ "anyOf": [
118
+ { "required": ["id"] },
119
+ { "required": ["name"] },
120
+ { "required": ["slug"] }
121
+ ]
122
+ }
123
+ }
124
+ }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@tryghost/admin-api-schema",
3
- "version": "2.7.0",
3
+ "version": "2.10.0",
4
4
  "repository": "https://github.com/TryGhost/SDK/tree/master/packages/admin-api-schema",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
7
7
  "main": "lib/index.js",
8
8
  "scripts": {
9
9
  "dev": "echo \"Implement me!\"",
10
- "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'",
10
+ "test": "NODE_ENV=testing c8 --all --reporter text --reporter cobertura mocha './test/**/*.test.js'",
11
11
  "lint": "eslint . --ext .js --cache",
12
12
  "posttest": "yarn lint"
13
13
  },
@@ -27,5 +27,5 @@
27
27
  "@tryghost/errors": "^0.2.10",
28
28
  "lodash": "^4.17.11"
29
29
  },
30
- "gitHead": "fd46ea76699b5f56bb9cd5dfbcd2095ff3863387"
30
+ "gitHead": "f8813610f5ba4eed4fbcbd025eddf78795fd8aab"
31
31
  }