@cerios/openapi-to-zod 1.0.0 → 1.1.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/README.md +238 -4
- package/dist/cli.js +173 -35
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +180 -35
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +168 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +168 -26
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.mts +53 -2
- package/dist/internal.d.ts +53 -2
- package/dist/internal.js +117 -2
- package/dist/internal.js.map +1 -1
- package/dist/internal.mjs +114 -2
- package/dist/internal.mjs.map +1 -1
- package/dist/{types-BjoP91vk.d.mts → types-CI48CjiU.d.mts} +43 -1
- package/dist/{types-BjoP91vk.d.ts → types-CI48CjiU.d.ts} +43 -1
- package/package.json +6 -2
package/dist/internal.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as ExecutionMode, d as OperationFilters } from './types-
|
|
1
|
+
import { E as ExecutionMode, d as OperationFilters } from './types-CI48CjiU.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { Loader } from 'cosmiconfig';
|
|
4
4
|
|
|
@@ -116,10 +116,23 @@ declare class LRUCache<K, V> {
|
|
|
116
116
|
size(): number;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Name conversion utilities
|
|
121
|
+
*/
|
|
122
|
+
interface NamingOptions {
|
|
123
|
+
prefix?: string;
|
|
124
|
+
suffix?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Convert schema name to camelCase with optional prefix/suffix
|
|
128
|
+
* Handles dotted names like "Company.Models.User" -> "companyModelsUser"
|
|
129
|
+
*/
|
|
130
|
+
declare function toCamelCase(str: string, options?: NamingOptions): string;
|
|
119
131
|
/**
|
|
120
132
|
* @shared Convert enum value to PascalCase and sanitize for TypeScript enum keys
|
|
121
133
|
* @since 1.0.0
|
|
122
134
|
* Utility used by core and playwright packages
|
|
135
|
+
* Handles dotted names like "Company.Models.User" -> "CompanyModelsUser"
|
|
123
136
|
*/
|
|
124
137
|
declare function toPascalCase(str: string | number): string;
|
|
125
138
|
|
|
@@ -174,6 +187,44 @@ declare function validateFilters(stats: FilterStatistics, filters?: OperationFil
|
|
|
174
187
|
*/
|
|
175
188
|
declare function formatFilterStatistics(stats: FilterStatistics): string;
|
|
176
189
|
|
|
190
|
+
/**
|
|
191
|
+
* @shared Strips a prefix from a string using either literal string matching or glob patterns
|
|
192
|
+
* @since 1.1.0
|
|
193
|
+
* Shared utility used by core and playwright packages
|
|
194
|
+
*
|
|
195
|
+
* @param input - The full string to strip from
|
|
196
|
+
* @param pattern - The glob pattern to strip
|
|
197
|
+
* @param ensureLeadingChar - Optional character to ensure at start (e.g., "/" for paths)
|
|
198
|
+
* @returns The string with prefix removed, or original string if no match
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* // Literal string matching
|
|
202
|
+
* stripPrefix("/api/v1/users", "/api/v1") // => "/users"
|
|
203
|
+
* stripPrefix("Company.Models.User", "Company.Models.") // => "User"
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* // Glob pattern matching
|
|
207
|
+
* stripPrefix("/api/v1.0/users", "/api/v*") // => matches and strips
|
|
208
|
+
* stripPrefix("Company.Models.User", "*.Models.") // => "User"
|
|
209
|
+
* stripPrefix("api_v2_UserSchema", "api_v[0-9]_") // => "UserSchema"
|
|
210
|
+
*/
|
|
211
|
+
declare function stripPrefix(input: string, pattern: string | undefined, ensureLeadingChar?: string): string;
|
|
212
|
+
/**
|
|
213
|
+
* @shared Strips a prefix from a path (ensures leading slash)
|
|
214
|
+
* @since 1.1.0
|
|
215
|
+
* Shared utility used by playwright package for path manipulation
|
|
216
|
+
*
|
|
217
|
+
* @param path - The full path to strip from
|
|
218
|
+
* @param pattern - The glob pattern to strip
|
|
219
|
+
* @returns The path with prefix removed, or original path if no match
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* stripPathPrefix("/api/v1/users", "/api/v1") // => "/users"
|
|
223
|
+
* stripPathPrefix("/api/v2/posts", "/api/v*") // => "/posts"
|
|
224
|
+
* stripPathPrefix("/api/v1.0/items", "/api/v[0-9].*") // => "/items"
|
|
225
|
+
*/
|
|
226
|
+
declare function stripPathPrefix(path: string, pattern: string | undefined): string;
|
|
227
|
+
|
|
177
228
|
/**
|
|
178
229
|
* String utility functions for escaping and formatting
|
|
179
230
|
*/
|
|
@@ -197,4 +248,4 @@ declare function escapeJSDoc(str: string): string;
|
|
|
197
248
|
*/
|
|
198
249
|
declare function createTypeScriptLoader(): Loader;
|
|
199
250
|
|
|
200
|
-
export { type BaseOperationFilters, type FilterStatistics, type Generator, LRUCache, OperationFiltersSchema, type RequestResponseOptions, RequestResponseOptionsSchema, createFilterStatistics, createTypeScriptLoader, escapeJSDoc, executeBatch, formatConfigValidationError, formatFilterStatistics, getBatchExitCode, shouldIncludeOperation, toPascalCase, validateFilters };
|
|
251
|
+
export { type BaseOperationFilters, type FilterStatistics, type Generator, LRUCache, OperationFiltersSchema, type RequestResponseOptions, RequestResponseOptionsSchema, createFilterStatistics, createTypeScriptLoader, escapeJSDoc, executeBatch, formatConfigValidationError, formatFilterStatistics, getBatchExitCode, shouldIncludeOperation, stripPathPrefix, stripPrefix, toCamelCase, toPascalCase, validateFilters };
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as ExecutionMode, d as OperationFilters } from './types-
|
|
1
|
+
import { E as ExecutionMode, d as OperationFilters } from './types-CI48CjiU.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { Loader } from 'cosmiconfig';
|
|
4
4
|
|
|
@@ -116,10 +116,23 @@ declare class LRUCache<K, V> {
|
|
|
116
116
|
size(): number;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Name conversion utilities
|
|
121
|
+
*/
|
|
122
|
+
interface NamingOptions {
|
|
123
|
+
prefix?: string;
|
|
124
|
+
suffix?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Convert schema name to camelCase with optional prefix/suffix
|
|
128
|
+
* Handles dotted names like "Company.Models.User" -> "companyModelsUser"
|
|
129
|
+
*/
|
|
130
|
+
declare function toCamelCase(str: string, options?: NamingOptions): string;
|
|
119
131
|
/**
|
|
120
132
|
* @shared Convert enum value to PascalCase and sanitize for TypeScript enum keys
|
|
121
133
|
* @since 1.0.0
|
|
122
134
|
* Utility used by core and playwright packages
|
|
135
|
+
* Handles dotted names like "Company.Models.User" -> "CompanyModelsUser"
|
|
123
136
|
*/
|
|
124
137
|
declare function toPascalCase(str: string | number): string;
|
|
125
138
|
|
|
@@ -174,6 +187,44 @@ declare function validateFilters(stats: FilterStatistics, filters?: OperationFil
|
|
|
174
187
|
*/
|
|
175
188
|
declare function formatFilterStatistics(stats: FilterStatistics): string;
|
|
176
189
|
|
|
190
|
+
/**
|
|
191
|
+
* @shared Strips a prefix from a string using either literal string matching or glob patterns
|
|
192
|
+
* @since 1.1.0
|
|
193
|
+
* Shared utility used by core and playwright packages
|
|
194
|
+
*
|
|
195
|
+
* @param input - The full string to strip from
|
|
196
|
+
* @param pattern - The glob pattern to strip
|
|
197
|
+
* @param ensureLeadingChar - Optional character to ensure at start (e.g., "/" for paths)
|
|
198
|
+
* @returns The string with prefix removed, or original string if no match
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* // Literal string matching
|
|
202
|
+
* stripPrefix("/api/v1/users", "/api/v1") // => "/users"
|
|
203
|
+
* stripPrefix("Company.Models.User", "Company.Models.") // => "User"
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* // Glob pattern matching
|
|
207
|
+
* stripPrefix("/api/v1.0/users", "/api/v*") // => matches and strips
|
|
208
|
+
* stripPrefix("Company.Models.User", "*.Models.") // => "User"
|
|
209
|
+
* stripPrefix("api_v2_UserSchema", "api_v[0-9]_") // => "UserSchema"
|
|
210
|
+
*/
|
|
211
|
+
declare function stripPrefix(input: string, pattern: string | undefined, ensureLeadingChar?: string): string;
|
|
212
|
+
/**
|
|
213
|
+
* @shared Strips a prefix from a path (ensures leading slash)
|
|
214
|
+
* @since 1.1.0
|
|
215
|
+
* Shared utility used by playwright package for path manipulation
|
|
216
|
+
*
|
|
217
|
+
* @param path - The full path to strip from
|
|
218
|
+
* @param pattern - The glob pattern to strip
|
|
219
|
+
* @returns The path with prefix removed, or original path if no match
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* stripPathPrefix("/api/v1/users", "/api/v1") // => "/users"
|
|
223
|
+
* stripPathPrefix("/api/v2/posts", "/api/v*") // => "/posts"
|
|
224
|
+
* stripPathPrefix("/api/v1.0/items", "/api/v[0-9].*") // => "/items"
|
|
225
|
+
*/
|
|
226
|
+
declare function stripPathPrefix(path: string, pattern: string | undefined): string;
|
|
227
|
+
|
|
177
228
|
/**
|
|
178
229
|
* String utility functions for escaping and formatting
|
|
179
230
|
*/
|
|
@@ -197,4 +248,4 @@ declare function escapeJSDoc(str: string): string;
|
|
|
197
248
|
*/
|
|
198
249
|
declare function createTypeScriptLoader(): Loader;
|
|
199
250
|
|
|
200
|
-
export { type BaseOperationFilters, type FilterStatistics, type Generator, LRUCache, OperationFiltersSchema, type RequestResponseOptions, RequestResponseOptionsSchema, createFilterStatistics, createTypeScriptLoader, escapeJSDoc, executeBatch, formatConfigValidationError, formatFilterStatistics, getBatchExitCode, shouldIncludeOperation, toPascalCase, validateFilters };
|
|
251
|
+
export { type BaseOperationFilters, type FilterStatistics, type Generator, LRUCache, OperationFiltersSchema, type RequestResponseOptions, RequestResponseOptionsSchema, createFilterStatistics, createTypeScriptLoader, escapeJSDoc, executeBatch, formatConfigValidationError, formatFilterStatistics, getBatchExitCode, shouldIncludeOperation, stripPathPrefix, stripPrefix, toCamelCase, toPascalCase, validateFilters };
|
package/dist/internal.js
CHANGED
|
@@ -41,6 +41,9 @@ __export(internal_exports, {
|
|
|
41
41
|
formatFilterStatistics: () => formatFilterStatistics,
|
|
42
42
|
getBatchExitCode: () => getBatchExitCode,
|
|
43
43
|
shouldIncludeOperation: () => shouldIncludeOperation,
|
|
44
|
+
stripPathPrefix: () => stripPathPrefix,
|
|
45
|
+
stripPrefix: () => stripPrefix,
|
|
46
|
+
toCamelCase: () => toCamelCase,
|
|
44
47
|
toPascalCase: () => toPascalCase,
|
|
45
48
|
validateFilters: () => validateFilters
|
|
46
49
|
});
|
|
@@ -261,14 +264,49 @@ var LRUCache = class {
|
|
|
261
264
|
};
|
|
262
265
|
|
|
263
266
|
// src/utils/name-utils.ts
|
|
267
|
+
function sanitizeIdentifier(str) {
|
|
268
|
+
return str.replace(/[^a-zA-Z0-9._\-\s]+/g, "_");
|
|
269
|
+
}
|
|
270
|
+
function toCamelCase(str, options) {
|
|
271
|
+
const sanitized = sanitizeIdentifier(str);
|
|
272
|
+
const words = sanitized.split(/[.\-_\s]+/).filter((word) => word.length > 0);
|
|
273
|
+
let name;
|
|
274
|
+
if (words.length === 0) {
|
|
275
|
+
name = str.charAt(0).toLowerCase() + str.slice(1);
|
|
276
|
+
} else if (words.length === 1) {
|
|
277
|
+
name = words[0].charAt(0).toLowerCase() + words[0].slice(1);
|
|
278
|
+
} else {
|
|
279
|
+
name = words[0].charAt(0).toLowerCase() + words[0].slice(1) + words.slice(1).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
280
|
+
}
|
|
281
|
+
if (options == null ? void 0 : options.prefix) {
|
|
282
|
+
const prefix = options.prefix.toLowerCase();
|
|
283
|
+
name = prefix + name.charAt(0).toUpperCase() + name.slice(1);
|
|
284
|
+
}
|
|
285
|
+
if (options == null ? void 0 : options.suffix) {
|
|
286
|
+
const suffix = options.suffix;
|
|
287
|
+
name = name + suffix.charAt(0).toUpperCase() + suffix.slice(1).toLowerCase();
|
|
288
|
+
}
|
|
289
|
+
return name;
|
|
290
|
+
}
|
|
264
291
|
function toPascalCase(str) {
|
|
265
292
|
const stringValue = String(str);
|
|
266
|
-
|
|
293
|
+
const isAlreadyValidCase = /^[a-zA-Z][a-zA-Z0-9]*$/.test(stringValue);
|
|
294
|
+
if (isAlreadyValidCase) {
|
|
295
|
+
return stringValue.charAt(0).toUpperCase() + stringValue.slice(1);
|
|
296
|
+
}
|
|
297
|
+
const sanitized = sanitizeIdentifier(stringValue);
|
|
298
|
+
const words = sanitized.split(/[.\-_\s]+/).filter((word) => word.length > 0);
|
|
299
|
+
let result;
|
|
300
|
+
if (words.length === 0) {
|
|
301
|
+
result = "Value";
|
|
302
|
+
} else {
|
|
303
|
+
result = words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
304
|
+
}
|
|
267
305
|
if (/^\d/.test(result)) {
|
|
268
306
|
result = `N${result}`;
|
|
269
307
|
}
|
|
270
308
|
if (!result || /^_+$/.test(result)) {
|
|
271
|
-
|
|
309
|
+
return "Value";
|
|
272
310
|
}
|
|
273
311
|
return result;
|
|
274
312
|
}
|
|
@@ -407,6 +445,80 @@ function formatFilterStatistics(stats) {
|
|
|
407
445
|
return lines.join("\n");
|
|
408
446
|
}
|
|
409
447
|
|
|
448
|
+
// src/utils/pattern-utils.ts
|
|
449
|
+
var import_minimatch2 = require("minimatch");
|
|
450
|
+
function isValidGlobPattern(pattern) {
|
|
451
|
+
try {
|
|
452
|
+
new import_minimatch2.minimatch.Minimatch(pattern);
|
|
453
|
+
return true;
|
|
454
|
+
} catch {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function isGlobPattern(pattern) {
|
|
459
|
+
return /[*?[\]{}!]/.test(pattern);
|
|
460
|
+
}
|
|
461
|
+
function stripPrefix(input, pattern, ensureLeadingChar) {
|
|
462
|
+
if (!pattern) {
|
|
463
|
+
return input;
|
|
464
|
+
}
|
|
465
|
+
if (isGlobPattern(pattern) && !isValidGlobPattern(pattern)) {
|
|
466
|
+
console.warn(`\u26A0\uFE0F Invalid glob pattern "${pattern}": Pattern is malformed`);
|
|
467
|
+
return input;
|
|
468
|
+
}
|
|
469
|
+
if (isGlobPattern(pattern)) {
|
|
470
|
+
let longestMatch = -1;
|
|
471
|
+
for (let i = 1; i <= input.length; i++) {
|
|
472
|
+
const testPrefix = input.substring(0, i);
|
|
473
|
+
if ((0, import_minimatch2.minimatch)(testPrefix, pattern)) {
|
|
474
|
+
longestMatch = i;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (longestMatch > 0) {
|
|
478
|
+
const stripped = input.substring(longestMatch);
|
|
479
|
+
if (ensureLeadingChar) {
|
|
480
|
+
if (stripped === "") {
|
|
481
|
+
return ensureLeadingChar;
|
|
482
|
+
}
|
|
483
|
+
if (!stripped.startsWith(ensureLeadingChar)) {
|
|
484
|
+
return `${ensureLeadingChar}${stripped}`;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return stripped === "" && !ensureLeadingChar ? input : stripped;
|
|
488
|
+
}
|
|
489
|
+
return input;
|
|
490
|
+
}
|
|
491
|
+
if (input.startsWith(pattern)) {
|
|
492
|
+
const stripped = input.substring(pattern.length);
|
|
493
|
+
if (ensureLeadingChar) {
|
|
494
|
+
if (stripped === "") {
|
|
495
|
+
return ensureLeadingChar;
|
|
496
|
+
}
|
|
497
|
+
if (!stripped.startsWith(ensureLeadingChar)) {
|
|
498
|
+
return `${ensureLeadingChar}${stripped}`;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return stripped;
|
|
502
|
+
}
|
|
503
|
+
return input;
|
|
504
|
+
}
|
|
505
|
+
function stripPathPrefix(path, pattern) {
|
|
506
|
+
if (!pattern) {
|
|
507
|
+
return path;
|
|
508
|
+
}
|
|
509
|
+
if (!isGlobPattern(pattern)) {
|
|
510
|
+
let normalizedPattern = pattern.trim();
|
|
511
|
+
if (!normalizedPattern.startsWith("/")) {
|
|
512
|
+
normalizedPattern = `/${normalizedPattern}`;
|
|
513
|
+
}
|
|
514
|
+
if (normalizedPattern.endsWith("/") && normalizedPattern !== "/") {
|
|
515
|
+
normalizedPattern = normalizedPattern.slice(0, -1);
|
|
516
|
+
}
|
|
517
|
+
return stripPrefix(path, normalizedPattern, "/");
|
|
518
|
+
}
|
|
519
|
+
return stripPrefix(path, pattern, "/");
|
|
520
|
+
}
|
|
521
|
+
|
|
410
522
|
// src/utils/string-utils.ts
|
|
411
523
|
function escapeJSDoc(str) {
|
|
412
524
|
return str.replace(/\*\//g, "*\\/");
|
|
@@ -458,6 +570,9 @@ function createTypeScriptLoader() {
|
|
|
458
570
|
formatFilterStatistics,
|
|
459
571
|
getBatchExitCode,
|
|
460
572
|
shouldIncludeOperation,
|
|
573
|
+
stripPathPrefix,
|
|
574
|
+
stripPrefix,
|
|
575
|
+
toCamelCase,
|
|
461
576
|
toPascalCase,
|
|
462
577
|
validateFilters
|
|
463
578
|
});
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal.ts","../src/errors.ts","../src/batch-executor.ts","../src/utils/config-schemas.ts","../src/utils/config-validation.ts","../src/utils/lru-cache.ts","../src/utils/name-utils.ts","../src/utils/operation-filters.ts","../src/utils/string-utils.ts","../src/utils/typescript-loader.ts"],"sourcesContent":["/**\n * Internal utilities shared between @cerios packages\n *\n * ⚠️ WARNING: NOT FOR PUBLIC USE\n *\n * This module exposes internal implementation details that are shared\n * between @cerios/openapi-to-zod and @cerios/openapi-to-zod-playwright.\n *\n * These APIs are NOT considered part of the public API surface and may\n * change without notice in minor or patch versions. Use at your own risk.\n *\n * @internal\n * @packageDocumentation\n */\n\n// Batch execution utilities\nexport { executeBatch, type Generator, getBatchExitCode } from \"./batch-executor\";\n\n// Configuration schemas and validation\nexport type { BaseOperationFilters, RequestResponseOptions } from \"./utils/config-schemas\";\nexport { OperationFiltersSchema, RequestResponseOptionsSchema } from \"./utils/config-schemas\";\nexport { formatConfigValidationError } from \"./utils/config-validation\";\n\n// Caching utilities\nexport { LRUCache } from \"./utils/lru-cache\";\n\n// String and naming utilities\nexport { toPascalCase } from \"./utils/name-utils\";\n// Operation filtering utilities\nexport {\n\tcreateFilterStatistics,\n\ttype FilterStatistics,\n\tformatFilterStatistics,\n\tshouldIncludeOperation,\n\tvalidateFilters,\n} from \"./utils/operation-filters\";\nexport { escapeJSDoc } from \"./utils/string-utils\";\n\n// TypeScript loading utilities\nexport { createTypeScriptLoader } from \"./utils/typescript-loader\";\n","/**\n * Custom error classes for better error handling and debugging\n */\n\n/**\n * Base error class for all generator errors\n */\nexport class GeneratorError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly code: string,\n\t\tpublic readonly context?: Record<string, unknown>\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"GeneratorError\";\n\t\tError.captureStackTrace?.(this, this.constructor);\n\t}\n}\n\n/**\n * Error thrown when OpenAPI spec validation fails\n */\nexport class SpecValidationError extends GeneratorError {\n\tconstructor(message: string, context?: Record<string, unknown>) {\n\t\tsuper(message, \"SPEC_VALIDATION_ERROR\", context);\n\t\tthis.name = \"SpecValidationError\";\n\t}\n}\n\n/**\n * Error thrown when file operations fail\n */\nexport class FileOperationError extends GeneratorError {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly filePath: string,\n\t\tcontext?: Record<string, unknown>\n\t) {\n\t\tsuper(message, \"FILE_OPERATION_ERROR\", { ...context, filePath });\n\t\tthis.name = \"FileOperationError\";\n\t}\n}\n\n/**\n * Error thrown when config file is invalid\n */\nexport class ConfigValidationError extends GeneratorError {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly configPath?: string,\n\t\tcontext?: Record<string, unknown>\n\t) {\n\t\tsuper(message, \"CONFIG_VALIDATION_ERROR\", { ...context, configPath });\n\t\tthis.name = \"ConfigValidationError\";\n\t}\n}\n\n/**\n * Error thrown when schema generation fails\n */\nexport class SchemaGenerationError extends GeneratorError {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly schemaName: string,\n\t\tcontext?: Record<string, unknown>\n\t) {\n\t\tsuper(message, \"SCHEMA_GENERATION_ERROR\", { ...context, schemaName });\n\t\tthis.name = \"SchemaGenerationError\";\n\t}\n}\n\n/**\n * Error thrown when circular reference is detected in schema\n */\nexport class CircularReferenceError extends SchemaGenerationError {\n\tconstructor(\n\t\tschemaName: string,\n\t\tpublic readonly referencePath: string[]\n\t) {\n\t\tconst pathStr = referencePath.join(\" -> \");\n\t\tsuper(`Circular reference detected in schema: ${pathStr}`, schemaName, { referencePath, circularPath: pathStr });\n\t\tthis.name = \"CircularReferenceError\";\n\t}\n}\n\n/**\n * Error thrown when CLI options are invalid\n */\nexport class CliOptionsError extends GeneratorError {\n\tconstructor(message: string, context?: Record<string, unknown>) {\n\t\tsuper(message, \"CLI_OPTIONS_ERROR\", context);\n\t\tthis.name = \"CliOptionsError\";\n\t}\n}\n\n/**\n * Error thrown when configuration is invalid or missing required values\n */\nexport class ConfigurationError extends GeneratorError {\n\tconstructor(message: string, context?: Record<string, unknown>) {\n\t\tsuper(message, \"CONFIGURATION_ERROR\", context);\n\t\tthis.name = \"ConfigurationError\";\n\t}\n}\n","import { ConfigurationError } from \"./errors\";\nimport type { ExecutionMode } from \"./types\";\n\n/**\n * @shared Generator interface for batch execution\n * @since 1.0.0\n * Interface that both OpenApiGenerator and OpenApiPlaywrightGenerator must implement\n */\nexport interface Generator {\n\tgenerate(): void;\n}\n\n/**\n * Result of processing a single spec\n */\ninterface SpecResult<T> {\n\tspec: T;\n\tsuccess: boolean;\n\terror?: string;\n}\n\n/**\n * Summary of batch execution results\n */\ninterface BatchExecutionSummary<T> {\n\ttotal: number;\n\tsuccessful: number;\n\tfailed: number;\n\tresults: SpecResult<T>[];\n}\n\n/**\n * Process a single spec and return result with error handling\n */\nasync function processSpec<T>(\n\tspec: T,\n\tindex: number,\n\ttotal: number,\n\tcreateGenerator: (spec: T) => Generator\n): Promise<SpecResult<T>> {\n\t// Live progress to stdout\n\tconst specInput = (spec as any).input || \"spec\";\n\tconst specOutput = (spec as any).output || \"output\";\n\tconsole.log(`Processing [${index + 1}/${total}] ${specInput}...`);\n\n\ttry {\n\t\tconst generator = createGenerator(spec);\n\t\tgenerator.generate();\n\n\t\treturn {\n\t\t\tspec,\n\t\t\tsuccess: true,\n\t\t};\n\t} catch (error) {\n\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(`✗ Failed to generate ${specOutput}: ${errorMessage}`);\n\n\t\treturn {\n\t\t\tspec,\n\t\t\tsuccess: false,\n\t\t\terror: errorMessage,\n\t\t};\n\t}\n}\n\n/**\n * Execute specs in parallel using Promise.allSettled with configurable batch size\n * Processes specifications in batches to control memory usage and concurrency\n * Continues processing all specs even if some fail\n */\nasync function executeParallel<T>(\n\tspecs: T[],\n\tcreateGenerator: (spec: T) => Generator,\n\tbatchSize: number\n): Promise<SpecResult<T>[]> {\n\tconsole.log(`\\nExecuting ${specs.length} specification(s) in parallel (batch size: ${batchSize})...\\n`);\n\n\tconst results: SpecResult<T>[] = [];\n\n\t// Process in batches to control memory usage\n\tfor (let i = 0; i < specs.length; i += batchSize) {\n\t\tconst batch = specs.slice(i, Math.min(i + batchSize, specs.length));\n\t\tconst batchPromises = batch.map((spec, batchIndex) =>\n\t\t\tprocessSpec(spec, i + batchIndex, specs.length, createGenerator)\n\t\t);\n\n\t\tconst batchResults = await Promise.allSettled(batchPromises);\n\n\t\t// Convert settled results to SpecResult\n\t\tfor (let j = 0; j < batchResults.length; j++) {\n\t\t\tconst result = batchResults[j];\n\t\t\tif (result.status === \"fulfilled\") {\n\t\t\t\tresults.push(result.value);\n\t\t\t} else {\n\t\t\t\t// Handle unexpected promise rejection\n\t\t\t\tresults.push({\n\t\t\t\t\tspec: batch[j],\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: result.reason instanceof Error ? result.reason.message : String(result.reason),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn results;\n}\n\n/**\n * Execute specs sequentially one at a time\n * Continues processing all specs even if some fail\n */\nasync function executeSequential<T>(specs: T[], createGenerator: (spec: T) => Generator): Promise<SpecResult<T>[]> {\n\tconsole.log(`\\nExecuting ${specs.length} spec(s) sequentially...\\n`);\n\n\tconst results: SpecResult<T>[] = [];\n\n\tfor (let i = 0; i < specs.length; i++) {\n\t\tconst result = await processSpec(specs[i], i, specs.length, createGenerator);\n\t\tresults.push(result);\n\t}\n\n\treturn results;\n}\n\n/**\n * Print final summary of batch execution\n */\nfunction printSummary<T>(summary: BatchExecutionSummary<T>): void {\n\tconsole.log(`\\n${\"=\".repeat(50)}`);\n\tconsole.log(\"Batch Execution Summary\");\n\tconsole.log(\"=\".repeat(50));\n\tconsole.log(`Total specs: ${summary.total}`);\n\tconsole.log(`Successful: ${summary.successful}`);\n\tconsole.log(`Failed: ${summary.failed}`);\n\n\tif (summary.failed > 0) {\n\t\tconsole.log(\"\\nFailed specs:\");\n\t\tfor (const result of summary.results) {\n\t\t\tif (!result.success) {\n\t\t\t\tconst specInput = (result.spec as any).input || \"spec\";\n\t\t\t\tconsole.error(` ✗ ${specInput}`);\n\t\t\t\tconsole.error(` Error: ${result.error}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(`${\"=\".repeat(50)}\\n`);\n}\n\n/**\n * @shared Execute batch processing of multiple specs with custom generator\n * @since 1.0.0\n * Utility used by core and playwright packages\n *\n * @param specs - Array of spec configurations to process\n * @param executionMode - Execution mode: \"parallel\" (default) or \"sequential\"\n * @param createGenerator - Factory function to create generator from spec\n * @param batchSize - Number of specifications to process concurrently in parallel mode\n * @returns BatchExecutionSummary with results\n * @throws Never throws - collects all errors and reports them\n */\nexport async function executeBatch<T>(\n\tspecs: T[],\n\texecutionMode: ExecutionMode = \"parallel\",\n\tcreateGenerator: (spec: T) => Generator,\n\tbatchSize: number\n): Promise<BatchExecutionSummary<T>> {\n\tif (specs.length === 0) {\n\t\tthrow new ConfigurationError(\"No specs provided for batch execution\", { specsCount: 0, executionMode });\n\t}\n\n\tlet results: SpecResult<T>[] = [];\n\n\ttry {\n\t\t// Execute based on mode\n\t\tresults =\n\t\t\texecutionMode === \"parallel\"\n\t\t\t\t? await executeParallel(specs, createGenerator, batchSize)\n\t\t\t\t: await executeSequential(specs, createGenerator);\n\n\t\t// Calculate summary\n\t\tconst summary: BatchExecutionSummary<T> = {\n\t\t\ttotal: results.length,\n\t\t\tsuccessful: results.filter(r => r.success).length,\n\t\t\tfailed: results.filter(r => !r.success).length,\n\t\t\tresults,\n\t\t};\n\n\t\t// Print summary\n\t\tprintSummary(summary);\n\n\t\treturn summary;\n\t} finally {\n\t\t// Memory leak prevention: Clear large result objects and hint GC for large batches\n\t\tif (results.length > batchSize) {\n\t\t\t// Clear spec references to allow GC\n\t\t\tfor (const result of results) {\n\t\t\t\t// Keep only essential info, clear large objects\n\t\t\t\tif (result.spec) {\n\t\t\t\t\t(result.spec as any) = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Hint to V8 garbage collector for large batches (if available)\n\t\t\tif (global.gc) {\n\t\t\t\tglobal.gc();\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Determine exit code based on batch execution results\n * Returns 1 if any spec failed, 0 if all succeeded\n */\nexport function getBatchExitCode<T>(summary: BatchExecutionSummary<T>): number {\n\treturn summary.failed > 0 ? 1 : 0;\n}\n","import { z } from \"zod\";\n\n/**\n * @shared Zod schema for request/response options validation\n * @since 1.0.0\n * Utility used by core and playwright packages\n */\nexport const RequestResponseOptionsSchema = z.strictObject({\n\tmode: z.enum([\"strict\", \"normal\", \"loose\"]).optional(),\n\tuseDescribe: z.boolean().optional(),\n\tincludeDescriptions: z.boolean().optional(),\n});\n\n/**\n * @shared Base Zod schema for operation filters (without status codes)\n * @since 1.0.0\n * Utility used by core and playwright packages\n */\nexport const OperationFiltersSchema = z.strictObject({\n\tincludeTags: z.array(z.string()).optional(),\n\texcludeTags: z.array(z.string()).optional(),\n\tincludePaths: z.array(z.string()).optional(),\n\texcludePaths: z.array(z.string()).optional(),\n\tincludeMethods: z.array(z.string()).optional(),\n\texcludeMethods: z.array(z.string()).optional(),\n\tincludeOperationIds: z.array(z.string()).optional(),\n\texcludeOperationIds: z.array(z.string()).optional(),\n\texcludeDeprecated: z.boolean().optional(),\n});\n\n/**\n * Inferred TypeScript type for request/response options\n */\nexport type RequestResponseOptions = z.infer<typeof RequestResponseOptionsSchema>;\n\n/**\n * Inferred TypeScript type for base operation filters\n */\nexport type BaseOperationFilters = z.infer<typeof OperationFiltersSchema>;\n","import { z } from \"zod\";\n\n/**\n * @shared Format Zod validation errors into user-friendly error messages\n * @since 1.0.0\n * Utility used by core and playwright packages\n *\n * @param error - The Zod validation error\n * @param filepath - Path to the config file that was being validated\n * @param configPath - Optional explicit config path provided by user\n * @param additionalNotes - Optional array of additional notes to append to the error message\n * @returns Formatted error message string\n */\nexport function formatConfigValidationError(\n\terror: z.ZodError,\n\tfilepath: string | undefined,\n\tconfigPath: string | undefined,\n\tadditionalNotes?: string[]\n): string {\n\tconst formattedErrors =\n\t\terror.issues\n\t\t\t?.map(err => {\n\t\t\t\tconst path = err.path.length > 0 ? err.path.join(\".\") : \"root\";\n\t\t\t\treturn ` - ${path}: ${err.message}`;\n\t\t\t})\n\t\t\t.join(\"\\n\") || \"Unknown validation error\";\n\n\tconst configSource = filepath || configPath || \"config file\";\n\tconst lines = [\n\t\t`Invalid configuration file at: ${configSource}`,\n\t\t\"\",\n\t\t\"Validation errors:\",\n\t\tformattedErrors,\n\t\t\"\",\n\t\t\"Please check your configuration file and ensure:\",\n\t\t\" - All required fields are present (specs array with input/output)\",\n\t\t\" - Field names are spelled correctly (no typos)\",\n\t\t\" - Values match the expected types (e.g., mode: 'strict' | 'normal' | 'loose')\",\n\t\t\" - No unknown/extra properties are included\",\n\t];\n\n\tif (additionalNotes && additionalNotes.length > 0) {\n\t\tlines.push(...additionalNotes.map(note => ` - ${note}`));\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n","/**\n * @shared Simple LRU Cache implementation for performance optimization\n * @since 1.0.0\n * Utility used by core and playwright packages\n * Prevents memory leaks from unbounded cache growth\n */\nexport class LRUCache<K, V> {\n\tprivate cache = new Map<K, V>();\n\tprivate maxSize: number;\n\n\tconstructor(maxSize: number) {\n\t\tthis.maxSize = maxSize;\n\t}\n\n\tget capacity(): number {\n\t\treturn this.maxSize;\n\t}\n\n\tget(key: K): V | undefined {\n\t\tif (!this.cache.has(key)) return undefined;\n\t\t// Move to end (most recently used)\n\t\tconst value = this.cache.get(key);\n\t\tif (value === undefined) return undefined;\n\t\tthis.cache.delete(key);\n\t\tthis.cache.set(key, value);\n\t\treturn value;\n\t}\n\n\tset(key: K, value: V): void {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key);\n\t\t} else if (this.cache.size >= this.maxSize) {\n\t\t\t// Remove least recently used (first item)\n\t\t\tconst firstKey = this.cache.keys().next().value;\n\t\t\tif (firstKey !== undefined) {\n\t\t\t\tthis.cache.delete(firstKey);\n\t\t\t}\n\t\t}\n\t\tthis.cache.set(key, value);\n\t}\n\n\thas(key: K): boolean {\n\t\treturn this.cache.has(key);\n\t}\n\n\tclear(): void {\n\t\tthis.cache.clear();\n\t}\n\n\tsize(): number {\n\t\treturn this.cache.size;\n\t}\n}\n","/**\n * Name conversion utilities\n */\n\nexport interface NamingOptions {\n\tprefix?: string;\n\tsuffix?: string;\n}\n\n/**\n * Convert schema name to camelCase with optional prefix/suffix\n */\nexport function toCamelCase(str: string, options?: NamingOptions): string {\n\tlet name = str.charAt(0).toLowerCase() + str.slice(1);\n\n\t// Add prefix\n\tif (options?.prefix) {\n\t\tconst prefix = options.prefix.toLowerCase();\n\t\tname = prefix + name.charAt(0).toUpperCase() + name.slice(1);\n\t}\n\n\t// Add suffix before \"Schema\"\n\tif (options?.suffix) {\n\t\tconst suffix = options.suffix;\n\t\tname = name + suffix.charAt(0).toUpperCase() + suffix.slice(1).toLowerCase();\n\t}\n\n\treturn name;\n}\n\n/**\n * @shared Convert enum value to PascalCase and sanitize for TypeScript enum keys\n * @since 1.0.0\n * Utility used by core and playwright packages\n */\nexport function toPascalCase(str: string | number): string {\n\tconst stringValue = String(str);\n\t// Replace ALL special characters (not just dots/spaces) with underscores, then convert to PascalCase\n\t// Valid identifier chars: letters, digits, underscore. Everything else becomes underscore.\n\tlet result = stringValue\n\t\t.replace(/[^a-zA-Z0-9_]+/g, \"_\") // Replace all non-identifier chars with underscore\n\t\t.split(/[-_]+/)\n\t\t.filter(word => word.length > 0) // Remove empty parts\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n\t\t.join(\"\");\n\n\t// Enum keys can't start with a number - prefix with 'N'\n\tif (/^\\d/.test(result)) {\n\t\tresult = `N${result}`;\n\t}\n\n\t// If result is empty or only underscores, use a default\n\tif (!result || /^_+$/.test(result)) {\n\t\tresult = \"Value\";\n\t}\n\n\treturn result;\n}\n\n/**\n * Resolve $ref to schema name\n */\nexport function resolveRef(ref: string): string {\n\tconst parts = ref.split(\"/\");\n\treturn parts[parts.length - 1];\n}\n","import { minimatch } from \"minimatch\";\nimport type { OperationFilters } from \"../types\";\n\n/**\n * Filter statistics to track which operations were included/excluded\n */\nexport interface FilterStatistics {\n\ttotalOperations: number;\n\tincludedOperations: number;\n\tfilteredByTags: number;\n\tfilteredByPaths: number;\n\tfilteredByMethods: number;\n\tfilteredByOperationIds: number;\n\tfilteredByDeprecated: number;\n}\n\n/**\n * Create a new filter statistics object with all counters initialized to zero\n */\nexport function createFilterStatistics(): FilterStatistics {\n\treturn {\n\t\ttotalOperations: 0,\n\t\tincludedOperations: 0,\n\t\tfilteredByTags: 0,\n\t\tfilteredByPaths: 0,\n\t\tfilteredByMethods: 0,\n\t\tfilteredByOperationIds: 0,\n\t\tfilteredByDeprecated: 0,\n\t};\n}\n\n/**\n * Check if a value matches any of the patterns (supports glob patterns)\n * Empty patterns array = no constraint (returns true)\n */\nfunction matchesAnyPattern(value: string | undefined, patterns: string[] | undefined): boolean {\n\tif (!patterns || patterns.length === 0) {\n\t\treturn false; // No constraint means \"don't use this filter\"\n\t}\n\tif (!value) {\n\t\treturn false;\n\t}\n\treturn patterns.some(pattern => minimatch(value, pattern));\n}\n\n/**\n * Check if an array contains any of the specified values\n * Empty values array = no constraint (returns false)\n */\nfunction containsAny(arr: string[] | undefined, values: string[] | undefined): boolean {\n\tif (!values || values.length === 0) {\n\t\treturn false; // No constraint means \"don't use this filter\"\n\t}\n\tif (!arr || arr.length === 0) {\n\t\treturn false;\n\t}\n\treturn values.some(value => arr.includes(value));\n}\n\n/**\n * Determine if an operation should be included based on filter criteria\n *\n * Filter logic:\n * 1. If no filters specified, include all operations\n * 2. Empty arrays are treated as \"no constraint\" (not as \"exclude all\")\n * 3. Include filters are applied first (allowlist)\n * 4. Exclude filters are applied second (blocklist)\n * 5. Exclude rules always win over include rules\n *\n * @param operation - The OpenAPI operation object\n * @param path - The operation path (e.g., \"/users/{id}\")\n * @param method - The HTTP method (e.g., \"get\", \"post\")\n * @param filters - Optional filter configuration\n * @param stats - Optional statistics object to track filtering reasons\n * @returns true if the operation should be included, false otherwise\n */\nexport function shouldIncludeOperation(\n\toperation: any,\n\tpath: string,\n\tmethod: string,\n\tfilters?: OperationFilters,\n\tstats?: FilterStatistics\n): boolean {\n\t// If no filters specified, include all operations\n\tif (!filters) {\n\t\treturn true;\n\t}\n\n\tconst methodLower = method.toLowerCase();\n\tconst operationId = operation?.operationId;\n\tconst tags = operation?.tags || [];\n\tconst deprecated = operation?.deprecated === true;\n\n\t// Apply include filters first (allowlist)\n\t// If any include filter is specified and the operation doesn't match, exclude it\n\n\t// Check includeTags\n\tif (filters.includeTags && filters.includeTags.length > 0) {\n\t\tif (!containsAny(tags, filters.includeTags)) {\n\t\t\tif (stats) stats.filteredByTags++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check includePaths\n\tif (filters.includePaths && filters.includePaths.length > 0) {\n\t\tif (!matchesAnyPattern(path, filters.includePaths)) {\n\t\t\tif (stats) stats.filteredByPaths++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check includeMethods\n\tif (filters.includeMethods && filters.includeMethods.length > 0) {\n\t\tconst methodsLower = filters.includeMethods.map(m => m.toLowerCase());\n\t\tif (!methodsLower.includes(methodLower)) {\n\t\t\tif (stats) stats.filteredByMethods++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check includeOperationIds\n\tif (filters.includeOperationIds && filters.includeOperationIds.length > 0) {\n\t\tif (!matchesAnyPattern(operationId, filters.includeOperationIds)) {\n\t\t\tif (stats) stats.filteredByOperationIds++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Apply exclude filters second (blocklist)\n\t// If the operation matches any exclude filter, exclude it\n\n\t// Check excludeDeprecated\n\tif (filters.excludeDeprecated === true && deprecated) {\n\t\tif (stats) stats.filteredByDeprecated++;\n\t\treturn false;\n\t}\n\n\t// Check excludeTags\n\tif (filters.excludeTags && filters.excludeTags.length > 0) {\n\t\tif (containsAny(tags, filters.excludeTags)) {\n\t\t\tif (stats) stats.filteredByTags++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check excludePaths\n\tif (filters.excludePaths && filters.excludePaths.length > 0) {\n\t\tif (matchesAnyPattern(path, filters.excludePaths)) {\n\t\t\tif (stats) stats.filteredByPaths++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check excludeMethods\n\tif (filters.excludeMethods && filters.excludeMethods.length > 0) {\n\t\tconst methodsLower = filters.excludeMethods.map(m => m.toLowerCase());\n\t\tif (methodsLower.includes(methodLower)) {\n\t\t\tif (stats) stats.filteredByMethods++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check excludeOperationIds\n\tif (filters.excludeOperationIds && filters.excludeOperationIds.length > 0) {\n\t\tif (matchesAnyPattern(operationId, filters.excludeOperationIds)) {\n\t\t\tif (stats) stats.filteredByOperationIds++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Operation passed all filters\n\treturn true;\n}\n\n/**\n * Validate filter statistics and emit warnings for filters that matched nothing\n * Helps users debug filter configurations that might be too restrictive or contain typos\n *\n * @param stats - Filter statistics object\n * @param filters - The filter configuration to validate\n */\nexport function validateFilters(stats: FilterStatistics, filters?: OperationFilters): void {\n\tif (!filters || stats.totalOperations === 0) {\n\t\treturn;\n\t}\n\n\t// If all operations were filtered out, emit a warning\n\tif (stats.includedOperations === 0) {\n\t\tconsole.warn(\n\t\t\t`⚠️ Warning: All ${stats.totalOperations} operations were filtered out. Check your operationFilters configuration.`\n\t\t);\n\n\t\t// Provide specific guidance about which filters might be the issue\n\t\tconst filterBreakdown: string[] = [];\n\t\tif (stats.filteredByTags > 0) filterBreakdown.push(`${stats.filteredByTags} by tags`);\n\t\tif (stats.filteredByPaths > 0) filterBreakdown.push(`${stats.filteredByPaths} by paths`);\n\t\tif (stats.filteredByMethods > 0) filterBreakdown.push(`${stats.filteredByMethods} by methods`);\n\t\tif (stats.filteredByOperationIds > 0) filterBreakdown.push(`${stats.filteredByOperationIds} by operationIds`);\n\t\tif (stats.filteredByDeprecated > 0) filterBreakdown.push(`${stats.filteredByDeprecated} by deprecated flag`);\n\n\t\tif (filterBreakdown.length > 0) {\n\t\t\tconsole.warn(` Filtered: ${filterBreakdown.join(\", \")}`);\n\t\t}\n\t}\n}\n\n/**\n * Format filter statistics for display in generated output\n * Returns a formatted string suitable for inclusion in comments\n *\n * @param stats - Filter statistics object\n * @returns Formatted statistics string\n */\nexport function formatFilterStatistics(stats: FilterStatistics): string {\n\tif (stats.totalOperations === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst lines: string[] = [];\n\tlines.push(\"Operation Filtering:\");\n\tlines.push(` Total operations: ${stats.totalOperations}`);\n\tlines.push(` Included operations: ${stats.includedOperations}`);\n\n\tconst filteredCount =\n\t\tstats.filteredByTags +\n\t\tstats.filteredByPaths +\n\t\tstats.filteredByMethods +\n\t\tstats.filteredByOperationIds +\n\t\tstats.filteredByDeprecated;\n\n\tif (filteredCount > 0) {\n\t\tlines.push(` Filtered operations: ${filteredCount}`);\n\t\tif (stats.filteredByTags > 0) lines.push(` - By tags: ${stats.filteredByTags}`);\n\t\tif (stats.filteredByPaths > 0) lines.push(` - By paths: ${stats.filteredByPaths}`);\n\t\tif (stats.filteredByMethods > 0) lines.push(` - By methods: ${stats.filteredByMethods}`);\n\t\tif (stats.filteredByOperationIds > 0) lines.push(` - By operationIds: ${stats.filteredByOperationIds}`);\n\t\tif (stats.filteredByDeprecated > 0) lines.push(` - By deprecated: ${stats.filteredByDeprecated}`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n","/**\n * String utility functions for escaping and formatting\n */\n\nimport type { OpenAPISchema } from \"../types\";\n\n/**\n * Escape string for description in .describe()\n */\nexport function escapeDescription(str: string): string {\n\treturn str.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"').replace(/\\n/g, \"\\\\n\");\n}\n\n/**\n * Escape regex pattern for use in code\n */\nexport function escapePattern(str: string): string {\n\treturn str.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\");\n}\n\n/**\n * @shared Escape JSDoc comment content to prevent injection\n * @since 1.0.0\n * Utility used by core and playwright packages\n */\nexport function escapeJSDoc(str: string): string {\n\treturn str.replace(/\\*\\//g, \"*\\\\/\");\n}\n\n/**\n * Wrap validation with .nullable() if needed\n */\nexport function wrapNullable(validation: string, isNullable: boolean): string {\n\treturn isNullable ? `${validation}.nullable()` : validation;\n}\n\n/**\n * Check if schema is nullable (supports both OpenAPI 3.0 and 3.1 syntax)\n */\nexport function isNullable(schema: OpenAPISchema): boolean {\n\t// OpenAPI 3.0 style: nullable: true\n\tif (schema.nullable === true) {\n\t\treturn true;\n\t}\n\t// OpenAPI 3.1 style: type can be an array including \"null\"\n\tif (Array.isArray(schema.type)) {\n\t\treturn schema.type.includes(\"null\");\n\t}\n\treturn false;\n}\n\n/**\n * Get the primary type from schema (handles OpenAPI 3.1 type arrays)\n */\nexport function getPrimaryType(schema: OpenAPISchema): string | undefined {\n\tif (Array.isArray(schema.type)) {\n\t\t// OpenAPI 3.1: type can be an array like [\"string\", \"null\"]\n\t\t// Return the first non-null type\n\t\tconst nonNullType = schema.type.find(t => t !== \"null\");\n\t\treturn nonNullType;\n\t}\n\treturn schema.type;\n}\n\n/**\n * Check if schema has multiple non-null types\n */\nexport function hasMultipleTypes(schema: OpenAPISchema): boolean {\n\tif (Array.isArray(schema.type)) {\n\t\tconst nonNullTypes = schema.type.filter(t => t !== \"null\");\n\t\treturn nonNullTypes.length > 1;\n\t}\n\treturn false;\n}\n\n/**\n * Add description to a schema validation string\n */\nexport function addDescription(validation: string, description: string | undefined, useDescribe: boolean): string {\n\tif (!description || !useDescribe) return validation;\n\n\tconst escapedDesc = escapeDescription(description);\n\treturn `${validation}.describe(\"${escapedDesc}\")`;\n}\n","import type { Loader } from \"cosmiconfig\";\n\n/**\n * @shared Create a TypeScript loader for cosmiconfig using esbuild\n * @since 1.0.0\n * Utility used by core and playwright packages\n *\n * Creates a loader that transpiles TypeScript config files to JavaScript\n * using esbuild, then executes them to load the configuration.\n *\n * @returns A cosmiconfig Loader function\n */\nexport function createTypeScriptLoader(): Loader {\n\treturn async (filepath: string) => {\n\t\ttry {\n\t\t\t// Use esbuild to transpile TypeScript to JavaScript\n\t\t\tconst esbuild = await import(\"esbuild\");\n\t\t\tconst fs = await import(\"node:fs\");\n\t\t\tconst path = await import(\"node:path\");\n\n\t\t\tconst tsCode = fs.readFileSync(filepath, \"utf-8\");\n\t\t\tconst result = await esbuild.build({\n\t\t\t\tstdin: {\n\t\t\t\t\tcontents: tsCode,\n\t\t\t\t\tloader: \"ts\",\n\t\t\t\t\tresolveDir: path.dirname(filepath),\n\t\t\t\t\tsourcefile: filepath,\n\t\t\t\t},\n\t\t\t\tformat: \"cjs\",\n\t\t\t\tplatform: \"node\",\n\t\t\t\ttarget: \"node18\",\n\t\t\t\tbundle: false,\n\t\t\t\twrite: false,\n\t\t\t});\n\n\t\t\tconst jsCode = result.outputFiles[0].text;\n\n\t\t\t// Create a module and execute it\n\t\t\tconst module = { exports: {} } as any;\n\t\t\tconst func = new Function(\"exports\", \"module\", \"require\", \"__filename\", \"__dirname\", jsCode);\n\t\t\tfunc(module.exports, module, require, filepath, path.dirname(filepath));\n\n\t\t\treturn module.exports.default || module.exports;\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to load TypeScript config from ${filepath}: ${error instanceof Error ? error.message : String(error)}`\n\t\t\t);\n\t\t}\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EACzC,YACC,SACgB,MACA,SACf;AAZH;AAaE,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AACZ,gBAAM,sBAAN,+BAA0B,MAAM,KAAK;AAAA,EACtC;AACD;AAiFO,IAAM,qBAAN,cAAiC,eAAe;AAAA,EACtD,YAAY,SAAiB,SAAmC;AAC/D,UAAM,SAAS,uBAAuB,OAAO;AAC7C,SAAK,OAAO;AAAA,EACb;AACD;;;ACrEA,eAAe,YACd,MACA,OACA,OACA,iBACyB;AAEzB,QAAM,YAAa,KAAa,SAAS;AACzC,QAAM,aAAc,KAAa,UAAU;AAC3C,UAAQ,IAAI,eAAe,QAAQ,CAAC,IAAI,KAAK,KAAK,SAAS,KAAK;AAEhE,MAAI;AACH,UAAM,YAAY,gBAAgB,IAAI;AACtC,cAAU,SAAS;AAEnB,WAAO;AAAA,MACN;AAAA,MACA,SAAS;AAAA,IACV;AAAA,EACD,SAAS,OAAO;AACf,UAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC1E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AAY,CAAC,EAAE;AAGrC,YAAMA,UAAS,EAAE,SAAS,CAAC,EAAE;AAC7B,YAAM,OAAO,IAAI,SAAS,WAAW,UAAU,WAAW,cAAc,aAAa,MAAM;AAC3F,WAAKA,QAAO,SAASA,SAAQ,SAAS,UAAU,KAAK,QAAQ,QAAQ,CAAC;AAEtE,aAAOA,QAAO,QAAQ,WAAWA,QAAO;AAAA,IACzC,SAAS,OAAO;AACf,YAAM,IAAI;AAAA,QACT,yCAAyC,QAAQ,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,MAC7G;AAAA,IACD;AAAA,EACD;AACD;","names":["module"]}
|
|
1
|
+
{"version":3,"sources":["../src/internal.ts","../src/errors.ts","../src/batch-executor.ts","../src/utils/config-schemas.ts","../src/utils/config-validation.ts","../src/utils/lru-cache.ts","../src/utils/name-utils.ts","../src/utils/operation-filters.ts","../src/utils/pattern-utils.ts","../src/utils/string-utils.ts","../src/utils/typescript-loader.ts"],"sourcesContent":["/**\n * Internal utilities shared between @cerios packages\n *\n * ⚠️ WARNING: NOT FOR PUBLIC USE\n *\n * This module exposes internal implementation details that are shared\n * between @cerios/openapi-to-zod and @cerios/openapi-to-zod-playwright.\n *\n * These APIs are NOT considered part of the public API surface and may\n * change without notice in minor or patch versions. Use at your own risk.\n *\n * @internal\n * @packageDocumentation\n */\n\n// Batch execution utilities\nexport { executeBatch, type Generator, getBatchExitCode } from \"./batch-executor\";\n\n// Configuration schemas and validation\nexport type { BaseOperationFilters, RequestResponseOptions } from \"./utils/config-schemas\";\nexport { OperationFiltersSchema, RequestResponseOptionsSchema } from \"./utils/config-schemas\";\nexport { formatConfigValidationError } from \"./utils/config-validation\";\n\n// Caching utilities\nexport { LRUCache } from \"./utils/lru-cache\";\n\n// String and naming utilities\nexport { toCamelCase, toPascalCase } from \"./utils/name-utils\";\n// Operation filtering utilities\nexport {\n\tcreateFilterStatistics,\n\ttype FilterStatistics,\n\tformatFilterStatistics,\n\tshouldIncludeOperation,\n\tvalidateFilters,\n} from \"./utils/operation-filters\";\n// Pattern matching utilities\nexport { stripPathPrefix, stripPrefix } from \"./utils/pattern-utils\";\nexport { escapeJSDoc } from \"./utils/string-utils\";\n\n// TypeScript loading utilities\nexport { createTypeScriptLoader } from \"./utils/typescript-loader\";\n","/**\n * Custom error classes for better error handling and debugging\n */\n\n/**\n * Base error class for all generator errors\n */\nexport class GeneratorError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly code: string,\n\t\tpublic readonly context?: Record<string, unknown>\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"GeneratorError\";\n\t\tError.captureStackTrace?.(this, this.constructor);\n\t}\n}\n\n/**\n * Error thrown when OpenAPI spec validation fails\n */\nexport class SpecValidationError extends GeneratorError {\n\tconstructor(message: string, context?: Record<string, unknown>) {\n\t\tsuper(message, \"SPEC_VALIDATION_ERROR\", context);\n\t\tthis.name = \"SpecValidationError\";\n\t}\n}\n\n/**\n * Error thrown when file operations fail\n */\nexport class FileOperationError extends GeneratorError {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly filePath: string,\n\t\tcontext?: Record<string, unknown>\n\t) {\n\t\tsuper(message, \"FILE_OPERATION_ERROR\", { ...context, filePath });\n\t\tthis.name = \"FileOperationError\";\n\t}\n}\n\n/**\n * Error thrown when config file is invalid\n */\nexport class ConfigValidationError extends GeneratorError {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly configPath?: string,\n\t\tcontext?: Record<string, unknown>\n\t) {\n\t\tsuper(message, \"CONFIG_VALIDATION_ERROR\", { ...context, configPath });\n\t\tthis.name = \"ConfigValidationError\";\n\t}\n}\n\n/**\n * Error thrown when schema generation fails\n */\nexport class SchemaGenerationError extends GeneratorError {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly schemaName: string,\n\t\tcontext?: Record<string, unknown>\n\t) {\n\t\tsuper(message, \"SCHEMA_GENERATION_ERROR\", { ...context, schemaName });\n\t\tthis.name = \"SchemaGenerationError\";\n\t}\n}\n\n/**\n * Error thrown when circular reference is detected in schema\n */\nexport class CircularReferenceError extends SchemaGenerationError {\n\tconstructor(\n\t\tschemaName: string,\n\t\tpublic readonly referencePath: string[]\n\t) {\n\t\tconst pathStr = referencePath.join(\" -> \");\n\t\tsuper(`Circular reference detected in schema: ${pathStr}`, schemaName, { referencePath, circularPath: pathStr });\n\t\tthis.name = \"CircularReferenceError\";\n\t}\n}\n\n/**\n * Error thrown when CLI options are invalid\n */\nexport class CliOptionsError extends GeneratorError {\n\tconstructor(message: string, context?: Record<string, unknown>) {\n\t\tsuper(message, \"CLI_OPTIONS_ERROR\", context);\n\t\tthis.name = \"CliOptionsError\";\n\t}\n}\n\n/**\n * Error thrown when configuration is invalid or missing required values\n */\nexport class ConfigurationError extends GeneratorError {\n\tconstructor(message: string, context?: Record<string, unknown>) {\n\t\tsuper(message, \"CONFIGURATION_ERROR\", context);\n\t\tthis.name = \"ConfigurationError\";\n\t}\n}\n","import { ConfigurationError } from \"./errors\";\nimport type { ExecutionMode } from \"./types\";\n\n/**\n * @shared Generator interface for batch execution\n * @since 1.0.0\n * Interface that both OpenApiGenerator and OpenApiPlaywrightGenerator must implement\n */\nexport interface Generator {\n\tgenerate(): void;\n}\n\n/**\n * Result of processing a single spec\n */\ninterface SpecResult<T> {\n\tspec: T;\n\tsuccess: boolean;\n\terror?: string;\n}\n\n/**\n * Summary of batch execution results\n */\ninterface BatchExecutionSummary<T> {\n\ttotal: number;\n\tsuccessful: number;\n\tfailed: number;\n\tresults: SpecResult<T>[];\n}\n\n/**\n * Process a single spec and return result with error handling\n */\nasync function processSpec<T>(\n\tspec: T,\n\tindex: number,\n\ttotal: number,\n\tcreateGenerator: (spec: T) => Generator\n): Promise<SpecResult<T>> {\n\t// Live progress to stdout\n\tconst specInput = (spec as any).input || \"spec\";\n\tconst specOutput = (spec as any).output || \"output\";\n\tconsole.log(`Processing [${index + 1}/${total}] ${specInput}...`);\n\n\ttry {\n\t\tconst generator = createGenerator(spec);\n\t\tgenerator.generate();\n\n\t\treturn {\n\t\t\tspec,\n\t\t\tsuccess: true,\n\t\t};\n\t} catch (error) {\n\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(`✗ Failed to generate ${specOutput}: ${errorMessage}`);\n\n\t\treturn {\n\t\t\tspec,\n\t\t\tsuccess: false,\n\t\t\terror: errorMessage,\n\t\t};\n\t}\n}\n\n/**\n * Execute specs in parallel using Promise.allSettled with configurable batch size\n * Processes specifications in batches to control memory usage and concurrency\n * Continues processing all specs even if some fail\n */\nasync function executeParallel<T>(\n\tspecs: T[],\n\tcreateGenerator: (spec: T) => Generator,\n\tbatchSize: number\n): Promise<SpecResult<T>[]> {\n\tconsole.log(`\\nExecuting ${specs.length} specification(s) in parallel (batch size: ${batchSize})...\\n`);\n\n\tconst results: SpecResult<T>[] = [];\n\n\t// Process in batches to control memory usage\n\tfor (let i = 0; i < specs.length; i += batchSize) {\n\t\tconst batch = specs.slice(i, Math.min(i + batchSize, specs.length));\n\t\tconst batchPromises = batch.map((spec, batchIndex) =>\n\t\t\tprocessSpec(spec, i + batchIndex, specs.length, createGenerator)\n\t\t);\n\n\t\tconst batchResults = await Promise.allSettled(batchPromises);\n\n\t\t// Convert settled results to SpecResult\n\t\tfor (let j = 0; j < batchResults.length; j++) {\n\t\t\tconst result = batchResults[j];\n\t\t\tif (result.status === \"fulfilled\") {\n\t\t\t\tresults.push(result.value);\n\t\t\t} else {\n\t\t\t\t// Handle unexpected promise rejection\n\t\t\t\tresults.push({\n\t\t\t\t\tspec: batch[j],\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: result.reason instanceof Error ? result.reason.message : String(result.reason),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn results;\n}\n\n/**\n * Execute specs sequentially one at a time\n * Continues processing all specs even if some fail\n */\nasync function executeSequential<T>(specs: T[], createGenerator: (spec: T) => Generator): Promise<SpecResult<T>[]> {\n\tconsole.log(`\\nExecuting ${specs.length} spec(s) sequentially...\\n`);\n\n\tconst results: SpecResult<T>[] = [];\n\n\tfor (let i = 0; i < specs.length; i++) {\n\t\tconst result = await processSpec(specs[i], i, specs.length, createGenerator);\n\t\tresults.push(result);\n\t}\n\n\treturn results;\n}\n\n/**\n * Print final summary of batch execution\n */\nfunction printSummary<T>(summary: BatchExecutionSummary<T>): void {\n\tconsole.log(`\\n${\"=\".repeat(50)}`);\n\tconsole.log(\"Batch Execution Summary\");\n\tconsole.log(\"=\".repeat(50));\n\tconsole.log(`Total specs: ${summary.total}`);\n\tconsole.log(`Successful: ${summary.successful}`);\n\tconsole.log(`Failed: ${summary.failed}`);\n\n\tif (summary.failed > 0) {\n\t\tconsole.log(\"\\nFailed specs:\");\n\t\tfor (const result of summary.results) {\n\t\t\tif (!result.success) {\n\t\t\t\tconst specInput = (result.spec as any).input || \"spec\";\n\t\t\t\tconsole.error(` ✗ ${specInput}`);\n\t\t\t\tconsole.error(` Error: ${result.error}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(`${\"=\".repeat(50)}\\n`);\n}\n\n/**\n * @shared Execute batch processing of multiple specs with custom generator\n * @since 1.0.0\n * Utility used by core and playwright packages\n *\n * @param specs - Array of spec configurations to process\n * @param executionMode - Execution mode: \"parallel\" (default) or \"sequential\"\n * @param createGenerator - Factory function to create generator from spec\n * @param batchSize - Number of specifications to process concurrently in parallel mode\n * @returns BatchExecutionSummary with results\n * @throws Never throws - collects all errors and reports them\n */\nexport async function executeBatch<T>(\n\tspecs: T[],\n\texecutionMode: ExecutionMode = \"parallel\",\n\tcreateGenerator: (spec: T) => Generator,\n\tbatchSize: number\n): Promise<BatchExecutionSummary<T>> {\n\tif (specs.length === 0) {\n\t\tthrow new ConfigurationError(\"No specs provided for batch execution\", { specsCount: 0, executionMode });\n\t}\n\n\tlet results: SpecResult<T>[] = [];\n\n\ttry {\n\t\t// Execute based on mode\n\t\tresults =\n\t\t\texecutionMode === \"parallel\"\n\t\t\t\t? await executeParallel(specs, createGenerator, batchSize)\n\t\t\t\t: await executeSequential(specs, createGenerator);\n\n\t\t// Calculate summary\n\t\tconst summary: BatchExecutionSummary<T> = {\n\t\t\ttotal: results.length,\n\t\t\tsuccessful: results.filter(r => r.success).length,\n\t\t\tfailed: results.filter(r => !r.success).length,\n\t\t\tresults,\n\t\t};\n\n\t\t// Print summary\n\t\tprintSummary(summary);\n\n\t\treturn summary;\n\t} finally {\n\t\t// Memory leak prevention: Clear large result objects and hint GC for large batches\n\t\tif (results.length > batchSize) {\n\t\t\t// Clear spec references to allow GC\n\t\t\tfor (const result of results) {\n\t\t\t\t// Keep only essential info, clear large objects\n\t\t\t\tif (result.spec) {\n\t\t\t\t\t(result.spec as any) = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Hint to V8 garbage collector for large batches (if available)\n\t\t\tif (global.gc) {\n\t\t\t\tglobal.gc();\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Determine exit code based on batch execution results\n * Returns 1 if any spec failed, 0 if all succeeded\n */\nexport function getBatchExitCode<T>(summary: BatchExecutionSummary<T>): number {\n\treturn summary.failed > 0 ? 1 : 0;\n}\n","import { z } from \"zod\";\n\n/**\n * @shared Zod schema for request/response options validation\n * @since 1.0.0\n * Utility used by core and playwright packages\n */\nexport const RequestResponseOptionsSchema = z.strictObject({\n\tmode: z.enum([\"strict\", \"normal\", \"loose\"]).optional(),\n\tuseDescribe: z.boolean().optional(),\n\tincludeDescriptions: z.boolean().optional(),\n});\n\n/**\n * @shared Base Zod schema for operation filters (without status codes)\n * @since 1.0.0\n * Utility used by core and playwright packages\n */\nexport const OperationFiltersSchema = z.strictObject({\n\tincludeTags: z.array(z.string()).optional(),\n\texcludeTags: z.array(z.string()).optional(),\n\tincludePaths: z.array(z.string()).optional(),\n\texcludePaths: z.array(z.string()).optional(),\n\tincludeMethods: z.array(z.string()).optional(),\n\texcludeMethods: z.array(z.string()).optional(),\n\tincludeOperationIds: z.array(z.string()).optional(),\n\texcludeOperationIds: z.array(z.string()).optional(),\n\texcludeDeprecated: z.boolean().optional(),\n});\n\n/**\n * Inferred TypeScript type for request/response options\n */\nexport type RequestResponseOptions = z.infer<typeof RequestResponseOptionsSchema>;\n\n/**\n * Inferred TypeScript type for base operation filters\n */\nexport type BaseOperationFilters = z.infer<typeof OperationFiltersSchema>;\n","import { z } from \"zod\";\n\n/**\n * @shared Format Zod validation errors into user-friendly error messages\n * @since 1.0.0\n * Utility used by core and playwright packages\n *\n * @param error - The Zod validation error\n * @param filepath - Path to the config file that was being validated\n * @param configPath - Optional explicit config path provided by user\n * @param additionalNotes - Optional array of additional notes to append to the error message\n * @returns Formatted error message string\n */\nexport function formatConfigValidationError(\n\terror: z.ZodError,\n\tfilepath: string | undefined,\n\tconfigPath: string | undefined,\n\tadditionalNotes?: string[]\n): string {\n\tconst formattedErrors =\n\t\terror.issues\n\t\t\t?.map(err => {\n\t\t\t\tconst path = err.path.length > 0 ? err.path.join(\".\") : \"root\";\n\t\t\t\treturn ` - ${path}: ${err.message}`;\n\t\t\t})\n\t\t\t.join(\"\\n\") || \"Unknown validation error\";\n\n\tconst configSource = filepath || configPath || \"config file\";\n\tconst lines = [\n\t\t`Invalid configuration file at: ${configSource}`,\n\t\t\"\",\n\t\t\"Validation errors:\",\n\t\tformattedErrors,\n\t\t\"\",\n\t\t\"Please check your configuration file and ensure:\",\n\t\t\" - All required fields are present (specs array with input/output)\",\n\t\t\" - Field names are spelled correctly (no typos)\",\n\t\t\" - Values match the expected types (e.g., mode: 'strict' | 'normal' | 'loose')\",\n\t\t\" - No unknown/extra properties are included\",\n\t];\n\n\tif (additionalNotes && additionalNotes.length > 0) {\n\t\tlines.push(...additionalNotes.map(note => ` - ${note}`));\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n","/**\n * @shared Simple LRU Cache implementation for performance optimization\n * @since 1.0.0\n * Utility used by core and playwright packages\n * Prevents memory leaks from unbounded cache growth\n */\nexport class LRUCache<K, V> {\n\tprivate cache = new Map<K, V>();\n\tprivate maxSize: number;\n\n\tconstructor(maxSize: number) {\n\t\tthis.maxSize = maxSize;\n\t}\n\n\tget capacity(): number {\n\t\treturn this.maxSize;\n\t}\n\n\tget(key: K): V | undefined {\n\t\tif (!this.cache.has(key)) return undefined;\n\t\t// Move to end (most recently used)\n\t\tconst value = this.cache.get(key);\n\t\tif (value === undefined) return undefined;\n\t\tthis.cache.delete(key);\n\t\tthis.cache.set(key, value);\n\t\treturn value;\n\t}\n\n\tset(key: K, value: V): void {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key);\n\t\t} else if (this.cache.size >= this.maxSize) {\n\t\t\t// Remove least recently used (first item)\n\t\t\tconst firstKey = this.cache.keys().next().value;\n\t\t\tif (firstKey !== undefined) {\n\t\t\t\tthis.cache.delete(firstKey);\n\t\t\t}\n\t\t}\n\t\tthis.cache.set(key, value);\n\t}\n\n\thas(key: K): boolean {\n\t\treturn this.cache.has(key);\n\t}\n\n\tclear(): void {\n\t\tthis.cache.clear();\n\t}\n\n\tsize(): number {\n\t\treturn this.cache.size;\n\t}\n}\n","/**\n * Name conversion utilities\n */\n\nexport interface NamingOptions {\n\tprefix?: string;\n\tsuffix?: string;\n}\n\n/**\n * Sanitize a string by replacing invalid identifier characters with underscores\n * Preserves dots, hyphens, underscores, and spaces as word separators\n * Example: \"User@Domain\" -> \"User_Domain\"\n * Example: \"User-Data@2024\" -> \"User-Data_2024\"\n */\nfunction sanitizeIdentifier(str: string): string {\n\t// Replace all non-identifier chars (except dots, hyphens, underscores, spaces) with underscores\n\t// Valid identifier chars: letters, digits, underscore\n\t// Preserve: dots, hyphens, underscores, spaces as word separators\n\treturn str.replace(/[^a-zA-Z0-9._\\-\\s]+/g, \"_\");\n}\n\n/**\n * Convert schema name to camelCase with optional prefix/suffix\n * Handles dotted names like \"Company.Models.User\" -> \"companyModelsUser\"\n */\nexport function toCamelCase(str: string, options?: NamingOptions): string {\n\t// Sanitize invalid characters first\n\tconst sanitized = sanitizeIdentifier(str);\n\n\t// Split by dots, hyphens, underscores, and spaces to get words\n\tconst words = sanitized.split(/[.\\-_\\s]+/).filter(word => word.length > 0);\n\n\t// Convert to camelCase: first word lowercase, rest PascalCase\n\tlet name: string;\n\tif (words.length === 0) {\n\t\tname = str.charAt(0).toLowerCase() + str.slice(1);\n\t} else if (words.length === 1) {\n\t\tname = words[0].charAt(0).toLowerCase() + words[0].slice(1);\n\t} else {\n\t\tname =\n\t\t\twords[0].charAt(0).toLowerCase() +\n\t\t\twords[0].slice(1) +\n\t\t\twords\n\t\t\t\t.slice(1)\n\t\t\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t\t\t.join(\"\");\n\t}\n\n\t// Add prefix\n\tif (options?.prefix) {\n\t\tconst prefix = options.prefix.toLowerCase();\n\t\tname = prefix + name.charAt(0).toUpperCase() + name.slice(1);\n\t}\n\n\t// Add suffix before \"Schema\"\n\tif (options?.suffix) {\n\t\tconst suffix = options.suffix;\n\t\tname = name + suffix.charAt(0).toUpperCase() + suffix.slice(1).toLowerCase();\n\t}\n\n\treturn name;\n}\n\n/**\n * @shared Convert enum value to PascalCase and sanitize for TypeScript enum keys\n * @since 1.0.0\n * Utility used by core and playwright packages\n * Handles dotted names like \"Company.Models.User\" -> \"CompanyModelsUser\"\n */\nexport function toPascalCase(str: string | number): string {\n\tconst stringValue = String(str);\n\n\t// Check if it's already a valid PascalCase or camelCase identifier\n\t// (only contains letters, digits, and no special characters)\n\tconst isAlreadyValidCase = /^[a-zA-Z][a-zA-Z0-9]*$/.test(stringValue);\n\n\tif (isAlreadyValidCase) {\n\t\t// Just ensure it starts with uppercase\n\t\treturn stringValue.charAt(0).toUpperCase() + stringValue.slice(1);\n\t}\n\n\t// Sanitize invalid characters first\n\tconst sanitized = sanitizeIdentifier(stringValue);\n\n\t// Split by dots, hyphens, underscores, and spaces to get words\n\tconst words = sanitized.split(/[.\\-_\\s]+/).filter(word => word.length > 0);\n\n\t// Convert all words to PascalCase\n\tlet result: string;\n\tif (words.length === 0) {\n\t\tresult = \"Value\";\n\t} else {\n\t\tresult = words.map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(\"\");\n\t}\n\n\t// Enum keys can't start with a number - prefix with 'N'\n\tif (/^\\d/.test(result)) {\n\t\tresult = `N${result}`;\n\t}\n\n\t// If result is empty or only underscores, use a default\n\tif (!result || /^_+$/.test(result)) {\n\t\treturn \"Value\";\n\t}\n\n\treturn result;\n}\n\n/**\n * Resolve $ref to schema name\n */\nexport function resolveRef(ref: string): string {\n\tconst parts = ref.split(\"/\");\n\treturn parts[parts.length - 1];\n}\n","import { minimatch } from \"minimatch\";\nimport type { OperationFilters } from \"../types\";\n\n/**\n * Filter statistics to track which operations were included/excluded\n */\nexport interface FilterStatistics {\n\ttotalOperations: number;\n\tincludedOperations: number;\n\tfilteredByTags: number;\n\tfilteredByPaths: number;\n\tfilteredByMethods: number;\n\tfilteredByOperationIds: number;\n\tfilteredByDeprecated: number;\n}\n\n/**\n * Create a new filter statistics object with all counters initialized to zero\n */\nexport function createFilterStatistics(): FilterStatistics {\n\treturn {\n\t\ttotalOperations: 0,\n\t\tincludedOperations: 0,\n\t\tfilteredByTags: 0,\n\t\tfilteredByPaths: 0,\n\t\tfilteredByMethods: 0,\n\t\tfilteredByOperationIds: 0,\n\t\tfilteredByDeprecated: 0,\n\t};\n}\n\n/**\n * Check if a value matches any of the patterns (supports glob patterns)\n * Empty patterns array = no constraint (returns true)\n */\nfunction matchesAnyPattern(value: string | undefined, patterns: string[] | undefined): boolean {\n\tif (!patterns || patterns.length === 0) {\n\t\treturn false; // No constraint means \"don't use this filter\"\n\t}\n\tif (!value) {\n\t\treturn false;\n\t}\n\treturn patterns.some(pattern => minimatch(value, pattern));\n}\n\n/**\n * Check if an array contains any of the specified values\n * Empty values array = no constraint (returns false)\n */\nfunction containsAny(arr: string[] | undefined, values: string[] | undefined): boolean {\n\tif (!values || values.length === 0) {\n\t\treturn false; // No constraint means \"don't use this filter\"\n\t}\n\tif (!arr || arr.length === 0) {\n\t\treturn false;\n\t}\n\treturn values.some(value => arr.includes(value));\n}\n\n/**\n * Determine if an operation should be included based on filter criteria\n *\n * Filter logic:\n * 1. If no filters specified, include all operations\n * 2. Empty arrays are treated as \"no constraint\" (not as \"exclude all\")\n * 3. Include filters are applied first (allowlist)\n * 4. Exclude filters are applied second (blocklist)\n * 5. Exclude rules always win over include rules\n *\n * @param operation - The OpenAPI operation object\n * @param path - The operation path (e.g., \"/users/{id}\")\n * @param method - The HTTP method (e.g., \"get\", \"post\")\n * @param filters - Optional filter configuration\n * @param stats - Optional statistics object to track filtering reasons\n * @returns true if the operation should be included, false otherwise\n */\nexport function shouldIncludeOperation(\n\toperation: any,\n\tpath: string,\n\tmethod: string,\n\tfilters?: OperationFilters,\n\tstats?: FilterStatistics\n): boolean {\n\t// If no filters specified, include all operations\n\tif (!filters) {\n\t\treturn true;\n\t}\n\n\tconst methodLower = method.toLowerCase();\n\tconst operationId = operation?.operationId;\n\tconst tags = operation?.tags || [];\n\tconst deprecated = operation?.deprecated === true;\n\n\t// Apply include filters first (allowlist)\n\t// If any include filter is specified and the operation doesn't match, exclude it\n\n\t// Check includeTags\n\tif (filters.includeTags && filters.includeTags.length > 0) {\n\t\tif (!containsAny(tags, filters.includeTags)) {\n\t\t\tif (stats) stats.filteredByTags++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check includePaths\n\tif (filters.includePaths && filters.includePaths.length > 0) {\n\t\tif (!matchesAnyPattern(path, filters.includePaths)) {\n\t\t\tif (stats) stats.filteredByPaths++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check includeMethods\n\tif (filters.includeMethods && filters.includeMethods.length > 0) {\n\t\tconst methodsLower = filters.includeMethods.map(m => m.toLowerCase());\n\t\tif (!methodsLower.includes(methodLower)) {\n\t\t\tif (stats) stats.filteredByMethods++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check includeOperationIds\n\tif (filters.includeOperationIds && filters.includeOperationIds.length > 0) {\n\t\tif (!matchesAnyPattern(operationId, filters.includeOperationIds)) {\n\t\t\tif (stats) stats.filteredByOperationIds++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Apply exclude filters second (blocklist)\n\t// If the operation matches any exclude filter, exclude it\n\n\t// Check excludeDeprecated\n\tif (filters.excludeDeprecated === true && deprecated) {\n\t\tif (stats) stats.filteredByDeprecated++;\n\t\treturn false;\n\t}\n\n\t// Check excludeTags\n\tif (filters.excludeTags && filters.excludeTags.length > 0) {\n\t\tif (containsAny(tags, filters.excludeTags)) {\n\t\t\tif (stats) stats.filteredByTags++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check excludePaths\n\tif (filters.excludePaths && filters.excludePaths.length > 0) {\n\t\tif (matchesAnyPattern(path, filters.excludePaths)) {\n\t\t\tif (stats) stats.filteredByPaths++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check excludeMethods\n\tif (filters.excludeMethods && filters.excludeMethods.length > 0) {\n\t\tconst methodsLower = filters.excludeMethods.map(m => m.toLowerCase());\n\t\tif (methodsLower.includes(methodLower)) {\n\t\t\tif (stats) stats.filteredByMethods++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Check excludeOperationIds\n\tif (filters.excludeOperationIds && filters.excludeOperationIds.length > 0) {\n\t\tif (matchesAnyPattern(operationId, filters.excludeOperationIds)) {\n\t\t\tif (stats) stats.filteredByOperationIds++;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Operation passed all filters\n\treturn true;\n}\n\n/**\n * Validate filter statistics and emit warnings for filters that matched nothing\n * Helps users debug filter configurations that might be too restrictive or contain typos\n *\n * @param stats - Filter statistics object\n * @param filters - The filter configuration to validate\n */\nexport function validateFilters(stats: FilterStatistics, filters?: OperationFilters): void {\n\tif (!filters || stats.totalOperations === 0) {\n\t\treturn;\n\t}\n\n\t// If all operations were filtered out, emit a warning\n\tif (stats.includedOperations === 0) {\n\t\tconsole.warn(\n\t\t\t`⚠️ Warning: All ${stats.totalOperations} operations were filtered out. Check your operationFilters configuration.`\n\t\t);\n\n\t\t// Provide specific guidance about which filters might be the issue\n\t\tconst filterBreakdown: string[] = [];\n\t\tif (stats.filteredByTags > 0) filterBreakdown.push(`${stats.filteredByTags} by tags`);\n\t\tif (stats.filteredByPaths > 0) filterBreakdown.push(`${stats.filteredByPaths} by paths`);\n\t\tif (stats.filteredByMethods > 0) filterBreakdown.push(`${stats.filteredByMethods} by methods`);\n\t\tif (stats.filteredByOperationIds > 0) filterBreakdown.push(`${stats.filteredByOperationIds} by operationIds`);\n\t\tif (stats.filteredByDeprecated > 0) filterBreakdown.push(`${stats.filteredByDeprecated} by deprecated flag`);\n\n\t\tif (filterBreakdown.length > 0) {\n\t\t\tconsole.warn(` Filtered: ${filterBreakdown.join(\", \")}`);\n\t\t}\n\t}\n}\n\n/**\n * Format filter statistics for display in generated output\n * Returns a formatted string suitable for inclusion in comments\n *\n * @param stats - Filter statistics object\n * @returns Formatted statistics string\n */\nexport function formatFilterStatistics(stats: FilterStatistics): string {\n\tif (stats.totalOperations === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst lines: string[] = [];\n\tlines.push(\"Operation Filtering:\");\n\tlines.push(` Total operations: ${stats.totalOperations}`);\n\tlines.push(` Included operations: ${stats.includedOperations}`);\n\n\tconst filteredCount =\n\t\tstats.filteredByTags +\n\t\tstats.filteredByPaths +\n\t\tstats.filteredByMethods +\n\t\tstats.filteredByOperationIds +\n\t\tstats.filteredByDeprecated;\n\n\tif (filteredCount > 0) {\n\t\tlines.push(` Filtered operations: ${filteredCount}`);\n\t\tif (stats.filteredByTags > 0) lines.push(` - By tags: ${stats.filteredByTags}`);\n\t\tif (stats.filteredByPaths > 0) lines.push(` - By paths: ${stats.filteredByPaths}`);\n\t\tif (stats.filteredByMethods > 0) lines.push(` - By methods: ${stats.filteredByMethods}`);\n\t\tif (stats.filteredByOperationIds > 0) lines.push(` - By operationIds: ${stats.filteredByOperationIds}`);\n\t\tif (stats.filteredByDeprecated > 0) lines.push(` - By deprecated: ${stats.filteredByDeprecated}`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n","import { minimatch } from \"minimatch\";\n\n/**\n * Pattern matching utilities for prefix stripping\n *\n * Shared utility used by core and playwright packages\n *\n * Supports both literal string matching and glob patterns for stripping\n * prefixes from strings (paths, schema names, etc.)\n */\n\n/**\n * Validates if a glob pattern is syntactically valid\n * @param pattern - The glob pattern to validate\n * @returns true if valid, false otherwise\n */\nfunction isValidGlobPattern(pattern: string): boolean {\n\ttry {\n\t\t// Try to create a minimatch instance to validate the pattern\n\t\tnew minimatch.Minimatch(pattern);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * Checks if a pattern contains glob special characters\n * @param pattern - The pattern to check\n * @returns true if pattern contains glob wildcards\n */\nfunction isGlobPattern(pattern: string): boolean {\n\treturn /[*?[\\]{}!]/.test(pattern);\n}\n\n/**\n * @shared Strips a prefix from a string using either literal string matching or glob patterns\n * @since 1.1.0\n * Shared utility used by core and playwright packages\n *\n * @param input - The full string to strip from\n * @param pattern - The glob pattern to strip\n * @param ensureLeadingChar - Optional character to ensure at start (e.g., \"/\" for paths)\n * @returns The string with prefix removed, or original string if no match\n *\n * @example\n * // Literal string matching\n * stripPrefix(\"/api/v1/users\", \"/api/v1\") // => \"/users\"\n * stripPrefix(\"Company.Models.User\", \"Company.Models.\") // => \"User\"\n *\n * @example\n * // Glob pattern matching\n * stripPrefix(\"/api/v1.0/users\", \"/api/v*\") // => matches and strips\n * stripPrefix(\"Company.Models.User\", \"*.Models.\") // => \"User\"\n * stripPrefix(\"api_v2_UserSchema\", \"api_v[0-9]_\") // => \"UserSchema\"\n */\nexport function stripPrefix(input: string, pattern: string | undefined, ensureLeadingChar?: string): string {\n\tif (!pattern) {\n\t\treturn input;\n\t}\n\n\t// Validate glob pattern if it contains special characters\n\tif (isGlobPattern(pattern) && !isValidGlobPattern(pattern)) {\n\t\tconsole.warn(`⚠️ Invalid glob pattern \"${pattern}\": Pattern is malformed`);\n\t\treturn input;\n\t}\n\n\t// Check if pattern contains glob wildcards\n\tif (isGlobPattern(pattern)) {\n\t\t// Use glob matching to find the prefix\n\t\t// We need to find what part of the input matches the pattern as a prefix\n\t\t// Try matching progressively longer prefixes to find the longest match\n\t\tlet longestMatch = -1;\n\n\t\tfor (let i = 1; i <= input.length; i++) {\n\t\t\tconst testPrefix = input.substring(0, i);\n\t\t\tif (minimatch(testPrefix, pattern)) {\n\t\t\t\t// Found a match - keep looking for a longer match\n\t\t\t\tlongestMatch = i;\n\t\t\t}\n\t\t}\n\n\t\tif (longestMatch > 0) {\n\t\t\t// Strip the longest matching prefix\n\t\t\tconst stripped = input.substring(longestMatch);\n\n\t\t\t// Ensure result starts with specified character if provided\n\t\t\tif (ensureLeadingChar) {\n\t\t\t\tif (stripped === \"\") {\n\t\t\t\t\treturn ensureLeadingChar;\n\t\t\t\t}\n\t\t\t\tif (!stripped.startsWith(ensureLeadingChar)) {\n\t\t\t\t\treturn `${ensureLeadingChar}${stripped}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn stripped === \"\" && !ensureLeadingChar ? input : stripped;\n\t\t}\n\n\t\t// No match found\n\t\treturn input;\n\t}\n\n\t// Literal string matching\n\tif (input.startsWith(pattern)) {\n\t\tconst stripped = input.substring(pattern.length);\n\n\t\t// Ensure result starts with specified character if provided\n\t\tif (ensureLeadingChar) {\n\t\t\tif (stripped === \"\") {\n\t\t\t\treturn ensureLeadingChar;\n\t\t\t}\n\t\t\tif (!stripped.startsWith(ensureLeadingChar)) {\n\t\t\t\treturn `${ensureLeadingChar}${stripped}`;\n\t\t\t}\n\t\t}\n\n\t\treturn stripped;\n\t}\n\n\t// No match - return original input\n\treturn input;\n}\n\n/**\n * @shared Strips a prefix from a path (ensures leading slash)\n * @since 1.1.0\n * Shared utility used by playwright package for path manipulation\n *\n * @param path - The full path to strip from\n * @param pattern - The glob pattern to strip\n * @returns The path with prefix removed, or original path if no match\n *\n * @example\n * stripPathPrefix(\"/api/v1/users\", \"/api/v1\") // => \"/users\"\n * stripPathPrefix(\"/api/v2/posts\", \"/api/v*\") // => \"/posts\"\n * stripPathPrefix(\"/api/v1.0/items\", \"/api/v[0-9].*\") // => \"/items\"\n */\nexport function stripPathPrefix(path: string, pattern: string | undefined): string {\n\tif (!pattern) {\n\t\treturn path;\n\t}\n\n\t// For literal string matching with paths, normalize the pattern\n\tif (!isGlobPattern(pattern)) {\n\t\tlet normalizedPattern = pattern.trim();\n\t\tif (!normalizedPattern.startsWith(\"/\")) {\n\t\t\tnormalizedPattern = `/${normalizedPattern}`;\n\t\t}\n\t\tif (normalizedPattern.endsWith(\"/\") && normalizedPattern !== \"/\") {\n\t\t\tnormalizedPattern = normalizedPattern.slice(0, -1);\n\t\t}\n\n\t\treturn stripPrefix(path, normalizedPattern, \"/\");\n\t}\n\n\t// For glob patterns, use as-is\n\treturn stripPrefix(path, pattern, \"/\");\n}\n","/**\n * String utility functions for escaping and formatting\n */\n\nimport type { OpenAPISchema } from \"../types\";\n\n/**\n * Escape string for description in .describe()\n */\nexport function escapeDescription(str: string): string {\n\treturn str.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"').replace(/\\n/g, \"\\\\n\");\n}\n\n/**\n * Escape regex pattern for use in code\n * Only escapes forward slashes which would terminate the regex literal\n */\nexport function escapePattern(str: string): string {\n\treturn str.replace(/\\//g, \"\\\\/\");\n}\n\n/**\n * @shared Escape JSDoc comment content to prevent injection\n * @since 1.0.0\n * Utility used by core and playwright packages\n */\nexport function escapeJSDoc(str: string): string {\n\treturn str.replace(/\\*\\//g, \"*\\\\/\");\n}\n\n/**\n * Wrap validation with .nullable() if needed\n */\nexport function wrapNullable(validation: string, isNullable: boolean): string {\n\treturn isNullable ? `${validation}.nullable()` : validation;\n}\n\n/**\n * Check if schema is nullable (supports both OpenAPI 3.0 and 3.1 syntax)\n */\nexport function isNullable(schema: OpenAPISchema): boolean {\n\t// OpenAPI 3.0 style: nullable: true\n\tif (schema.nullable === true) {\n\t\treturn true;\n\t}\n\t// OpenAPI 3.1 style: type can be an array including \"null\"\n\tif (Array.isArray(schema.type)) {\n\t\treturn schema.type.includes(\"null\");\n\t}\n\treturn false;\n}\n\n/**\n * Get the primary type from schema (handles OpenAPI 3.1 type arrays)\n */\nexport function getPrimaryType(schema: OpenAPISchema): string | undefined {\n\tif (Array.isArray(schema.type)) {\n\t\t// OpenAPI 3.1: type can be an array like [\"string\", \"null\"]\n\t\t// Return the first non-null type\n\t\tconst nonNullType = schema.type.find(t => t !== \"null\");\n\t\treturn nonNullType;\n\t}\n\treturn schema.type;\n}\n\n/**\n * Check if schema has multiple non-null types\n */\nexport function hasMultipleTypes(schema: OpenAPISchema): boolean {\n\tif (Array.isArray(schema.type)) {\n\t\tconst nonNullTypes = schema.type.filter(t => t !== \"null\");\n\t\treturn nonNullTypes.length > 1;\n\t}\n\treturn false;\n}\n\n/**\n * Add description to a schema validation string\n */\nexport function addDescription(validation: string, description: string | undefined, useDescribe: boolean): string {\n\tif (!description || !useDescribe) return validation;\n\n\tconst escapedDesc = escapeDescription(description);\n\treturn `${validation}.describe(\"${escapedDesc}\")`;\n}\n","import type { Loader } from \"cosmiconfig\";\n\n/**\n * @shared Create a TypeScript loader for cosmiconfig using esbuild\n * @since 1.0.0\n * Utility used by core and playwright packages\n *\n * Creates a loader that transpiles TypeScript config files to JavaScript\n * using esbuild, then executes them to load the configuration.\n *\n * @returns A cosmiconfig Loader function\n */\nexport function createTypeScriptLoader(): Loader {\n\treturn async (filepath: string) => {\n\t\ttry {\n\t\t\t// Use esbuild to transpile TypeScript to JavaScript\n\t\t\tconst esbuild = await import(\"esbuild\");\n\t\t\tconst fs = await import(\"node:fs\");\n\t\t\tconst path = await import(\"node:path\");\n\n\t\t\tconst tsCode = fs.readFileSync(filepath, \"utf-8\");\n\t\t\tconst result = await esbuild.build({\n\t\t\t\tstdin: {\n\t\t\t\t\tcontents: tsCode,\n\t\t\t\t\tloader: \"ts\",\n\t\t\t\t\tresolveDir: path.dirname(filepath),\n\t\t\t\t\tsourcefile: filepath,\n\t\t\t\t},\n\t\t\t\tformat: \"cjs\",\n\t\t\t\tplatform: \"node\",\n\t\t\t\ttarget: \"node18\",\n\t\t\t\tbundle: false,\n\t\t\t\twrite: false,\n\t\t\t});\n\n\t\t\tconst jsCode = result.outputFiles[0].text;\n\n\t\t\t// Create a module and execute it\n\t\t\tconst module = { exports: {} } as any;\n\t\t\tconst func = new Function(\"exports\", \"module\", \"require\", \"__filename\", \"__dirname\", jsCode);\n\t\t\tfunc(module.exports, module, require, filepath, path.dirname(filepath));\n\n\t\t\treturn module.exports.default || module.exports;\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to load TypeScript config from ${filepath}: ${error instanceof Error ? error.message : String(error)}`\n\t\t\t);\n\t\t}\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EACzC,YACC,SACgB,MACA,SACf;AAZH;AAaE,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AACZ,gBAAM,sBAAN,+BAA0B,MAAM,KAAK;AAAA,EACtC;AACD;AAiFO,IAAM,qBAAN,cAAiC,eAAe;AAAA,EACtD,YAAY,SAAiB,SAAmC;AAC/D,UAAM,SAAS,uBAAuB,OAAO;AAC7C,SAAK,OAAO;AAAA,EACb;AACD;;;ACrEA,eAAe,YACd,MACA,OACA,OACA,iBACyB;AAEzB,QAAM,YAAa,KAAa,SAAS;AACzC,QAAM,aAAc,KAAa,UAAU;AAC3C,UAAQ,IAAI,eAAe,QAAQ,CAAC,IAAI,KAAK,KAAK,SAAS,KAAK;AAEhE,M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