audible-api-ts 0.2.0 → 0.4.0

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/index.js CHANGED
@@ -12,19 +12,31 @@ var __export = (target, all) => {
12
12
  set: __exportSetter.bind(all, name)
13
13
  });
14
14
  };
15
- // node_modules/lodash-es/_arrayMap.js
16
- function arrayMap(array, iteratee) {
17
- var index = -1, length = array == null ? 0 : array.length, result = Array(length);
15
+ // node_modules/lodash-es/_baseSlice.js
16
+ function baseSlice(array, start, end) {
17
+ var index = -1, length = array.length;
18
+ if (start < 0) {
19
+ start = -start > length ? 0 : length + start;
20
+ }
21
+ end = end > length ? length : end;
22
+ if (end < 0) {
23
+ end += length;
24
+ }
25
+ length = start > end ? 0 : end - start >>> 0;
26
+ start >>>= 0;
27
+ var result = Array(length);
18
28
  while (++index < length) {
19
- result[index] = iteratee(array[index], index, array);
29
+ result[index] = array[index + start];
20
30
  }
21
31
  return result;
22
32
  }
23
- var _arrayMap_default = arrayMap;
33
+ var _baseSlice_default = baseSlice;
24
34
 
25
- // node_modules/lodash-es/isArray.js
26
- var isArray = Array.isArray;
27
- var isArray_default = isArray;
35
+ // node_modules/lodash-es/eq.js
36
+ function eq(value, other) {
37
+ return value === other || value !== value && other !== other;
38
+ }
39
+ var eq_default = eq;
28
40
 
29
41
  // node_modules/lodash-es/_freeGlobal.js
30
42
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
@@ -82,6 +94,79 @@ function baseGetTag(value) {
82
94
  }
83
95
  var _baseGetTag_default = baseGetTag;
84
96
 
97
+ // node_modules/lodash-es/isObject.js
98
+ function isObject(value) {
99
+ var type = typeof value;
100
+ return value != null && (type == "object" || type == "function");
101
+ }
102
+ var isObject_default = isObject;
103
+
104
+ // node_modules/lodash-es/isFunction.js
105
+ var asyncTag = "[object AsyncFunction]";
106
+ var funcTag = "[object Function]";
107
+ var genTag = "[object GeneratorFunction]";
108
+ var proxyTag = "[object Proxy]";
109
+ function isFunction(value) {
110
+ if (!isObject_default(value)) {
111
+ return false;
112
+ }
113
+ var tag = _baseGetTag_default(value);
114
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
115
+ }
116
+ var isFunction_default = isFunction;
117
+
118
+ // node_modules/lodash-es/isLength.js
119
+ var MAX_SAFE_INTEGER = 9007199254740991;
120
+ function isLength(value) {
121
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
122
+ }
123
+ var isLength_default = isLength;
124
+
125
+ // node_modules/lodash-es/isArrayLike.js
126
+ function isArrayLike(value) {
127
+ return value != null && isLength_default(value.length) && !isFunction_default(value);
128
+ }
129
+ var isArrayLike_default = isArrayLike;
130
+
131
+ // node_modules/lodash-es/_isIndex.js
132
+ var MAX_SAFE_INTEGER2 = 9007199254740991;
133
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
134
+ function isIndex(value, length) {
135
+ var type = typeof value;
136
+ length = length == null ? MAX_SAFE_INTEGER2 : length;
137
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
138
+ }
139
+ var _isIndex_default = isIndex;
140
+
141
+ // node_modules/lodash-es/_isIterateeCall.js
142
+ function isIterateeCall(value, index, object) {
143
+ if (!isObject_default(object)) {
144
+ return false;
145
+ }
146
+ var type = typeof index;
147
+ if (type == "number" ? isArrayLike_default(object) && _isIndex_default(index, object.length) : type == "string" && (index in object)) {
148
+ return eq_default(object[index], value);
149
+ }
150
+ return false;
151
+ }
152
+ var _isIterateeCall_default = isIterateeCall;
153
+
154
+ // node_modules/lodash-es/_trimmedEndIndex.js
155
+ var reWhitespace = /\s/;
156
+ function trimmedEndIndex(string) {
157
+ var index = string.length;
158
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
159
+ return index;
160
+ }
161
+ var _trimmedEndIndex_default = trimmedEndIndex;
162
+
163
+ // node_modules/lodash-es/_baseTrim.js
164
+ var reTrimStart = /^\s+/;
165
+ function baseTrim(string) {
166
+ return string ? string.slice(0, _trimmedEndIndex_default(string) + 1).replace(reTrimStart, "") : string;
167
+ }
168
+ var _baseTrim_default = baseTrim;
169
+
85
170
  // node_modules/lodash-es/isObjectLike.js
86
171
  function isObjectLike(value) {
87
172
  return value != null && typeof value == "object";
@@ -95,6 +180,89 @@ function isSymbol(value) {
95
180
  }
96
181
  var isSymbol_default = isSymbol;
97
182
 
183
+ // node_modules/lodash-es/toNumber.js
184
+ var NAN = 0 / 0;
185
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
186
+ var reIsBinary = /^0b[01]+$/i;
187
+ var reIsOctal = /^0o[0-7]+$/i;
188
+ var freeParseInt = parseInt;
189
+ function toNumber(value) {
190
+ if (typeof value == "number") {
191
+ return value;
192
+ }
193
+ if (isSymbol_default(value)) {
194
+ return NAN;
195
+ }
196
+ if (isObject_default(value)) {
197
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
198
+ value = isObject_default(other) ? other + "" : other;
199
+ }
200
+ if (typeof value != "string") {
201
+ return value === 0 ? value : +value;
202
+ }
203
+ value = _baseTrim_default(value);
204
+ var isBinary = reIsBinary.test(value);
205
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
206
+ }
207
+ var toNumber_default = toNumber;
208
+
209
+ // node_modules/lodash-es/toFinite.js
210
+ var INFINITY = 1 / 0;
211
+ var MAX_INTEGER = 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
212
+ function toFinite(value) {
213
+ if (!value) {
214
+ return value === 0 ? value : 0;
215
+ }
216
+ value = toNumber_default(value);
217
+ if (value === INFINITY || value === -INFINITY) {
218
+ var sign = value < 0 ? -1 : 1;
219
+ return sign * MAX_INTEGER;
220
+ }
221
+ return value === value ? value : 0;
222
+ }
223
+ var toFinite_default = toFinite;
224
+
225
+ // node_modules/lodash-es/toInteger.js
226
+ function toInteger(value) {
227
+ var result = toFinite_default(value), remainder = result % 1;
228
+ return result === result ? remainder ? result - remainder : result : 0;
229
+ }
230
+ var toInteger_default = toInteger;
231
+
232
+ // node_modules/lodash-es/chunk.js
233
+ var nativeCeil = Math.ceil;
234
+ var nativeMax = Math.max;
235
+ function chunk(array, size, guard) {
236
+ if (guard ? _isIterateeCall_default(array, size, guard) : size === undefined) {
237
+ size = 1;
238
+ } else {
239
+ size = nativeMax(toInteger_default(size), 0);
240
+ }
241
+ var length = array == null ? 0 : array.length;
242
+ if (!length || size < 1) {
243
+ return [];
244
+ }
245
+ var index = 0, resIndex = 0, result = Array(nativeCeil(length / size));
246
+ while (index < length) {
247
+ result[resIndex++] = _baseSlice_default(array, index, index += size);
248
+ }
249
+ return result;
250
+ }
251
+ var chunk_default = chunk;
252
+ // node_modules/lodash-es/_arrayMap.js
253
+ function arrayMap(array, iteratee) {
254
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
255
+ while (++index < length) {
256
+ result[index] = iteratee(array[index], index, array);
257
+ }
258
+ return result;
259
+ }
260
+ var _arrayMap_default = arrayMap;
261
+
262
+ // node_modules/lodash-es/isArray.js
263
+ var isArray = Array.isArray;
264
+ var isArray_default = isArray;
265
+
98
266
  // node_modules/lodash-es/_isKey.js
99
267
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
100
268
  var reIsPlainProp = /^\w*$/;
@@ -110,27 +278,6 @@ function isKey(value, object) {
110
278
  }
111
279
  var _isKey_default = isKey;
112
280
 
113
- // node_modules/lodash-es/isObject.js
114
- function isObject(value) {
115
- var type = typeof value;
116
- return value != null && (type == "object" || type == "function");
117
- }
118
- var isObject_default = isObject;
119
-
120
- // node_modules/lodash-es/isFunction.js
121
- var asyncTag = "[object AsyncFunction]";
122
- var funcTag = "[object Function]";
123
- var genTag = "[object GeneratorFunction]";
124
- var proxyTag = "[object Proxy]";
125
- function isFunction(value) {
126
- if (!isObject_default(value)) {
127
- return false;
128
- }
129
- var tag = _baseGetTag_default(value);
130
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
131
- }
132
- var isFunction_default = isFunction;
133
-
134
281
  // node_modules/lodash-es/_coreJsData.js
135
282
  var coreJsData = _root_default["__core-js_shared__"];
136
283
  var _coreJsData_default = coreJsData;
@@ -266,12 +413,6 @@ function listCacheClear() {
266
413
  }
267
414
  var _listCacheClear_default = listCacheClear;
268
415
 
269
- // node_modules/lodash-es/eq.js
270
- function eq(value, other) {
271
- return value === other || value !== value && other !== other;
272
- }
273
- var eq_default = eq;
274
-
275
416
  // node_modules/lodash-es/_assocIndexOf.js
276
417
  function assocIndexOf(array, key) {
277
418
  var length = array.length;
@@ -470,7 +611,7 @@ var stringToPath = _memoizeCapped_default(function(string) {
470
611
  var _stringToPath_default = stringToPath;
471
612
 
472
613
  // node_modules/lodash-es/_baseToString.js
473
- var INFINITY = 1 / 0;
614
+ var INFINITY2 = 1 / 0;
474
615
  var symbolProto = _Symbol_default ? _Symbol_default.prototype : undefined;
475
616
  var symbolToString = symbolProto ? symbolProto.toString : undefined;
476
617
  function baseToString(value) {
@@ -484,7 +625,7 @@ function baseToString(value) {
484
625
  return symbolToString ? symbolToString.call(value) : "";
485
626
  }
486
627
  var result = value + "";
487
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
628
+ return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
488
629
  }
489
630
  var _baseToString_default = baseToString;
490
631
 
@@ -504,13 +645,13 @@ function castPath(value, object) {
504
645
  var _castPath_default = castPath;
505
646
 
506
647
  // node_modules/lodash-es/_toKey.js
507
- var INFINITY2 = 1 / 0;
648
+ var INFINITY3 = 1 / 0;
508
649
  function toKey(value) {
509
650
  if (typeof value == "string" || isSymbol_default(value)) {
510
651
  return value;
511
652
  }
512
653
  var result = value + "";
513
- return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
654
+ return result == "0" && 1 / value == -INFINITY3 ? "-0" : result;
514
655
  }
515
656
  var _toKey_default = toKey;
516
657
 
@@ -656,8 +797,8 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
656
797
  break;
657
798
  }
658
799
  if (seen) {
659
- if (!_arraySome_default(other, function(othValue2, othIndex) {
660
- if (!_cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
800
+ if (!_arraySome_default(other, function(othValue, othIndex) {
801
+ if (!_cacheHas_default(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
661
802
  return seen.push(othIndex);
662
803
  }
663
804
  })) {
@@ -863,23 +1004,6 @@ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined;
863
1004
  var isBuffer = nativeIsBuffer || stubFalse_default;
864
1005
  var isBuffer_default = isBuffer;
865
1006
 
866
- // node_modules/lodash-es/_isIndex.js
867
- var MAX_SAFE_INTEGER = 9007199254740991;
868
- var reIsUint = /^(?:0|[1-9]\d*)$/;
869
- function isIndex(value, length) {
870
- var type = typeof value;
871
- length = length == null ? MAX_SAFE_INTEGER : length;
872
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
873
- }
874
- var _isIndex_default = isIndex;
875
-
876
- // node_modules/lodash-es/isLength.js
877
- var MAX_SAFE_INTEGER2 = 9007199254740991;
878
- function isLength(value) {
879
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
880
- }
881
- var isLength_default = isLength;
882
-
883
1007
  // node_modules/lodash-es/_baseIsTypedArray.js
884
1008
  var argsTag2 = "[object Arguments]";
885
1009
  var arrayTag = "[object Array]";
@@ -997,12 +1121,6 @@ function baseKeys(object) {
997
1121
  }
998
1122
  var _baseKeys_default = baseKeys;
999
1123
 
1000
- // node_modules/lodash-es/isArrayLike.js
1001
- function isArrayLike(value) {
1002
- return value != null && isLength_default(value.length) && !isFunction_default(value);
1003
- }
1004
- var isArrayLike_default = isArrayLike;
1005
-
1006
1124
  // node_modules/lodash-es/keys.js
1007
1125
  function keys(object) {
1008
1126
  return isArrayLike_default(object) ? _arrayLikeKeys_default(object) : _baseKeys_default(object);
@@ -1389,8 +1507,8 @@ var _baseEach_default = baseEach;
1389
1507
  // node_modules/lodash-es/_baseMap.js
1390
1508
  function baseMap(collection, iteratee) {
1391
1509
  var index = -1, result = isArrayLike_default(collection) ? Array(collection.length) : [];
1392
- _baseEach_default(collection, function(value, key, collection2) {
1393
- result[++index] = iteratee(value, key, collection2);
1510
+ _baseEach_default(collection, function(value, key, collection) {
1511
+ result[++index] = iteratee(value, key, collection);
1394
1512
  });
1395
1513
  return result;
1396
1514
  }
@@ -1456,7 +1574,7 @@ function baseOrderBy(collection, iteratees, orders) {
1456
1574
  }
1457
1575
  var index = -1;
1458
1576
  iteratees = _arrayMap_default(iteratees, _baseUnary_default(_baseIteratee_default));
1459
- var result = _baseMap_default(collection, function(value, key, collection2) {
1577
+ var result = _baseMap_default(collection, function(value, key, collection) {
1460
1578
  var criteria = _arrayMap_default(iteratees, function(iteratee) {
1461
1579
  return iteratee(value);
1462
1580
  });
@@ -1543,8 +1661,8 @@ function noop() {}
1543
1661
  var noop_default = noop;
1544
1662
 
1545
1663
  // node_modules/lodash-es/_createSet.js
1546
- var INFINITY3 = 1 / 0;
1547
- var createSet = !(_Set_default && 1 / _setToArray_default(new _Set_default([, -0]))[1] == INFINITY3) ? noop_default : function(values) {
1664
+ var INFINITY4 = 1 / 0;
1665
+ var createSet = !(_Set_default && 1 / _setToArray_default(new _Set_default([, -0]))[1] == INFINITY4) ? noop_default : function(values) {
1548
1666
  return new _Set_default(values);
1549
1667
  };
1550
1668
  var _createSet_default = createSet;
@@ -1603,78 +1721,91 @@ var GENRE_CATEGORIES = {
1603
1721
  "science-fiction": { fr: "21229020031", com: "18580628011" },
1604
1722
  fantasy: { fr: "21229021031", com: "18580607011" },
1605
1723
  "science-fiction-fantasy": { fr: "21228885031", com: "18580606011" },
1606
- thriller: { fr: "21228906031", com: "18574449011" },
1607
- mystery: { fr: "21228905031", com: "18574427011" },
1608
- horror: { fr: "21229011031", com: "18573211011" },
1724
+ "mystery-thriller-suspense": { fr: "21228876031", com: "18574597011" },
1725
+ thriller: { fr: "21228906031", com: "18574621011" },
1726
+ mystery: { fr: "21228905031", com: "18574606011" },
1727
+ "crime-fiction": { fr: "21228907031", com: "18574598011" },
1728
+ horror: { fr: "21229011031", com: "18574490011" },
1609
1729
  romance: { fr: "21228893031", com: "18580518011" },
1610
- "historical-fiction": { fr: "21229010031" },
1611
- "literary-fiction": { fr: "21228884031", com: "18574784011" },
1730
+ "historical-fiction": { fr: "21229010031", com: "18574482011" },
1731
+ "literary-fiction": { fr: "21228884031", com: "18574426011" },
1612
1732
  biography: { fr: "21228881031", com: "18571951011" },
1613
- history: { fr: "21228890031" },
1614
- business: { fr: "21228882031", com: "18571961011" },
1615
- "self-help": { fr: "21228892031", com: "18571967011" },
1616
- science: { fr: "21228897031", com: "18571997011" },
1733
+ history: { fr: "21228890031", com: "18573518011" },
1734
+ business: { fr: "21228882031", com: "18572029011" },
1735
+ "self-help": { fr: "21228892031", com: "18574784011" },
1736
+ science: { fr: "21228897031", com: "18580540011" },
1617
1737
  children: { fr: "21228877031", com: "18572091011" },
1618
- "young-adult": { fr: "21228895031" },
1619
- comedy: { fr: "34003928031", com: "18572049011" },
1620
- erotica: { fr: "21228894031", com: "18573267011" },
1621
- religion: { fr: "21228880031", com: "18574606011" },
1622
- sports: { fr: "21228879031", com: "18574713011" },
1623
- travel: { fr: "21228891031", com: "18574721011" },
1624
- lgbtq: { fr: "21228883031", com: "18573939011" },
1738
+ "young-adult": { fr: "21228895031", com: "18580715011" },
1739
+ comedy: { fr: "34003928031", com: "24427740011" },
1740
+ erotica: { fr: "21228894031", com: "18573351011" },
1741
+ religion: { fr: "21228880031", com: "18574839011" },
1742
+ sports: { fr: "21228879031", com: "18580648011" },
1743
+ travel: { fr: "21228891031", com: "18581095011" },
1744
+ lgbtq: { fr: "21228883031", com: "18573743011" },
1625
1745
  "science-fiction/adventure": { fr: "21229681031", com: "18580629011" },
1626
- "science-fiction/adaptations": { fr: "21229683031" },
1746
+ "science-fiction/adaptations": { fr: "21229683031", com: "18580642011" },
1627
1747
  "science-fiction/cyberpunk": { fr: "21229684031", com: "18580633011" },
1628
- "science-fiction/dystopian": { fr: "21229685031", com: "18580634011" },
1629
- "science-fiction/first-contact": { fr: "21229682031", com: "18580635011" },
1630
- "science-fiction/galactic-empire": { fr: "21229693031", com: "18580636011" },
1631
- "science-fiction/genetic-engineering": { fr: "21229686031", com: "18580637011" },
1632
- "science-fiction/military": { fr: "21229688031", com: "18580643011" },
1633
- "science-fiction/post-apocalyptic": { fr: "21229687031", com: "18580645011" },
1634
- "science-fiction/space-exploration": { fr: "21229689031", com: "18580647011" },
1635
- "science-fiction/space-opera": { fr: "21229694031", com: "18580648011" },
1748
+ "science-fiction/dystopian": { fr: "21229685031", com: "18580635011" },
1749
+ "science-fiction/first-contact": { fr: "21229682031", com: "18580636011" },
1750
+ "science-fiction/galactic-empire": { fr: "21229693031" },
1751
+ "science-fiction/genetic-engineering": { fr: "21229686031", com: "18580638011" },
1752
+ "science-fiction/military": { fr: "21229688031", com: "18580641011" },
1753
+ "science-fiction/post-apocalyptic": { fr: "21229687031", com: "18580643011" },
1754
+ "science-fiction/space-exploration": { fr: "21229689031", com: "18580644011" },
1755
+ "science-fiction/space-opera": { fr: "21229694031", com: "18580645011" },
1636
1756
  "fantasy/action-adventure": { fr: "21229712031", com: "18580608011" },
1637
- "fantasy/adaptations": { fr: "21229708031" },
1638
- "fantasy/dragons": { fr: "21229709031", com: "18580612011" },
1639
- "fantasy/epic": { fr: "21229701031", com: "18580614011" },
1640
- "fantasy/historical": { fr: "21229700031", com: "18580616011" },
1641
- "fantasy/urban-paranormal": { fr: "21229711031", com: "18580621011" },
1642
- "thriller/suspense": { fr: "21229158031", com: "18574450011" },
1643
- "thriller/psychological": { fr: "21229165031", com: "18574459011" },
1644
- "thriller/domestic": { fr: "21229163031", com: "18574455011" },
1645
- "thriller/historical": { fr: "21229168031", com: "18574456011" },
1646
- "mystery/amateur-sleuth": { fr: "21229145031", com: "18574430011" },
1647
- "mystery/detective": { fr: "21229148031" },
1648
- "mystery/historical": { fr: "21229155031", com: "18574435011" },
1649
- "mystery/noir": { fr: "21229177031", com: "18574434011" },
1650
- "mystery/private-investigator": { fr: "21229148031", com: "18574439011" },
1651
- "mystery/traditional": { fr: "21229152031", com: "18574443011" },
1652
- "romance/action-adventure": { fr: "21229096031" },
1653
- "romance/comedy": { fr: "21229087031" },
1654
- "romance/contemporary": { fr: "21230152031" },
1655
- "romance/fantasy": { fr: "21229095031" },
1656
- "romance/historical": { fr: "21229093031" },
1657
- "romance/paranormal": { fr: "21229088031" },
1658
- "romance/science-fiction": { fr: "21229085031" },
1659
- "romance/sports": { fr: "21229086031" },
1660
- "romance/suspense": { fr: "21229090031" },
1661
- "literary-fiction/action-adventure": { fr: "21230085031" },
1662
- "literary-fiction/classics": { fr: "21229007031" },
1663
- "literary-fiction/coming-of-age": { fr: "21230090031" },
1664
- "literary-fiction/contemporary": { fr: "21229657031" },
1665
- "literary-fiction/drama": { fr: "21229017031" },
1666
- "literary-fiction/family-life": { fr: "21229670031" },
1667
- "literary-fiction/historical": { fr: "21229010031" },
1668
- "literary-fiction/sagas": { fr: "21229654031" },
1669
- "literary-fiction/sea-adventures": { fr: "21229673031" },
1670
- "literary-fiction/world-literature": { fr: "21229018031" },
1671
- "biography/entertainment": { fr: "21228985031" },
1672
- "history/europe": { fr: "21229067031" },
1673
- "children/action-adventure": { fr: "21228913031" },
1674
- "young-adult/literary-fiction": { fr: "21229110031" },
1675
- "young-adult/romance": { fr: "21229117031" },
1676
- "young-adult/science-fiction-fantasy": { fr: "21229103031" },
1677
- "young-adult/thriller": { fr: "21229114031" }
1757
+ "fantasy/adaptations": { fr: "21229708031", com: "18580621011" },
1758
+ "fantasy/dragons": { fr: "21229709031", com: "18580613011" },
1759
+ "fantasy/epic": { fr: "21229701031", com: "18580615011" },
1760
+ "fantasy/historical": { fr: "21229700031", com: "18580618011" },
1761
+ "fantasy/sword-sorcery": { fr: "21229713031", com: "18580627011" },
1762
+ "fantasy/urban-paranormal": { fr: "21229711031", com: "18580622011" },
1763
+ "thriller/suspense": { fr: "21229158031", com: "18574639011" },
1764
+ "thriller/psychological": { fr: "21229165031", com: "18574631011" },
1765
+ "thriller/domestic": { fr: "21229163031", com: "18574624011" },
1766
+ "thriller/historical": { fr: "21229168031", com: "18574627011" },
1767
+ "mystery/amateur-sleuth": { fr: "21229145031", com: "18574607011" },
1768
+ "mystery/cozy": { fr: "21229150031", com: "18574609011" },
1769
+ "mystery/detective": { fr: "21229148031", com: "18574618011" },
1770
+ "mystery/hard-boiled": { fr: "21229153031", com: "18574614011" },
1771
+ "mystery/historical": { fr: "21229155031", com: "18574615011" },
1772
+ "mystery/noir": { fr: "21229177031", com: "18574602011" },
1773
+ "mystery/police-procedural": { fr: "21229144031", com: "18574617011" },
1774
+ "mystery/private-investigator": { fr: "21229148031", com: "18574618011" },
1775
+ "mystery/traditional": { fr: "21229152031", com: "18574619011" },
1776
+ "romance/action-adventure": { fr: "21229096031", com: "18580519011" },
1777
+ "romance/comedy": { fr: "21229087031", com: "18580535011" },
1778
+ "romance/contemporary": { fr: "21230152031", com: "18580522011" },
1779
+ "romance/fantasy": { fr: "21229095031", com: "18580523011" },
1780
+ "romance/historical": { fr: "21229093031", com: "18580524011" },
1781
+ "romance/paranormal": { fr: "21229088031", com: "18580534011" },
1782
+ "romance/science-fiction": { fr: "21229085031", com: "18580537011" },
1783
+ "romance/sports": { fr: "21229086031", com: "18580538011" },
1784
+ "romance/suspense": { fr: "21229090031", com: "18580536011" },
1785
+ "literary-fiction/action-adventure": { fr: "21229016031", com: "18574427011" },
1786
+ "literary-fiction/classics": { fr: "21229007031", com: "18574449011" },
1787
+ "literary-fiction/coming-of-age": { fr: "21229655031", com: "18574461011" },
1788
+ "literary-fiction/contemporary": { fr: "21229657031", com: "18574462011" },
1789
+ "literary-fiction/drama": { fr: "21229017031", com: "18574450011" },
1790
+ "literary-fiction/family-life": { fr: "21229670031", com: "18574465011" },
1791
+ "literary-fiction/fiction": { fr: "21229019031", com: "18574456011" },
1792
+ "literary-fiction/historical": { fr: "21229010031", com: "18574482011" },
1793
+ "literary-fiction/sagas": { fr: "21229654031", com: "18574476011" },
1794
+ "literary-fiction/sea-adventures": { fr: "21229673031", com: "18574434011" },
1795
+ "literary-fiction/world-literature": { fr: "21229018031", com: "18574521011" },
1796
+ "biography/entertainment": { fr: "21228985031", com: "18571984011" },
1797
+ "history/europe": { fr: "21229067031", com: "18573582011" },
1798
+ "children/action-adventure": { fr: "21228913031", com: "18572092011" },
1799
+ "children/mystery": { fr: "21228927031", com: "18572548011" },
1800
+ "children/science-fiction-fantasy": { fr: "21228926031", com: "18572586011" },
1801
+ "children/fantasy": { fr: "21229338031", com: "18572587011" },
1802
+ "children/science-fiction": { fr: "21229339031", com: "18572593011" },
1803
+ "young-adult/literary-fiction": { fr: "21229110031", com: "18580894011" },
1804
+ "young-adult/romance": { fr: "21229117031", com: "18581004011" },
1805
+ "young-adult/science-fiction-fantasy": { fr: "21229103031", com: "18581048011" },
1806
+ "young-adult/fantasy": { fr: "21230013031", com: "18581049011" },
1807
+ "young-adult/science-fiction": { fr: "21230014031", com: "18581062011" },
1808
+ "young-adult/thriller": { fr: "21229114031", com: "18580961011" }
1678
1809
  };
1679
1810
  var resolveGenreId = (genre, locale) => {
1680
1811
  const id = GENRE_CATEGORIES[genre]?.[locale];
@@ -1838,170 +1969,58 @@ var refresh = async (credentials) => {
1838
1969
  };
1839
1970
  };
1840
1971
 
1841
- // node_modules/zod/v3/external.js
1842
- var exports_external = {};
1843
- __export(exports_external, {
1844
- void: () => voidType,
1845
- util: () => util,
1846
- unknown: () => unknownType,
1847
- union: () => unionType,
1848
- undefined: () => undefinedType,
1849
- tuple: () => tupleType,
1850
- transformer: () => effectsType,
1851
- symbol: () => symbolType,
1852
- string: () => stringType,
1853
- strictObject: () => strictObjectType,
1854
- setErrorMap: () => setErrorMap,
1855
- set: () => setType,
1856
- record: () => recordType,
1857
- quotelessJson: () => quotelessJson,
1858
- promise: () => promiseType,
1859
- preprocess: () => preprocessType,
1860
- pipeline: () => pipelineType,
1861
- ostring: () => ostring,
1862
- optional: () => optionalType,
1863
- onumber: () => onumber,
1864
- oboolean: () => oboolean,
1865
- objectUtil: () => objectUtil,
1866
- object: () => objectType,
1867
- number: () => numberType,
1868
- nullable: () => nullableType,
1869
- null: () => nullType,
1870
- never: () => neverType,
1871
- nativeEnum: () => nativeEnumType,
1872
- nan: () => nanType,
1873
- map: () => mapType,
1874
- makeIssue: () => makeIssue,
1875
- literal: () => literalType,
1876
- lazy: () => lazyType,
1877
- late: () => late,
1878
- isValid: () => isValid,
1879
- isDirty: () => isDirty,
1880
- isAsync: () => isAsync,
1881
- isAborted: () => isAborted,
1882
- intersection: () => intersectionType,
1883
- instanceof: () => instanceOfType,
1884
- getParsedType: () => getParsedType,
1885
- getErrorMap: () => getErrorMap,
1886
- function: () => functionType,
1887
- enum: () => enumType,
1888
- effect: () => effectsType,
1889
- discriminatedUnion: () => discriminatedUnionType,
1890
- defaultErrorMap: () => en_default,
1891
- datetimeRegex: () => datetimeRegex,
1892
- date: () => dateType,
1893
- custom: () => custom,
1894
- coerce: () => coerce,
1895
- boolean: () => booleanType,
1896
- bigint: () => bigIntType,
1897
- array: () => arrayType,
1898
- any: () => anyType,
1899
- addIssueToContext: () => addIssueToContext,
1900
- ZodVoid: () => ZodVoid,
1901
- ZodUnknown: () => ZodUnknown,
1902
- ZodUnion: () => ZodUnion,
1903
- ZodUndefined: () => ZodUndefined,
1904
- ZodType: () => ZodType,
1905
- ZodTuple: () => ZodTuple,
1906
- ZodTransformer: () => ZodEffects,
1907
- ZodSymbol: () => ZodSymbol,
1908
- ZodString: () => ZodString,
1909
- ZodSet: () => ZodSet,
1910
- ZodSchema: () => ZodType,
1911
- ZodRecord: () => ZodRecord,
1912
- ZodReadonly: () => ZodReadonly,
1913
- ZodPromise: () => ZodPromise,
1914
- ZodPipeline: () => ZodPipeline,
1915
- ZodParsedType: () => ZodParsedType,
1916
- ZodOptional: () => ZodOptional,
1917
- ZodObject: () => ZodObject,
1918
- ZodNumber: () => ZodNumber,
1919
- ZodNullable: () => ZodNullable,
1920
- ZodNull: () => ZodNull,
1921
- ZodNever: () => ZodNever,
1922
- ZodNativeEnum: () => ZodNativeEnum,
1923
- ZodNaN: () => ZodNaN,
1924
- ZodMap: () => ZodMap,
1925
- ZodLiteral: () => ZodLiteral,
1926
- ZodLazy: () => ZodLazy,
1927
- ZodIssueCode: () => ZodIssueCode,
1928
- ZodIntersection: () => ZodIntersection,
1929
- ZodFunction: () => ZodFunction,
1930
- ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
1931
- ZodError: () => ZodError,
1932
- ZodEnum: () => ZodEnum,
1933
- ZodEffects: () => ZodEffects,
1934
- ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
1935
- ZodDefault: () => ZodDefault,
1936
- ZodDate: () => ZodDate,
1937
- ZodCatch: () => ZodCatch,
1938
- ZodBranded: () => ZodBranded,
1939
- ZodBoolean: () => ZodBoolean,
1940
- ZodBigInt: () => ZodBigInt,
1941
- ZodArray: () => ZodArray,
1942
- ZodAny: () => ZodAny,
1943
- Schema: () => ZodType,
1944
- ParseStatus: () => ParseStatus,
1945
- OK: () => OK,
1946
- NEVER: () => NEVER,
1947
- INVALID: () => INVALID,
1948
- EMPTY_PATH: () => EMPTY_PATH,
1949
- DIRTY: () => DIRTY,
1950
- BRAND: () => BRAND
1951
- });
1952
-
1953
1972
  // node_modules/zod/v3/helpers/util.js
1954
1973
  var util;
1955
- (function(util2) {
1956
- util2.assertEqual = (_) => {};
1974
+ (function(util) {
1975
+ util.assertEqual = (_) => {};
1957
1976
  function assertIs(_arg) {}
1958
- util2.assertIs = assertIs;
1977
+ util.assertIs = assertIs;
1959
1978
  function assertNever(_x) {
1960
1979
  throw new Error;
1961
1980
  }
1962
- util2.assertNever = assertNever;
1963
- util2.arrayToEnum = (items) => {
1981
+ util.assertNever = assertNever;
1982
+ util.arrayToEnum = (items) => {
1964
1983
  const obj = {};
1965
1984
  for (const item of items) {
1966
1985
  obj[item] = item;
1967
1986
  }
1968
1987
  return obj;
1969
1988
  };
1970
- util2.getValidEnumValues = (obj) => {
1971
- const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
1989
+ util.getValidEnumValues = (obj) => {
1990
+ const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
1972
1991
  const filtered = {};
1973
1992
  for (const k of validKeys) {
1974
1993
  filtered[k] = obj[k];
1975
1994
  }
1976
- return util2.objectValues(filtered);
1995
+ return util.objectValues(filtered);
1977
1996
  };
1978
- util2.objectValues = (obj) => {
1979
- return util2.objectKeys(obj).map(function(e) {
1997
+ util.objectValues = (obj) => {
1998
+ return util.objectKeys(obj).map(function(e) {
1980
1999
  return obj[e];
1981
2000
  });
1982
2001
  };
1983
- util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
1984
- const keys2 = [];
2002
+ util.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
2003
+ const keys = [];
1985
2004
  for (const key in object) {
1986
2005
  if (Object.prototype.hasOwnProperty.call(object, key)) {
1987
- keys2.push(key);
2006
+ keys.push(key);
1988
2007
  }
1989
2008
  }
1990
- return keys2;
2009
+ return keys;
1991
2010
  };
1992
- util2.find = (arr, checker) => {
2011
+ util.find = (arr, checker) => {
1993
2012
  for (const item of arr) {
1994
2013
  if (checker(item))
1995
2014
  return item;
1996
2015
  }
1997
2016
  return;
1998
2017
  };
1999
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
2018
+ util.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
2000
2019
  function joinValues(array, separator = " | ") {
2001
2020
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
2002
2021
  }
2003
- util2.joinValues = joinValues;
2004
- util2.jsonStringifyReplacer = (_, value) => {
2022
+ util.joinValues = joinValues;
2023
+ util.jsonStringifyReplacer = (_, value) => {
2005
2024
  if (typeof value === "bigint") {
2006
2025
  return value.toString();
2007
2026
  }
@@ -2009,8 +2028,8 @@ var util;
2009
2028
  };
2010
2029
  })(util || (util = {}));
2011
2030
  var objectUtil;
2012
- (function(objectUtil2) {
2013
- objectUtil2.mergeShapes = (first, second) => {
2031
+ (function(objectUtil) {
2032
+ objectUtil.mergeShapes = (first, second) => {
2014
2033
  return {
2015
2034
  ...first,
2016
2035
  ...second
@@ -2100,11 +2119,6 @@ var ZodIssueCode = util.arrayToEnum([
2100
2119
  "not_multiple_of",
2101
2120
  "not_finite"
2102
2121
  ]);
2103
- var quotelessJson = (obj) => {
2104
- const json = JSON.stringify(obj, null, 2);
2105
- return json.replace(/"([^"]+)":/g, "$1:");
2106
- };
2107
-
2108
2122
  class ZodError extends Error {
2109
2123
  get errors() {
2110
2124
  return this.issues;
@@ -2305,12 +2319,10 @@ var en_default = errorMap;
2305
2319
 
2306
2320
  // node_modules/zod/v3/errors.js
2307
2321
  var overrideErrorMap = en_default;
2308
- function setErrorMap(map) {
2309
- overrideErrorMap = map;
2310
- }
2311
2322
  function getErrorMap() {
2312
2323
  return overrideErrorMap;
2313
2324
  }
2325
+
2314
2326
  // node_modules/zod/v3/helpers/parseUtil.js
2315
2327
  var makeIssue = (params) => {
2316
2328
  const { data, path, errorMaps, issueData } = params;
@@ -2337,7 +2349,6 @@ var makeIssue = (params) => {
2337
2349
  message: errorMessage
2338
2350
  };
2339
2351
  };
2340
- var EMPTY_PATH = [];
2341
2352
  function addIssueToContext(ctx, issueData) {
2342
2353
  const overrideMap = getErrorMap();
2343
2354
  const issue = makeIssue({
@@ -2417,11 +2428,12 @@ var isAborted = (x) => x.status === "aborted";
2417
2428
  var isDirty = (x) => x.status === "dirty";
2418
2429
  var isValid = (x) => x.status === "valid";
2419
2430
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
2431
+
2420
2432
  // node_modules/zod/v3/helpers/errorUtil.js
2421
2433
  var errorUtil;
2422
- (function(errorUtil2) {
2423
- errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
2424
- errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
2434
+ (function(errorUtil) {
2435
+ errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
2436
+ errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
2425
2437
  })(errorUtil || (errorUtil = {}));
2426
2438
 
2427
2439
  // node_modules/zod/v3/types.js
@@ -2466,12 +2478,12 @@ var handleResult = (ctx, result) => {
2466
2478
  function processCreateParams(params) {
2467
2479
  if (!params)
2468
2480
  return {};
2469
- const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
2470
- if (errorMap2 && (invalid_type_error || required_error)) {
2481
+ const { errorMap, invalid_type_error, required_error, description } = params;
2482
+ if (errorMap && (invalid_type_error || required_error)) {
2471
2483
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
2472
2484
  }
2473
- if (errorMap2)
2474
- return { errorMap: errorMap2, description };
2485
+ if (errorMap)
2486
+ return { errorMap, description };
2475
2487
  const customMap = (iss, ctx) => {
2476
2488
  const { message } = params;
2477
2489
  if (iss.code === "invalid_enum_value") {
@@ -2858,11 +2870,11 @@ class ZodString extends ZodType {
2858
2870
  }
2859
2871
  const parsedType = this._getType(input);
2860
2872
  if (parsedType !== ZodParsedType.string) {
2861
- const ctx2 = this._getOrReturnCtx(input);
2862
- addIssueToContext(ctx2, {
2873
+ const ctx = this._getOrReturnCtx(input);
2874
+ addIssueToContext(ctx, {
2863
2875
  code: ZodIssueCode.invalid_type,
2864
2876
  expected: ZodParsedType.string,
2865
- received: ctx2.parsedType
2877
+ received: ctx.parsedType
2866
2878
  });
2867
2879
  return INVALID;
2868
2880
  }
@@ -3416,11 +3428,11 @@ class ZodNumber extends ZodType {
3416
3428
  }
3417
3429
  const parsedType = this._getType(input);
3418
3430
  if (parsedType !== ZodParsedType.number) {
3419
- const ctx2 = this._getOrReturnCtx(input);
3420
- addIssueToContext(ctx2, {
3431
+ const ctx = this._getOrReturnCtx(input);
3432
+ addIssueToContext(ctx, {
3421
3433
  code: ZodIssueCode.invalid_type,
3422
3434
  expected: ZodParsedType.number,
3423
- received: ctx2.parsedType
3435
+ received: ctx.parsedType
3424
3436
  });
3425
3437
  return INVALID;
3426
3438
  }
@@ -3842,17 +3854,17 @@ class ZodDate extends ZodType {
3842
3854
  }
3843
3855
  const parsedType = this._getType(input);
3844
3856
  if (parsedType !== ZodParsedType.date) {
3845
- const ctx2 = this._getOrReturnCtx(input);
3846
- addIssueToContext(ctx2, {
3857
+ const ctx = this._getOrReturnCtx(input);
3858
+ addIssueToContext(ctx, {
3847
3859
  code: ZodIssueCode.invalid_type,
3848
3860
  expected: ZodParsedType.date,
3849
- received: ctx2.parsedType
3861
+ received: ctx.parsedType
3850
3862
  });
3851
3863
  return INVALID;
3852
3864
  }
3853
3865
  if (Number.isNaN(input.data.getTime())) {
3854
- const ctx2 = this._getOrReturnCtx(input);
3855
- addIssueToContext(ctx2, {
3866
+ const ctx = this._getOrReturnCtx(input);
3867
+ addIssueToContext(ctx, {
3856
3868
  code: ZodIssueCode.invalid_date
3857
3869
  });
3858
3870
  return INVALID;
@@ -4140,8 +4152,8 @@ class ZodArray extends ZodType {
4140
4152
  if (ctx.common.async) {
4141
4153
  return Promise.all([...ctx.data].map((item, i) => {
4142
4154
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
4143
- })).then((result2) => {
4144
- return ParseStatus.mergeArray(status, result2);
4155
+ })).then((result) => {
4156
+ return ParseStatus.mergeArray(status, result);
4145
4157
  });
4146
4158
  }
4147
4159
  const result = [...ctx.data].map((item, i) => {
@@ -4222,18 +4234,18 @@ class ZodObject extends ZodType {
4222
4234
  if (this._cached !== null)
4223
4235
  return this._cached;
4224
4236
  const shape = this._def.shape();
4225
- const keys2 = util.objectKeys(shape);
4226
- this._cached = { shape, keys: keys2 };
4237
+ const keys = util.objectKeys(shape);
4238
+ this._cached = { shape, keys };
4227
4239
  return this._cached;
4228
4240
  }
4229
4241
  _parse(input) {
4230
4242
  const parsedType = this._getType(input);
4231
4243
  if (parsedType !== ZodParsedType.object) {
4232
- const ctx2 = this._getOrReturnCtx(input);
4233
- addIssueToContext(ctx2, {
4244
+ const ctx = this._getOrReturnCtx(input);
4245
+ addIssueToContext(ctx, {
4234
4246
  code: ZodIssueCode.invalid_type,
4235
4247
  expected: ZodParsedType.object,
4236
- received: ctx2.parsedType
4248
+ received: ctx.parsedType
4237
4249
  });
4238
4250
  return INVALID;
4239
4251
  }
@@ -4537,7 +4549,7 @@ class ZodUnion extends ZodType {
4537
4549
  ctx.common.issues.push(...dirty.ctx.common.issues);
4538
4550
  return dirty.result;
4539
4551
  }
4540
- const unionErrors = issues.map((issues2) => new ZodError(issues2));
4552
+ const unionErrors = issues.map((issues) => new ZodError(issues));
4541
4553
  addIssueToContext(ctx, {
4542
4554
  code: ZodIssueCode.invalid_union,
4543
4555
  unionErrors
@@ -4977,9 +4989,9 @@ class ZodSet extends ZodType {
4977
4989
  }
4978
4990
  }
4979
4991
  const valueType = this._def.valueType;
4980
- function finalizeSet(elements2) {
4992
+ function finalizeSet(elements) {
4981
4993
  const parsedSet = new Set;
4982
- for (const element of elements2) {
4994
+ for (const element of elements) {
4983
4995
  if (element.status === "aborted")
4984
4996
  return INVALID;
4985
4997
  if (element.status === "dirty")
@@ -4990,7 +5002,7 @@ class ZodSet extends ZodType {
4990
5002
  }
4991
5003
  const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
4992
5004
  if (ctx.common.async) {
4993
- return Promise.all(elements).then((elements2) => finalizeSet(elements2));
5005
+ return Promise.all(elements).then((elements) => finalizeSet(elements));
4994
5006
  } else {
4995
5007
  return finalizeSet(elements);
4996
5008
  }
@@ -5343,11 +5355,11 @@ class ZodEffects extends ZodType {
5343
5355
  if (effect.type === "preprocess") {
5344
5356
  const processed = effect.transform(ctx.data, checkCtx);
5345
5357
  if (ctx.common.async) {
5346
- return Promise.resolve(processed).then(async (processed2) => {
5358
+ return Promise.resolve(processed).then(async (processed) => {
5347
5359
  if (status.value === "aborted")
5348
5360
  return INVALID;
5349
5361
  const result = await this._def.schema._parseAsync({
5350
- data: processed2,
5362
+ data: processed,
5351
5363
  path: ctx.path,
5352
5364
  parent: ctx
5353
5365
  });
@@ -5539,10 +5551,10 @@ class ZodCatch extends ZodType {
5539
5551
  }
5540
5552
  });
5541
5553
  if (isAsync(result)) {
5542
- return result.then((result2) => {
5554
+ return result.then((result) => {
5543
5555
  return {
5544
5556
  status: "valid",
5545
- value: result2.status === "valid" ? result2.value : this._def.catchValue({
5557
+ value: result.status === "valid" ? result.value : this._def.catchValue({
5546
5558
  get error() {
5547
5559
  return new ZodError(newCtx.common.issues);
5548
5560
  },
@@ -5691,78 +5703,48 @@ ZodReadonly.create = (type, params) => {
5691
5703
  ...processCreateParams(params)
5692
5704
  });
5693
5705
  };
5694
- function cleanParams(params, data) {
5695
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
5696
- const p2 = typeof p === "string" ? { message: p } : p;
5697
- return p2;
5698
- }
5699
- function custom(check, _params = {}, fatal) {
5700
- if (check)
5701
- return ZodAny.create().superRefine((data, ctx) => {
5702
- const r = check(data);
5703
- if (r instanceof Promise) {
5704
- return r.then((r2) => {
5705
- if (!r2) {
5706
- const params = cleanParams(_params, data);
5707
- const _fatal = params.fatal ?? fatal ?? true;
5708
- ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
5709
- }
5710
- });
5711
- }
5712
- if (!r) {
5713
- const params = cleanParams(_params, data);
5714
- const _fatal = params.fatal ?? fatal ?? true;
5715
- ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
5716
- }
5717
- return;
5718
- });
5719
- return ZodAny.create();
5720
- }
5721
5706
  var late = {
5722
5707
  object: ZodObject.lazycreate
5723
5708
  };
5724
5709
  var ZodFirstPartyTypeKind;
5725
- (function(ZodFirstPartyTypeKind2) {
5726
- ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
5727
- ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber";
5728
- ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN";
5729
- ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt";
5730
- ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean";
5731
- ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate";
5732
- ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol";
5733
- ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined";
5734
- ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull";
5735
- ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny";
5736
- ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown";
5737
- ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever";
5738
- ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid";
5739
- ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray";
5740
- ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject";
5741
- ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion";
5742
- ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
5743
- ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection";
5744
- ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple";
5745
- ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord";
5746
- ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap";
5747
- ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet";
5748
- ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction";
5749
- ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy";
5750
- ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral";
5751
- ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum";
5752
- ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects";
5753
- ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum";
5754
- ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional";
5755
- ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable";
5756
- ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault";
5757
- ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch";
5758
- ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
5759
- ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
5760
- ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
5761
- ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
5710
+ (function(ZodFirstPartyTypeKind) {
5711
+ ZodFirstPartyTypeKind["ZodString"] = "ZodString";
5712
+ ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
5713
+ ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
5714
+ ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
5715
+ ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
5716
+ ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
5717
+ ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
5718
+ ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
5719
+ ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
5720
+ ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
5721
+ ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
5722
+ ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
5723
+ ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
5724
+ ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
5725
+ ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
5726
+ ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
5727
+ ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
5728
+ ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
5729
+ ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
5730
+ ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
5731
+ ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
5732
+ ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
5733
+ ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
5734
+ ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
5735
+ ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
5736
+ ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
5737
+ ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
5738
+ ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
5739
+ ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
5740
+ ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
5741
+ ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
5742
+ ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
5743
+ ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
5744
+ ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
5745
+ ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
5746
+ ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
5762
5747
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
5763
- var instanceOfType = (cls, params = {
5764
- message: `Input not instance of ${cls.name}`
5765
- }) => custom((data) => data instanceof cls, params);
5766
5748
  var stringType = ZodString.create;
5767
5749
  var numberType = ZodNumber.create;
5768
5750
  var nanType = ZodNaN.create;
@@ -5797,64 +5779,60 @@ var optionalType = ZodOptional.create;
5797
5779
  var nullableType = ZodNullable.create;
5798
5780
  var preprocessType = ZodEffects.createWithPreprocess;
5799
5781
  var pipelineType = ZodPipeline.create;
5800
- var ostring = () => stringType().optional();
5801
- var onumber = () => numberType().optional();
5802
- var oboolean = () => booleanType().optional();
5803
- var coerce = {
5804
- string: (arg) => ZodString.create({ ...arg, coerce: true }),
5805
- number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
5806
- boolean: (arg) => ZodBoolean.create({
5807
- ...arg,
5808
- coerce: true
5809
- }),
5810
- bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
5811
- date: (arg) => ZodDate.create({ ...arg, coerce: true })
5812
- };
5813
- var NEVER = INVALID;
5814
5782
  // src/schemas.ts
5815
5783
  var nullToUndefined = (v) => v ?? undefined;
5816
- var optionalString = exports_external.string().nullish().transform(nullToUndefined);
5817
- var ratingDistributionSchema = exports_external.object({
5818
- average_rating: exports_external.number(),
5819
- display_average_rating: exports_external.string().default("0"),
5820
- display_stars: exports_external.number().default(0),
5821
- num_ratings: exports_external.number(),
5822
- num_five_star_ratings: exports_external.number().default(0),
5823
- num_four_star_ratings: exports_external.number().default(0),
5824
- num_three_star_ratings: exports_external.number().default(0),
5825
- num_two_star_ratings: exports_external.number().default(0),
5826
- num_one_star_ratings: exports_external.number().default(0)
5784
+ var optionalString = stringType().nullish().transform(nullToUndefined);
5785
+ var ratingDistributionSchema = objectType({
5786
+ average_rating: numberType(),
5787
+ display_average_rating: stringType().default("0"),
5788
+ display_stars: numberType().default(0),
5789
+ num_ratings: numberType(),
5790
+ num_five_star_ratings: numberType().default(0),
5791
+ num_four_star_ratings: numberType().default(0),
5792
+ num_three_star_ratings: numberType().default(0),
5793
+ num_two_star_ratings: numberType().default(0),
5794
+ num_one_star_ratings: numberType().default(0)
5827
5795
  });
5828
- var audibleRatingSchema = exports_external.object({
5829
- num_reviews: exports_external.number().default(0),
5796
+ var audibleRatingSchema = objectType({
5797
+ num_reviews: numberType().default(0),
5830
5798
  overall_distribution: ratingDistributionSchema.nullish(),
5831
5799
  performance_distribution: ratingDistributionSchema.nullish(),
5832
5800
  story_distribution: ratingDistributionSchema.nullish()
5833
5801
  }).nullish();
5834
- var categoryLadderSchema = exports_external.object({
5835
- root: exports_external.string().default("Genres"),
5836
- ladder: exports_external.array(exports_external.object({
5837
- id: exports_external.string(),
5838
- name: exports_external.string()
5802
+ var categoryLadderSchema = objectType({
5803
+ root: stringType().default("Genres"),
5804
+ ladder: arrayType(objectType({
5805
+ id: stringType(),
5806
+ name: stringType()
5839
5807
  })).default([])
5840
5808
  });
5841
- var relationshipSchema = exports_external.object({
5842
- asin: exports_external.string(),
5809
+ var relationshipSchema = objectType({
5810
+ asin: stringType(),
5843
5811
  relationship_to_product: optionalString,
5844
5812
  relationship_type: optionalString,
5845
5813
  title: optionalString,
5846
5814
  sort: optionalString,
5847
5815
  url: optionalString
5848
5816
  });
5849
- var audibleRawItemSchema = exports_external.object({
5850
- asin: exports_external.string().min(1),
5851
- title: exports_external.string().min(1),
5817
+ var lastPositionsSchema = objectType({
5818
+ asin_last_position_heard_annots: arrayType(objectType({
5819
+ asin: stringType(),
5820
+ last_position_heard: objectType({
5821
+ status: stringType(),
5822
+ position_ms: numberType().nullish(),
5823
+ last_updated: stringType().nullish()
5824
+ })
5825
+ })).nullish().transform((v) => v ?? [])
5826
+ });
5827
+ var audibleRawItemSchema = objectType({
5828
+ asin: stringType().min(1),
5829
+ title: stringType().min(1),
5852
5830
  subtitle: optionalString,
5853
5831
  isbn: optionalString,
5854
5832
  sku: optionalString,
5855
- authors: exports_external.array(exports_external.object({ name: exports_external.string() })).default([]),
5856
- narrators: exports_external.array(exports_external.object({ name: exports_external.string() })).default([]),
5857
- runtime_length_min: exports_external.number().nonnegative().default(0),
5833
+ authors: arrayType(objectType({ name: stringType() })).default([]),
5834
+ narrators: arrayType(objectType({ name: stringType() })).default([]),
5835
+ runtime_length_min: numberType().nonnegative().default(0),
5858
5836
  publisher_name: optionalString,
5859
5837
  language: optionalString,
5860
5838
  release_date: optionalString,
@@ -5866,29 +5844,29 @@ var audibleRawItemSchema = exports_external.object({
5866
5844
  content_type: optionalString,
5867
5845
  content_delivery_type: optionalString,
5868
5846
  program_participation: optionalString,
5869
- product_images: exports_external.record(exports_external.string(), exports_external.string()).nullish().transform((v) => v ?? {}),
5870
- social_media_images: exports_external.record(exports_external.string(), exports_external.string()).nullish().transform((v) => v ?? {}),
5871
- series: exports_external.array(exports_external.object({
5872
- asin: exports_external.string(),
5873
- title: exports_external.string(),
5847
+ product_images: recordType(stringType(), stringType()).nullish().transform((v) => v ?? {}),
5848
+ social_media_images: recordType(stringType(), stringType()).nullish().transform((v) => v ?? {}),
5849
+ series: arrayType(objectType({
5850
+ asin: stringType(),
5851
+ title: stringType(),
5874
5852
  sequence: optionalString
5875
5853
  })).nullish().transform((v) => v ?? []),
5876
- category_ladders: exports_external.array(categoryLadderSchema).nullish().transform((v) => v ?? []),
5877
- platinum_keywords: exports_external.array(exports_external.string()).nullish().transform((v) => v ?? []),
5878
- thesaurus_subject_keywords: exports_external.array(exports_external.string()).nullish().transform((v) => v ?? []),
5854
+ category_ladders: arrayType(categoryLadderSchema).nullish().transform((v) => v ?? []),
5855
+ platinum_keywords: arrayType(stringType()).nullish().transform((v) => v ?? []),
5856
+ thesaurus_subject_keywords: arrayType(stringType()).nullish().transform((v) => v ?? []),
5879
5857
  rating: audibleRatingSchema,
5880
- listening_status: exports_external.object({
5881
- is_finished: exports_external.boolean().optional(),
5882
- percent_complete: exports_external.number().optional(),
5883
- finished_at_timestamp: exports_external.string().nullish(),
5884
- time_remaining_seconds: exports_external.number().optional()
5858
+ listening_status: objectType({
5859
+ is_finished: booleanType().optional(),
5860
+ percent_complete: numberType().optional(),
5861
+ finished_at_timestamp: stringType().nullish(),
5862
+ time_remaining_seconds: numberType().optional()
5885
5863
  }).nullish().transform(nullToUndefined),
5886
5864
  purchase_date: optionalString,
5887
- library_status: exports_external.object({
5888
- date_added: exports_external.string().nullish()
5865
+ library_status: objectType({
5866
+ date_added: stringType().nullish()
5889
5867
  }).nullish().transform(nullToUndefined),
5890
- relationships: exports_external.array(relationshipSchema).nullish().transform((v) => v ?? []),
5891
- is_adult_product: exports_external.boolean().nullish().transform((v) => v ?? false)
5868
+ relationships: arrayType(relationshipSchema).nullish().transform((v) => v ?? []),
5869
+ is_adult_product: booleanType().nullish().transform((v) => v ?? false)
5892
5870
  });
5893
5871
 
5894
5872
  // src/signing.ts
@@ -6038,14 +6016,14 @@ var catalog = async (credentials, options) => {
6038
6016
  const limit = options.limit ?? 50;
6039
6017
  if (sortBy === "MostVoted") {
6040
6018
  const MAX_PAGES = 20;
6041
- const { items: allItems, credentials: fresh2 } = await fetchCatalogPages(credentials, categoryId, options, MAX_PAGES);
6019
+ const { items: allItems, credentials: fresh } = await fetchCatalogPages(credentials, categoryId, options, MAX_PAGES);
6042
6020
  const sorted = orderBy_default(uniqBy_default(allItems, ({ asin }) => asin), [
6043
6021
  ({ rating }) => rating?.overallDistribution?.numRatings ?? 0,
6044
6022
  ({ rating }) => rating?.overallDistribution?.averageRating ?? 0
6045
6023
  ], ["desc", "desc"]);
6046
6024
  return {
6047
6025
  items: limit === "all" ? sorted : sorted.slice(0, limit),
6048
- credentials: fresh2
6026
+ credentials: fresh
6049
6027
  };
6050
6028
  }
6051
6029
  const { data: response, credentials: fresh } = await audibleFetch("/catalog/products", credentials, {
@@ -6064,6 +6042,23 @@ var catalog = async (credentials, options) => {
6064
6042
  var RESPONSE_GROUPS = "product_details,contributors,media,product_attrs,listening_status,series,rating,category_ladders,product_desc,product_extended_attrs,relationships";
6065
6043
  var library = async (credentials) => fetchAllPages("/library", credentials, RESPONSE_GROUPS);
6066
6044
  var wishlist = async (credentials) => fetchAllPages("/wishlist", credentials, RESPONSE_GROUPS);
6045
+ var POSITIONS_BATCH_SIZE = 25;
6046
+ var utcDateOf = (value) => new Date(`${value.replace(" ", "T")}Z`);
6047
+ var fetchPositionBatches = async (batches, credentials, accumulated = []) => {
6048
+ const [batch, ...rest] = batches;
6049
+ if (!batch)
6050
+ return { positions: accumulated, credentials };
6051
+ const { data, credentials: fresh } = await audibleFetch("/annotations/lastpositions", credentials, { asins: batch.join(",") });
6052
+ const heard = lastPositionsSchema.parse(data).asin_last_position_heard_annots.flatMap(({ asin, last_position_heard: position }) => position.status === "Exists" && position.last_updated ? [
6053
+ {
6054
+ asin,
6055
+ positionMs: position.position_ms ?? 0,
6056
+ lastUpdatedAt: utcDateOf(position.last_updated)
6057
+ }
6058
+ ] : []);
6059
+ return fetchPositionBatches(rest, fresh, [...accumulated, ...heard]);
6060
+ };
6061
+ var lastPositions = async (credentials, asins) => fetchPositionBatches(chunk_default([...asins], POSITIONS_BATCH_SIZE), credentials);
6067
6062
  var verify = async (credentials) => {
6068
6063
  await audibleFetch("/library", credentials, {
6069
6064
  num_results: "1",
@@ -6072,14 +6067,15 @@ var verify = async (credentials) => {
6072
6067
  });
6073
6068
  };
6074
6069
  export {
6075
- wishlist,
6076
- verify,
6077
- resolveGenreId,
6078
- register,
6079
- refresh,
6080
- login,
6081
- library,
6082
- catalog,
6070
+ AUDIBLE_LOCALES,
6083
6071
  GENRE_CATEGORIES,
6084
- AUDIBLE_LOCALES
6072
+ catalog,
6073
+ lastPositions,
6074
+ library,
6075
+ login,
6076
+ refresh,
6077
+ register,
6078
+ resolveGenreId,
6079
+ verify,
6080
+ wishlist
6085
6081
  };