swagger-typescript-api 13.6.6 → 13.6.7

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/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require("./src-BROE-dEG.cjs");
2
+ const require_src = require("./src-CUhSthD5.cjs");
3
3
  let node_path = require("node:path");
4
4
  node_path = require_src.__toESM(node_path);
5
5
  let c12 = require("c12");
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { d as version, l as description, n as generateTemplates, o as CodeGenConfig, r as TemplatesGenConfig, s as HTTP_CLIENT, t as generateApi, u as name } from "./src-B-lBUhqS.mjs";
2
+ import { d as version, l as description, n as generateTemplates, o as CodeGenConfig, r as TemplatesGenConfig, s as HTTP_CLIENT, t as generateApi, u as name } from "./src--O_oZouc.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import { loadConfig } from "c12";
5
5
  import { defineCommand, runMain } from "citty";
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-BROE-dEG.cjs");
2
+ const require_src = require("./src-CUhSthD5.cjs");
3
3
  exports.RequestContentKind = require_src.RequestContentKind;
4
4
  exports.SCHEMA_TYPES = require_src.SCHEMA_TYPES;
5
5
  Object.defineProperty(exports, "constants", {
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as SCHEMA_TYPES, c as constants_exports, i as RequestContentKind, n as generateTemplates, t as generateApi } from "./src-B-lBUhqS.mjs";
1
+ import { a as SCHEMA_TYPES, c as constants_exports, i as RequestContentKind, n as generateTemplates, t as generateApi } from "./src--O_oZouc.mjs";
2
2
  export { RequestContentKind, SCHEMA_TYPES, constants_exports as constants, generateApi, generateTemplates };
@@ -143,12 +143,6 @@ var NameResolver = class {
143
143
  }
144
144
  };
145
145
  //#endregion
146
- //#region src/util/random.ts
147
- const getRandomInt = (min = 0, max = 1) => {
148
- if (min === max) return min;
149
- return Math.round(Math.random() * (max - min) + min);
150
- };
151
- //#endregion
152
146
  //#region src/component-type-name-resolver.ts
153
147
  var ComponentTypeNameResolver = class extends NameResolver {
154
148
  counter = 1;
@@ -156,12 +150,12 @@ var ComponentTypeNameResolver = class extends NameResolver {
156
150
  countersByVariant = /* @__PURE__ */ new Map();
157
151
  constructor(config, reservedNames) {
158
152
  super(config, reservedNames, (variants) => {
159
- const randomVariant = variants[getRandomInt(0, variants.length - 1)];
160
- if (randomVariant) {
161
- if (!this.countersByVariant.has(randomVariant)) this.countersByVariant.set(randomVariant, 0);
162
- const variantCounter = this.countersByVariant.get(randomVariant) + 1;
163
- this.countersByVariant.set(randomVariant, variantCounter);
164
- const dirtyResolvedName = `${randomVariant}${variantCounter}`;
153
+ const baseVariant = uniq(compact(variants)).sort((a, b) => a.localeCompare(b))[0];
154
+ if (baseVariant) {
155
+ if (!this.countersByVariant.has(baseVariant)) this.countersByVariant.set(baseVariant, 0);
156
+ const variantCounter = this.countersByVariant.get(baseVariant) + 1;
157
+ this.countersByVariant.set(baseVariant, variantCounter);
158
+ const dirtyResolvedName = `${baseVariant}${variantCounter}`;
165
159
  consola$1.debug("generated dirty resolved type name for component - ", dirtyResolvedName);
166
160
  return dirtyResolvedName;
167
161
  }
@@ -174,7 +168,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
174
168
  //#endregion
175
169
  //#region package.json
176
170
  var name = "swagger-typescript-api";
177
- var version = "13.6.6";
171
+ var version = "13.6.7";
178
172
  var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
179
173
  //#endregion
180
174
  //#region src/constants.ts
@@ -3596,4 +3590,4 @@ async function generateApi(config) {
3596
3590
  //#endregion
3597
3591
  export { SCHEMA_TYPES as a, constants_exports as c, version as d, RequestContentKind as i, description as l, generateTemplates as n, CodeGenConfig as o, TemplatesGenConfig as r, HTTP_CLIENT as s, generateApi as t, name as u };
3598
3592
 
3599
- //# sourceMappingURL=src-B-lBUhqS.mjs.map
3593
+ //# sourceMappingURL=src--O_oZouc.mjs.map