@lustre/sdk 1.5.2-dev.7 → 1.5.2-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/dist/Context.js +5 -5
  2. package/dist/Provider.js +13 -13
  3. package/dist/actions.js +2 -2
  4. package/dist/api/QueryError.js +54 -54
  5. package/dist/api/QueryResolver.js +103 -103
  6. package/dist/api/WrappedQuery.js +2 -2
  7. package/dist/api/fast1a64utf.js +134 -134
  8. package/dist/api/fetchEntity.js +41 -41
  9. package/dist/api/fetchQuery.js +31 -31
  10. package/dist/api/getHash.js +26 -26
  11. package/dist/api/getQueryHash.js +9 -9
  12. package/dist/hooks/index.js +17 -17
  13. package/dist/hooks/useApiDispatch.js +9 -9
  14. package/dist/hooks/useApiSelector.js +9 -9
  15. package/dist/hooks/useApiStore.js +9 -9
  16. package/dist/hooks/useEntities.js +40 -40
  17. package/dist/hooks/useEntity.js +9 -9
  18. package/dist/hooks/useQueries.js +54 -54
  19. package/dist/hooks/useQuery.js +9 -9
  20. package/dist/index.js +49 -49
  21. package/dist/schema/builtins.js +433 -433
  22. package/dist/schema/entities/alias.js +2 -2
  23. package/dist/schema/entities/brand.js +2 -2
  24. package/dist/schema/entities/category.js +2 -2
  25. package/dist/schema/entities/crawl.js +2 -2
  26. package/dist/schema/entities/index.js +29 -29
  27. package/dist/schema/entities/media.js +2 -2
  28. package/dist/schema/entities/offer.js +2 -2
  29. package/dist/schema/entities/productConfiguration.js +2 -2
  30. package/dist/schema/entities/productFamily.js +2 -2
  31. package/dist/schema/entities/productGeneration.js +2 -2
  32. package/dist/schema/entities/productType.js +2 -2
  33. package/dist/schema/entities/rating.js +2 -2
  34. package/dist/schema/entities/source.js +2 -2
  35. package/dist/schema/entities/spec.js +2 -2
  36. package/dist/schema/entities/specType.js +2 -2
  37. package/dist/schema/entities/specTypeChoice.js +2 -2
  38. package/dist/schema/entities/storePage.js +2 -2
  39. package/dist/schema/entities/storePageQueueGroup.js +2 -2
  40. package/dist/schema/entities/user.js +2 -2
  41. package/dist/schema/index.js +29 -29
  42. package/dist/schema/mutations/createBrand.js +2 -2
  43. package/dist/schema/mutations/createCategory.js +2 -2
  44. package/dist/schema/mutations/createProductConfiguration.js +2 -2
  45. package/dist/schema/mutations/createProductFamily.js +2 -2
  46. package/dist/schema/mutations/createProductGeneration.js +2 -2
  47. package/dist/schema/mutations/createProductType.js +2 -2
  48. package/dist/schema/mutations/createUser.js +2 -2
  49. package/dist/schema/mutations/storePageQueueClaimById.js +2 -2
  50. package/dist/schema/mutations/storePageQueueClaimNext.js +2 -2
  51. package/dist/schema/mutations/storePageQueueHandle.js +2 -2
  52. package/dist/schema/mutations/storePageQueueHandleStorePageIdSet.js +2 -2
  53. package/dist/schema/mutations/updateAlias.js +2 -2
  54. package/dist/schema/mutations/updateBrand.js +2 -2
  55. package/dist/schema/mutations/updateCategory.js +2 -2
  56. package/dist/schema/mutations/updateOffer.js +2 -2
  57. package/dist/schema/mutations/updateProductConfiguration.js +2 -2
  58. package/dist/schema/mutations/updateProductConfigurationProductType.js +2 -2
  59. package/dist/schema/mutations/updateProductFamily.js +2 -2
  60. package/dist/schema/mutations/updateProductFamilyBrand.js +2 -2
  61. package/dist/schema/mutations/updateProductGeneration.js +2 -2
  62. package/dist/schema/mutations/updateProductGenerationProductFamily.js +2 -2
  63. package/dist/schema/mutations/updateProductType.js +2 -2
  64. package/dist/schema/mutations/updateProductTypeProductGeneration.js +2 -2
  65. package/dist/schema/mutations/updateSource.js +2 -2
  66. package/dist/schema/mutations/updateStorePage.js +2 -2
  67. package/dist/schema/queries/affiliateUrl.js +2 -2
  68. package/dist/schema/queries/aliasIdListBySomeId.js +2 -2
  69. package/dist/schema/queries/analyticsTrack.js +2 -2
  70. package/dist/schema/queries/appliedCategoryIdListBySomeId.js +2 -2
  71. package/dist/schema/queries/baseScore.js +2 -2
  72. package/dist/schema/queries/baseScoreRatingIdList.js +2 -2
  73. package/dist/schema/queries/baseScoresByCategoryId.js +2 -2
  74. package/dist/schema/queries/bestInClass.js +2 -2
  75. package/dist/schema/queries/brandAliasResolution.js +2 -2
  76. package/dist/schema/queries/brandCategoryRankings.js +2 -2
  77. package/dist/schema/queries/brandIdBySomeId.js +2 -2
  78. package/dist/schema/queries/brandIdList.js +2 -2
  79. package/dist/schema/queries/brandIdListBySearch.js +2 -2
  80. package/dist/schema/queries/brandSocialMediaPostList.js +2 -2
  81. package/dist/schema/queries/categoryAliasResolution.js +2 -2
  82. package/dist/schema/queries/categoryDisplayMode.js +2 -2
  83. package/dist/schema/queries/categoryIdByUrlSlug.js +2 -2
  84. package/dist/schema/queries/categoryIdList.js +2 -2
  85. package/dist/schema/queries/categoryIdListBySomeId.js +2 -2
  86. package/dist/schema/queries/categoryIdListBySourceId.js +2 -2
  87. package/dist/schema/queries/categoryModifierSearchList.js +2 -2
  88. package/dist/schema/queries/categoryRankings.js +2 -2
  89. package/dist/schema/queries/categorySearchList.js +2 -2
  90. package/dist/schema/queries/categoryStatusList.js +2 -2
  91. package/dist/schema/queries/crawlIdList.js +2 -2
  92. package/dist/schema/queries/crawlIdListByUrl.js +2 -2
  93. package/dist/schema/queries/descriptionMarkdown.js +2 -2
  94. package/dist/schema/queries/entityType.js +2 -2
  95. package/dist/schema/queries/fallbackPriceByProductTypeId.js +2 -2
  96. package/dist/schema/queries/inputLayerVersion.js +2 -2
  97. package/dist/schema/queries/latestRatingIdList.js +2 -2
  98. package/dist/schema/queries/latestRatingIdListBySomeId.js +2 -2
  99. package/dist/schema/queries/mediaIdListBySomeId.js +2 -2
  100. package/dist/schema/queries/mlCategoryDisplayMode.js +2 -2
  101. package/dist/schema/queries/noteMarkdown.js +2 -2
  102. package/dist/schema/queries/offerIdListByStorePageId.js +2 -2
  103. package/dist/schema/queries/possibleAliasIdListBySomeId.js +2 -2
  104. package/dist/schema/queries/possibleStorePageIdListBySomeId.js +2 -2
  105. package/dist/schema/queries/preferredCategoryIdListByProductId.js +2 -2
  106. package/dist/schema/queries/preferredLatestRatingIdListBySomeId.js +2 -2
  107. package/dist/schema/queries/preferredStorePageList.js +2 -2
  108. package/dist/schema/queries/priceHistoryLookup.js +2 -2
  109. package/dist/schema/queries/pricePointCompetitors.js +2 -2
  110. package/dist/schema/queries/priceRangeByCategoryId.js +2 -2
  111. package/dist/schema/queries/productConfigurationIdListBySomeId.js +2 -2
  112. package/dist/schema/queries/productDealList.js +2 -2
  113. package/dist/schema/queries/productDocumentByStoreUrl.js +2 -2
  114. package/dist/schema/queries/productDocumentsByProductIds.js +2 -2
  115. package/dist/schema/queries/productFamilyIdBySomeId.js +2 -2
  116. package/dist/schema/queries/productFamilyIdListBySomeId.js +2 -2
  117. package/dist/schema/queries/productGenerationIdBySomeId.js +2 -2
  118. package/dist/schema/queries/productGenerationIdListBySomeId.js +2 -2
  119. package/dist/schema/queries/productListSort.js +2 -2
  120. package/dist/schema/queries/productPricePointList.js +2 -2
  121. package/dist/schema/queries/productSearchList.js +2 -2
  122. package/dist/schema/queries/productTypeIdBySomeId.js +2 -2
  123. package/dist/schema/queries/productTypeIdByStoreUrl.js +2 -2
  124. package/dist/schema/queries/productTypeIdListByCategoryId.js +2 -2
  125. package/dist/schema/queries/productTypeIdListByModifiers.js +2 -2
  126. package/dist/schema/queries/productTypeIdListBySomeId.js +2 -2
  127. package/dist/schema/queries/saleMetrics.js +2 -2
  128. package/dist/schema/queries/searchSuggestionList.js +2 -2
  129. package/dist/schema/queries/sectionDataByCrawlId.js +2 -2
  130. package/dist/schema/queries/sourceIdList.js +2 -2
  131. package/dist/schema/queries/specIdListBySomeId.js +2 -2
  132. package/dist/schema/queries/specTypeIdList.js +2 -2
  133. package/dist/schema/queries/specTypeValidValues.js +2 -2
  134. package/dist/schema/queries/specValueRangeListByCategoryId.js +2 -2
  135. package/dist/schema/queries/stablePriceByProductId.js +2 -2
  136. package/dist/schema/queries/stablePriceByProductIdAndStoreName.js +2 -2
  137. package/dist/schema/queries/stablePriceByStorePageId.js +2 -2
  138. package/dist/schema/queries/storePageFetchData.js +2 -2
  139. package/dist/schema/queries/storePageIdByUrl.js +2 -2
  140. package/dist/schema/queries/storePageIdListBySomeId.js +2 -2
  141. package/dist/schema/queries/storePageInfoBySku.js +2 -2
  142. package/dist/schema/queries/storePageScrapeData.js +2 -2
  143. package/dist/schema/queries/subCategoryIdListByCategoryId.js +2 -2
  144. package/dist/schema/queries/subsetModifierDataByModifiers.js +2 -2
  145. package/dist/schema/queries/topProductDocumentList.js +2 -2
  146. package/dist/schema/queries/unstableMediaIdListByCategoryId.js +2 -2
  147. package/dist/schema/queries/unstableSourceTrust.js +2 -2
  148. package/dist/schema/queries/userIdList.js +2 -2
  149. package/dist/schema/queries/userPermissionsByUserId.js +2 -2
  150. package/dist/schema/queries/userRestictedData.js +2 -2
  151. package/dist/schema/queries/userReviewAnalysis.js +2 -2
  152. package/dist/schema/queries/whoAmI.js +2 -2
  153. package/dist/schema/queries.js +2 -2
  154. package/dist/schema/responses.js +2 -2
  155. package/dist/store/entities/index.js +25 -25
  156. package/dist/store/entities/makeEntityReducer.js +23 -23
  157. package/dist/store/errors/index.js +23 -23
  158. package/dist/store/errors/makeErrorReducer.js +23 -23
  159. package/dist/store/index.js +16 -16
  160. package/dist/store/responses/index.js +90 -90
  161. package/dist/store/responses/makeResponseReducer.js +23 -23
  162. package/package.json +1 -1
  163. package/types/Context.d.ts +4 -4
  164. package/types/Provider.d.ts +3 -3
  165. package/types/actions.d.ts +7 -7
  166. package/types/api/QueryError.d.ts +29 -29
  167. package/types/api/QueryResolver.d.ts +32 -32
  168. package/types/api/WrappedQuery.d.ts +8 -8
  169. package/types/api/fast1a64utf.d.ts +2 -2
  170. package/types/api/fetchEntity.d.ts +6 -6
  171. package/types/api/fetchQuery.d.ts +6 -6
  172. package/types/api/getHash.d.ts +6 -6
  173. package/types/api/getQueryHash.d.ts +2 -2
  174. package/types/hooks/index.d.ts +7 -7
  175. package/types/hooks/useApiDispatch.d.ts +3 -3
  176. package/types/hooks/useApiSelector.d.ts +4 -4
  177. package/types/hooks/useApiStore.d.ts +2 -2
  178. package/types/hooks/useEntities.d.ts +7 -7
  179. package/types/hooks/useEntity.d.ts +7 -7
  180. package/types/hooks/useQueries.d.ts +7 -7
  181. package/types/hooks/useQuery.d.ts +7 -7
  182. package/types/index.d.ts +11 -11
  183. package/types/schema/builtins.d.ts +123 -123
  184. package/types/schema/entities/alias.d.ts +5 -5
  185. package/types/schema/entities/brand.d.ts +4 -4
  186. package/types/schema/entities/category.d.ts +6 -6
  187. package/types/schema/entities/crawl.d.ts +11 -11
  188. package/types/schema/entities/index.d.ts +17 -17
  189. package/types/schema/entities/media.d.ts +5 -5
  190. package/types/schema/entities/offer.d.ts +10 -10
  191. package/types/schema/entities/productConfiguration.d.ts +4 -4
  192. package/types/schema/entities/productFamily.d.ts +4 -4
  193. package/types/schema/entities/productGeneration.d.ts +4 -4
  194. package/types/schema/entities/productType.d.ts +4 -4
  195. package/types/schema/entities/rating.d.ts +52 -52
  196. package/types/schema/entities/source.d.ts +7 -7
  197. package/types/schema/entities/spec.d.ts +21 -21
  198. package/types/schema/entities/specType.d.ts +5 -5
  199. package/types/schema/entities/specTypeChoice.d.ts +6 -6
  200. package/types/schema/entities/storePage.d.ts +7 -7
  201. package/types/schema/entities/storePageQueueGroup.d.ts +5 -5
  202. package/types/schema/entities/user.d.ts +4 -4
  203. package/types/schema/index.d.ts +257 -257
  204. package/types/schema/mutations/createBrand.d.ts +8 -8
  205. package/types/schema/mutations/createCategory.d.ts +8 -8
  206. package/types/schema/mutations/createProductConfiguration.d.ts +9 -9
  207. package/types/schema/mutations/createProductFamily.d.ts +9 -9
  208. package/types/schema/mutations/createProductGeneration.d.ts +9 -9
  209. package/types/schema/mutations/createProductType.d.ts +9 -9
  210. package/types/schema/mutations/createUser.d.ts +9 -9
  211. package/types/schema/mutations/storePageQueueClaimById.d.ts +16 -16
  212. package/types/schema/mutations/storePageQueueClaimNext.d.ts +14 -14
  213. package/types/schema/mutations/storePageQueueHandle.d.ts +14 -14
  214. package/types/schema/mutations/storePageQueueHandleStorePageIdSet.d.ts +14 -14
  215. package/types/schema/mutations/updateAlias.d.ts +7 -7
  216. package/types/schema/mutations/updateBrand.d.ts +7 -7
  217. package/types/schema/mutations/updateCategory.d.ts +9 -9
  218. package/types/schema/mutations/updateOffer.d.ts +7 -7
  219. package/types/schema/mutations/updateProductConfiguration.d.ts +7 -7
  220. package/types/schema/mutations/updateProductConfigurationProductType.d.ts +7 -7
  221. package/types/schema/mutations/updateProductFamily.d.ts +7 -7
  222. package/types/schema/mutations/updateProductFamilyBrand.d.ts +7 -7
  223. package/types/schema/mutations/updateProductGeneration.d.ts +7 -7
  224. package/types/schema/mutations/updateProductGenerationProductFamily.d.ts +7 -7
  225. package/types/schema/mutations/updateProductType.d.ts +7 -7
  226. package/types/schema/mutations/updateProductTypeProductGeneration.d.ts +7 -7
  227. package/types/schema/mutations/updateSource.d.ts +9 -9
  228. package/types/schema/mutations/updateStorePage.d.ts +7 -7
  229. package/types/schema/queries/affiliateUrl.d.ts +11 -11
  230. package/types/schema/queries/aliasIdListBySomeId.d.ts +6 -6
  231. package/types/schema/queries/analyticsTrack.d.ts +5 -5
  232. package/types/schema/queries/appliedCategoryIdListBySomeId.d.ts +6 -6
  233. package/types/schema/queries/baseScore.d.ts +8 -8
  234. package/types/schema/queries/baseScoreRatingIdList.d.ts +7 -7
  235. package/types/schema/queries/baseScoresByCategoryId.d.ts +11 -11
  236. package/types/schema/queries/bestInClass.d.ts +19 -19
  237. package/types/schema/queries/brandAliasResolution.d.ts +7 -7
  238. package/types/schema/queries/brandCategoryRankings.d.ts +29 -28
  239. package/types/schema/queries/brandCategoryRankings.d.ts.map +1 -1
  240. package/types/schema/queries/brandIdBySomeId.d.ts +5 -5
  241. package/types/schema/queries/brandIdList.d.ts +8 -8
  242. package/types/schema/queries/brandIdListBySearch.d.ts +6 -6
  243. package/types/schema/queries/brandSocialMediaPostList.d.ts +21 -21
  244. package/types/schema/queries/categoryAliasResolution.d.ts +8 -8
  245. package/types/schema/queries/categoryDisplayMode.d.ts +10 -10
  246. package/types/schema/queries/categoryIdByUrlSlug.d.ts +5 -5
  247. package/types/schema/queries/categoryIdList.d.ts +8 -8
  248. package/types/schema/queries/categoryIdListBySomeId.d.ts +10 -10
  249. package/types/schema/queries/categoryIdListBySourceId.d.ts +6 -6
  250. package/types/schema/queries/categoryModifierSearchList.d.ts +21 -21
  251. package/types/schema/queries/categoryRankings.d.ts +13 -13
  252. package/types/schema/queries/categorySearchList.d.ts +16 -16
  253. package/types/schema/queries/categoryStatusList.d.ts +9 -9
  254. package/types/schema/queries/crawlIdList.d.ts +11 -11
  255. package/types/schema/queries/crawlIdListByUrl.d.ts +6 -6
  256. package/types/schema/queries/descriptionMarkdown.d.ts +5 -5
  257. package/types/schema/queries/entityType.d.ts +54 -54
  258. package/types/schema/queries/fallbackPriceByProductTypeId.d.ts +6 -6
  259. package/types/schema/queries/inputLayerVersion.d.ts +5 -5
  260. package/types/schema/queries/latestRatingIdList.d.ts +6 -6
  261. package/types/schema/queries/latestRatingIdListBySomeId.d.ts +6 -6
  262. package/types/schema/queries/mediaIdListBySomeId.d.ts +6 -6
  263. package/types/schema/queries/mlCategoryDisplayMode.d.ts +8 -8
  264. package/types/schema/queries/noteMarkdown.d.ts +5 -5
  265. package/types/schema/queries/offerIdListByStorePageId.d.ts +12 -12
  266. package/types/schema/queries/possibleAliasIdListBySomeId.d.ts +6 -6
  267. package/types/schema/queries/possibleStorePageIdListBySomeId.d.ts +6 -6
  268. package/types/schema/queries/preferredCategoryIdListByProductId.d.ts +6 -6
  269. package/types/schema/queries/preferredLatestRatingIdListBySomeId.d.ts +6 -6
  270. package/types/schema/queries/preferredStorePageList.d.ts +11 -11
  271. package/types/schema/queries/priceHistoryLookup.d.ts +16 -16
  272. package/types/schema/queries/pricePointCompetitors.d.ts +16 -16
  273. package/types/schema/queries/priceRangeByCategoryId.d.ts +10 -10
  274. package/types/schema/queries/productConfigurationIdListBySomeId.d.ts +6 -6
  275. package/types/schema/queries/productDealList.d.ts +13 -13
  276. package/types/schema/queries/productDocumentByStoreUrl.d.ts +7 -7
  277. package/types/schema/queries/productDocumentsByProductIds.d.ts +6 -6
  278. package/types/schema/queries/productFamilyIdBySomeId.d.ts +5 -5
  279. package/types/schema/queries/productFamilyIdListBySomeId.d.ts +6 -6
  280. package/types/schema/queries/productGenerationIdBySomeId.d.ts +5 -5
  281. package/types/schema/queries/productGenerationIdListBySomeId.d.ts +6 -6
  282. package/types/schema/queries/productListSort.d.ts +9 -9
  283. package/types/schema/queries/productPricePointList.d.ts +13 -13
  284. package/types/schema/queries/productSearchList.d.ts +39 -39
  285. package/types/schema/queries/productTypeIdBySomeId.d.ts +5 -5
  286. package/types/schema/queries/productTypeIdByStoreUrl.d.ts +6 -6
  287. package/types/schema/queries/productTypeIdListByCategoryId.d.ts +10 -10
  288. package/types/schema/queries/productTypeIdListByModifiers.d.ts +7 -7
  289. package/types/schema/queries/productTypeIdListBySomeId.d.ts +6 -6
  290. package/types/schema/queries/saleMetrics.d.ts +8 -8
  291. package/types/schema/queries/searchSuggestionList.d.ts +9 -9
  292. package/types/schema/queries/sectionDataByCrawlId.d.ts +19 -19
  293. package/types/schema/queries/sourceIdList.d.ts +4 -4
  294. package/types/schema/queries/specIdListBySomeId.d.ts +6 -6
  295. package/types/schema/queries/specTypeIdList.d.ts +12 -12
  296. package/types/schema/queries/specTypeValidValues.d.ts +15 -15
  297. package/types/schema/queries/specValueRangeListByCategoryId.d.ts +36 -36
  298. package/types/schema/queries/stablePriceByProductId.d.ts +6 -6
  299. package/types/schema/queries/stablePriceByProductIdAndStoreName.d.ts +7 -7
  300. package/types/schema/queries/stablePriceByStorePageId.d.ts +6 -6
  301. package/types/schema/queries/storePageFetchData.d.ts +12 -12
  302. package/types/schema/queries/storePageIdByUrl.d.ts +6 -6
  303. package/types/schema/queries/storePageIdListBySomeId.d.ts +6 -6
  304. package/types/schema/queries/storePageInfoBySku.d.ts +20 -20
  305. package/types/schema/queries/storePageScrapeData.d.ts +9 -9
  306. package/types/schema/queries/subCategoryIdListByCategoryId.d.ts +6 -6
  307. package/types/schema/queries/subsetModifierDataByModifiers.d.ts +12 -12
  308. package/types/schema/queries/topProductDocumentList.d.ts +8 -8
  309. package/types/schema/queries/unstableMediaIdListByCategoryId.d.ts +6 -6
  310. package/types/schema/queries/unstableSourceTrust.d.ts +9 -9
  311. package/types/schema/queries/userIdList.d.ts +4 -4
  312. package/types/schema/queries/userPermissionsByUserId.d.ts +7 -7
  313. package/types/schema/queries/userRestictedData.d.ts +10 -10
  314. package/types/schema/queries/userReviewAnalysis.d.ts +36 -36
  315. package/types/schema/queries/whoAmI.d.ts +5 -5
  316. package/types/schema/queries.d.ts +81 -81
  317. package/types/schema/responses.d.ts +81 -81
  318. package/types/store/entities/index.d.ts +23 -23
  319. package/types/store/entities/makeEntityReducer.d.ts +5 -5
  320. package/types/store/errors/index.d.ts +4 -4
  321. package/types/store/errors/makeErrorReducer.d.ts +5 -5
  322. package/types/store/index.d.ts +116 -116
  323. package/types/store/responses/index.d.ts +88 -88
  324. package/types/store/responses/makeResponseReducer.d.ts +5 -5
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const makeErrorReducer = (name) => {
4
- return (state, action) => {
5
- if (state === undefined) {
6
- return {};
7
- }
8
- if (action.type !== "response_arrived") {
9
- return state;
10
- }
11
- const allRawErrors = action.response.errors;
12
- if (allRawErrors === undefined) {
13
- return state;
14
- }
15
- const rawErrors = allRawErrors[name];
16
- if (rawErrors === undefined) {
17
- return state;
18
- }
19
- const next = Object.assign({}, state, rawErrors);
20
- return next;
21
- };
22
- };
23
- exports.default = makeErrorReducer;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const makeErrorReducer = (name) => {
4
+ return (state, action) => {
5
+ if (state === undefined) {
6
+ return {};
7
+ }
8
+ if (action.type !== "response_arrived") {
9
+ return state;
10
+ }
11
+ const allRawErrors = action.response.errors;
12
+ if (allRawErrors === undefined) {
13
+ return state;
14
+ }
15
+ const rawErrors = allRawErrors[name];
16
+ if (rawErrors === undefined) {
17
+ return state;
18
+ }
19
+ const next = Object.assign({}, state, rawErrors);
20
+ return next;
21
+ };
22
+ };
23
+ exports.default = makeErrorReducer;
24
24
  //# sourceMappingURL=makeErrorReducer.js.map
