@hey-api/openapi-ts 0.94.3 → 0.94.4

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.
@@ -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$2(plugin) {
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$2(plugin)(operation).join(".")] });
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$2(plugin),
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$2(plugin)
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$1(plugin) {
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$1(plugin)(operation).join(".")] });
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$1(plugin),
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$1(plugin)
405
+ path: resolvePath$2(plugin)
406
406
  });
407
407
  return plugin.config.httpResources.strategy;
408
408
  }
@@ -3945,7 +3945,7 @@ var TypeQueryTsDsl = class extends Mixed$1 {
3945
3945
  _expr;
3946
3946
  constructor(expr) {
3947
3947
  super();
3948
- this._expr = expr;
3948
+ this._expr = ref(expr);
3949
3949
  }
3950
3950
  analyze(ctx) {
3951
3951
  super.analyze(ctx);
@@ -4753,7 +4753,7 @@ function operationStatements({ isRequiredOptions, opParameters, operation, plugi
4753
4753
 
4754
4754
  //#endregion
4755
4755
  //#region src/plugins/@hey-api/sdk/v1/node.ts
4756
- const source$1 = globalThis.Symbol("@hey-api/sdk");
4756
+ const source$2 = globalThis.Symbol("@hey-api/sdk");
4757
4757
  function isInstance(plugin) {
4758
4758
  const config = plugin.config.operations;
4759
4759
  return config.container === "class" && config.methods === "instance" && config.strategy !== "flat";
@@ -4762,7 +4762,7 @@ function attachComment$1(args) {
4762
4762
  const { node, operation, plugin } = args;
4763
4763
  return node.$if(plugin.config.comments && createOperationComment(operation), (n, v) => n.doc(v));
4764
4764
  }
4765
- function createShellMeta(node) {
4765
+ function createShellMeta$1(node) {
4766
4766
  return {
4767
4767
  category: "utility",
4768
4768
  resource: "class",
@@ -4783,7 +4783,7 @@ function createFnSymbol(plugin, item) {
4783
4783
  } });
4784
4784
  }
4785
4785
  function childToNode(resource, plugin) {
4786
- const refChild = plugin.referenceSymbol(createShellMeta(resource));
4786
+ const refChild = plugin.referenceSymbol(createShellMeta$1(resource));
4787
4787
  const memberNameStr = toCase(refChild.name, plugin.config.operations.methodName.casing ?? "camelCase");
4788
4788
  const memberName = plugin.symbol(memberNameStr);
4789
4789
  if (isInstance(plugin)) {
@@ -4793,10 +4793,10 @@ function childToNode(resource, plugin) {
4793
4793
  if (plugin.isSymbolRegistered(refChild.id)) return [$.field(memberName, (f) => f.static().assign($(refChild)))];
4794
4794
  return [$.getter(memberName, (g) => g.public().static().do($.return(refChild)))];
4795
4795
  }
4796
- function createShell(plugin) {
4796
+ function createShell$1(plugin) {
4797
4797
  const isAngularClient = getClientPlugin(getTypedConfig(plugin)).name === "@hey-api/client-angular";
4798
4798
  return { define: (node) => {
4799
- const symbol = plugin.symbol(applyNaming(node.name, node.isRoot ? plugin.config.operations.containerName : plugin.config.operations.segmentName), { meta: createShellMeta(node) });
4799
+ const symbol = plugin.symbol(applyNaming(node.name, node.isRoot ? plugin.config.operations.containerName : plugin.config.operations.segmentName), { meta: createShellMeta$1(node) });
4800
4800
  const c = $.class(symbol).export().$if(isInstance(plugin), (c) => c.extends(plugin.referenceSymbol({
4801
4801
  category: "utility",
4802
4802
  resource: "class",
@@ -4889,10 +4889,10 @@ function implementFn(args) {
4889
4889
  role: "response"
4890
4890
  }), (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
4891
  }
4892
- function toNode$1(model, plugin) {
4892
+ function toNode$2(model, plugin) {
4893
4893
  if (model.virtual) {
4894
4894
  const nodes = [];
4895
- for (const item of model.itemsFrom(source$1)) {
4895
+ for (const item of model.itemsFrom(source$2)) {
4896
4896
  const { operation } = item.data;
4897
4897
  let node = $.const(createFnSymbol(plugin, item)).export().assign(implementFn({
4898
4898
  node: $.func(),
@@ -4915,7 +4915,7 @@ function toNode$1(model, plugin) {
4915
4915
  const shell = model.shell.define(model);
4916
4916
  const node = shell.node;
4917
4917
  let index = 0;
4918
- for (const item of model.itemsFrom(source$1)) {
4918
+ for (const item of model.itemsFrom(source$2)) {
4919
4919
  const { operation } = item.data;
4920
4920
  if (node["~dsl"] === "VarTsDsl") {} else {
4921
4921
  if (index > 0 || node.hasBody) node.newline();
@@ -4981,7 +4981,7 @@ function hasOperationSse({ operation }) {
4981
4981
 
4982
4982
  //#endregion
4983
4983
  //#region src/plugins/@angular/common/shared/node.ts
4984
- const source = globalThis.Symbol("@angular/common");
4984
+ const source$1 = globalThis.Symbol("@angular/common");
4985
4985
  function attachComment(args) {
4986
4986
  const { node, operation, plugin } = args;
4987
4987
  return node.$if(plugin.config.comments && createOperationComment(operation), (n, v) => n.doc(v));
@@ -5127,7 +5127,7 @@ function implementHttpResourceFn(args) {
5127
5127
  function toHttpRequestNode(model, plugin) {
5128
5128
  if (model.virtual) {
5129
5129
  const nodes = [];
5130
- for (const item of model.itemsFrom(source)) {
5130
+ for (const item of model.itemsFrom(source$1)) {
5131
5131
  const { operation } = item.data;
5132
5132
  let node = $.const(createHttpRequestFnSymbol(plugin, item)).export().assign(implementHttpRequestFn({
5133
5133
  node: $.func(),
@@ -5148,7 +5148,7 @@ function toHttpRequestNode(model, plugin) {
5148
5148
  const shell = model.shell.define(model);
5149
5149
  const node = shell.node;
5150
5150
  let index = 0;
5151
- for (const item of model.itemsFrom(source)) {
5151
+ for (const item of model.itemsFrom(source$1)) {
5152
5152
  const { operation } = item.data;
5153
5153
  if (index > 0 || node.hasBody) node.newline();
5154
5154
  node.do(implementHttpRequestFn({
@@ -5175,7 +5175,7 @@ function toHttpRequestNode(model, plugin) {
5175
5175
  function toHttpResourceNode(model, plugin) {
5176
5176
  if (model.virtual) {
5177
5177
  const nodes = [];
5178
- for (const item of model.itemsFrom(source)) {
5178
+ for (const item of model.itemsFrom(source$1)) {
5179
5179
  const { operation } = item.data;
5180
5180
  let node = $.const(createHttpResourceFnSymbol(plugin, item)).export().assign(implementHttpResourceFn({
5181
5181
  node: $.func(),
@@ -5196,7 +5196,7 @@ function toHttpResourceNode(model, plugin) {
5196
5196
  const shell = model.shell.define(model);
5197
5197
  const node = shell.node;
5198
5198
  let index = 0;
5199
- for (const item of model.itemsFrom(source)) {
5199
+ for (const item of model.itemsFrom(source$1)) {
5200
5200
  const { operation } = item.data;
5201
5201
  if (index > 0 || node.hasBody) node.newline();
5202
5202
  node.do(implementHttpResourceFn({
@@ -5223,7 +5223,7 @@ function toHttpResourceNode(model, plugin) {
5223
5223
 
5224
5224
  //#endregion
5225
5225
  //#region src/plugins/@angular/common/plugin.ts
5226
- const handler$12 = ({ plugin }) => {
5226
+ const handler$13 = ({ plugin }) => {
5227
5227
  plugin.symbol("HttpRequest", {
5228
5228
  external: "@angular/common/http",
5229
5229
  kind: "type",
@@ -5265,7 +5265,7 @@ const handler$12 = ({ plugin }) => {
5265
5265
  path,
5266
5266
  shell
5267
5267
  })),
5268
- source
5268
+ source: source$1
5269
5269
  });
5270
5270
  }, { order: "declarations" });
5271
5271
  }
@@ -5279,7 +5279,7 @@ const handler$12 = ({ plugin }) => {
5279
5279
  path,
5280
5280
  shell
5281
5281
  })),
5282
- source
5282
+ source: source$1
5283
5283
  });
5284
5284
  }, { order: "declarations" });
5285
5285
  }
@@ -5303,13 +5303,13 @@ const handler$12 = ({ plugin }) => {
5303
5303
 
5304
5304
  //#endregion
5305
5305
  //#region src/plugins/@angular/common/config.ts
5306
- const defaultConfig$25 = {
5306
+ const defaultConfig$26 = {
5307
5307
  config: {
5308
5308
  comments: true,
5309
5309
  includeInEntry: false
5310
5310
  },
5311
5311
  dependencies: ["@hey-api/client-angular", "@hey-api/sdk"],
5312
- handler: handler$12,
5312
+ handler: handler$13,
5313
5313
  name: "@angular/common",
5314
5314
  resolveConfig: (plugin, context) => {
5315
5315
  plugin.config.httpRequests = resolveHttpRequests(plugin.config, context);
@@ -5319,7 +5319,7 @@ const defaultConfig$25 = {
5319
5319
  /**
5320
5320
  * Type helper for `@angular/common` plugin, returns {@link Plugin.Config} object
5321
5321
  */
5322
- const defineConfig$25 = definePluginConfig(defaultConfig$25);
5322
+ const defineConfig$26 = definePluginConfig(defaultConfig$26);
5323
5323
 
5324
5324
  //#endregion
5325
5325
  //#region src/plugins/@faker-js/faker/api.ts
@@ -5330,7 +5330,7 @@ var Api$4 = class {
5330
5330
 
5331
5331
  //#endregion
5332
5332
  //#region src/plugins/@faker-js/faker/config.ts
5333
- const defaultConfig$24 = {
5333
+ const defaultConfig$25 = {
5334
5334
  api: new Api$4(),
5335
5335
  config: {
5336
5336
  case: "camelCase",
@@ -5354,7 +5354,7 @@ const defaultConfig$24 = {
5354
5354
  /**
5355
5355
  * Type helper for Faker plugin, returns {@link Plugin.Config} object
5356
5356
  */
5357
- const defineConfig$24 = definePluginConfig(defaultConfig$24);
5357
+ const defineConfig$25 = definePluginConfig(defaultConfig$25);
5358
5358
 
5359
5359
  //#endregion
5360
5360
  //#region src/plugins/@hey-api/client-core/config.ts
@@ -5585,7 +5585,7 @@ const clientPluginHandler = ({ plugin }) => {
5585
5585
 
5586
5586
  //#endregion
5587
5587
  //#region src/plugins/@hey-api/client-angular/config.ts
5588
- const defaultConfig$23 = {
5588
+ const defaultConfig$24 = {
5589
5589
  ...clientDefaultMeta,
5590
5590
  config: {
5591
5591
  ...clientDefaultConfig,
@@ -5597,11 +5597,11 @@ const defaultConfig$23 = {
5597
5597
  /**
5598
5598
  * Type helper for `@hey-api/client-angular` plugin, returns {@link Plugin.Config} object
5599
5599
  */
5600
- const defineConfig$23 = definePluginConfig(defaultConfig$23);
5600
+ const defineConfig$24 = definePluginConfig(defaultConfig$24);
5601
5601
 
5602
5602
  //#endregion
5603
5603
  //#region src/plugins/@hey-api/client-axios/config.ts
5604
- const defaultConfig$22 = {
5604
+ const defaultConfig$23 = {
5605
5605
  ...clientDefaultMeta,
5606
5606
  config: {
5607
5607
  ...clientDefaultConfig,
@@ -5613,11 +5613,11 @@ const defaultConfig$22 = {
5613
5613
  /**
5614
5614
  * Type helper for `@hey-api/client-axios` plugin, returns {@link Plugin.Config} object
5615
5615
  */
5616
- const defineConfig$22 = definePluginConfig(defaultConfig$22);
5616
+ const defineConfig$23 = definePluginConfig(defaultConfig$23);
5617
5617
 
5618
5618
  //#endregion
5619
5619
  //#region src/plugins/@hey-api/client-fetch/config.ts
5620
- const defaultConfig$21 = {
5620
+ const defaultConfig$22 = {
5621
5621
  ...clientDefaultMeta,
5622
5622
  config: {
5623
5623
  ...clientDefaultConfig,
@@ -5629,11 +5629,11 @@ const defaultConfig$21 = {
5629
5629
  /**
5630
5630
  * Type helper for `@hey-api/client-fetch` plugin, returns {@link Plugin.Config} object
5631
5631
  */
5632
- const defineConfig$21 = definePluginConfig(defaultConfig$21);
5632
+ const defineConfig$22 = definePluginConfig(defaultConfig$22);
5633
5633
 
5634
5634
  //#endregion
5635
5635
  //#region src/plugins/@hey-api/client-ky/config.ts
5636
- const defaultConfig$20 = {
5636
+ const defaultConfig$21 = {
5637
5637
  ...clientDefaultMeta,
5638
5638
  config: {
5639
5639
  ...clientDefaultConfig,
@@ -5645,11 +5645,11 @@ const defaultConfig$20 = {
5645
5645
  /**
5646
5646
  * Type helper for `@hey-api/client-ky` plugin, returns {@link Plugin.Config} object
5647
5647
  */
5648
- const defineConfig$20 = definePluginConfig(defaultConfig$20);
5648
+ const defineConfig$21 = definePluginConfig(defaultConfig$21);
5649
5649
 
5650
5650
  //#endregion
5651
5651
  //#region src/plugins/@hey-api/client-next/config.ts
5652
- const defaultConfig$19 = {
5652
+ const defaultConfig$20 = {
5653
5653
  ...clientDefaultMeta,
5654
5654
  config: {
5655
5655
  ...clientDefaultConfig,
@@ -5661,11 +5661,11 @@ const defaultConfig$19 = {
5661
5661
  /**
5662
5662
  * Type helper for `@hey-api/client-next` plugin, returns {@link Plugin.Config} object
5663
5663
  */
5664
- const defineConfig$19 = definePluginConfig(defaultConfig$19);
5664
+ const defineConfig$20 = definePluginConfig(defaultConfig$20);
5665
5665
 
5666
5666
  //#endregion
5667
5667
  //#region src/plugins/@hey-api/client-nuxt/config.ts
5668
- const defaultConfig$18 = {
5668
+ const defaultConfig$19 = {
5669
5669
  ...clientDefaultMeta,
5670
5670
  config: clientDefaultConfig,
5671
5671
  handler: clientPluginHandler,
@@ -5674,11 +5674,11 @@ const defaultConfig$18 = {
5674
5674
  /**
5675
5675
  * Type helper for `@hey-api/client-nuxt` plugin, returns {@link Plugin.Config} object
5676
5676
  */
5677
- const defineConfig$18 = definePluginConfig(defaultConfig$18);
5677
+ const defineConfig$19 = definePluginConfig(defaultConfig$19);
5678
5678
 
5679
5679
  //#endregion
5680
5680
  //#region src/plugins/@hey-api/client-ofetch/config.ts
5681
- const defaultConfig$17 = {
5681
+ const defaultConfig$18 = {
5682
5682
  ...clientDefaultMeta,
5683
5683
  config: {
5684
5684
  ...clientDefaultConfig,
@@ -5690,7 +5690,7 @@ const defaultConfig$17 = {
5690
5690
  /**
5691
5691
  * Type helper for `@hey-api/client-ofetch` plugin, returns {@link Plugin.Config} object
5692
5692
  */
5693
- const defineConfig$17 = definePluginConfig(defaultConfig$17);
5693
+ const defineConfig$18 = definePluginConfig(defaultConfig$18);
5694
5694
 
5695
5695
  //#endregion
5696
5696
  //#region src/plugins/@hey-api/schemas/plugin.ts
@@ -5921,7 +5921,7 @@ const schemasV3_1_X = ({ context, plugin }) => {
5921
5921
  plugin.node(statement);
5922
5922
  }
5923
5923
  };
5924
- const handler$11 = ({ plugin }) => {
5924
+ const handler$12 = ({ plugin }) => {
5925
5925
  if ("swagger" in plugin.context.spec) {
5926
5926
  schemasV2_0_X({
5927
5927
  context: plugin.context,
@@ -5948,19 +5948,19 @@ const handler$11 = ({ plugin }) => {
5948
5948
 
5949
5949
  //#endregion
5950
5950
  //#region src/plugins/@hey-api/schemas/config.ts
5951
- const defaultConfig$16 = {
5951
+ const defaultConfig$17 = {
5952
5952
  config: {
5953
5953
  includeInEntry: false,
5954
5954
  nameBuilder: (name) => `${name}Schema`,
5955
5955
  type: "json"
5956
5956
  },
5957
- handler: handler$11,
5957
+ handler: handler$12,
5958
5958
  name: "@hey-api/schemas"
5959
5959
  };
5960
5960
  /**
5961
5961
  * Type helper for `@hey-api/schemas` plugin, returns {@link Plugin.Config} object
5962
5962
  */
5963
- const defineConfig$16 = definePluginConfig(defaultConfig$16);
5963
+ const defineConfig$17 = definePluginConfig(defaultConfig$17);
5964
5964
 
5965
5965
  //#endregion
5966
5966
  //#region src/plugins/@hey-api/sdk/examples/config.ts
@@ -6009,9 +6009,9 @@ function resolveOperations(config, context) {
6009
6009
  replacement: ["operations: { nesting: \"operationId\" }", "operations: { nesting: \"id\" }"]
6010
6010
  });
6011
6011
  const legacy = mapLegacyToConfig(config);
6012
- return normalizeConfig(config.operations, legacy, context);
6012
+ return normalizeConfig$1(config.operations, legacy, context);
6013
6013
  }
6014
- function normalizeConfig(input, legacy, context) {
6014
+ function normalizeConfig$1(input, legacy, context) {
6015
6015
  if (!input || typeof input === "string" || typeof input === "function") input = { strategy: input };
6016
6016
  const strategy = legacy.strategy ?? input.strategy ?? "flat";
6017
6017
  const methods = strategy === "single" ? "instance" : "static";
@@ -6112,7 +6112,7 @@ function mapLegacyToConfig(config) {
6112
6112
 
6113
6113
  //#endregion
6114
6114
  //#region src/plugins/@hey-api/sdk/operations/resolve.ts
6115
- function resolvePath(plugin) {
6115
+ function resolvePath$1(plugin) {
6116
6116
  if (plugin.config.operations.nesting === "id") return OperationPath.id();
6117
6117
  if (plugin.config.operations.nesting === "operationId") return OperationPath.fromOperationId({
6118
6118
  delimiters: plugin.config.operations.nestingDelimiters,
@@ -6120,18 +6120,18 @@ function resolvePath(plugin) {
6120
6120
  });
6121
6121
  return plugin.config.operations.nesting;
6122
6122
  }
6123
- function resolveStrategy(plugin) {
6124
- if (plugin.config.operations.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath(plugin)(operation).join(".")] });
6123
+ function resolveStrategy$1(plugin) {
6124
+ if (plugin.config.operations.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath$1(plugin)(operation).join(".")] });
6125
6125
  if (plugin.config.operations.strategy === "single") {
6126
6126
  const root = plugin.config.operations.containerName;
6127
6127
  return OperationStrategy.single({
6128
- path: resolvePath(plugin),
6128
+ path: resolvePath$1(plugin),
6129
6129
  root: typeof root.name === "string" ? root.name : root.name?.("") ?? ""
6130
6130
  });
6131
6131
  }
6132
6132
  if (plugin.config.operations.strategy === "byTags") return OperationStrategy.byTags({
6133
6133
  fallback: plugin.config.operations.strategyDefaultTag,
6134
- path: resolvePath(plugin)
6134
+ path: resolvePath$1(plugin)
6135
6135
  });
6136
6136
  return plugin.config.operations.strategy;
6137
6137
  }
@@ -6174,7 +6174,7 @@ const createTypeOptions = ({ plugin }) => {
6174
6174
 
6175
6175
  //#endregion
6176
6176
  //#region src/plugins/@hey-api/sdk/v1/plugin.ts
6177
- const handlerV1$2 = ({ plugin }) => {
6177
+ const handlerV1$3 = ({ plugin }) => {
6178
6178
  const clientModule = clientFolderAbsolutePath(getTypedConfig(plugin));
6179
6179
  const client = getClientPlugin(getTypedConfig(plugin));
6180
6180
  const isAngularClient = client.name === "@hey-api/client-angular";
@@ -6221,8 +6221,8 @@ const handlerV1$2 = ({ plugin }) => {
6221
6221
  });
6222
6222
  createTypeOptions({ plugin });
6223
6223
  const structure = new StructureModel();
6224
- const shell = createShell(plugin);
6225
- const strategy = resolveStrategy(plugin);
6224
+ const shell = createShell$1(plugin);
6225
+ const strategy = resolveStrategy$1(plugin);
6226
6226
  plugin.forEach("operation", (event) => {
6227
6227
  structure.insert({
6228
6228
  data: {
@@ -6234,13 +6234,13 @@ const handlerV1$2 = ({ plugin }) => {
6234
6234
  path,
6235
6235
  shell
6236
6236
  })),
6237
- source: source$1
6237
+ source: source$2
6238
6238
  });
6239
6239
  }, { order: "declarations" });
6240
6240
  const allDependencies = [];
6241
6241
  const allNodes = [];
6242
6242
  for (const node of structure.walk()) {
6243
- const { dependencies, nodes } = toNode$1(node, plugin);
6243
+ const { dependencies, nodes } = toNode$2(node, plugin);
6244
6244
  allDependencies.push(...dependencies ?? []);
6245
6245
  allNodes.push(...nodes);
6246
6246
  }
@@ -6252,13 +6252,13 @@ const handlerV1$2 = ({ plugin }) => {
6252
6252
 
6253
6253
  //#endregion
6254
6254
  //#region src/plugins/@hey-api/sdk/plugin.ts
6255
- const handler$10 = (args) => handlerV1$2(args);
6255
+ const handler$11 = (args) => handlerV1$3(args);
6256
6256
 
6257
6257
  //#endregion
6258
6258
  //#region src/plugins/@hey-api/sdk/config.ts
6259
6259
  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$15 = {
6260
+ 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.";
6261
+ const defaultConfig$16 = {
6262
6262
  config: {
6263
6263
  auth: true,
6264
6264
  client: true,
@@ -6271,7 +6271,7 @@ const defaultConfig$15 = {
6271
6271
  response: "body"
6272
6272
  },
6273
6273
  dependencies: ["@hey-api/typescript"],
6274
- handler: handler$10,
6274
+ handler: handler$11,
6275
6275
  name: "@hey-api/sdk",
6276
6276
  resolveConfig: (plugin, context) => {
6277
6277
  if (plugin.config.client) {
@@ -6295,7 +6295,7 @@ const defaultConfig$15 = {
6295
6295
  plugin.config.validator.request = context.pluginByTag("validator");
6296
6296
  plugin.dependencies.add(plugin.config.validator.request);
6297
6297
  } catch {
6298
- log.warn(validatorInferWarn);
6298
+ log.warn(validatorInferWarn$1);
6299
6299
  plugin.config.validator.request = false;
6300
6300
  }
6301
6301
  else plugin.dependencies.add(plugin.config.validator.request);
@@ -6304,7 +6304,7 @@ const defaultConfig$15 = {
6304
6304
  plugin.config.validator.response = context.pluginByTag("validator");
6305
6305
  plugin.dependencies.add(plugin.config.validator.response);
6306
6306
  } catch {
6307
- log.warn(validatorInferWarn);
6307
+ log.warn(validatorInferWarn$1);
6308
6308
  plugin.config.validator.response = false;
6309
6309
  }
6310
6310
  else plugin.dependencies.add(plugin.config.validator.response);
@@ -6316,7 +6316,7 @@ const defaultConfig$15 = {
6316
6316
  /**
6317
6317
  * Type helper for `@hey-api/sdk` plugin, returns {@link Plugin.Config} object
6318
6318
  */
6319
- const defineConfig$15 = definePluginConfig(defaultConfig$15);
6319
+ const defineConfig$16 = definePluginConfig(defaultConfig$16);
6320
6320
 
6321
6321
  //#endregion
6322
6322
  //#region src/plugins/@hey-api/transformers/expressions.ts
@@ -6468,7 +6468,7 @@ function processSchemaType({ dataExpression, plugin, schema }) {
6468
6468
  }
6469
6469
  return [];
6470
6470
  }
6471
- const handler$9 = ({ plugin }) => {
6471
+ const handler$10 = ({ plugin }) => {
6472
6472
  plugin.forEach("operation", ({ operation }) => {
6473
6473
  const { response } = operationResponsesMap(operation);
6474
6474
  if (!response) return;
@@ -6513,7 +6513,7 @@ const handler$9 = ({ plugin }) => {
6513
6513
 
6514
6514
  //#endregion
6515
6515
  //#region src/plugins/@hey-api/transformers/config.ts
6516
- const defaultConfig$14 = {
6516
+ const defaultConfig$15 = {
6517
6517
  config: {
6518
6518
  bigInt: true,
6519
6519
  dates: true,
@@ -6522,7 +6522,7 @@ const defaultConfig$14 = {
6522
6522
  typeTransformers: []
6523
6523
  },
6524
6524
  dependencies: ["@hey-api/typescript"],
6525
- handler: handler$9,
6525
+ handler: handler$10,
6526
6526
  name: "@hey-api/transformers",
6527
6527
  resolveConfig: (plugin) => {
6528
6528
  if (!plugin.config.transformers) plugin.config.transformers = [];
@@ -6534,7 +6534,7 @@ const defaultConfig$14 = {
6534
6534
  /**
6535
6535
  * Type helper for `@hey-api/transformers`, returns {@link Plugin.Config} object
6536
6536
  */
6537
- const defineConfig$14 = definePluginConfig(defaultConfig$14);
6537
+ const defineConfig$15 = definePluginConfig(defaultConfig$15);
6538
6538
 
6539
6539
  //#endregion
6540
6540
  //#region src/plugins/shared/utils/schema.ts
@@ -7777,7 +7777,7 @@ function webhookToType({ operation, path, plugin, tags }) {
7777
7777
 
7778
7778
  //#endregion
7779
7779
  //#region src/plugins/@hey-api/typescript/v1/plugin.ts
7780
- const handlerV1$1 = ({ plugin }) => {
7780
+ const handlerV1$2 = ({ plugin }) => {
7781
7781
  const nodeClientIndex = plugin.node(null);
7782
7782
  const nodeWebhooksIndex = plugin.node(null);
7783
7783
  const servers = [];
@@ -7869,11 +7869,11 @@ const handlerV1$1 = ({ plugin }) => {
7869
7869
 
7870
7870
  //#endregion
7871
7871
  //#region src/plugins/@hey-api/typescript/plugin.ts
7872
- const handler$8 = (args) => handlerV1$1(args);
7872
+ const handler$9 = (args) => handlerV1$2(args);
7873
7873
 
7874
7874
  //#endregion
7875
7875
  //#region src/plugins/@hey-api/typescript/config.ts
7876
- const defaultConfig$13 = {
7876
+ const defaultConfig$14 = {
7877
7877
  api: new Api$3(),
7878
7878
  config: {
7879
7879
  case: "PascalCase",
@@ -7881,7 +7881,7 @@ const defaultConfig$13 = {
7881
7881
  includeInEntry: true,
7882
7882
  topType: "unknown"
7883
7883
  },
7884
- handler: handler$8,
7884
+ handler: handler$9,
7885
7885
  name: "@hey-api/typescript",
7886
7886
  resolveConfig: (plugin, context) => {
7887
7887
  plugin.config.definitions = context.valueToObject({
@@ -7960,7 +7960,7 @@ const defaultConfig$13 = {
7960
7960
  /**
7961
7961
  * Type helper for `@hey-api/typescript` plugin, returns {@link Plugin.Config} object
7962
7962
  */
7963
- const defineConfig$13 = definePluginConfig(defaultConfig$13);
7963
+ const defineConfig$14 = definePluginConfig(defaultConfig$14);
7964
7964
 
7965
7965
  //#endregion
7966
7966
  //#region src/plugins/@pinia/colada/meta.ts
@@ -8248,18 +8248,18 @@ const handlerV0 = ({ plugin }) => {
8248
8248
 
8249
8249
  //#endregion
8250
8250
  //#region src/plugins/@pinia/colada/plugin.ts
8251
- const handler$7 = (args) => handlerV0(args);
8251
+ const handler$8 = (args) => handlerV0(args);
8252
8252
 
8253
8253
  //#endregion
8254
8254
  //#region src/plugins/@pinia/colada/config.ts
8255
- const defaultConfig$12 = {
8255
+ const defaultConfig$13 = {
8256
8256
  config: {
8257
8257
  case: "camelCase",
8258
8258
  comments: true,
8259
8259
  includeInEntry: false
8260
8260
  },
8261
8261
  dependencies: ["@hey-api/typescript", "@hey-api/sdk"],
8262
- handler: handler$7,
8262
+ handler: handler$8,
8263
8263
  name: "@pinia/colada",
8264
8264
  resolveConfig: (plugin, context) => {
8265
8265
  plugin.config.mutationOptions = context.valueToObject({
@@ -8295,7 +8295,7 @@ const defaultConfig$12 = {
8295
8295
  /**
8296
8296
  * Type helper for `@pinia/colada` plugin, returns {@link Plugin.Config} object
8297
8297
  */
8298
- const defineConfig$12 = definePluginConfig(defaultConfig$12);
8298
+ const defineConfig$13 = definePluginConfig(defaultConfig$13);
8299
8299
 
8300
8300
  //#endregion
8301
8301
  //#region src/plugins/@tanstack/query-core/shared/useType.ts
@@ -8730,18 +8730,18 @@ const handlerV5 = ({ plugin }) => {
8730
8730
 
8731
8731
  //#endregion
8732
8732
  //#region src/plugins/@tanstack/query-core/plugin.ts
8733
- const handler$6 = (args) => handlerV5(args);
8733
+ const handler$7 = (args) => handlerV5(args);
8734
8734
 
8735
8735
  //#endregion
8736
8736
  //#region src/plugins/@tanstack/angular-query-experimental/config.ts
8737
- const defaultConfig$11 = {
8737
+ const defaultConfig$12 = {
8738
8738
  config: {
8739
8739
  case: "camelCase",
8740
8740
  comments: true,
8741
8741
  includeInEntry: false
8742
8742
  },
8743
8743
  dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
8744
- handler: handler$6,
8744
+ handler: handler$7,
8745
8745
  name: "@tanstack/angular-query-experimental",
8746
8746
  resolveConfig: (plugin, context) => {
8747
8747
  plugin.config.infiniteQueryKeys = context.valueToObject({
@@ -8798,18 +8798,18 @@ const defaultConfig$11 = {
8798
8798
  /**
8799
8799
  * Type helper for `@tanstack/angular-query-experimental` plugin, returns {@link Plugin.Config} object
8800
8800
  */
8801
- const defineConfig$11 = definePluginConfig(defaultConfig$11);
8801
+ const defineConfig$12 = definePluginConfig(defaultConfig$12);
8802
8802
 
8803
8803
  //#endregion
8804
8804
  //#region src/plugins/@tanstack/preact-query/config.ts
8805
- const defaultConfig$10 = {
8805
+ const defaultConfig$11 = {
8806
8806
  config: {
8807
8807
  case: "camelCase",
8808
8808
  comments: true,
8809
8809
  includeInEntry: false
8810
8810
  },
8811
8811
  dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
8812
- handler: handler$6,
8812
+ handler: handler$7,
8813
8813
  name: "@tanstack/preact-query",
8814
8814
  resolveConfig: (plugin, context) => {
8815
8815
  plugin.config.infiniteQueryKeys = context.valueToObject({
@@ -8924,18 +8924,18 @@ const defaultConfig$10 = {
8924
8924
  /**
8925
8925
  * Type helper for `@tanstack/preact-query` plugin, returns {@link Plugin.Config} object
8926
8926
  */
8927
- const defineConfig$10 = definePluginConfig(defaultConfig$10);
8927
+ const defineConfig$11 = definePluginConfig(defaultConfig$11);
8928
8928
 
8929
8929
  //#endregion
8930
8930
  //#region src/plugins/@tanstack/react-query/config.ts
8931
- const defaultConfig$9 = {
8931
+ const defaultConfig$10 = {
8932
8932
  config: {
8933
8933
  case: "camelCase",
8934
8934
  comments: true,
8935
8935
  includeInEntry: false
8936
8936
  },
8937
8937
  dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
8938
- handler: handler$6,
8938
+ handler: handler$7,
8939
8939
  name: "@tanstack/react-query",
8940
8940
  resolveConfig: (plugin, context) => {
8941
8941
  plugin.config.infiniteQueryKeys = context.valueToObject({
@@ -9050,18 +9050,18 @@ const defaultConfig$9 = {
9050
9050
  /**
9051
9051
  * Type helper for `@tanstack/react-query` plugin, returns {@link Plugin.Config} object
9052
9052
  */
9053
- const defineConfig$9 = definePluginConfig(defaultConfig$9);
9053
+ const defineConfig$10 = definePluginConfig(defaultConfig$10);
9054
9054
 
9055
9055
  //#endregion
9056
9056
  //#region src/plugins/@tanstack/solid-query/config.ts
9057
- const defaultConfig$8 = {
9057
+ const defaultConfig$9 = {
9058
9058
  config: {
9059
9059
  case: "camelCase",
9060
9060
  comments: true,
9061
9061
  includeInEntry: false
9062
9062
  },
9063
9063
  dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
9064
- handler: handler$6,
9064
+ handler: handler$7,
9065
9065
  name: "@tanstack/solid-query",
9066
9066
  resolveConfig: (plugin, context) => {
9067
9067
  plugin.config.infiniteQueryKeys = context.valueToObject({
@@ -9118,18 +9118,18 @@ const defaultConfig$8 = {
9118
9118
  /**
9119
9119
  * Type helper for `@tanstack/solid-query` plugin, returns {@link Plugin.Config} object
9120
9120
  */
9121
- const defineConfig$8 = definePluginConfig(defaultConfig$8);
9121
+ const defineConfig$9 = definePluginConfig(defaultConfig$9);
9122
9122
 
9123
9123
  //#endregion
9124
9124
  //#region src/plugins/@tanstack/svelte-query/config.ts
9125
- const defaultConfig$7 = {
9125
+ const defaultConfig$8 = {
9126
9126
  config: {
9127
9127
  case: "camelCase",
9128
9128
  comments: true,
9129
9129
  includeInEntry: false
9130
9130
  },
9131
9131
  dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
9132
- handler: handler$6,
9132
+ handler: handler$7,
9133
9133
  name: "@tanstack/svelte-query",
9134
9134
  resolveConfig: (plugin, context) => {
9135
9135
  plugin.config.infiniteQueryKeys = context.valueToObject({
@@ -9186,18 +9186,18 @@ const defaultConfig$7 = {
9186
9186
  /**
9187
9187
  * Type helper for `@tanstack/svelte-query` plugin, returns {@link Plugin.Config} object
9188
9188
  */
9189
- const defineConfig$7 = definePluginConfig(defaultConfig$7);
9189
+ const defineConfig$8 = definePluginConfig(defaultConfig$8);
9190
9190
 
9191
9191
  //#endregion
9192
9192
  //#region src/plugins/@tanstack/vue-query/config.ts
9193
- const defaultConfig$6 = {
9193
+ const defaultConfig$7 = {
9194
9194
  config: {
9195
9195
  case: "camelCase",
9196
9196
  comments: true,
9197
9197
  includeInEntry: false
9198
9198
  },
9199
9199
  dependencies: ["@hey-api/sdk", "@hey-api/typescript"],
9200
- handler: handler$6,
9200
+ handler: handler$7,
9201
9201
  name: "@tanstack/vue-query",
9202
9202
  resolveConfig: (plugin, context) => {
9203
9203
  plugin.config.infiniteQueryKeys = context.valueToObject({
@@ -9254,7 +9254,7 @@ const defaultConfig$6 = {
9254
9254
  /**
9255
9255
  * Type helper for `@tanstack/vue-query` plugin, returns {@link Plugin.Config} object
9256
9256
  */
9257
- const defineConfig$6 = definePluginConfig(defaultConfig$6);
9257
+ const defineConfig$7 = definePluginConfig(defaultConfig$7);
9258
9258
 
9259
9259
  //#endregion
9260
9260
  //#region src/plugins/arktype/v2/api.ts
@@ -9669,11 +9669,11 @@ const handlerV2$1 = ({ plugin }) => {
9669
9669
 
9670
9670
  //#endregion
9671
9671
  //#region src/plugins/arktype/plugin.ts
9672
- const handler$5 = (args) => handlerV2$1(args);
9672
+ const handler$6 = (args) => handlerV2$1(args);
9673
9673
 
9674
9674
  //#endregion
9675
9675
  //#region src/plugins/arktype/config.ts
9676
- const defaultConfig$5 = {
9676
+ const defaultConfig$6 = {
9677
9677
  api: new Api$2(),
9678
9678
  config: {
9679
9679
  case: "PascalCase",
@@ -9681,7 +9681,7 @@ const defaultConfig$5 = {
9681
9681
  includeInEntry: false,
9682
9682
  metadata: false
9683
9683
  },
9684
- handler: handler$5,
9684
+ handler: handler$6,
9685
9685
  name: "arktype",
9686
9686
  resolveConfig: (plugin, context) => {
9687
9687
  plugin.config.types = context.valueToObject({
@@ -9852,7 +9852,7 @@ const defaultConfig$5 = {
9852
9852
  /**
9853
9853
  * Type helper for Arktype plugin, returns {@link Plugin.Config} object
9854
9854
  */
9855
- const defineConfig$5 = definePluginConfig(defaultConfig$5);
9855
+ const defineConfig$6 = definePluginConfig(defaultConfig$6);
9856
9856
 
9857
9857
  //#endregion
9858
9858
  //#region src/plugins/fastify/plugin.ts
@@ -9915,7 +9915,7 @@ const operationToRouteHandler = ({ operation, plugin }) => {
9915
9915
  type: $.type(symbolRouteHandler, (t) => t.generic(type))
9916
9916
  };
9917
9917
  };
9918
- const handler$4 = ({ plugin }) => {
9918
+ const handler$5 = ({ plugin }) => {
9919
9919
  plugin.symbol("RouteHandler", {
9920
9920
  external: "fastify",
9921
9921
  kind: "type",
@@ -9940,16 +9940,16 @@ const handler$4 = ({ plugin }) => {
9940
9940
 
9941
9941
  //#endregion
9942
9942
  //#region src/plugins/fastify/config.ts
9943
- const defaultConfig$4 = {
9943
+ const defaultConfig$5 = {
9944
9944
  config: { includeInEntry: false },
9945
9945
  dependencies: ["@hey-api/typescript"],
9946
- handler: handler$4,
9946
+ handler: handler$5,
9947
9947
  name: "fastify"
9948
9948
  };
9949
9949
  /**
9950
9950
  * Type helper for `fastify` plugin, returns {@link Plugin.Config} object
9951
9951
  */
9952
- const defineConfig$4 = definePluginConfig(defaultConfig$4);
9952
+ const defineConfig$5 = definePluginConfig(defaultConfig$5);
9953
9953
 
9954
9954
  //#endregion
9955
9955
  //#region src/plugins/nestjs/plugin.ts
@@ -10004,7 +10004,7 @@ const emitTypeAlias = ({ methods, plugin, typeName }) => {
10004
10004
  for (const method of methods) type.prop(method.name, (p) => p.type(method.type));
10005
10005
  plugin.node($.type.alias(symbol).export().type(type));
10006
10006
  };
10007
- const handler$3 = ({ plugin }) => {
10007
+ const handler$4 = ({ plugin }) => {
10008
10008
  const operationsByTag = /* @__PURE__ */ new Map();
10009
10009
  plugin.forEach("operation", ({ operation, tags }) => {
10010
10010
  const tag = tags?.[0] ?? "default";
@@ -10024,15 +10024,309 @@ const handler$3 = ({ plugin }) => {
10024
10024
 
10025
10025
  //#endregion
10026
10026
  //#region src/plugins/nestjs/config.ts
10027
- const defaultConfig$3 = {
10027
+ const defaultConfig$4 = {
10028
10028
  config: { includeInEntry: false },
10029
10029
  dependencies: ["@hey-api/typescript"],
10030
- handler: handler$3,
10030
+ handler: handler$4,
10031
10031
  name: "nestjs"
10032
10032
  };
10033
10033
  /**
10034
10034
  * Type helper for `nestjs` plugin, returns {@link Plugin.Config} object
10035
10035
  */
10036
+ const defineConfig$4 = definePluginConfig(defaultConfig$4);
10037
+
10038
+ //#endregion
10039
+ //#region src/plugins/orpc/contracts/config.ts
10040
+ function resolveContracts(config, context) {
10041
+ return normalizeConfig(config.contracts, context);
10042
+ }
10043
+ function normalizeConfig(input, context) {
10044
+ if (!input || typeof input === "string" || typeof input === "function") input = { strategy: input };
10045
+ const strategy = input.strategy ?? "single";
10046
+ return context.valueToObject({
10047
+ defaultValue: {
10048
+ container: "object",
10049
+ nesting: "operationId",
10050
+ nestingDelimiters: /[./]/,
10051
+ strategy,
10052
+ strategyDefaultTag: "default"
10053
+ },
10054
+ mappers: { object(value) {
10055
+ value.containerName = context.valueToObject({
10056
+ defaultValue: strategy === "single" ? {
10057
+ casing: "camelCase",
10058
+ name: "contract"
10059
+ } : { casing: "camelCase" },
10060
+ mappers: {
10061
+ function: (name) => ({ name }),
10062
+ string: (name) => ({ name })
10063
+ },
10064
+ value: value.containerName
10065
+ });
10066
+ value.contractName = context.valueToObject({
10067
+ defaultValue: { casing: "camelCase" },
10068
+ mappers: {
10069
+ function: (name) => ({ name }),
10070
+ string: (name) => ({ name })
10071
+ },
10072
+ value: value.contractName
10073
+ });
10074
+ value.segmentName = context.valueToObject({
10075
+ defaultValue: { casing: "camelCase" },
10076
+ mappers: {
10077
+ function: (name) => ({ name }),
10078
+ string: (name) => ({ name })
10079
+ },
10080
+ value: value.segmentName
10081
+ });
10082
+ return value;
10083
+ } },
10084
+ value: input
10085
+ });
10086
+ }
10087
+
10088
+ //#endregion
10089
+ //#region src/plugins/orpc/shared/operation.ts
10090
+ function hasInput(operation) {
10091
+ const hasPathParams = Boolean(operation.parameters?.path && Object.keys(operation.parameters.path).length > 0);
10092
+ const hasQueryParams = Boolean(operation.parameters?.query && Object.keys(operation.parameters.query).length > 0);
10093
+ const hasHeaderParams = Boolean(operation.parameters?.header && Object.keys(operation.parameters.header).length > 0);
10094
+ const hasBody = Boolean(operation.body);
10095
+ return hasPathParams || hasQueryParams || hasHeaderParams || hasBody;
10096
+ }
10097
+ function getSuccessResponse(operation) {
10098
+ if (operation.responses) for (const [statusCode, response] of Object.entries(operation.responses)) {
10099
+ const statusCodeNumber = Number.parseInt(statusCode, 10);
10100
+ if (statusCodeNumber >= 200 && statusCodeNumber <= 399 && response?.mediaType && response?.schema) return {
10101
+ hasOutput: true,
10102
+ statusCode: statusCodeNumber
10103
+ };
10104
+ }
10105
+ return {
10106
+ hasOutput: false,
10107
+ statusCode: void 0
10108
+ };
10109
+ }
10110
+ function getTags(operation, defaultTag) {
10111
+ return operation.tags && operation.tags.length > 0 ? [...operation.tags] : [defaultTag];
10112
+ }
10113
+
10114
+ //#endregion
10115
+ //#region src/plugins/orpc/contracts/node.ts
10116
+ const source = globalThis.Symbol("orpc");
10117
+ function createShellMeta(node) {
10118
+ return {
10119
+ category: "contract",
10120
+ resource: "container",
10121
+ resourceId: node.getPath().join("."),
10122
+ tool: "orpc"
10123
+ };
10124
+ }
10125
+ function createContractSymbol(plugin, item) {
10126
+ const { operation, path, tags } = item.data;
10127
+ const name = item.location[item.location.length - 1];
10128
+ return plugin.symbol(applyNaming(name, plugin.config.contracts.contractName), { meta: {
10129
+ category: "contract",
10130
+ path,
10131
+ resource: "operation",
10132
+ resourceId: operation.id,
10133
+ role: "contract",
10134
+ tags,
10135
+ tool: plugin.name
10136
+ } });
10137
+ }
10138
+ function createContractExpression(plugin, operation, baseSymbol) {
10139
+ const successResponse = getSuccessResponse(operation);
10140
+ const tags = getTags(operation, plugin.config.contracts.strategyDefaultTag);
10141
+ let expression = $(baseSymbol).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("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(tags.length > 0 && tags, (o, v) => o.prop("tags", $.fromValue(v))));
10142
+ if (hasInput(operation) && plugin.config.validator.input) expression = expression.attr("input").call(plugin.referenceSymbol({
10143
+ category: "schema",
10144
+ resource: "operation",
10145
+ resourceId: operation.id,
10146
+ role: "data",
10147
+ tool: plugin.config.validator.input
10148
+ }));
10149
+ if (successResponse.hasOutput && plugin.config.validator.output) expression = expression.attr("output").call(plugin.referenceSymbol({
10150
+ category: "schema",
10151
+ resource: "operation",
10152
+ resourceId: operation.id,
10153
+ role: "responses",
10154
+ tool: plugin.config.validator.output
10155
+ }));
10156
+ return expression;
10157
+ }
10158
+ function buildContainerObject(node, plugin, symbols) {
10159
+ const obj = $.object();
10160
+ for (const item of node.itemsFrom(source)) {
10161
+ const { operation } = item.data;
10162
+ const contractSymbol = symbols.get(operation.id);
10163
+ const name = item.location[item.location.length - 1];
10164
+ const propName = applyNaming(name, plugin.config.contracts.contractName);
10165
+ obj.prop(propName, contractSymbol);
10166
+ }
10167
+ for (const child of node.children.values()) if (child.shell) {
10168
+ const childSymbol = child.shell.define(child).node.symbol;
10169
+ if (childSymbol) {
10170
+ const propName = applyNaming(child.name, plugin.config.contracts.segmentName);
10171
+ obj.prop(propName, childSymbol);
10172
+ }
10173
+ }
10174
+ return obj;
10175
+ }
10176
+ function createShell(plugin) {
10177
+ const cache = /* @__PURE__ */ new Map();
10178
+ return { define: (node) => {
10179
+ const resourceId = node.getPath().join(".");
10180
+ const cached = cache.get(resourceId);
10181
+ if (cached) return {
10182
+ dependencies: [],
10183
+ node: cached
10184
+ };
10185
+ const symbol = plugin.symbol(applyNaming(node.name, node.isRoot ? plugin.config.contracts.containerName : plugin.config.contracts.segmentName), { meta: createShellMeta(node) });
10186
+ const o = $.const(symbol).export().assign($.object());
10187
+ cache.set(resourceId, o);
10188
+ return {
10189
+ dependencies: [],
10190
+ node: o
10191
+ };
10192
+ } };
10193
+ }
10194
+ function toNode$1(model, plugin, baseSymbol) {
10195
+ if (model.virtual) {
10196
+ const nodes = [];
10197
+ const symbols = /* @__PURE__ */ new Map();
10198
+ for (const item of model.itemsFrom(source)) {
10199
+ const { operation } = item.data;
10200
+ const contractSymbol = createContractSymbol(plugin, item);
10201
+ const expression = createContractExpression(plugin, operation, baseSymbol);
10202
+ const node = $.const(contractSymbol).export().$if(createOperationComment(operation), (n, v) => n.doc(v)).assign(expression);
10203
+ nodes.push(node);
10204
+ symbols.set(operation.id, contractSymbol);
10205
+ }
10206
+ return {
10207
+ nodes,
10208
+ symbols
10209
+ };
10210
+ }
10211
+ if (!model.shell) return { nodes: [] };
10212
+ const nodes = [];
10213
+ const symbols = /* @__PURE__ */ new Map();
10214
+ for (const item of model.itemsFrom(source)) {
10215
+ const { operation } = item.data;
10216
+ const contractSymbol = createContractSymbol(plugin, item);
10217
+ const expression = createContractExpression(plugin, operation, baseSymbol);
10218
+ const node = $.const(contractSymbol).export().$if(createOperationComment(operation), (n, v) => n.doc(v)).assign(expression);
10219
+ nodes.push(node);
10220
+ symbols.set(operation.id, contractSymbol);
10221
+ }
10222
+ const containerSymbol = model.shell.define(model).node.symbol;
10223
+ const obj = buildContainerObject(model, plugin, symbols);
10224
+ const containerNode = $.const(containerSymbol).export().assign(obj.pretty());
10225
+ nodes.push(containerNode);
10226
+ return {
10227
+ nodes,
10228
+ symbols
10229
+ };
10230
+ }
10231
+
10232
+ //#endregion
10233
+ //#region src/plugins/orpc/contracts/resolve.ts
10234
+ function resolvePath(plugin) {
10235
+ if (plugin.config.contracts.nesting === "id") return OperationPath.id();
10236
+ if (plugin.config.contracts.nesting === "operationId") return OperationPath.fromOperationId({
10237
+ delimiters: plugin.config.contracts.nestingDelimiters,
10238
+ fallback: OperationPath.id()
10239
+ });
10240
+ return plugin.config.contracts.nesting;
10241
+ }
10242
+ function resolveStrategy(plugin) {
10243
+ if (plugin.config.contracts.strategy === "flat") return OperationStrategy.flat({ path: (operation) => [resolvePath(plugin)(operation).join(".")] });
10244
+ if (plugin.config.contracts.strategy === "single") {
10245
+ const root = plugin.config.contracts.containerName;
10246
+ return OperationStrategy.single({
10247
+ path: resolvePath(plugin),
10248
+ root: typeof root.name === "string" ? root.name : root.name?.("") ?? ""
10249
+ });
10250
+ }
10251
+ if (plugin.config.contracts.strategy === "byTags") return OperationStrategy.byTags({
10252
+ fallback: plugin.config.contracts.strategyDefaultTag,
10253
+ path: resolvePath(plugin)
10254
+ });
10255
+ return plugin.config.contracts.strategy;
10256
+ }
10257
+
10258
+ //#endregion
10259
+ //#region src/plugins/orpc/v1/plugin.ts
10260
+ const handlerV1$1 = ({ plugin }) => {
10261
+ const oc = plugin.symbol("oc", { external: "@orpc/contract" });
10262
+ const baseSymbol = plugin.symbol("base");
10263
+ const baseNode = $.const(baseSymbol).export().assign($(oc).attr("$route").call($.object().prop("inputStructure", $.literal("detailed"))));
10264
+ plugin.node(baseNode);
10265
+ const structure = new StructureModel();
10266
+ const shell = createShell(plugin);
10267
+ const strategy = resolveStrategy(plugin);
10268
+ plugin.forEach("operation", (event) => {
10269
+ structure.insert({
10270
+ data: {
10271
+ operation: event.operation,
10272
+ path: event._path,
10273
+ tags: event.tags
10274
+ },
10275
+ locations: strategy(event.operation).map((path) => ({
10276
+ path,
10277
+ shell
10278
+ })),
10279
+ source
10280
+ });
10281
+ }, { order: "declarations" });
10282
+ const allNodes = [];
10283
+ for (const node of structure.walk()) {
10284
+ const { nodes } = toNode$1(node, plugin, baseSymbol);
10285
+ allNodes.push(...nodes);
10286
+ }
10287
+ for (const node of allNodes) plugin.node(node);
10288
+ };
10289
+
10290
+ //#endregion
10291
+ //#region src/plugins/orpc/plugin.ts
10292
+ const handler$3 = (args) => handlerV1$1(args);
10293
+
10294
+ //#endregion
10295
+ //#region src/plugins/orpc/config.ts
10296
+ 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.";
10297
+ const defaultConfig$3 = {
10298
+ config: { includeInEntry: false },
10299
+ handler: handler$3,
10300
+ name: "orpc",
10301
+ resolveConfig: (plugin, context) => {
10302
+ if (typeof plugin.config.validator !== "object") plugin.config.validator = {
10303
+ input: plugin.config.validator,
10304
+ output: plugin.config.validator
10305
+ };
10306
+ 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 {
10307
+ plugin.config.validator.input = context.pluginByTag("validator");
10308
+ plugin.dependencies.add(plugin.config.validator.input);
10309
+ } catch {
10310
+ if (plugin.config.validator.input !== void 0) log.warn(validatorInferWarn);
10311
+ plugin.config.validator.input = false;
10312
+ }
10313
+ else plugin.dependencies.add(plugin.config.validator.input);
10314
+ else plugin.config.validator.input = false;
10315
+ 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 {
10316
+ plugin.config.validator.output = context.pluginByTag("validator");
10317
+ plugin.dependencies.add(plugin.config.validator.output);
10318
+ } catch {
10319
+ if (plugin.config.validator.output !== void 0) log.warn(validatorInferWarn);
10320
+ plugin.config.validator.output = false;
10321
+ }
10322
+ else plugin.dependencies.add(plugin.config.validator.output);
10323
+ else plugin.config.validator.output = false;
10324
+ plugin.config.contracts = resolveContracts(plugin.config, context);
10325
+ }
10326
+ };
10327
+ /**
10328
+ * Type helper for oRPC plugin, returns {@link Plugin.Config} object
10329
+ */
10036
10330
  const defineConfig$3 = definePluginConfig(defaultConfig$3);
10037
10331
 
10038
10332
  //#endregion
@@ -15719,29 +16013,30 @@ const defineConfig = definePluginConfig(defaultConfig);
15719
16013
  //#endregion
15720
16014
  //#region src/plugins/config.ts
15721
16015
  const defaultPluginConfigs = {
15722
- "@angular/common": defaultConfig$25,
15723
- "@faker-js/faker": defaultConfig$24,
15724
- "@hey-api/client-angular": defaultConfig$23,
15725
- "@hey-api/client-axios": defaultConfig$22,
15726
- "@hey-api/client-fetch": defaultConfig$21,
15727
- "@hey-api/client-ky": defaultConfig$20,
15728
- "@hey-api/client-next": defaultConfig$19,
15729
- "@hey-api/client-nuxt": defaultConfig$18,
15730
- "@hey-api/client-ofetch": defaultConfig$17,
15731
- "@hey-api/schemas": defaultConfig$16,
15732
- "@hey-api/sdk": defaultConfig$15,
15733
- "@hey-api/transformers": defaultConfig$14,
15734
- "@hey-api/typescript": defaultConfig$13,
15735
- "@pinia/colada": defaultConfig$12,
15736
- "@tanstack/angular-query-experimental": defaultConfig$11,
15737
- "@tanstack/preact-query": defaultConfig$10,
15738
- "@tanstack/react-query": defaultConfig$9,
15739
- "@tanstack/solid-query": defaultConfig$8,
15740
- "@tanstack/svelte-query": defaultConfig$7,
15741
- "@tanstack/vue-query": defaultConfig$6,
15742
- arktype: defaultConfig$5,
15743
- fastify: defaultConfig$4,
15744
- nestjs: defaultConfig$3,
16016
+ "@angular/common": defaultConfig$26,
16017
+ "@faker-js/faker": defaultConfig$25,
16018
+ "@hey-api/client-angular": defaultConfig$24,
16019
+ "@hey-api/client-axios": defaultConfig$23,
16020
+ "@hey-api/client-fetch": defaultConfig$22,
16021
+ "@hey-api/client-ky": defaultConfig$21,
16022
+ "@hey-api/client-next": defaultConfig$20,
16023
+ "@hey-api/client-nuxt": defaultConfig$19,
16024
+ "@hey-api/client-ofetch": defaultConfig$18,
16025
+ "@hey-api/schemas": defaultConfig$17,
16026
+ "@hey-api/sdk": defaultConfig$16,
16027
+ "@hey-api/transformers": defaultConfig$15,
16028
+ "@hey-api/typescript": defaultConfig$14,
16029
+ "@pinia/colada": defaultConfig$13,
16030
+ "@tanstack/angular-query-experimental": defaultConfig$12,
16031
+ "@tanstack/preact-query": defaultConfig$11,
16032
+ "@tanstack/react-query": defaultConfig$10,
16033
+ "@tanstack/solid-query": defaultConfig$9,
16034
+ "@tanstack/svelte-query": defaultConfig$8,
16035
+ "@tanstack/vue-query": defaultConfig$7,
16036
+ arktype: defaultConfig$6,
16037
+ fastify: defaultConfig$5,
16038
+ nestjs: defaultConfig$4,
16039
+ orpc: defaultConfig$3,
15745
16040
  swr: defaultConfig$2,
15746
16041
  valibot: defaultConfig$1,
15747
16042
  zod: defaultConfig
@@ -15926,4 +16221,4 @@ async function resolveJobs({ logger, userConfigs }) {
15926
16221
 
15927
16222
  //#endregion
15928
16223
  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-OaZZcRie.mjs.map
16224
+ //# sourceMappingURL=init-B4xCXgH4.mjs.map