@morehao/trendradar-contract 0.0.0-stage → 0.3.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.
- package/CHANGELOG.md +59 -0
- package/README.md +96 -2
- package/fixtures/digest-degraded.json +43 -0
- package/fixtures/digest-empty-lang.json +43 -0
- package/fixtures/digest-missing-optional.json +41 -0
- package/fixtures/digest-normal.json +97 -0
- package/fixtures/release-degraded.json +30 -0
- package/fixtures/release-empty.json +10 -0
- package/fixtures/release-normal.json +53 -0
- package/gen/ts/index.d.ts +216 -0
- package/gen/ts/index.js +1644 -0
- package/package.json +45 -4
- package/schema/api.v2.yaml +145 -0
- package/schema/digest.v2.json +25 -0
- package/schema/errors.v2.json +341 -0
- package/schema/ipc.v2.json +406 -0
- package/schema/model.v2.json +40 -0
- package/schema/releases.v2.json +278 -0
- package/schema/version-info.v2.json +17 -0
- package/version-map.json +57 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/releases.v2.json",
|
|
4
|
+
"title": "trendradar releases v2",
|
|
5
|
+
"description": "Repo release subscription documents. ReleaseDigest is the rendered on-disk document; ReleasesReport is the per-run diagnostic carried in RunResult.releases. Token cost lives in ReleasesReport.usage (always present), never in ReleaseDigest, because cost is a property of one run and cannot be reproduced from a stored document.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": true,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema",
|
|
10
|
+
"date",
|
|
11
|
+
"period",
|
|
12
|
+
"contentHash",
|
|
13
|
+
"contentHashAlgo",
|
|
14
|
+
"count",
|
|
15
|
+
"degraded",
|
|
16
|
+
"repos"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"schema": {
|
|
20
|
+
"const": 1
|
|
21
|
+
},
|
|
22
|
+
"date": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": "date"
|
|
25
|
+
},
|
|
26
|
+
"period": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"enum": [
|
|
29
|
+
"daily",
|
|
30
|
+
"weekly",
|
|
31
|
+
"monthly"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"contentHash": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
37
|
+
},
|
|
38
|
+
"contentHashAlgo": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"enum": [
|
|
41
|
+
"jcs-sha256-v1"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"coreVersion": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"generatedAt": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"format": "date-time"
|
|
50
|
+
},
|
|
51
|
+
"count": {
|
|
52
|
+
"type": "integer",
|
|
53
|
+
"minimum": 0
|
|
54
|
+
},
|
|
55
|
+
"degraded": {
|
|
56
|
+
"type": "boolean"
|
|
57
|
+
},
|
|
58
|
+
"repos": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": {
|
|
61
|
+
"$ref": "#/$defs/RepoReleases"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"$defs": {
|
|
66
|
+
"ReleaseItem": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"additionalProperties": true,
|
|
69
|
+
"description": "One release or tag. kind distinguishes a GitHub release (has notes) from a tag fallback (commit message used as the summary basis).",
|
|
70
|
+
"required": [
|
|
71
|
+
"id",
|
|
72
|
+
"tag",
|
|
73
|
+
"name",
|
|
74
|
+
"kind",
|
|
75
|
+
"url",
|
|
76
|
+
"prerelease",
|
|
77
|
+
"draft",
|
|
78
|
+
"summaryZh",
|
|
79
|
+
"summarySource"
|
|
80
|
+
],
|
|
81
|
+
"properties": {
|
|
82
|
+
"id": {
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"minimum": 0,
|
|
85
|
+
"x-go-type": "int64",
|
|
86
|
+
"description": "GitHub release id; 0 when the item comes from a tag fallback."
|
|
87
|
+
},
|
|
88
|
+
"tag": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"name": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
},
|
|
94
|
+
"kind": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"enum": [
|
|
97
|
+
"release",
|
|
98
|
+
"tag"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"publishedAt": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"format": "date-time"
|
|
104
|
+
},
|
|
105
|
+
"url": {
|
|
106
|
+
"type": "string"
|
|
107
|
+
},
|
|
108
|
+
"prerelease": {
|
|
109
|
+
"type": "boolean"
|
|
110
|
+
},
|
|
111
|
+
"draft": {
|
|
112
|
+
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"bodyExcerpt": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "Truncated raw release notes. Untrusted text: display only, never execute."
|
|
117
|
+
},
|
|
118
|
+
"summaryZh": {
|
|
119
|
+
"type": "string"
|
|
120
|
+
},
|
|
121
|
+
"summarySource": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"enum": [
|
|
124
|
+
"model",
|
|
125
|
+
"original"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"RepoReleases": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": true,
|
|
133
|
+
"required": [
|
|
134
|
+
"fullName",
|
|
135
|
+
"url",
|
|
136
|
+
"latestTag",
|
|
137
|
+
"newCount",
|
|
138
|
+
"releases"
|
|
139
|
+
],
|
|
140
|
+
"properties": {
|
|
141
|
+
"fullName": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"pattern": "^[^/]+/[^/]+$"
|
|
144
|
+
},
|
|
145
|
+
"url": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"format": "uri"
|
|
148
|
+
},
|
|
149
|
+
"latestTag": {
|
|
150
|
+
"type": "string"
|
|
151
|
+
},
|
|
152
|
+
"newCount": {
|
|
153
|
+
"type": "integer",
|
|
154
|
+
"minimum": 0
|
|
155
|
+
},
|
|
156
|
+
"releases": {
|
|
157
|
+
"type": "array",
|
|
158
|
+
"items": {
|
|
159
|
+
"$ref": "#/$defs/ReleaseItem"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"ReleasesReport": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"additionalProperties": true,
|
|
167
|
+
"description": "Per-run diagnostic for the releases stage. usage is required and always serialized so a consumer can tell 'nothing spent' (calls=0) from 'spent but not reported' (calls>0 with usageKnown=false).",
|
|
168
|
+
"required": [
|
|
169
|
+
"enabled",
|
|
170
|
+
"repos",
|
|
171
|
+
"newReleases",
|
|
172
|
+
"durationMs",
|
|
173
|
+
"usage"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"enabled": {
|
|
177
|
+
"type": "boolean"
|
|
178
|
+
},
|
|
179
|
+
"repos": {
|
|
180
|
+
"type": "integer",
|
|
181
|
+
"minimum": 0
|
|
182
|
+
},
|
|
183
|
+
"newReleases": {
|
|
184
|
+
"type": "integer",
|
|
185
|
+
"minimum": 0
|
|
186
|
+
},
|
|
187
|
+
"summarized": {
|
|
188
|
+
"type": "integer",
|
|
189
|
+
"minimum": 0
|
|
190
|
+
},
|
|
191
|
+
"degraded": {
|
|
192
|
+
"type": "integer",
|
|
193
|
+
"minimum": 0
|
|
194
|
+
},
|
|
195
|
+
"failed": {
|
|
196
|
+
"type": "integer",
|
|
197
|
+
"minimum": 0
|
|
198
|
+
},
|
|
199
|
+
"rateLimited": {
|
|
200
|
+
"type": "integer",
|
|
201
|
+
"minimum": 0
|
|
202
|
+
},
|
|
203
|
+
"skipped": {
|
|
204
|
+
"type": "integer",
|
|
205
|
+
"minimum": 0
|
|
206
|
+
},
|
|
207
|
+
"truncated": {
|
|
208
|
+
"type": "integer",
|
|
209
|
+
"minimum": 0
|
|
210
|
+
},
|
|
211
|
+
"historyTruncated": {
|
|
212
|
+
"type": "integer",
|
|
213
|
+
"minimum": 0
|
|
214
|
+
},
|
|
215
|
+
"durationMs": {
|
|
216
|
+
"type": "integer",
|
|
217
|
+
"minimum": 0
|
|
218
|
+
},
|
|
219
|
+
"usage": {
|
|
220
|
+
"$ref": "ipc.v2.json#/$defs/Usage"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"ReleaseManifestEntry": {
|
|
225
|
+
"type": "object",
|
|
226
|
+
"additionalProperties": true,
|
|
227
|
+
"description": "One row of GET /api/v2/releases. Cost is intentionally absent: manifests describe stored documents, which carry no run cost.",
|
|
228
|
+
"required": [
|
|
229
|
+
"date",
|
|
230
|
+
"period",
|
|
231
|
+
"count",
|
|
232
|
+
"contentHash"
|
|
233
|
+
],
|
|
234
|
+
"properties": {
|
|
235
|
+
"date": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"format": "date"
|
|
238
|
+
},
|
|
239
|
+
"period": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"enum": [
|
|
242
|
+
"daily",
|
|
243
|
+
"weekly",
|
|
244
|
+
"monthly"
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"count": {
|
|
248
|
+
"type": "integer",
|
|
249
|
+
"minimum": 0
|
|
250
|
+
},
|
|
251
|
+
"degraded": {
|
|
252
|
+
"type": "boolean"
|
|
253
|
+
},
|
|
254
|
+
"contentHash": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"SubscriptionList": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"additionalProperties": true,
|
|
263
|
+
"description": "Response of GET /api/v2/subscriptions.",
|
|
264
|
+
"required": [
|
|
265
|
+
"repos"
|
|
266
|
+
],
|
|
267
|
+
"properties": {
|
|
268
|
+
"repos": {
|
|
269
|
+
"type": "array",
|
|
270
|
+
"items": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/version-info.v2.json",
|
|
4
|
+
"title": "trendradar version info v2",
|
|
5
|
+
"description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===2 && digestSchema===2 && contractVersion major===2.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": true,
|
|
8
|
+
"required": ["version", "commit", "ipcSchema", "digestSchema", "contractVersion", "supportedProviders"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"version": { "type": "string" },
|
|
11
|
+
"commit": { "type": "string" },
|
|
12
|
+
"ipcSchema": { "const": 2 },
|
|
13
|
+
"digestSchema": { "const": 2 },
|
|
14
|
+
"contractVersion": { "type": "string" },
|
|
15
|
+
"supportedProviders": { "type": "array", "items": { "type": "string" } }
|
|
16
|
+
}
|
|
17
|
+
}
|
package/version-map.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ipc.v2.json": {
|
|
3
|
+
"wireKey": "ipcSchema",
|
|
4
|
+
"current": 2,
|
|
5
|
+
"breakingBump": [
|
|
6
|
+
"ipcSchema",
|
|
7
|
+
"packageMajor"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"digest.v2.json": {
|
|
11
|
+
"wireKey": "digestSchema",
|
|
12
|
+
"current": 2,
|
|
13
|
+
"breakingBump": [
|
|
14
|
+
"digestSchema",
|
|
15
|
+
"packageMajor"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"model.v2.json": {
|
|
19
|
+
"wireKey": null,
|
|
20
|
+
"current": 2,
|
|
21
|
+
"propagatesTo": [
|
|
22
|
+
"digestSchema"
|
|
23
|
+
],
|
|
24
|
+
"breakingBump": [
|
|
25
|
+
"packageMajor"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"errors.v2.json": {
|
|
29
|
+
"wireKey": null,
|
|
30
|
+
"current": 2,
|
|
31
|
+
"breakingBump": [
|
|
32
|
+
"packageMajor"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"version-info.v2.json": {
|
|
36
|
+
"wireKey": "contractVersion",
|
|
37
|
+
"current": "0.3.0",
|
|
38
|
+
"breakingBump": [
|
|
39
|
+
"packageMajor"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"api.v2.yaml": {
|
|
43
|
+
"wireKey": "info.version",
|
|
44
|
+
"current": "0.3.0",
|
|
45
|
+
"breakingBump": [
|
|
46
|
+
"packageMajor"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"releases.v2.json": {
|
|
50
|
+
"wireKey": null,
|
|
51
|
+
"current": 1,
|
|
52
|
+
"propagatesTo": [],
|
|
53
|
+
"breakingBump": [
|
|
54
|
+
"packageMajor"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|