@tiledev/sdk-apptile-live-selling 0.16.0-beta.0 → 0.16.1

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 (391) hide show
  1. package/README.md +5 -1
  2. package/dist/auctions.d.ts.map +1 -1
  3. package/dist/auctions.js +11 -41
  4. package/dist/auctions.js.map +1 -1
  5. package/dist/client.d.ts +2 -51
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +23 -123
  8. package/dist/client.js.map +1 -1
  9. package/dist/clips.d.ts +1 -12
  10. package/dist/clips.d.ts.map +1 -1
  11. package/dist/clips.js +6 -114
  12. package/dist/clips.js.map +1 -1
  13. package/dist/commentLinks.d.ts +0 -29
  14. package/dist/commentLinks.d.ts.map +1 -1
  15. package/dist/commentLinks.js.map +1 -1
  16. package/dist/engine.native.d.ts.map +1 -1
  17. package/dist/engine.native.js +845 -17
  18. package/dist/engine.native.js.map +1 -1
  19. package/dist/index.d.ts +3 -45
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +3 -233
  22. package/dist/index.js.map +1 -1
  23. package/dist/polls.d.ts.map +1 -1
  24. package/dist/polls.js +0 -3
  25. package/dist/polls.js.map +1 -1
  26. package/dist/react/LiveSellingProvider.d.ts +1 -46
  27. package/dist/react/LiveSellingProvider.d.ts.map +1 -1
  28. package/dist/react/LiveSellingProvider.js +3 -57
  29. package/dist/react/LiveSellingProvider.js.map +1 -1
  30. package/dist/react/LiveVideoTarget.d.ts.map +1 -1
  31. package/dist/react/LiveVideoTarget.js +3 -41
  32. package/dist/react/LiveVideoTarget.js.map +1 -1
  33. package/dist/react/index.d.ts +3 -30
  34. package/dist/react/index.d.ts.map +1 -1
  35. package/dist/react/index.js +1 -79
  36. package/dist/react/index.js.map +1 -1
  37. package/dist/react/index.web.d.ts +32 -36
  38. package/dist/react/index.web.d.ts.map +1 -1
  39. package/dist/react/index.web.js +122 -102
  40. package/dist/react/index.web.js.map +1 -1
  41. package/dist/react/useAuctionBidGate.d.ts +6 -62
  42. package/dist/react/useAuctionBidGate.d.ts.map +1 -1
  43. package/dist/react/useAuctionBidGate.js +27 -228
  44. package/dist/react/useAuctionBidGate.js.map +1 -1
  45. package/dist/react/useAuctionWins.d.ts +4 -14
  46. package/dist/react/useAuctionWins.d.ts.map +1 -1
  47. package/dist/react/useAuctionWins.js +5 -16
  48. package/dist/react/useAuctionWins.js.map +1 -1
  49. package/dist/react/useClips.d.ts +1 -7
  50. package/dist/react/useClips.d.ts.map +1 -1
  51. package/dist/react/useClips.js +7 -20
  52. package/dist/react/useClips.js.map +1 -1
  53. package/dist/react/useLiveSession.d.ts +3 -15
  54. package/dist/react/useLiveSession.d.ts.map +1 -1
  55. package/dist/react/useLiveSession.js +199 -561
  56. package/dist/react/useLiveSession.js.map +1 -1
  57. package/dist/react/useLiveStreams.d.ts.map +1 -1
  58. package/dist/react/useLiveStreams.js +2 -6
  59. package/dist/react/useLiveStreams.js.map +1 -1
  60. package/dist/react/useOngoingLive.d.ts +0 -1
  61. package/dist/react/useOngoingLive.d.ts.map +1 -1
  62. package/dist/react/useOngoingLive.js +1 -7
  63. package/dist/react/useOngoingLive.js.map +1 -1
  64. package/dist/react/useReplays.d.ts +0 -12
  65. package/dist/react/useReplays.d.ts.map +1 -1
  66. package/dist/react/useReplays.js +24 -56
  67. package/dist/react/useReplays.js.map +1 -1
  68. package/dist/react/useStreamInfo.d.ts +2 -13
  69. package/dist/react/useStreamInfo.d.ts.map +1 -1
  70. package/dist/react/useStreamInfo.js +5 -31
  71. package/dist/react/useStreamInfo.js.map +1 -1
  72. package/dist/replays.d.ts +0 -14
  73. package/dist/replays.d.ts.map +1 -1
  74. package/dist/replays.js +22 -68
  75. package/dist/replays.js.map +1 -1
  76. package/dist/session.d.ts +6 -39
  77. package/dist/session.d.ts.map +1 -1
  78. package/dist/session.js +22 -209
  79. package/dist/session.js.map +1 -1
  80. package/dist/sessionTypes.d.ts +18 -217
  81. package/dist/sessionTypes.d.ts.map +1 -1
  82. package/dist/sessionTypes.js +1 -2
  83. package/dist/sessionTypes.js.map +1 -1
  84. package/dist/streams.d.ts +1 -27
  85. package/dist/streams.d.ts.map +1 -1
  86. package/dist/streams.js +21 -84
  87. package/dist/streams.js.map +1 -1
  88. package/dist/types.d.ts +10 -288
  89. package/dist/types.d.ts.map +1 -1
  90. package/dist/types.js +1 -2
  91. package/dist/types.js.map +1 -1
  92. package/dist/wire.d.ts +0 -31
  93. package/dist/wire.d.ts.map +1 -1
  94. package/dist/wire.js +0 -25
  95. package/dist/wire.js.map +1 -1
  96. package/dist/zego.d.ts +1 -3
  97. package/dist/zego.d.ts.map +1 -1
  98. package/dist/zego.js +1 -1
  99. package/package.json +2 -2
  100. package/dist/auctionComments.d.ts +0 -25
  101. package/dist/auctionComments.d.ts.map +0 -1
  102. package/dist/auctionComments.js +0 -28
  103. package/dist/auctionComments.js.map +0 -1
  104. package/dist/auctionRules.d.ts +0 -77
  105. package/dist/auctionRules.d.ts.map +0 -1
  106. package/dist/auctionRules.js +0 -107
  107. package/dist/auctionRules.js.map +0 -1
  108. package/dist/cartExtension.d.ts +0 -39
  109. package/dist/cartExtension.d.ts.map +0 -1
  110. package/dist/cartExtension.js +0 -51
  111. package/dist/cartExtension.js.map +0 -1
  112. package/dist/checkoutRefused.d.ts +0 -9
  113. package/dist/checkoutRefused.d.ts.map +0 -1
  114. package/dist/checkoutRefused.js +0 -16
  115. package/dist/checkoutRefused.js.map +0 -1
  116. package/dist/clipsPage.d.ts +0 -29
  117. package/dist/clipsPage.d.ts.map +0 -1
  118. package/dist/clipsPage.js +0 -49
  119. package/dist/clipsPage.js.map +0 -1
  120. package/dist/commentHistory.d.ts +0 -70
  121. package/dist/commentHistory.d.ts.map +0 -1
  122. package/dist/commentHistory.js +0 -133
  123. package/dist/commentHistory.js.map +0 -1
  124. package/dist/commentLinkCards.d.ts +0 -11
  125. package/dist/commentLinkCards.d.ts.map +0 -1
  126. package/dist/commentLinkCards.js +0 -70
  127. package/dist/commentLinkCards.js.map +0 -1
  128. package/dist/giveawayPrize.d.ts +0 -13
  129. package/dist/giveawayPrize.d.ts.map +0 -1
  130. package/dist/giveawayPrize.js +0 -18
  131. package/dist/giveawayPrize.js.map +0 -1
  132. package/dist/giveawayPrizeLines.d.ts +0 -120
  133. package/dist/giveawayPrizeLines.d.ts.map +0 -1
  134. package/dist/giveawayPrizeLines.js +0 -97
  135. package/dist/giveawayPrizeLines.js.map +0 -1
  136. package/dist/giveawayPrizes.d.ts +0 -20
  137. package/dist/giveawayPrizes.d.ts.map +0 -1
  138. package/dist/giveawayPrizes.js +0 -50
  139. package/dist/giveawayPrizes.js.map +0 -1
  140. package/dist/giveawayRoster.d.ts +0 -53
  141. package/dist/giveawayRoster.d.ts.map +0 -1
  142. package/dist/giveawayRoster.js +0 -93
  143. package/dist/giveawayRoster.js.map +0 -1
  144. package/dist/heldComments.d.ts +0 -40
  145. package/dist/heldComments.d.ts.map +0 -1
  146. package/dist/heldComments.js +0 -75
  147. package/dist/heldComments.js.map +0 -1
  148. package/dist/hiddenShows.d.ts +0 -44
  149. package/dist/hiddenShows.d.ts.map +0 -1
  150. package/dist/hiddenShows.js +0 -53
  151. package/dist/hiddenShows.js.map +0 -1
  152. package/dist/linkLots.d.ts +0 -64
  153. package/dist/linkLots.d.ts.map +0 -1
  154. package/dist/linkLots.js +0 -84
  155. package/dist/linkLots.js.map +0 -1
  156. package/dist/liveHaptics.d.ts +0 -7
  157. package/dist/liveHaptics.d.ts.map +0 -1
  158. package/dist/liveHaptics.js +0 -11
  159. package/dist/liveHaptics.js.map +0 -1
  160. package/dist/liveHaptics.native.d.ts +0 -7
  161. package/dist/liveHaptics.native.d.ts.map +0 -1
  162. package/dist/liveHaptics.native.js +0 -12
  163. package/dist/liveHaptics.native.js.map +0 -1
  164. package/dist/livePages.d.ts +0 -176
  165. package/dist/livePages.d.ts.map +0 -1
  166. package/dist/livePages.js +0 -216
  167. package/dist/livePages.js.map +0 -1
  168. package/dist/liveRoom.d.ts +0 -21
  169. package/dist/liveRoom.d.ts.map +0 -1
  170. package/dist/liveRoom.js +0 -28
  171. package/dist/liveRoom.js.map +0 -1
  172. package/dist/liveShow.d.ts +0 -58
  173. package/dist/liveShow.d.ts.map +0 -1
  174. package/dist/liveShow.js +0 -55
  175. package/dist/liveShow.js.map +0 -1
  176. package/dist/pageOptions.d.ts +0 -134
  177. package/dist/pageOptions.d.ts.map +0 -1
  178. package/dist/pageOptions.js +0 -102
  179. package/dist/pageOptions.js.map +0 -1
  180. package/dist/pageTypes.d.ts +0 -185
  181. package/dist/pageTypes.d.ts.map +0 -1
  182. package/dist/pageTypes.js +0 -3
  183. package/dist/pageTypes.js.map +0 -1
  184. package/dist/phoneTaps.d.ts +0 -25
  185. package/dist/phoneTaps.d.ts.map +0 -1
  186. package/dist/phoneTaps.js +0 -47
  187. package/dist/phoneTaps.js.map +0 -1
  188. package/dist/pipWindow.d.ts +0 -85
  189. package/dist/pipWindow.d.ts.map +0 -1
  190. package/dist/pipWindow.js +0 -88
  191. package/dist/pipWindow.js.map +0 -1
  192. package/dist/react/clocks.d.ts +0 -29
  193. package/dist/react/clocks.d.ts.map +0 -1
  194. package/dist/react/clocks.js +0 -124
  195. package/dist/react/clocks.js.map +0 -1
  196. package/dist/react/navigation.d.ts +0 -13
  197. package/dist/react/navigation.d.ts.map +0 -1
  198. package/dist/react/navigation.js +0 -7
  199. package/dist/react/navigation.js.map +0 -1
  200. package/dist/react/platformSession.d.ts +0 -16
  201. package/dist/react/platformSession.d.ts.map +0 -1
  202. package/dist/react/platformSession.js +0 -28
  203. package/dist/react/platformSession.js.map +0 -1
  204. package/dist/react/platformSession.web.d.ts +0 -35
  205. package/dist/react/platformSession.web.d.ts.map +0 -1
  206. package/dist/react/platformSession.web.js +0 -148
  207. package/dist/react/platformSession.web.js.map +0 -1
  208. package/dist/react/replayPlayer.d.ts +0 -83
  209. package/dist/react/replayPlayer.d.ts.map +0 -1
  210. package/dist/react/replayPlayer.js +0 -315
  211. package/dist/react/replayPlayer.js.map +0 -1
  212. package/dist/react/share.d.ts +0 -22
  213. package/dist/react/share.d.ts.map +0 -1
  214. package/dist/react/share.js +0 -45
  215. package/dist/react/share.js.map +0 -1
  216. package/dist/react/shopifyProviders.d.ts +0 -74
  217. package/dist/react/shopifyProviders.d.ts.map +0 -1
  218. package/dist/react/shopifyProviders.js +0 -110
  219. package/dist/react/shopifyProviders.js.map +0 -1
  220. package/dist/react/showPages.d.ts +0 -106
  221. package/dist/react/showPages.d.ts.map +0 -1
  222. package/dist/react/showPages.js +0 -166
  223. package/dist/react/showPages.js.map +0 -1
  224. package/dist/react/showPagesOnDevice.d.ts +0 -18
  225. package/dist/react/showPagesOnDevice.d.ts.map +0 -1
  226. package/dist/react/showPagesOnDevice.js +0 -31
  227. package/dist/react/showPagesOnDevice.js.map +0 -1
  228. package/dist/react/startSignIn.d.ts +0 -3
  229. package/dist/react/startSignIn.d.ts.map +0 -1
  230. package/dist/react/startSignIn.js +0 -19
  231. package/dist/react/startSignIn.js.map +0 -1
  232. package/dist/react/systemPictureInPicture.d.ts +0 -34
  233. package/dist/react/systemPictureInPicture.d.ts.map +0 -1
  234. package/dist/react/systemPictureInPicture.js +0 -93
  235. package/dist/react/systemPictureInPicture.js.map +0 -1
  236. package/dist/react/useAccountName.d.ts +0 -8
  237. package/dist/react/useAccountName.d.ts.map +0 -1
  238. package/dist/react/useAccountName.js +0 -49
  239. package/dist/react/useAccountName.js.map +0 -1
  240. package/dist/react/useClipsPage.d.ts +0 -47
  241. package/dist/react/useClipsPage.d.ts.map +0 -1
  242. package/dist/react/useClipsPage.js +0 -130
  243. package/dist/react/useClipsPage.js.map +0 -1
  244. package/dist/react/useCommentLinkCards.d.ts +0 -6
  245. package/dist/react/useCommentLinkCards.d.ts.map +0 -1
  246. package/dist/react/useCommentLinkCards.js +0 -67
  247. package/dist/react/useCommentLinkCards.js.map +0 -1
  248. package/dist/react/useFeaturedClip.d.ts +0 -15
  249. package/dist/react/useFeaturedClip.d.ts.map +0 -1
  250. package/dist/react/useFeaturedClip.js +0 -52
  251. package/dist/react/useFeaturedClip.js.map +0 -1
  252. package/dist/react/useGiveawayEntry.d.ts +0 -59
  253. package/dist/react/useGiveawayEntry.d.ts.map +0 -1
  254. package/dist/react/useGiveawayEntry.js +0 -170
  255. package/dist/react/useGiveawayEntry.js.map +0 -1
  256. package/dist/react/useGiveawayPrize.d.ts +0 -12
  257. package/dist/react/useGiveawayPrize.d.ts.map +0 -1
  258. package/dist/react/useGiveawayPrize.js +0 -53
  259. package/dist/react/useGiveawayPrize.js.map +0 -1
  260. package/dist/react/useGiveawayPrizes.d.ts +0 -4
  261. package/dist/react/useGiveawayPrizes.d.ts.map +0 -1
  262. package/dist/react/useGiveawayPrizes.js +0 -58
  263. package/dist/react/useGiveawayPrizes.js.map +0 -1
  264. package/dist/react/useHiddenShows.d.ts +0 -10
  265. package/dist/react/useHiddenShows.d.ts.map +0 -1
  266. package/dist/react/useHiddenShows.js +0 -30
  267. package/dist/react/useHiddenShows.js.map +0 -1
  268. package/dist/react/useKeepScreenAwake.d.ts +0 -2
  269. package/dist/react/useKeepScreenAwake.d.ts.map +0 -1
  270. package/dist/react/useKeepScreenAwake.js +0 -34
  271. package/dist/react/useKeepScreenAwake.js.map +0 -1
  272. package/dist/react/useLiveAuction.d.ts +0 -106
  273. package/dist/react/useLiveAuction.d.ts.map +0 -1
  274. package/dist/react/useLiveAuction.js +0 -253
  275. package/dist/react/useLiveAuction.js.map +0 -1
  276. package/dist/react/useLiveChat.d.ts +0 -115
  277. package/dist/react/useLiveChat.d.ts.map +0 -1
  278. package/dist/react/useLiveChat.js +0 -231
  279. package/dist/react/useLiveChat.js.map +0 -1
  280. package/dist/react/useLiveGiveawaysAndPolls.d.ts +0 -95
  281. package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +0 -1
  282. package/dist/react/useLiveGiveawaysAndPolls.js +0 -225
  283. package/dist/react/useLiveGiveawaysAndPolls.js.map +0 -1
  284. package/dist/react/useLivePage.d.ts +0 -140
  285. package/dist/react/useLivePage.d.ts.map +0 -1
  286. package/dist/react/useLivePage.js +0 -319
  287. package/dist/react/useLivePage.js.map +0 -1
  288. package/dist/react/useLiveShop.d.ts +0 -96
  289. package/dist/react/useLiveShop.d.ts.map +0 -1
  290. package/dist/react/useLiveShop.js +0 -195
  291. package/dist/react/useLiveShop.js.map +0 -1
  292. package/dist/react/useLiveShow.d.ts +0 -3
  293. package/dist/react/useLiveShow.d.ts.map +0 -1
  294. package/dist/react/useLiveShow.js +0 -21
  295. package/dist/react/useLiveShow.js.map +0 -1
  296. package/dist/react/useMySilentAuctionBids.d.ts +0 -29
  297. package/dist/react/useMySilentAuctionBids.d.ts.map +0 -1
  298. package/dist/react/useMySilentAuctionBids.js +0 -157
  299. package/dist/react/useMySilentAuctionBids.js.map +0 -1
  300. package/dist/react/useReplayPage.d.ts +0 -155
  301. package/dist/react/useReplayPage.d.ts.map +0 -1
  302. package/dist/react/useReplayPage.js +0 -578
  303. package/dist/react/useReplayPage.js.map +0 -1
  304. package/dist/react/useSilentAuctionLot.d.ts +0 -44
  305. package/dist/react/useSilentAuctionLot.d.ts.map +0 -1
  306. package/dist/react/useSilentAuctionLot.js +0 -168
  307. package/dist/react/useSilentAuctionLot.js.map +0 -1
  308. package/dist/react/useSilentAuctionLots.d.ts +0 -41
  309. package/dist/react/useSilentAuctionLots.d.ts.map +0 -1
  310. package/dist/react/useSilentAuctionLots.js +0 -64
  311. package/dist/react/useSilentAuctionLots.js.map +0 -1
  312. package/dist/react/useSilentAuctionRounds.d.ts +0 -15
  313. package/dist/react/useSilentAuctionRounds.d.ts.map +0 -1
  314. package/dist/react/useSilentAuctionRounds.js +0 -44
  315. package/dist/react/useSilentAuctionRounds.js.map +0 -1
  316. package/dist/replayPages.d.ts +0 -31
  317. package/dist/replayPages.d.ts.map +0 -1
  318. package/dist/replayPages.js +0 -34
  319. package/dist/replayPages.js.map +0 -1
  320. package/dist/shopifyCommerce.d.ts +0 -204
  321. package/dist/shopifyCommerce.d.ts.map +0 -1
  322. package/dist/shopifyCommerce.js +0 -214
  323. package/dist/shopifyCommerce.js.map +0 -1
  324. package/dist/shopifyIdentity.d.ts +0 -61
  325. package/dist/shopifyIdentity.d.ts.map +0 -1
  326. package/dist/shopifyIdentity.js +0 -61
  327. package/dist/shopifyIdentity.js.map +0 -1
  328. package/dist/shopifyIds.d.ts +0 -9
  329. package/dist/shopifyIds.d.ts.map +0 -1
  330. package/dist/shopifyIds.js +0 -18
  331. package/dist/shopifyIds.js.map +0 -1
  332. package/dist/showCredit.d.ts +0 -87
  333. package/dist/showCredit.d.ts.map +0 -1
  334. package/dist/showCredit.js +0 -120
  335. package/dist/showCredit.js.map +0 -1
  336. package/dist/showLinks.d.ts +0 -24
  337. package/dist/showLinks.d.ts.map +0 -1
  338. package/dist/showLinks.js +0 -23
  339. package/dist/showLinks.js.map +0 -1
  340. package/dist/showLots.d.ts +0 -28
  341. package/dist/showLots.d.ts.map +0 -1
  342. package/dist/showLots.js +0 -51
  343. package/dist/showLots.js.map +0 -1
  344. package/dist/showNames.d.ts +0 -77
  345. package/dist/showNames.d.ts.map +0 -1
  346. package/dist/showNames.js +0 -143
  347. package/dist/showNames.js.map +0 -1
  348. package/dist/showPages.d.ts +0 -56
  349. package/dist/showPages.d.ts.map +0 -1
  350. package/dist/showPages.js +0 -48
  351. package/dist/showPages.js.map +0 -1
  352. package/dist/silentAuctionFeed.d.ts +0 -49
  353. package/dist/silentAuctionFeed.d.ts.map +0 -1
  354. package/dist/silentAuctionFeed.js +0 -242
  355. package/dist/silentAuctionFeed.js.map +0 -1
  356. package/dist/silentAuctionRules.d.ts +0 -236
  357. package/dist/silentAuctionRules.d.ts.map +0 -1
  358. package/dist/silentAuctionRules.js +0 -478
  359. package/dist/silentAuctionRules.js.map +0 -1
  360. package/dist/silentAuctions.d.ts +0 -65
  361. package/dist/silentAuctions.d.ts.map +0 -1
  362. package/dist/silentAuctions.js +0 -272
  363. package/dist/silentAuctions.js.map +0 -1
  364. package/dist/storeData.d.ts +0 -45
  365. package/dist/storeData.d.ts.map +0 -1
  366. package/dist/storeData.js +0 -35
  367. package/dist/storeData.js.map +0 -1
  368. package/dist/ui/BubbleFrame.d.ts +0 -38
  369. package/dist/ui/BubbleFrame.d.ts.map +0 -1
  370. package/dist/ui/BubbleFrame.js +0 -181
  371. package/dist/ui/BubbleFrame.js.map +0 -1
  372. package/dist/ui/LiveBubble.d.ts +0 -37
  373. package/dist/ui/LiveBubble.d.ts.map +0 -1
  374. package/dist/ui/LiveBubble.js +0 -101
  375. package/dist/ui/LiveBubble.js.map +0 -1
  376. package/dist/ui/ReplayBubble.d.ts +0 -23
  377. package/dist/ui/ReplayBubble.d.ts.map +0 -1
  378. package/dist/ui/ReplayBubble.js +0 -71
  379. package/dist/ui/ReplayBubble.js.map +0 -1
  380. package/dist/ui.d.ts +0 -27
  381. package/dist/ui.d.ts.map +0 -1
  382. package/dist/ui.js +0 -34
  383. package/dist/ui.js.map +0 -1
  384. package/dist/viewerRules.d.ts +0 -39
  385. package/dist/viewerRules.d.ts.map +0 -1
  386. package/dist/viewerRules.js +0 -46
  387. package/dist/viewerRules.js.map +0 -1
  388. package/dist/zegoEngine.d.ts +0 -173
  389. package/dist/zegoEngine.d.ts.map +0 -1
  390. package/dist/zegoEngine.js +0 -1069
  391. package/dist/zegoEngine.js.map +0 -1
