@alwaysai/device-agent 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/application-control/config.d.ts.map +1 -1
- package/lib/application-control/config.js +8 -3
- package/lib/application-control/config.js.map +1 -1
- package/lib/application-control/environment-variables.d.ts +1 -5
- package/lib/application-control/environment-variables.d.ts.map +1 -1
- package/lib/application-control/environment-variables.js +9 -26
- package/lib/application-control/environment-variables.js.map +1 -1
- package/lib/application-control/environment-variables.test.js +27 -7
- package/lib/application-control/environment-variables.test.js.map +1 -1
- package/lib/application-control/index.d.ts +4 -4
- package/lib/application-control/index.d.ts.map +1 -1
- package/lib/application-control/index.js +1 -4
- package/lib/application-control/index.js.map +1 -1
- package/lib/application-control/install.d.ts.map +1 -1
- package/lib/application-control/install.js +8 -7
- package/lib/application-control/install.js.map +1 -1
- package/lib/application-control/models.d.ts +0 -11
- package/lib/application-control/models.d.ts.map +1 -1
- package/lib/application-control/models.js +5 -54
- package/lib/application-control/models.js.map +1 -1
- package/lib/application-control/utils.d.ts +0 -4
- package/lib/application-control/utils.d.ts.map +1 -1
- package/lib/application-control/utils.js +1 -24
- package/lib/application-control/utils.js.map +1 -1
- package/lib/cloud-connection/bootstrap-provision.js +3 -2
- package/lib/cloud-connection/bootstrap-provision.js.map +1 -1
- package/lib/cloud-connection/device-agent-cloud-connection.d.ts +10 -15
- package/lib/cloud-connection/device-agent-cloud-connection.d.ts.map +1 -1
- package/lib/cloud-connection/device-agent-cloud-connection.js +279 -250
- package/lib/cloud-connection/device-agent-cloud-connection.js.map +1 -1
- package/lib/cloud-connection/device-agent.d.ts.map +1 -1
- package/lib/cloud-connection/device-agent.js +11 -9
- package/lib/cloud-connection/device-agent.js.map +1 -1
- package/lib/cloud-connection/live-updates-handler.d.ts +18 -28
- package/lib/cloud-connection/live-updates-handler.d.ts.map +1 -1
- package/lib/cloud-connection/live-updates-handler.js +54 -169
- package/lib/cloud-connection/live-updates-handler.js.map +1 -1
- package/lib/cloud-connection/live-updates-handler.test.js +71 -165
- package/lib/cloud-connection/live-updates-handler.test.js.map +1 -1
- package/lib/cloud-connection/passthrough-handler.d.ts +4 -1
- package/lib/cloud-connection/passthrough-handler.d.ts.map +1 -1
- package/lib/cloud-connection/passthrough-handler.js +30 -11
- package/lib/cloud-connection/passthrough-handler.js.map +1 -1
- package/lib/cloud-connection/shadow-handler.d.ts +5 -3
- package/lib/cloud-connection/shadow-handler.d.ts.map +1 -1
- package/lib/cloud-connection/shadow-handler.js +59 -27
- package/lib/cloud-connection/shadow-handler.js.map +1 -1
- package/lib/cloud-connection/shadow-handler.test.js +45 -57
- package/lib/cloud-connection/shadow-handler.test.js.map +1 -1
- package/lib/cloud-connection/shadow.d.ts.map +1 -1
- package/lib/cloud-connection/shadow.js +2 -1
- package/lib/cloud-connection/shadow.js.map +1 -1
- package/lib/cloud-connection/transaction-manager.d.ts +4 -2
- package/lib/cloud-connection/transaction-manager.d.ts.map +1 -1
- package/lib/cloud-connection/transaction-manager.js +18 -29
- package/lib/cloud-connection/transaction-manager.js.map +1 -1
- package/lib/cloud-connection/transaction-manager.test.js +3 -3
- package/lib/cloud-connection/transaction-manager.test.js.map +1 -1
- package/lib/device-control/device-control.d.ts +8 -8
- package/lib/device-control/device-control.d.ts.map +1 -1
- package/lib/device-control/device-control.js +95 -71
- package/lib/device-control/device-control.js.map +1 -1
- package/lib/docker/docker-compose.d.ts.map +1 -1
- package/lib/docker/docker-compose.js +2 -1
- package/lib/docker/docker-compose.js.map +1 -1
- package/lib/infrastructure/agent-config.d.ts +2 -1
- package/lib/infrastructure/agent-config.d.ts.map +1 -1
- package/lib/infrastructure/agent-config.js +7 -7
- package/lib/infrastructure/agent-config.js.map +1 -1
- package/lib/infrastructure/agent-config.test.js +3 -1
- package/lib/infrastructure/agent-config.test.js.map +1 -1
- package/lib/infrastructure/config-check-utility.d.ts +6 -0
- package/lib/infrastructure/config-check-utility.d.ts.map +1 -0
- package/lib/infrastructure/config-check-utility.js +67 -0
- package/lib/infrastructure/config-check-utility.js.map +1 -0
- package/lib/infrastructure/config-check-utility.test.d.ts +2 -0
- package/lib/infrastructure/config-check-utility.test.d.ts.map +1 -0
- package/lib/infrastructure/config-check-utility.test.js +109 -0
- package/lib/infrastructure/config-check-utility.test.js.map +1 -0
- package/lib/infrastructure/device-certificate.d.ts +10 -0
- package/lib/infrastructure/device-certificate.d.ts.map +1 -0
- package/lib/infrastructure/device-certificate.js +47 -0
- package/lib/infrastructure/device-certificate.js.map +1 -0
- package/lib/infrastructure/device-certificate.test.d.ts +2 -0
- package/lib/infrastructure/device-certificate.test.d.ts.map +1 -0
- package/lib/infrastructure/device-certificate.test.js +24 -0
- package/lib/infrastructure/device-certificate.test.js.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-file.test.d.ts +2 -0
- package/lib/infrastructure/legacy-migration/legacy-file.test.d.ts.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-file.test.js +61 -0
- package/lib/infrastructure/legacy-migration/legacy-file.test.js.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-files.d.ts +75 -0
- package/lib/infrastructure/legacy-migration/legacy-files.d.ts.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-files.js +75 -0
- package/lib/infrastructure/legacy-migration/legacy-files.js.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.d.ts +6 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.d.ts.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.js +149 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.js.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.test.d.ts +2 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.test.d.ts.map +1 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.test.js +226 -0
- package/lib/infrastructure/legacy-migration/legacy-migration.test.js.map +1 -0
- package/lib/infrastructure/require-files-present-ready.test.d.ts +2 -0
- package/lib/infrastructure/require-files-present-ready.test.d.ts.map +1 -0
- package/lib/infrastructure/require-files-present-ready.test.js +44 -0
- package/lib/infrastructure/require-files-present-ready.test.js.map +1 -0
- package/lib/infrastructure/required-config-checks.d.ts +2 -0
- package/lib/infrastructure/required-config-checks.d.ts.map +1 -0
- package/lib/infrastructure/required-config-checks.js +30 -0
- package/lib/infrastructure/required-config-checks.js.map +1 -0
- package/lib/infrastructure/tokens-and-device-cfg.d.ts.map +1 -1
- package/lib/infrastructure/tokens-and-device-cfg.js +11 -8
- package/lib/infrastructure/tokens-and-device-cfg.js.map +1 -1
- package/lib/local-connection/rabbitmq-connection.d.ts.map +1 -1
- package/lib/local-connection/rabbitmq-connection.js +14 -14
- package/lib/local-connection/rabbitmq-connection.js.map +1 -1
- package/lib/secure-tunneling/secure-tunneling.d.ts +9 -9
- package/lib/secure-tunneling/secure-tunneling.d.ts.map +1 -1
- package/lib/secure-tunneling/secure-tunneling.js +21 -16
- package/lib/secure-tunneling/secure-tunneling.js.map +1 -1
- package/lib/secure-tunneling/secure-tunneling.test.js +11 -13
- package/lib/secure-tunneling/secure-tunneling.test.js.map +1 -1
- package/lib/subcommands/app/analytics.d.ts.map +1 -1
- package/lib/subcommands/app/analytics.js +1 -2
- package/lib/subcommands/app/analytics.js.map +1 -1
- package/lib/subcommands/app/env-vars.d.ts +4 -0
- package/lib/subcommands/app/env-vars.d.ts.map +1 -1
- package/lib/subcommands/app/env-vars.js +52 -6
- package/lib/subcommands/app/env-vars.js.map +1 -1
- package/lib/subcommands/app/index.d.ts.map +1 -1
- package/lib/subcommands/app/index.js +1 -3
- package/lib/subcommands/app/index.js.map +1 -1
- package/lib/subcommands/app/models.d.ts +0 -11
- package/lib/subcommands/app/models.d.ts.map +1 -1
- package/lib/subcommands/app/models.js +2 -58
- package/lib/subcommands/app/models.js.map +1 -1
- package/lib/subcommands/app/shadow.d.ts.map +1 -1
- package/lib/subcommands/app/shadow.js +6 -5
- package/lib/subcommands/app/shadow.js.map +1 -1
- package/lib/subcommands/app/version.d.ts.map +1 -1
- package/lib/subcommands/app/version.js +2 -4
- package/lib/subcommands/app/version.js.map +1 -1
- package/lib/subcommands/config.d.ts +2 -0
- package/lib/subcommands/config.d.ts.map +1 -0
- package/lib/subcommands/config.js +39 -0
- package/lib/subcommands/config.js.map +1 -0
- package/lib/subcommands/device/clean.d.ts +1 -1
- package/lib/subcommands/device/clean.d.ts.map +1 -1
- package/lib/subcommands/device/clean.js +23 -13
- package/lib/subcommands/device/clean.js.map +1 -1
- package/lib/subcommands/device/index.d.ts.map +1 -1
- package/lib/subcommands/device/index.js +3 -1
- package/lib/subcommands/device/index.js.map +1 -1
- package/lib/subcommands/device/init.js +8 -8
- package/lib/subcommands/device/init.js.map +1 -1
- package/lib/subcommands/device/migrate.d.ts +2 -0
- package/lib/subcommands/device/migrate.d.ts.map +1 -0
- package/lib/subcommands/device/migrate.js +24 -0
- package/lib/subcommands/device/migrate.js.map +1 -0
- package/lib/subcommands/device/refresh.d.ts.map +1 -1
- package/lib/subcommands/device/refresh.js +1 -0
- package/lib/subcommands/device/refresh.js.map +1 -1
- package/lib/subcommands/index.d.ts +1 -1
- package/lib/subcommands/index.d.ts.map +1 -1
- package/lib/subcommands/index.js +3 -1
- package/lib/subcommands/index.js.map +1 -1
- package/lib/subcommands/rabbitmq-connection.d.ts +1 -1
- package/lib/subcommands/rabbitmq-connection.d.ts.map +1 -1
- package/lib/util/aai-error.d.ts +12 -0
- package/lib/util/aai-error.d.ts.map +1 -0
- package/lib/util/aai-error.js +11 -0
- package/lib/util/aai-error.js.map +1 -0
- package/lib/util/aws-regions.d.ts +2 -0
- package/lib/util/aws-regions.d.ts.map +1 -0
- package/lib/util/{cloud-mode-ready.js → aws-regions.js} +2 -20
- package/lib/util/aws-regions.js.map +1 -0
- package/lib/util/check-for-updates.d.ts.map +1 -1
- package/lib/util/check-for-updates.js +5 -28
- package/lib/util/check-for-updates.js.map +1 -1
- package/lib/util/clean-certs.d.ts.map +1 -1
- package/lib/util/clean-certs.js +5 -4
- package/lib/util/clean-certs.js.map +1 -1
- package/lib/util/directories.d.ts +4 -18
- package/lib/util/directories.d.ts.map +1 -1
- package/lib/util/directories.js +18 -32
- package/lib/util/directories.js.map +1 -1
- package/lib/util/file.d.ts +4 -0
- package/lib/util/file.d.ts.map +1 -1
- package/lib/util/file.js +65 -4
- package/lib/util/file.js.map +1 -1
- package/lib/util/get-device-id.d.ts.map +1 -1
- package/lib/util/get-device-id.js +7 -1
- package/lib/util/get-device-id.js.map +1 -1
- package/lib/util/http-client.js +3 -3
- package/lib/util/http-client.js.map +1 -1
- package/package.json +19 -17
- package/readme.md +12 -32
- package/src/application-control/config.ts +9 -12
- package/src/application-control/environment-variables.test.ts +28 -7
- package/src/application-control/environment-variables.ts +13 -40
- package/src/application-control/index.ts +3 -16
- package/src/application-control/install.ts +15 -10
- package/src/application-control/models.ts +6 -87
- package/src/application-control/utils.ts +0 -28
- package/src/cloud-connection/bootstrap-provision.ts +7 -7
- package/src/cloud-connection/device-agent-cloud-connection.ts +639 -525
- package/src/cloud-connection/device-agent.ts +16 -7
- package/src/cloud-connection/live-updates-handler.test.ts +121 -189
- package/src/cloud-connection/live-updates-handler.ts +99 -234
- package/src/cloud-connection/passthrough-handler.ts +55 -18
- package/src/cloud-connection/shadow-handler.test.ts +45 -57
- package/src/cloud-connection/shadow-handler.ts +103 -57
- package/src/cloud-connection/shadow.ts +4 -1
- package/src/cloud-connection/transaction-manager.test.ts +3 -3
- package/src/cloud-connection/transaction-manager.ts +53 -39
- package/src/device-control/device-control.ts +102 -70
- package/src/docker/docker-compose.ts +3 -2
- package/src/infrastructure/agent-config.test.ts +6 -2
- package/src/infrastructure/agent-config.ts +8 -7
- package/src/infrastructure/config-check-utility.test.ts +154 -0
- package/src/infrastructure/config-check-utility.ts +77 -0
- package/src/infrastructure/device-certificate.test.ts +40 -0
- package/src/infrastructure/device-certificate.ts +58 -0
- package/src/infrastructure/legacy-migration/legacy-file.test.ts +88 -0
- package/src/infrastructure/legacy-migration/legacy-files.ts +101 -0
- package/src/infrastructure/legacy-migration/legacy-migration.test.ts +396 -0
- package/src/infrastructure/legacy-migration/legacy-migration.ts +229 -0
- package/src/infrastructure/require-files-present-ready.test.ts +53 -0
- package/src/infrastructure/required-config-checks.ts +33 -0
- package/src/infrastructure/tokens-and-device-cfg.ts +12 -10
- package/src/local-connection/rabbitmq-connection.ts +22 -17
- package/src/secure-tunneling/secure-tunneling.test.ts +20 -22
- package/src/secure-tunneling/secure-tunneling.ts +41 -29
- package/src/subcommands/app/analytics.ts +2 -4
- package/src/subcommands/app/env-vars.ts +72 -9
- package/src/subcommands/app/index.ts +3 -11
- package/src/subcommands/app/models.ts +5 -81
- package/src/subcommands/app/shadow.ts +6 -5
- package/src/subcommands/app/version.ts +3 -4
- package/src/subcommands/config.ts +42 -0
- package/src/subcommands/device/clean.ts +31 -17
- package/src/subcommands/device/index.ts +3 -1
- package/src/subcommands/device/init.ts +11 -11
- package/src/subcommands/device/migrate.ts +20 -0
- package/src/subcommands/device/refresh.ts +1 -0
- package/src/subcommands/index.ts +3 -1
- package/src/util/aai-error.ts +20 -0
- package/src/util/{cloud-mode-ready.ts → aws-regions.ts} +0 -24
- package/src/util/check-for-updates.ts +14 -30
- package/src/util/clean-certs.ts +8 -4
- package/src/util/directories.ts +23 -67
- package/src/util/file.ts +83 -3
- package/src/util/get-device-id.ts +7 -7
- package/src/util/http-client.ts +2 -2
- package/lib/util/cloud-mode-ready.d.ts +0 -3
- package/lib/util/cloud-mode-ready.d.ts.map +0 -1
- package/lib/util/cloud-mode-ready.js.map +0 -1
- package/lib/util/download-file.d.ts +0 -6
- package/lib/util/download-file.d.ts.map +0 -1
- package/lib/util/download-file.js +0 -25
- package/lib/util/download-file.js.map +0 -1
- package/lib/util/fetch-with-timeout.d.ts +0 -4
- package/lib/util/fetch-with-timeout.d.ts.map +0 -1
- package/lib/util/fetch-with-timeout.js +0 -30
- package/lib/util/fetch-with-timeout.js.map +0 -1
- package/lib/util/parsing.d.ts +0 -2
- package/lib/util/parsing.d.ts.map +0 -1
- package/lib/util/parsing.js +0 -17
- package/lib/util/parsing.js.map +0 -1
- package/src/util/download-file.ts +0 -25
- package/src/util/fetch-with-timeout.ts +0 -35
- package/src/util/parsing.ts +0 -11
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildApp = exports.requireAppReady = exports.requireAppInstalled = exports.getAppDir = void 0;
|
|
4
4
|
const docker_compose_1 = require("../docker/docker-compose");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const fs = require("fs");
|
|
7
6
|
const agent_config_1 = require("../infrastructure/agent-config");
|
|
8
|
-
const fetch_with_timeout_1 = require("../util/fetch-with-timeout");
|
|
9
7
|
const app_1 = require("alwaysai/lib/core/app");
|
|
10
8
|
const run_in_dir_1 = require("../util/run-in-dir");
|
|
11
9
|
const logger_1 = require("../util/logger");
|
|
@@ -64,25 +62,4 @@ async function buildApp(props) {
|
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
64
|
exports.buildApp = buildApp;
|
|
67
|
-
async function downloadPackageUsingPresignedUrl(props) {
|
|
68
|
-
const { localDest, presignedUrl } = props;
|
|
69
|
-
logger_1.logger.debug(`Downloading package from ${presignedUrl}`);
|
|
70
|
-
let response;
|
|
71
|
-
try {
|
|
72
|
-
response = await (0, fetch_with_timeout_1.fetchWithTimeout)(presignedUrl);
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
const errorBody = e.type === 'aborted' ? e : await e.response.text();
|
|
76
|
-
throw new Error(`downloadPackageUsingPresignedUrl: Error=${e}\n${errorBody}`);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Write the app package to the hash directory
|
|
80
|
-
*/
|
|
81
|
-
const stream = response.body.pipe(fs.createWriteStream(localDest));
|
|
82
|
-
await new Promise((resolve, reject) => {
|
|
83
|
-
stream.on('finish', resolve);
|
|
84
|
-
stream.on('error', reject);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
exports.downloadPackageUsingPresignedUrl = downloadPackageUsingPresignedUrl;
|
|
88
65
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/application-control/utils.ts"],"names":[],"mappings":";;;AAAA,6DAAmD;AACnD,6BAA6B;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/application-control/utils.ts"],"names":[],"mappings":";;;AAAA,6DAAmD;AACnD,6BAA6B;AAE7B,iEAAiE;AACjE,+CAM+B;AAC/B,mDAA8C;AAC9C,2CAAwC;AACxC,qDAA+C;AAC/C,uDAAsD;AACtD,8CAAgF;AAEhF,SAAgB,SAAS,CAAC,SAAiB;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,sBAAQ,EAAE,SAAS,CAAC,CAAC;AACxC,CAAC;AAFD,8BAEC;AAEM,KAAK,UAAU,mBAAmB,CAAC,KAA4B;IACpE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,mEAAmE;IACnE,IAAI,CAAC,CAAC,MAAM,IAAA,8BAAe,GAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE;QAC1D,MAAM,IAAI,KAAK,CAAC,eAAe,SAAS,mBAAmB,CAAC,CAAC;KAC9D;AACH,CAAC;AAND,kDAMC;AAEM,KAAK,UAAU,eAAe,CAAC,KAA4B;IAChE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,MAAM,mBAAmB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;IACzC,IAAI,CAAC,CAAC,MAAM,IAAA,8BAAe,GAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE;QACxD,MAAM,IAAI,KAAK,CACb,eAAe,SAAS,qCAAqC,CAC9D,CAAC;KACH;AACH,CAAC;AARD,0CAQC;AAEM,KAAK,UAAU,QAAQ,CAAC,KAAyB;IACtD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,eAAM,CAAC,KAAK,CAAC,gBAAgB,MAAM,EAAE,CAAC,CAAC;IAEvC,4CAA4C;IAC5C,MAAM,cAAc,GAAG,IAAA,oBAAc,EAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC;IACxC,IAAI,SAAS,CAAC,cAAc,KAAK,SAAS,EAAE;QAC1C,MAAM,IAAI,KAAK,CAAC,GAAG,6BAAqB,8BAA8B,CAAC,CAAC;KACzE;IACD,MAAM,IAAA,qBAAQ,EACZ,KAAK,IAAI,EAAE;QACT,MAAM,IAAA,+BAAyB,GAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAA,mBAAS,GAAE,CAAC;QAC5B,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,CAAC;QAChD,IAAI,MAAM,OAAO,CAAC,MAAM,CAAC,2BAAmB,CAAC,EAAE;YAC7C,MAAM,IAAA,iCAA2B,EAAC;gBAChC,cAAc;aACf,CAAC,CAAC;SACJ;aAAM;YACL,MAAM,IAAA,4BAAsB,EAAC;gBAC3B,OAAO,EAAE,IAAA,mBAAS,GAAE;gBACpB,GAAG,EAAE,MAAM,IAAA,+BAAyB,EAAC,EAAE,cAAc,EAAE,CAAC;aACzD,CAAC,CAAC;SACJ;IACH,CAAC,EACD,EAAE,EACF,MAAM,CACP,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,wBAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACzD,eAAM,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3E,IAAI,QAAQ,CAAC,QAAQ,KAAK,CAAC,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,uCAAuC,QAAQ,CAAC,GAAG,WAAW,QAAQ,CAAC,GAAG,EAAE,CAC7E,CAAC;KACH;AACH,CAAC;AArCD,4BAqCC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bootstrapProvision = void 0;
|
|
4
|
+
const device_certificate_1 = require("../infrastructure/device-certificate");
|
|
4
5
|
const urls_1 = require("../infrastructure/urls");
|
|
5
6
|
const clean_certs_1 = require("../util/clean-certs");
|
|
6
7
|
const directories_1 = require("../util/directories");
|
|
@@ -11,8 +12,8 @@ async function bootstrapProvision() {
|
|
|
11
12
|
setTimeout(clean_certs_1.rmBootstrapCertsAndClose, 60000);
|
|
12
13
|
const clientId = (0, get_device_id_1.getDeviceUuid)();
|
|
13
14
|
const bootstrapConfig = {
|
|
14
|
-
keyPath: (0,
|
|
15
|
-
certPath: (0,
|
|
15
|
+
keyPath: (0, device_certificate_1.getBootstrapPrivateKeyFilePath)(),
|
|
16
|
+
certPath: (0, device_certificate_1.getBootstrapCertificateFilePath)(),
|
|
16
17
|
caPath: directories_1.AWS_ROOT_CERTIFICATE_FILE_PATH,
|
|
17
18
|
clientId,
|
|
18
19
|
host: (0, urls_1.getIoTCoreEndpointUrl)()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-provision.js","sourceRoot":"","sources":["../../src/cloud-connection/bootstrap-provision.ts"],"names":[],"mappings":";;;AAAA,iDAA+D;AAC/D,qDAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"bootstrap-provision.js","sourceRoot":"","sources":["../../src/cloud-connection/bootstrap-provision.ts"],"names":[],"mappings":";;;AAAA,6EAG8C;AAC9C,iDAA+D;AAC/D,qDAA+D;AAC/D,qDAAqE;AACrE,yDAAsD;AACtD,2CAAwC;AACxC,iDAAgD;AAEzC,KAAK,UAAU,kBAAkB;IACtC,UAAU,CAAC,sCAAwB,EAAE,KAAK,CAAC,CAAC;IAE5C,MAAM,QAAQ,GAAG,IAAA,6BAAa,GAAE,CAAC;IACjC,MAAM,eAAe,GAAG;QACtB,OAAO,EAAE,IAAA,mDAA8B,GAAE;QACzC,QAAQ,EAAE,IAAA,oDAA+B,GAAE;QAC3C,MAAM,EAAE,4CAA8B;QACtC,QAAQ;QACR,IAAI,EAAE,IAAA,4BAAqB,GAAE;KAC9B,CAAC;IAEF,MAAM,cAAc,GAAG,IAAI,6BAAc,CAAC,eAAe,CAAC,CAAC;IAC3D,MAAM,cAAc,CAAC,oBAAoB,EAAE,CAAC;IAE5C,cAAc,CAAC,cAAc,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC;IAEnE,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACvC,eAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,cAAc,CAAC,MAAM,CAAC,EAAE,CACtB,SAAS,EACT,KAAK,EAAE,KAAa,EAAE,OAAe,EAAE,EAAE;QACvC,MAAM,cAAc,CAAC,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC,CACF,CAAC;IAEF,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,MAAW,EAAE,EAAE;QACrD,eAAM,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC;AA/BD,gDA+BC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ToDeviceAgentMessage } from '@alwaysai/device-agent-schemas';
|
|
2
1
|
import { Publisher } from './publisher';
|
|
2
|
+
import { ShadowHandler } from './shadow-handler';
|
|
3
3
|
export declare class DeviceAgentCloudConnection {
|
|
4
|
-
|
|
4
|
+
shadowHandler: ShadowHandler;
|
|
5
5
|
publisher: Publisher;
|
|
6
6
|
private liveUpdatesHandler;
|
|
7
7
|
private txnMgr;
|
|
@@ -12,6 +12,14 @@ export declare class DeviceAgentCloudConnection {
|
|
|
12
12
|
private readonly toDeviceTopic;
|
|
13
13
|
private readonly secureTunnelNotifyTopic;
|
|
14
14
|
private readonly secureTunnelHandler;
|
|
15
|
+
constructor();
|
|
16
|
+
getClientId(): string;
|
|
17
|
+
isCmdInProgress(projectId: string): boolean;
|
|
18
|
+
handleMessage(topic: string, message: any): Promise<void>;
|
|
19
|
+
stop(): Promise<void>;
|
|
20
|
+
private setupHandlers;
|
|
21
|
+
private logConnectionInfo;
|
|
22
|
+
private handleDeviceAgentMessage;
|
|
15
23
|
private handleAppStateControl;
|
|
16
24
|
private handleAppVersionControl;
|
|
17
25
|
private handleAppInstallCloudResponsePayload;
|
|
@@ -24,19 +32,6 @@ export declare class DeviceAgentCloudConnection {
|
|
|
24
32
|
private handleProjectShadowConfigUpdate;
|
|
25
33
|
private handleProjectShadowMessage;
|
|
26
34
|
handleSecureTunnelMessage(payload: any): Promise<void>;
|
|
27
|
-
constructor();
|
|
28
|
-
getClientId(): string;
|
|
29
|
-
getToDeviceTopic(): string;
|
|
30
|
-
isCmdInProgress(projectId: string): boolean;
|
|
31
|
-
updateProjectShadow(projectId: string): Promise<void>;
|
|
32
|
-
handleDeviceAgentMessage({ topic, message }: {
|
|
33
|
-
topic: string;
|
|
34
|
-
message: ToDeviceAgentMessage;
|
|
35
|
-
}): Promise<void>;
|
|
36
|
-
handleMessage(topic: string, message: any): Promise<void>;
|
|
37
|
-
setupHandlers(): Promise<void>;
|
|
38
|
-
logConnectionInfo(): Promise<void>;
|
|
39
|
-
stop(): Promise<void>;
|
|
40
35
|
}
|
|
41
36
|
export declare function runDeviceAgentCloudInterface(): Promise<void>;
|
|
42
37
|
//# sourceMappingURL=device-agent-cloud-connection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-agent-cloud-connection.d.ts","sourceRoot":"","sources":["../../src/cloud-connection/device-agent-cloud-connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"device-agent-cloud-connection.d.ts","sourceRoot":"","sources":["../../src/cloud-connection/device-agent-cloud-connection.ts"],"names":[],"mappings":"AA6DA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AAK/D,qBAAa,0BAA0B;IAC9B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,SAAS,CAAC;IAC5B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,MAAM,CAAiB;IAE/B,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAmC;IACjE,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAiD;IACzF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CACS;;IAoCtC,WAAW,IAAI,MAAM;IAIrB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIrC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IA8BzC,IAAI;IAYjB,OAAO,CAAC,aAAa;YAsCP,iBAAiB;YAqDjB,wBAAwB;IAqRtC,OAAO,CAAC,qBAAqB,CAgB3B;IAEF,OAAO,CAAC,uBAAuB,CAuC7B;IAEF,OAAO,CAAC,oCAAoC,CAkB1C;IAEF,OAAO,CAAC,uCAAuC,CAsC7C;YAEY,kBAAkB;YAelB,mBAAmB;IAIjC,OAAO,CAAC,SAAS;YAKH,0BAA0B;YAW1B,uBAAuB;IA2DrC,OAAO,CAAC,+BAA+B,CA6DrC;YAEY,0BAA0B;IA4C3B,yBAAyB,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAsBpE;AAED,wBAAsB,4BAA4B,kBA+BjD"}
|