@builderbot/bot 1.3.14 → 1.3.15-alpha.149

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.
Files changed (2) hide show
  1. package/dist/index.cjs +68 -34
  2. package/package.json +17 -17
package/dist/index.cjs CHANGED
@@ -16436,13 +16436,14 @@ function requireHttpErrors () {
16436
16436
 
16437
16437
  /**
16438
16438
  * Get a class name from a name identifier.
16439
+ *
16440
+ * @param {string} name
16441
+ * @returns {string}
16439
16442
  * @private
16440
16443
  */
16441
16444
 
16442
16445
  function toClassName (name) {
16443
- return name.substr(-5) !== 'Error'
16444
- ? name + 'Error'
16445
- : name
16446
+ return name.slice(-5) === 'Error' ? name : name + 'Error'
16446
16447
  }
16447
16448
  } (httpErrors));
16448
16449
  return httpErrors.exports;
@@ -32669,7 +32670,7 @@ function requireUtils () {
32669
32670
  };
32670
32671
 
32671
32672
  var arrayToObject = function arrayToObject(source, options) {
32672
- var obj = options && options.plainObjects ? Object.create(null) : {};
32673
+ var obj = options && options.plainObjects ? { __proto__: null } : {};
32673
32674
  for (var i = 0; i < source.length; ++i) {
32674
32675
  if (typeof source[i] !== 'undefined') {
32675
32676
  obj[i] = source[i];
@@ -32685,11 +32686,14 @@ function requireUtils () {
32685
32686
  return target;
32686
32687
  }
32687
32688
 
32688
- if (typeof source !== 'object') {
32689
+ if (typeof source !== 'object' && typeof source !== 'function') {
32689
32690
  if (isArray(target)) {
32690
32691
  target.push(source);
32691
32692
  } else if (target && typeof target === 'object') {
32692
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
32693
+ if (
32694
+ (options && (options.plainObjects || options.allowPrototypes))
32695
+ || !has.call(Object.prototype, source)
32696
+ ) {
32693
32697
  target[source] = true;
32694
32698
  }
32695
32699
  } else {
@@ -32743,7 +32747,7 @@ function requireUtils () {
32743
32747
  }, target);
32744
32748
  };
32745
32749
 
32746
- var decode = function (str, decoder, charset) {
32750
+ var decode = function (str, defaultDecoder, charset) {
32747
32751
  var strWithoutPlus = str.replace(/\+/g, ' ');
32748
32752
  if (charset === 'iso-8859-1') {
32749
32753
  // unescape never throws, no try...catch needed:
@@ -32942,11 +32946,13 @@ function requireStringify () {
32942
32946
  arrayFormat: 'indices',
32943
32947
  charset: 'utf-8',
32944
32948
  charsetSentinel: false,
32949
+ commaRoundTrip: false,
32945
32950
  delimiter: '&',
32946
32951
  encode: true,
32947
32952
  encodeDotInKeys: false,
32948
32953
  encoder: utils.encode,
32949
32954
  encodeValuesOnly: false,
32955
+ filter: void undefined,
32950
32956
  format: defaultFormat,
32951
32957
  formatter: formats.formatters[defaultFormat],
32952
32958
  // deprecated
@@ -33058,7 +33064,7 @@ function requireStringify () {
33058
33064
  objKeys = sort ? keys.sort(sort) : keys;
33059
33065
  }
33060
33066
 
33061
- var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
33067
+ var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
33062
33068
 
33063
33069
  var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
33064
33070
 
@@ -33068,13 +33074,15 @@ function requireStringify () {
33068
33074
 
33069
33075
  for (var j = 0; j < objKeys.length; ++j) {
33070
33076
  var key = objKeys[j];
33071
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
33077
+ var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
33078
+ ? key.value
33079
+ : obj[key];
33072
33080
 
33073
33081
  if (skipNulls && value === null) {
33074
33082
  continue;
33075
33083
  }
33076
33084
 
33077
- var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
33085
+ var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
33078
33086
  var keyPrefix = isArray(obj)
33079
33087
  ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
33080
33088
  : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
@@ -33165,7 +33173,7 @@ function requireStringify () {
33165
33173
  arrayFormat: arrayFormat,
33166
33174
  charset: charset,
33167
33175
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
33168
- commaRoundTrip: opts.commaRoundTrip,
33176
+ commaRoundTrip: !!opts.commaRoundTrip,
33169
33177
  delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
33170
33178
  encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
33171
33179
  encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
@@ -33216,12 +33224,13 @@ function requireStringify () {
33216
33224
  var sideChannel = getSideChannel();
33217
33225
  for (var i = 0; i < objKeys.length; ++i) {
33218
33226
  var key = objKeys[i];
33227
+ var value = obj[key];
33219
33228
 
33220
- if (options.skipNulls && obj[key] === null) {
33229
+ if (options.skipNulls && value === null) {
33221
33230
  continue;
33222
33231
  }
33223
33232
  pushToArray(keys, stringify(
33224
- obj[key],
33233
+ value,
33225
33234
  key,
33226
33235
  generateArrayPrefix,
33227
33236
  commaRoundTrip,
@@ -33292,7 +33301,8 @@ function requireParse () {
33292
33301
  parseArrays: true,
33293
33302
  plainObjects: false,
33294
33303
  strictDepth: false,
33295
- strictNullHandling: false
33304
+ strictNullHandling: false,
33305
+ throwOnLimitExceeded: false
33296
33306
  };
33297
33307
 
33298
33308
  var interpretNumericEntities = function (str) {
@@ -33301,11 +33311,15 @@ function requireParse () {
33301
33311
  });
33302
33312
  };
33303
33313
 
33304
- var parseArrayValue = function (val, options) {
33314
+ var parseArrayValue = function (val, options, currentArrayLength) {
33305
33315
  if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
33306
33316
  return val.split(',');
33307
33317
  }
33308
33318
 
33319
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
33320
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
33321
+ }
33322
+
33309
33323
  return val;
33310
33324
  };
33311
33325
 
@@ -33324,8 +33338,17 @@ function requireParse () {
33324
33338
 
33325
33339
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
33326
33340
  cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
33341
+
33327
33342
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
33328
- var parts = cleanStr.split(options.delimiter, limit);
33343
+ var parts = cleanStr.split(
33344
+ options.delimiter,
33345
+ options.throwOnLimitExceeded ? limit + 1 : limit
33346
+ );
33347
+
33348
+ if (options.throwOnLimitExceeded && parts.length > limit) {
33349
+ throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
33350
+ }
33351
+
33329
33352
  var skipIndex = -1; // Keep track of where the utf8 sentinel was found
33330
33353
  var i;
33331
33354
 
@@ -33353,14 +33376,20 @@ function requireParse () {
33353
33376
  var bracketEqualsPos = part.indexOf(']=');
33354
33377
  var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
33355
33378
 
33356
- var key, val;
33379
+ var key;
33380
+ var val;
33357
33381
  if (pos === -1) {
33358
33382
  key = options.decoder(part, defaults.decoder, charset, 'key');
33359
33383
  val = options.strictNullHandling ? null : '';
33360
33384
  } else {
33361
33385
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
33386
+
33362
33387
  val = utils.maybeMap(
33363
- parseArrayValue(part.slice(pos + 1), options),
33388
+ parseArrayValue(
33389
+ part.slice(pos + 1),
33390
+ options,
33391
+ isArray(obj[key]) ? obj[key].length : 0
33392
+ ),
33364
33393
  function (encodedVal) {
33365
33394
  return options.decoder(encodedVal, defaults.decoder, charset, 'value');
33366
33395
  }
@@ -33368,7 +33397,7 @@ function requireParse () {
33368
33397
  }
33369
33398
 
33370
33399
  if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
33371
- val = interpretNumericEntities(val);
33400
+ val = interpretNumericEntities(String(val));
33372
33401
  }
33373
33402
 
33374
33403
  if (part.indexOf('[]=') > -1) {
@@ -33387,7 +33416,13 @@ function requireParse () {
33387
33416
  };
33388
33417
 
33389
33418
  var parseObject = function (chain, val, options, valuesParsed) {
33390
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
33419
+ var currentArrayLength = 0;
33420
+ if (chain.length > 0 && chain[chain.length - 1] === '[]') {
33421
+ var parentKey = chain.slice(0, -1).join('');
33422
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
33423
+ }
33424
+
33425
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
33391
33426
 
33392
33427
  for (var i = chain.length - 1; i >= 0; --i) {
33393
33428
  var obj;
@@ -33396,9 +33431,9 @@ function requireParse () {
33396
33431
  if (root === '[]' && options.parseArrays) {
33397
33432
  obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
33398
33433
  ? []
33399
- : [].concat(leaf);
33434
+ : utils.combine([], leaf);
33400
33435
  } else {
33401
- obj = options.plainObjects ? Object.create(null) : {};
33436
+ obj = options.plainObjects ? { __proto__: null } : {};
33402
33437
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
33403
33438
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
33404
33439
  var index = parseInt(decodedRoot, 10);
@@ -33501,6 +33536,11 @@ function requireParse () {
33501
33536
  if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
33502
33537
  throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
33503
33538
  }
33539
+
33540
+ if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
33541
+ throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
33542
+ }
33543
+
33504
33544
  var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
33505
33545
 
33506
33546
  var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
@@ -33532,7 +33572,8 @@ function requireParse () {
33532
33572
  parseArrays: opts.parseArrays !== false,
33533
33573
  plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
33534
33574
  strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
33535
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
33575
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
33576
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
33536
33577
  };
33537
33578
  };
33538
33579
 
@@ -33540,11 +33581,11 @@ function requireParse () {
33540
33581
  var options = normalizeParseOptions(opts);
33541
33582
 
33542
33583
  if (str === '' || str === null || typeof str === 'undefined') {
33543
- return options.plainObjects ? Object.create(null) : {};
33584
+ return options.plainObjects ? { __proto__: null } : {};
33544
33585
  }
33545
33586
 
33546
33587
  var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
33547
- var obj = options.plainObjects ? Object.create(null) : {};
33588
+ var obj = options.plainObjects ? { __proto__: null } : {};
33548
33589
 
33549
33590
  // Iterate over the keys and setup the new object
33550
33591
 
@@ -33645,9 +33686,6 @@ function requireUrlencoded () {
33645
33686
  : opts.limit;
33646
33687
  var type = opts.type || 'application/x-www-form-urlencoded';
33647
33688
  var verify = opts.verify || false;
33648
- var depth = typeof opts.depth !== 'number'
33649
- ? Number(opts.depth || 32)
33650
- : opts.depth;
33651
33689
 
33652
33690
  if (verify !== false && typeof verify !== 'function') {
33653
33691
  throw new TypeError('option verify must be function')
@@ -33711,8 +33749,7 @@ function requireUrlencoded () {
33711
33749
  encoding: charset,
33712
33750
  inflate: inflate,
33713
33751
  limit: limit,
33714
- verify: verify,
33715
- depth: depth
33752
+ verify: verify
33716
33753
  });
33717
33754
  }
33718
33755
  }
@@ -33727,10 +33764,7 @@ function requireUrlencoded () {
33727
33764
  var parameterLimit = options.parameterLimit !== undefined
33728
33765
  ? options.parameterLimit
33729
33766
  : 1000;
33730
-
33731
- var depth = typeof options.depth !== 'number'
33732
- ? Number(options.depth || 32)
33733
- : options.depth;
33767
+ var depth = options.depth !== undefined ? options.depth : 32;
33734
33768
  var parse = parser('qs');
33735
33769
 
33736
33770
  if (isNaN(parameterLimit) || parameterLimit < 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builderbot/bot",
3
- "version": "1.3.14",
3
+ "version": "1.3.15-alpha.149",
4
4
  "description": "core typescript",
5
5
  "author": "Leifer Mendez <leifer33@gmail.com>",
6
6
  "homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
@@ -28,39 +28,39 @@
28
28
  "url": "https://github.com/codigoencasa/bot-whatsapp/issues"
29
29
  },
30
30
  "devDependencies": {
31
- "@microsoft/api-extractor": "^7.43.0",
32
- "@rollup/plugin-commonjs": "^25.0.7",
31
+ "@microsoft/api-extractor": "^7.55.1",
32
+ "@rollup/plugin-commonjs": "^25.0.8",
33
33
  "@rollup/plugin-json": "^6.1.0",
34
- "@rollup/plugin-node-resolve": "^15.2.3",
34
+ "@rollup/plugin-node-resolve": "^15.3.1",
35
35
  "@rollup/plugin-terser": "^0.4.4",
36
- "@types/body-parser": "^1.19.5",
37
- "@types/cors": "^2.8.17",
38
- "@types/fluent-ffmpeg": "^2.1.24",
36
+ "@types/body-parser": "^1.19.6",
37
+ "@types/cors": "^2.8.19",
38
+ "@types/fluent-ffmpeg": "^2.1.28",
39
39
  "@types/follow-redirects": "^1.14.4",
40
40
  "@types/mime-types": "^2.1.4",
41
- "@types/node": "^20.12.3",
42
- "@types/polka": "^0.5.7",
41
+ "@types/node": "^20.19.25",
42
+ "@types/polka": "^0.5.8",
43
43
  "@types/proxyquire": "^1.3.31",
44
- "@types/sinon": "^17.0.3",
44
+ "@types/sinon": "^17.0.4",
45
45
  "proxyquire": "^2.1.3",
46
- "rimraf": "^5.0.5",
46
+ "rimraf": "^5.0.10",
47
47
  "rollup-plugin-typescript2": "^0.36.0",
48
48
  "sinon": "^17.0.1",
49
- "tslib": "^2.6.2",
49
+ "tslib": "^2.8.1",
50
50
  "tsm": "^2.3.0"
51
51
  },
52
52
  "dependencies": {
53
53
  "@ffmpeg-installer/ffmpeg": "^1.1.0",
54
- "body-parser": "^1.20.2",
54
+ "body-parser": "^1.20.4",
55
55
  "cors": "^2.8.5",
56
- "fluent-ffmpeg": "^2.1.2",
57
- "follow-redirects": "^1.15.6",
56
+ "fluent-ffmpeg": "^2.1.3",
57
+ "follow-redirects": "^1.15.11",
58
58
  "mime-types": "^2.1.35",
59
- "picocolors": "^1.0.0",
59
+ "picocolors": "^1.1.1",
60
60
  "polka": "^0.5.2"
61
61
  },
62
62
  "optionalDependencies": {
63
63
  "sharp": "0.33.3"
64
64
  },
65
- "gitHead": "b9bacfa917364b27d22fe7398c1219cbd28b2a22"
65
+ "gitHead": "4936e5cb0486b776e0175e7aa8d1807f7ee62dfb"
66
66
  }