Repository containing thin-edge.io flows to illustrate flows in a more production-like environment which covers;
- Repository structure that defines multiple
- Writing flows in TypeScript
- Using 3rd party dependencies within flows
- Transpile TypeScript to ES2018
- Writing unit test and run them, using Jest
- Packaging individual flows
The repository also uses Github workflows to run Pull Request checks, and also using an automated release process using release-please.
Feel-free to copy this repository and modify it to your liking, or you can also contribute new examples by raising a Pull Request.
You can build the flows locally with the following steps which requires nodejs >= 20.
-
Install the dependencies (using
npm ciinstead ofnpm installto install the exact versions defined in the package-lock.json file)npm ci
-
Build all the flows
npm run build-all
-
Publish the flows (locally) so that they can be either uploaded to Cumulocity or manually installed
npm run publish
The files are located under the
dist/directory$ ls -c1 dist/ c8y%2Ftedge-measurement-batch_1.0.0.tar.gz c8y%2Fuptime_2.0.0.tar.gz local%2Fcertificate-alert_2.0.0.tar.gz local%2Fcloud-mapper-commands_0.1.0.tar.gz local%2Fcloud-mapper-telemetry_0.1.0.tar.gz local%2Fjsonata-xform_0.1.0.tar.gz local%2Flog-surge_2.0.0.tar.gz local%2Fmeasurement-aggregator_1.0.0.tar.gz local%2Fprotobuf-xform_1.0.0.tar.gz local%2Ftedge-config-context_1.0.1.tar.gz local%2Ftedge-events_1.0.0.tar.gz local%2Fx509-cert-issuer_1.0.0.tar.gz thingsboard%2Fthingsboard-registration_1.0.0.tar.gz thingsboard%2Fthingsboard-server-rpc_0.2.0.tar.gz thingsboard%2Fthingsboard-telemetry_1.0.0.tar.gz
You can create a new flow (from a template) using the following command:
npm run generate-flow myflow1