openapi
Import
Section titled “Import”import * as api from "@fungi.computer/forage/openapi";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| class | OpenApiError | A bounded intake refusal, distinct from a listed unsupported operation. |
| type alias | OpenApiThirdPartyText | Bounded provider-authored text. Hosts must frame it as data, never instructions. |
| type alias | OpenApiIntakeOptions | Optional owner-declared credential parameter excluded from guest input. |
| type alias | OpenApiRefusalCode | Stable intake and per-operation refusal codes. |
| type alias | OpenApiOperation | Decoded normalized operation ready for selection, not an execution grant. |
| type alias | OpenApiPreviewOperation | An operation’s supported call shape or bounded unsupported reason. |
| constant | openApiOperationSchema | One stored operation, independent of spec-host URLs or credentials. |
| function | normalizeOpenApi() | Pure intake: the host supplies bounded spec text, never a fetch locator. |
| function | parseOpenApiTable() | Decode selected operations before persistence or execution; no authority is granted. |
OpenApiErrorclass
Section titled “OpenApiError”A bounded intake refusal, distinct from a listed unsupported operation.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OpenApiError( code, message, cause?): OpenApiError;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code |
OpenApiRefusalCode |
message |
string |
cause? |
unknown |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor;Properties
Section titled “Properties”readonly name: "OpenApiError" = "OpenApiError";Overrides
Section titled “Overrides”Error.name;readonly code: OpenApiRefusalCode;OpenApiThirdPartyTexttype alias
Section titled “OpenApiThirdPartyText”type OpenApiThirdPartyText = string & z.BRAND<"ThirdPartyText">;Bounded provider-authored text. Hosts must frame it as data, never instructions.
OpenApiIntakeOptionstype alias
Section titled “OpenApiIntakeOptions”type OpenApiIntakeOptions = object;Optional owner-declared credential parameter excluded from guest input.
Properties
Section titled “Properties”authParameter?
Section titled “authParameter?”optional authParameter?: object;in: "header" | "query";name: string;OpenApiRefusalCodetype alias
Section titled “OpenApiRefusalCode”type OpenApiRefusalCode = | "too_large" | "invalid_spec" | "not_openapi3" | "nodes_limit" | "depth_limit" | "alias_limit" | "external_reference" | "recursive_schema" | "operations_limit" | "invalid_operation" | "unsupported_schema" | "parameter_collision" | "unsafe_auth_parameter" | "unsafe_header" | "unsupported_parameter" | "unsupported_media" | "unsupported_path_item" | "unsupported_method" | "table_too_large" | "invalid_table" | "unsafe_name" | "unsafe_path";Stable intake and per-operation refusal codes.
OpenApiOperationtype alias
Section titled “OpenApiOperation”type OpenApiOperation = z.output<typeof openApiOperationSchema>;Decoded normalized operation ready for selection, not an execution grant.
OpenApiPreviewOperationtype alias
Section titled “OpenApiPreviewOperation”type OpenApiPreviewOperation = | OpenApiOperation | { status: "unsupported"; name: string; method: string; path: string; reason: OpenApiRefusalCode; };An operation’s supported call shape or bounded unsupported reason.
openApiOperationSchemaconstant
Section titled “openApiOperationSchema”const openApiOperationSchema: ZodObject< { status: ZodLiteral<"supported">; name: ZodString; method: ZodEnum<{ GET: "GET"; HEAD: "HEAD"; OPTIONS: "OPTIONS"; POST: "POST"; PUT: "PUT"; PATCH: "PATCH"; DELETE: "DELETE"; }>; path: ZodString; effect: ZodEnum<{ write: "write"; read: "read"; }>; description: $ZodBranded<ZodString, "ThirdPartyText", "out">; textSource: ZodLiteral<"third_party">; tags: ZodArray<$ZodBranded<ZodString, "ThirdPartyText", "out">>; parameters: ZodArray< ZodObject< { name: ZodLazy<ZodString>; in: ZodEnum<{ header: "header"; path: "path"; query: "query"; }>; required: ZodDefault<ZodBoolean>; schema: ZodUnion< readonly [ZodRecord<ZodString, ZodJSONSchema>, ZodBoolean] >; style: ZodOptional<ZodString>; explode: ZodOptional<ZodBoolean>; allowReserved: ZodOptional<ZodBoolean>; }, $strip > >; input: ZodPipe< ZodUnknown, ZodType< boolean | Record<string, JSONType>, unknown, $ZodTypeInternals<boolean | Record<string, JSONType>, unknown> > >; output: ZodPipe< ZodUnknown, ZodType< boolean | Record<string, JSONType>, unknown, $ZodTypeInternals<boolean | Record<string, JSONType>, unknown> > >; }, $strict>;One stored operation, independent of spec-host URLs or credentials.
normalizeOpenApi()function
Section titled “normalizeOpenApi()”function normalizeOpenApi( source, options?,): Promise<{ title: string & $brand<"ThirdPartyText">; version: string; servers: string[]; authHints: ( | { scheme: string; kind: "api_key_header" | "api_key_query"; name: string; } | { scheme: string; kind: "bearer" | "oauth" | "unsupported"; } )[]; operations: OpenApiPreviewOperation[]; tableDigest: string;}>;Pure intake: the host supplies bounded spec text, never a fetch locator.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
string |
options |
OpenApiIntakeOptions |
Returns
Section titled “Returns”Promise<{ title: string & $brand<"ThirdPartyText">; version:
string; servers: string[]; authHints: ( | { scheme: string;
kind: "api_key_header" | "api_key_query"; name: string; } | {
scheme: string; kind: "bearer" | "oauth" | "unsupported"; })[];
operations: OpenApiPreviewOperation[];
tableDigest: string; }>
parseOpenApiTable()function
Section titled “parseOpenApiTable()”function parseOpenApiTable(source): Promise<{ operations: object[]; digest: string;}>;Decode selected operations before persistence or execution; no authority is granted.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
unknown |
Returns
Section titled “Returns”Promise<{ operations: object[]; digest: string; }>