package/README.md CHANGED
@@ -494,6 +494,10 @@ const routes: LiveSellingRoutes = {
494
494
  shopName={APP_NAME}
495
495
  // 0.15.0: the names nobody watching may go by, from a list the app publishes (`blockedNamesFrom`).
496
496
  blockedNames={blockedNamesFrom(publishedBlockedNames)}
497
+ // 0.16.0, optional: a limit on each viewer's reactions, refilled when the host features another product;
498
+ // past it a tap sends nothing and onReactionLimitReached is called. Unset: no limit.
499
+ reactionLimit={15}
500
+ onReactionLimitReached={() => showToast('Please wait before reacting again.')}
497
501
  >
498
502
  <ShopifyLiveSessionProvider>
499
503
  <ReplayPlayerProvider>
@@ -798,7 +802,7 @@ gate.bidOnItsWay; // true for BID_ON_ITS_WAY_MS (1.2 s) after a bid goes
798
802
  ```
799
803
 
800
804
  The store's bar (0.16.0): the provider's `viewerRestrictions` (on Shopify, the customer's `BIDBLOCKED` /
801
- `APPBLOCKED` tags). Barred, a bid stops at `blocked`, before unpaid wins. Not read yet, it waits at
805
+ `APPBLOCKED` tags, read by `viewerRestrictionsFromTags`). Barred, a bid stops at `blocked`, before unpaid wins. Not read yet, it waits at
802
806
  `checkingAccount` ("Checking your account…") while they are read again, then goes on (or stops at `blocked`);
803
807
  not read within `ACCOUNT_CHECK_LIMIT_MS` (10 s) it is dropped at `accountUnknown`.
804
808
 
@@ -1 +1 @@
1
- {"version":3,"file":"auctions.d.ts","sourceRoot":"","sources":["../src/auctions.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,SAAS,CAAC;AA8FxE,eAAO,MAAM,QAAQ,EAAE,WAkGtB,CAAC"}
1
+ {"version":3,"file":"auctions.d.ts","sourceRoot":"","sources":["../src/auctions.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,SAAS,CAAC;AAuExE,eAAO,MAAM,QAAQ,EAAE,WAoFtB,CAAC"}
package/dist/auctions.js CHANGED
@@ -24,8 +24,6 @@ const UNPAID_WINS_QUERY = /* GraphQL */ `
24
24
  }
