@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.
Files changed (74) hide show
  1. package/README.md +44 -3
  2. package/dist/build.js +22 -11
  3. package/dist/config.d.ts +2 -1
  4. package/dist/config.js +3 -2
  5. package/dist/jschema/earthquake-counts_1.0.0.json +1 -0
  6. package/dist/jschema/earthquake-explanation_1.0.0.json +1 -0
  7. package/dist/jschema/earthquake-hypocenter-update_1.0.0.json +1 -0
  8. package/dist/jschema/earthquake-information_1.0.0.json +1 -0
  9. package/dist/jschema/earthquake-information_1.1.0.json +1 -0
  10. package/dist/jschema/earthquake-nankai_1.0.0.json +1 -0
  11. package/dist/jschema/eew-information_1.0.0.json +1 -0
  12. package/dist/jschema/tsunami-information_1.0.0.json +1 -0
  13. package/dist/jschema/volcano-information_1.0.0.json +1 -0
  14. package/dist/jschema/weather-early_1.0.0.json +1 -0
  15. package/dist/jschema/weather-impact-society_1.0.0.json +1 -0
  16. package/dist/jschema/weather-information_1.0.0.json +1 -0
  17. package/dist/jschema/weather-landslide_1.0.0.json +1 -0
  18. package/dist/jschema/weather-river-flood_1.0.0.json +1 -0
  19. package/dist/jschema/weather-tornado_1.0.0.json +1 -0
  20. package/dist/jschema/weather-typhoon_1.0.0.json +1 -0
  21. package/dist/jschema/weather-warning_1.0.0.json +1 -0
  22. package/dist/jschema-load.d.ts +1 -1
  23. package/dist/jschema-load.js +12 -6
  24. package/index.d.ts +2 -2
  25. package/jest.config.ts +202 -0
  26. package/package.json +29 -21
  27. package/test/sample-schema-check.test.ts +54 -0
  28. package/tsconfig.json +28 -15
  29. package/types/component/code-name.ts +4 -0
  30. package/types/{schema/component → component}/coordinate.d.ts +2 -2
  31. package/types/{schema/component → component}/earthquake.d.ts +0 -0
  32. package/types/{schema/component → component}/unit-value.d.ts +13 -13
  33. package/types/index.d.ts +35 -4
  34. package/types/schema/earthquake-counts/1.0.0.d.ts +69 -0
  35. package/types/schema/earthquake-counts/index.d.ts +7 -0
  36. package/types/schema/earthquake-explanation/1.0.0.d.ts +57 -0
  37. package/types/schema/earthquake-explanation/index.d.ts +7 -0
  38. package/types/schema/earthquake-hypocenter-update/1.0.0.d.ts +53 -0
  39. package/types/schema/earthquake-hypocenter-update/index.d.ts +7 -0
  40. package/types/schema/earthquake-information/1.0.0.d.ts +159 -0
  41. package/types/schema/{earthquake-information.d.ts → earthquake-information/1.1.0.d.ts} +206 -181
  42. package/types/schema/earthquake-information/index.d.ts +9 -0
  43. package/types/schema/earthquake-nankai/1.0.0.d.ts +86 -0
  44. package/types/schema/earthquake-nankai/index.d.ts +7 -0
  45. package/types/schema/{eew-information.d.ts → eew-information/1.0.0.d.ts} +42 -39
  46. package/types/schema/eew-information/index.d.ts +7 -0
  47. package/types/schema/{tsunami-information.d.ts → tsunami-information/1.0.0.d.ts} +262 -230
  48. package/types/schema/tsunami-information/index.d.ts +7 -0
  49. package/types/schema/volcano-information/1.0.0.d.ts +450 -0
  50. package/types/schema/volcano-information/index.d.ts +7 -0
  51. package/types/schema/weather-early/1.0.0.d.ts +135 -0
  52. package/types/schema/weather-early/index.d.ts +7 -0
  53. package/types/schema/weather-impact-society/1.0.0.d.ts +140 -0
  54. package/types/schema/weather-impact-society/index.d.ts +7 -0
  55. package/types/schema/weather-information/1.0.0.d.ts +30 -0
  56. package/types/schema/weather-information/index.d.ts +7 -0
  57. package/types/schema/weather-landslide/1.0.0.d.ts +51 -0
  58. package/types/schema/weather-landslide/index.d.ts +7 -0
  59. package/types/schema/weather-river-flood/1.0.0.d.ts +188 -0
  60. package/types/schema/weather-river-flood/index.d.ts +7 -0
  61. package/types/schema/weather-tornado/1.0.0.d.ts +51 -0
  62. package/types/schema/weather-tornado/index.d.ts +7 -0
  63. package/types/schema/{weather-typhoon.d.ts → weather-typhoon/1.0.0.d.ts} +26 -13
  64. package/types/schema/weather-typhoon/index.d.ts +7 -0
  65. package/types/schema/weather-warning/1.0.0.d.ts +212 -0
  66. package/types/schema/weather-warning/index.d.ts +7 -0
  67. package/dist/jschema/earthquake-information.json +0 -1778
  68. package/dist/jschema/eew-information.json +0 -2742
  69. package/dist/jschema/tsunami-information.json +0 -3891
  70. package/dist/jschema/weather-typhoon.json +0 -4969
  71. package/jschema/build.ts +0 -56
  72. package/jschema/config.ts +0 -4
  73. package/jschema/jschema-load.ts +0 -26
  74. package/tsconfig.jschema.json +0 -16