@@ -1,17 +1,17 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const redux_1 = require("redux");
7
- const entities_1 = __importDefault(require("./entities"));
8
- const errors_1 = __importDefault(require("./errors"));
9
- const responses_1 = __importDefault(require("./responses"));
10
- const reducers = redux_1.combineReducers({
11
- entities: entities_1.default,
12
- responses: responses_1.default,
13
- errors: errors_1.default,
14
- });
15
- const store = redux_1.createStore(reducers);
16
- exports.default = store;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const redux_1 = require("redux");
7
+ const entities_1 = __importDefault(require("./entities"));
8
+ const errors_1 = __importDefault(require("./errors"));
9
+ const responses_1 = __importDefault(require("./responses"));
10
+ const reducers = redux_1.combineReducers({
11
+ entities: entities_1.default,
12
+ responses: responses_1.default,
13
+ errors: errors_1.default,
14
+ });
15
+ const store = redux_1.createStore(reducers);
16
+ exports.default = store;
17
17
  //# sourceMappingURL=index.js.map
@@ -1,91 +1,91 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const redux_1 = require("redux");
7
- const makeResponseReducer_1 = __importDefault(require("./makeResponseReducer"));
8
- exports.default = redux_1.combineReducers({
9
- affiliateUrl: makeResponseReducer_1.default("affiliateUrl"),
10
- analyticsTrack: makeResponseReducer_1.default("analyticsTrack"),
11
- appliedCategoryIdListBySomeId: makeResponseReducer_1.default("appliedCategoryIdListBySomeId"),
12
- baseScore: makeResponseReducer_1.default("baseScore"),
13
- baseScoreRatingIdList: makeResponseReducer_1.default("baseScoreRatingIdList"),
14
- baseScoresByCategoryId: makeResponseReducer_1.default("baseScoresByCategoryId"),
15
- bestInClass: makeResponseReducer_1.default("bestInClass"),
16
- brandIdBySomeId: makeResponseReducer_1.default("brandIdBySomeId"),
17
- brandIdList: makeResponseReducer_1.default("brandIdList"),
18
- brandAliasResolution: makeResponseReducer_1.default("brandAliasResolution"),
19
- brandCategoryRankings: makeResponseReducer_1.default("brandCategoryRankings"),
20
- brandSocialMediaPostList: makeResponseReducer_1.default("brandSocialMediaPostList"),
21
- categoryAliasResolution: makeResponseReducer_1.default("categoryAliasResolution"),
22
- categoryDisplayMode: makeResponseReducer_1.default("categoryDisplayMode"),
23
- categoryIdByUrlSlug: makeResponseReducer_1.default("categoryIdByUrlSlug"),
24
- categoryIdList: makeResponseReducer_1.default("categoryIdList"),
25
- categoryIdListBySomeId: makeResponseReducer_1.default("categoryIdListBySomeId"),
26
- categoryIdListBySourceId: makeResponseReducer_1.default("categoryIdListBySourceId"),
27
- categoryRankings: makeResponseReducer_1.default("categoryRankings"),
28
- categorySearchList: makeResponseReducer_1.default("categorySearchList"),
29
- categoryStatusList: makeResponseReducer_1.default("categoryStatusList"),
30
- crawlIdList: makeResponseReducer_1.default("crawlIdList"),
31
- crawlIdListByUrl: makeResponseReducer_1.default("crawlIdListByUrl"),
32
- descriptionMarkdown: makeResponseReducer_1.default("descriptionMarkdown"),
33
- entityType: makeResponseReducer_1.default("entityType"),
34
- fallbackPriceByProductTypeId: makeResponseReducer_1.default("fallbackPriceByProductTypeId"),
35
- inputLayerVersion: makeResponseReducer_1.default("inputLayerVersion"),
36
- latestRatingIdList: makeResponseReducer_1.default("latestRatingIdList"),
37
- latestRatingIdListBySomeId: makeResponseReducer_1.default("latestRatingIdListBySomeId"),
38
- mediaIdListBySomeId: makeResponseReducer_1.default("mediaIdListBySomeId"),
39
- categoryModifierSearchList: makeResponseReducer_1.default("categoryModifierSearchList"),
40
- noteMarkdown: makeResponseReducer_1.default("noteMarkdown"),
41
- offerIdListByStorePageId: makeResponseReducer_1.default("offerIdListByStorePageId"),
42
- possibleAliasIdListBySomeId: makeResponseReducer_1.default("possibleAliasIdListBySomeId"),
43
- possibleStorePageIdListBySomeId: makeResponseReducer_1.default("possibleStorePageIdListBySomeId"),
44
- preferredCategoryIdListByProductId: makeResponseReducer_1.default("preferredCategoryIdListByProductId"),
45
- preferredLatestRatingIdListBySomeId: makeResponseReducer_1.default("preferredLatestRatingIdListBySomeId"),
46
- preferredStorePageList: makeResponseReducer_1.default("preferredStorePageList"),
47
- priceHistoryLookup: makeResponseReducer_1.default("priceHistoryLookup"),
48
- pricePointCompetitors: makeResponseReducer_1.default("pricePointCompetitors"),
49
- priceRangeByCategoryId: makeResponseReducer_1.default("priceRangeByCategoryId"),
50
- productConfigurationIdListBySomeId: makeResponseReducer_1.default("productConfigurationIdListBySomeId"),
51
- productDealList: makeResponseReducer_1.default("productDealList"),
52
- productDocumentByStoreUrl: makeResponseReducer_1.default("productDocumentByStoreUrl"),
53
- productDocumentsByProductIds: makeResponseReducer_1.default("productDocumentsByProductIds"),
54
- productFamilyIdBySomeId: makeResponseReducer_1.default("productFamilyIdBySomeId"),
55
- productFamilyIdListBySomeId: makeResponseReducer_1.default("productFamilyIdListBySomeId"),
56
- productGenerationIdBySomeId: makeResponseReducer_1.default("productGenerationIdBySomeId"),
57
- productGenerationIdListBySomeId: makeResponseReducer_1.default("productGenerationIdListBySomeId"),
58
- productListSort: makeResponseReducer_1.default("productListSort"),
59
- productPricePointList: makeResponseReducer_1.default("productPricePointList"),
60
- productSearchList: makeResponseReducer_1.default("productSearchList"),
61
- productTypeIdBySomeId: makeResponseReducer_1.default("productTypeIdBySomeId"),
62
- productTypeIdByStoreUrl: makeResponseReducer_1.default("productTypeIdByStoreUrl"),
63
- productTypeIdListByCategoryId: makeResponseReducer_1.default("productTypeIdListByCategoryId"),
64
- productTypeIdListByModifiers: makeResponseReducer_1.default("productTypeIdListByModifiers"),
65
- productTypeIdListBySomeId: makeResponseReducer_1.default("productTypeIdListBySomeId"),
66
- saleMetrics: makeResponseReducer_1.default("saleMetrics"),
67
- searchSuggestionList: makeResponseReducer_1.default("searchSuggestionList"),
68
- sectionDataByCrawlId: makeResponseReducer_1.default("sectionDataByCrawlId"),
69
- sourceIdList: makeResponseReducer_1.default("sourceIdList"),
70
- specIdListBySomeId: makeResponseReducer_1.default("specIdListBySomeId"),
71
- specTypeIdList: makeResponseReducer_1.default("specTypeIdList"),
72
- specTypeValidValues: makeResponseReducer_1.default("specTypeValidValues"),
73
- specValueRangeListByCategoryId: makeResponseReducer_1.default("specValueRangeListByCategoryId"),
74
- stablePriceByProductId: makeResponseReducer_1.default("stablePriceByProductId"),
75
- stablePriceByProductIdAndStoreName: makeResponseReducer_1.default("stablePriceByProductIdAndStoreName"),
76
- stablePriceByStorePageId: makeResponseReducer_1.default("stablePriceByStorePageId"),
77
- storePageFetchData: makeResponseReducer_1.default("storePageFetchData"),
78
- storePageIdByUrl: makeResponseReducer_1.default("storePageIdByUrl"),
79
- storePageIdListBySomeId: makeResponseReducer_1.default("storePageIdListBySomeId"),
80
- storePageInfoBySku: makeResponseReducer_1.default("storePageInfoBySku"),
81
- storePageScrapeData: makeResponseReducer_1.default("storePageScrapeData"),
82
- subCategoryIdListByCategoryId: makeResponseReducer_1.default("subCategoryIdListByCategoryId"),
83
- subsetModifierDataByModifiers: makeResponseReducer_1.default("subsetModifierDataByModifiers"),
84
- topProductDocumentList: makeResponseReducer_1.default("topProductDocumentList"),
85
- unstableMediaIdListByCategoryId: makeResponseReducer_1.default("unstableMediaIdListByCategoryId"),
86
- userReviewAnalysis: makeResponseReducer_1.default("userReviewAnalysis"),
87
- unstableSourceTrust: makeResponseReducer_1.default("unstableSourceTrust"),
88
- userIdList: makeResponseReducer_1.default("userIdList"),
89
- userPermissionsByUserId: makeResponseReducer_1.default("userPermissionsByUserId"),
90
- });
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const redux_1 = require("redux");
7
+ const makeResponseReducer_1 = __importDefault(require("./makeResponseReducer"));
8
+ exports.default = redux_1.combineReducers({
9
+ affiliateUrl: makeResponseReducer_1.default("affiliateUrl"),
10
+ analyticsTrack: makeResponseReducer_1.default("analyticsTrack"),
11
+ appliedCategoryIdListBySomeId: makeResponseReducer_1.default("appliedCategoryIdListBySomeId"),
12
+ baseScore: makeResponseReducer_1.default("baseScore"),
13
+ baseScoreRatingIdList: makeResponseReducer_1.default("baseScoreRatingIdList"),
14
+ baseScoresByCategoryId: makeResponseReducer_1.default("baseScoresByCategoryId"),
15
+ bestInClass: makeResponseReducer_1.default("bestInClass"),
16
+ brandIdBySomeId: makeResponseReducer_1.default("brandIdBySomeId"),
17
+ brandIdList: makeResponseReducer_1.default("brandIdList"),
18
+ brandAliasResolution: makeResponseReducer_1.default("brandAliasResolution"),
19
+ brandCategoryRankings: makeResponseReducer_1.default("brandCategoryRankings"),
20
+ brandSocialMediaPostList: makeResponseReducer_1.default("brandSocialMediaPostList"),
21
+ categoryAliasResolution: makeResponseReducer_1.default("categoryAliasResolution"),
22
+ categoryDisplayMode: makeResponseReducer_1.default("categoryDisplayMode"),
23
+ categoryIdByUrlSlug: makeResponseReducer_1.default("categoryIdByUrlSlug"),
24
+ categoryIdList: makeResponseReducer_1.default("categoryIdList"),
25
+ categoryIdListBySomeId: makeResponseReducer_1.default("categoryIdListBySomeId"),
26
+ categoryIdListBySourceId: makeResponseReducer_1.default("categoryIdListBySourceId"),
27
+ categoryRankings: makeResponseReducer_1.default("categoryRankings"),
28
+ categorySearchList: makeResponseReducer_1.default("categorySearchList"),
29
+ categoryStatusList: makeResponseReducer_1.default("categoryStatusList"),
30
+ crawlIdList: makeResponseReducer_1.default("crawlIdList"),
31
+ crawlIdListByUrl: makeResponseReducer_1.default("crawlIdListByUrl"),
32
+ descriptionMarkdown: makeResponseReducer_1.default("descriptionMarkdown"),
33
+ entityType: makeResponseReducer_1.default("entityType"),
34
+ fallbackPriceByProductTypeId: makeResponseReducer_1.default("fallbackPriceByProductTypeId"),
35
+ inputLayerVersion: makeResponseReducer_1.default("inputLayerVersion"),
36
+ latestRatingIdList: makeResponseReducer_1.default("latestRatingIdList"),
37
+ latestRatingIdListBySomeId: makeResponseReducer_1.default("latestRatingIdListBySomeId"),
38
+ mediaIdListBySomeId: makeResponseReducer_1.default("mediaIdListBySomeId"),
39
+ categoryModifierSearchList: makeResponseReducer_1.default("categoryModifierSearchList"),
40
+ noteMarkdown: makeResponseReducer_1.default("noteMarkdown"),
41
+ offerIdListByStorePageId: makeResponseReducer_1.default("offerIdListByStorePageId"),
42
+ possibleAliasIdListBySomeId: makeResponseReducer_1.default("possibleAliasIdListBySomeId"),
43
+ possibleStorePageIdListBySomeId: makeResponseReducer_1.default("possibleStorePageIdListBySomeId"),
44
+ preferredCategoryIdListByProductId: makeResponseReducer_1.default("preferredCategoryIdListByProductId"),
45
+ preferredLatestRatingIdListBySomeId: makeResponseReducer_1.default("preferredLatestRatingIdListBySomeId"),
46
+ preferredStorePageList: makeResponseReducer_1.default("preferredStorePageList"),
47
+ priceHistoryLookup: makeResponseReducer_1.default("priceHistoryLookup"),
48
+ pricePointCompetitors: makeResponseReducer_1.default("pricePointCompetitors"),
49
+ priceRangeByCategoryId: makeResponseReducer_1.default("priceRangeByCategoryId"),
50
+ productConfigurationIdListBySomeId: makeResponseReducer_1.default("productConfigurationIdListBySomeId"),
51
+ productDealList: makeResponseReducer_1.default("productDealList"),
52
+ productDocumentByStoreUrl: makeResponseReducer_1.default("productDocumentByStoreUrl"),
53
+ productDocumentsByProductIds: makeResponseReducer_1.default("productDocumentsByProductIds"),
54
+ productFamilyIdBySomeId: makeResponseReducer_1.default("productFamilyIdBySomeId"),
55
+ productFamilyIdListBySomeId: makeResponseReducer_1.default("productFamilyIdListBySomeId"),
56
+ productGenerationIdBySomeId: makeResponseReducer_1.default("productGenerationIdBySomeId"),
57
+ productGenerationIdListBySomeId: makeResponseReducer_1.default("productGenerationIdListBySomeId"),
58
+ productListSort: makeResponseReducer_1.default("productListSort"),
59
+ productPricePointList: makeResponseReducer_1.default("productPricePointList"),
60
+ productSearchList: makeResponseReducer_1.default("productSearchList"),
61
+ productTypeIdBySomeId: makeResponseReducer_1.default("productTypeIdBySomeId"),
62
+ productTypeIdByStoreUrl: makeResponseReducer_1.default("productTypeIdByStoreUrl"),
63
+ productTypeIdListByCategoryId: makeResponseReducer_1.default("productTypeIdListByCategoryId"),
64
+ productTypeIdListByModifiers: makeResponseReducer_1.default("productTypeIdListByModifiers"),
65
+ productTypeIdListBySomeId: makeResponseReducer_1.default("productTypeIdListBySomeId"),
66
+ saleMetrics: makeResponseReducer_1.default("saleMetrics"),
67
+ searchSuggestionList: makeResponseReducer_1.default("searchSuggestionList"),
68
+ sectionDataByCrawlId: makeResponseReducer_1.default("sectionDataByCrawlId"),
69
+ sourceIdList: makeResponseReducer_1.default("sourceIdList"),
70
+ specIdListBySomeId: makeResponseReducer_1.default("specIdListBySomeId"),
71
+ specTypeIdList: makeResponseReducer_1.default("specTypeIdList"),
72
+ specTypeValidValues: makeResponseReducer_1.default("specTypeValidValues"),
73
+ specValueRangeListByCategoryId: makeResponseReducer_1.default("specValueRangeListByCategoryId"),
74
+ stablePriceByProductId: makeResponseReducer_1.default("stablePriceByProductId"),
75
+ stablePriceByProductIdAndStoreName: makeResponseReducer_1.default("stablePriceByProductIdAndStoreName"),
76
+ stablePriceByStorePageId: makeResponseReducer_1.default("stablePriceByStorePageId"),
77
+ storePageFetchData: makeResponseReducer_1.default("storePageFetchData"),
78
+ storePageIdByUrl: makeResponseReducer_1.default("storePageIdByUrl"),
79
+ storePageIdListBySomeId: makeResponseReducer_1.default("storePageIdListBySomeId"),
80
+ storePageInfoBySku: makeResponseReducer_1.default("storePageInfoBySku"),
81
+ storePageScrapeData: makeResponseReducer_1.default("storePageScrapeData"),
82
+ subCategoryIdListByCategoryId: makeResponseReducer_1.default("subCategoryIdListByCategoryId"),
83
+ subsetModifierDataByModifiers: makeResponseReducer_1.default("subsetModifierDataByModifiers"),
84
+ topProductDocumentList: makeResponseReducer_1.default("topProductDocumentList"),
85
+ unstableMediaIdListByCategoryId: makeResponseReducer_1.default("unstableMediaIdListByCategoryId"),
86
+ userReviewAnalysis: makeResponseReducer_1.default("userReviewAnalysis"),
87
+ unstableSourceTrust: makeResponseReducer_1.default("unstableSourceTrust"),
88
+ userIdList: makeResponseReducer_1.default("userIdList"),
89
+ userPermissionsByUserId: makeResponseReducer_1.default("userPermissionsByUserId"),
90
+ });
91
91
  //# sourceMappingURL=index.js.map
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const makeResponseReducer = (name) => {
4
- return (state, action) => {
5
- if (state === undefined) {
6
- return {};
7
- }
8
- if (action.type !== "response_arrived") {
9
- return state;
10
- }
11
- const allRawResponses = action.response.responses;
12
- if (allRawResponses === undefined) {
13
- return state;
14
- }
15
- const rawResponses = allRawResponses[name];
16
- if (rawResponses === undefined) {
17
- return state;
18
- }
19
- const next = Object.assign({}, state, rawResponses);
20
- return next;
21
- };
22
- };
23
- exports.default = makeResponseReducer;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const makeResponseReducer = (name) => {
4
+ return (state, action) => {
5
+ if (state === undefined) {
6
+ return {};
7
+ }
8
+ if (action.type !== "response_arrived") {
9
+ return state;
10
+ }
11
+ const allRawResponses = action.response.responses;
12
+ if (allRawResponses === undefined) {
13
+ return state;
14
+ }
15
+ const rawResponses = allRawResponses[name];
16
+ if (rawResponses === undefined) {
17
+ return state;
18
+ }
19
+ const next = Object.assign({}, state, rawResponses);
20
+ return next;
21
+ };
22
+ };
23
+ exports.default = makeResponseReducer;
24
24
  //# sourceMappingURL=makeResponseReducer.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lustre/sdk",
