@sakura2333/kancolle-data 0.1.0 → 0.2.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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "metadata": {
3
3
  "schemaVersion": 2,
4
- "dataVersion": "2026-06-28T07:31:26+00:00",
5
- "generatedAt": "2026-06-28T07:31:26+00:00",
4
+ "dataVersion": "2026-06-28T11:13:25+00:00",
5
+ "generatedAt": "2026-06-28T11:13:25+00:00",
6
6
  "shipMasterVersion": "2026053000",
7
7
  "dayOrder": [
8
8
  "all",
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export interface KancolleDataPaths {
2
2
  rootPath: string
3
3
  manifestPath: string
4
+ releasesPath: string
4
5
  improvement: {
5
6
  listPath: string
6
7
  detailPath: string
package/index.js CHANGED
@@ -7,6 +7,7 @@ const resolveData = (...parts) => path.join(__dirname, ...parts)
7
7
  module.exports = Object.freeze({
8
8
  rootPath: __dirname,
9
9
  manifestPath: resolveData('manifest.json'),
10
+ releasesPath: resolveData('RELEASES.json'),
10
11
  improvement: Object.freeze({
11
12
  listPath: resolveData('improvement', 'list.json'),
12
13
  detailPath: resolveData('improvement', 'detail.nedb'),
package/manifest.json CHANGED
@@ -1,35 +1,117 @@
1
1
  {
2
- "packageVersion": "0.1.0",
3
- "generatedAt": "2026-06-28T08:34:34+00:00",
2
+ "packageVersion": "0.2.0",
3
+ "generatedAt": "2026-06-28T11:13:26+00:00",
4
4
  "datasets": {
5
5
  "improvement": {
6
6
  "schemaVersion": 3,
7
+ "listSchemaVersion": 2,
7
8
  "list": "improvement/list.json",
8
- "detail": "improvement/detail.nedb"
9
+ "detail": "improvement/detail.nedb",
10
+ "listViewCount": 8,
11
+ "listAllCount": 372,
12
+ "detailRecordCount": 372
9
13
  },
10
14
  "equipmentDropFrom": {
11
15
  "schemaVersion": 1,
12
16
  "path": "equipment/drop-from.nedb",
13
- "status": "stale",
14
- "error": "FileNotFoundError: [CACHE ONLY] cache miss: https://raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/ship.json -> raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/ship.json.html",
17
+ "source": "kcwiki-data",
15
18
  "sourceUrls": [
16
19
  "https://raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/ship.json",
17
20
  "https://raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/equipment.json"
18
21
  ],
19
- "refreshError": "FileNotFoundError: [CACHE ONLY] cache miss: https://raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/ship.json -> raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/ship.json.html"
22
+ "shipEntryCount": 840,
23
+ "equipmentRecordCount": 247,
24
+ "relationCount": 1645,
25
+ "issueCount": 2,
26
+ "status": "ok",
27
+ "fetches": [
28
+ {
29
+ "url": "https://raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/ship.json",
30
+ "status": "fresh",
31
+ "statusCode": 200,
32
+ "validatedAt": 1782645174,
33
+ "validatedInRun": true,
34
+ "usedCacheFallback": false,
35
+ "contentSha256": "d8c1691e83e6f4a9e55e34f8139c9ad9bb21ff9b3b7066dd3d5d31e15bae7dd7",
36
+ "cachePath": "raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/ship.json"
37
+ },
38
+ {
39
+ "url": "https://raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/equipment.json",
40
+ "status": "fresh",
41
+ "statusCode": 200,
42
+ "validatedAt": 1782645174,
43
+ "validatedInRun": true,
44
+ "usedCacheFallback": false,
45
+ "contentSha256": "284d7e32f70e67dd599ae43e1758d43568fcad3fe062548c68808988a4a27c0b",
46
+ "cachePath": "raw.githubusercontent.com/kcwiki/kancolle-data/refs/heads/master/wiki/equipment.json"
47
+ }
48
+ ]
20
49
  },
21
50
  "equipmentSpecialBonuses": {
22
- "schemaVersion": 1,
51
+ "schemaVersion": 2,
23
52
  "path": "equipment/special-bonuses.nedb",
24
- "status": "stale",
25
- "error": "FileNotFoundError: [CACHE ONLY] cache miss: https://raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json -> raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json.html",
53
+ "source": "kc3-slotitem-bonus",
26
54
  "sourceUrl": "https://raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json",
27
- "refreshError": "FileNotFoundError: [CACHE ONLY] cache miss: https://raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json -> raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json.html"
55
+ "entryCount": 325,
56
+ "recordCount": 348,
57
+ "equipmentRecordCount": 341,
58
+ "equipmentTypeRecordCount": 7,
59
+ "ruleCount": 2320,
60
+ "equipmentRuleCount": 2297,
61
+ "equipmentTypeRuleCount": 23,
62
+ "issueCount": 0,
63
+ "status": "ok",
64
+ "fetches": [
65
+ {
66
+ "url": "https://raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json",
67
+ "status": "fresh",
68
+ "statusCode": 200,
69
+ "validatedAt": 1782645175,
70
+ "validatedInRun": true,
71
+ "usedCacheFallback": false,
72
+ "contentSha256": "e19fc34ea5d0246c5d8a34a9cb272c595970118eba62409006669a4c7f9962d1",
73
+ "cachePath": "raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json"
74
+ }
75
+ ]
28
76
  },
29
77
  "useitemIcons": {
30
78
  "schemaVersion": 1,
31
79
  "directory": "assets/useitems",
32
- "count": 15
80
+ "count": 16,
81
+ "requiredIds": [
82
+ 2,
83
+ 57,
84
+ 70,
85
+ 71,
86
+ 75,
87
+ 77,
88
+ 78,
89
+ 91,
90
+ 92,
91
+ 94,
92
+ 95,
93
+ 100,
94
+ 104
95
+ ],
96
+ "availableIds": [
97
+ 2,
98
+ 57,
99
+ 70,
100
+ 71,
101
+ 75,
102
+ 77,
103
+ 78,
104
+ 91,
105
+ 92,
106
+ 94,
107
+ 95,
108
+ 100,
109
+ 104,
110
+ 145,
111
+ 150,
112
+ 241
113
+ ],
114
+ "missingIds": []
33
115
  }
34
116
  },
35
117
  "sources": {
@@ -41,13 +123,21 @@
41
123
  "kc3SlotitemBonus": "https://raw.githubusercontent.com/KC3Kai/kancolle-replay/refs/heads/master/js/data/mst_slotitem_bonus.json"
42
124
  },
43
125
  "files": {
126
+ "CHANGELOG.md": {
127
+ "sha256": "13c811ad057aad7d8d99e6aae1c9326f676d021271a0e8f1737596d4b5410324",
128
+ "bytes": 3030
129
+ },
44
130
  "LICENSES.md": {
45
131
  "sha256": "40bddfdbcdc4b7812056e82fc5de18184097d2fdb903fab14262ea41e47c7594",
46
132
  "bytes": 412
47
133
  },
48
134
  "README.md": {
49
- "sha256": "2d3c30a768e2fdd543bba4c356999b506a8ebf6ec7684f2da2736b41dd681530",
50
- "bytes": 884
135
+ "sha256": "c41e8f4910f98c9bfb49dc21c1245bd78696aad184fe144adb7f0144d332ddc4",
136
+ "bytes": 1173
137
+ },
138
+ "RELEASES.json": {
139
+ "sha256": "1912cea6dc06fd71491d957bb34e68722b9a897f97ba5bc6519fed393739feda",
140
+ "bytes": 795
51
141
  },
52
142
  "assets/useitems/100.png": {
53
143
  "sha256": "6c056ddea6ed3d2bf425ff70a36e47ecbc1dfa3de29d14fec24533e7699778f2",
@@ -81,6 +171,10 @@
81
171
  "sha256": "0f4075c759c4efd9c82f92311c5a657bff39f7ea0261be00818e8325cb0fc454",
82
172
  "bytes": 45622
83
173
  },
174
+ "assets/useitems/71.png": {
175
+ "sha256": "824bab9afa0a5fe768ffcfceade5c19fd0998b80ffc83413c7427ac3a31e6573",
176
+ "bytes": 15305
177
+ },
84
178
  "assets/useitems/75.png": {
85
179
  "sha256": "6db732f6217f551042d23df5cafff0b9b16bd00b34a52346c86a3c7d89f09352",
86
180
  "bytes": 19226
@@ -110,40 +204,44 @@
110
204
  "bytes": 28940
111
205
  },
112
206
  "audit/build-report.json": {
113
- "sha256": "b470d6f0e16ff378217c85234b865e59b86d71bf9678a4d1a9eb301750f81cf3",
114
- "bytes": 144
207
+ "sha256": "3583f2ecb591f9073df84b77fc0b67e86f559eef3158b2812d9fe9dd8c8abcc3",
208
+ "bytes": 313
115
209
  },
116
210
  "equipment/drop-from.nedb": {
117
- "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
118
- "bytes": 1
211
+ "sha256": "bb366ee4db693e396414cf3145e583a36c0ce9fa7f56cb4a553f8cba8a5e07d3",
212
+ "bytes": 358778
119
213
  },
120
214
  "equipment/special-bonuses.nedb": {
121
- "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
122
- "bytes": 1
215
+ "sha256": "818fe35d9a441823f65c37e1418a4a54492dfdd63ad61a1f292427d30972720e",
216
+ "bytes": 281247
123
217
  },
124
218
  "improvement/detail.nedb": {
125
219
  "sha256": "2e1f5068dfef350926206ca23c58d35c73f0f2384686a576caa330111d772cca",
126
220
  "bytes": 467736
127
221
  },
128
222
  "improvement/list.json": {
129
- "sha256": "29433d009cd04ef0383f14185f03a53691510da90963a3525ef90e4781dc8326",
223
+ "sha256": "7902004010db1b3fc3338dfc079cf8df6b6b352e91c23de789a9b007f409c5d0",
130
224
  "bytes": 209473
131
225
  },
132
226
  "index.d.ts": {
133
- "sha256": "1a68db4ac48528ee534b9ef26324898bf41d7e4f32c3287e106c2073a1a68378",
134
- "bytes": 380
227
+ "sha256": "ff7d2d5fc466627b1727e1cdb9aa6b2075b5ace680e695824067d450c015eeec",
228
+ "bytes": 403
135
229
  },
136
230
  "index.js": {
137
- "sha256": "c41585d6158161154b272aa0f813df100a86bf97a6c3a7f43fa949713de16f71",
138
- "bytes": 761
231
+ "sha256": "00ed1d97c6020622cc95ca4718dbd1e630bb823b62f232994a298673d2cbabc7",
232
+ "bytes": 807
139
233
  },
140
234
  "schemas/equipment-drop-from.schema.json": {
141
235
  "sha256": "b67bc757c8dd8523498abc0215656b7e8898485d060ddeac11577bb697a5279f",
142
236
  "bytes": 963
143
237
  },
144
238
  "schemas/equipment-special-bonus.schema.json": {
145
- "sha256": "03debb94d429c3565f0fe393928e45c7cbaf150d8478fbfa70073f96f8ced1de",
146
- "bytes": 614
239
+ "sha256": "e8811b953358cbb5df8c786521c68841a4c422e07d0dbc9c78088e66c4690273",
240
+ "bytes": 1591
241
+ },
242
+ "scripts/check-fresh.js": {
243
+ "sha256": "1c5fb329d910a5ec42146a959dedfdefd23dd478050e5d50dda2b3619fc69b6b",
244
+ "bytes": 934
147
245
  }
148
246
  }
149
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakura2333/kancolle-data",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Versioned KanColle community datasets generated by kancolle-item-improvement-spider",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -11,6 +11,8 @@
11
11
  "README.md",
12
12
  "CHANGELOG.md",
13
13
  "LICENSES.md",
14
+ "RELEASES.json",
15
+ "scripts/check-fresh.js",
14
16
  "schemas/",
15
17
  "improvement/",
16
18
  "equipment/",
@@ -29,7 +31,9 @@
29
31
  "access": "public"
30
32
  },
31
33
  "scripts": {
32
- "check": "node -e \"const d=require('./'); const fs=require('fs'); for(const p of [d.manifestPath,d.improvement.listPath,d.improvement.detailPath,d.equipment.dropFromPath,d.equipment.specialBonusesPath]) if(!fs.existsSync(p)) throw new Error('missing '+p)\"",
33
- "prepack": "npm run check"
34
+ "check": "node -e \"const d=require('./');const fs=require('fs');const m=JSON.parse(fs.readFileSync(d.manifestPath));for(const p of [d.manifestPath,d.releasesPath,d.improvement.listPath,d.improvement.detailPath,d.equipment.dropFromPath,d.equipment.specialBonusesPath])if(!fs.existsSync(p))throw new Error('missing '+p);if(m.datasets.equipmentSpecialBonuses.schemaVersion!==2)throw new Error('unexpected special bonus schema');if((m.datasets.useitemIcons.missingIds||[]).length)throw new Error('missing useitem icons');for(const id of m.datasets.useitemIcons.requiredIds||[])if(!fs.existsSync(d.assets.useitemPath(id)))throw new Error('missing icon '+id)\"",
35
+ "prepack": "npm run check",
36
+ "check:fresh": "node scripts/check-fresh.js",
37
+ "prepublishOnly": "npm run check && npm run check:fresh"
34
38
  }
35
39
  }
@@ -2,17 +2,53 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "Equipment special bonus record",
4
4
  "type": "object",
5
- "required": ["equipmentId", "equipmentName", "rules"],
5
+ "required": ["target", "rules"],
6
6
  "properties": {
7
+ "target": {
8
+ "oneOf": [
9
+ {
10
+ "type": "object",
11
+ "required": ["kind", "equipmentIds"],
12
+ "properties": {
13
+ "kind": { "const": "equipment" },
14
+ "equipmentIds": {
15
+ "type": "array",
16
+ "minItems": 1,
17
+ "items": { "type": "integer", "minimum": 1 }
18
+ }
19
+ },
20
+ "additionalProperties": false
21
+ },
22
+ {
23
+ "type": "object",
24
+ "required": ["kind", "equipmentTypeIds"],
25
+ "properties": {
26
+ "kind": { "const": "equipment-type" },
27
+ "equipmentTypeIds": {
28
+ "type": "array",
29
+ "minItems": 1,
30
+ "items": { "type": "integer", "minimum": 1 }
31
+ }
32
+ },
33
+ "additionalProperties": false
34
+ }
35
+ ]
36
+ },
7
37
  "equipmentId": { "type": "integer", "minimum": 1 },
8
38
  "equipmentName": { "type": "string" },
39
+ "equipmentTypeIds": {
40
+ "type": "array",
41
+ "minItems": 1,
42
+ "items": { "type": "integer", "minimum": 1 }
43
+ },
9
44
  "rules": {
10
45
  "type": "array",
46
+ "minItems": 1,
11
47
  "items": {
12
48
  "type": "object",
13
49
  "required": ["bonus", "conditions"],
14
50
  "properties": {
15
- "bonus": { "type": "object", "additionalProperties": { "type": "number" } },
51
+ "bonus": { "type": "object", "minProperties": 1, "additionalProperties": { "type": "number" } },
16
52
  "conditions": { "type": "object" }
17
53
  }
18
54
  }
@@ -0,0 +1,26 @@
1
+ 'use strict'
2
+
3
+ const fs = require('fs')
4
+ const path = require('path')
5
+
6
+ const root = path.resolve(__dirname, '..')
7
+ const manifest = JSON.parse(fs.readFileSync(path.join(root, 'manifest.json'), 'utf8'))
8
+
9
+ for (const key of ['equipmentDropFrom', 'equipmentSpecialBonuses']) {
10
+ const dataset = manifest.datasets && manifest.datasets[key]
11
+ if (!dataset || dataset.status !== 'ok') {
12
+ throw new Error(`dataset ${key} is not fresh: status=${dataset && dataset.status}`)
13
+ }
14
+ if (!Array.isArray(dataset.fetches) || dataset.fetches.length === 0) {
15
+ throw new Error(`dataset ${key} has no source fetch audit`)
16
+ }
17
+ for (const fetchInfo of dataset.fetches) {
18
+ if (fetchInfo.status !== 'fresh'
19
+ || fetchInfo.validatedInRun !== true
20
+ || fetchInfo.usedCacheFallback === true) {
21
+ throw new Error(`dataset ${key} source was not freshly validated: ${fetchInfo.url}`)
22
+ }
23
+ }
24
+ }
25
+
26
+ console.log('source freshness checks passed')