25
25
  }
26
26
  `;
27
- /** A silent auction's wins are recorded under a key of their own, `silent_…` (0.12.0). */
28
- const SILENT_KEY_PREFIX = 'silent_';
29
27
  async function fetchWinnerMetafield() {
30
28
  var _a, _b;
31
29
  const customerAccountRequest = (0, client_1.getCustomerAccountRequest)();
@@ -61,22 +59,6 @@ function isPayable(raw) {
61
59
  * The error is deliberately one-sided. Skipping an unpayable key can at worst let through a bid the
62
60
  * host refuses; counting one blocks a paying customer permanently.
63
61
  */
64
- /**
65
- * The streams whose unpaid wins block bidding elsewhere (0.12.0): every stream with something payable,
66
- * save a silent auction's (`silent_…`) whose payment deadlines haven't passed. A silent win's winner
67
- * has until its `purchaseDeadline` to pay and is expected to go on shopping and bidding meanwhile; one
68
- * with no deadline never becomes overdue, so never blocks (Sparkl's rule). Live wins are unchanged.
69
- */
70
- function blockingStreamIds(parsed, nowMs) {
71
- return payableStreamIds(parsed).filter((streamingId) => {
72
- if (!streamingId.startsWith(SILENT_KEY_PREFIX))
73
- return true;
74
- return parsed[streamingId].filter(isPayable).some((raw) => {
75
- const deadline = raw.purchaseDeadline ? Date.parse(raw.purchaseDeadline) : Number.NaN;
76
- return Number.isFinite(deadline) && deadline < nowMs;
77
- });
78
- });
79
- }
80
62
  function payableStreamIds(parsed) {
81
63
  return Object.keys(parsed).filter((streamingId) => {
82
64
  const entries = parsed[streamingId];
@@ -124,7 +106,7 @@ exports.auctions = {
124
106
  async unpaidStreamIds() {
125
107
  try {
126
108
  const parsed = await fetchWinnerMetafield();
127
- return parsed ? blockingStreamIds(parsed, Date.now()) : [];
109
+ return parsed ? payableStreamIds(parsed) : [];
128
110
  }
129
111
  catch {
130
112
  // A metafield read failing must not lock a customer out of bidding.
@@ -136,27 +118,19 @@ exports.auctions = {
136
118
  if (!parsed)
137
119
  return null;
138
120
  /**
139
- * Every stream with something payable, not just the first.
121
+ * The first stream with something payable, rather than the first key.
140
122
  *
141
- * This used to read one stream, on the reasoning that the bid gate stops a customer accruing wins
142
- * on a second stream while the first is unpaid. That holds for bids and not for giveaways:
143
- * `enterGiveaway` has no such gate, so a shopper with an unpaid win from one show can win a
144
- * giveaway in the next. The metafield then has two keys, and the giveaway under the second never
145
- * reached the cart (production's DEL-2569). Each item keeps the stream it was won on.
146
- *
147
- * `streamingId` stays one stream — the first with something payable, not the first key, so a
148
- * leftover empty key cannot hide a real win behind it — because `auction_id` is a single cart
149
- * attribute and there is no honest value for a cart spanning two shows. That is a limitation, not
150
- * a solved problem: per production's note on DEL-2569, the host marks that one stream's tab settled,
151
- * so wins carried over from another stay flagged unpaid until it catches up. Accepted there for the
152
- * same reason it is here: a prize the shopper paid for and can see beats one that silently does not
153
- * exist, and the alternative (a cart per stream) needs a checkout that can open more than one.
123
+ * One tab per checkout is the host's model — the cart carries a single `auction_id` and the gate
124
+ * stops a customer accruing wins on a second stream while the first is unpaid — so in practice
125
+ * there is one. Taking `Object.keys()[0]` regardless meant a leftover empty key hid a real win
126
+ * sitting behind it, and the customer was blocked by the very win the tab refused to show.
154
127
  */
155
- const streamingIds = payableStreamIds(parsed);
156
- const [streamingId] = streamingIds;
128
+ const [streamingId] = payableStreamIds(parsed);
157
129
  if (!streamingId)
158
130
  return null;
159
- const items = streamingIds.flatMap((stream) => parsed[stream].filter(isPayable).map((raw) => {
131
+ const items = (Array.isArray(parsed[streamingId]) ? parsed[streamingId] : [])
132
+ .filter(isPayable)
133
+ .map((raw) => {
160
134
  var _a;
161
135
  return ({
162
136
  productGid: `gid://shopify/Product/${raw.productId}`,