3
- "version": "1.5.2-dev.7",
3
+ "version": "1.5.2-dev.8",
4
4
  "repository": "github:parli/typescript-sdk",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
@@ -1,5 +1,5 @@
1
- import { Context } from "react";
2
- import { ReactReduxContextValue } from "react-redux";
3
- declare const _default;
4
- export default _default;
1
+ import { Context } from "react";
2
+ import { ReactReduxContextValue } from "react-redux";
3
+ declare const _default;
4
+ export default _default;
5
5
  //# sourceMappingURL=Context.d.ts.map
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- declare const ApiProvider: React.FC<React.PropsWithChildren<unknown>>;
3
- export default ApiProvider;
1
+ import React from "react";
2
+ declare const ApiProvider: React.FC<React.PropsWithChildren<unknown>>;
3
+ export default ApiProvider;
4
4
  //# sourceMappingURL=Provider.d.ts.map
@@ -1,8 +1,8 @@
1
- import type { Api } from "./schema";
2
- export declare type ApiAction<Type extends string, Body extends Record<string, unknown>> = {
3
- type: Type;
4
- } & Body;
5
- export declare type ApiActions = ApiAction<"response_arrived", {
6
- response: Api;
7
- }>;
1
+ import type { Api } from "./schema";
2
+ export declare type ApiAction<Type extends string, Body extends Record<string, unknown>> = {
3
+ type: Type;
4
+ } & Body;
5
+ export declare type ApiActions = ApiAction<"response_arrived", {
6
+ response: Api;
7
+ }>;
8
8
  //# sourceMappingURL=actions.d.ts.map
