@dmdata/telegram-json-types 1.0.9-jschema.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -3
- package/dist/build.js +22 -11
- package/dist/config.d.ts +2 -1
- package/dist/config.js +3 -2
- package/dist/jschema/earthquake-counts_1.0.0.json +1 -0
- package/dist/jschema/earthquake-explanation_1.0.0.json +1 -0
- package/dist/jschema/earthquake-hypocenter-update_1.0.0.json +1 -0
- 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/earthquake-nankai_1.0.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/volcano-information_1.0.0.json +1 -0
- package/dist/jschema/weather-early_1.0.0.json +1 -0
- package/dist/jschema/weather-impact-society_1.0.0.json +1 -0
- package/dist/jschema/weather-information_1.0.0.json +1 -0
- package/dist/jschema/weather-landslide_1.0.0.json +1 -0
- package/dist/jschema/weather-river-flood_1.0.0.json +1 -0
- package/dist/jschema/weather-tornado_1.0.0.json +1 -0
- package/dist/jschema/weather-typhoon_1.0.0.json +1 -0
- package/dist/jschema/weather-warning_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/jest.config.ts +202 -0
- package/package.json +29 -21
- package/test/sample-schema-check.test.ts +54 -0
- package/tsconfig.json +28 -15
- package/types/component/code-name.ts +4 -0
- package/types/{schema/component → component}/coordinate.d.ts +2 -2
- package/types/{schema/component → component}/earthquake.d.ts +0 -0
- package/types/{schema/component → component}/unit-value.d.ts +13 -13
- package/types/index.d.ts +35 -4
- package/types/schema/earthquake-counts/1.0.0.d.ts +69 -0
- package/types/schema/earthquake-counts/index.d.ts +7 -0
- package/types/schema/earthquake-explanation/1.0.0.d.ts +57 -0
- package/types/schema/earthquake-explanation/index.d.ts +7 -0
- package/types/schema/earthquake-hypocenter-update/1.0.0.d.ts +53 -0
- package/types/schema/earthquake-hypocenter-update/index.d.ts +7 -0
- package/types/schema/earthquake-information/1.0.0.d.ts +159 -0
- package/types/schema/{earthquake-information.d.ts → earthquake-information/1.1.0.d.ts} +206 -181
- package/types/schema/earthquake-information/index.d.ts +9 -0
- package/types/schema/earthquake-nankai/1.0.0.d.ts +86 -0
- package/types/schema/earthquake-nankai/index.d.ts +7 -0
- package/types/schema/{eew-information.d.ts → eew-information/1.0.0.d.ts} +42 -39
- package/types/schema/eew-information/index.d.ts +7 -0
- package/types/schema/{tsunami-information.d.ts → tsunami-information/1.0.0.d.ts} +262 -230
- package/types/schema/tsunami-information/index.d.ts +7 -0
- package/types/schema/volcano-information/1.0.0.d.ts +450 -0
- package/types/schema/volcano-information/index.d.ts +7 -0
- package/types/schema/weather-early/1.0.0.d.ts +135 -0
- package/types/schema/weather-early/index.d.ts +7 -0
- package/types/schema/weather-impact-society/1.0.0.d.ts +140 -0
- package/types/schema/weather-impact-society/index.d.ts +7 -0
- package/types/schema/weather-information/1.0.0.d.ts +30 -0
- package/types/schema/weather-information/index.d.ts +7 -0
- package/types/schema/weather-landslide/1.0.0.d.ts +51 -0
- package/types/schema/weather-landslide/index.d.ts +7 -0
- package/types/schema/weather-river-flood/1.0.0.d.ts +188 -0
- package/types/schema/weather-river-flood/index.d.ts +7 -0
- package/types/schema/weather-tornado/1.0.0.d.ts +51 -0
- package/types/schema/weather-tornado/index.d.ts +7 -0
- package/types/schema/{weather-typhoon.d.ts → weather-typhoon/1.0.0.d.ts} +26 -13
- package/types/schema/weather-typhoon/index.d.ts +7 -0
- package/types/schema/weather-warning/1.0.0.d.ts +212 -0
- package/types/schema/weather-warning/index.d.ts +7 -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/package.json
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dmdata/telegram-json-types",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"scripts": {
|
|
5
|
-
"build:jschema": "npx tsc --project tsconfig.
|
|
6
|
-
"build:dist-jschema": "
|
|
7
|
-
"prepublishOnly": "npm run build:jschema && npm run build:dist-jschema",
|
|
8
|
-
"publish:npm": "npm version patch && npm publish --access=public"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@dmdata/telegram-json-types",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build:jschema": "npx tsc --project jschema/tsconfig.json",
|
|
6
|
+
"build:dist-jschema": "node ./dist/build.js",
|
|
7
|
+
"prepublishOnly": "npm run build:jschema && npm run build:dist-jschema",
|
|
8
|
+
"publish:npm": "npm version patch && npm publish --access=public",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"type-test": "npm run build:dist-jschema && npm run test"
|
|
11
|
+
},
|
|
12
|
+
"types": "index.d.ts",
|
|
13
|
+
"main": "./dist/jschema-load.js",
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/jest": "^27.4.0",
|
|
19
|
+
"@types/node": "^14.18.9",
|
|
20
|
+
"@types/node-fetch": "^2.5.12",
|
|
21
|
+
"ajv": "^8.9.0",
|
|
22
|
+
"jest": "^27.4.7",
|
|
23
|
+
"node-fetch": "^2.6.7",
|
|
24
|
+
"ts-jest": "^27.1.3",
|
|
25
|
+
"ts-node": "^10.4.0",
|
|
26
|
+
"typescript": "^4.5.5",
|
|
27
|
+
"typescript-json-schema": "^0.53.0"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Ajv from 'ajv';
|
|
2
|
+
import fetch from 'node-fetch';
|
|
3
|
+
import { getJSchema } from '../jschema/jschema-load';
|
|
4
|
+
|
|
5
|
+
const checkSchemaTypes = [
|
|
6
|
+
'eew-information',
|
|
7
|
+
'earthquake-information',
|
|
8
|
+
'earthquake-explanation',
|
|
9
|
+
'earthquake-counts',
|
|
10
|
+
'earthquake-hypocenter-update',
|
|
11
|
+
'earthquake-nankai',
|
|
12
|
+
'tsunami-information',
|
|
13
|
+
'volcano-information',
|
|
14
|
+
'weather-information',
|
|
15
|
+
'weather-impact-society',
|
|
16
|
+
'weather-early',
|
|
17
|
+
'weather-warning',
|
|
18
|
+
'weather-tornado',
|
|
19
|
+
'weather-typhoon',
|
|
20
|
+
'weather-landslide',
|
|
21
|
+
'weather-river-flood'
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const ajv = new Ajv({
|
|
25
|
+
strictTuples: false
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test.each(checkSchemaTypes)('CheckSchemaType: %s', async schemaType => {
|
|
29
|
+
const sampleList = await getList(schemaType);
|
|
30
|
+
|
|
31
|
+
for (let i = 0; i < sampleList.length; i++) {
|
|
32
|
+
const url = sampleList[i];
|
|
33
|
+
const json: any = await fetch(url).then(res => res.json());
|
|
34
|
+
const schema = await getJSchema(json._schema.type, json._schema.version);
|
|
35
|
+
const validate = ajv.compile(schema);
|
|
36
|
+
const valid = validate(json);
|
|
37
|
+
|
|
38
|
+
console.group(url);
|
|
39
|
+
expect(validate.errors ?? []).toEqual([]);
|
|
40
|
+
console.groupEnd();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
async function getList(schemaType: string) {
|
|
46
|
+
const url = `https://sample.dmdata.jp/conversion/json/schema/${schemaType}/`;
|
|
47
|
+
return await fetch(url).then(res => res.text())
|
|
48
|
+
.then(html => html
|
|
49
|
+
.replace(/^.+?<pre>.+?<hr>(.+?)<\/pre>.+?$/s, '$1')
|
|
50
|
+
.match(/<a\shref="(.+?)">/g)
|
|
51
|
+
?.map(a => url + a.replace(/^<a\shref="(.+?)">$/, '$1'))
|
|
52
|
+
.filter(href => /\.json$/.test(href)) ?? []
|
|
53
|
+
);
|
|
54
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"target": "es2020",
|
|
5
|
-
"sourceMap": false,
|
|
6
|
-
"alwaysStrict": true,
|
|
7
|
-
"noImplicitThis": true,
|
|
8
|
-
"noImplicitReturns": true,
|
|
9
|
-
"noFallthroughCasesInSwitch": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"baseUrl": "./",
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"target": "es2020",
|
|
5
|
+
"sourceMap": false,
|
|
6
|
+
"alwaysStrict": true,
|
|
7
|
+
"noImplicitThis": true,
|
|
8
|
+
"noImplicitReturns": true,
|
|
9
|
+
"noFallthroughCasesInSwitch": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"baseUrl": "./",
|
|
14
|
+
"paths": {
|
|
15
|
+
"@t/*": [
|
|
16
|
+
"./types/*"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"include": [
|
|
21
|
+
"types/**/*",
|
|
22
|
+
"test/**/*"
|
|
23
|
+
],
|
|
24
|
+
"exclude": [
|
|
25
|
+
"jschema",
|
|
26
|
+
"node_modules"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -3,8 +3,8 @@ import { UnitValue } from './unit-value';
|
|
|
3
3
|
export type Coordinate<Geo = never> = {
|
|
4
4
|
latitude: { text: string, value: string };
|
|
5
5
|
longitude: { text: string, value: string };
|
|
6
|
-
height?: UnitValue<'
|
|
7
|
-
condition:
|
|
6
|
+
height?: UnitValue<'高さ', 'm'>;
|
|
7
|
+
condition: never;
|
|
8
8
|
geodeticSystem: Geo;
|
|
9
9
|
} | {
|
|
10
10
|
latitude: never;
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export type UnitValue<Type = string, Unit = string, Condition = never> = {
|
|
2
|
-
type: Type;
|
|
3
|
-
unit: Unit;
|
|
4
|
-
value: string | null;
|
|
5
|
-
condition: Condition
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type UnitValueNotNull<Type = string, Unit = string, Condition = never> = {
|
|
9
|
-
type: Type;
|
|
10
|
-
unit: Unit;
|
|
11
|
-
value: string;
|
|
12
|
-
condition: Condition
|
|
13
|
-
};
|
|
1
|
+
export type UnitValue<Type = string, Unit = string, Condition = never> = {
|
|
2
|
+
type: Type;
|
|
3
|
+
unit: Unit;
|
|
4
|
+
value: string | null;
|
|
5
|
+
condition: Condition
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type UnitValueNotNull<Type = string, Unit = string, Condition = never> = {
|
|
9
|
+
type: Type;
|
|
10
|
+
unit: Unit;
|
|
11
|
+
value: string;
|
|
12
|
+
condition: Condition
|
|
13
|
+
};
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as EarthquakeInformation from './schema/earthquake-information';
|
|
2
|
+
import * as EarthquakeExplanation from './schema/earthquake-explanation';
|
|
3
|
+
import * as EarthquakeCounts from './schema/earthquake-counts';
|
|
4
|
+
import * as EarthquakeHypocenterUpdate from './schema/earthquake-hypocenter-update';
|
|
5
|
+
import * as EarthquakeNankai from './schema/earthquake-nankai';
|
|
6
|
+
import * as EewInformation from './schema/eew-information';
|
|
7
|
+
import * as TsunamiInformation from './schema/tsunami-information';
|
|
8
|
+
import * as VolcanoInformation from './schema/volcano-information';
|
|
9
|
+
import * as WeatherInformation from './schema/weather-information';
|
|
10
|
+
import * as WeatherImpactSociety from './schema/weather-impact-society';
|
|
11
|
+
import * as WeatherEarly from './schema/weather-early';
|
|
12
|
+
import * as WeatherWarning from './schema/weather-warning';
|
|
13
|
+
import * as WeatherTornado from './schema/weather-tornado';
|
|
14
|
+
import * as WeatherTyphoon from './schema/weather-typhoon';
|
|
15
|
+
import * as WeatherLandslide from './schema/weather-landslide';
|
|
16
|
+
import * as WeatherRiverFlood from './schema/weather-river-flood';
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
EarthquakeInformation,
|
|
20
|
+
EarthquakeExplanation,
|
|
21
|
+
EarthquakeCounts,
|
|
22
|
+
EarthquakeHypocenterUpdate,
|
|
23
|
+
EarthquakeNankai,
|
|
24
|
+
EewInformation,
|
|
25
|
+
TsunamiInformation,
|
|
26
|
+
VolcanoInformation,
|
|
27
|
+
WeatherInformation,
|
|
28
|
+
WeatherImpactSociety,
|
|
29
|
+
WeatherEarly,
|
|
30
|
+
WeatherWarning,
|
|
31
|
+
WeatherTornado,
|
|
32
|
+
WeatherTyphoon,
|
|
33
|
+
WeatherLandslide,
|
|
34
|
+
WeatherRiverFlood
|
|
35
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { TelegramJSONMain } from '@t/main';
|
|
2
|
+
|
|
3
|
+
export namespace EarthquakeCounts {
|
|
4
|
+
export interface Schema {
|
|
5
|
+
type: 'earthquake-counts';
|
|
6
|
+
version: '1.0.0';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface EarthquakeCountTargetTime {
|
|
10
|
+
start: string;
|
|
11
|
+
end: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface EarthquakeCountValues {
|
|
15
|
+
all: string | null;
|
|
16
|
+
felt: string | null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface EarthquakeCount {
|
|
20
|
+
type: '1時間地震回数' | '累積地震回数' | '地震回数';
|
|
21
|
+
targetTime: EarthquakeCountTargetTime;
|
|
22
|
+
values: EarthquakeCountValues;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface Comments {
|
|
26
|
+
free: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface PublicBody {
|
|
30
|
+
earthquakeCounts?: EarthquakeCount[];
|
|
31
|
+
nextAdvisory?: string;
|
|
32
|
+
text?: string;
|
|
33
|
+
comments?: Comments;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface CancelBody {
|
|
37
|
+
text: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Public extends TelegramJSONMain {
|
|
41
|
+
_schema: Schema;
|
|
42
|
+
type: '地震回数に関する情報';
|
|
43
|
+
title: '地震回数に関する情報';
|
|
44
|
+
infoType: '発表' | '訂正';
|
|
45
|
+
targetDateTimeDubious: never;
|
|
46
|
+
targetDuration: never;
|
|
47
|
+
validDateTime: never;
|
|
48
|
+
eventId: string;
|
|
49
|
+
serialNo: string;
|
|
50
|
+
infoKind: '地震回数情報';
|
|
51
|
+
body: PublicBody;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface Cancel extends TelegramJSONMain {
|
|
55
|
+
_schema: Schema;
|
|
56
|
+
type: '地震回数に関する情報';
|
|
57
|
+
title: '地震回数に関する情報';
|
|
58
|
+
infoType: '取消';
|
|
59
|
+
targetDateTimeDubious: never;
|
|
60
|
+
targetDuration: never;
|
|
61
|
+
validDateTime: never;
|
|
62
|
+
eventId: string;
|
|
63
|
+
serialNo: string;
|
|
64
|
+
infoKind: '地震回数情報';
|
|
65
|
+
body: CancelBody;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type Main = Public | Cancel;
|
|
69
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { TelegramJSONMain } from '@t/main';
|
|
2
|
+
|
|
3
|
+
export namespace EarthquakeExplanation {
|
|
4
|
+
export interface Schema {
|
|
5
|
+
type: 'earthquake-explanation';
|
|
6
|
+
version: '1.0.0';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Naming {
|
|
10
|
+
text: string;
|
|
11
|
+
en?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Comments {
|
|
15
|
+
free: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface PublicBody {
|
|
19
|
+
naming?: Naming;
|
|
20
|
+
text: string;
|
|
21
|
+
comments?: Comments;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CancelBody {
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Public extends TelegramJSONMain {
|
|
29
|
+
_schema: Schema;
|
|
30
|
+
type: '地震の活動状況等に関する情報';
|
|
31
|
+
title: '地震の活動状況等に関する情報';
|
|
32
|
+
infoType: '発表' | '訂正';
|
|
33
|
+
targetDateTimeDubious: never;
|
|
34
|
+
targetDuration: never;
|
|
35
|
+
validDateTime: never;
|
|
36
|
+
eventId: string;
|
|
37
|
+
serialNo: null;
|
|
38
|
+
infoKind: '地震の活動状況等に関する情報';
|
|
39
|
+
body: PublicBody;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Cancel extends TelegramJSONMain {
|
|
43
|
+
_schema: Schema;
|
|
44
|
+
type: '地震の活動状況等に関する情報';
|
|
45
|
+
title: '地震の活動状況等に関する情報';
|
|
46
|
+
infoType: '取消';
|
|
47
|
+
targetDateTimeDubious: never;
|
|
48
|
+
targetDuration: never;
|
|
49
|
+
validDateTime: never;
|
|
50
|
+
eventId: string;
|
|
51
|
+
serialNo: null;
|
|
52
|
+
infoKind: '地震の活動状況等に関する情報';
|
|
53
|
+
body: CancelBody;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type Main = Public | Cancel;
|
|
57
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TelegramJSONMain } from '@t/main';
|
|
2
|
+
import { Earthquake } from '@t/component/earthquake';
|
|
3
|
+
|
|
4
|
+
export namespace EarthquakeHypocenterUpdate {
|
|
5
|
+
export interface Schema {
|
|
6
|
+
type: 'earthquake-hypocenter-update';
|
|
7
|
+
version: '1.0.0';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Comments {
|
|
11
|
+
free: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PublicBody {
|
|
15
|
+
earthquake: Earthquake;
|
|
16
|
+
text?: string;
|
|
17
|
+
comments?: Comments;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CancelBody {
|
|
21
|
+
text: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Public extends TelegramJSONMain {
|
|
25
|
+
_schema: Schema;
|
|
26
|
+
type: '顕著な地震の震源要素更新のお知らせ';
|
|
27
|
+
title: '顕著な地震の震源要素更新のお知らせ';
|
|
28
|
+
infoType: '発表' | '訂正';
|
|
29
|
+
targetDateTimeDubious: never;
|
|
30
|
+
targetDuration: never;
|
|
31
|
+
validDateTime: never;
|
|
32
|
+
eventId: string;
|
|
33
|
+
serialNo: null;
|
|
34
|
+
infoKind: '震源要素更新のお知らせ';
|
|
35
|
+
body: PublicBody;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Cancel extends TelegramJSONMain {
|
|
39
|
+
_schema: Schema;
|
|
40
|
+
type: '顕著な地震の震源要素更新のお知らせ';
|
|
41
|
+
title: '顕著な地震の震源要素更新のお知らせ';
|
|
42
|
+
infoType: '取消';
|
|
43
|
+
targetDateTimeDubious: never;
|
|
44
|
+
targetDuration: never;
|
|
45
|
+
validDateTime: never;
|
|
46
|
+
eventId: string;
|
|
47
|
+
serialNo: null;
|
|
48
|
+
infoKind: '震源要素更新のお知らせ';
|
|
49
|
+
body: CancelBody;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type Main = Public | Cancel;
|
|
53
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { TelegramJSONMain } from '@t/main';
|
|
2
|
+
import { CodeName } from '@t/component/code-name';
|
|
3
|
+
import { Earthquake } from '@t/component/earthquake';
|
|
4
|
+
|
|
5
|
+
export namespace EarthquakeInformation {
|
|
6
|
+
export interface Schema {
|
|
7
|
+
type: 'earthquake-information';
|
|
8
|
+
version: '1.0.0';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type IntensityClass = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
|
|
12
|
+
|
|
13
|
+
export interface IntensityMaxInt extends CodeName {
|
|
14
|
+
maxInt: IntensityClass;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IntensityMaxIntOnRevise extends CodeName {
|
|
18
|
+
maxInt?: IntensityClass;
|
|
19
|
+
revise?: '上方修正' | '追加';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IntensityCity extends CodeName {
|
|
23
|
+
maxInt?: IntensityClass;
|
|
24
|
+
revise?: '上方修正' | '追加';
|
|
25
|
+
condition?: '震度5弱以上未入電';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IntensityStation extends CodeName {
|
|
29
|
+
int: IntensityClass | '!5-';
|
|
30
|
+
revise?: '上方修正' | '追加';
|
|
31
|
+
condition?: '震度5弱以上未入電';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type Comment = {
|
|
35
|
+
free?: string;
|
|
36
|
+
forecast?: {
|
|
37
|
+
text: string;
|
|
38
|
+
codes: string[];
|
|
39
|
+
};
|
|
40
|
+
var?: {
|
|
41
|
+
text: string;
|
|
42
|
+
codes: string[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export interface IntensityVXSE51 {
|
|
48
|
+
maxInt: IntensityClass;
|
|
49
|
+
prefectures: IntensityMaxInt[];
|
|
50
|
+
regions: IntensityMaxInt[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IntensityVXSE53 {
|
|
54
|
+
maxInt: IntensityClass;
|
|
55
|
+
prefectures: IntensityMaxIntOnRevise[];
|
|
56
|
+
regions: IntensityMaxIntOnRevise[];
|
|
57
|
+
cities: IntensityCity[];
|
|
58
|
+
stations: IntensityStation[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export interface PublicBodyVXSE51 {
|
|
63
|
+
intensity: IntensityVXSE51;
|
|
64
|
+
text?: string;
|
|
65
|
+
comments: Omit<Comment, 'var'>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PublicBodyVXSE52 {
|
|
69
|
+
earthquake: Earthquake;
|
|
70
|
+
text?: string;
|
|
71
|
+
comments: Omit<Comment, 'var'>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface PublicBodyVXSE53 {
|
|
75
|
+
earthquake: Earthquake;
|
|
76
|
+
intensity?: IntensityVXSE53;
|
|
77
|
+
text?: string;
|
|
78
|
+
comments: Comment;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface PublicBodyVXZSE40 {
|
|
82
|
+
text: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface CancelBody {
|
|
86
|
+
text: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface PublicVXSE51 extends TelegramJSONMain {
|
|
90
|
+
_schema: Schema;
|
|
91
|
+
type: '震度速報';
|
|
92
|
+
title: '震度速報';
|
|
93
|
+
infoType: '発表' | '訂正';
|
|
94
|
+
targetDateTimeDubious: never;
|
|
95
|
+
targetDuration: never;
|
|
96
|
+
validDateTime: never;
|
|
97
|
+
eventId: string;
|
|
98
|
+
serialNo: null;
|
|
99
|
+
infoKind: '震度速報';
|
|
100
|
+
body: PublicBodyVXSE51;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface PublicVXSE52 extends TelegramJSONMain {
|
|
104
|
+
_schema: Schema;
|
|
105
|
+
type: '震源に関する情報';
|
|
106
|
+
title: '震源に関する情報';
|
|
107
|
+
infoType: '発表' | '訂正';
|
|
108
|
+
targetDateTimeDubious: never;
|
|
109
|
+
targetDuration: never;
|
|
110
|
+
validDateTime: never;
|
|
111
|
+
eventId: string;
|
|
112
|
+
serialNo: null;
|
|
113
|
+
infoKind: '震源速報';
|
|
114
|
+
body: PublicBodyVXSE52;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface PublicVXSE53 extends TelegramJSONMain {
|
|
118
|
+
_schema: Schema;
|
|
119
|
+
type: '震源・震度に関する情報';
|
|
120
|
+
title: '震源・震度情報' | '遠地地震に関する情報';
|
|
121
|
+
infoType: '発表' | '訂正';
|
|
122
|
+
targetDateTimeDubious: never;
|
|
123
|
+
targetDuration: never;
|
|
124
|
+
validDateTime: never;
|
|
125
|
+
eventId: string;
|
|
126
|
+
serialNo: string;
|
|
127
|
+
infoKind: '地震情報';
|
|
128
|
+
body: PublicBodyVXSE53;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface PublicVZSE40 extends TelegramJSONMain {
|
|
132
|
+
_schema: Schema;
|
|
133
|
+
type: '地震・津波に関するお知らせ';
|
|
134
|
+
title: '地震・津波に関するお知らせ';
|
|
135
|
+
infoType: '発表' | '訂正';
|
|
136
|
+
targetDateTimeDubious: never;
|
|
137
|
+
targetDuration: never;
|
|
138
|
+
validDateTime: never;
|
|
139
|
+
eventId: string;
|
|
140
|
+
serialNo: null;
|
|
141
|
+
infoKind: '地震・津波に関するお知らせ';
|
|
142
|
+
body: PublicBodyVXZSE40;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface Cancel extends TelegramJSONMain {
|
|
146
|
+
_schema: Schema;
|
|
147
|
+
type: '震度速報' | '震源に関する情報' | '震源・震度に関する情報' | '地震・津波に関するお知らせ';
|
|
148
|
+
title: '震度速報' | '震源に関する情報' | '震源・震度情報' | '遠地地震に関する情報' | '地震・津波に関するお知らせ';
|
|
149
|
+
infoType: '取消';
|
|
150
|
+
targetDateTimeDubious: never;
|
|
151
|
+
targetDuration: never;
|
|
152
|
+
validDateTime: never;
|
|
153
|
+
eventId: string;
|
|
154
|
+
infoKind: '震度速報' | '震源速報' | '地震情報' | '地震・津波に関するお知らせ';
|
|
155
|
+
body: CancelBody;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type Main = (PublicVXSE51 | PublicVXSE52 | PublicVXSE53 | PublicVZSE40) | Cancel;
|
|
159
|
+
}
|