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