apps 0.0.1-beta.100 → 0.0.1-beta.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/framework-reference.json +1 -1
- package/js/openapi.js +4497 -4359
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/implementation/openapi-compile.d.ts +10 -0
- package/types/apps/src/implementation/openapi-document.d.ts +4 -1
- package/types/apps/src/openapi.d.ts +16 -0
|
@@ -11,6 +11,16 @@ import { type OpenApiDocument } from "./openapi-document.js";
|
|
|
11
11
|
* `scripts/check-api-errors.ts` applies this to Executor's own API documents.
|
|
12
12
|
*/
|
|
13
13
|
export declare function errorResponses(document: OpenApiDocument, operation: JsonObject, at: string): OpenapiErrorResponse[];
|
|
14
|
+
/**
|
|
15
|
+
* The tool name, method and declared path of every operation a definition declares, in definition
|
|
16
|
+
* order, whether or not the compiler imports it: the names `compileOpenApiDocument` gives them.
|
|
17
|
+
* The document is consumed, as compilation consumes it.
|
|
18
|
+
*/
|
|
19
|
+
export declare const compiledOperationNames: (document: JsonObject) => Effect.Effect<{
|
|
20
|
+
name: string;
|
|
21
|
+
method: string;
|
|
22
|
+
path: string;
|
|
23
|
+
}[], TemplateError, never>;
|
|
14
24
|
/** Compile a revision of a live OpenAPI source into tool declarations for the app runtime.
|
|
15
25
|
* The document is consumed: compilation upgrades it in place instead of copying it. It must be a
|
|
16
26
|
* tree, with no object reached twice, as parsed JSON is.
|
|
@@ -64,7 +64,10 @@ export declare function openApiDocument(input: JsonObject): Promise<{
|
|
|
64
64
|
* a resolved Response, Parameter, Request Body or Path Item where the definition declares it.
|
|
65
65
|
*/
|
|
66
66
|
origin(value: unknown): string | undefined;
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Inspect the schema a reference reaches without expanding its children: a component, or any
|
|
69
|
+
* other schema in the definition. OpenAPI object references are already resolved.
|
|
70
|
+
*/
|
|
68
71
|
resolve(value: JsonObject): JsonObject;
|
|
69
72
|
/** Compose a Draft 2020-12 schema around API Schema Objects. Only values passed to
|
|
70
73
|
* `api` use the document's OpenAPI dialect; Executor-authored wrappers are already
|
|
@@ -14,4 +14,20 @@ export * from "./contracts/openapi-compile.js";
|
|
|
14
14
|
* operationId, first tag, method and path alone. It reads no document and compiles nothing.
|
|
15
15
|
*/
|
|
16
16
|
export { planOperationNames, type OperationNameInput } from "./implementation/openapi-names.js";
|
|
17
|
+
/** One operation a document declares, as `openapiOperationNames` lists it. */
|
|
18
|
+
export interface OpenapiDeclaredOperation {
|
|
19
|
+
/** The tool name `liveOpenapiRouter` gives the operation. */
|
|
20
|
+
readonly name: string;
|
|
21
|
+
/** The HTTP method, such as `GET`. */
|
|
22
|
+
readonly method: string;
|
|
23
|
+
/** The path as the document declares it. */
|
|
24
|
+
readonly path: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Every operation a document declares, in document order, with the name `liveOpenapiRouter` gives
|
|
28
|
+
* it, whether or not the router can import it. Unlike `planOperationNames`, it reads the document
|
|
29
|
+
* as the router does, references included. It rejects with `OpenapiCompileError` when the
|
|
30
|
+
* document is not one the router reads. The document is not modified.
|
|
31
|
+
*/
|
|
32
|
+
export declare const openapiOperationNames: (document: Readonly<Record<string, unknown>>) => Promise<readonly OpenapiDeclaredOperation[]>;
|
|
17
33
|
export { liveOpenapiRouter, openapiToolNames, type OpenapiSourceOptions, type OpenapiToolNamesOptions, } from "./implementation/openapi-source.js";
|