@@ -1,30 +1,30 @@
1
- import { ServerError } from "../schema";
2
- import { WrappedQuery } from "./WrappedQuery";
3
- export declare class QueryError extends Error {
4
- readonly query: WrappedQuery;
5
- constructor(query: WrappedQuery, message?: string);
6
- }
7
- export declare class QueryFetchError extends QueryError {
8
- readonly name = "QueryFetchError";
9
- constructor(query: WrappedQuery, message?: string);
10
- }
11
- export declare class QueryReferenceError extends QueryError {
12
- readonly name = "QueryReferenceError";
13
- constructor(query: WrappedQuery, message?: string);
14
- }
15
- export declare class QueryValidationError extends QueryError {
16
- readonly name = "QueryValidationError";
17
- constructor(query: WrappedQuery, message?: string);
18
- }
19
- export declare class QueryResponseError extends QueryError {
20
- readonly name = "QueryResponseError";
21
- readonly errors: ServerError[];
22
- constructor(query: WrappedQuery, errors: ServerError[], message?: string);
23
- }
24
- export declare class QueryHttpError extends QueryError {
25
- readonly name = "QueryHttpError";
26
- readonly status: number;
27
- readonly body: string;
28
- constructor(query: WrappedQuery, status: number, body: string, message?: string);
29
- }
1
+ import { ServerError } from "../schema";
2
+ import { WrappedQuery } from "./WrappedQuery";
3
+ export declare class QueryError extends Error {
4
+ readonly query: WrappedQuery;
5
+ constructor(query: WrappedQuery, message?: string);
6
+ }
7
+ export declare class QueryFetchError extends QueryError {
8
+ readonly name = "QueryFetchError";
9
+ constructor(query: WrappedQuery, message?: string);
10
+ }
11
+ export declare class QueryReferenceError extends QueryError {
12
+ readonly name = "QueryReferenceError";
13
+ constructor(query: WrappedQuery, message?: string);
14
+ }
15
+ export declare class QueryValidationError extends QueryError {
16
+ readonly name = "QueryValidationError";
17
+ constructor(query: WrappedQuery, message?: string);
18
+ }
19
+ export declare class QueryResponseError extends QueryError {
20
+ readonly name = "QueryResponseError";
21
+ readonly errors: ServerError[];
22
+ constructor(query: WrappedQuery, errors: ServerError[], message?: string);
23
+ }
24
+ export declare class QueryHttpError extends QueryError {
25
+ readonly name = "QueryHttpError";
26
+ readonly status: number;
27
+ readonly body: string;
28
+ constructor(query: WrappedQuery, status: number, body: string, message?: string);
29
+ }
30
30
  //# sourceMappingURL=QueryError.d.ts.map
