@alwaysai/device-agent-schemas 2.3.2 → 2.3.4

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 (419) hide show
  1. package/LICENSE +12 -0
  2. package/README.md +12 -1
  3. package/lib/index.d.ts +2 -2
  4. package/lib/index.js +3 -1
  5. package/lib/schemas/secure-tunnel-schema.json +30 -0
  6. package/lib/shadow-schema.d.ts +17 -1
  7. package/lib/shadow-schema.js +9 -1
  8. package/package.json +16 -6
  9. package/.eslintignore +0 -4
  10. package/.eslintrc +0 -14
  11. package/.node-version +0 -1
  12. package/bitbucket-pipelines.yml +0 -10
  13. package/development.md +0 -53
  14. package/docs/README.md +0 -107
  15. package/docs/agent-message-schema-defs-toclient.md +0 -25
  16. package/docs/agent-message-schema-defs-tocloud.md +0 -25
  17. package/docs/agent-message-schema-defs.md +0 -15
  18. package/docs/agent-message-schema-properties-deviceid.md +0 -15
  19. package/docs/agent-message-schema-properties-payload-oneof-app_install_status.md +0 -66
  20. package/docs/agent-message-schema-properties-payload-oneof-app_logs.md +0 -66
  21. package/docs/agent-message-schema-properties-payload-oneof-app_state.md +0 -66
  22. package/docs/agent-message-schema-properties-payload-oneof-device_stats.md +0 -66
  23. package/docs/agent-message-schema-properties-payload-oneof-signed_urls_request.md +0 -85
  24. package/docs/agent-message-schema-properties-payload.md +0 -27
  25. package/docs/agent-message-schema-properties-timestamp.md +0 -15
  26. package/docs/agent-message-schema-properties-topic-oneof-0.md +0 -25
  27. package/docs/agent-message-schema-properties-topic-oneof-1.md +0 -25
  28. package/docs/agent-message-schema-properties-topic.md +0 -21
  29. package/docs/agent-message-schema.md +0 -138
  30. package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-appinstallpayload-properties-appsignedurl.md +0 -15
  31. package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-appinstallpayload.md +0 -39
  32. package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-appreleasehash.md +0 -25
  33. package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-models_install_payload.md +0 -15
  34. package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-projectid.md +0 -25
  35. package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse.md +0 -116
  36. package/docs/app-install-cloud-response-schema-properties-messagetype.md +0 -23
  37. package/docs/app-install-cloud-response-schema.md +0 -66
  38. package/docs/app-install-response-schema-properties-appinstallresponse-properties-appinstallpayload-properties-appsignedurl.md +0 -15
  39. package/docs/app-install-response-schema-properties-appinstallresponse-properties-appinstallpayload.md +0 -39
  40. package/docs/app-install-response-schema-properties-appinstallresponse-properties-appreleasehash.md +0 -25
  41. package/docs/app-install-response-schema-properties-appinstallresponse-properties-models_install_payload.md +0 -15
  42. package/docs/app-install-response-schema-properties-appinstallresponse-properties-projectid.md +0 -25
  43. package/docs/app-install-response-schema-properties-appinstallresponse.md +0 -116
  44. package/docs/app-install-response-schema.md +0 -39
  45. package/docs/app-install-schema-properties-appreleasehash.md +0 -25
  46. package/docs/app-install-schema-properties-basecommand.md +0 -23
  47. package/docs/app-install-schema-properties-projectid.md +0 -25
  48. package/docs/app-install-schema.md +0 -105
  49. package/docs/app-install-status-schema-properties-appinstallstatus-properties-appreleasehash.md +0 -25
  50. package/docs/app-install-status-schema-properties-appinstallstatus-properties-message.md +0 -15
  51. package/docs/app-install-status-schema-properties-appinstallstatus-properties-status.md +0 -26
  52. package/docs/app-install-status-schema-properties-appinstallstatus.md +0 -98
  53. package/docs/app-install-status-schema-properties-messagetype.md +0 -23
  54. package/docs/app-install-status-schema.md +0 -66
  55. package/docs/app-logs-schema-properties-applogs-properties-logchunk.md +0 -15
  56. package/docs/app-logs-schema-properties-applogs-properties-projectid.md +0 -25
  57. package/docs/app-logs-schema-properties-applogs.md +0 -68
  58. package/docs/app-logs-schema-properties-logchunk.md +0 -15
  59. package/docs/app-logs-schema-properties-messagetype.md +0 -23
  60. package/docs/app-logs-schema-properties-projectid.md +0 -25
  61. package/docs/app-logs-schema.md +0 -68
  62. package/docs/app-state-control-schema-properties-appstatecontrol-properties-basecommand.md +0 -25
  63. package/docs/app-state-control-schema-properties-appstatecontrol-properties-projectid.md +0 -25
  64. package/docs/app-state-control-schema-properties-appstatecontrol.md +0 -78
  65. package/docs/app-state-control-schema-properties-basecommand.md +0 -25
  66. package/docs/app-state-control-schema-properties-messagetype.md +0 -23
  67. package/docs/app-state-control-schema-properties-projectid.md +0 -25
  68. package/docs/app-state-control-schema.md +0 -78
  69. package/docs/app-state-schema-properties-appstate-items-properties-appdetails-properties-projectid.md +0 -25
  70. package/docs/app-state-schema-properties-appstate-items-properties-appdetails-properties-version.md +0 -25
  71. package/docs/app-state-schema-properties-appstate-items-properties-appdetails.md +0 -78
  72. package/docs/app-state-schema-properties-appstate-items-properties-services-items-properties-name.md +0 -15
  73. package/docs/app-state-schema-properties-appstate-items-properties-services-items-properties-state.md +0 -25
  74. package/docs/app-state-schema-properties-appstate-items-properties-services-items.md +0 -68
  75. package/docs/app-state-schema-properties-appstate-items-properties-services.md +0 -15
  76. package/docs/app-state-schema-properties-appstate-items.md +0 -58
  77. package/docs/app-state-schema-properties-appstate.md +0 -15
  78. package/docs/app-state-schema-properties-messagetype.md +0 -23
  79. package/docs/app-state-schema.md +0 -39
  80. package/docs/app-uninstall-schema-properties-basecommand.md +0 -23
  81. package/docs/app-uninstall-schema-properties-projectid.md +0 -25
  82. package/docs/app-uninstall-schema.md +0 -76
  83. package/docs/app-version-control-schema-properties-appversioncontrol.md +0 -21
  84. package/docs/app-version-control-schema-properties-messagetype.md +0 -23
  85. package/docs/app-version-control-schema.md +0 -21
  86. package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-appinstallpayload-properties-appsignedurl.md +0 -15
  87. package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-appinstallpayload.md +0 -39
  88. package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-appreleasehash.md +0 -25
  89. package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-modelsinstallpayload.md +0 -15
  90. package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-projectid.md +0 -25
  91. package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse.md +0 -116
  92. package/docs/app_install_cloud_response_schema-properties-messagetype.md +0 -23
  93. package/docs/app_install_cloud_response_schema.md +0 -66
  94. package/docs/app_install_schema-properties-appreleasehash.md +0 -25
  95. package/docs/app_install_schema-properties-basecommand.md +0 -23
  96. package/docs/app_install_schema-properties-projectid.md +0 -25
  97. package/docs/app_install_schema.md +0 -105
  98. package/docs/app_state_control_schema-properties-appstatecontrol-properties-basecommand.md +0 -25
  99. package/docs/app_state_control_schema-properties-appstatecontrol-properties-projectid.md +0 -25
  100. package/docs/app_state_control_schema-properties-appstatecontrol.md +0 -78
  101. package/docs/app_state_control_schema-properties-messagetype.md +0 -23
  102. package/docs/app_state_control_schema.md +0 -66
  103. package/docs/app_uninstall_schema-properties-basecommand.md +0 -23
  104. package/docs/app_uninstall_schema-properties-projectid.md +0 -25
  105. package/docs/app_uninstall_schema.md +0 -76
  106. package/docs/app_version_control_schema-properties-appversioncontrol.md +0 -21
  107. package/docs/app_version_control_schema-properties-messagetype.md +0 -23
  108. package/docs/app_version_control_schema.md +0 -72
  109. package/docs/client-message-schema-defs-message.md +0 -25
  110. package/docs/client-message-schema-defs.md +0 -15
  111. package/docs/client-message-schema-properties-payload-oneof-live_state_updates.md +0 -66
  112. package/docs/client-message-schema-properties-payload-oneof-models_install_cloud_response.md +0 -66
  113. package/docs/client-message-schema-properties-payload.md +0 -27
  114. package/docs/client-message-schema-properties-timestamp.md +0 -15
  115. package/docs/client-message-schema-properties-topic.md +0 -25
  116. package/docs/client-message-schema.md +0 -112
  117. package/docs/client_message_schema-defs-message.md +0 -25
  118. package/docs/client_message_schema-defs.md +0 -15
  119. package/docs/client_message_schema-properties-payload-oneof-3.md +0 -66
  120. package/docs/client_message_schema-properties-payload-oneof-4.md +0 -66
  121. package/docs/client_message_schema-properties-payload.md +0 -27
  122. package/docs/client_message_schema-properties-timestamp.md +0 -15
  123. package/docs/client_message_schema-properties-topic.md +0 -25
  124. package/docs/client_message_schema.md +0 -112
  125. package/docs/common-schema-defs-appreleasehash.md +0 -25
  126. package/docs/common-schema-defs-modelid.md +0 -25
  127. package/docs/common-schema-defs-projectid.md +0 -25
  128. package/docs/common-schema-defs-txid.md +0 -29
  129. package/docs/common-schema-defs.md +0 -15
  130. package/docs/common-schema.md +0 -61
  131. package/docs/device-action-schema-properties-action.md +0 -23
  132. package/docs/device-action-schema.md +0 -47
  133. package/docs/device-stats-schema-properties-cpudetails-properties-temperature.md +0 -15
  134. package/docs/device-stats-schema-properties-cpudetails-properties-usedperc.md +0 -15
  135. package/docs/device-stats-schema-properties-cpudetails.md +0 -58
  136. package/docs/device-stats-schema-properties-cpuusage.md +0 -15
  137. package/docs/device-stats-schema-properties-diskdetails-properties-freegb.md +0 -15
  138. package/docs/device-stats-schema-properties-diskdetails-properties-usedgb.md +0 -15
  139. package/docs/device-stats-schema-properties-diskdetails.md +0 -58
  140. package/docs/device-stats-schema-properties-diskutil.md +0 -15
  141. package/docs/device-stats-schema-properties-memdetails-properties-freemb.md +0 -15
  142. package/docs/device-stats-schema-properties-memdetails-properties-usedmb.md +0 -15
  143. package/docs/device-stats-schema-properties-memdetails.md +0 -58
  144. package/docs/device-stats-schema-properties-usedmemorypercentage.md +0 -15
  145. package/docs/device-stats-schema.md +0 -134
  146. package/docs/device-status-schema-properties-devicestats-properties-cpuusage.md +0 -15
  147. package/docs/device-status-schema-properties-devicestats-properties-diskutil.md +0 -15
  148. package/docs/device-status-schema-properties-devicestats-properties-usedmemorypercentage.md +0 -15
  149. package/docs/device-status-schema-properties-devicestats.md +0 -77
  150. package/docs/device-status-schema-properties-messagetype.md +0 -23
  151. package/docs/device-status-schema.md +0 -66
  152. package/docs/live-updates-toggle-schema-properties-applogs-properties-toggle.md +0 -15
  153. package/docs/live-updates-toggle-schema-properties-applogs.md +0 -68
  154. package/docs/live-updates-toggle-schema-properties-appstate.md +0 -15
  155. package/docs/live-updates-toggle-schema-properties-devicestats.md +0 -15
  156. package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-applogs-properties-projectid.md +0 -25
  157. package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-applogs-properties-toggle.md +0 -15
  158. package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-applogs.md +0 -68
  159. package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-appstate.md +0 -15
  160. package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-devicestats.md +0 -15
  161. package/docs/live-updates-toggle-schema-properties-liveupdatestoggles.md +0 -77
  162. package/docs/live-updates-toggle-schema-properties-messagetype.md +0 -23
  163. package/docs/live-updates-toggle-schema.md +0 -77
  164. package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-applogs-properties-projectid.md +0 -25
  165. package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-applogs-properties-toggle.md +0 -15
  166. package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-applogs.md +0 -68
  167. package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-appstate.md +0 -15
  168. package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-devicestats.md +0 -15
  169. package/docs/live_updates_toggle_schema-properties-liveupdatestoggles.md +0 -77
  170. package/docs/live_updates_toggle_schema-properties-messagetype.md +0 -23
  171. package/docs/live_updates_toggle_schema.md +0 -66
  172. package/docs/models-install-cloud-response-schema-properties-messagetype.md +0 -23
  173. package/docs/models-install-cloud-response-schema-properties-modelsinstallcloudresponse-properties-projectid.md +0 -25
  174. package/docs/models-install-cloud-response-schema-properties-modelsinstallcloudresponse.md +0 -68
  175. package/docs/models-install-cloud-response-schema.md +0 -66
  176. package/docs/models-install-payload-schema-items-properties-id.md +0 -25
  177. package/docs/models-install-payload-schema-items-properties-modelsignedurl.md +0 -15
  178. package/docs/models-install-payload-schema-items-properties-version.md +0 -15
  179. package/docs/models-install-payload-schema-items.md +0 -87
  180. package/docs/models-install-payload-schema.md +0 -15
  181. package/docs/models-install-response-schema-properties-modelsinstallresponse.md +0 -68
  182. package/docs/models-install-response-schema.md +0 -39
  183. package/docs/models_install_cloud_response_schema-properties-messagetype.md +0 -23
  184. package/docs/models_install_cloud_response_schema-properties-modelsinstallcloudresponse-properties-projectid.md +0 -25
  185. package/docs/models_install_cloud_response_schema-properties-modelsinstallcloudresponse.md +0 -68
  186. package/docs/models_install_cloud_response_schema.md +0 -66
  187. package/docs/models_install_payload_schema-items-properties-id.md +0 -25
  188. package/docs/models_install_payload_schema-items-properties-modelsignedurl.md +0 -15
  189. package/docs/models_install_payload_schema-items-properties-version.md +0 -15
  190. package/docs/models_install_payload_schema-items.md +0 -87
  191. package/docs/models_install_payload_schema.md +0 -15
  192. package/docs/shadow-project-update-schema-properties-appconfig.md +0 -15
  193. package/docs/shadow-project-update-schema-properties-envvars-patternproperties--patternproperties-.md +0 -15
  194. package/docs/shadow-project-update-schema-properties-envvars-patternproperties--patternproperties.md +0 -15
  195. package/docs/shadow-project-update-schema-properties-envvars-patternproperties-.md +0 -39
  196. package/docs/shadow-project-update-schema-properties-envvars-patternproperties.md +0 -15
  197. package/docs/shadow-project-update-schema-properties-envvars.md +0 -44
  198. package/docs/shadow-project-update-schema.md +0 -63
  199. package/docs/shadow-projects-update-all-schema-patternproperties.md +0 -15
  200. package/docs/shadow-projects-update-all-schema-propertynames.md +0 -25
  201. package/docs/shadow-projects-update-all-schema.md +0 -44
  202. package/docs/signed-urls-request-schema-properties-messagetype.md +0 -23
  203. package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-models-patternproperties-a-za-z0-9_.md +0 -15
  204. package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-models-patternproperties.md +0 -15
  205. package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-models.md +0 -39
  206. package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-projectid.md +0 -25
  207. package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest.md +0 -68
  208. package/docs/signed-urls-request-schema-properties-signedurlsrequest-properties-appreleasehash.md +0 -25
  209. package/docs/signed-urls-request-schema-properties-signedurlsrequest-properties-projectid.md +0 -25
  210. package/docs/signed-urls-request-schema-properties-signedurlsrequest.md +0 -78
  211. package/docs/signed-urls-request-schema.md +0 -58
  212. package/docs/status-response-schema-properties-message.md +0 -15
  213. package/docs/status-response-schema-properties-status.md +0 -27
  214. package/docs/status-response-schema.md +0 -70
  215. package/docs/system-information-schema-properties-cpu-properties-brand.md +0 -15
  216. package/docs/system-information-schema-properties-cpu-properties-cores.md +0 -15
  217. package/docs/system-information-schema-properties-cpu-properties-efficiencycores.md +0 -15
  218. package/docs/system-information-schema-properties-cpu-properties-manufacturer.md +0 -15
  219. package/docs/system-information-schema-properties-cpu-properties-model.md +0 -15
  220. package/docs/system-information-schema-properties-cpu-properties-physicalcores.md +0 -15
  221. package/docs/system-information-schema-properties-cpu-properties-processors.md +0 -15
  222. package/docs/system-information-schema-properties-cpu-properties-vendor.md +0 -15
  223. package/docs/system-information-schema-properties-cpu.md +0 -172
  224. package/docs/system-information-schema-properties-device-properties-manufacturer.md +0 -15
  225. package/docs/system-information-schema-properties-device-properties-model.md +0 -15
  226. package/docs/system-information-schema-properties-device-properties-serial.md +0 -15
  227. package/docs/system-information-schema-properties-device-properties-version.md +0 -15
  228. package/docs/system-information-schema-properties-device-properties-virtual.md +0 -15
  229. package/docs/system-information-schema-properties-device.md +0 -115
  230. package/docs/system-information-schema-properties-disk-properties-drives-items-properties-device.md +0 -15
  231. package/docs/system-information-schema-properties-disk-properties-drives-items-properties-name.md +0 -15
  232. package/docs/system-information-schema-properties-disk-properties-drives-items-properties-size.md +0 -15
  233. package/docs/system-information-schema-properties-disk-properties-drives-items-properties-type.md +0 -15
  234. package/docs/system-information-schema-properties-disk-properties-drives-items-properties-vendor.md +0 -15
  235. package/docs/system-information-schema-properties-disk-properties-drives-items.md +0 -115
  236. package/docs/system-information-schema-properties-disk-properties-drives.md +0 -15
  237. package/docs/system-information-schema-properties-disk.md +0 -39
  238. package/docs/system-information-schema-properties-network-properties-ipv4address.md +0 -15
  239. package/docs/system-information-schema-properties-network-properties-ipv6address.md +0 -15
  240. package/docs/system-information-schema-properties-network-properties-macaddress.md +0 -15
  241. package/docs/system-information-schema-properties-network.md +0 -77
  242. package/docs/system-information-schema-properties-os-properties-architecture.md +0 -15
  243. package/docs/system-information-schema-properties-os-properties-distro.md +0 -15
  244. package/docs/system-information-schema-properties-os-properties-hostname.md +0 -15
  245. package/docs/system-information-schema-properties-os-properties-kernel.md +0 -15
  246. package/docs/system-information-schema-properties-os-properties-platform.md +0 -15
  247. package/docs/system-information-schema-properties-os-properties-release.md +0 -15
  248. package/docs/system-information-schema-properties-os.md +0 -134
  249. package/docs/system-information-schema-properties-versions-properties-agent.md +0 -15
  250. package/docs/system-information-schema-properties-versions-properties-deviceagentschemas.md +0 -15
  251. package/docs/system-information-schema-properties-versions.md +0 -58
  252. package/docs/system-information-schema.md +0 -134
  253. package/docs/to-client-message-schema-allof-0-if-properties-messagetype.md +0 -23
  254. package/docs/to-client-message-schema-allof-0-if-properties.md +0 -15
  255. package/docs/to-client-message-schema-allof-0-if.md +0 -47
  256. package/docs/to-client-message-schema-allof-0-then-properties.md +0 -15
  257. package/docs/to-client-message-schema-allof-0-then.md +0 -39
  258. package/docs/to-client-message-schema-allof-0.md +0 -15
  259. package/docs/to-client-message-schema-allof-1-if-properties-messagetype.md +0 -23
  260. package/docs/to-client-message-schema-allof-1-if-properties.md +0 -15
  261. package/docs/to-client-message-schema-allof-1-if.md +0 -47
  262. package/docs/to-client-message-schema-allof-1-then-properties.md +0 -15
  263. package/docs/to-client-message-schema-allof-1-then.md +0 -39
  264. package/docs/to-client-message-schema-allof-1.md +0 -15
  265. package/docs/to-client-message-schema-allof-2-if-properties-messagetype.md +0 -23
  266. package/docs/to-client-message-schema-allof-2-if-properties.md +0 -15
  267. package/docs/to-client-message-schema-allof-2-if.md +0 -47
  268. package/docs/to-client-message-schema-allof-2-then-properties.md +0 -15
  269. package/docs/to-client-message-schema-allof-2-then.md +0 -39
  270. package/docs/to-client-message-schema-allof-2.md +0 -15
  271. package/docs/to-client-message-schema-allof-3-if-properties-messagetype.md +0 -23
  272. package/docs/to-client-message-schema-allof-3-if-properties.md +0 -15
  273. package/docs/to-client-message-schema-allof-3-if.md +0 -47
  274. package/docs/to-client-message-schema-allof-3-then-properties.md +0 -15
  275. package/docs/to-client-message-schema-allof-3-then.md +0 -39
  276. package/docs/to-client-message-schema-allof-3.md +0 -15
  277. package/docs/to-client-message-schema-defs-toclient.md +0 -25
  278. package/docs/to-client-message-schema-defs.md +0 -15
  279. package/docs/to-client-message-schema-properties-deviceid.md +0 -15
  280. package/docs/to-client-message-schema-properties-messagetype.md +0 -26
  281. package/docs/to-client-message-schema-properties-payload.md +0 -25
  282. package/docs/to-client-message-schema-properties-timestamp.md +0 -15
  283. package/docs/to-client-message-schema-properties-topic-oneof-0.md +0 -25
  284. package/docs/to-client-message-schema-properties-topic.md +0 -19
  285. package/docs/to-client-message-schema.md +0 -196
  286. package/docs/to-cloud-message-schema-allof-0-if-properties-messagetype.md +0 -23
  287. package/docs/to-cloud-message-schema-allof-0-if-properties.md +0 -15
  288. package/docs/to-cloud-message-schema-allof-0-if.md +0 -47
  289. package/docs/to-cloud-message-schema-allof-0-then-properties.md +0 -15
  290. package/docs/to-cloud-message-schema-allof-0-then.md +0 -39
  291. package/docs/to-cloud-message-schema-allof-0.md +0 -15
  292. package/docs/to-cloud-message-schema-defs-tocloud.md +0 -25
  293. package/docs/to-cloud-message-schema-defs.md +0 -15
  294. package/docs/to-cloud-message-schema-properties-deviceid.md +0 -15
  295. package/docs/to-cloud-message-schema-properties-messagetype.md +0 -23
  296. package/docs/to-cloud-message-schema-properties-payload.md +0 -19
  297. package/docs/to-cloud-message-schema-properties-timestamp.md +0 -15
  298. package/docs/to-cloud-message-schema-properties-topic-oneof-0.md +0 -25
  299. package/docs/to-cloud-message-schema-properties-topic.md +0 -19
  300. package/docs/to-cloud-message-schema.md +0 -181
  301. package/docs/to-device-agent-message-schema-allof-0-if-properties-messagetype.md +0 -23
  302. package/docs/to-device-agent-message-schema-allof-0-if-properties.md +0 -15
  303. package/docs/to-device-agent-message-schema-allof-0-if.md +0 -47
  304. package/docs/to-device-agent-message-schema-allof-0-then-properties.md +0 -15
  305. package/docs/to-device-agent-message-schema-allof-0-then.md +0 -39
  306. package/docs/to-device-agent-message-schema-allof-0.md +0 -15
  307. package/docs/to-device-agent-message-schema-allof-1-if-properties-messagetype.md +0 -23
  308. package/docs/to-device-agent-message-schema-allof-1-if-properties.md +0 -15
  309. package/docs/to-device-agent-message-schema-allof-1-if.md +0 -47
  310. package/docs/to-device-agent-message-schema-allof-1-then-properties.md +0 -15
  311. package/docs/to-device-agent-message-schema-allof-1-then.md +0 -45
  312. package/docs/to-device-agent-message-schema-allof-1.md +0 -15
  313. package/docs/to-device-agent-message-schema-allof-2-if-properties-messagetype.md +0 -23
  314. package/docs/to-device-agent-message-schema-allof-2-if-properties.md +0 -15
  315. package/docs/to-device-agent-message-schema-allof-2-if.md +0 -47
  316. package/docs/to-device-agent-message-schema-allof-2-then-properties.md +0 -15
  317. package/docs/to-device-agent-message-schema-allof-2-then.md +0 -39
  318. package/docs/to-device-agent-message-schema-allof-2.md +0 -15
  319. package/docs/to-device-agent-message-schema-allof-3-if-properties-messagetype.md +0 -23
  320. package/docs/to-device-agent-message-schema-allof-3-if-properties.md +0 -15
  321. package/docs/to-device-agent-message-schema-allof-3-if.md +0 -47
  322. package/docs/to-device-agent-message-schema-allof-3-then-properties.md +0 -15
  323. package/docs/to-device-agent-message-schema-allof-3-then.md +0 -39
  324. package/docs/to-device-agent-message-schema-allof-3.md +0 -15
  325. package/docs/to-device-agent-message-schema-allof-4-if-properties-messagetype.md +0 -23
  326. package/docs/to-device-agent-message-schema-allof-4-if-properties.md +0 -15
  327. package/docs/to-device-agent-message-schema-allof-4-if.md +0 -47
  328. package/docs/to-device-agent-message-schema-allof-4-then-properties.md +0 -15
  329. package/docs/to-device-agent-message-schema-allof-4-then.md +0 -39
  330. package/docs/to-device-agent-message-schema-allof-4.md +0 -15
  331. package/docs/to-device-agent-message-schema-allof-5-if-properties-messagetype.md +0 -23
  332. package/docs/to-device-agent-message-schema-allof-5-if-properties.md +0 -15
  333. package/docs/to-device-agent-message-schema-allof-5-if.md +0 -47
  334. package/docs/to-device-agent-message-schema-allof-5-then-properties.md +0 -15
  335. package/docs/to-device-agent-message-schema-allof-5-then.md +0 -39
  336. package/docs/to-device-agent-message-schema-allof-5.md +0 -15
  337. package/docs/to-device-agent-message-schema-allof-6-if-properties-messagetype.md +0 -23
  338. package/docs/to-device-agent-message-schema-allof-6-if-properties.md +0 -15
  339. package/docs/to-device-agent-message-schema-allof-6-if.md +0 -47
  340. package/docs/to-device-agent-message-schema-allof-6-then-properties.md +0 -15
  341. package/docs/to-device-agent-message-schema-allof-6-then.md +0 -39
  342. package/docs/to-device-agent-message-schema-allof-6.md +0 -15
  343. package/docs/to-device-agent-message-schema-defs-todevice.md +0 -25
  344. package/docs/to-device-agent-message-schema-defs.md +0 -15
  345. package/docs/to-device-agent-message-schema-properties-messagetype.md +0 -29
  346. package/docs/to-device-agent-message-schema-properties-payload.md +0 -35
  347. package/docs/to-device-agent-message-schema-properties-timestamp.md +0 -15
  348. package/docs/to-device-agent-message-schema-properties-topic.md +0 -25
  349. package/docs/to-device-agent-message-schema.md +0 -202
  350. package/jest.config.js +0 -3
  351. package/lib/app-action-schema.d.ts.map +0 -1
  352. package/lib/app-action-schema.js.map +0 -1
  353. package/lib/app-logs-schema.d.ts.map +0 -1
  354. package/lib/app-logs-schema.js.map +0 -1
  355. package/lib/app-state-schema.d.ts.map +0 -1
  356. package/lib/app-state-schema.js.map +0 -1
  357. package/lib/constants.d.ts.map +0 -1
  358. package/lib/constants.js.map +0 -1
  359. package/lib/device-action-schema.d.ts.map +0 -1
  360. package/lib/device-action-schema.js.map +0 -1
  361. package/lib/device-agent-action-schema.d.ts.map +0 -1
  362. package/lib/device-agent-action-schema.js.map +0 -1
  363. package/lib/device-stats-schema.d.ts.map +0 -1
  364. package/lib/device-stats-schema.js.map +0 -1
  365. package/lib/index.d.ts.map +0 -1
  366. package/lib/index.js.map +0 -1
  367. package/lib/message-builders.d.ts.map +0 -1
  368. package/lib/message-builders.js.map +0 -1
  369. package/lib/shadow-schema.d.ts.map +0 -1
  370. package/lib/shadow-schema.js.map +0 -1
  371. package/lib/signed-urls-request-schema.d.ts.map +0 -1
  372. package/lib/signed-urls-request-schema.js.map +0 -1
  373. package/lib/status-response-schema.d.ts.map +0 -1
  374. package/lib/status-response-schema.js.map +0 -1
  375. package/lib/types.d.ts.map +0 -1
  376. package/lib/types.js.map +0 -1
  377. package/lib/utils.d.ts.map +0 -1
  378. package/lib/utils.js.map +0 -1
  379. package/src/app-action-schema.ts +0 -71
  380. package/src/app-logs-schema.ts +0 -13
  381. package/src/app-state-schema.ts +0 -27
  382. package/src/constants.ts +0 -140
  383. package/src/device-action-schema.ts +0 -11
  384. package/src/device-agent-action-schema.ts +0 -17
  385. package/src/device-stats-schema.ts +0 -33
  386. package/src/index.ts +0 -182
  387. package/src/message-builders.ts +0 -263
  388. package/src/schemas/app-install-response-schema.json +0 -41
  389. package/src/schemas/app-install-schema.json +0 -20
  390. package/src/schemas/app-logs-schema.json +0 -16
  391. package/src/schemas/app-state-control-schema.json +0 -17
  392. package/src/schemas/app-state-schema.json +0 -49
  393. package/src/schemas/app-uninstall-schema.json +0 -17
  394. package/src/schemas/app-version-control-schema.json +0 -14
  395. package/src/schemas/common-schema.json +0 -27
  396. package/src/schemas/device-action-schema.json +0 -14
  397. package/src/schemas/device-stats-schema.json +0 -58
  398. package/src/schemas/live-updates-toggle-schema.json +0 -29
  399. package/src/schemas/models-install-payload-schema.json +0 -22
  400. package/src/schemas/models-install-response-schema.json +0 -23
  401. package/src/schemas/shadow-project-update-schema.json +0 -30
  402. package/src/schemas/shadow-projects-update-all-schema.json +0 -17
  403. package/src/schemas/signed-urls-request-schema.json +0 -42
  404. package/src/schemas/status-response-schema.json +0 -16
  405. package/src/schemas/system-information-schema.json +0 -155
  406. package/src/schemas/to-client-message-schema.json +0 -98
  407. package/src/schemas/to-cloud-message-schema.json +0 -56
  408. package/src/schemas/to-device-agent-message-schema.json +0 -135
  409. package/src/shadow-schema.ts +0 -177
  410. package/src/signed-urls-request-schema.ts +0 -22
  411. package/src/status-response-schema.ts +0 -18
  412. package/src/types.ts +0 -175
  413. package/src/utils.ts +0 -21
  414. package/tests/constants.test.ts +0 -41
  415. package/tests/shadow-schema.test.ts +0 -171
  416. package/tests/types.test.ts +0 -515
  417. package/tsconfig.build.json +0 -4
  418. package/tsconfig.eslint.json +0 -5
  419. package/tsconfig.json +0 -91
