@kubb/core 5.0.0-beta.54 → 5.0.0-beta.55

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.d.ts CHANGED
@@ -1,143 +1,7 @@
1
1
  import { t as __name } from "./chunk-C0LytTxp.js";
2
- import { $ as Include, A as KubbHookStartContext, At as createReporter, B as ParsedFile, C as KubbFilesProcessingEndContext, Ct as Storage, D as KubbGenerationStartContext, Dt as ReporterContext, E as KubbGenerationEndContext, Et as Reporter, F as KubbSuccessContext, Ft as Adapter, G as Parser, H as createKubb, I as KubbWarnContext, It as AdapterFactoryOptions, J as GeneratorContext, K as defineParser, L as PossibleConfig, Lt as AdapterSource, M as KubbInfoContext, Mt as Cache, N as KubbLifecycleStartContext, Nt as CachedSnapshot, O as KubbHookEndContext, Ot as ReporterName, P as KubbPluginsEndContext, Pt as createCache, Q as Group, R as UserConfig, Rt as createAdapter, S as KubbFileProcessingUpdate, St as createRenderer, T as KubbFilesProcessingUpdateContext, Tt as GenerationResult, U as FsCacheOptions, V as Kubb, W as fsCache, X as KubbDriver, Y as defineGenerator, Z as Exclude, _ as InputPath, _t as ResolverFileParams, a as DiagnosticLocation, at as OutputMode, b as KubbDiagnosticContext, bt as Renderer, c as PerformanceDiagnostic, ct as Plugin, d as SerializedDiagnostic, dt as BannerMeta, et as KubbPluginEndContext, f as UpdateDiagnostic, ft as ResolveBannerContext, g as InputData, gt as ResolverContext, h as Config, ht as Resolver, i as DiagnosticKind, it as Output, j as KubbHooks, jt as logLevel, k as KubbHookLineContext, kt as UserReporter, l as ProblemCode, lt as PluginFactoryOptions, m as CLIOptions, mt as ResolveOptionsContext, n as DiagnosticByCode, nt as KubbPluginStartContext, o as DiagnosticSeverity, ot as OutputOptions, p as BuildOutput, pt as ResolveBannerFile, q as Generator, r as DiagnosticDoc, rt as NormalizedPlugin, s as Diagnostics, st as Override, t as Diagnostic, tt as KubbPluginSetupContext, u as ProblemDiagnostic, ut as definePlugin, v as KubbBuildEndContext, vt as ResolverPathParams, w as KubbFilesProcessingStartContext, wt as createStorage, x as KubbErrorContext, xt as RendererFactory, y as KubbBuildStartContext, yt as defineResolver, z as FileProcessorHooks, zt as AsyncEventEmitter } from "./diagnostics-D_LOtOCv.js";
2
+ import { $ as KubbPluginSetupContext, A as KubbHookStartContext, At as Adapter, B as ParsedFile, C as KubbFilesProcessingEndContext, Ct as GenerationResult, D as KubbGenerationStartContext, Dt as UserReporter, E as KubbGenerationEndContext, Et as ReporterName, F as KubbSuccessContext, G as Generator, H as createKubb, I as KubbWarnContext, J as KubbDriver, K as GeneratorContext, L as PossibleConfig, M as KubbInfoContext, Mt as AdapterSource, N as KubbLifecycleStartContext, Nt as createAdapter, O as KubbHookEndContext, Ot as createReporter, P as KubbPluginsEndContext, Pt as AsyncEventEmitter, Q as KubbPluginEndContext, R as UserConfig, S as KubbFileProcessingUpdate, St as createStorage, T as KubbFilesProcessingUpdateContext, Tt as ReporterContext, U as Parser, V as Kubb, W as defineParser, X as Group, Y as Exclude, Z as Include, _ as InputPath, _t as defineResolver, a as DiagnosticLocation, at as Override, b as KubbDiagnosticContext, bt as createRenderer, c as PerformanceDiagnostic, ct as definePlugin, d as SerializedDiagnostic, dt as ResolveBannerFile, et as KubbPluginStartContext, f as UpdateDiagnostic, ft as ResolveOptionsContext, g as InputData, gt as ResolverPathParams, h as Config, ht as ResolverFileParams, i as DiagnosticKind, it as OutputOptions, j as KubbHooks, jt as AdapterFactoryOptions, k as KubbHookLineContext, kt as logLevel, l as ProblemCode, lt as BannerMeta, m as CLIOptions, mt as ResolverContext, n as DiagnosticByCode, nt as Output, o as DiagnosticSeverity, ot as Plugin, p as BuildOutput, pt as Resolver, q as defineGenerator, r as DiagnosticDoc, rt as OutputMode, s as Diagnostics, st as PluginFactoryOptions, t as Diagnostic, tt as NormalizedPlugin, u as ProblemDiagnostic, ut as ResolveBannerContext, v as KubbBuildEndContext, vt as Renderer, w as KubbFilesProcessingStartContext, wt as Reporter, x as KubbErrorContext, xt as Storage, y as KubbBuildStartContext, yt as RendererFactory, z as FileProcessorHooks } from "./diagnostics-Bf2bC8lV.js";
3
3
  import * as ast from "@kubb/ast";