@@ -1,230 +1,262 @@
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
- type: '大津波警報・津波警報・津波予報a' | '津波情報a' | '各地の満潮時刻・津波到達予想時刻に関する情報' | '津波観測に関する情報';
223
- infoType: '取消';
224
- eventId: string;
225
- body: ChancelBody;
226
- }
227
-
228
- export type Main = (PublicVTSE41 | PublicVTSE51 | PublicVTSE52) | Channel;
229
-
230
- }
1
+ import { TelegramJSONMain } from '@t/main';
2
+ import { CodeName } from '@t/component/code-name';
3
+ import { Earthquake } from '@t/component/earthquake';
4
+
5
+
6
+ export namespace TsunamiInformation {
7
+ export interface Schema {
8
+ type: 'tsunami-information';
9
+ version: '1.0.0';
10
+ }
11
+
12
+ export interface TsunamiForecastKindLastKind extends CodeName {
13
+ }
14
+
15
+ export interface TsunamiForecastKind extends CodeName {
16
+ lastKind: TsunamiForecastKindLastKind;
17
+ }
18
+
19
+ export type TsunamiForecastFirstHeight = ({
20
+ arrivalTime: string;
21
+ condition?: 'ただちに津波来襲と予測';
22
+ } | {
23
+ arrivalTime: never;
24
+ condition: '津波到達中と推測' | '第1波の到達を確認';
25
+ }) &
26
+ {
27
+ revise?: '追加' | '更新';
28
+ };
29
+
30
+ export type TsunamiForecastMaxHeightValue = {
31
+ type: '津波の高さ';
32
+ unit: 'm';
33
+ } & ({
34
+ value: string;
35
+ over?: true;
36
+ condition: never;
37
+ } | {
38
+ value: null;
39
+ over: never;
40
+ condition?: '巨大' | '高い';
41
+ });
42
+
43
+ export interface TsunamiForecastMaxHeight {
44
+ height: TsunamiForecastMaxHeightValue;
45
+ condition?: '重要';
46
+ revise?: '追加' | '更新';
47
+ }
48
+
49
+ export interface TsunamiForecastStation extends CodeName {
50
+ highTideDateTime: string;
51
+ firstHeight: TsunamiForecastFirstHeight;
52
+ }
53
+
54
+ export interface TsunamiForecast extends CodeName {
55
+ kind: TsunamiForecastKind;
56
+ firstHeight?: TsunamiForecastFirstHeight;
57
+ maxHeight?: TsunamiForecastMaxHeight;
58
+ stations?: TsunamiForecastStation[] | never;
59
+ }
60
+
61
+ export interface TsunamiForecastVXSE41 extends TsunamiForecast {
62
+ stations: never;
63
+ }
64
+
65
+ export interface TsunamiForecastVXSE51 extends TsunamiForecast {
66
+ stations?: TsunamiForecastStation[];
67
+ }
68
+
69
+ export type TsunamiObservationStationFirstHeight = ({
70
+ arrivalTime: string;
71
+ initial: '押し' | '引き';
72
+ condition: never;
73
+ } | {
74
+ arrivalTime: never;
75
+ initial: never;
76
+ condition: '第1波識別不能';
77
+ }) & {
78
+ revise?: '追加' | '更新';
79
+ };
80
+
81
+ export interface TsunamiObservationStationMaxHeightValue {
82
+ type: 'これまでの最大波の高さ';
83
+ unit: 'm';
84
+ value: string;
85
+ over?: true;
86
+ condition?: '上昇中';
87
+ }
88
+
89
+ export type TsunamiObservationStationMaxHeight =
90
+ ({
91
+ dateTime: string;
92
+ height: TsunamiObservationStationMaxHeightValue;
93
+ condition?: '重要';
94
+ } | {
95
+ dateTime: string;
96
+ height: never;
97
+ condition: '微弱';
98
+ } | {
99
+ dateTime: never;
100
+ height: never;
101
+ condition: '観測中';
102
+ }) &
103
+ {
104
+ revise?: '追加' | '更新';
105
+ }
106
+
107
+ export interface TsunamiObservationStation extends CodeName {
108
+ sensor?: string;
109
+ firstHeight: TsunamiObservationStationFirstHeight;
110
+ maxHeight: TsunamiObservationStationMaxHeight;
111
+ }
112
+
113
+ export interface TsunamiObservation {
114
+ code: string | null;
115
+ name: string | null;
116
+ stations: TsunamiObservationStation[];
117
+ }
118
+
119
+ export interface TsunamiObservationVXSE51 extends TsunamiObservation {
120
+ code: string;
121
+ name: string;
122
+ }
123
+
124
+ export interface TsunamiObservationVXSE52 extends TsunamiObservation {
125
+ code: null;
126
+ name: null;
127
+ }
128
+
129
+ export interface TsunamiEstimationFirstHeight {
130
+ arrivalTime: string;
131
+ condition?: '早いところでは既に津波到達と推定';
132
+ revise?: '追加' | '更新';
133
+ }
134
+
135
+ export type TsunamiEstimationMaxHeightValue = TsunamiForecastMaxHeightValue;
136
+
137
+ export type TsunamiEstimationMaxHeight =
138
+ ({
139
+ dateTime: string;
140
+ height: TsunamiEstimationMaxHeightValue;
141
+ condition?: '重要';
142
+ } | {
143
+ dateTime: never;
144
+ height: never;
145
+ condition: '推定中';
146
+ }) &
147
+ {
148
+ revise?: '追加' | '更新';
149
+ };
150
+
151
+ export interface TsunamiEstimation extends CodeName {
152
+ firstHeight: TsunamiEstimationFirstHeight;
153
+ maxHeight: TsunamiEstimationMaxHeight;
154
+ }
155
+
156
+ export interface PublicBodyVTSE41Tsunami {
157
+ forecasts: TsunamiForecastVXSE41[];
158
+ }
159
+
160
+ export interface PublicBodyVTSE51Tsunami {
161
+ forecasts: TsunamiForecastVXSE51[];
162
+ observations?: TsunamiObservationVXSE51[];
163
+ }
164
+
165
+ export interface PublicBodyVTSE52Tsunami {
166
+ observations: TsunamiObservationVXSE52[];
167
+ estimations: TsunamiEstimation[];
168
+ }
169
+
170
+ export type Comment = {
171
+ free?: string;
172
+ warning?: {
173
+ text: string;
174
+ codes: string[];
175
+ };
176
+ };
177
+
178
+ export interface CancelBody {
179
+ text: string;
180
+ }
181
+
182
+ export interface PublicBodyVTSE41 {
183
+ tsunami: PublicBodyVTSE41Tsunami;
184
+ earthquakes: Earthquake[];
185
+ text?: string;
186
+ comments?: Comment;
187
+ }
188
+
189
+ export interface PublicBodyVTSE51 {
190
+ tsunami: PublicBodyVTSE51Tsunami;
191
+ earthquakes: Earthquake[];
192
+ text?: string;
193
+ comments?: Comment;
194
+ }
195
+
196
+ export interface PublicBodyVTSE52 {
197
+ tsunami: PublicBodyVTSE52Tsunami;
198
+ earthquakes: Earthquake[];
199
+ text?: string;
200
+ comments?: Comment;
201
+ }
202
+
203
+
204
+ export interface PublicVTSE41 extends TelegramJSONMain {
205
+ _schema: Schema;
206
+ type: '津波警報・注意報・予報a';
207
+ title: string;
208
+ infoType: '発表' | '訂正';
209
+ targetDateTimeDubious: never;
210
+ targetDuration: never;
211
+ validDateTime?: string;
212
+ eventId: string;
213
+ serialNo: null;
214
+ infoKind: '津波警報・注意報・予報';
215
+ body: PublicBodyVTSE41;
216
+ }
217
+
218
+ export interface PublicVTSE51 extends TelegramJSONMain {
219
+ _schema: Schema;
220
+ type: '津波情報a';
221
+ title: '各地の満潮時刻・津波到達予想時刻に関する情報' | '津波観測に関する情報';
222
+ infoType: '発表' | '訂正';
223
+ targetDateTimeDubious: never;
224
+ targetDuration: never;
225
+ validDateTime: never;
226
+ eventId: string;
227
+ serialNo: string;
228
+ infoKind:'津波情報';
229
+ body: PublicBodyVTSE51;
230
+ }
231
+
232
+
233
+ export interface PublicVTSE52 extends TelegramJSONMain {
234
+ _schema: Schema;
235
+ type: '沖合の津波観測に関する情報';
236
+ title: '沖合の津波観測に関する情報';
237
+ infoType: '発表' | '訂正';
238
+ targetDateTimeDubious: never;
239
+ targetDuration: never;
240
+ validDateTime: never;
241
+ eventId: string;
242
+ serialNo: string;
243
+ infoKind: '津波情報';
244
+ body: PublicBodyVTSE52;
245
+ }
246
+
247
+
248
+
249
+ export interface Cancel extends TelegramJSONMain {
250
+ type: '津波警報・注意報・予報a' | '津波情報a' | '各地の満潮時刻・津波到達予想時刻に関する情報' | '津波観測に関する情報';
251
+ infoType: '取消';
252
+ targetDateTimeDubious: never;
253
+ targetDuration: never;
254
+ validDateTime: never;
255
+ eventId: string;
256
+ infoKind: '津波警報・注意報・予報'| '津波情報';
257
+ body: CancelBody;
258
+ }
259
+
260
+ export type Main = (PublicVTSE41 | PublicVTSE51 | PublicVTSE52) | Cancel;
261
+
262
+ }
@@ -0,0 +1,7 @@
1
+ import { TsunamiInformation as v1_0_0 } from './1.0.0';
2
+
3
+
4
+ export {
5
+ v1_0_0 as Latest,
6
+ v1_0_0
7
+ };