Definitions
This repository contains all definitions for Code0. These definitions will be used to create a Flow. It also contains a CLI tool for managing definitions and a reader for reading all definitions.
Definition CLI
Setup
First download cargo to use the cli. Install Cargo
Then run:
After the cli compiled succesfully you can use it via:
Usage
(Stay inside the root directory when running the command)
Download
Will download the latest Definitions from the Code0 Definition Repository.
If no feature is specified, all features will be downloaded. If a feature is specified, only that feature will be kept & can be loaded by one of the following languages: TypeScript, Rust.
-f (--features) is a list of features that will be downloaded. -t (--tag) is the version tag of the release you want to select.
General Report
Will create a report of all errors in the definitions.
Feature Report
Will create a report of all errors in the definitions for a specific feature. Will also report on all specified functions, data types, and flow types.
Watch for Changes
Will run the report each time a definition file changes.
Definition
Will search for a specific definition.
TypeScript Definition Package
Install Package
Usage
const features = Definition("./path/to/definitions")
for (const feature in features) {
const name = feature.name; //name of the feature (e.g. http)
const dataTypes = fearture.dataTypes; //dataTypes of this feature
const flowTypes = fearture.flowTypes; //flowTypes of this feature
const functions = fearture.runtimeFunctions; //runtimeFunctions of this feature
}
Rust Definition Package
Install Package
Usage
use Definition;
let features = new;
for feature in features