@kubb/kit 5.18.5 → 5.18.6
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 +2 -2
- package/dist/index.cjs +237 -159
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +79 -41
- package/dist/index.d.ts +79 -41
- package/dist/index.js +229 -155
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
|
-
import { SchemaNode, ast, ast as ast$1 } from "@kubb/ast";
|
|
2
|
-
import { Adapter, AdapterDefinition, AdapterFactory, AdapterFactoryOptions, AdapterSource, BannerMeta, Config, Diagnostic, Diagnostics, Exclude, ExtensionDependencies, ExtensionDependency, ExtensionDependencyRecord, ExtensionFactory, ExtensionKind, ExtensionManifest, ExtensionManifestOption, ExtensionMeta, Generator as Generator$1, GeneratorContext, Group, Hookable, Include, KubbHooks, KubbPluginEndContext, KubbPluginSetupContext, KubbPluginStartContext, Memo, NormalizedPlugin, Output, OutputOptions, Override, Parser, ParserDefinition, ParserFactory, Plugin, PluginDefinition, PluginFactory, PluginType, Renderer, RendererFactory, ResolveFileOptions, ResolveImportsOptions, ResolveNameOptions, ResolvePathOptions, Resolver, ResolverFile, ResolverFileParams, ResolverFilePathParams, ResolverPatch, Storage, addGenerator, addMacro, assertPluginOption, camelCase, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, pascalCase, requirePlugin, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions } from "@kubb/core";
|
|
1
|
+
import { SchemaNode, ast, ast as ast$1, createPrinter as createPrinter$1, defineMacro as defineMacro$1 } from "@kubb/ast";
|
|
2
|
+
import { Adapter, AdapterDefinition, AdapterFactory, AdapterFactoryOptions, AdapterSource, BannerMeta, Config, Diagnostic, Diagnostics, Exclude, ExtensionDependencies, ExtensionDependency, ExtensionDependencyRecord, ExtensionFactory, ExtensionKind, ExtensionManifest, ExtensionManifestOption, ExtensionMeta, Generator as Generator$1, GeneratorContext, Group, Hookable, Include, KubbHooks, KubbPluginEndContext, KubbPluginSetupContext, KubbPluginStartContext, Memo, NormalizedPlugin, Output, OutputOptions, Override, Parser, ParserDefinition, ParserFactory, Plugin, PluginDefinition, PluginFactory, PluginType, Renderer, RendererFactory, ResolveFileOptions, ResolveImportsOptions, ResolveNameOptions, ResolvePathOptions, Resolver, ResolverFile, ResolverFileParams, ResolverFilePathParams, ResolverPatch, Storage, addGenerator, addMacro, assertPluginOption, camelCase as camel, camelCase as camelCase$1, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, pascalCase as pascal, pascalCase as pascalCase$1, requirePlugin, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions } from "@kubb/core";
|
|
3
|
+
type Options = {
|
|
4
|
+
/** Text prepended before casing is applied. */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** Text appended before casing is applied. */
|
|
7
|
+
suffix?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Uppercases only the first character of `text`. Unlike `pascalCase` it never splits words or strips characters.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* `capitalize('getPetById') // 'GetPetById'`
|
|
14
|
+
*/
|
|
15
|
+
declare function capitalize(text: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts `text` to snake_case.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* `snakeCase('helloWorld') // 'hello_world'`
|
|
21
|
+
*/
|
|
22
|
+
declare function snakeCase(text: string, { prefix, suffix }?: Options): string;
|
|
23
|
+
/**
|
|
24
|
+
* Converts `text` to SCREAMING_SNAKE_CASE.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* `screamingSnakeCase('helloWorld') // 'HELLO_WORLD'`
|
|
28
|
+
*/
|
|
29
|
+
declare function screamingSnakeCase(text: string, { prefix, suffix }?: Options): string;
|
|
30
|
+
/**
|
|
31
|
+
* Indents every non-empty line of `text` by `unit`, leaving blank lines empty.
|
|
32
|
+
* @example
|
|
33
|
+
* `indent({ text: 'a\n\nb' }) // ' a\n\n b'`
|
|
34
|
+
*/
|
|
35
|
+
declare function indent({ text, unit }: {
|
|
36
|
+
text: string;
|
|
37
|
+
unit?: string;
|
|
38
|
+
}): string;
|
|
39
|
+
/**
|
|
40
|
+
* Strips the common leading whitespace and the surrounding blank lines, counting tabs and spaces alike, so indented template literals start at column zero.
|
|
41
|
+
*/
|
|
42
|
+
declare function dedent(text: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Strips one matching pair of `"`, `'` or `` ` `` from both ends of `text`. Returns `text` unchanged without a matching pair.
|
|
45
|
+
* @example
|
|
46
|
+
* `unquote('"hello"') // 'hello'`
|
|
47
|
+
*/
|
|
48
|
+
declare function unquote(text: string): string;
|
|
49
|
+
declare namespace casing_d_exports {
|
|
50
|
+
export { camel, capitalize, pascal, screamingSnakeCase as screamingSnake, snakeCase as snake };
|
|
51
|
+
}
|
|
52
|
+
declare namespace text_d_exports {
|
|
53
|
+
export { dedent, indent, quote, unquote };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A single-quoted string literal with backslashes, quotes and line breaks escaped. JavaScript, TypeScript and Python read it the same way.
|
|
57
|
+
*/
|
|
58
|
+
declare function quote(value: string | number | boolean | undefined | null): string;
|
|
59
|
+
/** @deprecated Use `casing.camel`. Removed in Kubb v6. */
|
|
60
|
+
export declare const camelCase: typeof camelCase$1;
|
|
61
|
+
/** @deprecated Use `casing.pascal`. Removed in Kubb v6. */
|
|
62
|
+
export declare const pascalCase: typeof pascalCase$1;
|
|
63
|
+
/** @deprecated Use `ast.ref.getName`. Removed in Kubb v6. */
|
|
64
|
+
export declare const extractRefName: typeof ast$1.ref.getName;
|
|
65
|
+
/** @deprecated Use `ast.ref.mergeSchema`. Removed in Kubb v6. */
|
|
66
|
+
export declare const syncSchemaRef: typeof ast$1.ref.mergeSchema;
|
|
67
|
+
/** @deprecated Use `ast.schema.isString`. Removed in Kubb v6. */
|
|
68
|
+
export declare const isStringType: typeof ast$1.schema.isString;
|
|
69
|
+
/** @deprecated Use `ast.graph.containsCircular`. Removed in Kubb v6. */
|
|
70
|
+
export declare const containsCircularRef: typeof ast$1.graph.containsCircular;
|
|
71
|
+
/**
|
|
72
|
+
* The name `macroDedupeUnion` had before 5.16. Kept so a plugin built against an older `@kubb/kit` keeps running.
|
|
73
|
+
*
|
|
74
|
+
* @deprecated Use `macroDedupeUnion`. Removed in the next major.
|
|
75
|
+
*/
|
|
76
|
+
export declare const macroSimplifyUnion: ast$1.Macro;
|
|
77
|
+
export declare const createPrinter: typeof createPrinter$1;
|
|
78
|
+
export declare const defineMacro: typeof defineMacro$1;
|
|
3
79
|
/**
|
|
4
80
|
* Static helpers for OpenAPI/Swagger paths: template syntax conversion, parameter extraction, and URL composition.
|
|
5
81
|
*/
|
|
@@ -48,12 +124,6 @@ export declare class Url {
|
|
|
48
124
|
* ```
|
|
49
125
|
*/
|
|
50
126
|
export declare const macroDedupeUnion: ast$1.Macro;
|
|
51
|
-
/**
|
|
52
|
-
* The name `macroDedupeUnion` had before 5.16. Kept so a plugin built against an older `@kubb/kit` keeps running.
|
|
53
|
-
*
|
|
54
|
-
* @deprecated Use `macroDedupeUnion`. Removed in the next major.
|
|
55
|
-
*/
|
|
56
|
-
export declare const macroSimplifyUnion: ast$1.Macro;
|
|
57
127
|
type Props$1 = {
|
|
58
128
|
propertyName: string;
|
|
59
129
|
values: Array<string | number | boolean>;
|
|
@@ -102,8 +172,6 @@ export declare function macroEnumName({ parentName, propName, enumSuffix }: Prop
|
|
|
102
172
|
* ```
|
|
103
173
|
*/
|
|
104
174
|
export declare function mergeAdjacentObjectsLazy(members: Iterable<SchemaNode>): Generator<SchemaNode, void, undefined>;
|
|
105
|
-
/** Returns the last path segment of a reference string, for example `'Pet'` for `#/components/schemas/Pet`. */
|
|
106
|
-
export declare const extractRefName: typeof ast$1.refName;
|
|
107
175
|
/**
|
|
108
176
|
* Builds a PascalCase child schema name by joining a parent name and property name.
|
|
109
177
|
* Returns `null` when there is no parent to nest under.
|
|
@@ -123,35 +191,5 @@ export declare function childName(parentName: string | null | undefined, propNam
|
|
|
123
191
|
* `enumPropName('Order', 'status', 'enum') // 'OrderStatusEnum'`
|
|
124
192
|
*/
|
|
125
193
|
export declare function enumPropName(parentName: string | null | undefined, propName: string, enumSuffix: string): string;
|
|
126
|
-
|
|
127
|
-
* Applies `ast.mergeRefWithSchema()` to a resolved ref and rebuilds the result through
|
|
128
|
-
* `ast.factory.createSchema()`. Non-ref nodes and unresolved refs are returned unchanged.
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```ts
|
|
132
|
-
* const ref = ast.factory.createSchema({ type: 'ref', ref: '#/components/schemas/Pet', description: 'A cute pet' })
|
|
133
|
-
* const merged = syncSchemaRef(ref) // merges with resolved Pet schema
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
export declare function syncSchemaRef(node: SchemaNode): SchemaNode;
|
|
137
|
-
/**
|
|
138
|
-
* Returns `true` when a schema emits as a plain `string` type.
|
|
139
|
-
*
|
|
140
|
-
* Covers `string`, `uuid`, `email`, `url`, and `datetime` types. For `date` and `time`
|
|
141
|
-
* types, returns `true` only when `representation` is `'string'` rather than `'date'`.
|
|
142
|
-
*/
|
|
143
|
-
export declare function isStringType(node: SchemaNode): boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Returns `true` when a schema, or anything nested inside it, references a circular schema.
|
|
146
|
-
*
|
|
147
|
-
* Pass `excludeName` to skip refs to a specific schema, which helps when self-references are handled
|
|
148
|
-
* on their own. Pair it with `ast.findCircularSchemas()` to decide where lazy wrappers go.
|
|
149
|
-
*
|
|
150
|
-
* @note Reads the memoized `ast.collectSchemaRefs()` set, so a schema is scanned once across plugins.
|
|
151
|
-
*/
|
|
152
|
-
export declare function containsCircularRef(node: SchemaNode | undefined, { circularSchemas, excludeName }: {
|
|
153
|
-
circularSchemas: ReadonlySet<string>;
|
|
154
|
-
excludeName?: string;
|
|
155
|
-
}): boolean;
|
|
156
|
-
export { type Adapter, type AdapterDefinition, type AdapterFactory, type AdapterFactoryOptions, type AdapterSource, type BannerMeta, type Config, type Diagnostic, Diagnostics, type Exclude, type ExtensionDependencies, type ExtensionDependency, type ExtensionDependencyRecord, type ExtensionFactory, type ExtensionKind, type ExtensionManifest, type ExtensionManifestOption, type ExtensionMeta, type Generator$1 as Generator, type GeneratorContext, type Group, Hookable, type Include, type KubbHooks, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, type Memo, type NormalizedPlugin, type Output, type OutputOptions, type Override, type Parser, type ParserDefinition, type ParserFactory, type Plugin, type PluginDefinition, type PluginFactory, type PluginType, type Renderer, type RendererFactory, type ResolveFileOptions, type ResolveImportsOptions, type ResolveNameOptions, type ResolvePathOptions, Resolver, type ResolverFile, type ResolverFileParams, type ResolverFilePathParams, type ResolverPatch, type Storage, addGenerator, addMacro, assertPluginOption, ast, camelCase, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, pascalCase, requirePlugin, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions };
|
|
194
|
+
export { type Adapter, type AdapterDefinition, type AdapterFactory, type AdapterFactoryOptions, type AdapterSource, type BannerMeta, type Config, type Diagnostic, Diagnostics, type Exclude, type ExtensionDependencies, type ExtensionDependency, type ExtensionDependencyRecord, type ExtensionFactory, type ExtensionKind, type ExtensionManifest, type ExtensionManifestOption, type ExtensionMeta, type Generator$1 as Generator, type GeneratorContext, type Group, Hookable, type Include, type KubbHooks, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, type Memo, type NormalizedPlugin, type Output, type OutputOptions, type Override, type Parser, type ParserDefinition, type ParserFactory, type Plugin, type PluginDefinition, type PluginFactory, type PluginType, type Renderer, type RendererFactory, type ResolveFileOptions, type ResolveImportsOptions, type ResolveNameOptions, type ResolvePathOptions, Resolver, type ResolverFile, type ResolverFileParams, type ResolverFilePathParams, type ResolverPatch, type Storage, addGenerator, addMacro, assertPluginOption, ast, casing_d_exports as casing, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, requirePlugin, setMacros, setOptions, setResolver, text_d_exports as text, tryUseKubb, useConfig, useKubb, useOptions };
|
|
157
195
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
|
-
import { SchemaNode, ast, ast as ast$1 } from "@kubb/ast";
|
|
2
|
-
import { Adapter, AdapterDefinition, AdapterFactory, AdapterFactoryOptions, AdapterSource, BannerMeta, Config, Diagnostic, Diagnostics, Exclude, ExtensionDependencies, ExtensionDependency, ExtensionDependencyRecord, ExtensionFactory, ExtensionKind, ExtensionManifest, ExtensionManifestOption, ExtensionMeta, Generator as Generator$1, GeneratorContext, Group, Hookable, Include, KubbHooks, KubbPluginEndContext, KubbPluginSetupContext, KubbPluginStartContext, Memo, NormalizedPlugin, Output, OutputOptions, Override, Parser, ParserDefinition, ParserFactory, Plugin, PluginDefinition, PluginFactory, PluginType, Renderer, RendererFactory, ResolveFileOptions, ResolveImportsOptions, ResolveNameOptions, ResolvePathOptions, Resolver, ResolverFile, ResolverFileParams, ResolverFilePathParams, ResolverPatch, Storage, addGenerator, addMacro, assertPluginOption, camelCase, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, pascalCase, requirePlugin, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions } from "@kubb/core";
|
|
1
|
+
import { SchemaNode, ast, ast as ast$1, createPrinter as createPrinter$1, defineMacro as defineMacro$1 } from "@kubb/ast";
|
|
2
|
+
import { Adapter, AdapterDefinition, AdapterFactory, AdapterFactoryOptions, AdapterSource, BannerMeta, Config, Diagnostic, Diagnostics, Exclude, ExtensionDependencies, ExtensionDependency, ExtensionDependencyRecord, ExtensionFactory, ExtensionKind, ExtensionManifest, ExtensionManifestOption, ExtensionMeta, Generator as Generator$1, GeneratorContext, Group, Hookable, Include, KubbHooks, KubbPluginEndContext, KubbPluginSetupContext, KubbPluginStartContext, Memo, NormalizedPlugin, Output, OutputOptions, Override, Parser, ParserDefinition, ParserFactory, Plugin, PluginDefinition, PluginFactory, PluginType, Renderer, RendererFactory, ResolveFileOptions, ResolveImportsOptions, ResolveNameOptions, ResolvePathOptions, Resolver, ResolverFile, ResolverFileParams, ResolverFilePathParams, ResolverPatch, Storage, addGenerator, addMacro, assertPluginOption, camelCase as camel, camelCase as camelCase$1, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, pascalCase as pascal, pascalCase as pascalCase$1, requirePlugin, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions } from "@kubb/core";
|
|
3
|
+
type Options = {
|
|
4
|
+
/** Text prepended before casing is applied. */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** Text appended before casing is applied. */
|
|
7
|
+
suffix?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Uppercases only the first character of `text`. Unlike `pascalCase` it never splits words or strips characters.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* `capitalize('getPetById') // 'GetPetById'`
|
|
14
|
+
*/
|
|
15
|
+
declare function capitalize(text: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts `text` to snake_case.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* `snakeCase('helloWorld') // 'hello_world'`
|
|
21
|
+
*/
|
|
22
|
+
declare function snakeCase(text: string, { prefix, suffix }?: Options): string;
|
|
23
|
+
/**
|
|
24
|
+
* Converts `text` to SCREAMING_SNAKE_CASE.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* `screamingSnakeCase('helloWorld') // 'HELLO_WORLD'`
|
|
28
|
+
*/
|
|
29
|
+
declare function screamingSnakeCase(text: string, { prefix, suffix }?: Options): string;
|
|
30
|
+
/**
|
|
31
|
+
* Indents every non-empty line of `text` by `unit`, leaving blank lines empty.
|
|
32
|
+
* @example
|
|
33
|
+
* `indent({ text: 'a\n\nb' }) // ' a\n\n b'`
|
|
34
|
+
*/
|
|
35
|
+
declare function indent({ text, unit }: {
|
|
36
|
+
text: string;
|
|
37
|
+
unit?: string;
|
|
38
|
+
}): string;
|
|
39
|
+
/**
|
|
40
|
+
* Strips the common leading whitespace and the surrounding blank lines, counting tabs and spaces alike, so indented template literals start at column zero.
|
|
41
|
+
*/
|
|
42
|
+
declare function dedent(text: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Strips one matching pair of `"`, `'` or `` ` `` from both ends of `text`. Returns `text` unchanged without a matching pair.
|
|
45
|
+
* @example
|
|
46
|
+
* `unquote('"hello"') // 'hello'`
|
|
47
|
+
*/
|
|
48
|
+
declare function unquote(text: string): string;
|
|
49
|
+
declare namespace casing_d_exports {
|
|
50
|
+
export { camel, capitalize, pascal, screamingSnakeCase as screamingSnake, snakeCase as snake };
|
|
51
|
+
}
|
|
52
|
+
declare namespace text_d_exports {
|
|
53
|
+
export { dedent, indent, quote, unquote };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A single-quoted string literal with backslashes, quotes and line breaks escaped. JavaScript, TypeScript and Python read it the same way.
|
|
57
|
+
*/
|
|
58
|
+
declare function quote(value: string | number | boolean | undefined | null): string;
|
|
59
|
+
/** @deprecated Use `casing.camel`. Removed in Kubb v6. */
|
|
60
|
+
export declare const camelCase: typeof camelCase$1;
|
|
61
|
+
/** @deprecated Use `casing.pascal`. Removed in Kubb v6. */
|
|
62
|
+
export declare const pascalCase: typeof pascalCase$1;
|
|
63
|
+
/** @deprecated Use `ast.ref.getName`. Removed in Kubb v6. */
|
|
64
|
+
export declare const extractRefName: typeof ast$1.ref.getName;
|
|
65
|
+
/** @deprecated Use `ast.ref.mergeSchema`. Removed in Kubb v6. */
|
|
66
|
+
export declare const syncSchemaRef: typeof ast$1.ref.mergeSchema;
|
|
67
|
+
/** @deprecated Use `ast.schema.isString`. Removed in Kubb v6. */
|
|
68
|
+
export declare const isStringType: typeof ast$1.schema.isString;
|
|
69
|
+
/** @deprecated Use `ast.graph.containsCircular`. Removed in Kubb v6. */
|
|
70
|
+
export declare const containsCircularRef: typeof ast$1.graph.containsCircular;
|
|
71
|
+
/**
|
|
72
|
+
* The name `macroDedupeUnion` had before 5.16. Kept so a plugin built against an older `@kubb/kit` keeps running.
|
|
73
|
+
*
|
|
74
|
+
* @deprecated Use `macroDedupeUnion`. Removed in the next major.
|
|
75
|
+
*/
|
|
76
|
+
export declare const macroSimplifyUnion: ast$1.Macro;
|
|
77
|
+
export declare const createPrinter: typeof createPrinter$1;
|
|
78
|
+
export declare const defineMacro: typeof defineMacro$1;
|
|
3
79
|
/**
|
|
4
80
|
* Static helpers for OpenAPI/Swagger paths: template syntax conversion, parameter extraction, and URL composition.
|
|
5
81
|
*/
|
|
@@ -48,12 +124,6 @@ export declare class Url {
|
|
|
48
124
|
* ```
|
|
49
125
|
*/
|
|
50
126
|
export declare const macroDedupeUnion: ast$1.Macro;
|
|
51
|
-
/**
|
|
52
|
-
* The name `macroDedupeUnion` had before 5.16. Kept so a plugin built against an older `@kubb/kit` keeps running.
|
|
53
|
-
*
|
|
54
|
-
* @deprecated Use `macroDedupeUnion`. Removed in the next major.
|
|
55
|
-
*/
|
|
56
|
-
export declare const macroSimplifyUnion: ast$1.Macro;
|
|
57
127
|
type Props$1 = {
|
|
58
128
|
propertyName: string;
|
|
59
129
|
values: Array<string | number | boolean>;
|
|
@@ -102,8 +172,6 @@ export declare function macroEnumName({ parentName, propName, enumSuffix }: Prop
|
|
|
102
172
|
* ```
|
|
103
173
|
*/
|
|
104
174
|
export declare function mergeAdjacentObjectsLazy(members: Iterable<SchemaNode>): Generator<SchemaNode, void, undefined>;
|
|
105
|
-
/** Returns the last path segment of a reference string, for example `'Pet'` for `#/components/schemas/Pet`. */
|
|
106
|
-
export declare const extractRefName: typeof ast$1.refName;
|
|
107
175
|
/**
|
|
108
176
|
* Builds a PascalCase child schema name by joining a parent name and property name.
|
|
109
177
|
* Returns `null` when there is no parent to nest under.
|
|
@@ -123,35 +191,5 @@ export declare function childName(parentName: string | null | undefined, propNam
|
|
|
123
191
|
* `enumPropName('Order', 'status', 'enum') // 'OrderStatusEnum'`
|
|
124
192
|
*/
|
|
125
193
|
export declare function enumPropName(parentName: string | null | undefined, propName: string, enumSuffix: string): string;
|
|
126
|
-
|
|
127
|
-
* Applies `ast.mergeRefWithSchema()` to a resolved ref and rebuilds the result through
|
|
128
|
-
* `ast.factory.createSchema()`. Non-ref nodes and unresolved refs are returned unchanged.
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```ts
|
|
132
|
-
* const ref = ast.factory.createSchema({ type: 'ref', ref: '#/components/schemas/Pet', description: 'A cute pet' })
|
|
133
|
-
* const merged = syncSchemaRef(ref) // merges with resolved Pet schema
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
export declare function syncSchemaRef(node: SchemaNode): SchemaNode;
|
|
137
|
-
/**
|
|
138
|
-
* Returns `true` when a schema emits as a plain `string` type.
|
|
139
|
-
*
|
|
140
|
-
* Covers `string`, `uuid`, `email`, `url`, and `datetime` types. For `date` and `time`
|
|
141
|
-
* types, returns `true` only when `representation` is `'string'` rather than `'date'`.
|
|
142
|
-
*/
|
|
143
|
-
export declare function isStringType(node: SchemaNode): boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Returns `true` when a schema, or anything nested inside it, references a circular schema.
|
|
146
|
-
*
|
|
147
|
-
* Pass `excludeName` to skip refs to a specific schema, which helps when self-references are handled
|
|
148
|
-
* on their own. Pair it with `ast.findCircularSchemas()` to decide where lazy wrappers go.
|
|
149
|
-
*
|
|
150
|
-
* @note Reads the memoized `ast.collectSchemaRefs()` set, so a schema is scanned once across plugins.
|
|
151
|
-
*/
|
|
152
|
-
export declare function containsCircularRef(node: SchemaNode | undefined, { circularSchemas, excludeName }: {
|
|
153
|
-
circularSchemas: ReadonlySet<string>;
|
|
154
|
-
excludeName?: string;
|
|
155
|
-
}): boolean;
|
|
156
|
-
export { type Adapter, type AdapterDefinition, type AdapterFactory, type AdapterFactoryOptions, type AdapterSource, type BannerMeta, type Config, type Diagnostic, Diagnostics, type Exclude, type ExtensionDependencies, type ExtensionDependency, type ExtensionDependencyRecord, type ExtensionFactory, type ExtensionKind, type ExtensionManifest, type ExtensionManifestOption, type ExtensionMeta, type Generator$1 as Generator, type GeneratorContext, type Group, Hookable, type Include, type KubbHooks, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, type Memo, type NormalizedPlugin, type Output, type OutputOptions, type Override, type Parser, type ParserDefinition, type ParserFactory, type Plugin, type PluginDefinition, type PluginFactory, type PluginType, type Renderer, type RendererFactory, type ResolveFileOptions, type ResolveImportsOptions, type ResolveNameOptions, type ResolvePathOptions, Resolver, type ResolverFile, type ResolverFileParams, type ResolverFilePathParams, type ResolverPatch, type Storage, addGenerator, addMacro, assertPluginOption, ast, camelCase, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, pascalCase, requirePlugin, setMacros, setOptions, setResolver, tryUseKubb, useConfig, useKubb, useOptions };
|
|
194
|
+
export { type Adapter, type AdapterDefinition, type AdapterFactory, type AdapterFactoryOptions, type AdapterSource, type BannerMeta, type Config, type Diagnostic, Diagnostics, type Exclude, type ExtensionDependencies, type ExtensionDependency, type ExtensionDependencyRecord, type ExtensionFactory, type ExtensionKind, type ExtensionManifest, type ExtensionManifestOption, type ExtensionMeta, type Generator$1 as Generator, type GeneratorContext, type Group, Hookable, type Include, type KubbHooks, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, type Memo, type NormalizedPlugin, type Output, type OutputOptions, type Override, type Parser, type ParserDefinition, type ParserFactory, type Plugin, type PluginDefinition, type PluginFactory, type PluginType, type Renderer, type RendererFactory, type ResolveFileOptions, type ResolveImportsOptions, type ResolveNameOptions, type ResolvePathOptions, Resolver, type ResolverFile, type ResolverFileParams, type ResolverFilePathParams, type ResolverPatch, type Storage, addGenerator, addMacro, assertPluginOption, ast, casing_d_exports as casing, createAdapter, createRenderer, createResolver, createStorage, defineExtension, defineGenerator, defineParser, definePlugin, fsStorage, injectFile, isExtensionManifest, kubbContext, manifestProblems, memo, memoryStorage, requirePlugin, setMacros, setOptions, setResolver, text_d_exports as text, tryUseKubb, useConfig, useKubb, useOptions };
|
|
157
195
|
//# sourceMappingURL=index.d.ts.map
|