From d7de64b243caf8e5446e935c4dee9c0c54a4dab9 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 10:47:19 -0700 Subject: [PATCH 1/9] Sample from sperka --- samples/node/basic_discovery_mqtt5/README.md | 9 + .../basic_discovery_mqtt5/gg-mqtt5-client.ts | 235 ++++++++ samples/node/basic_discovery_mqtt5/index.ts | 130 ++++ .../node/basic_discovery_mqtt5/package.json | 27 + .../node/basic_discovery_mqtt5/tsconfig.json | 61 ++ samples/node/basic_discovery_mqtt5/yarn.lock | 570 ++++++++++++++++++ 6 files changed, 1032 insertions(+) create mode 100644 samples/node/basic_discovery_mqtt5/README.md create mode 100644 samples/node/basic_discovery_mqtt5/gg-mqtt5-client.ts create mode 100644 samples/node/basic_discovery_mqtt5/index.ts create mode 100644 samples/node/basic_discovery_mqtt5/package.json create mode 100644 samples/node/basic_discovery_mqtt5/tsconfig.json create mode 100644 samples/node/basic_discovery_mqtt5/yarn.lock diff --git a/samples/node/basic_discovery_mqtt5/README.md b/samples/node/basic_discovery_mqtt5/README.md new file mode 100644 index 00000000..ebde1575 --- /dev/null +++ b/samples/node/basic_discovery_mqtt5/README.md @@ -0,0 +1,9 @@ +# Node: Greengrass Discovery + +[**Return to main sample list**](../../README.md) + +This sample is intended for use with the following tutorials in the AWS IoT Greengrass documentation: + +* [MQTT5 User Guide](https://github.com/awslabs/aws-crt-nodejs/blob/main/MQTT5-UserGuide.md) +* [Connect and test client devices](https://docs.aws.amazon.com/greengrass/v2/developerguide/client-devices-tutorial.html) (Greengrass V2) +* [Test client device communications](https://docs.aws.amazon.com/greengrass/v2/developerguide/test-client-device-communications.html) (Greengrass V2) diff --git a/samples/node/basic_discovery_mqtt5/gg-mqtt5-client.ts b/samples/node/basic_discovery_mqtt5/gg-mqtt5-client.ts new file mode 100644 index 00000000..e38f9a73 --- /dev/null +++ b/samples/node/basic_discovery_mqtt5/gg-mqtt5-client.ts @@ -0,0 +1,235 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +import { ICrtError } from "aws-crt"; +import { greengrass, io, iot, mqtt5 } from "aws-iot-device-sdk-v2"; + +export interface GGMqtt5ClientOptions { + readonly rootCAPath: string; + readonly certificatePath: string; + readonly privateKeyPath: string; + + readonly region: string; + readonly thingName: string; +} + +/** + * Represents an MQTT5 Client with helper functions. + */ +export class GGMqtt5Client { + /** + * The actual client + */ + private _mqttClient?: mqtt5.Mqtt5Client; + + /** + * Passed parameters. + */ + private options: GGMqtt5ClientOptions; + + /** + * Instantiates an MQTT5 client. + * @param options The parameters needed to establish a connection with discovery. + */ + constructor(options: GGMqtt5ClientOptions) { + this.options = options; + + console.debug("GGMqtt5Client instantiated with options", options); + } + + /** + * Returns whether the client is connected (ie. exists). + */ + public get connected() { + return this._mqttClient != null; + } + + /** + * Returns the MQTT client object. + */ + public get client() { + if (this._mqttClient == null) { + throw new Error("MQTT client not connected yet."); + } + return this._mqttClient; + } + + /** + * Connects the MQTT5 client using discovery. + * @returns The Mqtt5Client promise. + */ + public async connectWithDiscovery(): Promise { + console.debug(`MQTT client connecting...`); + if (this._mqttClient != null) { + console.debug( + `Mqtt client already connected. Returning current active client` + ); + return Promise.resolve(this.client); + } + + const clientBootstrap = new io.ClientBootstrap(); + const socketOptions = new io.SocketOptions( + io.SocketType.STREAM, // type + io.SocketDomain.IPV4, // domain + 3000 // connect_timeout_ms + ); + const tlsOptions = new io.TlsContextOptions(); + tlsOptions.override_default_trust_store_from_path( + undefined, + this.options.rootCAPath + ); + tlsOptions.certificate_filepath = this.options.certificatePath; + tlsOptions.private_key_filepath = this.options.privateKeyPath; + + if (io.is_alpn_available()) { + console.debug("ALPN available. Adding 'x-amzn-http-ca' to alpn_list", { + alpnAvailable: io.is_alpn_available(), + }); + tlsOptions.alpn_list.push("x-amzn-http-ca"); + } + + const tlsContext = new io.ClientTlsContext(tlsOptions); + const discoveryClient = new greengrass.DiscoveryClient( + clientBootstrap, + socketOptions, + tlsContext, + this.options.region + ); + + console.debug(`Running discovery`, { + thingName: this.options.thingName, + }); + const discoveryResponse = await discoveryClient.discover( + this.options.thingName + ); + console.info(`Discovery response`, { discoveryResponse }); + + // returns the first connected client; + // otherwise, if all host_address attempts fail, will return a reject (error) + return Promise.any( + discoveryResponse.gg_groups.flatMap((ggGroup) => { + return ggGroup.cores.flatMap((ggCore) => { + return ggCore.connectivity.flatMap((connectivity) => { + console.debug( + `Connecting to ${connectivity.host_address}:${connectivity.port}` + ); + + // setup the client config + const mqtt5ClientConfig = + iot.AwsIotMqtt5ClientConfigBuilder.newDirectMqttBuilderWithMtlsFromPath( + // take the host address from discovery + connectivity.host_address, + + // cert and private keys of the client + this.options.certificatePath, + this.options.privateKeyPath + ) + // take the CA from discovery result + .withCertificateAuthority(ggGroup.certificate_authorities[0]) + // set the session behavior + .withSessionBehavior(mqtt5.ClientSessionBehavior.RejoinAlways) + // use socket settings + .withSocketOptions( + new io.SocketOptions( + io.SocketType.STREAM, + io.SocketDomain.IPV4, + 3000 + ) + ) + // set the client ID (current client's thingName) + .withConnectProperties({ + clientId: this.options.thingName, + keepAliveIntervalSeconds: 60, + }) + // set the port to connect to + .withPort(connectivity.port) + .build(); + + // instantiate the client + const mqttClient = new mqtt5.Mqtt5Client(mqtt5ClientConfig); + + return new Promise((resolve, reject) => { + // sign up for the events + mqttClient.on( + "attemptingConnect", + (eventData: mqtt5.AttemptingConnectEvent) => { + console.info( + `attemptingConnect event: ${connectivity.host_address}:${connectivity.port}` + ); + } + ); + mqttClient.on("error", (error: ICrtError) => { + console.error("MQTTclient error", { error }); + }); + mqttClient.on( + "disconnection", + (eventData: mqtt5.DisconnectionEvent) => { + console.info("disconnection event", { eventData }); + } + ); + mqttClient.on("stopped", (eventData: mqtt5.StoppedEvent) => { + console.info("stopped event", { eventData }); + }); + mqttClient.on( + "connectionFailure", + (eventData: mqtt5.ConnectionFailureEvent) => { + console.error( + `connectionFailure event: ${connectivity.host_address}:${connectivity.port}`, + { eventData } + ); + mqttClient.stop(); // optional todo: try "maxRetry" times + reject(eventData); + } + ); + mqttClient.on( + "connectionSuccess", + (eventData: mqtt5.ConnectionSuccessEvent) => { + console.info( + `Successfully connected to ${connectivity.host_address}:${connectivity.port}`, + { eventData } + ); + if (this.connected) { + console.debug( + `Already connected. Stopping ${JSON.stringify( + mqttClient._handle + )}` + ); + mqttClient.stop(); + } else { + // all good, save reference to connected client + this._mqttClient = mqttClient; + resolve(mqttClient); + } + } + ); + + // start the client + mqttClient.start(); + }); + }); + }); + }) + ); + } + + /** + * Publish JSON messages to a topic. + * @param topic The topic. + * @param payload The object to publish. + * @returns The {@link mqtt5.PublishCompletionResult}. + */ + public async publish( + topic: string, + payload: any + ): Promise { + const publishResp = await this.client.publish({ + topicName: topic, + qos: mqtt5.QoS.AtLeastOnce, + payload: JSON.stringify(payload), + }); + + return publishResp; + } +} diff --git a/samples/node/basic_discovery_mqtt5/index.ts b/samples/node/basic_discovery_mqtt5/index.ts new file mode 100644 index 00000000..81cade4c --- /dev/null +++ b/samples/node/basic_discovery_mqtt5/index.ts @@ -0,0 +1,130 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +import { io } from "aws-iot-device-sdk-v2"; +import { GGMqtt5Client } from "./gg-mqtt5-client"; +import { mqtt5 } from "aws-crt"; +import { toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { command } from "yargs"; + +type Args = { [index: string]: any }; + +// The relative path is '../../util/cli_args' from here, but the compiled javascript file gets put one level +// deeper inside the 'dist' folder +const common_args = require("../../../util/cli_args"); + +// yargs.command +command( + "*", + false, + (yargs: any) => { + common_args.add_universal_arguments(yargs); + common_args.add_topic_message_arguments(yargs); + + yargs + .option("ca_file", { + alias: "r", + description: + ": path to a Root CA certificate file in PEM format (optional, system trust store used by default).", + type: "string", + required: true, + }) + .option("cert", { + alias: "c", + description: + ": path to a PEM encoded certificate to use with mTLS.", + type: "string", + required: true, + }) + .option("key", { + alias: "k", + description: + ": Path to a PEM encoded private key that matches cert.", + type: "string", + required: true, + }) + .option("thing_name", { + alias: "n", + description: "Targeted Thing name.", + type: "string", + required: true, + }) + .option("region", { + description: "AWS Region.", + type: "string", + required: true, + }); + }, + main +).parse(); + +async function main(argv: Args) { + if (argv.verbose && argv.verbose != "none") { + const level: io.LogLevel = parseInt( + io.LogLevel[argv.verbose.toUpperCase()] + ); + io.enable_logging(level); + } + + const ggMqtt5Client = new GGMqtt5Client({ + rootCAPath: argv.ca_file, + certificatePath: argv.cert, + privateKeyPath: argv.key, + + region: argv.region, + thingName: argv.thing_name, + }); + try { + const client = await ggMqtt5Client.connectWithDiscovery(); + console.info("mqtt5Client connect with discovery success"); + + if (argv.topic) { + // example subscribe + client.subscribe({ + subscriptions: [ + { + qos: mqtt5.QoS.AtMostOnce, + topicFilter: argv.topic, + }, + ], + }); + + // example message received + client.on( + "messageReceived", + async (eventData: mqtt5.MessageReceivedEvent) => { + console.debug("Message received", { eventData }); + + const payloadStr = toUtf8( + new Uint8Array(eventData.message.payload as ArrayBuffer) + ); + console.debug("payloadStr", { payloadStr }); + + let payload: any; + try { + payload = JSON.parse(payloadStr); + } catch (err) { + payload = payloadStr; + } + + console.debug("payload", { payload }); + + const responsePayload = { ok: true }; + + if (argv.message) { + // example publish + console.debug(`Publishing response`); + await ggMqtt5Client.publish( + `${eventData.message.topicName}/response`, + responsePayload + ); + } + } + ); + } + } catch (err) { + console.error("Error while connecting MQTT5 client", { err }); + } +} diff --git a/samples/node/basic_discovery_mqtt5/package.json b/samples/node/basic_discovery_mqtt5/package.json new file mode 100644 index 00000000..2f0081ff --- /dev/null +++ b/samples/node/basic_discovery_mqtt5/package.json @@ -0,0 +1,27 @@ +{ + "name": "basic-discovery-mqtt5", + "version": "1.0.0", + "description": "NodeJS IoT SDK v2 Greengrass MQTT5 Discovery Sample", + "homepage": "https://github.com/awslabs/aws-iot-device-sdk-js-v2", + "repository": { + "type": "git", + "url": "git+https://github.com/aws/aws-iot-device-sdk-js-v2.git" + }, + "contributors": [ + "AWS SDK Common Runtime Team " + ], + "license": "Apache-2.0", + "main": "./dist/index.js", + "scripts": { + "tsc": "tsc", + "prepare": "npm run tsc" + }, + "devDependencies": { + "@types/yargs": "^17.0.24", + "typescript": "^4.7.4" + }, + "dependencies": { + "aws-iot-device-sdk-v2": "file:../../..", + "yargs": "^16.2.0" + } +} diff --git a/samples/node/basic_discovery_mqtt5/tsconfig.json b/samples/node/basic_discovery_mqtt5/tsconfig.json new file mode 100644 index 00000000..52f9b341 --- /dev/null +++ b/samples/node/basic_discovery_mqtt5/tsconfig.json @@ -0,0 +1,61 @@ +{ + "compilerOptions": { + /* Basic Options */ + "target": "ES2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "removeComments": false, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + "strictNullChecks": true, /* Enable strict null checks. */ + "strictFunctionTypes": true, /* Enable strict checking of function types. */ + "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + /* Additional Checks */ + "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + }, + "include": [ + "*.ts" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/samples/node/basic_discovery_mqtt5/yarn.lock b/samples/node/basic_discovery_mqtt5/yarn.lock new file mode 100644 index 00000000..f8a6d69c --- /dev/null +++ b/samples/node/basic_discovery_mqtt5/yarn.lock @@ -0,0 +1,570 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@aws-sdk/util-utf8-browser@^3.109.0": + version "3.259.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz#3275a6f5eb334f96ca76635b961d3c50259fd9ff" + integrity sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw== + dependencies: + tslib "^2.3.1" + +"@httptoolkit/websocket-stream@^6.0.0": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@httptoolkit/websocket-stream/-/websocket-stream-6.0.1.tgz#8d732f1509860236276f6b0759db4cc9859bbb62" + integrity sha512-A0NOZI+Glp3Xgcz6Na7i7o09+/+xm2m0UCU8gdtM2nIv6/cjLmhMZMqehSpTlgbx9omtLmV8LVqOskPEyWnmZQ== + dependencies: + "@types/ws" "*" + duplexify "^3.5.1" + inherits "^2.0.1" + isomorphic-ws "^4.0.1" + readable-stream "^2.3.3" + safe-buffer "^5.1.2" + ws "*" + xtend "^4.0.0" + +"@types/node@*": + version "20.5.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.7.tgz#4b8ecac87fbefbc92f431d09c30e176fc0a7c377" + integrity sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA== + +"@types/ws@*": + version "8.5.5" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" + integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg== + dependencies: + "@types/node" "*" + +"@types/yargs-parser@*": + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + +"@types/yargs@^17.0.24": + version "17.0.24" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" + integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + dependencies: + "@types/yargs-parser" "*" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +aws-crt@^1.17.0: + version "1.18.0" + resolved "https://registry.yarnpkg.com/aws-crt/-/aws-crt-1.18.0.tgz#49f1d8ac2baf06e243541cb20e3526af1e8867ab" + integrity sha512-H5Vrb/GMzq72+Of2zrW69i/BTQ4gQd3MQvdZ3X3okfppzHdEjSPkdJN6ia8V2/1J1FmFvEtoxaY4nwraHUGQvg== + dependencies: + "@aws-sdk/util-utf8-browser" "^3.109.0" + "@httptoolkit/websocket-stream" "^6.0.0" + axios "^0.24.0" + buffer "^6.0.3" + crypto-js "^4.0.0" + mqtt "^4.3.7" + process "^0.11.10" + +"aws-iot-device-sdk-v2@file:../../..": + version "1.0.0-dev" + dependencies: + "@aws-sdk/util-utf8-browser" "^3.109.0" + aws-crt "^1.17.0" + +axios@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6" + integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA== + dependencies: + follow-redirects "^1.14.4" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bl@^4.0.2: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commist@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/commist/-/commist-1.1.0.tgz#17811ec6978f6c15ee4de80c45c9beb77cee35d5" + integrity sha512-rraC8NXWOEjhADbZe9QBNzLAN5Q3fsTPQtBV+fEVj6xKIgDgNiEVE6ZNfHpZOqfQ21YUzfVNUXLOEZquYvQPPg== + dependencies: + leven "^2.1.0" + minimist "^1.1.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +concat-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1" + integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.0.2" + typedarray "^0.0.6" + +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +crypto-js@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" + integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== + +debug@^4.1.1, debug@^4.3.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +duplexify@^3.5.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +duplexify@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" + integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== + dependencies: + end-of-stream "^1.4.1" + inherits "^2.0.3" + readable-stream "^3.1.1" + stream-shift "^1.0.0" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +follow-redirects@^1.14.4: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +glob@^7.1.6: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +help-me@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/help-me/-/help-me-3.0.0.tgz#9803c81b5f346ad2bce2c6a0ba01b82257d319e8" + integrity sha512-hx73jClhyk910sidBB7ERlnhMlFsJJIBqSVMFDwPN8o2v9nmp5KgLq1Xz1Bf1fCMMZ6mPrX159iG0VLy/fPMtQ== + dependencies: + glob "^7.1.6" + readable-stream "^3.6.0" + +ieee754@^1.1.13, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +js-sdsl@4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711" + integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ== + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA== + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.1.0, minimist@^1.2.5: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mqtt-packet@^6.8.0: + version "6.10.0" + resolved "https://registry.yarnpkg.com/mqtt-packet/-/mqtt-packet-6.10.0.tgz#c8b507832c4152e3e511c0efa104ae4a64cd418f" + integrity sha512-ja8+mFKIHdB1Tpl6vac+sktqy3gA8t9Mduom1BA75cI+R9AHnZOiaBQwpGiWnaVJLDGRdNhQmFaAqd7tkKSMGA== + dependencies: + bl "^4.0.2" + debug "^4.1.1" + process-nextick-args "^2.0.1" + +mqtt@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/mqtt/-/mqtt-4.3.7.tgz#42985ca490ea25d2c12c119d83c632db6dc9d589" + integrity sha512-ew3qwG/TJRorTz47eW46vZ5oBw5MEYbQZVaEji44j5lAUSQSqIEoul7Kua/BatBW0H0kKQcC9kwUHa1qzaWHSw== + dependencies: + commist "^1.0.0" + concat-stream "^2.0.0" + debug "^4.1.1" + duplexify "^4.1.1" + help-me "^3.0.0" + inherits "^2.0.3" + lru-cache "^6.0.0" + minimist "^1.2.5" + mqtt-packet "^6.8.0" + number-allocator "^1.0.9" + pump "^3.0.0" + readable-stream "^3.6.0" + reinterval "^1.1.0" + rfdc "^1.3.0" + split2 "^3.1.0" + ws "^7.5.5" + xtend "^4.0.2" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +number-allocator@^1.0.9: + version "1.0.14" + resolved "https://registry.yarnpkg.com/number-allocator/-/number-allocator-1.0.14.tgz#1f2e32855498a7740dcc8c78bed54592d930ee4d" + integrity sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA== + dependencies: + debug "^4.3.1" + js-sdsl "4.3.0" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +process-nextick-args@^2.0.1, process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +readable-stream@^2.0.0, readable-stream@^2.3.3: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +reinterval@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/reinterval/-/reinterval-1.1.0.tgz#3361ecfa3ca6c18283380dd0bb9546f390f5ece7" + integrity sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +rfdc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" + integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + +safe-buffer@^5.1.2, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +split2@^3.1.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" + integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== + dependencies: + readable-stream "^3.0.0" + +stream-shift@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" + integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +tslib@^2.3.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== + +typescript@^4.7.4: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@*: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + +ws@^7.5.5: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +xtend@^4.0.0, xtend@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" From a4fc15eabf94519f1cb839221a4aff57e70158c5 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 10:51:48 -0700 Subject: [PATCH 2/9] Add sample to CI --- .github/workflows/ci.yml | 14 +++++++ ...ci_run_greengrass_discovery_mqtt5_cfg.json | 40 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/ci_run_greengrass_discovery_mqtt5_cfg.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcc0f9c2..1cb43886 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,6 +210,17 @@ jobs: sudo apt-get update -y sudo apt-get install softhsm -y softhsm2-util --version + - name: configure AWS credentials (Greengrass) # TODO Remove + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ env.CI_GREENGRASS_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - name: run Greengrass Discovery sample # TODO Remove + run: | + python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_greengrass_discovery_cfg.json + - name: run Greengrass Discovery MQTT5 sample # TODO Remove + run: | + python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_greengrass_discovery_mqtt5_cfg.json - name: configure AWS credentials (Shadow) uses: aws-actions/configure-aws-credentials@v2 with: @@ -381,6 +392,9 @@ jobs: - name: run Greengrass Discovery sample run: | python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_greengrass_discovery_cfg.json + - name: run Greengrass Discovery MQTT5 sample + run: | + python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_greengrass_discovery_mqtt5_cfg.json # check that docs can still build check-docs: diff --git a/.github/workflows/ci_run_greengrass_discovery_mqtt5_cfg.json b/.github/workflows/ci_run_greengrass_discovery_mqtt5_cfg.json new file mode 100644 index 00000000..9da91465 --- /dev/null +++ b/.github/workflows/ci_run_greengrass_discovery_mqtt5_cfg.json @@ -0,0 +1,40 @@ +{ + "language": "Javascript", + "runnable_file": "./aws-iot-device-sdk-js-v2/samples/node/basic_discovery_mqtt5", + "runnable_region": "us-east-1", + "runnable_main_class": "", + + "arguments": [ + { + "name": "--cert", + "secret": "ci/Greengrass/cert", + "filename": "tmp_certificate.pem" + }, + { + "name": "--key", + "secret": "ci/Greengrass/key", + "filename": "tmp_key.pem" + }, + { + "name": "--ca_file", + "secret": "ci/Greengrass/ca", + "filename": "tmp_ca.pem" + }, + { + "name": "--region", + "data": "us-east-1" + }, + { + "name": "--thing_name", + "data": "CI_GreenGrass_Thing" + }, + { + "name": "--is_ci", + "data": "true" + }, + { + "name": "--print_discover_resp_only", + "data": "" + } + ] +} From 1a42a96b1a88fb7a6591d81ca4684202ec1dfa5e Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 11:18:47 -0700 Subject: [PATCH 3/9] Add logs --- samples/node/basic_discovery/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/node/basic_discovery/index.ts b/samples/node/basic_discovery/index.ts index 7b7cc7bf..60259021 100644 --- a/samples/node/basic_discovery/index.ts +++ b/samples/node/basic_discovery/index.ts @@ -188,6 +188,8 @@ async function main(argv: Args) { // force node to wait 60 seconds before killing itself, promises do not keep node alive const timer = setTimeout(() => { }, 60 * 1000); + console.log('Starting discovery'); + await discovery.discover(argv.thing_name) .then(async (discovery_response: greengrass.model.DiscoverResponse) => { console.log("Discovery Response:"); From 197a6322adcf139cbf1bc9ce86d2ae478e342699 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 11:36:47 -0700 Subject: [PATCH 4/9] Set verbose --- .github/workflows/ci_run_greengrass_discovery_cfg.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci_run_greengrass_discovery_cfg.json b/.github/workflows/ci_run_greengrass_discovery_cfg.json index e6e6c831..89c807cf 100644 --- a/.github/workflows/ci_run_greengrass_discovery_cfg.json +++ b/.github/workflows/ci_run_greengrass_discovery_cfg.json @@ -32,6 +32,10 @@ "name": "--is_ci", "data": "true" }, + { + "name": "--verbose", + "data": "true" + }, { "name": "--print_discover_resp_only", "data": "" From 4f1ed062f80b9bfbcd379205bc511e56dec2d35a Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 11:45:38 -0700 Subject: [PATCH 5/9] Fix verbosity --- .github/workflows/ci_run_greengrass_discovery_cfg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_run_greengrass_discovery_cfg.json b/.github/workflows/ci_run_greengrass_discovery_cfg.json index 89c807cf..ec84efae 100644 --- a/.github/workflows/ci_run_greengrass_discovery_cfg.json +++ b/.github/workflows/ci_run_greengrass_discovery_cfg.json @@ -30,7 +30,7 @@ }, { "name": "--is_ci", - "data": "true" + "data": "trace" }, { "name": "--verbose", From a0aa34c226e58e60f07158a443b17c368a554c63 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 11:48:47 -0700 Subject: [PATCH 6/9] Fix verbosity --- .github/workflows/ci_run_greengrass_discovery_cfg.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_run_greengrass_discovery_cfg.json b/.github/workflows/ci_run_greengrass_discovery_cfg.json index ec84efae..6e4c5dfb 100644 --- a/.github/workflows/ci_run_greengrass_discovery_cfg.json +++ b/.github/workflows/ci_run_greengrass_discovery_cfg.json @@ -30,11 +30,11 @@ }, { "name": "--is_ci", - "data": "trace" + "data": "true" }, { "name": "--verbose", - "data": "true" + "data": "debug" }, { "name": "--print_discover_resp_only", From a42f54c76ca00473f35563ef30bc32015332864b Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 11:49:45 -0700 Subject: [PATCH 7/9] Remove CI jobs --- .github/workflows/ci.yml | 159 --------------------------------------- 1 file changed, 159 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cb43886..e975c171 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,165 +34,6 @@ env: jobs: - al2: - runs-on: ubuntu-latest - permissions: - id-token: write # This is required for requesting the JWT - steps: - - name: configure AWS credentials (containers) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_IOT_CONTAINERS }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - - name: Build ${{ env.PACKAGE_NAME }} - run: | - aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh - ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-al2-x64 build -p ${{ env.PACKAGE_NAME }} - - raspberry: - runs-on: ubuntu-latest # latest - permissions: - id-token: write # This is required for requesting the JWT - strategy: - fail-fast: false - matrix: - image: - - raspbian-bullseye - steps: - - name: configure AWS credentials (containers) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_IOT_CONTAINERS }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - # set arm arch - - name: Install qemu/docker - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - name: Build ${{ env.PACKAGE_NAME }} - run: | - aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh - ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} - - windows: - runs-on: windows-latest - permissions: - id-token: write # This is required for requesting the JWT - steps: - - name: Build ${{ env.PACKAGE_NAME }} - run: | - python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" - python builder.pyz build -p ${{ env.PACKAGE_NAME }} - - name: Running samples in CI setup - run: | - python -m pip install boto3 - - name: configure AWS credentials (PubSub) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_PUBSUB_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample - run: | - python ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_pubsub_cfg.json - # The electron app in CI would not perform any IoT operations. The CI only verify the app is launched correctly. - # This is because electron requires manually input for pwd while processing the credentials. Currently we don't have a good way to workaround it. - - name: run PubSub Electron sample - run: | - python ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_pubsub_electron_cfg.json - - name: run Windows Certificate Connect sample - run: | - python ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_windows_cert_connect_cfg.json - - name: configure AWS credentials (Device Advisor) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_DEVICE_ADVISOR }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run DeviceAdvisor - run: | - cd ./aws-iot-device-sdk-js-v2 - python ./deviceadvisor/script/DATestRun.py - - osx: - runs-on: macos-latest - permissions: - id-token: write # This is required for requesting the JWT - steps: - - name: Build ${{ env.PACKAGE_NAME }} - run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')" - chmod a+x builder - ./builder build -p ${{ env.PACKAGE_NAME }} - - name: Running samples in CI setup - run: | - python3 -m pip install boto3 - - name: configure AWS credentials (PubSub) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_PUBSUB_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample - run: | - python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_pubsub_cfg.json - - # The electron app in CI would not perform any IoT operations. The CI only verify the app is launched correctly. - # This is because electron requires manually input for pwd while processing the credentials. Currently we don't have a good way to workaround it. - - name: run PubSub Electron sample - run: | - python ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_pubsub_electron_cfg.json - - name: run PKCS12 sample - run: | - cert=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/cert" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/certificate.pem - key=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/privatekey.pem - pkcs12_password=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key_pkcs12_password" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") - openssl pkcs12 -export -in /tmp/certificate.pem -inkey /tmp/privatekey.pem -out /tmp/pkcs12-key.p12 -name PubSub_Thing_Alias -password pass:$pkcs12_password - python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_pkcs12_connect_cfg.json - - name: configure AWS credentials (Device Advisor) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_DEVICE_ADVISOR }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run DeviceAdvisor - run: | - cd ./aws-iot-device-sdk-js-v2 - python3 ./deviceadvisor/script/DATestRun.py - - linux: - runs-on: ubuntu-20.04 # latest - permissions: - id-token: write # This is required for requesting the JWT - steps: - - name: Build ${{ env.PACKAGE_NAME }} - run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')" - chmod a+x builder - ./builder build -p ${{ env.PACKAGE_NAME }} - - name: Running samples in CI setup - run: | - python3 -m pip install boto3 - - name: configure AWS credentials (PubSub) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_PUBSUB_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample - run: | - python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_pubsub_cfg.json - - # Electron requires X11 on linux, while github actions does not have X11 support. We work around it using XVFB. - - name: run PubSub Electron sample - run: | - export DISPLAY=:99 - sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & - python ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_pubsub_electron_cfg.json - - name: configure AWS credentials (Device Advisor) - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ env.CI_DEVICE_ADVISOR }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run DeviceAdvisor - run: | - cd ./aws-iot-device-sdk-js-v2 - python3 ./deviceadvisor/script/DATestRun.py - # Runs the samples and ensures that everything is working linux-smoke-tests: runs-on: ubuntu-latest From d3dbad2b173a729e2074b755d25eabe8f5052045 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 11:52:02 -0700 Subject: [PATCH 8/9] fixup --- .github/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e975c171..89c0f8d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -237,16 +237,6 @@ jobs: run: | python3 ./aws-iot-device-sdk-js-v2/utils/run_in_ci.py --file ./aws-iot-device-sdk-js-v2/.github/workflows/ci_run_greengrass_discovery_mqtt5_cfg.json - # check that docs can still build - check-docs: - runs-on: ubuntu-20.04 # latest - steps: - - uses: actions/checkout@v2 - - name: Check docs - run: | - npm ci - ./make-docs.sh - check-codegen-edits: runs-on: ubuntu-20.04 # latest steps: From 684ab4f144884733d3cb1232552dae30df6b8796 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Thu, 18 Apr 2024 11:53:19 -0700 Subject: [PATCH 9/9] check --- .github/workflows/ci_run_greengrass_discovery_cfg.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci_run_greengrass_discovery_cfg.json b/.github/workflows/ci_run_greengrass_discovery_cfg.json index 6e4c5dfb..3b6be3b9 100644 --- a/.github/workflows/ci_run_greengrass_discovery_cfg.json +++ b/.github/workflows/ci_run_greengrass_discovery_cfg.json @@ -34,11 +34,7 @@ }, { "name": "--verbose", - "data": "debug" - }, - { - "name": "--print_discover_resp_only", - "data": "" + "data": "info" } ] }