NS8 SwitchBoardtm Project Support Tools
This project contains the helper pieces for the development of switchboard projects.
TypeScript Interfaces
There are multiple interfaces exposed that support the SwitchBoard project object.
- Primary Schemas
- SwitchActionSchema
- SwitchEventSchema
- SwitchScoreSchema
- ScriptEventSchema
- UIObject
- Context Schemas
- ExecutionContext interfaces of a SwitchBoard action context object
- EventContext interfaces of a SwitchBoard event context object
- ScoringContext interfaces of a SwitchBoard scoring context object
- Supporting Schemas
- EndpointSchema
- SwitchTypeSchema
- ProjectTypeSchema
- SettingsImplementationType
all of which can be imported be imported by:
import { SwitchBoard, ExecutionContext, EventContext, ScoringContext } from "@ns8/switchboard-config-loader"
Schemas
All NS8 Official schemas are published to https://schemas.ns8.com/ if any changes or additions need to be made they should be made at github @ns8inc/ns8-schemas
Schemas are used by during the handoff between Fastify, Kafka and Zeebe to validate context objects before they are handed off to the switches. The interfaces are used by switch designers to ensure that their methods have the correct signatures.
- switchboard.json exposes a local copy of the switchboard schema file it can be found here
- executionContext.json exposes a local copy of the executionContext schema file it can be found here
- eventContext.json exposes a local copy of the eventContext schema file it can be found here
- scoringContext.json exposes a local copy of the scoringContext schema file it can be found here
Schema Loading
const exeContextSchema = require("@ns8/switchboard-config-loader/executionContext.json");