@dmdata/telegram-json-types 1.0.5 → 1.0.9-jschema.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/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/build.d.ts +1 -0
- package/dist/build.js +57 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +6 -0
- package/dist/jschema/earthquake-information.json +1778 -0
- package/dist/jschema/eew-information.json +2742 -0
- package/dist/jschema/tsunami-information.json +3891 -0
- package/dist/jschema/weather-typhoon.json +4969 -0
- package/dist/jschema-load.d.ts +1 -0
- package/dist/jschema-load.js +38 -0
- package/index.d.ts +1 -0
- package/jschema/build.ts +56 -0
- package/jschema/config.ts +4 -0
- package/jschema/jschema-load.ts +26 -0
- package/package.json +21 -11
- package/tsconfig.jschema.json +16 -0
- package/types/index.d.ts +4 -2
- package/types/schema/component/coordinate.d.ts +15 -15
- package/types/schema/component/earthquake.d.ts +56 -56
- package/types/schema/earthquake-information.d.ts +21 -17
- package/types/schema/eew-information.d.ts +167 -0
- package/types/schema/tsunami-information.d.ts +230 -0
- package/types/schema/weather-typhoon.d.ts +122 -116
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getJSchema(name: string): Promise<any> | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.getJSchema = void 0;
|
|
23
|
+
const fs_1 = require("fs");
|
|
24
|
+
const path_1 = require("path");
|
|
25
|
+
const config_1 = require("./config");
|
|
26
|
+
const schemas = new Map();
|
|
27
|
+
const jschemaList = (0, fs_1.readdirSync)(config_1.distDir).filter(file => /\.json$/.test(file));
|
|
28
|
+
jschemaList.forEach(jschema => {
|
|
29
|
+
schemas.set(jschema.replace('.json', ''), (0, path_1.resolve)(config_1.distDir, jschema));
|
|
30
|
+
});
|
|
31
|
+
function getJSchema(name) {
|
|
32
|
+
const filePath = schemas.get(name);
|
|
33
|
+
if (!filePath) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return Promise.resolve().then(() => __importStar(require(filePath)));
|
|
37
|
+
}
|
|
38
|
+
exports.getJSchema = getJSchema;
|
package/index.d.ts
CHANGED
package/jschema/build.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { mkdir, readdir, rm, writeFile } from 'fs/promises';
|
|
3
|
+
import * as TJS from 'typescript-json-schema';
|
|
4
|
+
|
|
5
|
+
import { basePath, distDir } from './config';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const settings: TJS.PartialArgs = {
|
|
11
|
+
required: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const compilerOptions: TJS.CompilerOptions = {
|
|
15
|
+
strictNullChecks: true,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
readdir(basePath)
|
|
19
|
+
.then(files => programTypescript(files));
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
async function programTypescript(files: string[]) {
|
|
23
|
+
const tsTypeFiles = files.filter(file => /\.ts$/.test(file));
|
|
24
|
+
const filepath = tsTypeFiles.map(file => resolve(basePath, file));
|
|
25
|
+
|
|
26
|
+
const program = TJS.getProgramFromFiles(filepath, compilerOptions);
|
|
27
|
+
const generator = TJS.buildGenerator(program, settings);
|
|
28
|
+
|
|
29
|
+
const objectMaps = tsTypeFiles.map(file => tsTypeFileName2TypeSymbolName(file));
|
|
30
|
+
|
|
31
|
+
await rm(distDir, { recursive: true, force: true });
|
|
32
|
+
await mkdir(distDir, { recursive: true });
|
|
33
|
+
for (let i = 0; i < objectMaps.length; i++) {
|
|
34
|
+
const { schemaName, typeName } = objectMaps[i];
|
|
35
|
+
console.log(`Build ok: ${schemaName}: ${typeName}`);
|
|
36
|
+
|
|
37
|
+
const schema = generator?.getSchemaForSymbol(typeName, true);
|
|
38
|
+
|
|
39
|
+
await writeFile(
|
|
40
|
+
resolve(distDir, `${schemaName}.json`),
|
|
41
|
+
JSON.stringify(schema, undefined, 4)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.log('Build complete');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function tsTypeFileName2TypeSymbolName(file: string) {
|
|
49
|
+
const schemaName = file.replace(/^([\w-]+?)(\.d)?\.ts$/, '$1');
|
|
50
|
+
const nameScope = schemaName.replace(/-(\w)|(^\w)/g, (match, p1 = '', p2 = '') => `${p1}${p2}`.toUpperCase());
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
schemaName,
|
|
54
|
+
typeName: nameScope + '.Main'
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readdirSync } from 'fs';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
|
|
4
|
+
import { distDir } from './config';
|
|
5
|
+
|
|
6
|
+
const schemas = new Map<string, string>();
|
|
7
|
+
|
|
8
|
+
const jschemaList = readdirSync(distDir).filter(file => /\.json$/.test(file));
|
|
9
|
+
|
|
10
|
+
jschemaList.forEach(jschema => {
|
|
11
|
+
schemas.set(
|
|
12
|
+
jschema.replace('.json', ''),
|
|
13
|
+
resolve(distDir, jschema)
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export function getJSchema(name: string) {
|
|
19
|
+
const filePath = schemas.get(name);
|
|
20
|
+
|
|
21
|
+
if (!filePath) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return import(filePath);
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dmdata/telegram-json-types",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"scripts": {
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@dmdata/telegram-json-types",
|
|
3
|
+
"version": "1.0.9-jschema.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build:jschema": "npx tsc --project tsconfig.jschema.json",
|
|
6
|
+
"build:dist-jschema": "npx ts-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
|
+
},
|
|
10
|
+
"types": "index.d.ts",
|
|
11
|
+
"main": "./dist/jschema-load.js",
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^14.18.9",
|
|
17
|
+
"typescript": "^4.5.5",
|
|
18
|
+
"ts-node": "^10.4.0",
|
|
19
|
+
"typescript-json-schema": "^0.53.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export * from './schema/
|
|
2
|
-
export * from './schema/
|
|
1
|
+
export * from './schema/eew-information';
|
|
2
|
+
export * from './schema/earthquake-information';
|
|
3
|
+
export * from './schema/tsunami-information';
|
|
4
|
+
export * from './schema/weather-typhoon';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { UnitValue } from './unit-value';
|
|
2
|
-
|
|
3
|
-
export type Coordinate<Geo = never> = {
|
|
4
|
-
latitude: { text: string, value: string };
|
|
5
|
-
longitude: { text: string, value: string };
|
|
6
|
-
height?: UnitValue<'深さ', 'km'>;
|
|
7
|
-
condition: undefined;
|
|
8
|
-
geodeticSystem: Geo;
|
|
9
|
-
} | {
|
|
10
|
-
latitude:
|
|
11
|
-
longitude:
|
|
12
|
-
height:
|
|
13
|
-
geodeticSystem: never;
|
|
14
|
-
condition: '不明';
|
|
15
|
-
}
|
|
1
|
+
import { UnitValue } from './unit-value';
|
|
2
|
+
|
|
3
|
+
export type Coordinate<Geo = never> = {
|
|
4
|
+
latitude: { text: string, value: string };
|
|
5
|
+
longitude: { text: string, value: string };
|
|
6
|
+
height?: UnitValue<'深さ', 'km'>;
|
|
7
|
+
condition: undefined;
|
|
8
|
+
geodeticSystem: Geo;
|
|
9
|
+
} | {
|
|
10
|
+
latitude: never;
|
|
11
|
+
longitude: never;
|
|
12
|
+
height: never;
|
|
13
|
+
geodeticSystem: never;
|
|
14
|
+
condition: '不明';
|
|
15
|
+
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { Coordinate } from './coordinate';
|
|
2
|
-
import { UnitValueNotNull } from './unit-value';
|
|
3
|
-
|
|
4
|
-
type Depth = {
|
|
5
|
-
type: '深さ';
|
|
6
|
-
unit: 'km';
|
|
7
|
-
} & ({
|
|
8
|
-
value: null;
|
|
9
|
-
condition: '不明';
|
|
10
|
-
} | {
|
|
11
|
-
value: '0';
|
|
12
|
-
condition: 'ごく浅い';
|
|
13
|
-
} | {
|
|
14
|
-
value: '700';
|
|
15
|
-
condition: '700km以上';
|
|
16
|
-
} | {
|
|
17
|
-
value: string;
|
|
18
|
-
condition:
|
|
19
|
-
});
|
|
20
|
-
type Magnitude = {
|
|
21
|
-
type: 'マグニチュード';
|
|
22
|
-
unit: 'Mj' | 'M';
|
|
23
|
-
} & ({
|
|
24
|
-
value: null;
|
|
25
|
-
condition: 'M不明' | 'M8を超える巨大地震';
|
|
26
|
-
} | {
|
|
27
|
-
value: string;
|
|
28
|
-
condition:
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export interface Earthquake {
|
|
32
|
-
originTime: string;
|
|
33
|
-
arrivalTime: string;
|
|
34
|
-
hypocenter: {
|
|
35
|
-
name: string;
|
|
36
|
-
code: string;
|
|
37
|
-
coordinate: Coordinate<'日本測地系' | undefined>;
|
|
38
|
-
depth: Depth;
|
|
39
|
-
detailed?: {
|
|
40
|
-
code: string;
|
|
41
|
-
name: string;
|
|
42
|
-
};
|
|
43
|
-
auxiliary?: {
|
|
44
|
-
text: string;
|
|
45
|
-
code: string;
|
|
46
|
-
name: string;
|
|
47
|
-
direction: string;
|
|
48
|
-
distance: Omit<UnitValueNotNull<never, 'km'>, 'type' | 'condition'>;
|
|
49
|
-
};
|
|
50
|
-
source?: 'PTWC' | 'USGS' | 'WCATWC';
|
|
51
|
-
};
|
|
52
|
-
magnitude: Magnitude;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
import { Coordinate } from './coordinate';
|
|
2
|
+
import { UnitValueNotNull } from './unit-value';
|
|
3
|
+
|
|
4
|
+
type Depth = {
|
|
5
|
+
type: '深さ';
|
|
6
|
+
unit: 'km';
|
|
7
|
+
} & ({
|
|
8
|
+
value: null;
|
|
9
|
+
condition: '不明';
|
|
10
|
+
} | {
|
|
11
|
+
value: '0';
|
|
12
|
+
condition: 'ごく浅い';
|
|
13
|
+
} | {
|
|
14
|
+
value: '700';
|
|
15
|
+
condition: '700km以上';
|
|
16
|
+
} | {
|
|
17
|
+
value: string;
|
|
18
|
+
condition: never;
|
|
19
|
+
});
|
|
20
|
+
type Magnitude = {
|
|
21
|
+
type: 'マグニチュード';
|
|
22
|
+
unit: 'Mj' | 'M';
|
|
23
|
+
} & ({
|
|
24
|
+
value: null;
|
|
25
|
+
condition: 'M不明' | 'M8を超える巨大地震';
|
|
26
|
+
} | {
|
|
27
|
+
value: string;
|
|
28
|
+
condition: never;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export interface Earthquake {
|
|
32
|
+
originTime: string;
|
|
33
|
+
arrivalTime: string;
|
|
34
|
+
hypocenter: {
|
|
35
|
+
name: string;
|
|
36
|
+
code: string;
|
|
37
|
+
coordinate: Coordinate<'日本測地系' | undefined>;
|
|
38
|
+
depth: Depth;
|
|
39
|
+
detailed?: {
|
|
40
|
+
code: string;
|
|
41
|
+
name: string;
|
|
42
|
+
};
|
|
43
|
+
auxiliary?: {
|
|
44
|
+
text: string;
|
|
45
|
+
code: string;
|
|
46
|
+
name: string;
|
|
47
|
+
direction: string;
|
|
48
|
+
distance: Omit<UnitValueNotNull<never, 'km'>, 'type' | 'condition'>;
|
|
49
|
+
};
|
|
50
|
+
source?: 'PTWC' | 'USGS' | 'WCATWC';
|
|
51
|
+
};
|
|
52
|
+
magnitude: Magnitude;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
@@ -6,29 +6,29 @@ import { UnitValueNotNull } from './component/unit-value';
|
|
|
6
6
|
export namespace EarthquakeInformation {
|
|
7
7
|
export interface Schema {
|
|
8
8
|
type: 'earthquake-information';
|
|
9
|
-
version: '1.
|
|
9
|
+
version: '1.1.0';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
12
|
+
export type IntensityClass = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
|
|
13
|
+
export type LpgmIntensityClass = '0' | '1' | '2' | '3' | '4';
|
|
14
14
|
export type LpgmCategory = '1' | '2' | '3' | '4';
|
|
15
15
|
|
|
16
|
-
type OnRevise = { revise?: '上方修正' | '追加'; };
|
|
17
16
|
export type IntensityMaxInt = {
|
|
18
17
|
name: string;
|
|
19
18
|
code: string;
|
|
20
|
-
maxInt:
|
|
19
|
+
maxInt: IntensityClass;
|
|
21
20
|
};
|
|
22
21
|
export type IntensityMaxIntOnRevise = {
|
|
23
22
|
name: string;
|
|
24
23
|
code: string;
|
|
25
|
-
maxInt?:
|
|
26
|
-
|
|
24
|
+
maxInt?: IntensityClass;
|
|
25
|
+
revise?: '上方修正' | '追加';
|
|
26
|
+
}
|
|
27
27
|
|
|
28
28
|
export type IntensityCity = {
|
|
29
29
|
name: string;
|
|
30
30
|
code: string;
|
|
31
|
-
maxInt?:
|
|
31
|
+
maxInt?: IntensityClass;
|
|
32
32
|
revise?: '上方修正' | '追加';
|
|
33
33
|
condition?: '震度5弱以上未入電';
|
|
34
34
|
};
|
|
@@ -36,21 +36,21 @@ export namespace EarthquakeInformation {
|
|
|
36
36
|
export type IntensityStation = {
|
|
37
37
|
name: string;
|
|
38
38
|
code: string;
|
|
39
|
-
int:
|
|
39
|
+
int: IntensityClass | '!5-';
|
|
40
40
|
revise?: '上方修正' | '追加';
|
|
41
41
|
condition?: '震度5弱以上未入電';
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export type IntensityLpgmMaxInt = IntensityMaxIntOnRevise & {
|
|
45
|
-
maxLpgmInt:
|
|
45
|
+
maxLpgmInt: LpgmIntensityClass;
|
|
46
46
|
};
|
|
47
47
|
export type IntensityLpgmStationPrePeriod = {
|
|
48
48
|
periodicBand: UnitValueNotNull<never, '秒台'>;
|
|
49
|
-
lpgmInt:
|
|
49
|
+
lpgmInt: LpgmIntensityClass;
|
|
50
50
|
sva: UnitValueNotNull<never, 'cm/s'>;
|
|
51
51
|
};
|
|
52
52
|
export type IntensityLpgmStation = IntensityStation & {
|
|
53
|
-
lpgmInt:
|
|
53
|
+
lpgmInt: LpgmIntensityClass;
|
|
54
54
|
sva: UnitValueNotNull<never, 'cm/s'>;
|
|
55
55
|
prePeriods: IntensityLpgmStationPrePeriod[];
|
|
56
56
|
}
|
|
@@ -69,13 +69,13 @@ export namespace EarthquakeInformation {
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
export type IntensityVXSE51 = {
|
|
72
|
-
maxInt:
|
|
72
|
+
maxInt: IntensityClass;
|
|
73
73
|
prefectures: IntensityMaxInt[];
|
|
74
74
|
regions: IntensityMaxInt[];
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
export type IntensityVXSE53 = {
|
|
78
|
-
maxInt:
|
|
78
|
+
maxInt: IntensityClass;
|
|
79
79
|
prefectures: IntensityMaxIntOnRevise[];
|
|
80
80
|
regions: IntensityMaxIntOnRevise[];
|
|
81
81
|
cities: IntensityCity[];
|
|
@@ -83,8 +83,8 @@ export namespace EarthquakeInformation {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export type IntensityVXSE62 = {
|
|
86
|
-
maxInt:
|
|
87
|
-
maxLpgmInt:
|
|
86
|
+
maxInt: IntensityClass;
|
|
87
|
+
maxLpgmInt: LpgmIntensityClass;
|
|
88
88
|
lpgmCategory: LpgmCategory;
|
|
89
89
|
prefectures: IntensityLpgmMaxInt[];
|
|
90
90
|
regions: IntensityLpgmMaxInt[];
|
|
@@ -167,8 +167,12 @@ export namespace EarthquakeInformation {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
export interface Channel extends TelegramJSONMain {
|
|
170
|
-
|
|
170
|
+
_schema: Schema;
|
|
171
|
+
type: '震度速報' | '震源に関する情報' | '震源・震度に関する情報' | '長周期地震動に関する観測情報';
|
|
172
|
+
title: '震度速報' | '震源に関する情報' | '震源・震度情報' | '遠地地震に関する情報' | '長周期地震動に関する観測情報';
|
|
173
|
+
infoKind: '震度速報';
|
|
171
174
|
eventId: string;
|
|
175
|
+
infoType: '取消';
|
|
172
176
|
body: ChancelBody;
|
|
173
177
|
}
|
|
174
178
|
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { TelegramJSONMain } from '../main';
|
|
2
|
+
import { Coordinate } from './component/coordinate';
|
|
3
|
+
import { UnitValueNotNull } from './component/unit-value';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export namespace EewInformation {
|
|
7
|
+
export interface Schema {
|
|
8
|
+
type: 'eew-information';
|
|
9
|
+
version: '1.0.0';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type IntensityClass = '0' | '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
|
|
13
|
+
export type LpgmIntensityClass = '0' | '1' | '2' | '3' | '4';
|
|
14
|
+
|
|
15
|
+
export interface WarningAreaKind {
|
|
16
|
+
code: string;
|
|
17
|
+
name: string;
|
|
18
|
+
lastKind: {
|
|
19
|
+
code: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface WarningArea {
|
|
25
|
+
code: string;
|
|
26
|
+
name: string;
|
|
27
|
+
kind: WarningAreaKind;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface EarthquakeHypocenterReduce {
|
|
31
|
+
code: string;
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface EarthquakeHypocenterAccuracy {
|
|
36
|
+
epicenters: [
|
|
37
|
+
'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8',
|
|
38
|
+
'0' | '1' | '2' | '3' | '4' | '9'
|
|
39
|
+
];
|
|
40
|
+
depth: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
|
|
41
|
+
magnitudeCalculation: '0' | '2' | '3' | '4' | '5' | '6' | '8';
|
|
42
|
+
numberOfMagnitudeCalculation: '0' | '1' | '2' | '3' | '4' | '5';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface EarthquakeHypocenter {
|
|
46
|
+
code: string;
|
|
47
|
+
name: string;
|
|
48
|
+
coordinate: Coordinate<'日本測地系'>;
|
|
49
|
+
depth: UnitValueNotNull<'深さ', 'km'>;
|
|
50
|
+
reduce: EarthquakeHypocenterReduce;
|
|
51
|
+
landOrSea?: '内陸' | '海域';
|
|
52
|
+
accuracy: EarthquakeHypocenterAccuracy;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface EarthquakeMagnitude {
|
|
56
|
+
type: 'マグニチュード';
|
|
57
|
+
unit: 'Mj' | 'M';
|
|
58
|
+
value: string | null;
|
|
59
|
+
condition?: 'M不明';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface Earthquake {
|
|
63
|
+
originTime?: string;
|
|
64
|
+
arrivalTime: string;
|
|
65
|
+
condition?: '仮定震源要素';
|
|
66
|
+
hypocenter: EarthquakeHypocenter;
|
|
67
|
+
magnitude: EarthquakeMagnitude;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface IntensityForecastMaxInt {
|
|
71
|
+
from: IntensityClass | '不明';
|
|
72
|
+
to: IntensityClass | 'over' | '不明';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface IntensityForecastLpgmMaxInt {
|
|
76
|
+
from: LpgmIntensityClass | '不明';
|
|
77
|
+
to: LpgmIntensityClass | 'over' | '不明';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface IntensityAppendix {
|
|
81
|
+
maxIntChange: '0' | '1' | '2';
|
|
82
|
+
maxLpgmIntChange?: '0' | '1' | '2';
|
|
83
|
+
maxIntChangeReason: '0' | '1' | '2' | '3' | '4' | '9';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface IntensityRegion {
|
|
87
|
+
code: string;
|
|
88
|
+
name: string;
|
|
89
|
+
forecastMaxInt: IntensityForecastMaxInt;
|
|
90
|
+
forecastLpgmMaxInt?: IntensityForecastLpgmMaxInt;
|
|
91
|
+
kind: WarningAreaKind;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
export interface Intensity {
|
|
96
|
+
forecastMaxInt: IntensityForecastMaxInt;
|
|
97
|
+
forecastLpgmMaxInt?: IntensityForecastLpgmMaxInt;
|
|
98
|
+
appendix?: IntensityAppendix;
|
|
99
|
+
regions: IntensityRegion[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
export type Comment = {
|
|
104
|
+
free?: string;
|
|
105
|
+
warning?: {
|
|
106
|
+
text: string;
|
|
107
|
+
codes: string[];
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export interface PublicCommonBody {
|
|
112
|
+
isLastInfo: boolean;
|
|
113
|
+
zones?: WarningArea[];
|
|
114
|
+
prefectures?: WarningArea[];
|
|
115
|
+
regions?: WarningArea[];
|
|
116
|
+
earthquake: Earthquake;
|
|
117
|
+
intensity?: Intensity;
|
|
118
|
+
text?: string;
|
|
119
|
+
comments: Comment;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface PublicTesting {
|
|
123
|
+
isLastInfo: false;
|
|
124
|
+
text: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface ChancelBody {
|
|
128
|
+
isLastInfo: true;
|
|
129
|
+
text: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface PublicCommon extends TelegramJSONMain {
|
|
133
|
+
_schema: Schema;
|
|
134
|
+
type: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)';
|
|
135
|
+
title: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)';
|
|
136
|
+
infoKind: '緊急地震速報';
|
|
137
|
+
eventId: string;
|
|
138
|
+
serialNo: string;
|
|
139
|
+
infoType: '発表' | '訂正';
|
|
140
|
+
body: PublicCommonBody;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface PublicTesting extends TelegramJSONMain {
|
|
144
|
+
_schema: Schema;
|
|
145
|
+
type: '緊急地震速報テスト';
|
|
146
|
+
title: '緊急地震速報テスト';
|
|
147
|
+
infoKind: '緊急地震速報';
|
|
148
|
+
eventId: string;
|
|
149
|
+
serialNo: string;
|
|
150
|
+
infoType: '発表' | '訂正';
|
|
151
|
+
body: PublicTesting;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface Channel extends TelegramJSONMain {
|
|
155
|
+
_schema: Schema;
|
|
156
|
+
type: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)' | '緊急地震速報テスト';
|
|
157
|
+
title: '緊急地震速報(予報)' | '緊急地震速報(地震動予報)' | '緊急地震速報(警報)' | '緊急地震速報テスト';
|
|
158
|
+
infoKind: '緊急地震速報';
|
|
159
|
+
eventId: string;
|
|
160
|
+
serialNo: string;
|
|
161
|
+
infoType: '取消';
|
|
162
|
+
body: ChancelBody;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export type Main = PublicCommon | PublicTesting | Channel;
|
|
166
|
+
|
|
167
|
+
}
|