@dmdata/telegram-json-types 1.0.9-jschema.3 → 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 (45) hide show
  1. package/README.md +7 -0
  2. package/dist/jschema/earthquake-counts_1.0.0.json +1 -1
  3. package/dist/jschema/earthquake-hypocenter-update_1.0.0.json +1 -1
  4. package/dist/jschema/earthquake-information_1.0.0.json +1 -1
  5. package/dist/jschema/earthquake-information_1.1.0.json +1 -1
  6. package/dist/jschema/eew-information_1.0.0.json +1 -1
  7. package/dist/jschema/tsunami-information_1.0.0.json +1 -1
  8. package/dist/jschema/volcano-information_1.0.0.json +1 -1
  9. package/dist/jschema/weather-early_1.0.0.json +1 -0
  10. package/dist/jschema/weather-impact-society_1.0.0.json +1 -0
  11. package/dist/jschema/weather-information_1.0.0.json +1 -0
  12. package/dist/jschema/weather-landslide_1.0.0.json +1 -0
  13. package/dist/jschema/weather-river-flood_1.0.0.json +1 -0
  14. package/dist/jschema/weather-tornado_1.0.0.json +1 -0
  15. package/dist/jschema/weather-typhoon_1.0.0.json +1 -1
  16. package/dist/jschema/weather-warning_1.0.0.json +1 -0
  17. package/jest.config.ts +202 -0
  18. package/package.json +29 -21
  19. package/test/sample-schema-check.test.ts +54 -0
  20. package/tsconfig.json +2 -1
  21. package/types/component/code-name.ts +4 -0
  22. package/types/index.d.ts +15 -1
  23. package/types/schema/earthquake-counts/1.0.0.d.ts +2 -2
  24. package/types/schema/earthquake-hypocenter-update/1.0.0.d.ts +1 -1
  25. package/types/schema/earthquake-information/1.0.0.d.ts +14 -20
  26. package/types/schema/earthquake-information/1.1.0.d.ts +15 -21
  27. package/types/schema/earthquake-nankai/1.0.0.d.ts +2 -3
  28. package/types/schema/eew-information/1.0.0.d.ts +20 -26
  29. package/types/schema/tsunami-information/1.0.0.d.ts +75 -56
  30. package/types/schema/volcano-information/1.0.0.d.ts +19 -18
  31. package/types/schema/weather-early/1.0.0.d.ts +135 -0
  32. package/types/schema/weather-early/index.d.ts +7 -0
  33. package/types/schema/weather-impact-society/1.0.0.d.ts +140 -0
  34. package/types/schema/weather-impact-society/index.d.ts +7 -0
  35. package/types/schema/weather-information/1.0.0.d.ts +30 -0
  36. package/types/schema/weather-information/index.d.ts +7 -0
  37. package/types/schema/weather-landslide/1.0.0.d.ts +51 -0
  38. package/types/schema/weather-landslide/index.d.ts +7 -0
  39. package/types/schema/weather-river-flood/1.0.0.d.ts +188 -0
  40. package/types/schema/weather-river-flood/index.d.ts +7 -0
  41. package/types/schema/weather-tornado/1.0.0.d.ts +51 -0
  42. package/types/schema/weather-tornado/index.d.ts +7 -0
  43. package/types/schema/weather-typhoon/1.0.0.d.ts +22 -11
  44. package/types/schema/weather-warning/1.0.0.d.ts +212 -0
  45. package/types/schema/weather-warning/index.d.ts +7 -0