@@ -1,33 +1,33 @@
1
- import "cross-fetch/polyfill";
2
- import { Api } from "../schema";
3
- import { WrappedQuery } from "./WrappedQuery";
4
- import { QueryError } from "./QueryError";
5
- import { ApiDispatch } from "../hooks/useApiDispatch";
6
- export declare const _defaultBatchKey = "__DEFAULT_BATCH_KEY__";
7
- declare type ResponseResolver = (response: Api) => void;
8
- declare type ResponseRejector = (error: QueryError) => void;
9
- declare type QueryHandler = {
10
- query: WrappedQuery;
11
- resolve: ResponseResolver;
12
- reject: ResponseRejector;
13
- dispatch?: ApiDispatch;
14
- };
15
- interface QueryResolverOptions {
16
- apiHost?: string;
17
- apiKey?: string;
18
- }
19
- declare class QueryResolver {
20
- resolverQueues: Record<string, QueryHandler[]>;
21
- readonly apiHost: string;
22
- readonly apiKey?: string;
23
- constructor(options?: QueryResolverOptions);
24
- addQueryToQueue(query: WrappedQuery, options?: {
25
- batchKey?: string;
26
- dispatch?: ApiDispatch;
27
- }): Promise<Api>;
28
- performQueryRequest(): Promise<void>;
29
- }
30
- export declare const _getDefaultQueryResolver: () => QueryResolver;
31
- export declare const _setDefaultQueryResolver: (queryResolver: QueryResolver) => void;
32
- export default QueryResolver;
1
+ import "cross-fetch/polyfill";
2
+ import { Api } from "../schema";
3
+ import { WrappedQuery } from "./WrappedQuery";
4
+ import { QueryError } from "./QueryError";
5
+ import { ApiDispatch } from "../hooks/useApiDispatch";
6
+ export declare const _defaultBatchKey = "__DEFAULT_BATCH_KEY__";
7
+ declare type ResponseResolver = (response: Api) => void;
8
+ declare type ResponseRejector = (error: QueryError) => void;
9
+ declare type QueryHandler = {
10
+ query: WrappedQuery;
11
+ resolve: ResponseResolver;
12
+ reject: ResponseRejector;
13
+ dispatch?: ApiDispatch;
14
+ };
15
+ interface QueryResolverOptions {
16
+ apiHost?: string;
17
+ apiKey?: string;
18
+ }
19
+ declare class QueryResolver {
20
+ resolverQueues: Record<string, QueryHandler[]>;
21
+ readonly apiHost: string;
22
+ readonly apiKey?: string;
23
+ constructor(options?: QueryResolverOptions);
24
+ addQueryToQueue(query: WrappedQuery, options?: {
25
+ batchKey?: string;
26
+ dispatch?: ApiDispatch;
27
+ }): Promise<Api>;
28
+ performQueryRequest(): Promise<void>;
29
+ }
30
+ export declare const _getDefaultQueryResolver: () => QueryResolver;
31
+ export declare const _setDefaultQueryResolver: (queryResolver: QueryResolver) => void;
32
+ export default QueryResolver;
33
33
  //# sourceMappingURL=QueryResolver.d.ts.map
