@dmdata/telegram-json-types 1.0.4 → 1.0.8

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/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@dmdata/telegram-json-types",
3
- "version": "1.0.4",
4
- "scripts": {},
3
+ "version": "1.0.8",
4
+ "scripts": {
5
+ "publish:npm": "npm version patch && npm publish --access=public"
6
+ },
5
7
  "types": "index.d.ts",
6
8
  "keywords": [],
7
9
  "author": "",
package/types/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './schema/earthquake-information';
2
+ export * from './schema/tsunami-information';
2
3
  export * from './schema/weather-typhoon';
@@ -1,95 +1,121 @@
1
1
  import { Earthquake } from './component/earthquake';
2
2
  import { TelegramJSONMain } from '../main';
3
+ import { UnitValueNotNull } from './component/unit-value';
3
4
 
4
- type Intensity = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
5
5
 
6
6
  export namespace EarthquakeInformation {
7
7
  export interface Schema {
8
8
  type: 'earthquake-information';
9
- version: '1.0.0';
9
+ version: '1.1.0';
10
10
  }
11
11
 
12
+ export type Intensity = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
13
+ export type LpgmIntensity = '0' | '1' | '2' | '3' | '4';
14
+ export type LpgmCategory = '1' | '2' | '3' | '4';
12
15
 
16
+ type OnRevise = { revise?: '上方修正' | '追加'; };
17
+ export type IntensityMaxInt = {
18
+ name: string;
19
+ code: string;
20
+ maxInt: Intensity;
21
+ };
22
+ export type IntensityMaxIntOnRevise = {
23
+ name: string;
24
+ code: string;
25
+ maxInt?: Intensity;
26
+ } & OnRevise;
13
27
 
14
- export interface PublicBodyVXSE51 {
15
- intensity: {
16
- maxInt: string;
17
- prefectures: {
18
- name: string;
19
- code: string;
20
- maxInt: Intensity;
21
- }[];
22
- regions: {
23
- name: string;
24
- code: string;
25
- maxInt: Intensity;
26
- }[];
28
+ export type IntensityCity = {
29
+ name: string;
30
+ code: string;
31
+ maxInt?: Intensity;
32
+ revise?: '上方修正' | '追加';
33
+ condition?: '震度5弱以上未入電';
34
+ };
35
+
36
+ export type IntensityStation = {
37
+ name: string;
38
+ code: string;
39
+ int: Intensity | '!5-';
40
+ revise?: '上方修正' | '追加';
41
+ condition?: '震度5弱以上未入電';
42
+ };
43
+
44
+ export type IntensityLpgmMaxInt = IntensityMaxIntOnRevise & {
45
+ maxLpgmInt: LpgmIntensity;
46
+ };
47
+ export type IntensityLpgmStationPrePeriod = {
48
+ periodicBand: UnitValueNotNull<never, '秒台'>;
49
+ lpgmInt: LpgmIntensity;
50
+ sva: UnitValueNotNull<never, 'cm/s'>;
51
+ };
52
+ export type IntensityLpgmStation = IntensityStation & {
53
+ lpgmInt: LpgmIntensity;
54
+ sva: UnitValueNotNull<never, 'cm/s'>;
55
+ prePeriods: IntensityLpgmStationPrePeriod[];
56
+ }
57
+
58
+ export type Comment = {
59
+ free?: string;
60
+ forecast?: {
61
+ text: string;
62
+ codes: string[];
27
63
  };
28
- text?: string;
29
- comments: {
30
- free?: string;
31
- forecast?: {
32
- text: string;
33
- codes: string[];
34
- };
64
+ var?: {
65
+ text: string;
66
+ codes: string[];
35
67
  };
68
+ };
69
+
70
+
71
+ export type IntensityVXSE51 = {
72
+ maxInt: Intensity;
73
+ prefectures: IntensityMaxInt[];
74
+ regions: IntensityMaxInt[];
75
+ };
76
+
77
+ export type IntensityVXSE53 = {
78
+ maxInt: Intensity;
79
+ prefectures: IntensityMaxIntOnRevise[];
80
+ regions: IntensityMaxIntOnRevise[];
81
+ cities: IntensityCity[];
82
+ stations: IntensityStation[];
83
+ };
84
+
85
+ export type IntensityVXSE62 = {
86
+ maxInt: Intensity;
87
+ maxLpgmInt: LpgmIntensity;
88
+ lpgmCategory: LpgmCategory;
89
+ prefectures: IntensityLpgmMaxInt[];
90
+ regions: IntensityLpgmMaxInt[];
91
+ stations: IntensityLpgmStation[];
92
+ };
93
+
94
+
95
+ export interface PublicBodyVXSE51 {
96
+ intensity: IntensityVXSE51;
97
+ text?: string;
98
+ comments: Omit<Comment, 'var'>;
36
99
  }
37
100
 
38
101
  export interface PublicBodyVXSE52 {
39
102
  earthquake: Earthquake;
40
103
  text?: string;
41
- comments: {
42
- free?: string;
43
- forecast?: {
44
- text: string;
45
- codes: string[];
46
- };
47
- };
104
+ comments: Omit<Comment, 'var'>;
48
105
  }
49
106
 
50
107
  export interface PublicBodyVXSE53 {
51
108
  earthquake: Earthquake;
52
- intensity?: {
53
- maxInt: string;
54
- prefectures: {
55
- name: string;
56
- code: string;
57
- maxInt?: Intensity;
58
- revise?: '上方修正' | '追加';
59
- }[];
60
- regions: {
61
- name: string;
62
- code: string;
63
- maxInt?: Intensity;
64
- revise?: '上方修正' | '追加';
65
- }[];
66
- cities: {
67
- name: string;
68
- code: string;
69
- maxInt?: Intensity;
70
- revise?: '上方修正' | '追加';
71
- condition?: '震度5弱以上未入電';
72
- }[];
73
- stations: {
74
- name: string;
75
- code: string;
76
- int: Intensity | '!5-';
77
- revise?: '上方修正' | '追加';
78
- condition?: '震度5弱以上未入電';
79
- }[];
80
- };
109
+ intensity?: IntensityVXSE53;
81
110
  text?: string;
82
- comments: {
83
- free?: string;
84
- forecast?: {
85
- text: string;
86
- codes: string[];
87
- };
88
- var?: {
89
- text: string;
90
- codes: string[];
91
- };
92
- };
111
+ comments: Comment;
112
+ }
113
+
114
+ export interface PublicBodyVXSE62 {
115
+ earthquake: Earthquake;
116
+ intensity?: IntensityVXSE62;
117
+ text?: string;
118
+ comments: Comment;
93
119
  }
94
120
 
95
121
  export interface ChancelBody {
@@ -129,12 +155,23 @@ export namespace EarthquakeInformation {
129
155
  body: PublicBodyVXSE53;
130
156
  }
131
157
 
158
+ export interface PublicVXSE62 extends TelegramJSONMain {
159
+ _schema: Schema;
160
+ type: '長周期地震動に関する観測情報';
161
+ title: '長周期地震動に関する観測情報';
162
+ infoKind: '長周期地震動に関する観測情報';
163
+ eventId: string;
164
+ serialNo: string;
165
+ infoType: '発表' | '訂正';
166
+ body: PublicBodyVXSE62;
167
+ }
168
+
132
169
  export interface Channel extends TelegramJSONMain {
133
170
  infoType: '取消';
134
171
  eventId: string;
135
172
  body: ChancelBody;
136
173
  }
137
174
 
138
- export type Main = (PublicVXSE51 | PublicVXSE52 | PublicVXSE53) | Channel;
175
+ export type Main = (PublicVXSE51 | PublicVXSE52 | PublicVXSE53 | PublicVXSE62) | Channel;
139
176
 
140
177
  }
@@ -0,0 +1,229 @@
1
+ import { Earthquake } from './component/earthquake';
2
+ import { TelegramJSONMain } from '../main';
3
+
4
+
5
+ export namespace TsunamiInformation {
6
+ export interface Schema {
7
+ type: 'tsunami-information';
8
+ version: '1.0.0';
9
+ }
10
+
11
+ export interface TsunamiForecastKind {
12
+ code: string;
13
+ name: string;
14
+ lastKind: {
15
+ code: string;
16
+ name: string;
17
+ };
18
+ }
19
+
20
+ export interface TsunamiForecastFirstHeight {
21
+ arrivalTime?: string;
22
+ condition?: '津波到達中と推測' | '第1波の到達を確認' | 'ただちに津波来襲と予測';
23
+ revise?: '追加' | '更新';
24
+ }
25
+
26
+ export interface TsunamiForecastMaxHeightValue {
27
+ type: '津波の高さ';
28
+ unit: 'm';
29
+ value: string | null;
30
+ over?: true;
31
+ condition?: '巨大' | '高い';
32
+ }
33
+
34
+ export interface TsunamiForecastMaxHeight {
35
+ height: TsunamiForecastMaxHeightValue;
36
+ condition?: '重要';
37
+ revise?: '追加' | '更新';
38
+ }
39
+
40
+ export interface TsunamiForecastStation {
41
+ code: string;
42
+ name: string;
43
+ highTideDateTime: string;
44
+ firstHeight: TsunamiForecastFirstHeight;
45
+ }
46
+
47
+ export interface TsunamiForecast {
48
+ code: string;
49
+ name: string;
50
+ kind: TsunamiForecastKind;
51
+ firstHeight: TsunamiForecastFirstHeight;
52
+ maxHeight: TsunamiForecastMaxHeight;
53
+ stations?: TsunamiForecastStation[] | never;
54
+ }
55
+
56
+ export interface TsunamiForecastVXSE41 extends TsunamiForecast {
57
+ stations: never;
58
+ }
59
+
60
+ export interface TsunamiForecastVXSE51 extends TsunamiForecast {
61
+ stations?: TsunamiForecastStation[];
62
+ }
63
+
64
+ export interface TsunamiObservationStationFirstHeight {
65
+ arrivalTime: string;
66
+ initial?: '押し' | '引き';
67
+ condition?: '第1波識別不能';
68
+ revise?: '追加' | '更新';
69
+ }
70
+
71
+ export interface TsunamiObservationStationMaxHeightValue {
72
+ type: 'これまでの最大波の高さ';
73
+ unit: 'm';
74
+ value: string | null;
75
+ over?: true;
76
+ condition?: '上昇中';
77
+ }
78
+
79
+ export interface TsunamiObservationStationMaxHeight {
80
+ dateTime?: string;
81
+ height?: TsunamiObservationStationMaxHeightValue;
82
+ condition?: '微弱' | '観測中' | '重要';
83
+ revise?: '追加' | '更新';
84
+ }
85
+
86
+ export interface TsunamiObservationStation {
87
+ code: string;
88
+ name: string;
89
+ sensor?: string;
90
+ firstHeight: TsunamiObservationStationFirstHeight;
91
+ maxHeight: TsunamiObservationStationMaxHeight;
92
+ }
93
+
94
+ export interface TsunamiObservation {
95
+ code: string | null;
96
+ name: string | null;
97
+ stations: TsunamiObservationStation[];
98
+ }
99
+
100
+ export interface TsunamiObservationVXSE51 extends TsunamiObservation {
101
+ code: string;
102
+ name: string;
103
+ }
104
+
105
+ export interface TsunamiObservationVXSE52 extends TsunamiObservation {
106
+ code: null;
107
+ name: null;
108
+ }
109
+
110
+ export interface TsunamiEstimationFirstHeight {
111
+ arrivalTime: string;
112
+ condition?: '早いところでは既に津波到達と推定';
113
+ revise?: '追加' | '更新';
114
+ }
115
+
116
+ export interface TsunamiEstimationMaxHeightValue {
117
+ type: '津波の高さ';
118
+ unit: 'm';
119
+ value: string | null;
120
+ over?: true;
121
+ }
122
+
123
+ export interface TsunamiEstimationMaxHeight {
124
+ dateTime?: string;
125
+ height?: TsunamiEstimationMaxHeightValue;
126
+ condition?: '微弱' | '観測中' | '重要';
127
+ revise?: '追加' | '更新';
128
+ }
129
+
130
+ export interface TsunamiEstimation {
131
+ code: string;
132
+ name: string;
133
+ firstHeight: TsunamiEstimationFirstHeight;
134
+ maxHeight: TsunamiEstimationMaxHeight;
135
+ }
136
+
137
+ export interface PublicBodyVTSE41Tsunami {
138
+ forecasts: TsunamiForecastVXSE41[];
139
+ }
140
+
141
+ export interface PublicBodyVTSE51Tsunami {
142
+ forecasts: TsunamiForecastVXSE51[];
143
+ observations: TsunamiObservationVXSE51[];
144
+ }
145
+
146
+ export interface PublicBodyVTSE52Tsunami {
147
+ observations: TsunamiObservationVXSE52[];
148
+ estimations: TsunamiEstimation[];
149
+ }
150
+
151
+ export type Comment = {
152
+ free?: string;
153
+ warning?: {
154
+ text: string;
155
+ codes: string[];
156
+ };
157
+ };
158
+
159
+ export interface ChancelBody {
160
+ text: string;
161
+ }
162
+
163
+ export interface PublicBodyVTSE41 {
164
+ tsunami: PublicBodyVTSE41Tsunami;
165
+ earthquakes: Earthquake[];
166
+ text?: string;
167
+ comments?: Comment;
168
+ }
169
+
170
+ export interface PublicBodyVTSE51 {
171
+ tsunami: PublicBodyVTSE51Tsunami;
172
+ earthquakes: Earthquake[];
173
+ text?: string;
174
+ comments?: Comment;
175
+ }
176
+
177
+ export interface PublicBodyVTSE52 {
178
+ tsunami: PublicBodyVTSE52Tsunami;
179
+ earthquakes: Earthquake[];
180
+ text?: string;
181
+ comments?: Comment;
182
+ }
183
+
184
+
185
+ export interface PublicVTSE41 extends TelegramJSONMain {
186
+ _schema: Schema;
187
+ type: '大津波警報・津波警報・津波予報a';
188
+ title: string;
189
+ infoKind: '津波警報・注意報・予報';
190
+ eventId: string;
191
+ serialNo: null;
192
+ infoType: '発表' | '訂正';
193
+ body: PublicBodyVTSE41;
194
+ }
195
+
196
+ export interface PublicVTSE51 extends TelegramJSONMain {
197
+ _schema: Schema;
198
+ type: '津波情報a';
199
+ title: '各地の満潮時刻・津波到達予想時刻に関する情報' | '津波観測に関する情報';
200
+ infoKind:'津波情報';
201
+ eventId: string;
202
+ serialNo: string;
203
+ infoType: '発表' | '訂正';
204
+ body: PublicBodyVTSE51;
205
+ }
206
+
207
+
208
+ export interface PublicVTSE52 extends TelegramJSONMain {
209
+ _schema: Schema;
210
+ type: '沖合の津波観測に関する情報';
211
+ title: '沖合の津波観測に関する情報';
212
+ infoKind: '津波情報';
213
+ eventId: string;
214
+ serialNo: string;
215
+ infoType: '発表' | '訂正';
216
+ body: PublicBodyVTSE52;
217
+ }
218
+
219
+
220
+
221
+ export interface Channel extends TelegramJSONMain {
222
+ infoType: '取消';
223
+ eventId: string;
224
+ body: ChancelBody;
225
+ }
226
+
227
+ export type Main = (PublicVTSE41 | PublicVTSE51 | PublicVTSE52) | Channel;
228
+
229
+ }
@@ -1,6 +1,6 @@
1
1
  import { TelegramJSONMain } from '../main';
2
2
  import { Coordinate } from './component/coordinate';
3
- import { UnitValue } from './component/unit-value';
3
+ import { UnitValue, UnitValueNotNull } from './component/unit-value';
4
4
 
5
5
  export namespace WeatherTyphoon {
6
6
  export interface Schema {
@@ -8,7 +8,7 @@ export namespace WeatherTyphoon {
8
8
  version: '1.0.0';
9
9
  }
10
10
 
11
- type Direction = {
11
+ export type Direction = {
12
12
  type: string;
13
13
  unit: string;
14
14
  value: string;
@@ -19,67 +19,69 @@ export namespace WeatherTyphoon {
19
19
  value: null;
20
20
  azimuth: null;
21
21
  condition: string;
22
- }
22
+ };
23
23
 
24
- interface Axis {
24
+ export type Axis = {
25
25
  direction: Direction;
26
26
  radius: UnitValue;
27
27
  }
28
28
 
29
+ export type RealStateClassification = {
30
+ category: 'TD' | 'TY' | 'STS' | 'Hurricane' | 'Tropical Storm' | 'LOW' | null;
31
+ name: '熱帯低気圧' | '台風' | 'ハリケーン' | '発達した熱帯低気圧' | '温帯低気圧' | null;
32
+ area: '大型' | '超大型' | null;
33
+ intensity: '強い' | '非常に強い' | '猛烈な' | null;
34
+ };
35
+ export type ForecastClassification = Omit<RealStateClassification, 'area'>;
36
+
37
+ export type RealStateCenter = {
38
+ coordinate: Coordinate;
39
+ location: string;
40
+ direction: Direction;
41
+ speed: UnitValue;
42
+ pressure: UnitValueNotNull;
43
+ };
44
+ export type ForecastCenter = {
45
+ probabilityCircle: {
46
+ basePoint: Coordinate;
47
+ axes: Axis[];
48
+ };
49
+ } & Omit<RealStateCenter, 'location'>;
50
+
51
+ export type RealStateWindArea = {
52
+ strong: Axis[];
53
+ storm: Axis[];
54
+ };
55
+ export type RealStateWind = {
56
+ average: UnitValue;
57
+ instantaneous: UnitValue;
58
+ area: RealStateWindArea;
59
+ };
60
+ export type ForecastWindArea = {
61
+ stormWarning: Axis[];
62
+ };
63
+ export type ForecastWind = {
64
+ average: UnitValue;
65
+ instantaneous: UnitValue;
66
+ area: ForecastWindArea;
67
+ }
29
68
 
30
- interface A {
69
+ interface RealState {
31
70
  type: '実況' | '推定';
32
71
  elapsedTime: 'PT0H' | 'PT1H';
33
72
  dateTime: string;
34
- classification: {
35
- category: 'TD' | 'TY' | 'STS' | 'Hurricane' | 'Tropical Storm' | 'LOW' | null;
36
- name: '熱帯低気圧' | '台風' | 'ハリケーン' | '発達した熱帯低気圧' | '温帯低気圧' | null;
37
- area: '大型' | '超大型' | null;
38
- intensity: '強い' | '非常に強い' | '猛烈な' | null;
39
- };
40
- center: {
41
- location: Coordinate;
42
- direction: Direction;
43
- speed: UnitValue;
44
- pressure: UnitValue;
45
- };
46
- wind?: {
47
- average: UnitValue;
48
- instantaneous: UnitValue;
49
- area: {
50
- strong: Axis[];
51
- storm: Axis[];
52
- };
53
- };
73
+ classification: RealStateClassification;
74
+ center: RealStateCenter;
75
+ wind?:RealStateWind;
54
76
  }
55
77
 
56
- interface B {
78
+ interface Forecast {
57
79
  type: '予報' | '延長予報';
58
80
  elapsedTime: string;
59
81
  dateTime: string;
60
- classification: {
61
- category: 'TD' | 'TY' | 'STS' | 'Hurricane' | 'Tropical Storm' | 'LOW' | null;
62
- name: '熱帯低気圧' | '台風' | 'ハリケーン' | '発達した熱帯低気圧' | '温帯低気圧' | null;
63
- intensity?: '強い' | '非常に強い' | '猛烈な' | null;
64
- };
65
- center: {
66
- probabilityCircle: {
67
- basePoint: Coordinate;
68
- axes: Axis[];
69
- };
70
- direction: Direction;
71
- speed: UnitValue;
72
- pressure: UnitValue
73
- };
74
- wind: {
75
- average: UnitValue;
76
- instantaneous: UnitValue;
77
- area?: {
78
- strong?: Axis[];
79
- storm?: Axis[];
80
- stormWarning?: Axis[];
81
- };
82
- };
82
+ classification: ForecastClassification;
83
+ center: ForecastCenter;
84
+ wind: ForecastWind;
83
85
  }
84
86
 
85
87
  export interface PublicBody {
@@ -93,7 +95,7 @@ export namespace WeatherTyphoon {
93
95
  remark: '台風発生' | '台風発生(域外から入る)' | '台風消滅(域外へ出る)' | '台風消滅(温帯低気圧化)' | '台風消滅(熱帯低気圧化)' |
94
96
  '台風発生の可能性が小さくなった' | '発表間隔変更(毎時から3時間毎)' | '発表間隔変更(3時間毎から毎時)' | '台風発生予想' | '温帯低気圧化しつつある' | null;
95
97
  };
96
- forecasts: [A] | [A, ...B[]] | [A, A] | [A, A, ...B[]];
98
+ forecasts: [RealState] | [RealState, ...Forecast[]] | [RealState, RealState] | [RealState, RealState, ...Forecast[]];
97
99
  }
98
100
 
99
101
  export interface Public extends TelegramJSONMain {