swagger-client 3.35.1 → 3.35.2

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.
@@ -7117,21 +7117,18 @@ var ShortUniqueId = (() => {
7117
7117
  return to;
7118
7118
  };
7119
7119
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
7120
- var __publicField = (obj, key, value) => {
7121
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7122
- return value;
7123
- };
7120
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7124
7121
 
7125
7122
  // src/index.ts
7126
- var src_exports = {};
7127
- __export(src_exports, {
7123
+ var index_exports = {};
7124
+ __export(index_exports, {
7128
7125
  DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
7129
7126
  DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
7130
7127
  default: () => ShortUniqueId
7131
7128
  });
7132
7129
 
7133
7130
  // package.json
7134
- var version = "5.2.0";
7131
+ var version = "5.3.2";
7135
7132
 
7136
7133
  // src/index.ts
7137
7134
  var DEFAULT_UUID_LENGTH = 6;
@@ -7204,10 +7201,11 @@ var ShortUniqueId = (() => {
7204
7201
  /* tslint:disable consistent-return */
7205
7202
  __publicField(this, "log", (...args) => {
7206
7203
  const finalArgs = [...args];
7207
- finalArgs[0] = `[short-unique-id] ${args[0]}`;
7204
+ finalArgs[0] = "[short-unique-id] ".concat(args[0]);
7208
7205
  if (this.debug === true) {
7209
7206
  if (typeof console !== "undefined" && console !== null) {
7210
- return console.log(...finalArgs);
7207
+ console.log(...finalArgs);
7208
+ return;
7211
7209
  }
7212
7210
  }
7213
7211
  });
@@ -7218,23 +7216,43 @@ var ShortUniqueId = (() => {
7218
7216
  finalDict = dictionary;
7219
7217
  } else {
7220
7218
  finalDict = [];
7221
- let i;
7222
- this.dictIndex = i = 0;
7223
- const rangesName = `_${dictionary}_dict_ranges`;
7219
+ this.dictIndex = 0;
7220
+ const rangesName = "_".concat(dictionary, "_dict_ranges");
7224
7221
  const ranges = this._dict_ranges[rangesName];
7225
- Object.keys(ranges).forEach((rangeType) => {
7226
- const rangeTypeKey = rangeType;
7227
- this.dictRange = ranges[rangeTypeKey];
7222
+ let capacity = 0;
7223
+ for (const [, rangeValue] of Object.entries(ranges)) {
7224
+ const [lower, upper] = rangeValue;
7225
+ capacity += Math.abs(upper - lower);
7226
+ }
7227
+ finalDict = new Array(capacity);
7228
+ let dictIdx = 0;
7229
+ for (const [, rangeTypeValue] of Object.entries(ranges)) {
7230
+ this.dictRange = rangeTypeValue;
7228
7231
  this.lowerBound = this.dictRange[0];
7229
7232
  this.upperBound = this.dictRange[1];
7230
- for (this.dictIndex = i = this.lowerBound; this.lowerBound <= this.upperBound ? i < this.upperBound : i > this.upperBound; this.dictIndex = this.lowerBound <= this.upperBound ? i += 1 : i -= 1) {
7231
- finalDict.push(String.fromCharCode(this.dictIndex));
7233
+ const isAscending = this.lowerBound <= this.upperBound;
7234
+ const start = this.lowerBound;
7235
+ const end = this.upperBound;
7236
+ if (isAscending) {
7237
+ for (let i = start; i < end; i++) {
7238
+ finalDict[dictIdx++] = String.fromCharCode(i);
7239
+ this.dictIndex = i;
7240
+ }
7241
+ } else {
7242
+ for (let i = start; i > end; i--) {
7243
+ finalDict[dictIdx++] = String.fromCharCode(i);
7244
+ this.dictIndex = i;
7245
+ }
7232
7246
  }
7233
- });
7247
+ }
7248
+ finalDict.length = dictIdx;
7234
7249
  }
7235
7250
  if (shuffle) {
7236
- const PROBABILITY = 0.5;
7237
- finalDict = finalDict.sort(() => Math.random() - PROBABILITY);
7251
+ const len = finalDict.length;
7252
+ for (let i = len - 1; i > 0; i--) {
7253
+ const j = Math.floor(Math.random() * (i + 1));
7254
+ [finalDict[i], finalDict[j]] = [finalDict[j], finalDict[i]];
7255
+ }
7238
7256
  }
7239
7257
  return finalDict;
7240
7258
  });
@@ -7252,15 +7270,16 @@ var ShortUniqueId = (() => {
7252
7270
  * @alias `const uid = new ShortUniqueId(); uid.seq();`
7253
7271
  */
7254
7272
  __publicField(this, "sequentialUUID", () => {
7255
- let counterDiv;
7256
- let counterRem;
7257
- let id = "";
7258
- counterDiv = this.counter;
7273
+ const dictLen = this.dictLength;
7274
+ const dict = this.dict;
7275
+ let counterDiv = this.counter;
7276
+ const idParts = [];
7259
7277
  do {
7260
- counterRem = counterDiv % this.dictLength;
7261
- counterDiv = Math.trunc(counterDiv / this.dictLength);
7262
- id += this.dict[counterRem];
7278
+ const counterRem = counterDiv % dictLen;
7279
+ counterDiv = Math.trunc(counterDiv / dictLen);
7280
+ idParts.push(dict[counterRem]);
7263
7281
  } while (counterDiv !== 0);
7282
+ const id = idParts.join("");
7264
7283
  this.counter += 1;
7265
7284
  return id;
7266
7285
  });
@@ -7272,22 +7291,17 @@ var ShortUniqueId = (() => {
7272
7291
  * @alias `const uid = new ShortUniqueId(); uid.rnd(uuidLength: number);`
7273
7292
  */
7274
7293
  __publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
7275
- let id;
7276
- let randomPartIdx;
7277
- let j;
7278
7294
  if (uuidLength === null || typeof uuidLength === "undefined" || uuidLength < 1) {
7279
7295
  throw new Error("Invalid UUID Length Provided");
7280
7296
  }
7281
- const isPositive = uuidLength >= 0;
7282
- id = "";
7283
- for (j = 0; j < uuidLength; j += 1) {
7284
- randomPartIdx = parseInt(
7285
- (Math.random() * this.dictLength).toFixed(0),
7286
- 10
7287
- ) % this.dictLength;
7288
- id += this.dict[randomPartIdx];
7297
+ const result = new Array(uuidLength);
7298
+ const dictLen = this.dictLength;
7299
+ const dict = this.dict;
7300
+ for (let j = 0; j < uuidLength; j++) {
7301
+ const randomPartIdx = Math.floor(Math.random() * dictLen);
7302
+ result[j] = dict[randomPartIdx];
7289
7303
  }
7290
- return id;
7304
+ return result.join("");
7291
7305
  });
7292
7306
  __publicField(this, "fmt", (format, date) => {
7293
7307
  return this.formattedUUID(format, date);
@@ -7298,24 +7312,21 @@ var ShortUniqueId = (() => {
7298
7312
  */
7299
7313
  __publicField(this, "formattedUUID", (format, date) => {
7300
7314
  const fnMap = {
7301
- "$r": this.randomUUID,
7302
- "$s": this.sequentialUUID,
7303
- "$t": this.stamp
7315
+ $r: this.randomUUID,
7316
+ $s: this.sequentialUUID,
7317
+ $t: this.stamp
7304
7318
  };
7305
- const result = format.replace(
7306
- /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
7307
- (m) => {
7308
- const fn = m.slice(0, 2);
7309
- const len = parseInt(m.slice(2), 10);
7310
- if (fn === "$s") {
7311
- return fnMap[fn]().padStart(len, "0");
7312
- }
7313
- if (fn === "$t" && date) {
7314
- return fnMap[fn](len, date);
7315
- }
7316
- return fnMap[fn](len);
7319
+ const result = format.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g, (m) => {
7320
+ const fn = m.slice(0, 2);
7321
+ const len = Number.parseInt(m.slice(2), 10);
7322
+ if (fn === "$s") {
7323
+ return fnMap[fn]().padStart(len, "0");
7317
7324
  }
7318
- );
7325
+ if (fn === "$t" && date) {
7326
+ return fnMap[fn](len, date);
7327
+ }
7328
+ return fnMap[fn](len);
7329
+ });
7319
7330
  return result;
7320
7331
  });
7321
7332
  /**
@@ -7336,9 +7347,7 @@ var ShortUniqueId = (() => {
7336
7347
  * This function returns `H`.
7337
7348
  */
7338
7349
  __publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
7339
- return parseFloat(
7340
- Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
7341
- );
7350
+ return Number.parseFloat(([...new Set(this.dict)].length ** uuidLength).toFixed(0));
7342
7351
  });
7343
7352
  /**
7344
7353
  * Calculates approximate number of hashes before first collision.
@@ -7358,13 +7367,20 @@ var ShortUniqueId = (() => {
7358
7367
  * </div>
7359
7368
  *
7360
7369
  * This function returns `Q(H)`.
7361
- *
7370
+ *
7362
7371
  * (see [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution))
7363
7372
  */
7373
+ // Cache for memoization
7374
+ __publicField(this, "_collisionCache", /* @__PURE__ */ new Map());
7364
7375
  __publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
7365
- return parseFloat(
7366
- Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
7367
- );
7376
+ const cacheKey = rounds;
7377
+ const cached = this._collisionCache.get(cacheKey);
7378
+ if (cached !== void 0) {
7379
+ return cached;
7380
+ }
7381
+ const result = Number.parseFloat(Math.sqrt(Math.PI / 2 * rounds).toFixed(20));
7382
+ this._collisionCache.set(cacheKey, result);
7383
+ return result;
7368
7384
  });
7369
7385
  /**
7370
7386
  * Calculates probability of generating duplicate UUIDs (a collision) in a
@@ -7385,14 +7401,14 @@ var ShortUniqueId = (() => {
7385
7401
  * </div>
7386
7402
  *
7387
7403
  * This function returns `p(r; H)`.
7388
- *
7404
+ *
7389
7405
  * (see [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution))
7390
7406
  *
7391
7407
  * (Useful if you are wondering _"If I use this lib and expect to perform at most
7392
7408
  * `r` rounds of UUID generations, what is the probability that I will hit a duplicate UUID?"_.)
7393
7409
  */
7394
7410
  __publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
7395
- return parseFloat(
7411
+ return Number.parseFloat(
7396
7412
  (this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
7397
7413
  );
7398
7414
  });
@@ -7419,7 +7435,7 @@ var ShortUniqueId = (() => {
7419
7435
  * and UUID length. The closer to 1, higher the uniqueness and thus better the quality.)
7420
7436
  */
7421
7437
  __publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
7422
- const score = parseFloat(
7438
+ const score = Number.parseFloat(
7423
7439
  (1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
7424
7440
  );
7425
7441
  return score > 1 ? 1 : score < 0 ? 0 : score;
@@ -7432,12 +7448,12 @@ var ShortUniqueId = (() => {
7432
7448
  });
7433
7449
  /**
7434
7450
  * Generates a UUID with a timestamp that can be extracted using `uid.parseStamp(stampString);`.
7435
- *
7451
+ *
7436
7452
  * ```js
7437
7453
  * const uidWithTimestamp = uid.stamp(32);
7438
7454
  * console.log(uidWithTimestamp);
7439
7455
  * // GDa608f973aRCHLXQYPTbKDbjDeVsSb3
7440
- *
7456
+ *
7441
7457
  * console.log(uid.parseStamp(uidWithTimestamp));
7442
7458
  * // 2021-05-03T06:24:58.000Z
7443
7459
  * ```
@@ -7458,16 +7474,16 @@ var ShortUniqueId = (() => {
7458
7474
  const idLength = finalLength - 9;
7459
7475
  const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
7460
7476
  const id = this.randomUUID(idLength);
7461
- return `${id.substring(0, rndIdx)}${hexStamp}${id.substring(rndIdx)}${rndIdx.toString(16)}`;
7477
+ return "".concat(id.substring(0, rndIdx)).concat(hexStamp).concat(id.substring(rndIdx)).concat(rndIdx.toString(16));
7462
7478
  });
7463
7479
  /**
7464
7480
  * Extracts the date embeded in a UUID generated using the `uid.stamp(finalLength);` method.
7465
- *
7481
+ *
7466
7482
  * ```js
7467
7483
  * const uidWithTimestamp = uid.stamp(32);
7468
7484
  * console.log(uidWithTimestamp);
7469
7485
  * // GDa608f973aRCHLXQYPTbKDbjDeVsSb3
7470
- *
7486
+ *
7471
7487
  * console.log(uid.parseStamp(uidWithTimestamp));
7472
7488
  * // 2021-05-03T06:24:58.000Z
7473
7489
  * ```
@@ -7476,32 +7492,26 @@ var ShortUniqueId = (() => {
7476
7492
  if (format && !/t0|t[1-9]\d{1,}/.test(format)) {
7477
7493
  throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
7478
7494
  }
7479
- const stamp = format ? format.replace(
7480
- /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
7481
- (m) => {
7482
- const fnMap = {
7483
- "$r": (len2) => [...Array(len2)].map(() => "r").join(""),
7484
- "$s": (len2) => [...Array(len2)].map(() => "s").join(""),
7485
- "$t": (len2) => [...Array(len2)].map(() => "t").join("")
7486
- };
7487
- const fn = m.slice(0, 2);
7488
- const len = parseInt(m.slice(2), 10);
7489
- return fnMap[fn](len);
7490
- }
7491
- ).replace(
7492
- /^(.*?)(t{8,})(.*)$/g,
7493
- (_m, p1, p2) => {
7494
- return suid.substring(p1.length, p1.length + p2.length);
7495
- }
7496
- ) : suid;
7495
+ const stamp = format ? format.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g, (m) => {
7496
+ const fnMap = {
7497
+ $r: (len2) => [...Array(len2)].map(() => "r").join(""),
7498
+ $s: (len2) => [...Array(len2)].map(() => "s").join(""),
7499
+ $t: (len2) => [...Array(len2)].map(() => "t").join("")
7500
+ };
7501
+ const fn = m.slice(0, 2);
7502
+ const len = Number.parseInt(m.slice(2), 10);
7503
+ return fnMap[fn](len);
7504
+ }).replace(/^(.*?)(t{8,})(.*)$/g, (_m, p1, p2) => {
7505
+ return suid.substring(p1.length, p1.length + p2.length);
7506
+ }) : suid;
7497
7507
  if (stamp.length === 8) {
7498
- return new Date(parseInt(stamp, 16) * 1e3);
7508
+ return new Date(Number.parseInt(stamp, 16) * 1e3);
7499
7509
  }
7500
7510
  if (stamp.length < 10) {
7501
7511
  throw new Error("Stamp length invalid");
7502
7512
  }
7503
- const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
7504
- return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
7513
+ const rndIdx = Number.parseInt(stamp.substring(stamp.length - 1), 16);
7514
+ return new Date(Number.parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
7505
7515
  });
7506
7516
  /**
7507
7517
  * Set the counter to a specific value.
@@ -7521,19 +7531,14 @@ var ShortUniqueId = (() => {
7521
7531
  this.debug = false;
7522
7532
  this.dict = [];
7523
7533
  this.version = version;
7524
- const {
7525
- dictionary,
7526
- shuffle,
7527
- length,
7528
- counter
7529
- } = options;
7534
+ const { dictionary, shuffle, length, counter } = options;
7530
7535
  this.uuidLength = length;
7531
7536
  this.setDictionary(dictionary, shuffle);
7532
7537
  this.setCounter(counter);
7533
7538
  this.debug = options.debug;
7534
7539
  this.log(this.dict);
7535
7540
  this.log(
7536
- `Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
7541
+ "Generator instantiated with Dictionary Size ".concat(this.dictLength, " and counter set to ").concat(this.counter)
7537
7542
  );
7538
7543
  this.log = this.log.bind(this);
7539
7544
  this.setDictionary = this.setDictionary.bind(this);
@@ -7551,13 +7556,12 @@ var ShortUniqueId = (() => {
7551
7556
  this.getVersion = this.getVersion.bind(this);
7552
7557
  this.stamp = this.stamp.bind(this);
7553
7558
  this.parseStamp = this.parseStamp.bind(this);
7554
- return this;
7555
7559
  }
7556
7560
  };
7557
7561
  /** @hidden */
7558
7562
  __publicField(_ShortUniqueId, "default", _ShortUniqueId);
7559
7563
  var ShortUniqueId = _ShortUniqueId;
7560
- return __toCommonJS(src_exports);
7564
+ return __toCommonJS(index_exports);
7561
7565
  })();
7562
7566
  //# sourceMappingURL=short-unique-id.js.map
7563
7567
  true&&(module.exports=ShortUniqueId.default),'undefined'!=typeof window&&(ShortUniqueId=ShortUniqueId.default);
@@ -10657,8 +10661,10 @@ __webpack_require__.r(__webpack_exports__);
10657
10661
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10658
10662
  /* harmony export */ "default": () => (/* binding */ normalize)
10659
10663
  /* harmony export */ });
10664
+ /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24955);
10660
10665
  /* harmony import */ var _helpers_op_id_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37896);
10661
10666
 
10667
+
10662
10668
  function normalize(parsedSpec) {
10663
10669
  const {
10664
10670
  spec
@@ -10733,12 +10739,16 @@ function normalize(parsedSpec) {
10733
10739
  for (const inherits of inheritsList) {
10734
10740
  // eslint-disable-next-line no-restricted-syntax
10735
10741
  for (const inheritName in inherits) {
10736
- if (!operation[inheritName]) {
10742
+ if (!Array.isArray(operation[inheritName])) {
10737
10743
  operation[inheritName] = inherits[inheritName];
10738
10744
  } else if (inheritName === 'parameters') {
10739
10745
  // eslint-disable-next-line no-restricted-syntax
10740
10746
  for (const param of inherits[inheritName]) {
10741
- const exists = operation[inheritName].some(opParam => opParam.name && opParam.name === param.name || opParam.$ref && opParam.$ref === param.$ref || opParam.$$ref && opParam.$$ref === param.$$ref || opParam === param);
10747
+ const exists = operation[inheritName].some(opParam => {
10748
+ if (!(0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(opParam) && !(0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(param)) return false;
10749
+ if (opParam === param) return true;
10750
+ return ['name', '$ref', '$$ref'].some(key => typeof opParam[key] === 'string' && typeof param[key] === 'string' && opParam[key] === param[key]);
10751
+ });
10742
10752
  if (!exists) {
10743
10753
  operation[inheritName].push(param);
10744
10754
  }
@@ -27531,7 +27541,7 @@ const resolveSchema$idField = (retrievalURI, schemaElement) => {
27531
27541
  const ancestorsSchemaIdentifiers = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(schemaElement.meta.get('ancestorsSchemaIdentifiers'));
27532
27542
  return (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])((acc, $id) => {
27533
27543
  return _util_url_mjs__WEBPACK_IMPORTED_MODULE_0__.resolve(acc, _util_url_mjs__WEBPACK_IMPORTED_MODULE_0__.sanitize(_util_url_mjs__WEBPACK_IMPORTED_MODULE_0__.stripHash($id)));
27534
- }, retrievalURI, [...ancestorsSchemaIdentifiers, (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(schemaElement.$id)]);
27544
+ }, retrievalURI, ancestorsSchemaIdentifiers);
27535
27545
  };
27536
27546
 
27537
27547
  /**