@@ -1,9 +1,9 @@
1
- import { ApiQueries } from "../schema";
2
- declare type WrapQuery<T extends keyof ApiQueries> = {
3
- name: T;
4
- body: ApiQueries[T][string];
5
- };
6
- declare type DistributeWrapQuery<T extends keyof ApiQueries> = T extends keyof ApiQueries ? WrapQuery<T> : never;
7
- export declare type WrappedQuery = DistributeWrapQuery<keyof ApiQueries>;
8
- export {};
1
+ import { ApiQueries } from "../schema";
2
+ declare type WrapQuery<T extends keyof ApiQueries> = {
3
+ name: T;
4
+ body: ApiQueries[T][string];
5
+ };
6
+ declare type DistributeWrapQuery<T extends keyof ApiQueries> = T extends keyof ApiQueries ? WrapQuery<T> : never;
7
+ export declare type WrappedQuery = DistributeWrapQuery<keyof ApiQueries>;
8
+ export {};
9
9
  //# sourceMappingURL=WrappedQuery.d.ts.map
@@ -1,3 +1,3 @@
1
- declare function fast1a64utf(str: string): string;
2
- export default fast1a64utf;
1
+ declare function fast1a64utf(str: string): string;
2
+ export default fast1a64utf;
3
3
  //# sourceMappingURL=fast1a64utf.d.ts.map
