rsmp_schema 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (653) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +49 -0
  6. data/LICENSE +7 -0
  7. data/README.md +73 -0
  8. data/Rakefile +18 -0
  9. data/examples/validate.rb +32 -0
  10. data/exe/rsmp_schema +4 -0
  11. data/lib/rsmp_schema/cli.rb +35 -0
  12. data/lib/rsmp_schema/convert/export/json_schema.rb +223 -0
  13. data/lib/rsmp_schema/convert/import/yaml.rb +41 -0
  14. data/lib/rsmp_schema/error.rb +13 -0
  15. data/lib/rsmp_schema/schema.rb +102 -0
  16. data/lib/rsmp_schema/version.rb +5 -0
  17. data/lib/rsmp_schema.rb +7 -0
  18. data/rsmp_schema.gemspec +40 -0
  19. data/schemas/core/3.1.1/aggregated_status.json +25 -0
  20. data/schemas/core/3.1.1/alarm.json +58 -0
  21. data/schemas/core/3.1.1/alarm_issue.json +47 -0
  22. data/schemas/core/3.1.1/alarm_suspend_resume.json +3 -0
  23. data/schemas/core/3.1.1/alarm_suspended_resumed.json +47 -0
  24. data/schemas/core/3.1.1/command_request.json +24 -0
  25. data/schemas/core/3.1.1/command_response.json +34 -0
  26. data/schemas/core/3.1.1/core.json +38 -0
  27. data/schemas/core/3.1.1/definitions.json +67 -0
  28. data/schemas/core/3.1.1/message_ack.json +11 -0
  29. data/schemas/core/3.1.1/message_not_ack.json +15 -0
  30. data/schemas/core/3.1.1/rsmp.json +124 -0
  31. data/schemas/core/3.1.1/status.json +21 -0
  32. data/schemas/core/3.1.1/status_request.json +5 -0
  33. data/schemas/core/3.1.1/status_response.json +30 -0
  34. data/schemas/core/3.1.1/status_subscribe.json +27 -0
  35. data/schemas/core/3.1.1/status_unsubscribe.json +5 -0
  36. data/schemas/core/3.1.1/status_update.json +30 -0
  37. data/schemas/core/3.1.1/version.json +47 -0
  38. data/schemas/core/3.1.1/watchdog.json +9 -0
  39. data/schemas/core/3.1.2/rsmp.json +3 -0
  40. data/schemas/core/3.1.3/rsmp.json +124 -0
  41. data/schemas/core/3.1.3/status_response.json +30 -0
  42. data/schemas/core/3.1.3/status_update.json +30 -0
  43. data/schemas/core/3.1.4/rsmp.json +3 -0
  44. data/schemas/core/3.1.5/aggregated_status_request.json +9 -0
  45. data/schemas/core/3.1.5/alarm.json +68 -0
  46. data/schemas/core/3.1.5/alarm_request.json +3 -0
  47. data/schemas/core/3.1.5/core.json +39 -0
  48. data/schemas/core/3.1.5/rsmp.json +133 -0
  49. data/schemas/core/3.1.5/status.json +21 -0
  50. data/schemas/core/3.1.5/status_subscribe.json +31 -0
  51. data/schemas/core/3.2/alarm.json +62 -0
  52. data/schemas/core/3.2/core.json +39 -0
  53. data/schemas/core/3.2/rsmp.json +133 -0
  54. data/schemas/tlc/1.0.10/alarms/A0001.json +7 -0
  55. data/schemas/tlc/1.0.10/alarms/A0002.json +7 -0
  56. data/schemas/tlc/1.0.10/alarms/A0003.json +7 -0
  57. data/schemas/tlc/1.0.10/alarms/A0004.json +7 -0
  58. data/schemas/tlc/1.0.10/alarms/A0005.json +7 -0
  59. data/schemas/tlc/1.0.10/alarms/A0006.json +7 -0
  60. data/schemas/tlc/1.0.10/alarms/A0007.json +7 -0
  61. data/schemas/tlc/1.0.10/alarms/A0008.json +40 -0
  62. data/schemas/tlc/1.0.10/alarms/A0009.json +7 -0
  63. data/schemas/tlc/1.0.10/alarms/A0101.json +7 -0
  64. data/schemas/tlc/1.0.10/alarms/A0201.json +39 -0
  65. data/schemas/tlc/1.0.10/alarms/A0202.json +39 -0
  66. data/schemas/tlc/1.0.10/alarms/A0301.json +111 -0
  67. data/schemas/tlc/1.0.10/alarms/A0302.json +137 -0
  68. data/schemas/tlc/1.0.10/alarms/alarms.json +238 -0
  69. data/schemas/tlc/1.0.10/commands/M0001.json +125 -0
  70. data/schemas/tlc/1.0.10/commands/M0002.json +91 -0
  71. data/schemas/tlc/1.0.10/commands/M0003.json +91 -0
  72. data/schemas/tlc/1.0.10/commands/M0004.json +64 -0
  73. data/schemas/tlc/1.0.10/commands/M0005.json +91 -0
  74. data/schemas/tlc/1.0.10/commands/M0006.json +91 -0
  75. data/schemas/tlc/1.0.10/commands/M0007.json +64 -0
  76. data/schemas/tlc/1.0.10/commands/M0008.json +91 -0
  77. data/schemas/tlc/1.0.10/commands/M0010.json +64 -0
  78. data/schemas/tlc/1.0.10/commands/M0011.json +64 -0
  79. data/schemas/tlc/1.0.10/commands/M0012.json +58 -0
  80. data/schemas/tlc/1.0.10/commands/M0013.json +58 -0
  81. data/schemas/tlc/1.0.10/commands/M0019.json +118 -0
  82. data/schemas/tlc/1.0.10/commands/M0103.json +82 -0
  83. data/schemas/tlc/1.0.10/commands/M0104.json +199 -0
  84. data/schemas/tlc/1.0.10/commands/command_requests.json +7 -0
  85. data/schemas/tlc/1.0.10/commands/command_responses.json +7 -0
  86. data/schemas/tlc/1.0.10/commands/commands.json +254 -0
  87. data/schemas/tlc/1.0.10/statuses/S0001.json +116 -0
  88. data/schemas/tlc/1.0.10/statuses/S0002.json +34 -0
  89. data/schemas/tlc/1.0.10/statuses/S0003.json +55 -0
  90. data/schemas/tlc/1.0.10/statuses/S0004.json +55 -0
  91. data/schemas/tlc/1.0.10/statuses/S0005.json +40 -0
  92. data/schemas/tlc/1.0.10/statuses/S0006.json +67 -0
  93. data/schemas/tlc/1.0.10/statuses/S0007.json +67 -0
  94. data/schemas/tlc/1.0.10/statuses/S0008.json +67 -0
  95. data/schemas/tlc/1.0.10/statuses/S0009.json +67 -0
  96. data/schemas/tlc/1.0.10/statuses/S0010.json +67 -0
  97. data/schemas/tlc/1.0.10/statuses/S0011.json +67 -0
  98. data/schemas/tlc/1.0.10/statuses/S0012.json +67 -0
  99. data/schemas/tlc/1.0.10/statuses/S0013.json +67 -0
  100. data/schemas/tlc/1.0.10/statuses/S0014.json +40 -0
  101. data/schemas/tlc/1.0.10/statuses/S0015.json +40 -0
  102. data/schemas/tlc/1.0.10/statuses/S0016.json +40 -0
  103. data/schemas/tlc/1.0.10/statuses/S0017.json +40 -0
  104. data/schemas/tlc/1.0.10/statuses/S0018.json +40 -0
  105. data/schemas/tlc/1.0.10/statuses/S0019.json +40 -0
  106. data/schemas/tlc/1.0.10/statuses/S0020.json +67 -0
  107. data/schemas/tlc/1.0.10/statuses/S0021.json +35 -0
  108. data/schemas/tlc/1.0.10/statuses/S0091.json +58 -0
  109. data/schemas/tlc/1.0.10/statuses/S0092.json +58 -0
  110. data/schemas/tlc/1.0.10/statuses/S0095.json +34 -0
  111. data/schemas/tlc/1.0.10/statuses/S0096.json +175 -0
  112. data/schemas/tlc/1.0.10/statuses/S0201.json +67 -0
  113. data/schemas/tlc/1.0.10/statuses/S0202.json +67 -0
  114. data/schemas/tlc/1.0.10/statuses/S0203.json +67 -0
  115. data/schemas/tlc/1.0.10/statuses/S0204.json +283 -0
  116. data/schemas/tlc/1.0.10/statuses/statuses.json +482 -0
  117. data/schemas/tlc/1.0.10/sxl.json +73 -0
  118. data/schemas/tlc/1.0.10/sxl.yaml +1059 -0
  119. data/schemas/tlc/1.0.13/alarms/A0001.json +7 -0
  120. data/schemas/tlc/1.0.13/alarms/A0002.json +7 -0
  121. data/schemas/tlc/1.0.13/alarms/A0003.json +7 -0
  122. data/schemas/tlc/1.0.13/alarms/A0004.json +7 -0
  123. data/schemas/tlc/1.0.13/alarms/A0005.json +7 -0
  124. data/schemas/tlc/1.0.13/alarms/A0006.json +7 -0
  125. data/schemas/tlc/1.0.13/alarms/A0007.json +7 -0
  126. data/schemas/tlc/1.0.13/alarms/A0008.json +40 -0
  127. data/schemas/tlc/1.0.13/alarms/A0009.json +7 -0
  128. data/schemas/tlc/1.0.13/alarms/A0101.json +7 -0
  129. data/schemas/tlc/1.0.13/alarms/A0201.json +39 -0
  130. data/schemas/tlc/1.0.13/alarms/A0202.json +39 -0
  131. data/schemas/tlc/1.0.13/alarms/A0301.json +111 -0
  132. data/schemas/tlc/1.0.13/alarms/A0302.json +137 -0
  133. data/schemas/tlc/1.0.13/alarms/alarms.json +238 -0
  134. data/schemas/tlc/1.0.13/commands/M0001.json +125 -0
  135. data/schemas/tlc/1.0.13/commands/M0002.json +91 -0
  136. data/schemas/tlc/1.0.13/commands/M0003.json +91 -0
  137. data/schemas/tlc/1.0.13/commands/M0004.json +64 -0
  138. data/schemas/tlc/1.0.13/commands/M0005.json +91 -0
  139. data/schemas/tlc/1.0.13/commands/M0006.json +91 -0
  140. data/schemas/tlc/1.0.13/commands/M0007.json +64 -0
  141. data/schemas/tlc/1.0.13/commands/M0008.json +91 -0
  142. data/schemas/tlc/1.0.13/commands/M0010.json +64 -0
  143. data/schemas/tlc/1.0.13/commands/M0011.json +64 -0
  144. data/schemas/tlc/1.0.13/commands/M0012.json +58 -0
  145. data/schemas/tlc/1.0.13/commands/M0013.json +58 -0
  146. data/schemas/tlc/1.0.13/commands/M0014.json +85 -0
  147. data/schemas/tlc/1.0.13/commands/M0015.json +91 -0
  148. data/schemas/tlc/1.0.13/commands/M0016.json +58 -0
  149. data/schemas/tlc/1.0.13/commands/M0017.json +58 -0
  150. data/schemas/tlc/1.0.13/commands/M0018.json +91 -0
  151. data/schemas/tlc/1.0.13/commands/M0019.json +118 -0
  152. data/schemas/tlc/1.0.13/commands/M0103.json +82 -0
  153. data/schemas/tlc/1.0.13/commands/M0104.json +199 -0
  154. data/schemas/tlc/1.0.13/commands/command_requests.json +7 -0
  155. data/schemas/tlc/1.0.13/commands/command_responses.json +7 -0
  156. data/schemas/tlc/1.0.13/commands/commands.json +334 -0
  157. data/schemas/tlc/1.0.13/statuses/S0001.json +116 -0
  158. data/schemas/tlc/1.0.13/statuses/S0002.json +34 -0
  159. data/schemas/tlc/1.0.13/statuses/S0003.json +55 -0
  160. data/schemas/tlc/1.0.13/statuses/S0004.json +55 -0
  161. data/schemas/tlc/1.0.13/statuses/S0005.json +40 -0
  162. data/schemas/tlc/1.0.13/statuses/S0006.json +67 -0
  163. data/schemas/tlc/1.0.13/statuses/S0007.json +67 -0
  164. data/schemas/tlc/1.0.13/statuses/S0008.json +67 -0
  165. data/schemas/tlc/1.0.13/statuses/S0009.json +67 -0
  166. data/schemas/tlc/1.0.13/statuses/S0010.json +67 -0
  167. data/schemas/tlc/1.0.13/statuses/S0011.json +67 -0
  168. data/schemas/tlc/1.0.13/statuses/S0012.json +67 -0
  169. data/schemas/tlc/1.0.13/statuses/S0013.json +67 -0
  170. data/schemas/tlc/1.0.13/statuses/S0014.json +40 -0
  171. data/schemas/tlc/1.0.13/statuses/S0015.json +40 -0
  172. data/schemas/tlc/1.0.13/statuses/S0016.json +40 -0
  173. data/schemas/tlc/1.0.13/statuses/S0017.json +40 -0
  174. data/schemas/tlc/1.0.13/statuses/S0018.json +40 -0
  175. data/schemas/tlc/1.0.13/statuses/S0019.json +40 -0
  176. data/schemas/tlc/1.0.13/statuses/S0020.json +67 -0
  177. data/schemas/tlc/1.0.13/statuses/S0021.json +35 -0
  178. data/schemas/tlc/1.0.13/statuses/S0022.json +34 -0
  179. data/schemas/tlc/1.0.13/statuses/S0023.json +35 -0
  180. data/schemas/tlc/1.0.13/statuses/S0024.json +35 -0
  181. data/schemas/tlc/1.0.13/statuses/S0025.json +229 -0
  182. data/schemas/tlc/1.0.13/statuses/S0026.json +34 -0
  183. data/schemas/tlc/1.0.13/statuses/S0027.json +34 -0
  184. data/schemas/tlc/1.0.13/statuses/S0028.json +34 -0
  185. data/schemas/tlc/1.0.13/statuses/S0029.json +34 -0
  186. data/schemas/tlc/1.0.13/statuses/S0091.json +58 -0
  187. data/schemas/tlc/1.0.13/statuses/S0092.json +58 -0
  188. data/schemas/tlc/1.0.13/statuses/S0095.json +34 -0
  189. data/schemas/tlc/1.0.13/statuses/S0096.json +175 -0
  190. data/schemas/tlc/1.0.13/statuses/S0201.json +67 -0
  191. data/schemas/tlc/1.0.13/statuses/S0202.json +67 -0
  192. data/schemas/tlc/1.0.13/statuses/S0203.json +67 -0
  193. data/schemas/tlc/1.0.13/statuses/S0204.json +283 -0
  194. data/schemas/tlc/1.0.13/statuses/statuses.json +610 -0
  195. data/schemas/tlc/1.0.13/sxl.json +73 -0
  196. data/schemas/tlc/1.0.13/sxl.yaml +1376 -0
  197. data/schemas/tlc/1.0.14/alarms/A0001.json +7 -0
  198. data/schemas/tlc/1.0.14/alarms/A0002.json +7 -0
  199. data/schemas/tlc/1.0.14/alarms/A0003.json +7 -0
  200. data/schemas/tlc/1.0.14/alarms/A0004.json +7 -0
  201. data/schemas/tlc/1.0.14/alarms/A0005.json +7 -0
  202. data/schemas/tlc/1.0.14/alarms/A0006.json +7 -0
  203. data/schemas/tlc/1.0.14/alarms/A0007.json +7 -0
  204. data/schemas/tlc/1.0.14/alarms/A0008.json +40 -0
  205. data/schemas/tlc/1.0.14/alarms/A0009.json +7 -0
  206. data/schemas/tlc/1.0.14/alarms/A0101.json +7 -0
  207. data/schemas/tlc/1.0.14/alarms/A0201.json +39 -0
  208. data/schemas/tlc/1.0.14/alarms/A0202.json +39 -0
  209. data/schemas/tlc/1.0.14/alarms/A0301.json +111 -0
  210. data/schemas/tlc/1.0.14/alarms/A0302.json +137 -0
  211. data/schemas/tlc/1.0.14/alarms/alarms.json +238 -0
  212. data/schemas/tlc/1.0.14/commands/M0001.json +125 -0
  213. data/schemas/tlc/1.0.14/commands/M0002.json +91 -0
  214. data/schemas/tlc/1.0.14/commands/M0003.json +91 -0
  215. data/schemas/tlc/1.0.14/commands/M0004.json +64 -0
  216. data/schemas/tlc/1.0.14/commands/M0005.json +91 -0
  217. data/schemas/tlc/1.0.14/commands/M0006.json +91 -0
  218. data/schemas/tlc/1.0.14/commands/M0007.json +64 -0
  219. data/schemas/tlc/1.0.14/commands/M0008.json +91 -0
  220. data/schemas/tlc/1.0.14/commands/M0010.json +64 -0
  221. data/schemas/tlc/1.0.14/commands/M0011.json +64 -0
  222. data/schemas/tlc/1.0.14/commands/M0012.json +58 -0
  223. data/schemas/tlc/1.0.14/commands/M0013.json +58 -0
  224. data/schemas/tlc/1.0.14/commands/M0014.json +85 -0
  225. data/schemas/tlc/1.0.14/commands/M0015.json +91 -0
  226. data/schemas/tlc/1.0.14/commands/M0016.json +58 -0
  227. data/schemas/tlc/1.0.14/commands/M0017.json +58 -0
  228. data/schemas/tlc/1.0.14/commands/M0018.json +91 -0
  229. data/schemas/tlc/1.0.14/commands/M0019.json +118 -0
  230. data/schemas/tlc/1.0.14/commands/M0103.json +82 -0
  231. data/schemas/tlc/1.0.14/commands/M0104.json +199 -0
  232. data/schemas/tlc/1.0.14/commands/command_requests.json +7 -0
  233. data/schemas/tlc/1.0.14/commands/command_responses.json +7 -0
  234. data/schemas/tlc/1.0.14/commands/commands.json +334 -0
  235. data/schemas/tlc/1.0.14/statuses/S0001.json +116 -0
  236. data/schemas/tlc/1.0.14/statuses/S0002.json +34 -0
  237. data/schemas/tlc/1.0.14/statuses/S0003.json +55 -0
  238. data/schemas/tlc/1.0.14/statuses/S0004.json +55 -0
  239. data/schemas/tlc/1.0.14/statuses/S0005.json +40 -0
  240. data/schemas/tlc/1.0.14/statuses/S0006.json +67 -0
  241. data/schemas/tlc/1.0.14/statuses/S0007.json +67 -0
  242. data/schemas/tlc/1.0.14/statuses/S0008.json +67 -0
  243. data/schemas/tlc/1.0.14/statuses/S0009.json +67 -0
  244. data/schemas/tlc/1.0.14/statuses/S0010.json +67 -0
  245. data/schemas/tlc/1.0.14/statuses/S0011.json +67 -0
  246. data/schemas/tlc/1.0.14/statuses/S0012.json +67 -0
  247. data/schemas/tlc/1.0.14/statuses/S0013.json +67 -0
  248. data/schemas/tlc/1.0.14/statuses/S0014.json +40 -0
  249. data/schemas/tlc/1.0.14/statuses/S0015.json +40 -0
  250. data/schemas/tlc/1.0.14/statuses/S0016.json +40 -0
  251. data/schemas/tlc/1.0.14/statuses/S0017.json +40 -0
  252. data/schemas/tlc/1.0.14/statuses/S0018.json +40 -0
  253. data/schemas/tlc/1.0.14/statuses/S0019.json +40 -0
  254. data/schemas/tlc/1.0.14/statuses/S0020.json +67 -0
  255. data/schemas/tlc/1.0.14/statuses/S0021.json +35 -0
  256. data/schemas/tlc/1.0.14/statuses/S0022.json +34 -0
  257. data/schemas/tlc/1.0.14/statuses/S0023.json +35 -0
  258. data/schemas/tlc/1.0.14/statuses/S0024.json +35 -0
  259. data/schemas/tlc/1.0.14/statuses/S0025.json +229 -0
  260. data/schemas/tlc/1.0.14/statuses/S0026.json +34 -0
  261. data/schemas/tlc/1.0.14/statuses/S0027.json +34 -0
  262. data/schemas/tlc/1.0.14/statuses/S0028.json +34 -0
  263. data/schemas/tlc/1.0.14/statuses/S0029.json +34 -0
  264. data/schemas/tlc/1.0.14/statuses/S0091.json +58 -0
  265. data/schemas/tlc/1.0.14/statuses/S0092.json +58 -0
  266. data/schemas/tlc/1.0.14/statuses/S0095.json +34 -0
  267. data/schemas/tlc/1.0.14/statuses/S0096.json +175 -0
  268. data/schemas/tlc/1.0.14/statuses/S0201.json +67 -0
  269. data/schemas/tlc/1.0.14/statuses/S0202.json +67 -0
  270. data/schemas/tlc/1.0.14/statuses/S0203.json +67 -0
  271. data/schemas/tlc/1.0.14/statuses/S0204.json +283 -0
  272. data/schemas/tlc/1.0.14/statuses/S0205.json +61 -0
  273. data/schemas/tlc/1.0.14/statuses/S0206.json +61 -0
  274. data/schemas/tlc/1.0.14/statuses/S0207.json +61 -0
  275. data/schemas/tlc/1.0.14/statuses/S0208.json +229 -0
  276. data/schemas/tlc/1.0.14/statuses/statuses.json +674 -0
  277. data/schemas/tlc/1.0.14/sxl.json +73 -0
  278. data/schemas/tlc/1.0.14/sxl.yaml +1514 -0
  279. data/schemas/tlc/1.0.15/alarms/A0001.json +7 -0
  280. data/schemas/tlc/1.0.15/alarms/A0002.json +7 -0
  281. data/schemas/tlc/1.0.15/alarms/A0003.json +7 -0
  282. data/schemas/tlc/1.0.15/alarms/A0004.json +7 -0
  283. data/schemas/tlc/1.0.15/alarms/A0005.json +7 -0
  284. data/schemas/tlc/1.0.15/alarms/A0006.json +7 -0
  285. data/schemas/tlc/1.0.15/alarms/A0007.json +7 -0
  286. data/schemas/tlc/1.0.15/alarms/A0008.json +40 -0
  287. data/schemas/tlc/1.0.15/alarms/A0009.json +7 -0
  288. data/schemas/tlc/1.0.15/alarms/A0010.json +7 -0
  289. data/schemas/tlc/1.0.15/alarms/A0101.json +7 -0
  290. data/schemas/tlc/1.0.15/alarms/A0201.json +39 -0
  291. data/schemas/tlc/1.0.15/alarms/A0202.json +39 -0
  292. data/schemas/tlc/1.0.15/alarms/A0301.json +111 -0
  293. data/schemas/tlc/1.0.15/alarms/A0302.json +137 -0
  294. data/schemas/tlc/1.0.15/alarms/alarms.json +254 -0
  295. data/schemas/tlc/1.0.15/commands/M0001.json +125 -0
  296. data/schemas/tlc/1.0.15/commands/M0002.json +91 -0
  297. data/schemas/tlc/1.0.15/commands/M0003.json +91 -0
  298. data/schemas/tlc/1.0.15/commands/M0004.json +64 -0
  299. data/schemas/tlc/1.0.15/commands/M0005.json +91 -0
  300. data/schemas/tlc/1.0.15/commands/M0006.json +91 -0
  301. data/schemas/tlc/1.0.15/commands/M0007.json +64 -0
  302. data/schemas/tlc/1.0.15/commands/M0008.json +91 -0
  303. data/schemas/tlc/1.0.15/commands/M0010.json +64 -0
  304. data/schemas/tlc/1.0.15/commands/M0011.json +64 -0
  305. data/schemas/tlc/1.0.15/commands/M0012.json +58 -0
  306. data/schemas/tlc/1.0.15/commands/M0013.json +58 -0
  307. data/schemas/tlc/1.0.15/commands/M0014.json +85 -0
  308. data/schemas/tlc/1.0.15/commands/M0015.json +91 -0
  309. data/schemas/tlc/1.0.15/commands/M0016.json +58 -0
  310. data/schemas/tlc/1.0.15/commands/M0017.json +58 -0
  311. data/schemas/tlc/1.0.15/commands/M0018.json +91 -0
  312. data/schemas/tlc/1.0.15/commands/M0019.json +118 -0
  313. data/schemas/tlc/1.0.15/commands/M0020.json +118 -0
  314. data/schemas/tlc/1.0.15/commands/M0021.json +58 -0
  315. data/schemas/tlc/1.0.15/commands/M0103.json +82 -0
  316. data/schemas/tlc/1.0.15/commands/M0104.json +199 -0
  317. data/schemas/tlc/1.0.15/commands/command_requests.json +7 -0
  318. data/schemas/tlc/1.0.15/commands/command_responses.json +7 -0
  319. data/schemas/tlc/1.0.15/commands/commands.json +366 -0
  320. data/schemas/tlc/1.0.15/statuses/S0001.json +116 -0
  321. data/schemas/tlc/1.0.15/statuses/S0002.json +34 -0
  322. data/schemas/tlc/1.0.15/statuses/S0003.json +55 -0
  323. data/schemas/tlc/1.0.15/statuses/S0004.json +55 -0
  324. data/schemas/tlc/1.0.15/statuses/S0005.json +40 -0
  325. data/schemas/tlc/1.0.15/statuses/S0006.json +67 -0
  326. data/schemas/tlc/1.0.15/statuses/S0007.json +67 -0
  327. data/schemas/tlc/1.0.15/statuses/S0008.json +67 -0
  328. data/schemas/tlc/1.0.15/statuses/S0009.json +67 -0
  329. data/schemas/tlc/1.0.15/statuses/S0010.json +67 -0
  330. data/schemas/tlc/1.0.15/statuses/S0011.json +67 -0
  331. data/schemas/tlc/1.0.15/statuses/S0012.json +67 -0
  332. data/schemas/tlc/1.0.15/statuses/S0013.json +67 -0
  333. data/schemas/tlc/1.0.15/statuses/S0014.json +40 -0
  334. data/schemas/tlc/1.0.15/statuses/S0015.json +40 -0
  335. data/schemas/tlc/1.0.15/statuses/S0016.json +40 -0
  336. data/schemas/tlc/1.0.15/statuses/S0017.json +40 -0
  337. data/schemas/tlc/1.0.15/statuses/S0018.json +40 -0
  338. data/schemas/tlc/1.0.15/statuses/S0019.json +40 -0
  339. data/schemas/tlc/1.0.15/statuses/S0020.json +67 -0
  340. data/schemas/tlc/1.0.15/statuses/S0021.json +35 -0
  341. data/schemas/tlc/1.0.15/statuses/S0022.json +34 -0
  342. data/schemas/tlc/1.0.15/statuses/S0023.json +35 -0
  343. data/schemas/tlc/1.0.15/statuses/S0024.json +35 -0
  344. data/schemas/tlc/1.0.15/statuses/S0025.json +229 -0
  345. data/schemas/tlc/1.0.15/statuses/S0026.json +34 -0
  346. data/schemas/tlc/1.0.15/statuses/S0027.json +34 -0
  347. data/schemas/tlc/1.0.15/statuses/S0028.json +34 -0
  348. data/schemas/tlc/1.0.15/statuses/S0029.json +34 -0
  349. data/schemas/tlc/1.0.15/statuses/S0030.json +34 -0
  350. data/schemas/tlc/1.0.15/statuses/S0031.json +34 -0
  351. data/schemas/tlc/1.0.15/statuses/S0091.json +58 -0
  352. data/schemas/tlc/1.0.15/statuses/S0092.json +58 -0
  353. data/schemas/tlc/1.0.15/statuses/S0095.json +34 -0
  354. data/schemas/tlc/1.0.15/statuses/S0096.json +175 -0
  355. data/schemas/tlc/1.0.15/statuses/S0097.json +61 -0
  356. data/schemas/tlc/1.0.15/statuses/S0098.json +82 -0
  357. data/schemas/tlc/1.0.15/statuses/S0201.json +67 -0
  358. data/schemas/tlc/1.0.15/statuses/S0202.json +67 -0
  359. data/schemas/tlc/1.0.15/statuses/S0203.json +67 -0
  360. data/schemas/tlc/1.0.15/statuses/S0204.json +283 -0
  361. data/schemas/tlc/1.0.15/statuses/S0205.json +61 -0
  362. data/schemas/tlc/1.0.15/statuses/S0206.json +61 -0
  363. data/schemas/tlc/1.0.15/statuses/S0207.json +61 -0
  364. data/schemas/tlc/1.0.15/statuses/S0208.json +229 -0
  365. data/schemas/tlc/1.0.15/statuses/statuses.json +738 -0
  366. data/schemas/tlc/1.0.15/sxl.json +73 -0
  367. data/schemas/tlc/1.0.15/sxl.yaml +1660 -0
  368. data/schemas/tlc/1.0.7/alarms/A0001.json +7 -0
  369. data/schemas/tlc/1.0.7/alarms/A0002.json +7 -0
  370. data/schemas/tlc/1.0.7/alarms/A0003.json +7 -0
  371. data/schemas/tlc/1.0.7/alarms/A0004.json +7 -0
  372. data/schemas/tlc/1.0.7/alarms/A0005.json +7 -0
  373. data/schemas/tlc/1.0.7/alarms/A0006.json +7 -0
  374. data/schemas/tlc/1.0.7/alarms/A0007.json +7 -0
  375. data/schemas/tlc/1.0.7/alarms/A0008.json +40 -0
  376. data/schemas/tlc/1.0.7/alarms/A0009.json +7 -0
  377. data/schemas/tlc/1.0.7/alarms/A0101.json +7 -0
  378. data/schemas/tlc/1.0.7/alarms/A0201.json +39 -0
  379. data/schemas/tlc/1.0.7/alarms/A0202.json +39 -0
  380. data/schemas/tlc/1.0.7/alarms/A0301.json +111 -0
  381. data/schemas/tlc/1.0.7/alarms/A0302.json +137 -0
  382. data/schemas/tlc/1.0.7/alarms/alarms.json +238 -0
  383. data/schemas/tlc/1.0.7/commands/M0001.json +125 -0
  384. data/schemas/tlc/1.0.7/commands/M0002.json +91 -0
  385. data/schemas/tlc/1.0.7/commands/M0003.json +91 -0
  386. data/schemas/tlc/1.0.7/commands/M0004.json +64 -0
  387. data/schemas/tlc/1.0.7/commands/M0005.json +91 -0
  388. data/schemas/tlc/1.0.7/commands/M0006.json +91 -0
  389. data/schemas/tlc/1.0.7/commands/M0007.json +64 -0
  390. data/schemas/tlc/1.0.7/commands/M0008.json +91 -0
  391. data/schemas/tlc/1.0.7/commands/M0010.json +64 -0
  392. data/schemas/tlc/1.0.7/commands/M0011.json +64 -0
  393. data/schemas/tlc/1.0.7/commands/M0019.json +118 -0
  394. data/schemas/tlc/1.0.7/commands/M0103.json +82 -0
  395. data/schemas/tlc/1.0.7/commands/M0104.json +199 -0
  396. data/schemas/tlc/1.0.7/commands/command_requests.json +7 -0
  397. data/schemas/tlc/1.0.7/commands/command_responses.json +7 -0
  398. data/schemas/tlc/1.0.7/commands/commands.json +222 -0
  399. data/schemas/tlc/1.0.7/statuses/S0001.json +116 -0
  400. data/schemas/tlc/1.0.7/statuses/S0002.json +34 -0
  401. data/schemas/tlc/1.0.7/statuses/S0003.json +55 -0
  402. data/schemas/tlc/1.0.7/statuses/S0004.json +55 -0
  403. data/schemas/tlc/1.0.7/statuses/S0005.json +40 -0
  404. data/schemas/tlc/1.0.7/statuses/S0006.json +67 -0
  405. data/schemas/tlc/1.0.7/statuses/S0007.json +67 -0
  406. data/schemas/tlc/1.0.7/statuses/S0008.json +67 -0
  407. data/schemas/tlc/1.0.7/statuses/S0009.json +67 -0
  408. data/schemas/tlc/1.0.7/statuses/S0010.json +67 -0
  409. data/schemas/tlc/1.0.7/statuses/S0011.json +67 -0
  410. data/schemas/tlc/1.0.7/statuses/S0012.json +67 -0
  411. data/schemas/tlc/1.0.7/statuses/S0013.json +67 -0
  412. data/schemas/tlc/1.0.7/statuses/S0014.json +40 -0
  413. data/schemas/tlc/1.0.7/statuses/S0015.json +40 -0
  414. data/schemas/tlc/1.0.7/statuses/S0016.json +40 -0
  415. data/schemas/tlc/1.0.7/statuses/S0017.json +40 -0
  416. data/schemas/tlc/1.0.7/statuses/S0018.json +40 -0
  417. data/schemas/tlc/1.0.7/statuses/S0019.json +40 -0
  418. data/schemas/tlc/1.0.7/statuses/S0020.json +67 -0
  419. data/schemas/tlc/1.0.7/statuses/S0021.json +35 -0
  420. data/schemas/tlc/1.0.7/statuses/S0025.json +229 -0
  421. data/schemas/tlc/1.0.7/statuses/S0091.json +58 -0
  422. data/schemas/tlc/1.0.7/statuses/S0092.json +58 -0
  423. data/schemas/tlc/1.0.7/statuses/S0095.json +34 -0
  424. data/schemas/tlc/1.0.7/statuses/S0096.json +175 -0
  425. data/schemas/tlc/1.0.7/statuses/S0201.json +67 -0
  426. data/schemas/tlc/1.0.7/statuses/S0202.json +67 -0
  427. data/schemas/tlc/1.0.7/statuses/S0203.json +67 -0
  428. data/schemas/tlc/1.0.7/statuses/S0204.json +283 -0
  429. data/schemas/tlc/1.0.7/statuses/statuses.json +498 -0
  430. data/schemas/tlc/1.0.7/sxl.json +73 -0
  431. data/schemas/tlc/1.0.7/sxl.yaml +1026 -0
  432. data/schemas/tlc/1.0.8/alarms/A0001.json +7 -0
  433. data/schemas/tlc/1.0.8/alarms/A0002.json +7 -0
  434. data/schemas/tlc/1.0.8/alarms/A0003.json +7 -0
  435. data/schemas/tlc/1.0.8/alarms/A0004.json +7 -0
  436. data/schemas/tlc/1.0.8/alarms/A0005.json +7 -0
  437. data/schemas/tlc/1.0.8/alarms/A0006.json +7 -0
  438. data/schemas/tlc/1.0.8/alarms/A0007.json +7 -0
  439. data/schemas/tlc/1.0.8/alarms/A0008.json +40 -0
  440. data/schemas/tlc/1.0.8/alarms/A0009.json +7 -0
  441. data/schemas/tlc/1.0.8/alarms/A0101.json +7 -0
  442. data/schemas/tlc/1.0.8/alarms/A0201.json +39 -0
  443. data/schemas/tlc/1.0.8/alarms/A0202.json +39 -0
  444. data/schemas/tlc/1.0.8/alarms/A0301.json +111 -0
  445. data/schemas/tlc/1.0.8/alarms/A0302.json +137 -0
  446. data/schemas/tlc/1.0.8/alarms/alarms.json +238 -0
  447. data/schemas/tlc/1.0.8/commands/M0001.json +125 -0
  448. data/schemas/tlc/1.0.8/commands/M0002.json +91 -0
  449. data/schemas/tlc/1.0.8/commands/M0003.json +91 -0
  450. data/schemas/tlc/1.0.8/commands/M0004.json +64 -0
  451. data/schemas/tlc/1.0.8/commands/M0005.json +91 -0
  452. data/schemas/tlc/1.0.8/commands/M0006.json +91 -0
  453. data/schemas/tlc/1.0.8/commands/M0007.json +64 -0
  454. data/schemas/tlc/1.0.8/commands/M0008.json +91 -0
  455. data/schemas/tlc/1.0.8/commands/M0010.json +64 -0
  456. data/schemas/tlc/1.0.8/commands/M0011.json +64 -0
  457. data/schemas/tlc/1.0.8/commands/M0012.json +58 -0
  458. data/schemas/tlc/1.0.8/commands/M0013.json +58 -0
  459. data/schemas/tlc/1.0.8/commands/M0019.json +118 -0
  460. data/schemas/tlc/1.0.8/commands/M0103.json +82 -0
  461. data/schemas/tlc/1.0.8/commands/M0104.json +199 -0
  462. data/schemas/tlc/1.0.8/commands/command_requests.json +7 -0
  463. data/schemas/tlc/1.0.8/commands/command_responses.json +7 -0
  464. data/schemas/tlc/1.0.8/commands/commands.json +254 -0
  465. data/schemas/tlc/1.0.8/statuses/S0001.json +116 -0
  466. data/schemas/tlc/1.0.8/statuses/S0002.json +34 -0
  467. data/schemas/tlc/1.0.8/statuses/S0003.json +55 -0
  468. data/schemas/tlc/1.0.8/statuses/S0004.json +55 -0
  469. data/schemas/tlc/1.0.8/statuses/S0005.json +40 -0
  470. data/schemas/tlc/1.0.8/statuses/S0006.json +67 -0
  471. data/schemas/tlc/1.0.8/statuses/S0007.json +67 -0
  472. data/schemas/tlc/1.0.8/statuses/S0008.json +67 -0
  473. data/schemas/tlc/1.0.8/statuses/S0009.json +67 -0
  474. data/schemas/tlc/1.0.8/statuses/S0010.json +67 -0
  475. data/schemas/tlc/1.0.8/statuses/S0011.json +67 -0
  476. data/schemas/tlc/1.0.8/statuses/S0012.json +67 -0
  477. data/schemas/tlc/1.0.8/statuses/S0013.json +67 -0
  478. data/schemas/tlc/1.0.8/statuses/S0014.json +40 -0
  479. data/schemas/tlc/1.0.8/statuses/S0015.json +40 -0
  480. data/schemas/tlc/1.0.8/statuses/S0016.json +40 -0
  481. data/schemas/tlc/1.0.8/statuses/S0017.json +40 -0
  482. data/schemas/tlc/1.0.8/statuses/S0018.json +40 -0
  483. data/schemas/tlc/1.0.8/statuses/S0019.json +40 -0
  484. data/schemas/tlc/1.0.8/statuses/S0020.json +67 -0
  485. data/schemas/tlc/1.0.8/statuses/S0021.json +35 -0
  486. data/schemas/tlc/1.0.8/statuses/S0025.json +181 -0
  487. data/schemas/tlc/1.0.8/statuses/S0091.json +58 -0
  488. data/schemas/tlc/1.0.8/statuses/S0092.json +58 -0
  489. data/schemas/tlc/1.0.8/statuses/S0095.json +34 -0
  490. data/schemas/tlc/1.0.8/statuses/S0096.json +175 -0
  491. data/schemas/tlc/1.0.8/statuses/S0201.json +67 -0
  492. data/schemas/tlc/1.0.8/statuses/S0202.json +67 -0
  493. data/schemas/tlc/1.0.8/statuses/S0203.json +67 -0
  494. data/schemas/tlc/1.0.8/statuses/S0204.json +283 -0
  495. data/schemas/tlc/1.0.8/statuses/statuses.json +482 -0
  496. data/schemas/tlc/1.0.8/sxl.json +73 -0
  497. data/schemas/tlc/1.0.8/sxl.yaml +1059 -0
  498. data/schemas/tlc/1.0.9/alarms/A0001.json +7 -0
  499. data/schemas/tlc/1.0.9/alarms/A0002.json +7 -0
  500. data/schemas/tlc/1.0.9/alarms/A0003.json +7 -0
  501. data/schemas/tlc/1.0.9/alarms/A0004.json +7 -0
  502. data/schemas/tlc/1.0.9/alarms/A0005.json +7 -0
  503. data/schemas/tlc/1.0.9/alarms/A0006.json +7 -0
  504. data/schemas/tlc/1.0.9/alarms/A0007.json +7 -0
  505. data/schemas/tlc/1.0.9/alarms/A0008.json +40 -0
  506. data/schemas/tlc/1.0.9/alarms/A0009.json +7 -0
  507. data/schemas/tlc/1.0.9/alarms/A0101.json +7 -0
  508. data/schemas/tlc/1.0.9/alarms/A0201.json +39 -0
  509. data/schemas/tlc/1.0.9/alarms/A0202.json +39 -0
  510. data/schemas/tlc/1.0.9/alarms/A0301.json +111 -0
  511. data/schemas/tlc/1.0.9/alarms/A0302.json +137 -0
  512. data/schemas/tlc/1.0.9/alarms/alarms.json +238 -0
  513. data/schemas/tlc/1.0.9/commands/M0001.json +125 -0
  514. data/schemas/tlc/1.0.9/commands/M0002.json +91 -0
  515. data/schemas/tlc/1.0.9/commands/M0003.json +91 -0
  516. data/schemas/tlc/1.0.9/commands/M0004.json +64 -0
  517. data/schemas/tlc/1.0.9/commands/M0005.json +91 -0
  518. data/schemas/tlc/1.0.9/commands/M0006.json +91 -0
  519. data/schemas/tlc/1.0.9/commands/M0007.json +64 -0
  520. data/schemas/tlc/1.0.9/commands/M0008.json +91 -0
  521. data/schemas/tlc/1.0.9/commands/M0010.json +64 -0
  522. data/schemas/tlc/1.0.9/commands/M0011.json +64 -0
  523. data/schemas/tlc/1.0.9/commands/M0012.json +58 -0
  524. data/schemas/tlc/1.0.9/commands/M0013.json +58 -0
  525. data/schemas/tlc/1.0.9/commands/M0019.json +118 -0
  526. data/schemas/tlc/1.0.9/commands/M0103.json +82 -0
  527. data/schemas/tlc/1.0.9/commands/M0104.json +199 -0
  528. data/schemas/tlc/1.0.9/commands/command_requests.json +7 -0
  529. data/schemas/tlc/1.0.9/commands/command_responses.json +7 -0
  530. data/schemas/tlc/1.0.9/commands/commands.json +254 -0
  531. data/schemas/tlc/1.0.9/statuses/S0001.json +116 -0
  532. data/schemas/tlc/1.0.9/statuses/S0002.json +34 -0
  533. data/schemas/tlc/1.0.9/statuses/S0003.json +55 -0
  534. data/schemas/tlc/1.0.9/statuses/S0004.json +55 -0
  535. data/schemas/tlc/1.0.9/statuses/S0005.json +40 -0
  536. data/schemas/tlc/1.0.9/statuses/S0006.json +67 -0
  537. data/schemas/tlc/1.0.9/statuses/S0007.json +67 -0
  538. data/schemas/tlc/1.0.9/statuses/S0008.json +67 -0
  539. data/schemas/tlc/1.0.9/statuses/S0009.json +67 -0
  540. data/schemas/tlc/1.0.9/statuses/S0010.json +67 -0
  541. data/schemas/tlc/1.0.9/statuses/S0011.json +67 -0
  542. data/schemas/tlc/1.0.9/statuses/S0012.json +67 -0
  543. data/schemas/tlc/1.0.9/statuses/S0013.json +67 -0
  544. data/schemas/tlc/1.0.9/statuses/S0014.json +40 -0
  545. data/schemas/tlc/1.0.9/statuses/S0015.json +40 -0
  546. data/schemas/tlc/1.0.9/statuses/S0016.json +40 -0
  547. data/schemas/tlc/1.0.9/statuses/S0017.json +40 -0
  548. data/schemas/tlc/1.0.9/statuses/S0018.json +40 -0
  549. data/schemas/tlc/1.0.9/statuses/S0019.json +40 -0
  550. data/schemas/tlc/1.0.9/statuses/S0020.json +67 -0
  551. data/schemas/tlc/1.0.9/statuses/S0021.json +35 -0
  552. data/schemas/tlc/1.0.9/statuses/S0025.json +181 -0
  553. data/schemas/tlc/1.0.9/statuses/S0091.json +58 -0
  554. data/schemas/tlc/1.0.9/statuses/S0092.json +58 -0
  555. data/schemas/tlc/1.0.9/statuses/S0095.json +34 -0
  556. data/schemas/tlc/1.0.9/statuses/S0096.json +175 -0
  557. data/schemas/tlc/1.0.9/statuses/S0201.json +67 -0
  558. data/schemas/tlc/1.0.9/statuses/S0202.json +67 -0
  559. data/schemas/tlc/1.0.9/statuses/S0203.json +67 -0
  560. data/schemas/tlc/1.0.9/statuses/S0204.json +283 -0
  561. data/schemas/tlc/1.0.9/statuses/statuses.json +482 -0
  562. data/schemas/tlc/1.0.9/sxl.json +73 -0
  563. data/schemas/tlc/1.0.9/sxl.yaml +1059 -0
  564. data/schemas/tlc/1.1/alarms/A0001.json +7 -0
  565. data/schemas/tlc/1.1/alarms/A0002.json +7 -0
  566. data/schemas/tlc/1.1/alarms/A0003.json +7 -0
  567. data/schemas/tlc/1.1/alarms/A0004.json +7 -0
  568. data/schemas/tlc/1.1/alarms/A0005.json +7 -0
  569. data/schemas/tlc/1.1/alarms/A0006.json +7 -0
  570. data/schemas/tlc/1.1/alarms/A0007.json +38 -0
  571. data/schemas/tlc/1.1/alarms/A0008.json +40 -0
  572. data/schemas/tlc/1.1/alarms/A0009.json +7 -0
  573. data/schemas/tlc/1.1/alarms/A0010.json +7 -0
  574. data/schemas/tlc/1.1/alarms/A0101.json +7 -0
  575. data/schemas/tlc/1.1/alarms/A0201.json +39 -0
  576. data/schemas/tlc/1.1/alarms/A0202.json +39 -0
  577. data/schemas/tlc/1.1/alarms/A0301.json +111 -0
  578. data/schemas/tlc/1.1/alarms/A0302.json +137 -0
  579. data/schemas/tlc/1.1/alarms/alarms.json +254 -0
  580. data/schemas/tlc/1.1/commands/M0001.json +125 -0
  581. data/schemas/tlc/1.1/commands/M0002.json +91 -0
  582. data/schemas/tlc/1.1/commands/M0003.json +91 -0
  583. data/schemas/tlc/1.1/commands/M0004.json +64 -0
  584. data/schemas/tlc/1.1/commands/M0005.json +91 -0
  585. data/schemas/tlc/1.1/commands/M0006.json +91 -0
  586. data/schemas/tlc/1.1/commands/M0007.json +64 -0
  587. data/schemas/tlc/1.1/commands/M0008.json +91 -0
  588. data/schemas/tlc/1.1/commands/M0010.json +64 -0
  589. data/schemas/tlc/1.1/commands/M0011.json +64 -0
  590. data/schemas/tlc/1.1/commands/M0012.json +58 -0
  591. data/schemas/tlc/1.1/commands/M0013.json +58 -0
  592. data/schemas/tlc/1.1/commands/M0014.json +85 -0
  593. data/schemas/tlc/1.1/commands/M0015.json +91 -0
  594. data/schemas/tlc/1.1/commands/M0016.json +58 -0
  595. data/schemas/tlc/1.1/commands/M0017.json +58 -0
  596. data/schemas/tlc/1.1/commands/M0018.json +91 -0
  597. data/schemas/tlc/1.1/commands/M0019.json +118 -0
  598. data/schemas/tlc/1.1/commands/M0020.json +118 -0
  599. data/schemas/tlc/1.1/commands/M0021.json +58 -0
  600. data/schemas/tlc/1.1/commands/M0103.json +82 -0
  601. data/schemas/tlc/1.1/commands/M0104.json +199 -0
  602. data/schemas/tlc/1.1/commands/command_requests.json +7 -0
  603. data/schemas/tlc/1.1/commands/command_responses.json +7 -0
  604. data/schemas/tlc/1.1/commands/commands.json +366 -0
  605. data/schemas/tlc/1.1/statuses/S0001.json +116 -0
  606. data/schemas/tlc/1.1/statuses/S0002.json +34 -0
  607. data/schemas/tlc/1.1/statuses/S0003.json +55 -0
  608. data/schemas/tlc/1.1/statuses/S0004.json +55 -0
  609. data/schemas/tlc/1.1/statuses/S0005.json +40 -0
  610. data/schemas/tlc/1.1/statuses/S0006.json +67 -0
  611. data/schemas/tlc/1.1/statuses/S0007.json +95 -0
  612. data/schemas/tlc/1.1/statuses/S0008.json +95 -0
  613. data/schemas/tlc/1.1/statuses/S0009.json +95 -0
  614. data/schemas/tlc/1.1/statuses/S0010.json +95 -0
  615. data/schemas/tlc/1.1/statuses/S0011.json +95 -0
  616. data/schemas/tlc/1.1/statuses/S0012.json +95 -0
  617. data/schemas/tlc/1.1/statuses/S0013.json +67 -0
  618. data/schemas/tlc/1.1/statuses/S0014.json +68 -0
  619. data/schemas/tlc/1.1/statuses/S0015.json +68 -0
  620. data/schemas/tlc/1.1/statuses/S0016.json +40 -0
  621. data/schemas/tlc/1.1/statuses/S0017.json +40 -0
  622. data/schemas/tlc/1.1/statuses/S0018.json +40 -0
  623. data/schemas/tlc/1.1/statuses/S0019.json +40 -0
  624. data/schemas/tlc/1.1/statuses/S0020.json +67 -0
  625. data/schemas/tlc/1.1/statuses/S0021.json +35 -0
  626. data/schemas/tlc/1.1/statuses/S0022.json +34 -0
  627. data/schemas/tlc/1.1/statuses/S0023.json +35 -0
  628. data/schemas/tlc/1.1/statuses/S0024.json +35 -0
  629. data/schemas/tlc/1.1/statuses/S0025.json +229 -0
  630. data/schemas/tlc/1.1/statuses/S0026.json +34 -0
  631. data/schemas/tlc/1.1/statuses/S0027.json +34 -0
  632. data/schemas/tlc/1.1/statuses/S0028.json +34 -0
  633. data/schemas/tlc/1.1/statuses/S0029.json +34 -0
  634. data/schemas/tlc/1.1/statuses/S0030.json +34 -0
  635. data/schemas/tlc/1.1/statuses/S0031.json +34 -0
  636. data/schemas/tlc/1.1/statuses/S0091.json +45 -0
  637. data/schemas/tlc/1.1/statuses/S0092.json +45 -0
  638. data/schemas/tlc/1.1/statuses/S0095.json +34 -0
  639. data/schemas/tlc/1.1/statuses/S0096.json +175 -0
  640. data/schemas/tlc/1.1/statuses/S0097.json +61 -0
  641. data/schemas/tlc/1.1/statuses/S0098.json +82 -0
  642. data/schemas/tlc/1.1/statuses/S0201.json +67 -0
  643. data/schemas/tlc/1.1/statuses/S0202.json +67 -0
  644. data/schemas/tlc/1.1/statuses/S0203.json +67 -0
  645. data/schemas/tlc/1.1/statuses/S0204.json +283 -0
  646. data/schemas/tlc/1.1/statuses/S0205.json +61 -0
  647. data/schemas/tlc/1.1/statuses/S0206.json +61 -0
  648. data/schemas/tlc/1.1/statuses/S0207.json +61 -0
  649. data/schemas/tlc/1.1/statuses/S0208.json +229 -0
  650. data/schemas/tlc/1.1/statuses/statuses.json +738 -0
  651. data/schemas/tlc/1.1/sxl.json +73 -0
  652. data/schemas/tlc/1.1/sxl.yaml +1749 -0
  653. metadata +784 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 07e5fccae77303733072ab27976c1cb1991ea9cd1add360dbac63e8da97baf8b
