@kubb/core 5.10.4 → 5.11.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/dist/{Hookable-D_Eafz_X.js → Hookable-COETyXWW.js} +12 -6
- package/dist/Hookable-COETyXWW.js.map +1 -0
- package/dist/{createAdapter-B5kKMsWV.d.ts → createAdapter-D6osJ_0O.d.ts} +12 -3
- package/dist/index.cjs +11 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +1 -1
- package/package.json +2 -2
- package/dist/Hookable-D_Eafz_X.js.map +0 -1
|
@@ -2691,11 +2691,19 @@ type ByContentType = {
|
|
|
2691
2691
|
*/
|
|
2692
2692
|
pattern: string | RegExp;
|
|
2693
2693
|
};
|
|
2694
|
+
type ByExtension = {
|
|
2695
|
+
/** Filter operations by a vendor extension (`x-*` key) on the source operation. Does not apply to schemas. */
|
|
2696
|
+
type: 'extension';
|
|
2697
|
+
/** Extension key, including the `x-` prefix. */
|
|
2698
|
+
key: `x-${string}`;
|
|
2699
|
+
/** Value the extension must strictly equal. When omitted, the key being present is enough. */
|
|
2700
|
+
value?: unknown;
|
|
2701
|
+
};
|
|
2694
2702
|
/**
|
|
2695
2703
|
* Pattern filter for include, exclude, and override rules. Matches operations or schemas
|
|
2696
|
-
* by tag, operationId, path, method, content type, or
|
|
2704
|
+
* by tag, operationId, path, method, content type, schema name, or vendor extension.
|
|
2697
2705
|
*/
|
|
2698
|
-
type Filter = ByTag | ByOperationId | ByPath | ByMethod | ByContentType | BySchemaName;
|
|
2706
|
+
type Filter = ByTag | ByOperationId | ByPath | ByMethod | ByContentType | BySchemaName | ByExtension;
|
|
2699
2707
|
/**
|
|
2700
2708
|
* Filter that skips matching operations or schemas during generation, for example
|
|
2701
2709
|
* deprecated endpoints or internal-only schemas.
|
|
@@ -2706,6 +2714,7 @@ type Filter = ByTag | ByOperationId | ByPath | ByMethod | ByContentType | BySche
|
|
|
2706
2714
|
* { type: 'tag', pattern: 'internal' },
|
|
2707
2715
|
* { type: 'path', pattern: /^\/admin/ },
|
|
2708
2716
|
* { type: 'operationId', pattern: /^deprecated_/ },
|
|
2717
|
+
* { type: 'extension', key: 'x-internal', value: true },
|
|
2709
2718
|
* ]
|
|
2710
2719
|
* ```
|
|
2711
2720
|
*/
|
|
@@ -3144,4 +3153,4 @@ type AdapterFactory<T extends AdapterFactoryOptions = AdapterFactoryOptions> = E
|
|
|
3144
3153
|
declare function createAdapter<T extends AdapterFactoryOptions = AdapterFactoryOptions>(definition: AdapterDefinition<T>): AdapterFactory<T>;
|
|
3145
3154
|
//#endregion
|
|
3146
3155
|
export { NodeCache as $, ReporterPluginFiles as $t, PluginFactory as A, KubbInfoContext as At, ResolveImportsOptions as B, RunHookOptions as Bt, NormalizedPlugin as C, KubbGenerationEndContext as Ct, Override as D, KubbHookLineContext as Dt, OutputOptions as E, KubbHookEndContext as Et, definePlugin as F, KubbWarnContext as Ft, ResolverFile as G, RendererFactory as Gt, ResolvePathOptions as H, KubbDriver as Ht, BannerMeta as I, PossibleConfig as It, ResolverPatch as J, createStorage as Jt, ResolverFileParams as K, createRenderer as Kt, ResolveBannerContext as L, PostGenerateCommand as Lt, PluginType as M, KubbMessageContext as Mt, ResolvePluginOptions as N, KubbPluginsEndContext as Nt, Plugin as O, KubbHookStartContext as Ot, assertPluginOption as P, KubbSuccessContext as Pt, defineGenerator as Q, ReporterName as Qt, ResolveBannerFile as R, UserConfig as Rt, KubbPluginStartContext as S, KubbFilesProcessingUpdateContext as St, OutputMode as T, KubbGenerationSummaryContext as Tt, Resolver as U, Hookable as Ut, ResolveOptionsContext as V, runHook as Vt, ResolverDefault as W, Renderer as Wt, Generator as X, Reporter as Xt, ResolverPathParams as Y, GenerationResult as Yt, GeneratorContext as Z, ReporterContext as Zt, Filter as _, KubbDiagnosticContext as _t, AdapterSource as a, Parser as an, Diagnostics as at, KubbPluginEndContext as b, KubbFilesProcessingEndContext as bt, ExtensionDependency as c, defineParser as cn, ProblemDiagnostic as ct, ExtensionKind as d, CLIOptions as dt, UserReporter as en, Diagnostic as et, ExtensionMeta as f, Config as ft, Exclude$1 as g, KubbBuildStartContext as gt, resolveMeta as h, KubbBuildEndContext as ht, AdapterFactoryOptions as i, SerializedDiagnostic as in, DiagnosticSeverity as it, PluginName as j, KubbLifecycleStartContext as jt, PluginDefinition as k, KubbHooks as kt, ExtensionDependencyRecord as l, UpdateDiagnostic as lt, defineExtension as m, Input as mt, AdapterDefinition as n, logLevel as nn, DiagnosticKind as nt, createAdapter as o, ParserDefinition as on, PerformanceDiagnostic as ot, checkCompatibility as p, FilesContext as pt, ResolverFilePathParams as q, Storage as qt, AdapterFactory as r, DiagnosticFormatOptions as rn, DiagnosticLocation as rt, ExtensionDependencies as s, ParserFactory as sn, ProblemCode as st, Adapter as t, createReporter as tn, DiagnosticDoc as tt, ExtensionFactory as u, BuildOutput as ut, Group as v, KubbErrorContext as vt, Output as w, KubbGenerationStartContext as wt, KubbPluginSetupContext as x, KubbFilesProcessingStartContext as xt, Include as y, KubbFileProcessingUpdate as yt, ResolveFileOptions as z, HookResult as zt };
|
|
3147
|
-
//# sourceMappingURL=createAdapter-
|
|
3156
|
+
//# sourceMappingURL=createAdapter-D6osJ_0O.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ unstorage_drivers_fs = __toESM(unstorage_drivers_fs, 1);
|
|
|
41
41
|
let node_url = require("node:url");
|
|
42
42
|
let node_module = require("node:module");
|
|
43
43
|
//#region package.json
|
|
44
|
-
var version = "5.
|
|
44
|
+
var version = "5.11.0";
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region ../../internals/utils/src/casing.ts
|
|
47
47
|
/**
|
|
@@ -1631,7 +1631,12 @@ var Resolver = class Resolver {
|
|
|
1631
1631
|
}
|
|
1632
1632
|
return value.match(pattern) !== null;
|
|
1633
1633
|
}
|
|
1634
|
-
static #matchesOperation(node,
|
|
1634
|
+
static #matchesOperation(node, filter) {
|
|
1635
|
+
if (filter.type === "extension") {
|
|
1636
|
+
const { extensions } = node;
|
|
1637
|
+
return extensions !== void 0 && Object.hasOwn(extensions, filter.key) && (filter.value === void 0 || extensions[filter.key] === filter.value);
|
|
1638
|
+
}
|
|
1639
|
+
const { type, pattern } = filter;
|
|
1635
1640
|
if (type === "tag") return node.tags.some((tag) => Resolver.#testPattern(tag, pattern));
|
|
1636
1641
|
if (type === "operationId") return Resolver.#testPattern(node.operationId, pattern);
|
|
1637
1642
|
if (type === "path") return node.path !== void 0 && Resolver.#testPattern(node.path, pattern);
|
|
@@ -1643,8 +1648,8 @@ var Resolver = class Resolver {
|
|
|
1643
1648
|
* Returns `null` when the filter type doesn't apply to schemas, so include rules built
|
|
1644
1649
|
* from operation filters (e.g. `tag`) don't exclude every schema.
|
|
1645
1650
|
*/
|
|
1646
|
-
static #matchesSchema(node,
|
|
1647
|
-
if (type === "schemaName") return node.name ? Resolver.#testPattern(node.name, pattern) : false;
|
|
1651
|
+
static #matchesSchema(node, filter) {
|
|
1652
|
+
if (filter.type === "schemaName") return node.name ? Resolver.#testPattern(node.name, filter.pattern) : false;
|
|
1648
1653
|
return null;
|
|
1649
1654
|
}
|
|
1650
1655
|
static #computeOptions(node, { options, exclude = [], include, override = [] }) {
|
|
@@ -2166,7 +2171,8 @@ const OPERATION_FILTER_TYPES = /* @__PURE__ */ new Set([
|
|
|
2166
2171
|
"operationId",
|
|
2167
2172
|
"path",
|
|
2168
2173
|
"method",
|
|
2169
|
-
"contentType"
|
|
2174
|
+
"contentType",
|
|
2175
|
+
"extension"
|
|
2170
2176
|
]);
|
|
2171
2177
|
const enforceWeight = (plugin) => plugin.enforce ? ENFORCE_ORDER[plugin.enforce] : 0;
|
|
2172
2178
|
/**
|