@kubb/ast 5.0.0-beta.91 → 5.0.0-beta.94
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/dist/index.cjs +5 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -29
- package/dist/index.js.map +1 -1
- package/dist/{types-D12-e8Av.d.ts → types-CsAwiskn.d.ts} +10 -70
- package/dist/types.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as __name, t as __exportAll } from "./rolldown-runtime-CNktS9qV.js";
|
|
2
|
-
import { $ as sourceDef, $t as NodeDef, A as StatusCode, At as BreakNode, B as parameterDef, Bt as constDef, C as GenericOperationNode, Ct as PropertyNode, D as createOperation, Dt as InferSchemaNode, E as OperationNode, Et as propertyDef, F as requestBodyDef, Ft as JsxNode, G as UserFileNode, Gt as createJsx, H as FileNode, Ht as createBreak, I as ParameterLocation, It as TextNode, J as createImport, Jt as functionDef, K as createExport, Kt as createText, L as ParameterNode, Lt as TypeNode, M as responseDef, Mt as ConstNode, N as RequestBodyNode, Nt as FunctionNode, O as operationDef, Ot as ParserOptions, P as createRequestBody, Pt as JSDocNode, Q as importDef, Qt as DistributiveOmit, R as ParameterStyle, Rt as arrowFunctionDef, S as inputDef, St as schemaDef, T as HttpOperationNode, Tt as createProperty, U as ImportNode, Ut as createConst, V as ExportNode, Vt as createArrowFunction, W as SourceNode, Wt as createFunction, X as exportDef, Xt as textDef, Y as createSource, Yt as jsxDef, Z as fileDef, Zt as typeDef, _ as createOutput, _t as StringSchemaNode, a as Enforce,
|
|
2
|
+
import { $ as sourceDef, $t as NodeDef, A as StatusCode, At as BreakNode, B as parameterDef, Bt as constDef, C as GenericOperationNode, Ct as PropertyNode, D as createOperation, Dt as InferSchemaNode, E as OperationNode, Et as propertyDef, F as requestBodyDef, Ft as JsxNode, G as UserFileNode, Gt as createJsx, H as FileNode, Ht as createBreak, I as ParameterLocation, It as TextNode, J as createImport, Jt as functionDef, K as createExport, Kt as createText, L as ParameterNode, Lt as TypeNode, M as responseDef, Mt as ConstNode, N as RequestBodyNode, Nt as FunctionNode, O as operationDef, Ot as ParserOptions, P as createRequestBody, Pt as JSDocNode, Q as importDef, Qt as DistributiveOmit, R as ParameterStyle, Rt as arrowFunctionDef, S as inputDef, St as schemaDef, T as HttpOperationNode, Tt as createProperty, U as ImportNode, Ut as createConst, V as ExportNode, Vt as createArrowFunction, W as SourceNode, Wt as createFunction, X as exportDef, Xt as textDef, Y as createSource, Yt as jsxDef, Z as fileDef, Zt as typeDef, _ as createOutput, _t as StringSchemaNode, a as Enforce, at as DatetimeSchemaNode, b as InputNode, bt as UrlSchemaNode, c as composeMacros, ct as NumberSchemaNode, d as Visitor, dt as RefSchemaNode, en as defineNode, et as ContentNode, f as VisitorContext, ft as ScalarSchemaNode, g as OutputNode, gt as SchemaType, h as Node, ht as SchemaNodeByType, i as createPrinter, it as DateSchemaNode, j as createResponse, jt as CodeNode, k as ResponseNode, kt as ArrowFunctionNode, l as defineMacro, lt as ObjectSchemaNode, m as transform, mt as SchemaNode, n as PrinterFactoryOptions, nn as NodeKind, nt as createContent, o as Macro, ot as EnumSchemaNode, p as collect, pt as ScalarSchemaType, q as createFile, qt as createType, r as PrinterPartial, rn as schemaTypes, rt as ArraySchemaNode, s as applyMacros, st as IntersectionSchemaNode, t as Printer, tn as BaseNode, tt as contentDef, u as ParentOf, ut as PrimitiveSchemaType, v as outputDef, vt as TimeSchemaNode, w as HttpMethod, wt as UserPropertyNode, x as createInput, xt as createSchema, y as InputMeta, yt as UnionSchemaNode, z as createParameter, zt as breakDef } from "./types-CsAwiskn.js";
|
|
3
3
|
|
|
4
4
|
//#region src/guards.d.ts
|
|
5
5
|
/**
|
|
@@ -118,7 +118,7 @@ declare function enumPropName(parentName: string | null | undefined, propName: s
|
|
|
118
118
|
*/
|
|
119
119
|
declare function syncSchemaRef(node: SchemaNode): SchemaNode;
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* Returns `true` when a schema emits as a plain `string` type.
|
|
122
122
|
*
|
|
123
123
|
* Covers `string`, `uuid`, `email`, `url`, and `datetime` types. For `date` and `time`
|
|
124
124
|
* types, returns `true` only when `representation` is `'string'` rather than `'date'`.
|
|
@@ -382,8 +382,8 @@ declare const nodeDefs: (NodeDef<InputNode, Partial<Omit<InputNode, "kind">>> |
|
|
|
382
382
|
type: "ipv6";
|
|
383
383
|
}) | ScalarSchemaNode, "kind">> | NodeDef<PropertyNode, UserPropertyNode> | NodeDef<ParameterNode, Pick<ParameterNode, "schema" | "name" | "in"> & Partial<Omit<ParameterNode, "schema" | "kind" | "name" | "in">>> | NodeDef<ConstNode, Omit<ConstNode, "kind">> | NodeDef<TypeNode, Omit<TypeNode, "kind">> | NodeDef<FunctionNode, Omit<FunctionNode, "kind">> | NodeDef<ArrowFunctionNode, Omit<ArrowFunctionNode, "kind">> | NodeDef<TextNode, string> | NodeDef<BreakNode, void> | NodeDef<JsxNode, string> | NodeDef<ImportNode, Omit<ImportNode, "kind">> | NodeDef<ExportNode, Omit<ExportNode, "kind">> | NodeDef<SourceNode, Omit<SourceNode, "kind">> | NodeDef<FileNode<object>, Omit<FileNode<object>, "kind">>)[];
|
|
384
384
|
declare namespace exports_d_exports {
|
|
385
|
-
export { ArraySchemaNode, ArrowFunctionNode, BreakNode, CodeNode, ConstNode, ContentNode, DateSchemaNode, DatetimeSchemaNode,
|
|
385
|
+
export { ArraySchemaNode, ArrowFunctionNode, BreakNode, CodeNode, ConstNode, ContentNode, DateSchemaNode, DatetimeSchemaNode, DistributiveOmit, Enforce, EnumSchemaNode, ExportNode, FileNode, FunctionNode, GenericOperationNode, HttpMethod, HttpOperationNode, ImportNode, InferSchemaNode, InputMeta, InputNode, IntersectionSchemaNode, JSDocNode, JsxNode, Macro, Node, NodeDef, NodeKind, NumberSchemaNode, ObjectSchemaNode, OperationNode, OutputNode, ParameterLocation, ParameterNode, ParameterStyle, ParentOf, ParserOptions, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, RequestBodyNode, ResponseNode, ScalarSchemaNode, ScalarSchemaType, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext, applyMacros, arrowFunctionDef, breakDef, childName, collect, collectUsedSchemaNames, combineExports, combineImports, combineSources, composeMacros, constDef, containsCircularRef, contentDef, createPrinter, defineMacro, defineNode, enumPropName, exportDef, extractRefName, extractStringsFromNodes, factory_d_exports as factory, fileDef, findCircularSchemas, functionDef, importDef, inputDef, isHttpOperationNode, isStringType, jsxDef, macroDiscriminatorEnum, macroEnumName, macroSimplifyUnion, mapSchemaItems, mapSchemaMembers, mapSchemaProperties, mergeAdjacentObjectsLazy, narrowSchema, nodeDefs, operationDef, optionality, outputDef, parameterDef, propertyDef, requestBodyDef, responseDef, schemaDef, schemaTypes, sourceDef, syncSchemaRef, textDef, transform, typeDef };
|
|
386
386
|
}
|
|
387
387
|
//#endregion
|
|
388
|
-
export { type ArraySchemaNode, type ArrowFunctionNode, type BreakNode, type CodeNode, type ConstNode, type ContentNode, type DateSchemaNode, type DatetimeSchemaNode, type
|
|
388
|
+
export { type ArraySchemaNode, type ArrowFunctionNode, type BreakNode, type CodeNode, type ConstNode, type ContentNode, type DateSchemaNode, type DatetimeSchemaNode, type DistributiveOmit, type Enforce, type EnumSchemaNode, type ExportNode, type FileNode, type FunctionNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type ImportNode, type InferSchemaNode, type InputMeta, type InputNode, type IntersectionSchemaNode, type JSDocNode, type JsxNode, type Macro, type Node, type NodeDef, type NodeKind, type NumberSchemaNode, type ObjectSchemaNode, type OperationNode, type OutputNode, type ParameterLocation, type ParameterNode, type ParameterStyle, type ParentOf, type ParserOptions, type PrimitiveSchemaType, type Printer, type PrinterFactoryOptions, type PrinterPartial, type PropertyNode, type RefSchemaNode, type RequestBodyNode, type ResponseNode, type ScalarSchemaNode, type ScalarSchemaType, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, type UserFileNode, type Visitor, type VisitorContext, applyMacros, arrowFunctionDef, exports_d_exports as ast, breakDef, childName, collect, collectUsedSchemaNames, combineExports, combineImports, combineSources, composeMacros, constDef, containsCircularRef, contentDef, createPrinter, defineMacro, defineNode, enumPropName, exportDef, extractRefName, extractStringsFromNodes, factory_d_exports as factory, fileDef, findCircularSchemas, functionDef, importDef, inputDef, isHttpOperationNode, isStringType, jsxDef, macroDiscriminatorEnum, macroEnumName, macroSimplifyUnion, mapSchemaItems, mapSchemaMembers, mapSchemaProperties, mergeAdjacentObjectsLazy, narrowSchema, nodeDefs, operationDef, optionality, outputDef, parameterDef, propertyDef, requestBodyDef, responseDef, schemaDef, schemaTypes, sourceDef, syncSchemaRef, textDef, transform, typeDef };
|
|
389
389
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -118,29 +118,6 @@ const schemaTypes = {
|
|
|
118
118
|
never: "never"
|
|
119
119
|
};
|
|
120
120
|
//#endregion
|
|
121
|
-
//#region src/defineDialect.ts
|
|
122
|
-
/**
|
|
123
|
-
* Types a {@link Dialect} for an adapter. Adds no runtime behavior and only pins the
|
|
124
|
-
* dialect's type for inference.
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```ts
|
|
128
|
-
* export const oasDialect = defineDialect({
|
|
129
|
-
* name: 'oas',
|
|
130
|
-
* schema: {
|
|
131
|
-
* isNullable,
|
|
132
|
-
* isReference,
|
|
133
|
-
* isDiscriminator,
|
|
134
|
-
* isBinary: (schema) => schema.type === 'string' && schema.contentMediaType === 'application/octet-stream',
|
|
135
|
-
* resolveRef,
|
|
136
|
-
* },
|
|
137
|
-
* })
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
function defineDialect(dialect) {
|
|
141
|
-
return dialect;
|
|
142
|
-
}
|
|
143
|
-
//#endregion
|
|
144
121
|
//#region src/guards.ts
|
|
145
122
|
/**
|
|
146
123
|
* Narrows a `SchemaNode` to the variant that matches `type`.
|
|
@@ -1140,10 +1117,11 @@ function transformChildren(node, visitor, recurse) {
|
|
|
1140
1117
|
if (next !== value) (updates ??= {})[key] = next;
|
|
1141
1118
|
}
|
|
1142
1119
|
}
|
|
1143
|
-
|
|
1120
|
+
if (!updates) return node;
|
|
1121
|
+
return {
|
|
1144
1122
|
...node,
|
|
1145
1123
|
...updates
|
|
1146
|
-
}
|
|
1124
|
+
};
|
|
1147
1125
|
}
|
|
1148
1126
|
/**
|
|
1149
1127
|
* Lazy depth-first collection pass. Yields every non-null value returned by
|
|
@@ -1410,7 +1388,7 @@ function extractRefName(ref) {
|
|
|
1410
1388
|
*/
|
|
1411
1389
|
function resolveRefName(node) {
|
|
1412
1390
|
if (!node || node.type !== "ref") return null;
|
|
1413
|
-
if (node.ref) return extractRefName(node.ref)
|
|
1391
|
+
if (node.ref) return extractRefName(node.ref);
|
|
1414
1392
|
return node.name ?? node.schema?.name ?? null;
|
|
1415
1393
|
}
|
|
1416
1394
|
/**
|
|
@@ -1466,7 +1444,7 @@ function syncSchemaRef(node) {
|
|
|
1466
1444
|
});
|
|
1467
1445
|
}
|
|
1468
1446
|
/**
|
|
1469
|
-
*
|
|
1447
|
+
* Returns `true` when a schema emits as a plain `string` type.
|
|
1470
1448
|
*
|
|
1471
1449
|
* Covers `string`, `uuid`, `email`, `url`, and `datetime` types. For `date` and `time`
|
|
1472
1450
|
* types, returns `true` only when `representation` is `'string'` rather than `'date'`.
|
|
@@ -1842,7 +1820,6 @@ var exports_exports = /* @__PURE__ */ __exportAll({
|
|
|
1842
1820
|
containsCircularRef: () => containsCircularRef,
|
|
1843
1821
|
contentDef: () => contentDef,
|
|
1844
1822
|
createPrinter: () => createPrinter,
|
|
1845
|
-
defineDialect: () => defineDialect,
|
|
1846
1823
|
defineMacro: () => defineMacro,
|
|
1847
1824
|
defineNode: () => defineNode,
|
|
1848
1825
|
enumPropName: () => enumPropName,
|
|
@@ -1883,6 +1860,6 @@ var exports_exports = /* @__PURE__ */ __exportAll({
|
|
|
1883
1860
|
typeDef: () => typeDef
|
|
1884
1861
|
});
|
|
1885
1862
|
//#endregion
|
|
1886
|
-
export { applyMacros, arrowFunctionDef, exports_exports as ast, breakDef, childName, collect, collectUsedSchemaNames, combineExports, combineImports, combineSources, composeMacros, constDef, containsCircularRef, contentDef, createPrinter,
|
|
1863
|
+
export { applyMacros, arrowFunctionDef, exports_exports as ast, breakDef, childName, collect, collectUsedSchemaNames, combineExports, combineImports, combineSources, composeMacros, constDef, containsCircularRef, contentDef, createPrinter, defineMacro, defineNode, enumPropName, exportDef, extractRefName, extractStringsFromNodes, factory_exports as factory, fileDef, findCircularSchemas, functionDef, importDef, inputDef, isHttpOperationNode, isStringType, jsxDef, macroDiscriminatorEnum, macroEnumName, macroSimplifyUnion, mapSchemaItems, mapSchemaMembers, mapSchemaProperties, mergeAdjacentObjectsLazy, narrowSchema, nodeDefs, operationDef, optionality, outputDef, parameterDef, propertyDef, requestBodyDef, responseDef, schemaDef, schemaTypes, sourceDef, syncSchemaRef, textDef, transform, typeDef };
|
|
1887
1864
|
|
|
1888
1865
|
//# sourceMappingURL=index.js.map
|