@kubb/core 4.21.2 → 4.22.1
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/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index-BfAwjQCB.d.cts +255 -0
- package/dist/index-C0nP9vjm.d.ts +255 -0
- package/dist/index.cjs +156 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +127 -3
- package/dist/index.d.ts +127 -3
- package/dist/index.js +140 -4
- package/dist/index.js.map +1 -1
- package/dist/{types-Dv2RimvH.d.ts → types-Cn3Gwsf3.d.ts} +2 -82
- package/dist/{types-DalqcJjU.d.cts → types-ulibr7zw.d.cts} +2 -82
- package/dist/{getBarrelFiles-DCNjiX2W.cjs → utils-BclJP5UT.cjs} +350 -11
- package/dist/utils-BclJP5UT.cjs.map +1 -0
- package/dist/{getBarrelFiles-gRyVPFBP.js → utils-C3cuilmF.js} +281 -22
- package/dist/utils-C3cuilmF.js.map +1 -0
- package/dist/utils.cjs +24 -288
- package/dist/utils.d.cts +3 -226
- package/dist/utils.d.ts +3 -226
- package/dist/utils.js +3 -264
- package/package.json +3 -2
- package/schemas/openapi/server.yaml +524 -0
- package/src/index.ts +2 -0
- package/src/server/index.ts +281 -0
- package/src/types.ts +0 -2
- package/dist/getBarrelFiles-DCNjiX2W.cjs.map +0 -1
- package/dist/getBarrelFiles-D_2NWu2Q.d.ts +0 -35
- package/dist/getBarrelFiles-g6fYZe8A.d.cts +0 -35
- package/dist/getBarrelFiles-gRyVPFBP.js.map +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js.map +0 -1
- package/src/StreamEvents.ts +0 -71
package/dist/hooks.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-DlpkT3g-.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { O as PluginManager, f as Plugin, m as PluginFactoryOptions } from "./types-ulibr7zw.cjs";
|
|
3
3
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useMode.d.ts
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
|
-
import {
|
|
2
|
+
import { O as PluginManager, f as Plugin, m as PluginFactoryOptions } from "./types-Cn3Gwsf3.js";
|
|
3
3
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useMode.d.ts
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { t as __name } from "./chunk-DlpkT3g-.cjs";
|
|
2
|
+
import { E as PossiblePromise, f as Plugin, t as BarrelType } from "./types-ulibr7zw.cjs";
|
|
3
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/buildJSDoc.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Builds a JSDoc comment block with custom indentation.
|
|
9
|
+
* @param comments - Array of comment strings to include in the JSDoc block
|
|
10
|
+
* @param options - Configuration options for formatting
|
|
11
|
+
* @returns Formatted JSDoc string or fallback string if no comments
|
|
12
|
+
*/
|
|
13
|
+
declare function buildJSDoc(comments: Array<string>, options?: {
|
|
14
|
+
/**
|
|
15
|
+
* String to use for indenting each line of the JSDoc comment
|
|
16
|
+
* @default ' * ' (3 spaces + asterisk + space)
|
|
17
|
+
*/
|
|
18
|
+
indent?: string;
|
|
19
|
+
/**
|
|
20
|
+
* String to append after the closing JSDoc tag
|
|
21
|
+
* @default '\n ' (newline + 2 spaces)
|
|
22
|
+
*/
|
|
23
|
+
suffix?: string;
|
|
24
|
+
/**
|
|
25
|
+
* String to return when there are no comments
|
|
26
|
+
* @default ' ' (2 spaces)
|
|
27
|
+
*/
|
|
28
|
+
fallback?: string;
|
|
29
|
+
}): string;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/utils/Cache.d.ts
|
|
32
|
+
declare class Cache<T> {
|
|
33
|
+
#private;
|
|
34
|
+
get(key: string): Promise<T | null>;
|
|
35
|
+
set(key: string, value: T): Promise<void>;
|
|
36
|
+
delete(key: string): Promise<void>;
|
|
37
|
+
clear(): Promise<void>;
|
|
38
|
+
keys(): Promise<string[]>;
|
|
39
|
+
values(): Promise<T[]>;
|
|
40
|
+
flush(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/utils/checkOnlineStatus.d.ts
|
|
44
|
+
/**
|
|
45
|
+
* Check if the system has internet connectivity
|
|
46
|
+
* Uses DNS lookup to well-known stable domains as a lightweight connectivity test
|
|
47
|
+
*/
|
|
48
|
+
declare function isOnline(): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Execute a function only if online, otherwise silently skip
|
|
51
|
+
*/
|
|
52
|
+
declare function executeIfOnline<T>(fn: () => Promise<T>): Promise<T | null>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/utils/FunctionParams.d.ts
|
|
55
|
+
type FunctionParamsASTWithoutType = {
|
|
56
|
+
name?: string;
|
|
57
|
+
type?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
required?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
enabled?: boolean;
|
|
66
|
+
default?: string;
|
|
67
|
+
};
|
|
68
|
+
type FunctionParamsASTWithType = {
|
|
69
|
+
name?: never;
|
|
70
|
+
type: string;
|
|
71
|
+
/**
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
required?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
default?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated
|
|
83
|
+
*/
|
|
84
|
+
type FunctionParamsAST = FunctionParamsASTWithoutType | FunctionParamsASTWithType;
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated
|
|
87
|
+
*/
|
|
88
|
+
declare class FunctionParams {
|
|
89
|
+
#private;
|
|
90
|
+
constructor();
|
|
91
|
+
get items(): FunctionParamsAST[];
|
|
92
|
+
add(item: FunctionParamsAST | Array<FunctionParamsAST | FunctionParamsAST[] | undefined> | undefined): FunctionParams;
|
|
93
|
+
static toObject(items: FunctionParamsAST[]): FunctionParamsAST;
|
|
94
|
+
toObject(): FunctionParamsAST;
|
|
95
|
+
static toString(items: (FunctionParamsAST | FunctionParamsAST[])[]): string;
|
|
96
|
+
toString(): string;
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/utils/formatHrtime.d.ts
|
|
100
|
+
/**
|
|
101
|
+
* Calculates elapsed time in milliseconds from a high-resolution start time.
|
|
102
|
+
* Rounds to 2 decimal places to provide sub-millisecond precision without noise.
|
|
103
|
+
*/
|
|
104
|
+
declare function getElapsedMs(hrStart: [number, number]): number;
|
|
105
|
+
/**
|
|
106
|
+
* Converts a millisecond duration into a human-readable string.
|
|
107
|
+
* Adjusts units (ms, s, m s) based on the magnitude of the duration.
|
|
108
|
+
*/
|
|
109
|
+
declare function formatMs(ms: number): string;
|
|
110
|
+
/**
|
|
111
|
+
* Convenience helper to get and format elapsed time in one step.
|
|
112
|
+
*/
|
|
113
|
+
declare function formatHrtime(hrStart: [number, number]): string;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/utils/getBarrelFiles.d.ts
|
|
116
|
+
type FileMetaBase = {
|
|
117
|
+
pluginKey?: Plugin['key'];
|
|
118
|
+
};
|
|
119
|
+
type AddIndexesProps = {
|
|
120
|
+
type: BarrelType | false | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Root based on root and output.path specified in the config
|
|
123
|
+
*/
|
|
124
|
+
root: string;
|
|
125
|
+
/**
|
|
126
|
+
* Output for plugin
|
|
127
|
+
*/
|
|
128
|
+
output: {
|
|
129
|
+
path: string;
|
|
130
|
+
};
|
|
131
|
+
group?: {
|
|
132
|
+
output: string;
|
|
133
|
+
exportAs: string;
|
|
134
|
+
};
|
|
135
|
+
meta?: FileMetaBase;
|
|
136
|
+
};
|
|
137
|
+
declare function getBarrelFiles(files: Array<KubbFile.ResolvedFile>, {
|
|
138
|
+
type,
|
|
139
|
+
meta,
|
|
140
|
+
root,
|
|
141
|
+
output
|
|
142
|
+
}: AddIndexesProps): Promise<KubbFile.File[]>;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/utils/getNestedAccessor.d.ts
|
|
145
|
+
/**
|
|
146
|
+
* Converts a param path (string with dot notation or array of strings) to a JavaScript accessor expression.
|
|
147
|
+
* @param param - The param path, e.g., 'pagination.next.id' or ['pagination', 'next', 'id']
|
|
148
|
+
* @param accessor - The base accessor, e.g., 'lastPage' or 'firstPage'
|
|
149
|
+
* @returns A JavaScript accessor expression, e.g., "lastPage?.['pagination']?.['next']?.['id']", or undefined if param is empty
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* getNestedAccessor('pagination.next.id', 'lastPage')
|
|
154
|
+
* // returns: "lastPage?.['pagination']?.['next']?.['id']"
|
|
155
|
+
*
|
|
156
|
+
* getNestedAccessor(['pagination', 'next', 'id'], 'lastPage')
|
|
157
|
+
* // returns: "lastPage?.['pagination']?.['next']?.['id']"
|
|
158
|
+
*
|
|
159
|
+
* getNestedAccessor('', 'lastPage')
|
|
160
|
+
* // returns: undefined
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
declare function getNestedAccessor(param: string | string[], accessor: string): string | undefined;
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/utils/promise.d.ts
|
|
166
|
+
declare function isPromise<T>(result: PossiblePromise<T>): result is Promise<T>;
|
|
167
|
+
declare function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T>;
|
|
168
|
+
declare function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & {
|
|
169
|
+
reason: T;
|
|
170
|
+
};
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/utils/renderTemplate.d.ts
|
|
173
|
+
declare function renderTemplate<TData extends Record<string, unknown> = Record<string, unknown>>(template: string, data?: TData | undefined): string;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/utils/resolveModuleSource.d.ts
|
|
176
|
+
declare function resolveModuleSource(pkgName: string): {
|
|
177
|
+
readonly path: string;
|
|
178
|
+
readonly source: string;
|
|
179
|
+
readonly ext: string;
|
|
180
|
+
};
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/utils/serializePluginOptions.d.ts
|
|
183
|
+
/**
|
|
184
|
+
* Serialize plugin options for safe JSON transport.
|
|
185
|
+
* Strips functions, symbols, and undefined values recursively.
|
|
186
|
+
*/
|
|
187
|
+
declare function serializePluginOptions(options: unknown): unknown;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/utils/timeout.d.ts
|
|
190
|
+
declare function timeout(ms: number): Promise<unknown>;
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/utils/URLPath.d.ts
|
|
193
|
+
type URLObject = {
|
|
194
|
+
url: string;
|
|
195
|
+
params?: Record<string, string>;
|
|
196
|
+
};
|
|
197
|
+
type ObjectOptions = {
|
|
198
|
+
type?: 'path' | 'template';
|
|
199
|
+
replacer?: (pathParam: string) => string;
|
|
200
|
+
stringify?: boolean;
|
|
201
|
+
};
|
|
202
|
+
type Options = {
|
|
203
|
+
casing?: 'camelcase';
|
|
204
|
+
};
|
|
205
|
+
declare class URLPath {
|
|
206
|
+
#private;
|
|
207
|
+
path: string;
|
|
208
|
+
constructor(path: string, options?: Options);
|
|
209
|
+
/**
|
|
210
|
+
* Convert Swagger path to URLPath(syntax of Express)
|
|
211
|
+
* @example /pet/{petId} => /pet/:petId
|
|
212
|
+
*/
|
|
213
|
+
get URL(): string;
|
|
214
|
+
get isURL(): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
217
|
+
* @example /pet/{petId} => `/pet/${petId}`
|
|
218
|
+
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
219
|
+
* @example /account/userID => `/account/${userId}`
|
|
220
|
+
*/
|
|
221
|
+
get template(): string;
|
|
222
|
+
get object(): URLObject | string;
|
|
223
|
+
get params(): Record<string, string> | undefined;
|
|
224
|
+
toObject({
|
|
225
|
+
type,
|
|
226
|
+
replacer,
|
|
227
|
+
stringify
|
|
228
|
+
}?: ObjectOptions): URLObject | string;
|
|
229
|
+
/**
|
|
230
|
+
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
231
|
+
* @example /pet/{petId} => `/pet/${petId}`
|
|
232
|
+
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
233
|
+
* @example /account/userID => `/account/${userId}`
|
|
234
|
+
*/
|
|
235
|
+
toTemplateString({
|
|
236
|
+
prefix,
|
|
237
|
+
replacer
|
|
238
|
+
}?: {
|
|
239
|
+
prefix?: string;
|
|
240
|
+
replacer?: (pathParam: string) => string;
|
|
241
|
+
}): string;
|
|
242
|
+
getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Convert Swagger path to URLPath(syntax of Express)
|
|
245
|
+
* @example /pet/{petId} => /pet/:petId
|
|
246
|
+
*/
|
|
247
|
+
toURLPath(): string;
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/utils/uniqueName.d.ts
|
|
251
|
+
declare function getUniqueName(originalName: string, data: Record<string, number>): string;
|
|
252
|
+
declare function setUniqueName(originalName: string, data: Record<string, number>): string;
|
|
253
|
+
//#endregion
|
|
254
|
+
export { buildJSDoc as C, Cache as S, getElapsedMs as _, timeout as a, executeIfOnline as b, renderTemplate as c, isPromiseRejectedResult as d, getNestedAccessor as f, formatMs as g, formatHrtime as h, URLPath as i, isPromise as l, getBarrelFiles as m, setUniqueName as n, serializePluginOptions as o, FileMetaBase as p, URLObject as r, resolveModuleSource as s, getUniqueName as t, isPromiseFulfilledResult as u, FunctionParams as v, isOnline as x, FunctionParamsAST as y };
|
|
255
|
+
//# sourceMappingURL=index-BfAwjQCB.d.cts.map
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
|
+
import { E as PossiblePromise, f as Plugin, t as BarrelType } from "./types-Cn3Gwsf3.js";
|
|
3
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/buildJSDoc.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Builds a JSDoc comment block with custom indentation.
|
|
9
|
+
* @param comments - Array of comment strings to include in the JSDoc block
|
|
10
|
+
* @param options - Configuration options for formatting
|
|
11
|
+
* @returns Formatted JSDoc string or fallback string if no comments
|
|
12
|
+
*/
|
|
13
|
+
declare function buildJSDoc(comments: Array<string>, options?: {
|
|
14
|
+
/**
|
|
15
|
+
* String to use for indenting each line of the JSDoc comment
|
|
16
|
+
* @default ' * ' (3 spaces + asterisk + space)
|
|
17
|
+
*/
|
|
18
|
+
indent?: string;
|
|
19
|
+
/**
|
|
20
|
+
* String to append after the closing JSDoc tag
|
|
21
|
+
* @default '\n ' (newline + 2 spaces)
|
|
22
|
+
*/
|
|
23
|
+
suffix?: string;
|
|
24
|
+
/**
|
|
25
|
+
* String to return when there are no comments
|
|
26
|
+
* @default ' ' (2 spaces)
|
|
27
|
+
*/
|
|
28
|
+
fallback?: string;
|
|
29
|
+
}): string;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/utils/Cache.d.ts
|
|
32
|
+
declare class Cache<T> {
|
|
33
|
+
#private;
|
|
34
|
+
get(key: string): Promise<T | null>;
|
|
35
|
+
set(key: string, value: T): Promise<void>;
|
|
36
|
+
delete(key: string): Promise<void>;
|
|
37
|
+
clear(): Promise<void>;
|
|
38
|
+
keys(): Promise<string[]>;
|
|
39
|
+
values(): Promise<T[]>;
|
|
40
|
+
flush(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/utils/checkOnlineStatus.d.ts
|
|
44
|
+
/**
|
|
45
|
+
* Check if the system has internet connectivity
|
|
46
|
+
* Uses DNS lookup to well-known stable domains as a lightweight connectivity test
|
|
47
|
+
*/
|
|
48
|
+
declare function isOnline(): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Execute a function only if online, otherwise silently skip
|
|
51
|
+
*/
|
|
52
|
+
declare function executeIfOnline<T>(fn: () => Promise<T>): Promise<T | null>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/utils/FunctionParams.d.ts
|
|
55
|
+
type FunctionParamsASTWithoutType = {
|
|
56
|
+
name?: string;
|
|
57
|
+
type?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
required?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
enabled?: boolean;
|
|
66
|
+
default?: string;
|
|
67
|
+
};
|
|
68
|
+
type FunctionParamsASTWithType = {
|
|
69
|
+
name?: never;
|
|
70
|
+
type: string;
|
|
71
|
+
/**
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
required?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
default?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated
|
|
83
|
+
*/
|
|
84
|
+
type FunctionParamsAST = FunctionParamsASTWithoutType | FunctionParamsASTWithType;
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated
|
|
87
|
+
*/
|
|
88
|
+
declare class FunctionParams {
|
|
89
|
+
#private;
|
|
90
|
+
constructor();
|
|
91
|
+
get items(): FunctionParamsAST[];
|
|
92
|
+
add(item: FunctionParamsAST | Array<FunctionParamsAST | FunctionParamsAST[] | undefined> | undefined): FunctionParams;
|
|
93
|
+
static toObject(items: FunctionParamsAST[]): FunctionParamsAST;
|
|
94
|
+
toObject(): FunctionParamsAST;
|
|
95
|
+
static toString(items: (FunctionParamsAST | FunctionParamsAST[])[]): string;
|
|
96
|
+
toString(): string;
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/utils/formatHrtime.d.ts
|
|
100
|
+
/**
|
|
101
|
+
* Calculates elapsed time in milliseconds from a high-resolution start time.
|
|
102
|
+
* Rounds to 2 decimal places to provide sub-millisecond precision without noise.
|
|
103
|
+
*/
|
|
104
|
+
declare function getElapsedMs(hrStart: [number, number]): number;
|
|
105
|
+
/**
|
|
106
|
+
* Converts a millisecond duration into a human-readable string.
|
|
107
|
+
* Adjusts units (ms, s, m s) based on the magnitude of the duration.
|
|
108
|
+
*/
|
|
109
|
+
declare function formatMs(ms: number): string;
|
|
110
|
+
/**
|
|
111
|
+
* Convenience helper to get and format elapsed time in one step.
|
|
112
|
+
*/
|
|
113
|
+
declare function formatHrtime(hrStart: [number, number]): string;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/utils/getBarrelFiles.d.ts
|
|
116
|
+
type FileMetaBase = {
|
|
117
|
+
pluginKey?: Plugin['key'];
|
|
118
|
+
};
|
|
119
|
+
type AddIndexesProps = {
|
|
120
|
+
type: BarrelType | false | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Root based on root and output.path specified in the config
|
|
123
|
+
*/
|
|
124
|
+
root: string;
|
|
125
|
+
/**
|
|
126
|
+
* Output for plugin
|
|
127
|
+
*/
|
|
128
|
+
output: {
|
|
129
|
+
path: string;
|
|
130
|
+
};
|
|
131
|
+
group?: {
|
|
132
|
+
output: string;
|
|
133
|
+
exportAs: string;
|
|
134
|
+
};
|
|
135
|
+
meta?: FileMetaBase;
|
|
136
|
+
};
|
|
137
|
+
declare function getBarrelFiles(files: Array<KubbFile.ResolvedFile>, {
|
|
138
|
+
type,
|
|
139
|
+
meta,
|
|
140
|
+
root,
|
|
141
|
+
output
|
|
142
|
+
}: AddIndexesProps): Promise<KubbFile.File[]>;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/utils/getNestedAccessor.d.ts
|
|
145
|
+
/**
|
|
146
|
+
* Converts a param path (string with dot notation or array of strings) to a JavaScript accessor expression.
|
|
147
|
+
* @param param - The param path, e.g., 'pagination.next.id' or ['pagination', 'next', 'id']
|
|
148
|
+
* @param accessor - The base accessor, e.g., 'lastPage' or 'firstPage'
|
|
149
|
+
* @returns A JavaScript accessor expression, e.g., "lastPage?.['pagination']?.['next']?.['id']", or undefined if param is empty
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* getNestedAccessor('pagination.next.id', 'lastPage')
|
|
154
|
+
* // returns: "lastPage?.['pagination']?.['next']?.['id']"
|
|
155
|
+
*
|
|
156
|
+
* getNestedAccessor(['pagination', 'next', 'id'], 'lastPage')
|
|
157
|
+
* // returns: "lastPage?.['pagination']?.['next']?.['id']"
|
|
158
|
+
*
|
|
159
|
+
* getNestedAccessor('', 'lastPage')
|
|
160
|
+
* // returns: undefined
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
declare function getNestedAccessor(param: string | string[], accessor: string): string | undefined;
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/utils/promise.d.ts
|
|
166
|
+
declare function isPromise<T>(result: PossiblePromise<T>): result is Promise<T>;
|
|
167
|
+
declare function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T>;
|
|
168
|
+
declare function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & {
|
|
169
|
+
reason: T;
|
|
170
|
+
};
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/utils/renderTemplate.d.ts
|
|
173
|
+
declare function renderTemplate<TData extends Record<string, unknown> = Record<string, unknown>>(template: string, data?: TData | undefined): string;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/utils/resolveModuleSource.d.ts
|
|
176
|
+
declare function resolveModuleSource(pkgName: string): {
|
|
177
|
+
readonly path: string;
|
|
178
|
+
readonly source: string;
|
|
179
|
+
readonly ext: string;
|
|
180
|
+
};
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/utils/serializePluginOptions.d.ts
|
|
183
|
+
/**
|
|
184
|
+
* Serialize plugin options for safe JSON transport.
|
|
185
|
+
* Strips functions, symbols, and undefined values recursively.
|
|
186
|
+
*/
|
|
187
|
+
declare function serializePluginOptions(options: unknown): unknown;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/utils/timeout.d.ts
|
|
190
|
+
declare function timeout(ms: number): Promise<unknown>;
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/utils/URLPath.d.ts
|
|
193
|
+
type URLObject = {
|
|
194
|
+
url: string;
|
|
195
|
+
params?: Record<string, string>;
|
|
196
|
+
};
|
|
197
|
+
type ObjectOptions = {
|
|
198
|
+
type?: 'path' | 'template';
|
|
199
|
+
replacer?: (pathParam: string) => string;
|
|
200
|
+
stringify?: boolean;
|
|
201
|
+
};
|
|
202
|
+
type Options = {
|
|
203
|
+
casing?: 'camelcase';
|
|
204
|
+
};
|
|
205
|
+
declare class URLPath {
|
|
206
|
+
#private;
|
|
207
|
+
path: string;
|
|
208
|
+
constructor(path: string, options?: Options);
|
|
209
|
+
/**
|
|
210
|
+
* Convert Swagger path to URLPath(syntax of Express)
|
|
211
|
+
* @example /pet/{petId} => /pet/:petId
|
|
212
|
+
*/
|
|
213
|
+
get URL(): string;
|
|
214
|
+
get isURL(): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
217
|
+
* @example /pet/{petId} => `/pet/${petId}`
|
|
218
|
+
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
219
|
+
* @example /account/userID => `/account/${userId}`
|
|
220
|
+
*/
|
|
221
|
+
get template(): string;
|
|
222
|
+
get object(): URLObject | string;
|
|
223
|
+
get params(): Record<string, string> | undefined;
|
|
224
|
+
toObject({
|
|
225
|
+
type,
|
|
226
|
+
replacer,
|
|
227
|
+
stringify
|
|
228
|
+
}?: ObjectOptions): URLObject | string;
|
|
229
|
+
/**
|
|
230
|
+
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
231
|
+
* @example /pet/{petId} => `/pet/${petId}`
|
|
232
|
+
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
233
|
+
* @example /account/userID => `/account/${userId}`
|
|
234
|
+
*/
|
|
235
|
+
toTemplateString({
|
|
236
|
+
prefix,
|
|
237
|
+
replacer
|
|
238
|
+
}?: {
|
|
239
|
+
prefix?: string;
|
|
240
|
+
replacer?: (pathParam: string) => string;
|
|
241
|
+
}): string;
|
|
242
|
+
getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Convert Swagger path to URLPath(syntax of Express)
|
|
245
|
+
* @example /pet/{petId} => /pet/:petId
|
|
246
|
+
*/
|
|
247
|
+
toURLPath(): string;
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/utils/uniqueName.d.ts
|
|
251
|
+
declare function getUniqueName(originalName: string, data: Record<string, number>): string;
|
|
252
|
+
declare function setUniqueName(originalName: string, data: Record<string, number>): string;
|
|
253
|
+
//#endregion
|
|
254
|
+
export { buildJSDoc as C, Cache as S, getElapsedMs as _, timeout as a, executeIfOnline as b, renderTemplate as c, isPromiseRejectedResult as d, getNestedAccessor as f, formatMs as g, formatHrtime as h, URLPath as i, isPromise as l, getBarrelFiles as m, setUniqueName as n, serializePluginOptions as o, FileMetaBase as p, URLObject as r, resolveModuleSource as s, getUniqueName as t, isPromiseFulfilledResult as u, FunctionParams as v, isOnline as x, FunctionParamsAST as y };
|
|
255
|
+
//# sourceMappingURL=index-C0nP9vjm.d.ts.map
|