@kubb/agent 5.0.0-alpha.17 → 5.0.0-alpha.19
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +629 -201
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/node_modules/@kubb/fabric-core/package.json +1 -1
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +6 -0
- package/.output/server/node_modules/@kubb/react-fabric/package.json +2 -2
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +22 -2
- package/.output/server/node_modules/@redocly/config/package.json +2 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/all.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/minimal.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended-strict.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/spec.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/ref-utils.js +7 -6
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-mixed-number-range-constraints.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/redocly-yaml.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
- package/.output/server/package.json +5 -5
- package/package.json +17 -17
|
@@ -4456,73 +4456,12 @@ const logger = {
|
|
|
4456
4456
|
const _KZ9YuROWp70nNn4X1C4BxF_W0D7H9EWgBo03XvMd7w0 = defineNitroPlugin(() => {
|
|
4457
4457
|
});
|
|
4458
4458
|
|
|
4459
|
-
var __typeError$d = (msg) => {
|
|
4460
|
-
throw TypeError(msg);
|
|
4461
|
-
};
|
|
4462
|
-
var __accessCheck$d = (obj, member, msg) => member.has(obj) || __typeError$d("Cannot " + msg);
|
|
4463
|
-
var __privateGet$d = (obj, member, getter) => (__accessCheck$d(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
4464
|
-
var __privateAdd$d = (obj, member, value) => member.has(obj) ? __typeError$d("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
4465
|
-
var _emitter$1, _a$d;
|
|
4466
|
-
function toError$1(value) {
|
|
4467
|
-
return value instanceof Error ? value : new Error(String(value));
|
|
4468
|
-
}
|
|
4469
|
-
var AsyncEventEmitter$1 = (_a$d = class {
|
|
4470
|
-
/**
|
|
4471
|
-
* `maxListener` controls the maximum number of listeners per event before Node emits a memory-leak warning.
|
|
4472
|
-
* @default 10
|
|
4473
|
-
*/
|
|
4474
|
-
constructor(maxListener = 10) {
|
|
4475
|
-
__privateAdd$d(this, _emitter$1, new EventEmitter());
|
|
4476
|
-
__privateGet$d(this, _emitter$1).setMaxListeners(maxListener);
|
|
4477
|
-
}
|
|
4478
|
-
/**
|
|
4479
|
-
* Emits an event and awaits all registered listeners in parallel.
|
|
4480
|
-
* Throws if any listener rejects, wrapping the cause with the event name and serialized arguments.
|
|
4481
|
-
*/
|
|
4482
|
-
async emit(eventName, ...eventArgs) {
|
|
4483
|
-
const listeners = __privateGet$d(this, _emitter$1).listeners(eventName);
|
|
4484
|
-
if (listeners.length === 0) return;
|
|
4485
|
-
await Promise.all(listeners.map(async (listener) => {
|
|
4486
|
-
try {
|
|
4487
|
-
return await listener(...eventArgs);
|
|
4488
|
-
} catch (err) {
|
|
4489
|
-
let serializedArgs;
|
|
4490
|
-
try {
|
|
4491
|
-
serializedArgs = JSON.stringify(eventArgs);
|
|
4492
|
-
} catch {
|
|
4493
|
-
serializedArgs = String(eventArgs);
|
|
4494
|
-
}
|
|
4495
|
-
throw new Error(`Error in async listener for "${eventName}" with eventArgs ${serializedArgs}`, { cause: toError$1(err) });
|
|
4496
|
-
}
|
|
4497
|
-
}));
|
|
4498
|
-
}
|
|
4499
|
-
/** Registers a persistent listener for the given event. */
|
|
4500
|
-
on(eventName, handler) {
|
|
4501
|
-
__privateGet$d(this, _emitter$1).on(eventName, handler);
|
|
4502
|
-
}
|
|
4503
|
-
/** Registers a one-shot listener that removes itself after the first invocation. */
|
|
4504
|
-
onOnce(eventName, handler) {
|
|
4505
|
-
const wrapper = (...args) => {
|
|
4506
|
-
this.off(eventName, wrapper);
|
|
4507
|
-
return handler(...args);
|
|
4508
|
-
};
|
|
4509
|
-
this.on(eventName, wrapper);
|
|
4510
|
-
}
|
|
4511
|
-
/** Removes a previously registered listener. */
|
|
4512
|
-
off(eventName, handler) {
|
|
4513
|
-
__privateGet$d(this, _emitter$1).off(eventName, handler);
|
|
4514
|
-
}
|
|
4515
|
-
/** Removes all listeners from every event channel. */
|
|
4516
|
-
removeAll() {
|
|
4517
|
-
__privateGet$d(this, _emitter$1).removeAllListeners();
|
|
4518
|
-
}
|
|
4519
|
-
}, _emitter$1 = new WeakMap(), _a$d);
|
|
4520
4459
|
function formatMs$1(ms) {
|
|
4521
4460
|
if (ms >= 6e4) return `${Math.floor(ms / 6e4)}m ${(ms % 6e4 / 1e3).toFixed(1)}s`;
|
|
4522
4461
|
if (ms >= 1e3) return `${(ms / 1e3).toFixed(2)}s`;
|
|
4523
4462
|
return `${Math.round(ms)}ms`;
|
|
4524
4463
|
}
|
|
4525
|
-
function parseHex
|
|
4464
|
+
function parseHex(color) {
|
|
4526
4465
|
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
4527
4466
|
return Number.isNaN(int) ? {
|
|
4528
4467
|
r: 255,
|
|
@@ -4534,18 +4473,18 @@ function parseHex$2(color) {
|
|
|
4534
4473
|
b: int & 255
|
|
4535
4474
|
};
|
|
4536
4475
|
}
|
|
4537
|
-
function hex
|
|
4538
|
-
const { r, g, b } = parseHex
|
|
4476
|
+
function hex(color) {
|
|
4477
|
+
const { r, g, b } = parseHex(color);
|
|
4539
4478
|
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
|
|
4540
4479
|
}
|
|
4541
4480
|
({
|
|
4542
|
-
lid: hex
|
|
4543
|
-
woodTop: hex
|
|
4544
|
-
woodMid: hex
|
|
4545
|
-
woodBase: hex
|
|
4546
|
-
eye: hex
|
|
4547
|
-
highlight: hex
|
|
4548
|
-
blush: hex
|
|
4481
|
+
lid: hex("#F55A17"),
|
|
4482
|
+
woodTop: hex("#F5A217"),
|
|
4483
|
+
woodMid: hex("#F58517"),
|
|
4484
|
+
woodBase: hex("#B45309"),
|
|
4485
|
+
eye: hex("#FFFFFF"),
|
|
4486
|
+
highlight: hex("#adadc6"),
|
|
4487
|
+
blush: hex("#FDA4AF")
|
|
4549
4488
|
});
|
|
4550
4489
|
function maskString(value, start = 8, end = 4) {
|
|
4551
4490
|
if (value.length <= start + end) return value;
|
|
@@ -4674,23 +4613,6 @@ function camelCase$f(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
|
4674
4613
|
} : {}));
|
|
4675
4614
|
return toCamelOrPascal$f(`${prefix} ${text} ${suffix}`);
|
|
4676
4615
|
}
|
|
4677
|
-
function parseHex$1(color) {
|
|
4678
|
-
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
4679
|
-
return Number.isNaN(int) ? {
|
|
4680
|
-
r: 255,
|
|
4681
|
-
g: 255,
|
|
4682
|
-
b: 255
|
|
4683
|
-
} : {
|
|
4684
|
-
r: int >> 16 & 255,
|
|
4685
|
-
g: int >> 8 & 255,
|
|
4686
|
-
b: int & 255
|
|
4687
|
-
};
|
|
4688
|
-
}
|
|
4689
|
-
function hex$1(color) {
|
|
4690
|
-
const { r, g, b } = parseHex$1(color);
|
|
4691
|
-
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
|
|
4692
|
-
}
|
|
4693
|
-
hex$1("#F55A17"), hex$1("#F5A217"), hex$1("#F58517"), hex$1("#B45309"), hex$1("#FFFFFF"), hex$1("#adadc6"), hex$1("#FDA4AF");
|
|
4694
4616
|
function isValidVarName$c(name) {
|
|
4695
4617
|
try {
|
|
4696
4618
|
new Function(`var ${name}`);
|
|
@@ -4782,9 +4704,9 @@ function createPrinterFactory(getKey) {
|
|
|
4782
4704
|
options: resolvedOptions,
|
|
4783
4705
|
print: (node) => {
|
|
4784
4706
|
const key = getKey(node);
|
|
4785
|
-
if (key === void 0) return
|
|
4707
|
+
if (key === void 0) return null;
|
|
4786
4708
|
const handler = nodes[key];
|
|
4787
|
-
if (!handler) return
|
|
4709
|
+
if (!handler) return null;
|
|
4788
4710
|
return handler.call(context, node);
|
|
4789
4711
|
}
|
|
4790
4712
|
};
|
|
@@ -5098,7 +5020,7 @@ function toError(value) {
|
|
|
5098
5020
|
}
|
|
5099
5021
|
var AsyncEventEmitter = (_a$c = class {
|
|
5100
5022
|
/**
|
|
5101
|
-
*
|
|
5023
|
+
* Maximum number of listeners per event before Node emits a memory-leak warning.
|
|
5102
5024
|
* @default 10
|
|
5103
5025
|
*/
|
|
5104
5026
|
constructor(maxListener = 10) {
|
|
@@ -5106,8 +5028,13 @@ var AsyncEventEmitter = (_a$c = class {
|
|
|
5106
5028
|
__privateGet$c(this, _emitter).setMaxListeners(maxListener);
|
|
5107
5029
|
}
|
|
5108
5030
|
/**
|
|
5109
|
-
* Emits
|
|
5031
|
+
* Emits `eventName` and awaits all registered listeners in parallel.
|
|
5110
5032
|
* Throws if any listener rejects, wrapping the cause with the event name and serialized arguments.
|
|
5033
|
+
*
|
|
5034
|
+
* @example
|
|
5035
|
+
* ```ts
|
|
5036
|
+
* await emitter.emit('build', 'petstore')
|
|
5037
|
+
* ```
|
|
5111
5038
|
*/
|
|
5112
5039
|
async emit(eventName, ...eventArgs) {
|
|
5113
5040
|
const listeners = __privateGet$c(this, _emitter).listeners(eventName);
|
|
@@ -5126,11 +5053,25 @@ var AsyncEventEmitter = (_a$c = class {
|
|
|
5126
5053
|
}
|
|
5127
5054
|
}));
|
|
5128
5055
|
}
|
|
5129
|
-
/**
|
|
5056
|
+
/**
|
|
5057
|
+
* Registers a persistent listener for `eventName`.
|
|
5058
|
+
*
|
|
5059
|
+
* @example
|
|
5060
|
+
* ```ts
|
|
5061
|
+
* emitter.on('build', async (name) => { console.log(name) })
|
|
5062
|
+
* ```
|
|
5063
|
+
*/
|
|
5130
5064
|
on(eventName, handler) {
|
|
5131
5065
|
__privateGet$c(this, _emitter).on(eventName, handler);
|
|
5132
5066
|
}
|
|
5133
|
-
/**
|
|
5067
|
+
/**
|
|
5068
|
+
* Registers a one-shot listener that removes itself after the first invocation.
|
|
5069
|
+
*
|
|
5070
|
+
* @example
|
|
5071
|
+
* ```ts
|
|
5072
|
+
* emitter.onOnce('build', async (name) => { console.log(name) })
|
|
5073
|
+
* ```
|
|
5074
|
+
*/
|
|
5134
5075
|
onOnce(eventName, handler) {
|
|
5135
5076
|
const wrapper = (...args) => {
|
|
5136
5077
|
this.off(eventName, wrapper);
|
|
@@ -5138,11 +5079,25 @@ var AsyncEventEmitter = (_a$c = class {
|
|
|
5138
5079
|
};
|
|
5139
5080
|
this.on(eventName, wrapper);
|
|
5140
5081
|
}
|
|
5141
|
-
/**
|
|
5082
|
+
/**
|
|
5083
|
+
* Removes a previously registered listener.
|
|
5084
|
+
*
|
|
5085
|
+
* @example
|
|
5086
|
+
* ```ts
|
|
5087
|
+
* emitter.off('build', handler)
|
|
5088
|
+
* ```
|
|
5089
|
+
*/
|
|
5142
5090
|
off(eventName, handler) {
|
|
5143
5091
|
__privateGet$c(this, _emitter).off(eventName, handler);
|
|
5144
5092
|
}
|
|
5145
|
-
/**
|
|
5093
|
+
/**
|
|
5094
|
+
* Removes all listeners from every event channel.
|
|
5095
|
+
*
|
|
5096
|
+
* @example
|
|
5097
|
+
* ```ts
|
|
5098
|
+
* emitter.removeAll()
|
|
5099
|
+
* ```
|
|
5100
|
+
*/
|
|
5146
5101
|
removeAll() {
|
|
5147
5102
|
__privateGet$c(this, _emitter).removeAllListeners();
|
|
5148
5103
|
}
|
|
@@ -5182,23 +5137,6 @@ function formatMs(ms) {
|
|
|
5182
5137
|
if (ms >= 1e3) return `${(ms / 1e3).toFixed(2)}s`;
|
|
5183
5138
|
return `${Math.round(ms)}ms`;
|
|
5184
5139
|
}
|
|
5185
|
-
function parseHex(color) {
|
|
5186
|
-
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
5187
|
-
return Number.isNaN(int) ? {
|
|
5188
|
-
r: 255,
|
|
5189
|
-
g: 255,
|
|
5190
|
-
b: 255
|
|
5191
|
-
} : {
|
|
5192
|
-
r: int >> 16 & 255,
|
|
5193
|
-
g: int >> 8 & 255,
|
|
5194
|
-
b: int & 255
|
|
5195
|
-
};
|
|
5196
|
-
}
|
|
5197
|
-
function hex(color) {
|
|
5198
|
-
const { r, g, b } = parseHex(color);
|
|
5199
|
-
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
|
|
5200
|
-
}
|
|
5201
|
-
hex("#F55A17"), hex("#F5A217"), hex("#F58517"), hex("#B45309"), hex("#FFFFFF"), hex("#adadc6"), hex("#FDA4AF");
|
|
5202
5140
|
function toSlash(p) {
|
|
5203
5141
|
if (p.startsWith("\\\\?\\")) return p;
|
|
5204
5142
|
return p.replaceAll("\\", "/");
|
|
@@ -5217,16 +5155,16 @@ function readSync(path2) {
|
|
|
5217
5155
|
}
|
|
5218
5156
|
async function write(path2, data, options = {}) {
|
|
5219
5157
|
const trimmed = data.trim();
|
|
5220
|
-
if (trimmed === "") return
|
|
5158
|
+
if (trimmed === "") return null;
|
|
5221
5159
|
const resolved = resolve(path2);
|
|
5222
5160
|
if (typeof Bun !== "undefined") {
|
|
5223
5161
|
const file = Bun.file(resolved);
|
|
5224
|
-
if ((await file.exists() ? await file.text() : null) === trimmed) return
|
|
5162
|
+
if ((await file.exists() ? await file.text() : null) === trimmed) return null;
|
|
5225
5163
|
await Bun.write(resolved, trimmed);
|
|
5226
5164
|
return trimmed;
|
|
5227
5165
|
}
|
|
5228
5166
|
try {
|
|
5229
|
-
if (await readFile$1(resolved, { encoding: "utf-8" }) === trimmed) return
|
|
5167
|
+
if (await readFile$1(resolved, { encoding: "utf-8" }) === trimmed) return null;
|
|
5230
5168
|
} catch {
|
|
5231
5169
|
}
|
|
5232
5170
|
await mkdir(dirname(resolved), { recursive: true });
|
|
@@ -5362,17 +5300,32 @@ function isValidVarName$b(name) {
|
|
|
5362
5300
|
var URLPath$a = (_b$2 = class {
|
|
5363
5301
|
constructor(path2, options = {}) {
|
|
5364
5302
|
__privateAdd$c(this, _URLPath_instances$a);
|
|
5365
|
-
/**
|
|
5303
|
+
/**
|
|
5304
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
5305
|
+
*/
|
|
5366
5306
|
__publicField$b(this, "path");
|
|
5367
5307
|
__privateAdd$c(this, _options$c);
|
|
5368
5308
|
this.path = path2;
|
|
5369
5309
|
__privateSet$c(this, _options$c, options);
|
|
5370
5310
|
}
|
|
5371
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
5311
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
5312
|
+
*
|
|
5313
|
+
* @example
|
|
5314
|
+
* ```ts
|
|
5315
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
5316
|
+
* ```
|
|
5317
|
+
*/
|
|
5372
5318
|
get URL() {
|
|
5373
5319
|
return this.toURLPath();
|
|
5374
5320
|
}
|
|
5375
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
5321
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
5322
|
+
*
|
|
5323
|
+
* @example
|
|
5324
|
+
* ```ts
|
|
5325
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
5326
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
5327
|
+
* ```
|
|
5328
|
+
*/
|
|
5376
5329
|
get isURL() {
|
|
5377
5330
|
try {
|
|
5378
5331
|
return !!new URL(this.path).href;
|
|
@@ -5390,11 +5343,25 @@ var URLPath$a = (_b$2 = class {
|
|
|
5390
5343
|
get template() {
|
|
5391
5344
|
return this.toTemplateString();
|
|
5392
5345
|
}
|
|
5393
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
5346
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
5347
|
+
*
|
|
5348
|
+
* @example
|
|
5349
|
+
* ```ts
|
|
5350
|
+
* new URLPath('/pet/{petId}').object
|
|
5351
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
5352
|
+
* ```
|
|
5353
|
+
*/
|
|
5394
5354
|
get object() {
|
|
5395
5355
|
return this.toObject();
|
|
5396
5356
|
}
|
|
5397
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
5357
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
5358
|
+
*
|
|
5359
|
+
* @example
|
|
5360
|
+
* ```ts
|
|
5361
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
5362
|
+
* new URLPath('/pet').params // undefined
|
|
5363
|
+
* ```
|
|
5364
|
+
*/
|
|
5398
5365
|
get params() {
|
|
5399
5366
|
return this.getParams();
|
|
5400
5367
|
}
|
|
@@ -5428,6 +5395,12 @@ var URLPath$a = (_b$2 = class {
|
|
|
5428
5395
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
5429
5396
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
5430
5397
|
* Returns `undefined` when no path parameters are found.
|
|
5398
|
+
*
|
|
5399
|
+
* @example
|
|
5400
|
+
* ```ts
|
|
5401
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
5402
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
5403
|
+
* ```
|
|
5431
5404
|
*/
|
|
5432
5405
|
getParams(replacer) {
|
|
5433
5406
|
const params = {};
|
|
@@ -5437,14 +5410,22 @@ var URLPath$a = (_b$2 = class {
|
|
|
5437
5410
|
});
|
|
5438
5411
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
5439
5412
|
}
|
|
5440
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
5413
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
5414
|
+
*
|
|
5415
|
+
* @example
|
|
5416
|
+
* ```ts
|
|
5417
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
5418
|
+
* ```
|
|
5419
|
+
*/
|
|
5441
5420
|
toURLPath() {
|
|
5442
5421
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
5443
5422
|
}
|
|
5444
5423
|
}, _options$c = new WeakMap(), _URLPath_instances$a = new WeakSet(), transformParam_fn$a = function(raw) {
|
|
5445
5424
|
const param = isValidVarName$b(raw) ? raw : camelCase$e(raw);
|
|
5446
5425
|
return __privateGet$c(this, _options$c).casing === "camelcase" ? camelCase$e(param) : param;
|
|
5447
|
-
}, /**
|
|
5426
|
+
}, /**
|
|
5427
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
5428
|
+
*/
|
|
5448
5429
|
eachParam_fn$a = function(fn) {
|
|
5449
5430
|
for (const match2 of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
5450
5431
|
const raw = match2[1];
|
|
@@ -6126,7 +6107,7 @@ const fsStorage = createStorage(() => ({
|
|
|
6126
6107
|
await clean(resolve(base));
|
|
6127
6108
|
}
|
|
6128
6109
|
}));
|
|
6129
|
-
var version$1 = "5.0.0-alpha.
|
|
6110
|
+
var version$1 = "5.0.0-alpha.19";
|
|
6130
6111
|
function getDiagnosticInfo() {
|
|
6131
6112
|
return {
|
|
6132
6113
|
nodeVersion: version$2,
|
|
@@ -6684,6 +6665,7 @@ async function detectFormatter() {
|
|
|
6684
6665
|
"prettier"
|
|
6685
6666
|
]);
|
|
6686
6667
|
for (const formatter of formatterNames) if (await isFormatterAvailable(formatter)) return formatter;
|
|
6668
|
+
return null;
|
|
6687
6669
|
}
|
|
6688
6670
|
var TreeNode = (_f = class {
|
|
6689
6671
|
constructor(data, parent) {
|
|
@@ -6700,10 +6682,18 @@ var TreeNode = (_f = class {
|
|
|
6700
6682
|
this.children.push(child);
|
|
6701
6683
|
return child;
|
|
6702
6684
|
}
|
|
6685
|
+
/**
|
|
6686
|
+
* Returns the root ancestor of this node, walking up via `parent` links.
|
|
6687
|
+
*/
|
|
6703
6688
|
get root() {
|
|
6704
6689
|
if (!this.parent) return this;
|
|
6705
6690
|
return this.parent.root;
|
|
6706
6691
|
}
|
|
6692
|
+
/**
|
|
6693
|
+
* Returns all leaf descendants (nodes with no children) of this node.
|
|
6694
|
+
*
|
|
6695
|
+
* Results are cached after the first traversal.
|
|
6696
|
+
*/
|
|
6707
6697
|
get leaves() {
|
|
6708
6698
|
if (!this.children || this.children.length === 0) return [this];
|
|
6709
6699
|
if (__privateGet$c(this, _cachedLeaves)) return __privateGet$c(this, _cachedLeaves);
|
|
@@ -6734,6 +6724,12 @@ var TreeNode = (_f = class {
|
|
|
6734
6724
|
if (typeof callback !== "function") throw new TypeError("map() callback must be a function");
|
|
6735
6725
|
return this.leaves.map(callback);
|
|
6736
6726
|
}
|
|
6727
|
+
/**
|
|
6728
|
+
* Builds a {@link TreeNode} tree from a flat list of files.
|
|
6729
|
+
*
|
|
6730
|
+
* - Filters to files under `root` (when provided) and skips `.json` files.
|
|
6731
|
+
* - Returns `null` when no files match.
|
|
6732
|
+
*/
|
|
6737
6733
|
static build(files, root) {
|
|
6738
6734
|
var _a2;
|
|
6739
6735
|
try {
|
|
@@ -6914,24 +6910,26 @@ async function detectLinter() {
|
|
|
6914
6910
|
"eslint"
|
|
6915
6911
|
]);
|
|
6916
6912
|
for (const linter of linterNames) if (await isLinterAvailable(linter)) return linter;
|
|
6913
|
+
return null;
|
|
6917
6914
|
}
|
|
6918
6915
|
function getPackageJSONSync(cwd) {
|
|
6919
6916
|
const pkgPath = pkg.up({ cwd });
|
|
6920
|
-
if (!pkgPath) return;
|
|
6917
|
+
if (!pkgPath) return null;
|
|
6921
6918
|
return JSON.parse(readSync(pkgPath));
|
|
6922
6919
|
}
|
|
6923
6920
|
function match(packageJSON, dependency) {
|
|
6921
|
+
var _a2;
|
|
6924
6922
|
const dependencies = {
|
|
6925
6923
|
...packageJSON.dependencies || {},
|
|
6926
6924
|
...packageJSON.devDependencies || {}
|
|
6927
6925
|
};
|
|
6928
6926
|
if (dependencies[dependency]) return dependencies[dependency];
|
|
6929
6927
|
const matched = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
6930
|
-
return matched ? dependencies[matched] :
|
|
6928
|
+
return matched ? (_a2 = dependencies[matched]) != null ? _a2 : null : null;
|
|
6931
6929
|
}
|
|
6932
6930
|
function getVersionSync(dependency, cwd) {
|
|
6933
6931
|
const packageJSON = getPackageJSONSync(cwd);
|
|
6934
|
-
return packageJSON ? match(packageJSON, dependency) :
|
|
6932
|
+
return packageJSON ? match(packageJSON, dependency) : null;
|
|
6935
6933
|
}
|
|
6936
6934
|
function satisfiesDependency(dependency, version2, cwd) {
|
|
6937
6935
|
const packageVersion = getVersionSync(dependency, cwd);
|
|
@@ -6942,7 +6940,7 @@ function satisfiesDependency(dependency, version2, cwd) {
|
|
|
6942
6940
|
return satisfies(semVer, version2);
|
|
6943
6941
|
}
|
|
6944
6942
|
|
|
6945
|
-
var version = "5.0.0-alpha.
|
|
6943
|
+
var version = "5.0.0-alpha.19";
|
|
6946
6944
|
|
|
6947
6945
|
function isCommandMessage(msg) {
|
|
6948
6946
|
return msg.type === "command";
|
|
@@ -7325,17 +7323,32 @@ function isValidVarName$a(name) {
|
|
|
7325
7323
|
var URLPath$9 = (_a$b = class {
|
|
7326
7324
|
constructor(path2, options = {}) {
|
|
7327
7325
|
__privateAdd$b(this, _URLPath_instances$9);
|
|
7328
|
-
/**
|
|
7326
|
+
/**
|
|
7327
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
7328
|
+
*/
|
|
7329
7329
|
__publicField$a(this, "path");
|
|
7330
7330
|
__privateAdd$b(this, _options$b);
|
|
7331
7331
|
this.path = path2;
|
|
7332
7332
|
__privateSet$b(this, _options$b, options);
|
|
7333
7333
|
}
|
|
7334
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
7334
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
7335
|
+
*
|
|
7336
|
+
* @example
|
|
7337
|
+
* ```ts
|
|
7338
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
7339
|
+
* ```
|
|
7340
|
+
*/
|
|
7335
7341
|
get URL() {
|
|
7336
7342
|
return this.toURLPath();
|
|
7337
7343
|
}
|
|
7338
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
7344
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
7345
|
+
*
|
|
7346
|
+
* @example
|
|
7347
|
+
* ```ts
|
|
7348
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
7349
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
7350
|
+
* ```
|
|
7351
|
+
*/
|
|
7339
7352
|
get isURL() {
|
|
7340
7353
|
try {
|
|
7341
7354
|
return !!new URL(this.path).href;
|
|
@@ -7353,11 +7366,25 @@ var URLPath$9 = (_a$b = class {
|
|
|
7353
7366
|
get template() {
|
|
7354
7367
|
return this.toTemplateString();
|
|
7355
7368
|
}
|
|
7356
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
7369
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
7370
|
+
*
|
|
7371
|
+
* @example
|
|
7372
|
+
* ```ts
|
|
7373
|
+
* new URLPath('/pet/{petId}').object
|
|
7374
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
7375
|
+
* ```
|
|
7376
|
+
*/
|
|
7357
7377
|
get object() {
|
|
7358
7378
|
return this.toObject();
|
|
7359
7379
|
}
|
|
7360
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
7380
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
7381
|
+
*
|
|
7382
|
+
* @example
|
|
7383
|
+
* ```ts
|
|
7384
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
7385
|
+
* new URLPath('/pet').params // undefined
|
|
7386
|
+
* ```
|
|
7387
|
+
*/
|
|
7361
7388
|
get params() {
|
|
7362
7389
|
return this.getParams();
|
|
7363
7390
|
}
|
|
@@ -7391,6 +7418,12 @@ var URLPath$9 = (_a$b = class {
|
|
|
7391
7418
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
7392
7419
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
7393
7420
|
* Returns `undefined` when no path parameters are found.
|
|
7421
|
+
*
|
|
7422
|
+
* @example
|
|
7423
|
+
* ```ts
|
|
7424
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
7425
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
7426
|
+
* ```
|
|
7394
7427
|
*/
|
|
7395
7428
|
getParams(replacer) {
|
|
7396
7429
|
const params = {};
|
|
@@ -7400,14 +7433,22 @@ var URLPath$9 = (_a$b = class {
|
|
|
7400
7433
|
});
|
|
7401
7434
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
7402
7435
|
}
|
|
7403
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
7436
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
7437
|
+
*
|
|
7438
|
+
* @example
|
|
7439
|
+
* ```ts
|
|
7440
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
7441
|
+
* ```
|
|
7442
|
+
*/
|
|
7404
7443
|
toURLPath() {
|
|
7405
7444
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
7406
7445
|
}
|
|
7407
7446
|
}, _options$b = new WeakMap(), _URLPath_instances$9 = new WeakSet(), transformParam_fn$9 = function(raw) {
|
|
7408
7447
|
const param = isValidVarName$a(raw) ? raw : camelCase$c(raw);
|
|
7409
7448
|
return __privateGet$b(this, _options$b).casing === "camelcase" ? camelCase$c(param) : param;
|
|
7410
|
-
}, /**
|
|
7449
|
+
}, /**
|
|
7450
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
7451
|
+
*/
|
|
7411
7452
|
eachParam_fn$9 = function(fn) {
|
|
7412
7453
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
7413
7454
|
const raw = match[1];
|
|
@@ -9230,17 +9271,32 @@ function isValidVarName$9(name) {
|
|
|
9230
9271
|
var URLPath$8 = (_a$9 = class {
|
|
9231
9272
|
constructor(path, options = {}) {
|
|
9232
9273
|
__privateAdd$9(this, _URLPath_instances$8);
|
|
9233
|
-
/**
|
|
9274
|
+
/**
|
|
9275
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
9276
|
+
*/
|
|
9234
9277
|
__publicField$8(this, "path");
|
|
9235
9278
|
__privateAdd$9(this, _options$9);
|
|
9236
9279
|
this.path = path;
|
|
9237
9280
|
__privateSet$9(this, _options$9, options);
|
|
9238
9281
|
}
|
|
9239
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
9282
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
9283
|
+
*
|
|
9284
|
+
* @example
|
|
9285
|
+
* ```ts
|
|
9286
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
9287
|
+
* ```
|
|
9288
|
+
*/
|
|
9240
9289
|
get URL() {
|
|
9241
9290
|
return this.toURLPath();
|
|
9242
9291
|
}
|
|
9243
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
9292
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
9293
|
+
*
|
|
9294
|
+
* @example
|
|
9295
|
+
* ```ts
|
|
9296
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
9297
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
9298
|
+
* ```
|
|
9299
|
+
*/
|
|
9244
9300
|
get isURL() {
|
|
9245
9301
|
try {
|
|
9246
9302
|
return !!new URL(this.path).href;
|
|
@@ -9258,11 +9314,25 @@ var URLPath$8 = (_a$9 = class {
|
|
|
9258
9314
|
get template() {
|
|
9259
9315
|
return this.toTemplateString();
|
|
9260
9316
|
}
|
|
9261
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
9317
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
9318
|
+
*
|
|
9319
|
+
* @example
|
|
9320
|
+
* ```ts
|
|
9321
|
+
* new URLPath('/pet/{petId}').object
|
|
9322
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
9323
|
+
* ```
|
|
9324
|
+
*/
|
|
9262
9325
|
get object() {
|
|
9263
9326
|
return this.toObject();
|
|
9264
9327
|
}
|
|
9265
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
9328
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
9329
|
+
*
|
|
9330
|
+
* @example
|
|
9331
|
+
* ```ts
|
|
9332
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
9333
|
+
* new URLPath('/pet').params // undefined
|
|
9334
|
+
* ```
|
|
9335
|
+
*/
|
|
9266
9336
|
get params() {
|
|
9267
9337
|
return this.getParams();
|
|
9268
9338
|
}
|
|
@@ -9296,6 +9366,12 @@ var URLPath$8 = (_a$9 = class {
|
|
|
9296
9366
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
9297
9367
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
9298
9368
|
* Returns `undefined` when no path parameters are found.
|
|
9369
|
+
*
|
|
9370
|
+
* @example
|
|
9371
|
+
* ```ts
|
|
9372
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
9373
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
9374
|
+
* ```
|
|
9299
9375
|
*/
|
|
9300
9376
|
getParams(replacer) {
|
|
9301
9377
|
const params = {};
|
|
@@ -9305,14 +9381,22 @@ var URLPath$8 = (_a$9 = class {
|
|
|
9305
9381
|
});
|
|
9306
9382
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
9307
9383
|
}
|
|
9308
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
9384
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
9385
|
+
*
|
|
9386
|
+
* @example
|
|
9387
|
+
* ```ts
|
|
9388
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
9389
|
+
* ```
|
|
9390
|
+
*/
|
|
9309
9391
|
toURLPath() {
|
|
9310
9392
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
9311
9393
|
}
|
|
9312
9394
|
}, _options$9 = new WeakMap(), _URLPath_instances$8 = new WeakSet(), transformParam_fn$8 = function(raw) {
|
|
9313
9395
|
const param = isValidVarName$9(raw) ? raw : camelCase$d(raw);
|
|
9314
9396
|
return __privateGet$9(this, _options$9).casing === "camelcase" ? camelCase$d(param) : param;
|
|
9315
|
-
}, /**
|
|
9397
|
+
}, /**
|
|
9398
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
9399
|
+
*/
|
|
9316
9400
|
eachParam_fn$8 = function(fn) {
|
|
9317
9401
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
9318
9402
|
const raw = match[1];
|
|
@@ -9469,17 +9553,32 @@ function isValidVarName$8(name) {
|
|
|
9469
9553
|
var URLPath$7 = (_a$8 = class {
|
|
9470
9554
|
constructor(path, options = {}) {
|
|
9471
9555
|
__privateAdd$8(this, _URLPath_instances$7);
|
|
9472
|
-
/**
|
|
9556
|
+
/**
|
|
9557
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
9558
|
+
*/
|
|
9473
9559
|
__publicField$7(this, "path");
|
|
9474
9560
|
__privateAdd$8(this, _options$8);
|
|
9475
9561
|
this.path = path;
|
|
9476
9562
|
__privateSet$8(this, _options$8, options);
|
|
9477
9563
|
}
|
|
9478
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
9564
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
9565
|
+
*
|
|
9566
|
+
* @example
|
|
9567
|
+
* ```ts
|
|
9568
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
9569
|
+
* ```
|
|
9570
|
+
*/
|
|
9479
9571
|
get URL() {
|
|
9480
9572
|
return this.toURLPath();
|
|
9481
9573
|
}
|
|
9482
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
9574
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
9575
|
+
*
|
|
9576
|
+
* @example
|
|
9577
|
+
* ```ts
|
|
9578
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
9579
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
9580
|
+
* ```
|
|
9581
|
+
*/
|
|
9483
9582
|
get isURL() {
|
|
9484
9583
|
try {
|
|
9485
9584
|
return !!new URL(this.path).href;
|
|
@@ -9497,11 +9596,25 @@ var URLPath$7 = (_a$8 = class {
|
|
|
9497
9596
|
get template() {
|
|
9498
9597
|
return this.toTemplateString();
|
|
9499
9598
|
}
|
|
9500
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
9599
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
9600
|
+
*
|
|
9601
|
+
* @example
|
|
9602
|
+
* ```ts
|
|
9603
|
+
* new URLPath('/pet/{petId}').object
|
|
9604
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
9605
|
+
* ```
|
|
9606
|
+
*/
|
|
9501
9607
|
get object() {
|
|
9502
9608
|
return this.toObject();
|
|
9503
9609
|
}
|
|
9504
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
9610
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
9611
|
+
*
|
|
9612
|
+
* @example
|
|
9613
|
+
* ```ts
|
|
9614
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
9615
|
+
* new URLPath('/pet').params // undefined
|
|
9616
|
+
* ```
|
|
9617
|
+
*/
|
|
9505
9618
|
get params() {
|
|
9506
9619
|
return this.getParams();
|
|
9507
9620
|
}
|
|
@@ -9535,6 +9648,12 @@ var URLPath$7 = (_a$8 = class {
|
|
|
9535
9648
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
9536
9649
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
9537
9650
|
* Returns `undefined` when no path parameters are found.
|
|
9651
|
+
*
|
|
9652
|
+
* @example
|
|
9653
|
+
* ```ts
|
|
9654
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
9655
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
9656
|
+
* ```
|
|
9538
9657
|
*/
|
|
9539
9658
|
getParams(replacer) {
|
|
9540
9659
|
const params = {};
|
|
@@ -9544,14 +9663,22 @@ var URLPath$7 = (_a$8 = class {
|
|
|
9544
9663
|
});
|
|
9545
9664
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
9546
9665
|
}
|
|
9547
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
9666
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
9667
|
+
*
|
|
9668
|
+
* @example
|
|
9669
|
+
* ```ts
|
|
9670
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
9671
|
+
* ```
|
|
9672
|
+
*/
|
|
9548
9673
|
toURLPath() {
|
|
9549
9674
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
9550
9675
|
}
|
|
9551
9676
|
}, _options$8 = new WeakMap(), _URLPath_instances$7 = new WeakSet(), transformParam_fn$7 = function(raw) {
|
|
9552
9677
|
const param = isValidVarName$8(raw) ? raw : camelCase$b(raw);
|
|
9553
9678
|
return __privateGet$8(this, _options$8).casing === "camelcase" ? camelCase$b(param) : param;
|
|
9554
|
-
}, /**
|
|
9679
|
+
}, /**
|
|
9680
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
9681
|
+
*/
|
|
9555
9682
|
eachParam_fn$7 = function(fn) {
|
|
9556
9683
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
9557
9684
|
const raw = match[1];
|
|
@@ -211970,17 +212097,32 @@ function isValidVarName$7(name) {
|
|
|
211970
212097
|
var URLPath$6 = (_a$6 = class {
|
|
211971
212098
|
constructor(path, options = {}) {
|
|
211972
212099
|
__privateAdd$6(this, _URLPath_instances$6);
|
|
211973
|
-
/**
|
|
212100
|
+
/**
|
|
212101
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
212102
|
+
*/
|
|
211974
212103
|
__publicField$6(this, "path");
|
|
211975
212104
|
__privateAdd$6(this, _options$6);
|
|
211976
212105
|
this.path = path;
|
|
211977
212106
|
__privateSet$6(this, _options$6, options);
|
|
211978
212107
|
}
|
|
211979
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
212108
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
212109
|
+
*
|
|
212110
|
+
* @example
|
|
212111
|
+
* ```ts
|
|
212112
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
212113
|
+
* ```
|
|
212114
|
+
*/
|
|
211980
212115
|
get URL() {
|
|
211981
212116
|
return this.toURLPath();
|
|
211982
212117
|
}
|
|
211983
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
212118
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
212119
|
+
*
|
|
212120
|
+
* @example
|
|
212121
|
+
* ```ts
|
|
212122
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
212123
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
212124
|
+
* ```
|
|
212125
|
+
*/
|
|
211984
212126
|
get isURL() {
|
|
211985
212127
|
try {
|
|
211986
212128
|
return !!new URL(this.path).href;
|
|
@@ -211998,11 +212140,25 @@ var URLPath$6 = (_a$6 = class {
|
|
|
211998
212140
|
get template() {
|
|
211999
212141
|
return this.toTemplateString();
|
|
212000
212142
|
}
|
|
212001
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
212143
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
212144
|
+
*
|
|
212145
|
+
* @example
|
|
212146
|
+
* ```ts
|
|
212147
|
+
* new URLPath('/pet/{petId}').object
|
|
212148
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
212149
|
+
* ```
|
|
212150
|
+
*/
|
|
212002
212151
|
get object() {
|
|
212003
212152
|
return this.toObject();
|
|
212004
212153
|
}
|
|
212005
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
212154
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
212155
|
+
*
|
|
212156
|
+
* @example
|
|
212157
|
+
* ```ts
|
|
212158
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
212159
|
+
* new URLPath('/pet').params // undefined
|
|
212160
|
+
* ```
|
|
212161
|
+
*/
|
|
212006
212162
|
get params() {
|
|
212007
212163
|
return this.getParams();
|
|
212008
212164
|
}
|
|
@@ -212036,6 +212192,12 @@ var URLPath$6 = (_a$6 = class {
|
|
|
212036
212192
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
212037
212193
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
212038
212194
|
* Returns `undefined` when no path parameters are found.
|
|
212195
|
+
*
|
|
212196
|
+
* @example
|
|
212197
|
+
* ```ts
|
|
212198
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
212199
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
212200
|
+
* ```
|
|
212039
212201
|
*/
|
|
212040
212202
|
getParams(replacer) {
|
|
212041
212203
|
const params = {};
|
|
@@ -212045,14 +212207,22 @@ var URLPath$6 = (_a$6 = class {
|
|
|
212045
212207
|
});
|
|
212046
212208
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
212047
212209
|
}
|
|
212048
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
212210
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
212211
|
+
*
|
|
212212
|
+
* @example
|
|
212213
|
+
* ```ts
|
|
212214
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
212215
|
+
* ```
|
|
212216
|
+
*/
|
|
212049
212217
|
toURLPath() {
|
|
212050
212218
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
212051
212219
|
}
|
|
212052
212220
|
}, _options$6 = new WeakMap(), _URLPath_instances$6 = new WeakSet(), transformParam_fn$6 = function(raw) {
|
|
212053
212221
|
const param = isValidVarName$7(raw) ? raw : camelCase$8(raw);
|
|
212054
212222
|
return __privateGet$6(this, _options$6).casing === "camelcase" ? camelCase$8(param) : param;
|
|
212055
|
-
}, /**
|
|
212223
|
+
}, /**
|
|
212224
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
212225
|
+
*/
|
|
212056
212226
|
eachParam_fn$6 = function(fn) {
|
|
212057
212227
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
212058
212228
|
const raw = match[1];
|
|
@@ -213505,17 +213675,32 @@ function isValidVarName$5(name) {
|
|
|
213505
213675
|
var URLPath$5 = (_a$5 = class {
|
|
213506
213676
|
constructor(path, options = {}) {
|
|
213507
213677
|
__privateAdd$5(this, _URLPath_instances$5);
|
|
213508
|
-
/**
|
|
213678
|
+
/**
|
|
213679
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
213680
|
+
*/
|
|
213509
213681
|
__publicField$5(this, "path");
|
|
213510
213682
|
__privateAdd$5(this, _options$5);
|
|
213511
213683
|
this.path = path;
|
|
213512
213684
|
__privateSet$5(this, _options$5, options);
|
|
213513
213685
|
}
|
|
213514
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
213686
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
213687
|
+
*
|
|
213688
|
+
* @example
|
|
213689
|
+
* ```ts
|
|
213690
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
213691
|
+
* ```
|
|
213692
|
+
*/
|
|
213515
213693
|
get URL() {
|
|
213516
213694
|
return this.toURLPath();
|
|
213517
213695
|
}
|
|
213518
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
213696
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
213697
|
+
*
|
|
213698
|
+
* @example
|
|
213699
|
+
* ```ts
|
|
213700
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
213701
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
213702
|
+
* ```
|
|
213703
|
+
*/
|
|
213519
213704
|
get isURL() {
|
|
213520
213705
|
try {
|
|
213521
213706
|
return !!new URL(this.path).href;
|
|
@@ -213533,11 +213718,25 @@ var URLPath$5 = (_a$5 = class {
|
|
|
213533
213718
|
get template() {
|
|
213534
213719
|
return this.toTemplateString();
|
|
213535
213720
|
}
|
|
213536
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
213721
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
213722
|
+
*
|
|
213723
|
+
* @example
|
|
213724
|
+
* ```ts
|
|
213725
|
+
* new URLPath('/pet/{petId}').object
|
|
213726
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
213727
|
+
* ```
|
|
213728
|
+
*/
|
|
213537
213729
|
get object() {
|
|
213538
213730
|
return this.toObject();
|
|
213539
213731
|
}
|
|
213540
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
213732
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
213733
|
+
*
|
|
213734
|
+
* @example
|
|
213735
|
+
* ```ts
|
|
213736
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
213737
|
+
* new URLPath('/pet').params // undefined
|
|
213738
|
+
* ```
|
|
213739
|
+
*/
|
|
213541
213740
|
get params() {
|
|
213542
213741
|
return this.getParams();
|
|
213543
213742
|
}
|
|
@@ -213571,6 +213770,12 @@ var URLPath$5 = (_a$5 = class {
|
|
|
213571
213770
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
213572
213771
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
213573
213772
|
* Returns `undefined` when no path parameters are found.
|
|
213773
|
+
*
|
|
213774
|
+
* @example
|
|
213775
|
+
* ```ts
|
|
213776
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
213777
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
213778
|
+
* ```
|
|
213574
213779
|
*/
|
|
213575
213780
|
getParams(replacer) {
|
|
213576
213781
|
const params = {};
|
|
@@ -213580,14 +213785,22 @@ var URLPath$5 = (_a$5 = class {
|
|
|
213580
213785
|
});
|
|
213581
213786
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
213582
213787
|
}
|
|
213583
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
213788
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
213789
|
+
*
|
|
213790
|
+
* @example
|
|
213791
|
+
* ```ts
|
|
213792
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
213793
|
+
* ```
|
|
213794
|
+
*/
|
|
213584
213795
|
toURLPath() {
|
|
213585
213796
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
213586
213797
|
}
|
|
213587
213798
|
}, _options$5 = new WeakMap(), _URLPath_instances$5 = new WeakSet(), transformParam_fn$5 = function(raw) {
|
|
213588
213799
|
const param = isValidVarName$5(raw) ? raw : camelCase$5(raw);
|
|
213589
213800
|
return __privateGet$5(this, _options$5).casing === "camelcase" ? camelCase$5(param) : param;
|
|
213590
|
-
}, /**
|
|
213801
|
+
}, /**
|
|
213802
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
213803
|
+
*/
|
|
213591
213804
|
eachParam_fn$5 = function(fn) {
|
|
213592
213805
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
213593
213806
|
const raw = match[1];
|
|
@@ -213967,7 +214180,7 @@ function pascalCase$4(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
|
213967
214180
|
}
|
|
213968
214181
|
function getNestedAccessor$1(param, accessor) {
|
|
213969
214182
|
const parts = Array.isArray(param) ? param : param.split(".");
|
|
213970
|
-
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return
|
|
214183
|
+
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return null;
|
|
213971
214184
|
return `${accessor}?.['${`${parts.join("']?.['")}']`}`;
|
|
213972
214185
|
}
|
|
213973
214186
|
function isValidVarName$4(name) {
|
|
@@ -213981,17 +214194,32 @@ function isValidVarName$4(name) {
|
|
|
213981
214194
|
var URLPath$4 = (_a$4 = class {
|
|
213982
214195
|
constructor(path, options = {}) {
|
|
213983
214196
|
__privateAdd$4(this, _URLPath_instances$4);
|
|
213984
|
-
/**
|
|
214197
|
+
/**
|
|
214198
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
214199
|
+
*/
|
|
213985
214200
|
__publicField$4(this, "path");
|
|
213986
214201
|
__privateAdd$4(this, _options$4);
|
|
213987
214202
|
this.path = path;
|
|
213988
214203
|
__privateSet$4(this, _options$4, options);
|
|
213989
214204
|
}
|
|
213990
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
214205
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
214206
|
+
*
|
|
214207
|
+
* @example
|
|
214208
|
+
* ```ts
|
|
214209
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
214210
|
+
* ```
|
|
214211
|
+
*/
|
|
213991
214212
|
get URL() {
|
|
213992
214213
|
return this.toURLPath();
|
|
213993
214214
|
}
|
|
213994
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
214215
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
214216
|
+
*
|
|
214217
|
+
* @example
|
|
214218
|
+
* ```ts
|
|
214219
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
214220
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
214221
|
+
* ```
|
|
214222
|
+
*/
|
|
213995
214223
|
get isURL() {
|
|
213996
214224
|
try {
|
|
213997
214225
|
return !!new URL(this.path).href;
|
|
@@ -214009,11 +214237,25 @@ var URLPath$4 = (_a$4 = class {
|
|
|
214009
214237
|
get template() {
|
|
214010
214238
|
return this.toTemplateString();
|
|
214011
214239
|
}
|
|
214012
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
214240
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
214241
|
+
*
|
|
214242
|
+
* @example
|
|
214243
|
+
* ```ts
|
|
214244
|
+
* new URLPath('/pet/{petId}').object
|
|
214245
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
214246
|
+
* ```
|
|
214247
|
+
*/
|
|
214013
214248
|
get object() {
|
|
214014
214249
|
return this.toObject();
|
|
214015
214250
|
}
|
|
214016
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
214251
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
214252
|
+
*
|
|
214253
|
+
* @example
|
|
214254
|
+
* ```ts
|
|
214255
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
214256
|
+
* new URLPath('/pet').params // undefined
|
|
214257
|
+
* ```
|
|
214258
|
+
*/
|
|
214017
214259
|
get params() {
|
|
214018
214260
|
return this.getParams();
|
|
214019
214261
|
}
|
|
@@ -214047,6 +214289,12 @@ var URLPath$4 = (_a$4 = class {
|
|
|
214047
214289
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
214048
214290
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
214049
214291
|
* Returns `undefined` when no path parameters are found.
|
|
214292
|
+
*
|
|
214293
|
+
* @example
|
|
214294
|
+
* ```ts
|
|
214295
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
214296
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
214297
|
+
* ```
|
|
214050
214298
|
*/
|
|
214051
214299
|
getParams(replacer) {
|
|
214052
214300
|
const params = {};
|
|
@@ -214056,14 +214304,22 @@ var URLPath$4 = (_a$4 = class {
|
|
|
214056
214304
|
});
|
|
214057
214305
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
214058
214306
|
}
|
|
214059
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
214307
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
214308
|
+
*
|
|
214309
|
+
* @example
|
|
214310
|
+
* ```ts
|
|
214311
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
214312
|
+
* ```
|
|
214313
|
+
*/
|
|
214060
214314
|
toURLPath() {
|
|
214061
214315
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
214062
214316
|
}
|
|
214063
214317
|
}, _options$4 = new WeakMap(), _URLPath_instances$4 = new WeakSet(), transformParam_fn$4 = function(raw) {
|
|
214064
214318
|
const param = isValidVarName$4(raw) ? raw : camelCase$4(raw);
|
|
214065
214319
|
return __privateGet$4(this, _options$4).casing === "camelcase" ? camelCase$4(param) : param;
|
|
214066
|
-
}, /**
|
|
214320
|
+
}, /**
|
|
214321
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
214322
|
+
*/
|
|
214067
214323
|
eachParam_fn$4 = function(fn) {
|
|
214068
214324
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
214069
214325
|
const raw = match[1];
|
|
@@ -217051,17 +217307,32 @@ function isValidVarName$3(name) {
|
|
|
217051
217307
|
var URLPath$3 = (_a$3 = class {
|
|
217052
217308
|
constructor(path, options = {}) {
|
|
217053
217309
|
__privateAdd$3(this, _URLPath_instances$3);
|
|
217054
|
-
/**
|
|
217310
|
+
/**
|
|
217311
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
217312
|
+
*/
|
|
217055
217313
|
__publicField$3(this, "path");
|
|
217056
217314
|
__privateAdd$3(this, _options$3);
|
|
217057
217315
|
this.path = path;
|
|
217058
217316
|
__privateSet$3(this, _options$3, options);
|
|
217059
217317
|
}
|
|
217060
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
217318
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
217319
|
+
*
|
|
217320
|
+
* @example
|
|
217321
|
+
* ```ts
|
|
217322
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
217323
|
+
* ```
|
|
217324
|
+
*/
|
|
217061
217325
|
get URL() {
|
|
217062
217326
|
return this.toURLPath();
|
|
217063
217327
|
}
|
|
217064
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
217328
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
217329
|
+
*
|
|
217330
|
+
* @example
|
|
217331
|
+
* ```ts
|
|
217332
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
217333
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
217334
|
+
* ```
|
|
217335
|
+
*/
|
|
217065
217336
|
get isURL() {
|
|
217066
217337
|
try {
|
|
217067
217338
|
return !!new URL(this.path).href;
|
|
@@ -217079,11 +217350,25 @@ var URLPath$3 = (_a$3 = class {
|
|
|
217079
217350
|
get template() {
|
|
217080
217351
|
return this.toTemplateString();
|
|
217081
217352
|
}
|
|
217082
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
217353
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
217354
|
+
*
|
|
217355
|
+
* @example
|
|
217356
|
+
* ```ts
|
|
217357
|
+
* new URLPath('/pet/{petId}').object
|
|
217358
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
217359
|
+
* ```
|
|
217360
|
+
*/
|
|
217083
217361
|
get object() {
|
|
217084
217362
|
return this.toObject();
|
|
217085
217363
|
}
|
|
217086
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
217364
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
217365
|
+
*
|
|
217366
|
+
* @example
|
|
217367
|
+
* ```ts
|
|
217368
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
217369
|
+
* new URLPath('/pet').params // undefined
|
|
217370
|
+
* ```
|
|
217371
|
+
*/
|
|
217087
217372
|
get params() {
|
|
217088
217373
|
return this.getParams();
|
|
217089
217374
|
}
|
|
@@ -217117,6 +217402,12 @@ var URLPath$3 = (_a$3 = class {
|
|
|
217117
217402
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
217118
217403
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
217119
217404
|
* Returns `undefined` when no path parameters are found.
|
|
217405
|
+
*
|
|
217406
|
+
* @example
|
|
217407
|
+
* ```ts
|
|
217408
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
217409
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
217410
|
+
* ```
|
|
217120
217411
|
*/
|
|
217121
217412
|
getParams(replacer) {
|
|
217122
217413
|
const params = {};
|
|
@@ -217126,14 +217417,22 @@ var URLPath$3 = (_a$3 = class {
|
|
|
217126
217417
|
});
|
|
217127
217418
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
217128
217419
|
}
|
|
217129
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
217420
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
217421
|
+
*
|
|
217422
|
+
* @example
|
|
217423
|
+
* ```ts
|
|
217424
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
217425
|
+
* ```
|
|
217426
|
+
*/
|
|
217130
217427
|
toURLPath() {
|
|
217131
217428
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
217132
217429
|
}
|
|
217133
217430
|
}, _options$3 = new WeakMap(), _URLPath_instances$3 = new WeakSet(), transformParam_fn$3 = function(raw) {
|
|
217134
217431
|
const param = isValidVarName$3(raw) ? raw : camelCase$3(raw);
|
|
217135
217432
|
return __privateGet$3(this, _options$3).casing === "camelcase" ? camelCase$3(param) : param;
|
|
217136
|
-
}, /**
|
|
217433
|
+
}, /**
|
|
217434
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
217435
|
+
*/
|
|
217137
217436
|
eachParam_fn$3 = function(fn) {
|
|
217138
217437
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
217139
217438
|
const raw = match[1];
|
|
@@ -218201,17 +218500,32 @@ function isValidVarName$2(name) {
|
|
|
218201
218500
|
var URLPath$2 = (_a$2 = class {
|
|
218202
218501
|
constructor(path, options = {}) {
|
|
218203
218502
|
__privateAdd$2(this, _URLPath_instances$2);
|
|
218204
|
-
/**
|
|
218503
|
+
/**
|
|
218504
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
218505
|
+
*/
|
|
218205
218506
|
__publicField$2(this, "path");
|
|
218206
218507
|
__privateAdd$2(this, _options$2);
|
|
218207
218508
|
this.path = path;
|
|
218208
218509
|
__privateSet$2(this, _options$2, options);
|
|
218209
218510
|
}
|
|
218210
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
218511
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
218512
|
+
*
|
|
218513
|
+
* @example
|
|
218514
|
+
* ```ts
|
|
218515
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
218516
|
+
* ```
|
|
218517
|
+
*/
|
|
218211
218518
|
get URL() {
|
|
218212
218519
|
return this.toURLPath();
|
|
218213
218520
|
}
|
|
218214
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
218521
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
218522
|
+
*
|
|
218523
|
+
* @example
|
|
218524
|
+
* ```ts
|
|
218525
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
218526
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
218527
|
+
* ```
|
|
218528
|
+
*/
|
|
218215
218529
|
get isURL() {
|
|
218216
218530
|
try {
|
|
218217
218531
|
return !!new URL(this.path).href;
|
|
@@ -218229,11 +218543,25 @@ var URLPath$2 = (_a$2 = class {
|
|
|
218229
218543
|
get template() {
|
|
218230
218544
|
return this.toTemplateString();
|
|
218231
218545
|
}
|
|
218232
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
218546
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
218547
|
+
*
|
|
218548
|
+
* @example
|
|
218549
|
+
* ```ts
|
|
218550
|
+
* new URLPath('/pet/{petId}').object
|
|
218551
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
218552
|
+
* ```
|
|
218553
|
+
*/
|
|
218233
218554
|
get object() {
|
|
218234
218555
|
return this.toObject();
|
|
218235
218556
|
}
|
|
218236
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
218557
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
218558
|
+
*
|
|
218559
|
+
* @example
|
|
218560
|
+
* ```ts
|
|
218561
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
218562
|
+
* new URLPath('/pet').params // undefined
|
|
218563
|
+
* ```
|
|
218564
|
+
*/
|
|
218237
218565
|
get params() {
|
|
218238
218566
|
return this.getParams();
|
|
218239
218567
|
}
|
|
@@ -218267,6 +218595,12 @@ var URLPath$2 = (_a$2 = class {
|
|
|
218267
218595
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
218268
218596
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
218269
218597
|
* Returns `undefined` when no path parameters are found.
|
|
218598
|
+
*
|
|
218599
|
+
* @example
|
|
218600
|
+
* ```ts
|
|
218601
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
218602
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
218603
|
+
* ```
|
|
218270
218604
|
*/
|
|
218271
218605
|
getParams(replacer) {
|
|
218272
218606
|
const params = {};
|
|
@@ -218276,14 +218610,22 @@ var URLPath$2 = (_a$2 = class {
|
|
|
218276
218610
|
});
|
|
218277
218611
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
218278
218612
|
}
|
|
218279
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
218613
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
218614
|
+
*
|
|
218615
|
+
* @example
|
|
218616
|
+
* ```ts
|
|
218617
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
218618
|
+
* ```
|
|
218619
|
+
*/
|
|
218280
218620
|
toURLPath() {
|
|
218281
218621
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
218282
218622
|
}
|
|
218283
218623
|
}, _options$2 = new WeakMap(), _URLPath_instances$2 = new WeakSet(), transformParam_fn$2 = function(raw) {
|
|
218284
218624
|
const param = isValidVarName$2(raw) ? raw : camelCase$2(raw);
|
|
218285
218625
|
return __privateGet$2(this, _options$2).casing === "camelcase" ? camelCase$2(param) : param;
|
|
218286
|
-
}, /**
|
|
218626
|
+
}, /**
|
|
218627
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
218628
|
+
*/
|
|
218287
218629
|
eachParam_fn$2 = function(fn) {
|
|
218288
218630
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
218289
218631
|
const raw = match[1];
|
|
@@ -219351,17 +219693,32 @@ function isValidVarName$1(name) {
|
|
|
219351
219693
|
var URLPath$1 = (_a$1 = class {
|
|
219352
219694
|
constructor(path, options = {}) {
|
|
219353
219695
|
__privateAdd$1(this, _URLPath_instances$1);
|
|
219354
|
-
/**
|
|
219696
|
+
/**
|
|
219697
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
219698
|
+
*/
|
|
219355
219699
|
__publicField$1(this, "path");
|
|
219356
219700
|
__privateAdd$1(this, _options$1);
|
|
219357
219701
|
this.path = path;
|
|
219358
219702
|
__privateSet$1(this, _options$1, options);
|
|
219359
219703
|
}
|
|
219360
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
219704
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
219705
|
+
*
|
|
219706
|
+
* @example
|
|
219707
|
+
* ```ts
|
|
219708
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
219709
|
+
* ```
|
|
219710
|
+
*/
|
|
219361
219711
|
get URL() {
|
|
219362
219712
|
return this.toURLPath();
|
|
219363
219713
|
}
|
|
219364
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
219714
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
219715
|
+
*
|
|
219716
|
+
* @example
|
|
219717
|
+
* ```ts
|
|
219718
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
219719
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
219720
|
+
* ```
|
|
219721
|
+
*/
|
|
219365
219722
|
get isURL() {
|
|
219366
219723
|
try {
|
|
219367
219724
|
return !!new URL(this.path).href;
|
|
@@ -219379,11 +219736,25 @@ var URLPath$1 = (_a$1 = class {
|
|
|
219379
219736
|
get template() {
|
|
219380
219737
|
return this.toTemplateString();
|
|
219381
219738
|
}
|
|
219382
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
219739
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
219740
|
+
*
|
|
219741
|
+
* @example
|
|
219742
|
+
* ```ts
|
|
219743
|
+
* new URLPath('/pet/{petId}').object
|
|
219744
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
219745
|
+
* ```
|
|
219746
|
+
*/
|
|
219383
219747
|
get object() {
|
|
219384
219748
|
return this.toObject();
|
|
219385
219749
|
}
|
|
219386
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
219750
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
219751
|
+
*
|
|
219752
|
+
* @example
|
|
219753
|
+
* ```ts
|
|
219754
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
219755
|
+
* new URLPath('/pet').params // undefined
|
|
219756
|
+
* ```
|
|
219757
|
+
*/
|
|
219387
219758
|
get params() {
|
|
219388
219759
|
return this.getParams();
|
|
219389
219760
|
}
|
|
@@ -219417,6 +219788,12 @@ var URLPath$1 = (_a$1 = class {
|
|
|
219417
219788
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
219418
219789
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
219419
219790
|
* Returns `undefined` when no path parameters are found.
|
|
219791
|
+
*
|
|
219792
|
+
* @example
|
|
219793
|
+
* ```ts
|
|
219794
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
219795
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
219796
|
+
* ```
|
|
219420
219797
|
*/
|
|
219421
219798
|
getParams(replacer) {
|
|
219422
219799
|
const params = {};
|
|
@@ -219426,14 +219803,22 @@ var URLPath$1 = (_a$1 = class {
|
|
|
219426
219803
|
});
|
|
219427
219804
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
219428
219805
|
}
|
|
219429
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
219806
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
219807
|
+
*
|
|
219808
|
+
* @example
|
|
219809
|
+
* ```ts
|
|
219810
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
219811
|
+
* ```
|
|
219812
|
+
*/
|
|
219430
219813
|
toURLPath() {
|
|
219431
219814
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
219432
219815
|
}
|
|
219433
219816
|
}, _options$1 = new WeakMap(), _URLPath_instances$1 = new WeakSet(), transformParam_fn$1 = function(raw) {
|
|
219434
219817
|
const param = isValidVarName$1(raw) ? raw : camelCase$1(raw);
|
|
219435
219818
|
return __privateGet$1(this, _options$1).casing === "camelcase" ? camelCase$1(param) : param;
|
|
219436
|
-
}, /**
|
|
219819
|
+
}, /**
|
|
219820
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
219821
|
+
*/
|
|
219437
219822
|
eachParam_fn$1 = function(fn) {
|
|
219438
219823
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
219439
219824
|
const raw = match[1];
|
|
@@ -220514,7 +220899,7 @@ function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
|
220514
220899
|
}
|
|
220515
220900
|
function getNestedAccessor(param, accessor) {
|
|
220516
220901
|
const parts = Array.isArray(param) ? param : param.split(".");
|
|
220517
|
-
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return
|
|
220902
|
+
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return null;
|
|
220518
220903
|
return `${accessor}?.['${`${parts.join("']?.['")}']`}`;
|
|
220519
220904
|
}
|
|
220520
220905
|
function isValidVarName(name) {
|
|
@@ -220528,17 +220913,32 @@ function isValidVarName(name) {
|
|
|
220528
220913
|
var URLPath = (_a = class {
|
|
220529
220914
|
constructor(path, options = {}) {
|
|
220530
220915
|
__privateAdd(this, _URLPath_instances);
|
|
220531
|
-
/**
|
|
220916
|
+
/**
|
|
220917
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
220918
|
+
*/
|
|
220532
220919
|
__publicField(this, "path");
|
|
220533
220920
|
__privateAdd(this, _options);
|
|
220534
220921
|
this.path = path;
|
|
220535
220922
|
__privateSet(this, _options, options);
|
|
220536
220923
|
}
|
|
220537
|
-
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
220924
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
220925
|
+
*
|
|
220926
|
+
* @example
|
|
220927
|
+
* ```ts
|
|
220928
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
220929
|
+
* ```
|
|
220930
|
+
*/
|
|
220538
220931
|
get URL() {
|
|
220539
220932
|
return this.toURLPath();
|
|
220540
220933
|
}
|
|
220541
|
-
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
220934
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
220935
|
+
*
|
|
220936
|
+
* @example
|
|
220937
|
+
* ```ts
|
|
220938
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
220939
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
220940
|
+
* ```
|
|
220941
|
+
*/
|
|
220542
220942
|
get isURL() {
|
|
220543
220943
|
try {
|
|
220544
220944
|
return !!new URL(this.path).href;
|
|
@@ -220556,11 +220956,25 @@ var URLPath = (_a = class {
|
|
|
220556
220956
|
get template() {
|
|
220557
220957
|
return this.toTemplateString();
|
|
220558
220958
|
}
|
|
220559
|
-
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
220959
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
220960
|
+
*
|
|
220961
|
+
* @example
|
|
220962
|
+
* ```ts
|
|
220963
|
+
* new URLPath('/pet/{petId}').object
|
|
220964
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
220965
|
+
* ```
|
|
220966
|
+
*/
|
|
220560
220967
|
get object() {
|
|
220561
220968
|
return this.toObject();
|
|
220562
220969
|
}
|
|
220563
|
-
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
220970
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
220971
|
+
*
|
|
220972
|
+
* @example
|
|
220973
|
+
* ```ts
|
|
220974
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
220975
|
+
* new URLPath('/pet').params // undefined
|
|
220976
|
+
* ```
|
|
220977
|
+
*/
|
|
220564
220978
|
get params() {
|
|
220565
220979
|
return this.getParams();
|
|
220566
220980
|
}
|
|
@@ -220594,6 +221008,12 @@ var URLPath = (_a = class {
|
|
|
220594
221008
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
220595
221009
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
220596
221010
|
* Returns `undefined` when no path parameters are found.
|
|
221011
|
+
*
|
|
221012
|
+
* @example
|
|
221013
|
+
* ```ts
|
|
221014
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
221015
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
221016
|
+
* ```
|
|
220597
221017
|
*/
|
|
220598
221018
|
getParams(replacer) {
|
|
220599
221019
|
const params = {};
|
|
@@ -220603,14 +221023,22 @@ var URLPath = (_a = class {
|
|
|
220603
221023
|
});
|
|
220604
221024
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
220605
221025
|
}
|
|
220606
|
-
/** Converts the OpenAPI path to Express-style colon syntax
|
|
221026
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
221027
|
+
*
|
|
221028
|
+
* @example
|
|
221029
|
+
* ```ts
|
|
221030
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
221031
|
+
* ```
|
|
221032
|
+
*/
|
|
220607
221033
|
toURLPath() {
|
|
220608
221034
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
220609
221035
|
}
|
|
220610
221036
|
}, _options = new WeakMap(), _URLPath_instances = new WeakSet(), transformParam_fn = function(raw) {
|
|
220611
221037
|
const param = isValidVarName(raw) ? raw : camelCase(raw);
|
|
220612
221038
|
return __privateGet(this, _options).casing === "camelcase" ? camelCase(param) : param;
|
|
220613
|
-
}, /**
|
|
221039
|
+
}, /**
|
|
221040
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
221041
|
+
*/
|
|
220614
221042
|
eachParam_fn = function(fn) {
|
|
220615
221043
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
220616
221044
|
const raw = match[1];
|
|
@@ -222485,7 +222913,7 @@ async function connectToStudio(options) {
|
|
|
222485
222913
|
initialSession,
|
|
222486
222914
|
nitro
|
|
222487
222915
|
} = options;
|
|
222488
|
-
const events = new AsyncEventEmitter
|
|
222916
|
+
const events = new AsyncEventEmitter();
|
|
222489
222917
|
let currentSource;
|
|
222490
222918
|
async function reconnect() {
|
|
222491
222919
|
logger.info(`Retrying connection in ${formatMs$1(retryInterval)} to Kubb Studio ...`);
|