@dmdata/telegram-json-types 1.1.16 → 1.1.18
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/dist/build.js +17 -7
- package/dist/jschema/earthquake-hypocenter-update_1.0.0.json +1 -1
- package/dist/jschema/earthquake-information_1.0.0.json +1 -1
- package/dist/jschema/earthquake-information_1.1.0.json +1 -1
- package/dist/jschema/eew-information_1.0.0.json +1 -1
- package/dist/jschema/forecast-2week-temperature_1.0.0.json +1 -1
- package/dist/jschema/forecast-prefecture_1.0.0.json +1 -1
- package/dist/jschema/forecast-season_1.0.0.json +1 -1
- package/dist/jschema/forecast-warning-possibility_1.0.0.json +1 -1
- package/dist/jschema/forecast-weathermap_1.0.0.json +1 -1
- package/dist/jschema/tsunami-information_1.0.0.json +1 -1
- package/dist/jschema/tsunami-information_1.1.0.json +1 -1
- package/dist/jschema/volcano-information_1.0.0.json +1 -1
- package/dist/jschema/weather-impact-society_1.0.0.json +1 -1
- package/dist/jschema/weather-typhoon_1.0.0.json +1 -1
- package/dist/jschema/weather-warning_1.0.0.json +1 -1
- package/dist/jschema-load.js +23 -13
- package/package.json +8 -8
- package/test/sample-schema-check.test.ts +10 -7
- package/types/schema/earthquake-information/1.1.0.d.ts +2 -2
- package/types/schema/tsunami-information/1.0.0.d.ts +2 -2
- package/types/schema/tsunami-information/1.1.0.d.ts +4 -4
|
@@ -3,6 +3,7 @@ import { deepEqual } from 'node:assert/strict';
|
|
|
3
3
|
import Ajv from 'ajv';
|
|
4
4
|
import { getJSchema } from '../jschema/jschema-load';
|
|
5
5
|
|
|
6
|
+
const sampleUrl = 'https://sample.dmdata.jp';
|
|
6
7
|
const checkSchemaTypes = [
|
|
7
8
|
'eew-information',
|
|
8
9
|
'earthquake-information',
|
|
@@ -52,12 +53,14 @@ for (const schemaType of checkSchemaTypes) {
|
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
async function getList(schemaType: string) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.
|
|
56
|
+
const query = new URLSearchParams({ prefix: `conversion/json/schema/${schemaType}`, delimiter: '' });
|
|
57
|
+
const url = `${sampleUrl}/?` + query.toString();
|
|
58
|
+
|
|
59
|
+
return await fetch(url, { headers: { accept: 'application/xml' } })
|
|
60
|
+
.then(res => res.text())
|
|
61
|
+
.then(xml => xml
|
|
62
|
+
.match(/<Key>.+?\.json<\/Key>/g)
|
|
63
|
+
?.map(element => element.replace(/^<Key>(.+?\.json)<\/Key>$/, '$1'))
|
|
64
|
+
.map(href => `${sampleUrl}/${encodeURIComponent(href)}`) ?? []
|
|
62
65
|
);
|
|
63
66
|
}
|
|
@@ -17,12 +17,12 @@ export namespace EarthquakeInformation {
|
|
|
17
17
|
|
|
18
18
|
export interface IntensityMaxIntOnRevise extends Components.CodeName {
|
|
19
19
|
maxInt?: IntensityClass;
|
|
20
|
-
revise?: '上方修正' | '追加';
|
|
20
|
+
revise?: '上方修正' | '下方修正' | '追加';
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface IntensityCity extends Components.CodeName {
|
|
24
24
|
maxInt?: IntensityClass;
|
|
25
|
-
revise?: '上方修正' | '追加';
|
|
25
|
+
revise?: '上方修正' | '下方修正' | '追加';
|
|
26
26
|
condition?: '震度5弱以上未入電';
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -246,7 +246,7 @@ export namespace TsunamiInformation {
|
|
|
246
246
|
|
|
247
247
|
|
|
248
248
|
export interface Cancel extends TelegramJSONMain {
|
|
249
|
-
type: '津波警報・注意報・予報a' | '津波情報a' | '
|
|
249
|
+
type: '津波警報・注意報・予報a' | '津波情報a' | '沖合の津波観測に関する情報';
|
|
250
250
|
infoType: '取消';
|
|
251
251
|
targetDateTimeDubious?: never;
|
|
252
252
|
targetDuration?: never;
|
|
@@ -256,6 +256,6 @@ export namespace TsunamiInformation {
|
|
|
256
256
|
body: CancelBody;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
export type Main =
|
|
259
|
+
export type Main = PublicVTSE41 | PublicVTSE51 | PublicVTSE52 | Cancel;
|
|
260
260
|
|
|
261
261
|
}
|
|
@@ -164,8 +164,8 @@ export namespace TsunamiInformation {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
export interface TsunamiEstimationFirstHeight {
|
|
167
|
-
arrivalTime
|
|
168
|
-
condition
|
|
167
|
+
arrivalTime?: string;
|
|
168
|
+
condition: '早いところでは既に津波到達と推定';
|
|
169
169
|
revise?: '追加' | '更新';
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -283,7 +283,7 @@ export namespace TsunamiInformation {
|
|
|
283
283
|
|
|
284
284
|
|
|
285
285
|
export interface Cancel extends TelegramJSONMain {
|
|
286
|
-
type: '津波警報・注意報・予報a' | '津波情報a' | '
|
|
286
|
+
type: '津波警報・注意報・予報a' | '津波情報a' | '沖合の津波観測に関する情報';
|
|
287
287
|
infoType: '取消';
|
|
288
288
|
targetDateTimeDubious?: never;
|
|
289
289
|
targetDuration?: never;
|
|
@@ -293,6 +293,6 @@ export namespace TsunamiInformation {
|
|
|
293
293
|
body: CancelBody;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
export type Main =
|
|
296
|
+
export type Main = PublicVTSE41 | PublicVTSE51 | PublicVTSE52 | Cancel;
|
|
297
297
|
|
|
298
298
|
}
|