@tryghost/admin-api-schema 2.9.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',
@@ -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.9.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": "87eafa37844bc1f4fc7a139b876aed73e175a4bb"
30
+ "gitHead": "f8813610f5ba4eed4fbcbd025eddf78795fd8aab"
31
31
  }