@svatah/yam-spec
Flow reader, grammar, target dictionary, signatures
- Source:
packages/spec· README:packages/spec/README.md - Install:
npm install @svatah/yam-spec - Version 0.1.0 · Apache-2.0
Exports
| Export | Kind | Signature | |
|---|---|---|---|
ApiCatalogue | interface | export interface ApiCatalogue | |
buildApiCatalogue | function | export function buildApiCatalogue( | Build a catalogue from files already read, rejecting duplicate names. |
dataAt | function | export function dataAt(data: ProjectData, path: string): unknown | Read one dotted path, for {data.user.email}. |
DEFAULT_META | variable | DEFAULT_META: StoryMeta = { enabled: true, onFailure: "stop", tags: [] } | |
diagnostic | function | export function diagnostic( | |
Diagnostic | interface | export interface Diagnostic | |
DiagnosticCode | typealias | export type DiagnosticCode = ErrorCode | WarningCode; | |
DictionaryEntry | interface | export interface DictionaryEntry | |
elementId | function | export function elementId(phrase: string): string | A target phrase's element id: the leading article dropped, lower-cased, every |
EMPTY_APIS | variable | EMPTY_APIS: ApiCatalogue = { requests: new Map(), files: new Map() } | |
EMPTY_DATA | variable | EMPTY_DATA: ProjectData = { values: {}, secrets: new Set() } | |
ERROR_CODES | variable | ERROR_CODES = [ | Codes that fail a compile. |
ErrorCode | typealias | export type ErrorCode = (typeof ERROR_CODES)[number]; | |
errorsIn | function | export function errorsIn(diagnostics: readonly Diagnostic[]): Diagnostic[] | The errors among a set of diagnostics. |
FlowBlock | typealias | export type FlowBlock = StoryBlock | ListBlock; | |
FlowFile | interface | export interface FlowFile | |
formatDiagnostic | function | export function formatDiagnostic(diagnostic: Diagnostic): string | One line per diagnostic, in the shape editors and terminals both parse. |
generateActionsYaml | function | export function generateActionsYaml(vocabulary: readonly Verb[] = VOCABULARY): string | The exact bytes packages/spec/actions.yaml holds. |
isEmptySignature | function | export function isEmpty(signature: Signature): boolean | Whether a signature says anything, so an empty one is left off the story. |
isError | function | export function isError(code: DiagnosticCode): boolean | |
isRunBlock | function | export function isRunBlock(block: FlowBlock): block is ListBlock | |
isSecretPath | function | export function isSecretPath(data: ProjectData, path: string): boolean | Whether a dotted path was declared secret, or sits under one that was. |
isStoryBlock | function | export function isStoryBlock(block: FlowBlock): block is StoryBlock | |
ListBlock | interface | export interface ListBlock | A compose: or test:/run: block: a name and an ordered list of names. |
META_KEYS | variable | META_KEYS = [ | The keys REQ-LANG-2 allows, and nothing else. |
normaliseWords | function | export function normaliseWords(text: string): string | Lower-cased, whitespace collapsed. Nothing else. |
parseMeta | function | export function parseMeta(raw: string, where: Where): { meta: StoryMeta; diagnostics: Diagnostic[] } | Parse the metadata inside a header's parentheses. |
parseOnFailure | function | export function parseOnFailure( | stop | continue | compensate:<story> (REQ-AUTO-4). |
parseTargets | function | export function parseTargets( | Read a targets.yaml body. |
phraseKey | function | export function phraseKey(phrase: string): string | The form two phrases are compared by when deciding they name the same thing. |
Project | interface | export interface Project | |
ProjectData | interface | export interface ProjectData | |
ProjectPaths | interface | export interface ProjectPaths | |
ProjectSource | interface | export interface ProjectSource | |
RawStep | interface | export interface RawStep | A step line, with the guard that applies to it if there is one. |
readApiRequest | function | export function readApiRequest( | Read one api/*.yaml. |
readData | function | export function readData( | Read data.yaml (or a JSON file with the same shape). |
readFlow | function | export function readFlow(text: string, file: string): { flow: FlowFile; diagnostics: Diagnostic[] } | Read one flow file. |
readProject | function | export function readProject(source: ProjectSource): | |
readProjectFrom | function | export function readProjectFrom(paths: ProjectPaths): | Read a project from disk. Paths in diagnostics are relative to root. |
readSignatureLine | function | export function readSignatureLine( | Read one inputs: or outputs: line into the signature being built. |
StoryBlock | interface | export interface StoryBlock | |
TargetDeclaration | typealias | export type TargetDeclaration | What targets.yaml may say about one element. |
TargetDictionary | class | export class TargetDictionary | |
TargetResolution | interface | export interface TargetResolution | |
TargetScope | typealias | export type TargetScope = "page" | "dialog" | "frame" | "desktop" | "window"; | Where an element lives, when it is not on the page itself (LLD §3.2). |
TargetStatus | typealias | export type TargetStatus = "bound" | "unbound" | "ambiguous"; | |
Verb | interface | export interface Verb | |
VerbMatch | interface | export interface VerbMatch | |
VERBS | variable | VERBS = new VerbTrie() | The vocabulary as one trie, built once. |
VerbTrie | class | export class VerbTrie | |
VOCABULARY | variable | VOCABULARY: readonly Verb[] = [ | |
WARNING_CODES | variable | WARNING_CODES = [ | Codes yam lint reports without failing. |
WarningCode | typealias | export type WarningCode = (typeof WARNING_CODES)[number]; |