4
4
 
5
- //#region ../../internals/utils/src/urlPath.d.ts
6
- type URLObject = {
7
- /**
8
- * The resolved URL string (Express-style or template literal, depending on context).
9
- */
10
- url: string;
11
- /**
12
- * Extracted path parameters as a key-value map, or `undefined` when the path has none.
13
- */
14
- params?: Record<string, string>;
15
- };
16
- type ObjectOptions = {
17
- /**
18
- * Controls whether the `url` is rendered as an Express path or a template literal.
19
- * @default 'path'
20
- */
21
- type?: 'path' | 'template';
22
- /**
23
- * Optional transform applied to each extracted parameter name.
24
- */
25
- replacer?: (pathParam: string) => string;
26
- /**
27
- * When `true`, the result is serialized to a string expression instead of a plain object.
28
- */
29
- stringify?: boolean;
30
- };
31
- /**
32
- * Supported identifier casing strategies for path parameters.
33
- */
34
- type PathCasing = 'camelcase';
35
- type Options = {
36
- /**
37
- * Casing strategy applied to path parameter names.
38
- * @default undefined (original identifier preserved)
39
- */
40
- casing?: PathCasing;
41
- };
42
- /**
43
- * Parses and transforms an OpenAPI/Swagger path string into various URL formats.
44
- *
45
- * @example
46
- * const p = new URLPath('/pet/{petId}')
47
- * p.URL // '/pet/:petId'
48
- * p.template // '`/pet/${petId}`'
49
- */
50
- declare class URLPath {
51
- #private;
52
- /**
53
- * The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
54
- */
55
- path: string;
56
- constructor(path: string, options?: Options);
57
- /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
58
- *
59
- * @example
60
- * ```ts
61
- * new URLPath('/pet/{petId}').URL // '/pet/:petId'
62
- * ```
63
- */
64
- get URL(): string;
65
- /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
66
- *
67
- * @example
68
- * ```ts
69
- * new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
70
- * new URLPath('/pet/{petId}').isURL // false
71
- * ```
72
- */
73
- get isURL(): boolean;
74
- /**
75
- * Converts the OpenAPI path to a TypeScript template literal string.
76
- *
77
- * @example
78
- * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
79
- * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
80
- */
81
- get template(): string;
82
- /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
83
- *
84
- * @example
85
- * ```ts
86
- * new URLPath('/pet/{petId}').object
87
- * // { url: '/pet/:petId', params: { petId: 'petId' } }
88
- * ```
89
- */
90
- get object(): URLObject | string;
91
- /** Returns a map of path parameter names, or `undefined` when the path has no parameters.
92
- *
93
- * @example
94
- * ```ts
95
- * new URLPath('/pet/{petId}').params // { petId: 'petId' }
96
- * new URLPath('/pet').params // undefined
97
- * ```
98
- */
99
- get params(): Record<string, string> | undefined;
100
- toObject({
101
- type,
102
- replacer,
103
- stringify
104
- }?: ObjectOptions): URLObject | string;
105
- /**
106
- * Converts the OpenAPI path to a TypeScript template literal string.
107
- * An optional `replacer` can transform each extracted parameter name before interpolation.
108
- *
109
- * @example
110
- * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
111
- */
112
- toTemplateString({
113
- prefix,
114
- replacer
115
- }?: {
116
- prefix?: string | null;
117
- replacer?: (pathParam: string) => string;
118
- }): string;
119
- /**
120
- * Extracts all `{param}` segments from the path and returns them as a key-value map.
121
- * An optional `replacer` transforms each parameter name in both key and value positions.
122
- * Returns `undefined` when no path parameters are found.
123
- *
124
- * @example
125
- * ```ts
126
- * new URLPath('/pet/{petId}/tag/{tagId}').getParams()
127
- * // { petId: 'petId', tagId: 'tagId' }
128
- * ```
129
- */
130
- getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined;
131
- /** Converts the OpenAPI path to Express-style colon syntax.
132
- *
133
- * @example
134
- * ```ts
135
- * new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
136
- * ```
137
- */
138
- toURLPath(): string;
139
- }
140
- //#endregion
141
5
  //#region src/reporters/cliReporter.d.ts
