Skip to main content

Module codegen

Module codegen 

Source
Expand description

The types subcommand: a TypeScript module typing the tags of a running server (GET /tags), as a typed tag tree (tagTree<PLC1Tags>) or the 0.2 union of tag names.

Functionsยง

fetch_tags
GET <url>/tags[?plc=NAME] with a Bearer token; the whole body (plc, version, tags, types, rules, groups, decorators, udt, tag_settings). http:// only; a non-200 status is an error with the status line and body.
names_module
The 0.2 --format names module: export type TagName = "..." | ...;. plcs are as passed on the command line (one body each); names are qualified as PLC/tag when there is more than one.
tag_names
Readable names: each tag, but for an AOI its readable members (Inst.Member) instead of the instance.
tree_module
The generated module: UDT interfaces, a tags interface and a tagTree const per PLC; qualified passes each PLC name to its tagTree (several PLCs).