@@ -1,7 +1,7 @@
1
- import { ApiEntities, Id } from "../schema";
2
- import QueryResolver from "./QueryResolver";
3
- export declare const fetchEntity: <EntityName extends keyof ApiEntities, IdType extends Id<EntityName>, Entity extends ApiEntities[EntityName][string]>(type: EntityName, id: IdType, options?: {
4
- queryResolver?: QueryResolver;
5
- batchKey?: string;
6
- }) => Promise<Entity>;
1
+ import { ApiEntities, Id } from "../schema";
2
+ import QueryResolver from "./QueryResolver";
3
+ export declare const fetchEntity: <EntityName extends keyof ApiEntities, IdType extends Id<EntityName>, Entity extends ApiEntities[EntityName][string]>(type: EntityName, id: IdType, options?: {
4
+ queryResolver?: QueryResolver;
5
+ batchKey?: string;
6
+ }) => Promise<Entity>;
7
7
  //# sourceMappingURL=fetchEntity.d.ts.map
@@ -1,7 +1,7 @@
1
- import { ApiQueries, ApiResponses } from "../schema";
2
- import QueryResolver from "./QueryResolver";
3
- export declare const fetchQuery: <QueryName extends keyof ApiQueries, QueryBody extends ApiQueries[QueryName][string], QueryResult extends NonNullable<ApiResponses[QueryName][string]>>(name: QueryName, body: QueryBody, options?: {
4
- queryResolver?: QueryResolver;
5
- batchKey?: string;
6
- }) => Promise<QueryResult>;
1
+ import { ApiQueries, ApiResponses } from "../schema";
2
+ import QueryResolver from "./QueryResolver";
3
+ export declare const fetchQuery: <QueryName extends keyof ApiQueries, QueryBody extends ApiQueries[QueryName][string], QueryResult extends NonNullable<ApiResponses[QueryName][string]>>(name: QueryName, body: QueryBody, options?: {
4
+ queryResolver?: QueryResolver;
5
+ batchKey?: string;
6
+ }) => Promise<QueryResult>;
7
7
  //# sourceMappingURL=fetchQuery.d.ts.map