142
6
  /**
143
7
  * The default `cli` reporter. Renders the {@link Report} for each config as it finishes, independent
@@ -177,11 +41,11 @@ declare const jsonReporter: Reporter;
177
41
  * Keys are resolved against `process.cwd()`, so root-relative paths such as
178
42
  * `src/gen/api/getPets.ts` are written to the correct location without extra configuration.
179
43
  *
180
- * Internally uses the `write` utility from `@internals/utils`, which:
181
- * - trims leading/trailing whitespace before writing
182
- * - skips the write when file content is already identical (deduplication)
183
- * - creates missing parent directories automatically
184
- * - supports Bun's native file API when running under Bun
44
+ * Writes are deduplicated and directory-safe:
45
+ * - leading and trailing whitespace is trimmed before writing
46
+ * - the write is skipped when the file content is already identical
47
+ * - missing parent directories are created automatically
48
+ * - Bun's native file API is used when running under Bun
185
49
  *
186
50
  * @example
187
51
  * ```ts
@@ -219,5 +83,5 @@ declare const fsStorage: (options?: Record<string, never> | undefined) => Storag
219
83
  */
220
84
  declare const memoryStorage: (options?: Record<string, never> | undefined) => Storage;
221
85
  //#endregion
222
- export { type Adapter, type AdapterFactoryOptions, type AdapterSource, AsyncEventEmitter, type BannerMeta, BuildOutput, CLIOptions, type Cache, type CachedSnapshot, Config, type Diagnostic, type DiagnosticByCode, type DiagnosticDoc, type DiagnosticKind, type DiagnosticLocation, type DiagnosticSeverity, Diagnostics, type Exclude, type FileProcessorHooks, type FsCacheOptions, type GenerationResult, type Generator, type GeneratorContext, type Group, type Include, InputData, InputPath, type Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbDiagnosticContext, KubbDriver, KubbErrorContext, KubbFileProcessingUpdate, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbFilesProcessingUpdateContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbHookEndContext, KubbHookLineContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbWarnContext, type NormalizedPlugin, type Output, type OutputMode, type OutputOptions, type Override, type ParsedFile, type Parser, type PerformanceDiagnostic, type Plugin, type PluginFactoryOptions, PossibleConfig, type ProblemCode, type ProblemDiagnostic, type Renderer, type RendererFactory, type Reporter, type ReporterContext, type ReporterName, type ResolveBannerContext, type ResolveBannerFile, type ResolveOptionsContext, type Resolver, type ResolverContext, type ResolverFileParams, type ResolverPathParams, type SerializedDiagnostic, type Storage, URLPath, type UpdateDiagnostic, UserConfig, type UserReporter, ast, cliReporter, createAdapter, createCache, createKubb, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, defineResolver, fileReporter, fsCache, fsStorage, jsonReporter, logLevel, memoryStorage };
86
+ export { type Adapter, type AdapterFactoryOptions, type AdapterSource, AsyncEventEmitter, type BannerMeta, BuildOutput, CLIOptions, Config, type Diagnostic, type DiagnosticByCode, type DiagnosticDoc, type DiagnosticKind, type DiagnosticLocation, type DiagnosticSeverity, Diagnostics, type Exclude, type FileProcessorHooks, type GenerationResult, type Generator, type GeneratorContext, type Group, type Include, InputData, InputPath, type Kubb, KubbBuildEndContext, KubbBuildStartContext, KubbDiagnosticContext, KubbDriver, KubbErrorContext, KubbFileProcessingUpdate, KubbFilesProcessingEndContext, KubbFilesProcessingStartContext, KubbFilesProcessingUpdateContext, KubbGenerationEndContext, KubbGenerationStartContext, KubbHookEndContext, KubbHookLineContext, KubbHookStartContext, KubbHooks, KubbInfoContext, KubbLifecycleStartContext, type KubbPluginEndContext, type KubbPluginSetupContext, type KubbPluginStartContext, KubbPluginsEndContext, KubbSuccessContext, KubbWarnContext, type NormalizedPlugin, type Output, type OutputMode, type OutputOptions, type Override, type ParsedFile, type Parser, type PerformanceDiagnostic, type Plugin, type PluginFactoryOptions, PossibleConfig, type ProblemCode, type ProblemDiagnostic, type Renderer, type RendererFactory, type Reporter, type ReporterContext, type ReporterName, type ResolveBannerContext, type ResolveBannerFile, type ResolveOptionsContext, type Resolver, type ResolverContext, type ResolverFileParams, type ResolverPathParams, type SerializedDiagnostic, type Storage, type UpdateDiagnostic, UserConfig, type UserReporter, ast, cliReporter, createAdapter, createKubb, createRenderer, createReporter, createStorage, defineGenerator, defineParser, definePlugin, defineResolver, fileReporter, fsStorage, jsonReporter, logLevel, memoryStorage };
223
87
  //# sourceMappingURL=index.d.ts.map