@kubb/agent 5.0.0-alpha.16 → 5.0.0-alpha.18
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 +713 -278
- 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;
|
|
@@ -4654,6 +4593,75 @@ async function disconnect({ sessionId, token, studioUrl }) {
|
|
|
4654
4593
|
const visitorDepths = {
|
|
4655
4594
|
deep: "deep"
|
|
4656
4595
|
};
|
|
4596
|
+
const schemaTypes = {
|
|
4597
|
+
enum: "enum"};
|
|
4598
|
+
function toCamelOrPascal$f(text, pascal) {
|
|
4599
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
4600
|
+
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
4601
|
+
if (i === 0 && true) return word.charAt(0).toLowerCase() + word.slice(1);
|
|
4602
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
4603
|
+
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
4604
|
+
}
|
|
4605
|
+
function applyToFileParts$f(text, transformPart) {
|
|
4606
|
+
const parts = text.split(/\.(?=[a-zA-Z])/);
|
|
4607
|
+
return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
|
|
4608
|
+
}
|
|
4609
|
+
function camelCase$f(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
4610
|
+
if (isFile) return applyToFileParts$f(text, (part, isLast) => camelCase$f(part, isLast ? {
|
|
4611
|
+
prefix,
|
|
4612
|
+
suffix
|
|
4613
|
+
} : {}));
|
|
4614
|
+
return toCamelOrPascal$f(`${prefix} ${text} ${suffix}`);
|
|
4615
|
+
}
|
|
4616
|
+
function isValidVarName$c(name) {
|
|
4617
|
+
try {
|
|
4618
|
+
new Function(`var ${name}`);
|
|
4619
|
+
} catch {
|
|
4620
|
+
return false;
|
|
4621
|
+
}
|
|
4622
|
+
return true;
|
|
4623
|
+
}
|
|
4624
|
+
function narrowSchema(node, type) {
|
|
4625
|
+
return (node == null ? void 0 : node.type) === type ? node : void 0;
|
|
4626
|
+
}
|
|
4627
|
+
function isKind(kind) {
|
|
4628
|
+
return (node) => node.kind === kind;
|
|
4629
|
+
}
|
|
4630
|
+
const isOperationNode = isKind("Operation");
|
|
4631
|
+
const isSchemaNode = isKind("Schema");
|
|
4632
|
+
const plainStringTypes = /* @__PURE__ */ new Set([
|
|
4633
|
+
"string",
|
|
4634
|
+
"uuid",
|
|
4635
|
+
"email",
|
|
4636
|
+
"url",
|
|
4637
|
+
"datetime"
|
|
4638
|
+
]);
|
|
4639
|
+
function isStringType(node) {
|
|
4640
|
+
var _a;
|
|
4641
|
+
if (plainStringTypes.has(node.type)) return true;
|
|
4642
|
+
const temporal = (_a = narrowSchema(node, "date")) != null ? _a : narrowSchema(node, "time");
|
|
4643
|
+
if (temporal) return temporal.representation !== "date";
|
|
4644
|
+
return false;
|
|
4645
|
+
}
|
|
4646
|
+
function caseParams(params, casing) {
|
|
4647
|
+
if (!casing) return params;
|
|
4648
|
+
return params.map((param) => {
|
|
4649
|
+
const transformed = casing === "camelcase" || !isValidVarName$c(param.name) ? camelCase$f(param.name) : param.name;
|
|
4650
|
+
return {
|
|
4651
|
+
...param,
|
|
4652
|
+
name: transformed
|
|
4653
|
+
};
|
|
4654
|
+
});
|
|
4655
|
+
}
|
|
4656
|
+
function syncOptionality(required, schema) {
|
|
4657
|
+
var _a;
|
|
4658
|
+
const nullable = (_a = schema.nullable) != null ? _a : false;
|
|
4659
|
+
return {
|
|
4660
|
+
...schema,
|
|
4661
|
+
optional: !required && !nullable ? true : void 0,
|
|
4662
|
+
nullish: !required && nullable ? true : void 0
|
|
4663
|
+
};
|
|
4664
|
+
}
|
|
4657
4665
|
function createSchema(props) {
|
|
4658
4666
|
if (props["type"] === "object") return {
|
|
4659
4667
|
properties: [],
|
|
@@ -4665,15 +4673,6 @@ function createSchema(props) {
|
|
|
4665
4673
|
kind: "Schema"
|
|
4666
4674
|
};
|
|
4667
4675
|
}
|
|
4668
|
-
function syncPropertySchema(required, schema) {
|
|
4669
|
-
var _a;
|
|
4670
|
-
const nullable = (_a = schema.nullable) != null ? _a : false;
|
|
4671
|
-
return {
|
|
4672
|
-
...schema,
|
|
4673
|
-
optional: !required && !nullable ? true : void 0,
|
|
4674
|
-
nullish: !required && nullable ? true : void 0
|
|
4675
|
-
};
|
|
4676
|
-
}
|
|
4677
4676
|
function createProperty(props) {
|
|
4678
4677
|
var _a;
|
|
4679
4678
|
const required = (_a = props.required) != null ? _a : false;
|
|
@@ -4681,7 +4680,7 @@ function createProperty(props) {
|
|
|
4681
4680
|
...props,
|
|
4682
4681
|
kind: "Property",
|
|
4683
4682
|
required,
|
|
4684
|
-
schema:
|
|
4683
|
+
schema: syncOptionality(required, props.schema)
|
|
4685
4684
|
};
|
|
4686
4685
|
}
|
|
4687
4686
|
function createParameter(props) {
|
|
@@ -4691,7 +4690,7 @@ function createParameter(props) {
|
|
|
4691
4690
|
...props,
|
|
4692
4691
|
kind: "Parameter",
|
|
4693
4692
|
required,
|
|
4694
|
-
schema:
|
|
4693
|
+
schema: syncOptionality(required, props.schema)
|
|
4695
4694
|
};
|
|
4696
4695
|
}
|
|
4697
4696
|
function definePrinter(build) {
|
|
@@ -4705,9 +4704,9 @@ function createPrinterFactory(getKey) {
|
|
|
4705
4704
|
options: resolvedOptions,
|
|
4706
4705
|
print: (node) => {
|
|
4707
4706
|
const key = getKey(node);
|
|
4708
|
-
if (key === void 0) return
|
|
4707
|
+
if (key === void 0) return null;
|
|
4709
4708
|
const handler = nodes[key];
|
|
4710
|
-
if (!handler) return
|
|
4709
|
+
if (!handler) return null;
|
|
4711
4710
|
return handler.call(context, node);
|
|
4712
4711
|
}
|
|
4713
4712
|
};
|
|
@@ -4719,81 +4718,6 @@ function createPrinterFactory(getKey) {
|
|
|
4719
4718
|
};
|
|
4720
4719
|
};
|
|
4721
4720
|
}
|
|
4722
|
-
function narrowSchema(node, type) {
|
|
4723
|
-
return (node == null ? void 0 : node.type) === type ? node : void 0;
|
|
4724
|
-
}
|
|
4725
|
-
function isKind(kind) {
|
|
4726
|
-
return (node) => node.kind === kind;
|
|
4727
|
-
}
|
|
4728
|
-
const isOperationNode = isKind("Operation");
|
|
4729
|
-
const isSchemaNode = isKind("Schema");
|
|
4730
|
-
function toCamelOrPascal$f(text, pascal) {
|
|
4731
|
-
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
4732
|
-
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
4733
|
-
if (i === 0 && true) return word.charAt(0).toLowerCase() + word.slice(1);
|
|
4734
|
-
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
4735
|
-
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
4736
|
-
}
|
|
4737
|
-
function applyToFileParts$f(text, transformPart) {
|
|
4738
|
-
const parts = text.split(/\.(?=[a-zA-Z])/);
|
|
4739
|
-
return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
|
|
4740
|
-
}
|
|
4741
|
-
function camelCase$f(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
4742
|
-
if (isFile) return applyToFileParts$f(text, (part, isLast) => camelCase$f(part, isLast ? {
|
|
4743
|
-
prefix,
|
|
4744
|
-
suffix
|
|
4745
|
-
} : {}));
|
|
4746
|
-
return toCamelOrPascal$f(`${prefix} ${text} ${suffix}`);
|
|
4747
|
-
}
|
|
4748
|
-
function parseHex$1(color) {
|
|
4749
|
-
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
4750
|
-
return Number.isNaN(int) ? {
|
|
4751
|
-
r: 255,
|
|
4752
|
-
g: 255,
|
|
4753
|
-
b: 255
|
|
4754
|
-
} : {
|
|
4755
|
-
r: int >> 16 & 255,
|
|
4756
|
-
g: int >> 8 & 255,
|
|
4757
|
-
b: int & 255
|
|
4758
|
-
};
|
|
4759
|
-
}
|
|
4760
|
-
function hex$1(color) {
|
|
4761
|
-
const { r, g, b } = parseHex$1(color);
|
|
4762
|
-
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
|
|
4763
|
-
}
|
|
4764
|
-
hex$1("#F55A17"), hex$1("#F5A217"), hex$1("#F58517"), hex$1("#B45309"), hex$1("#FFFFFF"), hex$1("#adadc6"), hex$1("#FDA4AF");
|
|
4765
|
-
function isValidVarName$c(name) {
|
|
4766
|
-
try {
|
|
4767
|
-
new Function(`var ${name}`);
|
|
4768
|
-
} catch {
|
|
4769
|
-
return false;
|
|
4770
|
-
}
|
|
4771
|
-
return true;
|
|
4772
|
-
}
|
|
4773
|
-
const plainStringTypes = /* @__PURE__ */ new Set([
|
|
4774
|
-
"string",
|
|
4775
|
-
"uuid",
|
|
4776
|
-
"email",
|
|
4777
|
-
"url",
|
|
4778
|
-
"datetime"
|
|
4779
|
-
]);
|
|
4780
|
-
function isPlainStringType(node) {
|
|
4781
|
-
var _a;
|
|
4782
|
-
if (plainStringTypes.has(node.type)) return true;
|
|
4783
|
-
const temporal = (_a = narrowSchema(node, "date")) != null ? _a : narrowSchema(node, "time");
|
|
4784
|
-
if (temporal) return temporal.representation !== "date";
|
|
4785
|
-
return false;
|
|
4786
|
-
}
|
|
4787
|
-
function applyParamsCasing$1(params, casing) {
|
|
4788
|
-
if (!casing) return params;
|
|
4789
|
-
return params.map((param) => {
|
|
4790
|
-
const transformed = casing === "camelcase" || !isValidVarName$c(param.name) ? camelCase$f(param.name) : param.name;
|
|
4791
|
-
return {
|
|
4792
|
-
...param,
|
|
4793
|
-
name: transformed
|
|
4794
|
-
};
|
|
4795
|
-
});
|
|
4796
|
-
}
|
|
4797
4721
|
function createLimit(concurrency) {
|
|
4798
4722
|
let active = 0;
|
|
4799
4723
|
const queue = [];
|
|
@@ -5096,7 +5020,7 @@ function toError(value) {
|
|
|
5096
5020
|
}
|
|
5097
5021
|
var AsyncEventEmitter = (_a$c = class {
|
|
5098
5022
|
/**
|
|
5099
|
-
*
|
|
5023
|
+
* Maximum number of listeners per event before Node emits a memory-leak warning.
|
|
5100
5024
|
* @default 10
|
|
5101
5025
|
*/
|
|
5102
5026
|
constructor(maxListener = 10) {
|
|
@@ -5104,8 +5028,13 @@ var AsyncEventEmitter = (_a$c = class {
|
|
|
5104
5028
|
__privateGet$c(this, _emitter).setMaxListeners(maxListener);
|
|
5105
5029
|
}
|
|
5106
5030
|
/**
|
|
5107
|
-
* Emits
|
|
5031
|
+
* Emits `eventName` and awaits all registered listeners in parallel.
|
|
5108
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
|
+
* ```
|
|
5109
5038
|
*/
|
|
5110
5039
|
async emit(eventName, ...eventArgs) {
|
|
5111
5040
|
const listeners = __privateGet$c(this, _emitter).listeners(eventName);
|
|
@@ -5124,11 +5053,25 @@ var AsyncEventEmitter = (_a$c = class {
|
|
|
5124
5053
|
}
|
|
5125
5054
|
}));
|
|
5126
5055
|
}
|
|
5127
|
-
/**
|
|
5056
|
+
/**
|
|
5057
|
+
* Registers a persistent listener for `eventName`.
|
|
5058
|
+
*
|
|
5059
|
+
* @example
|
|
5060
|
+
* ```ts
|
|
5061
|
+
* emitter.on('build', async (name) => { console.log(name) })
|
|
5062
|
+
* ```
|
|
5063
|
+
*/
|
|
5128
5064
|
on(eventName, handler) {
|
|
5129
5065
|
__privateGet$c(this, _emitter).on(eventName, handler);
|
|
5130
5066
|
}
|
|
5131
|
-
/**
|
|
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
|
+
*/
|
|
5132
5075
|
onOnce(eventName, handler) {
|
|
5133
5076
|
const wrapper = (...args) => {
|
|
5134
5077
|
this.off(eventName, wrapper);
|
|
@@ -5136,11 +5079,25 @@ var AsyncEventEmitter = (_a$c = class {
|
|
|
5136
5079
|
};
|
|
5137
5080
|
this.on(eventName, wrapper);
|
|
5138
5081
|
}
|
|
5139
|
-
/**
|
|
5082
|
+
/**
|
|
5083
|
+
* Removes a previously registered listener.
|
|
5084
|
+
*
|
|
5085
|
+
* @example
|
|
5086
|
+
* ```ts
|
|
5087
|
+
* emitter.off('build', handler)
|
|
5088
|
+
* ```
|
|
5089
|
+
*/
|
|
5140
5090
|
off(eventName, handler) {
|
|
5141
5091
|
__privateGet$c(this, _emitter).off(eventName, handler);
|
|
5142
5092
|
}
|
|
5143
|
-
/**
|
|
5093
|
+
/**
|
|
5094
|
+
* Removes all listeners from every event channel.
|
|
5095
|
+
*
|
|
5096
|
+
* @example
|
|
5097
|
+
* ```ts
|
|
5098
|
+
* emitter.removeAll()
|
|
5099
|
+
* ```
|
|
5100
|
+
*/
|
|
5144
5101
|
removeAll() {
|
|
5145
5102
|
__privateGet$c(this, _emitter).removeAllListeners();
|
|
5146
5103
|
}
|
|
@@ -5180,23 +5137,6 @@ function formatMs(ms) {
|
|
|
5180
5137
|
if (ms >= 1e3) return `${(ms / 1e3).toFixed(2)}s`;
|
|
5181
5138
|
return `${Math.round(ms)}ms`;
|
|
5182
5139
|
}
|
|
5183
|
-
function parseHex(color) {
|
|
5184
|
-
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
5185
|
-
return Number.isNaN(int) ? {
|
|
5186
|
-
r: 255,
|
|
5187
|
-
g: 255,
|
|
5188
|
-
b: 255
|
|
5189
|
-
} : {
|
|
5190
|
-
r: int >> 16 & 255,
|
|
5191
|
-
g: int >> 8 & 255,
|
|
5192
|
-
b: int & 255
|
|
5193
|
-
};
|
|
5194
|
-
}
|
|
5195
|
-
function hex(color) {
|
|
5196
|
-
const { r, g, b } = parseHex(color);
|
|
5197
|
-
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
|
|
5198
|
-
}
|
|
5199
|
-
hex("#F55A17"), hex("#F5A217"), hex("#F58517"), hex("#B45309"), hex("#FFFFFF"), hex("#adadc6"), hex("#FDA4AF");
|
|
5200
5140
|
function toSlash(p) {
|
|
5201
5141
|
if (p.startsWith("\\\\?\\")) return p;
|
|
5202
5142
|
return p.replaceAll("\\", "/");
|
|
@@ -5215,16 +5155,16 @@ function readSync(path2) {
|
|
|
5215
5155
|
}
|
|
5216
5156
|
async function write(path2, data, options = {}) {
|
|
5217
5157
|
const trimmed = data.trim();
|
|
5218
|
-
if (trimmed === "") return
|
|
5158
|
+
if (trimmed === "") return null;
|
|
5219
5159
|
const resolved = resolve(path2);
|
|
5220
5160
|
if (typeof Bun !== "undefined") {
|
|
5221
5161
|
const file = Bun.file(resolved);
|
|
5222
|
-
if ((await file.exists() ? await file.text() : null) === trimmed) return
|
|
5162
|
+
if ((await file.exists() ? await file.text() : null) === trimmed) return null;
|
|
5223
5163
|
await Bun.write(resolved, trimmed);
|
|
5224
5164
|
return trimmed;
|
|
5225
5165
|
}
|
|
5226
5166
|
try {
|
|
5227
|
-
if (await readFile$1(resolved, { encoding: "utf-8" }) === trimmed) return
|
|
5167
|
+
if (await readFile$1(resolved, { encoding: "utf-8" }) === trimmed) return null;
|
|
5228
5168
|
} catch {
|
|
5229
5169
|
}
|
|
5230
5170
|
await mkdir(dirname(resolved), { recursive: true });
|
|
@@ -5360,17 +5300,32 @@ function isValidVarName$b(name) {
|
|
|
5360
5300
|
var URLPath$a = (_b$2 = class {
|
|
5361
5301
|
constructor(path2, options = {}) {
|
|
5362
5302
|
__privateAdd$c(this, _URLPath_instances$a);
|
|
5363
|
-
/**
|
|
5303
|
+
/**
|
|
5304
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
5305
|
+
*/
|
|
5364
5306
|
__publicField$b(this, "path");
|
|
5365
5307
|
__privateAdd$c(this, _options$c);
|
|
5366
5308
|
this.path = path2;
|
|
5367
5309
|
__privateSet$c(this, _options$c, options);
|
|
5368
5310
|
}
|
|
5369
|
-
/** 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
|
+
*/
|
|
5370
5318
|
get URL() {
|
|
5371
5319
|
return this.toURLPath();
|
|
5372
5320
|
}
|
|
5373
|
-
/** 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
|
+
*/
|
|
5374
5329
|
get isURL() {
|
|
5375
5330
|
try {
|
|
5376
5331
|
return !!new URL(this.path).href;
|
|
@@ -5388,11 +5343,25 @@ var URLPath$a = (_b$2 = class {
|
|
|
5388
5343
|
get template() {
|
|
5389
5344
|
return this.toTemplateString();
|
|
5390
5345
|
}
|
|
5391
|
-
/** 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
|
+
*/
|
|
5392
5354
|
get object() {
|
|
5393
5355
|
return this.toObject();
|
|
5394
5356
|
}
|
|
5395
|
-
/** 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
|
+
*/
|
|
5396
5365
|
get params() {
|
|
5397
5366
|
return this.getParams();
|
|
5398
5367
|
}
|
|
@@ -5426,6 +5395,12 @@ var URLPath$a = (_b$2 = class {
|
|
|
5426
5395
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
5427
5396
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
5428
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
|
+
* ```
|
|
5429
5404
|
*/
|
|
5430
5405
|
getParams(replacer) {
|
|
5431
5406
|
const params = {};
|
|
@@ -5435,14 +5410,22 @@ var URLPath$a = (_b$2 = class {
|
|
|
5435
5410
|
});
|
|
5436
5411
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
5437
5412
|
}
|
|
5438
|
-
/** 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
|
+
*/
|
|
5439
5420
|
toURLPath() {
|
|
5440
5421
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
5441
5422
|
}
|
|
5442
5423
|
}, _options$c = new WeakMap(), _URLPath_instances$a = new WeakSet(), transformParam_fn$a = function(raw) {
|
|
5443
5424
|
const param = isValidVarName$b(raw) ? raw : camelCase$e(raw);
|
|
5444
5425
|
return __privateGet$c(this, _options$c).casing === "camelcase" ? camelCase$e(param) : param;
|
|
5445
|
-
}, /**
|
|
5426
|
+
}, /**
|
|
5427
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
5428
|
+
*/
|
|
5446
5429
|
eachParam_fn$a = function(fn) {
|
|
5447
5430
|
for (const match2 of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
5448
5431
|
const raw = match2[1];
|
|
@@ -6124,7 +6107,7 @@ const fsStorage = createStorage(() => ({
|
|
|
6124
6107
|
await clean(resolve(base));
|
|
6125
6108
|
}
|
|
6126
6109
|
}));
|
|
6127
|
-
var version$1 = "5.0.0-alpha.
|
|
6110
|
+
var version$1 = "5.0.0-alpha.18";
|
|
6128
6111
|
function getDiagnosticInfo() {
|
|
6129
6112
|
return {
|
|
6130
6113
|
nodeVersion: version$2,
|
|
@@ -6682,6 +6665,7 @@ async function detectFormatter() {
|
|
|
6682
6665
|
"prettier"
|
|
6683
6666
|
]);
|
|
6684
6667
|
for (const formatter of formatterNames) if (await isFormatterAvailable(formatter)) return formatter;
|
|
6668
|
+
return null;
|
|
6685
6669
|
}
|
|
6686
6670
|
var TreeNode = (_f = class {
|
|
6687
6671
|
constructor(data, parent) {
|
|
@@ -6698,10 +6682,18 @@ var TreeNode = (_f = class {
|
|
|
6698
6682
|
this.children.push(child);
|
|
6699
6683
|
return child;
|
|
6700
6684
|
}
|
|
6685
|
+
/**
|
|
6686
|
+
* Returns the root ancestor of this node, walking up via `parent` links.
|
|
6687
|
+
*/
|
|
6701
6688
|
get root() {
|
|
6702
6689
|
if (!this.parent) return this;
|
|
6703
6690
|
return this.parent.root;
|
|
6704
6691
|
}
|
|
6692
|
+
/**
|
|
6693
|
+
* Returns all leaf descendants (nodes with no children) of this node.
|
|
6694
|
+
*
|
|
6695
|
+
* Results are cached after the first traversal.
|
|
6696
|
+
*/
|
|
6705
6697
|
get leaves() {
|
|
6706
6698
|
if (!this.children || this.children.length === 0) return [this];
|
|
6707
6699
|
if (__privateGet$c(this, _cachedLeaves)) return __privateGet$c(this, _cachedLeaves);
|
|
@@ -6732,6 +6724,12 @@ var TreeNode = (_f = class {
|
|
|
6732
6724
|
if (typeof callback !== "function") throw new TypeError("map() callback must be a function");
|
|
6733
6725
|
return this.leaves.map(callback);
|
|
6734
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
|
+
*/
|
|
6735
6733
|
static build(files, root) {
|
|
6736
6734
|
var _a2;
|
|
6737
6735
|
try {
|
|
@@ -6912,24 +6910,26 @@ async function detectLinter() {
|
|
|
6912
6910
|
"eslint"
|
|
6913
6911
|
]);
|
|
6914
6912
|
for (const linter of linterNames) if (await isLinterAvailable(linter)) return linter;
|
|
6913
|
+
return null;
|
|
6915
6914
|
}
|
|
6916
6915
|
function getPackageJSONSync(cwd) {
|
|
6917
6916
|
const pkgPath = pkg.up({ cwd });
|
|
6918
|
-
if (!pkgPath) return;
|
|
6917
|
+
if (!pkgPath) return null;
|
|
6919
6918
|
return JSON.parse(readSync(pkgPath));
|
|
6920
6919
|
}
|
|
6921
6920
|
function match(packageJSON, dependency) {
|
|
6921
|
+
var _a2;
|
|
6922
6922
|
const dependencies = {
|
|
6923
6923
|
...packageJSON.dependencies || {},
|
|
6924
6924
|
...packageJSON.devDependencies || {}
|
|
6925
6925
|
};
|
|
6926
6926
|
if (dependencies[dependency]) return dependencies[dependency];
|
|
6927
6927
|
const matched = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
6928
|
-
return matched ? dependencies[matched] :
|
|
6928
|
+
return matched ? (_a2 = dependencies[matched]) != null ? _a2 : null : null;
|
|
6929
6929
|
}
|
|
6930
6930
|
function getVersionSync(dependency, cwd) {
|
|
6931
6931
|
const packageJSON = getPackageJSONSync(cwd);
|
|
6932
|
-
return packageJSON ? match(packageJSON, dependency) :
|
|
6932
|
+
return packageJSON ? match(packageJSON, dependency) : null;
|
|
6933
6933
|
}
|
|
6934
6934
|
function satisfiesDependency(dependency, version2, cwd) {
|
|
6935
6935
|
const packageVersion = getVersionSync(dependency, cwd);
|
|
@@ -6940,7 +6940,7 @@ function satisfiesDependency(dependency, version2, cwd) {
|
|
|
6940
6940
|
return satisfies(semVer, version2);
|
|
6941
6941
|
}
|
|
6942
6942
|
|
|
6943
|
-
var version = "5.0.0-alpha.
|
|
6943
|
+
var version = "5.0.0-alpha.18";
|
|
6944
6944
|
|
|
6945
6945
|
function isCommandMessage(msg) {
|
|
6946
6946
|
return msg.type === "command";
|
|
@@ -7323,17 +7323,32 @@ function isValidVarName$a(name) {
|
|
|
7323
7323
|
var URLPath$9 = (_a$b = class {
|
|
7324
7324
|
constructor(path2, options = {}) {
|
|
7325
7325
|
__privateAdd$b(this, _URLPath_instances$9);
|
|
7326
|
-
/**
|
|
7326
|
+
/**
|
|
7327
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
7328
|
+
*/
|
|
7327
7329
|
__publicField$a(this, "path");
|
|
7328
7330
|
__privateAdd$b(this, _options$b);
|
|
7329
7331
|
this.path = path2;
|
|
7330
7332
|
__privateSet$b(this, _options$b, options);
|
|
7331
7333
|
}
|
|
7332
|
-
/** 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
|
+
*/
|
|
7333
7341
|
get URL() {
|
|
7334
7342
|
return this.toURLPath();
|
|
7335
7343
|
}
|
|
7336
|
-
/** 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
|
+
*/
|
|
7337
7352
|
get isURL() {
|
|
7338
7353
|
try {
|
|
7339
7354
|
return !!new URL(this.path).href;
|
|
@@ -7351,11 +7366,25 @@ var URLPath$9 = (_a$b = class {
|
|
|
7351
7366
|
get template() {
|
|
7352
7367
|
return this.toTemplateString();
|
|
7353
7368
|
}
|
|
7354
|
-
/** 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
|
+
*/
|
|
7355
7377
|
get object() {
|
|
7356
7378
|
return this.toObject();
|
|
7357
7379
|
}
|
|
7358
|
-
/** 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
|
+
*/
|
|
7359
7388
|
get params() {
|
|
7360
7389
|
return this.getParams();
|
|
7361
7390
|
}
|
|
@@ -7389,6 +7418,12 @@ var URLPath$9 = (_a$b = class {
|
|
|
7389
7418
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
7390
7419
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
7391
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
|
+
* ```
|
|
7392
7427
|
*/
|
|
7393
7428
|
getParams(replacer) {
|
|
7394
7429
|
const params = {};
|
|
@@ -7398,14 +7433,22 @@ var URLPath$9 = (_a$b = class {
|
|
|
7398
7433
|
});
|
|
7399
7434
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
7400
7435
|
}
|
|
7401
|
-
/** 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
|
+
*/
|
|
7402
7443
|
toURLPath() {
|
|
7403
7444
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
7404
7445
|
}
|
|
7405
7446
|
}, _options$b = new WeakMap(), _URLPath_instances$9 = new WeakSet(), transformParam_fn$9 = function(raw) {
|
|
7406
7447
|
const param = isValidVarName$a(raw) ? raw : camelCase$c(raw);
|
|
7407
7448
|
return __privateGet$b(this, _options$b).casing === "camelcase" ? camelCase$c(param) : param;
|
|
7408
|
-
}, /**
|
|
7449
|
+
}, /**
|
|
7450
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
7451
|
+
*/
|
|
7409
7452
|
eachParam_fn$9 = function(fn) {
|
|
7410
7453
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
7411
7454
|
const raw = match[1];
|
|
@@ -9228,17 +9271,32 @@ function isValidVarName$9(name) {
|
|
|
9228
9271
|
var URLPath$8 = (_a$9 = class {
|
|
9229
9272
|
constructor(path, options = {}) {
|
|
9230
9273
|
__privateAdd$9(this, _URLPath_instances$8);
|
|
9231
|
-
/**
|
|
9274
|
+
/**
|
|
9275
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
9276
|
+
*/
|
|
9232
9277
|
__publicField$8(this, "path");
|
|
9233
9278
|
__privateAdd$9(this, _options$9);
|
|
9234
9279
|
this.path = path;
|
|
9235
9280
|
__privateSet$9(this, _options$9, options);
|
|
9236
9281
|
}
|
|
9237
|
-
/** 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
|
+
*/
|
|
9238
9289
|
get URL() {
|
|
9239
9290
|
return this.toURLPath();
|
|
9240
9291
|
}
|
|
9241
|
-
/** 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
|
+
*/
|
|
9242
9300
|
get isURL() {
|
|
9243
9301
|
try {
|
|
9244
9302
|
return !!new URL(this.path).href;
|
|
@@ -9256,11 +9314,25 @@ var URLPath$8 = (_a$9 = class {
|
|
|
9256
9314
|
get template() {
|
|
9257
9315
|
return this.toTemplateString();
|
|
9258
9316
|
}
|
|
9259
|
-
/** 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
|
+
*/
|
|
9260
9325
|
get object() {
|
|
9261
9326
|
return this.toObject();
|
|
9262
9327
|
}
|
|
9263
|
-
/** 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
|
+
*/
|
|
9264
9336
|
get params() {
|
|
9265
9337
|
return this.getParams();
|
|
9266
9338
|
}
|
|
@@ -9294,6 +9366,12 @@ var URLPath$8 = (_a$9 = class {
|
|
|
9294
9366
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
9295
9367
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
9296
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
|
+
* ```
|
|
9297
9375
|
*/
|
|
9298
9376
|
getParams(replacer) {
|
|
9299
9377
|
const params = {};
|
|
@@ -9303,14 +9381,22 @@ var URLPath$8 = (_a$9 = class {
|
|
|
9303
9381
|
});
|
|
9304
9382
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
9305
9383
|
}
|
|
9306
|
-
/** 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
|
+
*/
|
|
9307
9391
|
toURLPath() {
|
|
9308
9392
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
9309
9393
|
}
|
|
9310
9394
|
}, _options$9 = new WeakMap(), _URLPath_instances$8 = new WeakSet(), transformParam_fn$8 = function(raw) {
|
|
9311
9395
|
const param = isValidVarName$9(raw) ? raw : camelCase$d(raw);
|
|
9312
9396
|
return __privateGet$9(this, _options$9).casing === "camelcase" ? camelCase$d(param) : param;
|
|
9313
|
-
}, /**
|
|
9397
|
+
}, /**
|
|
9398
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
9399
|
+
*/
|
|
9314
9400
|
eachParam_fn$8 = function(fn) {
|
|
9315
9401
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
9316
9402
|
const raw = match[1];
|
|
@@ -9467,17 +9553,32 @@ function isValidVarName$8(name) {
|
|
|
9467
9553
|
var URLPath$7 = (_a$8 = class {
|
|
9468
9554
|
constructor(path, options = {}) {
|
|
9469
9555
|
__privateAdd$8(this, _URLPath_instances$7);
|
|
9470
|
-
/**
|
|
9556
|
+
/**
|
|
9557
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
9558
|
+
*/
|
|
9471
9559
|
__publicField$7(this, "path");
|
|
9472
9560
|
__privateAdd$8(this, _options$8);
|
|
9473
9561
|
this.path = path;
|
|
9474
9562
|
__privateSet$8(this, _options$8, options);
|
|
9475
9563
|
}
|
|
9476
|
-
/** 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
|
+
*/
|
|
9477
9571
|
get URL() {
|
|
9478
9572
|
return this.toURLPath();
|
|
9479
9573
|
}
|
|
9480
|
-
/** 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
|
+
*/
|
|
9481
9582
|
get isURL() {
|
|
9482
9583
|
try {
|
|
9483
9584
|
return !!new URL(this.path).href;
|
|
@@ -9495,11 +9596,25 @@ var URLPath$7 = (_a$8 = class {
|
|
|
9495
9596
|
get template() {
|
|
9496
9597
|
return this.toTemplateString();
|
|
9497
9598
|
}
|
|
9498
|
-
/** 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
|
+
*/
|
|
9499
9607
|
get object() {
|
|
9500
9608
|
return this.toObject();
|
|
9501
9609
|
}
|
|
9502
|
-
/** 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
|
+
*/
|
|
9503
9618
|
get params() {
|
|
9504
9619
|
return this.getParams();
|
|
9505
9620
|
}
|
|
@@ -9533,6 +9648,12 @@ var URLPath$7 = (_a$8 = class {
|
|
|
9533
9648
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
9534
9649
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
9535
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
|
+
* ```
|
|
9536
9657
|
*/
|
|
9537
9658
|
getParams(replacer) {
|
|
9538
9659
|
const params = {};
|
|
@@ -9542,14 +9663,22 @@ var URLPath$7 = (_a$8 = class {
|
|
|
9542
9663
|
});
|
|
9543
9664
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
9544
9665
|
}
|
|
9545
|
-
/** 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
|
+
*/
|
|
9546
9673
|
toURLPath() {
|
|
9547
9674
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
9548
9675
|
}
|
|
9549
9676
|
}, _options$8 = new WeakMap(), _URLPath_instances$7 = new WeakSet(), transformParam_fn$7 = function(raw) {
|
|
9550
9677
|
const param = isValidVarName$8(raw) ? raw : camelCase$b(raw);
|
|
9551
9678
|
return __privateGet$8(this, _options$8).casing === "camelcase" ? camelCase$b(param) : param;
|
|
9552
|
-
}, /**
|
|
9679
|
+
}, /**
|
|
9680
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
9681
|
+
*/
|
|
9553
9682
|
eachParam_fn$7 = function(fn) {
|
|
9554
9683
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
9555
9684
|
const raw = match[1];
|
|
@@ -209510,12 +209639,15 @@ const printerTs = definePrinter((options) => {
|
|
|
209510
209639
|
union(node) {
|
|
209511
209640
|
var _a, _b, _c;
|
|
209512
209641
|
const members = (_a = node.members) != null ? _a : [];
|
|
209513
|
-
const hasStringLiteral = members.some((m) =>
|
|
209514
|
-
|
|
209642
|
+
const hasStringLiteral = members.some((m) => {
|
|
209643
|
+
var _a2;
|
|
209644
|
+
return ((_a2 = narrowSchema(m, schemaTypes.enum)) == null ? void 0 : _a2.primitive) === "string";
|
|
209645
|
+
});
|
|
209646
|
+
const hasPlainString = members.some((m) => isStringType(m));
|
|
209515
209647
|
if (hasStringLiteral && hasPlainString) return (_b = createUnionDeclaration({
|
|
209516
209648
|
withParentheses: true,
|
|
209517
209649
|
nodes: members.map((m) => {
|
|
209518
|
-
if (
|
|
209650
|
+
if (isStringType(m)) return createIntersectionDeclaration({
|
|
209519
209651
|
nodes: [keywordTypeNodes.string, createTypeLiteralNode([])],
|
|
209520
209652
|
withParentheses: true
|
|
209521
209653
|
});
|
|
@@ -209647,7 +209779,8 @@ function Enum({ node, enumType, enumKeyCasing, resolver }) {
|
|
|
209647
209779
|
function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, syntaxType, enumType, enumKeyCasing, description, resolver }) {
|
|
209648
209780
|
const resolvedDescription = description || (node == null ? void 0 : node.description);
|
|
209649
209781
|
const enumSchemaNodes = collect(node, { schema(n) {
|
|
209650
|
-
|
|
209782
|
+
const enumNode = narrowSchema(n, schemaTypes.enum);
|
|
209783
|
+
if (enumNode == null ? void 0 : enumNode.name) return enumNode;
|
|
209651
209784
|
} });
|
|
209652
209785
|
const typeNode = printerTs({
|
|
209653
209786
|
optionalType,
|
|
@@ -209987,8 +210120,9 @@ function buildLegacyResponseUnionSchemaNode({ node, resolver }) {
|
|
|
209987
210120
|
function nameUnnamedEnums(node, parentName) {
|
|
209988
210121
|
return transform(node, {
|
|
209989
210122
|
schema(n) {
|
|
209990
|
-
|
|
209991
|
-
|
|
210123
|
+
const enumNode = narrowSchema(n, "enum");
|
|
210124
|
+
if (enumNode && !enumNode.name) return {
|
|
210125
|
+
...enumNode,
|
|
209992
210126
|
name: pascalCase$6([parentName, "enum"].join(" "))
|
|
209993
210127
|
};
|
|
209994
210128
|
},
|
|
@@ -210022,7 +210156,7 @@ const typeGenerator = defineGenerator({
|
|
|
210022
210156
|
mode,
|
|
210023
210157
|
options: { group: group ? group.type === "tag" ? { tag: (_a = node.tags[0]) != null ? _a : "default" } : { path: node.path } : void 0 }
|
|
210024
210158
|
});
|
|
210025
|
-
const params =
|
|
210159
|
+
const params = caseParams(node.parameters, paramsCasing);
|
|
210026
210160
|
function renderSchemaType({ node: schemaNode, name, typedName, description, keysToOmit }) {
|
|
210027
210161
|
if (!schemaNode) return null;
|
|
210028
210162
|
const transformedNode = transform(schemaNode, composeTransformers(...transformers));
|
|
@@ -210217,7 +210351,7 @@ const typeGenerator = defineGenerator({
|
|
|
210217
210351
|
mode
|
|
210218
210352
|
}).path
|
|
210219
210353
|
}));
|
|
210220
|
-
const isEnumSchema = node.
|
|
210354
|
+
const isEnumSchema = !!narrowSchema(node, schemaTypes.enum);
|
|
210221
210355
|
const typedName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyTypedName(node) : resolver.resolveTypedName(node.name);
|
|
210222
210356
|
const type = {
|
|
210223
210357
|
name: resolver.resolveName(node.name),
|
|
@@ -211963,17 +212097,32 @@ function isValidVarName$7(name) {
|
|
|
211963
212097
|
var URLPath$6 = (_a$6 = class {
|
|
211964
212098
|
constructor(path, options = {}) {
|
|
211965
212099
|
__privateAdd$6(this, _URLPath_instances$6);
|
|
211966
|
-
/**
|
|
212100
|
+
/**
|
|
212101
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
212102
|
+
*/
|
|
211967
212103
|
__publicField$6(this, "path");
|
|
211968
212104
|
__privateAdd$6(this, _options$6);
|
|
211969
212105
|
this.path = path;
|
|
211970
212106
|
__privateSet$6(this, _options$6, options);
|
|
211971
212107
|
}
|
|
211972
|
-
/** 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
|
+
*/
|
|
211973
212115
|
get URL() {
|
|
211974
212116
|
return this.toURLPath();
|
|
211975
212117
|
}
|
|
211976
|
-
/** 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
|
+
*/
|
|
211977
212126
|
get isURL() {
|
|
211978
212127
|
try {
|
|
211979
212128
|
return !!new URL(this.path).href;
|
|
@@ -211991,11 +212140,25 @@ var URLPath$6 = (_a$6 = class {
|
|
|
211991
212140
|
get template() {
|
|
211992
212141
|
return this.toTemplateString();
|
|
211993
212142
|
}
|
|
211994
|
-
/** 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
|
+
*/
|
|
211995
212151
|
get object() {
|
|
211996
212152
|
return this.toObject();
|
|
211997
212153
|
}
|
|
211998
|
-
/** 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
|
+
*/
|
|
211999
212162
|
get params() {
|
|
212000
212163
|
return this.getParams();
|
|
212001
212164
|
}
|
|
@@ -212029,6 +212192,12 @@ var URLPath$6 = (_a$6 = class {
|
|
|
212029
212192
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
212030
212193
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
212031
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
|
+
* ```
|
|
212032
212201
|
*/
|
|
212033
212202
|
getParams(replacer) {
|
|
212034
212203
|
const params = {};
|
|
@@ -212038,14 +212207,22 @@ var URLPath$6 = (_a$6 = class {
|
|
|
212038
212207
|
});
|
|
212039
212208
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
212040
212209
|
}
|
|
212041
|
-
/** 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
|
+
*/
|
|
212042
212217
|
toURLPath() {
|
|
212043
212218
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
212044
212219
|
}
|
|
212045
212220
|
}, _options$6 = new WeakMap(), _URLPath_instances$6 = new WeakSet(), transformParam_fn$6 = function(raw) {
|
|
212046
212221
|
const param = isValidVarName$7(raw) ? raw : camelCase$8(raw);
|
|
212047
212222
|
return __privateGet$6(this, _options$6).casing === "camelcase" ? camelCase$8(param) : param;
|
|
212048
|
-
}, /**
|
|
212223
|
+
}, /**
|
|
212224
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
212225
|
+
*/
|
|
212049
212226
|
eachParam_fn$6 = function(fn) {
|
|
212050
212227
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
212051
212228
|
const raw = match[1];
|
|
@@ -213498,17 +213675,32 @@ function isValidVarName$5(name) {
|
|
|
213498
213675
|
var URLPath$5 = (_a$5 = class {
|
|
213499
213676
|
constructor(path, options = {}) {
|
|
213500
213677
|
__privateAdd$5(this, _URLPath_instances$5);
|
|
213501
|
-
/**
|
|
213678
|
+
/**
|
|
213679
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
213680
|
+
*/
|
|
213502
213681
|
__publicField$5(this, "path");
|
|
213503
213682
|
__privateAdd$5(this, _options$5);
|
|
213504
213683
|
this.path = path;
|
|
213505
213684
|
__privateSet$5(this, _options$5, options);
|
|
213506
213685
|
}
|
|
213507
|
-
/** 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
|
+
*/
|
|
213508
213693
|
get URL() {
|
|
213509
213694
|
return this.toURLPath();
|
|
213510
213695
|
}
|
|
213511
|
-
/** 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
|
+
*/
|
|
213512
213704
|
get isURL() {
|
|
213513
213705
|
try {
|
|
213514
213706
|
return !!new URL(this.path).href;
|
|
@@ -213526,11 +213718,25 @@ var URLPath$5 = (_a$5 = class {
|
|
|
213526
213718
|
get template() {
|
|
213527
213719
|
return this.toTemplateString();
|
|
213528
213720
|
}
|
|
213529
|
-
/** 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
|
+
*/
|
|
213530
213729
|
get object() {
|
|
213531
213730
|
return this.toObject();
|
|
213532
213731
|
}
|
|
213533
|
-
/** 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
|
+
*/
|
|
213534
213740
|
get params() {
|
|
213535
213741
|
return this.getParams();
|
|
213536
213742
|
}
|
|
@@ -213564,6 +213770,12 @@ var URLPath$5 = (_a$5 = class {
|
|
|
213564
213770
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
213565
213771
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
213566
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
|
+
* ```
|
|
213567
213779
|
*/
|
|
213568
213780
|
getParams(replacer) {
|
|
213569
213781
|
const params = {};
|
|
@@ -213573,14 +213785,22 @@ var URLPath$5 = (_a$5 = class {
|
|
|
213573
213785
|
});
|
|
213574
213786
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
213575
213787
|
}
|
|
213576
|
-
/** 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
|
+
*/
|
|
213577
213795
|
toURLPath() {
|
|
213578
213796
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
213579
213797
|
}
|
|
213580
213798
|
}, _options$5 = new WeakMap(), _URLPath_instances$5 = new WeakSet(), transformParam_fn$5 = function(raw) {
|
|
213581
213799
|
const param = isValidVarName$5(raw) ? raw : camelCase$5(raw);
|
|
213582
213800
|
return __privateGet$5(this, _options$5).casing === "camelcase" ? camelCase$5(param) : param;
|
|
213583
|
-
}, /**
|
|
213801
|
+
}, /**
|
|
213802
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
213803
|
+
*/
|
|
213584
213804
|
eachParam_fn$5 = function(fn) {
|
|
213585
213805
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
213586
213806
|
const raw = match[1];
|
|
@@ -213960,7 +214180,7 @@ function pascalCase$4(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
|
213960
214180
|
}
|
|
213961
214181
|
function getNestedAccessor$1(param, accessor) {
|
|
213962
214182
|
const parts = Array.isArray(param) ? param : param.split(".");
|
|
213963
|
-
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return
|
|
214183
|
+
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return null;
|
|
213964
214184
|
return `${accessor}?.['${`${parts.join("']?.['")}']`}`;
|
|
213965
214185
|
}
|
|
213966
214186
|
function isValidVarName$4(name) {
|
|
@@ -213974,17 +214194,32 @@ function isValidVarName$4(name) {
|
|
|
213974
214194
|
var URLPath$4 = (_a$4 = class {
|
|
213975
214195
|
constructor(path, options = {}) {
|
|
213976
214196
|
__privateAdd$4(this, _URLPath_instances$4);
|
|
213977
|
-
/**
|
|
214197
|
+
/**
|
|
214198
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
214199
|
+
*/
|
|
213978
214200
|
__publicField$4(this, "path");
|
|
213979
214201
|
__privateAdd$4(this, _options$4);
|
|
213980
214202
|
this.path = path;
|
|
213981
214203
|
__privateSet$4(this, _options$4, options);
|
|
213982
214204
|
}
|
|
213983
|
-
/** 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
|
+
*/
|
|
213984
214212
|
get URL() {
|
|
213985
214213
|
return this.toURLPath();
|
|
213986
214214
|
}
|
|
213987
|
-
/** 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
|
+
*/
|
|
213988
214223
|
get isURL() {
|
|
213989
214224
|
try {
|
|
213990
214225
|
return !!new URL(this.path).href;
|
|
@@ -214002,11 +214237,25 @@ var URLPath$4 = (_a$4 = class {
|
|
|
214002
214237
|
get template() {
|
|
214003
214238
|
return this.toTemplateString();
|
|
214004
214239
|
}
|
|
214005
|
-
/** 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
|
+
*/
|
|
214006
214248
|
get object() {
|
|
214007
214249
|
return this.toObject();
|
|
214008
214250
|
}
|
|
214009
|
-
/** 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
|
+
*/
|
|
214010
214259
|
get params() {
|
|
214011
214260
|
return this.getParams();
|
|
214012
214261
|
}
|
|
@@ -214040,6 +214289,12 @@ var URLPath$4 = (_a$4 = class {
|
|
|
214040
214289
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
214041
214290
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
214042
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
|
+
* ```
|
|
214043
214298
|
*/
|
|
214044
214299
|
getParams(replacer) {
|
|
214045
214300
|
const params = {};
|
|
@@ -214049,14 +214304,22 @@ var URLPath$4 = (_a$4 = class {
|
|
|
214049
214304
|
});
|
|
214050
214305
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
214051
214306
|
}
|
|
214052
|
-
/** 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
|
+
*/
|
|
214053
214314
|
toURLPath() {
|
|
214054
214315
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
214055
214316
|
}
|
|
214056
214317
|
}, _options$4 = new WeakMap(), _URLPath_instances$4 = new WeakSet(), transformParam_fn$4 = function(raw) {
|
|
214057
214318
|
const param = isValidVarName$4(raw) ? raw : camelCase$4(raw);
|
|
214058
214319
|
return __privateGet$4(this, _options$4).casing === "camelcase" ? camelCase$4(param) : param;
|
|
214059
|
-
}, /**
|
|
214320
|
+
}, /**
|
|
214321
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
214322
|
+
*/
|
|
214060
214323
|
eachParam_fn$4 = function(fn) {
|
|
214061
214324
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
214062
214325
|
const raw = match[1];
|
|
@@ -217044,17 +217307,32 @@ function isValidVarName$3(name) {
|
|
|
217044
217307
|
var URLPath$3 = (_a$3 = class {
|
|
217045
217308
|
constructor(path, options = {}) {
|
|
217046
217309
|
__privateAdd$3(this, _URLPath_instances$3);
|
|
217047
|
-
/**
|
|
217310
|
+
/**
|
|
217311
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
217312
|
+
*/
|
|
217048
217313
|
__publicField$3(this, "path");
|
|
217049
217314
|
__privateAdd$3(this, _options$3);
|
|
217050
217315
|
this.path = path;
|
|
217051
217316
|
__privateSet$3(this, _options$3, options);
|
|
217052
217317
|
}
|
|
217053
|
-
/** 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
|
+
*/
|
|
217054
217325
|
get URL() {
|
|
217055
217326
|
return this.toURLPath();
|
|
217056
217327
|
}
|
|
217057
|
-
/** 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
|
+
*/
|
|
217058
217336
|
get isURL() {
|
|
217059
217337
|
try {
|
|
217060
217338
|
return !!new URL(this.path).href;
|
|
@@ -217072,11 +217350,25 @@ var URLPath$3 = (_a$3 = class {
|
|
|
217072
217350
|
get template() {
|
|
217073
217351
|
return this.toTemplateString();
|
|
217074
217352
|
}
|
|
217075
|
-
/** 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
|
+
*/
|
|
217076
217361
|
get object() {
|
|
217077
217362
|
return this.toObject();
|
|
217078
217363
|
}
|
|
217079
|
-
/** 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
|
+
*/
|
|
217080
217372
|
get params() {
|
|
217081
217373
|
return this.getParams();
|
|
217082
217374
|
}
|
|
@@ -217110,6 +217402,12 @@ var URLPath$3 = (_a$3 = class {
|
|
|
217110
217402
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
217111
217403
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
217112
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
|
+
* ```
|
|
217113
217411
|
*/
|
|
217114
217412
|
getParams(replacer) {
|
|
217115
217413
|
const params = {};
|
|
@@ -217119,14 +217417,22 @@ var URLPath$3 = (_a$3 = class {
|
|
|
217119
217417
|
});
|
|
217120
217418
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
217121
217419
|
}
|
|
217122
|
-
/** 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
|
+
*/
|
|
217123
217427
|
toURLPath() {
|
|
217124
217428
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
217125
217429
|
}
|
|
217126
217430
|
}, _options$3 = new WeakMap(), _URLPath_instances$3 = new WeakSet(), transformParam_fn$3 = function(raw) {
|
|
217127
217431
|
const param = isValidVarName$3(raw) ? raw : camelCase$3(raw);
|
|
217128
217432
|
return __privateGet$3(this, _options$3).casing === "camelcase" ? camelCase$3(param) : param;
|
|
217129
|
-
}, /**
|
|
217433
|
+
}, /**
|
|
217434
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
217435
|
+
*/
|
|
217130
217436
|
eachParam_fn$3 = function(fn) {
|
|
217131
217437
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
217132
217438
|
const raw = match[1];
|
|
@@ -218194,17 +218500,32 @@ function isValidVarName$2(name) {
|
|
|
218194
218500
|
var URLPath$2 = (_a$2 = class {
|
|
218195
218501
|
constructor(path, options = {}) {
|
|
218196
218502
|
__privateAdd$2(this, _URLPath_instances$2);
|
|
218197
|
-
/**
|
|
218503
|
+
/**
|
|
218504
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
218505
|
+
*/
|
|
218198
218506
|
__publicField$2(this, "path");
|
|
218199
218507
|
__privateAdd$2(this, _options$2);
|
|
218200
218508
|
this.path = path;
|
|
218201
218509
|
__privateSet$2(this, _options$2, options);
|
|
218202
218510
|
}
|
|
218203
|
-
/** 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
|
+
*/
|
|
218204
218518
|
get URL() {
|
|
218205
218519
|
return this.toURLPath();
|
|
218206
218520
|
}
|
|
218207
|
-
/** 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
|
+
*/
|
|
218208
218529
|
get isURL() {
|
|
218209
218530
|
try {
|
|
218210
218531
|
return !!new URL(this.path).href;
|
|
@@ -218222,11 +218543,25 @@ var URLPath$2 = (_a$2 = class {
|
|
|
218222
218543
|
get template() {
|
|
218223
218544
|
return this.toTemplateString();
|
|
218224
218545
|
}
|
|
218225
|
-
/** 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
|
+
*/
|
|
218226
218554
|
get object() {
|
|
218227
218555
|
return this.toObject();
|
|
218228
218556
|
}
|
|
218229
|
-
/** 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
|
+
*/
|
|
218230
218565
|
get params() {
|
|
218231
218566
|
return this.getParams();
|
|
218232
218567
|
}
|
|
@@ -218260,6 +218595,12 @@ var URLPath$2 = (_a$2 = class {
|
|
|
218260
218595
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
218261
218596
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
218262
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
|
+
* ```
|
|
218263
218604
|
*/
|
|
218264
218605
|
getParams(replacer) {
|
|
218265
218606
|
const params = {};
|
|
@@ -218269,14 +218610,22 @@ var URLPath$2 = (_a$2 = class {
|
|
|
218269
218610
|
});
|
|
218270
218611
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
218271
218612
|
}
|
|
218272
|
-
/** 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
|
+
*/
|
|
218273
218620
|
toURLPath() {
|
|
218274
218621
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
218275
218622
|
}
|
|
218276
218623
|
}, _options$2 = new WeakMap(), _URLPath_instances$2 = new WeakSet(), transformParam_fn$2 = function(raw) {
|
|
218277
218624
|
const param = isValidVarName$2(raw) ? raw : camelCase$2(raw);
|
|
218278
218625
|
return __privateGet$2(this, _options$2).casing === "camelcase" ? camelCase$2(param) : param;
|
|
218279
|
-
}, /**
|
|
218626
|
+
}, /**
|
|
218627
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
218628
|
+
*/
|
|
218280
218629
|
eachParam_fn$2 = function(fn) {
|
|
218281
218630
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
218282
218631
|
const raw = match[1];
|
|
@@ -219344,17 +219693,32 @@ function isValidVarName$1(name) {
|
|
|
219344
219693
|
var URLPath$1 = (_a$1 = class {
|
|
219345
219694
|
constructor(path, options = {}) {
|
|
219346
219695
|
__privateAdd$1(this, _URLPath_instances$1);
|
|
219347
|
-
/**
|
|
219696
|
+
/**
|
|
219697
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
219698
|
+
*/
|
|
219348
219699
|
__publicField$1(this, "path");
|
|
219349
219700
|
__privateAdd$1(this, _options$1);
|
|
219350
219701
|
this.path = path;
|
|
219351
219702
|
__privateSet$1(this, _options$1, options);
|
|
219352
219703
|
}
|
|
219353
|
-
/** 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
|
+
*/
|
|
219354
219711
|
get URL() {
|
|
219355
219712
|
return this.toURLPath();
|
|
219356
219713
|
}
|
|
219357
|
-
/** 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
|
+
*/
|
|
219358
219722
|
get isURL() {
|
|
219359
219723
|
try {
|
|
219360
219724
|
return !!new URL(this.path).href;
|
|
@@ -219372,11 +219736,25 @@ var URLPath$1 = (_a$1 = class {
|
|
|
219372
219736
|
get template() {
|
|
219373
219737
|
return this.toTemplateString();
|
|
219374
219738
|
}
|
|
219375
|
-
/** 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
|
+
*/
|
|
219376
219747
|
get object() {
|
|
219377
219748
|
return this.toObject();
|
|
219378
219749
|
}
|
|
219379
|
-
/** 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
|
+
*/
|
|
219380
219758
|
get params() {
|
|
219381
219759
|
return this.getParams();
|
|
219382
219760
|
}
|
|
@@ -219410,6 +219788,12 @@ var URLPath$1 = (_a$1 = class {
|
|
|
219410
219788
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
219411
219789
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
219412
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
|
+
* ```
|
|
219413
219797
|
*/
|
|
219414
219798
|
getParams(replacer) {
|
|
219415
219799
|
const params = {};
|
|
@@ -219419,14 +219803,22 @@ var URLPath$1 = (_a$1 = class {
|
|
|
219419
219803
|
});
|
|
219420
219804
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
219421
219805
|
}
|
|
219422
|
-
/** 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
|
+
*/
|
|
219423
219813
|
toURLPath() {
|
|
219424
219814
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
219425
219815
|
}
|
|
219426
219816
|
}, _options$1 = new WeakMap(), _URLPath_instances$1 = new WeakSet(), transformParam_fn$1 = function(raw) {
|
|
219427
219817
|
const param = isValidVarName$1(raw) ? raw : camelCase$1(raw);
|
|
219428
219818
|
return __privateGet$1(this, _options$1).casing === "camelcase" ? camelCase$1(param) : param;
|
|
219429
|
-
}, /**
|
|
219819
|
+
}, /**
|
|
219820
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
219821
|
+
*/
|
|
219430
219822
|
eachParam_fn$1 = function(fn) {
|
|
219431
219823
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
219432
219824
|
const raw = match[1];
|
|
@@ -220507,7 +220899,7 @@ function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
|
220507
220899
|
}
|
|
220508
220900
|
function getNestedAccessor(param, accessor) {
|
|
220509
220901
|
const parts = Array.isArray(param) ? param : param.split(".");
|
|
220510
|
-
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return
|
|
220902
|
+
if (parts.length === 0 || parts.length === 1 && parts[0] === "") return null;
|
|
220511
220903
|
return `${accessor}?.['${`${parts.join("']?.['")}']`}`;
|
|
220512
220904
|
}
|
|
220513
220905
|
function isValidVarName(name) {
|
|
@@ -220521,17 +220913,32 @@ function isValidVarName(name) {
|
|
|
220521
220913
|
var URLPath = (_a = class {
|
|
220522
220914
|
constructor(path, options = {}) {
|
|
220523
220915
|
__privateAdd(this, _URLPath_instances);
|
|
220524
|
-
/**
|
|
220916
|
+
/**
|
|
220917
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
220918
|
+
*/
|
|
220525
220919
|
__publicField(this, "path");
|
|
220526
220920
|
__privateAdd(this, _options);
|
|
220527
220921
|
this.path = path;
|
|
220528
220922
|
__privateSet(this, _options, options);
|
|
220529
220923
|
}
|
|
220530
|
-
/** 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
|
+
*/
|
|
220531
220931
|
get URL() {
|
|
220532
220932
|
return this.toURLPath();
|
|
220533
220933
|
}
|
|
220534
|
-
/** 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
|
+
*/
|
|
220535
220942
|
get isURL() {
|
|
220536
220943
|
try {
|
|
220537
220944
|
return !!new URL(this.path).href;
|
|
@@ -220549,11 +220956,25 @@ var URLPath = (_a = class {
|
|
|
220549
220956
|
get template() {
|
|
220550
220957
|
return this.toTemplateString();
|
|
220551
220958
|
}
|
|
220552
|
-
/** 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
|
+
*/
|
|
220553
220967
|
get object() {
|
|
220554
220968
|
return this.toObject();
|
|
220555
220969
|
}
|
|
220556
|
-
/** 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
|
+
*/
|
|
220557
220978
|
get params() {
|
|
220558
220979
|
return this.getParams();
|
|
220559
220980
|
}
|
|
@@ -220587,6 +221008,12 @@ var URLPath = (_a = class {
|
|
|
220587
221008
|
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
220588
221009
|
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
220589
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
|
+
* ```
|
|
220590
221017
|
*/
|
|
220591
221018
|
getParams(replacer) {
|
|
220592
221019
|
const params = {};
|
|
@@ -220596,14 +221023,22 @@ var URLPath = (_a = class {
|
|
|
220596
221023
|
});
|
|
220597
221024
|
return Object.keys(params).length > 0 ? params : void 0;
|
|
220598
221025
|
}
|
|
220599
|
-
/** 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
|
+
*/
|
|
220600
221033
|
toURLPath() {
|
|
220601
221034
|
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
220602
221035
|
}
|
|
220603
221036
|
}, _options = new WeakMap(), _URLPath_instances = new WeakSet(), transformParam_fn = function(raw) {
|
|
220604
221037
|
const param = isValidVarName(raw) ? raw : camelCase(raw);
|
|
220605
221038
|
return __privateGet(this, _options).casing === "camelcase" ? camelCase(param) : param;
|
|
220606
|
-
}, /**
|
|
221039
|
+
}, /**
|
|
221040
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
221041
|
+
*/
|
|
220607
221042
|
eachParam_fn = function(fn) {
|
|
220608
221043
|
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
220609
221044
|
const raw = match[1];
|
|
@@ -222478,7 +222913,7 @@ async function connectToStudio(options) {
|
|
|
222478
222913
|
initialSession,
|
|
222479
222914
|
nitro
|
|
222480
222915
|
} = options;
|
|
222481
|
-
const events = new AsyncEventEmitter
|
|
222916
|
+
const events = new AsyncEventEmitter();
|
|
222482
222917
|
let currentSource;
|
|
222483
222918
|
async function reconnect() {
|
|
222484
222919
|
logger.info(`Retrying connection in ${formatMs$1(retryInterval)} to Kubb Studio ...`);
|