@@ -1 +1 @@
1
- {"type":"object","properties":{"_schema":{"$ref":"#/definitions/WeatherTyphoon.Schema"},"type":{"enum":["台風解析・予報情報(3日予報)","台風解析・予報情報(5日予報)","台風解析・予報情報(5日予報)(H30)"],"type":"string"},"title":{"type":"string","enum":["台風解析・予報情報"]},"targetDuration":{"type":"string"},"infoKind":{"enum":["台風解析・予報情報(3日予報)","台風解析・予報情報(5日予報)"],"type":"string"},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["取消","発表","訂正"],"type":"string"},"headline":{"type":"null"},"body":{"$ref":"#/definitions/WeatherTyphoon.PublicBody"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"infoKindVersion":{"type":"string"}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","targetDuration","title","type"],"definitions":{"WeatherTyphoon.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["weather-typhoon"]},"version":{"type":"string","enum":["1.0.0"]}},"required":["type","version"]},"WeatherTyphoon.PublicBody":{"type":"object","properties":{"typhoon":{"$ref":"#/definitions/WeatherTyphoon.Typhoon"},"forecasts":{"anyOf":[{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":1,"maxItems":1},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":1,"additionalItems":{"$ref":"#/definitions/WeatherTyphoon.Forecast"}},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"},{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":2,"maxItems":2},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"},{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":2,"additionalItems":{"$ref":"#/definitions/WeatherTyphoon.Forecast"}}]}},"required":["forecasts","typhoon"]},"WeatherTyphoon.Typhoon":{"type":"object","properties":{"tcNumber":{"type":"string"},"name":{"$ref":"#/definitions/WeatherTyphoon.TyphoonName"},"remark":{"anyOf":[{"enum":["台風消滅(域外へ出る)","台風消滅(温帯低気圧化)","台風消滅(熱帯低気圧化)","台風発生","台風発生の可能性が小さくなった","台風発生予想","台風発生(域外から入る)","温帯低気圧化しつつある","発表間隔変更(毎時から3時間毎)","発表間隔変更(3時間毎から毎時)"],"type":"string"},{"type":"null"}]}},"required":["name","remark","tcNumber"]},"WeatherTyphoon.TyphoonName":{"type":"object","properties":{"text":{"type":["null","string"]},"kana":{"type":["null","string"]},"number":{"type":["null","string"]}},"required":["kana","number","text"]},"WeatherTyphoon.RealState":{"type":"object","properties":{"type":{"enum":["実況","推定"],"type":"string"},"elapsedTime":{"enum":["PT0H","PT1H"],"type":"string"},"dateTime":{"type":"string"},"classification":{"$ref":"#/definitions/WeatherTyphoon.RealStateClassification"},"center":{"$ref":"#/definitions/WeatherTyphoon.RealStateCenter"},"wind":{"$ref":"#/definitions/WeatherTyphoon.RealStateWind"}},"required":["center","classification","dateTime","elapsedTime","type"]},"WeatherTyphoon.RealStateClassification":{"type":"object","properties":{"category":{"anyOf":[{"enum":["Hurricane","LOW","STS","TD","TY","Tropical Storm"],"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"enum":["ハリケーン","台風","温帯低気圧","熱帯低気圧","発達した熱帯低気圧"],"type":"string"},{"type":"null"}]},"area":{"anyOf":[{"enum":["大型","超大型"],"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"enum":["強い","猛烈な","非常に強い"],"type":"string"},{"type":"null"}]}},"required":["area","category","intensity","name"]},"WeatherTyphoon.RealStateCenter":{"type":"object","properties":{"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]}},"required":["latitude","longitude"]}]},"location":{"type":"string"},"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"speed":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"pressure":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":"string"}},"required":["type","unit","value"]}},"required":["coordinate","direction","location","pressure","speed"]},"WeatherTyphoon.Direction":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]},"azimuth":{"type":["null","string"]},"condition":{"type":"string"}},"required":["azimuth","type","unit","value"]},"WeatherTyphoon.RealStateWind":{"type":"object","properties":{"average":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"instantaneous":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"area":{"$ref":"#/definitions/WeatherTyphoon.RealStateWindArea"}},"required":["area","average","instantaneous"]},"WeatherTyphoon.RealStateWindArea":{"type":"object","properties":{"strong":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}},"storm":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["storm","strong"]},"WeatherTyphoon.Axis":{"type":"object","properties":{"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"radius":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]}},"required":["direction","radius"]},"WeatherTyphoon.Forecast":{"type":"object","properties":{"type":{"enum":["予報","延長予報"],"type":"string"},"elapsedTime":{"type":"string"},"dateTime":{"type":"string"},"classification":{"$ref":"#/definitions/WeatherTyphoon.ForecastClassification"},"center":{"allOf":[{"type":"object","properties":{"probabilityCircle":{"type":"object","properties":{"basePoint":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]}},"required":["latitude","longitude"]}]},"axes":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["axes","basePoint"]}},"required":["probabilityCircle"]},{"$ref":"#/definitions/Omit<WeatherTyphoon.RealStateCenter,\"location\">"}]},"wind":{"$ref":"#/definitions/WeatherTyphoon.ForecastWind"}},"required":["center","classification","dateTime","elapsedTime","type","wind"]},"WeatherTyphoon.ForecastClassification":{"type":"object","properties":{"name":{"anyOf":[{"enum":["ハリケーン","台風","温帯低気圧","熱帯低気圧","発達した熱帯低気圧"],"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"enum":["Hurricane","LOW","STS","TD","TY","Tropical Storm"],"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"enum":["強い","猛烈な","非常に強い"],"type":"string"},{"type":"null"}]}},"required":["category","intensity","name"]},"Omit<WeatherTyphoon.RealStateCenter,\"location\">":{"type":"object","properties":{"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]}},"required":["latitude","longitude"]}]},"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"speed":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"pressure":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":"string"}},"required":["type","unit","value"]}},"required":["coordinate","direction","pressure","speed"]},"WeatherTyphoon.ForecastWind":{"type":"object","properties":{"average":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"instantaneous":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]}},"required":["type","unit","value"]},"area":{"$ref":"#/definitions/WeatherTyphoon.ForecastWindArea"}},"required":["area","average","instantaneous"]},"WeatherTyphoon.ForecastWindArea":{"type":"object","properties":{"stormWarning":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["stormWarning"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
1
+ {"type":"object","properties":{"_schema":{"$ref":"#/definitions/WeatherTyphoon.Schema"},"type":{"enum":["台風解析・予報情報(3日予報)","台風解析・予報情報(5日予報)","台風解析・予報情報(5日予報)(H30)"],"type":"string"},"title":{"type":"string","enum":["台風解析・予報情報"]},"targetDuration":{"type":"string"},"infoKind":{"enum":["台風解析・予報情報(3日予報)","台風解析・予報情報(5日予報)"],"type":"string"},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoType":{"enum":["取消","発表","訂正"],"type":"string"},"headline":{"type":"null"},"body":{"$ref":"#/definitions/WeatherTyphoon.PublicBody"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"infoKindVersion":{"type":"string"}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","targetDuration","title","type"],"definitions":{"WeatherTyphoon.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["weather-typhoon"]},"version":{"type":"string","enum":["1.0.0"]}},"required":["type","version"]},"WeatherTyphoon.PublicBody":{"type":"object","properties":{"typhoon":{"$ref":"#/definitions/WeatherTyphoon.Typhoon"},"forecasts":{"anyOf":[{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":1,"maxItems":1},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":1,"additionalItems":{"$ref":"#/definitions/WeatherTyphoon.Forecast"}},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"},{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":2,"maxItems":2},{"type":"array","items":[{"$ref":"#/definitions/WeatherTyphoon.RealState"},{"$ref":"#/definitions/WeatherTyphoon.RealState"}],"minItems":2,"additionalItems":{"$ref":"#/definitions/WeatherTyphoon.Forecast"}}]}},"required":["forecasts","typhoon"]},"WeatherTyphoon.Typhoon":{"type":"object","properties":{"tcNumber":{"type":"string"},"name":{"$ref":"#/definitions/WeatherTyphoon.TyphoonName"},"remark":{"anyOf":[{"enum":["台風消滅(域外へ出る)","台風消滅(温帯低気圧化)","台風消滅(熱帯低気圧化)","台風発生","台風発生の可能性が小さくなった","台風発生予想","台風発生(域外から入る)","温帯低気圧化しつつある","発表間隔変更(毎時から3時間毎)","発表間隔変更(3時間毎から毎時)"],"type":"string"},{"type":"null"}]}},"required":["name","remark","tcNumber"]},"WeatherTyphoon.TyphoonName":{"type":"object","properties":{"text":{"type":["null","string"]},"kana":{"type":["null","string"]},"number":{"type":["null","string"]}},"required":["kana","number","text"]},"WeatherTyphoon.RealState":{"type":"object","properties":{"type":{"enum":["実況","推定"],"type":"string"},"elapsedTime":{"enum":["PT0H","PT1H"],"type":"string"},"dateTime":{"type":"string"},"classification":{"$ref":"#/definitions/WeatherTyphoon.RealStateClassification"},"center":{"$ref":"#/definitions/WeatherTyphoon.RealStateCenter"},"wind":{"$ref":"#/definitions/WeatherTyphoon.RealStateWind"}},"required":["center","classification","dateTime","elapsedTime","type"]},"WeatherTyphoon.RealStateClassification":{"type":"object","properties":{"category":{"anyOf":[{"enum":["Hurricane","LOW","STS","TD","TS","TY","Tropical Storm"],"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"enum":["ハリケーン","台風","温帯低気圧","熱帯低気圧","発達した熱帯低気圧"],"type":"string"},{"type":"null"}]},"area":{"anyOf":[{"enum":["大型","超大型"],"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"enum":["強い","猛烈な","非常に強い"],"type":"string"},{"type":"null"}]}},"required":["area","category","intensity","name"]},"WeatherTyphoon.RealStateCenter":{"type":"object","properties":{"coordinate":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]}},"required":["latitude","longitude"]}]},"location":{"type":["null","string"]},"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"speed":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["移動速度"]},"unit":{"type":"string","enum":["km/h"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["移動速度"]},"unit":{"type":"string","enum":["km/h"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"enum":["ほとんど停滞","ゆっくり"],"type":"string"}},"required":["condition","value"]}]}]},"pressure":{"type":"object","properties":{"type":{"type":"string","enum":["中心気圧"]},"unit":{"type":"string","enum":["hPa"]},"value":{"type":"string"}},"required":["type","unit","value"]}},"required":["coordinate","direction","location","pressure","speed"]},"WeatherTyphoon.Direction":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]},"azimuth":{"type":["null","string"]},"condition":{"type":"string"}},"required":["azimuth","type","unit","value"]},"WeatherTyphoon.RealStateWind":{"type":"object","properties":{"average":{"type":"object","properties":{"type":{"type":"string","enum":["最大風速"]},"unit":{"type":"string","enum":["m/s"]},"value":{"type":"string"},"condition":{"$ref":"#/definitions/Condition"}},"required":["condition","type","unit","value"]},"instantaneous":{"type":"object","properties":{"type":{"type":"string","enum":["最大瞬間風速"]},"unit":{"type":"string","enum":["m/s"]},"value":{"type":"string"}},"required":["type","unit","value"]},"area":{"$ref":"#/definitions/WeatherTyphoon.RealStateWindArea"}},"required":["area","average","instantaneous"]},"Condition":{"enum":["なし","中心付近","中心付近を除く"],"type":"string"},"WeatherTyphoon.RealStateWindArea":{"type":"object","properties":{"strong":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}},"storm":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["storm","strong"]},"WeatherTyphoon.Axis":{"type":"object","properties":{"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"radius":{"type":"object","properties":{"type":{"type":"string"},"unit":{"type":"string"},"value":{"type":"string"}},"required":["type","unit","value"]}},"required":["direction","radius"]},"WeatherTyphoon.Forecast":{"type":"object","properties":{"type":{"enum":["予報","延長予報"],"type":"string"},"elapsedTime":{"type":"string"},"dateTime":{"type":"string"},"classification":{"$ref":"#/definitions/WeatherTyphoon.ForecastClassification"},"center":{"allOf":[{"type":"object","properties":{"probabilityCircle":{"type":"object","properties":{"basePoint":{"anyOf":[{"type":"object","properties":{"condition":{"type":"string","enum":["不明"]}},"required":["condition"]},{"type":"object","properties":{"latitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"longitude":{"type":"object","properties":{"text":{"type":"string"},"value":{"type":"string"}},"required":["text","value"]},"height":{"type":"object","properties":{"type":{"type":"string","enum":["高さ"]},"unit":{"type":"string","enum":["m"]},"value":{"type":["null","string"]}},"required":["type","unit","value"]}},"required":["latitude","longitude"]}]},"axes":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["axes","basePoint"]}},"required":["probabilityCircle"]},{"$ref":"#/definitions/Omit<WeatherTyphoon.RealStateCenter,\"coordinate\">"}]},"wind":{"$ref":"#/definitions/WeatherTyphoon.ForecastWind"}},"required":["center","classification","dateTime","elapsedTime","type","wind"]},"WeatherTyphoon.ForecastClassification":{"type":"object","properties":{"name":{"anyOf":[{"enum":["ハリケーン","台風","温帯低気圧","熱帯低気圧","発達した熱帯低気圧"],"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"enum":["Hurricane","LOW","STS","TD","TS","TY","Tropical Storm"],"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"enum":["強い","猛烈な","非常に強い"],"type":"string"},{"type":"null"}]}},"required":["category","intensity","name"]},"Omit<WeatherTyphoon.RealStateCenter,\"coordinate\">":{"type":"object","properties":{"location":{"type":["null","string"]},"direction":{"$ref":"#/definitions/WeatherTyphoon.Direction"},"speed":{"anyOf":[{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["移動速度"]},"unit":{"type":"string","enum":["km/h"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}]},{"allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["移動速度"]},"unit":{"type":"string","enum":["km/h"]}},"required":["type","unit"]},{"type":"object","properties":{"value":{"type":"null"},"condition":{"enum":["ほとんど停滞","ゆっくり"],"type":"string"}},"required":["condition","value"]}]}]},"pressure":{"type":"object","properties":{"type":{"type":"string","enum":["中心気圧"]},"unit":{"type":"string","enum":["hPa"]},"value":{"type":"string"}},"required":["type","unit","value"]}},"required":["direction","location","pressure","speed"]},"WeatherTyphoon.ForecastWind":{"type":"object","properties":{"average":{"type":"object","properties":{"type":{"type":"string","enum":["最大風速"]},"unit":{"type":"string","enum":["m/s"]},"value":{"type":"string"},"condition":{"$ref":"#/definitions/Condition"}},"required":["condition","type","unit","value"]},"instantaneous":{"type":"object","properties":{"type":{"type":"string","enum":["最大瞬間風速"]},"unit":{"type":"string","enum":["m/s"]},"value":{"type":"string"}},"required":["type","unit","value"]},"area":{"$ref":"#/definitions/WeatherTyphoon.ForecastWindArea"}},"required":["area","average","instantaneous"]},"WeatherTyphoon.ForecastWindArea":{"type":"object","properties":{"stormWarning":{"type":"array","items":{"$ref":"#/definitions/WeatherTyphoon.Axis"}}},"required":["stormWarning"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
@@ -0,0 +1 @@
1
+ {"anyOf":[{"$ref":"#/definitions/WeatherWarning.PublicVPWW54"},{"$ref":"#/definitions/WeatherWarning.PublicVPOA50"}],"definitions":{"WeatherWarning.PublicVPWW54":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/WeatherWarning.Schema"},"type":{"type":"string","enum":["気象警報・注意報(H27)"]},"title":{"type":"string"},"infoType":{"enum":["発表","訂正"],"type":"string"},"eventId":{"type":"null"},"serialNo":{"type":"null"},"infoKind":{"type":"string","enum":["気象警報・注意報"]},"body":{"$ref":"#/definitions/WeatherWarning.PublicBodyVPWW54"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"WeatherWarning.Schema":{"type":"object","properties":{"type":{"type":"string","enum":["weather-warning"]},"version":{"type":"string","enum":["1.0.0"]}},"required":["type","version"]},"WeatherWarning.PublicBodyVPWW54":{"type":"object","properties":{"notice":{"type":"string"},"prefectures":{"type":"array","items":{"anyOf":[{"$ref":"#/definitions/WeatherWarning.PrefectureBase"},{"$ref":"#/definitions/WeatherWarning.PrefectureNone"}]}},"regions":{"type":"array","items":{"anyOf":[{"$ref":"#/definitions/WeatherWarning.PrefectureBase"},{"$ref":"#/definitions/WeatherWarning.PrefectureNone"}]}},"areas":{"type":"array","items":{"anyOf":[{"$ref":"#/definitions/WeatherWarning.PrefectureBase"},{"$ref":"#/definitions/WeatherWarning.PrefectureNone"}]}},"cities":{"type":"array","items":{"anyOf":[{"$ref":"#/definitions/WeatherWarning.PrefectureNone"},{"$ref":"#/definitions/Omit<WeatherWarning.PrefectureBase,\"fullStatus\"|\"editingMark\">"}]}},"timeSeries":{"anyOf":[{"type":"array","items":[{"$ref":"#/definitions/WeatherWarning.TimeSeries"}],"minItems":1,"maxItems":1},{"type":"array","items":[{"$ref":"#/definitions/WeatherWarning.TimeSeries"},{"$ref":"#/definitions/WeatherWarning.TimeSeries"}],"minItems":2,"maxItems":2}]}},"required":["areas","cities","prefectures","regions"]},"WeatherWarning.PrefectureBase":{"type":"object","properties":{"kinds":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.Kind"}},"changeStatus":{"enum":["変化無","警報・注意報種別に変化有","警報・注意報種別に変化無、量的予想事項等に変化有"],"type":"string"},"fullStatus":{"enum":["一部","全域"],"type":"string"},"editingMark":{"type":"boolean"},"code":{"type":"string"},"name":{"type":"string"}},"required":["changeStatus","code","editingMark","fullStatus","kinds","name"]},"WeatherWarning.Kind":{"type":"object","properties":{"status":{"enum":["特別警報から注意報","特別警報から警報","発表","継続","解除","警報から注意報"],"type":"string"},"condition":{"enum":["土砂災害","土砂災害、浸水害","浸水害"],"type":"string"},"attentions":{"type":"array","items":{"type":"string"}},"additions":{"type":"array","items":{"type":"string"}},"lastKind":{"$ref":"#/definitions/CodeName"},"nextKinds":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.KindNextKind"}},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name","status"]},"CodeName":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]},"WeatherWarning.KindNextKind":{"type":"object","properties":{"condition":{"enum":["土砂災害","土砂災害、浸水害","浸水害"],"type":"string"},"dateTime":{"$ref":"#/definitions/WeatherWarning.KindNextKindDateTime"},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","dateTime","name"]},"WeatherWarning.KindNextKindDateTime":{"type":"object","properties":{"value":{"type":"string"},"validFormat":{"type":"string"},"precision":{"type":"string"}},"required":["precision","validFormat","value"]},"WeatherWarning.PrefectureNone":{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"object","properties":{}}},"condition":{"type":"string","enum":["発表警報・注意報はなし"]},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","condition","kinds","name"]},"Omit<WeatherWarning.PrefectureBase,\"fullStatus\"|\"editingMark\">":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"kinds":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.Kind"}},"changeStatus":{"enum":["変化無","警報・注意報種別に変化有","警報・注意報種別に変化無、量的予想事項等に変化有"],"type":"string"}},"required":["changeStatus","code","kinds","name"]},"WeatherWarning.TimeSeries":{"type":"object","properties":{"timeDefines":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesTimeDefine"}},"items":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItem"}}},"required":["items","timeDefines"]},"WeatherWarning.TimeSeriesTimeDefine":{"type":"object","properties":{"timeId":{"type":"string"},"dateTime":{"type":"string"},"duration":{"type":"string"},"name":{"type":"string"}},"required":["dateTime","duration","name","timeId"]},"WeatherWarning.TimeSeriesItem":{"type":"object","properties":{"kinds":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKind"}},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","kinds","name"]},"WeatherWarning.TimeSeriesItemKind":{"type":"object","properties":{"riskDegrees":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindRiskDegree"}},"quantitative":{"type":"array","items":{"anyOf":[{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeTimeline"},{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeWhole"}]}},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name","riskDegrees"]},"WeatherWarning.TimeSeriesItemKindRiskDegree":{"type":"object","properties":{"type":{"type":"string"},"locals":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindRiskDegreeLocal"}}},"required":["locals","type"]},"WeatherWarning.TimeSeriesItemKindRiskDegreeLocal":{"type":"object","properties":{"name":{"type":["null","string"]},"significances":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindRiskDegreeLocalSignificance"}},"peakTime":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindRiskDegreeLocalPeakTime"},"attentions":{"type":"array","items":{"type":"string"}},"additions":{"type":"array","items":{"type":"string"}},"future":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindRiskDegreeLocalFuture"}},"required":["name","significances"]},"WeatherWarning.TimeSeriesItemKindRiskDegreeLocalSignificance":{"type":"object","properties":{"refId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name","refId"]},"WeatherWarning.TimeSeriesItemKindRiskDegreeLocalPeakTime":{"type":"object","properties":{"date":{"type":"string"},"term":{"type":"string"}},"required":["term"]},"WeatherWarning.TimeSeriesItemKindRiskDegreeLocalFuture":{"type":"object","properties":{"sentence":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name","sentence"]},"WeatherWarning.TimeSeriesItemKindQuantitativeTimeline":{"type":"object","properties":{"type":{"type":"string"},"forecastType":{"type":"string","enum":["timeline"]},"locals":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeTimelineLocal"}}},"required":["forecastType","locals","type"]},"WeatherWarning.TimeSeriesItemKindQuantitativeTimelineLocal":{"type":"object","properties":{"name":{"type":["null","string"]},"forecasts":{"type":"array","items":{"anyOf":[{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeTimelineLocalForecastValue"},{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeTimelineLocalForecastNotValue"}]}}},"required":["forecasts","name"]},"WeatherWarning.TimeSeriesItemKindQuantitativeTimelineLocalForecastValue":{"type":"object","properties":{"refId":{"type":"string"},"unit":{"type":"string"},"value":{"type":["null","string"]},"condition":{"type":"string"}},"required":["refId","unit","value"]},"WeatherWarning.TimeSeriesItemKindQuantitativeTimelineLocalForecastNotValue":{"type":"object","properties":{"refId":{"type":"string"},"unit":{"type":"string"},"value":{"type":"null"},"condition":{"enum":["値なし"],"type":"string"}},"required":["refId","unit","value"]},"WeatherWarning.TimeSeriesItemKindQuantitativeWhole":{"type":"object","properties":{"type":{"type":"string"},"forecastType":{"type":"string","enum":["whole"]},"locals":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeWholeLocal"}}},"required":["forecastType","locals","type"]},"WeatherWarning.TimeSeriesItemKindQuantitativeWholeLocal":{"type":"object","properties":{"name":{"type":["null","string"]},"forecast":{"anyOf":[{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeWholeLocalForecastValue"},{"$ref":"#/definitions/WeatherWarning.TimeSeriesItemKindQuantitativeWholeLocalForecastNotValue"}]}},"required":["forecast","name"]},"WeatherWarning.TimeSeriesItemKindQuantitativeWholeLocalForecastValue":{"type":"object","properties":{"unit":{"type":"string"},"value":{"type":"string"},"condition":{"type":"string"}},"required":["unit","value"]},"WeatherWarning.TimeSeriesItemKindQuantitativeWholeLocalForecastNotValue":{"type":"object","properties":{"unit":{"type":"string"},"value":{"type":"null"},"condition":{"type":"string","enum":["値なし"]}},"required":["condition","unit","value"]},"WeatherWarning.PublicVPOA50":{"type":"object","properties":{"_schema":{"$ref":"#/definitions/WeatherWarning.Schema"},"type":{"type":"string","enum":["記録的短時間大雨情報"]},"title":{"type":"string"},"infoType":{"enum":["取消","発表","訂正"],"type":"string"},"eventId":{"type":"string"},"serialNo":{"type":"string"},"infoKind":{"type":"string","enum":["記録的短時間大雨情報"]},"body":{"$ref":"#/definitions/WeatherWarning.PublicBodyVPOA50"},"_originalId":{"type":"string"},"status":{"enum":["訓練","試験","通常"],"type":"string"},"editorialOffice":{"type":"string"},"publishingOffice":{"type":"array","items":{"type":"string"}},"pressDateTime":{"type":"string"},"reportDateTime":{"type":"string"},"targetDateTime":{"type":"string"},"infoKindVersion":{"type":"string"},"headline":{"type":["null","string"]}},"required":["_originalId","_schema","body","editorialOffice","eventId","headline","infoKind","infoKindVersion","infoType","pressDateTime","publishingOffice","reportDateTime","serialNo","status","targetDateTime","title","type"]},"WeatherWarning.PublicBodyVPOA50":{"type":"object","properties":{"notice":{"type":"string"},"prefectures":{"type":"array","items":{"$ref":"#/definitions/WeatherWarning.PrefectureVPOA50"}}},"required":["prefectures"]},"WeatherWarning.PrefectureVPOA50":{"type":"object","properties":{"kinds":{"type":"array","items":[{"$ref":"#/definitions/WeatherWarning.KindVPOA50"}],"minItems":1,"maxItems":1},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","kinds","name"]},"WeatherWarning.KindVPOA50":{"type":"object","properties":{"status":{"enum":["なし","発表"],"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name","status"]}},"$schema":"http://json-schema.org/draft-07/schema#"}
package/jest.config.ts ADDED
@@ -0,0 +1,202 @@
1
+ /*
2
+ * For a detailed explanation regarding each configuration property and type check, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ export default {
7
+ // All imported modules in your tests should be mocked automatically
8
+ // automock: false,
9
+
10
+ // Stop running tests after `n` failures
11
+ // bail: 0,
12
+
13
+ // The directory where Jest should store its cached dependency information
14
+ // cacheDirectory: "C:\\Users\\soshi\\AppData\\Local\\Temp\\jest",
15
+
16
+ // Automatically clear mock calls, instances and results before every test
17
+ // clearMocks: true,
18
+
19
+ // Indicates whether the coverage information should be collected while executing the test
20
+ // collectCoverage: false,
21
+
22
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
23
+ // collectCoverageFrom: undefined,
24
+
25
+ // The directory where Jest should output its coverage files
26
+ // coverageDirectory: undefined,
27
+
28
+ // An array of regexp pattern strings used to skip coverage collection
29
+ // coveragePathIgnorePatterns: [
30
+ // "\\\\node_modules\\\\"
31
+ // ],
32
+
33
+ // Indicates which provider should be used to instrument code for coverage
34
+ coverageProvider: "v8",
35
+
36
+ // A list of reporter names that Jest uses when writing coverage reports
37
+ // coverageReporters: [
38
+ // "json",
39
+ // "text",
40
+ // "lcov",
41
+ // "clover"
42
+ // ],
43
+
44
+ // An object that configures minimum threshold enforcement for coverage results
45
+ // coverageThreshold: undefined,
46
+
47
+ // A path to a custom dependency extractor
48
+ // dependencyExtractor: undefined,
49
+
50
+ // Make calling deprecated APIs throw helpful error messages
51
+ // errorOnDeprecated: false,
52
+
53
+ // Force coverage collection from ignored files using an array of glob patterns
54
+ // forceCoverageMatch: [],
55
+
56
+ // A path to a module which exports an async function that is triggered once before all test suites
57
+ // globalSetup: undefined,
58
+
59
+ // A path to a module which exports an async function that is triggered once after all test suites
60
+ // globalTeardown: undefined,
61
+
62
+ // A set of global variables that need to be available in all test environments
63
+ // globals: {},
64
+
65
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
66
+ // maxWorkers: "50%",
67
+
68
+ // An array of directory names to be searched recursively up from the requiring module's location
69
+ // moduleDirectories: [
70
+ // "node_modules"
71
+ // ],
72
+
73
+ // An array of file extensions your modules use
74
+ // moduleFileExtensions: [
75
+ // "js",
76
+ // "jsx",
77
+ // "ts",
78
+ // "tsx",
79
+ // "json",
80
+ // "node"
81
+ // ],
82
+
83
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
84
+ // moduleNameMapper: {},
85
+
86
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
87
+ // modulePathIgnorePatterns: [],
88
+
89
+ // Activates notifications for test results
90
+ // notify: false,
91
+
92
+ // An enum that specifies notification mode. Requires { notify: true }
93
+ // notifyMode: "failure-change",
94
+
95
+ // A preset that is used as a base for Jest's configuration
96
+ // preset: undefined,
97
+
98
+ // Run tests from one or more projects
99
+ // projects: undefined,
100
+
101
+ // Use this configuration option to add custom reporters to Jest
102
+ // reporters: undefined,
103
+
104
+ // Automatically reset mock state before every test
105
+ // resetMocks: false,
106
+
107
+ // Reset the module registry before running each individual test
108
+ // resetModules: false,
109
+
110
+ // A path to a custom resolver
111
+ // resolver: undefined,
112
+
113
+ // Automatically restore mock state and implementation before every test
114
+ // restoreMocks: false,
115
+
116
+ // The root directory that Jest should scan for tests and modules within
117
+ // rootDir: undefined,
118
+
119
+ // A list of paths to directories that Jest should use to search for files in
120
+ // roots: [
121
+ // "<rootDir>"
122
+ // ],
123
+
124
+ // Allows you to use a custom runner instead of Jest's default test runner
125
+ // runner: "jest-runner",
126
+
127
+ // The paths to modules that run some code to configure or set up the testing environment before each test
128
+ // setupFiles: [],
129
+
130
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
131
+ // setupFilesAfterEnv: [],
132
+
133
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
134
+ // slowTestThreshold: 5,
135
+
136
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
137
+ // snapshotSerializers: [],
138
+
139
+ // The test environment that will be used for testing
140
+ // testEnvironment: "jest-environment-node",
141
+
142
+ // Options that will be passed to the testEnvironment
143
+ // testEnvironmentOptions: {},
144
+
145
+ // Adds a location field to test results
146
+ // testLocationInResults: false,
147
+
148
+ // The glob patterns Jest uses to detect test files
149
+ // testMatch: [
150
+ // "**/__tests__/**/*.[jt]s?(x)",
151
+ // "**/?(*.)+(spec|test).[tj]s?(x)"
152
+ // ],
153
+
154
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
155
+ // testPathIgnorePatterns: [
156
+ // "\\\\node_modules\\\\"
157
+ // ],
158
+
159
+ // The regexp pattern or array of patterns that Jest uses to detect test files
160
+ // testRegex: [],
161
+
162
+ // This option allows the use of a custom results processor
163
+ // testResultsProcessor: undefined,
164
+
165
+ // This option allows use of a custom test runner
166
+ // testRunner: "jest-circus/runner",
167
+
168
+ // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
169
+ // testURL: "http://localhost",
170
+
171
+ // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
172
+ // timers: "real",
173
+
174
+ // A map from regular expressions to paths to transformers
175
+ // transform: undefined,
176
+
177
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
178
+ // transformIgnorePatterns: [
179
+ // "\\\\node_modules\\\\",
180
+ // "\\.pnp\\.[^\\\\]+$"
181
+ // ],
182
+
183
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
184
+ // unmockedModulePathPatterns: undefined,
185
+
186
+ // Indicates whether each individual test should be reported during the run
187
+ // verbose: undefined,
188
+
189
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
190
+ // watchPathIgnorePatterns: [],
191
+
192
+ // Whether to use watchman for file crawling
193
+ // watchman: true,
194
+
195
+ roots: [
196
+ "<rootDir>/test"
197
+ ],
198
+
199
+ transform: {
200
+ "^.+\\.ts$": "ts-jest"
201
+ },
202
+ };
package/package.json CHANGED
@@ -1,21 +1,29 @@
1
- {
2
- "name": "@dmdata/telegram-json-types",
3
- "version": "1.0.9-jschema.3",
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
- },
10
- "types": "index.d.ts",
11
- "main": "./dist/jschema-load.js",
12
- "keywords": [],
13
- "author": "",
14
- "license": "MIT",
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
- }
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
@@ -18,7 +18,8 @@
18
18
  }
19
19
  },
20
20
  "include": [
21
- "types/**/*"
21
+ "types/**/*",
22
+ "test/**/*"
22
23
  ],
23
24
  "exclude": [
24
25
  "jschema",
@@ -0,0 +1,4 @@
1
+ export interface CodeName {
2
+ code: string;
3
+ name: string;
4
+ }
package/types/index.d.ts CHANGED
@@ -6,7 +6,14 @@ import * as EarthquakeNankai from './schema/earthquake-nankai';
6
6
  import * as EewInformation from './schema/eew-information';
7
7
  import * as TsunamiInformation from './schema/tsunami-information';
8
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';
9
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';
10
17
 
11
18
  export {
12
19
  EarthquakeInformation,
@@ -17,5 +24,12 @@ export {
17
24
  EewInformation,
18
25
  TsunamiInformation,
19
26
  VolcanoInformation,
20
- WeatherTyphoon
27
+ WeatherInformation,
28
+ WeatherImpactSociety,
29
+ WeatherEarly,
30
+ WeatherWarning,
31
+ WeatherTornado,
32
+ WeatherTyphoon,
33
+ WeatherLandslide,
34
+ WeatherRiverFlood
21
35
  };
@@ -17,7 +17,7 @@ export namespace EarthquakeCounts {
17
17
  }
18
18
 
19
19
  export interface EarthquakeCount {
20
- type: '1時間地震回数' | '累計地震回数' | '地震回数';
20
+ type: '1時間地震回数' | '累積地震回数' | '地震回数';
21
21
  targetTime: EarthquakeCountTargetTime;
22
22
  values: EarthquakeCountValues;
23
23
  }
@@ -27,7 +27,7 @@ export namespace EarthquakeCounts {
27
27
  }
28
28
 
29
29
  export interface PublicBody {
30
- earthquakeCounts?: EarthquakeCount;
30
+ earthquakeCounts?: EarthquakeCount[];
31
31
  nextAdvisory?: string;
32
32
  text?: string;
33
33
  comments?: Comments;
@@ -13,7 +13,7 @@ export namespace EarthquakeHypocenterUpdate {
13
13
 
14
14
  export interface PublicBody {
15
15
  earthquake: Earthquake;
16
- text: string;
16
+ text?: string;
17
17
  comments?: Comments;
18
18
  }
19
19
 
@@ -1,41 +1,35 @@
1
1
  import { TelegramJSONMain } from '@t/main';
2
+ import { CodeName } from '@t/component/code-name';
2
3
  import { Earthquake } from '@t/component/earthquake';
3
4
 
4
5
  export namespace EarthquakeInformation {
5
6
  export interface Schema {
6
7
  type: 'earthquake-information';
7
- version: '1.1.0';
8
+ version: '1.0.0';
8
9
  }
9
10
 
10
11
  export type IntensityClass = '1' | '2' | '3' | '4' | '5-' | '5+' | '6-' | '6+' | '7';
11
12
 
12
- export type IntensityMaxInt = {
13
- name: string;
14
- code: string;
13
+ export interface IntensityMaxInt extends CodeName {
15
14
  maxInt: IntensityClass;
16
- };
17
- export type IntensityMaxIntOnRevise = {
18
- name: string;
19
- code: string;
15
+ }
16
+
17
+ export interface IntensityMaxIntOnRevise extends CodeName {
20
18
  maxInt?: IntensityClass;
21
19
  revise?: '上方修正' | '追加';
22
20
  }
23
21
 
24
- export type IntensityCity = {
25
- name: string;
26
- code: string;
22
+ export interface IntensityCity extends CodeName {
27
23
  maxInt?: IntensityClass;
28
24
  revise?: '上方修正' | '追加';
29
25
  condition?: '震度5弱以上未入電';
30
- };
26
+ }
31
27
 
32
- export type IntensityStation = {
33
- name: string;
34
- code: string;
28
+ export interface IntensityStation extends CodeName {
35
29
  int: IntensityClass | '!5-';
36
30
  revise?: '上方修正' | '追加';
37
31
  condition?: '震度5弱以上未入電';
38
- };
32
+ }
39
33
 
40
34
  export type Comment = {
41
35
  free?: string;
@@ -50,19 +44,19 @@ export namespace EarthquakeInformation {
50
44
  };
51
45
 
52
46
 
53
- export type IntensityVXSE51 = {
47
+ export interface IntensityVXSE51 {
54
48
  maxInt: IntensityClass;
55
49
  prefectures: IntensityMaxInt[];
56
50
  regions: IntensityMaxInt[];
57
- };
51
+ }
58
52
 
59
- export type IntensityVXSE53 = {
53
+ export interface IntensityVXSE53 {
60
54
  maxInt: IntensityClass;
61
55
  prefectures: IntensityMaxIntOnRevise[];
62
56
  regions: IntensityMaxIntOnRevise[];
63
57
  cities: IntensityCity[];
64
58
  stations: IntensityStation[];
65
- };
59
+ }
66
60
 
67
61
 
68
62
  export interface PublicBodyVXSE51 {