@@ -1,42 +0,0 @@
1
- {
2
- "$id": "https://alwaysai.co/signed-urls-request-schema.json",
3
- "$schema": "https://json-schema.org/draft/2019-09/schema",
4
- "title": "signed_urls_request",
5
- "type": "object",
6
- "properties": {
7
- "signedUrlsRequest": {
8
- "type": "object",
9
- "properties": {
10
- "projectId": {
11
- "$ref": "https://alwaysai.co/common-schema.json#/$defs/projectId"
12
- },
13
- "appReleaseHash": {
14
- "$ref": "https://alwaysai.co/common-schema.json#/$defs/appReleaseHash"
15
- }
16
- },
17
- "required": ["projectId", "appReleaseHash"],
18
- "additionalProperties": false
19
- },
20
- "modelsOnlyUrlsRequest": {
21
- "type": "object",
22
- "properties": {
23
- "projectId": {
24
- "$ref": "https://alwaysai.co/common-schema.json#/$defs/projectId"
25
- },
26
- "models": {
27
- "type": "object",
28
- "patternProperties": {
29
- "[A-Za-z0-9_]+/[A-Za-z0-9_]*": {
30
- "type": ["integer"]
31
- }
32
- },
33
- "additionalProperties": false
34
- }
35
- },
36
- "required": ["projectId", "models"],
37
- "additionalProperties": false
38
- }
39
- },
40
- "required": [],
41
- "additionalProperties": false
42
- }
@@ -1,16 +0,0 @@
1
- {
2
- "$id": "https://alwaysai.co/status-response-schema.json",
3
- "$schema": "https://json-schema.org/draft/2019-09/schema",
4
- "title": "status_response",
5
- "type": "object",
6
- "properties": {
7
- "status": {
8
- "enum": ["requested", "in_progress", "failure", "success", "connection_lost"]
9
- },
10
- "message": {
11
- "type": "string"
12
- }
13
- },
14
- "required": ["status"],
15
- "additionalProperties": false
16
- }
@@ -1,155 +0,0 @@
1
- {
2
- "$id": "https://alwaysai.co/system-information-schema.json",
3
- "$schema": "https://json-schema.org/draft/2019-09/schema",
4
- "title": "system-information",
5
- "type": "object",
6
- "properties": {
7
- "os": {
8
- "type": "object",
9
- "properties": {
10
- "platform": {
11
- "type": "string"
12
- },
13
- "distro": {
14
- "type": "string"
15
- },
16
- "release": {
17
- "type": "string"
18
- },
19
- "kernel": {
20
- "type": "string"
21
- },
22
- "architecture": {
23
- "type": "string"
24
- },
25
- "hostname": {
26
- "type": "string"
27
- }
28
- },
29
- "additionalProperties": false
30
- },
31
- "cpu": {
32
- "type": "object",
33
- "properties": {
34
- "manufacturer": {
35
- "type": "string"
36
- },
37
- "brand": {
38
- "type": "string"
39
- },
40
- "vendor": {
41
- "type": "string"
42
- },
43
- "model": {
44
- "type": "string"
45
- },
46
- "cores": {
47
- "type": "number"
48
- },
49
- "physicalCores": {
50
- "type": "number"
51
- },
52
- "efficiencyCores": {
53
- "type": "number"
54
- },
55
- "processors": {
56
- "type": "number"
57
- }
58
- },
59
- "additionalProperties": false
60
- },
61
- "disk": {
62
- "type": "object",
63
- "properties": {
64
- "drives": {
65
- "type": "array",
66
- "items": {
67
- "type": "object",
68
- "properties": {
69
- "device": {
70
- "type": "string"
71
- },
72
- "type": {
73
- "type": "string"
74
- },
75
- "name": {
76
- "type": "string"
77
- },
78
- "vendor": {
79
- "type": "string"
80
- },
81
- "size": {
82
- "type": "number"
83
- }
84
- }
85
- }
86
- }
87
- },
88
- "additionalProperties": false
89
- },
90
- "device": {
91
- "type": "object",
92
- "properties": {
93
- "manufacturer": {
94
- "type": "string"
95
- },
96
- "model": {
97
- "type": "string"
98
- },
99
- "version": {
100
- "type": "string"
101
- },
102
- "serial": {
103
- "type": "string"
104
- },
105
- "virtual": {
106
- "type": "boolean"
107
- }
108
- },
109
- "additionalProperties": false
110
- },
111
- "network": {
112
- "type": "object",
113
- "properties": {
114
- "ipv4Address": {
115
- "type": "string"
116
- },
117
- "ipv6Address": {
118
- "type": "string"
119
- },
120
- "macAddress": {
121
- "type": "string"
122
- }
123
- },
124
- "additionalProperties": false
125
- },
126
- "versions": {
127
- "type": "object",
128
- "properties": {
129
- "agent": {
130
- "type": "string"
131
- },
132
- "deviceAgentSchemas": {
133
- "type": "string"
134
- },
135
- "npm": {
136
- "type": "string"
137
- },
138
- "node": {
139
- "type": "string"
140
- },
141
- "docker": {
142
- "type": "string"
143
- },
144
- "dockerCompose": {
145
- "type": "string"
146
- }
147
- },
148
- "additionalProperties": false
149
- },
150
- "lastBootTime": {
151
- "type": "string"
152
- }
153
- },
154
- "additionalProperties": false
155
- }
@@ -1,98 +0,0 @@
1
- {
2
- "$id": "https://alwaysai.co/to-client-message-schema.json",
3
- "title": "to_client_message",
4
- "$schema": "https://json-schema.org/draft/2019-09/schema",
5
- "description": "The messaging payload structure for messages sent from device agent to clients",
6
- "type": "object",
7
- "properties": {
8
- "timestamp": {
9
- "type": "string"
10
- },
11
- "deviceId": {
12
- "description": "Device UUID of device sending the message",
13
- "type": "string"
14
- },
15
- "topic": {
16
- "oneOf": [{ "$ref": "#/$defs/toClient" }]
17
- },
18
- "messageType": {
19
- "type": "string",
20
- "enum": [
21
- "device_stats",
22
- "app_state",
23
- "status_response",
24
- "app_logs"
25
- ]
26
- },
27
- "txId": {
28
- "$ref": "https://alwaysai.co/common-schema.json#/$defs/txId"
29
- },
30
- "payload": {
31
- "oneOf": [
32
- { "$ref": "https://alwaysai.co/device-stats-schema.json" },
33
- { "$ref": "https://alwaysai.co/app-state-schema.json" },
34
- { "$ref": "https://alwaysai.co/app-logs-schema.json" },
35
- { "$ref": "https://alwaysai.co/status-response-schema.json" }
36
- ]
37
- }
38
- },
39
- "allOf":[
40
- {
41
- "if": {
42
- "properties": {
43
- "messageType": { "const": "device_stats" }
44
- }
45
- },
46
- "then": {
47
- "properties": {
48
- "payload": {"$ref": "https://alwaysai.co/device-stats-schema.json"}
49
- }
50
- }
51
- },
52
- {
53
- "if": {
54
- "properties": {
55
- "messageType": { "const": "app_state" }
56
- }
57
- },
58
- "then": {
59
- "properties": {
60
- "payload": {"$ref": "https://alwaysai.co/app-state-schema.json"}
61
- }
62
- }
63
- },
64
- {
65
- "if": {
66
- "properties": {
67
- "messageType": { "const": "status_response" }
68
- }
69
- },
70
- "then": {
71
- "properties": {
72
- "payload": {"$ref": "https://alwaysai.co/status-response-schema.json"}
73
- }
74
- }
75
- },
76
- {
77
- "if": {
78
- "properties": {
79
- "messageType": { "const": "app_logs" }
80
- }
81
- },
82
- "then": {
83
- "properties": {
84
- "payload": {"$ref": "https://alwaysai.co/app-logs-schema.json"}
85
- }
86
- }
87
- }
88
- ],
89
- "required": ["timestamp", "deviceId", "txId", "payload", "messageType"],
90
- "additionalProperties": false,
91
- "$defs": {
92
- "toClient": {
93
- "description": "Messages sent from the device agent to console client",
94
- "type": "string",
95
- "pattern": "to-client/aai-device/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
96
- }
97
- }
98
- }
@@ -1,56 +0,0 @@
1
- {
2
- "$id": "https://alwaysai.co/cloud-message-schema.json",
3
- "title": "cloud_message",
4
- "$schema": "https://json-schema.org/draft/2019-09/schema",
5
- "description": "The messaging payload structure for messages sent from device agent to the cloud",
6
- "type": "object",
7
- "properties": {
8
- "timestamp": {
9
- "type": "string"
10
- },
11
- "deviceId": {
12
- "description": "Device UUID of device sending the message",
13
- "type": "string"
14
- },
15
- "topic": {
16
- "oneOf": [{ "$ref": "#/$defs/toCloud" }]
17
- },
18
- "messageType": {
19
- "type": "string",
20
- "enum": [
21
- "signed_urls_request"
22
- ]
23
- },
24
- "txId": {
25
- "$ref": "https://alwaysai.co/common-schema.json#/$defs/txId"
26
- },
27
- "payload": {
28
- "oneOf": [
29
- { "$ref": "https://alwaysai.co/signed-urls-request-schema.json" }
30
- ]
31
- }
32
- },
33
- "allOf":[
34
- {
35
- "if": {
36
- "properties": {
37
- "messageType": { "const": "signed_urls_request" }
38
- }
39
- },
40
- "then": {
41
- "properties": {
42
- "payload": {"$ref": "https://alwaysai.co/signed-urls-request-schema.json"}
43
- }
44
- }
45
- }
46
- ],
47
- "required": ["timestamp", "deviceId", "txId", "payload", "messageType"],
48
- "additionalProperties": false,
49
- "$defs": {
50
- "toCloud": {
51
- "description": "Messages sent from the device agent to cloud backend client",
52
- "type": "string",
53
- "pattern": "to-cloud/aai-device/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
54
- }
55
- }
56
- }
@@ -1,135 +0,0 @@
1
- {
2
- "$id": "https://alwaysai.co/to-device-agent-message-schema.json",
3
- "$schema": "https://json-schema.org/draft/2019-09/schema",
4
- "title": "to_device_agent_message",
5
- "description":
6
- "A schema that describes the message payload structure for messages sent from clients to device agent",
7
- "type": "object",
8
- "properties": {
9
- "timestamp": {
10
- "type": "string"
11
- },
12
- "topic": { "$ref": "#/$defs/toDevice" },
13
- "messageType": {
14
- "type": "string",
15
- "enum": [
16
- "app_state_control",
17
- "app_version_control",
18
- "app_install_response",
19
- "models_install_response",
20
- "live_state_updates",
21
- "device_action",
22
- "status_response"
23
- ]
24
- },
25
- "txId": {
26
- "$ref": "https://alwaysai.co/common-schema.json#/$defs/txId"
27
- },
28
- "payload": {
29
- "oneOf": [
30
- { "$ref": "https://alwaysai.co/app-state-control-schema.json" },
31
- { "$ref": "https://alwaysai.co/app-version-control-schema.json" },
32
- { "$ref": "https://alwaysai.co/app-install-response-schema.json" },
33
- { "$ref": "https://alwaysai.co/models-install-response-schema.json" },
34
- { "$ref": "https://alwaysai.co/live-updates-toggle-schema.json" },
35
- { "$ref": "https://alwaysai.co/device-action-schema.json" },
36
- { "$ref": "https://alwaysai.co/status-response-schema.json" }
37
- ]
38
- }
39
- },
40
- "allOf":[
41
- {
42
- "if": {
43
- "properties": {
44
- "messageType": { "const": "app_state_control" }
45
- }
46
- },
47
- "then": {
48
- "properties": {
49
- "payload": {"$ref": "https://alwaysai.co/app-state-control-schema.json"}
50
- }
51
- }
52
- },
53
- {
54
- "if": {
55
- "properties": {
56
- "messageType": { "const": "app_version_control" }
57
- }
58
- },
59
- "then": {
60
- "properties": {
61
- "payload": {"$ref": "https://alwaysai.co/app-version-control-schema.json"}
62
- }
63
- }
64
- },
65
- {
66
- "if": {
67
- "properties": {
68
- "messageType": { "const": "app_install_response" }
69
- }
70
- },
71
- "then": {
72
- "properties": {
73
- "payload": {"$ref": "https://alwaysai.co/app-install-response-schema.json"}
74
- }
75
- }
76
- },
77
- {
78
- "if": {
79
- "properties": {
80
- "messageType": { "const": "models_install_response" }
81
- }
82
- },
83
- "then": {
84
- "properties": {
85
- "payload": {"$ref": "https://alwaysai.co/models-install-response-schema.json"}
86
- }
87
- }
88
- },
89
- {
90
- "if": {
91
- "properties": {
92
- "messageType": { "const": "live_state_updates" }
93
- }
94
- },
95
- "then": {
96
- "properties": {
97
- "payload": {"$ref": "https://alwaysai.co/live-updates-toggle-schema.json"}
98
- }
99
- }
100
- },
101
- {
102
- "if": {
103
- "properties": {
104
- "messageType": { "const": "device_action" }
105
- }
106
- },
107
- "then": {
108
- "properties": {
109
- "payload": {"$ref": "https://alwaysai.co/device-action-schema.json"}
110
- }
111
- }
112
- },
113
- {
114
- "if": {
115
- "properties": {
116
- "messageType": { "const": "status_response" }
117
- }
118
- },
119
- "then": {
120
- "properties": {
121
- "payload": {"$ref": "https://alwaysai.co/status-response-schema.json"}
122
- }
123
- }
124
- }
125
- ],
126
- "required": ["timestamp", "txId", "payload", "messageType"],
127
- "additionalProperties": false,
128
- "$defs": {
129
- "toDevice": {
130
- "description": "Topic on which messages are sent to device agent.",
131
- "type": "string",
132
- "pattern": "^to-device/aai-device/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
133
- }
134
- }
135
- }
@@ -1,177 +0,0 @@
1
- import Ajv2019 from 'ajv/dist/2019';
2
- import * as shadowProjectsUpdateAllSchema from './schemas/shadow-projects-update-all-schema.json';
3
- import * as shadowProjectUpdateSchema from './schemas/shadow-project-update-schema.json';
4
- import * as systemInformationSchema from './schemas/system-information-schema.json';
5
- import * as commonSchema from './schemas/common-schema.json';
6
-
7
- import { keyMirror } from './utils';
8
-
9
- const ajv = new Ajv2019({
10
- allErrors: true,
11
- schemas: [commonSchema]
12
- });
13
-
14
- /* ============================================================================
15
- Shadow Topics
16
- ============================================================================ */
17
-
18
- const SHADOW_PREFIX = `$aws/things/`;
19
-
20
- export const ShadowTopics = keyMirror({
21
- get: null,
22
- 'get/accepted': null,
23
- 'get/rejected': null,
24
- update: null,
25
- 'update/delta': null,
26
- 'update/accepted': null,
27
- 'update/rejected': null,
28
- delete: null,
29
- 'delete/accepted': null,
30
- 'delete/rejected': null
31
- });
32
- export type ShadowTopics = keyof typeof ShadowTopics;
33
- export const SHADOW_TOPICS = Object.keys(ShadowTopics) as ShadowTopics[];
34
-
35
- const ShadowNames = keyMirror({
36
- projects: null,
37
- 'system-info': null,
38
- 'secure-tunnel': null
39
- });
40
- export type ShadowNames = keyof typeof ShadowNames;
41
- export const SHADOW_NAMES = Object.keys(ShadowNames) as ShadowNames[];
42
-
43
- export const getShadowTopic = (
44
- clientId: string,
45
- shadowName: ShadowNames,
46
- shadowTopic: ShadowTopics
47
- ) => `${SHADOW_PREFIX}${clientId}/shadow/name/${shadowName}/${shadowTopic}`;
48
-
49
- /* ============================================================================
50
- Project Shadow
51
- ============================================================================ */
52
-
53
- export interface ProjectShadowUpdate {
54
- appConfig?: string;
55
- envVars?: {
56
- [service: string]: {
57
- [key: string]: string | null;
58
- };
59
- };
60
- }
61
-
62
- export interface ShadowProjectsUpdateAll {
63
- [projectId: string]: ProjectShadowUpdate | null;
64
- }
65
-
66
- // Shadow Message validator functions
67
- ajv.addSchema(shadowProjectUpdateSchema, 'shadow-project-update-schema.json');
68
- export const validateProjectShadowUpdate = ajv.compile<ProjectShadowUpdate>(
69
- shadowProjectUpdateSchema
70
- );
71
-
72
- ajv.addSchema(
73
- shadowProjectsUpdateAllSchema,
74
- 'shadow-projects-update-all-schema.json'
75
- );
76
- export const validateShadowProjectsUpdateAll =
77
- ajv.compile<ShadowProjectsUpdateAll>(shadowProjectsUpdateAllSchema);
78
-
79
- export function getDesiredFromMessage(message) {
80
- if (message?.state?.desired) {
81
- return message.state.desired;
82
- } else return null;
83
- }
84
-
85
- /* ============================================================================
86
- System Information Shadow
87
- ============================================================================ */
88
-
89
- export interface SystemInformationShadowUpdate {
90
- os?: {
91
- platform?: string;
92
- distro?: string;
93
- release?: string;
94
- kernel?: string;
95
- architecture?: string;
96
- hostname?: string;
97
- };
98
- cpu?: {
99
- manufacturer?: string;
100
- brand?: string;
101
- vendor?: string;
102
- model?: string;
103
- cores?: number;
104
- physicalCores?: number;
105
- efficiencyCores?: number;
106
- };
107
- disk?: {
108
- drives: {
109
- device?: string;
110
- type?: string;
111
- name?: string;
112
- vendor?: string;
113
- size?: number;
114
- }[];
115
- };
116
- device?: {
117
- manufacturer?: string;
118
- model?: string;
119
- version?: string;
120
- serial?: string;
121
- virtual?: boolean;
122
- };
123
- network?: {
124
- ipv4Address?: string;
125
- ipv6Address?: string;
126
- macAddress?: string;
127
- };
128
- versions?: {
129
- agent?: string;
130
- deviceAgentSchemas?: string;
131
- npm?: string;
132
- node?: string;
133
- docker?: string;
134
- dockerCompose?: string;
135
- };
136
- lastBootTime?: string;
137
- }
138
-
139
- ajv.addSchema(systemInformationSchema, 'system-information-schema.json');
140
- export const validateSystemInformationShadowUpdate =
141
- ajv.compile<SystemInformationShadowUpdate>(systemInformationSchema);
142
-
143
- /* ============================================================================
144
- Shadow Message Builders
145
- ============================================================================ */
146
-
147
- export function buildBaseShadowMessage(clientId: string) {
148
- const baseShadowMessage = {
149
- clientToken: clientId
150
- };
151
- return baseShadowMessage;
152
- }
153
-
154
- export function buildUpdateProjectShadowMessage({
155
- clientId,
156
- reported,
157
- desired
158
- }: {
159
- clientId: string;
160
- reported?: ShadowProjectsUpdateAll | SystemInformationShadowUpdate;
161
- desired?: ShadowProjectsUpdateAll;
162
- }) {
163
- const state = { reported, desired };
164
-
165
- const message = {
166
- ...buildBaseShadowMessage(clientId),
167
- state
168
- };
169
- return message;
170
- }
171
-
172
- export function buildUpdateSystemInfoShadowMessage(
173
- clientId: string,
174
- systemInfo: SystemInformationShadowUpdate
175
- ) {
176
- return buildUpdateProjectShadowMessage({ clientId, reported: systemInfo });
177
- }