@morehao/trendradar-contract 0.6.0 → 0.7.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 +28 -0
- package/README.md +22 -19
- package/fixtures/digest-degraded.json +8 -6
- package/fixtures/digest-empty-lang.json +8 -6
- package/fixtures/digest-en.json +103 -0
- package/fixtures/digest-missing-optional.json +8 -6
- package/fixtures/digest-normal.json +20 -14
- package/fixtures/release-degraded.json +6 -5
- package/fixtures/release-empty.json +2 -2
- package/fixtures/release-normal.json +10 -8
- package/fixtures/release-weekly.json +5 -4
- package/gen/ts/index.d.ts +13 -10
- package/gen/ts/index.js +211 -84
- package/package.json +1 -1
- package/schema/api.v2.yaml +1 -1
- package/schema/{digest.v2.json → digest.v3.json} +4 -4
- package/schema/{ipc.v3.json → ipc.v4.json} +9 -9
- package/schema/{model.v2.json → model.v3.json} +5 -4
- package/schema/{releases.v2.json → releases.v3.json} +15 -11
- package/schema/version-info.v2.json +3 -3
- package/version-map.json +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morehao/trendradar-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Language-neutral contract (JSON Schema, fixtures, generated Go & TypeScript types) shared by the trendradar Go core and its DSH plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/schema/api.v2.yaml
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/digest.
|
|
4
|
-
"title": "trendradar digest
|
|
3
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/digest.v3.json",
|
|
4
|
+
"title": "trendradar digest v3",
|
|
5
5
|
"description": "One day's rendered digest document. contentHash is stable across runs (generatedAt/coreVersion excluded); contentHashAlgo records which algorithm produced it.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": true,
|
|
8
8
|
"required": ["schema", "date", "period", "languages", "count", "degraded", "contentHash", "contentHashAlgo", "repos"],
|
|
9
9
|
"properties": {
|
|
10
|
-
"schema": { "const":
|
|
10
|
+
"schema": { "const": 3 },
|
|
11
11
|
"date": { "type": "string", "format": "date" },
|
|
12
12
|
"period": { "type": "string", "enum": ["daily", "weekly", "monthly"] },
|
|
13
13
|
"languages": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"generatedAt": { "type": "string", "format": "date-time" },
|
|
20
20
|
"repos": {
|
|
21
21
|
"type": "array",
|
|
22
|
-
"items": { "$ref": "model.
|
|
22
|
+
"items": { "$ref": "model.v3.json#/$defs/RepoDigest" }
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/ipc.
|
|
4
|
-
"title": "trendradar ipc
|
|
5
|
-
"description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const
|
|
3
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/ipc.v4.json",
|
|
4
|
+
"title": "trendradar ipc v4",
|
|
5
|
+
"description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const 4.",
|
|
6
6
|
"oneOf": [
|
|
7
7
|
{
|
|
8
8
|
"$ref": "#/$defs/RunRequest"
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
],
|
|
118
118
|
"properties": {
|
|
119
119
|
"ipcSchema": {
|
|
120
|
-
"const":
|
|
120
|
+
"const": 4
|
|
121
121
|
},
|
|
122
122
|
"command": {
|
|
123
123
|
"type": "string",
|
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
],
|
|
404
404
|
"properties": {
|
|
405
405
|
"ipcSchema": {
|
|
406
|
-
"const":
|
|
406
|
+
"const": 4
|
|
407
407
|
},
|
|
408
408
|
"ok": {
|
|
409
409
|
"type": "boolean"
|
|
@@ -465,13 +465,13 @@
|
|
|
465
465
|
"$ref": "#/$defs/Usage"
|
|
466
466
|
},
|
|
467
467
|
"releases": {
|
|
468
|
-
"$ref": "releases.
|
|
468
|
+
"$ref": "releases.v3.json#/$defs/ReleasesReport"
|
|
469
469
|
},
|
|
470
470
|
"subscriptions": {
|
|
471
|
-
"$ref": "releases.
|
|
471
|
+
"$ref": "releases.v3.json#/$defs/SubscriptionList"
|
|
472
472
|
},
|
|
473
473
|
"subscriptionDoc": {
|
|
474
|
-
"$ref": "releases.
|
|
474
|
+
"$ref": "releases.v3.json#/$defs/SubscriptionDoc"
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
},
|
|
@@ -561,7 +561,7 @@
|
|
|
561
561
|
],
|
|
562
562
|
"properties": {
|
|
563
563
|
"ipcSchema": {
|
|
564
|
-
"const":
|
|
564
|
+
"const": 4
|
|
565
565
|
},
|
|
566
566
|
"stateSchema": {
|
|
567
567
|
"const": 3
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/model.
|
|
4
|
-
"title": "trendradar model
|
|
3
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/model.v3.json",
|
|
4
|
+
"title": "trendradar model v3",
|
|
5
5
|
"description": "Domain model: a scraped repository snapshot (RepoSnapshot) and its digested form (RepoDigest). RepoDigest composes RepoSnapshot via allOf instead of flattening.",
|
|
6
6
|
"$ref": "#/$defs/RepoDigest",
|
|
7
7
|
"$defs": {
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
{
|
|
29
29
|
"type": "object",
|
|
30
30
|
"additionalProperties": true,
|
|
31
|
-
"required": ["
|
|
31
|
+
"required": ["summary", "summaryLang", "summarySource"],
|
|
32
32
|
"properties": {
|
|
33
|
-
"
|
|
33
|
+
"summary": { "type": "string" },
|
|
34
|
+
"summaryLang": { "type": "string" },
|
|
34
35
|
"summarySource": { "type": "string", "enum": ["model", "original"] }
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/morehao/trendradar/contract/schema/releases.
|
|
4
|
-
"title": "trendradar releases
|
|
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. schema
|
|
3
|
+
"$id": "https://github.com/morehao/trendradar/contract/schema/releases.v3.json",
|
|
4
|
+
"title": "trendradar releases v3",
|
|
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. Older documents put one weekly summary per repo (repos[].summary); schema 3 cores write a per-version summary on each repos[].releases[].summary instead, and leave repos[].summary empty on new data (carrying summaryLang when non-empty). Both fields stay optional (readable old + new documents): consumers should prefer the per-item summary and fall back to the repo-level one for older documents.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": true,
|
|
8
8
|
"required": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"properties": {
|
|
19
19
|
"schema": {
|
|
20
|
-
"const":
|
|
20
|
+
"const": 3
|
|
21
21
|
},
|
|
22
22
|
"date": {
|
|
23
23
|
"type": "string",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"ReleaseItem": {
|
|
67
67
|
"type": "object",
|
|
68
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).
|
|
69
|
+
"description": "One release or tag. kind distinguishes a GitHub release (has notes) from a tag fallback (commit message used as the summary basis). summary is this version's own summary in the configured output language, written per version by current cores (incremental). It stays optional so old documents (which only carry the repo-level RepoReleases.summary) remain valid; consumers should prefer this field and fall back to RepoReleases.summary.",
|
|
70
70
|
"required": [
|
|
71
71
|
"id",
|
|
72
72
|
"tag",
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
"type": "string",
|
|
115
115
|
"description": "Truncated raw release notes. Untrusted text: display only, never execute."
|
|
116
116
|
},
|
|
117
|
-
"
|
|
117
|
+
"summary": {
|
|
118
118
|
"type": "string",
|
|
119
|
-
"description": "
|
|
119
|
+
"description": "This version's own summary in the configured output language (model or original text). Optional: older documents only carry the repo-level summary, and consumers should prefer this field and fall back to RepoReleases.summary."
|
|
120
120
|
},
|
|
121
121
|
"summarySource": {
|
|
122
122
|
"type": "string",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"RepoReleases": {
|
|
131
131
|
"type": "object",
|
|
132
132
|
"additionalProperties": true,
|
|
133
|
-
"description": "One repo's release batch for one summary period.
|
|
133
|
+
"description": "One repo's release batch for one summary period. periodStart/periodEnd bound the period (attributed to the versions' publish dates) so a consumer can label it without parsing dates. summary (repo-level, whole-week) plus optional summaryLang is kept for backward compatibility: current cores summarize per version (releases[].summary) and usually leave this empty on new data.",
|
|
134
134
|
"required": [
|
|
135
135
|
"fullName",
|
|
136
136
|
"url",
|
|
@@ -162,9 +162,13 @@
|
|
|
162
162
|
"type": "string",
|
|
163
163
|
"format": "date"
|
|
164
164
|
},
|
|
165
|
-
"
|
|
165
|
+
"summary": {
|
|
166
166
|
"type": "string",
|
|
167
|
-
"description": "
|
|
167
|
+
"description": "Optional repo-level summary for the whole period. Current cores summarize per version (releases[].summary) and usually leave this empty. Kept optional for older documents; consumers should prefer releases[].summary and fall back to this."
|
|
168
|
+
},
|
|
169
|
+
"summaryLang": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "BCP47 language of the repo-level summary above; present only when summary is. Item-level summaries inherit this / the configured output language."
|
|
168
172
|
},
|
|
169
173
|
"releases": {
|
|
170
174
|
"type": "array",
|
|
@@ -240,7 +244,7 @@
|
|
|
240
244
|
"minimum": 0
|
|
241
245
|
},
|
|
242
246
|
"usage": {
|
|
243
|
-
"$ref": "ipc.
|
|
247
|
+
"$ref": "ipc.v4.json#/$defs/Usage"
|
|
244
248
|
}
|
|
245
249
|
}
|
|
246
250
|
},
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://github.com/morehao/trendradar/contract/schema/version-info.v2.json",
|
|
4
4
|
"title": "trendradar version info v2",
|
|
5
|
-
"description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===
|
|
5
|
+
"description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===4 && digestSchema===3 && contractVersion major===0.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": true,
|
|
8
8
|
"required": ["version", "commit", "ipcSchema", "digestSchema", "contractVersion", "supportedProviders"],
|
|
9
9
|
"properties": {
|
|
10
10
|
"version": { "type": "string" },
|
|
11
11
|
"commit": { "type": "string" },
|
|
12
|
-
"ipcSchema": { "const":
|
|
13
|
-
"digestSchema": { "const":
|
|
12
|
+
"ipcSchema": { "const": 4 },
|
|
13
|
+
"digestSchema": { "const": 3 },
|
|
14
14
|
"contractVersion": { "type": "string" },
|
|
15
15
|
"supportedProviders": { "type": "array", "items": { "type": "string" } }
|
|
16
16
|
}
|
package/version-map.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"digest.
|
|
2
|
+
"digest.v3.json": {
|
|
3
3
|
"wireKey": "digestSchema",
|
|
4
|
-
"current":
|
|
4
|
+
"current": 3,
|
|
5
5
|
"breakingBump": [
|
|
6
6
|
"digestSchema",
|
|
7
7
|
"packageMajor"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
|
-
"model.
|
|
10
|
+
"model.v3.json": {
|
|
11
11
|
"wireKey": null,
|
|
12
|
-
"current":
|
|
12
|
+
"current": 3,
|
|
13
13
|
"propagatesTo": [
|
|
14
14
|
"digestSchema"
|
|
15
15
|
],
|
|
@@ -26,29 +26,29 @@
|
|
|
26
26
|
},
|
|
27
27
|
"version-info.v2.json": {
|
|
28
28
|
"wireKey": "contractVersion",
|
|
29
|
-
"current": "0.
|
|
29
|
+
"current": "0.7.0",
|
|
30
30
|
"breakingBump": [
|
|
31
31
|
"packageMajor"
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
34
|
"api.v2.yaml": {
|
|
35
35
|
"wireKey": "info.version",
|
|
36
|
-
"current": "0.
|
|
36
|
+
"current": "0.7.0",
|
|
37
37
|
"breakingBump": [
|
|
38
38
|
"packageMajor"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
|
-
"releases.
|
|
41
|
+
"releases.v3.json": {
|
|
42
42
|
"wireKey": null,
|
|
43
|
-
"current":
|
|
43
|
+
"current": 3,
|
|
44
44
|
"propagatesTo": [],
|
|
45
45
|
"breakingBump": [
|
|
46
46
|
"packageMajor"
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
|
-
"ipc.
|
|
49
|
+
"ipc.v4.json": {
|
|
50
50
|
"wireKey": "ipcSchema",
|
|
51
|
-
"current":
|
|
51
|
+
"current": 4,
|
|
52
52
|
"breakingBump": [
|
|
53
53
|
"ipcSchema",
|
|
54
54
|
"packageMajor"
|