@dmdata/telegram-json-types 1.0.9-jschema.0 → 1.0.9-jschema.1
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/README.md +31 -2
- package/dist/build.js +17 -11
- package/dist/jschema/earthquake-information_1.0.0.json +1 -0
- package/dist/jschema/earthquake-information_1.1.0.json +1 -0
- package/dist/jschema/eew-information_1.0.0.json +1 -0
- package/dist/jschema/tsunami-information_1.0.0.json +1 -0
- package/dist/jschema/weather-typhoon_1.0.0.json +1 -0
- package/dist/jschema-load.d.ts +1 -1
- package/dist/jschema-load.js +12 -6
- package/index.d.ts +2 -2
- package/package.json +3 -3
- package/types/{schema/component → component}/coordinate.d.ts +0 -0
- package/types/{schema/component → component}/earthquake.d.ts +0 -0
- package/types/{schema/component → component}/unit-value.d.ts +0 -0
- package/types/index.d.ts +11 -4
- package/types/schema/earthquake-information/1.0.0.d.ts +135 -0
- package/types/schema/{earthquake-information.d.ts → earthquake-information/1.1.0.d.ts} +179 -181
- package/types/schema/earthquake-information/index.d.ts +11 -0
- package/types/schema/{eew-information.d.ts → eew-information/1.0.0.d.ts} +3 -3
- package/types/schema/eew-information/index.d.ts +9 -0
- package/types/schema/{tsunami-information.d.ts → tsunami-information/1.0.0.d.ts} +230 -230
- package/types/schema/tsunami-information/index.d.ts +9 -0
- package/types/schema/{weather-typhoon.d.ts → weather-typhoon/1.0.0.d.ts} +3 -3
- package/types/schema/weather-typhoon/index.d.ts +9 -0
- package/dist/jschema/earthquake-information.json +0 -1778
- package/dist/jschema/eew-information.json +0 -2742
- package/dist/jschema/tsunami-information.json +0 -3891
- package/dist/jschema/weather-typhoon.json +0 -4969
- package/jschema/build.ts +0 -56
- package/jschema/config.ts +0 -4
- package/jschema/jschema-load.ts +0 -26
- package/tsconfig.jschema.json +0 -16
package/README.md
CHANGED
|
@@ -10,14 +10,43 @@ DMDATA.JP が提供する [JSON Schema](https://dmdata.jp/doc/reference/conversi
|
|
|
10
10
|
|
|
11
11
|
### 型の使用
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
```typescript
|
|
14
14
|
import { EarthquakeInformation } from '@dmdata/telegram-json-types';
|
|
15
15
|
|
|
16
16
|
const data = await fetch('https://data.api.dmdata.jp/v1/...')
|
|
17
|
-
.then(res => res.json()) as Promise<EarthquakeInformation.Main>
|
|
17
|
+
.then(res => res.json()) as Promise<EarthquakeInformation.Latest.Main>
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## JSON Schema による整合性チェック
|
|
22
|
+
|
|
23
|
+
Telegram JSON が、仕様通り整合するかチェックすることができます。
|
|
24
|
+
|
|
25
|
+
`$ npm i @dmdata/telegram-json-type ajv`
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { getJSchema } from '@dmdata/telegram-json-types';
|
|
29
|
+
|
|
30
|
+
// 実際の電文データ
|
|
31
|
+
const telegramData = {
|
|
32
|
+
_schema: {
|
|
33
|
+
type: 'earthquake-information',
|
|
34
|
+
version: '1.1.0'
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
async function check() {
|
|
39
|
+
// Schema 名から JSON Schema 定義を読み込む
|
|
40
|
+
const jschema = await getJSchema(telegramData._schema.type, telegramData._schema.version);
|
|
41
|
+
|
|
42
|
+
const validate = ajv.complite(jschema);
|
|
43
|
+
|
|
44
|
+
console.log(validate(telegramData)); // false
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
check();
|
|
48
|
+
```
|
|
49
|
+
|
|
21
50
|
## 使える型定義
|
|
22
51
|
|
|
23
52
|
* [EewInformation](https://dmdata.jp/doc/reference/conversion/json/schema/eew-information)
|
package/dist/build.js
CHANGED
|
@@ -29,29 +29,35 @@ const settings = {
|
|
|
29
29
|
const compilerOptions = {
|
|
30
30
|
strictNullChecks: true,
|
|
31
31
|
};
|
|
32
|
-
(0, promises_1.readdir)(config_1.basePath)
|
|
32
|
+
(0, promises_1.readdir)(config_1.basePath, { withFileTypes: true })
|
|
33
|
+
.then(dirs => dirs.filter(dir => dir.isDirectory())
|
|
34
|
+
.map(async (dir) => [dir.name, await (0, promises_1.readdir)((0, path_1.resolve)(config_1.basePath, dir.name))]))
|
|
35
|
+
.then(dirs => Promise.all(dirs))
|
|
36
|
+
.then(dirs => dirs
|
|
37
|
+
.flatMap(([dir, files]) => files.map(file => (0, path_1.resolve)(config_1.basePath, dir, file)))
|
|
38
|
+
.filter(file => /(\d+\.\d+\.\d+)(\.d)?\.ts$/.test(file)))
|
|
33
39
|
.then(files => programTypescript(files));
|
|
34
40
|
async function programTypescript(files) {
|
|
35
41
|
const tsTypeFiles = files.filter(file => /\.ts$/.test(file));
|
|
36
|
-
const filepath = tsTypeFiles.map(file => (0, path_1.resolve)(config_1.basePath, file));
|
|
37
|
-
const program = TJS.getProgramFromFiles(filepath, compilerOptions);
|
|
38
|
-
const generator = TJS.buildGenerator(program, settings);
|
|
39
42
|
const objectMaps = tsTypeFiles.map(file => tsTypeFileName2TypeSymbolName(file));
|
|
40
43
|
await (0, promises_1.rm)(config_1.distDir, { recursive: true, force: true });
|
|
41
44
|
await (0, promises_1.mkdir)(config_1.distDir, { recursive: true });
|
|
42
45
|
for (let i = 0; i < objectMaps.length; i++) {
|
|
43
|
-
const { schemaName, typeName } = objectMaps[i];
|
|
44
|
-
|
|
45
|
-
const schema =
|
|
46
|
-
|
|
46
|
+
const { schemaName, schemaVersion, typeName, file } = objectMaps[i];
|
|
47
|
+
const program = TJS.getProgramFromFiles([file], compilerOptions);
|
|
48
|
+
const schema = TJS.generateSchema(program, typeName, settings);
|
|
49
|
+
console.log(`Build ok: ${schemaName}:${schemaVersion} => ${typeName}`);
|
|
50
|
+
await (0, promises_1.writeFile)((0, path_1.resolve)(config_1.distDir, `${schemaName}_${schemaVersion}.json`), JSON.stringify(schema));
|
|
47
51
|
}
|
|
48
52
|
console.log('Build complete');
|
|
49
53
|
}
|
|
50
54
|
function tsTypeFileName2TypeSymbolName(file) {
|
|
51
|
-
const schemaName = file.
|
|
52
|
-
const nameScope = schemaName
|
|
55
|
+
const [, schemaName = null, schemaVersion = null] = file.match(/([\w-]+?)[\\/](\d+\.\d+\.\d+)(\.d)?\.ts$/) ?? [];
|
|
56
|
+
const nameScope = schemaName?.replace(/-(\w)|(^\w)/g, (match, p1 = '', p2 = '') => `${p1}${p2}`.toUpperCase());
|
|
53
57
|
return {
|
|
54
58
|
schemaName,
|
|
55
|
-
|
|
59
|
+
schemaVersion,
|
|
60
|
+
typeName: nameScope + '.Main',
|
|
61
|
+
file
|
|
56
62
|
};
|
|
57
63
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"anyOf":[{"$ref":"#/definitions/EarthquakeInformation.PublicVXSE51"},{"$ref":"#/definitions/EarthquakeInformation.PublicVXSE52"},{"$ref":"#/definitions/EarthquakeInformation.PublicVXSE53"},{"$ref":"#/definitions/EarthquakeInformation.Channel"}],"definitions":{"EarthquakeInformation.PublicVXSE51":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"type":"string","enum":["震度速報"]},"title":{"type":"string","enum":["震度速報"]},"infoKind":{"type":"string","enum":["震度速報"]},"eventId":{"type":"string"},"serialNo":{"type":"null"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EarthquakeInformation.PublicBodyVXSE51"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["earthquake-information"]},"version":{"type":"string","enum":["1.1.0"]}},"required":["type","version"]},"EarthquakeInformation.PublicBodyVXSE51":{"type":"object","properties":{"intensity":{"type":"object","properties":{"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"},"prefectures":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"}},"required":["code","maxInt","name"]}},"regions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"}},"required":["code","maxInt","name"]}}},"required":["maxInt","prefectures","regions"]},"text":{"type":"string"},"comments":{"$ref":"#/definitions/Omit<EarthquakeInformation.Comment,\"var\">"}},"required":["comments","intensity"]},"EarthquakeInformation.IntensityClass":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"Omit<EarthquakeInformation.Comment,\"var\">":{"type":"object","properties":{"free":{"type":"string"},"forecast":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}},"EarthquakeInformation.PublicVXSE52":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"type":"string","enum":["震源に関する情報"]},"title":{"type":"string","enum":["震源に関する情報"]},"infoKind":{"type":"string","enum":["震源速報"]},"eventId":{"type":"string"},"serialNo":{"type":"null"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EarthquakeInformation.PublicBodyVXSE52"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.PublicBodyVXSE52":{"type":"object","properties":{"earthquake":{"$ref":"#/definitions/Earthquake"},"text":{"type":"string"},"comments":{"$ref":"#/definitions/Omit<EarthquakeInformation.Comment,\"var\">"}},"required":["comments","earthquake"]},"Earthquake":{"type":"object","properties":{"originTime":{"type":"string"},"arrivalTime":{"type":"string"},"hypocenter":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"condition":{"type":"undefined"},"geodeticSystem":{"enum":["日本測地系"],"type":"string"}},"required":["condition","latitude","longitude"]}]},"depth":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"type":"string","enum":["不明"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string","enum":["0"]},"condition":{"type":"string","enum":["ごく浅い"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string","enum":["700"]},"condition":{"type":"string","enum":["700km以上"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]}]},"detailed":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]},"auxiliary":{"type":"object","properties":{"text":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"direction":{"type":"string"},"distance":{"$ref":"#/definitions/Omit<UnitValueNotNull<never,\"km\",never>,\"type\"|\"condition\">"}},"required":["code","direction","distance","name","text"]},"source":{"enum":["PTWC","USGS","WCATWC"],"type":"string"}},"required":["code","coordinate","depth","name"]},"magnitude":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["マグニチュード"]},"unit":{"enum":["M","Mj"],"type":"string"}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"enum":["M不明","M8を超える巨大地震"],"type":"string"}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["マグニチュード"]},"unit":{"enum":["M","Mj"],"type":"string"}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]}]}},"required":["arrivalTime","hypocenter","magnitude","originTime"]},"Omit<UnitValueNotNull<never,\"km\",never>,\"type\"|\"condition\">":{"type":"object","properties":{"unit":{"type":"string","enum":["km"]},"value":{"type":"string"}},"required":["unit","value"]},"EarthquakeInformation.PublicVXSE53":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"type":"string","enum":["震源・震度に関する情報"]},"title":{"enum":["遠地地震に関する情報","震源・震度情報"],"type":"string"},"infoKind":{"type":"string","enum":["地震情報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EarthquakeInformation.PublicBodyVXSE53"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.PublicBodyVXSE53":{"type":"object","properties":{"earthquake":{"$ref":"#/definitions/Earthquake"},"intensity":{"type":"object","properties":{"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"},"prefectures":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"}},"required":["code","name"]}},"regions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"}},"required":["code","name"]}},"cities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"},"condition":{"enum":["震度5弱以上未入電"],"type":"string"}},"required":["code","name"]}},"stations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"int":{"enum":["!5-","1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"},"condition":{"enum":["震度5弱以上未入電"],"type":"string"}},"required":["code","int","name"]}}},"required":["cities","maxInt","prefectures","regions","stations"]},"text":{"type":"string"},"comments":{"type":"object","properties":{"free":{"type":"string"},"forecast":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]},"var":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}}},"required":["comments","earthquake"]},"EarthquakeInformation.Channel":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"enum":["長周期地震動に関する観測情報","震度速報","震源に関する情報","震源・震度に関する情報"],"type":"string"},"title":{"enum":["遠地地震に関する情報","長周期地震動に関する観測情報","震度速報","震源に関する情報","震源・震度情報"],"type":"string"},"infoKind":{"type":"string","enum":["震度速報"]},"eventId":{"type":"string"},"infoType":{"type":"string","enum":["取消"]},"body":{"$ref":"#/definitions/EarthquakeInformation.ChancelBody"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"serialNo":{"type":["null","string"]},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.ChancelBody":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"anyOf":[{"$ref":"#/definitions/EarthquakeInformation.PublicVXSE51"},{"$ref":"#/definitions/EarthquakeInformation.PublicVXSE52"},{"$ref":"#/definitions/EarthquakeInformation.PublicVXSE53"},{"$ref":"#/definitions/EarthquakeInformation.PublicVXSE62"},{"$ref":"#/definitions/EarthquakeInformation.Channel"}],"definitions":{"EarthquakeInformation.PublicVXSE51":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"type":"string","enum":["震度速報"]},"title":{"type":"string","enum":["震度速報"]},"infoKind":{"type":"string","enum":["震度速報"]},"eventId":{"type":"string"},"serialNo":{"type":"null"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EarthquakeInformation.PublicBodyVXSE51"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["earthquake-information"]},"version":{"type":"string","enum":["1.1.0"]}},"required":["type","version"]},"EarthquakeInformation.PublicBodyVXSE51":{"type":"object","properties":{"intensity":{"type":"object","properties":{"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"},"prefectures":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"}},"required":["code","maxInt","name"]}},"regions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"}},"required":["code","maxInt","name"]}}},"required":["maxInt","prefectures","regions"]},"text":{"type":"string"},"comments":{"$ref":"#/definitions/Omit<EarthquakeInformation.Comment,\"var\">"}},"required":["comments","intensity"]},"EarthquakeInformation.IntensityClass":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"Omit<EarthquakeInformation.Comment,\"var\">":{"type":"object","properties":{"free":{"type":"string"},"forecast":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}},"EarthquakeInformation.PublicVXSE52":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"type":"string","enum":["震源に関する情報"]},"title":{"type":"string","enum":["震源に関する情報"]},"infoKind":{"type":"string","enum":["震源速報"]},"eventId":{"type":"string"},"serialNo":{"type":"null"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EarthquakeInformation.PublicBodyVXSE52"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.PublicBodyVXSE52":{"type":"object","properties":{"earthquake":{"$ref":"#/definitions/Earthquake"},"text":{"type":"string"},"comments":{"$ref":"#/definitions/Omit<EarthquakeInformation.Comment,\"var\">"}},"required":["comments","earthquake"]},"Earthquake":{"type":"object","properties":{"originTime":{"type":"string"},"arrivalTime":{"type":"string"},"hypocenter":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"condition":{"type":"undefined"},"geodeticSystem":{"enum":["日本測地系"],"type":"string"}},"required":["condition","latitude","longitude"]}]},"depth":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"type":"string","enum":["不明"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string","enum":["0"]},"condition":{"type":"string","enum":["ごく浅い"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string","enum":["700"]},"condition":{"type":"string","enum":["700km以上"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]}]},"detailed":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]},"auxiliary":{"type":"object","properties":{"text":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"direction":{"type":"string"},"distance":{"$ref":"#/definitions/Omit<UnitValueNotNull<never,\"km\",never>,\"type\"|\"condition\">"}},"required":["code","direction","distance","name","text"]},"source":{"enum":["PTWC","USGS","WCATWC"],"type":"string"}},"required":["code","coordinate","depth","name"]},"magnitude":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["マグニチュード"]},"unit":{"enum":["M","Mj"],"type":"string"}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"enum":["M不明","M8を超える巨大地震"],"type":"string"}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["マグニチュード"]},"unit":{"enum":["M","Mj"],"type":"string"}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]}]}},"required":["arrivalTime","hypocenter","magnitude","originTime"]},"Omit<UnitValueNotNull<never,\"km\",never>,\"type\"|\"condition\">":{"type":"object","properties":{"unit":{"type":"string","enum":["km"]},"value":{"type":"string"}},"required":["unit","value"]},"EarthquakeInformation.PublicVXSE53":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"type":"string","enum":["震源・震度に関する情報"]},"title":{"enum":["遠地地震に関する情報","震源・震度情報"],"type":"string"},"infoKind":{"type":"string","enum":["地震情報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EarthquakeInformation.PublicBodyVXSE53"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.PublicBodyVXSE53":{"type":"object","properties":{"earthquake":{"$ref":"#/definitions/Earthquake"},"intensity":{"type":"object","properties":{"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"},"prefectures":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"}},"required":["code","name"]}},"regions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"}},"required":["code","name"]}},"cities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"},"condition":{"enum":["震度5弱以上未入電"],"type":"string"}},"required":["code","name"]}},"stations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"int":{"enum":["!5-","1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"},"condition":{"enum":["震度5弱以上未入電"],"type":"string"}},"required":["code","int","name"]}}},"required":["cities","maxInt","prefectures","regions","stations"]},"text":{"type":"string"},"comments":{"type":"object","properties":{"free":{"type":"string"},"forecast":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]},"var":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}}},"required":["comments","earthquake"]},"EarthquakeInformation.PublicVXSE62":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"type":"string","enum":["長周期地震動に関する観測情報"]},"title":{"type":"string","enum":["長周期地震動に関する観測情報"]},"infoKind":{"type":"string","enum":["長周期地震動に関する観測情報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EarthquakeInformation.PublicBodyVXSE62"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.PublicBodyVXSE62":{"type":"object","properties":{"earthquake":{"$ref":"#/definitions/Earthquake"},"intensity":{"type":"object","properties":{"maxInt":{"$ref":"#/definitions/EarthquakeInformation.IntensityClass"},"maxLpgmInt":{"$ref":"#/definitions/EarthquakeInformation.LpgmIntensityClass"},"lpgmCategory":{"$ref":"#/definitions/EarthquakeInformation.LpgmCategory"},"prefectures":{"type":"array","items":{"allOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"}},"required":["code","name"]},{"type":"object","properties":{"maxLpgmInt":{"$ref":"#/definitions/EarthquakeInformation.LpgmIntensityClass"}},"required":["maxLpgmInt"]}]}},"regions":{"type":"array","items":{"allOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"maxInt":{"enum":["1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"}},"required":["code","name"]},{"type":"object","properties":{"maxLpgmInt":{"$ref":"#/definitions/EarthquakeInformation.LpgmIntensityClass"}},"required":["maxLpgmInt"]}]}},"stations":{"type":"array","items":{"allOf":[{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"int":{"enum":["!5-","1","2","3","4","5+","5-","6+","6-","7"],"type":"string"},"revise":{"enum":["上方修正","追加"],"type":"string"},"condition":{"enum":["震度5弱以上未入電"],"type":"string"}},"required":["code","int","name"]},{"type":"object","properties":{"lpgmInt":{"$ref":"#/definitions/EarthquakeInformation.LpgmIntensityClass"},"sva":{"type":"object","properties":{"unit":{"type":"string","enum":["cm/s"]},"value":{"type":"string"}},"required":["unit","value"]},"prePeriods":{"type":"array","items":{"type":"object","properties":{"periodicBand":{"type":"object","properties":{"unit":{"type":"string","enum":["秒台"]},"value":{"type":"string"}},"required":["unit","value"]},"lpgmInt":{"$ref":"#/definitions/EarthquakeInformation.LpgmIntensityClass"},"sva":{"type":"object","properties":{"unit":{"type":"string","enum":["cm/s"]},"value":{"type":"string"}},"required":["unit","value"]}},"required":["lpgmInt","periodicBand","sva"]}}},"required":["lpgmInt","prePeriods","sva"]}]}}},"required":["lpgmCategory","maxInt","maxLpgmInt","prefectures","regions","stations"]},"text":{"type":"string"},"comments":{"type":"object","properties":{"free":{"type":"string"},"forecast":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]},"var":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}}},"required":["comments","earthquake"]},"EarthquakeInformation.LpgmIntensityClass":{"enum":["0","1","2","3","4"],"type":"string"},"EarthquakeInformation.LpgmCategory":{"enum":["1","2","3","4"],"type":"string"},"EarthquakeInformation.Channel":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EarthquakeInformation.Schema"},"type":{"enum":["長周期地震動に関する観測情報","震度速報","震源に関する情報","震源・震度に関する情報"],"type":"string"},"title":{"enum":["遠地地震に関する情報","長周期地震動に関する観測情報","震度速報","震源に関する情報","震源・震度情報"],"type":"string"},"infoKind":{"type":"string","enum":["震度速報"]},"eventId":{"type":"string"},"infoType":{"type":"string","enum":["取消"]},"body":{"$ref":"#/definitions/EarthquakeInformation.ChancelBody"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"serialNo":{"type":["null","string"]},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EarthquakeInformation.ChancelBody":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"anyOf":[{"$ref":"#/definitions/EewInformation.PublicTesting"},{"$ref":"#/definitions/EewInformation.PublicCommon"},{"$ref":"#/definitions/EewInformation.Channel"}],"definitions":{"EewInformation.PublicTesting":{"type":"object","properties":{"isLastInfo":{"type":"boolean","enum":[false]},"text":{"type":"string"},"_schema":{"$ref":"#/definitions/EewInformation.Schema"},"type":{"type":"string","enum":["緊急地震速報テスト"]},"title":{"type":"string","enum":["緊急地震速報テスト"]},"infoKind":{"type":"string","enum":["緊急地震速報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EewInformation.PublicTesting"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","isLastInfo","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","text","title","type"]},"EewInformation.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["eew-information"]},"version":{"type":"string","enum":["1.0.0"]}},"required":["type","version"]},"EewInformation.PublicCommon":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EewInformation.Schema"},"type":{"enum":["緊急地震速報(予報)","緊急地震速報(地震動予報)","緊急地震速報(警報)"],"type":"string"},"title":{"enum":["緊急地震速報(予報)","緊急地震速報(地震動予報)","緊急地震速報(警報)"],"type":"string"},"infoKind":{"type":"string","enum":["緊急地震速報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/EewInformation.PublicCommonBody"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EewInformation.PublicCommonBody":{"type":"object","properties":{"isLastInfo":{"type":"boolean"},"zones":{"type":"array","items":{"$ref":"#/definitions/EewInformation.WarningArea"}},"prefectures":{"type":"array","items":{"$ref":"#/definitions/EewInformation.WarningArea"}},"regions":{"type":"array","items":{"$ref":"#/definitions/EewInformation.WarningArea"}},"earthquake":{"$ref":"#/definitions/EewInformation.Earthquake"},"intensity":{"$ref":"#/definitions/EewInformation.Intensity"},"text":{"type":"string"},"comments":{"type":"object","properties":{"free":{"type":"string"},"warning":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}}},"required":["comments","earthquake","isLastInfo"]},"EewInformation.WarningArea":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/definitions/EewInformation.WarningAreaKind"}},"required":["code","kind","name"]},"EewInformation.WarningAreaKind":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"lastKind":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]}},"required":["code","lastKind","name"]},"EewInformation.Earthquake":{"type":"object","properties":{"originTime":{"type":"string"},"arrivalTime":{"type":"string"},"condition":{"enum":["仮定震源要素"],"type":"string"},"hypocenter":{"$ref":"#/definitions/EewInformation.EarthquakeHypocenter"},"magnitude":{"$ref":"#/definitions/EewInformation.EarthquakeMagnitude"}},"required":["arrivalTime","hypocenter","magnitude"]},"EewInformation.EarthquakeHypocenter":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"condition":{"type":"undefined"},"geodeticSystem":{"type":"string","enum":["日本測地系"]}},"required":["condition","geodeticSystem","latitude","longitude"]}]},"depth":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":"string"}},"required":["type","unit","value"]},"reduce":{"$ref":"#/definitions/EewInformation.EarthquakeHypocenterReduce"},"landOrSea":{"enum":["内陸","海域"],"type":"string"},"accuracy":{"$ref":"#/definitions/EewInformation.EarthquakeHypocenterAccuracy"}},"required":["accuracy","code","coordinate","depth","name","reduce"]},"EewInformation.EarthquakeHypocenterReduce":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]},"EewInformation.EarthquakeHypocenterAccuracy":{"type":"object","properties":{"epicenters":{"type":"array","items":[{"enum":["0","1","2","3","4","5","6","7","8"],"type":"string"},{"enum":["0","1","2","3","4","9"],"type":"string"}],"minItems":2,"maxItems":2},"depth":{"enum":["0","1","2","3","4","5","6","7","8"],"type":"string"},"magnitudeCalculation":{"enum":["0","2","3","4","5","6","8"],"type":"string"},"numberOfMagnitudeCalculation":{"enum":["0","1","2","3","4","5"],"type":"string"}},"required":["depth","epicenters","magnitudeCalculation","numberOfMagnitudeCalculation"]},"EewInformation.EarthquakeMagnitude":{"type":"object","properties":{"type":{"type":"string","enum":["マグニチュード"]},"unit":{"enum":["M","Mj"],"type":"string"},"value":{"type":["null","string"]},"condition":{"enum":["M不明"],"type":"string"}},"required":["type","unit","value"]},"EewInformation.Intensity":{"type":"object","properties":{"forecastMaxInt":{"$ref":"#/definitions/EewInformation.IntensityForecastMaxInt"},"forecastLpgmMaxInt":{"$ref":"#/definitions/EewInformation.IntensityForecastLpgmMaxInt"},"appendix":{"$ref":"#/definitions/EewInformation.IntensityAppendix"},"regions":{"type":"array","items":{"$ref":"#/definitions/EewInformation.IntensityRegion"}}},"required":["forecastMaxInt","regions"]},"EewInformation.IntensityForecastMaxInt":{"type":"object","properties":{"from":{"enum":["0","1","2","3","4","5+","5-","6+","6-","7","不明"],"type":"string"},"to":{"enum":["0","1","2","3","4","5+","5-","6+","6-","7","over","不明"],"type":"string"}},"required":["from","to"]},"EewInformation.IntensityForecastLpgmMaxInt":{"type":"object","properties":{"from":{"enum":["0","1","2","3","4","不明"],"type":"string"},"to":{"enum":["0","1","2","3","4","over","不明"],"type":"string"}},"required":["from","to"]},"EewInformation.IntensityAppendix":{"type":"object","properties":{"maxIntChange":{"enum":["0","1","2"],"type":"string"},"maxLpgmIntChange":{"enum":["0","1","2"],"type":"string"},"maxIntChangeReason":{"enum":["0","1","2","3","4","9"],"type":"string"}},"required":["maxIntChange","maxIntChangeReason"]},"EewInformation.IntensityRegion":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"forecastMaxInt":{"$ref":"#/definitions/EewInformation.IntensityForecastMaxInt"},"forecastLpgmMaxInt":{"$ref":"#/definitions/EewInformation.IntensityForecastLpgmMaxInt"},"kind":{"$ref":"#/definitions/EewInformation.WarningAreaKind"}},"required":["code","forecastMaxInt","kind","name"]},"EewInformation.Channel":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/EewInformation.Schema"},"type":{"enum":["緊急地震速報テスト","緊急地震速報(予報)","緊急地震速報(地震動予報)","緊急地震速報(警報)"],"type":"string"},"title":{"enum":["緊急地震速報テスト","緊急地震速報(予報)","緊急地震速報(地震動予報)","緊急地震速報(警報)"],"type":"string"},"infoKind":{"type":"string","enum":["緊急地震速報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"type":"string","enum":["取消"]},"body":{"$ref":"#/definitions/EewInformation.ChancelBody"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"EewInformation.ChancelBody":{"type":"object","properties":{"isLastInfo":{"type":"boolean","enum":[true]},"text":{"type":"string"}},"required":["isLastInfo","text"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"anyOf":[{"$ref":"#/definitions/TsunamiInformation.PublicVTSE41"},{"$ref":"#/definitions/TsunamiInformation.PublicVTSE51"},{"$ref":"#/definitions/TsunamiInformation.PublicVTSE52"},{"$ref":"#/definitions/TsunamiInformation.Channel"}],"definitions":{"TsunamiInformation.PublicVTSE41":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/TsunamiInformation.Schema"},"type":{"type":"string","enum":["津波警報・注意報・予報a"]},"title":{"type":"string"},"infoKind":{"type":"string","enum":["津波警報・注意報・予報"]},"eventId":{"type":"string"},"serialNo":{"type":"null"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/TsunamiInformation.PublicBodyVTSE41"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"TsunamiInformation.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["tsunami-information"]},"version":{"type":"string","enum":["1.0.0"]}},"required":["type","version"]},"TsunamiInformation.PublicBodyVTSE41":{"type":"object","properties":{"tsunami":{"$ref":"#/definitions/TsunamiInformation.PublicBodyVTSE41Tsunami"},"earthquakes":{"type":"array","items":{"$ref":"#/definitions/Earthquake"}},"text":{"type":"string"},"comments":{"type":"object","properties":{"free":{"type":"string"},"warning":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}}},"required":["earthquakes","tsunami"]},"TsunamiInformation.PublicBodyVTSE41Tsunami":{"type":"object","properties":{"forecasts":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastVXSE41"}}},"required":["forecasts"]},"TsunamiInformation.TsunamiForecastVXSE41":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastKind"},"firstHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastFirstHeight"},"maxHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastMaxHeight"}},"required":["code","firstHeight","kind","maxHeight","name"]},"TsunamiInformation.TsunamiForecastKind":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"lastKind":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]}},"required":["code","lastKind","name"]},"TsunamiInformation.TsunamiForecastFirstHeight":{"type":"object","properties":{"arrivalTime":{"type":"string"},"condition":{"enum":["ただちに津波来襲と予測","津波到達中と推測","第1波の到達を確認"],"type":"string"},"revise":{"enum":["更新","追加"],"type":"string"}}},"TsunamiInformation.TsunamiForecastMaxHeight":{"type":"object","properties":{"height":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastMaxHeightValue"},"condition":{"enum":["重要"],"type":"string"},"revise":{"enum":["更新","追加"],"type":"string"}},"required":["height"]},"TsunamiInformation.TsunamiForecastMaxHeightValue":{"type":"object","properties":{"type":{"type":"string","enum":["津波の高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]},"over":{"enum":[true],"type":"boolean"},"condition":{"enum":["巨大","高い"],"type":"string"}},"required":["type","unit","value"]},"Earthquake":{"type":"object","properties":{"originTime":{"type":"string"},"arrivalTime":{"type":"string"},"hypocenter":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"condition":{"type":"undefined"},"geodeticSystem":{"enum":["日本測地系"],"type":"string"}},"required":["condition","latitude","longitude"]}]},"depth":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"type":"string","enum":["不明"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string","enum":["0"]},"condition":{"type":"string","enum":["ごく浅い"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string","enum":["700"]},"condition":{"type":"string","enum":["700km以上"]}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]}]},"detailed":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]},"auxiliary":{"type":"object","properties":{"text":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"direction":{"type":"string"},"distance":{"$ref":"#/definitions/Omit<UnitValueNotNull<never,\"km\",never>,\"type\"|\"condition\">"}},"required":["code","direction","distance","name","text"]},"source":{"enum":["PTWC","USGS","WCATWC"],"type":"string"}},"required":["code","coordinate","depth","name"]},"magnitude":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["マグニチュード"]},"unit":{"enum":["M","Mj"],"type":"string"}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"enum":["M不明","M8を超える巨大地震"],"type":"string"}},"required":["condition","value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["マグニチュード"]},"unit":{"enum":["M","Mj"],"type":"string"}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]}]}},"required":["arrivalTime","hypocenter","magnitude","originTime"]},"Omit<UnitValueNotNull<never,\"km\",never>,\"type\"|\"condition\">":{"type":"object","properties":{"unit":{"type":"string","enum":["km"]},"value":{"type":"string"}},"required":["unit","value"]},"TsunamiInformation.PublicVTSE51":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/TsunamiInformation.Schema"},"type":{"type":"string","enum":["津波情報a"]},"title":{"enum":["各地の満潮時刻・津波到達予想時刻に関する情報","津波観測に関する情報"],"type":"string"},"infoKind":{"type":"string","enum":["津波情報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/TsunamiInformation.PublicBodyVTSE51"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"TsunamiInformation.PublicBodyVTSE51":{"type":"object","properties":{"tsunami":{"$ref":"#/definitions/TsunamiInformation.PublicBodyVTSE51Tsunami"},"earthquakes":{"type":"array","items":{"$ref":"#/definitions/Earthquake"}},"text":{"type":"string"},"comments":{"type":"object","properties":{"free":{"type":"string"},"warning":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}}},"required":["earthquakes","tsunami"]},"TsunamiInformation.PublicBodyVTSE51Tsunami":{"type":"object","properties":{"forecasts":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastVXSE51"}},"observations":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiObservationVXSE51"}}},"required":["forecasts","observations"]},"TsunamiInformation.TsunamiForecastVXSE51":{"type":"object","properties":{"stations":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastStation"}},"code":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastKind"},"firstHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastFirstHeight"},"maxHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastMaxHeight"}},"required":["code","firstHeight","kind","maxHeight","name"]},"TsunamiInformation.TsunamiForecastStation":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"highTideDateTime":{"type":"string"},"firstHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiForecastFirstHeight"}},"required":["code","firstHeight","highTideDateTime","name"]},"TsunamiInformation.TsunamiObservationVXSE51":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"stations":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiObservationStation"}}},"required":["code","name","stations"]},"TsunamiInformation.TsunamiObservationStation":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"sensor":{"type":"string"},"firstHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiObservationStationFirstHeight"},"maxHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiObservationStationMaxHeight"}},"required":["code","firstHeight","maxHeight","name"]},"TsunamiInformation.TsunamiObservationStationFirstHeight":{"type":"object","properties":{"arrivalTime":{"type":"string"},"initial":{"enum":["引き","押し"],"type":"string"},"condition":{"enum":["第1波識別不能"],"type":"string"},"revise":{"enum":["更新","追加"],"type":"string"}},"required":["arrivalTime"]},"TsunamiInformation.TsunamiObservationStationMaxHeight":{"type":"object","properties":{"dateTime":{"type":"string"},"height":{"$ref":"#/definitions/TsunamiInformation.TsunamiObservationStationMaxHeightValue"},"condition":{"enum":["微弱","観測中","重要"],"type":"string"},"revise":{"enum":["更新","追加"],"type":"string"}}},"TsunamiInformation.TsunamiObservationStationMaxHeightValue":{"type":"object","properties":{"type":{"type":"string","enum":["これまでの最大波の高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]},"over":{"enum":[true],"type":"boolean"},"condition":{"enum":["上昇中"],"type":"string"}},"required":["type","unit","value"]},"TsunamiInformation.PublicVTSE52":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/TsunamiInformation.Schema"},"type":{"type":"string","enum":["沖合の津波観測に関する情報"]},"title":{"type":"string","enum":["沖合の津波観測に関する情報"]},"infoKind":{"type":"string","enum":["津波情報"]},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"body":{"$ref":"#/definitions/TsunamiInformation.PublicBodyVTSE52"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"TsunamiInformation.PublicBodyVTSE52":{"type":"object","properties":{"tsunami":{"$ref":"#/definitions/TsunamiInformation.PublicBodyVTSE52Tsunami"},"earthquakes":{"type":"array","items":{"$ref":"#/definitions/Earthquake"}},"text":{"type":"string"},"comments":{"type":"object","properties":{"free":{"type":"string"},"warning":{"type":"object","properties":{"text":{"type":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["codes","text"]}}}},"required":["earthquakes","tsunami"]},"TsunamiInformation.PublicBodyVTSE52Tsunami":{"type":"object","properties":{"observations":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiObservationVXSE52"}},"estimations":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiEstimation"}}},"required":["estimations","observations"]},"TsunamiInformation.TsunamiObservationVXSE52":{"type":"object","properties":{"code":{"type":"null"},"name":{"type":"null"},"stations":{"type":"array","items":{"$ref":"#/definitions/TsunamiInformation.TsunamiObservationStation"}}},"required":["code","name","stations"]},"TsunamiInformation.TsunamiEstimation":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"firstHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiEstimationFirstHeight"},"maxHeight":{"$ref":"#/definitions/TsunamiInformation.TsunamiEstimationMaxHeight"}},"required":["code","firstHeight","maxHeight","name"]},"TsunamiInformation.TsunamiEstimationFirstHeight":{"type":"object","properties":{"arrivalTime":{"type":"string"},"condition":{"enum":["早いところでは既に津波到達と推定"],"type":"string"},"revise":{"enum":["更新","追加"],"type":"string"}},"required":["arrivalTime"]},"TsunamiInformation.TsunamiEstimationMaxHeight":{"type":"object","properties":{"dateTime":{"type":"string"},"height":{"$ref":"#/definitions/TsunamiInformation.TsunamiEstimationMaxHeightValue"},"condition":{"enum":["微弱","観測中","重要"],"type":"string"},"revise":{"enum":["更新","追加"],"type":"string"}}},"TsunamiInformation.TsunamiEstimationMaxHeightValue":{"type":"object","properties":{"type":{"type":"string","enum":["津波の高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]},"over":{"enum":[true],"type":"boolean"}},"required":["type","unit","value"]},"TsunamiInformation.Channel":{"type":"object","properties":{"type":{"enum":["各地の満潮時刻・津波到達予想時刻に関する情報","大津波警報・津波警報・津波予報a","津波情報a","津波観測に関する情報"],"type":"string"},"infoType":{"type":"string","enum":["取消"]},"eventId":{"type":"string"},"body":{"$ref":"#/definitions/TsunamiInformation.ChancelBody"},"_originalId":{"type":"string"},"_schema":{"type":"object","properties":{"type":{"type":"string"},"version":{"type":"string"}},"required":["type","version"]},"title":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"targetDuration":{"type":"string"},"validDateTime":{"type":"string"},"serialNo":{"type":["null","string"]},"infoKind":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"TsunamiInformation.ChancelBody":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"object","properties":{"_schema":{"$ref":"#/definitions/WeatherTyphoon.Schema"},"type":{"enum":["台風解析・予報情報(3日予報)","台風解析・予報情報(5日予報)","台風解析・予報情報(5日予報)(H30)"],"type":"string"},"title":{"type":"string","enum":["台風解析・予報情報"]},"targetDuration":{"type":"string"},"infoKind":{"enum":["台風解析・予報情報(3日予報)","台風解析・予報情報(5日予報)"],"type":"string"},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["取消","発表","訂正"],"type":"string"},"headline":{"type":"null"},"body":{"$ref":"#/definitions/WeatherTyphoon.PublicBody"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"targetDateTimeDubious":{"type":"string"},"validDateTime":{"type":"string"},"infoKindVersion":{"type":"string"}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","targetDuration","title","type"],"definitions":{"WeatherTyphoon.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["weather-typhoon"]},"version":{"type":"string","enum":["1.0.0"]}},"required":["type","version"]},"WeatherTyphoon.PublicBody":{"type":"object","properties":{"typhoon":{"$ref":"#/definitions/WeatherTyphoon.Typhoon"},"forecasts":{"anyOf":[{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":1,"maxItems":1},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":1,"additionalItems":{"$ref":"#/definitions/WeatherTyphoon.Forecast"}},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"},{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":2,"maxItems":2},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"},{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":2,"additionalItems":{"$ref":"#/definitions/WeatherTyphoon.Forecast"}}]}},"required":["forecasts","typhoon"]},"WeatherTyphoon.Typhoon":{"type":"object","properties":{"tcNumber":{"type":"string"},"name":{"$ref":"#/definitions/WeatherTyphoon.TyphoonName"},"remark":{"anyOf":[{"enum":["台風消滅(域外へ出る)","台風消滅(温帯低気圧化)","台風消滅(熱帯低気圧化)","台風発生","台風発生の可能性が小さくなった","台風発生予想","台風発生(域外から入る)","温帯低気圧化しつつある","発表間隔変更(毎時から3時間毎)","発表間隔変更(3時間毎から毎時)"],"type":"string"},{"type":"null"}]}},"required":["name","remark","tcNumber"]},"WeatherTyphoon.TyphoonName":{"type":"object","properties":{"text":{"type":["null","string"]},"kana":{"type":["null","string"]},"number":{"type":["null","string"]}},"required":["kana","number","text"]},"WeatherTyphoon.RealState":{"type":"object","properties":{"type":{"enum":["実況","推定"],"type":"string"},"elapsedTime":{"enum":["PT0H","PT1H"],"type":"string"},"dateTime":{"type":"string"},"classification":{"$ref":"#/definitions/WeatherTyphoon.RealStateClassification"},"center":{"$ref":"#/definitions/WeatherTyphoon.RealStateCenter"},"wind":{"$ref":"#/definitions/WeatherTyphoon.RealStateWind"}},"required":["center","classification","dateTime","elapsedTime","type"]},"WeatherTyphoon.RealStateClassification":{"type":"object","properties":{"category":{"anyOf":[{"enum":["Hurricane","LOW","STS","TD","TY","Tropical Storm"],"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"enum":["ハリケーン","台風","温帯低気圧","熱帯低気圧","発達した熱帯低気圧"],"type":"string"},{"type":"null"}]},"area":{"anyOf":[{"enum":["大型","超大型"],"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"enum":["強い","猛烈な","非常に強い"],"type":"string"},{"type":"null"}]}},"required":["area","category","intensity","name"]},"WeatherTyphoon.RealStateCenter":{"type":"object","properties":{"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"condition":{"type":"undefined"}},"required":["condition","latitude","longitude"]}]},"location":{"type":"string"},"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"speed":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"pressure":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":"string"}},"required":["type","unit","value"]}},"required":["coordinate","direction","location","pressure","speed"]},"WeatherTyphoon.Direction":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]},"azimuth":{"type":["null","string"]},"condition":{"type":"string"}},"required":["azimuth","type","unit","value"]},"WeatherTyphoon.RealStateWind":{"type":"object","properties":{"average":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"instantaneous":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"area":{"$ref":"#/definitions/WeatherTyphoon.RealStateWindArea"}},"required":["area","average","instantaneous"]},"WeatherTyphoon.RealStateWindArea":{"type":"object","properties":{"strong":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}},"storm":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["storm","strong"]},"WeatherTyphoon.Axis":{"type":"object","properties":{"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"radius":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]}},"required":["direction","radius"]},"WeatherTyphoon.Forecast":{"type":"object","properties":{"type":{"enum":["予報","延長予報"],"type":"string"},"elapsedTime":{"type":"string"},"dateTime":{"type":"string"},"classification":{"$ref":"#/definitions/WeatherTyphoon.ForecastClassification"},"center":{"allOf":[{"type":"object","properties":{"probabilityCircle":{"type":"object","properties":{"basePoint":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"condition":{"type":"undefined"}},"required":["condition","latitude","longitude"]}]},"axes":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["axes","basePoint"]}},"required":["probabilityCircle"]},{"$ref":"#/definitions/Omit<WeatherTyphoon.RealStateCenter,\"location\">"}]},"wind":{"$ref":"#/definitions/WeatherTyphoon.ForecastWind"}},"required":["center","classification","dateTime","elapsedTime","type","wind"]},"WeatherTyphoon.ForecastClassification":{"type":"object","properties":{"name":{"anyOf":[{"enum":["ハリケーン","台風","温帯低気圧","熱帯低気圧","発達した熱帯低気圧"],"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"enum":["Hurricane","LOW","STS","TD","TY","Tropical Storm"],"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"enum":["強い","猛烈な","非常に強い"],"type":"string"},{"type":"null"}]}},"required":["category","intensity","name"]},"Omit<WeatherTyphoon.RealStateCenter,\"location\">":{"type":"object","properties":{"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["深さ"]},"unit":{"type":"string","enum":["km"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"condition":{"type":"undefined"}},"required":["condition","latitude","longitude"]}]},"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"speed":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"pressure":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":"string"}},"required":["type","unit","value"]}},"required":["coordinate","direction","pressure","speed"]},"WeatherTyphoon.ForecastWind":{"type":"object","properties":{"average":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"instantaneous":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"area":{"$ref":"#/definitions/WeatherTyphoon.ForecastWindArea"}},"required":["area","average","instantaneous"]},"WeatherTyphoon.ForecastWindArea":{"type":"object","properties":{"stormWarning":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["stormWarning"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
|
package/dist/jschema-load.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getJSchema(name: string): Promise<any
|
|
1
|
+
export declare function getJSchema(name: string, version?: string): Promise<any>;
|
package/dist/jschema-load.js
CHANGED
|
@@ -24,15 +24,21 @@ const fs_1 = require("fs");
|
|
|
24
24
|
const path_1 = require("path");
|
|
25
25
|
const config_1 = require("./config");
|
|
26
26
|
const schemas = new Map();
|
|
27
|
-
const jschemaList = (0, fs_1.readdirSync)(config_1.distDir)
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const jschemaList = (0, fs_1.readdirSync)(config_1.distDir)
|
|
28
|
+
.filter(file => /\.json$/.test(file))
|
|
29
|
+
.sort();
|
|
30
|
+
jschemaList.forEach(file => {
|
|
31
|
+
const [, schemaName, schemaVersion] = file.match(/^([\w-]+)_(\w+\.\w+\.\w+)\.json$/) ?? [];
|
|
32
|
+
const schemaVersions = schemas.get(schemaName) ?? schemas.set(schemaName, new Map()).get(schemaName);
|
|
33
|
+
const jschemaFile = (0, path_1.resolve)(config_1.distDir, file);
|
|
34
|
+
schemaVersions?.set(schemaVersion, jschemaFile);
|
|
35
|
+
schemaVersions?.set('latest', jschemaFile);
|
|
30
36
|
});
|
|
31
|
-
function getJSchema(name) {
|
|
32
|
-
const filePath = schemas.get(name);
|
|
37
|
+
async function getJSchema(name, version = 'latest') {
|
|
38
|
+
const filePath = schemas.get(name)?.get(version);
|
|
33
39
|
if (!filePath) {
|
|
34
40
|
return null;
|
|
35
41
|
}
|
|
36
|
-
return Promise.resolve().then(() => __importStar(require(filePath)));
|
|
42
|
+
return await Promise.resolve().then(() => __importStar(require(filePath)));
|
|
37
43
|
}
|
|
38
44
|
exports.getJSchema = getJSchema;
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './dist/jschema-load'
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './dist/jschema-load'
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dmdata/telegram-json-types",
|
|
3
|
-
"version": "1.0.9-jschema.
|
|
3
|
+
"version": "1.0.9-jschema.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build:jschema": "npx tsc --project tsconfig.jschema.json",
|
|
6
|
-
"build:dist-jschema": "
|
|
6
|
+
"build:dist-jschema": "node ./dist/build.js",
|
|
7
7
|
"prepublishOnly": "npm run build:jschema && npm run build:dist-jschema",
|
|
8
8
|
"publish:npm": "npm version patch && npm publish --access=public"
|
|
9
9
|
},
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"main": "./dist/jschema-load.js",
|
|
12
12
|
"keywords": [],
|
|
13
13
|
"author": "",
|
|
14
|
-
"license": "
|
|
14
|
+
"license": "MIT",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "^14.18.9",
|
|
17
17
|
"typescript": "^4.5.5",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as EarthquakeInformation from './schema/earthquake-information';
|
|
2
|
+
import * as EewInformation from './schema/eew-information';
|
|
3
|
+
import * as WeatherTyphoon from './schema/eew-information';
|
|
4
|
+
import * as TsunamiInformation from './schema/tsunami-information';
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
EarthquakeInformation,
|
|
8
|
+
EewInformation,
|
|
9
|
+
TsunamiInformation,
|
|
10
|
+
WeatherTyphoon
|
|
11
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Earthquake } from '../../component/earthquake';
|
|
2
|
+
import { TelegramJSONMain } from '../../main';
|
|
3
|
+
|
|
4
|
+
export namespace EarthquakeInformation {
|
|
5
|
+
export interface Schema {
|
|
6
|
+
type: 'earthquake-information';
|
|
7
|
+
version: '1.1.0';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type IntensityClass = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
|
|
11
|
+
|
|
12
|
+
export type IntensityMaxInt = {
|
|
13
|
+
name: string;
|
|
14
|
+
code: string;
|
|
15
|
+
maxInt: IntensityClass;
|
|
16
|
+
};
|
|
17
|
+
export type IntensityMaxIntOnRevise = {
|
|
18
|
+
name: string;
|
|
19
|
+
code: string;
|
|
20
|
+
maxInt?: IntensityClass;
|
|
21
|
+
revise?: '上方修正' | '追加';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type IntensityCity = {
|
|
25
|
+
name: string;
|
|
26
|
+
code: string;
|
|
27
|
+
maxInt?: IntensityClass;
|
|
28
|
+
revise?: '上方修正' | '追加';
|
|
29
|
+
condition?: '震度5弱以上未入電';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type IntensityStation = {
|
|
33
|
+
name: string;
|
|
34
|
+
code: string;
|
|
35
|
+
int: IntensityClass | '!5-';
|
|
36
|
+
revise?: '上方修正' | '追加';
|
|
37
|
+
condition?: '震度5弱以上未入電';
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type Comment = {
|
|
41
|
+
free?: string;
|
|
42
|
+
forecast?: {
|
|
43
|
+
text: string;
|
|
44
|
+
codes: string[];
|
|
45
|
+
};
|
|
46
|
+
var?: {
|
|
47
|
+
text: string;
|
|
48
|
+
codes: string[];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export type IntensityVXSE51 = {
|
|
54
|
+
maxInt: IntensityClass;
|
|
55
|
+
prefectures: IntensityMaxInt[];
|
|
56
|
+
regions: IntensityMaxInt[];
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type IntensityVXSE53 = {
|
|
60
|
+
maxInt: IntensityClass;
|
|
61
|
+
prefectures: IntensityMaxIntOnRevise[];
|
|
62
|
+
regions: IntensityMaxIntOnRevise[];
|
|
63
|
+
cities: IntensityCity[];
|
|
64
|
+
stations: IntensityStation[];
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
export interface PublicBodyVXSE51 {
|
|
69
|
+
intensity: IntensityVXSE51;
|
|
70
|
+
text?: string;
|
|
71
|
+
comments: Omit<Comment, 'var'>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface PublicBodyVXSE52 {
|
|
75
|
+
earthquake: Earthquake;
|
|
76
|
+
text?: string;
|
|
77
|
+
comments: Omit<Comment, 'var'>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface PublicBodyVXSE53 {
|
|
81
|
+
earthquake: Earthquake;
|
|
82
|
+
intensity?: IntensityVXSE53;
|
|
83
|
+
text?: string;
|
|
84
|
+
comments: Comment;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface ChancelBody {
|
|
88
|
+
text: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface PublicVXSE51 extends TelegramJSONMain {
|
|
92
|
+
_schema: Schema;
|
|
93
|
+
type: '震度速報';
|
|
94
|
+
title: '震度速報';
|
|
95
|
+
infoKind: '震度速報';
|
|
96
|
+
eventId: string;
|
|
97
|
+
serialNo: null;
|
|
98
|
+
infoType: '発表' | '訂正';
|
|
99
|
+
body: PublicBodyVXSE51;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface PublicVXSE52 extends TelegramJSONMain {
|
|
103
|
+
_schema: Schema;
|
|
104
|
+
type: '震源に関する情報';
|
|
105
|
+
title: '震源に関する情報';
|
|
106
|
+
infoKind: '震源速報';
|
|
107
|
+
eventId: string;
|
|
108
|
+
serialNo: null;
|
|
109
|
+
infoType: '発表' | '訂正';
|
|
110
|
+
body: PublicBodyVXSE52;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface PublicVXSE53 extends TelegramJSONMain {
|
|
114
|
+
_schema: Schema;
|
|
115
|
+
type: '震源・震度に関する情報';
|
|
116
|
+
title: '震源・震度情報' | '遠地地震に関する情報';
|
|
117
|
+
infoKind: '地震情報';
|
|
118
|
+
eventId: string;
|
|
119
|
+
serialNo: string;
|
|
120
|
+
infoType: '発表' | '訂正';
|
|
121
|
+
body: PublicBodyVXSE53;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface Channel extends TelegramJSONMain {
|
|
125
|
+
_schema: Schema;
|
|
126
|
+
type: '震度速報' | '震源に関する情報' | '震源・震度に関する情報' | '長周期地震動に関する観測情報';
|
|
127
|
+
title: '震度速報' | '震源に関する情報' | '震源・震度情報' | '遠地地震に関する情報' | '長周期地震動に関する観測情報';
|
|
128
|
+
infoKind: '震度速報';
|
|
129
|
+
eventId: string;
|
|
130
|
+
infoType: '取消';
|
|
131
|
+
body: ChancelBody;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export type Main = (PublicVXSE51 | PublicVXSE52 | PublicVXSE53) | Channel;
|
|
135
|
+
}
|