iya-sts
    Preparing search index...

    The static surfaces' shell document and file sending. A static utility class; it holds no state.

    Index
    • The content coding to answer a request with.

      Parameters

      • header: unknown

        the request's Accept-Encoding

      Returns string

      br, gzip or '' for none

    • Whether the ambient realm lets one browser hold several signed-in accounts (#561): what data-sts-accounts says to the runtime.

      Returns boolean

      authn.multipleAccounts; false where it cannot be read

    • The ambient realm's sign-in appearance as a shell carries it (#717): its stylesheet and its <html> attributes, or nothing for a shell it does not apply to and for a realm that has set nothing.

      Parameters

      • spec: ShellSpec

        the shell being drawn

      Returns { attributes: [string, string][]; stylesheet: string }

      { attributes, stylesheet }

    • Compresses the body this response is about to end with, in the coding the request accepts, and says Vary: Accept-Encoding either way. Call it before the answer is sent.

      Parameters

      • req: any

        the request

      • res: any

        the response, not yet sent

      Returns void

      nothing

    • Draws a shell document.

      Parameters

      • spec: ShellSpec

        what it is drawn from

      Returns string

      the document, ending in a newline

    • Escapes text for HTML.

      Parameters

      • value: unknown

        anything

      Returns string

      the escaped text

    • The page footer in the ambient request's language (common/page_footer.ts).

      Returns string

      its markup, or '' where it cannot be drawn

    • The img-src a shell names other origins in (#1300): the base policy's 'self' data: and each https origin given exactly, or nothing to add where none is usable.

      Parameters

      • Optionalorigins: string[]

        the origins asked for

      Returns Record<string, string>

      { 'img-src': … }, or an empty object

    • The distinct origins of a list of bases, for connect-src.

      Parameters

      • bases: string[]

        absolute URLs, or ''

      Returns string[]

      their origins, each once

    • The Content-Security-Policy a shell is sent with, through app.contentSecurityPolicy().

      Parameters

      • app: any

        the express app, for its policy builder

      • Optionaloptions: ServeOptions

        the other listeners' origins and extra directives

      Returns string

      the header value

    • Reads a surface's built file and the .br and .gz beside it. A tree that was never built (a checkout) has none: raw is then the placeholder, a script that says so.

      Parameters

      • dir: string

        the directory the build wrote it in

      • name: string

        its file name, portal-spa.js

      • placeholder: string

        what to serve when it was not built

      Returns BuiltFile

      the file and its precompressed forms

    • Sends a surface's file, compressed when the request accepts it; the caller has set its type and caching.

      Parameters

      • req: any

        the request

      • res: any

        the response

      • text: any

        the file as served uncompressed

      • packed: any

        precompressed forms (br, gzip), or null

      • finish: (s: string) => string

        what the realm middleware would do to the text, or null

      Returns void

      nothing

    • Sends a surface's built file: its type, no-cache (a new build is picked up on the next load, with no version in the address), and the coding the request accepts.

      Parameters

      • req: any

        the request

      • res: any

        the response

      • file: BuiltFile

        readFile()'s answer

      • type: string

        its media type, application/javascript

      Returns void

      nothing

    • Sends a shell: its policy, no-store, and the document, compressed where the surface asks and the request accepts.

      Parameters

      • app: any

        the express app, for its policy and its realm rewrite

      • req: any

        the request

      • res: any

        the response

      • html: string

        the document

      • Optionaloptions: ServeOptions

        the policy's origins and directives, and compression

      Returns void

      nothing