@@ -1,7 +1,7 @@
1
- interface HashableObject {
2
- [key: string]: any;
3
- }
4
- export declare const objectToString: (data: HashableObject) => string;
5
- declare const getHash: (object: HashableObject) => string;
6
- export default getHash;
1
+ interface HashableObject {
2
+ [key: string]: any;
3
+ }
4
+ export declare const objectToString: (data: HashableObject) => string;
5
+ declare const getHash: (object: HashableObject) => string;
6
+ export default getHash;
7
7
  //# sourceMappingURL=getHash.d.ts.map
@@ -1,3 +1,3 @@
1
- import { WrappedQuery } from "./WrappedQuery";
2
- export declare const getQueryHash: (query: WrappedQuery) => string;
1
+ import { WrappedQuery } from "./WrappedQuery";
2
+ export declare const getQueryHash: (query: WrappedQuery) => string;
3
3
  //# sourceMappingURL=getQueryHash.d.ts.map
@@ -1,8 +1,8 @@
1
- export { useApiDispatch } from "./useApiDispatch";
2
- export { useApiSelector } from "./useApiSelector";
3
- export { useApiStore } from "./useApiStore";
4
- export { useEntities } from "./useEntities";
5
- export { useEntity } from "./useEntity";
6
- export { useQueries } from "./useQueries";
7
- export { useQuery } from "./useQuery";
1
+ export { useApiDispatch } from "./useApiDispatch";
2
+ export { useApiSelector } from "./useApiSelector";
3
+ export { useApiStore } from "./useApiStore";
4
+ export { useEntities } from "./useEntities";
5
+ export { useEntity } from "./useEntity";
6
+ export { useQueries } from "./useQueries";
7
+ export { useQuery } from "./useQuery";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ApiActions } from "../actions";
2
- export declare const useApiDispatch: () => (dispatch: ApiActions) => void;
3
- export declare type ApiDispatch = ReturnType<typeof useApiDispatch>;
1
+ import { ApiActions } from "../actions";
2
+ export declare const useApiDispatch: () => (dispatch: ApiActions) => void;
3
+ export declare type ApiDispatch = ReturnType<typeof useApiDispatch>;
4
4
  //# sourceMappingURL=useApiDispatch.d.ts.map
@@ -1,5 +1,5 @@
1
- import { Store } from "../store";
2
- declare type ApiStateSelector<R> = (state: Store) => R;
3
- export declare const useApiSelector: <T>(sel: ApiStateSelector<T>, eq?: ((prev: Store, next: Store) => boolean) | undefined) => T;
4
- export {};
1
+ import { Store } from "../store";
2
+ declare type ApiStateSelector<R> = (state: Store) => R;
3
+ export declare const useApiSelector: <T>(sel: ApiStateSelector<T>, eq?: ((prev: Store, next: Store) => boolean) | undefined) => T;
4
+ export {};
5
5
  //# sourceMappingURL=useApiSelector.d.ts.map
@@ -1,3 +1,3 @@
1
- import { Store } from "redux";
2
- export declare const useApiStore: () => Store;
1
+ import { Store } from "redux";
2
+ export declare const useApiStore: () => Store;
3
3
  //# sourceMappingURL=useApiStore.d.ts.map