@tryghost/admin-api-schema 3.2.0 → 3.2.3
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/lib/schemas/labels.json +0 -15
- package/lib/schemas/members-edit.json +0 -30
- package/lib/schemas/members-upload.json +0 -3
- package/lib/schemas/members.json +0 -33
- package/lib/schemas/pages.json +0 -57
- package/lib/schemas/posts.json +0 -72
- package/lib/schemas/products.json +0 -18
- package/lib/schemas/snippets.json +0 -15
- package/lib/schemas/tags.json +0 -24
- package/lib/schemas/tiers.json +1 -25
- package/lib/schemas/webhooks-edit.json +0 -30
- package/lib/schemas/webhooks.json +0 -27
- package/lib/utils/json-schema.js +0 -2
- package/package.json +3 -2
- package/lib/utils/strip-keyword.js +0 -22
package/lib/schemas/labels.json
CHANGED
|
@@ -17,21 +17,6 @@
|
|
|
17
17
|
"slug": {
|
|
18
18
|
"type": ["string", "null"],
|
|
19
19
|
"maxLength": 191
|
|
20
|
-
},
|
|
21
|
-
"id": {
|
|
22
|
-
"strip": true
|
|
23
|
-
},
|
|
24
|
-
"created_at": {
|
|
25
|
-
"strip": true
|
|
26
|
-
},
|
|
27
|
-
"created_by": {
|
|
28
|
-
"strip": true
|
|
29
|
-
},
|
|
30
|
-
"updated_at": {
|
|
31
|
-
"strip": true
|
|
32
|
-
},
|
|
33
|
-
"updated_by": {
|
|
34
|
-
"strip": true
|
|
35
20
|
}
|
|
36
21
|
}
|
|
37
22
|
}
|
|
@@ -25,9 +25,6 @@
|
|
|
25
25
|
"maxLength": 191,
|
|
26
26
|
"pattern": "^([^,]|$)"
|
|
27
27
|
},
|
|
28
|
-
"avatar_image": {
|
|
29
|
-
"strip": true
|
|
30
|
-
},
|
|
31
28
|
"note": {
|
|
32
29
|
"type": "string",
|
|
33
30
|
"minLength": 0,
|
|
@@ -42,9 +39,6 @@
|
|
|
42
39
|
"comped": {
|
|
43
40
|
"type": "boolean"
|
|
44
41
|
},
|
|
45
|
-
"id": {
|
|
46
|
-
"strip": true
|
|
47
|
-
},
|
|
48
42
|
"products": {
|
|
49
43
|
"$ref": "members#/definitions/member-products"
|
|
50
44
|
},
|
|
@@ -56,30 +50,6 @@
|
|
|
56
50
|
},
|
|
57
51
|
"labels": {
|
|
58
52
|
"$ref": "members#/definitions/member-labels"
|
|
59
|
-
},
|
|
60
|
-
"email_count": {
|
|
61
|
-
"strip": true
|
|
62
|
-
},
|
|
63
|
-
"email_opened_count": {
|
|
64
|
-
"strip": true
|
|
65
|
-
},
|
|
66
|
-
"email_open_rate": {
|
|
67
|
-
"strip": true
|
|
68
|
-
},
|
|
69
|
-
"email_recipients": {
|
|
70
|
-
"strip": true
|
|
71
|
-
},
|
|
72
|
-
"created_at": {
|
|
73
|
-
"strip": true
|
|
74
|
-
},
|
|
75
|
-
"created_by": {
|
|
76
|
-
"strip": true
|
|
77
|
-
},
|
|
78
|
-
"updated_at": {
|
|
79
|
-
"strip": true
|
|
80
|
-
},
|
|
81
|
-
"updated_by": {
|
|
82
|
-
"strip": true
|
|
83
53
|
}
|
|
84
54
|
}
|
|
85
55
|
}
|
package/lib/schemas/members.json
CHANGED
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
"maxLength": 191,
|
|
20
20
|
"pattern": "^([^,]|$)"
|
|
21
21
|
},
|
|
22
|
-
"avatar_image": {
|
|
23
|
-
"strip": true
|
|
24
|
-
},
|
|
25
22
|
"note": {
|
|
26
23
|
"type": "string",
|
|
27
24
|
"minLength": 0,
|
|
@@ -39,9 +36,6 @@
|
|
|
39
36
|
"subscriptions": {
|
|
40
37
|
"type": "array"
|
|
41
38
|
},
|
|
42
|
-
"id": {
|
|
43
|
-
"strip": true
|
|
44
|
-
},
|
|
45
39
|
"labels": {
|
|
46
40
|
"$ref": "#/definitions/member-labels"
|
|
47
41
|
},
|
|
@@ -53,30 +47,6 @@
|
|
|
53
47
|
},
|
|
54
48
|
"newsletters": {
|
|
55
49
|
"$ref": "#/definitions/member-newsletters"
|
|
56
|
-
},
|
|
57
|
-
"email_count": {
|
|
58
|
-
"strip": true
|
|
59
|
-
},
|
|
60
|
-
"email_opened_count": {
|
|
61
|
-
"strip": true
|
|
62
|
-
},
|
|
63
|
-
"email_open_rate": {
|
|
64
|
-
"strip": true
|
|
65
|
-
},
|
|
66
|
-
"email_recipients": {
|
|
67
|
-
"strip": true
|
|
68
|
-
},
|
|
69
|
-
"created_at": {
|
|
70
|
-
"strip": true
|
|
71
|
-
},
|
|
72
|
-
"created_by": {
|
|
73
|
-
"strip": true
|
|
74
|
-
},
|
|
75
|
-
"updated_at": {
|
|
76
|
-
"strip": true
|
|
77
|
-
},
|
|
78
|
-
"updated_by": {
|
|
79
|
-
"strip": true
|
|
80
50
|
}
|
|
81
51
|
}
|
|
82
52
|
},
|
|
@@ -162,9 +132,6 @@
|
|
|
162
132
|
"slug": {
|
|
163
133
|
"type": ["string", "null"],
|
|
164
134
|
"maxLength": 191
|
|
165
|
-
},
|
|
166
|
-
"members": {
|
|
167
|
-
"strip": true
|
|
168
135
|
}
|
|
169
136
|
},
|
|
170
137
|
"anyOf": [
|
package/lib/schemas/pages.json
CHANGED
|
@@ -126,48 +126,6 @@
|
|
|
126
126
|
},
|
|
127
127
|
"tags": {
|
|
128
128
|
"$ref": "#/definitions/page-tags"
|
|
129
|
-
},
|
|
130
|
-
"id": {
|
|
131
|
-
"strip": true
|
|
132
|
-
},
|
|
133
|
-
"page": {
|
|
134
|
-
"strip": true
|
|
135
|
-
},
|
|
136
|
-
"author": {
|
|
137
|
-
"strip": true
|
|
138
|
-
},
|
|
139
|
-
"author_id": {
|
|
140
|
-
"strip": true
|
|
141
|
-
},
|
|
142
|
-
"created_at": {
|
|
143
|
-
"strip": true
|
|
144
|
-
},
|
|
145
|
-
"created_by": {
|
|
146
|
-
"strip": true
|
|
147
|
-
},
|
|
148
|
-
"updated_by": {
|
|
149
|
-
"strip": true
|
|
150
|
-
},
|
|
151
|
-
"published_by": {
|
|
152
|
-
"strip": true
|
|
153
|
-
},
|
|
154
|
-
"url": {
|
|
155
|
-
"strip": true
|
|
156
|
-
},
|
|
157
|
-
"primary_tag": {
|
|
158
|
-
"strip": true
|
|
159
|
-
},
|
|
160
|
-
"primary_author": {
|
|
161
|
-
"strip": true
|
|
162
|
-
},
|
|
163
|
-
"excerpt": {
|
|
164
|
-
"strip": true
|
|
165
|
-
},
|
|
166
|
-
"plaintext": {
|
|
167
|
-
"strip": true
|
|
168
|
-
},
|
|
169
|
-
"frontmatter": {
|
|
170
|
-
"strip": true
|
|
171
129
|
}
|
|
172
130
|
}
|
|
173
131
|
},
|
|
@@ -224,12 +182,6 @@
|
|
|
224
182
|
"email": {
|
|
225
183
|
"type": "string",
|
|
226
184
|
"maxLength": 191
|
|
227
|
-
},
|
|
228
|
-
"roles": {
|
|
229
|
-
"strip": true
|
|
230
|
-
},
|
|
231
|
-
"permissions": {
|
|
232
|
-
"strip": true
|
|
233
185
|
}
|
|
234
186
|
},
|
|
235
187
|
"anyOf": [
|
|
@@ -264,15 +216,6 @@
|
|
|
264
216
|
"slug": {
|
|
265
217
|
"type": ["string", "null"],
|
|
266
218
|
"maxLength": 191
|
|
267
|
-
},
|
|
268
|
-
"parent": {
|
|
269
|
-
"strip": true
|
|
270
|
-
},
|
|
271
|
-
"parent_id": {
|
|
272
|
-
"strip": true
|
|
273
|
-
},
|
|
274
|
-
"pages": {
|
|
275
|
-
"strip": true
|
|
276
219
|
}
|
|
277
220
|
},
|
|
278
221
|
"anyOf": [
|
package/lib/schemas/posts.json
CHANGED
|
@@ -133,63 +133,6 @@
|
|
|
133
133
|
},
|
|
134
134
|
"tags": {
|
|
135
135
|
"$ref": "#/definitions/post-tags"
|
|
136
|
-
},
|
|
137
|
-
"id": {
|
|
138
|
-
"strip": true
|
|
139
|
-
},
|
|
140
|
-
"uuid": {
|
|
141
|
-
"strip": true
|
|
142
|
-
},
|
|
143
|
-
"comment_id": {
|
|
144
|
-
"strip": true
|
|
145
|
-
},
|
|
146
|
-
"author": {
|
|
147
|
-
"strip": true
|
|
148
|
-
},
|
|
149
|
-
"author_id": {
|
|
150
|
-
"strip": true
|
|
151
|
-
},
|
|
152
|
-
"page": {
|
|
153
|
-
"strip": true
|
|
154
|
-
},
|
|
155
|
-
"created_at": {
|
|
156
|
-
"strip": true
|
|
157
|
-
},
|
|
158
|
-
"created_by": {
|
|
159
|
-
"strip": true
|
|
160
|
-
},
|
|
161
|
-
"updated_by": {
|
|
162
|
-
"strip": true
|
|
163
|
-
},
|
|
164
|
-
"published_by": {
|
|
165
|
-
"strip": true
|
|
166
|
-
},
|
|
167
|
-
"url": {
|
|
168
|
-
"strip": true
|
|
169
|
-
},
|
|
170
|
-
"primary_tag": {
|
|
171
|
-
"strip": true
|
|
172
|
-
},
|
|
173
|
-
"primary_author": {
|
|
174
|
-
"strip": true
|
|
175
|
-
},
|
|
176
|
-
"excerpt": {
|
|
177
|
-
"strip": true
|
|
178
|
-
},
|
|
179
|
-
"plaintext": {
|
|
180
|
-
"strip": true
|
|
181
|
-
},
|
|
182
|
-
"email": {
|
|
183
|
-
"strip": true
|
|
184
|
-
},
|
|
185
|
-
"email_segment": {
|
|
186
|
-
"strip": true
|
|
187
|
-
},
|
|
188
|
-
"frontmatter": {
|
|
189
|
-
"strip": true
|
|
190
|
-
},
|
|
191
|
-
"newsletter": {
|
|
192
|
-
"strip": true
|
|
193
136
|
}
|
|
194
137
|
}
|
|
195
138
|
},
|
|
@@ -246,12 +189,6 @@
|
|
|
246
189
|
"email": {
|
|
247
190
|
"type": "string",
|
|
248
191
|
"maxLength": 191
|
|
249
|
-
},
|
|
250
|
-
"roles": {
|
|
251
|
-
"strip": true
|
|
252
|
-
},
|
|
253
|
-
"permissions": {
|
|
254
|
-
"strip": true
|
|
255
192
|
}
|
|
256
193
|
},
|
|
257
194
|
"anyOf": [
|
|
@@ -286,15 +223,6 @@
|
|
|
286
223
|
"slug": {
|
|
287
224
|
"type": ["string", "null"],
|
|
288
225
|
"maxLength": 191
|
|
289
|
-
},
|
|
290
|
-
"parent": {
|
|
291
|
-
"strip": true
|
|
292
|
-
},
|
|
293
|
-
"parent_id": {
|
|
294
|
-
"strip": true
|
|
295
|
-
},
|
|
296
|
-
"posts": {
|
|
297
|
-
"strip": true
|
|
298
226
|
}
|
|
299
227
|
},
|
|
300
228
|
"anyOf": [
|
|
@@ -24,12 +24,6 @@
|
|
|
24
24
|
"active": {
|
|
25
25
|
"type": "boolean"
|
|
26
26
|
},
|
|
27
|
-
"updated_at": {
|
|
28
|
-
"strip": true
|
|
29
|
-
},
|
|
30
|
-
"created_at": {
|
|
31
|
-
"strip": true
|
|
32
|
-
},
|
|
33
27
|
"stripe_prices": {
|
|
34
28
|
"type": ["array", "null"],
|
|
35
29
|
"items": {
|
|
@@ -82,12 +76,6 @@
|
|
|
82
76
|
"interval": {
|
|
83
77
|
"type": ["string", "null"],
|
|
84
78
|
"enum": ["year", "month", "week", "day"]
|
|
85
|
-
},
|
|
86
|
-
"updated_at": {
|
|
87
|
-
"strip": true
|
|
88
|
-
},
|
|
89
|
-
"created_at": {
|
|
90
|
-
"strip": true
|
|
91
79
|
}
|
|
92
80
|
}
|
|
93
81
|
},
|
|
@@ -106,12 +94,6 @@
|
|
|
106
94
|
"slug": {
|
|
107
95
|
"type": "string",
|
|
108
96
|
"maxLength": 191
|
|
109
|
-
},
|
|
110
|
-
"updated_at": {
|
|
111
|
-
"strip": true
|
|
112
|
-
},
|
|
113
|
-
"created_at": {
|
|
114
|
-
"strip": true
|
|
115
97
|
}
|
|
116
98
|
},
|
|
117
99
|
"anyOf": [
|
|
@@ -17,21 +17,6 @@
|
|
|
17
17
|
"type": "string",
|
|
18
18
|
"format": "json-string",
|
|
19
19
|
"maxLength": 1000000000
|
|
20
|
-
},
|
|
21
|
-
"id": {
|
|
22
|
-
"strip": true
|
|
23
|
-
},
|
|
24
|
-
"created_at": {
|
|
25
|
-
"strip": true
|
|
26
|
-
},
|
|
27
|
-
"created_by": {
|
|
28
|
-
"strip": true
|
|
29
|
-
},
|
|
30
|
-
"updated_at": {
|
|
31
|
-
"strip": true
|
|
32
|
-
},
|
|
33
|
-
"updated_by": {
|
|
34
|
-
"strip": true
|
|
35
20
|
}
|
|
36
21
|
}
|
|
37
22
|
}
|
package/lib/schemas/tags.json
CHANGED
|
@@ -81,30 +81,6 @@
|
|
|
81
81
|
"accent_color": {
|
|
82
82
|
"type": ["string", "null"],
|
|
83
83
|
"maxLength": 50
|
|
84
|
-
},
|
|
85
|
-
"id": {
|
|
86
|
-
"strip": true
|
|
87
|
-
},
|
|
88
|
-
"parent": {
|
|
89
|
-
"strip": true
|
|
90
|
-
},
|
|
91
|
-
"parent_id": {
|
|
92
|
-
"strip": true
|
|
93
|
-
},
|
|
94
|
-
"created_at": {
|
|
95
|
-
"strip": true
|
|
96
|
-
},
|
|
97
|
-
"created_by": {
|
|
98
|
-
"strip": true
|
|
99
|
-
},
|
|
100
|
-
"updated_at": {
|
|
101
|
-
"strip": true
|
|
102
|
-
},
|
|
103
|
-
"updated_by": {
|
|
104
|
-
"strip": true
|
|
105
|
-
},
|
|
106
|
-
"url": {
|
|
107
|
-
"strip": true
|
|
108
84
|
}
|
|
109
85
|
}
|
|
110
86
|
}
|
package/lib/schemas/tiers.json
CHANGED
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
"type": "object",
|
|
10
10
|
"additionalProperties": false,
|
|
11
11
|
"properties": {
|
|
12
|
-
"id": {
|
|
13
|
-
"strip": true
|
|
14
|
-
},
|
|
15
12
|
"name": {
|
|
16
13
|
"type": "string",
|
|
17
14
|
"maxLength": 191
|
|
@@ -35,15 +32,6 @@
|
|
|
35
32
|
"type": "string",
|
|
36
33
|
"enum": ["public", "none"]
|
|
37
34
|
},
|
|
38
|
-
"updated_at": {
|
|
39
|
-
"strip": true
|
|
40
|
-
},
|
|
41
|
-
"type": {
|
|
42
|
-
"strip": true
|
|
43
|
-
},
|
|
44
|
-
"created_at": {
|
|
45
|
-
"strip": true
|
|
46
|
-
},
|
|
47
35
|
"monthly_price": {
|
|
48
36
|
"$ref": "#/definitions/tier-price"
|
|
49
37
|
},
|
|
@@ -60,7 +48,7 @@
|
|
|
60
48
|
},
|
|
61
49
|
"tier-price": {
|
|
62
50
|
"description": "A Stripe Price associated with a Tier",
|
|
63
|
-
"type": "object",
|
|
51
|
+
"type": ["object", "null"],
|
|
64
52
|
"properties": {
|
|
65
53
|
"id": {
|
|
66
54
|
"type": "string",
|
|
@@ -96,12 +84,6 @@
|
|
|
96
84
|
"interval": {
|
|
97
85
|
"type": ["string", "null"],
|
|
98
86
|
"enum": ["year", "month", "week", "day"]
|
|
99
|
-
},
|
|
100
|
-
"updated_at": {
|
|
101
|
-
"strip": true
|
|
102
|
-
},
|
|
103
|
-
"created_at": {
|
|
104
|
-
"strip": true
|
|
105
87
|
}
|
|
106
88
|
}
|
|
107
89
|
},
|
|
@@ -120,12 +102,6 @@
|
|
|
120
102
|
"slug": {
|
|
121
103
|
"type": "string",
|
|
122
104
|
"maxLength": 191
|
|
123
|
-
},
|
|
124
|
-
"updated_at": {
|
|
125
|
-
"strip": true
|
|
126
|
-
},
|
|
127
|
-
"created_at": {
|
|
128
|
-
"strip": true
|
|
129
105
|
}
|
|
130
106
|
},
|
|
131
107
|
"anyOf": [
|
|
@@ -35,36 +35,6 @@
|
|
|
35
35
|
"api_version": {
|
|
36
36
|
"type": ["string", "null"],
|
|
37
37
|
"maxLength": 50
|
|
38
|
-
},
|
|
39
|
-
"integration_id": {
|
|
40
|
-
"strip": true
|
|
41
|
-
},
|
|
42
|
-
"id": {
|
|
43
|
-
"strip": true
|
|
44
|
-
},
|
|
45
|
-
"status": {
|
|
46
|
-
"strip": true
|
|
47
|
-
},
|
|
48
|
-
"last_triggered_at": {
|
|
49
|
-
"strip": true
|
|
50
|
-
},
|
|
51
|
-
"last_triggered_status": {
|
|
52
|
-
"strip": true
|
|
53
|
-
},
|
|
54
|
-
"last_triggered_error": {
|
|
55
|
-
"strip": true
|
|
56
|
-
},
|
|
57
|
-
"created_at": {
|
|
58
|
-
"strip": true
|
|
59
|
-
},
|
|
60
|
-
"created_by": {
|
|
61
|
-
"strip": true
|
|
62
|
-
},
|
|
63
|
-
"updated_at": {
|
|
64
|
-
"strip": true
|
|
65
|
-
},
|
|
66
|
-
"updated_by": {
|
|
67
|
-
"strip": true
|
|
68
38
|
}
|
|
69
39
|
}
|
|
70
40
|
}
|
|
@@ -33,33 +33,6 @@
|
|
|
33
33
|
"integration_id": {
|
|
34
34
|
"type": ["string", "null"],
|
|
35
35
|
"maxLength": 24
|
|
36
|
-
},
|
|
37
|
-
"id": {
|
|
38
|
-
"strip": true
|
|
39
|
-
},
|
|
40
|
-
"status": {
|
|
41
|
-
"strip": true
|
|
42
|
-
},
|
|
43
|
-
"last_triggered_at": {
|
|
44
|
-
"strip": true
|
|
45
|
-
},
|
|
46
|
-
"last_triggered_status": {
|
|
47
|
-
"strip": true
|
|
48
|
-
},
|
|
49
|
-
"last_triggered_error": {
|
|
50
|
-
"strip": true
|
|
51
|
-
},
|
|
52
|
-
"created_at": {
|
|
53
|
-
"strip": true
|
|
54
|
-
},
|
|
55
|
-
"created_by": {
|
|
56
|
-
"strip": true
|
|
57
|
-
},
|
|
58
|
-
"updated_at": {
|
|
59
|
-
"strip": true
|
|
60
|
-
},
|
|
61
|
-
"updated_by": {
|
|
62
|
-
"strip": true
|
|
63
36
|
}
|
|
64
37
|
}
|
|
65
38
|
}
|
package/lib/utils/json-schema.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const _ = require('lodash');
|
|
2
2
|
const Ajv = require('ajv');
|
|
3
|
-
const stripKeyword = require('./strip-keyword');
|
|
4
3
|
const isLowercaseKeyword = require('./is-lowercase-keyword');
|
|
5
4
|
const errors = require('@tryghost/errors');
|
|
6
5
|
|
|
@@ -20,7 +19,6 @@ const ajv = new Ajv({
|
|
|
20
19
|
}
|
|
21
20
|
});
|
|
22
21
|
|
|
23
|
-
stripKeyword(ajv);
|
|
24
22
|
isLowercaseKeyword(ajv);
|
|
25
23
|
|
|
26
24
|
const getValidation = (schema, def) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/admin-api-schema",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"repository": "https://github.com/TryGhost/SDK/tree/master/packages/admin-api-schema",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tryghost/errors": "^1.0.0",
|
|
29
|
+
"ajv": "^6.12.6",
|
|
29
30
|
"lodash": "^4.17.11"
|
|
30
31
|
},
|
|
31
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "e12b766a0086be38f83451d42518533a8ffd2c3e"
|
|
32
33
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 'strip' keyword is introduced into schemas for following behavior:
|
|
3
|
-
* properties that are 'known' but should not be present in the model
|
|
4
|
-
* should be stripped from data and not throw validation errors.
|
|
5
|
-
*
|
|
6
|
-
* An example of such property is `tag.parent` which we want to ignore
|
|
7
|
-
* but not necessarily throw a validation error as it was present in
|
|
8
|
-
* responses in previous versions of API
|
|
9
|
-
*/
|
|
10
|
-
module.exports = function defFunc(ajv) {
|
|
11
|
-
defFunc.definition = {
|
|
12
|
-
errors: false,
|
|
13
|
-
modifying: true,
|
|
14
|
-
valid: true,
|
|
15
|
-
validate: function (schema, data, parentSchema, dataPath, parentData, propName) {
|
|
16
|
-
delete parentData[propName];
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
ajv.addKeyword('strip', defFunc.definition);
|
|
21
|
-
return ajv;
|
|
22
|
-
};
|