audible-api-ts 0.2.0 → 0.3.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/categories.d.ts +8 -2
- package/dist/categories.d.ts.map +1 -1
- package/dist/categories.int.test.d.ts +2 -0
- package/dist/categories.int.test.d.ts.map +1 -0
- package/dist/index.js +230 -380
- package/package.json +1 -1
package/dist/categories.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { AudibleLocale } from './types.js';
|
|
2
2
|
/** Human-readable genre and sub-genre names for catalog search */
|
|
3
|
-
export type AudibleGenre = 'science-fiction' | 'fantasy' | 'science-fiction-fantasy' | 'thriller' | 'mystery' | 'horror' | 'romance' | 'historical-fiction' | 'literary-fiction' | 'biography' | 'history' | 'business' | 'self-help' | 'science' | 'children' | 'young-adult' | 'comedy' | 'erotica' | 'religion' | 'sports' | 'travel' | 'lgbtq' | 'science-fiction/adventure' | 'science-fiction/adaptations' | 'science-fiction/cyberpunk' | 'science-fiction/dystopian' | 'science-fiction/first-contact' | 'science-fiction/galactic-empire' | 'science-fiction/genetic-engineering' | 'science-fiction/military' | 'science-fiction/post-apocalyptic' | 'science-fiction/space-exploration' | 'science-fiction/space-opera' | 'fantasy/action-adventure' | 'fantasy/adaptations' | 'fantasy/dragons' | 'fantasy/epic' | 'fantasy/historical' | 'fantasy/urban-paranormal' | 'thriller/suspense' | 'thriller/psychological' | 'thriller/domestic' | 'thriller/historical' | 'mystery/amateur-sleuth' | 'mystery/detective' | 'mystery/historical' | 'mystery/noir' | 'mystery/private-investigator' | 'mystery/traditional' | 'romance/action-adventure' | 'romance/comedy' | 'romance/contemporary' | 'romance/fantasy' | 'romance/historical' | 'romance/paranormal' | 'romance/science-fiction' | 'romance/sports' | 'romance/suspense' | 'literary-fiction/action-adventure' | 'literary-fiction/classics' | 'literary-fiction/coming-of-age' | 'literary-fiction/contemporary' | 'literary-fiction/drama' | 'literary-fiction/family-life' | 'literary-fiction/historical' | 'literary-fiction/sagas' | 'literary-fiction/sea-adventures' | 'literary-fiction/world-literature' | 'biography/entertainment' | 'history/europe' | 'children/action-adventure' | 'young-adult/literary-fiction' | 'young-adult/romance' | 'young-adult/science-fiction-fantasy' | 'young-adult/thriller';
|
|
4
|
-
/**
|
|
3
|
+
export type AudibleGenre = 'science-fiction' | 'fantasy' | 'science-fiction-fantasy' | 'mystery-thriller-suspense' | 'thriller' | 'mystery' | 'crime-fiction' | 'horror' | 'romance' | 'historical-fiction' | 'literary-fiction' | 'biography' | 'history' | 'business' | 'self-help' | 'science' | 'children' | 'young-adult' | 'comedy' | 'erotica' | 'religion' | 'sports' | 'travel' | 'lgbtq' | 'science-fiction/adventure' | 'science-fiction/adaptations' | 'science-fiction/cyberpunk' | 'science-fiction/dystopian' | 'science-fiction/first-contact' | 'science-fiction/galactic-empire' | 'science-fiction/genetic-engineering' | 'science-fiction/military' | 'science-fiction/post-apocalyptic' | 'science-fiction/space-exploration' | 'science-fiction/space-opera' | 'fantasy/action-adventure' | 'fantasy/adaptations' | 'fantasy/dragons' | 'fantasy/epic' | 'fantasy/historical' | 'fantasy/sword-sorcery' | 'fantasy/urban-paranormal' | 'thriller/suspense' | 'thriller/psychological' | 'thriller/domestic' | 'thriller/historical' | 'mystery/amateur-sleuth' | 'mystery/cozy' | 'mystery/detective' | 'mystery/hard-boiled' | 'mystery/historical' | 'mystery/noir' | 'mystery/police-procedural' | 'mystery/private-investigator' | 'mystery/traditional' | 'romance/action-adventure' | 'romance/comedy' | 'romance/contemporary' | 'romance/fantasy' | 'romance/historical' | 'romance/paranormal' | 'romance/science-fiction' | 'romance/sports' | 'romance/suspense' | 'literary-fiction/action-adventure' | 'literary-fiction/classics' | 'literary-fiction/coming-of-age' | 'literary-fiction/contemporary' | 'literary-fiction/drama' | 'literary-fiction/family-life' | 'literary-fiction/fiction' | 'literary-fiction/historical' | 'literary-fiction/sagas' | 'literary-fiction/sea-adventures' | 'literary-fiction/world-literature' | 'biography/entertainment' | 'history/europe' | 'children/action-adventure' | 'children/mystery' | 'children/science-fiction-fantasy' | 'children/fantasy' | 'children/science-fiction' | 'young-adult/literary-fiction' | 'young-adult/romance' | 'young-adult/science-fiction-fantasy' | 'young-adult/fantasy' | 'young-adult/science-fiction' | 'young-adult/thriller';
|
|
4
|
+
/**
|
|
5
|
+
* Mapping from genre name to locale-specific Audible category ID.
|
|
6
|
+
*
|
|
7
|
+
* Every id is checked against the live catalogue by `categories.int.test.ts`, which
|
|
8
|
+
* asserts the name Audible gives it. A category can sit under several parents, so
|
|
9
|
+
* the id is the same wherever the store shows it.
|
|
10
|
+
*/
|
|
5
11
|
export declare const GENRE_CATEGORIES: Record<AudibleGenre, Partial<Record<AudibleLocale, string>>>;
|
|
6
12
|
/**
|
|
7
13
|
* Resolve a genre name to a locale-specific Audible category ID.
|
package/dist/categories.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../src/categories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,kEAAkE;AAClE,MAAM,MAAM,YAAY,GAEpB,iBAAiB,GACjB,SAAS,GACT,yBAAyB,GACzB,UAAU,GACV,SAAS,GACT,QAAQ,GACR,SAAS,GACT,oBAAoB,GACpB,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,UAAU,GACV,WAAW,GACX,SAAS,GACT,UAAU,GACV,aAAa,GACb,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,OAAO,GAEP,2BAA2B,GAC3B,6BAA6B,GAC7B,2BAA2B,GAC3B,2BAA2B,GAC3B,+BAA+B,GAC/B,iCAAiC,GACjC,qCAAqC,GACrC,0BAA0B,GAC1B,kCAAkC,GAClC,mCAAmC,GACnC,6BAA6B,GAE7B,0BAA0B,GAC1B,qBAAqB,GACrB,iBAAiB,GACjB,cAAc,GACd,oBAAoB,GACpB,0BAA0B,GAE1B,mBAAmB,GACnB,wBAAwB,GACxB,mBAAmB,GACnB,qBAAqB,GAErB,wBAAwB,GACxB,mBAAmB,GACnB,oBAAoB,GACpB,cAAc,GACd,8BAA8B,GAC9B,qBAAqB,GAErB,0BAA0B,GAC1B,gBAAgB,GAChB,sBAAsB,GACtB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,yBAAyB,GACzB,gBAAgB,GAChB,kBAAkB,GAElB,mCAAmC,GACnC,2BAA2B,GAC3B,gCAAgC,GAChC,+BAA+B,GAC/B,wBAAwB,GACxB,8BAA8B,GAC9B,6BAA6B,GAC7B,wBAAwB,GACxB,iCAAiC,GACjC,mCAAmC,GAEnC,yBAAyB,GAEzB,gBAAgB,GAEhB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../src/categories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,kEAAkE;AAClE,MAAM,MAAM,YAAY,GAEpB,iBAAiB,GACjB,SAAS,GACT,yBAAyB,GACzB,2BAA2B,GAC3B,UAAU,GACV,SAAS,GACT,eAAe,GACf,QAAQ,GACR,SAAS,GACT,oBAAoB,GACpB,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,UAAU,GACV,WAAW,GACX,SAAS,GACT,UAAU,GACV,aAAa,GACb,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,OAAO,GAEP,2BAA2B,GAC3B,6BAA6B,GAC7B,2BAA2B,GAC3B,2BAA2B,GAC3B,+BAA+B,GAC/B,iCAAiC,GACjC,qCAAqC,GACrC,0BAA0B,GAC1B,kCAAkC,GAClC,mCAAmC,GACnC,6BAA6B,GAE7B,0BAA0B,GAC1B,qBAAqB,GACrB,iBAAiB,GACjB,cAAc,GACd,oBAAoB,GACpB,uBAAuB,GACvB,0BAA0B,GAE1B,mBAAmB,GACnB,wBAAwB,GACxB,mBAAmB,GACnB,qBAAqB,GAErB,wBAAwB,GACxB,cAAc,GACd,mBAAmB,GACnB,qBAAqB,GACrB,oBAAoB,GACpB,cAAc,GACd,2BAA2B,GAC3B,8BAA8B,GAC9B,qBAAqB,GAErB,0BAA0B,GAC1B,gBAAgB,GAChB,sBAAsB,GACtB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,yBAAyB,GACzB,gBAAgB,GAChB,kBAAkB,GAElB,mCAAmC,GACnC,2BAA2B,GAC3B,gCAAgC,GAChC,+BAA+B,GAC/B,wBAAwB,GACxB,8BAA8B,GAC9B,0BAA0B,GAC1B,6BAA6B,GAC7B,wBAAwB,GACxB,iCAAiC,GACjC,mCAAmC,GAEnC,yBAAyB,GAEzB,gBAAgB,GAEhB,2BAA2B,GAC3B,kBAAkB,GAClB,kCAAkC,GAClC,kBAAkB,GAClB,0BAA0B,GAE1B,8BAA8B,GAC9B,qBAAqB,GACrB,qCAAqC,GACrC,qBAAqB,GACrB,6BAA6B,GAC7B,sBAAsB,CAAA;AAE1B;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CA8GzF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,YAAY,EAAE,QAAQ,aAAa,WAQxE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.int.test.d.ts","sourceRoot":"","sources":["../src/categories.int.test.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -656,8 +656,8 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
656
656
|
break;
|
|
657
657
|
}
|
|
658
658
|
if (seen) {
|
|
659
|
-
if (!_arraySome_default(other, function(
|
|
660
|
-
if (!_cacheHas_default(seen, othIndex) && (arrValue ===
|
|
659
|
+
if (!_arraySome_default(other, function(othValue, othIndex) {
|
|
660
|
+
if (!_cacheHas_default(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
661
661
|
return seen.push(othIndex);
|
|
662
662
|
}
|
|
663
663
|
})) {
|
|
@@ -1389,8 +1389,8 @@ var _baseEach_default = baseEach;
|
|
|
1389
1389
|
// node_modules/lodash-es/_baseMap.js
|
|
1390
1390
|
function baseMap(collection, iteratee) {
|
|
1391
1391
|
var index = -1, result = isArrayLike_default(collection) ? Array(collection.length) : [];
|
|
1392
|
-
_baseEach_default(collection, function(value, key,
|
|
1393
|
-
result[++index] = iteratee(value, key,
|
|
1392
|
+
_baseEach_default(collection, function(value, key, collection) {
|
|
1393
|
+
result[++index] = iteratee(value, key, collection);
|
|
1394
1394
|
});
|
|
1395
1395
|
return result;
|
|
1396
1396
|
}
|
|
@@ -1456,7 +1456,7 @@ function baseOrderBy(collection, iteratees, orders) {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
var index = -1;
|
|
1458
1458
|
iteratees = _arrayMap_default(iteratees, _baseUnary_default(_baseIteratee_default));
|
|
1459
|
-
var result = _baseMap_default(collection, function(value, key,
|
|
1459
|
+
var result = _baseMap_default(collection, function(value, key, collection) {
|
|
1460
1460
|
var criteria = _arrayMap_default(iteratees, function(iteratee) {
|
|
1461
1461
|
return iteratee(value);
|
|
1462
1462
|
});
|
|
@@ -1603,78 +1603,91 @@ var GENRE_CATEGORIES = {
|
|
|
1603
1603
|
"science-fiction": { fr: "21229020031", com: "18580628011" },
|
|
1604
1604
|
fantasy: { fr: "21229021031", com: "18580607011" },
|
|
1605
1605
|
"science-fiction-fantasy": { fr: "21228885031", com: "18580606011" },
|
|
1606
|
-
thriller: { fr: "
|
|
1607
|
-
|
|
1608
|
-
|
|
1606
|
+
"mystery-thriller-suspense": { fr: "21228876031", com: "18574597011" },
|
|
1607
|
+
thriller: { fr: "21228906031", com: "18574621011" },
|
|
1608
|
+
mystery: { fr: "21228905031", com: "18574606011" },
|
|
1609
|
+
"crime-fiction": { fr: "21228907031", com: "18574598011" },
|
|
1610
|
+
horror: { fr: "21229011031", com: "18574490011" },
|
|
1609
1611
|
romance: { fr: "21228893031", com: "18580518011" },
|
|
1610
|
-
"historical-fiction": { fr: "21229010031" },
|
|
1611
|
-
"literary-fiction": { fr: "21228884031", com: "
|
|
1612
|
+
"historical-fiction": { fr: "21229010031", com: "18574482011" },
|
|
1613
|
+
"literary-fiction": { fr: "21228884031", com: "18574426011" },
|
|
1612
1614
|
biography: { fr: "21228881031", com: "18571951011" },
|
|
1613
|
-
history: { fr: "21228890031" },
|
|
1614
|
-
business: { fr: "21228882031", com: "
|
|
1615
|
-
"self-help": { fr: "21228892031", com: "
|
|
1616
|
-
science: { fr: "21228897031", com: "
|
|
1615
|
+
history: { fr: "21228890031", com: "18573518011" },
|
|
1616
|
+
business: { fr: "21228882031", com: "18572029011" },
|
|
1617
|
+
"self-help": { fr: "21228892031", com: "18574784011" },
|
|
1618
|
+
science: { fr: "21228897031", com: "18580540011" },
|
|
1617
1619
|
children: { fr: "21228877031", com: "18572091011" },
|
|
1618
|
-
"young-adult": { fr: "21228895031" },
|
|
1619
|
-
comedy: { fr: "34003928031", com: "
|
|
1620
|
-
erotica: { fr: "21228894031", com: "
|
|
1621
|
-
religion: { fr: "21228880031", com: "
|
|
1622
|
-
sports: { fr: "21228879031", com: "
|
|
1623
|
-
travel: { fr: "21228891031", com: "
|
|
1624
|
-
lgbtq: { fr: "21228883031", com: "
|
|
1620
|
+
"young-adult": { fr: "21228895031", com: "18580715011" },
|
|
1621
|
+
comedy: { fr: "34003928031", com: "24427740011" },
|
|
1622
|
+
erotica: { fr: "21228894031", com: "18573351011" },
|
|
1623
|
+
religion: { fr: "21228880031", com: "18574839011" },
|
|
1624
|
+
sports: { fr: "21228879031", com: "18580648011" },
|
|
1625
|
+
travel: { fr: "21228891031", com: "18581095011" },
|
|
1626
|
+
lgbtq: { fr: "21228883031", com: "18573743011" },
|
|
1625
1627
|
"science-fiction/adventure": { fr: "21229681031", com: "18580629011" },
|
|
1626
|
-
"science-fiction/adaptations": { fr: "21229683031" },
|
|
1628
|
+
"science-fiction/adaptations": { fr: "21229683031", com: "18580642011" },
|
|
1627
1629
|
"science-fiction/cyberpunk": { fr: "21229684031", com: "18580633011" },
|
|
1628
|
-
"science-fiction/dystopian": { fr: "21229685031", com: "
|
|
1629
|
-
"science-fiction/first-contact": { fr: "21229682031", com: "
|
|
1630
|
-
"science-fiction/galactic-empire": { fr: "21229693031"
|
|
1631
|
-
"science-fiction/genetic-engineering": { fr: "21229686031", com: "
|
|
1632
|
-
"science-fiction/military": { fr: "21229688031", com: "
|
|
1633
|
-
"science-fiction/post-apocalyptic": { fr: "21229687031", com: "
|
|
1634
|
-
"science-fiction/space-exploration": { fr: "21229689031", com: "
|
|
1635
|
-
"science-fiction/space-opera": { fr: "21229694031", com: "
|
|
1630
|
+
"science-fiction/dystopian": { fr: "21229685031", com: "18580635011" },
|
|
1631
|
+
"science-fiction/first-contact": { fr: "21229682031", com: "18580636011" },
|
|
1632
|
+
"science-fiction/galactic-empire": { fr: "21229693031" },
|
|
1633
|
+
"science-fiction/genetic-engineering": { fr: "21229686031", com: "18580638011" },
|
|
1634
|
+
"science-fiction/military": { fr: "21229688031", com: "18580641011" },
|
|
1635
|
+
"science-fiction/post-apocalyptic": { fr: "21229687031", com: "18580643011" },
|
|
1636
|
+
"science-fiction/space-exploration": { fr: "21229689031", com: "18580644011" },
|
|
1637
|
+
"science-fiction/space-opera": { fr: "21229694031", com: "18580645011" },
|
|
1636
1638
|
"fantasy/action-adventure": { fr: "21229712031", com: "18580608011" },
|
|
1637
|
-
"fantasy/adaptations": { fr: "21229708031" },
|
|
1638
|
-
"fantasy/dragons": { fr: "21229709031", com: "
|
|
1639
|
-
"fantasy/epic": { fr: "21229701031", com: "
|
|
1640
|
-
"fantasy/historical": { fr: "21229700031", com: "
|
|
1641
|
-
"fantasy/
|
|
1642
|
-
"
|
|
1643
|
-
"thriller/
|
|
1644
|
-
"thriller/
|
|
1645
|
-
"thriller/
|
|
1646
|
-
"
|
|
1647
|
-
"mystery/
|
|
1648
|
-
"mystery/
|
|
1649
|
-
"mystery/
|
|
1650
|
-
"mystery/
|
|
1651
|
-
"mystery/
|
|
1652
|
-
"
|
|
1653
|
-
"
|
|
1654
|
-
"
|
|
1655
|
-
"
|
|
1656
|
-
"romance/
|
|
1657
|
-
"romance/
|
|
1658
|
-
"romance/
|
|
1659
|
-
"romance/
|
|
1660
|
-
"romance/
|
|
1661
|
-
"
|
|
1662
|
-
"
|
|
1663
|
-
"
|
|
1664
|
-
"
|
|
1665
|
-
"literary-fiction/
|
|
1666
|
-
"literary-fiction/
|
|
1667
|
-
"literary-fiction/
|
|
1668
|
-
"literary-fiction/
|
|
1669
|
-
"literary-fiction/
|
|
1670
|
-
"literary-fiction/
|
|
1671
|
-
"
|
|
1672
|
-
"
|
|
1673
|
-
"
|
|
1674
|
-
"
|
|
1675
|
-
"
|
|
1676
|
-
"
|
|
1677
|
-
"
|
|
1639
|
+
"fantasy/adaptations": { fr: "21229708031", com: "18580621011" },
|
|
1640
|
+
"fantasy/dragons": { fr: "21229709031", com: "18580613011" },
|
|
1641
|
+
"fantasy/epic": { fr: "21229701031", com: "18580615011" },
|
|
1642
|
+
"fantasy/historical": { fr: "21229700031", com: "18580618011" },
|
|
1643
|
+
"fantasy/sword-sorcery": { fr: "21229713031", com: "18580627011" },
|
|
1644
|
+
"fantasy/urban-paranormal": { fr: "21229711031", com: "18580622011" },
|
|
1645
|
+
"thriller/suspense": { fr: "21229158031", com: "18574639011" },
|
|
1646
|
+
"thriller/psychological": { fr: "21229165031", com: "18574631011" },
|
|
1647
|
+
"thriller/domestic": { fr: "21229163031", com: "18574624011" },
|
|
1648
|
+
"thriller/historical": { fr: "21229168031", com: "18574627011" },
|
|
1649
|
+
"mystery/amateur-sleuth": { fr: "21229145031", com: "18574607011" },
|
|
1650
|
+
"mystery/cozy": { fr: "21229150031", com: "18574609011" },
|
|
1651
|
+
"mystery/detective": { fr: "21229148031", com: "18574618011" },
|
|
1652
|
+
"mystery/hard-boiled": { fr: "21229153031", com: "18574614011" },
|
|
1653
|
+
"mystery/historical": { fr: "21229155031", com: "18574615011" },
|
|
1654
|
+
"mystery/noir": { fr: "21229177031", com: "18574602011" },
|
|
1655
|
+
"mystery/police-procedural": { fr: "21229144031", com: "18574617011" },
|
|
1656
|
+
"mystery/private-investigator": { fr: "21229148031", com: "18574618011" },
|
|
1657
|
+
"mystery/traditional": { fr: "21229152031", com: "18574619011" },
|
|
1658
|
+
"romance/action-adventure": { fr: "21229096031", com: "18580519011" },
|
|
1659
|
+
"romance/comedy": { fr: "21229087031", com: "18580535011" },
|
|
1660
|
+
"romance/contemporary": { fr: "21230152031", com: "18580522011" },
|
|
1661
|
+
"romance/fantasy": { fr: "21229095031", com: "18580523011" },
|
|
1662
|
+
"romance/historical": { fr: "21229093031", com: "18580524011" },
|
|
1663
|
+
"romance/paranormal": { fr: "21229088031", com: "18580534011" },
|
|
1664
|
+
"romance/science-fiction": { fr: "21229085031", com: "18580537011" },
|
|
1665
|
+
"romance/sports": { fr: "21229086031", com: "18580538011" },
|
|
1666
|
+
"romance/suspense": { fr: "21229090031", com: "18580536011" },
|
|
1667
|
+
"literary-fiction/action-adventure": { fr: "21229016031", com: "18574427011" },
|
|
1668
|
+
"literary-fiction/classics": { fr: "21229007031", com: "18574449011" },
|
|
1669
|
+
"literary-fiction/coming-of-age": { fr: "21229655031", com: "18574461011" },
|
|
1670
|
+
"literary-fiction/contemporary": { fr: "21229657031", com: "18574462011" },
|
|
1671
|
+
"literary-fiction/drama": { fr: "21229017031", com: "18574450011" },
|
|
1672
|
+
"literary-fiction/family-life": { fr: "21229670031", com: "18574465011" },
|
|
1673
|
+
"literary-fiction/fiction": { fr: "21229019031", com: "18574456011" },
|
|
1674
|
+
"literary-fiction/historical": { fr: "21229010031", com: "18574482011" },
|
|
1675
|
+
"literary-fiction/sagas": { fr: "21229654031", com: "18574476011" },
|
|
1676
|
+
"literary-fiction/sea-adventures": { fr: "21229673031", com: "18574434011" },
|
|
1677
|
+
"literary-fiction/world-literature": { fr: "21229018031", com: "18574521011" },
|
|
1678
|
+
"biography/entertainment": { fr: "21228985031", com: "18571984011" },
|
|
1679
|
+
"history/europe": { fr: "21229067031", com: "18573582011" },
|
|
1680
|
+
"children/action-adventure": { fr: "21228913031", com: "18572092011" },
|
|
1681
|
+
"children/mystery": { fr: "21228927031", com: "18572548011" },
|
|
1682
|
+
"children/science-fiction-fantasy": { fr: "21228926031", com: "18572586011" },
|
|
1683
|
+
"children/fantasy": { fr: "21229338031", com: "18572587011" },
|
|
1684
|
+
"children/science-fiction": { fr: "21229339031", com: "18572593011" },
|
|
1685
|
+
"young-adult/literary-fiction": { fr: "21229110031", com: "18580894011" },
|
|
1686
|
+
"young-adult/romance": { fr: "21229117031", com: "18581004011" },
|
|
1687
|
+
"young-adult/science-fiction-fantasy": { fr: "21229103031", com: "18581048011" },
|
|
1688
|
+
"young-adult/fantasy": { fr: "21230013031", com: "18581049011" },
|
|
1689
|
+
"young-adult/science-fiction": { fr: "21230014031", com: "18581062011" },
|
|
1690
|
+
"young-adult/thriller": { fr: "21229114031", com: "18580961011" }
|
|
1678
1691
|
};
|
|
1679
1692
|
var resolveGenreId = (genre, locale) => {
|
|
1680
1693
|
const id = GENRE_CATEGORIES[genre]?.[locale];
|
|
@@ -1838,170 +1851,58 @@ var refresh = async (credentials) => {
|
|
|
1838
1851
|
};
|
|
1839
1852
|
};
|
|
1840
1853
|
|
|
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
1854
|
// node_modules/zod/v3/helpers/util.js
|
|
1954
1855
|
var util;
|
|
1955
|
-
(function(
|
|
1956
|
-
|
|
1856
|
+
(function(util) {
|
|
1857
|
+
util.assertEqual = (_) => {};
|
|
1957
1858
|
function assertIs(_arg) {}
|
|
1958
|
-
|
|
1859
|
+
util.assertIs = assertIs;
|
|
1959
1860
|
function assertNever(_x) {
|
|
1960
1861
|
throw new Error;
|
|
1961
1862
|
}
|
|
1962
|
-
|
|
1963
|
-
|
|
1863
|
+
util.assertNever = assertNever;
|
|
1864
|
+
util.arrayToEnum = (items) => {
|
|
1964
1865
|
const obj = {};
|
|
1965
1866
|
for (const item of items) {
|
|
1966
1867
|
obj[item] = item;
|
|
1967
1868
|
}
|
|
1968
1869
|
return obj;
|
|
1969
1870
|
};
|
|
1970
|
-
|
|
1971
|
-
const validKeys =
|
|
1871
|
+
util.getValidEnumValues = (obj) => {
|
|
1872
|
+
const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
1972
1873
|
const filtered = {};
|
|
1973
1874
|
for (const k of validKeys) {
|
|
1974
1875
|
filtered[k] = obj[k];
|
|
1975
1876
|
}
|
|
1976
|
-
return
|
|
1877
|
+
return util.objectValues(filtered);
|
|
1977
1878
|
};
|
|
1978
|
-
|
|
1979
|
-
return
|
|
1879
|
+
util.objectValues = (obj) => {
|
|
1880
|
+
return util.objectKeys(obj).map(function(e) {
|
|
1980
1881
|
return obj[e];
|
|
1981
1882
|
});
|
|
1982
1883
|
};
|
|
1983
|
-
|
|
1984
|
-
const
|
|
1884
|
+
util.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
1885
|
+
const keys = [];
|
|
1985
1886
|
for (const key in object) {
|
|
1986
1887
|
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
1987
|
-
|
|
1888
|
+
keys.push(key);
|
|
1988
1889
|
}
|
|
1989
1890
|
}
|
|
1990
|
-
return
|
|
1891
|
+
return keys;
|
|
1991
1892
|
};
|
|
1992
|
-
|
|
1893
|
+
util.find = (arr, checker) => {
|
|
1993
1894
|
for (const item of arr) {
|
|
1994
1895
|
if (checker(item))
|
|
1995
1896
|
return item;
|
|
1996
1897
|
}
|
|
1997
1898
|
return;
|
|
1998
1899
|
};
|
|
1999
|
-
|
|
1900
|
+
util.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
2000
1901
|
function joinValues(array, separator = " | ") {
|
|
2001
1902
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
2002
1903
|
}
|
|
2003
|
-
|
|
2004
|
-
|
|
1904
|
+
util.joinValues = joinValues;
|
|
1905
|
+
util.jsonStringifyReplacer = (_, value) => {
|
|
2005
1906
|
if (typeof value === "bigint") {
|
|
2006
1907
|
return value.toString();
|
|
2007
1908
|
}
|
|
@@ -2009,8 +1910,8 @@ var util;
|
|
|
2009
1910
|
};
|
|
2010
1911
|
})(util || (util = {}));
|
|
2011
1912
|
var objectUtil;
|
|
2012
|
-
(function(
|
|
2013
|
-
|
|
1913
|
+
(function(objectUtil) {
|
|
1914
|
+
objectUtil.mergeShapes = (first, second) => {
|
|
2014
1915
|
return {
|
|
2015
1916
|
...first,
|
|
2016
1917
|
...second
|
|
@@ -2100,11 +2001,6 @@ var ZodIssueCode = util.arrayToEnum([
|
|
|
2100
2001
|
"not_multiple_of",
|
|
2101
2002
|
"not_finite"
|
|
2102
2003
|
]);
|
|
2103
|
-
var quotelessJson = (obj) => {
|
|
2104
|
-
const json = JSON.stringify(obj, null, 2);
|
|
2105
|
-
return json.replace(/"([^"]+)":/g, "$1:");
|
|
2106
|
-
};
|
|
2107
|
-
|
|
2108
2004
|
class ZodError extends Error {
|
|
2109
2005
|
get errors() {
|
|
2110
2006
|
return this.issues;
|
|
@@ -2305,12 +2201,10 @@ var en_default = errorMap;
|
|
|
2305
2201
|
|
|
2306
2202
|
// node_modules/zod/v3/errors.js
|
|
2307
2203
|
var overrideErrorMap = en_default;
|
|
2308
|
-
function setErrorMap(map) {
|
|
2309
|
-
overrideErrorMap = map;
|
|
2310
|
-
}
|
|
2311
2204
|
function getErrorMap() {
|
|
2312
2205
|
return overrideErrorMap;
|
|
2313
2206
|
}
|
|
2207
|
+
|
|
2314
2208
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
2315
2209
|
var makeIssue = (params) => {
|
|
2316
2210
|
const { data, path, errorMaps, issueData } = params;
|
|
@@ -2337,7 +2231,6 @@ var makeIssue = (params) => {
|
|
|
2337
2231
|
message: errorMessage
|
|
2338
2232
|
};
|
|
2339
2233
|
};
|
|
2340
|
-
var EMPTY_PATH = [];
|
|
2341
2234
|
function addIssueToContext(ctx, issueData) {
|
|
2342
2235
|
const overrideMap = getErrorMap();
|
|
2343
2236
|
const issue = makeIssue({
|
|
@@ -2417,11 +2310,12 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
2417
2310
|
var isDirty = (x) => x.status === "dirty";
|
|
2418
2311
|
var isValid = (x) => x.status === "valid";
|
|
2419
2312
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
2313
|
+
|
|
2420
2314
|
// node_modules/zod/v3/helpers/errorUtil.js
|
|
2421
2315
|
var errorUtil;
|
|
2422
|
-
(function(
|
|
2423
|
-
|
|
2424
|
-
|
|
2316
|
+
(function(errorUtil) {
|
|
2317
|
+
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
2318
|
+
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
2425
2319
|
})(errorUtil || (errorUtil = {}));
|
|
2426
2320
|
|
|
2427
2321
|
// node_modules/zod/v3/types.js
|
|
@@ -2466,12 +2360,12 @@ var handleResult = (ctx, result) => {
|
|
|
2466
2360
|
function processCreateParams(params) {
|
|
2467
2361
|
if (!params)
|
|
2468
2362
|
return {};
|
|
2469
|
-
const { errorMap
|
|
2470
|
-
if (
|
|
2363
|
+
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
2364
|
+
if (errorMap && (invalid_type_error || required_error)) {
|
|
2471
2365
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
2472
2366
|
}
|
|
2473
|
-
if (
|
|
2474
|
-
return { errorMap
|
|
2367
|
+
if (errorMap)
|
|
2368
|
+
return { errorMap, description };
|
|
2475
2369
|
const customMap = (iss, ctx) => {
|
|
2476
2370
|
const { message } = params;
|
|
2477
2371
|
if (iss.code === "invalid_enum_value") {
|
|
@@ -2858,11 +2752,11 @@ class ZodString extends ZodType {
|
|
|
2858
2752
|
}
|
|
2859
2753
|
const parsedType = this._getType(input);
|
|
2860
2754
|
if (parsedType !== ZodParsedType.string) {
|
|
2861
|
-
const
|
|
2862
|
-
addIssueToContext(
|
|
2755
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2756
|
+
addIssueToContext(ctx, {
|
|
2863
2757
|
code: ZodIssueCode.invalid_type,
|
|
2864
2758
|
expected: ZodParsedType.string,
|
|
2865
|
-
received:
|
|
2759
|
+
received: ctx.parsedType
|
|
2866
2760
|
});
|
|
2867
2761
|
return INVALID;
|
|
2868
2762
|
}
|
|
@@ -3416,11 +3310,11 @@ class ZodNumber extends ZodType {
|
|
|
3416
3310
|
}
|
|
3417
3311
|
const parsedType = this._getType(input);
|
|
3418
3312
|
if (parsedType !== ZodParsedType.number) {
|
|
3419
|
-
const
|
|
3420
|
-
addIssueToContext(
|
|
3313
|
+
const ctx = this._getOrReturnCtx(input);
|
|
3314
|
+
addIssueToContext(ctx, {
|
|
3421
3315
|
code: ZodIssueCode.invalid_type,
|
|
3422
3316
|
expected: ZodParsedType.number,
|
|
3423
|
-
received:
|
|
3317
|
+
received: ctx.parsedType
|
|
3424
3318
|
});
|
|
3425
3319
|
return INVALID;
|
|
3426
3320
|
}
|
|
@@ -3842,17 +3736,17 @@ class ZodDate extends ZodType {
|
|
|
3842
3736
|
}
|
|
3843
3737
|
const parsedType = this._getType(input);
|
|
3844
3738
|
if (parsedType !== ZodParsedType.date) {
|
|
3845
|
-
const
|
|
3846
|
-
addIssueToContext(
|
|
3739
|
+
const ctx = this._getOrReturnCtx(input);
|
|
3740
|
+
addIssueToContext(ctx, {
|
|
3847
3741
|
code: ZodIssueCode.invalid_type,
|
|
3848
3742
|
expected: ZodParsedType.date,
|
|
3849
|
-
received:
|
|
3743
|
+
received: ctx.parsedType
|
|
3850
3744
|
});
|
|
3851
3745
|
return INVALID;
|
|
3852
3746
|
}
|
|
3853
3747
|
if (Number.isNaN(input.data.getTime())) {
|
|
3854
|
-
const
|
|
3855
|
-
addIssueToContext(
|
|
3748
|
+
const ctx = this._getOrReturnCtx(input);
|
|
3749
|
+
addIssueToContext(ctx, {
|
|
3856
3750
|
code: ZodIssueCode.invalid_date
|
|
3857
3751
|
});
|
|
3858
3752
|
return INVALID;
|
|
@@ -4140,8 +4034,8 @@ class ZodArray extends ZodType {
|
|
|
4140
4034
|
if (ctx.common.async) {
|
|
4141
4035
|
return Promise.all([...ctx.data].map((item, i) => {
|
|
4142
4036
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
4143
|
-
})).then((
|
|
4144
|
-
return ParseStatus.mergeArray(status,
|
|
4037
|
+
})).then((result) => {
|
|
4038
|
+
return ParseStatus.mergeArray(status, result);
|
|
4145
4039
|
});
|
|
4146
4040
|
}
|
|
4147
4041
|
const result = [...ctx.data].map((item, i) => {
|
|
@@ -4222,18 +4116,18 @@ class ZodObject extends ZodType {
|
|
|
4222
4116
|
if (this._cached !== null)
|
|
4223
4117
|
return this._cached;
|
|
4224
4118
|
const shape = this._def.shape();
|
|
4225
|
-
const
|
|
4226
|
-
this._cached = { shape, keys
|
|
4119
|
+
const keys = util.objectKeys(shape);
|
|
4120
|
+
this._cached = { shape, keys };
|
|
4227
4121
|
return this._cached;
|
|
4228
4122
|
}
|
|
4229
4123
|
_parse(input) {
|
|
4230
4124
|
const parsedType = this._getType(input);
|
|
4231
4125
|
if (parsedType !== ZodParsedType.object) {
|
|
4232
|
-
const
|
|
4233
|
-
addIssueToContext(
|
|
4126
|
+
const ctx = this._getOrReturnCtx(input);
|
|
4127
|
+
addIssueToContext(ctx, {
|
|
4234
4128
|
code: ZodIssueCode.invalid_type,
|
|
4235
4129
|
expected: ZodParsedType.object,
|
|
4236
|
-
received:
|
|
4130
|
+
received: ctx.parsedType
|
|
4237
4131
|
});
|
|
4238
4132
|
return INVALID;
|
|
4239
4133
|
}
|
|
@@ -4537,7 +4431,7 @@ class ZodUnion extends ZodType {
|
|
|
4537
4431
|
ctx.common.issues.push(...dirty.ctx.common.issues);
|
|
4538
4432
|
return dirty.result;
|
|
4539
4433
|
}
|
|
4540
|
-
const unionErrors = issues.map((
|
|
4434
|
+
const unionErrors = issues.map((issues) => new ZodError(issues));
|
|
4541
4435
|
addIssueToContext(ctx, {
|
|
4542
4436
|
code: ZodIssueCode.invalid_union,
|
|
4543
4437
|
unionErrors
|
|
@@ -4977,9 +4871,9 @@ class ZodSet extends ZodType {
|
|
|
4977
4871
|
}
|
|
4978
4872
|
}
|
|
4979
4873
|
const valueType = this._def.valueType;
|
|
4980
|
-
function finalizeSet(
|
|
4874
|
+
function finalizeSet(elements) {
|
|
4981
4875
|
const parsedSet = new Set;
|
|
4982
|
-
for (const element of
|
|
4876
|
+
for (const element of elements) {
|
|
4983
4877
|
if (element.status === "aborted")
|
|
4984
4878
|
return INVALID;
|
|
4985
4879
|
if (element.status === "dirty")
|
|
@@ -4990,7 +4884,7 @@ class ZodSet extends ZodType {
|
|
|
4990
4884
|
}
|
|
4991
4885
|
const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
|
|
4992
4886
|
if (ctx.common.async) {
|
|
4993
|
-
return Promise.all(elements).then((
|
|
4887
|
+
return Promise.all(elements).then((elements) => finalizeSet(elements));
|
|
4994
4888
|
} else {
|
|
4995
4889
|
return finalizeSet(elements);
|
|
4996
4890
|
}
|
|
@@ -5343,11 +5237,11 @@ class ZodEffects extends ZodType {
|
|
|
5343
5237
|
if (effect.type === "preprocess") {
|
|
5344
5238
|
const processed = effect.transform(ctx.data, checkCtx);
|
|
5345
5239
|
if (ctx.common.async) {
|
|
5346
|
-
return Promise.resolve(processed).then(async (
|
|
5240
|
+
return Promise.resolve(processed).then(async (processed) => {
|
|
5347
5241
|
if (status.value === "aborted")
|
|
5348
5242
|
return INVALID;
|
|
5349
5243
|
const result = await this._def.schema._parseAsync({
|
|
5350
|
-
data:
|
|
5244
|
+
data: processed,
|
|
5351
5245
|
path: ctx.path,
|
|
5352
5246
|
parent: ctx
|
|
5353
5247
|
});
|
|
@@ -5539,10 +5433,10 @@ class ZodCatch extends ZodType {
|
|
|
5539
5433
|
}
|
|
5540
5434
|
});
|
|
5541
5435
|
if (isAsync(result)) {
|
|
5542
|
-
return result.then((
|
|
5436
|
+
return result.then((result) => {
|
|
5543
5437
|
return {
|
|
5544
5438
|
status: "valid",
|
|
5545
|
-
value:
|
|
5439
|
+
value: result.status === "valid" ? result.value : this._def.catchValue({
|
|
5546
5440
|
get error() {
|
|
5547
5441
|
return new ZodError(newCtx.common.issues);
|
|
5548
5442
|
},
|
|
@@ -5691,78 +5585,48 @@ ZodReadonly.create = (type, params) => {
|
|
|
5691
5585
|
...processCreateParams(params)
|
|
5692
5586
|
});
|
|
5693
5587
|
};
|
|
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
5588
|
var late = {
|
|
5722
5589
|
object: ZodObject.lazycreate
|
|
5723
5590
|
};
|
|
5724
5591
|
var ZodFirstPartyTypeKind;
|
|
5725
|
-
(function(
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5592
|
+
(function(ZodFirstPartyTypeKind) {
|
|
5593
|
+
ZodFirstPartyTypeKind["ZodString"] = "ZodString";
|
|
5594
|
+
ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
|
|
5595
|
+
ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
|
|
5596
|
+
ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
|
|
5597
|
+
ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
|
|
5598
|
+
ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
|
|
5599
|
+
ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
|
|
5600
|
+
ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
|
|
5601
|
+
ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
|
|
5602
|
+
ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
|
|
5603
|
+
ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
|
|
5604
|
+
ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
|
|
5605
|
+
ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
|
|
5606
|
+
ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
|
|
5607
|
+
ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
|
|
5608
|
+
ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
|
|
5609
|
+
ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
|
|
5610
|
+
ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
|
|
5611
|
+
ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
|
|
5612
|
+
ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
|
|
5613
|
+
ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
|
|
5614
|
+
ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
|
|
5615
|
+
ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
|
|
5616
|
+
ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
|
|
5617
|
+
ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
|
|
5618
|
+
ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
|
|
5619
|
+
ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
|
|
5620
|
+
ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
|
|
5621
|
+
ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
|
|
5622
|
+
ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
|
|
5623
|
+
ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
|
|
5624
|
+
ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
|
|
5625
|
+
ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
|
|
5626
|
+
ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
|
|
5627
|
+
ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
|
|
5628
|
+
ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
|
|
5762
5629
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
5763
|
-
var instanceOfType = (cls, params = {
|
|
5764
|
-
message: `Input not instance of ${cls.name}`
|
|
5765
|
-
}) => custom((data) => data instanceof cls, params);
|
|
5766
5630
|
var stringType = ZodString.create;
|
|
5767
5631
|
var numberType = ZodNumber.create;
|
|
5768
5632
|
var nanType = ZodNaN.create;
|
|
@@ -5797,64 +5661,50 @@ var optionalType = ZodOptional.create;
|
|
|
5797
5661
|
var nullableType = ZodNullable.create;
|
|
5798
5662
|
var preprocessType = ZodEffects.createWithPreprocess;
|
|
5799
5663
|
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
5664
|
// src/schemas.ts
|
|
5815
5665
|
var nullToUndefined = (v) => v ?? undefined;
|
|
5816
|
-
var optionalString =
|
|
5817
|
-
var ratingDistributionSchema =
|
|
5818
|
-
average_rating:
|
|
5819
|
-
display_average_rating:
|
|
5820
|
-
display_stars:
|
|
5821
|
-
num_ratings:
|
|
5822
|
-
num_five_star_ratings:
|
|
5823
|
-
num_four_star_ratings:
|
|
5824
|
-
num_three_star_ratings:
|
|
5825
|
-
num_two_star_ratings:
|
|
5826
|
-
num_one_star_ratings:
|
|
5666
|
+
var optionalString = stringType().nullish().transform(nullToUndefined);
|
|
5667
|
+
var ratingDistributionSchema = objectType({
|
|
5668
|
+
average_rating: numberType(),
|
|
5669
|
+
display_average_rating: stringType().default("0"),
|
|
5670
|
+
display_stars: numberType().default(0),
|
|
5671
|
+
num_ratings: numberType(),
|
|
5672
|
+
num_five_star_ratings: numberType().default(0),
|
|
5673
|
+
num_four_star_ratings: numberType().default(0),
|
|
5674
|
+
num_three_star_ratings: numberType().default(0),
|
|
5675
|
+
num_two_star_ratings: numberType().default(0),
|
|
5676
|
+
num_one_star_ratings: numberType().default(0)
|
|
5827
5677
|
});
|
|
5828
|
-
var audibleRatingSchema =
|
|
5829
|
-
num_reviews:
|
|
5678
|
+
var audibleRatingSchema = objectType({
|
|
5679
|
+
num_reviews: numberType().default(0),
|
|
5830
5680
|
overall_distribution: ratingDistributionSchema.nullish(),
|
|
5831
5681
|
performance_distribution: ratingDistributionSchema.nullish(),
|
|
5832
5682
|
story_distribution: ratingDistributionSchema.nullish()
|
|
5833
5683
|
}).nullish();
|
|
5834
|
-
var categoryLadderSchema =
|
|
5835
|
-
root:
|
|
5836
|
-
ladder:
|
|
5837
|
-
id:
|
|
5838
|
-
name:
|
|
5684
|
+
var categoryLadderSchema = objectType({
|
|
5685
|
+
root: stringType().default("Genres"),
|
|
5686
|
+
ladder: arrayType(objectType({
|
|
5687
|
+
id: stringType(),
|
|
5688
|
+
name: stringType()
|
|
5839
5689
|
})).default([])
|
|
5840
5690
|
});
|
|
5841
|
-
var relationshipSchema =
|
|
5842
|
-
asin:
|
|
5691
|
+
var relationshipSchema = objectType({
|
|
5692
|
+
asin: stringType(),
|
|
5843
5693
|
relationship_to_product: optionalString,
|
|
5844
5694
|
relationship_type: optionalString,
|
|
5845
5695
|
title: optionalString,
|
|
5846
5696
|
sort: optionalString,
|
|
5847
5697
|
url: optionalString
|
|
5848
5698
|
});
|
|
5849
|
-
var audibleRawItemSchema =
|
|
5850
|
-
asin:
|
|
5851
|
-
title:
|
|
5699
|
+
var audibleRawItemSchema = objectType({
|
|
5700
|
+
asin: stringType().min(1),
|
|
5701
|
+
title: stringType().min(1),
|
|
5852
5702
|
subtitle: optionalString,
|
|
5853
5703
|
isbn: optionalString,
|
|
5854
5704
|
sku: optionalString,
|
|
5855
|
-
authors:
|
|
5856
|
-
narrators:
|
|
5857
|
-
runtime_length_min:
|
|
5705
|
+
authors: arrayType(objectType({ name: stringType() })).default([]),
|
|
5706
|
+
narrators: arrayType(objectType({ name: stringType() })).default([]),
|
|
5707
|
+
runtime_length_min: numberType().nonnegative().default(0),
|
|
5858
5708
|
publisher_name: optionalString,
|
|
5859
5709
|
language: optionalString,
|
|
5860
5710
|
release_date: optionalString,
|
|
@@ -5866,29 +5716,29 @@ var audibleRawItemSchema = exports_external.object({
|
|
|
5866
5716
|
content_type: optionalString,
|
|
5867
5717
|
content_delivery_type: optionalString,
|
|
5868
5718
|
program_participation: optionalString,
|
|
5869
|
-
product_images:
|
|
5870
|
-
social_media_images:
|
|
5871
|
-
series:
|
|
5872
|
-
asin:
|
|
5873
|
-
title:
|
|
5719
|
+
product_images: recordType(stringType(), stringType()).nullish().transform((v) => v ?? {}),
|
|
5720
|
+
social_media_images: recordType(stringType(), stringType()).nullish().transform((v) => v ?? {}),
|
|
5721
|
+
series: arrayType(objectType({
|
|
5722
|
+
asin: stringType(),
|
|
5723
|
+
title: stringType(),
|
|
5874
5724
|
sequence: optionalString
|
|
5875
5725
|
})).nullish().transform((v) => v ?? []),
|
|
5876
|
-
category_ladders:
|
|
5877
|
-
platinum_keywords:
|
|
5878
|
-
thesaurus_subject_keywords:
|
|
5726
|
+
category_ladders: arrayType(categoryLadderSchema).nullish().transform((v) => v ?? []),
|
|
5727
|
+
platinum_keywords: arrayType(stringType()).nullish().transform((v) => v ?? []),
|
|
5728
|
+
thesaurus_subject_keywords: arrayType(stringType()).nullish().transform((v) => v ?? []),
|
|
5879
5729
|
rating: audibleRatingSchema,
|
|
5880
|
-
listening_status:
|
|
5881
|
-
is_finished:
|
|
5882
|
-
percent_complete:
|
|
5883
|
-
finished_at_timestamp:
|
|
5884
|
-
time_remaining_seconds:
|
|
5730
|
+
listening_status: objectType({
|
|
5731
|
+
is_finished: booleanType().optional(),
|
|
5732
|
+
percent_complete: numberType().optional(),
|
|
5733
|
+
finished_at_timestamp: stringType().nullish(),
|
|
5734
|
+
time_remaining_seconds: numberType().optional()
|
|
5885
5735
|
}).nullish().transform(nullToUndefined),
|
|
5886
5736
|
purchase_date: optionalString,
|
|
5887
|
-
library_status:
|
|
5888
|
-
date_added:
|
|
5737
|
+
library_status: objectType({
|
|
5738
|
+
date_added: stringType().nullish()
|
|
5889
5739
|
}).nullish().transform(nullToUndefined),
|
|
5890
|
-
relationships:
|
|
5891
|
-
is_adult_product:
|
|
5740
|
+
relationships: arrayType(relationshipSchema).nullish().transform((v) => v ?? []),
|
|
5741
|
+
is_adult_product: booleanType().nullish().transform((v) => v ?? false)
|
|
5892
5742
|
});
|
|
5893
5743
|
|
|
5894
5744
|
// src/signing.ts
|
|
@@ -6038,14 +5888,14 @@ var catalog = async (credentials, options) => {
|
|
|
6038
5888
|
const limit = options.limit ?? 50;
|
|
6039
5889
|
if (sortBy === "MostVoted") {
|
|
6040
5890
|
const MAX_PAGES = 20;
|
|
6041
|
-
const { items: allItems, credentials:
|
|
5891
|
+
const { items: allItems, credentials: fresh } = await fetchCatalogPages(credentials, categoryId, options, MAX_PAGES);
|
|
6042
5892
|
const sorted = orderBy_default(uniqBy_default(allItems, ({ asin }) => asin), [
|
|
6043
5893
|
({ rating }) => rating?.overallDistribution?.numRatings ?? 0,
|
|
6044
5894
|
({ rating }) => rating?.overallDistribution?.averageRating ?? 0
|
|
6045
5895
|
], ["desc", "desc"]);
|
|
6046
5896
|
return {
|
|
6047
5897
|
items: limit === "all" ? sorted : sorted.slice(0, limit),
|
|
6048
|
-
credentials:
|
|
5898
|
+
credentials: fresh
|
|
6049
5899
|
};
|
|
6050
5900
|
}
|
|
6051
5901
|
const { data: response, credentials: fresh } = await audibleFetch("/catalog/products", credentials, {
|
|
@@ -6072,14 +5922,14 @@ var verify = async (credentials) => {
|
|
|
6072
5922
|
});
|
|
6073
5923
|
};
|
|
6074
5924
|
export {
|
|
6075
|
-
|
|
6076
|
-
verify,
|
|
6077
|
-
resolveGenreId,
|
|
6078
|
-
register,
|
|
6079
|
-
refresh,
|
|
6080
|
-
login,
|
|
6081
|
-
library,
|
|
6082
|
-
catalog,
|
|
5925
|
+
AUDIBLE_LOCALES,
|
|
6083
5926
|
GENRE_CATEGORIES,
|
|
6084
|
-
|
|
5927
|
+
catalog,
|
|
5928
|
+
library,
|
|
5929
|
+
login,
|
|
5930
|
+
refresh,
|
|
5931
|
+
register,
|
|
5932
|
+
resolveGenreId,
|
|
5933
|
+
verify,
|
|
5934
|
+
wishlist
|
|
6085
5935
|
};
|
package/package.json
CHANGED