@@ -164,12 +138,8 @@ exports.auctions = {
164
138
  winningBid: Number(raw.winningBid) || 0,
165
139
  isGiveaway: !!raw.isGiveaway,
166
140
  discountCode: (_a = raw.discountCode) !== null && _a !== void 0 ? _a : null,
167
- streamingId: stream,
168
- // A silent auction's two fields, only when it has them, so a live win is as it was.
169
- ...(typeof raw.lotNumber === 'number' ? { lotNumber: raw.lotNumber } : {}),
170
- ...(raw.purchaseDeadline ? { purchaseDeadline: raw.purchaseDeadline } : {}),
171
141
  });
172
- }));
142
+ });
173
143
  return items.length ? { streamingId, items } : null;
174
144
  },
175
145
  isBiddingBlocked(unpaidStreamIds, streamingId) {
@@ -1 +1 @@
1
- {"version":3,"file":"auctions.js","sourceRoot":"","sources":["../src/auctions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,qCAOkB;AAKlB,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAE1C,gFAAgF;AAEhF,MAAM,iBAAiB,GAAG,aAAa,CAAC;;;;;;;;CAQvC,CAAC;AAgBF,0FAA0F;AAC1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gBAC5B,YAAY,EAAE,MAAA,GAAG,CAAC,YAAY,mCAAI,IAAI;aACvC,CAAC,CAAA;SAAA,CAAC,CAAC;QAEN,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAE,EAAE,WAAW,EAAE,KAAK,EAAyB,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,CAAC;IAED,gBAAgB,CAAC,eAAyB,EAAE,WAA0B;QACpE,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAC9B,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;CACF,CAAC"}
package/dist/client.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Replaces the app's `APP_CONFIG.liveSelling` / `LIVE_CONFIG` globals with an explicit `configure`.
11
11
  */
12
- import type { CustomerAccountRequest, HiddenShows, LiveSellingConfig, Logger, StorageAdapter } from './types';
12
+ import type { CustomerAccountRequest, LiveSellingConfig, Logger, StorageAdapter } from './types';
13
13
  import type { CommerceAdapter, IdentityAdapter } from './sessionTypes';
14
14
  /** The service stores bare numeric Shopify ids; everything downstream speaks GIDs. */
15
15
  export declare function toProductGid(id: string): string;
@@ -23,28 +23,6 @@ export declare class LiveSellingError extends Error {
23
23
  readonly status: number;
24
24
  constructor(status: number);
25
25
  }
26
- /** How long a request may take before it is given up on, unless `requestTimeoutMs` says otherwise. */
27
- export declare const DEFAULT_REQUEST_TIMEOUT_MS = 10000;
28
- /**
29
- * A request that took longer than `requestTimeoutMs` and was given up on.
30
- *
31
- * Its own class rather than a `LiveSellingError`, because there is no HTTP status to carry: the server
32
- * never answered. A caller tells the two apart with `instanceof`; `url` says which call it was.
33
- *
34
- * Before 0.9.0 nothing had a timeout, so a request on a dead connection never settled — a join waiting
35
- * on its room token, or a record read, hung for as long as the OS kept the socket open.
36
- */
37
- export declare class LiveSellingTimeoutError extends Error {
38
- readonly url: string;
39
- readonly timeoutMs: number;
40
- constructor(url: string, timeoutMs: number);
41
- }
42
- /**
43
- * A store that keeps things only in memory, for as long as the app runs. Used until `configure` is
44
- * called (which requires the app's own `storage`), and by the tests. Not on the package's root: an app
45
- * passes real storage.
46
- */
47
- export declare function memoryStorage(): StorageAdapter;
48
26
  export declare function setConfig(config: LiveSellingConfig): void;
49
27
  export declare function getConfig(): LiveSellingConfig;
50
28
  export declare function isConfigured(): boolean;
@@ -70,38 +48,11 @@ export declare function getCommerce(): CommerceAdapter<unknown> | null;
70
48
  * answers before `configure()` has run instead of throwing.
71
49
  */
72
50
  export declare function strictActiveProduct(): boolean;
73
- /**
74
- * The shows to keep from shoppers (`hiddenShows` on the config), or null when the app hides none.
75
- * Read through here so it answers before `configure()` has run instead of throwing.
76
- */
77
- export declare function hiddenShowsRule(): HiddenShows | null;
78
- /** How long the session waits with nothing on air before it calls the show ended. */
79
- export declare const DEFAULT_OFF_AIR_GRACE_MS = 4000;
80
- /** `offAirGraceMs` from the config, or 4 seconds. Same fallback rules as `requestTimeoutMs`. */
81
- export declare function offAirGraceMs(): number;
82
51
  /** Null when nobody is identified beyond the per-install viewer id — bidding is then never offered. */
83
52
  export declare function getIdentity(): IdentityAdapter | null;
84
- /**
85
- * The timeout every request gets: `requestTimeoutMs` from the config, or 10 seconds.
86
- *
87
- * Read through here so it answers before `configure()` has run (the CDN comment file needs no config)
88
- * and so a nonsense value — zero, negative, not a number — falls back rather than making every request
89
- * fail at once.
90
- */
91
- export declare function requestTimeoutMs(): number;
92
- /**
93
- * Runs one HTTP exchange — the fetch AND reading its body — under a deadline.
94
- *
95
- * The deadline covers the body too, because a server can send headers and then stall. Two things
96
- * enforce it: an `AbortController`, so the socket is actually released, and a timer that rejects on
97
- * its own, because a `fetch` that ignores `signal` (an old polyfill, a test double) would otherwise
98
- * still hang. Either way the caller sees a `LiveSellingTimeoutError`, never a bare `AbortError`.
99
- */
100
- export declare function withRequestTimeout<T>(url: string, exchange: (signal: AbortSignal | undefined) => Promise<T>, timeoutMs?: number): Promise<T>;
101
53
  /**
102
54
  * The gateway request. The company header is the only credential; a body implies JSON. `X-Request-Source`
103
- * marks the traffic as first-party app rather than a web widget. Every call is time-boxed — see
104
- * `withRequestTimeout`.
55
+ * marks the traffic as first-party app rather than a web widget.
105
56
  */
106
57
  export declare function liveSellingRequest<T>(path: string, options?: {
107
58
  params?: Record<string, string | number>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9G,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIvE,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAIpC;AAED,sGAAsG;AACtG,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAE9C,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM;gBADjB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM;CAK7B;AAID;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,cAAc,CAW9C;AAUD,wBAAgB,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CASzD;AAED,wBAAgB,SAAS,IAAI,iBAAiB,CAG7C;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,YAAY,IAAI,MAAM,GAAG,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AAC9F,wBAAgB,WAAW,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,IAAI,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED,uGAAuG;AACvG,wBAAgB,WAAW,IAAI,eAAe,GAAG,IAAI,CAEpD;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GACA,OAAO,CAAC,CAAC,CAAC,CAgBZ;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAK,GAAG,MAAM,CAM5C;AAED,2FAA2F;AAC3F,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEpE;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E"}
package/dist/client.js CHANGED
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_OFF_AIR_GRACE_MS = exports.LiveSellingTimeoutError = exports.DEFAULT_REQUEST_TIMEOUT_MS = exports.LiveSellingError = void 0;
3
+ exports.LiveSellingError = void 0;
4
4
  exports.toProductGid = toProductGid;
5
- exports.memoryStorage = memoryStorage;
6
5
  exports.setConfig = setConfig;
7
6
  exports.getConfig = getConfig;
8
7
  exports.isConfigured = isConfigured;
@@ -13,11 +12,7 @@ exports.logWarning = logWarning;
13
12
  exports.getCustomerAccountRequest = getCustomerAccountRequest;
14
13
  exports.getCommerce = getCommerce;
15
14
  exports.strictActiveProduct = strictActiveProduct;
16
- exports.hiddenShowsRule = hiddenShowsRule;
17
- exports.offAirGraceMs = offAirGraceMs;
18
15
  exports.getIdentity = getIdentity;
19
- exports.requestTimeoutMs = requestTimeoutMs;
20
- exports.withRequestTimeout = withRequestTimeout;
21
16
  exports.liveSellingRequest = liveSellingRequest;
22
17
  exports.randomId = randomId;
23
18
  exports.storageGet = storageGet;
@@ -41,33 +36,12 @@ class LiveSellingError extends Error {
41
36
  }
42
37
  }
43
38
  exports.LiveSellingError = LiveSellingError;
44
- /** How long a request may take before it is given up on, unless `requestTimeoutMs` says otherwise. */
45
- exports.DEFAULT_REQUEST_TIMEOUT_MS = 10000;
46
- /**
47
- * A request that took longer than `requestTimeoutMs` and was given up on.
48
- *
49
- * Its own class rather than a `LiveSellingError`, because there is no HTTP status to carry: the server
50
- * never answered. A caller tells the two apart with `instanceof`; `url` says which call it was.
51
- *
52
- * Before 0.9.0 nothing had a timeout, so a request on a dead connection never settled — a join waiting
53
- * on its room token, or a record read, hung for as long as the OS kept the socket open.
54
- */
55
- class LiveSellingTimeoutError extends Error {
56
- constructor(url, timeoutMs) {
57
- super(`Live-selling request timed out after ${timeoutMs}ms: ${url}`);
58
- this.url = url;
59
- this.timeoutMs = timeoutMs;
60
- this.name = 'LiveSellingTimeoutError';
61
- }
62
- }
63
- exports.LiveSellingTimeoutError = LiveSellingTimeoutError;
64
39
  const SILENT = { error: () => undefined };
65
- /**
66
- * A store that keeps things only in memory, for as long as the app runs. Used until `configure` is
67
- * called (which requires the app's own `storage`), and by the tests. Not on the package's root: an app
68
- * passes real storage.
69
- */
70
- function memoryStorage() {
40
+ /** Prefers `window.localStorage`; falls back to a process-lifetime in-memory map. */
41
+ function defaultStorage() {
42
+ const ls = globalThis.localStorage;
43
+ if (ls && typeof ls.getItem === 'function')
44
+ return ls;
71
45
  const mem = new Map();
72
46
  return {
73
47
  getItem: (key) => (mem.has(key) ? mem.get(key) : null),
@@ -79,20 +53,16 @@ function memoryStorage() {
79
53
  },
80
54
  };
81
55
  }
82
- const state = { config: null, storage: memoryStorage(), logger: SILENT };
56
+ const state = { config: null, storage: defaultStorage(), logger: SILENT };
83
57
  function setConfig(config) {
84
- var _a;
58
+ var _a, _b;
85
59
  if (!config.apiUrl)
86
60
  throw new Error('liveSelling.configure: apiUrl is required');
87
61
  if (!config.companyId)
88
62
  throw new Error('liveSelling.configure: companyId is required');
89
- // Required since 0.9.0: without it a phone forgot poll votes (counted twice), the viewer's name and
90
- // the accepted terms on every relaunch. AsyncStorage on a phone, window.localStorage on the web.
91
- if (!config.storage)
92
- throw new Error('liveSelling.configure: storage is required (AsyncStorage on a phone, localStorage on the web)');
93
63
  state.config = config;
94
- state.storage = config.storage;
95
- state.logger = (_a = config.logger) !== null && _a !== void 0 ? _a : SILENT;
64
+ state.storage = (_a = config.storage) !== null && _a !== void 0 ? _a : defaultStorage();
65
+ state.logger = (_b = config.logger) !== null && _b !== void 0 ? _b : SILENT;
96
66
  }
97
67
  function getConfig() {
98
68
  if (!state.config)
@@ -146,103 +116,33 @@ function strictActiveProduct() {
146
116
  var _a;
147
117
  return ((_a = state.config) === null || _a === void 0 ? void 0 : _a.strictActiveProduct) === true;
148
118
  }
149
- /**
150
- * The shows to keep from shoppers (`hiddenShows` on the config), or null when the app hides none.
151
- * Read through here so it answers before `configure()` has run instead of throwing.
152
- */
153
- function hiddenShowsRule() {
154
- var _a, _b;
155
- return (_b = (_a = state.config) === null || _a === void 0 ? void 0 : _a.hiddenShows) !== null && _b !== void 0 ? _b : null;
156
- }
157
- /** How long the session waits with nothing on air before it calls the show ended. */
158
- exports.DEFAULT_OFF_AIR_GRACE_MS = 4000;
159
- /** `offAirGraceMs` from the config, or 4 seconds. Same fallback rules as `requestTimeoutMs`. */
160
- function offAirGraceMs() {
161
- var _a;
162
- const configured = (_a = state.config) === null || _a === void 0 ? void 0 : _a.offAirGraceMs;
163
- return typeof configured === 'number' && Number.isFinite(configured) && configured > 0
164
- ? configured
165
- : exports.DEFAULT_OFF_AIR_GRACE_MS;
166
- }
167
119
  /** Null when nobody is identified beyond the per-install viewer id — bidding is then never offered. */
168
120
  function getIdentity() {
169
121
  var _a, _b;
170
122
  return (_b = (_a = state.config) === null || _a === void 0 ? void 0 : _a.identity) !== null && _b !== void 0 ? _b : null;
171
123
  }
172
- /**
173
- * The timeout every request gets: `requestTimeoutMs` from the config, or 10 seconds.
174
- *
175
- * Read through here so it answers before `configure()` has run (the CDN comment file needs no config)
176
- * and so a nonsense value — zero, negative, not a number — falls back rather than making every request
177
- * fail at once.
178
- */
179
- function requestTimeoutMs() {
180
- var _a;
181
- const configured = (_a = state.config) === null || _a === void 0 ? void 0 : _a.requestTimeoutMs;
182
- return typeof configured === 'number' && Number.isFinite(configured) && configured > 0
183
- ? configured
184
- : exports.DEFAULT_REQUEST_TIMEOUT_MS;
185
- }
186
- /**
187
- * Runs one HTTP exchange — the fetch AND reading its body — under a deadline.
188
- *
189
- * The deadline covers the body too, because a server can send headers and then stall. Two things
190
- * enforce it: an `AbortController`, so the socket is actually released, and a timer that rejects on
191
- * its own, because a `fetch` that ignores `signal` (an old polyfill, a test double) would otherwise
192
- * still hang. Either way the caller sees a `LiveSellingTimeoutError`, never a bare `AbortError`.
193
- */
194
- async function withRequestTimeout(url, exchange, timeoutMs = requestTimeoutMs()) {
195
- const controller = typeof AbortController === 'function' ? new AbortController() : null;
196
- let timer = null;
197
- let timedOut = false;
198
- const deadline = new Promise((_, reject) => {
199
- timer = setTimeout(() => {
200
- timedOut = true;
201
- controller === null || controller === void 0 ? void 0 : controller.abort();
202
- reject(new LiveSellingTimeoutError(url, timeoutMs));
203
- }, timeoutMs);
204
- });
205
- try {
206
- return await Promise.race([exchange(controller === null || controller === void 0 ? void 0 : controller.signal), deadline]);
207
- }
208
- catch (caught) {
209
- // The abort above makes `fetch` reject with an `AbortError` of its own; that IS the timeout.
210
- if (timedOut)
211
- throw new LiveSellingTimeoutError(url, timeoutMs);
212
- throw caught;
213
- }
214
- finally {
215
- if (timer)
216
- clearTimeout(timer);
217
- }
218
- }
219
124
  /**
220
125
  * The gateway request. The company header is the only credential; a body implies JSON. `X-Request-Source`
221
- * marks the traffic as first-party app rather than a web widget. Every call is time-boxed — see
222
- * `withRequestTimeout`.
126
+ * marks the traffic as first-party app rather than a web widget.
223
127
  */
224
128
  async function liveSellingRequest(path, options) {
129
+ var _a, _b;
225
130
  const config = getConfig();
226
131
  const query = (options === null || options === void 0 ? void 0 : options.params)
227
132
  ? `?${new URLSearchParams(Object.entries(options.params).map(([k, v]) => [k, String(v)]))}`
228
133
  : '';
229
- const url = `${config.apiUrl}${path}${query}`;
230
- return withRequestTimeout(url, async (signal) => {
231
- var _a, _b;
232
- const response = await fetch(url, {
233
- method: (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'GET',
234
- headers: {
235
- 'x-company-id': config.companyId,
236
- 'X-Request-Source': (_b = config.requestSource) !== null && _b !== void 0 ? _b : 'APPTILE',
237
- ...((options === null || options === void 0 ? void 0 : options.body) ? { 'Content-Type': 'application/json' } : {}),
238
- },
239
- body: (options === null || options === void 0 ? void 0 : options.body) ? JSON.stringify(options.body) : undefined,
240
- signal,
241
- });
242
- if (!response.ok)
243
- throw new LiveSellingError(response.status);
244
- return (await response.json());
134
+ const response = await fetch(`${config.apiUrl}${path}${query}`, {
135
+ method: (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'GET',
136
+ headers: {
137
+ 'x-company-id': config.companyId,
138
+ 'X-Request-Source': (_b = config.requestSource) !== null && _b !== void 0 ? _b : 'APPTILE',
139
+ ...((options === null || options === void 0 ? void 0 : options.body) ? { 'Content-Type': 'application/json' } : {}),
140
+ },
141
+ body: (options === null || options === void 0 ? void 0 : options.body) ? JSON.stringify(options.body) : undefined,
245
142
  });
143
+ if (!response.ok)
144
+ throw new LiveSellingError(response.status);
145
+ return (await response.json());
246
146
  }
247
147
  /**
248
148
  * A stable random id. Uses the platform `crypto.randomUUID` when present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CAAC,UAAU,EAAE;QAChC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/G,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,2FAA2F;AACpF,KAAK,UAAU,UAAU,CAAC,GAAW;IAC1C,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,CAAC;AAEM,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,KAAa;IACzD,MAAM,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC"}
package/dist/clips.d.ts CHANGED
@@ -1,14 +1,3 @@
1
- import type { ClipItem, ClipsAPI } from './types';
2
- /**
3
- * The featured clip among a product's clips (`rows`, or the gateway's `{ data: rows }`): the first ranked 1
4
- * (`pdp_rank` 1 or "1"; the gateway puts it first), active, with a playlist and an id; null when the merchant
5
- * has featured none. Its window, products and poster as above; `recordingId` / `streamingId` open it on
6
- * Replay with its chat (0.16.0). Pure, for tests.
7
- */
8
- export declare function featuredClipOf(rows: unknown): ClipItem | null;
9
- /** A Shopify product video is the clip worker's copy of `clip` (its alt names the clip), so not shown twice. */
10
- export declare function isCopyOfClip(media: {
11
- alt?: string | null;
12
- } | null | undefined, clip: Pick<ClipItem, 'id'> | null | undefined): boolean;
1
+ import type { ClipsAPI } from './types';
13
2
  export declare const clips: ClipsAPI;
14
3
  //# sourceMappingURL=clips.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clips.d.ts","sourceRoot":"","sources":["../src/clips.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA+ElD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAoB7D;AAKD,gHAAgH;AAChH,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAGtI;AAKD,eAAO,MAAM,KAAK,EAAE,QA2DnB,CAAC"}
1
+ {"version":3,"file":"clips.d.ts","sourceRoot":"","sources":["../src/clips.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAY,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwBlD,eAAO,MAAM,KAAK,EAAE,QAyBnB,CAAC"}
package/dist/clips.js CHANGED
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.clips = void 0;
4
- exports.featuredClipOf = featuredClipOf;
5
- exports.isCopyOfClip = isCopyOfClip;
6
4
  /**
7
5
  * Clips, from the gateway's video collections.
8
6
  *
@@ -13,93 +11,18 @@ exports.isCopyOfClip = isCopyOfClip;
13
11
  * applied, and each clip silently plays a whole show from the top.
14
12
  */
15
13
  const client_1 = require("./client");
16
- /** Recordings read, and of those how many asked for their clips, by `clips.recent()`. */
17
- const RECENT_CLIPS_RECORDINGS = 10;
18
- const RECENT_CLIPS_PROBES = 4;
19
- function chunkToClip(chunk, index, recordingId) {
20
- var _a, _b, _c;
21
- const source = (chunk.streaming_url || chunk.url || '').trim();
22
- if (!source)
23
- return null;
24
- return {
25
- id: chunk._id || `${recordingId}-clip-${index}`,
26
- title: ((_a = chunk.title) === null || _a === void 0 ? void 0 : _a.trim()) || '',
27
- posterUrl: ((_b = chunk.thumbnail) === null || _b === void 0 ? void 0 : _b.trim()) || ((_c = chunk.thumbnail_image) === null || _c === void 0 ? void 0 : _c.trim()) || null,
28
- productIds: clipProductIds(chunk),
29
- recordingId: chunk.feed_id || recordingId,
30
- ...clipWindowOf(source, chunk),
31
- };
32
- }
33
14
  /**
34
- * A clip's window in its recording, and the playlist without the inert trim params: the row's own segment
35
- * times when it has both (end after start), else the URL's `?start=&end=` (ms, each on its own). An end at or
36
- * before the start is dropped. Read with a regex rather than `URL.searchParams`, which React Native does not
37
- * implement for reading a parsed URL back.
15
+ * Splits the trim window off the playlist URL. Read with a regex rather than `URL.searchParams`, which
16
+ * React Native does not implement for reading a parsed URL back.
38
17
  */
39
- function clipWindowOf(url, segment) {
18
+ function readTrimWindow(url) {
40
19
  const [videoUrl, query = ''] = url.split('?');
41
- const start = segment === null || segment === void 0 ? void 0 : segment.segment_start_time;
42
- const end = segment === null || segment === void 0 ? void 0 : segment.segment_end_time;
43
- if (typeof start === 'number' && typeof end === 'number' && end > start)
44
- return { videoUrl, startMs: start, endMs: end };
45
20
  const readMs = (key) => {
46
- const found = query.match(new RegExp(`(?:^|&)${key}=(\\d+(?:\\.\\d+)?)`));
21
+ const found = query.match(new RegExp(`(?:^|&)${key}=(\\d+)`));
47
22
  return found ? Number(found[1]) : null;
48
23
  };
49
- const startMs = readMs('start');
50
- const endMs = readMs('end');
51
- return { videoUrl, startMs, endMs: endMs !== null && startMs !== null && endMs <= startMs ? null : endMs };
52
- }
53
- /** The products a clip sells: its lots (`product_info`, links left out), else `product_ids`; as Shopify gids. */
54
- function clipProductIds(row) {
55
- var _a, _b;
56
- const lots = ((_a = row.product_info) !== null && _a !== void 0 ? _a : [])
57
- .filter((info) => !!(info === null || info === void 0 ? void 0 : info.store_product_id) && info.product_type !== 'url')
58
- .map((info) => info.store_product_id);
59
- return (lots.length ? lots : (_b = row.product_ids) !== null && _b !== void 0 ? _b : []).map(client_1.toProductGid);
60
- }
61
- /**
62
- * The featured clip among a product's clips (`rows`, or the gateway's `{ data: rows }`): the first ranked 1
63
- * (`pdp_rank` 1 or "1"; the gateway puts it first), active, with a playlist and an id; null when the merchant
64
- * has featured none. Its window, products and poster as above; `recordingId` / `streamingId` open it on
65
- * Replay with its chat (0.16.0). Pure, for tests.
66
- */
67
- function featuredClipOf(rows) {
68
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
69
- const list = Array.isArray(rows) ? rows : rows === null || rows === void 0 ? void 0 : rows.data;
70
- if (!Array.isArray(list))
71
- return null;
72
- for (const row of list) {
73
- // eslint-disable-next-line eqeqeq -- the gateway sends the rank as a number or a string.
74
- if (!row || row.pdp_rank == null || row.pdp_rank != 1 || row.is_active === false)
75
- continue;
76
- const url = ((_a = row.streaming_url) === null || _a === void 0 ? void 0 : _a.trim()) || ((_b = row.url) === null || _b === void 0 ? void 0 : _b.trim());
77
- const id = ((_c = row._id) === null || _c === void 0 ? void 0 : _c.trim()) || ((_d = row.feed_id) === null || _d === void 0 ? void 0 : _d.trim());
78
- if (!url || !id)
79
- continue;
80
- return {
81
- id,
82
- title: ((_e = row.title) === null || _e === void 0 ? void 0 : _e.trim()) || '',
83
- posterUrl: ((_f = row.thumbnail) === null || _f === void 0 ? void 0 : _f.trim()) || ((_g = row.thumbnail_image) === null || _g === void 0 ? void 0 : _g.trim()) || null,
84
- productIds: clipProductIds(row),
85
- recordingId: ((_h = row.feed_id) === null || _h === void 0 ? void 0 : _h.trim()) || null,
86
- streamingId: ((_j = row.streaming_id) === null || _j === void 0 ? void 0 : _j.trim()) || null,
87
- ...clipWindowOf(url, row),
88
- };
89
- }
90
- return null;
91
- }
92
- /** The alt the clip worker gives Shopify's copy of a clip it uploads to the product. */
93
- const COPY_ALT = /^Apptile product clip (\S+)$/;
94
- /** A Shopify product video is the clip worker's copy of `clip` (its alt names the clip), so not shown twice. */
95
- function isCopyOfClip(media, clip) {
96
- var _a, _b, _c;
97
- if (!media || !clip)
98
- return false;
99
- return ((_c = COPY_ALT.exec((_b = (_a = media.alt) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '')) === null || _c === void 0 ? void 0 : _c[1]) === clip.id;
24
+ return { videoUrl, startMs: readMs('start'), endMs: readMs('end') };
100
25
  }
101
- /** A product gid's number: the gateway names a product by it. */
102
- const productNumberOf = (productId) => { var _a; return (_a = productId.trim().split('/').pop()) !== null && _a !== void 0 ? _a : ''; };
103
26
  exports.clips = {
104
27
  async list() {
105
28
  var _a, _b;
@@ -122,40 +45,9 @@ exports.clips = {
122
45
  title: ((_a = item.title) === null || _a === void 0 ? void 0 : _a.trim()) || '',
123
46
  posterUrl: ((_b = item.thumbnail) === null || _b === void 0 ? void 0 : _b.trim()) || null,
124
47
  productIds: ((_c = item.product_ids) !== null && _c !== void 0 ? _c : []).map(client_1.toProductGid),
125
- ...clipWindowOf(item.url),
48
+ ...readTrimWindow(item.url),
126
49
  });
127
50
  });
128
51
  },
129
- async recent({ recordings = RECENT_CLIPS_RECORDINGS, probes = RECENT_CLIPS_PROBES } = {}) {
130
- var _a, _b, _c, _d;
131
- const body = await (0, client_1.liveSellingRequest)(
132
- // The service resolves the company from the header and never reads this path segment.
133
- '/widget/plugin/shoppable-feeds/app', { params: { limit: recordings } });
134
- const recordingIds = ((_b = (_a = body.data) === null || _a === void 0 ? void 0 : _a.feeds) !== null && _b !== void 0 ? _b : []).map((feed) => feed === null || feed === void 0 ? void 0 : feed.feed_id).filter((id) => !!id);
135
- for (const recordingId of recordingIds.slice(0, probes)) {
136
- let rows = [];
137
- try {
138
- const page = await (0, client_1.liveSellingRequest)('/live-streaming/plugin/shoppable-feeds/chunks', { params: { shoppable_feed_id: recordingId, page: 1 } });
139
- rows = (_d = (_c = page.data) === null || _c === void 0 ? void 0 : _c.streaming_shoppable_feeds) !== null && _d !== void 0 ? _d : [];
140
- }
141
- catch {
142
- // A recording that can't be cut into clips isn't the reel failing: the next one is asked.
143
- continue;
144
- }
145
- const found = rows.map((row, index) => chunkToClip(row, index, recordingId)).filter((clip) => !!clip);
146
- if (found.length)
147
- return found;
148
- }
149
- return [];
150
- },
151
- async featuredForProduct(productId) {
152
- const productNumber = productNumberOf(productId);
153
- if (!productNumber)
154
- return null;
155
- const body = await (0, client_1.liveSellingRequest)('/shoppable-feeds/product/v2', {
156
- params: { store_product_id: productNumber, company_id: (0, client_1.getConfig)().companyId },
157
- });
158
- return featuredClipOf(body);
159
- },
160
52
  };
161
53
  //# sourceMappingURL=clips.js.map