@wp-typia/block-runtime 0.2.3 → 0.3.0

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.
@@ -0,0 +1,233 @@
1
+ import { cloneJsonValue } from "./json-utils.js";
2
+ import { getWordPressKind, } from "./metadata-model.js";
3
+ export function createBlockJsonAttribute(node, warnings) {
4
+ const attribute = {
5
+ type: getWordPressKind(node),
6
+ };
7
+ if (node.defaultValue !== undefined) {
8
+ attribute.default = cloneJsonValue(node.defaultValue);
9
+ }
10
+ if (node.enumValues !== null && node.enumValues.length > 0) {
11
+ attribute.enum = [...node.enumValues];
12
+ }
13
+ if (node.wp.source !== null) {
14
+ attribute.source = node.wp.source;
15
+ }
16
+ if (node.wp.selector !== null) {
17
+ attribute.selector = node.wp.selector;
18
+ }
19
+ const reasons = [];
20
+ if (node.constraints.exclusiveMaximum !== null)
21
+ reasons.push("exclusiveMaximum");
22
+ if (node.constraints.exclusiveMinimum !== null)
23
+ reasons.push("exclusiveMinimum");
24
+ if (node.constraints.format !== null)
25
+ reasons.push("format");
26
+ if (node.constraints.maxLength !== null)
27
+ reasons.push("maxLength");
28
+ if (node.constraints.maxItems !== null)
29
+ reasons.push("maxItems");
30
+ if (node.constraints.maximum !== null)
31
+ reasons.push("maximum");
32
+ if (node.constraints.minLength !== null)
33
+ reasons.push("minLength");
34
+ if (node.constraints.minItems !== null)
35
+ reasons.push("minItems");
36
+ if (node.constraints.minimum !== null)
37
+ reasons.push("minimum");
38
+ if (node.constraints.multipleOf !== null)
39
+ reasons.push("multipleOf");
40
+ if (node.constraints.pattern !== null)
41
+ reasons.push("pattern");
42
+ if (node.constraints.typeTag !== null)
43
+ reasons.push("typeTag");
44
+ if (node.kind === "array" && node.items !== undefined)
45
+ reasons.push("items");
46
+ if (node.kind === "object" && node.properties !== undefined)
47
+ reasons.push("properties");
48
+ if (node.kind === "union" && node.union !== null)
49
+ reasons.push("union");
50
+ if (reasons.length > 0) {
51
+ warnings.push(`${node.path}: ${reasons.join(", ")}`);
52
+ }
53
+ return attribute;
54
+ }
55
+ export function createManifestAttribute(node) {
56
+ return {
57
+ typia: {
58
+ constraints: { ...node.constraints },
59
+ defaultValue: node.defaultValue === undefined ? null : cloneJsonValue(node.defaultValue),
60
+ hasDefault: node.defaultValue !== undefined,
61
+ },
62
+ ts: {
63
+ items: node.items ? createManifestAttribute(node.items) : null,
64
+ kind: node.kind,
65
+ properties: node.properties
66
+ ? Object.fromEntries(Object.entries(node.properties).map(([key, property]) => [
67
+ key,
68
+ createManifestAttribute(property),
69
+ ]))
70
+ : null,
71
+ required: node.required,
72
+ union: node.union
73
+ ? {
74
+ branches: Object.fromEntries(Object.entries(node.union.branches).map(([key, branch]) => [
75
+ key,
76
+ createManifestAttribute(branch),
77
+ ])),
78
+ discriminator: node.union.discriminator,
79
+ }
80
+ : null,
81
+ },
82
+ wp: {
83
+ defaultValue: node.defaultValue === undefined ? null : cloneJsonValue(node.defaultValue),
84
+ enum: node.enumValues ? [...node.enumValues] : null,
85
+ hasDefault: node.defaultValue !== undefined,
86
+ ...(node.wp.selector !== null ? { selector: node.wp.selector } : {}),
87
+ ...(node.wp.source !== null ? { source: node.wp.source } : {}),
88
+ type: getWordPressKind(node),
89
+ },
90
+ };
91
+ }
92
+ export function createManifestDocument(sourceTypeName, attributes) {
93
+ return {
94
+ attributes: Object.fromEntries(Object.entries(attributes).map(([key, node]) => [
95
+ key,
96
+ createManifestAttribute(node),
97
+ ])),
98
+ manifestVersion: 2,
99
+ sourceType: sourceTypeName,
100
+ };
101
+ }
102
+ export function validateWordPressExtractionAttributes(attributes) {
103
+ for (const attribute of Object.values(attributes)) {
104
+ validateWordPressExtractionAttribute(attribute, true);
105
+ }
106
+ }
107
+ export function validateWordPressExtractionAttribute(node, isTopLevel = false) {
108
+ const hasSelector = node.wp.selector !== null;
109
+ const hasSource = node.wp.source !== null;
110
+ if (hasSelector || hasSource) {
111
+ if (!isTopLevel) {
112
+ throw new Error(`WordPress extraction tags are only supported on top-level block attributes at ${node.path}`);
113
+ }
114
+ if (!hasSelector || !hasSource) {
115
+ throw new Error(`WordPress extraction tags require both Source and Selector at ${node.path}`);
116
+ }
117
+ if (node.kind !== "string") {
118
+ throw new Error(`WordPress extraction tags are only supported on string attributes at ${node.path}`);
119
+ }
120
+ }
121
+ if (node.items !== undefined) {
122
+ validateWordPressExtractionAttribute(node.items, false);
123
+ }
124
+ if (node.properties !== undefined) {
125
+ for (const property of Object.values(node.properties)) {
126
+ validateWordPressExtractionAttribute(property, false);
127
+ }
128
+ }
129
+ if (node.union?.branches) {
130
+ for (const branch of Object.values(node.union.branches)) {
131
+ validateWordPressExtractionAttribute(branch, false);
132
+ }
133
+ }
134
+ }
135
+ export function createExampleValue(node, key) {
136
+ if (node.defaultValue !== undefined) {
137
+ return cloneJsonValue(node.defaultValue);
138
+ }
139
+ if (node.enumValues !== null && node.enumValues.length > 0) {
140
+ return cloneJsonValue(node.enumValues[0]);
141
+ }
142
+ switch (node.kind) {
143
+ case "string":
144
+ return fitStringExampleToConstraints(createFormattedStringExample(node.constraints.format, key), node.constraints);
145
+ case "number":
146
+ return createNumericExample(node);
147
+ case "boolean":
148
+ return true;
149
+ case "array":
150
+ return createArrayExample(node, key);
151
+ case "object":
152
+ return Object.fromEntries(Object.entries(node.properties ?? {}).map(([propertyKey, propertyNode]) => [
153
+ propertyKey,
154
+ createExampleValue(propertyNode, propertyKey),
155
+ ]));
156
+ case "union": {
157
+ const firstBranch = node.union
158
+ ? Object.values(node.union.branches)[0]
159
+ : undefined;
160
+ if (!firstBranch || firstBranch.kind !== "object") {
161
+ return {};
162
+ }
163
+ return Object.fromEntries(Object.entries(firstBranch.properties ?? {}).map(([propertyKey, propertyNode]) => [
164
+ propertyKey,
165
+ createExampleValue(propertyNode, propertyKey),
166
+ ]));
167
+ }
168
+ }
169
+ }
170
+ function createFormattedStringExample(format, key) {
171
+ switch (format) {
172
+ case "uuid":
173
+ return "00000000-0000-4000-8000-000000000000";
174
+ case "email":
175
+ return "example@example.com";
176
+ case "url":
177
+ case "uri":
178
+ return "https://example.com";
179
+ case "ipv4":
180
+ return "127.0.0.1";
181
+ case "ipv6":
182
+ return "::1";
183
+ case "date-time":
184
+ return "2024-01-01T00:00:00Z";
185
+ default:
186
+ return `Example ${key}`;
187
+ }
188
+ }
189
+ function fitStringExampleToConstraints(value, constraints) {
190
+ let nextValue = value;
191
+ if (constraints.maxLength !== null &&
192
+ nextValue.length > constraints.maxLength) {
193
+ nextValue = nextValue.slice(0, constraints.maxLength);
194
+ }
195
+ if (constraints.minLength !== null &&
196
+ nextValue.length < constraints.minLength) {
197
+ nextValue = nextValue.padEnd(constraints.minLength, "x");
198
+ }
199
+ return nextValue;
200
+ }
201
+ function createNumericExample(node) {
202
+ const { exclusiveMaximum, exclusiveMinimum, maximum, minimum, multipleOf, } = node.constraints;
203
+ const step = multipleOf && multipleOf !== 0 ? multipleOf : 1;
204
+ const minCandidate = minimum ?? (exclusiveMinimum !== null ? exclusiveMinimum + step : null);
205
+ const maxCandidate = maximum ?? (exclusiveMaximum !== null ? exclusiveMaximum - step : null);
206
+ let candidate = multipleOf && multipleOf !== 0
207
+ ? minCandidate !== null
208
+ ? Math.ceil(minCandidate / multipleOf) * multipleOf
209
+ : maxCandidate !== null
210
+ ? Math.floor(maxCandidate / multipleOf) * multipleOf
211
+ : multipleOf
212
+ : minCandidate ?? maxCandidate ?? 42;
213
+ if (maxCandidate !== null && candidate > maxCandidate) {
214
+ candidate =
215
+ multipleOf && multipleOf !== 0
216
+ ? Math.floor(maxCandidate / multipleOf) * multipleOf
217
+ : maxCandidate;
218
+ }
219
+ if (minCandidate !== null && candidate < minCandidate) {
220
+ candidate =
221
+ multipleOf && multipleOf !== 0
222
+ ? Math.ceil(minCandidate / multipleOf) * multipleOf
223
+ : minCandidate;
224
+ }
225
+ return candidate;
226
+ }
227
+ function createArrayExample(node, key) {
228
+ const minimumItems = Math.max(node.constraints.minItems ?? 0, 0);
229
+ if (minimumItems === 0 || node.items === undefined) {
230
+ return [];
231
+ }
232
+ return Array.from({ length: minimumItems }, (_value, index) => createExampleValue(node.items, `${key}${index + 1}`));
233
+ }
@@ -0,0 +1,53 @@
1
+ export type JsonPrimitive = string | number | boolean | null;
2
+ export type JsonValue = JsonPrimitive | JsonValue[] | {
3
+ [key: string]: JsonValue;
4
+ };
5
+ export type ManifestTsKind = "string" | "number" | "boolean" | "array" | "object" | "union";
6
+ export interface ManifestConstraints {
7
+ exclusiveMaximum?: number | null;
8
+ exclusiveMinimum?: number | null;
9
+ format?: string | null;
10
+ maxLength?: number | null;
11
+ maxItems?: number | null;
12
+ maximum?: number | null;
13
+ minLength?: number | null;
14
+ minItems?: number | null;
15
+ minimum?: number | null;
16
+ multipleOf?: number | null;
17
+ pattern?: string | null;
18
+ typeTag?: string | null;
19
+ }
20
+ export interface ManifestUnionMetadata {
21
+ discriminator: string;
22
+ branches: Record<string, ManifestAttribute>;
23
+ }
24
+ export interface ManifestTsMetadata {
25
+ items?: ManifestAttribute | null;
26
+ kind: ManifestTsKind;
27
+ properties?: Record<string, ManifestAttribute> | null;
28
+ required?: boolean;
29
+ union?: ManifestUnionMetadata | null;
30
+ }
31
+ export interface ManifestTypiaMetadata {
32
+ constraints: ManifestConstraints;
33
+ defaultValue?: JsonValue | null;
34
+ hasDefault?: boolean;
35
+ }
36
+ export interface ManifestWpMetadata {
37
+ defaultValue?: JsonValue | null;
38
+ enum?: JsonValue[] | null;
39
+ hasDefault?: boolean;
40
+ selector?: string | null;
41
+ source?: "html" | "text" | "rich-text" | null;
42
+ type?: string | null;
43
+ }
44
+ export interface ManifestAttribute {
45
+ ts: ManifestTsMetadata;
46
+ typia: ManifestTypiaMetadata;
47
+ wp: ManifestWpMetadata;
48
+ }
49
+ export interface ManifestDocument {
50
+ attributes?: Record<string, ManifestAttribute>;
51
+ manifestVersion?: number | null;
52
+ sourceType?: string | null;
53
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type UnknownRecord = Record<string, unknown>;
2
+ export declare function isPlainObject(value: unknown): value is UnknownRecord;
@@ -0,0 +1,7 @@
1
+ export function isPlainObject(value) {
2
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
3
+ return false;
4
+ }
5
+ const prototype = Object.getPrototypeOf(value);
6
+ return prototype === Object.prototype || prototype === null;
7
+ }
@@ -0,0 +1,267 @@
1
+ import type { JsonValue, ManifestAttribute, ManifestDocument } from "./migration-types.js";
2
+ export interface JsonSchemaObject {
3
+ [key: string]: JsonValue | JsonSchemaObject | JsonSchemaObject[] | undefined;
4
+ }
5
+ /**
6
+ * Full JSON Schema document for a manifest-derived root object.
7
+ */
8
+ export interface JsonSchemaDocument extends JsonSchemaObject {
9
+ $schema: string;
10
+ additionalProperties: boolean;
11
+ properties: Record<string, JsonSchemaObject>;
12
+ required: string[];
13
+ title: string;
14
+ type: "object";
15
+ }
16
+ /**
17
+ * Document-level metadata applied to generated OpenAPI files.
18
+ */
19
+ export interface OpenApiInfo {
20
+ description?: string;
21
+ title?: string;
22
+ version?: string;
23
+ }
24
+ /**
25
+ * JSON Schema reference used inside generated OpenAPI documents.
26
+ */
27
+ export interface OpenApiSchemaReference extends JsonSchemaObject {
28
+ $ref: string;
29
+ }
30
+ /**
31
+ * OpenAPI query parameter emitted from a manifest attribute.
32
+ */
33
+ export interface OpenApiParameter extends JsonSchemaObject {
34
+ in: "query";
35
+ name: string;
36
+ required: boolean;
37
+ schema: JsonSchemaObject;
38
+ }
39
+ /**
40
+ * OpenAPI media type wrapper for JSON responses and request bodies.
41
+ */
42
+ export interface OpenApiMediaType extends JsonSchemaObject {
43
+ schema: OpenApiSchemaReference;
44
+ }
45
+ /**
46
+ * OpenAPI request body definition for generated JSON endpoints.
47
+ */
48
+ export interface OpenApiRequestBody extends JsonSchemaObject {
49
+ content: {
50
+ "application/json": OpenApiMediaType;
51
+ };
52
+ required: true;
53
+ }
54
+ /**
55
+ * Successful JSON response entry in the generated OpenAPI document.
56
+ */
57
+ export interface OpenApiResponse extends JsonSchemaObject {
58
+ content: {
59
+ "application/json": OpenApiMediaType;
60
+ };
61
+ description: string;
62
+ }
63
+ /**
64
+ * Header-based security scheme used by authenticated WordPress REST routes.
65
+ */
66
+ export interface OpenApiSecurityScheme extends JsonSchemaObject {
67
+ description?: string;
68
+ in: "header";
69
+ name: string;
70
+ type: "apiKey";
71
+ }
72
+ /**
73
+ * One generated OpenAPI operation for a scaffolded REST endpoint.
74
+ */
75
+ export interface OpenApiOperation extends JsonSchemaObject {
76
+ operationId: string;
77
+ parameters?: OpenApiParameter[];
78
+ requestBody?: OpenApiRequestBody;
79
+ responses: Record<string, OpenApiResponse>;
80
+ security?: Array<Record<string, string[]>>;
81
+ summary?: string;
82
+ tags: string[];
83
+ "x-typia-authIntent": EndpointAuthIntent;
84
+ "x-wp-typia-authPolicy"?: EndpointOpenApiAuthMode;
85
+ "x-wp-typia-publicTokenField"?: string;
86
+ }
87
+ /**
88
+ * Path item containing one or more generated REST operations.
89
+ */
90
+ export type OpenApiPathItem = JsonSchemaObject & Partial<Record<Lowercase<EndpointOpenApiMethod>, OpenApiOperation>>;
91
+ /**
92
+ * Named tag entry surfaced at the top level of generated OpenAPI docs.
93
+ */
94
+ export interface OpenApiTag extends JsonSchemaObject {
95
+ name: string;
96
+ }
97
+ /**
98
+ * OpenAPI component registry for generated schemas and security schemes.
99
+ */
100
+ export interface OpenApiComponents extends JsonSchemaObject {
101
+ schemas: Record<string, JsonSchemaDocument>;
102
+ securitySchemes?: Record<string, OpenApiSecurityScheme>;
103
+ }
104
+ /**
105
+ * Complete OpenAPI 3.1 document emitted for endpoint-aware REST contracts.
106
+ */
107
+ export interface OpenApiDocument extends JsonSchemaObject {
108
+ components: OpenApiComponents;
109
+ info: {
110
+ description?: string;
111
+ title: string;
112
+ version: string;
113
+ };
114
+ openapi: "3.1.0";
115
+ paths: Record<string, OpenApiPathItem>;
116
+ tags?: OpenApiTag[];
117
+ }
118
+ /**
119
+ * Backend-neutral auth intent for one manifest-defined endpoint.
120
+ */
121
+ export type EndpointAuthIntent = "authenticated" | "public" | "public-write-protected";
122
+ /**
123
+ * WordPress-specific authentication mechanisms that can implement neutral auth intent.
124
+ */
125
+ export type EndpointWordPressAuthMechanism = "public-signed-token" | "rest-nonce";
126
+ /**
127
+ * Optional WordPress adapter metadata that explains how the default runtime satisfies auth intent.
128
+ */
129
+ export interface EndpointWordPressAuthDefinition {
130
+ mechanism: EndpointWordPressAuthMechanism;
131
+ publicTokenField?: string;
132
+ }
133
+ /**
134
+ * Legacy WordPress auth-mode literals kept for backward compatibility.
135
+ */
136
+ export type EndpointOpenApiAuthMode = "authenticated-rest-nonce" | "public-read" | "public-signed-token";
137
+ /**
138
+ * Supported HTTP methods for generated REST OpenAPI endpoints.
139
+ */
140
+ export type EndpointOpenApiMethod = "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
141
+ /**
142
+ * Contract document used when composing an endpoint-aware OpenAPI file.
143
+ */
144
+ export interface EndpointOpenApiContractDocument {
145
+ /** Manifest-derived contract document for this schema component. */
146
+ document: ManifestDocument;
147
+ /** Optional component name override for the generated schema reference. */
148
+ schemaName?: string;
149
+ }
150
+ interface EndpointOpenApiEndpointBaseDefinition {
151
+ /** Authentication policy surfaced in OpenAPI metadata. */
152
+ auth?: EndpointAuthIntent;
153
+ /** @deprecated Prefer `auth` plus `wordpressAuth` for new manifests. */
154
+ authMode?: EndpointOpenApiAuthMode;
155
+ /** Contract key for a JSON request body, when the endpoint accepts one. */
156
+ bodyContract?: string;
157
+ /** HTTP method exposed by the route. */
158
+ method: EndpointOpenApiMethod;
159
+ /** Stable OpenAPI operation id for this route. */
160
+ operationId: string;
161
+ /** Absolute REST path including namespace and version. */
162
+ path: string;
163
+ /** Contract key for query parameters, when the endpoint reads from the query string. */
164
+ queryContract?: string;
165
+ /** Contract key for the successful JSON response body. */
166
+ responseContract: string;
167
+ /** Optional short endpoint summary shown in generated docs. */
168
+ summary?: string;
169
+ /** OpenAPI tag names applied to this endpoint. */
170
+ tags: readonly string[];
171
+ /** Optional WordPress adapter metadata for the default runtime. */
172
+ wordpressAuth?: EndpointWordPressAuthDefinition;
173
+ }
174
+ /**
175
+ * Route metadata for one REST endpoint in the aggregate OpenAPI document.
176
+ */
177
+ export type EndpointOpenApiEndpointDefinition = (EndpointOpenApiEndpointBaseDefinition & {
178
+ auth: EndpointAuthIntent;
179
+ }) | (EndpointOpenApiEndpointBaseDefinition & {
180
+ /** @deprecated Prefer `auth` plus `wordpressAuth` for new manifests. */
181
+ authMode: EndpointOpenApiAuthMode;
182
+ });
183
+ export interface NormalizedEndpointAuthDefinition {
184
+ auth: EndpointAuthIntent;
185
+ authMode?: EndpointOpenApiAuthMode;
186
+ wordpressAuth?: EndpointWordPressAuthDefinition;
187
+ }
188
+ /**
189
+ * Options for building an aggregate endpoint-aware OpenAPI document.
190
+ */
191
+ export interface EndpointOpenApiDocumentOptions {
192
+ /** Named contract documents keyed by the endpoint registry identifiers. */
193
+ contracts: Readonly<Record<string, EndpointOpenApiContractDocument>>;
194
+ /** Route definitions that should appear in the generated OpenAPI file. */
195
+ endpoints: readonly EndpointOpenApiEndpointDefinition[];
196
+ /** Optional document-level OpenAPI info metadata. */
197
+ info?: OpenApiInfo;
198
+ }
199
+ /**
200
+ * Supported schema projection profiles derived from one canonical wp-typia JSON Schema document.
201
+ */
202
+ export type JsonSchemaProjectionProfile = "ai-structured-output" | "rest";
203
+ /**
204
+ * Options for projecting one generated JSON Schema document into another consumer-facing profile.
205
+ */
206
+ export interface JsonSchemaProjectionOptions {
207
+ /** Projection profile that controls schema transformation rules. */
208
+ profile: JsonSchemaProjectionProfile;
209
+ }
210
+ /**
211
+ * Converts one manifest attribute definition into a JSON Schema fragment.
212
+ *
213
+ * @param attribute Manifest-derived attribute metadata.
214
+ * @returns A JSON-compatible schema fragment for the attribute.
215
+ */
216
+ export declare function manifestAttributeToJsonSchema(attribute: ManifestAttribute): JsonSchemaObject;
217
+ /**
218
+ * Builds a full JSON Schema document from a Typia manifest document.
219
+ *
220
+ * @param doc Manifest-derived attribute document.
221
+ * @returns A draft 2020-12 JSON Schema document for the manifest root object.
222
+ */
223
+ export declare function manifestToJsonSchema(doc: ManifestDocument): JsonSchemaDocument;
224
+ /**
225
+ * Projects one generated wp-typia JSON Schema document into a consumer-facing profile.
226
+ *
227
+ * @param schema Existing generated JSON Schema document.
228
+ * @param options Projection profile options.
229
+ * @returns A cloned schema document adjusted for the requested profile.
230
+ */
231
+ export declare function projectJsonSchemaDocument<Schema extends JsonSchemaDocument | JsonSchemaObject>(schema: Schema, options: JsonSchemaProjectionOptions): Schema;
232
+ /**
233
+ * Wraps a manifest-derived JSON Schema document in a minimal OpenAPI 3.1 shell.
234
+ *
235
+ * @param doc Manifest-derived attribute document.
236
+ * @param info Optional OpenAPI document metadata.
237
+ * @returns An OpenAPI document containing the schema as a single component.
238
+ */
239
+ export declare function manifestToOpenApi(doc: ManifestDocument, info?: OpenApiInfo): OpenApiDocument;
240
+ /**
241
+ * Normalizes endpoint auth metadata into backend-neutral intent plus optional
242
+ * WordPress adapter details.
243
+ *
244
+ * This public runtime helper accepts either the authored `auth` and optional
245
+ * `wordpressAuth` shape or the deprecated `authMode` field. It validates that
246
+ * the provided fields are compatible, resolves the legacy compatibility mode,
247
+ * and returns a normalized definition without mutating the input endpoint.
248
+ *
249
+ * @param endpoint - Endpoint auth fields to normalize, including `auth`,
250
+ * `authMode`, `wordpressAuth`, and optional identity fields used in error
251
+ * messages (`operationId`, `path`, and `method`).
252
+ * @returns The normalized auth definition for the endpoint.
253
+ * @throws When `auth` and deprecated `authMode` conflict.
254
+ * @throws When `wordpressAuth` is attached to the `public` auth intent.
255
+ * @throws When the selected `wordpressAuth` mechanism is incompatible with the
256
+ * chosen auth intent.
257
+ * @throws When neither `auth` nor deprecated `authMode` is defined.
258
+ */
259
+ export declare function normalizeEndpointAuthDefinition(endpoint: Pick<EndpointOpenApiEndpointDefinition, "auth" | "authMode" | "operationId" | "path" | "wordpressAuth" | "method">): NormalizedEndpointAuthDefinition;
260
+ /**
261
+ * Build a complete OpenAPI 3.1 document from contract manifests and route metadata.
262
+ *
263
+ * @param options Aggregate contract and endpoint definitions for the REST surface.
264
+ * @returns A JSON-compatible OpenAPI document with paths, components, and auth metadata.
265
+ */
266
+ export declare function buildEndpointOpenApiDocument(options: EndpointOpenApiDocumentOptions): OpenApiDocument;
267
+ export {};