@hey-api/openapi-ts 0.94.3 → 0.94.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/clients/angular/utils.ts +1 -1
- package/dist/clients/axios/utils.ts +2 -2
- package/dist/clients/core/types.ts +1 -1
- package/dist/clients/core/utils.ts +1 -1
- package/dist/clients/fetch/utils.ts +1 -1
- package/dist/clients/next/utils.ts +1 -1
- package/dist/clients/nuxt/utils.ts +1 -1
- package/dist/clients/ofetch/utils.ts +1 -1
- package/dist/index.d.mts +630 -452
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{init-OaZZcRie.mjs → init-DXg2DSyt.mjs} +837 -493
- package/dist/init-DXg2DSyt.mjs.map +1 -0
- package/dist/internal.mjs +1 -1
- package/dist/run.mjs +5 -5
- package/dist/run.mjs.map +1 -1
- package/dist/{src-CwAmA-wp.mjs → src-onOyaUFS.mjs} +3 -3
- package/dist/src-onOyaUFS.mjs.map +1 -0
- package/package.json +6 -5
- package/dist/init-OaZZcRie.mjs.map +0 -1
- package/dist/src-CwAmA-wp.mjs.map +0 -1
|
@@ -300,7 +300,7 @@ function resolveHttpRequests(config, context) {
|
|
|
300
300
|
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region src/plugins/@angular/common/httpRequests/resolve.ts
|
|
303
|
-
function resolvePath$
|
|
303
|
+
function resolvePath$3(plugin) {
|
|
304
304
|
if (plugin.config.httpRequests.nesting === "id") return OperationPath.id();
|
|
305
305
|
if (plugin.config.httpRequests.nesting === "operationId") return OperationPath.fromOperationId({
|
|
306
306
|
delimiters: plugin.config.httpRequests.nestingDelimiters,
|
|
@@ -309,17 +309,17 @@ function resolvePath$2(plugin) {
|
|
|
309
309
|
return plugin.config.httpRequests.nesting;
|
|
310
310
|
}
|
|
311
311
|
function resolveHttpRequestsStrategy(plugin) {
|
|
312
|
-
if (plugin.config.httpRequests.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath$
|
|
312
|
+
if (plugin.config.httpRequests.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath$3(plugin)(operation).join(".")] });
|
|
313
313
|
if (plugin.config.httpRequests.strategy === "single") {
|
|
314
314
|
const root = plugin.config.httpRequests.containerName;
|
|
315
315
|
return OperationStrategy.single({
|
|
316
|
-
path: resolvePath$
|
|
316
|
+
path: resolvePath$3(plugin),
|
|
317
317
|
root: typeof root.name === "string" ? root.name : root.name?.("") ?? ""
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
320
|
if (plugin.config.httpRequests.strategy === "byTags") return OperationStrategy.byTags({
|
|
321
321
|
fallback: plugin.config.httpRequests.strategyDefaultTag,
|
|
322
|
-
path: resolvePath$
|
|
322
|
+
path: resolvePath$3(plugin)
|
|
323
323
|
});
|
|
324
324
|
return plugin.config.httpRequests.strategy;
|
|
325
325
|
}
|
|
@@ -383,7 +383,7 @@ function resolveHttpResources(config, context) {
|
|
|
383
383
|
|
|
384
384
|
//#endregion
|
|
385
385
|
//#region src/plugins/@angular/common/httpResources/resolve.ts
|
|
386
|
-
function resolvePath$
|
|
386
|
+
function resolvePath$2(plugin) {
|
|
387
387
|
if (plugin.config.httpResources.nesting === "id") return OperationPath.id();
|
|
388
388
|
if (plugin.config.httpResources.nesting === "operationId") return OperationPath.fromOperationId({
|
|
389
389
|
delimiters: plugin.config.httpResources.nestingDelimiters,
|
|
@@ -392,17 +392,17 @@ function resolvePath$1(plugin) {
|
|
|
392
392
|
return plugin.config.httpResources.nesting;
|
|
393
393
|
}
|
|
394
394
|
function resolveHttpResourcesStrategy(plugin) {
|
|
395
|
-
if (plugin.config.httpResources.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath$
|
|
395
|
+
if (plugin.config.httpResources.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath$2(plugin)(operation).join(".")] });
|
|
396
396
|
if (plugin.config.httpResources.strategy === "single") {
|
|
397
397
|
const root = plugin.config.httpResources.containerName;
|
|
398
398
|
return OperationStrategy.single({
|
|
399
|
-
path: resolvePath$
|
|
399
|
+
path: resolvePath$2(plugin),
|
|
400
400
|
root: typeof root.name === "string" ? root.name : root.name?.("") ?? ""
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
403
|
if (plugin.config.httpResources.strategy === "byTags") return OperationStrategy.byTags({
|
|
404
404
|
fallback: plugin.config.httpResources.strategyDefaultTag,
|
|
405
|
-
path: resolvePath$
|
|
405
|
+
path: resolvePath$2(plugin)
|
|
406
406
|
});
|
|
407
407
|
return plugin.config.httpResources.strategy;
|
|
408
408
|
}
|
|
@@ -538,8 +538,8 @@ var TypeTsDsl = class extends TsDsl {};
|
|
|
538
538
|
|
|
539
539
|
//#endregion
|
|
540
540
|
//#region src/ts-dsl/expr/id.ts
|
|
541
|
-
const Mixed$
|
|
542
|
-
var IdTsDsl = class extends Mixed$
|
|
541
|
+
const Mixed$54 = TsDsl;
|
|
542
|
+
var IdTsDsl = class extends Mixed$54 {
|
|
543
543
|
"~dsl" = "IdTsDsl";
|
|
544
544
|
constructor(name) {
|
|
545
545
|
super();
|
|
@@ -594,8 +594,8 @@ function ArgsMixin(Base) {
|
|
|
594
594
|
|
|
595
595
|
//#endregion
|
|
596
596
|
//#region src/ts-dsl/expr/prefix.ts
|
|
597
|
-
const Mixed$
|
|
598
|
-
var PrefixTsDsl = class extends Mixed$
|
|
597
|
+
const Mixed$53 = TsDsl;
|
|
598
|
+
var PrefixTsDsl = class extends Mixed$53 {
|
|
599
599
|
"~dsl" = "PrefixTsDsl";
|
|
600
600
|
_expr;
|
|
601
601
|
_op;
|
|
@@ -610,7 +610,7 @@ var PrefixTsDsl = class extends Mixed$51 {
|
|
|
610
610
|
}
|
|
611
611
|
/** Returns true when all required builder calls are present. */
|
|
612
612
|
get isValid() {
|
|
613
|
-
return this.missingRequiredCalls().length
|
|
613
|
+
return !this.missingRequiredCalls().length;
|
|
614
614
|
}
|
|
615
615
|
/** Sets the operand (the expression being prefixed). */
|
|
616
616
|
expr(expr) {
|
|
@@ -627,7 +627,7 @@ var PrefixTsDsl = class extends Mixed$51 {
|
|
|
627
627
|
this._op = ts.SyntaxKind.ExclamationToken;
|
|
628
628
|
return this;
|
|
629
629
|
}
|
|
630
|
-
/** Sets the operator (e.g
|
|
630
|
+
/** Sets the operator (e.g., `ts.SyntaxKind.ExclamationToken` for `!`). */
|
|
631
631
|
op(op) {
|
|
632
632
|
this._op = op;
|
|
633
633
|
return this;
|
|
@@ -638,7 +638,7 @@ var PrefixTsDsl = class extends Mixed$51 {
|
|
|
638
638
|
}
|
|
639
639
|
$validate() {
|
|
640
640
|
const missing = this.missingRequiredCalls();
|
|
641
|
-
if (missing.length
|
|
641
|
+
if (!missing.length) return;
|
|
642
642
|
throw new Error(`Prefix unary expression missing ${missing.join(" and ")}`);
|
|
643
643
|
}
|
|
644
644
|
missingRequiredCalls() {
|
|
@@ -694,8 +694,8 @@ function AsMixin(Base) {
|
|
|
694
694
|
|
|
695
695
|
//#endregion
|
|
696
696
|
//#region src/ts-dsl/expr/literal.ts
|
|
697
|
-
const Mixed$
|
|
698
|
-
var LiteralTsDsl = class extends Mixed$
|
|
697
|
+
const Mixed$52 = AsMixin(TsDsl);
|
|
698
|
+
var LiteralTsDsl = class extends Mixed$52 {
|
|
699
699
|
"~dsl" = "LiteralTsDsl";
|
|
700
700
|
value;
|
|
701
701
|
constructor(value) {
|
|
@@ -984,8 +984,8 @@ const safeTypeName = (name) => safeName(name, reserved.type);
|
|
|
984
984
|
|
|
985
985
|
//#endregion
|
|
986
986
|
//#region src/ts-dsl/decl/decorator.ts
|
|
987
|
-
const Mixed$
|
|
988
|
-
var DecoratorTsDsl = class extends Mixed$
|
|
987
|
+
const Mixed$51 = ArgsMixin(TsDsl);
|
|
988
|
+
var DecoratorTsDsl = class extends Mixed$51 {
|
|
989
989
|
"~dsl" = "DecoratorTsDsl";
|
|
990
990
|
nameSanitizer = safeRuntimeName;
|
|
991
991
|
constructor(name, ...args) {
|
|
@@ -1036,7 +1036,7 @@ function accessChainToNode(accessChain) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
function getAccessChainForNode(node) {
|
|
1038
1038
|
const accessChain = structuralToAccessChain([...getStructuralChainForNode(node, /* @__PURE__ */ new Set())]);
|
|
1039
|
-
if (accessChain.length
|
|
1039
|
+
if (!accessChain.length) return [node.clone()];
|
|
1040
1040
|
return accessChain.map((node) => node.clone());
|
|
1041
1041
|
}
|
|
1042
1042
|
function getScope(node) {
|
|
@@ -1049,7 +1049,7 @@ function getStructuralChainForNode(node, visited) {
|
|
|
1049
1049
|
if (node.structuralParents) for (const [parent] of node.structuralParents) {
|
|
1050
1050
|
if (getScope(parent) !== getScope(node)) continue;
|
|
1051
1051
|
const chain = getStructuralChainForNode(parent, visited);
|
|
1052
|
-
if (chain.length
|
|
1052
|
+
if (chain.length) return [...chain, node];
|
|
1053
1053
|
}
|
|
1054
1054
|
if (!node.root) return [];
|
|
1055
1055
|
return [node];
|
|
@@ -1263,7 +1263,7 @@ function AbstractMixin(Base) {
|
|
|
1263
1263
|
const Mixed = ModifiersMixin(Base);
|
|
1264
1264
|
class Abstract extends Mixed {
|
|
1265
1265
|
abstract(condition) {
|
|
1266
|
-
const cond = arguments.length
|
|
1266
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1267
1267
|
return this._m("abstract", cond);
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
@@ -1276,7 +1276,7 @@ function AsyncMixin(Base) {
|
|
|
1276
1276
|
const Mixed = ModifiersMixin(Base);
|
|
1277
1277
|
class Async extends Mixed {
|
|
1278
1278
|
async(condition) {
|
|
1279
|
-
const cond = arguments.length
|
|
1279
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1280
1280
|
return this._m("async", cond);
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
@@ -1289,7 +1289,7 @@ function ConstMixin(Base) {
|
|
|
1289
1289
|
const Mixed = ModifiersMixin(Base);
|
|
1290
1290
|
class Const extends Mixed {
|
|
1291
1291
|
const(condition) {
|
|
1292
|
-
const cond = arguments.length
|
|
1292
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1293
1293
|
return this._m("const", cond);
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
@@ -1308,7 +1308,7 @@ function DefaultMixin(Base) {
|
|
|
1308
1308
|
* @returns The target object for chaining.
|
|
1309
1309
|
*/
|
|
1310
1310
|
default(condition) {
|
|
1311
|
-
const cond = arguments.length
|
|
1311
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1312
1312
|
return this._m("default", cond);
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
@@ -1327,7 +1327,7 @@ function ExportMixin(Base) {
|
|
|
1327
1327
|
* @returns The target object for chaining.
|
|
1328
1328
|
*/
|
|
1329
1329
|
export(condition) {
|
|
1330
|
-
const cond = arguments.length
|
|
1330
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1331
1331
|
this.exported = cond;
|
|
1332
1332
|
if (this.symbol) this.symbol.setExported(cond);
|
|
1333
1333
|
return this._m("export", cond);
|
|
@@ -1342,7 +1342,7 @@ function PrivateMixin(Base) {
|
|
|
1342
1342
|
const Mixed = ModifiersMixin(Base);
|
|
1343
1343
|
class Private extends Mixed {
|
|
1344
1344
|
private(condition) {
|
|
1345
|
-
const cond = arguments.length
|
|
1345
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1346
1346
|
return this._m("private", cond);
|
|
1347
1347
|
}
|
|
1348
1348
|
}
|
|
@@ -1355,7 +1355,7 @@ function ProtectedMixin(Base) {
|
|
|
1355
1355
|
const Mixed = ModifiersMixin(Base);
|
|
1356
1356
|
class Protected extends Mixed {
|
|
1357
1357
|
protected(condition) {
|
|
1358
|
-
const cond = arguments.length
|
|
1358
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1359
1359
|
return this._m("protected", cond);
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
@@ -1368,7 +1368,7 @@ function PublicMixin(Base) {
|
|
|
1368
1368
|
const Mixed = ModifiersMixin(Base);
|
|
1369
1369
|
class Public extends Mixed {
|
|
1370
1370
|
public(condition) {
|
|
1371
|
-
const cond = arguments.length
|
|
1371
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1372
1372
|
return this._m("public", cond);
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
@@ -1381,7 +1381,7 @@ function ReadonlyMixin(Base) {
|
|
|
1381
1381
|
const Mixed = ModifiersMixin(Base);
|
|
1382
1382
|
class Readonly extends Mixed {
|
|
1383
1383
|
readonly(condition) {
|
|
1384
|
-
const cond = arguments.length
|
|
1384
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1385
1385
|
return this._m("readonly", cond);
|
|
1386
1386
|
}
|
|
1387
1387
|
}
|
|
@@ -1394,7 +1394,7 @@ function StaticMixin(Base) {
|
|
|
1394
1394
|
const Mixed = ModifiersMixin(Base);
|
|
1395
1395
|
class Static extends Mixed {
|
|
1396
1396
|
static(condition) {
|
|
1397
|
-
const cond = arguments.length
|
|
1397
|
+
const cond = !arguments.length ? true : Boolean(condition);
|
|
1398
1398
|
return this._m("static", cond);
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
@@ -1403,8 +1403,8 @@ function StaticMixin(Base) {
|
|
|
1403
1403
|
|
|
1404
1404
|
//#endregion
|
|
1405
1405
|
//#region src/ts-dsl/type/param.ts
|
|
1406
|
-
const Mixed$
|
|
1407
|
-
var TypeParamTsDsl = class extends Mixed$
|
|
1406
|
+
const Mixed$50 = TsDsl;
|
|
1407
|
+
var TypeParamTsDsl = class extends Mixed$50 {
|
|
1408
1408
|
"~dsl" = "TypeParamTsDsl";
|
|
1409
1409
|
scope = "type";
|
|
1410
1410
|
constraint;
|
|
@@ -1472,11 +1472,11 @@ function OptionalMixin(Base) {
|
|
|
1472
1472
|
super.analyze(ctx);
|
|
1473
1473
|
}
|
|
1474
1474
|
optional(condition) {
|
|
1475
|
-
this._optional = arguments.length
|
|
1475
|
+
this._optional = !arguments.length ? true : Boolean(condition);
|
|
1476
1476
|
return this;
|
|
1477
1477
|
}
|
|
1478
1478
|
required(condition) {
|
|
1479
|
-
this._optional = arguments.length
|
|
1479
|
+
this._optional = !arguments.length ? false : !condition;
|
|
1480
1480
|
return this;
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
@@ -1543,7 +1543,7 @@ var TokenTsDsl = class extends TsDsl {
|
|
|
1543
1543
|
}
|
|
1544
1544
|
$validate() {
|
|
1545
1545
|
const missing = this.missingRequiredCalls();
|
|
1546
|
-
if (missing.length
|
|
1546
|
+
if (!missing.length) return;
|
|
1547
1547
|
throw new Error(`Token missing ${missing.join(" and ")}`);
|
|
1548
1548
|
}
|
|
1549
1549
|
missingRequiredCalls() {
|
|
@@ -1553,7 +1553,7 @@ var TokenTsDsl = class extends TsDsl {
|
|
|
1553
1553
|
}
|
|
1554
1554
|
/** Returns true when all required builder calls are present. */
|
|
1555
1555
|
get isValid() {
|
|
1556
|
-
return this.missingRequiredCalls().length
|
|
1556
|
+
return !this.missingRequiredCalls().length;
|
|
1557
1557
|
}
|
|
1558
1558
|
};
|
|
1559
1559
|
|
|
@@ -1615,8 +1615,8 @@ function TypeExprMixin(Base) {
|
|
|
1615
1615
|
|
|
1616
1616
|
//#endregion
|
|
1617
1617
|
//#region src/ts-dsl/type/attr.ts
|
|
1618
|
-
const Mixed$
|
|
1619
|
-
var TypeAttrTsDsl = class extends Mixed$
|
|
1618
|
+
const Mixed$49 = TypeExprMixin(TsDsl);
|
|
1619
|
+
var TypeAttrTsDsl = class extends Mixed$49 {
|
|
1620
1620
|
"~dsl" = "TypeAttrTsDsl";
|
|
1621
1621
|
scope = "type";
|
|
1622
1622
|
_base;
|
|
@@ -1638,7 +1638,7 @@ var TypeAttrTsDsl = class extends Mixed$47 {
|
|
|
1638
1638
|
}
|
|
1639
1639
|
/** Returns true when all required builder calls are present. */
|
|
1640
1640
|
get isValid() {
|
|
1641
|
-
return this.missingRequiredCalls().length
|
|
1641
|
+
return !this.missingRequiredCalls().length;
|
|
1642
1642
|
}
|
|
1643
1643
|
base(base) {
|
|
1644
1644
|
if (isRef(base)) this._base = base;
|
|
@@ -1657,7 +1657,7 @@ var TypeAttrTsDsl = class extends Mixed$47 {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
$validate() {
|
|
1659
1659
|
const missing = this.missingRequiredCalls();
|
|
1660
|
-
if (missing.length
|
|
1660
|
+
if (!missing.length) return;
|
|
1661
1661
|
throw new Error(`Type attribute missing ${missing.join(" and ")}`);
|
|
1662
1662
|
}
|
|
1663
1663
|
missingRequiredCalls() {
|
|
@@ -1670,8 +1670,8 @@ var TypeAttrTsDsl = class extends Mixed$47 {
|
|
|
1670
1670
|
|
|
1671
1671
|
//#endregion
|
|
1672
1672
|
//#region src/ts-dsl/type/expr.ts
|
|
1673
|
-
const Mixed$
|
|
1674
|
-
var TypeExprTsDsl = class extends Mixed$
|
|
1673
|
+
const Mixed$48 = TypeArgsMixin(TypeExprMixin(TsDsl));
|
|
1674
|
+
var TypeExprTsDsl = class extends Mixed$48 {
|
|
1675
1675
|
"~dsl" = "TypeExprTsDsl";
|
|
1676
1676
|
scope = "type";
|
|
1677
1677
|
_exprInput;
|
|
@@ -1689,9 +1689,9 @@ var TypeExprTsDsl = class extends Mixed$46 {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
/** Returns true when all required builder calls are present. */
|
|
1691
1691
|
get isValid() {
|
|
1692
|
-
return this.missingRequiredCalls().length
|
|
1692
|
+
return !this.missingRequiredCalls().length;
|
|
1693
1693
|
}
|
|
1694
|
-
/** Accesses a nested type (e.g
|
|
1694
|
+
/** Accesses a nested type (e.g., `Foo.Bar`). */
|
|
1695
1695
|
attr(right) {
|
|
1696
1696
|
this._exprInput = isNode(right) ? ref(right.base(this._exprInput)) : ref(new TypeAttrTsDsl(this._exprInput, right));
|
|
1697
1697
|
return this;
|
|
@@ -1702,7 +1702,7 @@ var TypeExprTsDsl = class extends Mixed$46 {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
$validate() {
|
|
1704
1704
|
const missing = this.missingRequiredCalls();
|
|
1705
|
-
if (missing.length
|
|
1705
|
+
if (!missing.length) return;
|
|
1706
1706
|
throw new Error(`Type expression missing ${missing.join(" and ")}`);
|
|
1707
1707
|
}
|
|
1708
1708
|
missingRequiredCalls() {
|
|
@@ -1715,8 +1715,8 @@ f.type.expr.set((...args) => new TypeExprTsDsl(...args));
|
|
|
1715
1715
|
|
|
1716
1716
|
//#endregion
|
|
1717
1717
|
//#region src/ts-dsl/decl/field.ts
|
|
1718
|
-
const Mixed$
|
|
1719
|
-
var FieldTsDsl = class extends Mixed$
|
|
1718
|
+
const Mixed$47 = DecoratorMixin(DocMixin(OptionalMixin(PrivateMixin(ProtectedMixin(PublicMixin(ReadonlyMixin(StaticMixin(ValueMixin(TsDsl)))))))));
|
|
1719
|
+
var FieldTsDsl = class extends Mixed$47 {
|
|
1720
1720
|
"~dsl" = "FieldTsDsl";
|
|
1721
1721
|
nameSanitizer = safeAccessorName;
|
|
1722
1722
|
_type;
|
|
@@ -1743,8 +1743,8 @@ var FieldTsDsl = class extends Mixed$45 {
|
|
|
1743
1743
|
|
|
1744
1744
|
//#endregion
|
|
1745
1745
|
//#region src/ts-dsl/stmt/stmt.ts
|
|
1746
|
-
const Mixed$
|
|
1747
|
-
var StmtTsDsl = class extends Mixed$
|
|
1746
|
+
const Mixed$46 = TsDsl;
|
|
1747
|
+
var StmtTsDsl = class extends Mixed$46 {
|
|
1748
1748
|
"~dsl" = "StmtTsDsl";
|
|
1749
1749
|
_inner;
|
|
1750
1750
|
constructor(inner) {
|
|
@@ -1791,11 +1791,11 @@ function DoMixin(Base) {
|
|
|
1791
1791
|
|
|
1792
1792
|
//#endregion
|
|
1793
1793
|
//#region src/ts-dsl/decl/pattern.ts
|
|
1794
|
-
const Mixed$
|
|
1794
|
+
const Mixed$45 = TsDsl;
|
|
1795
1795
|
/**
|
|
1796
|
-
* Builds binding patterns (e.g
|
|
1796
|
+
* Builds binding patterns (e.g., `{ foo, bar }`, `[a, b, ...rest]`).
|
|
1797
1797
|
*/
|
|
1798
|
-
var PatternTsDsl = class extends Mixed$
|
|
1798
|
+
var PatternTsDsl = class extends Mixed$45 {
|
|
1799
1799
|
"~dsl" = "PatternTsDsl";
|
|
1800
1800
|
pattern;
|
|
1801
1801
|
_spread;
|
|
@@ -1804,9 +1804,9 @@ var PatternTsDsl = class extends Mixed$43 {
|
|
|
1804
1804
|
}
|
|
1805
1805
|
/** Returns true when all required builder calls are present. */
|
|
1806
1806
|
get isValid() {
|
|
1807
|
-
return this.missingRequiredCalls().length
|
|
1807
|
+
return !this.missingRequiredCalls().length;
|
|
1808
1808
|
}
|
|
1809
|
-
/** Defines an array pattern (e.g
|
|
1809
|
+
/** Defines an array pattern (e.g., `[a, b, c]`). */
|
|
1810
1810
|
array(...props) {
|
|
1811
1811
|
this.pattern = {
|
|
1812
1812
|
kind: "array",
|
|
@@ -1814,7 +1814,7 @@ var PatternTsDsl = class extends Mixed$43 {
|
|
|
1814
1814
|
};
|
|
1815
1815
|
return this;
|
|
1816
1816
|
}
|
|
1817
|
-
/** Defines an object pattern (e.g
|
|
1817
|
+
/** Defines an object pattern (e.g., `{ a, b: alias }`). */
|
|
1818
1818
|
object(...props) {
|
|
1819
1819
|
const entries = {};
|
|
1820
1820
|
for (const p of props) if (typeof p === "string") entries[p] = p;
|
|
@@ -1826,7 +1826,7 @@ var PatternTsDsl = class extends Mixed$43 {
|
|
|
1826
1826
|
};
|
|
1827
1827
|
return this;
|
|
1828
1828
|
}
|
|
1829
|
-
/** Adds a spread element (e.g
|
|
1829
|
+
/** Adds a spread element (e.g., `...rest`, `...options`, `...args`). */
|
|
1830
1830
|
spread(name) {
|
|
1831
1831
|
this._spread = name;
|
|
1832
1832
|
return this;
|
|
@@ -1849,7 +1849,7 @@ var PatternTsDsl = class extends Mixed$43 {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
$validate() {
|
|
1851
1851
|
const missing = this.missingRequiredCalls();
|
|
1852
|
-
if (missing.length
|
|
1852
|
+
if (!missing.length) return;
|
|
1853
1853
|
throw new Error(`Binding pattern missing ${missing.join(" and ")}`);
|
|
1854
1854
|
}
|
|
1855
1855
|
missingRequiredCalls() {
|
|
@@ -1882,7 +1882,7 @@ function PatternMixin(Base) {
|
|
|
1882
1882
|
(this.pattern ??= new PatternTsDsl()).object(...props);
|
|
1883
1883
|
return this;
|
|
1884
1884
|
}
|
|
1885
|
-
/** Adds a spread element (e.g
|
|
1885
|
+
/** Adds a spread element (e.g., `...args`, `...options`) to the pattern. */
|
|
1886
1886
|
spread(name) {
|
|
1887
1887
|
(this.pattern ??= new PatternTsDsl()).spread(name);
|
|
1888
1888
|
return this;
|
|
@@ -1898,8 +1898,8 @@ function PatternMixin(Base) {
|
|
|
1898
1898
|
|
|
1899
1899
|
//#endregion
|
|
1900
1900
|
//#region src/ts-dsl/decl/param.ts
|
|
1901
|
-
const Mixed$
|
|
1902
|
-
var ParamTsDsl = class extends Mixed$
|
|
1901
|
+
const Mixed$44 = DecoratorMixin(OptionalMixin(PatternMixin(ValueMixin(TsDsl))));
|
|
1902
|
+
var ParamTsDsl = class extends Mixed$44 {
|
|
1903
1903
|
"~dsl" = "ParamTsDsl";
|
|
1904
1904
|
_type;
|
|
1905
1905
|
constructor(name, fn) {
|
|
@@ -1917,7 +1917,7 @@ var ParamTsDsl = class extends Mixed$42 {
|
|
|
1917
1917
|
}
|
|
1918
1918
|
/** Returns true when all required builder calls are present. */
|
|
1919
1919
|
get isValid() {
|
|
1920
|
-
return this.missingRequiredCalls().length
|
|
1920
|
+
return !this.missingRequiredCalls().length;
|
|
1921
1921
|
}
|
|
1922
1922
|
/** Sets the parameter type. */
|
|
1923
1923
|
type(type) {
|
|
@@ -1930,7 +1930,7 @@ var ParamTsDsl = class extends Mixed$42 {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
$validate() {
|
|
1932
1932
|
const missing = this.missingRequiredCalls();
|
|
1933
|
-
if (missing.length
|
|
1933
|
+
if (!missing.length) return;
|
|
1934
1934
|
throw new Error(`Parameter missing ${missing.join(" and ")}`);
|
|
1935
1935
|
}
|
|
1936
1936
|
missingRequiredCalls() {
|
|
@@ -1997,8 +1997,8 @@ function LayoutMixin(Base) {
|
|
|
1997
1997
|
|
|
1998
1998
|
//#endregion
|
|
1999
1999
|
//#region src/ts-dsl/stmt/block.ts
|
|
2000
|
-
const Mixed$
|
|
2001
|
-
var BlockTsDsl = class extends Mixed$
|
|
2000
|
+
const Mixed$43 = DoMixin(LayoutMixin(TsDsl));
|
|
2001
|
+
var BlockTsDsl = class extends Mixed$43 {
|
|
2002
2002
|
"~dsl" = "BlockTsDsl";
|
|
2003
2003
|
constructor(...items) {
|
|
2004
2004
|
super();
|
|
@@ -2015,8 +2015,8 @@ var BlockTsDsl = class extends Mixed$41 {
|
|
|
2015
2015
|
|
|
2016
2016
|
//#endregion
|
|
2017
2017
|
//#region src/ts-dsl/decl/init.ts
|
|
2018
|
-
const Mixed$
|
|
2019
|
-
var InitTsDsl = class extends Mixed$
|
|
2018
|
+
const Mixed$42 = DecoratorMixin(DoMixin(DocMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(TsDsl)))))));
|
|
2019
|
+
var InitTsDsl = class extends Mixed$42 {
|
|
2020
2020
|
"~dsl" = "InitTsDsl";
|
|
2021
2021
|
constructor(fn) {
|
|
2022
2022
|
super();
|
|
@@ -2058,8 +2058,8 @@ function TypeReturnsMixin(Base) {
|
|
|
2058
2058
|
|
|
2059
2059
|
//#endregion
|
|
2060
2060
|
//#region src/ts-dsl/decl/method.ts
|
|
2061
|
-
const Mixed$
|
|
2062
|
-
var MethodTsDsl = class extends Mixed$
|
|
2061
|
+
const Mixed$41 = AbstractMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(OptionalMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TypeParamsMixin(TypeReturnsMixin(TsDsl)))))))))))));
|
|
2062
|
+
var MethodTsDsl = class extends Mixed$41 {
|
|
2063
2063
|
"~dsl" = "MethodTsDsl";
|
|
2064
2064
|
nameSanitizer = safeAccessorName;
|
|
2065
2065
|
constructor(name, fn) {
|
|
@@ -2084,8 +2084,8 @@ var MethodTsDsl = class extends Mixed$39 {
|
|
|
2084
2084
|
|
|
2085
2085
|
//#endregion
|
|
2086
2086
|
//#region src/ts-dsl/decl/class.ts
|
|
2087
|
-
const Mixed$
|
|
2088
|
-
var ClassTsDsl = class extends Mixed$
|
|
2087
|
+
const Mixed$40 = AbstractMixin(DecoratorMixin(DefaultMixin(DocMixin(ExportMixin(TypeParamsMixin(TsDsl))))));
|
|
2088
|
+
var ClassTsDsl = class extends Mixed$40 {
|
|
2089
2089
|
"~dsl" = "ClassTsDsl";
|
|
2090
2090
|
nameSanitizer = safeRuntimeName;
|
|
2091
2091
|
baseClass;
|
|
@@ -2108,7 +2108,7 @@ var ClassTsDsl = class extends Mixed$38 {
|
|
|
2108
2108
|
}
|
|
2109
2109
|
/** Returns true if the class has any members. */
|
|
2110
2110
|
get hasBody() {
|
|
2111
|
-
return this.body.length
|
|
2111
|
+
return Boolean(this.body.length);
|
|
2112
2112
|
}
|
|
2113
2113
|
/** Adds one or more class members (fields, methods, etc.). */
|
|
2114
2114
|
do(...items) {
|
|
@@ -2158,8 +2158,8 @@ var ClassTsDsl = class extends Mixed$38 {
|
|
|
2158
2158
|
|
|
2159
2159
|
//#endregion
|
|
2160
2160
|
//#region src/ts-dsl/decl/member.ts
|
|
2161
|
-
const Mixed$
|
|
2162
|
-
var EnumMemberTsDsl = class extends Mixed$
|
|
2161
|
+
const Mixed$39 = DocMixin(TsDsl);
|
|
2162
|
+
var EnumMemberTsDsl = class extends Mixed$39 {
|
|
2163
2163
|
"~dsl" = "EnumMemberTsDsl";
|
|
2164
2164
|
_value;
|
|
2165
2165
|
constructor(name, value) {
|
|
@@ -2185,8 +2185,8 @@ var EnumMemberTsDsl = class extends Mixed$37 {
|
|
|
2185
2185
|
|
|
2186
2186
|
//#endregion
|
|
2187
2187
|
//#region src/ts-dsl/decl/enum.ts
|
|
2188
|
-
const Mixed$
|
|
2189
|
-
var EnumTsDsl = class extends Mixed$
|
|
2188
|
+
const Mixed$38 = ConstMixin(DocMixin(ExportMixin(TsDsl)));
|
|
2189
|
+
var EnumTsDsl = class extends Mixed$38 {
|
|
2190
2190
|
"~dsl" = "EnumTsDsl";
|
|
2191
2191
|
nameSanitizer = safeRuntimeName;
|
|
2192
2192
|
_members = [];
|
|
@@ -2225,8 +2225,8 @@ var EnumTsDsl = class extends Mixed$36 {
|
|
|
2225
2225
|
|
|
2226
2226
|
//#endregion
|
|
2227
2227
|
//#region src/ts-dsl/decl/func.ts
|
|
2228
|
-
const Mixed$
|
|
2229
|
-
var ImplFuncTsDsl = class extends Mixed$
|
|
2228
|
+
const Mixed$37 = AbstractMixin(AsMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TypeParamsMixin(TypeReturnsMixin(TsDsl)))))))))))));
|
|
2229
|
+
var ImplFuncTsDsl = class extends Mixed$37 {
|
|
2230
2230
|
"~dsl" = "FuncTsDsl";
|
|
2231
2231
|
nameSanitizer = safeRuntimeName;
|
|
2232
2232
|
mode;
|
|
@@ -2253,7 +2253,7 @@ var ImplFuncTsDsl = class extends Mixed$35 {
|
|
|
2253
2253
|
}
|
|
2254
2254
|
/** Returns true when all required builder calls are present. */
|
|
2255
2255
|
get isValid() {
|
|
2256
|
-
return this.missingRequiredCalls().length
|
|
2256
|
+
return !this.missingRequiredCalls().length;
|
|
2257
2257
|
}
|
|
2258
2258
|
/** Switches the function to an arrow function form. */
|
|
2259
2259
|
arrow() {
|
|
@@ -2286,7 +2286,7 @@ var ImplFuncTsDsl = class extends Mixed$35 {
|
|
|
2286
2286
|
}
|
|
2287
2287
|
$validate() {
|
|
2288
2288
|
const missing = this.missingRequiredCalls();
|
|
2289
|
-
if (missing.length
|
|
2289
|
+
if (!missing.length) return;
|
|
2290
2290
|
throw new Error(`Function ${this.mode} missing ${missing.join(" and ")}`);
|
|
2291
2291
|
}
|
|
2292
2292
|
missingRequiredCalls() {
|
|
@@ -2299,8 +2299,8 @@ const FuncTsDsl = ImplFuncTsDsl;
|
|
|
2299
2299
|
|
|
2300
2300
|
//#endregion
|
|
2301
2301
|
//#region src/ts-dsl/decl/getter.ts
|
|
2302
|
-
const Mixed$
|
|
2303
|
-
var GetterTsDsl = class extends Mixed$
|
|
2302
|
+
const Mixed$36 = AbstractMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TypeReturnsMixin(TsDsl)))))))))));
|
|
2303
|
+
var GetterTsDsl = class extends Mixed$36 {
|
|
2304
2304
|
"~dsl" = "GetterTsDsl";
|
|
2305
2305
|
nameSanitizer = safeAccessorName;
|
|
2306
2306
|
constructor(name, fn) {
|
|
@@ -2325,8 +2325,8 @@ var GetterTsDsl = class extends Mixed$34 {
|
|
|
2325
2325
|
|
|
2326
2326
|
//#endregion
|
|
2327
2327
|
//#region src/ts-dsl/decl/setter.ts
|
|
2328
|
-
const Mixed$
|
|
2329
|
-
var SetterTsDsl = class extends Mixed$
|
|
2328
|
+
const Mixed$35 = AbstractMixin(AsyncMixin(DecoratorMixin(DoMixin(DocMixin(ParamMixin(PrivateMixin(ProtectedMixin(PublicMixin(StaticMixin(TsDsl))))))))));
|
|
2329
|
+
var SetterTsDsl = class extends Mixed$35 {
|
|
2330
2330
|
"~dsl" = "SetterTsDsl";
|
|
2331
2331
|
nameSanitizer = safeAccessorName;
|
|
2332
2332
|
constructor(name, fn) {
|
|
@@ -2349,10 +2349,33 @@ var SetterTsDsl = class extends Mixed$33 {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
};
|
|
2351
2351
|
|
|
2352
|
+
//#endregion
|
|
2353
|
+
//#region src/ts-dsl/mixins/expr.ts
|
|
2354
|
+
function ExprMixin(Base) {
|
|
2355
|
+
class Expr extends Base {
|
|
2356
|
+
analyze(ctx) {
|
|
2357
|
+
super.analyze(ctx);
|
|
2358
|
+
}
|
|
2359
|
+
attr(...args) {
|
|
2360
|
+
return f.attr(this, ...args);
|
|
2361
|
+
}
|
|
2362
|
+
await() {
|
|
2363
|
+
return f.await(this);
|
|
2364
|
+
}
|
|
2365
|
+
call(...args) {
|
|
2366
|
+
return f.call(this, ...args);
|
|
2367
|
+
}
|
|
2368
|
+
return() {
|
|
2369
|
+
return f.return(this);
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
return Expr;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2352
2375
|
//#endregion
|
|
2353
2376
|
//#region src/ts-dsl/expr/array.ts
|
|
2354
|
-
const Mixed$
|
|
2355
|
-
var ArrayTsDsl = class extends Mixed$
|
|
2377
|
+
const Mixed$34 = AsMixin(ExprMixin(LayoutMixin(TsDsl)));
|
|
2378
|
+
var ArrayTsDsl = class extends Mixed$34 {
|
|
2356
2379
|
"~dsl" = "ArrayTsDsl";
|
|
2357
2380
|
_elements = [];
|
|
2358
2381
|
constructor(...exprs) {
|
|
@@ -2394,33 +2417,10 @@ var ArrayTsDsl = class extends Mixed$32 {
|
|
|
2394
2417
|
}
|
|
2395
2418
|
};
|
|
2396
2419
|
|
|
2397
|
-
//#endregion
|
|
2398
|
-
//#region src/ts-dsl/mixins/expr.ts
|
|
2399
|
-
function ExprMixin(Base) {
|
|
2400
|
-
class Expr extends Base {
|
|
2401
|
-
analyze(ctx) {
|
|
2402
|
-
super.analyze(ctx);
|
|
2403
|
-
}
|
|
2404
|
-
attr(...args) {
|
|
2405
|
-
return f.attr(this, ...args);
|
|
2406
|
-
}
|
|
2407
|
-
await() {
|
|
2408
|
-
return f.await(this);
|
|
2409
|
-
}
|
|
2410
|
-
call(...args) {
|
|
2411
|
-
return f.call(this, ...args);
|
|
2412
|
-
}
|
|
2413
|
-
return() {
|
|
2414
|
-
return f.return(this);
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
return Expr;
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
2420
|
//#endregion
|
|
2421
2421
|
//#region src/ts-dsl/expr/as.ts
|
|
2422
|
-
const Mixed$
|
|
2423
|
-
var AsTsDsl = class extends Mixed$
|
|
2422
|
+
const Mixed$33 = AsMixin(ExprMixin(TsDsl));
|
|
2423
|
+
var AsTsDsl = class extends Mixed$33 {
|
|
2424
2424
|
"~dsl" = "AsTsDsl";
|
|
2425
2425
|
expr;
|
|
2426
2426
|
type;
|
|
@@ -2442,8 +2442,8 @@ f.as.set((...args) => new AsTsDsl(...args));
|
|
|
2442
2442
|
|
|
2443
2443
|
//#endregion
|
|
2444
2444
|
//#region src/ts-dsl/expr/binary.ts
|
|
2445
|
-
const Mixed$
|
|
2446
|
-
var BinaryTsDsl = class extends Mixed$
|
|
2445
|
+
const Mixed$32 = AsMixin(ExprMixin(TsDsl));
|
|
2446
|
+
var BinaryTsDsl = class extends Mixed$32 {
|
|
2447
2447
|
"~dsl" = "BinaryTsDsl";
|
|
2448
2448
|
_base;
|
|
2449
2449
|
_expr;
|
|
@@ -2461,13 +2461,13 @@ var BinaryTsDsl = class extends Mixed$30 {
|
|
|
2461
2461
|
}
|
|
2462
2462
|
/** Returns true when all required builder calls are present. */
|
|
2463
2463
|
get isValid() {
|
|
2464
|
-
return this.missingRequiredCalls().length
|
|
2464
|
+
return !this.missingRequiredCalls().length;
|
|
2465
2465
|
}
|
|
2466
2466
|
/** Logical AND — `this && expr` */
|
|
2467
2467
|
and(expr) {
|
|
2468
2468
|
return this.opAndExpr("&&", expr);
|
|
2469
2469
|
}
|
|
2470
|
-
/** Creates an assignment expression (e.g
|
|
2470
|
+
/** Creates an assignment expression (e.g., `this = expr`). */
|
|
2471
2471
|
assign(expr) {
|
|
2472
2472
|
return this.opAndExpr("=", expr);
|
|
2473
2473
|
}
|
|
@@ -2539,7 +2539,7 @@ var BinaryTsDsl = class extends Mixed$30 {
|
|
|
2539
2539
|
}
|
|
2540
2540
|
$validate() {
|
|
2541
2541
|
const missing = this.missingRequiredCalls();
|
|
2542
|
-
if (missing.length
|
|
2542
|
+
if (!missing.length) return;
|
|
2543
2543
|
throw new Error(`Binary expression missing ${missing.join(" and ")}`);
|
|
2544
2544
|
}
|
|
2545
2545
|
missingRequiredCalls() {
|
|
@@ -2643,42 +2643,48 @@ function OperatorMixin(Base) {
|
|
|
2643
2643
|
|
|
2644
2644
|
//#endregion
|
|
2645
2645
|
//#region src/ts-dsl/expr/attr.ts
|
|
2646
|
-
const Mixed$
|
|
2647
|
-
var AttrTsDsl = class extends Mixed$
|
|
2646
|
+
const Mixed$31 = AsMixin(ExprMixin(OperatorMixin(OptionalMixin(TsDsl))));
|
|
2647
|
+
var AttrTsDsl = class extends Mixed$31 {
|
|
2648
2648
|
"~dsl" = "AttrTsDsl";
|
|
2649
|
-
|
|
2649
|
+
_computed = false;
|
|
2650
|
+
_left;
|
|
2650
2651
|
constructor(left, right) {
|
|
2651
2652
|
super();
|
|
2652
|
-
this.
|
|
2653
|
+
this._left = ref(left);
|
|
2653
2654
|
this.name.set(right);
|
|
2654
2655
|
}
|
|
2655
2656
|
analyze(ctx) {
|
|
2656
2657
|
super.analyze(ctx);
|
|
2657
|
-
ctx.analyze(this.
|
|
2658
|
+
ctx.analyze(this._left);
|
|
2658
2659
|
ctx.analyze(this.name);
|
|
2659
2660
|
}
|
|
2661
|
+
/** Use computed property access (e.g., `obj[expr]`)? */
|
|
2662
|
+
computed(condition) {
|
|
2663
|
+
this._computed = condition ?? true;
|
|
2664
|
+
return this;
|
|
2665
|
+
}
|
|
2660
2666
|
toAst() {
|
|
2661
|
-
const
|
|
2667
|
+
const left = this.$node(this._left);
|
|
2662
2668
|
regexp.typeScriptIdentifier.lastIndex = 0;
|
|
2663
|
-
|
|
2664
|
-
|
|
2669
|
+
if (this._computed || !regexp.typeScriptIdentifier.test(this.name.toString())) {
|
|
2670
|
+
const right = fromRef(this.name);
|
|
2665
2671
|
let value = isSymbol(right) ? right.finalName : right;
|
|
2666
2672
|
if (typeof value === "string") {
|
|
2667
2673
|
if (value.startsWith("'") && value.endsWith("'") || value.startsWith("\"") && value.endsWith("\"")) value = value.slice(1, -1);
|
|
2668
2674
|
}
|
|
2669
|
-
if (this._optional) return ts.factory.createElementAccessChain(
|
|
2670
|
-
return ts.factory.createElementAccessExpression(
|
|
2675
|
+
if (this._optional) return ts.factory.createElementAccessChain(left, this.$node(new TokenTsDsl().questionDot()), this.$node(this._computed ? this.name : new LiteralTsDsl(value)));
|
|
2676
|
+
return ts.factory.createElementAccessExpression(left, this.$node(this._computed ? this.name : new LiteralTsDsl(value)));
|
|
2671
2677
|
}
|
|
2672
|
-
if (this._optional) return ts.factory.createPropertyAccessChain(
|
|
2673
|
-
return ts.factory.createPropertyAccessExpression(
|
|
2678
|
+
if (this._optional) return ts.factory.createPropertyAccessChain(left, this.$node(new TokenTsDsl().questionDot()), this.$node(this.name));
|
|
2679
|
+
return ts.factory.createPropertyAccessExpression(left, this.$node(this.name));
|
|
2674
2680
|
}
|
|
2675
2681
|
};
|
|
2676
2682
|
f.attr.set((...args) => new AttrTsDsl(...args));
|
|
2677
2683
|
|
|
2678
2684
|
//#endregion
|
|
2679
2685
|
//#region src/ts-dsl/expr/await.ts
|
|
2680
|
-
const Mixed$
|
|
2681
|
-
var AwaitTsDsl = class extends Mixed$
|
|
2686
|
+
const Mixed$30 = ExprMixin(TsDsl);
|
|
2687
|
+
var AwaitTsDsl = class extends Mixed$30 {
|
|
2682
2688
|
"~dsl" = "AwaitTsDsl";
|
|
2683
2689
|
_awaitExpr;
|
|
2684
2690
|
constructor(expr) {
|
|
@@ -2697,8 +2703,8 @@ f.await.set((...args) => new AwaitTsDsl(...args));
|
|
|
2697
2703
|
|
|
2698
2704
|
//#endregion
|
|
2699
2705
|
//#region src/ts-dsl/expr/call.ts
|
|
2700
|
-
const Mixed$
|
|
2701
|
-
var CallTsDsl = class extends Mixed$
|
|
2706
|
+
const Mixed$29 = ArgsMixin(AsMixin(ExprMixin(TypeArgsMixin(TsDsl))));
|
|
2707
|
+
var CallTsDsl = class extends Mixed$29 {
|
|
2702
2708
|
"~dsl" = "CallTsDsl";
|
|
2703
2709
|
_callee;
|
|
2704
2710
|
constructor(callee, ...args) {
|
|
@@ -2718,8 +2724,8 @@ f.call.set((...args) => new CallTsDsl(...args));
|
|
|
2718
2724
|
|
|
2719
2725
|
//#endregion
|
|
2720
2726
|
//#region src/ts-dsl/expr/expr.ts
|
|
2721
|
-
const Mixed$
|
|
2722
|
-
var ExprTsDsl = class extends Mixed$
|
|
2727
|
+
const Mixed$28 = AsMixin(ExprMixin(OperatorMixin(TypeExprMixin(TsDsl))));
|
|
2728
|
+
var ExprTsDsl = class extends Mixed$28 {
|
|
2723
2729
|
"~dsl" = "ExprTsDsl";
|
|
2724
2730
|
_exprInput;
|
|
2725
2731
|
constructor(id) {
|
|
@@ -2790,8 +2796,8 @@ function HintMixin(Base) {
|
|
|
2790
2796
|
|
|
2791
2797
|
//#endregion
|
|
2792
2798
|
//#region src/ts-dsl/expr/prop.ts
|
|
2793
|
-
const Mixed$
|
|
2794
|
-
var ObjectPropTsDsl = class extends Mixed$
|
|
2799
|
+
const Mixed$27 = DocMixin(TsDsl);
|
|
2800
|
+
var ObjectPropTsDsl = class extends Mixed$27 {
|
|
2795
2801
|
"~dsl" = "ObjectPropTsDsl";
|
|
2796
2802
|
_value;
|
|
2797
2803
|
_meta;
|
|
@@ -2810,7 +2816,7 @@ var ObjectPropTsDsl = class extends Mixed$25 {
|
|
|
2810
2816
|
ctx.analyze(this._value);
|
|
2811
2817
|
}
|
|
2812
2818
|
get isValid() {
|
|
2813
|
-
return this.missingRequiredCalls().length
|
|
2819
|
+
return !this.missingRequiredCalls().length;
|
|
2814
2820
|
}
|
|
2815
2821
|
value(value) {
|
|
2816
2822
|
if (typeof value === "function") value(this);
|
|
@@ -2845,7 +2851,7 @@ var ObjectPropTsDsl = class extends Mixed$25 {
|
|
|
2845
2851
|
}
|
|
2846
2852
|
$validate() {
|
|
2847
2853
|
const missing = this.missingRequiredCalls();
|
|
2848
|
-
if (missing.length
|
|
2854
|
+
if (!missing.length) return;
|
|
2849
2855
|
throw new Error(`Object property${this._meta.name ? ` "${this._meta.name}"` : ""} missing ${missing.join(" and ")}`);
|
|
2850
2856
|
}
|
|
2851
2857
|
missingRequiredCalls() {
|
|
@@ -2857,8 +2863,8 @@ var ObjectPropTsDsl = class extends Mixed$25 {
|
|
|
2857
2863
|
|
|
2858
2864
|
//#endregion
|
|
2859
2865
|
//#region src/ts-dsl/expr/object.ts
|
|
2860
|
-
const Mixed$
|
|
2861
|
-
var ObjectTsDsl = class extends Mixed$
|
|
2866
|
+
const Mixed$26 = AsMixin(ExprMixin(HintMixin(LayoutMixin(TsDsl))));
|
|
2867
|
+
var ObjectTsDsl = class extends Mixed$26 {
|
|
2862
2868
|
"~dsl" = "ObjectTsDsl";
|
|
2863
2869
|
_props = /* @__PURE__ */ new Map();
|
|
2864
2870
|
_spreadCounter = 0;
|
|
@@ -2875,7 +2881,7 @@ var ObjectTsDsl = class extends Mixed$24 {
|
|
|
2875
2881
|
if (prop.kind === "spread") return `spread:${this._spreadCounter++}`;
|
|
2876
2882
|
return `${prop.kind}:${prop.propName}`;
|
|
2877
2883
|
}
|
|
2878
|
-
/** Adds a computed property (e.g
|
|
2884
|
+
/** Adds a computed property (e.g., `{ [expr]: value }`), or removes if null. */
|
|
2879
2885
|
computed(name, expr) {
|
|
2880
2886
|
if (expr === null) this._props.delete(`computed:${name}`);
|
|
2881
2887
|
else this._props.set(`computed:${name}`, new ObjectPropTsDsl({
|
|
@@ -2884,7 +2890,7 @@ var ObjectTsDsl = class extends Mixed$24 {
|
|
|
2884
2890
|
}).value(expr));
|
|
2885
2891
|
return this;
|
|
2886
2892
|
}
|
|
2887
|
-
/** Adds a getter property (e.g
|
|
2893
|
+
/** Adds a getter property (e.g., `{ get foo() { ... } }`), or removes if null. */
|
|
2888
2894
|
getter(name, stmt) {
|
|
2889
2895
|
if (stmt === null) this._props.delete(`getter:${name}`);
|
|
2890
2896
|
else this._props.set(`getter:${name}`, new ObjectPropTsDsl({
|
|
@@ -2915,7 +2921,7 @@ var ObjectTsDsl = class extends Mixed$24 {
|
|
|
2915
2921
|
for (const prop of props) this._props.set(this._propKey(prop), prop);
|
|
2916
2922
|
return this;
|
|
2917
2923
|
}
|
|
2918
|
-
/** Adds a setter property (e.g
|
|
2924
|
+
/** Adds a setter property (e.g., `{ set foo(v) { ... } }`), or removes if null. */
|
|
2919
2925
|
setter(name, stmt) {
|
|
2920
2926
|
if (stmt === null) this._props.delete(`setter:${name}`);
|
|
2921
2927
|
else this._props.set(`setter:${name}`, new ObjectPropTsDsl({
|
|
@@ -2924,7 +2930,7 @@ var ObjectTsDsl = class extends Mixed$24 {
|
|
|
2924
2930
|
}).value(stmt));
|
|
2925
2931
|
return this;
|
|
2926
2932
|
}
|
|
2927
|
-
/** Adds a spread property (e.g
|
|
2933
|
+
/** Adds a spread property (e.g., `{ ...options }`). */
|
|
2928
2934
|
spread(expr) {
|
|
2929
2935
|
const key = `spread:${this._spreadCounter++}`;
|
|
2930
2936
|
this._props.set(key, new ObjectPropTsDsl({ kind: "spread" }).value(expr));
|
|
@@ -2961,8 +2967,8 @@ const fromValue$1 = (input, options) => {
|
|
|
2961
2967
|
|
|
2962
2968
|
//#endregion
|
|
2963
2969
|
//#region src/ts-dsl/expr/new.ts
|
|
2964
|
-
const Mixed$
|
|
2965
|
-
var NewTsDsl = class extends Mixed$
|
|
2970
|
+
const Mixed$25 = ArgsMixin(AsMixin(ExprMixin(TypeArgsMixin(TsDsl))));
|
|
2971
|
+
var NewTsDsl = class extends Mixed$25 {
|
|
2966
2972
|
"~dsl" = "NewTsDsl";
|
|
2967
2973
|
_newExpr;
|
|
2968
2974
|
constructor(expr, ...args) {
|
|
@@ -2980,10 +2986,67 @@ var NewTsDsl = class extends Mixed$23 {
|
|
|
2980
2986
|
};
|
|
2981
2987
|
f.new.set((...args) => new NewTsDsl(...args));
|
|
2982
2988
|
|
|
2989
|
+
//#endregion
|
|
2990
|
+
//#region src/ts-dsl/expr/postfix.ts
|
|
2991
|
+
const Mixed$24 = TsDsl;
|
|
2992
|
+
var PostfixTsDsl = class extends Mixed$24 {
|
|
2993
|
+
"~dsl" = "PostfixTsDsl";
|
|
2994
|
+
_expr;
|
|
2995
|
+
_op;
|
|
2996
|
+
constructor(expr, op) {
|
|
2997
|
+
super();
|
|
2998
|
+
this._expr = expr;
|
|
2999
|
+
this._op = op;
|
|
3000
|
+
}
|
|
3001
|
+
analyze(ctx) {
|
|
3002
|
+
super.analyze(ctx);
|
|
3003
|
+
ctx.analyze(this._expr);
|
|
3004
|
+
}
|
|
3005
|
+
/** Returns true when all required builder calls are present. */
|
|
3006
|
+
get isValid() {
|
|
3007
|
+
return !this.missingRequiredCalls().length;
|
|
3008
|
+
}
|
|
3009
|
+
/** Sets the operator to MinusMinusToken for decrement (`--`). */
|
|
3010
|
+
dec() {
|
|
3011
|
+
this._op = ts.SyntaxKind.MinusMinusToken;
|
|
3012
|
+
return this;
|
|
3013
|
+
}
|
|
3014
|
+
/** Sets the operand (the expression being postfixed). */
|
|
3015
|
+
expr(expr) {
|
|
3016
|
+
this._expr = expr;
|
|
3017
|
+
return this;
|
|
3018
|
+
}
|
|
3019
|
+
/** Sets the operator to PlusPlusToken for increment (`++`). */
|
|
3020
|
+
inc() {
|
|
3021
|
+
this._op = ts.SyntaxKind.PlusPlusToken;
|
|
3022
|
+
return this;
|
|
3023
|
+
}
|
|
3024
|
+
/** Sets the operator (e.g., `ts.SyntaxKind.PlusPlusToken` for `++`). */
|
|
3025
|
+
op(op) {
|
|
3026
|
+
this._op = op;
|
|
3027
|
+
return this;
|
|
3028
|
+
}
|
|
3029
|
+
toAst() {
|
|
3030
|
+
this.$validate();
|
|
3031
|
+
return ts.factory.createPostfixUnaryExpression(this.$node(this._expr), this._op);
|
|
3032
|
+
}
|
|
3033
|
+
$validate() {
|
|
3034
|
+
const missing = this.missingRequiredCalls();
|
|
3035
|
+
if (!missing.length) return;
|
|
3036
|
+
throw new Error(`Postfix unary expression missing ${missing.join(" and ")}`);
|
|
3037
|
+
}
|
|
3038
|
+
missingRequiredCalls() {
|
|
3039
|
+
const missing = [];
|
|
3040
|
+
if (!this._expr) missing.push(".expr()");
|
|
3041
|
+
if (!this._op) missing.push("operator (e.g., .inc(), .dec())");
|
|
3042
|
+
return missing;
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
|
|
2983
3046
|
//#endregion
|
|
2984
3047
|
//#region src/ts-dsl/expr/regexp.ts
|
|
2985
|
-
const Mixed$
|
|
2986
|
-
var RegExpTsDsl = class extends Mixed$
|
|
3048
|
+
const Mixed$23 = TsDsl;
|
|
3049
|
+
var RegExpTsDsl = class extends Mixed$23 {
|
|
2987
3050
|
"~dsl" = "RegExpTsDsl";
|
|
2988
3051
|
pattern;
|
|
2989
3052
|
flags;
|
|
@@ -3003,8 +3066,8 @@ var RegExpTsDsl = class extends Mixed$22 {
|
|
|
3003
3066
|
|
|
3004
3067
|
//#endregion
|
|
3005
3068
|
//#region src/ts-dsl/expr/template.ts
|
|
3006
|
-
const Mixed$
|
|
3007
|
-
var TemplateTsDsl = class extends Mixed$
|
|
3069
|
+
const Mixed$22 = TsDsl;
|
|
3070
|
+
var TemplateTsDsl = class extends Mixed$22 {
|
|
3008
3071
|
"~dsl" = "TemplateTsDsl";
|
|
3009
3072
|
parts = [];
|
|
3010
3073
|
constructor(value) {
|
|
@@ -3037,7 +3100,7 @@ var TemplateTsDsl = class extends Mixed$21 {
|
|
|
3037
3100
|
} else if (typeof current === "number") normalized.push(String(current));
|
|
3038
3101
|
else normalized.push(current);
|
|
3039
3102
|
}
|
|
3040
|
-
if (normalized.length
|
|
3103
|
+
if (!normalized.length || typeof normalized[0] !== "string") normalized.unshift("");
|
|
3041
3104
|
if (normalized.length === 1 && typeof normalized[0] === "string") return ts.factory.createNoSubstitutionTemplateLiteral(normalized[0]);
|
|
3042
3105
|
if (normalized.length === 2 && typeof normalized[0] === "string" && typeof normalized[1] !== "string") return ts.factory.createTemplateExpression(ts.factory.createTemplateHead(normalized[0]), [ts.factory.createTemplateSpan(normalized[1], ts.factory.createTemplateTail(""))]);
|
|
3043
3106
|
const head = ts.factory.createTemplateHead(normalized.shift());
|
|
@@ -3045,7 +3108,7 @@ var TemplateTsDsl = class extends Mixed$21 {
|
|
|
3045
3108
|
while (normalized.length) {
|
|
3046
3109
|
const expr = normalized.shift();
|
|
3047
3110
|
const next = typeof normalized[0] === "string" ? normalized.shift() : "";
|
|
3048
|
-
const isLast = normalized.length
|
|
3111
|
+
const isLast = !normalized.length;
|
|
3049
3112
|
spans.push(ts.factory.createTemplateSpan(expr, isLast ? ts.factory.createTemplateTail(next) : ts.factory.createTemplateMiddle(next)));
|
|
3050
3113
|
}
|
|
3051
3114
|
return ts.factory.createTemplateExpression(head, spans);
|
|
@@ -3054,8 +3117,8 @@ var TemplateTsDsl = class extends Mixed$21 {
|
|
|
3054
3117
|
|
|
3055
3118
|
//#endregion
|
|
3056
3119
|
//#region src/ts-dsl/expr/ternary.ts
|
|
3057
|
-
const Mixed$
|
|
3058
|
-
var TernaryTsDsl = class extends Mixed$
|
|
3120
|
+
const Mixed$21 = TsDsl;
|
|
3121
|
+
var TernaryTsDsl = class extends Mixed$21 {
|
|
3059
3122
|
"~dsl" = "TernaryTsDsl";
|
|
3060
3123
|
_condition;
|
|
3061
3124
|
_then;
|
|
@@ -3072,7 +3135,7 @@ var TernaryTsDsl = class extends Mixed$20 {
|
|
|
3072
3135
|
}
|
|
3073
3136
|
/** Returns true when all required builder calls are present. */
|
|
3074
3137
|
get isValid() {
|
|
3075
|
-
return this.missingRequiredCalls().length
|
|
3138
|
+
return !this.missingRequiredCalls().length;
|
|
3076
3139
|
}
|
|
3077
3140
|
condition(condition) {
|
|
3078
3141
|
this._condition = condition;
|
|
@@ -3092,7 +3155,7 @@ var TernaryTsDsl = class extends Mixed$20 {
|
|
|
3092
3155
|
}
|
|
3093
3156
|
$validate() {
|
|
3094
3157
|
const missing = this.missingRequiredCalls();
|
|
3095
|
-
if (missing.length
|
|
3158
|
+
if (!missing.length) return;
|
|
3096
3159
|
throw new Error(`Ternary expression missing ${missing.join(" and ")}`);
|
|
3097
3160
|
}
|
|
3098
3161
|
missingRequiredCalls() {
|
|
@@ -3106,8 +3169,8 @@ var TernaryTsDsl = class extends Mixed$20 {
|
|
|
3106
3169
|
|
|
3107
3170
|
//#endregion
|
|
3108
3171
|
//#region src/ts-dsl/expr/typeof.ts
|
|
3109
|
-
const Mixed$
|
|
3110
|
-
var TypeOfExprTsDsl = class extends Mixed$
|
|
3172
|
+
const Mixed$20 = OperatorMixin(TsDsl);
|
|
3173
|
+
var TypeOfExprTsDsl = class extends Mixed$20 {
|
|
3111
3174
|
"~dsl" = "TypeOfExprTsDsl";
|
|
3112
3175
|
_expr;
|
|
3113
3176
|
constructor(expr) {
|
|
@@ -3156,6 +3219,105 @@ var NoteTsDsl = class extends TsDsl {
|
|
|
3156
3219
|
}
|
|
3157
3220
|
};
|
|
3158
3221
|
|
|
3222
|
+
//#endregion
|
|
3223
|
+
//#region src/ts-dsl/stmt/for.ts
|
|
3224
|
+
const Mixed$19 = DoMixin(LayoutMixin(TsDsl));
|
|
3225
|
+
var ImplForTsDsl = class extends Mixed$19 {
|
|
3226
|
+
"~dsl" = "ForTsDsl";
|
|
3227
|
+
_await;
|
|
3228
|
+
_condition;
|
|
3229
|
+
_iterableOrUpdate;
|
|
3230
|
+
_mode = "for";
|
|
3231
|
+
_variableOrInit;
|
|
3232
|
+
constructor(variableOrInit, modeOrCondition, iterableOrUpdate) {
|
|
3233
|
+
super();
|
|
3234
|
+
this._iterableOrUpdate = iterableOrUpdate;
|
|
3235
|
+
this._variableOrInit = variableOrInit;
|
|
3236
|
+
if (typeof modeOrCondition === "string") this._mode = modeOrCondition ?? "for";
|
|
3237
|
+
else this._condition = modeOrCondition;
|
|
3238
|
+
}
|
|
3239
|
+
analyze(ctx) {
|
|
3240
|
+
ctx.analyze(this._condition);
|
|
3241
|
+
ctx.analyze(this._iterableOrUpdate);
|
|
3242
|
+
ctx.analyze(this._variableOrInit);
|
|
3243
|
+
ctx.pushScope();
|
|
3244
|
+
try {
|
|
3245
|
+
super.analyze(ctx);
|
|
3246
|
+
} finally {
|
|
3247
|
+
ctx.popScope();
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
/** Returns true when all required builder calls are present. */
|
|
3251
|
+
get isValid() {
|
|
3252
|
+
return !this.missingRequiredCalls().length;
|
|
3253
|
+
}
|
|
3254
|
+
/** Enables async iteration (`for await...of`). Can only be called on for...of. */
|
|
3255
|
+
await() {
|
|
3256
|
+
this._await = true;
|
|
3257
|
+
this.of();
|
|
3258
|
+
return this;
|
|
3259
|
+
}
|
|
3260
|
+
/** Sets the condition (e.g., `i < n`). */
|
|
3261
|
+
condition(condition) {
|
|
3262
|
+
this._condition = condition;
|
|
3263
|
+
return this;
|
|
3264
|
+
}
|
|
3265
|
+
/** Sets the iteration variable (e.g., `$.const('item')`). */
|
|
3266
|
+
each(variable) {
|
|
3267
|
+
this._variableOrInit = variable;
|
|
3268
|
+
return this;
|
|
3269
|
+
}
|
|
3270
|
+
/** Sets the object to iterate over and switches to for...in. */
|
|
3271
|
+
in(iterable) {
|
|
3272
|
+
this._mode = "in";
|
|
3273
|
+
if (iterable !== void 0) this.iterable(iterable);
|
|
3274
|
+
return this;
|
|
3275
|
+
}
|
|
3276
|
+
/** Sets the initialization (e.g., `let i = 0`). */
|
|
3277
|
+
init(init) {
|
|
3278
|
+
this._variableOrInit = init;
|
|
3279
|
+
return this;
|
|
3280
|
+
}
|
|
3281
|
+
/** Sets the iterable to iterate over. */
|
|
3282
|
+
iterable(iterable) {
|
|
3283
|
+
this._iterableOrUpdate = iterable;
|
|
3284
|
+
return this;
|
|
3285
|
+
}
|
|
3286
|
+
/** Sets the iterable to iterate over and switches to for...of. */
|
|
3287
|
+
of(iterable) {
|
|
3288
|
+
this._mode = "of";
|
|
3289
|
+
if (iterable !== void 0) this.iterable(iterable);
|
|
3290
|
+
return this;
|
|
3291
|
+
}
|
|
3292
|
+
/** Sets the update expression (e.g., `i++`). */
|
|
3293
|
+
update(update) {
|
|
3294
|
+
this._iterableOrUpdate = update;
|
|
3295
|
+
return this;
|
|
3296
|
+
}
|
|
3297
|
+
toAst() {
|
|
3298
|
+
this.$validate();
|
|
3299
|
+
const body = this.$node(new BlockTsDsl(...this._do).pretty());
|
|
3300
|
+
if (this._mode === "of") return ts.factory.createForOfStatement(this._await ? ts.factory.createToken(ts.SyntaxKind.AwaitKeyword) : void 0, this.$node(this._variableOrInit).declarationList, this.$node(this._iterableOrUpdate), body);
|
|
3301
|
+
if (this._mode === "in") return ts.factory.createForInStatement(this.$node(this._variableOrInit).declarationList, this.$node(this._iterableOrUpdate), body);
|
|
3302
|
+
const init = this.$node(this._variableOrInit);
|
|
3303
|
+
return ts.factory.createForStatement(init && ts.isVariableStatement(init) ? init.declarationList : init, this.$node(this._condition), this.$node(this._iterableOrUpdate), body);
|
|
3304
|
+
}
|
|
3305
|
+
$validate() {
|
|
3306
|
+
const missing = this.missingRequiredCalls();
|
|
3307
|
+
if (!missing.length) return;
|
|
3308
|
+
throw new Error(`For${this._mode === "for" ? "" : `...${this._mode}`} statement missing ${missing.join(" and ")}`);
|
|
3309
|
+
}
|
|
3310
|
+
missingRequiredCalls() {
|
|
3311
|
+
const missing = [];
|
|
3312
|
+
if (this._mode !== "for") {
|
|
3313
|
+
if (!this._variableOrInit) missing.push(".each()");
|
|
3314
|
+
if (!this._iterableOrUpdate) missing.push(".iterable()");
|
|
3315
|
+
}
|
|
3316
|
+
return missing;
|
|
3317
|
+
}
|
|
3318
|
+
};
|
|
3319
|
+
const ForTsDsl = ImplForTsDsl;
|
|
3320
|
+
|
|
3159
3321
|
//#endregion
|
|
3160
3322
|
//#region src/ts-dsl/stmt/if.ts
|
|
3161
3323
|
const Mixed$18 = DoMixin(TsDsl);
|
|
@@ -3181,7 +3343,7 @@ var IfTsDsl = class extends Mixed$18 {
|
|
|
3181
3343
|
}
|
|
3182
3344
|
/** Returns true when all required builder calls are present. */
|
|
3183
3345
|
get isValid() {
|
|
3184
|
-
return this.missingRequiredCalls().length
|
|
3346
|
+
return !this.missingRequiredCalls().length;
|
|
3185
3347
|
}
|
|
3186
3348
|
condition(condition) {
|
|
3187
3349
|
this._condition = condition;
|
|
@@ -3197,13 +3359,13 @@ var IfTsDsl = class extends Mixed$18 {
|
|
|
3197
3359
|
}
|
|
3198
3360
|
$validate() {
|
|
3199
3361
|
const missing = this.missingRequiredCalls();
|
|
3200
|
-
if (missing.length
|
|
3362
|
+
if (!missing.length) return;
|
|
3201
3363
|
throw new Error(`If statement missing ${missing.join(" and ")}`);
|
|
3202
3364
|
}
|
|
3203
3365
|
missingRequiredCalls() {
|
|
3204
3366
|
const missing = [];
|
|
3205
3367
|
if (!this._condition) missing.push(".condition()");
|
|
3206
|
-
if (this._do.length
|
|
3368
|
+
if (!this._do.length) missing.push(".do()");
|
|
3207
3369
|
return missing;
|
|
3208
3370
|
}
|
|
3209
3371
|
};
|
|
@@ -3302,7 +3464,7 @@ var TryTsDsl = class extends Mixed$15 {
|
|
|
3302
3464
|
}
|
|
3303
3465
|
/** Returns true when all required builder calls are present. */
|
|
3304
3466
|
get isValid() {
|
|
3305
|
-
return this.missingRequiredCalls().length
|
|
3467
|
+
return !this.missingRequiredCalls().length;
|
|
3306
3468
|
}
|
|
3307
3469
|
catch(...items) {
|
|
3308
3470
|
this._catch = items;
|
|
@@ -3327,12 +3489,12 @@ var TryTsDsl = class extends Mixed$15 {
|
|
|
3327
3489
|
}
|
|
3328
3490
|
$validate() {
|
|
3329
3491
|
const missing = this.missingRequiredCalls();
|
|
3330
|
-
if (missing.length
|
|
3492
|
+
if (!missing.length) return;
|
|
3331
3493
|
throw new Error(`Try statement missing ${missing.join(" and ")}`);
|
|
3332
3494
|
}
|
|
3333
3495
|
missingRequiredCalls() {
|
|
3334
3496
|
const missing = [];
|
|
3335
|
-
if (!this._try || this._try.length
|
|
3497
|
+
if (!this._try || !this._try.length) missing.push(".try()");
|
|
3336
3498
|
return missing;
|
|
3337
3499
|
}
|
|
3338
3500
|
};
|
|
@@ -3357,7 +3519,7 @@ var VarTsDsl = class extends Mixed$14 {
|
|
|
3357
3519
|
}
|
|
3358
3520
|
/** Returns true when all required builder calls are present. */
|
|
3359
3521
|
get isValid() {
|
|
3360
|
-
return this.missingRequiredCalls().length
|
|
3522
|
+
return !this.missingRequiredCalls().length;
|
|
3361
3523
|
}
|
|
3362
3524
|
const() {
|
|
3363
3525
|
this.kind = ts.NodeFlags.Const;
|
|
@@ -3383,7 +3545,7 @@ var VarTsDsl = class extends Mixed$14 {
|
|
|
3383
3545
|
}
|
|
3384
3546
|
$validate() {
|
|
3385
3547
|
const missing = this.missingRequiredCalls();
|
|
3386
|
-
if (missing.length
|
|
3548
|
+
if (!missing.length) return;
|
|
3387
3549
|
throw new Error(`Variable declaration missing ${missing.join(" and ")}`);
|
|
3388
3550
|
}
|
|
3389
3551
|
missingRequiredCalls() {
|
|
@@ -3414,7 +3576,7 @@ var TypeAliasTsDsl = class extends Mixed$13 {
|
|
|
3414
3576
|
}
|
|
3415
3577
|
/** Returns true when all required builder calls are present. */
|
|
3416
3578
|
get isValid() {
|
|
3417
|
-
return this.missingRequiredCalls().length
|
|
3579
|
+
return !this.missingRequiredCalls().length;
|
|
3418
3580
|
}
|
|
3419
3581
|
/** Sets the type expression on the right-hand side of `= ...`. */
|
|
3420
3582
|
type(node) {
|
|
@@ -3428,13 +3590,13 @@ var TypeAliasTsDsl = class extends Mixed$13 {
|
|
|
3428
3590
|
}
|
|
3429
3591
|
$validate() {
|
|
3430
3592
|
const missing = this.missingRequiredCalls();
|
|
3431
|
-
if (missing.length
|
|
3593
|
+
if (!missing.length) return;
|
|
3432
3594
|
const name = this.name.toString();
|
|
3433
3595
|
throw new Error(`Type alias${name ? ` "${name}"` : ""} missing ${missing.join(" and ")}`);
|
|
3434
3596
|
}
|
|
3435
3597
|
missingRequiredCalls() {
|
|
3436
3598
|
const missing = [];
|
|
3437
|
-
if (!this.value) missing.push("
|
|
3599
|
+
if (!this.value) missing.push(".type()");
|
|
3438
3600
|
return missing;
|
|
3439
3601
|
}
|
|
3440
3602
|
};
|
|
@@ -3516,7 +3678,7 @@ var TypeIdxSigTsDsl = class extends Mixed$10 {
|
|
|
3516
3678
|
}
|
|
3517
3679
|
/** Returns true when all required builder calls are present. */
|
|
3518
3680
|
get isValid() {
|
|
3519
|
-
return this.missingRequiredCalls().length
|
|
3681
|
+
return !this.missingRequiredCalls().length;
|
|
3520
3682
|
}
|
|
3521
3683
|
/** Sets the key type: `[name: T]` */
|
|
3522
3684
|
key(type) {
|
|
@@ -3535,7 +3697,7 @@ var TypeIdxSigTsDsl = class extends Mixed$10 {
|
|
|
3535
3697
|
}
|
|
3536
3698
|
$validate() {
|
|
3537
3699
|
const missing = this.missingRequiredCalls();
|
|
3538
|
-
if (missing.length
|
|
3700
|
+
if (!missing.length) return;
|
|
3539
3701
|
const name = this.name.toString();
|
|
3540
3702
|
throw new Error(`Index signature${name ? ` "${name}"` : ""} missing ${missing.join(" and ")}`);
|
|
3541
3703
|
}
|
|
@@ -3573,7 +3735,7 @@ var TypePropTsDsl = class extends Mixed$9 {
|
|
|
3573
3735
|
}
|
|
3574
3736
|
/** Returns true when all required builder calls are present. */
|
|
3575
3737
|
get isValid() {
|
|
3576
|
-
return this.missingRequiredCalls().length
|
|
3738
|
+
return !this.missingRequiredCalls().length;
|
|
3577
3739
|
}
|
|
3578
3740
|
/** Sets the property type. */
|
|
3579
3741
|
type(type) {
|
|
@@ -3588,13 +3750,13 @@ var TypePropTsDsl = class extends Mixed$9 {
|
|
|
3588
3750
|
}
|
|
3589
3751
|
$validate() {
|
|
3590
3752
|
const missing = this.missingRequiredCalls();
|
|
3591
|
-
if (missing.length
|
|
3753
|
+
if (!missing.length) return;
|
|
3592
3754
|
const name = this.name.toString();
|
|
3593
3755
|
throw new Error(`Type property${name ? ` "${name}"` : ""} missing ${missing.join(" and ")}`);
|
|
3594
3756
|
}
|
|
3595
3757
|
missingRequiredCalls() {
|
|
3596
3758
|
const missing = [];
|
|
3597
|
-
if (!this._type) missing.push("
|
|
3759
|
+
if (!this._type) missing.push(".type()");
|
|
3598
3760
|
return missing;
|
|
3599
3761
|
}
|
|
3600
3762
|
};
|
|
@@ -3695,7 +3857,7 @@ var TypeFuncTsDsl = class extends Mixed$6 {
|
|
|
3695
3857
|
}
|
|
3696
3858
|
/** Returns true when all required builder calls are present. */
|
|
3697
3859
|
get isValid() {
|
|
3698
|
-
return this.missingRequiredCalls().length
|
|
3860
|
+
return !this.missingRequiredCalls().length;
|
|
3699
3861
|
}
|
|
3700
3862
|
toAst() {
|
|
3701
3863
|
this.$validate();
|
|
@@ -3704,7 +3866,7 @@ var TypeFuncTsDsl = class extends Mixed$6 {
|
|
|
3704
3866
|
}
|
|
3705
3867
|
$validate() {
|
|
3706
3868
|
const missing = this.missingRequiredCalls();
|
|
3707
|
-
if (missing.length
|
|
3869
|
+
if (!missing.length) return;
|
|
3708
3870
|
throw new Error(`Function type missing ${missing.join(" and ")}`);
|
|
3709
3871
|
}
|
|
3710
3872
|
missingRequiredCalls() {
|
|
@@ -3734,7 +3896,7 @@ var TypeIdxTsDsl = class extends Mixed$5 {
|
|
|
3734
3896
|
}
|
|
3735
3897
|
/** Returns true when all required builder calls are present. */
|
|
3736
3898
|
get isValid() {
|
|
3737
|
-
return this.missingRequiredCalls().length
|
|
3899
|
+
return !this.missingRequiredCalls().length;
|
|
3738
3900
|
}
|
|
3739
3901
|
base(base) {
|
|
3740
3902
|
this._base = base;
|
|
@@ -3750,7 +3912,7 @@ var TypeIdxTsDsl = class extends Mixed$5 {
|
|
|
3750
3912
|
}
|
|
3751
3913
|
$validate() {
|
|
3752
3914
|
const missing = this.missingRequiredCalls();
|
|
3753
|
-
if (missing.length
|
|
3915
|
+
if (!missing.length) return;
|
|
3754
3916
|
throw new Error(`Indexed access type missing ${missing.join(" and ")}`);
|
|
3755
3917
|
}
|
|
3756
3918
|
missingRequiredCalls() {
|
|
@@ -3785,7 +3947,7 @@ var TypeMappedTsDsl = class extends Mixed$4 {
|
|
|
3785
3947
|
}
|
|
3786
3948
|
/** Returns true when all required builder calls are present. */
|
|
3787
3949
|
get isValid() {
|
|
3788
|
-
return this.missingRequiredCalls().length
|
|
3950
|
+
return !this.missingRequiredCalls().length;
|
|
3789
3951
|
}
|
|
3790
3952
|
/** Sets the key constraint: `[K in Constraint]` */
|
|
3791
3953
|
key(type) {
|
|
@@ -3823,7 +3985,7 @@ var TypeMappedTsDsl = class extends Mixed$4 {
|
|
|
3823
3985
|
}
|
|
3824
3986
|
$validate() {
|
|
3825
3987
|
const missing = this.missingRequiredCalls();
|
|
3826
|
-
if (missing.length
|
|
3988
|
+
if (!missing.length) return;
|
|
3827
3989
|
const name = this.name.toString();
|
|
3828
3990
|
throw new Error(`Mapped type${name ? ` "${name}"` : ""} missing ${missing.join(" and ")}`);
|
|
3829
3991
|
}
|
|
@@ -3894,7 +4056,7 @@ var TypeOperatorTsDsl = class extends Mixed$3 {
|
|
|
3894
4056
|
/** Throws if required fields are not set. */
|
|
3895
4057
|
$validate() {
|
|
3896
4058
|
const missing = this.missingRequiredCalls();
|
|
3897
|
-
if (missing.length
|
|
4059
|
+
if (!missing.length) return;
|
|
3898
4060
|
throw new Error(`Type operator missing ${missing.join(" and ")}`);
|
|
3899
4061
|
}
|
|
3900
4062
|
missingRequiredCalls() {
|
|
@@ -3945,7 +4107,7 @@ var TypeQueryTsDsl = class extends Mixed$1 {
|
|
|
3945
4107
|
_expr;
|
|
3946
4108
|
constructor(expr) {
|
|
3947
4109
|
super();
|
|
3948
|
-
this._expr = expr;
|
|
4110
|
+
this._expr = ref(expr);
|
|
3949
4111
|
}
|
|
3950
4112
|
analyze(ctx) {
|
|
3951
4113
|
super.analyze(ctx);
|
|
@@ -3992,7 +4154,7 @@ var TypeTemplateTsDsl = class extends Mixed {
|
|
|
3992
4154
|
normalized.push(merged);
|
|
3993
4155
|
} else normalized.push(current);
|
|
3994
4156
|
}
|
|
3995
|
-
if (normalized.length
|
|
4157
|
+
if (!normalized.length || typeof normalized[0] !== "string") normalized.unshift("");
|
|
3996
4158
|
if (normalized.length === 1 && typeof normalized[0] === "string") return ts.factory.createTemplateLiteralType(ts.factory.createTemplateHead(normalized[0]), []);
|
|
3997
4159
|
if (normalized.length === 2 && typeof normalized[0] === "string" && typeof normalized[1] !== "string") return ts.factory.createTemplateLiteralType(ts.factory.createTemplateHead(normalized[0]), [ts.factory.createTemplateLiteralTypeSpan(normalized[1], ts.factory.createTemplateTail(""))]);
|
|
3998
4160
|
const head = ts.factory.createTemplateHead(normalized.shift());
|
|
@@ -4000,7 +4162,7 @@ var TypeTemplateTsDsl = class extends Mixed {
|
|
|
4000
4162
|
while (normalized.length) {
|
|
4001
4163
|
const type = normalized.shift();
|
|
4002
4164
|
const next = typeof normalized[0] === "string" ? normalized.shift() : "";
|
|
4003
|
-
const isLast = normalized.length
|
|
4165
|
+
const isLast = !normalized.length;
|
|
4004
4166
|
spans.push(ts.factory.createTemplateLiteralTypeSpan(type, isLast ? ts.factory.createTemplateTail(next) : ts.factory.createTemplateMiddle(next)));
|
|
4005
4167
|
}
|
|
4006
4168
|
return ts.factory.createTemplateLiteralType(head, spans);
|
|
@@ -4165,7 +4327,7 @@ var TypeScriptRenderer = class TypeScriptRenderer {
|
|
|
4165
4327
|
const specifiers = group.imports.map((imp) => {
|
|
4166
4328
|
return ts.factory.createImportSpecifier(imp.isTypeOnly, imp.sourceName !== imp.localName ? $.id(imp.sourceName).toAst() : void 0, $.id(imp.localName).toAst());
|
|
4167
4329
|
});
|
|
4168
|
-
const importClause = ts.factory.createImportClause(group.isTypeOnly, group.kind === "default" ? $.id(group.localName ?? "").toAst() : void 0, group.kind === "namespace" ? ts.factory.createNamespaceImport($.id(group.localName ?? "").toAst()) : specifiers.length
|
|
4330
|
+
const importClause = ts.factory.createImportClause(group.isTypeOnly, group.kind === "default" ? $.id(group.localName ?? "").toAst() : void 0, group.kind === "namespace" ? ts.factory.createNamespaceImport($.id(group.localName ?? "").toAst()) : specifiers.length ? ts.factory.createNamedImports(specifiers) : void 0);
|
|
4169
4331
|
return ts.factory.createImportDeclaration(void 0, importClause, $.literal(group.modulePath).toAst());
|
|
4170
4332
|
}
|
|
4171
4333
|
getExports(ctx) {
|
|
@@ -4275,22 +4437,24 @@ const tsDsl = {
|
|
|
4275
4437
|
call: (...args) => new CallTsDsl(...args),
|
|
4276
4438
|
class: (...args) => new ClassTsDsl(...args),
|
|
4277
4439
|
const: (...args) => new VarTsDsl(...args).const(),
|
|
4440
|
+
dec: (...args) => new PostfixTsDsl(...args).dec(),
|
|
4278
4441
|
decorator: (...args) => new DecoratorTsDsl(...args),
|
|
4279
4442
|
doc: (...args) => new DocTsDsl(...args),
|
|
4280
4443
|
enum: (...args) => new EnumTsDsl(...args),
|
|
4281
4444
|
expr: (...args) => new ExprTsDsl(...args),
|
|
4282
4445
|
field: (...args) => new FieldTsDsl(...args),
|
|
4446
|
+
for: ((...args) => new ForTsDsl(...args)),
|
|
4283
4447
|
fromValue: (...args) => fromValue$1(...args),
|
|
4284
4448
|
func: ((nameOrFn, fn) => {
|
|
4285
4449
|
if (nameOrFn === void 0) return new FuncTsDsl();
|
|
4286
|
-
if (typeof nameOrFn !== "string") return new FuncTsDsl(nameOrFn);
|
|
4287
|
-
if (fn === void 0) return new FuncTsDsl(nameOrFn);
|
|
4450
|
+
if (typeof nameOrFn !== "string" || fn === void 0) return new FuncTsDsl(nameOrFn);
|
|
4288
4451
|
return new FuncTsDsl(nameOrFn, fn);
|
|
4289
4452
|
}),
|
|
4290
4453
|
getter: (...args) => new GetterTsDsl(...args),
|
|
4291
4454
|
hint: (...args) => new HintTsDsl(...args),
|
|
4292
4455
|
id: (...args) => new IdTsDsl(...args),
|
|
4293
4456
|
if: (...args) => new IfTsDsl(...args),
|
|
4457
|
+
inc: (...args) => new PostfixTsDsl(...args).inc(),
|
|
4294
4458
|
init: (...args) => new InitTsDsl(...args),
|
|
4295
4459
|
lazy: (...args) => new LazyTsDsl(...args),
|
|
4296
4460
|
let: (...args) => new VarTsDsl(...args).let(),
|
|
@@ -4409,7 +4573,7 @@ const operationAuth = ({ operation, plugin }) => {
|
|
|
4409
4573
|
//#region src/plugins/@hey-api/sdk/shared/signature.ts
|
|
4410
4574
|
/**
|
|
4411
4575
|
* Collects and resolves all operation parameters for flattened SDK signatures.
|
|
4412
|
-
* - Prefixes all conflicting names with their location (e.g
|
|
4576
|
+
* - Prefixes all conflicting names with their location (e.g., path_foo, query_foo)
|
|
4413
4577
|
* - Returns a flat map of resolved parameter names to their metadata
|
|
4414
4578
|
*/
|
|
4415
4579
|
function getSignatureParameters({ operation }) {
|
|
@@ -4753,7 +4917,7 @@ function operationStatements({ isRequiredOptions, opParameters, operation, plugi
|
|
|
4753
4917
|
|
|
4754
4918
|
//#endregion
|
|
4755
4919
|
//#region src/plugins/@hey-api/sdk/v1/node.ts
|
|
4756
|
-
const source$
|
|
4920
|
+
const source$2 = globalThis.Symbol("@hey-api/sdk");
|
|
4757
4921
|
function isInstance(plugin) {
|
|
4758
4922
|
const config = plugin.config.operations;
|
|
4759
4923
|
return config.container === "class" && config.methods === "instance" && config.strategy !== "flat";
|
|
@@ -4762,7 +4926,7 @@ function attachComment$1(args) {
|
|
|
4762
4926
|
const { node, operation, plugin } = args;
|
|
4763
4927
|
return node.$if(plugin.config.comments && createOperationComment(operation), (n, v) => n.doc(v));
|
|
4764
4928
|
}
|
|
4765
|
-
function createShellMeta(node) {
|
|
4929
|
+
function createShellMeta$1(node) {
|
|
4766
4930
|
return {
|
|
4767
4931
|
category: "utility",
|
|
4768
4932
|
resource: "class",
|
|
@@ -4783,7 +4947,7 @@ function createFnSymbol(plugin, item) {
|
|
|
4783
4947
|
} });
|
|
4784
4948
|
}
|
|
4785
4949
|
function childToNode(resource, plugin) {
|
|
4786
|
-
const refChild = plugin.referenceSymbol(createShellMeta(resource));
|
|
4950
|
+
const refChild = plugin.referenceSymbol(createShellMeta$1(resource));
|
|
4787
4951
|
const memberNameStr = toCase(refChild.name, plugin.config.operations.methodName.casing ?? "camelCase");
|
|
4788
4952
|
const memberName = plugin.symbol(memberNameStr);
|
|
4789
4953
|
if (isInstance(plugin)) {
|
|
@@ -4793,10 +4957,10 @@ function childToNode(resource, plugin) {
|
|
|
4793
4957
|
if (plugin.isSymbolRegistered(refChild.id)) return [$.field(memberName, (f) => f.static().assign($(refChild)))];
|
|
4794
4958
|
return [$.getter(memberName, (g) => g.public().static().do($.return(refChild)))];
|
|
4795
4959
|
}
|
|
4796
|
-
function createShell(plugin) {
|
|
4960
|
+
function createShell$1(plugin) {
|
|
4797
4961
|
const isAngularClient = getClientPlugin(getTypedConfig(plugin)).name === "@hey-api/client-angular";
|
|
4798
4962
|
return { define: (node) => {
|
|
4799
|
-
const symbol = plugin.symbol(applyNaming(node.name, node.isRoot ? plugin.config.operations.containerName : plugin.config.operations.segmentName), { meta: createShellMeta(node) });
|
|
4963
|
+
const symbol = plugin.symbol(applyNaming(node.name, node.isRoot ? plugin.config.operations.containerName : plugin.config.operations.segmentName), { meta: createShellMeta$1(node) });
|
|
4800
4964
|
const c = $.class(symbol).export().$if(isInstance(plugin), (c) => c.extends(plugin.referenceSymbol({
|
|
4801
4965
|
category: "utility",
|
|
4802
4966
|
resource: "class",
|
|
@@ -4889,10 +5053,10 @@ function implementFn(args) {
|
|
|
4889
5053
|
role: "response"
|
|
4890
5054
|
}), (t, s) => t.extends(s).default(s), (t) => t.default("undefined"))), (m) => m.generic("ThrowOnError", (t) => t.extends("boolean").default(("throwOnError" in client.config ? client.config.throwOnError : false) ?? false))).params(...opParameters.parameters).do(...statements);
|
|
4891
5055
|
}
|
|
4892
|
-
function toNode$
|
|
5056
|
+
function toNode$2(model, plugin) {
|
|
4893
5057
|
if (model.virtual) {
|
|
4894
5058
|
const nodes = [];
|
|
4895
|
-
for (const item of model.itemsFrom(source$
|
|
5059
|
+
for (const item of model.itemsFrom(source$2)) {
|
|
4896
5060
|
const { operation } = item.data;
|
|
4897
5061
|
let node = $.const(createFnSymbol(plugin, item)).export().assign(implementFn({
|
|
4898
5062
|
node: $.func(),
|
|
@@ -4915,7 +5079,7 @@ function toNode$1(model, plugin) {
|
|
|
4915
5079
|
const shell = model.shell.define(model);
|
|
4916
5080
|
const node = shell.node;
|
|
4917
5081
|
let index = 0;
|
|
4918
|
-
for (const item of model.itemsFrom(source$
|
|
5082
|
+
for (const item of model.itemsFrom(source$2)) {
|
|
4919
5083
|
const { operation } = item.data;
|
|
4920
5084
|
if (node["~dsl"] === "VarTsDsl") {} else {
|
|
4921
5085
|
if (index > 0 || node.hasBody) node.newline();
|
|
@@ -4981,7 +5145,7 @@ function hasOperationSse({ operation }) {
|
|
|
4981
5145
|
|
|
4982
5146
|
//#endregion
|
|
4983
5147
|
//#region src/plugins/@angular/common/shared/node.ts
|
|
4984
|
-
const source = globalThis.Symbol("@angular/common");
|
|
5148
|
+
const source$1 = globalThis.Symbol("@angular/common");
|
|
4985
5149
|
function attachComment(args) {
|
|
4986
5150
|
const { node, operation, plugin } = args;
|
|
4987
5151
|
return node.$if(plugin.config.comments && createOperationComment(operation), (n, v) => n.doc(v));
|
|
@@ -5127,7 +5291,7 @@ function implementHttpResourceFn(args) {
|
|
|
5127
5291
|
function toHttpRequestNode(model, plugin) {
|
|
5128
5292
|
if (model.virtual) {
|
|
5129
5293
|
const nodes = [];
|
|
5130
|
-
for (const item of model.itemsFrom(source)) {
|
|
5294
|
+
for (const item of model.itemsFrom(source$1)) {
|
|
5131
5295
|
const { operation } = item.data;
|
|
5132
5296
|
let node = $.const(createHttpRequestFnSymbol(plugin, item)).export().assign(implementHttpRequestFn({
|
|
5133
5297
|
node: $.func(),
|
|
@@ -5148,7 +5312,7 @@ function toHttpRequestNode(model, plugin) {
|
|
|
5148
5312
|
const shell = model.shell.define(model);
|
|
5149
5313
|
const node = shell.node;
|
|
5150
5314
|
let index = 0;
|
|
5151
|
-
for (const item of model.itemsFrom(source)) {
|
|
5315
|
+
for (const item of model.itemsFrom(source$1)) {
|
|
5152
5316
|
const { operation } = item.data;
|
|
5153
5317
|
if (index > 0 || node.hasBody) node.newline();
|
|
5154
5318
|
node.do(implementHttpRequestFn({
|
|
@@ -5175,7 +5339,7 @@ function toHttpRequestNode(model, plugin) {
|
|
|
5175
5339
|
function toHttpResourceNode(model, plugin) {
|
|
5176
5340
|
if (model.virtual) {
|
|
5177
5341
|
const nodes = [];
|
|
5178
|
-
for (const item of model.itemsFrom(source)) {
|
|
5342
|
+
for (const item of model.itemsFrom(source$1)) {
|
|
5179
5343
|
const { operation } = item.data;
|
|
5180
5344
|
let node = $.const(createHttpResourceFnSymbol(plugin, item)).export().assign(implementHttpResourceFn({
|
|
5181
5345
|
node: $.func(),
|
|
@@ -5196,7 +5360,7 @@ function toHttpResourceNode(model, plugin) {
|
|
|
5196
5360
|
const shell = model.shell.define(model);
|
|
5197
5361
|
const node = shell.node;
|
|
5198
5362
|
let index = 0;
|
|
5199
|
-
for (const item of model.itemsFrom(source)) {
|
|
5363
|
+
for (const item of model.itemsFrom(source$1)) {
|
|
5200
5364
|
const { operation } = item.data;
|
|
5201
5365
|
if (index > 0 || node.hasBody) node.newline();
|
|
5202
5366
|
node.do(implementHttpResourceFn({
|
|
@@ -5223,36 +5387,14 @@ function toHttpResourceNode(model, plugin) {
|
|
|
5223
5387
|
|
|
5224
5388
|
//#endregion
|
|
5225
5389
|
//#region src/plugins/@angular/common/plugin.ts
|
|
5226
|
-
const handler$
|
|
5390
|
+
const handler$13 = ({ plugin }) => {
|
|
5227
5391
|
plugin.symbol("HttpRequest", {
|
|
5228
5392
|
external: "@angular/common/http",
|
|
5229
|
-
kind: "type"
|
|
5230
|
-
meta: {
|
|
5231
|
-
category: "external",
|
|
5232
|
-
resource: "@angular/common/http.HttpRequest"
|
|
5233
|
-
}
|
|
5234
|
-
});
|
|
5235
|
-
plugin.symbol("inject", {
|
|
5236
|
-
external: "@angular/core",
|
|
5237
|
-
meta: {
|
|
5238
|
-
category: "external",
|
|
5239
|
-
resource: "@angular/core.inject"
|
|
5240
|
-
}
|
|
5241
|
-
});
|
|
5242
|
-
plugin.symbol("Injectable", {
|
|
5243
|
-
external: "@angular/core",
|
|
5244
|
-
meta: {
|
|
5245
|
-
category: "external",
|
|
5246
|
-
resource: "@angular/core.Injectable"
|
|
5247
|
-
}
|
|
5248
|
-
});
|
|
5249
|
-
plugin.symbol("httpResource", {
|
|
5250
|
-
external: "@angular/common/http",
|
|
5251
|
-
meta: {
|
|
5252
|
-
category: "external",
|
|
5253
|
-
resource: "@angular/common/http.httpResource"
|
|
5254
|
-
}
|
|
5393
|
+
kind: "type"
|
|
5255
5394
|
});
|
|
5395
|
+
plugin.symbol("inject", { external: "@angular/core" });
|
|
5396
|
+
plugin.symbol("Injectable", { external: "@angular/core" });
|
|
5397
|
+
plugin.symbol("httpResource", { external: "@angular/common/http" });
|
|
5256
5398
|
const httpRequestStructure = new StructureModel();
|
|
5257
5399
|
const httpResourceStructure = new StructureModel();
|
|
5258
5400
|
if (plugin.config.httpRequests.enabled) {
|
|
@@ -5265,7 +5407,7 @@ const handler$12 = ({ plugin }) => {
|
|
|
5265
5407
|
path,
|
|
5266
5408
|
shell
|
|
5267
5409
|
})),
|
|
5268
|
-
source
|
|
5410
|
+
source: source$1
|
|
5269
5411
|
});
|
|
5270
5412
|
}, { order: "declarations" });
|
|
5271
5413
|
}
|
|
@@ -5279,7 +5421,7 @@ const handler$12 = ({ plugin }) => {
|
|
|
5279
5421
|
path,
|
|
5280
5422
|
shell
|
|
5281
5423
|
})),
|
|
5282
|
-
source
|
|
5424
|
+
source: source$1
|
|
5283
5425
|
});
|
|
5284
5426
|
}, { order: "declarations" });
|
|
5285
5427
|
}
|
|
@@ -5303,13 +5445,13 @@ const handler$12 = ({ plugin }) => {
|
|
|
5303
5445
|
|
|
5304
5446
|
//#endregion
|
|
5305
5447
|
//#region src/plugins/@angular/common/config.ts
|
|
5306
|
-
const defaultConfig$
|
|
5448
|
+
const defaultConfig$26 = {
|
|
5307
5449
|
config: {
|
|
5308
5450
|
comments: true,
|
|
5309
5451
|
includeInEntry: false
|
|
5310
5452
|
},
|
|
5311
5453
|
dependencies: ["@hey-api/client-angular", "@hey-api/sdk"],
|
|
5312
|
-
handler: handler$
|
|
5454
|
+
handler: handler$13,
|
|
5313
5455
|
name: "@angular/common",
|
|
5314
5456
|
resolveConfig: (plugin, context) => {
|
|
5315
5457
|
plugin.config.httpRequests = resolveHttpRequests(plugin.config, context);
|
|
@@ -5319,7 +5461,7 @@ const defaultConfig$25 = {
|
|
|
5319
5461
|
/**
|
|
5320
5462
|
* Type helper for `@angular/common` plugin, returns {@link Plugin.Config} object
|
|
5321
5463
|
*/
|
|
5322
|
-
const defineConfig$
|
|
5464
|
+
const defineConfig$26 = definePluginConfig(defaultConfig$26);
|
|
5323
5465
|
|
|
5324
5466
|
//#endregion
|
|
5325
5467
|
//#region src/plugins/@faker-js/faker/api.ts
|
|
@@ -5330,7 +5472,7 @@ var Api$4 = class {
|
|
|
5330
5472
|
|
|
5331
5473
|
//#endregion
|
|
5332
5474
|
//#region src/plugins/@faker-js/faker/config.ts
|
|
5333
|
-
const defaultConfig$
|
|
5475
|
+
const defaultConfig$25 = {
|
|
5334
5476
|
api: new Api$4(),
|
|
5335
5477
|
config: {
|
|
5336
5478
|
case: "camelCase",
|
|
@@ -5354,7 +5496,7 @@ const defaultConfig$24 = {
|
|
|
5354
5496
|
/**
|
|
5355
5497
|
* Type helper for Faker plugin, returns {@link Plugin.Config} object
|
|
5356
5498
|
*/
|
|
5357
|
-
const defineConfig$
|
|
5499
|
+
const defineConfig$25 = definePluginConfig(defaultConfig$25);
|
|
5358
5500
|
|
|
5359
5501
|
//#endregion
|
|
5360
5502
|
//#region src/plugins/@hey-api/client-core/config.ts
|
|
@@ -5585,7 +5727,7 @@ const clientPluginHandler = ({ plugin }) => {
|
|
|
5585
5727
|
|
|
5586
5728
|
//#endregion
|
|
5587
5729
|
//#region src/plugins/@hey-api/client-angular/config.ts
|
|
5588
|
-
const defaultConfig$
|
|
5730
|
+
const defaultConfig$24 = {
|
|
5589
5731
|
...clientDefaultMeta,
|
|
5590
5732
|
config: {
|
|
5591
5733
|
...clientDefaultConfig,
|
|
@@ -5597,11 +5739,11 @@ const defaultConfig$23 = {
|
|
|
5597
5739
|
/**
|
|
5598
5740
|
* Type helper for `@hey-api/client-angular` plugin, returns {@link Plugin.Config} object
|
|
5599
5741
|
*/
|
|
5600
|
-
const defineConfig$
|
|
5742
|
+
const defineConfig$24 = definePluginConfig(defaultConfig$24);
|
|
5601
5743
|
|
|
5602
5744
|
//#endregion
|
|
5603
5745
|
//#region src/plugins/@hey-api/client-axios/config.ts
|
|
5604
|
-
const defaultConfig$
|
|
5746
|
+
const defaultConfig$23 = {
|
|
5605
5747
|
...clientDefaultMeta,
|
|
5606
5748
|
config: {
|
|
5607
5749
|
...clientDefaultConfig,
|
|
@@ -5613,11 +5755,11 @@ const defaultConfig$22 = {
|
|
|
5613
5755
|
/**
|
|
5614
5756
|
* Type helper for `@hey-api/client-axios` plugin, returns {@link Plugin.Config} object
|
|
5615
5757
|
*/
|
|
5616
|
-
const defineConfig$
|
|
5758
|
+
const defineConfig$23 = definePluginConfig(defaultConfig$23);
|
|
5617
5759
|
|
|
5618
5760
|
//#endregion
|
|
5619
5761
|
//#region src/plugins/@hey-api/client-fetch/config.ts
|
|
5620
|
-
const defaultConfig$
|
|
5762
|
+
const defaultConfig$22 = {
|
|
5621
5763
|
...clientDefaultMeta,
|
|
5622
5764
|
config: {
|
|
5623
5765
|
...clientDefaultConfig,
|
|
@@ -5629,11 +5771,11 @@ const defaultConfig$21 = {
|
|
|
5629
5771
|
/**
|
|
5630
5772
|
* Type helper for `@hey-api/client-fetch` plugin, returns {@link Plugin.Config} object
|
|
5631
5773
|
*/
|
|
5632
|
-
const defineConfig$
|
|
5774
|
+
const defineConfig$22 = definePluginConfig(defaultConfig$22);
|
|
5633
5775
|
|
|
5634
5776
|
//#endregion
|
|
5635
5777
|
//#region src/plugins/@hey-api/client-ky/config.ts
|
|
5636
|
-
const defaultConfig$
|
|
5778
|
+
const defaultConfig$21 = {
|
|
5637
5779
|
...clientDefaultMeta,
|
|
5638
5780
|
config: {
|
|
5639
5781
|
...clientDefaultConfig,
|
|
@@ -5645,11 +5787,11 @@ const defaultConfig$20 = {
|
|
|
5645
5787
|
/**
|
|
5646
5788
|
* Type helper for `@hey-api/client-ky` plugin, returns {@link Plugin.Config} object
|
|
5647
5789
|
*/
|
|
5648
|
-
const defineConfig$
|
|
5790
|
+
const defineConfig$21 = definePluginConfig(defaultConfig$21);
|
|
5649
5791
|
|
|
5650
5792
|
//#endregion
|
|
5651
5793
|
//#region src/plugins/@hey-api/client-next/config.ts
|
|
5652
|
-
const defaultConfig$
|
|
5794
|
+
const defaultConfig$20 = {
|
|
5653
5795
|
...clientDefaultMeta,
|
|
5654
5796
|
config: {
|
|
5655
5797
|
...clientDefaultConfig,
|
|
@@ -5661,11 +5803,11 @@ const defaultConfig$19 = {
|
|
|
5661
5803
|
/**
|
|
5662
5804
|
* Type helper for `@hey-api/client-next` plugin, returns {@link Plugin.Config} object
|
|
5663
5805
|
*/
|
|
5664
|
-
const defineConfig$
|
|
5806
|
+
const defineConfig$20 = definePluginConfig(defaultConfig$20);
|
|
5665
5807
|
|
|
5666
5808
|
//#endregion
|
|
5667
5809
|
//#region src/plugins/@hey-api/client-nuxt/config.ts
|
|
5668
|
-
const defaultConfig$
|
|
5810
|
+
const defaultConfig$19 = {
|
|
5669
5811
|
...clientDefaultMeta,
|
|
5670
5812
|
config: clientDefaultConfig,
|
|
5671
5813
|
handler: clientPluginHandler,
|
|
@@ -5674,11 +5816,11 @@ const defaultConfig$18 = {
|
|
|
5674
5816
|
/**
|
|
5675
5817
|
* Type helper for `@hey-api/client-nuxt` plugin, returns {@link Plugin.Config} object
|
|
5676
5818
|
*/
|
|
5677
|
-
const defineConfig$
|
|
5819
|
+
const defineConfig$19 = definePluginConfig(defaultConfig$19);
|
|
5678
5820
|
|
|
5679
5821
|
//#endregion
|
|
5680
5822
|
//#region src/plugins/@hey-api/client-ofetch/config.ts
|
|
5681
|
-
const defaultConfig$
|
|
5823
|
+
const defaultConfig$18 = {
|
|
5682
5824
|
...clientDefaultMeta,
|
|
5683
5825
|
config: {
|
|
5684
5826
|
...clientDefaultConfig,
|
|
@@ -5690,7 +5832,7 @@ const defaultConfig$17 = {
|
|
|
5690
5832
|
/**
|
|
5691
5833
|
* Type helper for `@hey-api/client-ofetch` plugin, returns {@link Plugin.Config} object
|
|
5692
5834
|
*/
|
|
5693
|
-
const defineConfig$
|
|
5835
|
+
const defineConfig$18 = definePluginConfig(defaultConfig$18);
|
|
5694
5836
|
|
|
5695
5837
|
//#endregion
|
|
5696
5838
|
//#region src/plugins/@hey-api/schemas/plugin.ts
|
|
@@ -5921,7 +6063,7 @@ const schemasV3_1_X = ({ context, plugin }) => {
|
|
|
5921
6063
|
plugin.node(statement);
|
|
5922
6064
|
}
|
|
5923
6065
|
};
|
|
5924
|
-
const handler$
|
|
6066
|
+
const handler$12 = ({ plugin }) => {
|
|
5925
6067
|
if ("swagger" in plugin.context.spec) {
|
|
5926
6068
|
schemasV2_0_X({
|
|
5927
6069
|
context: plugin.context,
|
|
@@ -5948,19 +6090,19 @@ const handler$11 = ({ plugin }) => {
|
|
|
5948
6090
|
|
|
5949
6091
|
//#endregion
|
|
5950
6092
|
//#region src/plugins/@hey-api/schemas/config.ts
|
|
5951
|
-
const defaultConfig$
|
|
6093
|
+
const defaultConfig$17 = {
|
|
5952
6094
|
config: {
|
|
5953
6095
|
includeInEntry: false,
|
|
5954
6096
|
nameBuilder: (name) => `${name}Schema`,
|
|
5955
6097
|
type: "json"
|
|
5956
6098
|
},
|
|
5957
|
-
handler: handler$
|
|
6099
|
+
handler: handler$12,
|
|
5958
6100
|
name: "@hey-api/schemas"
|
|
5959
6101
|
};
|
|
5960
6102
|
/**
|
|
5961
6103
|
* Type helper for `@hey-api/schemas` plugin, returns {@link Plugin.Config} object
|
|
5962
6104
|
*/
|
|
5963
|
-
const defineConfig$
|
|
6105
|
+
const defineConfig$17 = definePluginConfig(defaultConfig$17);
|
|
5964
6106
|
|
|
5965
6107
|
//#endregion
|
|
5966
6108
|
//#region src/plugins/@hey-api/sdk/examples/config.ts
|
|
@@ -6009,9 +6151,9 @@ function resolveOperations(config, context) {
|
|
|
6009
6151
|
replacement: ["operations: { nesting: \"operationId\" }", "operations: { nesting: \"id\" }"]
|
|
6010
6152
|
});
|
|
6011
6153
|
const legacy = mapLegacyToConfig(config);
|
|
6012
|
-
return normalizeConfig(config.operations, legacy, context);
|
|
6154
|
+
return normalizeConfig$1(config.operations, legacy, context);
|
|
6013
6155
|
}
|
|
6014
|
-
function normalizeConfig(input, legacy, context) {
|
|
6156
|
+
function normalizeConfig$1(input, legacy, context) {
|
|
6015
6157
|
if (!input || typeof input === "string" || typeof input === "function") input = { strategy: input };
|
|
6016
6158
|
const strategy = legacy.strategy ?? input.strategy ?? "flat";
|
|
6017
6159
|
const methods = strategy === "single" ? "instance" : "static";
|
|
@@ -6112,7 +6254,7 @@ function mapLegacyToConfig(config) {
|
|
|
6112
6254
|
|
|
6113
6255
|
//#endregion
|
|
6114
6256
|
//#region src/plugins/@hey-api/sdk/operations/resolve.ts
|
|
6115
|
-
function resolvePath(plugin) {
|
|
6257
|
+
function resolvePath$1(plugin) {
|
|
6116
6258
|
if (plugin.config.operations.nesting === "id") return OperationPath.id();
|
|
6117
6259
|
if (plugin.config.operations.nesting === "operationId") return OperationPath.fromOperationId({
|
|
6118
6260
|
delimiters: plugin.config.operations.nestingDelimiters,
|
|
@@ -6120,18 +6262,18 @@ function resolvePath(plugin) {
|
|
|
6120
6262
|
});
|
|
6121
6263
|
return plugin.config.operations.nesting;
|
|
6122
6264
|
}
|
|
6123
|
-
function resolveStrategy(plugin) {
|
|
6124
|
-
if (plugin.config.operations.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath(plugin)(operation).join(".")] });
|
|
6265
|
+
function resolveStrategy$1(plugin) {
|
|
6266
|
+
if (plugin.config.operations.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath$1(plugin)(operation).join(".")] });
|
|
6125
6267
|
if (plugin.config.operations.strategy === "single") {
|
|
6126
6268
|
const root = plugin.config.operations.containerName;
|
|
6127
6269
|
return OperationStrategy.single({
|
|
6128
|
-
path: resolvePath(plugin),
|
|
6270
|
+
path: resolvePath$1(plugin),
|
|
6129
6271
|
root: typeof root.name === "string" ? root.name : root.name?.("") ?? ""
|
|
6130
6272
|
});
|
|
6131
6273
|
}
|
|
6132
6274
|
if (plugin.config.operations.strategy === "byTags") return OperationStrategy.byTags({
|
|
6133
6275
|
fallback: plugin.config.operations.strategyDefaultTag,
|
|
6134
|
-
path: resolvePath(plugin)
|
|
6276
|
+
path: resolvePath$1(plugin)
|
|
6135
6277
|
});
|
|
6136
6278
|
return plugin.config.operations.strategy;
|
|
6137
6279
|
}
|
|
@@ -6150,7 +6292,6 @@ const createTypeOptions = ({ plugin }) => {
|
|
|
6150
6292
|
external: clientModule,
|
|
6151
6293
|
kind: "type",
|
|
6152
6294
|
meta: {
|
|
6153
|
-
category: "external",
|
|
6154
6295
|
resource: "client.Client",
|
|
6155
6296
|
tool: client.name
|
|
6156
6297
|
}
|
|
@@ -6174,7 +6315,7 @@ const createTypeOptions = ({ plugin }) => {
|
|
|
6174
6315
|
|
|
6175
6316
|
//#endregion
|
|
6176
6317
|
//#region src/plugins/@hey-api/sdk/v1/plugin.ts
|
|
6177
|
-
const handlerV1$
|
|
6318
|
+
const handlerV1$3 = ({ plugin }) => {
|
|
6178
6319
|
const clientModule = clientFolderAbsolutePath(getTypedConfig(plugin));
|
|
6179
6320
|
const client = getClientPlugin(getTypedConfig(plugin));
|
|
6180
6321
|
const isAngularClient = client.name === "@hey-api/client-angular";
|
|
@@ -6182,7 +6323,6 @@ const handlerV1$2 = ({ plugin }) => {
|
|
|
6182
6323
|
plugin.symbol("formDataBodySerializer", {
|
|
6183
6324
|
external: clientModule,
|
|
6184
6325
|
meta: {
|
|
6185
|
-
category: "external",
|
|
6186
6326
|
resource: "client.formDataBodySerializer",
|
|
6187
6327
|
tool: client.name
|
|
6188
6328
|
}
|
|
@@ -6190,7 +6330,6 @@ const handlerV1$2 = ({ plugin }) => {
|
|
|
6190
6330
|
plugin.symbol("urlSearchParamsBodySerializer", {
|
|
6191
6331
|
external: clientModule,
|
|
6192
6332
|
meta: {
|
|
6193
|
-
category: "external",
|
|
6194
6333
|
resource: "client.urlSearchParamsBodySerializer",
|
|
6195
6334
|
tool: client.name
|
|
6196
6335
|
}
|
|
@@ -6198,7 +6337,6 @@ const handlerV1$2 = ({ plugin }) => {
|
|
|
6198
6337
|
plugin.symbol("buildClientParams", {
|
|
6199
6338
|
external: clientModule,
|
|
6200
6339
|
meta: {
|
|
6201
|
-
category: "external",
|
|
6202
6340
|
resource: "client.buildClientParams",
|
|
6203
6341
|
tool: client.name
|
|
6204
6342
|
}
|
|
@@ -6207,22 +6345,15 @@ const handlerV1$2 = ({ plugin }) => {
|
|
|
6207
6345
|
external: clientModule,
|
|
6208
6346
|
kind: "type",
|
|
6209
6347
|
meta: {
|
|
6210
|
-
category: "external",
|
|
6211
6348
|
resource: "client.Composable",
|
|
6212
6349
|
tool: client.name
|
|
6213
6350
|
}
|
|
6214
6351
|
});
|
|
6215
|
-
if (isAngularClient) plugin.symbol("Injectable", {
|
|
6216
|
-
external: "@angular/core",
|
|
6217
|
-
meta: {
|
|
6218
|
-
category: "external",
|
|
6219
|
-
resource: "@angular/core.Injectable"
|
|
6220
|
-
}
|
|
6221
|
-
});
|
|
6352
|
+
if (isAngularClient) plugin.symbol("Injectable", { external: "@angular/core" });
|
|
6222
6353
|
createTypeOptions({ plugin });
|
|
6223
6354
|
const structure = new StructureModel();
|
|
6224
|
-
const shell = createShell(plugin);
|
|
6225
|
-
const strategy = resolveStrategy(plugin);
|
|
6355
|
+
const shell = createShell$1(plugin);
|
|
6356
|
+
const strategy = resolveStrategy$1(plugin);
|
|
6226
6357
|
plugin.forEach("operation", (event) => {
|
|
6227
6358
|
structure.insert({
|
|
6228
6359
|
data: {
|
|
@@ -6234,13 +6365,13 @@ const handlerV1$2 = ({ plugin }) => {
|
|
|
6234
6365
|
path,
|
|
6235
6366
|
shell
|
|
6236
6367
|
})),
|
|
6237
|
-
source: source$
|
|
6368
|
+
source: source$2
|
|
6238
6369
|
});
|
|
6239
6370
|
}, { order: "declarations" });
|
|
6240
6371
|
const allDependencies = [];
|
|
6241
6372
|
const allNodes = [];
|
|
6242
6373
|
for (const node of structure.walk()) {
|
|
6243
|
-
const { dependencies, nodes } = toNode$
|
|
6374
|
+
const { dependencies, nodes } = toNode$2(node, plugin);
|
|
6244
6375
|
allDependencies.push(...dependencies ?? []);
|
|
6245
6376
|
allNodes.push(...nodes);
|
|
6246
6377
|
}
|
|
@@ -6252,13 +6383,13 @@ const handlerV1$2 = ({ plugin }) => {
|
|
|
6252
6383
|
|
|
6253
6384
|
//#endregion
|
|
6254
6385
|
//#region src/plugins/@hey-api/sdk/plugin.ts
|
|
6255
|
-
const handler$
|
|
6386
|
+
const handler$11 = (args) => handlerV1$3(args);
|
|
6256
6387
|
|
|
6257
6388
|
//#endregion
|
|
6258
6389
|
//#region src/plugins/@hey-api/sdk/config.ts
|
|
6259
6390
|
const transformerInferWarn = "You set `transformer: true` but no transformer plugin was found in your plugins. Add a transformer plugin like `@hey-api/transformers` to enable this feature. The transformer option has been disabled.";
|
|
6260
|
-
const validatorInferWarn = "You set `validator: true` but no validator plugin was found in your plugins. Add a validator plugin like `zod` to enable this feature. The validator option has been disabled.";
|
|
6261
|
-
const defaultConfig$
|
|
6391
|
+
const validatorInferWarn$1 = "You set `validator: true` but no validator plugin was found in your plugins. Add a validator plugin like `zod` to enable this feature. The validator option has been disabled.";
|
|
6392
|
+
const defaultConfig$16 = {
|
|
6262
6393
|
config: {
|
|
6263
6394
|
auth: true,
|
|
6264
6395
|
client: true,
|
|
@@ -6271,7 +6402,7 @@ const defaultConfig$15 = {
|
|
|
6271
6402
|
response: "body"
|
|
6272
6403
|
},
|
|
6273
6404
|
dependencies: ["@hey-api/typescript"],
|
|
6274
|
-
handler: handler$
|
|
6405
|
+
handler: handler$11,
|
|
6275
6406
|
name: "@hey-api/sdk",
|
|
6276
6407
|
resolveConfig: (plugin, context) => {
|
|
6277
6408
|
if (plugin.config.client) {
|
|
@@ -6295,7 +6426,7 @@ const defaultConfig$15 = {
|
|
|
6295
6426
|
plugin.config.validator.request = context.pluginByTag("validator");
|
|
6296
6427
|
plugin.dependencies.add(plugin.config.validator.request);
|
|
6297
6428
|
} catch {
|
|
6298
|
-
log.warn(validatorInferWarn);
|
|
6429
|
+
log.warn(validatorInferWarn$1);
|
|
6299
6430
|
plugin.config.validator.request = false;
|
|
6300
6431
|
}
|
|
6301
6432
|
else plugin.dependencies.add(plugin.config.validator.request);
|
|
@@ -6304,7 +6435,7 @@ const defaultConfig$15 = {
|
|
|
6304
6435
|
plugin.config.validator.response = context.pluginByTag("validator");
|
|
6305
6436
|
plugin.dependencies.add(plugin.config.validator.response);
|
|
6306
6437
|
} catch {
|
|
6307
|
-
log.warn(validatorInferWarn);
|
|
6438
|
+
log.warn(validatorInferWarn$1);
|
|
6308
6439
|
plugin.config.validator.response = false;
|
|
6309
6440
|
}
|
|
6310
6441
|
else plugin.dependencies.add(plugin.config.validator.response);
|
|
@@ -6316,22 +6447,22 @@ const defaultConfig$15 = {
|
|
|
6316
6447
|
/**
|
|
6317
6448
|
* Type helper for `@hey-api/sdk` plugin, returns {@link Plugin.Config} object
|
|
6318
6449
|
*/
|
|
6319
|
-
const defineConfig$
|
|
6450
|
+
const defineConfig$16 = definePluginConfig(defaultConfig$16);
|
|
6320
6451
|
|
|
6321
6452
|
//#endregion
|
|
6322
6453
|
//#region src/plugins/@hey-api/transformers/expressions.ts
|
|
6323
6454
|
const bigIntExpressions = ({ dataExpression, schema }) => {
|
|
6324
6455
|
if (schema.type !== "integer" || schema.format !== "int64") return;
|
|
6325
|
-
const bigIntCallExpression = dataExpression !== void 0 ? $("BigInt").call(
|
|
6456
|
+
const bigIntCallExpression = dataExpression !== void 0 ? $("BigInt").call($(dataExpression).attr("toString").call()) : void 0;
|
|
6326
6457
|
if (bigIntCallExpression) {
|
|
6327
6458
|
if (typeof dataExpression === "string") return [bigIntCallExpression];
|
|
6328
|
-
if (dataExpression) return [
|
|
6459
|
+
if (dataExpression) return [$(dataExpression).assign(bigIntCallExpression)];
|
|
6329
6460
|
}
|
|
6330
6461
|
};
|
|
6331
6462
|
const dateExpressions = ({ dataExpression, schema }) => {
|
|
6332
6463
|
if (schema.type !== "string" || !(schema.format === "date" || schema.format === "date-time")) return;
|
|
6333
6464
|
if (typeof dataExpression === "string") return [$.new("Date").arg(dataExpression)];
|
|
6334
|
-
if (dataExpression) return [
|
|
6465
|
+
if (dataExpression) return [$(dataExpression).assign($.new("Date").arg(dataExpression))];
|
|
6335
6466
|
};
|
|
6336
6467
|
|
|
6337
6468
|
//#endregion
|
|
@@ -6419,6 +6550,17 @@ function processSchemaType({ dataExpression, plugin, schema }) {
|
|
|
6419
6550
|
if (required.includes(name) && noNullableTypesInSchema) nodes = nodes.concat(propertyNodes);
|
|
6420
6551
|
else nodes.push($.if(propertyAccessExpression).do(...propertyNodes));
|
|
6421
6552
|
}
|
|
6553
|
+
if (schema.additionalProperties && dataExpression) {
|
|
6554
|
+
const entryValueNodes = processSchemaType({
|
|
6555
|
+
dataExpression: $(dataExpression).attr("key").computed(),
|
|
6556
|
+
plugin,
|
|
6557
|
+
schema: schema.additionalProperties
|
|
6558
|
+
});
|
|
6559
|
+
if (entryValueNodes.length) {
|
|
6560
|
+
const properties = Object.keys(schema.properties ?? {});
|
|
6561
|
+
nodes.push($.for($.const("key")).of($("Object").attr("keys").call(dataExpression)).$if(properties.length, (f) => f.do($.if($.not($.array(...properties).attr("includes").call("key"))).do(...entryValueNodes)), (f) => f.do(...entryValueNodes)));
|
|
6562
|
+
}
|
|
6563
|
+
}
|
|
6422
6564
|
return nodes;
|
|
6423
6565
|
}
|
|
6424
6566
|
if (schema.items) {
|
|
@@ -6468,7 +6610,7 @@ function processSchemaType({ dataExpression, plugin, schema }) {
|
|
|
6468
6610
|
}
|
|
6469
6611
|
return [];
|
|
6470
6612
|
}
|
|
6471
|
-
const handler$
|
|
6613
|
+
const handler$10 = ({ plugin }) => {
|
|
6472
6614
|
plugin.forEach("operation", ({ operation }) => {
|
|
6473
6615
|
const { response } = operationResponsesMap(operation);
|
|
6474
6616
|
if (!response) return;
|
|
@@ -6513,7 +6655,7 @@ const handler$9 = ({ plugin }) => {
|
|
|
6513
6655
|
|
|
6514
6656
|
//#endregion
|
|
6515
6657
|
//#region src/plugins/@hey-api/transformers/config.ts
|
|
6516
|
-
const defaultConfig$
|
|
6658
|
+
const defaultConfig$15 = {
|
|
6517
6659
|
config: {
|
|
6518
6660
|
bigInt: true,
|
|
6519
6661
|
dates: true,
|
|
@@ -6522,7 +6664,7 @@ const defaultConfig$14 = {
|
|
|
6522
6664
|
typeTransformers: []
|
|
6523
6665
|
},
|
|
6524
6666
|
dependencies: ["@hey-api/typescript"],
|
|
6525
|
-
handler: handler$
|
|
6667
|
+
handler: handler$10,
|
|
6526
6668
|
name: "@hey-api/transformers",
|
|
6527
6669
|
resolveConfig: (plugin) => {
|
|
6528
6670
|
if (!plugin.config.transformers) plugin.config.transformers = [];
|
|
@@ -6534,7 +6676,7 @@ const defaultConfig$14 = {
|
|
|
6534
6676
|
/**
|
|
6535
6677
|
* Type helper for `@hey-api/transformers`, returns {@link Plugin.Config} object
|
|
6536
6678
|
*/
|
|
6537
|
-
const defineConfig$
|
|
6679
|
+
const defineConfig$15 = definePluginConfig(defaultConfig$15);
|
|
6538
6680
|
|
|
6539
6681
|
//#endregion
|
|
6540
6682
|
//#region src/plugins/shared/utils/schema.ts
|
|
@@ -6815,9 +6957,9 @@ function itemsNode$4(ctx) {
|
|
|
6815
6957
|
function baseNode$61(ctx) {
|
|
6816
6958
|
const { schema } = ctx;
|
|
6817
6959
|
const items = schema.items ?? [];
|
|
6818
|
-
if (items.length
|
|
6960
|
+
if (!items.length) return $.type("never");
|
|
6819
6961
|
const literalTypes = items.filter((item) => item.const !== void 0).map((item) => $.type.fromValue(item.const));
|
|
6820
|
-
return literalTypes.length
|
|
6962
|
+
return literalTypes.length ? $.type.or(...literalTypes) : $.type("string");
|
|
6821
6963
|
}
|
|
6822
6964
|
function enumResolver$4(ctx) {
|
|
6823
6965
|
return ctx.nodes.base(ctx);
|
|
@@ -6966,16 +7108,16 @@ function baseNode$56(ctx) {
|
|
|
6966
7108
|
const ir = schema.patternProperties[pattern];
|
|
6967
7109
|
indexSchemas.unshift(ir);
|
|
6968
7110
|
}
|
|
6969
|
-
const hasPatterns =
|
|
7111
|
+
const hasPatterns = schema.patternProperties && Object.keys(schema.patternProperties).length;
|
|
6970
7112
|
const addPropsRaw = schema.additionalProperties;
|
|
6971
7113
|
const addPropsObj = addPropsRaw !== false && addPropsRaw ? addPropsRaw : void 0;
|
|
6972
|
-
if (hasPatterns ||
|
|
7114
|
+
if (hasPatterns || addPropsObj && (addPropsObj.type !== "never" || !indexSchemas.length)) {
|
|
6973
7115
|
const addProps = addPropsObj;
|
|
6974
7116
|
if (addProps && addProps.type !== "never") if (addProps.type === "unknown") indexSchemas = [addProps, ...schema.patternProperties ? Object.values(schema.patternProperties) : []];
|
|
6975
7117
|
else indexSchemas.unshift(addProps);
|
|
6976
7118
|
else if (!hasPatterns && !indexSchemas.length && addProps && addProps.type === "never") indexSchemas = [addProps];
|
|
6977
7119
|
if (hasOptionalProperties && addProps?.type !== "unknown") indexSchemas.push({ type: "undefined" });
|
|
6978
|
-
if (indexSchemas.length
|
|
7120
|
+
if (indexSchemas.length) {
|
|
6979
7121
|
const indexType = walk(indexSchemas.length === 1 ? indexSchemas[0] : deduplicateSchema({ schema: {
|
|
6980
7122
|
items: indexSchemas,
|
|
6981
7123
|
logicalOperator: "or"
|
|
@@ -7350,7 +7492,7 @@ function createVisitor$4(config) {
|
|
|
7350
7492
|
resource: "definition",
|
|
7351
7493
|
resourceId: $ref
|
|
7352
7494
|
});
|
|
7353
|
-
if (schema.omit && schema.omit.length
|
|
7495
|
+
if (schema.omit && schema.omit.length) {
|
|
7354
7496
|
const omittedKeys = schema.omit.length === 1 ? $.type.literal(schema.omit[0]) : $.type.or(...schema.omit.map((key) => $.type.literal(key)));
|
|
7355
7497
|
return {
|
|
7356
7498
|
meta: defaultMeta$2(schema),
|
|
@@ -7564,7 +7706,7 @@ const operationToType = ({ operation, path, plugin, tags }) => {
|
|
|
7564
7706
|
if (data.properties.path.required) dataRequired.push("path");
|
|
7565
7707
|
if (data.properties.query.required) dataRequired.push("query");
|
|
7566
7708
|
dataRequired.push("url");
|
|
7567
|
-
if (dataRequired.length
|
|
7709
|
+
if (dataRequired.length) data.required = dataRequired;
|
|
7568
7710
|
const dataResult = processor.process({
|
|
7569
7711
|
export: false,
|
|
7570
7712
|
meta: {
|
|
@@ -7777,7 +7919,7 @@ function webhookToType({ operation, path, plugin, tags }) {
|
|
|
7777
7919
|
|
|
7778
7920
|
//#endregion
|
|
7779
7921
|
//#region src/plugins/@hey-api/typescript/v1/plugin.ts
|
|
7780
|
-
const handlerV1$
|
|
7922
|
+
const handlerV1$2 = ({ plugin }) => {
|
|
7781
7923
|
const nodeClientIndex = plugin.node(null);
|
|
7782
7924
|
const nodeWebhooksIndex = plugin.node(null);
|
|
7783
7925
|
const servers = [];
|
|
@@ -7850,7 +7992,7 @@ const handlerV1$1 = ({ plugin }) => {
|
|
|
7850
7992
|
plugin,
|
|
7851
7993
|
servers
|
|
7852
7994
|
});
|
|
7853
|
-
if (webhooks.length
|
|
7995
|
+
if (webhooks.length) {
|
|
7854
7996
|
const symbol = plugin.registerSymbol(buildSymbolIn({
|
|
7855
7997
|
meta: {
|
|
7856
7998
|
category: "type",
|
|
@@ -7869,11 +8011,11 @@ const handlerV1$1 = ({ plugin }) => {
|
|
|
7869
8011
|
|
|
7870
8012
|
//#endregion
|
|
7871
8013
|
//#region src/plugins/@hey-api/typescript/plugin.ts
|
|
7872
|
-
const handler$
|
|
8014
|
+
const handler$9 = (args) => handlerV1$2(args);
|
|
7873
8015
|
|
|
7874
8016
|
//#endregion
|
|
7875
8017
|
//#region src/plugins/@hey-api/typescript/config.ts
|
|
7876
|
-
const defaultConfig$
|
|
8018
|
+
const defaultConfig$14 = {
|
|
7877
8019
|
api: new Api$3(),
|
|
7878
8020
|
config: {
|
|
7879
8021
|
case: "PascalCase",
|
|
@@ -7881,7 +8023,7 @@ const defaultConfig$13 = {
|
|
|
7881
8023
|
includeInEntry: true,
|
|
7882
8024
|
topType: "unknown"
|
|
7883
8025
|
},
|
|
7884
|
-
handler: handler$
|
|
8026
|
+
handler: handler$9,
|
|
7885
8027
|
name: "@hey-api/typescript",
|
|
7886
8028
|
resolveConfig: (plugin, context) => {
|
|
7887
8029
|
plugin.config.definitions = context.valueToObject({
|
|
@@ -7960,7 +8102,7 @@ const defaultConfig$13 = {
|
|
|
7960
8102
|
/**
|
|
7961
8103
|
* Type helper for `@hey-api/typescript` plugin, returns {@link Plugin.Config} object
|
|
7962
8104
|
*/
|
|
7963
|
-
const defineConfig$
|
|
8105
|
+
const defineConfig$14 = definePluginConfig(defaultConfig$14);
|
|
7964
8106
|
|
|
7965
8107
|
//#endregion
|
|
7966
8108
|
//#region src/plugins/@pinia/colada/meta.ts
|
|
@@ -8070,20 +8212,14 @@ const createQueryKeyFunction$1 = ({ plugin }) => {
|
|
|
8070
8212
|
});
|
|
8071
8213
|
const symbolClient = plugin.getSymbol({ category: "client" });
|
|
8072
8214
|
const clientModule = clientFolderAbsolutePath(getTypedConfig(plugin));
|
|
8073
|
-
const symbolSerializeQueryValue = plugin.symbol("serializeQueryKeyValue", {
|
|
8074
|
-
external: clientModule,
|
|
8075
|
-
meta: {
|
|
8076
|
-
category: "external",
|
|
8077
|
-
resource: `${clientModule}.serializeQueryKeyValue`
|
|
8078
|
-
}
|
|
8079
|
-
});
|
|
8215
|
+
const symbolSerializeQueryValue = plugin.symbol("serializeQueryKeyValue", { external: clientModule });
|
|
8080
8216
|
const fn = $.const(symbolCreateQueryKey).assign($.func().param("id", (p) => p.type("string")).param("options", (p) => p.optional().type(TOptionsType$1)).param("tags", (p) => p.optional().type("ReadonlyArray<string>")).returns($.type.tuple(returnType)).generic(TOptionsType$1, (g) => g.extends(symbolOptions)).do($.const("params").type(returnType).assign($.object().prop("_id", "id").prop(baseUrlKey, $("options").attr(baseUrlKey).optional().or($("options").attr("client").optional().$if(symbolClient, (a, v) => a.coalesce(v)).attr("getConfig").call().attr(baseUrlKey))).as(returnType)), $.if("tags").do($("params").attr("tags").assign($("tags").as("unknown").as(symbolJsonValue))), $.if($("options").attr("body").optional().neq($.id("undefined"))).do($.const("normalizedBody").assign($(symbolSerializeQueryValue).call($("options").attr("body"))), $.if($("normalizedBody").neq($.id("undefined"))).do($("params").attr("body").assign("normalizedBody"))), $.if($("options").attr("path").optional()).do($("params").attr("path").assign($("options").attr("path"))), $.if($("options").attr("query").optional().neq($.id("undefined"))).do($.const("normalizedQuery").assign($(symbolSerializeQueryValue).call($("options").attr("query"))), $.if($("normalizedQuery").neq($.id("undefined"))).do($("params").attr("query").assign("normalizedQuery"))), $.return($.array($("params")))));
|
|
8081
8217
|
plugin.node(fn);
|
|
8082
8218
|
};
|
|
8083
8219
|
const createQueryKeyLiteral$1 = ({ id, operation, plugin }) => {
|
|
8084
8220
|
const config = plugin.config.queryKeys;
|
|
8085
8221
|
let tagsExpression;
|
|
8086
|
-
if (config.tags && operation.tags && operation.tags.length
|
|
8222
|
+
if (config.tags && operation.tags && operation.tags.length) tagsExpression = $.array(...operation.tags.map((tag) => $.literal(tag)));
|
|
8087
8223
|
return $(plugin.referenceSymbol({
|
|
8088
8224
|
category: "utility",
|
|
8089
8225
|
resource: "createQueryKey",
|
|
@@ -8153,7 +8289,7 @@ const createQueryOptions$1 = ({ operation, plugin }) => {
|
|
|
8153
8289
|
tool: plugin.name
|
|
8154
8290
|
});
|
|
8155
8291
|
let tagsExpr;
|
|
8156
|
-
if (plugin.config.queryKeys.tags && operation.tags && operation.tags.length
|
|
8292
|
+
if (plugin.config.queryKeys.tags && operation.tags && operation.tags.length) tagsExpr = $.array(...operation.tags.map((t) => $.literal(t)));
|
|
8157
8293
|
keyExpression = $(symbolCreateQueryKey).call($.literal(operation.id), optionsParamName$2, tagsExpr);
|
|
8158
8294
|
}
|
|
8159
8295
|
const typeData = getPublicTypeData({
|
|
@@ -8191,44 +8327,22 @@ const createQueryOptions$1 = ({ operation, plugin }) => {
|
|
|
8191
8327
|
//#endregion
|
|
8192
8328
|
//#region src/plugins/@pinia/colada/v0/plugin.ts
|
|
8193
8329
|
const handlerV0 = ({ plugin }) => {
|
|
8194
|
-
plugin.symbol("defineQueryOptions", {
|
|
8195
|
-
external: plugin.name,
|
|
8196
|
-
meta: {
|
|
8197
|
-
category: "external",
|
|
8198
|
-
resource: `${plugin.name}.defineQueryOptions`
|
|
8199
|
-
}
|
|
8200
|
-
});
|
|
8330
|
+
plugin.symbol("defineQueryOptions", { external: plugin.name });
|
|
8201
8331
|
plugin.symbol("UseMutationOptions", {
|
|
8202
8332
|
external: plugin.name,
|
|
8203
|
-
kind: "type"
|
|
8204
|
-
meta: {
|
|
8205
|
-
category: "external",
|
|
8206
|
-
resource: `${plugin.name}.UseMutationOptions`
|
|
8207
|
-
}
|
|
8333
|
+
kind: "type"
|
|
8208
8334
|
});
|
|
8209
8335
|
plugin.symbol("UseQueryOptions", {
|
|
8210
8336
|
external: plugin.name,
|
|
8211
|
-
kind: "type"
|
|
8212
|
-
meta: {
|
|
8213
|
-
category: "external",
|
|
8214
|
-
resource: `${plugin.name}.UseQueryOptions`
|
|
8215
|
-
}
|
|
8337
|
+
kind: "type"
|
|
8216
8338
|
});
|
|
8217
8339
|
plugin.symbol("_JSONValue", {
|
|
8218
8340
|
external: plugin.name,
|
|
8219
|
-
kind: "type"
|
|
8220
|
-
meta: {
|
|
8221
|
-
category: "external",
|
|
8222
|
-
resource: `${plugin.name}._JSONValue`
|
|
8223
|
-
}
|
|
8341
|
+
kind: "type"
|
|
8224
8342
|
});
|
|
8225
8343
|
plugin.symbol("AxiosError", {
|
|
8226
8344
|
external: "axios",
|
|
8227
|
-
kind: "type"
|
|
8228
|
-
meta: {
|
|
8229
|
-
category: "external",
|
|
8230
|
-
resource: "axios.AxiosError"
|
|
8231
|
-
}
|
|
8345
|
+
kind: "type"
|
|
8232
8346
|
});
|
|
8233
8347
|
plugin.forEach("operation", ({ operation }) => {
|
|
8234
8348
|
if (plugin.hooks.operation.isQuery(operation)) {
|
|
@@ -8248,18 +8362,18 @@ const handlerV0 = ({ plugin }) => {
|
|
|
8248
8362
|
|
|
8249
8363
|
//#endregion
|
|
8250
8364
|
//#region src/plugins/@pinia/colada/plugin.ts
|
|
8251
|
-
const handler$
|
|
8365
|
+
const handler$8 = (args) => handlerV0(args);
|
|
8252
8366
|
|
|
8253
8367
|
//#endregion
|
|
8254
8368
|
//#region src/plugins/@pinia/colada/config.ts
|
|
8255
|
-
const defaultConfig$
|
|
8369
|
+
const defaultConfig$13 = {
|
|
8256
8370
|
config: {
|
|
8257
8371
|
case: "camelCase",
|
|
8258
8372
|
comments: true,
|
|
8259
8373
|
includeInEntry: false
|
|
8260
8374
|
},
|
|
8261
8375
|
dependencies: ["@hey-api/typescript", "@hey-api/sdk"],
|
|
8262
|
-
handler: handler$
|
|
8376
|
+
handler: handler$8,
|
|
8263
8377
|
name: "@pinia/colada",
|
|
8264
8378
|
resolveConfig: (plugin, context) => {
|
|
8265
8379
|
plugin.config.mutationOptions = context.valueToObject({
|
|
@@ -8295,7 +8409,7 @@ const defaultConfig$12 = {
|
|
|
8295
8409
|
/**
|
|
8296
8410
|
* Type helper for `@pinia/colada` plugin, returns {@link Plugin.Config} object
|
|
8297
8411
|
*/
|
|
8298
|
-
const defineConfig$
|
|
8412
|
+
const defineConfig$13 = definePluginConfig(defaultConfig$13);
|
|
8299
8413
|
|
|
8300
8414
|
//#endregion
|
|
8301
8415
|
//#region src/plugins/@tanstack/query-core/shared/useType.ts
|
|
@@ -8357,7 +8471,7 @@ const createQueryKeyFunction = ({ plugin }) => {
|
|
|
8357
8471
|
const createQueryKeyLiteral = ({ id, isInfinite, operation, plugin }) => {
|
|
8358
8472
|
const config = isInfinite ? plugin.config.infiniteQueryKeys : plugin.config.queryKeys;
|
|
8359
8473
|
let tagsArray;
|
|
8360
|
-
if (config.tags && operation.tags && operation.tags.length
|
|
8474
|
+
if (config.tags && operation.tags && operation.tags.length) tagsArray = $.array().elements(...operation.tags);
|
|
8361
8475
|
return $(plugin.referenceSymbol({
|
|
8362
8476
|
category: "utility",
|
|
8363
8477
|
resource: "createQueryKey",
|
|
@@ -8641,64 +8755,25 @@ const createUseQuery = ({ operation, plugin }) => {
|
|
|
8641
8755
|
const handlerV5 = ({ plugin }) => {
|
|
8642
8756
|
plugin.symbol("DefaultError", {
|
|
8643
8757
|
external: plugin.name,
|
|
8644
|
-
kind: "type"
|
|
8645
|
-
meta: {
|
|
8646
|
-
category: "external",
|
|
8647
|
-
resource: `${plugin.name}.DefaultError`
|
|
8648
|
-
}
|
|
8758
|
+
kind: "type"
|
|
8649
8759
|
});
|
|
8650
8760
|
plugin.symbol("InfiniteData", {
|
|
8651
8761
|
external: plugin.name,
|
|
8652
|
-
kind: "type"
|
|
8653
|
-
meta: {
|
|
8654
|
-
category: "external",
|
|
8655
|
-
resource: `${plugin.name}.InfiniteData`
|
|
8656
|
-
}
|
|
8762
|
+
kind: "type"
|
|
8657
8763
|
});
|
|
8658
8764
|
const mutationsType = plugin.name === "@tanstack/angular-query-experimental" || plugin.name === "@tanstack/svelte-query" || plugin.name === "@tanstack/solid-query" ? "MutationOptions" : "UseMutationOptions";
|
|
8659
8765
|
plugin.symbol(mutationsType, {
|
|
8660
8766
|
external: plugin.name,
|
|
8661
8767
|
kind: "type",
|
|
8662
|
-
meta: {
|
|
8663
|
-
category: "external",
|
|
8664
|
-
resource: `${plugin.name}.MutationOptions`
|
|
8665
|
-
}
|
|
8666
|
-
});
|
|
8667
|
-
plugin.symbol("infiniteQueryOptions", {
|
|
8668
|
-
external: plugin.name,
|
|
8669
|
-
meta: {
|
|
8670
|
-
category: "external",
|
|
8671
|
-
resource: `${plugin.name}.infiniteQueryOptions`
|
|
8672
|
-
}
|
|
8673
|
-
});
|
|
8674
|
-
plugin.symbol("queryOptions", {
|
|
8675
|
-
external: plugin.name,
|
|
8676
|
-
meta: {
|
|
8677
|
-
category: "external",
|
|
8678
|
-
resource: `${plugin.name}.queryOptions`
|
|
8679
|
-
}
|
|
8680
|
-
});
|
|
8681
|
-
plugin.symbol("useMutation", {
|
|
8682
|
-
external: plugin.name,
|
|
8683
|
-
meta: {
|
|
8684
|
-
category: "external",
|
|
8685
|
-
resource: `${plugin.name}.useMutation`
|
|
8686
|
-
}
|
|
8687
|
-
});
|
|
8688
|
-
plugin.symbol("useQuery", {
|
|
8689
|
-
external: plugin.name,
|
|
8690
|
-
meta: {
|
|
8691
|
-
category: "external",
|
|
8692
|
-
resource: `${plugin.name}.useQuery`
|
|
8693
|
-
}
|
|
8768
|
+
meta: { resource: `${plugin.name}.MutationOptions` }
|
|
8694
8769
|
});
|
|
8770
|
+
plugin.symbol("infiniteQueryOptions", { external: plugin.name });
|
|
8771
|
+
plugin.symbol("queryOptions", { external: plugin.name });
|
|
8772
|
+
plugin.symbol("useMutation", { external: plugin.name });
|
|
8773
|
+
plugin.symbol("useQuery", { external: plugin.name });
|
|
8695
8774
|
plugin.symbol("AxiosError", {
|
|
8696
8775
|
external: "axios",
|
|
8697
|
-
kind: "type"
|
|
8698
|
-
meta: {
|
|
8699
|
-
category: "external",
|
|
8700
|
-
resource: "axios.AxiosError"
|
|
8701
|
-
}
|
|
8776
|
+
kind: "type"
|
|
8702
8777
|
});
|
|
8703
8778
|
plugin.forEach("operation", ({ operation }) => {
|
|
8704
8779
|
if (plugin.hooks.operation.isQuery(operation)) {
|
|
@@ -8730,18 +8805,18 @@ const handlerV5 = ({ plugin }) => {
|
|
|
8730
8805
|
|
|
8731
8806
|
//#endregion
|
|
8732
8807
|
//#region src/plugins/@tanstack/query-core/plugin.ts
|
|
8733
|
-
const handler$
|
|
8808
|
+
const handler$7 = (args) => handlerV5(args);
|
|
8734
8809
|
|
|
8735
8810
|
//#endregion
|
|
8736
8811
|
//#region src/plugins/@tanstack/angular-query-experimental/config.ts
|
|
8737
|
-
const defaultConfig$
|
|
8812
|
+
const defaultConfig$12 = {
|
|
8738
8813
|
config: {
|
|
8739
8814
|
case: "camelCase",
|
|
8740
8815
|
comments: true,
|
|
8741
8816
|
includeInEntry: false
|
|
8742
8817
|
},
|
|
8743
8818
|
dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
|
|
8744
|
-
handler: handler$
|
|
8819
|
+
handler: handler$7,
|
|
8745
8820
|
name: "@tanstack/angular-query-experimental",
|
|
8746
8821
|
resolveConfig: (plugin, context) => {
|
|
8747
8822
|
plugin.config.infiniteQueryKeys = context.valueToObject({
|
|
@@ -8798,18 +8873,18 @@ const defaultConfig$11 = {
|
|
|
8798
8873
|
/**
|
|
8799
8874
|
* Type helper for `@tanstack/angular-query-experimental` plugin, returns {@link Plugin.Config} object
|
|
8800
8875
|
*/
|
|
8801
|
-
const defineConfig$
|
|
8876
|
+
const defineConfig$12 = definePluginConfig(defaultConfig$12);
|
|
8802
8877
|
|
|
8803
8878
|
//#endregion
|
|
8804
8879
|
//#region src/plugins/@tanstack/preact-query/config.ts
|
|
8805
|
-
const defaultConfig$
|
|
8880
|
+
const defaultConfig$11 = {
|
|
8806
8881
|
config: {
|
|
8807
8882
|
case: "camelCase",
|
|
8808
8883
|
comments: true,
|
|
8809
8884
|
includeInEntry: false
|
|
8810
8885
|
},
|
|
8811
8886
|
dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
|
|
8812
|
-
handler: handler$
|
|
8887
|
+
handler: handler$7,
|
|
8813
8888
|
name: "@tanstack/preact-query",
|
|
8814
8889
|
resolveConfig: (plugin, context) => {
|
|
8815
8890
|
plugin.config.infiniteQueryKeys = context.valueToObject({
|
|
@@ -8924,18 +8999,18 @@ const defaultConfig$10 = {
|
|
|
8924
8999
|
/**
|
|
8925
9000
|
* Type helper for `@tanstack/preact-query` plugin, returns {@link Plugin.Config} object
|
|
8926
9001
|
*/
|
|
8927
|
-
const defineConfig$
|
|
9002
|
+
const defineConfig$11 = definePluginConfig(defaultConfig$11);
|
|
8928
9003
|
|
|
8929
9004
|
//#endregion
|
|
8930
9005
|
//#region src/plugins/@tanstack/react-query/config.ts
|
|
8931
|
-
const defaultConfig$
|
|
9006
|
+
const defaultConfig$10 = {
|
|
8932
9007
|
config: {
|
|
8933
9008
|
case: "camelCase",
|
|
8934
9009
|
comments: true,
|
|
8935
9010
|
includeInEntry: false
|
|
8936
9011
|
},
|
|
8937
9012
|
dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
|
|
8938
|
-
handler: handler$
|
|
9013
|
+
handler: handler$7,
|
|
8939
9014
|
name: "@tanstack/react-query",
|
|
8940
9015
|
resolveConfig: (plugin, context) => {
|
|
8941
9016
|
plugin.config.infiniteQueryKeys = context.valueToObject({
|
|
@@ -9050,18 +9125,18 @@ const defaultConfig$9 = {
|
|
|
9050
9125
|
/**
|
|
9051
9126
|
* Type helper for `@tanstack/react-query` plugin, returns {@link Plugin.Config} object
|
|
9052
9127
|
*/
|
|
9053
|
-
const defineConfig$
|
|
9128
|
+
const defineConfig$10 = definePluginConfig(defaultConfig$10);
|
|
9054
9129
|
|
|
9055
9130
|
//#endregion
|
|
9056
9131
|
//#region src/plugins/@tanstack/solid-query/config.ts
|
|
9057
|
-
const defaultConfig$
|
|
9132
|
+
const defaultConfig$9 = {
|
|
9058
9133
|
config: {
|
|
9059
9134
|
case: "camelCase",
|
|
9060
9135
|
comments: true,
|
|
9061
9136
|
includeInEntry: false
|
|
9062
9137
|
},
|
|
9063
9138
|
dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
|
|
9064
|
-
handler: handler$
|
|
9139
|
+
handler: handler$7,
|
|
9065
9140
|
name: "@tanstack/solid-query",
|
|
9066
9141
|
resolveConfig: (plugin, context) => {
|
|
9067
9142
|
plugin.config.infiniteQueryKeys = context.valueToObject({
|
|
@@ -9118,18 +9193,18 @@ const defaultConfig$8 = {
|
|
|
9118
9193
|
/**
|
|
9119
9194
|
* Type helper for `@tanstack/solid-query` plugin, returns {@link Plugin.Config} object
|
|
9120
9195
|
*/
|
|
9121
|
-
const defineConfig$
|
|
9196
|
+
const defineConfig$9 = definePluginConfig(defaultConfig$9);
|
|
9122
9197
|
|
|
9123
9198
|
//#endregion
|
|
9124
9199
|
//#region src/plugins/@tanstack/svelte-query/config.ts
|
|
9125
|
-
const defaultConfig$
|
|
9200
|
+
const defaultConfig$8 = {
|
|
9126
9201
|
config: {
|
|
9127
9202
|
case: "camelCase",
|
|
9128
9203
|
comments: true,
|
|
9129
9204
|
includeInEntry: false
|
|
9130
9205
|
},
|
|
9131
9206
|
dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
|
|
9132
|
-
handler: handler$
|
|
9207
|
+
handler: handler$7,
|
|
9133
9208
|
name: "@tanstack/svelte-query",
|
|
9134
9209
|
resolveConfig: (plugin, context) => {
|
|
9135
9210
|
plugin.config.infiniteQueryKeys = context.valueToObject({
|
|
@@ -9186,18 +9261,18 @@ const defaultConfig$7 = {
|
|
|
9186
9261
|
/**
|
|
9187
9262
|
* Type helper for `@tanstack/svelte-query` plugin, returns {@link Plugin.Config} object
|
|
9188
9263
|
*/
|
|
9189
|
-
const defineConfig$
|
|
9264
|
+
const defineConfig$8 = definePluginConfig(defaultConfig$8);
|
|
9190
9265
|
|
|
9191
9266
|
//#endregion
|
|
9192
9267
|
//#region src/plugins/@tanstack/vue-query/config.ts
|
|
9193
|
-
const defaultConfig$
|
|
9268
|
+
const defaultConfig$7 = {
|
|
9194
9269
|
config: {
|
|
9195
9270
|
case: "camelCase",
|
|
9196
9271
|
comments: true,
|
|
9197
9272
|
includeInEntry: false
|
|
9198
9273
|
},
|
|
9199
9274
|
dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
|
|
9200
|
-
handler: handler$
|
|
9275
|
+
handler: handler$7,
|
|
9201
9276
|
name: "@tanstack/vue-query",
|
|
9202
9277
|
resolveConfig: (plugin, context) => {
|
|
9203
9278
|
plugin.config.infiniteQueryKeys = context.valueToObject({
|
|
@@ -9254,7 +9329,7 @@ const defaultConfig$6 = {
|
|
|
9254
9329
|
/**
|
|
9255
9330
|
* Type helper for `@tanstack/vue-query` plugin, returns {@link Plugin.Config} object
|
|
9256
9331
|
*/
|
|
9257
|
-
const defineConfig$
|
|
9332
|
+
const defineConfig$7 = definePluginConfig(defaultConfig$7);
|
|
9258
9333
|
|
|
9259
9334
|
//#endregion
|
|
9260
9335
|
//#region src/plugins/arktype/v2/api.ts
|
|
@@ -9628,13 +9703,7 @@ function handleComponent({ plugin, schema, state }) {
|
|
|
9628
9703
|
});
|
|
9629
9704
|
}
|
|
9630
9705
|
const handlerV2$1 = ({ plugin }) => {
|
|
9631
|
-
plugin.symbol("type", {
|
|
9632
|
-
external: "arktype",
|
|
9633
|
-
meta: {
|
|
9634
|
-
category: "external",
|
|
9635
|
-
resource: "arktype.type"
|
|
9636
|
-
}
|
|
9637
|
-
});
|
|
9706
|
+
plugin.symbol("type", { external: "arktype" });
|
|
9638
9707
|
plugin.forEach("operation", "parameter", "requestBody", "schema", "webhook", (event) => {
|
|
9639
9708
|
const state = refs({
|
|
9640
9709
|
hasLazyExpression: false,
|
|
@@ -9669,11 +9738,11 @@ const handlerV2$1 = ({ plugin }) => {
|
|
|
9669
9738
|
|
|
9670
9739
|
//#endregion
|
|
9671
9740
|
//#region src/plugins/arktype/plugin.ts
|
|
9672
|
-
const handler$
|
|
9741
|
+
const handler$6 = (args) => handlerV2$1(args);
|
|
9673
9742
|
|
|
9674
9743
|
//#endregion
|
|
9675
9744
|
//#region src/plugins/arktype/config.ts
|
|
9676
|
-
const defaultConfig$
|
|
9745
|
+
const defaultConfig$6 = {
|
|
9677
9746
|
api: new Api$2(),
|
|
9678
9747
|
config: {
|
|
9679
9748
|
case: "PascalCase",
|
|
@@ -9681,7 +9750,7 @@ const defaultConfig$5 = {
|
|
|
9681
9750
|
includeInEntry: false,
|
|
9682
9751
|
metadata: false
|
|
9683
9752
|
},
|
|
9684
|
-
handler: handler$
|
|
9753
|
+
handler: handler$6,
|
|
9685
9754
|
name: "arktype",
|
|
9686
9755
|
resolveConfig: (plugin, context) => {
|
|
9687
9756
|
plugin.config.types = context.valueToObject({
|
|
@@ -9852,7 +9921,7 @@ const defaultConfig$5 = {
|
|
|
9852
9921
|
/**
|
|
9853
9922
|
* Type helper for Arktype plugin, returns {@link Plugin.Config} object
|
|
9854
9923
|
*/
|
|
9855
|
-
const defineConfig$
|
|
9924
|
+
const defineConfig$6 = definePluginConfig(defaultConfig$6);
|
|
9856
9925
|
|
|
9857
9926
|
//#endregion
|
|
9858
9927
|
//#region src/plugins/fastify/plugin.ts
|
|
@@ -9915,7 +9984,7 @@ const operationToRouteHandler = ({ operation, plugin }) => {
|
|
|
9915
9984
|
type: $.type(symbolRouteHandler, (t) => t.generic(type))
|
|
9916
9985
|
};
|
|
9917
9986
|
};
|
|
9918
|
-
const handler$
|
|
9987
|
+
const handler$5 = ({ plugin }) => {
|
|
9919
9988
|
plugin.symbol("RouteHandler", {
|
|
9920
9989
|
external: "fastify",
|
|
9921
9990
|
kind: "type",
|
|
@@ -9940,16 +10009,16 @@ const handler$4 = ({ plugin }) => {
|
|
|
9940
10009
|
|
|
9941
10010
|
//#endregion
|
|
9942
10011
|
//#region src/plugins/fastify/config.ts
|
|
9943
|
-
const defaultConfig$
|
|
10012
|
+
const defaultConfig$5 = {
|
|
9944
10013
|
config: { includeInEntry: false },
|
|
9945
10014
|
dependencies: ["@hey-api/typescript"],
|
|
9946
|
-
handler: handler$
|
|
10015
|
+
handler: handler$5,
|
|
9947
10016
|
name: "fastify"
|
|
9948
10017
|
};
|
|
9949
10018
|
/**
|
|
9950
10019
|
* Type helper for `fastify` plugin, returns {@link Plugin.Config} object
|
|
9951
10020
|
*/
|
|
9952
|
-
const defineConfig$
|
|
10021
|
+
const defineConfig$5 = definePluginConfig(defaultConfig$5);
|
|
9953
10022
|
|
|
9954
10023
|
//#endregion
|
|
9955
10024
|
//#region src/plugins/nestjs/plugin.ts
|
|
@@ -10004,7 +10073,7 @@ const emitTypeAlias = ({ methods, plugin, typeName }) => {
|
|
|
10004
10073
|
for (const method of methods) type.prop(method.name, (p) => p.type(method.type));
|
|
10005
10074
|
plugin.node($.type.alias(symbol).export().type(type));
|
|
10006
10075
|
};
|
|
10007
|
-
const handler$
|
|
10076
|
+
const handler$4 = ({ plugin }) => {
|
|
10008
10077
|
const operationsByTag = /* @__PURE__ */ new Map();
|
|
10009
10078
|
plugin.forEach("operation", ({ operation, tags }) => {
|
|
10010
10079
|
const tag = tags?.[0] ?? "default";
|
|
@@ -10024,22 +10093,313 @@ const handler$3 = ({ plugin }) => {
|
|
|
10024
10093
|
|
|
10025
10094
|
//#endregion
|
|
10026
10095
|
//#region src/plugins/nestjs/config.ts
|
|
10027
|
-
const defaultConfig$
|
|
10096
|
+
const defaultConfig$4 = {
|
|
10028
10097
|
config: { includeInEntry: false },
|
|
10029
10098
|
dependencies: ["@hey-api/typescript"],
|
|
10030
|
-
handler: handler$
|
|
10099
|
+
handler: handler$4,
|
|
10031
10100
|
name: "nestjs"
|
|
10032
10101
|
};
|
|
10033
10102
|
/**
|
|
10034
10103
|
* Type helper for `nestjs` plugin, returns {@link Plugin.Config} object
|
|
10035
10104
|
*/
|
|
10105
|
+
const defineConfig$4 = definePluginConfig(defaultConfig$4);
|
|
10106
|
+
|
|
10107
|
+
//#endregion
|
|
10108
|
+
//#region src/plugins/orpc/contracts/config.ts
|
|
10109
|
+
function resolveContracts(config, context) {
|
|
10110
|
+
return normalizeConfig(config.contracts, context);
|
|
10111
|
+
}
|
|
10112
|
+
function normalizeConfig(input, context) {
|
|
10113
|
+
if (!input || typeof input === "string" || typeof input === "function") input = { strategy: input };
|
|
10114
|
+
const strategy = input.strategy ?? "single";
|
|
10115
|
+
return context.valueToObject({
|
|
10116
|
+
defaultValue: {
|
|
10117
|
+
container: "object",
|
|
10118
|
+
nesting: "operationId",
|
|
10119
|
+
nestingDelimiters: /[./]/,
|
|
10120
|
+
strategy,
|
|
10121
|
+
strategyDefaultTag: "default"
|
|
10122
|
+
},
|
|
10123
|
+
mappers: { object(value) {
|
|
10124
|
+
value.containerName = context.valueToObject({
|
|
10125
|
+
defaultValue: strategy === "single" ? {
|
|
10126
|
+
casing: "camelCase",
|
|
10127
|
+
name: "contract"
|
|
10128
|
+
} : { casing: "camelCase" },
|
|
10129
|
+
mappers: {
|
|
10130
|
+
function: (name) => ({ name }),
|
|
10131
|
+
string: (name) => ({ name })
|
|
10132
|
+
},
|
|
10133
|
+
value: value.containerName
|
|
10134
|
+
});
|
|
10135
|
+
value.contractName = context.valueToObject({
|
|
10136
|
+
defaultValue: { casing: "camelCase" },
|
|
10137
|
+
mappers: {
|
|
10138
|
+
function: (name) => ({ name }),
|
|
10139
|
+
string: (name) => ({ name })
|
|
10140
|
+
},
|
|
10141
|
+
value: value.contractName
|
|
10142
|
+
});
|
|
10143
|
+
value.segmentName = context.valueToObject({
|
|
10144
|
+
defaultValue: { casing: "camelCase" },
|
|
10145
|
+
mappers: {
|
|
10146
|
+
function: (name) => ({ name }),
|
|
10147
|
+
string: (name) => ({ name })
|
|
10148
|
+
},
|
|
10149
|
+
value: value.segmentName
|
|
10150
|
+
});
|
|
10151
|
+
return value;
|
|
10152
|
+
} },
|
|
10153
|
+
value: input
|
|
10154
|
+
});
|
|
10155
|
+
}
|
|
10156
|
+
|
|
10157
|
+
//#endregion
|
|
10158
|
+
//#region src/plugins/orpc/shared/operation.ts
|
|
10159
|
+
function hasInput(operation) {
|
|
10160
|
+
const hasPathParams = Boolean(operation.parameters?.path && Object.keys(operation.parameters.path).length);
|
|
10161
|
+
const hasQueryParams = Boolean(operation.parameters?.query && Object.keys(operation.parameters.query).length);
|
|
10162
|
+
const hasHeaderParams = Boolean(operation.parameters?.header && Object.keys(operation.parameters.header).length);
|
|
10163
|
+
const hasBody = Boolean(operation.body);
|
|
10164
|
+
return hasPathParams || hasQueryParams || hasHeaderParams || hasBody;
|
|
10165
|
+
}
|
|
10166
|
+
function getSuccessResponse(operation) {
|
|
10167
|
+
if (operation.responses) for (const [statusCode, response] of Object.entries(operation.responses)) {
|
|
10168
|
+
const statusCodeNumber = Number.parseInt(statusCode, 10);
|
|
10169
|
+
if (statusCodeNumber >= 200 && statusCodeNumber <= 399 && response?.mediaType && response?.schema) return {
|
|
10170
|
+
hasOutput: true,
|
|
10171
|
+
statusCode: statusCodeNumber
|
|
10172
|
+
};
|
|
10173
|
+
}
|
|
10174
|
+
return {
|
|
10175
|
+
hasOutput: false,
|
|
10176
|
+
statusCode: void 0
|
|
10177
|
+
};
|
|
10178
|
+
}
|
|
10179
|
+
function getTags(operation, defaultTag) {
|
|
10180
|
+
return operation.tags && operation.tags.length ? [...operation.tags] : [defaultTag];
|
|
10181
|
+
}
|
|
10182
|
+
|
|
10183
|
+
//#endregion
|
|
10184
|
+
//#region src/plugins/orpc/contracts/node.ts
|
|
10185
|
+
const source = globalThis.Symbol("orpc");
|
|
10186
|
+
function createShellMeta(node) {
|
|
10187
|
+
return {
|
|
10188
|
+
category: "contract",
|
|
10189
|
+
resource: "container",
|
|
10190
|
+
resourceId: node.getPath().join("."),
|
|
10191
|
+
tool: "orpc"
|
|
10192
|
+
};
|
|
10193
|
+
}
|
|
10194
|
+
function createContractSymbol(plugin, item) {
|
|
10195
|
+
const { operation, path, tags } = item.data;
|
|
10196
|
+
const name = item.location[item.location.length - 1];
|
|
10197
|
+
return plugin.symbol(applyNaming(name, plugin.config.contracts.contractName), { meta: {
|
|
10198
|
+
category: "contract",
|
|
10199
|
+
path,
|
|
10200
|
+
resource: "operation",
|
|
10201
|
+
resourceId: operation.id,
|
|
10202
|
+
role: "contract",
|
|
10203
|
+
tags,
|
|
10204
|
+
tool: plugin.name
|
|
10205
|
+
} });
|
|
10206
|
+
}
|
|
10207
|
+
function createContractExpression(plugin, operation) {
|
|
10208
|
+
const successResponse = getSuccessResponse(operation);
|
|
10209
|
+
const tags = getTags(operation, plugin.config.contracts.strategyDefaultTag);
|
|
10210
|
+
let expression = $(plugin.external("@orpc/contract.oc")).attr("route").call($.object().$if(operation.deprecated, (o, v) => o.prop("deprecated", $.literal(v))).$if(operation.description, (o, v) => o.prop("description", $.literal(v))).prop("inputStructure", $.literal("detailed")).prop("method", $.literal(operation.method.toUpperCase())).$if(operation.operationId, (o, v) => o.prop("operationId", $.literal(v))).prop("path", $.literal(operation.path)).$if(successResponse.hasOutput && successResponse.statusCode !== 200 && successResponse.statusCode, (o, v) => o.prop("successStatus", $.literal(v))).$if(operation.summary, (o, v) => o.prop("summary", $.literal(v))).$if(Boolean(tags.length) && tags, (o, v) => o.prop("tags", $.fromValue(v))));
|
|
10211
|
+
if (hasInput(operation) && plugin.config.validator.input) expression = expression.attr("input").call(plugin.referenceSymbol({
|
|
10212
|
+
category: "schema",
|
|
10213
|
+
resource: "operation",
|
|
10214
|
+
resourceId: operation.id,
|
|
10215
|
+
role: "data",
|
|
10216
|
+
tool: plugin.config.validator.input
|
|
10217
|
+
}));
|
|
10218
|
+
if (successResponse.hasOutput && plugin.config.validator.output) expression = expression.attr("output").call(plugin.referenceSymbol({
|
|
10219
|
+
category: "schema",
|
|
10220
|
+
resource: "operation",
|
|
10221
|
+
resourceId: operation.id,
|
|
10222
|
+
role: "responses",
|
|
10223
|
+
tool: plugin.config.validator.output
|
|
10224
|
+
}));
|
|
10225
|
+
return expression;
|
|
10226
|
+
}
|
|
10227
|
+
function buildContainerObject(node, plugin, symbols) {
|
|
10228
|
+
const obj = $.object();
|
|
10229
|
+
for (const item of node.itemsFrom(source)) {
|
|
10230
|
+
const { operation } = item.data;
|
|
10231
|
+
const contractSymbol = symbols.get(operation.id);
|
|
10232
|
+
const name = item.location[item.location.length - 1];
|
|
10233
|
+
const propName = applyNaming(name, plugin.config.contracts.contractName);
|
|
10234
|
+
obj.prop(propName, contractSymbol);
|
|
10235
|
+
}
|
|
10236
|
+
for (const child of node.children.values()) if (child.shell) {
|
|
10237
|
+
const childSymbol = child.shell.define(child).node.symbol;
|
|
10238
|
+
if (childSymbol) {
|
|
10239
|
+
const propName = applyNaming(child.name, plugin.config.contracts.segmentName);
|
|
10240
|
+
obj.prop(propName, childSymbol);
|
|
10241
|
+
}
|
|
10242
|
+
}
|
|
10243
|
+
return obj;
|
|
10244
|
+
}
|
|
10245
|
+
function createShell(plugin) {
|
|
10246
|
+
const cache = /* @__PURE__ */ new Map();
|
|
10247
|
+
return { define: (node) => {
|
|
10248
|
+
const resourceId = node.getPath().join(".");
|
|
10249
|
+
const cached = cache.get(resourceId);
|
|
10250
|
+
if (cached) return {
|
|
10251
|
+
dependencies: [],
|
|
10252
|
+
node: cached
|
|
10253
|
+
};
|
|
10254
|
+
const symbol = plugin.symbol(applyNaming(node.name, node.isRoot ? plugin.config.contracts.containerName : plugin.config.contracts.segmentName), { meta: createShellMeta(node) });
|
|
10255
|
+
const o = $.const(symbol).export().assign($.object());
|
|
10256
|
+
cache.set(resourceId, o);
|
|
10257
|
+
return {
|
|
10258
|
+
dependencies: [],
|
|
10259
|
+
node: o
|
|
10260
|
+
};
|
|
10261
|
+
} };
|
|
10262
|
+
}
|
|
10263
|
+
function toNode$1(model, plugin) {
|
|
10264
|
+
if (model.virtual) {
|
|
10265
|
+
const nodes = [];
|
|
10266
|
+
const symbols = /* @__PURE__ */ new Map();
|
|
10267
|
+
for (const item of model.itemsFrom(source)) {
|
|
10268
|
+
const { operation } = item.data;
|
|
10269
|
+
const contractSymbol = createContractSymbol(plugin, item);
|
|
10270
|
+
const expression = createContractExpression(plugin, operation);
|
|
10271
|
+
const node = $.const(contractSymbol).export().$if(createOperationComment(operation), (n, v) => n.doc(v)).assign(expression);
|
|
10272
|
+
nodes.push(node);
|
|
10273
|
+
symbols.set(operation.id, contractSymbol);
|
|
10274
|
+
}
|
|
10275
|
+
return {
|
|
10276
|
+
nodes,
|
|
10277
|
+
symbols
|
|
10278
|
+
};
|
|
10279
|
+
}
|
|
10280
|
+
if (!model.shell) return { nodes: [] };
|
|
10281
|
+
const nodes = [];
|
|
10282
|
+
const symbols = /* @__PURE__ */ new Map();
|
|
10283
|
+
for (const item of model.itemsFrom(source)) {
|
|
10284
|
+
const { operation } = item.data;
|
|
10285
|
+
const contractSymbol = createContractSymbol(plugin, item);
|
|
10286
|
+
const expression = createContractExpression(plugin, operation);
|
|
10287
|
+
const node = $.const(contractSymbol).export().$if(createOperationComment(operation), (n, v) => n.doc(v)).assign(expression);
|
|
10288
|
+
nodes.push(node);
|
|
10289
|
+
symbols.set(operation.id, contractSymbol);
|
|
10290
|
+
}
|
|
10291
|
+
const containerSymbol = model.shell.define(model).node.symbol;
|
|
10292
|
+
const obj = buildContainerObject(model, plugin, symbols);
|
|
10293
|
+
const containerNode = $.const(containerSymbol).export().assign(obj.pretty());
|
|
10294
|
+
nodes.push(containerNode);
|
|
10295
|
+
return {
|
|
10296
|
+
nodes,
|
|
10297
|
+
symbols
|
|
10298
|
+
};
|
|
10299
|
+
}
|
|
10300
|
+
|
|
10301
|
+
//#endregion
|
|
10302
|
+
//#region src/plugins/orpc/contracts/resolve.ts
|
|
10303
|
+
function resolvePath(plugin) {
|
|
10304
|
+
if (plugin.config.contracts.nesting === "id") return OperationPath.id();
|
|
10305
|
+
if (plugin.config.contracts.nesting === "operationId") return OperationPath.fromOperationId({
|
|
10306
|
+
delimiters: plugin.config.contracts.nestingDelimiters,
|
|
10307
|
+
fallback: OperationPath.id()
|
|
10308
|
+
});
|
|
10309
|
+
return plugin.config.contracts.nesting;
|
|
10310
|
+
}
|
|
10311
|
+
function resolveStrategy(plugin) {
|
|
10312
|
+
if (plugin.config.contracts.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath(plugin)(operation).join(".")] });
|
|
10313
|
+
if (plugin.config.contracts.strategy === "single") {
|
|
10314
|
+
const root = plugin.config.contracts.containerName;
|
|
10315
|
+
return OperationStrategy.single({
|
|
10316
|
+
path: resolvePath(plugin),
|
|
10317
|
+
root: typeof root.name === "string" ? root.name : root.name?.("") ?? ""
|
|
10318
|
+
});
|
|
10319
|
+
}
|
|
10320
|
+
if (plugin.config.contracts.strategy === "byTags") return OperationStrategy.byTags({
|
|
10321
|
+
fallback: plugin.config.contracts.strategyDefaultTag,
|
|
10322
|
+
path: resolvePath(plugin)
|
|
10323
|
+
});
|
|
10324
|
+
return plugin.config.contracts.strategy;
|
|
10325
|
+
}
|
|
10326
|
+
|
|
10327
|
+
//#endregion
|
|
10328
|
+
//#region src/plugins/orpc/v1/plugin.ts
|
|
10329
|
+
const handlerV1$1 = ({ plugin }) => {
|
|
10330
|
+
plugin.symbol("oc", { external: "@orpc/contract" });
|
|
10331
|
+
const structure = new StructureModel();
|
|
10332
|
+
const shell = createShell(plugin);
|
|
10333
|
+
const strategy = resolveStrategy(plugin);
|
|
10334
|
+
plugin.forEach("operation", (event) => {
|
|
10335
|
+
structure.insert({
|
|
10336
|
+
data: {
|
|
10337
|
+
operation: event.operation,
|
|
10338
|
+
path: event._path,
|
|
10339
|
+
tags: event.tags
|
|
10340
|
+
},
|
|
10341
|
+
locations: strategy(event.operation).map((path) => ({
|
|
10342
|
+
path,
|
|
10343
|
+
shell
|
|
10344
|
+
})),
|
|
10345
|
+
source
|
|
10346
|
+
});
|
|
10347
|
+
}, { order: "declarations" });
|
|
10348
|
+
const allNodes = [];
|
|
10349
|
+
for (const node of structure.walk()) {
|
|
10350
|
+
const { nodes } = toNode$1(node, plugin);
|
|
10351
|
+
allNodes.push(...nodes);
|
|
10352
|
+
}
|
|
10353
|
+
for (const node of allNodes) plugin.node(node);
|
|
10354
|
+
};
|
|
10355
|
+
|
|
10356
|
+
//#endregion
|
|
10357
|
+
//#region src/plugins/orpc/plugin.ts
|
|
10358
|
+
const handler$3 = (args) => handlerV1$1(args);
|
|
10359
|
+
|
|
10360
|
+
//#endregion
|
|
10361
|
+
//#region src/plugins/orpc/config.ts
|
|
10362
|
+
const validatorInferWarn = "You set `validator: true` but no validator plugin was found in your plugins. Add a validator plugin like `zod` to enable this feature. The validator option has been disabled.";
|
|
10363
|
+
const defaultConfig$3 = {
|
|
10364
|
+
config: { includeInEntry: false },
|
|
10365
|
+
handler: handler$3,
|
|
10366
|
+
name: "orpc",
|
|
10367
|
+
resolveConfig: (plugin, context) => {
|
|
10368
|
+
if (typeof plugin.config.validator !== "object") plugin.config.validator = {
|
|
10369
|
+
input: plugin.config.validator,
|
|
10370
|
+
output: plugin.config.validator
|
|
10371
|
+
};
|
|
10372
|
+
if (plugin.config.validator.input || plugin.config.validator.input === void 0) if (typeof plugin.config.validator.input === "boolean" || plugin.config.validator.input === void 0) try {
|
|
10373
|
+
plugin.config.validator.input = context.pluginByTag("validator");
|
|
10374
|
+
plugin.dependencies.add(plugin.config.validator.input);
|
|
10375
|
+
} catch {
|
|
10376
|
+
if (plugin.config.validator.input !== void 0) log.warn(validatorInferWarn);
|
|
10377
|
+
plugin.config.validator.input = false;
|
|
10378
|
+
}
|
|
10379
|
+
else plugin.dependencies.add(plugin.config.validator.input);
|
|
10380
|
+
else plugin.config.validator.input = false;
|
|
10381
|
+
if (plugin.config.validator.output || plugin.config.validator.output === void 0) if (typeof plugin.config.validator.output === "boolean" || plugin.config.validator.output === void 0) try {
|
|
10382
|
+
plugin.config.validator.output = context.pluginByTag("validator");
|
|
10383
|
+
plugin.dependencies.add(plugin.config.validator.output);
|
|
10384
|
+
} catch {
|
|
10385
|
+
if (plugin.config.validator.output !== void 0) log.warn(validatorInferWarn);
|
|
10386
|
+
plugin.config.validator.output = false;
|
|
10387
|
+
}
|
|
10388
|
+
else plugin.dependencies.add(plugin.config.validator.output);
|
|
10389
|
+
else plugin.config.validator.output = false;
|
|
10390
|
+
plugin.config.contracts = resolveContracts(plugin.config, context);
|
|
10391
|
+
}
|
|
10392
|
+
};
|
|
10393
|
+
/**
|
|
10394
|
+
* Type helper for oRPC plugin, returns {@link Plugin.Config} object
|
|
10395
|
+
*/
|
|
10036
10396
|
const defineConfig$3 = definePluginConfig(defaultConfig$3);
|
|
10037
10397
|
|
|
10038
10398
|
//#endregion
|
|
10039
10399
|
//#region src/plugins/swr/v2/useSwr.ts
|
|
10040
10400
|
const createUseSwr = ({ operation, plugin }) => {
|
|
10041
10401
|
if (hasOperationSse({ operation })) return;
|
|
10042
|
-
const symbolUseSwr = plugin.external("swr");
|
|
10402
|
+
const symbolUseSwr = plugin.external("swr.useSWR");
|
|
10043
10403
|
const symbolUseQueryFn = plugin.symbol(applyNaming(operation.id, plugin.config.useSwr));
|
|
10044
10404
|
const awaitSdkFn = $.lazy((ctx) => ctx.access(plugin.referenceSymbol({
|
|
10045
10405
|
category: "sdk",
|
|
@@ -10059,11 +10419,7 @@ const handlerV2 = ({ plugin }) => {
|
|
|
10059
10419
|
plugin.symbol("useSWR", {
|
|
10060
10420
|
external: "swr",
|
|
10061
10421
|
importKind: "default",
|
|
10062
|
-
kind: "function"
|
|
10063
|
-
meta: {
|
|
10064
|
-
category: "external",
|
|
10065
|
-
resource: "swr"
|
|
10066
|
-
}
|
|
10422
|
+
kind: "function"
|
|
10067
10423
|
});
|
|
10068
10424
|
plugin.forEach("operation", ({ operation }) => {
|
|
10069
10425
|
if (plugin.hooks.operation.isQuery(operation)) {
|
|
@@ -10424,7 +10780,7 @@ function push(target, result) {
|
|
|
10424
10780
|
}
|
|
10425
10781
|
function toNode(pipes, plugin) {
|
|
10426
10782
|
if (!(pipes instanceof Array)) return pipes;
|
|
10427
|
-
if (pipes.length
|
|
10783
|
+
if (!pipes.length) return $(plugin.external("valibot.v")).attr(identifiers$1.schemas.unknown).call();
|
|
10428
10784
|
if (pipes.length === 1) return pipes[0];
|
|
10429
10785
|
return $(plugin.external("valibot.v")).attr(identifiers$1.methods.pipe).call(...pipes);
|
|
10430
10786
|
}
|
|
@@ -10940,7 +11296,7 @@ function enumToPipes({ plugin, schema }) {
|
|
|
10940
11296
|
function baseNode$45(ctx) {
|
|
10941
11297
|
const { applyModifiers, childResults, plugin, symbols } = ctx;
|
|
10942
11298
|
const { v } = symbols;
|
|
10943
|
-
if (childResults.length
|
|
11299
|
+
if (!childResults.length) return $(v).attr(identifiers$1.schemas.any).call();
|
|
10944
11300
|
if (childResults.length === 1) return applyModifiers(childResults[0]).pipes;
|
|
10945
11301
|
const itemNodes = childResults.map((item) => pipesToNode(item.pipes, plugin));
|
|
10946
11302
|
return $(v).attr(identifiers$1.schemas.intersect).call($.array(...itemNodes));
|
|
@@ -11401,7 +11757,7 @@ function baseNode$37(ctx) {
|
|
|
11401
11757
|
const schema = schemas[index];
|
|
11402
11758
|
if (schema.type !== "null" && schema.const !== null) nonNullItems.push(item);
|
|
11403
11759
|
});
|
|
11404
|
-
if (nonNullItems.length
|
|
11760
|
+
if (!nonNullItems.length) return $(v).attr(identifiers$1.schemas.null).call();
|
|
11405
11761
|
if (nonNullItems.length === 1) return nonNullItems[0].pipes;
|
|
11406
11762
|
const itemNodes = nonNullItems.map((i) => pipesToNode(i.pipes, plugin));
|
|
11407
11763
|
return $(v).attr(identifiers$1.schemas.union).call($.array(...itemNodes));
|
|
@@ -11795,11 +12151,7 @@ function createProcessor$3(plugin) {
|
|
|
11795
12151
|
const handlerV1 = ({ plugin }) => {
|
|
11796
12152
|
plugin.symbol("v", {
|
|
11797
12153
|
external: "valibot",
|
|
11798
|
-
importKind: "namespace"
|
|
11799
|
-
meta: {
|
|
11800
|
-
category: "external",
|
|
11801
|
-
resource: "valibot.v"
|
|
11802
|
-
}
|
|
12154
|
+
importKind: "namespace"
|
|
11803
12155
|
});
|
|
11804
12156
|
const processor = createProcessor$3(plugin);
|
|
11805
12157
|
plugin.forEach("operation", "parameter", "requestBody", "schema", "webhook", (event) => {
|
|
@@ -12606,7 +12958,7 @@ function baseNode$32(ctx) {
|
|
|
12606
12958
|
const { symbols } = ctx;
|
|
12607
12959
|
const { z } = symbols;
|
|
12608
12960
|
const { allStrings, enumMembers, literalMembers } = ctx.nodes.items(ctx);
|
|
12609
|
-
if (allStrings && enumMembers.length
|
|
12961
|
+
if (allStrings && enumMembers.length) return $(z).attr(identifiers.enum).call($.array(...enumMembers));
|
|
12610
12962
|
if (literalMembers.length === 1) return literalMembers[0];
|
|
12611
12963
|
return $(z).attr(identifiers.union).call($.array(...literalMembers));
|
|
12612
12964
|
}
|
|
@@ -12736,7 +13088,7 @@ function numberResolver$2(ctx) {
|
|
|
12736
13088
|
if (minNode) checks.push(minNode);
|
|
12737
13089
|
const maxNode = ctx.nodes.max(ctx);
|
|
12738
13090
|
if (maxNode) checks.push(maxNode);
|
|
12739
|
-
if (checks.length
|
|
13091
|
+
if (checks.length) ctx.chain.current = ctx.chain.current.attr(identifiers.check).call(...checks);
|
|
12740
13092
|
return ctx.chain.current;
|
|
12741
13093
|
}
|
|
12742
13094
|
function numberToNode$2({ plugin, schema }) {
|
|
@@ -12767,7 +13119,7 @@ function numberToNode$2({ plugin, schema }) {
|
|
|
12767
13119
|
//#region src/plugins/zod/mini/toAst/object.ts
|
|
12768
13120
|
function additionalPropertiesNode$2(ctx) {
|
|
12769
13121
|
const { _childResults, applyModifiers, schema, walk, walkerCtx } = ctx;
|
|
12770
|
-
if (!schema.additionalProperties || schema.properties && Object.keys(schema.properties).length
|
|
13122
|
+
if (!schema.additionalProperties || schema.properties && Object.keys(schema.properties).length) return;
|
|
12771
13123
|
const additionalResult = walk(schema.additionalProperties, childContext(walkerCtx, "additionalProperties"));
|
|
12772
13124
|
_childResults.push(additionalResult);
|
|
12773
13125
|
return applyModifiers(additionalResult, {}).expression;
|
|
@@ -12899,7 +13251,7 @@ function stringResolver$2(ctx) {
|
|
|
12899
13251
|
}
|
|
12900
13252
|
const patternNode = ctx.nodes.pattern(ctx);
|
|
12901
13253
|
if (patternNode) checks.push(patternNode);
|
|
12902
|
-
if (checks.length
|
|
13254
|
+
if (checks.length) ctx.chain.current = ctx.chain.current.attr(identifiers.check).call(...checks);
|
|
12903
13255
|
return ctx.chain.current;
|
|
12904
13256
|
}
|
|
12905
13257
|
function stringToNode$2({ plugin, schema }) {
|
|
@@ -12930,7 +13282,7 @@ function baseNode$26(ctx) {
|
|
|
12930
13282
|
const { applyModifiers, childResults, symbols } = ctx;
|
|
12931
13283
|
const { z } = symbols;
|
|
12932
13284
|
const tupleFn = $(z).attr(identifiers.tuple);
|
|
12933
|
-
if (childResults.length
|
|
13285
|
+
if (!childResults.length) return tupleFn.call($.array());
|
|
12934
13286
|
const tupleElements = childResults.map((result) => applyModifiers(result, { optional: false }).expression);
|
|
12935
13287
|
return tupleFn.call($.array(...tupleElements));
|
|
12936
13288
|
}
|
|
@@ -13282,7 +13634,7 @@ function createVisitor$2(config) {
|
|
|
13282
13634
|
if (schema.type !== "null" && schema.const !== null) nonNullItems.push(item);
|
|
13283
13635
|
});
|
|
13284
13636
|
let expression;
|
|
13285
|
-
if (nonNullItems.length
|
|
13637
|
+
if (!nonNullItems.length) expression = $(z).attr(identifiers.null).call();
|
|
13286
13638
|
else if (nonNullItems.length === 1) expression = nonNullItems[0].expression;
|
|
13287
13639
|
else expression = $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
13288
13640
|
return {
|
|
@@ -13379,10 +13731,7 @@ const handlerMini = ({ plugin }) => {
|
|
|
13379
13731
|
plugin.symbol("z", {
|
|
13380
13732
|
external: getZodModule({ plugin }),
|
|
13381
13733
|
importKind: "namespace",
|
|
13382
|
-
meta: {
|
|
13383
|
-
category: "external",
|
|
13384
|
-
resource: "zod.z"
|
|
13385
|
-
}
|
|
13734
|
+
meta: { resource: "zod.z" }
|
|
13386
13735
|
});
|
|
13387
13736
|
const processor = createProcessor$2(plugin);
|
|
13388
13737
|
plugin.forEach("operation", "parameter", "requestBody", "schema", "webhook", (event) => {
|
|
@@ -13643,7 +13992,7 @@ function baseNode$20(ctx) {
|
|
|
13643
13992
|
const { symbols } = ctx;
|
|
13644
13993
|
const { z } = symbols;
|
|
13645
13994
|
const { allStrings, enumMembers, literalMembers } = ctx.nodes.items(ctx);
|
|
13646
|
-
if (allStrings && enumMembers.length
|
|
13995
|
+
if (allStrings && enumMembers.length) return $(z).attr(identifiers.enum).call($.array(...enumMembers));
|
|
13647
13996
|
else if (literalMembers.length === 1) return literalMembers[0];
|
|
13648
13997
|
else return $(z).attr(identifiers.union).call($.array(...literalMembers));
|
|
13649
13998
|
}
|
|
@@ -13795,7 +14144,7 @@ function numberToNode$1({ plugin, schema }) {
|
|
|
13795
14144
|
//#region src/plugins/zod/v3/toAst/object.ts
|
|
13796
14145
|
function additionalPropertiesNode$1(ctx) {
|
|
13797
14146
|
const { applyModifiers, schema, walk, walkerCtx } = ctx;
|
|
13798
|
-
if (!schema.additionalProperties || schema.properties && Object.keys(schema.properties).length
|
|
14147
|
+
if (!schema.additionalProperties || schema.properties && Object.keys(schema.properties).length) return;
|
|
13799
14148
|
const additionalResult = walk(schema.additionalProperties, childContext(walkerCtx, "additionalProperties"));
|
|
13800
14149
|
ctx._childResults.push(additionalResult);
|
|
13801
14150
|
return applyModifiers(additionalResult, {}).expression;
|
|
@@ -13950,7 +14299,7 @@ function baseNode$14(ctx) {
|
|
|
13950
14299
|
const { applyModifiers, childResults, symbols } = ctx;
|
|
13951
14300
|
const { z } = symbols;
|
|
13952
14301
|
const tupleFn = $(z).attr(identifiers.tuple);
|
|
13953
|
-
if (childResults.length
|
|
14302
|
+
if (!childResults.length) return tupleFn.call($.array());
|
|
13954
14303
|
const tupleElements = childResults.map((result) => applyModifiers(result, { optional: false }).expression);
|
|
13955
14304
|
return tupleFn.call($.array(...tupleElements));
|
|
13956
14305
|
}
|
|
@@ -14300,7 +14649,7 @@ function createVisitor$1(config) {
|
|
|
14300
14649
|
if (schema.type !== "null" && schema.const !== null) nonNullItems.push(item);
|
|
14301
14650
|
});
|
|
14302
14651
|
let expression;
|
|
14303
|
-
if (nonNullItems.length
|
|
14652
|
+
if (!nonNullItems.length) expression = $(z).attr(identifiers.null).call();
|
|
14304
14653
|
else if (nonNullItems.length === 1) expression = nonNullItems[0].expression;
|
|
14305
14654
|
else expression = $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
14306
14655
|
return {
|
|
@@ -14396,10 +14745,7 @@ function createProcessor$1(plugin) {
|
|
|
14396
14745
|
const handlerV3 = ({ plugin }) => {
|
|
14397
14746
|
plugin.symbol("z", {
|
|
14398
14747
|
external: getZodModule({ plugin }),
|
|
14399
|
-
meta: {
|
|
14400
|
-
category: "external",
|
|
14401
|
-
resource: "zod.z"
|
|
14402
|
-
}
|
|
14748
|
+
meta: { resource: "zod.z" }
|
|
14403
14749
|
});
|
|
14404
14750
|
const processor = createProcessor$1(plugin);
|
|
14405
14751
|
plugin.forEach("operation", "parameter", "requestBody", "schema", "webhook", (event) => {
|
|
@@ -14660,7 +15006,7 @@ function baseNode$8(ctx) {
|
|
|
14660
15006
|
const { symbols } = ctx;
|
|
14661
15007
|
const { z } = symbols;
|
|
14662
15008
|
const { allStrings, enumMembers, literalMembers } = ctx.nodes.items(ctx);
|
|
14663
|
-
if (allStrings && enumMembers.length
|
|
15009
|
+
if (allStrings && enumMembers.length) return $(z).attr(identifiers.enum).call($.array(...enumMembers));
|
|
14664
15010
|
if (literalMembers.length === 1) return literalMembers[0];
|
|
14665
15011
|
return $(z).attr(identifiers.union).call($.array(...literalMembers));
|
|
14666
15012
|
}
|
|
@@ -14817,7 +15163,7 @@ function numberToNode({ plugin, schema }) {
|
|
|
14817
15163
|
//#region src/plugins/zod/v4/toAst/object.ts
|
|
14818
15164
|
function additionalPropertiesNode(ctx) {
|
|
14819
15165
|
const { _childResults, applyModifiers, schema, walk, walkerCtx } = ctx;
|
|
14820
|
-
if (!schema.additionalProperties || schema.properties && Object.keys(schema.properties).length
|
|
15166
|
+
if (!schema.additionalProperties || schema.properties && Object.keys(schema.properties).length) return;
|
|
14821
15167
|
const additionalResult = walk(schema.additionalProperties, childContext(walkerCtx, "additionalProperties"));
|
|
14822
15168
|
_childResults.push(additionalResult);
|
|
14823
15169
|
return applyModifiers(additionalResult, {}).expression;
|
|
@@ -14974,7 +15320,7 @@ function baseNode$2(ctx) {
|
|
|
14974
15320
|
const { applyModifiers, childResults, symbols } = ctx;
|
|
14975
15321
|
const { z } = symbols;
|
|
14976
15322
|
const tupleFn = $(z).attr(identifiers.tuple);
|
|
14977
|
-
if (childResults.length
|
|
15323
|
+
if (!childResults.length) return tupleFn.call($.array());
|
|
14978
15324
|
const tupleElements = childResults.map((result) => applyModifiers(result, { optional: false }).expression);
|
|
14979
15325
|
return tupleFn.call($.array(...tupleElements));
|
|
14980
15326
|
}
|
|
@@ -15330,7 +15676,7 @@ function createVisitor(config) {
|
|
|
15330
15676
|
if (schema.type !== "null" && schema.const !== null) nonNullItems.push(item);
|
|
15331
15677
|
});
|
|
15332
15678
|
let expression;
|
|
15333
|
-
if (nonNullItems.length
|
|
15679
|
+
if (!nonNullItems.length) expression = $(z).attr(identifiers.null).call();
|
|
15334
15680
|
else if (nonNullItems.length === 1) expression = nonNullItems[0].expression;
|
|
15335
15681
|
else expression = $(z).attr(identifiers.union).call($.array().pretty().elements(...nonNullItems.map((item) => item.expression)));
|
|
15336
15682
|
return {
|
|
@@ -15427,10 +15773,7 @@ const handlerV4 = ({ plugin }) => {
|
|
|
15427
15773
|
plugin.symbol("z", {
|
|
15428
15774
|
external: getZodModule({ plugin }),
|
|
15429
15775
|
importKind: "namespace",
|
|
15430
|
-
meta: {
|
|
15431
|
-
category: "external",
|
|
15432
|
-
resource: "zod.z"
|
|
15433
|
-
}
|
|
15776
|
+
meta: { resource: "zod.z" }
|
|
15434
15777
|
});
|
|
15435
15778
|
const processor = createProcessor(plugin);
|
|
15436
15779
|
plugin.forEach("operation", "parameter", "requestBody", "schema", "webhook", (event) => {
|
|
@@ -15719,29 +16062,30 @@ const defineConfig = definePluginConfig(defaultConfig);
|
|
|
15719
16062
|
//#endregion
|
|
15720
16063
|
//#region src/plugins/config.ts
|
|
15721
16064
|
const defaultPluginConfigs = {
|
|
15722
|
-
"@angular/common": defaultConfig$
|
|
15723
|
-
"@faker-js/faker": defaultConfig$
|
|
15724
|
-
"@hey-api/client-angular": defaultConfig$
|
|
15725
|
-
"@hey-api/client-axios": defaultConfig$
|
|
15726
|
-
"@hey-api/client-fetch": defaultConfig$
|
|
15727
|
-
"@hey-api/client-ky": defaultConfig$
|
|
15728
|
-
"@hey-api/client-next": defaultConfig$
|
|
15729
|
-
"@hey-api/client-nuxt": defaultConfig$
|
|
15730
|
-
"@hey-api/client-ofetch": defaultConfig$
|
|
15731
|
-
"@hey-api/schemas": defaultConfig$
|
|
15732
|
-
"@hey-api/sdk": defaultConfig$
|
|
15733
|
-
"@hey-api/transformers": defaultConfig$
|
|
15734
|
-
"@hey-api/typescript": defaultConfig$
|
|
15735
|
-
"@pinia/colada": defaultConfig$
|
|
15736
|
-
"@tanstack/angular-query-experimental": defaultConfig$
|
|
15737
|
-
"@tanstack/preact-query": defaultConfig$
|
|
15738
|
-
"@tanstack/react-query": defaultConfig$
|
|
15739
|
-
"@tanstack/solid-query": defaultConfig$
|
|
15740
|
-
"@tanstack/svelte-query": defaultConfig$
|
|
15741
|
-
"@tanstack/vue-query": defaultConfig$
|
|
15742
|
-
arktype: defaultConfig$
|
|
15743
|
-
fastify: defaultConfig$
|
|
15744
|
-
nestjs: defaultConfig$
|
|
16065
|
+
"@angular/common": defaultConfig$26,
|
|
16066
|
+
"@faker-js/faker": defaultConfig$25,
|
|
16067
|
+
"@hey-api/client-angular": defaultConfig$24,
|
|
16068
|
+
"@hey-api/client-axios": defaultConfig$23,
|
|
16069
|
+
"@hey-api/client-fetch": defaultConfig$22,
|
|
16070
|
+
"@hey-api/client-ky": defaultConfig$21,
|
|
16071
|
+
"@hey-api/client-next": defaultConfig$20,
|
|
16072
|
+
"@hey-api/client-nuxt": defaultConfig$19,
|
|
16073
|
+
"@hey-api/client-ofetch": defaultConfig$18,
|
|
16074
|
+
"@hey-api/schemas": defaultConfig$17,
|
|
16075
|
+
"@hey-api/sdk": defaultConfig$16,
|
|
16076
|
+
"@hey-api/transformers": defaultConfig$15,
|
|
16077
|
+
"@hey-api/typescript": defaultConfig$14,
|
|
16078
|
+
"@pinia/colada": defaultConfig$13,
|
|
16079
|
+
"@tanstack/angular-query-experimental": defaultConfig$12,
|
|
16080
|
+
"@tanstack/preact-query": defaultConfig$11,
|
|
16081
|
+
"@tanstack/react-query": defaultConfig$10,
|
|
16082
|
+
"@tanstack/solid-query": defaultConfig$9,
|
|
16083
|
+
"@tanstack/svelte-query": defaultConfig$8,
|
|
16084
|
+
"@tanstack/vue-query": defaultConfig$7,
|
|
16085
|
+
arktype: defaultConfig$6,
|
|
16086
|
+
fastify: defaultConfig$5,
|
|
16087
|
+
nestjs: defaultConfig$4,
|
|
16088
|
+
orpc: defaultConfig$3,
|
|
15745
16089
|
swr: defaultConfig$2,
|
|
15746
16090
|
valibot: defaultConfig$1,
|
|
15747
16091
|
zod: defaultConfig
|
|
@@ -15926,4 +16270,4 @@ async function resolveJobs({ logger, userConfigs }) {
|
|
|
15926
16270
|
|
|
15927
16271
|
//#endregion
|
|
15928
16272
|
export { postProcessors as _, clientDefaultConfig as a, TypeScriptRenderer as c, reserved as d, keywords as f, getTypedConfig as g, getClientPlugin as h, generateClientBundle as i, TsDslContext as l, TsDsl as m, defaultPlugins as n, clientDefaultMeta as o, regexp as p, clientPluginHandler as r, $ as s, resolveJobs as t, ctx as u };
|
|
15929
|
-
//# sourceMappingURL=init-
|
|
16273
|
+
//# sourceMappingURL=init-DXg2DSyt.mjs.map
|