@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.
- package/LICENSE +12 -0
- package/README.md +12 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -1
- package/lib/schemas/secure-tunnel-schema.json +30 -0
- package/lib/shadow-schema.d.ts +17 -1
- package/lib/shadow-schema.js +9 -1
- package/package.json +16 -6
- package/.eslintignore +0 -4
- package/.eslintrc +0 -14
- package/.node-version +0 -1
- package/bitbucket-pipelines.yml +0 -10
- package/development.md +0 -53
- package/docs/README.md +0 -107
- package/docs/agent-message-schema-defs-toclient.md +0 -25
- package/docs/agent-message-schema-defs-tocloud.md +0 -25
- package/docs/agent-message-schema-defs.md +0 -15
- package/docs/agent-message-schema-properties-deviceid.md +0 -15
- package/docs/agent-message-schema-properties-payload-oneof-app_install_status.md +0 -66
- package/docs/agent-message-schema-properties-payload-oneof-app_logs.md +0 -66
- package/docs/agent-message-schema-properties-payload-oneof-app_state.md +0 -66
- package/docs/agent-message-schema-properties-payload-oneof-device_stats.md +0 -66
- package/docs/agent-message-schema-properties-payload-oneof-signed_urls_request.md +0 -85
- package/docs/agent-message-schema-properties-payload.md +0 -27
- package/docs/agent-message-schema-properties-timestamp.md +0 -15
- package/docs/agent-message-schema-properties-topic-oneof-0.md +0 -25
- package/docs/agent-message-schema-properties-topic-oneof-1.md +0 -25
- package/docs/agent-message-schema-properties-topic.md +0 -21
- package/docs/agent-message-schema.md +0 -138
- package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-appinstallpayload-properties-appsignedurl.md +0 -15
- package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-appinstallpayload.md +0 -39
- package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-appreleasehash.md +0 -25
- package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-models_install_payload.md +0 -15
- package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse-properties-projectid.md +0 -25
- package/docs/app-install-cloud-response-schema-properties-appinstallcloudresponse.md +0 -116
- package/docs/app-install-cloud-response-schema-properties-messagetype.md +0 -23
- package/docs/app-install-cloud-response-schema.md +0 -66
- package/docs/app-install-response-schema-properties-appinstallresponse-properties-appinstallpayload-properties-appsignedurl.md +0 -15
- package/docs/app-install-response-schema-properties-appinstallresponse-properties-appinstallpayload.md +0 -39
- package/docs/app-install-response-schema-properties-appinstallresponse-properties-appreleasehash.md +0 -25
- package/docs/app-install-response-schema-properties-appinstallresponse-properties-models_install_payload.md +0 -15
- package/docs/app-install-response-schema-properties-appinstallresponse-properties-projectid.md +0 -25
- package/docs/app-install-response-schema-properties-appinstallresponse.md +0 -116
- package/docs/app-install-response-schema.md +0 -39
- package/docs/app-install-schema-properties-appreleasehash.md +0 -25
- package/docs/app-install-schema-properties-basecommand.md +0 -23
- package/docs/app-install-schema-properties-projectid.md +0 -25
- package/docs/app-install-schema.md +0 -105
- package/docs/app-install-status-schema-properties-appinstallstatus-properties-appreleasehash.md +0 -25
- package/docs/app-install-status-schema-properties-appinstallstatus-properties-message.md +0 -15
- package/docs/app-install-status-schema-properties-appinstallstatus-properties-status.md +0 -26
- package/docs/app-install-status-schema-properties-appinstallstatus.md +0 -98
- package/docs/app-install-status-schema-properties-messagetype.md +0 -23
- package/docs/app-install-status-schema.md +0 -66
- package/docs/app-logs-schema-properties-applogs-properties-logchunk.md +0 -15
- package/docs/app-logs-schema-properties-applogs-properties-projectid.md +0 -25
- package/docs/app-logs-schema-properties-applogs.md +0 -68
- package/docs/app-logs-schema-properties-logchunk.md +0 -15
- package/docs/app-logs-schema-properties-messagetype.md +0 -23
- package/docs/app-logs-schema-properties-projectid.md +0 -25
- package/docs/app-logs-schema.md +0 -68
- package/docs/app-state-control-schema-properties-appstatecontrol-properties-basecommand.md +0 -25
- package/docs/app-state-control-schema-properties-appstatecontrol-properties-projectid.md +0 -25
- package/docs/app-state-control-schema-properties-appstatecontrol.md +0 -78
- package/docs/app-state-control-schema-properties-basecommand.md +0 -25
- package/docs/app-state-control-schema-properties-messagetype.md +0 -23
- package/docs/app-state-control-schema-properties-projectid.md +0 -25
- package/docs/app-state-control-schema.md +0 -78
- package/docs/app-state-schema-properties-appstate-items-properties-appdetails-properties-projectid.md +0 -25
- package/docs/app-state-schema-properties-appstate-items-properties-appdetails-properties-version.md +0 -25
- package/docs/app-state-schema-properties-appstate-items-properties-appdetails.md +0 -78
- package/docs/app-state-schema-properties-appstate-items-properties-services-items-properties-name.md +0 -15
- package/docs/app-state-schema-properties-appstate-items-properties-services-items-properties-state.md +0 -25
- package/docs/app-state-schema-properties-appstate-items-properties-services-items.md +0 -68
- package/docs/app-state-schema-properties-appstate-items-properties-services.md +0 -15
- package/docs/app-state-schema-properties-appstate-items.md +0 -58
- package/docs/app-state-schema-properties-appstate.md +0 -15
- package/docs/app-state-schema-properties-messagetype.md +0 -23
- package/docs/app-state-schema.md +0 -39
- package/docs/app-uninstall-schema-properties-basecommand.md +0 -23
- package/docs/app-uninstall-schema-properties-projectid.md +0 -25
- package/docs/app-uninstall-schema.md +0 -76
- package/docs/app-version-control-schema-properties-appversioncontrol.md +0 -21
- package/docs/app-version-control-schema-properties-messagetype.md +0 -23
- package/docs/app-version-control-schema.md +0 -21
- package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-appinstallpayload-properties-appsignedurl.md +0 -15
- package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-appinstallpayload.md +0 -39
- package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-appreleasehash.md +0 -25
- package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-modelsinstallpayload.md +0 -15
- package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse-properties-projectid.md +0 -25
- package/docs/app_install_cloud_response_schema-properties-appinstallcloudresponse.md +0 -116
- package/docs/app_install_cloud_response_schema-properties-messagetype.md +0 -23
- package/docs/app_install_cloud_response_schema.md +0 -66
- package/docs/app_install_schema-properties-appreleasehash.md +0 -25
- package/docs/app_install_schema-properties-basecommand.md +0 -23
- package/docs/app_install_schema-properties-projectid.md +0 -25
- package/docs/app_install_schema.md +0 -105
- package/docs/app_state_control_schema-properties-appstatecontrol-properties-basecommand.md +0 -25
- package/docs/app_state_control_schema-properties-appstatecontrol-properties-projectid.md +0 -25
- package/docs/app_state_control_schema-properties-appstatecontrol.md +0 -78
- package/docs/app_state_control_schema-properties-messagetype.md +0 -23
- package/docs/app_state_control_schema.md +0 -66
- package/docs/app_uninstall_schema-properties-basecommand.md +0 -23
- package/docs/app_uninstall_schema-properties-projectid.md +0 -25
- package/docs/app_uninstall_schema.md +0 -76
- package/docs/app_version_control_schema-properties-appversioncontrol.md +0 -21
- package/docs/app_version_control_schema-properties-messagetype.md +0 -23
- package/docs/app_version_control_schema.md +0 -72
- package/docs/client-message-schema-defs-message.md +0 -25
- package/docs/client-message-schema-defs.md +0 -15
- package/docs/client-message-schema-properties-payload-oneof-live_state_updates.md +0 -66
- package/docs/client-message-schema-properties-payload-oneof-models_install_cloud_response.md +0 -66
- package/docs/client-message-schema-properties-payload.md +0 -27
- package/docs/client-message-schema-properties-timestamp.md +0 -15
- package/docs/client-message-schema-properties-topic.md +0 -25
- package/docs/client-message-schema.md +0 -112
- package/docs/client_message_schema-defs-message.md +0 -25
- package/docs/client_message_schema-defs.md +0 -15
- package/docs/client_message_schema-properties-payload-oneof-3.md +0 -66
- package/docs/client_message_schema-properties-payload-oneof-4.md +0 -66
- package/docs/client_message_schema-properties-payload.md +0 -27
- package/docs/client_message_schema-properties-timestamp.md +0 -15
- package/docs/client_message_schema-properties-topic.md +0 -25
- package/docs/client_message_schema.md +0 -112
- package/docs/common-schema-defs-appreleasehash.md +0 -25
- package/docs/common-schema-defs-modelid.md +0 -25
- package/docs/common-schema-defs-projectid.md +0 -25
- package/docs/common-schema-defs-txid.md +0 -29
- package/docs/common-schema-defs.md +0 -15
- package/docs/common-schema.md +0 -61
- package/docs/device-action-schema-properties-action.md +0 -23
- package/docs/device-action-schema.md +0 -47
- package/docs/device-stats-schema-properties-cpudetails-properties-temperature.md +0 -15
- package/docs/device-stats-schema-properties-cpudetails-properties-usedperc.md +0 -15
- package/docs/device-stats-schema-properties-cpudetails.md +0 -58
- package/docs/device-stats-schema-properties-cpuusage.md +0 -15
- package/docs/device-stats-schema-properties-diskdetails-properties-freegb.md +0 -15
- package/docs/device-stats-schema-properties-diskdetails-properties-usedgb.md +0 -15
- package/docs/device-stats-schema-properties-diskdetails.md +0 -58
- package/docs/device-stats-schema-properties-diskutil.md +0 -15
- package/docs/device-stats-schema-properties-memdetails-properties-freemb.md +0 -15
- package/docs/device-stats-schema-properties-memdetails-properties-usedmb.md +0 -15
- package/docs/device-stats-schema-properties-memdetails.md +0 -58
- package/docs/device-stats-schema-properties-usedmemorypercentage.md +0 -15
- package/docs/device-stats-schema.md +0 -134
- package/docs/device-status-schema-properties-devicestats-properties-cpuusage.md +0 -15
- package/docs/device-status-schema-properties-devicestats-properties-diskutil.md +0 -15
- package/docs/device-status-schema-properties-devicestats-properties-usedmemorypercentage.md +0 -15
- package/docs/device-status-schema-properties-devicestats.md +0 -77
- package/docs/device-status-schema-properties-messagetype.md +0 -23
- package/docs/device-status-schema.md +0 -66
- package/docs/live-updates-toggle-schema-properties-applogs-properties-toggle.md +0 -15
- package/docs/live-updates-toggle-schema-properties-applogs.md +0 -68
- package/docs/live-updates-toggle-schema-properties-appstate.md +0 -15
- package/docs/live-updates-toggle-schema-properties-devicestats.md +0 -15
- package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-applogs-properties-projectid.md +0 -25
- package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-applogs-properties-toggle.md +0 -15
- package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-applogs.md +0 -68
- package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-appstate.md +0 -15
- package/docs/live-updates-toggle-schema-properties-liveupdatestoggles-properties-devicestats.md +0 -15
- package/docs/live-updates-toggle-schema-properties-liveupdatestoggles.md +0 -77
- package/docs/live-updates-toggle-schema-properties-messagetype.md +0 -23
- package/docs/live-updates-toggle-schema.md +0 -77
- package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-applogs-properties-projectid.md +0 -25
- package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-applogs-properties-toggle.md +0 -15
- package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-applogs.md +0 -68
- package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-appstate.md +0 -15
- package/docs/live_updates_toggle_schema-properties-liveupdatestoggles-properties-devicestats.md +0 -15
- package/docs/live_updates_toggle_schema-properties-liveupdatestoggles.md +0 -77
- package/docs/live_updates_toggle_schema-properties-messagetype.md +0 -23
- package/docs/live_updates_toggle_schema.md +0 -66
- package/docs/models-install-cloud-response-schema-properties-messagetype.md +0 -23
- package/docs/models-install-cloud-response-schema-properties-modelsinstallcloudresponse-properties-projectid.md +0 -25
- package/docs/models-install-cloud-response-schema-properties-modelsinstallcloudresponse.md +0 -68
- package/docs/models-install-cloud-response-schema.md +0 -66
- package/docs/models-install-payload-schema-items-properties-id.md +0 -25
- package/docs/models-install-payload-schema-items-properties-modelsignedurl.md +0 -15
- package/docs/models-install-payload-schema-items-properties-version.md +0 -15
- package/docs/models-install-payload-schema-items.md +0 -87
- package/docs/models-install-payload-schema.md +0 -15
- package/docs/models-install-response-schema-properties-modelsinstallresponse.md +0 -68
- package/docs/models-install-response-schema.md +0 -39
- package/docs/models_install_cloud_response_schema-properties-messagetype.md +0 -23
- package/docs/models_install_cloud_response_schema-properties-modelsinstallcloudresponse-properties-projectid.md +0 -25
- package/docs/models_install_cloud_response_schema-properties-modelsinstallcloudresponse.md +0 -68
- package/docs/models_install_cloud_response_schema.md +0 -66
- package/docs/models_install_payload_schema-items-properties-id.md +0 -25
- package/docs/models_install_payload_schema-items-properties-modelsignedurl.md +0 -15
- package/docs/models_install_payload_schema-items-properties-version.md +0 -15
- package/docs/models_install_payload_schema-items.md +0 -87
- package/docs/models_install_payload_schema.md +0 -15
- package/docs/shadow-project-update-schema-properties-appconfig.md +0 -15
- package/docs/shadow-project-update-schema-properties-envvars-patternproperties--patternproperties-.md +0 -15
- package/docs/shadow-project-update-schema-properties-envvars-patternproperties--patternproperties.md +0 -15
- package/docs/shadow-project-update-schema-properties-envvars-patternproperties-.md +0 -39
- package/docs/shadow-project-update-schema-properties-envvars-patternproperties.md +0 -15
- package/docs/shadow-project-update-schema-properties-envvars.md +0 -44
- package/docs/shadow-project-update-schema.md +0 -63
- package/docs/shadow-projects-update-all-schema-patternproperties.md +0 -15
- package/docs/shadow-projects-update-all-schema-propertynames.md +0 -25
- package/docs/shadow-projects-update-all-schema.md +0 -44
- package/docs/signed-urls-request-schema-properties-messagetype.md +0 -23
- package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-models-patternproperties-a-za-z0-9_.md +0 -15
- package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-models-patternproperties.md +0 -15
- package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-models.md +0 -39
- package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest-properties-projectid.md +0 -25
- package/docs/signed-urls-request-schema-properties-modelsonlyurlsrequest.md +0 -68
- package/docs/signed-urls-request-schema-properties-signedurlsrequest-properties-appreleasehash.md +0 -25
- package/docs/signed-urls-request-schema-properties-signedurlsrequest-properties-projectid.md +0 -25
- package/docs/signed-urls-request-schema-properties-signedurlsrequest.md +0 -78
- package/docs/signed-urls-request-schema.md +0 -58
- package/docs/status-response-schema-properties-message.md +0 -15
- package/docs/status-response-schema-properties-status.md +0 -27
- package/docs/status-response-schema.md +0 -70
- package/docs/system-information-schema-properties-cpu-properties-brand.md +0 -15
- package/docs/system-information-schema-properties-cpu-properties-cores.md +0 -15
- package/docs/system-information-schema-properties-cpu-properties-efficiencycores.md +0 -15
- package/docs/system-information-schema-properties-cpu-properties-manufacturer.md +0 -15
- package/docs/system-information-schema-properties-cpu-properties-model.md +0 -15
- package/docs/system-information-schema-properties-cpu-properties-physicalcores.md +0 -15
- package/docs/system-information-schema-properties-cpu-properties-processors.md +0 -15
- package/docs/system-information-schema-properties-cpu-properties-vendor.md +0 -15
- package/docs/system-information-schema-properties-cpu.md +0 -172
- package/docs/system-information-schema-properties-device-properties-manufacturer.md +0 -15
- package/docs/system-information-schema-properties-device-properties-model.md +0 -15
- package/docs/system-information-schema-properties-device-properties-serial.md +0 -15
- package/docs/system-information-schema-properties-device-properties-version.md +0 -15
- package/docs/system-information-schema-properties-device-properties-virtual.md +0 -15
- package/docs/system-information-schema-properties-device.md +0 -115
- package/docs/system-information-schema-properties-disk-properties-drives-items-properties-device.md +0 -15
- package/docs/system-information-schema-properties-disk-properties-drives-items-properties-name.md +0 -15
- package/docs/system-information-schema-properties-disk-properties-drives-items-properties-size.md +0 -15
- package/docs/system-information-schema-properties-disk-properties-drives-items-properties-type.md +0 -15
- package/docs/system-information-schema-properties-disk-properties-drives-items-properties-vendor.md +0 -15
- package/docs/system-information-schema-properties-disk-properties-drives-items.md +0 -115
- package/docs/system-information-schema-properties-disk-properties-drives.md +0 -15
- package/docs/system-information-schema-properties-disk.md +0 -39
- package/docs/system-information-schema-properties-network-properties-ipv4address.md +0 -15
- package/docs/system-information-schema-properties-network-properties-ipv6address.md +0 -15
- package/docs/system-information-schema-properties-network-properties-macaddress.md +0 -15
- package/docs/system-information-schema-properties-network.md +0 -77
- package/docs/system-information-schema-properties-os-properties-architecture.md +0 -15
- package/docs/system-information-schema-properties-os-properties-distro.md +0 -15
- package/docs/system-information-schema-properties-os-properties-hostname.md +0 -15
- package/docs/system-information-schema-properties-os-properties-kernel.md +0 -15
- package/docs/system-information-schema-properties-os-properties-platform.md +0 -15
- package/docs/system-information-schema-properties-os-properties-release.md +0 -15
- package/docs/system-information-schema-properties-os.md +0 -134
- package/docs/system-information-schema-properties-versions-properties-agent.md +0 -15
- package/docs/system-information-schema-properties-versions-properties-deviceagentschemas.md +0 -15
- package/docs/system-information-schema-properties-versions.md +0 -58
- package/docs/system-information-schema.md +0 -134
- package/docs/to-client-message-schema-allof-0-if-properties-messagetype.md +0 -23
- package/docs/to-client-message-schema-allof-0-if-properties.md +0 -15
- package/docs/to-client-message-schema-allof-0-if.md +0 -47
- package/docs/to-client-message-schema-allof-0-then-properties.md +0 -15
- package/docs/to-client-message-schema-allof-0-then.md +0 -39
- package/docs/to-client-message-schema-allof-0.md +0 -15
- package/docs/to-client-message-schema-allof-1-if-properties-messagetype.md +0 -23
- package/docs/to-client-message-schema-allof-1-if-properties.md +0 -15
- package/docs/to-client-message-schema-allof-1-if.md +0 -47
- package/docs/to-client-message-schema-allof-1-then-properties.md +0 -15
- package/docs/to-client-message-schema-allof-1-then.md +0 -39
- package/docs/to-client-message-schema-allof-1.md +0 -15
- package/docs/to-client-message-schema-allof-2-if-properties-messagetype.md +0 -23
- package/docs/to-client-message-schema-allof-2-if-properties.md +0 -15
- package/docs/to-client-message-schema-allof-2-if.md +0 -47
- package/docs/to-client-message-schema-allof-2-then-properties.md +0 -15
- package/docs/to-client-message-schema-allof-2-then.md +0 -39
- package/docs/to-client-message-schema-allof-2.md +0 -15
- package/docs/to-client-message-schema-allof-3-if-properties-messagetype.md +0 -23
- package/docs/to-client-message-schema-allof-3-if-properties.md +0 -15
- package/docs/to-client-message-schema-allof-3-if.md +0 -47
- package/docs/to-client-message-schema-allof-3-then-properties.md +0 -15
- package/docs/to-client-message-schema-allof-3-then.md +0 -39
- package/docs/to-client-message-schema-allof-3.md +0 -15
- package/docs/to-client-message-schema-defs-toclient.md +0 -25
- package/docs/to-client-message-schema-defs.md +0 -15
- package/docs/to-client-message-schema-properties-deviceid.md +0 -15
- package/docs/to-client-message-schema-properties-messagetype.md +0 -26
- package/docs/to-client-message-schema-properties-payload.md +0 -25
- package/docs/to-client-message-schema-properties-timestamp.md +0 -15
- package/docs/to-client-message-schema-properties-topic-oneof-0.md +0 -25
- package/docs/to-client-message-schema-properties-topic.md +0 -19
- package/docs/to-client-message-schema.md +0 -196
- package/docs/to-cloud-message-schema-allof-0-if-properties-messagetype.md +0 -23
- package/docs/to-cloud-message-schema-allof-0-if-properties.md +0 -15
- package/docs/to-cloud-message-schema-allof-0-if.md +0 -47
- package/docs/to-cloud-message-schema-allof-0-then-properties.md +0 -15
- package/docs/to-cloud-message-schema-allof-0-then.md +0 -39
- package/docs/to-cloud-message-schema-allof-0.md +0 -15
- package/docs/to-cloud-message-schema-defs-tocloud.md +0 -25
- package/docs/to-cloud-message-schema-defs.md +0 -15
- package/docs/to-cloud-message-schema-properties-deviceid.md +0 -15
- package/docs/to-cloud-message-schema-properties-messagetype.md +0 -23
- package/docs/to-cloud-message-schema-properties-payload.md +0 -19
- package/docs/to-cloud-message-schema-properties-timestamp.md +0 -15
- package/docs/to-cloud-message-schema-properties-topic-oneof-0.md +0 -25
- package/docs/to-cloud-message-schema-properties-topic.md +0 -19
- package/docs/to-cloud-message-schema.md +0 -181
- package/docs/to-device-agent-message-schema-allof-0-if-properties-messagetype.md +0 -23
- package/docs/to-device-agent-message-schema-allof-0-if-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-0-if.md +0 -47
- package/docs/to-device-agent-message-schema-allof-0-then-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-0-then.md +0 -39
- package/docs/to-device-agent-message-schema-allof-0.md +0 -15
- package/docs/to-device-agent-message-schema-allof-1-if-properties-messagetype.md +0 -23
- package/docs/to-device-agent-message-schema-allof-1-if-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-1-if.md +0 -47
- package/docs/to-device-agent-message-schema-allof-1-then-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-1-then.md +0 -45
- package/docs/to-device-agent-message-schema-allof-1.md +0 -15
- package/docs/to-device-agent-message-schema-allof-2-if-properties-messagetype.md +0 -23
- package/docs/to-device-agent-message-schema-allof-2-if-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-2-if.md +0 -47
- package/docs/to-device-agent-message-schema-allof-2-then-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-2-then.md +0 -39
- package/docs/to-device-agent-message-schema-allof-2.md +0 -15
- package/docs/to-device-agent-message-schema-allof-3-if-properties-messagetype.md +0 -23
- package/docs/to-device-agent-message-schema-allof-3-if-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-3-if.md +0 -47
- package/docs/to-device-agent-message-schema-allof-3-then-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-3-then.md +0 -39
- package/docs/to-device-agent-message-schema-allof-3.md +0 -15
- package/docs/to-device-agent-message-schema-allof-4-if-properties-messagetype.md +0 -23
- package/docs/to-device-agent-message-schema-allof-4-if-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-4-if.md +0 -47
- package/docs/to-device-agent-message-schema-allof-4-then-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-4-then.md +0 -39
- package/docs/to-device-agent-message-schema-allof-4.md +0 -15
- package/docs/to-device-agent-message-schema-allof-5-if-properties-messagetype.md +0 -23
- package/docs/to-device-agent-message-schema-allof-5-if-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-5-if.md +0 -47
- package/docs/to-device-agent-message-schema-allof-5-then-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-5-then.md +0 -39
- package/docs/to-device-agent-message-schema-allof-5.md +0 -15
- package/docs/to-device-agent-message-schema-allof-6-if-properties-messagetype.md +0 -23
- package/docs/to-device-agent-message-schema-allof-6-if-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-6-if.md +0 -47
- package/docs/to-device-agent-message-schema-allof-6-then-properties.md +0 -15
- package/docs/to-device-agent-message-schema-allof-6-then.md +0 -39
- package/docs/to-device-agent-message-schema-allof-6.md +0 -15
- package/docs/to-device-agent-message-schema-defs-todevice.md +0 -25
- package/docs/to-device-agent-message-schema-defs.md +0 -15
- package/docs/to-device-agent-message-schema-properties-messagetype.md +0 -29
- package/docs/to-device-agent-message-schema-properties-payload.md +0 -35
- package/docs/to-device-agent-message-schema-properties-timestamp.md +0 -15
- package/docs/to-device-agent-message-schema-properties-topic.md +0 -25
- package/docs/to-device-agent-message-schema.md +0 -202
- package/jest.config.js +0 -3
- package/lib/app-action-schema.d.ts.map +0 -1
- package/lib/app-action-schema.js.map +0 -1
- package/lib/app-logs-schema.d.ts.map +0 -1
- package/lib/app-logs-schema.js.map +0 -1
- package/lib/app-state-schema.d.ts.map +0 -1
- package/lib/app-state-schema.js.map +0 -1
- package/lib/constants.d.ts.map +0 -1
- package/lib/constants.js.map +0 -1
- package/lib/device-action-schema.d.ts.map +0 -1
- package/lib/device-action-schema.js.map +0 -1
- package/lib/device-agent-action-schema.d.ts.map +0 -1
- package/lib/device-agent-action-schema.js.map +0 -1
- package/lib/device-stats-schema.d.ts.map +0 -1
- package/lib/device-stats-schema.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/message-builders.d.ts.map +0 -1
- package/lib/message-builders.js.map +0 -1
- package/lib/shadow-schema.d.ts.map +0 -1
- package/lib/shadow-schema.js.map +0 -1
- package/lib/signed-urls-request-schema.d.ts.map +0 -1
- package/lib/signed-urls-request-schema.js.map +0 -1
- package/lib/status-response-schema.d.ts.map +0 -1
- package/lib/status-response-schema.js.map +0 -1
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/src/app-action-schema.ts +0 -71
- package/src/app-logs-schema.ts +0 -13
- package/src/app-state-schema.ts +0 -27
- package/src/constants.ts +0 -140
- package/src/device-action-schema.ts +0 -11
- package/src/device-agent-action-schema.ts +0 -17
- package/src/device-stats-schema.ts +0 -33
- package/src/index.ts +0 -182
- package/src/message-builders.ts +0 -263
- package/src/schemas/app-install-response-schema.json +0 -41
- package/src/schemas/app-install-schema.json +0 -20
- package/src/schemas/app-logs-schema.json +0 -16
- package/src/schemas/app-state-control-schema.json +0 -17
- package/src/schemas/app-state-schema.json +0 -49
- package/src/schemas/app-uninstall-schema.json +0 -17
- package/src/schemas/app-version-control-schema.json +0 -14
- package/src/schemas/common-schema.json +0 -27
- package/src/schemas/device-action-schema.json +0 -14
- package/src/schemas/device-stats-schema.json +0 -58
- package/src/schemas/live-updates-toggle-schema.json +0 -29
- package/src/schemas/models-install-payload-schema.json +0 -22
- package/src/schemas/models-install-response-schema.json +0 -23
- package/src/schemas/shadow-project-update-schema.json +0 -30
- package/src/schemas/shadow-projects-update-all-schema.json +0 -17
- package/src/schemas/signed-urls-request-schema.json +0 -42
- package/src/schemas/status-response-schema.json +0 -16
- package/src/schemas/system-information-schema.json +0 -155
- package/src/schemas/to-client-message-schema.json +0 -98
- package/src/schemas/to-cloud-message-schema.json +0 -56
- package/src/schemas/to-device-agent-message-schema.json +0 -135
- package/src/shadow-schema.ts +0 -177
- package/src/signed-urls-request-schema.ts +0 -22
- package/src/status-response-schema.ts +0 -18
- package/src/types.ts +0 -175
- package/src/utils.ts +0 -21
- package/tests/constants.test.ts +0 -41
- package/tests/shadow-schema.test.ts +0 -171
- package/tests/types.test.ts +0 -515
- package/tsconfig.build.json +0 -4
- package/tsconfig.eslint.json +0 -5
- 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
|
-
}
|
package/src/shadow-schema.ts
DELETED
|
@@ -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
|
-
}
|