@kubb/ast 5.23.4 → 5.24.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.
- package/README.md +1 -1
- package/dist/{base-LhsPvVY1.d.ts → base-A-xF4pUL.d.ts} +1 -0
- package/dist/{base-UFBZi-FO.d.cts → base-CyJhBRMi.d.cts} +1 -0
- package/dist/{constants-DztHlVmY.cjs → constants-BCRkFAiy.cjs} +2 -1
- package/dist/constants-BCRkFAiy.cjs.map +1 -0
- package/dist/{constants-BTTus9ee.js → constants-UorsTFsa.js} +2 -1
- package/dist/constants-UorsTFsa.js.map +1 -0
- package/dist/factory.cjs +4 -3
- package/dist/factory.d.cts +4 -4
- package/dist/factory.d.ts +4 -4
- package/dist/factory.js +4 -4
- package/dist/{file-D_ih0x7q.js → file-1YtTOZeL.js} +4 -4
- package/dist/{file-D_ih0x7q.js.map → file-1YtTOZeL.js.map} +1 -1
- package/dist/{file-Bq2GPaxh.js → file-3gsgXreK.js} +3 -3
- package/dist/{file-Bq2GPaxh.js.map → file-3gsgXreK.js.map} +1 -1
- package/dist/{file-B269mZh4.d.cts → file-CMHRNuMX.d.cts} +1 -1
- package/dist/{file-oLlejzZV.d.ts → file-D67ITWja.d.ts} +1 -1
- package/dist/{file-C4pqV8yl.cjs → file-D73XubVb.cjs} +3 -3
- package/dist/{file-C4pqV8yl.cjs.map → file-D73XubVb.cjs.map} +1 -1
- package/dist/{file-DiPZBLSP.cjs → file-azmmZwDb.cjs} +4 -4
- package/dist/{file-DiPZBLSP.cjs.map → file-azmmZwDb.cjs.map} +1 -1
- package/dist/file.cjs +2 -2
- package/dist/file.d.cts +1 -1
- package/dist/file.d.ts +1 -1
- package/dist/file.js +2 -2
- package/dist/{graph-CFJ4wzFR.cjs → graph-DDh1FFrm.cjs} +3 -3
- package/dist/{graph-CFJ4wzFR.cjs.map → graph-DDh1FFrm.cjs.map} +1 -1
- package/dist/{graph-BUEOBomo.js → graph-DImDxlJE.js} +3 -3
- package/dist/{graph-BUEOBomo.js.map → graph-DImDxlJE.js.map} +1 -1
- package/dist/graph.cjs +1 -1
- package/dist/graph.d.cts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/graph.js +1 -1
- package/dist/{guards-u-dAAtl8.d.cts → guards-B6LgmDhJ.d.cts} +1 -1
- package/dist/{guards-RCnH6re9.d.ts → guards-l2AsKeHR.d.ts} +1 -1
- package/dist/http.d.cts +2 -2
- package/dist/http.d.ts +2 -2
- package/dist/{index-C1za72gL.d.cts → index-2hzFweaD.d.cts} +1 -1
- package/dist/{index-DbQ-J072.d.cts → index-84453BaS.d.cts} +1 -1
- package/dist/{index-UwSVys3m.d.ts → index-B3o1AkNE.d.ts} +4 -4
- package/dist/{index-BgFaJtnv.d.ts → index-BFwAhPp8.d.ts} +1 -1
- package/dist/{index-c9FD2S5f.d.cts → index-Bcxj7FqZ.d.cts} +3 -3
- package/dist/index-BiXrjYNm.d.cts +5 -0
- package/dist/{index-D_WLsIMP.d.cts → index-BvdIGsVr.d.cts} +2 -2
- package/dist/{index-DzHcy3vy.d.ts → index-C7U9EiIP.d.ts} +2 -2
- package/dist/index-CC5Rmgcm.d.ts +5 -0
- package/dist/{index-6-ZZCX9W.d.ts → index-CGmrJThc.d.ts} +4 -4
- package/dist/{index-DF7CbpYW.d.ts → index-CIUD99Ft.d.ts} +3 -3
- package/dist/{index-DpnCCtXt.d.cts → index-D2tWPgnK.d.cts} +1 -1
- package/dist/{index-B2nnOQjf.d.cts → index-DNZgWmNq.d.cts} +4 -4
- package/dist/{index-DbAnYRRM.d.ts → index-DerFkxlp.d.ts} +1 -1
- package/dist/{index-sdprVPKQ.d.cts → index-DfTgdgaH.d.cts} +1 -1
- package/dist/{index-DfRcRYF2.d.ts → index-YTyLBHFN.d.ts} +1 -1
- package/dist/{index-Bw2oMIM1.d.cts → index-bkTCYnZj.d.cts} +4 -4
- package/dist/{index-2TMYDLjK.d.ts → index-f90iIhHX.d.ts} +1 -1
- package/dist/index.cjs +11 -11
- package/dist/index.d.cts +17 -16
- package/dist/index.d.ts +17 -16
- package/dist/index.js +11 -11
- package/dist/{json-DyDtIZTj.js → json-DeqPhPUQ.js} +2 -2
- package/dist/{json-DyDtIZTj.js.map → json-DeqPhPUQ.js.map} +1 -1
- package/dist/{json-CCWMgzJZ.cjs → json-KV2VhBue.cjs} +2 -2
- package/dist/{json-CCWMgzJZ.cjs.map → json-KV2VhBue.cjs.map} +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.d.cts +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/json.js +1 -1
- package/dist/{macro-9WouvtZe.js → macro-3uGSg-ic.js} +2 -2
- package/dist/{macro-9WouvtZe.js.map → macro-3uGSg-ic.js.map} +1 -1
- package/dist/{macro-BEwfGNu1.cjs → macro-Ywn4-0s5.cjs} +2 -2
- package/dist/{macro-BEwfGNu1.cjs.map → macro-Ywn4-0s5.cjs.map} +1 -1
- package/dist/macro.cjs +1 -1
- package/dist/macro.d.cts +1 -1
- package/dist/macro.d.ts +1 -1
- package/dist/macro.js +1 -1
- package/dist/{node-vTrAIz3e.cjs → node-BeccjrHH.cjs} +4 -4
- package/dist/{node-vTrAIz3e.cjs.map → node-BeccjrHH.cjs.map} +1 -1
- package/dist/{node-DtuO3zr8.js → node-Dm56432_.js} +4 -4
- package/dist/{node-DtuO3zr8.js.map → node-Dm56432_.js.map} +1 -1
- package/dist/node.cjs +4 -4
- package/dist/node.d.cts +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/node.js +4 -4
- package/dist/{nodeText-BSYvDZOH.js → nodeText-DFak5VpX.js} +2 -2
- package/dist/{nodeText-BSYvDZOH.js.map → nodeText-DFak5VpX.js.map} +1 -1
- package/dist/{nodeText-CZ7wgxu9.cjs → nodeText-DH4dLGUb.cjs} +2 -2
- package/dist/{nodeText-CZ7wgxu9.cjs.map → nodeText-DH4dLGUb.cjs.map} +1 -1
- package/dist/{nodes-DEQjVliP.cjs → nodes-BdZfapPI.cjs} +26 -4
- package/dist/nodes-BdZfapPI.cjs.map +1 -0
- package/dist/{nodes-ClL1C158.js → nodes-D9nwroV5.js} +21 -5
- package/dist/nodes-D9nwroV5.js.map +1 -0
- package/dist/{operation-Cu4XSaJQ.d.ts → operation-Dd0-l2VB.d.ts} +27 -2
- package/dist/{operation-AFw8tzIN.d.cts → operation-De4lbIZS.d.cts} +27 -2
- package/dist/{ref-Bh5Xo8T7.cjs → ref-Ck-0j8NV.cjs} +2 -2
- package/dist/{ref-Bh5Xo8T7.cjs.map → ref-Ck-0j8NV.cjs.map} +1 -1
- package/dist/{ref-DPqeS8K1.js → ref-Dlxn7eu7.js} +2 -2
- package/dist/{ref-DPqeS8K1.js.map → ref-Dlxn7eu7.js.map} +1 -1
- package/dist/ref.cjs +1 -1
- package/dist/ref.d.cts +1 -1
- package/dist/ref.d.ts +1 -1
- package/dist/ref.js +1 -1
- package/dist/{schema-gSjYgaCl.cjs → schema-0YJZqRXb.cjs} +2 -2
- package/dist/{schema-gSjYgaCl.cjs.map → schema-0YJZqRXb.cjs.map} +1 -1
- package/dist/{schema-4UcdIPQ2.js → schema-BvUrXIoX.js} +4 -4
- package/dist/{schema-4UcdIPQ2.js.map → schema-BvUrXIoX.js.map} +1 -1
- package/dist/{schema-tH14gE6i.js → schema-CC008xgK.js} +2 -2
- package/dist/{schema-tH14gE6i.js.map → schema-CC008xgK.js.map} +1 -1
- package/dist/{schema-DuCY4lCG.cjs → schema-DfLGJ-oh.cjs} +4 -4
- package/dist/{schema-DuCY4lCG.cjs.map → schema-DfLGJ-oh.cjs.map} +1 -1
- package/dist/schema.cjs +3 -3
- package/dist/schema.d.cts +4 -4
- package/dist/schema.d.ts +4 -4
- package/dist/schema.js +3 -3
- package/dist/{visitor-CpmsR8o5.d.ts → visitor-CqI8T9Qa.d.ts} +2 -2
- package/dist/{visitor-XA0W3OVv.js → visitor-DA5yfOJz.js} +3 -2
- package/dist/visitor-DA5yfOJz.js.map +1 -0
- package/dist/{visitor-Bh1CBAOz.cjs → visitor-DhuKS-7x.cjs} +3 -2
- package/dist/visitor-DhuKS-7x.cjs.map +1 -0
- package/dist/{visitor-DnBK2MNl.d.cts → visitor-VYLe7Q4m.d.cts} +2 -2
- package/package.json +1 -1
- package/dist/constants-BTTus9ee.js.map +0 -1
- package/dist/constants-DztHlVmY.cjs.map +0 -1
- package/dist/index-Bj7a0aSM.d.cts +0 -5
- package/dist/index-CW-ztJjd.d.ts +0 -5
- package/dist/nodes-ClL1C158.js.map +0 -1
- package/dist/nodes-DEQjVliP.cjs.map +0 -1
- package/dist/visitor-Bh1CBAOz.cjs.map +0 -1
- package/dist/visitor-XA0W3OVv.js.map +0 -1
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as nodeKinds } from "./constants-
|
|
2
|
-
import { r as transform, t as collect } from "./visitor-
|
|
3
|
-
import { n as getNodeText } from "./nodeText-
|
|
4
|
-
import "./node-
|
|
1
|
+
import { t as nodeKinds } from "./constants-UorsTFsa.js";
|
|
2
|
+
import { r as transform, t as collect } from "./visitor-DA5yfOJz.js";
|
|
3
|
+
import { n as getNodeText } from "./nodeText-DFak5VpX.js";
|
|
4
|
+
import "./node-Dm56432_.js";
|
|
5
5
|
export { collect, getNodeText as getText, nodeKinds as kinds, transform };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-BYyVTPww.js";
|
|
2
|
-
import { t as nodeKinds } from "./constants-
|
|
2
|
+
import { t as nodeKinds } from "./constants-UorsTFsa.js";
|
|
3
3
|
// src/utils/nodeText.ts
|
|
4
4
|
const CODE_NODE_TEXT_FIELDS = {
|
|
5
5
|
Text: ["value"],
|
|
@@ -44,4 +44,4 @@ function getNodeText(nodes) {
|
|
|
44
44
|
}
|
|
45
45
|
export { getNodeText as n, CODE_NODE_TEXT_FIELDS as t };
|
|
46
46
|
|
|
47
|
-
//# sourceMappingURL=nodeText-
|
|
47
|
+
//# sourceMappingURL=nodeText-DFak5VpX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeText-
|
|
1
|
+
{"version":3,"file":"nodeText-DFak5VpX.js","names":[],"sources":["../src/utils/nodeText.ts"],"sourcesContent":["import { nodeKinds } from '../constants.ts'\nimport type { NodeKind } from '../nodes/base.ts'\nimport type { CodeNode } from '../nodes/code.ts'\n\nexport const CODE_NODE_TEXT_FIELDS: Partial<Record<NodeKind, ReadonlyArray<string>>> = {\n Text: ['value'],\n Jsx: ['value'],\n Function: ['params', 'generics', 'returnType'],\n ArrowFunction: ['params', 'generics', 'returnType'],\n Const: ['type'],\n}\n\n/**\n * Extracts all string content from a `CodeNode` tree recursively.\n * Collects the text fields and nested node content, to build the source string for import filtering.\n */\nexport function getNodeText(nodes: Array<CodeNode> | undefined): string {\n if (!nodes?.length) return ''\n\n // One flat pass: this runs over every code node during file assembly, so it skips `map().filter().join()` allocations.\n const collected: Array<string> = []\n\n for (const node of nodes) {\n // Backward-compat: compiled plugins may still pass bare strings at runtime\n if (typeof node === 'string') {\n if (node) collected.push(node as string)\n continue\n }\n if (node.kind === nodeKinds.break) continue\n\n const parts: Array<string> = []\n const record = node as unknown as Record<string, unknown>\n for (const field of CODE_NODE_TEXT_FIELDS[node.kind] ?? []) {\n const value = record[field]\n if (Array.isArray(value)) parts.push(value.join(', '))\n if (typeof value === 'string' && value) parts.push(value)\n }\n\n const nested = 'nodes' in node ? getNodeText(node.nodes) : ''\n if (nested) parts.push(nested)\n\n if (parts.length) collected.push(parts.join('\\n'))\n }\n\n return collected.join('\\n')\n}\n"],"mappings":";;;AAIA,MAAa,wBAA0E;CACrF,MAAM,CAAC,OAAO;CACd,KAAK,CAAC,OAAO;CACb,UAAU;EAAC;EAAU;EAAY;CAAY;CAC7C,eAAe;EAAC;EAAU;EAAY;CAAY;CAClD,OAAO,CAAC,MAAM;AAChB;;;;;AAMA,SAAgB,YAAY,OAA4C;CACtE,IAAI,CAAC,OAAO,QAAQ,OAAO;CAG3B,MAAM,YAA2B,CAAC;CAElC,KAAK,MAAM,QAAQ,OAAO;EAExB,IAAI,OAAO,SAAS,UAAU;GAC5B,IAAI,MAAM,UAAU,KAAK,IAAc;GACvC;EACF;EACA,IAAI,KAAK,SAAS,UAAU,OAAO;EAEnC,MAAM,QAAuB,CAAC;EAC9B,MAAM,SAAS;EACf,KAAK,MAAM,SAAS,sBAAsB,KAAK,SAAS,CAAC,GAAG;GAC1D,MAAM,QAAQ,OAAO;GACrB,IAAI,MAAM,QAAQ,KAAK,GAAG,MAAM,KAAK,MAAM,KAAK,IAAI,CAAC;GACrD,IAAI,OAAO,UAAU,YAAY,OAAO,MAAM,KAAK,KAAK;EAC1D;EAEA,MAAM,SAAS,WAAW,OAAO,YAAY,KAAK,KAAK,IAAI;EAC3D,IAAI,QAAQ,MAAM,KAAK,MAAM;EAE7B,IAAI,MAAM,QAAQ,UAAU,KAAK,MAAM,KAAK,IAAI,CAAC;CACnD;CAEA,OAAO,UAAU,KAAK,IAAI;AAC5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
2
|
-
const require_constants = require("./constants-
|
|
2
|
+
const require_constants = require("./constants-BCRkFAiy.cjs");
|
|
3
3
|
// src/utils/nodeText.ts
|
|
4
4
|
const CODE_NODE_TEXT_FIELDS = {
|
|
5
5
|
Text: ["value"],
|
|
@@ -55,4 +55,4 @@ Object.defineProperty(exports, "getNodeText", {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
//# sourceMappingURL=nodeText-
|
|
58
|
+
//# sourceMappingURL=nodeText-DH4dLGUb.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeText-
|
|
1
|
+
{"version":3,"file":"nodeText-DH4dLGUb.cjs","names":["nodeKinds"],"sources":["../src/utils/nodeText.ts"],"sourcesContent":["import { nodeKinds } from '../constants.ts'\nimport type { NodeKind } from '../nodes/base.ts'\nimport type { CodeNode } from '../nodes/code.ts'\n\nexport const CODE_NODE_TEXT_FIELDS: Partial<Record<NodeKind, ReadonlyArray<string>>> = {\n Text: ['value'],\n Jsx: ['value'],\n Function: ['params', 'generics', 'returnType'],\n ArrowFunction: ['params', 'generics', 'returnType'],\n Const: ['type'],\n}\n\n/**\n * Extracts all string content from a `CodeNode` tree recursively.\n * Collects the text fields and nested node content, to build the source string for import filtering.\n */\nexport function getNodeText(nodes: Array<CodeNode> | undefined): string {\n if (!nodes?.length) return ''\n\n // One flat pass: this runs over every code node during file assembly, so it skips `map().filter().join()` allocations.\n const collected: Array<string> = []\n\n for (const node of nodes) {\n // Backward-compat: compiled plugins may still pass bare strings at runtime\n if (typeof node === 'string') {\n if (node) collected.push(node as string)\n continue\n }\n if (node.kind === nodeKinds.break) continue\n\n const parts: Array<string> = []\n const record = node as unknown as Record<string, unknown>\n for (const field of CODE_NODE_TEXT_FIELDS[node.kind] ?? []) {\n const value = record[field]\n if (Array.isArray(value)) parts.push(value.join(', '))\n if (typeof value === 'string' && value) parts.push(value)\n }\n\n const nested = 'nodes' in node ? getNodeText(node.nodes) : ''\n if (nested) parts.push(nested)\n\n if (parts.length) collected.push(parts.join('\\n'))\n }\n\n return collected.join('\\n')\n}\n"],"mappings":";;;AAIA,MAAa,wBAA0E;CACrF,MAAM,CAAC,OAAO;CACd,KAAK,CAAC,OAAO;CACb,UAAU;EAAC;EAAU;EAAY;CAAY;CAC7C,eAAe;EAAC;EAAU;EAAY;CAAY;CAClD,OAAO,CAAC,MAAM;AAChB;;;;;AAMA,SAAgB,YAAY,OAA4C;CACtE,IAAI,CAAC,OAAO,QAAQ,OAAO;CAG3B,MAAM,YAA2B,CAAC;CAElC,KAAK,MAAM,QAAQ,OAAO;EAExB,IAAI,OAAO,SAAS,UAAU;GAC5B,IAAI,MAAM,UAAU,KAAK,IAAc;GACvC;EACF;EACA,IAAI,KAAK,SAASA,kBAAAA,UAAU,OAAO;EAEnC,MAAM,QAAuB,CAAC;EAC9B,MAAM,SAAS;EACf,KAAK,MAAM,SAAS,sBAAsB,KAAK,SAAS,CAAC,GAAG;GAC1D,MAAM,QAAQ,OAAO;GACrB,IAAI,MAAM,QAAQ,KAAK,GAAG,MAAM,KAAK,MAAM,KAAK,IAAI,CAAC;GACrD,IAAI,OAAO,UAAU,YAAY,OAAO,MAAM,KAAK,KAAK;EAC1D;EAEA,MAAM,SAAS,WAAW,OAAO,YAAY,KAAK,KAAK,IAAI;EAC3D,IAAI,QAAQ,MAAM,KAAK,MAAM;EAE7B,IAAI,MAAM,QAAQ,UAAU,KAAK,MAAM,KAAK,IAAI,CAAC;CACnD;CAEA,OAAO,UAAU,KAAK,IAAI;AAC5B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
2
|
-
const require_constants = require("./constants-
|
|
3
|
-
const require_file = require("./file-
|
|
2
|
+
const require_constants = require("./constants-BCRkFAiy.cjs");
|
|
3
|
+
const require_file = require("./file-D73XubVb.cjs");
|
|
4
4
|
const require_optionality = require("./optionality-C-qULYxo.cjs");
|
|
5
|
-
const require_schema = require("./schema-
|
|
5
|
+
const require_schema = require("./schema-0YJZqRXb.cjs");
|
|
6
6
|
// src/nodes/code.ts
|
|
7
7
|
/**
|
|
8
8
|
* Creates a `ConstNode` representing a TypeScript `const` declaration.
|
|
@@ -130,6 +130,21 @@ function createOperation(props) {
|
|
|
130
130
|
requestBody: requestBody ? createRequestBody(requestBody) : void 0
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Creates an `OperationsNode` for a list of operations.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const node = createOperations({ operations: [listPets, getPetById] })
|
|
139
|
+
* // { kind: 'Operations', operations: [...] }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
function createOperations({ operations }) {
|
|
143
|
+
return {
|
|
144
|
+
kind: require_constants.nodeKinds.operations,
|
|
145
|
+
operations
|
|
146
|
+
};
|
|
147
|
+
}
|
|
133
148
|
// src/nodes/parameter.ts
|
|
134
149
|
/**
|
|
135
150
|
* Creates a `ParameterNode`. `required` defaults to `false`, and the schema's
|
|
@@ -217,6 +232,7 @@ var nodes_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
|
217
232
|
createInput: () => createInput,
|
|
218
233
|
createJsx: () => createJsx,
|
|
219
234
|
createOperation: () => createOperation,
|
|
235
|
+
createOperations: () => createOperations,
|
|
220
236
|
createParameter: () => createParameter,
|
|
221
237
|
createProperty: () => createProperty,
|
|
222
238
|
createRequestBody: () => createRequestBody,
|
|
@@ -274,6 +290,12 @@ Object.defineProperty(exports, "createOperation", {
|
|
|
274
290
|
return createOperation;
|
|
275
291
|
}
|
|
276
292
|
});
|
|
293
|
+
Object.defineProperty(exports, "createOperations", {
|
|
294
|
+
enumerable: true,
|
|
295
|
+
get: function() {
|
|
296
|
+
return createOperations;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
277
299
|
Object.defineProperty(exports, "createParameter", {
|
|
278
300
|
enumerable: true,
|
|
279
301
|
get: function() {
|
|
@@ -317,4 +339,4 @@ Object.defineProperty(exports, "nodes_exports", {
|
|
|
317
339
|
}
|
|
318
340
|
});
|
|
319
341
|
|
|
320
|
-
//# sourceMappingURL=nodes-
|
|
342
|
+
//# sourceMappingURL=nodes-BdZfapPI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes-BdZfapPI.cjs","names":["nodeFactory","nodeKinds","nodeFactory","nodeKinds","nodeKinds","nodeFactory","nodeKinds","nodeKinds","applyOptionality","nodeKinds","applyOptionality","nodeKinds","nodeKinds"],"sources":["../src/nodes/code.ts","../src/nodes/content.ts","../src/nodes/input.ts","../src/nodes/requestBody.ts","../src/nodes/operation.ts","../src/nodes/parameter.ts","../src/nodes/property.ts","../src/nodes/response.ts","../src/nodes/index.ts"],"sourcesContent":["import { nodeKinds } from '../constants.ts'\nimport { type BaseNode, nodeFactory } from './base.ts'\n\n/**\n * JSDoc documentation metadata attached to code declarations.\n */\nexport type JSDocNode = {\n /**\n * JSDoc comment lines. `undefined` entries are filtered out during rendering.\n *\n * @example\n * ```ts\n * ['@description A pet resource', '@deprecated']\n * ```\n */\n comments?: Array<string | undefined>\n}\n\n/**\n * AST node representing a TypeScript `const` declaration.\n *\n * Mirrors the props of the `Const` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createConst({ name: 'pet', export: true, asConst: true })\n * // export const pet = ... as const\n * ```\n */\nexport type ConstNode = BaseNode & {\n kind: 'Const'\n /**\n * Name of the constant declaration.\n */\n name: string\n /**\n * Whether the declaration should be exported.\n */\n export?: boolean | null\n /**\n * Explicit type annotation.\n *\n * @example Type reference\n * `'Pet'`\n */\n type?: string | null\n /**\n * JSDoc documentation metadata.\n */\n JSDoc?: JSDocNode | null\n /**\n * Whether to append `as const` to the declaration.\n */\n asConst?: boolean | null\n /**\n * Child nodes representing the value of the constant (children of the `Const` component).\n * Each entry is a {@link CodeNode}. Use {@link TextNode} for raw string content.\n */\n nodes?: Array<CodeNode>\n}\n\n/**\n * AST node representing a TypeScript `type` alias declaration.\n *\n * Mirrors the props of the `Type` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createType({ name: 'Pet', export: true })\n * // export type Pet = ...\n * ```\n */\nexport type TypeNode = BaseNode & {\n kind: 'Type'\n /**\n * Name of the type alias.\n */\n name: string\n /**\n * Whether the declaration should be exported.\n */\n export?: boolean | null\n /**\n * How the declaration is written.\n * - `'type'` declares `type Name = …`\n * - `'interface'` declares `interface Name { … }`, so the body must be an object type\n *\n * @default 'type'\n */\n syntax?: 'type' | 'interface' | null\n /**\n * JSDoc documentation metadata.\n */\n JSDoc?: JSDocNode | null\n /**\n * Child nodes representing the type body (children of the `Type` component).\n * Each entry is a {@link CodeNode}. Use {@link TextNode} for raw string content.\n */\n nodes?: Array<CodeNode>\n}\n\n/**\n * AST node representing a TypeScript `function` declaration.\n *\n * Mirrors the props of the `Function` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createFunction({ name: 'getPet', export: true, async: true, returnType: 'Pet' })\n * // export async function getPet(): Promise<Pet> { ... }\n * ```\n */\nexport type FunctionNode = BaseNode & {\n kind: 'Function'\n /**\n * Name of the function.\n */\n name: string\n /**\n * Whether the function is a default export.\n */\n default?: boolean | null\n /**\n * Function parameter list as a pre-rendered string, written verbatim between the parentheses.\n *\n * @example\n * `'id: string, config: Config = {}'`\n */\n params?: string | null\n /**\n * Whether the function should be exported.\n */\n export?: boolean | null\n /**\n * Whether the function is async. When `true`, the return type is wrapped in `Promise<>`.\n */\n async?: boolean | null\n /**\n * TypeScript generic type parameters.\n *\n * @example Constrained generics\n * `['T', 'U extends string']`\n */\n generics?: string | Array<string> | null\n /**\n * Return type annotation.\n *\n * @example Type reference\n * `'Pet'`\n */\n returnType?: string | null\n /**\n * JSDoc documentation metadata.\n */\n JSDoc?: JSDocNode | null\n /**\n * Child nodes representing the function body (children of the `Function` component).\n * Each entry is a {@link CodeNode}. Use {@link TextNode} for raw string content.\n */\n nodes?: Array<CodeNode>\n}\n\n/**\n * AST node representing a TypeScript arrow function (`const name = () => { ... }`).\n *\n * Mirrors the props of the `Function.Arrow` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createArrowFunction({ name: 'getPet', export: true, singleLine: true })\n * // export const getPet = () => ...\n * ```\n */\nexport type ArrowFunctionNode = Omit<FunctionNode, 'kind'> & {\n kind: 'ArrowFunction'\n /**\n * Render the arrow function body as a single-line expression.\n */\n singleLine?: boolean | null\n}\n\n/**\n * AST node representing a raw text/string fragment in the source output.\n *\n * Used instead of bare `string` values so that all entries in `nodes` arrays\n * are typed `CodeNode` objects rather than a mixed `CodeNode | string` union.\n *\n * @example\n * ```ts\n * createText('return fetch(id)')\n * // { kind: 'Text', value: 'return fetch(id)' }\n * ```\n */\nexport type TextNode = BaseNode & {\n kind: 'Text'\n /**\n * The raw string content.\n */\n value: string\n}\n\n/**\n * AST node representing a blank line in the source output.\n *\n * Corresponds to `<br/>` in JSX components. `printNodes` turns a `Break` between two\n * statements into one blank line. Consecutive breaks, and breaks at the start or end of\n * the list, are folded away, so a `Break` never produces more than one blank line.\n *\n * @example\n * ```ts\n * createBreak()\n * // { kind: 'Break' }\n * ```\n */\nexport type BreakNode = BaseNode & {\n kind: 'Break'\n}\n\n/**\n * AST node representing a raw JSX fragment in the source output.\n *\n * Mirrors the `Jsx` component from `@kubb/renderer-jsx`. Embeds raw JSX/TSX markup\n * (including fragments `<>…</>`) directly in generated code.\n *\n * @example\n * ```ts\n * createJsx('<>\\n <a href={href}>Open</a>\\n</>')\n * // { kind: 'Jsx', value: '<>\\n <a href={href}>Open</a>\\n</>' }\n * ```\n */\nexport type JsxNode = BaseNode & {\n kind: 'Jsx'\n /**\n * The raw JSX string content.\n */\n value: string\n}\n\n/**\n * Union of all code-generation AST nodes.\n *\n * These nodes mirror the JSX components from `@kubb/renderer-jsx` and are used as\n * structured children in {@link SourceNode.nodes}.\n */\nexport type CodeNode = ConstNode | TypeNode | FunctionNode | ArrowFunctionNode | TextNode | BreakNode | JsxNode\n\n/**\n * Creates a `ConstNode` representing a TypeScript `const` declaration.\n *\n * @example Exported constant with type and `as const`\n * ```ts\n * createConst({ name: 'pets', export: true, type: 'Pet[]', asConst: true })\n * // export const pets: Pet[] = ... as const\n * ```\n */\nexport const createConst = nodeFactory<ConstNode>(nodeKinds.const)\n\n/**\n * Creates a `TypeNode` representing a TypeScript `type` alias declaration.\n *\n * @example\n * ```ts\n * createType({ name: 'Pet', export: true })\n * // export type Pet = ...\n * ```\n */\nexport const createType = nodeFactory<TypeNode>(nodeKinds.type)\n\n/**\n * Creates a `FunctionNode` representing a TypeScript `function` declaration.\n *\n * @example\n * ```ts\n * createFunction({ name: 'fetchPet', export: true, async: true, returnType: 'Pet' })\n * // export async function fetchPet(): Promise<Pet> { ... }\n * ```\n */\nexport const createFunction = nodeFactory<FunctionNode>(nodeKinds.function)\n\n/**\n * Creates an `ArrowFunctionNode` representing a TypeScript arrow function.\n *\n * @example\n * ```ts\n * createArrowFunction({ name: 'double', export: true, params: 'n: number', singleLine: true })\n * // export const double = (n: number) => ...\n * ```\n */\nexport const createArrowFunction = nodeFactory<ArrowFunctionNode>(nodeKinds.arrowFunction)\n\n/**\n * Creates a {@link TextNode} representing a raw string fragment in the source output.\n *\n * @example\n * ```ts\n * createText('return fetch(id)')\n * // { kind: 'Text', value: 'return fetch(id)' }\n * ```\n */\nexport function createText(value: string): TextNode {\n return { kind: nodeKinds.text, value }\n}\n\n/**\n * Creates a {@link BreakNode} representing a line break in the source output.\n *\n * @example\n * ```ts\n * createBreak()\n * // { kind: 'Break' }\n * ```\n */\nexport function createBreak(): BreakNode {\n return { kind: nodeKinds.break }\n}\n\n/**\n * Creates a {@link JsxNode} representing a raw JSX fragment in the source output.\n *\n * @example\n * ```ts\n * createJsx('<>\\n <a href={href}>Open</a>\\n</>')\n * // { kind: 'Jsx', value: '<>\\n <a href={href}>Open</a>\\n</>' }\n * ```\n */\nexport function createJsx(value: string): JsxNode {\n return { kind: nodeKinds.jsx, value }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { type BaseNode, nodeFactory } from './base.ts'\nimport type { ParameterStyle } from './parameter.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * How one body property is serialized, from the `encoding` entry of its media type.\n */\nexport type EncodingNode = {\n /**\n * Content type of the part, for example `'application/json'` for a multipart property.\n */\n contentType?: string\n /**\n * Serialization style of the property.\n */\n style?: ParameterStyle\n /**\n * Whether array and object values expand into separate values.\n */\n explode?: boolean\n /**\n * Whether reserved characters are sent as-is instead of percent-encoded.\n */\n allowReserved?: boolean\n encoding?: Record<string, EncodingNode>\n prefixEncoding?: Array<EncodingNode>\n itemEncoding?: EncodingNode\n}\n\nexport type ExampleNode = {\n name?: string\n summary?: string\n description?: string\n value?: unknown\n serializedValue?: string\n}\n\n/**\n * AST node representing one content-type entry of a request body or response.\n *\n * There is one entry per content type declared in the spec (e.g. `application/json`,\n * `multipart/form-data`), and each entry holds its own body schema.\n *\n * @example\n * ```ts\n * const content: ContentNode = {\n * kind: 'Content',\n * contentType: 'application/json',\n * schema: createSchema({ type: 'string' }),\n * }\n * ```\n */\nexport type ContentNode = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Content'\n /**\n * The content type for this entry (e.g. `'application/json'`), or `''` for a response without a body.\n */\n contentType: string\n /**\n * Body schema for this content type. For a stream it is the same node as `stream.schema`.\n */\n schema?: SchemaNode\n /**\n * Set when the content is a stream of items (an event stream, JSON Lines, a channel of messages) instead of one body.\n */\n stream?: {\n /**\n * Schema of one item, such as one event of `text/event-stream` or one line of JSON Lines.\n */\n schema?: SchemaNode\n /**\n * What `schema` describes for an event stream.\n * - `'event'` the parsed event with its `event`, `data`, `id` and `retry` fields\n * - `'data'` only the `data` payload, which the client wraps in its own event type\n */\n shape?: 'event' | 'data'\n }\n /**\n * Property keys to exclude from the generated type via `Omit<Type, Keys>`.\n * Set when a referenced schema has `readOnly`/`writeOnly` fields that should be omitted.\n */\n keysToOmit?: Array<string> | null\n /**\n * Serialization settings per body property that sets at least one field in the spec's `encoding`.\n */\n encoding?: Record<string, EncodingNode>\n examples?: Array<ExampleNode>\n /**\n * Serialization of the first parts by position, for a body sent as an array of parts such as `multipart/mixed`.\n */\n prefixEncoding?: Array<EncodingNode>\n /**\n * Serialization of every part after `prefixEncoding`, for a body sent as an array of parts such as `multipart/mixed`.\n */\n itemEncoding?: EncodingNode\n /** Vendor extensions (`x-*` keys) from the source media type, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\n/**\n * Creates a `ContentNode` for a single request-body or response content type.\n */\nexport const createContent = nodeFactory<ContentNode>(nodeKinds.content)\n","import { nodeKinds } from '../constants.ts'\nimport type { BaseNode } from './base.ts'\nimport type { OperationNode } from './operation.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * A variable declared by a server URL template.\n */\nexport type InputServerVariable = {\n default?: string\n enum?: Array<string>\n description?: string\n}\n\n/**\n * A server from the source document, with `{variable}` placeholders filled from their defaults.\n */\nexport type InputServer = {\n url: string\n name?: string\n description?: string\n /**\n * Variables of the source URL template, copied as-is. `url` already has their defaults filled in, so\n * this tells a templated server apart from a literal one. Absent when the server declares none.\n */\n variables?: Record<string, InputServerVariable>\n}\n\nexport type ExternalDocs = { url: string; description?: string }\n\nexport type InputTag = {\n name: string\n summary?: string\n description?: string\n /**\n * Name of the tag this tag nests under. `group: { type: 'tag' }` places its files in the parent's folder.\n */\n parent?: string\n kind?: string\n externalDocs?: ExternalDocs\n}\n\nexport type OAuthFlow = {\n authorizationUrl?: string\n deviceAuthorizationUrl?: string\n tokenUrl?: string\n refreshUrl?: string\n scopes?: Record<string, string>\n}\n\n/**\n * How a client sends a credential, in the same shape as the `Auth` object the generated clients pass to `auth`.\n */\nexport type AuthCredential =\n | { type: 'http'; scheme: 'bearer' | 'basic' | (string & {}); bearerFormat?: string }\n | { type: 'apiKey'; in: 'header' | 'query' | 'cookie'; name: string }\n | { type: 'oauth2'; flows: Record<string, OAuthFlow>; metadataUrl?: string }\n | { type: 'openIdConnect'; url?: string }\n | { type: 'mutualTLS' }\n\n/**\n * One way to authenticate, keyed by `name`, which operations refer to in `auth`.\n */\nexport type AuthScheme = {\n name: string\n description?: string\n deprecated?: boolean\n credential: AuthCredential\n}\n\n/**\n * One way to meet an operation's auth. Every scheme in it applies together. `scopes` are the OAuth2 or OpenID\n * Connect scopes the call needs. An empty list means the call may be sent without credentials.\n */\nexport type AuthRequirement = Array<{ scheme: string; scopes?: Array<string> }>\n\n/**\n * Metadata for an API document, populated by the adapter and available to every generator.\n * Every field is a plain JSON value.\n *\n * @example\n * ```ts\n * const meta: InputMeta = { title: 'Pet Store', version: '1.0.0', baseURL: 'https://api.example.com/v2' }\n * ```\n */\nexport type InputMeta = {\n /**\n * API title from `info.title` in the source document.\n */\n title?: string\n /**\n * API description from `info.description` in the source document.\n */\n description?: string\n /**\n * API version string from `info.version` in the source document.\n */\n version?: string\n summary?: string\n termsOfService?: string\n contact?: { name?: string; url?: string; email?: string }\n license?: { name: string; identifier?: string; url?: string }\n externalDocs?: ExternalDocs\n /**\n * Resolved base URL from the first matching server entry in the source document.\n */\n baseURL?: string | null\n /**\n * The server index the adapter was configured with. A plugin uses it to pick the server at the same position in an\n * operation's or a path's own `servers`. It counts the source document's entries, including any without a URL.\n * Absent when the adapter was given no index.\n */\n serverIndex?: number\n servers?: Array<InputServer>\n tags?: Array<InputTag>\n auth?: Array<AuthScheme>\n /**\n * Vendor extensions (`x-*` keys) from the document root, copied as-is. Absent when the root has none.\n */\n extensions?: Record<string, unknown>\n}\n\n/**\n * Input AST node that contains all schemas and operations for one API document.\n * Produced by the adapter and consumed by all Kubb plugins.\n *\n * @example\n * ```ts\n * const input: InputNode = {\n * kind: 'Input',\n * schemas: [],\n * operations: [],\n * meta: {},\n * }\n * ```\n */\nexport type InputNode = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Input'\n /**\n * All schema nodes in the document.\n */\n schemas: Array<SchemaNode>\n /**\n * All operation nodes in the document.\n */\n operations: Array<OperationNode>\n /**\n * Document metadata populated by the adapter.\n */\n meta: InputMeta\n}\n\n/**\n * Creates an `InputNode`, defaulting `schemas`/`operations` to empty arrays and `meta` to an empty\n * object. Every call allocates fresh defaults so no two inputs share them.\n *\n * @example\n * ```ts\n * const input = createInput()\n * // { kind: 'Input', schemas: [], operations: [] }\n * ```\n */\nexport function createInput(overrides: Partial<Omit<InputNode, 'kind'>> = {}): InputNode {\n return { schemas: [], operations: [], meta: {}, ...overrides, kind: nodeKinds.input }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { type BaseNode, nodeFactory } from './base.ts'\nimport type { ContentNode } from './content.ts'\n\n/**\n * AST node representing an operation request body.\n *\n * Body schemas live exclusively inside the `content` array (one entry per content type),\n * mirroring {@link ResponseNode}.\n *\n * @example\n * ```ts\n * const requestBody: RequestBodyNode = {\n * kind: 'RequestBody',\n * required: true,\n * content: [{ kind: 'Content', contentType: 'application/json', schema: createSchema({ type: 'string' }) }],\n * }\n * ```\n */\nexport type RequestBodyNode = BaseNode & {\n kind: 'RequestBody'\n /**\n * Request body description carried over from the spec.\n */\n description?: string\n /**\n * Whether the request body is required (`requestBody.required: true` in the spec).\n * When `false` or absent, the generated `data` parameter should be optional.\n */\n required?: boolean\n /**\n * Content type entries for this request body.\n *\n * When the adapter `contentType` option is set, this array contains exactly one entry for\n * that content type. Otherwise it contains one entry per content type declared in the spec,\n * so plugins can generate code for every variant (for example, separate hooks for\n * `application/json` and `multipart/form-data`).\n */\n content?: Array<ContentNode>\n /** Vendor extensions (`x-*` keys) from the source request body, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\n/**\n * Creates a `RequestBodyNode`.\n */\nexport const createRequestBody = nodeFactory<RequestBodyNode>(nodeKinds.requestBody)\n","import { nodeKinds } from '../constants.ts'\nimport type { BaseNode } from './base.ts'\nimport type { AuthRequirement, ExternalDocs, InputServer } from './input.ts'\nimport type { ParameterNode } from './parameter.ts'\nimport { createRequestBody, type RequestBodyNode } from './requestBody.ts'\nimport type { ResponseNode } from './response.ts'\n\n/**\n * HTTP method an operation responds to. `QUERY` is the safe, idempotent method with a request body\n * from RFC 10008, declared with the `query` field of an OpenAPI 3.2 path item. Any other name is a\n * method the source declares outside this fixed set, in the capitalization it is sent with.\n */\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'QUERY' | (string & {})\n\n/**\n * Fields shared by every operation, regardless of transport.\n */\ntype OperationNodeBase = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Operation'\n /**\n * Stable identifier for the operation.\n */\n operationId: string\n /**\n * Group labels for the operation.\n */\n tags: Array<string>\n /**\n * Short one-line operation summary.\n */\n summary?: string\n /**\n * Full operation description.\n */\n description?: string\n /**\n * Marks the operation as deprecated.\n */\n deprecated?: boolean\n externalDocs?: ExternalDocs\n /**\n * Query, path, header, and cookie parameters for the operation.\n */\n parameters: Array<ParameterNode>\n /**\n * Request body for the operation.\n */\n requestBody?: RequestBodyNode\n /**\n * Operation responses.\n */\n responses: Array<ResponseNode>\n /**\n * Vendor extensions (`x-*` keys) from the source operation, copied as-is. Absent when the source has none.\n */\n extensions?: Record<string, unknown>\n /** The operation's own `servers`, else its path item's, such as an upload host. Absent when neither declares any. */\n servers?: Array<InputServer>\n /**\n * Ways to authenticate, from the operation or else the document. Any one entry is enough. `[]` means no auth.\n */\n auth?: Array<AuthRequirement>\n}\n\n/**\n * Operation served over HTTP. `method` and `path` are guaranteed.\n *\n * @example\n * ```ts\n * const operation: HttpOperationNode = {\n * kind: 'Operation',\n * operationId: 'listPets',\n * protocol: 'http',\n * method: 'GET',\n * path: '/pets',\n * tags: [],\n * parameters: [],\n * responses: [],\n * }\n * ```\n */\nexport type HttpOperationNode = OperationNodeBase & {\n /**\n * Transport the operation belongs to.\n */\n protocol?: 'http'\n /**\n * HTTP method like `'GET'`.\n */\n method: HttpMethod\n /**\n * Path string, for example `/pets/{petId}`, with `{param}` notation preserved.\n */\n path: string\n}\n\n/**\n * Operation for a non-HTTP transport. HTTP-only fields are forbidden.\n */\nexport type GenericOperationNode = OperationNodeBase & {\n protocol?: never\n method?: never\n path?: never\n}\n\n/**\n * AST node representing one API operation.\n *\n * Discriminated on `protocol`: an {@link HttpOperationNode} (`protocol: 'http'`) guarantees\n * `method` and `path`, while a {@link GenericOperationNode} omits them. Narrow with\n * `ast.http.isOperation(node)` or `node.protocol === 'http'` before reading `method`/`path`.\n */\nexport type OperationNode = HttpOperationNode | GenericOperationNode\n\ntype OperationInput = {\n operationId: string\n method?: HttpOperationNode['method']\n path?: HttpOperationNode['path']\n requestBody?: Omit<RequestBodyNode, 'kind'>\n [key: string]: unknown\n}\n\n/**\n * Creates an `OperationNode` with default empty arrays for `tags`, `parameters`, and `responses`.\n * HTTP operations (those carrying both `method` and `path`) are tagged with `protocol: 'http'`,\n * and the request body is normalized into a `RequestBodyNode`.\n *\n * @example\n * ```ts\n * const operation = createOperation({ operationId: 'getPetById', method: 'GET', path: '/pet/{petId}' })\n * // tags, parameters, and responses are []\n * ```\n */\nexport function createOperation(\n props: Pick<HttpOperationNode, 'operationId' | 'method' | 'path'> &\n Partial<Omit<HttpOperationNode, 'kind' | 'operationId' | 'method' | 'path' | 'requestBody'>> & {\n requestBody?: Omit<RequestBodyNode, 'kind'>\n },\n): HttpOperationNode\nexport function createOperation(\n props: Pick<GenericOperationNode, 'operationId'> &\n Partial<Omit<GenericOperationNode, 'kind' | 'operationId' | 'requestBody'>> & {\n requestBody?: Omit<RequestBodyNode, 'kind'>\n },\n): GenericOperationNode\nexport function createOperation(props: OperationInput): OperationNode {\n const { requestBody, ...rest } = props\n const isHttp = rest.method !== undefined && rest.path !== undefined\n\n const node = {\n tags: [],\n parameters: [],\n responses: [],\n ...rest,\n kind: nodeKinds.operation,\n ...(isHttp ? { protocol: 'http' as const } : {}),\n requestBody: requestBody ? createRequestBody(requestBody) : undefined,\n }\n\n return node as OperationNode\n}\n\n/**\n * The operations a plugin keeps, as one node. A template with `kind: 'Operations'` gets it once, after every operation.\n */\nexport type OperationsNode = BaseNode & {\n kind: 'Operations'\n operations: Array<OperationNode>\n}\n\n/**\n * Creates an `OperationsNode` for a list of operations.\n *\n * @example\n * ```ts\n * const node = createOperations({ operations: [listPets, getPetById] })\n * // { kind: 'Operations', operations: [...] }\n * ```\n */\nexport function createOperations({ operations }: { operations: Array<OperationNode> }): OperationsNode {\n return { kind: nodeKinds.operations, operations }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { applyOptionality } from '../optionality.ts'\nimport type { BaseNode } from './base.ts'\nimport type { EncodingNode, ExampleNode } from './content.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * Where a parameter is sent. `querystring` carries the whole query string as one value, serialized per `contentType`.\n */\nexport type ParameterLocation = 'path' | 'query' | 'header' | 'cookie' | 'querystring'\n\n/**\n * Parameter serialization style, controlling how a parameter value is rendered into the request.\n */\nexport type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject' | 'cookie'\n\n/**\n * AST node representing one operation parameter.\n *\n * @example\n * ```ts\n * const param: ParameterNode = {\n * kind: 'Parameter',\n * name: 'petId',\n * in: 'path',\n * schema: createSchema({ type: 'string' }),\n * required: true,\n * }\n * ```\n */\nexport type ParameterNode = BaseNode & {\n kind: 'Parameter'\n /**\n * Parameter name.\n */\n name: string\n /**\n * Parameter location (`path`, `query`, `header`, `cookie`, or `querystring`).\n */\n in: ParameterLocation\n /**\n * Parameter schema.\n */\n schema: SchemaNode\n /**\n * Whether the parameter is required.\n */\n required: boolean\n /**\n * Serialization style. Absent when the source omits it, leaving consumers to apply the\n * per-location default.\n */\n style?: ParameterStyle\n /**\n * Whether array and object values expand into separate values. Absent when the source omits it,\n * leaving consumers to apply the default for the style.\n */\n explode?: boolean\n /**\n * Whether reserved characters (RFC 3986 `:/?#[]@!$&'()*+,;=`) are sent as-is instead of\n * percent-encoded. Absent when the source omits it.\n */\n allowReserved?: boolean\n /**\n * Media type of a parameter described with `content` instead of `schema`, for example\n * `application/json` when the value is sent as a JSON-encoded string. Absent for `schema` parameters.\n */\n contentType?: string\n /**\n * Serialization settings per property of a `content` parameter, from the `encoding` of its media type. An OpenAPI 3.2\n * `querystring` parameter sent as `application/x-www-form-urlencoded` uses it to set `style` and `explode` per field.\n */\n encoding?: Record<string, EncodingNode>\n examples?: Array<ExampleNode>\n deprecated?: boolean\n allowEmptyValue?: boolean\n /** Vendor extensions (`x-*` keys) from the source parameter, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\ntype UserParameterNode = Pick<ParameterNode, 'name' | 'in' | 'schema'> & Partial<Omit<ParameterNode, 'kind' | 'name' | 'in' | 'schema'>>\n\n/**\n * Creates a `ParameterNode`. `required` defaults to `false`, and the schema's\n * `optional`/`nullish` flags are derived from it.\n *\n * @example\n * ```ts\n * const param = createParameter({\n * name: 'petId',\n * in: 'path',\n * required: true,\n * schema: createSchema({ type: 'string' }),\n * })\n * ```\n */\nexport function createParameter(input: UserParameterNode): ParameterNode {\n const required = input.required ?? false\n\n return { ...input, required, schema: applyOptionality(input.schema, required), kind: nodeKinds.parameter }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { applyOptionality } from '../optionality.ts'\nimport type { BaseNode } from './base.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * AST node representing one named object property.\n *\n * @example\n * ```ts\n * const property: PropertyNode = {\n * kind: 'Property',\n * name: 'id',\n * schema: createSchema({ type: 'integer' }),\n * required: true,\n * }\n * ```\n */\nexport type PropertyNode = BaseNode & {\n kind: 'Property'\n /**\n * Property key.\n */\n name: string\n /**\n * Property schema.\n */\n schema: SchemaNode\n /**\n * Whether the property is required.\n */\n required: boolean\n}\n\n/**\n * Loosely-typed property accepted by `createProperty`, with `required` optional.\n */\ntype UserPropertyNode = Pick<PropertyNode, 'name' | 'schema'> & Partial<Omit<PropertyNode, 'kind' | 'name' | 'schema'>>\n\n/**\n * Creates a `PropertyNode`. `required` defaults to `false`, and the schema's\n * `optional`/`nullish` flags are derived from it.\n *\n * @example\n * ```ts\n * const property = createProperty({\n * name: 'status',\n * required: true,\n * schema: createSchema({ type: 'string', nullable: true }),\n * })\n * // required=true, no optional/nullish\n * ```\n */\nexport function createProperty(input: UserPropertyNode): PropertyNode {\n const required = input.required ?? false\n\n return { ...input, required, schema: applyOptionality(input.schema, required), kind: nodeKinds.property }\n}\n","import { nodeKinds } from '../constants.ts'\nimport type { BaseNode } from './base.ts'\nimport { type ContentNode, createContent } from './content.ts'\nimport type { InputServer } from './input.ts'\nimport type { ParameterNode } from './parameter.ts'\nimport type { SchemaNode } from './schema.ts'\n\ntype Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9\n\n/**\n * Response status code literal used by operations.\n *\n * Includes three-digit HTTP status code strings, ranges such as `\"2xx\"`, and `\"default\"` for catch-all responses.\n *\n * @example\n * ```ts\n * const status: StatusCode = '200'\n * const fallback: StatusCode = 'default'\n * ```\n */\nexport type StatusCode = `${1 | 2 | 3 | 4 | 5}${Digit}${Digit}` | `${1 | 2 | 3 | 4 | 5}xx` | 'default'\n\n/**\n * AST node representing one operation response variant.\n *\n * Mirrors {@link OperationNode.requestBody}: the response body schemas live exclusively inside\n * the `content` array (one entry per content type), so the same schema is never duplicated at the\n * node root and inside `content`.\n *\n * @example\n * ```ts\n * const response: ResponseNode = {\n * kind: 'Response',\n * statusCode: '200',\n * content: [{ kind: 'Content', contentType: 'application/json', schema: createSchema({ type: 'string' }) }],\n * }\n * ```\n */\nexport type ResponseNode = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Response'\n /**\n * HTTP status code or `'default'` for a fallback response.\n */\n statusCode: StatusCode\n summary?: string\n /**\n * Optional response description.\n */\n description?: string\n /**\n * All available content type entries for this response.\n *\n * For a response that declares content, the array holds exactly one entry for the adapter\n * `contentType` option when it is set. Otherwise it holds one entry per content type declared in\n * the spec, so that plugins can generate a union of response types (e.g. `application/json` and\n * `application/xml`). A body-less response always keeps a single entry whose `contentType` is `''`\n * and whose `schema` is the empty/`void` placeholder, even when the option is set.\n *\n * @example\n * ```ts\n * // spec response declares both application/json and application/xml\n * response.content[0].contentType // 'application/json'\n * response.content[1].contentType // 'application/xml'\n * ```\n */\n content?: Array<ContentNode>\n /**\n * Response headers, as `in: 'header'` parameters. `Content-Type` is left out.\n */\n headers?: Array<ParameterNode>\n links?: Record<string, ResponseLink>\n /** Vendor extensions (`x-*` keys) from the source response, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\n/**\n * A link to another operation. `parameters` and `requestBody` hold runtime expressions such as `$response.body#/id`.\n */\nexport type ResponseLink = {\n operationId?: string\n operationRef?: string\n parameters?: Record<string, unknown>\n requestBody?: unknown\n description?: string\n server?: InputServer\n}\n\ntype ResponseInput = Pick<ResponseNode, 'statusCode'> &\n Partial<Omit<ResponseNode, 'kind' | 'statusCode' | 'content'>> & {\n content?: Array<ContentNode>\n schema?: SchemaNode\n mediaType?: string | null\n keysToOmit?: Array<string> | null\n }\n\n/**\n * Creates a `ResponseNode`. A single legacy `schema` (with optional `mediaType`/`keysToOmit`)\n * is normalized into one `content` entry.\n *\n * @example\n * ```ts\n * const response = createResponse({\n * statusCode: '200',\n * content: [createContent({ contentType: 'application/json', schema: createSchema({ type: 'object', properties: [] }) })],\n * })\n * ```\n */\nexport function createResponse(props: ResponseInput): ResponseNode {\n const { schema, mediaType, keysToOmit, content, ...rest } = props\n const entries = content ?? (schema ? [createContent({ contentType: mediaType ?? 'application/json', schema, keysToOmit: keysToOmit ?? null })] : undefined)\n\n return { ...rest, content: entries, kind: nodeKinds.response }\n}\n","import type { ArrowFunctionNode, BreakNode, ConstNode, FunctionNode, JsxNode, TextNode, TypeNode } from './code.ts'\nimport type { ContentNode } from './content.ts'\nimport type { ExportNode, FileNode, ImportNode, SourceNode } from './file.ts'\nimport type { InputNode } from './input.ts'\nimport type { OperationNode, OperationsNode } from './operation.ts'\nimport type { ParameterNode } from './parameter.ts'\nimport type { PropertyNode } from './property.ts'\nimport type { RequestBodyNode } from './requestBody.ts'\nimport type { ResponseNode } from './response.ts'\nimport type { SchemaNode } from './schema.ts'\n\nexport { createArrowFunction, createBreak, createConst, createFunction, createJsx, createText, createType } from './code.ts'\nexport { createContent } from './content.ts'\nexport { createExport, createFile, createImport, createSource } from './file.ts'\nexport type { ExportInput, ImportInput, ModuleName, Space, UserFileNode } from './file.ts'\nexport { createInput } from './input.ts'\nexport { createOperation, createOperations } from './operation.ts'\nexport { createParameter } from './parameter.ts'\nexport { createProperty } from './property.ts'\nexport { createRequestBody } from './requestBody.ts'\nexport { createResponse } from './response.ts'\nexport { createSchema } from './schema.ts'\n\n/**\n * Union of all AST node types.\n *\n * This lets TypeScript narrow types in `switch (node.kind)` blocks.\n *\n * @example\n * ```ts\n * function getKind(node: Node): string {\n * switch (node.kind) {\n * case nodeKinds.input:\n * return 'input'\n * default:\n * return 'other'\n * }\n * }\n * ```\n */\nexport type Node =\n | InputNode\n | OperationNode\n | OperationsNode\n | SchemaNode\n | PropertyNode\n | ParameterNode\n | ResponseNode\n | RequestBodyNode\n | ContentNode\n | FileNode\n | ImportNode\n | ExportNode\n | SourceNode\n | ConstNode\n | TypeNode\n | FunctionNode\n | ArrowFunctionNode\n | TextNode\n | BreakNode\n | JsxNode\n"],"mappings":";;;;;;;;;;;;;;;AAmQA,MAAa,cAAcA,aAAAA,YAAuBC,kBAAAA,UAAU,KAAK;;;;;;;;;;AAWjE,MAAa,aAAaD,aAAAA,YAAsBC,kBAAAA,UAAU,IAAI;;;;;;;;;;AAW9D,MAAa,iBAAiBD,aAAAA,YAA0BC,kBAAAA,UAAU,QAAQ;;;;;;;;;;AAW1E,MAAa,sBAAsBD,aAAAA,YAA+BC,kBAAAA,UAAU,aAAa;;;;;;;;;;AAWzF,SAAgB,WAAW,OAAyB;CAClD,OAAO;EAAE,MAAMA,kBAAAA,UAAU;EAAM;CAAM;AACvC;;;;;;;;;;AAWA,SAAgB,cAAyB;CACvC,OAAO,EAAE,MAAMA,kBAAAA,UAAU,MAAM;AACjC;;;;;;;;;;AAWA,SAAgB,UAAU,OAAwB;CAChD,OAAO;EAAE,MAAMA,kBAAAA,UAAU;EAAK;CAAM;AACtC;;;;;ACjOA,MAAa,gBAAgBC,aAAAA,YAAyBC,kBAAAA,UAAU,OAAO;;;;;;;;;;;;AC2DvE,SAAgB,YAAY,YAA8C,CAAC,GAAc;CACvF,OAAO;EAAE,SAAS,CAAC;EAAG,YAAY,CAAC;EAAG,MAAM,CAAC;EAAG,GAAG;EAAW,MAAMC,kBAAAA,UAAU;CAAM;AACtF;;;;;ACzHA,MAAa,oBAAoBC,aAAAA,YAA6BC,kBAAAA,UAAU,WAAW;;ACsGnF,SAAgB,gBAAgB,OAAsC;CACpE,MAAM,EAAE,aAAa,GAAG,SAAS;CACjC,MAAM,SAAS,KAAK,WAAW,KAAA,KAAa,KAAK,SAAS,KAAA;CAY1D,OAAO;EATL,MAAM,CAAC;EACP,YAAY,CAAC;EACb,WAAW,CAAC;EACZ,GAAG;EACH,MAAMC,kBAAAA,UAAU;EAChB,GAAI,SAAS,EAAE,UAAU,OAAgB,IAAI,CAAC;EAC9C,aAAa,cAAc,kBAAkB,WAAW,IAAI,KAAA;CAGpD;AACZ;;;;;;;;;;AAmBA,SAAgB,iBAAiB,EAAE,cAAoE;CACrG,OAAO;EAAE,MAAMA,kBAAAA,UAAU;EAAY;CAAW;AAClD;;;;;;;;;;;;;;;;ACxFA,SAAgB,gBAAgB,OAAyC;CACvE,MAAM,WAAW,MAAM,YAAY;CAEnC,OAAO;EAAE,GAAG;EAAO;EAAU,QAAQC,oBAAAA,iBAAiB,MAAM,QAAQ,QAAQ;EAAG,MAAMC,kBAAAA,UAAU;CAAU;AAC3G;;;;;;;;;;;;;;;;AC/CA,SAAgB,eAAe,OAAuC;CACpE,MAAM,WAAW,MAAM,YAAY;CAEnC,OAAO;EAAE,GAAG;EAAO;EAAU,QAAQC,oBAAAA,iBAAiB,MAAM,QAAQ,QAAQ;EAAG,MAAMC,kBAAAA,UAAU;CAAS;AAC1G;;;;;;;;;;;;;;ACqDA,SAAgB,eAAe,OAAoC;CACjE,MAAM,EAAE,QAAQ,WAAW,YAAY,SAAS,GAAG,SAAS;CAC5D,MAAM,UAAU,YAAY,SAAS,CAAC,cAAc;EAAE,aAAa,aAAa;EAAoB;EAAQ,YAAY,cAAc;CAAK,CAAC,CAAC,IAAI,KAAA;CAEjJ,OAAO;EAAE,GAAG;EAAM,SAAS;EAAS,MAAMC,kBAAAA,UAAU;CAAS;AAC/D"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BYyVTPww.js";
|
|
2
|
-
import { t as nodeKinds } from "./constants-
|
|
3
|
-
import { a as nodeFactory, i as createSource, n as createFile, r as createImport, t as createExport } from "./file-
|
|
2
|
+
import { t as nodeKinds } from "./constants-UorsTFsa.js";
|
|
3
|
+
import { a as nodeFactory, i as createSource, n as createFile, r as createImport, t as createExport } from "./file-3gsgXreK.js";
|
|
4
4
|
import { t as applyOptionality } from "./optionality-FkRredTC.js";
|
|
5
|
-
import { t as createSchema } from "./schema-
|
|
5
|
+
import { t as createSchema } from "./schema-CC008xgK.js";
|
|
6
6
|
// src/nodes/code.ts
|
|
7
7
|
/**
|
|
8
8
|
* Creates a `ConstNode` representing a TypeScript `const` declaration.
|
|
@@ -130,6 +130,21 @@ function createOperation(props) {
|
|
|
130
130
|
requestBody: requestBody ? createRequestBody(requestBody) : void 0
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Creates an `OperationsNode` for a list of operations.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const node = createOperations({ operations: [listPets, getPetById] })
|
|
139
|
+
* // { kind: 'Operations', operations: [...] }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
function createOperations({ operations }) {
|
|
143
|
+
return {
|
|
144
|
+
kind: nodeKinds.operations,
|
|
145
|
+
operations
|
|
146
|
+
};
|
|
147
|
+
}
|
|
133
148
|
// src/nodes/parameter.ts
|
|
134
149
|
/**
|
|
135
150
|
* Creates a `ParameterNode`. `required` defaults to `false`, and the schema's
|
|
@@ -217,6 +232,7 @@ var nodes_exports = /* @__PURE__ */ __exportAll({
|
|
|
217
232
|
createInput: () => createInput,
|
|
218
233
|
createJsx: () => createJsx,
|
|
219
234
|
createOperation: () => createOperation,
|
|
235
|
+
createOperations: () => createOperations,
|
|
220
236
|
createParameter: () => createParameter,
|
|
221
237
|
createProperty: () => createProperty,
|
|
222
238
|
createRequestBody: () => createRequestBody,
|
|
@@ -226,6 +242,6 @@ var nodes_exports = /* @__PURE__ */ __exportAll({
|
|
|
226
242
|
createText: () => createText,
|
|
227
243
|
createType: () => createType
|
|
228
244
|
});
|
|
229
|
-
export { createOperation as a,
|
|
245
|
+
export { createOperation as a, createInput as c, createBreak as d, createConst as f, createType as g, createText as h, createParameter as i, createContent as l, createJsx as m, createResponse as n, createOperations as o, createFunction as p, createProperty as r, createRequestBody as s, nodes_exports as t, createArrowFunction as u };
|
|
230
246
|
|
|
231
|
-
//# sourceMappingURL=nodes-
|
|
247
|
+
//# sourceMappingURL=nodes-D9nwroV5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes-D9nwroV5.js","names":[],"sources":["../src/nodes/code.ts","../src/nodes/content.ts","../src/nodes/input.ts","../src/nodes/requestBody.ts","../src/nodes/operation.ts","../src/nodes/parameter.ts","../src/nodes/property.ts","../src/nodes/response.ts","../src/nodes/index.ts"],"sourcesContent":["import { nodeKinds } from '../constants.ts'\nimport { type BaseNode, nodeFactory } from './base.ts'\n\n/**\n * JSDoc documentation metadata attached to code declarations.\n */\nexport type JSDocNode = {\n /**\n * JSDoc comment lines. `undefined` entries are filtered out during rendering.\n *\n * @example\n * ```ts\n * ['@description A pet resource', '@deprecated']\n * ```\n */\n comments?: Array<string | undefined>\n}\n\n/**\n * AST node representing a TypeScript `const` declaration.\n *\n * Mirrors the props of the `Const` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createConst({ name: 'pet', export: true, asConst: true })\n * // export const pet = ... as const\n * ```\n */\nexport type ConstNode = BaseNode & {\n kind: 'Const'\n /**\n * Name of the constant declaration.\n */\n name: string\n /**\n * Whether the declaration should be exported.\n */\n export?: boolean | null\n /**\n * Explicit type annotation.\n *\n * @example Type reference\n * `'Pet'`\n */\n type?: string | null\n /**\n * JSDoc documentation metadata.\n */\n JSDoc?: JSDocNode | null\n /**\n * Whether to append `as const` to the declaration.\n */\n asConst?: boolean | null\n /**\n * Child nodes representing the value of the constant (children of the `Const` component).\n * Each entry is a {@link CodeNode}. Use {@link TextNode} for raw string content.\n */\n nodes?: Array<CodeNode>\n}\n\n/**\n * AST node representing a TypeScript `type` alias declaration.\n *\n * Mirrors the props of the `Type` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createType({ name: 'Pet', export: true })\n * // export type Pet = ...\n * ```\n */\nexport type TypeNode = BaseNode & {\n kind: 'Type'\n /**\n * Name of the type alias.\n */\n name: string\n /**\n * Whether the declaration should be exported.\n */\n export?: boolean | null\n /**\n * How the declaration is written.\n * - `'type'` declares `type Name = …`\n * - `'interface'` declares `interface Name { … }`, so the body must be an object type\n *\n * @default 'type'\n */\n syntax?: 'type' | 'interface' | null\n /**\n * JSDoc documentation metadata.\n */\n JSDoc?: JSDocNode | null\n /**\n * Child nodes representing the type body (children of the `Type` component).\n * Each entry is a {@link CodeNode}. Use {@link TextNode} for raw string content.\n */\n nodes?: Array<CodeNode>\n}\n\n/**\n * AST node representing a TypeScript `function` declaration.\n *\n * Mirrors the props of the `Function` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createFunction({ name: 'getPet', export: true, async: true, returnType: 'Pet' })\n * // export async function getPet(): Promise<Pet> { ... }\n * ```\n */\nexport type FunctionNode = BaseNode & {\n kind: 'Function'\n /**\n * Name of the function.\n */\n name: string\n /**\n * Whether the function is a default export.\n */\n default?: boolean | null\n /**\n * Function parameter list as a pre-rendered string, written verbatim between the parentheses.\n *\n * @example\n * `'id: string, config: Config = {}'`\n */\n params?: string | null\n /**\n * Whether the function should be exported.\n */\n export?: boolean | null\n /**\n * Whether the function is async. When `true`, the return type is wrapped in `Promise<>`.\n */\n async?: boolean | null\n /**\n * TypeScript generic type parameters.\n *\n * @example Constrained generics\n * `['T', 'U extends string']`\n */\n generics?: string | Array<string> | null\n /**\n * Return type annotation.\n *\n * @example Type reference\n * `'Pet'`\n */\n returnType?: string | null\n /**\n * JSDoc documentation metadata.\n */\n JSDoc?: JSDocNode | null\n /**\n * Child nodes representing the function body (children of the `Function` component).\n * Each entry is a {@link CodeNode}. Use {@link TextNode} for raw string content.\n */\n nodes?: Array<CodeNode>\n}\n\n/**\n * AST node representing a TypeScript arrow function (`const name = () => { ... }`).\n *\n * Mirrors the props of the `Function.Arrow` component from `@kubb/renderer-jsx`.\n * The `children` prop of the component is represented as `nodes`.\n *\n * @example\n * ```ts\n * createArrowFunction({ name: 'getPet', export: true, singleLine: true })\n * // export const getPet = () => ...\n * ```\n */\nexport type ArrowFunctionNode = Omit<FunctionNode, 'kind'> & {\n kind: 'ArrowFunction'\n /**\n * Render the arrow function body as a single-line expression.\n */\n singleLine?: boolean | null\n}\n\n/**\n * AST node representing a raw text/string fragment in the source output.\n *\n * Used instead of bare `string` values so that all entries in `nodes` arrays\n * are typed `CodeNode` objects rather than a mixed `CodeNode | string` union.\n *\n * @example\n * ```ts\n * createText('return fetch(id)')\n * // { kind: 'Text', value: 'return fetch(id)' }\n * ```\n */\nexport type TextNode = BaseNode & {\n kind: 'Text'\n /**\n * The raw string content.\n */\n value: string\n}\n\n/**\n * AST node representing a blank line in the source output.\n *\n * Corresponds to `<br/>` in JSX components. `printNodes` turns a `Break` between two\n * statements into one blank line. Consecutive breaks, and breaks at the start or end of\n * the list, are folded away, so a `Break` never produces more than one blank line.\n *\n * @example\n * ```ts\n * createBreak()\n * // { kind: 'Break' }\n * ```\n */\nexport type BreakNode = BaseNode & {\n kind: 'Break'\n}\n\n/**\n * AST node representing a raw JSX fragment in the source output.\n *\n * Mirrors the `Jsx` component from `@kubb/renderer-jsx`. Embeds raw JSX/TSX markup\n * (including fragments `<>…</>`) directly in generated code.\n *\n * @example\n * ```ts\n * createJsx('<>\\n <a href={href}>Open</a>\\n</>')\n * // { kind: 'Jsx', value: '<>\\n <a href={href}>Open</a>\\n</>' }\n * ```\n */\nexport type JsxNode = BaseNode & {\n kind: 'Jsx'\n /**\n * The raw JSX string content.\n */\n value: string\n}\n\n/**\n * Union of all code-generation AST nodes.\n *\n * These nodes mirror the JSX components from `@kubb/renderer-jsx` and are used as\n * structured children in {@link SourceNode.nodes}.\n */\nexport type CodeNode = ConstNode | TypeNode | FunctionNode | ArrowFunctionNode | TextNode | BreakNode | JsxNode\n\n/**\n * Creates a `ConstNode` representing a TypeScript `const` declaration.\n *\n * @example Exported constant with type and `as const`\n * ```ts\n * createConst({ name: 'pets', export: true, type: 'Pet[]', asConst: true })\n * // export const pets: Pet[] = ... as const\n * ```\n */\nexport const createConst = nodeFactory<ConstNode>(nodeKinds.const)\n\n/**\n * Creates a `TypeNode` representing a TypeScript `type` alias declaration.\n *\n * @example\n * ```ts\n * createType({ name: 'Pet', export: true })\n * // export type Pet = ...\n * ```\n */\nexport const createType = nodeFactory<TypeNode>(nodeKinds.type)\n\n/**\n * Creates a `FunctionNode` representing a TypeScript `function` declaration.\n *\n * @example\n * ```ts\n * createFunction({ name: 'fetchPet', export: true, async: true, returnType: 'Pet' })\n * // export async function fetchPet(): Promise<Pet> { ... }\n * ```\n */\nexport const createFunction = nodeFactory<FunctionNode>(nodeKinds.function)\n\n/**\n * Creates an `ArrowFunctionNode` representing a TypeScript arrow function.\n *\n * @example\n * ```ts\n * createArrowFunction({ name: 'double', export: true, params: 'n: number', singleLine: true })\n * // export const double = (n: number) => ...\n * ```\n */\nexport const createArrowFunction = nodeFactory<ArrowFunctionNode>(nodeKinds.arrowFunction)\n\n/**\n * Creates a {@link TextNode} representing a raw string fragment in the source output.\n *\n * @example\n * ```ts\n * createText('return fetch(id)')\n * // { kind: 'Text', value: 'return fetch(id)' }\n * ```\n */\nexport function createText(value: string): TextNode {\n return { kind: nodeKinds.text, value }\n}\n\n/**\n * Creates a {@link BreakNode} representing a line break in the source output.\n *\n * @example\n * ```ts\n * createBreak()\n * // { kind: 'Break' }\n * ```\n */\nexport function createBreak(): BreakNode {\n return { kind: nodeKinds.break }\n}\n\n/**\n * Creates a {@link JsxNode} representing a raw JSX fragment in the source output.\n *\n * @example\n * ```ts\n * createJsx('<>\\n <a href={href}>Open</a>\\n</>')\n * // { kind: 'Jsx', value: '<>\\n <a href={href}>Open</a>\\n</>' }\n * ```\n */\nexport function createJsx(value: string): JsxNode {\n return { kind: nodeKinds.jsx, value }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { type BaseNode, nodeFactory } from './base.ts'\nimport type { ParameterStyle } from './parameter.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * How one body property is serialized, from the `encoding` entry of its media type.\n */\nexport type EncodingNode = {\n /**\n * Content type of the part, for example `'application/json'` for a multipart property.\n */\n contentType?: string\n /**\n * Serialization style of the property.\n */\n style?: ParameterStyle\n /**\n * Whether array and object values expand into separate values.\n */\n explode?: boolean\n /**\n * Whether reserved characters are sent as-is instead of percent-encoded.\n */\n allowReserved?: boolean\n encoding?: Record<string, EncodingNode>\n prefixEncoding?: Array<EncodingNode>\n itemEncoding?: EncodingNode\n}\n\nexport type ExampleNode = {\n name?: string\n summary?: string\n description?: string\n value?: unknown\n serializedValue?: string\n}\n\n/**\n * AST node representing one content-type entry of a request body or response.\n *\n * There is one entry per content type declared in the spec (e.g. `application/json`,\n * `multipart/form-data`), and each entry holds its own body schema.\n *\n * @example\n * ```ts\n * const content: ContentNode = {\n * kind: 'Content',\n * contentType: 'application/json',\n * schema: createSchema({ type: 'string' }),\n * }\n * ```\n */\nexport type ContentNode = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Content'\n /**\n * The content type for this entry (e.g. `'application/json'`), or `''` for a response without a body.\n */\n contentType: string\n /**\n * Body schema for this content type. For a stream it is the same node as `stream.schema`.\n */\n schema?: SchemaNode\n /**\n * Set when the content is a stream of items (an event stream, JSON Lines, a channel of messages) instead of one body.\n */\n stream?: {\n /**\n * Schema of one item, such as one event of `text/event-stream` or one line of JSON Lines.\n */\n schema?: SchemaNode\n /**\n * What `schema` describes for an event stream.\n * - `'event'` the parsed event with its `event`, `data`, `id` and `retry` fields\n * - `'data'` only the `data` payload, which the client wraps in its own event type\n */\n shape?: 'event' | 'data'\n }\n /**\n * Property keys to exclude from the generated type via `Omit<Type, Keys>`.\n * Set when a referenced schema has `readOnly`/`writeOnly` fields that should be omitted.\n */\n keysToOmit?: Array<string> | null\n /**\n * Serialization settings per body property that sets at least one field in the spec's `encoding`.\n */\n encoding?: Record<string, EncodingNode>\n examples?: Array<ExampleNode>\n /**\n * Serialization of the first parts by position, for a body sent as an array of parts such as `multipart/mixed`.\n */\n prefixEncoding?: Array<EncodingNode>\n /**\n * Serialization of every part after `prefixEncoding`, for a body sent as an array of parts such as `multipart/mixed`.\n */\n itemEncoding?: EncodingNode\n /** Vendor extensions (`x-*` keys) from the source media type, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\n/**\n * Creates a `ContentNode` for a single request-body or response content type.\n */\nexport const createContent = nodeFactory<ContentNode>(nodeKinds.content)\n","import { nodeKinds } from '../constants.ts'\nimport type { BaseNode } from './base.ts'\nimport type { OperationNode } from './operation.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * A variable declared by a server URL template.\n */\nexport type InputServerVariable = {\n default?: string\n enum?: Array<string>\n description?: string\n}\n\n/**\n * A server from the source document, with `{variable}` placeholders filled from their defaults.\n */\nexport type InputServer = {\n url: string\n name?: string\n description?: string\n /**\n * Variables of the source URL template, copied as-is. `url` already has their defaults filled in, so\n * this tells a templated server apart from a literal one. Absent when the server declares none.\n */\n variables?: Record<string, InputServerVariable>\n}\n\nexport type ExternalDocs = { url: string; description?: string }\n\nexport type InputTag = {\n name: string\n summary?: string\n description?: string\n /**\n * Name of the tag this tag nests under. `group: { type: 'tag' }` places its files in the parent's folder.\n */\n parent?: string\n kind?: string\n externalDocs?: ExternalDocs\n}\n\nexport type OAuthFlow = {\n authorizationUrl?: string\n deviceAuthorizationUrl?: string\n tokenUrl?: string\n refreshUrl?: string\n scopes?: Record<string, string>\n}\n\n/**\n * How a client sends a credential, in the same shape as the `Auth` object the generated clients pass to `auth`.\n */\nexport type AuthCredential =\n | { type: 'http'; scheme: 'bearer' | 'basic' | (string & {}); bearerFormat?: string }\n | { type: 'apiKey'; in: 'header' | 'query' | 'cookie'; name: string }\n | { type: 'oauth2'; flows: Record<string, OAuthFlow>; metadataUrl?: string }\n | { type: 'openIdConnect'; url?: string }\n | { type: 'mutualTLS' }\n\n/**\n * One way to authenticate, keyed by `name`, which operations refer to in `auth`.\n */\nexport type AuthScheme = {\n name: string\n description?: string\n deprecated?: boolean\n credential: AuthCredential\n}\n\n/**\n * One way to meet an operation's auth. Every scheme in it applies together. `scopes` are the OAuth2 or OpenID\n * Connect scopes the call needs. An empty list means the call may be sent without credentials.\n */\nexport type AuthRequirement = Array<{ scheme: string; scopes?: Array<string> }>\n\n/**\n * Metadata for an API document, populated by the adapter and available to every generator.\n * Every field is a plain JSON value.\n *\n * @example\n * ```ts\n * const meta: InputMeta = { title: 'Pet Store', version: '1.0.0', baseURL: 'https://api.example.com/v2' }\n * ```\n */\nexport type InputMeta = {\n /**\n * API title from `info.title` in the source document.\n */\n title?: string\n /**\n * API description from `info.description` in the source document.\n */\n description?: string\n /**\n * API version string from `info.version` in the source document.\n */\n version?: string\n summary?: string\n termsOfService?: string\n contact?: { name?: string; url?: string; email?: string }\n license?: { name: string; identifier?: string; url?: string }\n externalDocs?: ExternalDocs\n /**\n * Resolved base URL from the first matching server entry in the source document.\n */\n baseURL?: string | null\n /**\n * The server index the adapter was configured with. A plugin uses it to pick the server at the same position in an\n * operation's or a path's own `servers`. It counts the source document's entries, including any without a URL.\n * Absent when the adapter was given no index.\n */\n serverIndex?: number\n servers?: Array<InputServer>\n tags?: Array<InputTag>\n auth?: Array<AuthScheme>\n /**\n * Vendor extensions (`x-*` keys) from the document root, copied as-is. Absent when the root has none.\n */\n extensions?: Record<string, unknown>\n}\n\n/**\n * Input AST node that contains all schemas and operations for one API document.\n * Produced by the adapter and consumed by all Kubb plugins.\n *\n * @example\n * ```ts\n * const input: InputNode = {\n * kind: 'Input',\n * schemas: [],\n * operations: [],\n * meta: {},\n * }\n * ```\n */\nexport type InputNode = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Input'\n /**\n * All schema nodes in the document.\n */\n schemas: Array<SchemaNode>\n /**\n * All operation nodes in the document.\n */\n operations: Array<OperationNode>\n /**\n * Document metadata populated by the adapter.\n */\n meta: InputMeta\n}\n\n/**\n * Creates an `InputNode`, defaulting `schemas`/`operations` to empty arrays and `meta` to an empty\n * object. Every call allocates fresh defaults so no two inputs share them.\n *\n * @example\n * ```ts\n * const input = createInput()\n * // { kind: 'Input', schemas: [], operations: [] }\n * ```\n */\nexport function createInput(overrides: Partial<Omit<InputNode, 'kind'>> = {}): InputNode {\n return { schemas: [], operations: [], meta: {}, ...overrides, kind: nodeKinds.input }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { type BaseNode, nodeFactory } from './base.ts'\nimport type { ContentNode } from './content.ts'\n\n/**\n * AST node representing an operation request body.\n *\n * Body schemas live exclusively inside the `content` array (one entry per content type),\n * mirroring {@link ResponseNode}.\n *\n * @example\n * ```ts\n * const requestBody: RequestBodyNode = {\n * kind: 'RequestBody',\n * required: true,\n * content: [{ kind: 'Content', contentType: 'application/json', schema: createSchema({ type: 'string' }) }],\n * }\n * ```\n */\nexport type RequestBodyNode = BaseNode & {\n kind: 'RequestBody'\n /**\n * Request body description carried over from the spec.\n */\n description?: string\n /**\n * Whether the request body is required (`requestBody.required: true` in the spec).\n * When `false` or absent, the generated `data` parameter should be optional.\n */\n required?: boolean\n /**\n * Content type entries for this request body.\n *\n * When the adapter `contentType` option is set, this array contains exactly one entry for\n * that content type. Otherwise it contains one entry per content type declared in the spec,\n * so plugins can generate code for every variant (for example, separate hooks for\n * `application/json` and `multipart/form-data`).\n */\n content?: Array<ContentNode>\n /** Vendor extensions (`x-*` keys) from the source request body, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\n/**\n * Creates a `RequestBodyNode`.\n */\nexport const createRequestBody = nodeFactory<RequestBodyNode>(nodeKinds.requestBody)\n","import { nodeKinds } from '../constants.ts'\nimport type { BaseNode } from './base.ts'\nimport type { AuthRequirement, ExternalDocs, InputServer } from './input.ts'\nimport type { ParameterNode } from './parameter.ts'\nimport { createRequestBody, type RequestBodyNode } from './requestBody.ts'\nimport type { ResponseNode } from './response.ts'\n\n/**\n * HTTP method an operation responds to. `QUERY` is the safe, idempotent method with a request body\n * from RFC 10008, declared with the `query` field of an OpenAPI 3.2 path item. Any other name is a\n * method the source declares outside this fixed set, in the capitalization it is sent with.\n */\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'QUERY' | (string & {})\n\n/**\n * Fields shared by every operation, regardless of transport.\n */\ntype OperationNodeBase = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Operation'\n /**\n * Stable identifier for the operation.\n */\n operationId: string\n /**\n * Group labels for the operation.\n */\n tags: Array<string>\n /**\n * Short one-line operation summary.\n */\n summary?: string\n /**\n * Full operation description.\n */\n description?: string\n /**\n * Marks the operation as deprecated.\n */\n deprecated?: boolean\n externalDocs?: ExternalDocs\n /**\n * Query, path, header, and cookie parameters for the operation.\n */\n parameters: Array<ParameterNode>\n /**\n * Request body for the operation.\n */\n requestBody?: RequestBodyNode\n /**\n * Operation responses.\n */\n responses: Array<ResponseNode>\n /**\n * Vendor extensions (`x-*` keys) from the source operation, copied as-is. Absent when the source has none.\n */\n extensions?: Record<string, unknown>\n /** The operation's own `servers`, else its path item's, such as an upload host. Absent when neither declares any. */\n servers?: Array<InputServer>\n /**\n * Ways to authenticate, from the operation or else the document. Any one entry is enough. `[]` means no auth.\n */\n auth?: Array<AuthRequirement>\n}\n\n/**\n * Operation served over HTTP. `method` and `path` are guaranteed.\n *\n * @example\n * ```ts\n * const operation: HttpOperationNode = {\n * kind: 'Operation',\n * operationId: 'listPets',\n * protocol: 'http',\n * method: 'GET',\n * path: '/pets',\n * tags: [],\n * parameters: [],\n * responses: [],\n * }\n * ```\n */\nexport type HttpOperationNode = OperationNodeBase & {\n /**\n * Transport the operation belongs to.\n */\n protocol?: 'http'\n /**\n * HTTP method like `'GET'`.\n */\n method: HttpMethod\n /**\n * Path string, for example `/pets/{petId}`, with `{param}` notation preserved.\n */\n path: string\n}\n\n/**\n * Operation for a non-HTTP transport. HTTP-only fields are forbidden.\n */\nexport type GenericOperationNode = OperationNodeBase & {\n protocol?: never\n method?: never\n path?: never\n}\n\n/**\n * AST node representing one API operation.\n *\n * Discriminated on `protocol`: an {@link HttpOperationNode} (`protocol: 'http'`) guarantees\n * `method` and `path`, while a {@link GenericOperationNode} omits them. Narrow with\n * `ast.http.isOperation(node)` or `node.protocol === 'http'` before reading `method`/`path`.\n */\nexport type OperationNode = HttpOperationNode | GenericOperationNode\n\ntype OperationInput = {\n operationId: string\n method?: HttpOperationNode['method']\n path?: HttpOperationNode['path']\n requestBody?: Omit<RequestBodyNode, 'kind'>\n [key: string]: unknown\n}\n\n/**\n * Creates an `OperationNode` with default empty arrays for `tags`, `parameters`, and `responses`.\n * HTTP operations (those carrying both `method` and `path`) are tagged with `protocol: 'http'`,\n * and the request body is normalized into a `RequestBodyNode`.\n *\n * @example\n * ```ts\n * const operation = createOperation({ operationId: 'getPetById', method: 'GET', path: '/pet/{petId}' })\n * // tags, parameters, and responses are []\n * ```\n */\nexport function createOperation(\n props: Pick<HttpOperationNode, 'operationId' | 'method' | 'path'> &\n Partial<Omit<HttpOperationNode, 'kind' | 'operationId' | 'method' | 'path' | 'requestBody'>> & {\n requestBody?: Omit<RequestBodyNode, 'kind'>\n },\n): HttpOperationNode\nexport function createOperation(\n props: Pick<GenericOperationNode, 'operationId'> &\n Partial<Omit<GenericOperationNode, 'kind' | 'operationId' | 'requestBody'>> & {\n requestBody?: Omit<RequestBodyNode, 'kind'>\n },\n): GenericOperationNode\nexport function createOperation(props: OperationInput): OperationNode {\n const { requestBody, ...rest } = props\n const isHttp = rest.method !== undefined && rest.path !== undefined\n\n const node = {\n tags: [],\n parameters: [],\n responses: [],\n ...rest,\n kind: nodeKinds.operation,\n ...(isHttp ? { protocol: 'http' as const } : {}),\n requestBody: requestBody ? createRequestBody(requestBody) : undefined,\n }\n\n return node as OperationNode\n}\n\n/**\n * The operations a plugin keeps, as one node. A template with `kind: 'Operations'` gets it once, after every operation.\n */\nexport type OperationsNode = BaseNode & {\n kind: 'Operations'\n operations: Array<OperationNode>\n}\n\n/**\n * Creates an `OperationsNode` for a list of operations.\n *\n * @example\n * ```ts\n * const node = createOperations({ operations: [listPets, getPetById] })\n * // { kind: 'Operations', operations: [...] }\n * ```\n */\nexport function createOperations({ operations }: { operations: Array<OperationNode> }): OperationsNode {\n return { kind: nodeKinds.operations, operations }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { applyOptionality } from '../optionality.ts'\nimport type { BaseNode } from './base.ts'\nimport type { EncodingNode, ExampleNode } from './content.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * Where a parameter is sent. `querystring` carries the whole query string as one value, serialized per `contentType`.\n */\nexport type ParameterLocation = 'path' | 'query' | 'header' | 'cookie' | 'querystring'\n\n/**\n * Parameter serialization style, controlling how a parameter value is rendered into the request.\n */\nexport type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject' | 'cookie'\n\n/**\n * AST node representing one operation parameter.\n *\n * @example\n * ```ts\n * const param: ParameterNode = {\n * kind: 'Parameter',\n * name: 'petId',\n * in: 'path',\n * schema: createSchema({ type: 'string' }),\n * required: true,\n * }\n * ```\n */\nexport type ParameterNode = BaseNode & {\n kind: 'Parameter'\n /**\n * Parameter name.\n */\n name: string\n /**\n * Parameter location (`path`, `query`, `header`, `cookie`, or `querystring`).\n */\n in: ParameterLocation\n /**\n * Parameter schema.\n */\n schema: SchemaNode\n /**\n * Whether the parameter is required.\n */\n required: boolean\n /**\n * Serialization style. Absent when the source omits it, leaving consumers to apply the\n * per-location default.\n */\n style?: ParameterStyle\n /**\n * Whether array and object values expand into separate values. Absent when the source omits it,\n * leaving consumers to apply the default for the style.\n */\n explode?: boolean\n /**\n * Whether reserved characters (RFC 3986 `:/?#[]@!$&'()*+,;=`) are sent as-is instead of\n * percent-encoded. Absent when the source omits it.\n */\n allowReserved?: boolean\n /**\n * Media type of a parameter described with `content` instead of `schema`, for example\n * `application/json` when the value is sent as a JSON-encoded string. Absent for `schema` parameters.\n */\n contentType?: string\n /**\n * Serialization settings per property of a `content` parameter, from the `encoding` of its media type. An OpenAPI 3.2\n * `querystring` parameter sent as `application/x-www-form-urlencoded` uses it to set `style` and `explode` per field.\n */\n encoding?: Record<string, EncodingNode>\n examples?: Array<ExampleNode>\n deprecated?: boolean\n allowEmptyValue?: boolean\n /** Vendor extensions (`x-*` keys) from the source parameter, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\ntype UserParameterNode = Pick<ParameterNode, 'name' | 'in' | 'schema'> & Partial<Omit<ParameterNode, 'kind' | 'name' | 'in' | 'schema'>>\n\n/**\n * Creates a `ParameterNode`. `required` defaults to `false`, and the schema's\n * `optional`/`nullish` flags are derived from it.\n *\n * @example\n * ```ts\n * const param = createParameter({\n * name: 'petId',\n * in: 'path',\n * required: true,\n * schema: createSchema({ type: 'string' }),\n * })\n * ```\n */\nexport function createParameter(input: UserParameterNode): ParameterNode {\n const required = input.required ?? false\n\n return { ...input, required, schema: applyOptionality(input.schema, required), kind: nodeKinds.parameter }\n}\n","import { nodeKinds } from '../constants.ts'\nimport { applyOptionality } from '../optionality.ts'\nimport type { BaseNode } from './base.ts'\nimport type { SchemaNode } from './schema.ts'\n\n/**\n * AST node representing one named object property.\n *\n * @example\n * ```ts\n * const property: PropertyNode = {\n * kind: 'Property',\n * name: 'id',\n * schema: createSchema({ type: 'integer' }),\n * required: true,\n * }\n * ```\n */\nexport type PropertyNode = BaseNode & {\n kind: 'Property'\n /**\n * Property key.\n */\n name: string\n /**\n * Property schema.\n */\n schema: SchemaNode\n /**\n * Whether the property is required.\n */\n required: boolean\n}\n\n/**\n * Loosely-typed property accepted by `createProperty`, with `required` optional.\n */\ntype UserPropertyNode = Pick<PropertyNode, 'name' | 'schema'> & Partial<Omit<PropertyNode, 'kind' | 'name' | 'schema'>>\n\n/**\n * Creates a `PropertyNode`. `required` defaults to `false`, and the schema's\n * `optional`/`nullish` flags are derived from it.\n *\n * @example\n * ```ts\n * const property = createProperty({\n * name: 'status',\n * required: true,\n * schema: createSchema({ type: 'string', nullable: true }),\n * })\n * // required=true, no optional/nullish\n * ```\n */\nexport function createProperty(input: UserPropertyNode): PropertyNode {\n const required = input.required ?? false\n\n return { ...input, required, schema: applyOptionality(input.schema, required), kind: nodeKinds.property }\n}\n","import { nodeKinds } from '../constants.ts'\nimport type { BaseNode } from './base.ts'\nimport { type ContentNode, createContent } from './content.ts'\nimport type { InputServer } from './input.ts'\nimport type { ParameterNode } from './parameter.ts'\nimport type { SchemaNode } from './schema.ts'\n\ntype Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9\n\n/**\n * Response status code literal used by operations.\n *\n * Includes three-digit HTTP status code strings, ranges such as `\"2xx\"`, and `\"default\"` for catch-all responses.\n *\n * @example\n * ```ts\n * const status: StatusCode = '200'\n * const fallback: StatusCode = 'default'\n * ```\n */\nexport type StatusCode = `${1 | 2 | 3 | 4 | 5}${Digit}${Digit}` | `${1 | 2 | 3 | 4 | 5}xx` | 'default'\n\n/**\n * AST node representing one operation response variant.\n *\n * Mirrors {@link OperationNode.requestBody}: the response body schemas live exclusively inside\n * the `content` array (one entry per content type), so the same schema is never duplicated at the\n * node root and inside `content`.\n *\n * @example\n * ```ts\n * const response: ResponseNode = {\n * kind: 'Response',\n * statusCode: '200',\n * content: [{ kind: 'Content', contentType: 'application/json', schema: createSchema({ type: 'string' }) }],\n * }\n * ```\n */\nexport type ResponseNode = BaseNode & {\n /**\n * Node kind.\n */\n kind: 'Response'\n /**\n * HTTP status code or `'default'` for a fallback response.\n */\n statusCode: StatusCode\n summary?: string\n /**\n * Optional response description.\n */\n description?: string\n /**\n * All available content type entries for this response.\n *\n * For a response that declares content, the array holds exactly one entry for the adapter\n * `contentType` option when it is set. Otherwise it holds one entry per content type declared in\n * the spec, so that plugins can generate a union of response types (e.g. `application/json` and\n * `application/xml`). A body-less response always keeps a single entry whose `contentType` is `''`\n * and whose `schema` is the empty/`void` placeholder, even when the option is set.\n *\n * @example\n * ```ts\n * // spec response declares both application/json and application/xml\n * response.content[0].contentType // 'application/json'\n * response.content[1].contentType // 'application/xml'\n * ```\n */\n content?: Array<ContentNode>\n /**\n * Response headers, as `in: 'header'` parameters. `Content-Type` is left out.\n */\n headers?: Array<ParameterNode>\n links?: Record<string, ResponseLink>\n /** Vendor extensions (`x-*` keys) from the source response, copied as-is. */\n extensions?: Record<string, unknown>\n}\n\n/**\n * A link to another operation. `parameters` and `requestBody` hold runtime expressions such as `$response.body#/id`.\n */\nexport type ResponseLink = {\n operationId?: string\n operationRef?: string\n parameters?: Record<string, unknown>\n requestBody?: unknown\n description?: string\n server?: InputServer\n}\n\ntype ResponseInput = Pick<ResponseNode, 'statusCode'> &\n Partial<Omit<ResponseNode, 'kind' | 'statusCode' | 'content'>> & {\n content?: Array<ContentNode>\n schema?: SchemaNode\n mediaType?: string | null\n keysToOmit?: Array<string> | null\n }\n\n/**\n * Creates a `ResponseNode`. A single legacy `schema` (with optional `mediaType`/`keysToOmit`)\n * is normalized into one `content` entry.\n *\n * @example\n * ```ts\n * const response = createResponse({\n * statusCode: '200',\n * content: [createContent({ contentType: 'application/json', schema: createSchema({ type: 'object', properties: [] }) })],\n * })\n * ```\n */\nexport function createResponse(props: ResponseInput): ResponseNode {\n const { schema, mediaType, keysToOmit, content, ...rest } = props\n const entries = content ?? (schema ? [createContent({ contentType: mediaType ?? 'application/json', schema, keysToOmit: keysToOmit ?? null })] : undefined)\n\n return { ...rest, content: entries, kind: nodeKinds.response }\n}\n","import type { ArrowFunctionNode, BreakNode, ConstNode, FunctionNode, JsxNode, TextNode, TypeNode } from './code.ts'\nimport type { ContentNode } from './content.ts'\nimport type { ExportNode, FileNode, ImportNode, SourceNode } from './file.ts'\nimport type { InputNode } from './input.ts'\nimport type { OperationNode, OperationsNode } from './operation.ts'\nimport type { ParameterNode } from './parameter.ts'\nimport type { PropertyNode } from './property.ts'\nimport type { RequestBodyNode } from './requestBody.ts'\nimport type { ResponseNode } from './response.ts'\nimport type { SchemaNode } from './schema.ts'\n\nexport { createArrowFunction, createBreak, createConst, createFunction, createJsx, createText, createType } from './code.ts'\nexport { createContent } from './content.ts'\nexport { createExport, createFile, createImport, createSource } from './file.ts'\nexport type { ExportInput, ImportInput, ModuleName, Space, UserFileNode } from './file.ts'\nexport { createInput } from './input.ts'\nexport { createOperation, createOperations } from './operation.ts'\nexport { createParameter } from './parameter.ts'\nexport { createProperty } from './property.ts'\nexport { createRequestBody } from './requestBody.ts'\nexport { createResponse } from './response.ts'\nexport { createSchema } from './schema.ts'\n\n/**\n * Union of all AST node types.\n *\n * This lets TypeScript narrow types in `switch (node.kind)` blocks.\n *\n * @example\n * ```ts\n * function getKind(node: Node): string {\n * switch (node.kind) {\n * case nodeKinds.input:\n * return 'input'\n * default:\n * return 'other'\n * }\n * }\n * ```\n */\nexport type Node =\n | InputNode\n | OperationNode\n | OperationsNode\n | SchemaNode\n | PropertyNode\n | ParameterNode\n | ResponseNode\n | RequestBodyNode\n | ContentNode\n | FileNode\n | ImportNode\n | ExportNode\n | SourceNode\n | ConstNode\n | TypeNode\n | FunctionNode\n | ArrowFunctionNode\n | TextNode\n | BreakNode\n | JsxNode\n"],"mappings":";;;;;;;;;;;;;;;AAmQA,MAAa,cAAc,YAAuB,UAAU,KAAK;;;;;;;;;;AAWjE,MAAa,aAAa,YAAsB,UAAU,IAAI;;;;;;;;;;AAW9D,MAAa,iBAAiB,YAA0B,UAAU,QAAQ;;;;;;;;;;AAW1E,MAAa,sBAAsB,YAA+B,UAAU,aAAa;;;;;;;;;;AAWzF,SAAgB,WAAW,OAAyB;CAClD,OAAO;EAAE,MAAM,UAAU;EAAM;CAAM;AACvC;;;;;;;;;;AAWA,SAAgB,cAAyB;CACvC,OAAO,EAAE,MAAM,UAAU,MAAM;AACjC;;;;;;;;;;AAWA,SAAgB,UAAU,OAAwB;CAChD,OAAO;EAAE,MAAM,UAAU;EAAK;CAAM;AACtC;;;;;ACjOA,MAAa,gBAAgB,YAAyB,UAAU,OAAO;;;;;;;;;;;;AC2DvE,SAAgB,YAAY,YAA8C,CAAC,GAAc;CACvF,OAAO;EAAE,SAAS,CAAC;EAAG,YAAY,CAAC;EAAG,MAAM,CAAC;EAAG,GAAG;EAAW,MAAM,UAAU;CAAM;AACtF;;;;;ACzHA,MAAa,oBAAoB,YAA6B,UAAU,WAAW;;ACsGnF,SAAgB,gBAAgB,OAAsC;CACpE,MAAM,EAAE,aAAa,GAAG,SAAS;CACjC,MAAM,SAAS,KAAK,WAAW,KAAA,KAAa,KAAK,SAAS,KAAA;CAY1D,OAAO;EATL,MAAM,CAAC;EACP,YAAY,CAAC;EACb,WAAW,CAAC;EACZ,GAAG;EACH,MAAM,UAAU;EAChB,GAAI,SAAS,EAAE,UAAU,OAAgB,IAAI,CAAC;EAC9C,aAAa,cAAc,kBAAkB,WAAW,IAAI,KAAA;CAGpD;AACZ;;;;;;;;;;AAmBA,SAAgB,iBAAiB,EAAE,cAAoE;CACrG,OAAO;EAAE,MAAM,UAAU;EAAY;CAAW;AAClD;;;;;;;;;;;;;;;;ACxFA,SAAgB,gBAAgB,OAAyC;CACvE,MAAM,WAAW,MAAM,YAAY;CAEnC,OAAO;EAAE,GAAG;EAAO;EAAU,QAAQ,iBAAiB,MAAM,QAAQ,QAAQ;EAAG,MAAM,UAAU;CAAU;AAC3G;;;;;;;;;;;;;;;;AC/CA,SAAgB,eAAe,OAAuC;CACpE,MAAM,WAAW,MAAM,YAAY;CAEnC,OAAO;EAAE,GAAG;EAAO;EAAU,QAAQ,iBAAiB,MAAM,QAAQ,QAAQ;EAAG,MAAM,UAAU;CAAS;AAC1G;;;;;;;;;;;;;;ACqDA,SAAgB,eAAe,OAAoC;CACjE,MAAM,EAAE,QAAQ,WAAW,YAAY,SAAS,GAAG,SAAS;CAC5D,MAAM,UAAU,YAAY,SAAS,CAAC,cAAc;EAAE,aAAa,aAAa;EAAoB;EAAQ,YAAY,cAAc;CAAK,CAAC,CAAC,IAAI,KAAA;CAEjJ,OAAO;EAAE,GAAG;EAAM,SAAS;EAAS,MAAM,UAAU;CAAS;AAC/D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DistributiveOmit, t as BaseNode } from "./base-
|
|
1
|
+
import { n as DistributiveOmit, t as BaseNode } from "./base-A-xF4pUL.js";
|
|
2
2
|
/**
|
|
3
3
|
* AST node representing one named object property.
|
|
4
4
|
*
|
|
@@ -786,6 +786,12 @@ type InputMeta = {
|
|
|
786
786
|
* Resolved base URL from the first matching server entry in the source document.
|
|
787
787
|
*/
|
|
788
788
|
baseURL?: string | null;
|
|
789
|
+
/**
|
|
790
|
+
* The server index the adapter was configured with. A plugin uses it to pick the server at the same position in an
|
|
791
|
+
* operation's or a path's own `servers`. It counts the source document's entries, including any without a URL.
|
|
792
|
+
* Absent when the adapter was given no index.
|
|
793
|
+
*/
|
|
794
|
+
serverIndex?: number;
|
|
789
795
|
servers?: Array<InputServer>;
|
|
790
796
|
tags?: Array<InputTag>;
|
|
791
797
|
auth?: Array<AuthScheme>;
|
|
@@ -1285,4 +1291,23 @@ declare function createOperation(props: Pick<HttpOperationNode, 'operationId' |
|
|
|
1285
1291
|
declare function createOperation(props: Pick<GenericOperationNode, 'operationId'> & Partial<Omit<GenericOperationNode, 'kind' | 'operationId' | 'requestBody'>> & {
|
|
1286
1292
|
requestBody?: Omit<RequestBodyNode, 'kind'>;
|
|
1287
1293
|
}): GenericOperationNode;
|
|
1288
|
-
|
|
1294
|
+
/**
|
|
1295
|
+
* The operations a plugin keeps, as one node. A template with `kind: 'Operations'` gets it once, after every operation.
|
|
1296
|
+
*/
|
|
1297
|
+
type OperationsNode = BaseNode & {
|
|
1298
|
+
kind: 'Operations';
|
|
1299
|
+
operations: Array<OperationNode>;
|
|
1300
|
+
};
|
|
1301
|
+
/**
|
|
1302
|
+
* Creates an `OperationsNode` for a list of operations.
|
|
1303
|
+
*
|
|
1304
|
+
* @example
|
|
1305
|
+
* ```ts
|
|
1306
|
+
* const node = createOperations({ operations: [listPets, getPetById] })
|
|
1307
|
+
* // { kind: 'Operations', operations: [...] }
|
|
1308
|
+
* ```
|
|
1309
|
+
*/
|
|
1310
|
+
declare function createOperations({ operations }: {
|
|
1311
|
+
operations: Array<OperationNode>;
|
|
1312
|
+
}): OperationsNode;
|
|
1313
|
+
export { PropertyNode as $, OAuthFlow as A, ObjectSchemaNode as B, AuthRequirement as C, InputNode as D, InputMeta as E, DatetimeSchemaNode as F, SchemaNode as G, RefSchemaNode as H, EnumSchemaNode as I, StringSchemaNode as J, SchemaNodeByType as K, IntersectionSchemaNode as L, ArraySchemaNode as M, BlobSchemaNode as N, InputServer as O, DateSchemaNode as P, createSchema as Q, NotSchemaNode as R, AuthCredential as S, ExternalDocs as T, ScalarSchemaNode as U, PrimitiveSchemaType as V, ScalarSchemaType as W, UnionSchemaNode as X, TimeSchemaNode as Y, UrlSchemaNode as Z, createParameter as _, OperationsNode as a, ExampleNode as b, ResponseLink as c, createResponse as d, createProperty as et, RequestBodyNode as f, ParameterStyle as g, ParameterNode as h, OperationNode as i, createInput as j, InputTag as k, ResponseNode as l, ParameterLocation as m, HttpMethod as n, createOperation as o, createRequestBody as p, SchemaType as q, HttpOperationNode as r, createOperations as s, GenericOperationNode as t, StatusCode as u, ContentNode as v, AuthScheme as w, createContent as x, EncodingNode as y, NumberSchemaNode as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DistributiveOmit, t as BaseNode } from "./base-
|
|
1
|
+
import { n as DistributiveOmit, t as BaseNode } from "./base-CyJhBRMi.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* AST node representing one named object property.
|
|
4
4
|
*
|
|
@@ -786,6 +786,12 @@ type InputMeta = {
|
|
|
786
786
|
* Resolved base URL from the first matching server entry in the source document.
|
|
787
787
|
*/
|
|
788
788
|
baseURL?: string | null;
|
|
789
|
+
/**
|
|
790
|
+
* The server index the adapter was configured with. A plugin uses it to pick the server at the same position in an
|
|
791
|
+
* operation's or a path's own `servers`. It counts the source document's entries, including any without a URL.
|
|
792
|
+
* Absent when the adapter was given no index.
|
|
793
|
+
*/
|
|
794
|
+
serverIndex?: number;
|
|
789
795
|
servers?: Array<InputServer>;
|
|
790
796
|
tags?: Array<InputTag>;
|
|
791
797
|
auth?: Array<AuthScheme>;
|
|
@@ -1285,4 +1291,23 @@ declare function createOperation(props: Pick<HttpOperationNode, 'operationId' |
|
|
|
1285
1291
|
declare function createOperation(props: Pick<GenericOperationNode, 'operationId'> & Partial<Omit<GenericOperationNode, 'kind' | 'operationId' | 'requestBody'>> & {
|
|
1286
1292
|
requestBody?: Omit<RequestBodyNode, 'kind'>;
|
|
1287
1293
|
}): GenericOperationNode;
|
|
1288
|
-
|
|
1294
|
+
/**
|
|
1295
|
+
* The operations a plugin keeps, as one node. A template with `kind: 'Operations'` gets it once, after every operation.
|
|
1296
|
+
*/
|
|
1297
|
+
type OperationsNode = BaseNode & {
|
|
1298
|
+
kind: 'Operations';
|
|
1299
|
+
operations: Array<OperationNode>;
|
|
1300
|
+
};
|
|
1301
|
+
/**
|
|
1302
|
+
* Creates an `OperationsNode` for a list of operations.
|
|
1303
|
+
*
|
|
1304
|
+
* @example
|
|
1305
|
+
* ```ts
|
|
1306
|
+
* const node = createOperations({ operations: [listPets, getPetById] })
|
|
1307
|
+
* // { kind: 'Operations', operations: [...] }
|
|
1308
|
+
* ```
|
|
1309
|
+
*/
|
|
1310
|
+
declare function createOperations({ operations }: {
|
|
1311
|
+
operations: Array<OperationNode>;
|
|
1312
|
+
}): OperationsNode;
|
|
1313
|
+
export { PropertyNode as $, OAuthFlow as A, ObjectSchemaNode as B, AuthRequirement as C, InputNode as D, InputMeta as E, DatetimeSchemaNode as F, SchemaNode as G, RefSchemaNode as H, EnumSchemaNode as I, StringSchemaNode as J, SchemaNodeByType as K, IntersectionSchemaNode as L, ArraySchemaNode as M, BlobSchemaNode as N, InputServer as O, DateSchemaNode as P, createSchema as Q, NotSchemaNode as R, AuthCredential as S, ExternalDocs as T, ScalarSchemaNode as U, PrimitiveSchemaType as V, ScalarSchemaType as W, UnionSchemaNode as X, TimeSchemaNode as Y, UrlSchemaNode as Z, createParameter as _, OperationsNode as a, ExampleNode as b, ResponseLink as c, createResponse as d, createProperty as et, RequestBodyNode as f, ParameterStyle as g, ParameterNode as h, OperationNode as i, createInput as j, InputTag as k, ResponseNode as l, ParameterLocation as m, HttpMethod as n, createOperation as o, createRequestBody as p, SchemaType as q, HttpOperationNode as r, createOperations as s, GenericOperationNode as t, StatusCode as u, ContentNode as v, AuthScheme as w, createContent as x, EncodingNode as y, NumberSchemaNode as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
2
2
|
const require_refs = require("./refs-rmr2LFV1.cjs");
|
|
3
3
|
const require_guards = require("./guards-4drgx10i.cjs");
|
|
4
|
-
const require_schema = require("./schema-
|
|
4
|
+
const require_schema = require("./schema-0YJZqRXb.cjs");
|
|
5
5
|
// src/ref/index.ts
|
|
6
6
|
var ref_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
7
7
|
getName: () => getName,
|
|
@@ -36,4 +36,4 @@ Object.defineProperty(exports, "ref_exports", {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=ref-
|
|
39
|
+
//# sourceMappingURL=ref-Ck-0j8NV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref-
|
|
1
|
+
{"version":3,"file":"ref-Ck-0j8NV.cjs","names":["narrowSchema","createSchema","mergeRefWithSchema","refName","resolveRefName"],"sources":["../src/ref/index.ts"],"sourcesContent":["export { isBareRef as isAlias, resolveRef as getSchema } from '../utils/refs.ts'\nimport { narrowSchema } from '../guards.ts'\nimport { createSchema, type SchemaNode } from '../nodes/schema.ts'\nimport { mergeRefWithSchema, refName, resolveRefName } from '../utils/refs.ts'\n\n/** A resolved ref merged with its target schema, so usage-site fields such as `description` win. Other nodes come back unchanged. */\nexport function mergeSchema(node: SchemaNode): SchemaNode {\n const ref = narrowSchema(node, 'ref')\n return ref?.schema ? createSchema(mergeRefWithSchema(ref)) : node\n}\n\n/**\n * The name a ref points at. A `$ref` string gives its last segment: `'#/components/schemas/Pet'` gives `'Pet'`.\n * A ref node gives its `targetName` first, so pass the node, not `node.ref`, to respect a renamed target. Other nodes give `null`.\n */\nexport function getName(ref: string): string\nexport function getName(node: SchemaNode | null | undefined): string | null\nexport function getName(input: string | SchemaNode | null | undefined): string | null {\n return typeof input === 'string' ? refName(input) : resolveRefName(input)\n}\n"],"mappings":";;;;;;;;;;;;AAMA,SAAgB,YAAY,MAA8B;CACxD,MAAM,MAAMA,eAAAA,aAAa,MAAM,KAAK;CACpC,OAAO,KAAK,SAASC,eAAAA,aAAaC,aAAAA,mBAAmB,GAAG,CAAC,IAAI;AAC/D;AAQA,SAAgB,QAAQ,OAA8D;CACpF,OAAO,OAAO,UAAU,WAAWC,aAAAA,QAAQ,KAAK,IAAIC,aAAAA,eAAe,KAAK;AAC1E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BYyVTPww.js";
|
|
2
2
|
import { a as resolveRefName, i as resolveRef, n as mergeRefWithSchema, r as refName, t as isBareRef } from "./refs-Bgf8_9Ui.js";
|
|
3
3
|
import { n as narrowSchema } from "./guards-DKw4uwc5.js";
|
|
4
|
-
import { t as createSchema } from "./schema-
|
|
4
|
+
import { t as createSchema } from "./schema-CC008xgK.js";
|
|
5
5
|
// src/ref/index.ts
|
|
6
6
|
var ref_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
getName: () => getName,
|
|
@@ -19,4 +19,4 @@ function getName(input) {
|
|
|
19
19
|
}
|
|
20
20
|
export { mergeSchema as n, ref_exports as r, getName as t };
|
|
21
21
|
|
|
22
|
-
//# sourceMappingURL=ref-
|
|
22
|
+
//# sourceMappingURL=ref-Dlxn7eu7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref-
|
|
1
|
+
{"version":3,"file":"ref-Dlxn7eu7.js","names":[],"sources":["../src/ref/index.ts"],"sourcesContent":["export { isBareRef as isAlias, resolveRef as getSchema } from '../utils/refs.ts'\nimport { narrowSchema } from '../guards.ts'\nimport { createSchema, type SchemaNode } from '../nodes/schema.ts'\nimport { mergeRefWithSchema, refName, resolveRefName } from '../utils/refs.ts'\n\n/** A resolved ref merged with its target schema, so usage-site fields such as `description` win. Other nodes come back unchanged. */\nexport function mergeSchema(node: SchemaNode): SchemaNode {\n const ref = narrowSchema(node, 'ref')\n return ref?.schema ? createSchema(mergeRefWithSchema(ref)) : node\n}\n\n/**\n * The name a ref points at. A `$ref` string gives its last segment: `'#/components/schemas/Pet'` gives `'Pet'`.\n * A ref node gives its `targetName` first, so pass the node, not `node.ref`, to respect a renamed target. Other nodes give `null`.\n */\nexport function getName(ref: string): string\nexport function getName(node: SchemaNode | null | undefined): string | null\nexport function getName(input: string | SchemaNode | null | undefined): string | null {\n return typeof input === 'string' ? refName(input) : resolveRefName(input)\n}\n"],"mappings":";;;;;;;;;;;;AAMA,SAAgB,YAAY,MAA8B;CACxD,MAAM,MAAM,aAAa,MAAM,KAAK;CACpC,OAAO,KAAK,SAAS,aAAa,mBAAmB,GAAG,CAAC,IAAI;AAC/D;AAQA,SAAgB,QAAQ,OAA8D;CACpF,OAAO,OAAO,UAAU,WAAW,QAAQ,KAAK,IAAI,eAAe,KAAK;AAC1E"}
|
package/dist/ref.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_refs = require("./refs-rmr2LFV1.cjs");
|
|
3
|
-
const require_ref = require("./ref-
|
|
3
|
+
const require_ref = require("./ref-Ck-0j8NV.cjs");
|
|
4
4
|
exports.getName = require_ref.getName;
|
|
5
5
|
exports.getSchema = require_refs.resolveRef;
|
|
6
6
|
exports.isAlias = require_refs.isBareRef;
|
package/dist/ref.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as isBareRef, o as resolveRef, r as mergeSchema, t as getName } from "./index-
|
|
1
|
+
import { i as isBareRef, o as resolveRef, r as mergeSchema, t as getName } from "./index-D2tWPgnK.cjs";
|
|
2
2
|
export { getName, resolveRef as getSchema, isBareRef as isAlias, mergeSchema };
|
package/dist/ref.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as isBareRef, o as resolveRef, r as mergeSchema, t as getName } from "./index-
|
|
1
|
+
import { i as isBareRef, o as resolveRef, r as mergeSchema, t as getName } from "./index-YTyLBHFN.js";
|
|
2
2
|
export { getName, resolveRef as getSchema, isBareRef as isAlias, mergeSchema };
|
package/dist/ref.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as resolveRef, t as isBareRef } from "./refs-Bgf8_9Ui.js";
|
|
2
|
-
import { n as mergeSchema, t as getName } from "./ref-
|
|
2
|
+
import { n as mergeSchema, t as getName } from "./ref-Dlxn7eu7.js";
|
|
3
3
|
export { getName, resolveRef as getSchema, isBareRef as isAlias, mergeSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
2
|
-
const require_constants = require("./constants-
|
|
2
|
+
const require_constants = require("./constants-BCRkFAiy.cjs");
|
|
3
3
|
// src/nodes/schema.ts
|
|
4
4
|
/**
|
|
5
5
|
* Maps schema `type` to its underlying `primitive`.
|
|
@@ -46,4 +46,4 @@ Object.defineProperty(exports, "createSchema", {
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
//# sourceMappingURL=schema-
|
|
49
|
+
//# sourceMappingURL=schema-0YJZqRXb.cjs.map
|