iya-sts
    Preparing search index...

    Class export=

    Turns a collected catalogue into TypeSpec and class text.

    Index
    • The application's key, subject, and relationships. They are part of the model and are not attributes the TypeSpec property list can show on their own.

      Parameters

      • lines: string[]

        the page being built

      Returns void

    • One attribute's description: secret, families, the model's own sentence, and a citation when the row has one.

      Parameters

      • attribute: any

        a catalogue attribute

      Returns string

      the cell text

    • Appends an attribute table.

      Parameters

      • lines: string[]

        the page being built

      • attributes: any[]

        the attributes

      Returns void

    • The TypeScript type of a directory kind.

      Parameters

      • kind: string

        single, multi or unspecified

      Returns string

      the type

    • The Zod expression of a directory kind, before .optional().

      Parameters

      • kind: string

        single, multi or unspecified

      Returns string

      the expression

    • Captures documents the caller already built. This does not build them, and check() does not call it.

      Parameters

      • named: { document: unknown; name: string }[]

        document name and the builder's object

      Returns any[]

      one captured model per document

    • Two directory collects agree, and the reading pages and the TypeSpec match the model. OpenAPI is not built here.

      Parameters

      • root: string

        the package root

      Returns string[]

      problems, empty when the check passes

    • One object class, in RFC 4512's form.

      Parameters

      • item: any

        a class with an OID

      Returns string

      the definition

    • A TypeScript name. application stays Application. A dotted id such as policy.password becomes PolicyPassword, because the dot is not part of a class name.

      Parameters

      • id: string

        an object id or a table name

      Returns string

      the class name

    • Notes for one column of the reading page.

      Parameters

      • column: any

        a column

      Returns string

      the notes cell

    • The TypeScript type of a SQL type token.

      Parameters

      • sqlType: string

        the type from the column

      Returns string

      the type

    • The Zod expression of a SQL type token, before .optional(). The same mapping as PostgresImport.zodOf.

      Parameters

      • sqlType: string

        the type from the column

      Returns string

      the expression

    • The body of one directory model, under a heading the caller writes.

      Parameters

      • lines: string[]

        the page being built

      • object: any

        the catalogue object

      • onPerson: boolean

        the person-side attributes of a policy

      Returns void

    • Class text for one directory object, and a second class when the object lists person attributes. The text is not compiled here.

      Parameters

      • object: any

        a catalogue object

      Returns string

      the class text

    • The directory models, as a page a person can read.

      Parameters

      • catalog: any

        a catalogue from DirectoryModel.collect()

      Returns string

      the Markdown page, including its front matter

    • The heading a reader sees for one directory object.

      Parameters

      • id: string

        the object id

      Returns string

      the heading

    • A doc comment, wrapped to 80 columns. An empty text writes nothing. A single token longer than the width is kept whole.

      Parameters

      • lines: string[]

        the file being built

      • text: string

        the sentence

      • indent: string

        the indent of the comment

      Returns void

    • Escapes the end of a block comment.

      Parameters

      • text: string

        the sentence

      Returns string

      the text safe to put in a block comment

    • One generated file, compared to a fresh render. A missing file is stale.

      Parameters

      • root: string

        the package root

      • relative: string

        the path under the package root

      • fresh: string

        what the file should contain

      • problems: string[]

        the list being built

      Returns void

    • The class text. schema() is a z.strictObject, so an unknown key fails. The tests read this text. They do not compile it.

      Parameters

      • name: string

        the class name

      • fields: { name: string; optional: boolean; ts: string; zod: string }[]

        name, optional, TypeScript type, Zod expression

      Returns string

      the class text

    • A heading's kramdown id: lower case, spaces as hyphens, and no other punctuation. The same rule as tests/doc_links.js.

      Parameters

      • title: string

        the heading text

      Returns string

      the id

    • RFC 4512 definitions of everything in the model that has an OID. A name with no OID cannot be written as a definition, so it is listed instead.

      Parameters

      • objects: any[]

        objects from a compiled model

      Returns { attributeTypes: string[]; objectClasses: string[]; withoutOid: string[] }

      the definitions and the names that have no OID

    • node common/model_emit.js --check, --docs, or --write. --docs rewrites the TypeSpec and the reading pages.

      Parameters

      • argv: string[]

        arguments after the program name

      Returns void

    • One directory class.

      Parameters

      • name: string

        the class name

      • attributes: any[]

        the attributes

      • directoryOptional: boolean

        directory attributes are always optional

      Returns string

      the class text

    • Where a name comes from, in words.

      Parameters

      • provenance: string

        the catalogue provenance

      Returns string

      the word

    • The persistence models, as a page a person can read.

      Parameters

      • model: any

        a model from PostgresImport.read()

      Returns string

      the Markdown page, including its front matter

    • The sentence under a model that says where it was recorded.

      Parameters

      • object: any

        a catalogue object

      Returns string

      the sentence

    • A Markdown table cell. A pipe or a newline would split the row.

      Parameters

      • text: string

        the cell

      Returns string

      the escaped cell

    • Class text for one table. One property per column. jsonb and any type this mapping does not name are unknown. The same tokens as PostgresImport.zodOf.

      Parameters

      • table: any

        a table from the PostgreSQL model

      Returns string

      the class text

    • One attribute type, in RFC 4512's form.

      Parameters

      • attribute: any

        an attribute with an OID

      Returns string

      the definition

    • How many values an attribute holds, in words.

      Parameters

      • kind: string

        single, multi, or anything else

      Returns string

      the word

    • Wraps on spaces. A token longer than width stays on its own line.

      Parameters

      • text: string

        one paragraph

      • width: number

        the maximum line length

      Returns string[]

      the lines

    • Writes the TypeSpec, the reading pages, a structural model.json and gaps.json. Class text and OpenAPI documents are not written: a class file would be compiled into the image, and an OpenAPI file rebuilt from pieces would not be the served document.

      Parameters

      • root: string

        the package root

      Returns void

    • Collects both namespaces and writes the TypeSpec and the reading pages.

      Parameters

      • root: string

        the package root

      Returns void

    • Writes the TypeSpec and the two reading pages. model.json is not written here.

      Parameters

      • root: string

        the package root

      • catalog: any

        the directory catalogue

      • pg: any

        the persistence model

      Returns void