effx
API reference@effx/compilergenerate

http-contracts

API reference for @effx/compiler/generate/http-contracts

http-contracts.ts overview


Exports Grouped by Category


utils

HttpGroup (interface)

Signature

export interface HttpGroup {
  readonly root: string
  readonly group: string
  readonly metadata: Extract<Node, { readonly _tag: "HttpGroup" }> | undefined
  readonly items: ReadonlyArray<HttpItem>
}

HttpItem (interface)

Signature

export interface HttpItem extends Exposed<HttpTransport> {
  readonly contract: HttpContractData | undefined
  readonly problems: ProblemContractData | undefined
  readonly access: AccessContractData | undefined
  readonly uiCommand: UiCommandData | undefined
  readonly root: string
  readonly group: string
}

UiCommandData

The two app-owned Message schemas named by an opted-in Foldkit operation.

Signature

declare const UiCommandData: Schema.Struct<{
  readonly success: Schema.Struct<{
    readonly module: Schema.String
    readonly export: Schema.String
    readonly symbolId: Schema.brand<Schema.String, "effx/StableId">
  }>
  readonly failure: Schema.Struct<{
    readonly module: Schema.String
    readonly export: Schema.String
    readonly symbolId: Schema.brand<Schema.String, "effx/StableId">
  }>
}>

UiCommandData (type alias)

Signature

type UiCommandData = typeof UiCommandData.Type

clientName

Signature

declare const clientName: (root: string) => string

endpointKey

Endpoint names are independent of stable IDs; legacy local operations retain their keys.

Signature

declare const endpointKey: (item: HttpItem) => string

groupApiHandlersName

Signature

declare const groupApiHandlersName: (group: string) => string

groupApiName

Split-mode group contracts export the same group symbol regardless of enclosing root.

Signature

declare const groupApiName: (group: string) => string

groupClassName

Signature

declare const groupClassName: (root: string, group: string) => string

groupExportPart

Only HTTP group parts treat route punctuation as word boundaries.

Signature

declare const groupExportPart: (group: string) => string

guardTypeName

Signature

declare const guardTypeName: (root: string, group: string) => string

handlerName

Signature

declare const handlerName: (root: string, group: string) => string

httpGroups

Signature

declare const httpGroups: (items: ReadonlyArray<HttpItem>, ir?: ApplicationIR) => ReadonlyArray<HttpGroup>

httpItems

Signature

declare const httpItems: (ir: ApplicationIR, index: GraphIndex) => Effect.Effect<ReadonlyArray<HttpItem>, CompilerFault>

rootClassName

Signature

declare const rootClassName: (root: string) => string

toHttpItems

Builds one typed lookup from validated ExtensionOf edges, not from JSON naming conventions.

Signature

declare const toHttpItems: (ir: ApplicationIR, all: ReadonlyArray<Exposed>) => ReadonlyArray<HttpItem>

On this page