4
+ data.tar.gz: 364e6d5569d3fa262a96de68b80bec855d4fd3bb06c754ee47c5bcc3ea9300c4
5
+ SHA512:
6
+ metadata.gz: d9a41e3ef2a8f1ce2ed30b701867b118fdaad9fc7f2bced0ca3637a65f242bb69735715e1d41d5bf7ea20690c2280cad7bdbd3b33ce2d0e137f218517967f3d8
7
+ data.tar.gz: 9885c98876461dab7abc379206ee2617ffb6747fe96a91dec3c382d9111029b3a98ad9a389a6b2ea311db1d4d98e66ead63bf8baf5a7b020c3f520878bad4d54
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ /.bundle/
2
+ /pkg/
3
+ /spec/reports/
4
+ /tmp/
5
+ /.DS_Store
6
+ /.rspec_status
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rsmp_schema.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,49 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rsmp_schema (0.1.0)
5
+ json_schemer (~> 0.2.21)
6
+ thor (~> 1.2.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.5.0)
12
+ ecma-re-validator (0.4.0)
13
+ regexp_parser (~> 2.2)
14
+ hana (1.3.7)
15
+ json_schemer (0.2.21)
16
+ ecma-re-validator (~> 0.3)
17
+ hana (~> 1.3)
18
+ regexp_parser (~> 2.0)
19
+ uri_template (~> 0.7)
20
+ rake (13.0.6)
21
+ regexp_parser (2.5.0)
22
+ rspec (3.11.0)
23
+ rspec-core (~> 3.11.0)
24
+ rspec-expectations (~> 3.11.0)
25
+ rspec-mocks (~> 3.11.0)
26
+ rspec-core (3.11.0)
27
+ rspec-support (~> 3.11.0)
28
+ rspec-expectations (3.11.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-mocks (3.11.1)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-support (3.11.0)
35
+ thor (1.2.1)
36
+ uri_template (0.7.0)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ bundler (~> 2.3.19)
43
+ rake (~> 13.0.6)
44
+ rsmp_schema!
45
+ rspec (~> 3.11.0)
46
+ rspec-expectations (~> 3.11.0)
47
+
48
+ BUNDLED WITH
49
+ 2.3.19
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2019 The City Copenhagen
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # About
2
+ JSON Schema for RSMP messages. The schema can be used to automatically validate RSMP messages.
3
+
4
+ The schema so far covers the core specifiation and the SXL for Trafic Light Controllers:
5
+ https://github.com/rsmp-nordic/rsmp_core
6
+ https://github.com/rsmp-nordic/rsmp_sxl_traffic_lights
7
+
8
+ More about JSON Schema:
9
+ https://json-schema.org/
10
+
11
+ ## Schema organisation
12
+ The schema consists of a core schema shared by all equipment types, and an SXL schema for each supported equipment type. At the only SXL supported is for Traffic Light Controllers. An SXL defines massages specific to a particular type of equipment, but they all rely on the core part of the RSMP specification.
13
+
14
+ Both core and SXL schemas exist in different version, for validation agaist a particular version of the spec.
15
+
16
+ For example, to validate against the SXL for Trafic Light Controllers (TLCs), version 1.0.15, use the file schemas/tcl/1.0.15/sxl.json.
17
+
18
+ Depending on the message type, relevant JSON Schema elements will be included to validate the detailed parameters, arguments, etc.
19
+
20
+ For example, validating a CommandRequest M0001 message will include these parts:
21
+
22
+ ```
23
+ sxl.json
24
+ commands.json
25
+ M0001.json
26
+ ```
27
+
28
+ ## Usage
29
+ The JSON Schema can be used from any language that provides a suitable JSON Schema validation library.
30
+
31
+ For example, to validate a JSON message with Ruby using the json_schemer gem:
32
+
33
+ ```ruby
34
+ require 'json_schemer'
35
+
36
+ message = {
37
+ "mType" => "rSMsg",
38
+ "mId" => "4173c2c8-a933-43cb-9425-66d4613731ed",
39
+ "type" => "CommandRequest",
40
+ "siteId" => [
41
+ { "sId" => "RN+SI0001" }
42
+ ],
43
+ "cId" => "O+14439=481WA001",
44
+ "arg" => [
45
+ {
46
+ "cCI" => "M0001",
47
+ "n" => "status",
48
+ "cO" => "setValue",
49
+ "v" => "YellowFlash"
50
+ }
51
+ ]
52
+ }
53
+
54
+ # try validating a message against our schema
55
+ schema = Pathname.new('schemas/tlc/1.1/sxl.json')
56
+ schemer = JSONSchemer.schema(schema)
57
+ puts schemer.valid? message # => true
58
+ ```
59
+
60
+ ## RSpec tests
61
+ The reposity includes RSpec test written in Ruby that checks the schema, by testing the result of validating a set of RSMP messages using the json_schemer gem.
62
+
63
+ To run the tests, you need Ruby installed. Then run bundler to ensure you have rspec. Then run use the rspec command to run tests:
64
+
65
+ ```
66
+ $ bundle # install gems
67
+ $ bundle exec rspec # run rspec tests
68
+ ```
69
+
70
+ ## Schema maintenance
71
+ The SXL JSON Schemas are generated automatically from their corresponding YAML source, and should therefore not be edited by hand. Instead, edit the YAML source and regenerate the schema files.
72
+
73
+ The core schemas has no YAML sources and are maintained by hand.
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+ require "bundler/gem_tasks"
3
+ require "bundler/setup"
4
+ require "rsmp_schema"
5
+
6
+
7
+ task default: %i[]
8
+
9
+ # Regenerate all SXL JSON Schemas.
10
+ # Warning: This will destructively override all relevant files. Any changes will be lost!
11
+ task :regenerate do
12
+ puts "Regenerating SXL JSON Schemas:"
13
+ Dir.glob('schemas/tlc/*/sxl.yaml').each do |path|
14
+ puts " #{File.dirname(path)}"
15
+ sxl = RSMP::Convert::Import::YAML.read path
16
+ RSMP::Convert::Export::JSONSchema.write sxl, File.dirname(path)
17
+ end
18
+ end
@@ -0,0 +1,32 @@
1
+ require 'json_schemer'
2
+
3
+ message = {
4
+ "mType" => "rSMsg",
5
+ "mId" => "4173c2c8-a933-43cb-9425-66d4613731ed",
6
+ "type" => "CommandRequest",
7
+ "siteId" => [
8
+ { "sId" => "RN+SI0001" }
9
+ ],
10
+ "cId" => "O+14439=481WA001",
11
+ "arg" => [
12
+ {
13
+ "cCI" => "M0002",
14
+ "n" => "timeplan",
15
+ "cO" => "setPlan",
16
+ "v" => "1"
17
+ }
18
+ ]
19
+ }
20
+
21
+ # try validating a message against our schema
22
+ schema = Pathname.new('schema/tlc/sxl.json')
23
+ schemer = JSONSchemer.schema(schema)
24
+ if schemer.valid? message
25
+ puts 'ok'
26
+ else
27
+ schemer.validate(message).each do |item|
28
+ puts [item['data_pointer'],item['type'],item['details']].compact.join(' ')
29
+ end
30
+ end
31
+
32
+
data/exe/rsmp_schema ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bundler/setup'
3
+ require 'rsmp_schema/cli'
4
+ RSMP::Schema::CLI.start
@@ -0,0 +1,35 @@
1
+ require 'thor'
2
+ require 'rsmp_schema'
3
+
4
+ module RSMP::Schema
5
+ class CLI < Thor
6
+ desc "convert", "Convert SXL from YAML to JSON Schema"
7
+ method_option :in, :type => :string, :aliases => "-i", banner: 'Path to YAML input file'
8
+ method_option :out, :type => :string, :aliases => "-o", banner: 'Path to JSON Schema output file'
9
+ def convert
10
+ unless options[:in]
11
+ puts "Error: Input option missing"
12
+ exit
13
+ end
14
+
15
+ unless options[:out]
16
+ puts "Error: Output option missing"
17
+ exit
18
+ end
19
+
20
+ unless File.exist? options[:in]
21
+ puts "Error: Input path file #{options[:in]} not found"
22
+ exit
23
+ end
24
+
25
+ sxl = RSMP::Convert::Import::YAML.read options[:in]
26
+ RSMP::Convert::Export::JSONSchema.write sxl, options[:out]
27
+ end
28
+
29
+ # avoid Thor returnin 0 on failures, see
30
+ # https://github.com/coinbase/salus/pull/380/files
31
+ def self.exit_on_failure?
32
+ true
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,223 @@
1
+ # Import SXL from YAML format
2
+
3
+ require 'yaml'
4
+ require 'json'
5
+ require 'fileutils'
6
+
7
+ module RSMP
8
+ module Convert
9
+ module Export
10
+ module JSONSchema
11
+
12
+ @@json_options = {
13
+ array_nl: "\n",
14
+ object_nl: "\n",
15
+ indent: ' ',
16
+ space_before: ' ',
17
+ space: ' '
18
+ }
19
+
20
+ def self.output_json item
21
+ JSON.generate(item,@@json_options)
22
+ end
23
+
24
+ def self.build_value item
25
+ out = {}
26
+
27
+ if item['description']
28
+ out["description"] = item['description']
29
+ end
30
+
31
+ if item['list']
32
+ case item['type']
33
+ when "boolean"
34
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/boolean_list"
35
+ when "integer", "ordinal", "unit", "scale", "long"
36
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/integer_list"
37
+ when "string"
38
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/string_list"
39
+ else
40
+ raise "Error: List of #{item['type']} is not supported: #{item.inspect}"
41
+ end
42
+
43
+ if item["values"]
44
+ value_list = item["values"].keys.join('|')
45
+ out['pattern'] = /(?-mix:^(#{value_list})(?:,(#{value_list}))*$)/
46
+ end
47
+
48
+ if item["pattern"]
49
+ puts "Warning: Pattern not support for lists: #{item.inspect}"
50
+ end
51
+ else
52
+ case item['type']
53
+ when "string", "base64"
54
+ out["type"] = "string"
55
+ when "boolean"
56
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/boolean"
57
+ when "timestamp"
58
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/timestamp"
59
+ when "integer", "ordinal", "unit", "scale", "long"
60
+ out["$ref"] = "../../../core/3.1.1/definitions.json#/integer"
61
+ else
62
+ out["type"] = "string"
63
+ end
64
+
65
+ if item["values"]
66
+ case item["values"]
67
+ when Hash
68
+ out["enum"] = item["values"].keys.sort
69
+ when Array
70
+ out["enum"] = item["values"].sort
71
+ else
72
+ raise "Error: Values must be specified as either a Hash or an Array"
73
+ end
74
+
75
+ end
76
+
77
+ if item["pattern"]
78
+ out["pattern"] = item["pattern"]
79
+ end
80
+ end
81
+
82
+ # with draft-07 and older, using a $ref mean all other properties are ignored.
83
+ # to avoid this we need to use an allOf.
84
+ # this is changed from draft-08, but unfortunately, there is still no Ruby validator for that
85
+ if out.keys.include? '$ref'
86
+ ref = out.delete '$ref'
87
+ { "allOf" => [out,{"$ref"=>ref}]}
88
+ else
89
+ out
90
+ end
91
+ end
92
+
93
+ def self.build_item item, property_key: 'v'
94
+ json = { "allOf" => [ { "description" => item['description'] } ] }
95
+ if item['arguments']
96
+ json["allOf"].first["properties"] = { "n" => { "enum" => item['arguments'].keys.sort } }
97
+ item['arguments'].each_pair do |key,argument|
98
+ json["allOf"] << {
99
+ "if" => { "required" => ["n"], "properties" => { "n" => { "const" => key }}},
100
+ "then" => { "properties" => { property_key => build_value(argument) } }
101
+ }
102
+ end
103
+ end
104
+ json
105
+ end
106
+
107
+ def self.output_alarms out, items
108
+ list = items.keys.sort.map do |key|
109
+ {
110
+ "if" => { "required" => ["aCId"], "properties" => { "aCId" => { "const" => key }}},
111
+ "then" => { "$ref" => "#{key}.json" }
112
+ }
113
+ end
114
+ json = {
115
+ "properties" => {
116
+ "aCId" => { "enum" => items.keys.sort },
117
+ "rvs" => { "items" => { "allOf" => list } }
118
+ }
119
+ }
120
+ out['alarms/alarms.json'] = output_json json
121
+ items.each_pair { |key,item| output_alarm out, key, item }
122
+ end
123
+
124
+ def self.output_alarm out, key, item
125
+ json = build_item item
126
+ out["alarms/#{key}.json"] = output_json json
127
+ end
128
+
129
+ def self.output_statuses out, items
130
+ list = [ { "properties" => { "sCI" => { "enum"=> items.keys.sort }}} ]
131
+ items.keys.sort.each do |key|
132
+ list << {
133
+ "if"=> { "required" => ["sCI"], "properties" => { "sCI"=> { "const"=> key }}},
134
+ "then" => { "$ref" => "#{key}.json" }
135
+ }
136
+ end
137
+ json = { "properties" => { "sS" => { "items" => { "allOf" => list }}}}
138
+ out['statuses/statuses.json'] = output_json json
139
+ items.each_pair { |key,item| output_status out, key, item }
140
+ end
141
+
142
+ def self.output_status out, key, item
143
+ json = build_item item, property_key:'s'
144
+ out["statuses/#{key}.json"] = output_json json
145
+ end
146
+
147
+ def self.output_commands out, items
148
+ list = [ { "properties" => { "cCI" => { "enum"=> items.keys.sort }}} ]
149
+ items.keys.sort.each do |key|
150
+ list << {
151
+ "if" => { "required" => ["cCI"], "properties" => { "cCI"=> { "const"=> key }}},
152
+ "then" => { "$ref" => "#{key}.json" }
153
+ }
154
+ end
155
+ json = { "items" => { "allOf" => list }}
156
+ out['commands/commands.json'] = output_json json
157
+
158
+ json = { "properties" => { "arg" => { "$ref" => "commands.json" }}}
159
+ out['commands/command_requests.json'] = output_json json
160
+
161
+ json = { "properties" => { "rvs" => { "$ref" => "commands.json" }}}
162
+ out['commands/command_responses.json'] = output_json json
163
+
164
+ items.each_pair { |key,item| output_command out, key, item }
165
+ end
166
+
167
+ def self.output_command out, key, item
168
+ json = build_item item
169
+ json["allOf"].first["properties"]['cO'] = { "const" => item['command'] }
170
+ out["commands/#{key}.json"] = output_json json
171
+ end
172
+
173
+ def self.output_root out, meta
174
+ json = {
175
+ "name"=> meta['name'],
176
+ "description"=> meta['description'],
177
+ "version"=> meta['version'],
178
+ "allOf" => [
179
+ {
180
+ "if" => { "required" => ["type"], "properties" => { "type" => { "const" => "CommandRequest" }}},
181
+ "then" => { "$ref" => "commands/command_requests.json" }
182
+ },
183
+ {
184
+ "if" => { "required" => ["type"], "properties" => { "type" => { "const" => "CommandResponse" }}},
185
+ "then" => { "$ref" => "commands/command_responses.json" }
186
+ },
187
+ {
188
+ "if" => { "required" => ["type"], "properties" => { "type" => { "enum" => ["StatusRequest","StatusResponse","StatusSubscribe","StatusUnsubscribe","StatusUpdate"] }}},
189
+ "then" => { "$ref" => "statuses/statuses.json" }
190
+ },
191
+ {
192
+ "if" => { "required" => ["type"], "properties" => { "type" => { "const" => "Alarm" }}},
193
+ "then" => { "$ref" => "alarms/alarms.json" }
194
+ }
195
+ ]
196
+ }
197
+ out["sxl.json"] = output_json json
198
+ end
199
+
200
+ def self.generate sxl
201
+ out = {}
202
+ output_root out, sxl[:meta]
203
+ output_alarms out, sxl[:alarms]
204
+ output_statuses out, sxl[:statuses]
205
+ output_commands out, sxl[:commands]
206
+ out
207
+ end
208
+
209
+ def self.write sxl, folder
210
+ out = generate sxl
211
+ out.each_pair do |relative_path,str|
212
+ path = File.join(folder, relative_path)
213
+ FileUtils.mkdir_p File.dirname(path) # create folders if needed
214
+ file = File.open(path, 'w+') # w+ means truncate or create new file
215
+ file.puts str
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
222
+ end
223
+ end
@@ -0,0 +1,41 @@
1
+ # Import SXL from YAML format
2
+
3
+ require 'yaml'
4
+ require 'json'
5
+ require 'fileutils'
6
+
7
+ module RSMP
8
+ module Convert
9
+ module Import
10
+ module YAML
11
+
12
+ def self.read path
13
+ convert ::YAML.load_file(path)
14
+ end
15
+
16
+ def self.parse str
17
+ convert ::YAML.load(str)
18
+ end
19
+
20
+ def self.convert yaml
21
+ sxl = {
22
+ meta: {},
23
+ alarms: {},
24
+ statuses: {},
25
+ commands: {}
26
+ }
27
+
28
+ sxl[:meta] = yaml['meta']
29
+
30
+ yaml['objects'].each_pair do |type,object|
31
+ object["alarms"].each { |id,item| sxl[:alarms][id] = item } if object["alarms"]
32
+ object["statuses"].each { |id,item| sxl[:statuses][id] = item } if object["statuses"]
33
+ object["commands"].each { |id,item| sxl[:commands][id] = item } if object["commands"]
34
+ end
35
+ sxl
36
+ end
37
+ end
38
+
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,13 @@
1
+ module RSMP::Schema
2
+ class Error < StandardError
3
+ end
4
+
5
+ class UnknownSchemaError < Error
6
+ end
7
+
8
+ class UnknownSchemaTypeError < UnknownSchemaError
9
+ end
10
+
11
+ class UnknownSchemaVersionError < UnknownSchemaError
12
+ end
13
+ end
@@ -0,0 +1,102 @@
1
+ require 'json_schemer'
2
+
3
+ module RSMP
4
+ end
5
+
6
+ module RSMP::Schema
7
+ @@schemas = nil
8
+
9
+ def self.schemas
10
+ return @@schemas if @@schemas
11
+ schemas_path = File.expand_path( File.join(__dir__,'..','..','schemas') )
12
+ @@schemas = {
13
+ core: {
14
+ '3.1.1' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'core','3.1.1','rsmp.json')) ),
15
+ '3.1.2' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'core','3.1.2','rsmp.json')) ),
16
+ '3.1.3' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'core','3.1.3','rsmp.json')) ),
17
+ '3.1.4' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'core','3.1.4','rsmp.json')) ),
18
+ '3.1.5' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'core','3.1.5','rsmp.json')) ),
19
+ '3.2' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'core','3.2', 'rsmp.json')) )
20
+ },
21
+ # note that tlc 1.0.11 and 1.0.12 does not exist (unreleased drafts)
22
+ tlc: {
23
+ '1.0.7' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.0.7' ,'sxl.json')) ),
24
+ '1.0.8' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.0.8' ,'sxl.json')) ),
25
+ '1.0.9' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.0.9' ,'sxl.json')) ),
26
+ '1.0.10' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.0.10','sxl.json')) ),
27
+ '1.0.13' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.0.13','sxl.json')) ),
28
+ '1.0.14' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.0.14','sxl.json')) ),
29
+ '1.0.15' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.0.15','sxl.json')) ),
30
+ '1.1' => JSONSchemer.schema( Pathname.new(File.join(schemas_path, 'tlc','1.1', 'sxl.json')) )
31
+ }
32
+ }
33
+ end
34
+
35
+ def self.validate_using_schema message, schema
36
+ raise ArgumentError.new("message missing") unless message
37
+ raise ArgumentError.new("schema missing") unless schema
38
+ unless schema.valid? message
39
+ schema.validate(message).map do |item|
40
+ [item['data_pointer'],item['type'],item['details']]
41
+ end
42
+ else
43
+ []
44
+ end
45
+ end
46
+
47
+ def self.find_schemas type
48
+ raise ArgumentError.new("type missing") unless type
49
+ schemas[type.to_sym]
50
+ end
51
+
52
+ def self.find_schemas! type
53
+ schemas = find_schemas type
54
+ raise UnknownSchemaTypeError.new("Unknown schema type #{type}") unless schemas
55
+ schemas
56
+ end
57
+
58
+ def self.find_schema type, version, options={}
59
+ raise ArgumentError.new("version missing") unless version
60
+ version = sanitize_version version if options[:lenient]
61
+ if version
62
+ schemas = find_schemas type
63
+ return schemas[version] if schemas
64
+ end
65
+ nil
66
+ end
67
+
68
+ def self.sanitize_version version
69
+ matched = /^\d+\.\d+(\.\d+)?/.match version
70
+ matched.to_s if matched
71
+ end
72
+
73
+ def self.find_schema! type, version, options={}
74
+ schema = find_schema type, version, options
75
+ raise ArgumentError.new("version missing") unless version
76
+ version = sanitize_version version if options[:lenient]
77
+ if version
78
+ schemas = find_schemas! type
79
+ schema = schemas[version]
80
+ return schema if schema
81
+ end
82
+ raise UnknownSchemaVersionError.new("Unknown schema version #{type} #{version}")
83
+ end
84
+
85
+ def self.has_schema? type, version, options={}
86
+ find_schema(type,version, options) != nil
87
+ end
88
+
89
+ def self.validate message, schemas, options={}
90
+ raise ArgumentError.new("message missing") unless message
91
+ raise ArgumentError.new("schemas missing") unless schemas
92
+ raise ArgumentError.new("schemas must be a Hash") unless schemas.is_a?(Hash)
93
+ raise ArgumentError.new("schemas cannot be empty") unless schemas.any?
94
+ errors = schemas.flat_map do |type, version|
95
+ schema = find_schema! type, version, options
96
+ validate_using_schema(message, schema)
97
+ end
98
+ return nil if errors.empty?
99
+ errors
100
+ end
101
+
102
+ end
@@ -0,0 +1,5 @@
1
+ module RSMP
2
+ module Schema
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require 'yaml'
2
+ require 'json_schemer'
3
+ require 'rsmp_schema/error'
4
+ require 'rsmp_schema/schema'
5
+ require 'rsmp_schema/convert/import/yaml'
6
+ require 'rsmp_schema/convert/export/json_schema'
7
+ require 'rsmp_schema/version'