@velajs/cli 1.25.0 → 1.26.1
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/README.md +8 -1
- package/dist/{client-contract-R3_sMYFQ.js → client-contract-DUkUZGpU.js} +14 -5
- package/dist/client-contract-DUkUZGpU.js.map +1 -0
- package/dist/client-contract.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +4 -4
- package/templates/worker/package.json +2 -2
- package/dist/client-contract-R3_sMYFQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -196,4 +196,11 @@ bare `hc` always serializes forms as multipart. Wrap per-call fetch overrides to
|
|
|
196
196
|
Custom part encodings, nested form values, and binary JSON bodies fail generation
|
|
197
197
|
with diagnostics. See the [HTTP guide](../../docs/client/HTTP.md#form-bodies-and-uploads).
|
|
198
198
|
|
|
199
|
-
Supported: JSON bodies, JSON/text responses with status narrowing, string path/query/header inputs, repeated query arrays, component references, object/array/enum/union/intersection/nullable schemas. Unsupported encodings, custom serialization and unresolved references fail with a diagnostic. Global middleware/error responses must be documented or added with Hono's `ApplyGlobalResponse`. Generation does not validate server responses at runtime. Raw Hono mounts and live-query resolver contracts are not inferred.
|
|
199
|
+
Supported: JSON bodies, JSON/text and binary/stream/native responses with status narrowing, string path/query/header inputs, repeated query arrays, component references, object/array/enum/union/intersection/nullable schemas. Unsupported encodings, custom serialization and unresolved references fail with a diagnostic. Global middleware/error responses must be documented or added with Hono's `ApplyGlobalResponse`. Generation does not validate server responses at runtime. Raw Hono mounts and live-query resolver contracts are not inferred.
|
|
200
|
+
|
|
201
|
+
Native endpoint formats export `x-vela-response-format` with the declared media
|
|
202
|
+
type. Generated binary/stream calls expose blob/byte-stream consumption and keep
|
|
203
|
+
`.json()` unknown. Imported event-stream/NDJSON media and binary schemas are
|
|
204
|
+
recognized; multiple response media types use an unknown native contract. Use
|
|
205
|
+
`readHttpResponse` from `@velajs/client/http` to retain the response, consume a
|
|
206
|
+
blob, or access an unread stream. See the [HTTP guide](../../docs/client/HTTP.md).
|
|
@@ -58,6 +58,11 @@ const requestBody = z.object({
|
|
|
58
58
|
$ref: z.string().optional()
|
|
59
59
|
}).passthrough();
|
|
60
60
|
const response = z.object({
|
|
61
|
+
"x-vela-response-format": z.enum([
|
|
62
|
+
"binary",
|
|
63
|
+
"stream",
|
|
64
|
+
"response"
|
|
65
|
+
]).optional(),
|
|
61
66
|
content: content.optional(),
|
|
62
67
|
$ref: z.string().optional()
|
|
63
68
|
}).passthrough();
|
|
@@ -418,15 +423,19 @@ function generateClientContract(input) {
|
|
|
418
423
|
if (statusType.includes("HttpStatus")) usesHttpStatus = true;
|
|
419
424
|
const content = response.content ?? {};
|
|
420
425
|
const media = Object.keys(content);
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
|
|
426
|
+
const declaredFormat = response["x-vela-response-format"];
|
|
427
|
+
const mediaType = media[0];
|
|
428
|
+
const mediaSchema = content[mediaType ?? ""]?.schema;
|
|
429
|
+
const binarySchema = typeof mediaSchema === "object" && mediaSchema.type === "string" && mediaSchema.format === "binary";
|
|
430
|
+
const format = declaredFormat ?? (media.length > 1 ? "response" : mediaType === "text/plain" ? "text" : mediaType === "text/event-stream" || mediaType === "application/x-ndjson" || mediaType === "application/ndjson" ? "stream" : mediaType === "application/octet-stream" || mediaType !== "application/json" && mediaType !== "text/plain" && binarySchema ? "binary" : mediaType && mediaType !== "application/json" ? "response" : "json");
|
|
431
|
+
const native = format === "binary" || format === "stream" || format === "response";
|
|
432
|
+
if (!native) rejectBinaryJson(content[mediaType ?? ""]?.schema, `${at} response ${status}`);
|
|
424
433
|
const bodyType = [
|
|
425
434
|
"101",
|
|
426
435
|
"204",
|
|
427
436
|
"205",
|
|
428
437
|
"304"
|
|
429
|
-
].includes(status) || method === "head" ? "never" : schemaType(content[
|
|
438
|
+
].includes(status) || method === "head" ? "never" : native ? format === "binary" ? "Blob" : format === "stream" ? "ReadableStream<Uint8Array> | null" : "unknown" : schemaType(content[mediaType ?? ""]?.schema, `${at} response ${status}`);
|
|
430
439
|
const output = format === "text" ? `Extract<${bodyType}, string> extends never ? string : Extract<${bodyType}, string>` : bodyType;
|
|
431
440
|
variants.push(`{ input: ${input}; output: ${output}; outputFormat: '${format}'; status: ${statusType} }`);
|
|
432
441
|
}
|
|
@@ -470,4 +479,4 @@ function rangeStatus(status) {
|
|
|
470
479
|
//#endregion
|
|
471
480
|
export { generateClientContract as t };
|
|
472
481
|
|
|
473
|
-
//# sourceMappingURL=client-contract-
|
|
482
|
+
//# sourceMappingURL=client-contract-DUkUZGpU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-contract-DUkUZGpU.js","names":[],"sources":["../src/client-contract-input.ts","../src/client-contract.ts"],"sourcesContent":["import { z } from 'zod';\n\n// This is the projection consumed by code generation, not a claim that an\n// arbitrary document satisfies every OpenAPI requirement. Decode both JSON\n// input and runtime-generated metadata before accessing their nested fields.\nconst schemaType = z.enum(['null', 'boolean', 'object', 'array', 'number', 'integer', 'string']);\ntype SchemaType = z.infer<typeof schemaType>;\ntype Scalar = string | number | boolean | null;\n\nexport type ContractSchema = boolean | ContractSchemaObject;\nexport interface ContractSchemaObject {\n type?: SchemaType | SchemaType[];\n format?: string;\n enum?: Scalar[];\n const?: unknown;\n nullable?: boolean;\n readOnly?: boolean;\n writeOnly?: boolean;\n items?: ContractSchema;\n properties?: Record<string, ContractSchema>;\n required?: string[];\n additionalProperties?: ContractSchema;\n oneOf?: ContractSchema[];\n anyOf?: ContractSchema[];\n allOf?: ContractSchema[];\n $ref?: string;\n [keyword: string]: unknown;\n}\n\nconst scalar = z.union([z.string(), z.number().finite(), z.boolean(), z.null()]);\nconst schema: z.ZodType<ContractSchema> = z.lazy(() =>\n z.union([\n z.boolean(),\n z\n .object({\n type: z.union([schemaType, z.array(schemaType).nonempty()]).optional(),\n format: z.string().optional(),\n enum: z.array(scalar).optional(),\n const: scalar.optional(),\n nullable: z.boolean().optional(),\n readOnly: z.boolean().optional(),\n writeOnly: z.boolean().optional(),\n items: schema.optional(),\n properties: z.record(z.string(), schema).optional(),\n required: z.array(z.string()).optional(),\n additionalProperties: schema.optional(),\n oneOf: z.array(schema).optional(),\n anyOf: z.array(schema).optional(),\n allOf: z.array(schema).optional(),\n $ref: z.string().min(1).optional(),\n })\n .passthrough(),\n ]),\n);\n\nconst parameter = z\n .object({\n name: z.string().min(1),\n in: z.enum(['path', 'query', 'header', 'cookie']),\n required: z.boolean().optional(),\n schema: schema.optional(),\n style: z.string().optional(),\n explode: z.boolean().optional(),\n // Keep unsupported representations explicit so they cannot disappear\n // during projection and accidentally become a fabricated string input.\n $ref: z.string().optional(),\n content: z.unknown().optional(),\n })\n .passthrough();\nexport type ContractParameter = z.infer<typeof parameter>;\n\nconst media = z\n .object({ schema: schema.optional(), encoding: z.unknown().optional() })\n .passthrough();\nconst content = z.record(z.string(), media);\nconst requestBody = z\n .object({\n required: z.boolean().optional(),\n content: content.optional(),\n $ref: z.string().optional(),\n })\n .passthrough();\nconst response = z\n .object({\n 'x-vela-response-format': z.enum(['binary', 'stream', 'response']).optional(),\n content: content.optional(),\n $ref: z.string().optional(),\n })\n .passthrough();\nconst operation = z\n .object({\n parameters: z.array(parameter).optional(),\n requestBody: requestBody.optional(),\n responses: z.record(z.string(), response),\n 'x-vela-client-unsupported': z.array(z.string()).optional(),\n })\n .passthrough();\nexport type ContractOperation = z.infer<typeof operation>;\n\nconst pathItem = z\n .object({\n get: operation.optional(),\n post: operation.optional(),\n put: operation.optional(),\n patch: operation.optional(),\n delete: operation.optional(),\n options: operation.optional(),\n head: operation.optional(),\n parameters: z.unknown().optional(),\n $ref: z.string().optional(),\n })\n .passthrough();\n\nconst document = z.object({\n openapi: z.string().regex(/^3\\.[01]\\.\\d+$/, 'expected OpenAPI 3.0.x or 3.1.x'),\n paths: z.record(z.string(), pathItem),\n components: z\n .object({ schemas: z.record(z.string(), schema).optional() })\n .passthrough()\n .optional(),\n});\n\n/** Read only structurally validated data. Unsupported constructs remain explicit. */\nexport function parseClientContractDocument(input: unknown): z.infer<typeof document> {\n // Zod recursively walks schemas. Refuse cyclic/excessively deep object input\n // (JSON files cannot contain cycles) with a diagnostic rather than overflowing.\n checkTree(input, '$', new Set<object>(), 0);\n const result = document.safeParse(input);\n if (!result.success) {\n const details = result.error.issues.map(\n (issue) => `${issue.path.join('.') || '$'}: ${issue.message}`,\n );\n throw new Error(`Invalid OpenAPI client contract:\\n${details.join('\\n')}`);\n }\n return result.data;\n}\n\nfunction checkTree(value: unknown, at: string, ancestors: Set<object>, depth: number): void {\n if (value === null || typeof value !== 'object') return;\n if (depth > 100)\n throw new Error(`Invalid OpenAPI client contract: ${at} exceeds 100 nested levels.`);\n if (ancestors.has(value))\n throw new Error(`Invalid OpenAPI client contract: ${at} contains a cycle; use $ref.`);\n ancestors.add(value);\n for (const [key, child] of Object.entries(value))\n checkTree(child, `${at}.${key}`, ancestors, depth + 1);\n ancestors.delete(value);\n}\n","import type { HttpVerb } from '@velajs/vela';\nimport { parseClientContractDocument } from './client-contract-input.js';\nimport type {\n ContractOperation,\n ContractParameter,\n ContractSchema,\n} from './client-contract-input.js';\n\nconst METHODS: HttpVerb[] = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head'];\nconst quote = (value: string): string => JSON.stringify(value);\n// Hono uses -1 for unofficial statuses. Reject those here so the generated\n// status literals always satisfy its public StatusCode contract.\nconst HTTP_STATUSES = new Set([\n 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304,\n 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,\n 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504,\n 505, 506, 507, 508, 510, 511,\n]);\n\nexport interface GeneratedClientContract {\n source: string;\n warnings: string[];\n}\n\n/** Generate hc types and optional form encoding metadata, without application imports. */\nexport function generateClientContract(input: unknown): GeneratedClientContract {\n const document = parseClientContractDocument(input);\n const warnings = new Set<string>();\n const components = document.components?.schemas ?? {};\n const formEncodings: { path: string; method: string; contentType: string }[] = [];\n let usesHttpStatus = false;\n const warn = (message: string): void => {\n warnings.add(message);\n };\n\n function schemaType(schema: ContractSchema | undefined, at: string): string {\n if (schema === false) return 'never';\n if (schema === true) return 'unknown';\n if (!schema || Object.keys(schema).length === 0) {\n warn(`${at}: no schema; emitted unknown.`);\n return 'unknown';\n }\n if (schema.readOnly || schema.writeOnly) {\n throw new Error(\n `${at}: readOnly/writeOnly schemas require separate request and response definitions.`,\n );\n }\n for (const keyword of [\n '$dynamicRef',\n 'prefixItems',\n 'patternProperties',\n 'not',\n 'if',\n 'then',\n 'else',\n 'dependentSchemas',\n 'unevaluatedProperties',\n ] as const) {\n if (schema[keyword] !== undefined)\n throw new Error(`${at}: unsupported schema keyword ${keyword}.`);\n }\n const parts: string[] = [];\n if (schema.$ref) {\n const prefix = '#/components/schemas/';\n const name = schema.$ref.startsWith(prefix)\n ? schema.$ref.slice(prefix.length).replace(/~1/g, '/').replace(/~0/g, '~')\n : undefined;\n if (name === undefined || !Object.hasOwn(components, name)) {\n throw new Error(\n `${at}: unsupported or unresolved reference ${schema.$ref}. Bundle references into components.schemas first.`,\n );\n }\n parts.push(`Schemas[${quote(name)}]`);\n }\n if ('const' in schema) parts.push(literal(schema.const, at));\n else if (schema.enum) parts.push(schema.enum.map((v) => literal(v, at)).join(' | ') || 'never');\n for (const key of ['oneOf', 'anyOf', 'allOf'] as const) {\n const members = schema[key];\n if (members)\n parts.push(\n members.map((s) => `(${schemaType(s, at)})`).join(key === 'allOf' ? ' & ' : ' | ') ||\n 'never',\n );\n }\n if (Array.isArray(schema.type)) {\n parts.push(\n schema.type\n .map((type) =>\n schemaType(\n {\n ...schema,\n type,\n nullable: false,\n $ref: undefined,\n enum: undefined,\n oneOf: undefined,\n anyOf: undefined,\n allOf: undefined,\n },\n at,\n ),\n )\n .join(' | '),\n );\n } else if (\n schema.type === 'object' ||\n (schema.type === undefined && (schema.properties || schema.additionalProperties))\n ) {\n const required = new Set(schema.required ?? []);\n const fields = Object.entries(schema.properties ?? {})\n .toSorted(([a], [b]) => a.localeCompare(b))\n .map(\n ([key, value]) =>\n `${quote(key)}${required.has(key) ? '' : '?'}: ${schemaType(value, `${at}.${key}`)};`,\n );\n if (schema.additionalProperties !== false) {\n // Unknown is intentional when properties coexist with a dictionary:\n // a narrow index signature could make declared properties impossible.\n const additional =\n typeof schema.additionalProperties === 'object' && fields.length === 0\n ? schemaType(schema.additionalProperties, `${at}.*`)\n : 'unknown';\n if (typeof schema.additionalProperties === 'object' && fields.length > 0)\n warn(`${at}: additionalProperties alongside named properties is widened to unknown.`);\n fields.push(`[key: string]: ${additional};`);\n }\n parts.push(fields.length ? `{ ${fields.join(' ')} }` : 'Record<string, never>');\n } else if (schema.type === 'array') {\n parts.push(`Array<${schemaType(schema.items, `${at}[]`)}>`);\n } else if (schema.type === 'string') {\n parts.push(schema.format === 'binary' ? 'File | Blob' : 'string');\n } else if (schema.type === 'number' || schema.type === 'integer') {\n parts.push('number');\n } else if (schema.type === 'boolean' || schema.type === 'null') {\n parts.push(schema.type);\n } else if (schema.type) {\n throw new Error(`${at}: unsupported schema type ${schema.type}.`);\n }\n if (!parts.length) {\n warn(`${at}: schema has no representable type; emitted unknown.`);\n return 'unknown';\n }\n const value = parts.map((part) => `(${part})`).join(' & ');\n return schema.nullable ? `(${value}) | null` : value;\n }\n\n function resolveFormSchema(\n value: ContractSchema | undefined,\n at: string,\n seen = new Set<string>(),\n ): Exclude<ContractSchema, boolean> {\n if (!value || typeof value !== 'object')\n throw new Error(`${at}: form fields require concrete schemas.`);\n if (!value.$ref) return value;\n const prefix = '#/components/schemas/';\n const name = value.$ref.startsWith(prefix)\n ? value.$ref.slice(prefix.length).replace(/~1/g, '/').replace(/~0/g, '~')\n : '';\n if (!Object.hasOwn(components, name))\n throw new Error(`${at}: unsupported or unresolved reference ${value.$ref}.`);\n if (seen.has(value.$ref)) throw new Error(`${at}: recursive form schemas are unsupported.`);\n if (Object.keys(value).some((key) => !['$ref', 'description', 'title'].includes(key)))\n throw new Error(`${at}: form references with schema siblings are unsupported.`);\n return resolveFormSchema(components[name], at, new Set(seen).add(value.$ref));\n }\n\n function formType(\n value: ContractSchema | undefined,\n encoding: unknown,\n contentType: string,\n at: string,\n ): string {\n const schema = resolveFormSchema(value, at);\n schemaType(schema, at); // Retain the generator's structural-keyword checks.\n if (\n schema.type !== 'object' ||\n !schema.properties ||\n schema.oneOf ||\n schema.anyOf ||\n schema.allOf ||\n schema.nullable ||\n (schema.additionalProperties !== undefined && schema.additionalProperties !== false)\n )\n throw new Error(\n `${at}: form bodies require an object with named fields and no additionalProperties schema.`,\n );\n if (encoding !== undefined) {\n if (encoding === null || typeof encoding !== 'object' || Array.isArray(encoding))\n throw new Error(`${at}: invalid form encoding.`);\n for (const [name, entry] of Object.entries(encoding)) {\n if (\n !Object.hasOwn(schema.properties, name) ||\n !entry ||\n typeof entry !== 'object' ||\n Array.isArray(entry) ||\n Object.entries(entry).some(\n ([key, value]) =>\n !((key === 'style' && value === 'form') || (key === 'explode' && value === true)),\n )\n )\n throw new Error(\n `${at}: unsupported form serialization for ${name}; use repeated fields with style form and explode true.`,\n );\n }\n }\n const fieldType = (value: ContractSchema | undefined, name: string, array = false): string => {\n const field = resolveFormSchema(value, `${at}.${name}`);\n schemaType(field, `${at}.${name}`);\n if (\n field.oneOf ||\n field.anyOf ||\n field.allOf ||\n field.nullable ||\n field.readOnly ||\n field.writeOnly\n )\n throw new Error(`${at}.${name}: ambiguous form wire schema.`);\n if (field.type === 'array' && !array) return `Array<${fieldType(field.items, name, true)}>`;\n if (field.type !== 'string')\n throw new Error(\n `${at}.${name}: form wire fields must be strings, binary files, or arrays of these.`,\n );\n const file = field.format === 'binary';\n if (file && contentType !== 'multipart/form-data')\n throw new Error(`${at}.${name}: files require multipart/form-data.`);\n if (field.contentEncoding !== undefined && !(file && field.contentEncoding === 'binary'))\n throw new Error(`${at}.${name}: unsupported contentEncoding.`);\n if (\n (field.enum && field.enum.some((entry) => typeof entry !== 'string')) ||\n ('const' in field && typeof field.const !== 'string') ||\n (file && (field.enum || 'const' in field))\n )\n throw new Error(`${at}.${name}: invalid form scalar literal.`);\n return schemaType(field, `${at}.${name}`);\n };\n const required = new Set(schema.required ?? []);\n const fields = Object.entries(schema.properties)\n .toSorted(([a], [b]) => a.localeCompare(b))\n .map(\n ([name, value]) =>\n `${quote(name)}${required.has(name) ? '' : '?'}: ${fieldType(value, name)};`,\n );\n return fields.length ? `{ ${fields.join(' ')} }` : 'Record<string, never>';\n }\n\n function rejectBinaryJson(\n value: ContractSchema | undefined,\n at: string,\n seen = new Set<string>(),\n ): void {\n if (!value || typeof value !== 'object') return;\n if (value.format === 'binary')\n throw new Error(\n `${at}: binary files require multipart form fields; JSON/text serialization is unsupported.`,\n );\n if (value.$ref && !seen.has(value.$ref)) {\n seen.add(value.$ref);\n const name = value.$ref\n .slice('#/components/schemas/'.length)\n .replace(/~1/g, '/')\n .replace(/~0/g, '~');\n rejectBinaryJson(components[name], at, seen);\n }\n for (const child of [\n ...Object.values(value.properties ?? {}),\n value.items,\n typeof value.additionalProperties === 'object' ? value.additionalProperties : undefined,\n ...(value.oneOf ?? []),\n ...(value.anyOf ?? []),\n ...(value.allOf ?? []),\n ])\n rejectBinaryJson(child, at, seen);\n }\n\n function wireType(\n value: ContractSchema | undefined,\n at: string,\n seen = new Set<string>(),\n ): string {\n if (value === false) return 'never';\n const schema = value === true ? undefined : value;\n if (schema?.$ref) {\n schemaType(schema, at); // validate reference\n if (seen.has(schema.$ref))\n throw new Error(`${at}: recursive parameter schemas are unsupported.`);\n const name = schema.$ref\n .slice('#/components/schemas/'.length)\n .replace(/~1/g, '/')\n .replace(/~0/g, '~');\n return wireType(components[name], at, new Set(seen).add(schema.$ref));\n }\n if (schema?.type === 'array') {\n const item = wireType(schema.items, at, seen);\n if (item.startsWith('Array<')) throw new Error(`${at}: nested query arrays are unsupported.`);\n return `Array<${item}>`;\n }\n if (\n schema?.type === 'object' ||\n schema?.properties ||\n schema?.oneOf ||\n schema?.anyOf ||\n schema?.allOf ||\n Array.isArray(schema?.type)\n ) {\n throw new Error(\n `${at}: structured parameters need a custom serializer and are not supported by this generator.`,\n );\n }\n if (schema?.enum) return schema.enum.map((v) => quote(String(v))).join(' | ') || 'never';\n return 'string';\n }\n\n function inputType(\n path: string,\n operation: ContractOperation,\n at: string,\n method: string,\n ): string {\n const parameters = [...(operation.parameters ?? [])];\n for (const p of parameters) {\n if (!['path', 'query', 'header', 'cookie'].includes(p.in) || typeof p.name !== 'string')\n throw new Error(`${at}: unresolved or invalid parameter.`);\n }\n for (const match of path.matchAll(/:([A-Za-z_][A-Za-z0-9_]*)/g)) {\n const name = match[1]!;\n if (!parameters.some((p) => p.in === 'path' && p.name === name))\n parameters.push({ name, in: 'path', required: true });\n }\n const fields: string[] = [];\n for (const [location, key] of [\n ['path', 'param'],\n ['query', 'query'],\n ['header', 'header'],\n ] as const) {\n const group = parameters.filter((p) => p.in === location);\n if (!group.length) continue;\n const required = location === 'path' || group.some((p) => p.required);\n fields.push(\n `${key}${required ? '' : '?'}: { ${group.map((p) => parameterType(p, location, at)).join(' ')} };`,\n );\n }\n if (parameters.some((p) => p.in === 'cookie'))\n throw new Error(\n `${at}: cookie parameters are unsupported; configure browser credentials through hc options.`,\n );\n if (operation.requestBody) {\n const body = operation.requestBody;\n if (body.$ref)\n throw new Error(`${at}: resolve requestBody references before generating a client.`);\n const content = body.content ?? {};\n const media = Object.keys(content);\n const contentType = media[0];\n if (\n media.length !== 1 ||\n !contentType ||\n !['application/json', 'multipart/form-data', 'application/x-www-form-urlencoded'].includes(\n contentType,\n )\n )\n throw new Error(\n `${at}: request bodies must declare exactly one supported media type: application/json, multipart/form-data, or application/x-www-form-urlencoded.`,\n );\n if (method === 'get' || method === 'head')\n throw new Error(`${at}: hc cannot send a request body for GET or HEAD.`);\n const entry = content[contentType];\n if (contentType === 'application/json') {\n rejectBinaryJson(entry?.schema, `${at} request body`);\n fields.push(\n `json${body.required ? '' : '?'}: ${schemaType(entry?.schema, `${at} request body`)};`,\n );\n } else {\n fields.push(\n `form${body.required ? '' : '?'}: ${formType(entry?.schema, entry?.encoding, contentType, `${at} request body`)};`,\n );\n formEncodings.push({ path, method: method.toUpperCase(), contentType });\n }\n }\n return fields.length ? `{ ${fields.join(' ')} }` : '{}';\n }\n\n function parameterType(p: ContractParameter, location: string, at: string): string {\n if (p.$ref || p.style || p.explode === false || p.content !== undefined)\n throw new Error(\n `${at}: custom parameter serialization/references are unsupported (${p.name}).`,\n );\n const type = wireType(p.schema, `${at} parameter ${p.name}`);\n if (location !== 'query' && type.startsWith('Array<'))\n throw new Error(`${at}: only query parameters support arrays.`);\n return `${quote(p.name)}${location === 'path' || p.required ? '' : '?'}: ${type};`;\n }\n\n const paths: string[] = [];\n for (const [openApiPath, item] of Object.entries(document.paths).toSorted(([a], [b]) =>\n a.localeCompare(b),\n )) {\n // Hono's proxy consumes one path segment per property. Reject templates it\n // cannot faithfully round-trip rather than generate a misleading client.\n if (\n !openApiPath.startsWith('/') ||\n openApiPath\n .slice(1)\n .split('/')\n .some(\n (segment) =>\n segment !== '' && !/^(?:[A-Za-z0-9_.~-]+|\\{[A-Za-z_][A-Za-z0-9_]*\\})$/.test(segment),\n ) ||\n openApiPath.includes('//') ||\n (openApiPath !== '/' && openApiPath.endsWith('/'))\n )\n throw new Error(`Unsupported client path: ${openApiPath}`);\n const path = openApiPath.replace(/\\{([^}]+)\\}/g, ':$1');\n if (\n path\n .split('/')\n .some(\n (segment) => ['index', 'then', '.', '..'].includes(segment) || segment.startsWith('$'),\n )\n )\n throw new Error(`Reserved hc path segment: ${path}`);\n if ('parameters' in item || '$ref' in item)\n throw new Error(`${path}: resolve path-level parameters/references into operations first.`);\n const methods: string[] = [];\n for (const method of METHODS) {\n const operation = item[method];\n if (!operation) continue;\n const at = `${method.toUpperCase()} ${path}`;\n const unsupported = operation['x-vela-client-unsupported'];\n if (unsupported?.length) throw new Error(`${at}: ${unsupported.join(' ')}`);\n const input = inputType(path, operation, at, method);\n const explicitStatuses = Object.keys(operation.responses).filter((s) => /^\\d{3}$/.test(s));\n const variants: string[] = [];\n for (const [status, response] of Object.entries(operation.responses).toSorted(([a], [b]) =>\n a.localeCompare(b),\n )) {\n if (response.$ref)\n throw new Error(`${at}: resolve response references before generating a client.`);\n let statusType: string;\n if (/^[1-5]\\d\\d$/.test(status) && HTTP_STATUSES.has(Number(status))) statusType = status;\n else if (status === 'default')\n statusType = `Exclude<HttpStatus, ${\n Object.keys(operation.responses)\n .filter((s) => s !== 'default')\n .map((s) => (/^[1-5]XX$/.test(s) ? rangeStatus(s) : s))\n .join(' | ') || 'never'\n }>`;\n else if (/^[1-5]XX$/.test(status))\n statusType = `Exclude<${rangeStatus(status)}, ${explicitStatuses.join(' | ') || 'never'}>`;\n else throw new Error(`${at}: unsupported response status ${status}.`);\n if (statusType.includes('HttpStatus')) usesHttpStatus = true;\n const content = response.content ?? {};\n const media = Object.keys(content);\n const declaredFormat = response['x-vela-response-format'];\n const mediaType = media[0];\n const mediaSchema = content[mediaType ?? '']?.schema;\n const binarySchema =\n typeof mediaSchema === 'object' &&\n mediaSchema.type === 'string' &&\n mediaSchema.format === 'binary';\n const format =\n declaredFormat ??\n (media.length > 1\n ? 'response'\n : mediaType === 'text/plain'\n ? 'text'\n : mediaType === 'text/event-stream' ||\n mediaType === 'application/x-ndjson' ||\n mediaType === 'application/ndjson'\n ? 'stream'\n : mediaType === 'application/octet-stream' ||\n (mediaType !== 'application/json' && mediaType !== 'text/plain' && binarySchema)\n ? 'binary'\n : mediaType && mediaType !== 'application/json'\n ? 'response'\n : 'json');\n const native = format === 'binary' || format === 'stream' || format === 'response';\n if (!native) rejectBinaryJson(content[mediaType ?? '']?.schema, `${at} response ${status}`);\n const bodyType =\n ['101', '204', '205', '304'].includes(status) || method === 'head'\n ? 'never'\n : native\n ? format === 'binary'\n ? 'Blob'\n : format === 'stream'\n ? 'ReadableStream<Uint8Array> | null'\n : 'unknown'\n : schemaType(content[mediaType ?? '']?.schema, `${at} response ${status}`);\n // Native formats deliberately leave json() unknown. A media type or\n // streaming record schema cannot establish an arbitrary parsed JSON value.\n const output =\n format === 'text'\n ? `Extract<${bodyType}, string> extends never ? string : Extract<${bodyType}, string>`\n : bodyType;\n variants.push(\n `{ input: ${input}; output: ${output}; outputFormat: '${format}'; status: ${statusType} }`,\n );\n }\n if (!variants.length) throw new Error(`${at}: at least one response is required.`);\n methods.push(` $${method}: ${variants.join(' | ')};`);\n }\n if (methods.length) paths.push(` ${quote(path)}: {\\n${methods.join('\\n')}\\n };`);\n }\n\n const schemas = Object.entries(components)\n .toSorted(([a], [b]) => a.localeCompare(b))\n .map(([name, schema]) => ` ${quote(name)}: ${schemaType(schema, `schema ${name}`)};`);\n const source = [\n '// Generated by vela client generate. Do not edit.',\n `import type { HttpApp${usesHttpStatus ? ', HttpStatus' : ''}${formEncodings.length ? ', HttpFormEncoding' : ''} } from '@velajs/client/http';`,\n '',\n `export type Schemas = {\\n${schemas.join('\\n')}\\n};`,\n '',\n `export type AppType = HttpApp<{\\n${paths.join('\\n')}\\n}>;`,\n ...(formEncodings.length\n ? [\n '',\n '// hc sends multipart by default. Use fetch: withFormEncoding(formEncodings, yourFetch)',\n '// from @velajs/client/http to honor URL-encoded routes. Wrap per-call fetch overrides too.',\n `export const formEncodings = ${JSON.stringify(formEncodings, null, 2)} as const satisfies readonly HttpFormEncoding[];`,\n ]\n : []),\n '',\n ].join('\\n');\n return { source, warnings: [...warnings] };\n}\n\nfunction literal(value: unknown, at: string): string {\n if (value === null || ['string', 'boolean', 'number'].includes(typeof value))\n return JSON.stringify(value);\n throw new Error(`${at}: object/array const values are not supported.`);\n}\n\nfunction rangeStatus(status: string): string {\n const start = Number(status[0]) * 100;\n return `Extract<HttpStatus, ${Array.from({ length: 100 }, (_, i) => start + i).join(' | ')}>`;\n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wBAAwB,iBAAiB,iBAAiB,KAAK,cAAc,SAAS,uBAAuB,GAAG;GAChH;GACA,4BAA4B,QAAQ,KAAK,IAAI,EAAE;GAC/C;GACA,oCAAoC,MAAM,KAAK,IAAI,EAAE;GACrD,GAAI,cAAc,SACd;IACE;IACA;IACA;IACA,gCAAgC,KAAK,UAAU,eAAe,MAAM,CAAC,EAAE;GACzE,IACA,CAAC;GACL;EACF,CAAC,CAAC,KAAK,IACO;EAAG,UAAU,CAAC,GAAG,QAAQ;CAAE;AAC3C;AAEA,SAAS,QAAQ,OAAgB,IAAoB;CACnD,IAAI,UAAU,QAAQ;EAAC;EAAU;EAAW;CAAQ,CAAC,CAAC,SAAS,OAAO,KAAK,GACzE,OAAO,KAAK,UAAU,KAAK;CAC7B,MAAM,IAAI,MAAM,GAAG,GAAG,+CAA+C;AACvE;AAEA,SAAS,YAAY,QAAwB;CAC3C,MAAM,QAAQ,OAAO,OAAO,EAAE,IAAI;CAClC,OAAO,uBAAuB,MAAM,KAAK,EAAE,QAAQ,IAAI,IAAI,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;AAC7F"}
|
package/dist/client-contract.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as generateClientContract } from "./client-contract-
|
|
1
|
+
import { t as generateClientContract } from "./client-contract-DUkUZGpU.js";
|
|
2
2
|
export { generateClientContract };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { defineVelaConfig, loadConfig, resolveConfig } from "./config.js";
|
|
3
|
-
import { t as generateClientContract } from "./client-contract-
|
|
3
|
+
import { t as generateClientContract } from "./client-contract-DUkUZGpU.js";
|
|
4
4
|
import { Builtins, Cli, Command, Option, UsageError } from "clipanion";
|
|
5
5
|
import { lstat, mkdir, open, readFile, readdir, rmdir, unlink, writeFile } from "node:fs/promises";
|
|
6
6
|
import { createOpenApiDocument, describeToken, getEntrypointKinds, parseCron, parseCronMetadata } from "@velajs/vela";
|
|
@@ -14,7 +14,7 @@ import { promisify } from "node:util";
|
|
|
14
14
|
import { parse } from "jsonc-parser";
|
|
15
15
|
import { parse as parse$1 } from "smol-toml";
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "1.
|
|
17
|
+
var version = "1.26.1";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/with-app.ts
|
|
20
20
|
/** Own one app for the whole command, including output and long-lived transports. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velajs/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "CLI for Vela apps — seeding and project tasks (Node-side; not bundled into the edge Worker)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"typescript": "7.0.2",
|
|
68
68
|
"unplugin-swc": "1.5.9",
|
|
69
69
|
"vitest": "4.1.10",
|
|
70
|
-
"@velajs/
|
|
71
|
-
"@velajs/
|
|
70
|
+
"@velajs/client": "1.25.0",
|
|
71
|
+
"@velajs/vela": "1.27.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@velajs/vela": "^1.
|
|
74
|
+
"@velajs/vela": "^1.27.0"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
77
|
"@velajs/studio-host": "1.22.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-contract-R3_sMYFQ.js","names":[],"sources":["../src/client-contract-input.ts","../src/client-contract.ts"],"sourcesContent":["import { z } from 'zod';\n\n// This is the projection consumed by code generation, not a claim that an\n// arbitrary document satisfies every OpenAPI requirement. Decode both JSON\n// input and runtime-generated metadata before accessing their nested fields.\nconst schemaType = z.enum(['null', 'boolean', 'object', 'array', 'number', 'integer', 'string']);\ntype SchemaType = z.infer<typeof schemaType>;\ntype Scalar = string | number | boolean | null;\n\nexport type ContractSchema = boolean | ContractSchemaObject;\nexport interface ContractSchemaObject {\n type?: SchemaType | SchemaType[];\n format?: string;\n enum?: Scalar[];\n const?: unknown;\n nullable?: boolean;\n readOnly?: boolean;\n writeOnly?: boolean;\n items?: ContractSchema;\n properties?: Record<string, ContractSchema>;\n required?: string[];\n additionalProperties?: ContractSchema;\n oneOf?: ContractSchema[];\n anyOf?: ContractSchema[];\n allOf?: ContractSchema[];\n $ref?: string;\n [keyword: string]: unknown;\n}\n\nconst scalar = z.union([z.string(), z.number().finite(), z.boolean(), z.null()]);\nconst schema: z.ZodType<ContractSchema> = z.lazy(() =>\n z.union([\n z.boolean(),\n z\n .object({\n type: z.union([schemaType, z.array(schemaType).nonempty()]).optional(),\n format: z.string().optional(),\n enum: z.array(scalar).optional(),\n const: scalar.optional(),\n nullable: z.boolean().optional(),\n readOnly: z.boolean().optional(),\n writeOnly: z.boolean().optional(),\n items: schema.optional(),\n properties: z.record(z.string(), schema).optional(),\n required: z.array(z.string()).optional(),\n additionalProperties: schema.optional(),\n oneOf: z.array(schema).optional(),\n anyOf: z.array(schema).optional(),\n allOf: z.array(schema).optional(),\n $ref: z.string().min(1).optional(),\n })\n .passthrough(),\n ]),\n);\n\nconst parameter = z\n .object({\n name: z.string().min(1),\n in: z.enum(['path', 'query', 'header', 'cookie']),\n required: z.boolean().optional(),\n schema: schema.optional(),\n style: z.string().optional(),\n explode: z.boolean().optional(),\n // Keep unsupported representations explicit so they cannot disappear\n // during projection and accidentally become a fabricated string input.\n $ref: z.string().optional(),\n content: z.unknown().optional(),\n })\n .passthrough();\nexport type ContractParameter = z.infer<typeof parameter>;\n\nconst media = z\n .object({ schema: schema.optional(), encoding: z.unknown().optional() })\n .passthrough();\nconst content = z.record(z.string(), media);\nconst requestBody = z\n .object({\n required: z.boolean().optional(),\n content: content.optional(),\n $ref: z.string().optional(),\n })\n .passthrough();\nconst response = z\n .object({\n content: content.optional(),\n $ref: z.string().optional(),\n })\n .passthrough();\nconst operation = z\n .object({\n parameters: z.array(parameter).optional(),\n requestBody: requestBody.optional(),\n responses: z.record(z.string(), response),\n 'x-vela-client-unsupported': z.array(z.string()).optional(),\n })\n .passthrough();\nexport type ContractOperation = z.infer<typeof operation>;\n\nconst pathItem = z\n .object({\n get: operation.optional(),\n post: operation.optional(),\n put: operation.optional(),\n patch: operation.optional(),\n delete: operation.optional(),\n options: operation.optional(),\n head: operation.optional(),\n parameters: z.unknown().optional(),\n $ref: z.string().optional(),\n })\n .passthrough();\n\nconst document = z.object({\n openapi: z.string().regex(/^3\\.[01]\\.\\d+$/, 'expected OpenAPI 3.0.x or 3.1.x'),\n paths: z.record(z.string(), pathItem),\n components: z\n .object({ schemas: z.record(z.string(), schema).optional() })\n .passthrough()\n .optional(),\n});\n\n/** Read only structurally validated data. Unsupported constructs remain explicit. */\nexport function parseClientContractDocument(input: unknown): z.infer<typeof document> {\n // Zod recursively walks schemas. Refuse cyclic/excessively deep object input\n // (JSON files cannot contain cycles) with a diagnostic rather than overflowing.\n checkTree(input, '$', new Set<object>(), 0);\n const result = document.safeParse(input);\n if (!result.success) {\n const details = result.error.issues.map(\n (issue) => `${issue.path.join('.') || '$'}: ${issue.message}`,\n );\n throw new Error(`Invalid OpenAPI client contract:\\n${details.join('\\n')}`);\n }\n return result.data;\n}\n\nfunction checkTree(value: unknown, at: string, ancestors: Set<object>, depth: number): void {\n if (value === null || typeof value !== 'object') return;\n if (depth > 100)\n throw new Error(`Invalid OpenAPI client contract: ${at} exceeds 100 nested levels.`);\n if (ancestors.has(value))\n throw new Error(`Invalid OpenAPI client contract: ${at} contains a cycle; use $ref.`);\n ancestors.add(value);\n for (const [key, child] of Object.entries(value))\n checkTree(child, `${at}.${key}`, ancestors, depth + 1);\n ancestors.delete(value);\n}\n","import type { HttpVerb } from '@velajs/vela';\nimport { parseClientContractDocument } from './client-contract-input.js';\nimport type {\n ContractOperation,\n ContractParameter,\n ContractSchema,\n} from './client-contract-input.js';\n\nconst METHODS: HttpVerb[] = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head'];\nconst quote = (value: string): string => JSON.stringify(value);\n// Hono uses -1 for unofficial statuses. Reject those here so the generated\n// status literals always satisfy its public StatusCode contract.\nconst HTTP_STATUSES = new Set([\n 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304,\n 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,\n 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504,\n 505, 506, 507, 508, 510, 511,\n]);\n\nexport interface GeneratedClientContract {\n source: string;\n warnings: string[];\n}\n\n/** Generate hc types and optional form encoding metadata, without application imports. */\nexport function generateClientContract(input: unknown): GeneratedClientContract {\n const document = parseClientContractDocument(input);\n const warnings = new Set<string>();\n const components = document.components?.schemas ?? {};\n const formEncodings: { path: string; method: string; contentType: string }[] = [];\n let usesHttpStatus = false;\n const warn = (message: string): void => {\n warnings.add(message);\n };\n\n function schemaType(schema: ContractSchema | undefined, at: string): string {\n if (schema === false) return 'never';\n if (schema === true) return 'unknown';\n if (!schema || Object.keys(schema).length === 0) {\n warn(`${at}: no schema; emitted unknown.`);\n return 'unknown';\n }\n if (schema.readOnly || schema.writeOnly) {\n throw new Error(\n `${at}: readOnly/writeOnly schemas require separate request and response definitions.`,\n );\n }\n for (const keyword of [\n '$dynamicRef',\n 'prefixItems',\n 'patternProperties',\n 'not',\n 'if',\n 'then',\n 'else',\n 'dependentSchemas',\n 'unevaluatedProperties',\n ] as const) {\n if (schema[keyword] !== undefined)\n throw new Error(`${at}: unsupported schema keyword ${keyword}.`);\n }\n const parts: string[] = [];\n if (schema.$ref) {\n const prefix = '#/components/schemas/';\n const name = schema.$ref.startsWith(prefix)\n ? schema.$ref.slice(prefix.length).replace(/~1/g, '/').replace(/~0/g, '~')\n : undefined;\n if (name === undefined || !Object.hasOwn(components, name)) {\n throw new Error(\n `${at}: unsupported or unresolved reference ${schema.$ref}. Bundle references into components.schemas first.`,\n );\n }\n parts.push(`Schemas[${quote(name)}]`);\n }\n if ('const' in schema) parts.push(literal(schema.const, at));\n else if (schema.enum) parts.push(schema.enum.map((v) => literal(v, at)).join(' | ') || 'never');\n for (const key of ['oneOf', 'anyOf', 'allOf'] as const) {\n const members = schema[key];\n if (members)\n parts.push(\n members.map((s) => `(${schemaType(s, at)})`).join(key === 'allOf' ? ' & ' : ' | ') ||\n 'never',\n );\n }\n if (Array.isArray(schema.type)) {\n parts.push(\n schema.type\n .map((type) =>\n schemaType(\n {\n ...schema,\n type,\n nullable: false,\n $ref: undefined,\n enum: undefined,\n oneOf: undefined,\n anyOf: undefined,\n allOf: undefined,\n },\n at,\n ),\n )\n .join(' | '),\n );\n } else if (\n schema.type === 'object' ||\n (schema.type === undefined && (schema.properties || schema.additionalProperties))\n ) {\n const required = new Set(schema.required ?? []);\n const fields = Object.entries(schema.properties ?? {})\n .toSorted(([a], [b]) => a.localeCompare(b))\n .map(\n ([key, value]) =>\n `${quote(key)}${required.has(key) ? '' : '?'}: ${schemaType(value, `${at}.${key}`)};`,\n );\n if (schema.additionalProperties !== false) {\n // Unknown is intentional when properties coexist with a dictionary:\n // a narrow index signature could make declared properties impossible.\n const additional =\n typeof schema.additionalProperties === 'object' && fields.length === 0\n ? schemaType(schema.additionalProperties, `${at}.*`)\n : 'unknown';\n if (typeof schema.additionalProperties === 'object' && fields.length > 0)\n warn(`${at}: additionalProperties alongside named properties is widened to unknown.`);\n fields.push(`[key: string]: ${additional};`);\n }\n parts.push(fields.length ? `{ ${fields.join(' ')} }` : 'Record<string, never>');\n } else if (schema.type === 'array') {\n parts.push(`Array<${schemaType(schema.items, `${at}[]`)}>`);\n } else if (schema.type === 'string') {\n parts.push(schema.format === 'binary' ? 'File | Blob' : 'string');\n } else if (schema.type === 'number' || schema.type === 'integer') {\n parts.push('number');\n } else if (schema.type === 'boolean' || schema.type === 'null') {\n parts.push(schema.type);\n } else if (schema.type) {\n throw new Error(`${at}: unsupported schema type ${schema.type}.`);\n }\n if (!parts.length) {\n warn(`${at}: schema has no representable type; emitted unknown.`);\n return 'unknown';\n }\n const value = parts.map((part) => `(${part})`).join(' & ');\n return schema.nullable ? `(${value}) | null` : value;\n }\n\n function resolveFormSchema(\n value: ContractSchema | undefined,\n at: string,\n seen = new Set<string>(),\n ): Exclude<ContractSchema, boolean> {\n if (!value || typeof value !== 'object')\n throw new Error(`${at}: form fields require concrete schemas.`);\n if (!value.$ref) return value;\n const prefix = '#/components/schemas/';\n const name = value.$ref.startsWith(prefix)\n ? value.$ref.slice(prefix.length).replace(/~1/g, '/').replace(/~0/g, '~')\n : '';\n if (!Object.hasOwn(components, name))\n throw new Error(`${at}: unsupported or unresolved reference ${value.$ref}.`);\n if (seen.has(value.$ref)) throw new Error(`${at}: recursive form schemas are unsupported.`);\n if (Object.keys(value).some((key) => !['$ref', 'description', 'title'].includes(key)))\n throw new Error(`${at}: form references with schema siblings are unsupported.`);\n return resolveFormSchema(components[name], at, new Set(seen).add(value.$ref));\n }\n\n function formType(\n value: ContractSchema | undefined,\n encoding: unknown,\n contentType: string,\n at: string,\n ): string {\n const schema = resolveFormSchema(value, at);\n schemaType(schema, at); // Retain the generator's structural-keyword checks.\n if (\n schema.type !== 'object' ||\n !schema.properties ||\n schema.oneOf ||\n schema.anyOf ||\n schema.allOf ||\n schema.nullable ||\n (schema.additionalProperties !== undefined && schema.additionalProperties !== false)\n )\n throw new Error(\n `${at}: form bodies require an object with named fields and no additionalProperties schema.`,\n );\n if (encoding !== undefined) {\n if (encoding === null || typeof encoding !== 'object' || Array.isArray(encoding))\n throw new Error(`${at}: invalid form encoding.`);\n for (const [name, entry] of Object.entries(encoding)) {\n if (\n !Object.hasOwn(schema.properties, name) ||\n !entry ||\n typeof entry !== 'object' ||\n Array.isArray(entry) ||\n Object.entries(entry).some(\n ([key, value]) =>\n !((key === 'style' && value === 'form') || (key === 'explode' && value === true)),\n )\n )\n throw new Error(\n `${at}: unsupported form serialization for ${name}; use repeated fields with style form and explode true.`,\n );\n }\n }\n const fieldType = (value: ContractSchema | undefined, name: string, array = false): string => {\n const field = resolveFormSchema(value, `${at}.${name}`);\n schemaType(field, `${at}.${name}`);\n if (\n field.oneOf ||\n field.anyOf ||\n field.allOf ||\n field.nullable ||\n field.readOnly ||\n field.writeOnly\n )\n throw new Error(`${at}.${name}: ambiguous form wire schema.`);\n if (field.type === 'array' && !array) return `Array<${fieldType(field.items, name, true)}>`;\n if (field.type !== 'string')\n throw new Error(\n `${at}.${name}: form wire fields must be strings, binary files, or arrays of these.`,\n );\n const file = field.format === 'binary';\n if (file && contentType !== 'multipart/form-data')\n throw new Error(`${at}.${name}: files require multipart/form-data.`);\n if (field.contentEncoding !== undefined && !(file && field.contentEncoding === 'binary'))\n throw new Error(`${at}.${name}: unsupported contentEncoding.`);\n if (\n (field.enum && field.enum.some((entry) => typeof entry !== 'string')) ||\n ('const' in field && typeof field.const !== 'string') ||\n (file && (field.enum || 'const' in field))\n )\n throw new Error(`${at}.${name}: invalid form scalar literal.`);\n return schemaType(field, `${at}.${name}`);\n };\n const required = new Set(schema.required ?? []);\n const fields = Object.entries(schema.properties)\n .toSorted(([a], [b]) => a.localeCompare(b))\n .map(\n ([name, value]) =>\n `${quote(name)}${required.has(name) ? '' : '?'}: ${fieldType(value, name)};`,\n );\n return fields.length ? `{ ${fields.join(' ')} }` : 'Record<string, never>';\n }\n\n function rejectBinaryJson(\n value: ContractSchema | undefined,\n at: string,\n seen = new Set<string>(),\n ): void {\n if (!value || typeof value !== 'object') return;\n if (value.format === 'binary')\n throw new Error(\n `${at}: binary files require multipart form fields; JSON/text serialization is unsupported.`,\n );\n if (value.$ref && !seen.has(value.$ref)) {\n seen.add(value.$ref);\n const name = value.$ref\n .slice('#/components/schemas/'.length)\n .replace(/~1/g, '/')\n .replace(/~0/g, '~');\n rejectBinaryJson(components[name], at, seen);\n }\n for (const child of [\n ...Object.values(value.properties ?? {}),\n value.items,\n typeof value.additionalProperties === 'object' ? value.additionalProperties : undefined,\n ...(value.oneOf ?? []),\n ...(value.anyOf ?? []),\n ...(value.allOf ?? []),\n ])\n rejectBinaryJson(child, at, seen);\n }\n\n function wireType(\n value: ContractSchema | undefined,\n at: string,\n seen = new Set<string>(),\n ): string {\n if (value === false) return 'never';\n const schema = value === true ? undefined : value;\n if (schema?.$ref) {\n schemaType(schema, at); // validate reference\n if (seen.has(schema.$ref))\n throw new Error(`${at}: recursive parameter schemas are unsupported.`);\n const name = schema.$ref\n .slice('#/components/schemas/'.length)\n .replace(/~1/g, '/')\n .replace(/~0/g, '~');\n return wireType(components[name], at, new Set(seen).add(schema.$ref));\n }\n if (schema?.type === 'array') {\n const item = wireType(schema.items, at, seen);\n if (item.startsWith('Array<')) throw new Error(`${at}: nested query arrays are unsupported.`);\n return `Array<${item}>`;\n }\n if (\n schema?.type === 'object' ||\n schema?.properties ||\n schema?.oneOf ||\n schema?.anyOf ||\n schema?.allOf ||\n Array.isArray(schema?.type)\n ) {\n throw new Error(\n `${at}: structured parameters need a custom serializer and are not supported by this generator.`,\n );\n }\n if (schema?.enum) return schema.enum.map((v) => quote(String(v))).join(' | ') || 'never';\n return 'string';\n }\n\n function inputType(\n path: string,\n operation: ContractOperation,\n at: string,\n method: string,\n ): string {\n const parameters = [...(operation.parameters ?? [])];\n for (const p of parameters) {\n if (!['path', 'query', 'header', 'cookie'].includes(p.in) || typeof p.name !== 'string')\n throw new Error(`${at}: unresolved or invalid parameter.`);\n }\n for (const match of path.matchAll(/:([A-Za-z_][A-Za-z0-9_]*)/g)) {\n const name = match[1]!;\n if (!parameters.some((p) => p.in === 'path' && p.name === name))\n parameters.push({ name, in: 'path', required: true });\n }\n const fields: string[] = [];\n for (const [location, key] of [\n ['path', 'param'],\n ['query', 'query'],\n ['header', 'header'],\n ] as const) {\n const group = parameters.filter((p) => p.in === location);\n if (!group.length) continue;\n const required = location === 'path' || group.some((p) => p.required);\n fields.push(\n `${key}${required ? '' : '?'}: { ${group.map((p) => parameterType(p, location, at)).join(' ')} };`,\n );\n }\n if (parameters.some((p) => p.in === 'cookie'))\n throw new Error(\n `${at}: cookie parameters are unsupported; configure browser credentials through hc options.`,\n );\n if (operation.requestBody) {\n const body = operation.requestBody;\n if (body.$ref)\n throw new Error(`${at}: resolve requestBody references before generating a client.`);\n const content = body.content ?? {};\n const media = Object.keys(content);\n const contentType = media[0];\n if (\n media.length !== 1 ||\n !contentType ||\n !['application/json', 'multipart/form-data', 'application/x-www-form-urlencoded'].includes(\n contentType,\n )\n )\n throw new Error(\n `${at}: request bodies must declare exactly one supported media type: application/json, multipart/form-data, or application/x-www-form-urlencoded.`,\n );\n if (method === 'get' || method === 'head')\n throw new Error(`${at}: hc cannot send a request body for GET or HEAD.`);\n const entry = content[contentType];\n if (contentType === 'application/json') {\n rejectBinaryJson(entry?.schema, `${at} request body`);\n fields.push(\n `json${body.required ? '' : '?'}: ${schemaType(entry?.schema, `${at} request body`)};`,\n );\n } else {\n fields.push(\n `form${body.required ? '' : '?'}: ${formType(entry?.schema, entry?.encoding, contentType, `${at} request body`)};`,\n );\n formEncodings.push({ path, method: method.toUpperCase(), contentType });\n }\n }\n return fields.length ? `{ ${fields.join(' ')} }` : '{}';\n }\n\n function parameterType(p: ContractParameter, location: string, at: string): string {\n if (p.$ref || p.style || p.explode === false || p.content !== undefined)\n throw new Error(\n `${at}: custom parameter serialization/references are unsupported (${p.name}).`,\n );\n const type = wireType(p.schema, `${at} parameter ${p.name}`);\n if (location !== 'query' && type.startsWith('Array<'))\n throw new Error(`${at}: only query parameters support arrays.`);\n return `${quote(p.name)}${location === 'path' || p.required ? '' : '?'}: ${type};`;\n }\n\n const paths: string[] = [];\n for (const [openApiPath, item] of Object.entries(document.paths).toSorted(([a], [b]) =>\n a.localeCompare(b),\n )) {\n // Hono's proxy consumes one path segment per property. Reject templates it\n // cannot faithfully round-trip rather than generate a misleading client.\n if (\n !openApiPath.startsWith('/') ||\n openApiPath\n .slice(1)\n .split('/')\n .some(\n (segment) =>\n segment !== '' && !/^(?:[A-Za-z0-9_.~-]+|\\{[A-Za-z_][A-Za-z0-9_]*\\})$/.test(segment),\n ) ||\n openApiPath.includes('//') ||\n (openApiPath !== '/' && openApiPath.endsWith('/'))\n )\n throw new Error(`Unsupported client path: ${openApiPath}`);\n const path = openApiPath.replace(/\\{([^}]+)\\}/g, ':$1');\n if (\n path\n .split('/')\n .some(\n (segment) => ['index', 'then', '.', '..'].includes(segment) || segment.startsWith('$'),\n )\n )\n throw new Error(`Reserved hc path segment: ${path}`);\n if ('parameters' in item || '$ref' in item)\n throw new Error(`${path}: resolve path-level parameters/references into operations first.`);\n const methods: string[] = [];\n for (const method of METHODS) {\n const operation = item[method];\n if (!operation) continue;\n const at = `${method.toUpperCase()} ${path}`;\n const unsupported = operation['x-vela-client-unsupported'];\n if (unsupported?.length) throw new Error(`${at}: ${unsupported.join(' ')}`);\n const input = inputType(path, operation, at, method);\n const explicitStatuses = Object.keys(operation.responses).filter((s) => /^\\d{3}$/.test(s));\n const variants: string[] = [];\n for (const [status, response] of Object.entries(operation.responses).toSorted(([a], [b]) =>\n a.localeCompare(b),\n )) {\n if (response.$ref)\n throw new Error(`${at}: resolve response references before generating a client.`);\n let statusType: string;\n if (/^[1-5]\\d\\d$/.test(status) && HTTP_STATUSES.has(Number(status))) statusType = status;\n else if (status === 'default')\n statusType = `Exclude<HttpStatus, ${\n Object.keys(operation.responses)\n .filter((s) => s !== 'default')\n .map((s) => (/^[1-5]XX$/.test(s) ? rangeStatus(s) : s))\n .join(' | ') || 'never'\n }>`;\n else if (/^[1-5]XX$/.test(status))\n statusType = `Exclude<${rangeStatus(status)}, ${explicitStatuses.join(' | ') || 'never'}>`;\n else throw new Error(`${at}: unsupported response status ${status}.`);\n if (statusType.includes('HttpStatus')) usesHttpStatus = true;\n const content = response.content ?? {};\n const media = Object.keys(content);\n if (\n media.length > 1 ||\n (media.length === 1 && media[0] !== 'application/json' && media[0] !== 'text/plain')\n )\n throw new Error(`${at}: responses must declare one JSON or text media type.`);\n const format = media[0] === 'text/plain' ? 'text' : 'json';\n rejectBinaryJson(content[media[0] ?? '']?.schema, `${at} response ${status}`);\n const bodyType =\n ['101', '204', '205', '304'].includes(status) || method === 'head'\n ? 'never'\n : schemaType(content[media[0] ?? '']?.schema, `${at} response ${status}`);\n // text() always returns a string, even if the document describes a\n // numeric or unconstrained text payload. Preserve string literals.\n const output =\n format === 'text'\n ? `Extract<${bodyType}, string> extends never ? string : Extract<${bodyType}, string>`\n : bodyType;\n variants.push(\n `{ input: ${input}; output: ${output}; outputFormat: '${format}'; status: ${statusType} }`,\n );\n }\n if (!variants.length) throw new Error(`${at}: at least one response is required.`);\n methods.push(` $${method}: ${variants.join(' | ')};`);\n }\n if (methods.length) paths.push(` ${quote(path)}: {\\n${methods.join('\\n')}\\n };`);\n }\n\n const schemas = Object.entries(components)\n .toSorted(([a], [b]) => a.localeCompare(b))\n .map(([name, schema]) => ` ${quote(name)}: ${schemaType(schema, `schema ${name}`)};`);\n const source = [\n '// Generated by vela client generate. Do not edit.',\n `import type { HttpApp${usesHttpStatus ? ', HttpStatus' : ''}${formEncodings.length ? ', HttpFormEncoding' : ''} } from '@velajs/client/http';`,\n '',\n `export type Schemas = {\\n${schemas.join('\\n')}\\n};`,\n '',\n `export type AppType = HttpApp<{\\n${paths.join('\\n')}\\n}>;`,\n ...(formEncodings.length\n ? [\n '',\n '// hc sends multipart by default. Use fetch: withFormEncoding(formEncodings, yourFetch)',\n '// from @velajs/client/http to honor URL-encoded routes. Wrap per-call fetch overrides too.',\n `export const formEncodings = ${JSON.stringify(formEncodings, null, 2)} as const satisfies readonly HttpFormEncoding[];`,\n ]\n : []),\n '',\n ].join('\\n');\n return { source, warnings: [...warnings] };\n}\n\nfunction literal(value: unknown, at: string): string {\n if (value === null || ['string', 'boolean', 'number'].includes(typeof value))\n return JSON.stringify(value);\n throw new Error(`${at}: object/array const values are not supported.`);\n}\n\nfunction rangeStatus(status: string): string {\n const start = Number(status[0]) * 100;\n return `Extract<HttpStatus, ${Array.from({ length: 100 }, (_, i) => start + i).join(' | ')}>`;\n}\n"],"mappings":";;AAKA,MAAM,aAAa,EAAE,KAAK;CAAC;CAAQ;CAAW;CAAU;CAAS;CAAU;CAAW;AAAQ,CAAC;AAwB/F,MAAM,SAAS,EAAE,MAAM;CAAC,EAAE,OAAO;CAAG,EAAE,OAAO,CAAC,CAAC,OAAO;CAAG,EAAE,QAAQ;CAAG,EAAE,KAAK;AAAC,CAAC;AAC/E,MAAM,SAAoC,EAAE,WAC1C,EAAE,MAAM,CACN,EAAE,QAAQ,GACV,EACG,OAAO;CACN,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;CACrE,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,MAAM,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAC/B,OAAO,OAAO,SAAS;CACvB,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS;CAChC,OAAO,OAAO,SAAS;CACvB,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC,SAAS;CAClD,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;CACvC,sBAAsB,OAAO,SAAS;CACtC,OAAO,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAChC,OAAO,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAChC,OAAO,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAChC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;AACnC,CAAC,CAAC,CACD,YAAY,CACjB,CAAC,CACH;AAEA,MAAM,Y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