@tiledev/sdk-apptile-live-selling 0.8.1 → 0.9.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.
- package/README.md +452 -34
- package/dist/auctionComments.d.ts +25 -0
- package/dist/auctionComments.d.ts.map +1 -0
- package/dist/auctionComments.js +28 -0
- package/dist/auctionComments.js.map +1 -0
- package/dist/auctionRules.d.ts +76 -0
- package/dist/auctionRules.d.ts.map +1 -0
- package/dist/auctionRules.js +106 -0
- package/dist/auctionRules.js.map +1 -0
- package/dist/auctions.d.ts.map +1 -1
- package/dist/auctions.js +19 -10
- package/dist/auctions.js.map +1 -1
- package/dist/client.d.ts +51 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +123 -23
- package/dist/client.js.map +1 -1
- package/dist/commentHistory.d.ts +66 -0
- package/dist/commentHistory.d.ts.map +1 -0
- package/dist/commentHistory.js +125 -0
- package/dist/commentHistory.js.map +1 -0
- package/dist/engine.native.d.ts.map +1 -1
- package/dist/engine.native.js +17 -845
- package/dist/engine.native.js.map +1 -1
- package/dist/giveawayPrize.d.ts +13 -0
- package/dist/giveawayPrize.d.ts.map +1 -0
- package/dist/giveawayPrize.js +18 -0
- package/dist/giveawayPrize.js.map +1 -0
- package/dist/giveawayPrizeLines.d.ts +67 -0
- package/dist/giveawayPrizeLines.d.ts.map +1 -0
- package/dist/giveawayPrizeLines.js +48 -0
- package/dist/giveawayPrizeLines.js.map +1 -0
- package/dist/giveawayRoster.d.ts +53 -0
- package/dist/giveawayRoster.d.ts.map +1 -0
- package/dist/giveawayRoster.js +93 -0
- package/dist/giveawayRoster.js.map +1 -0
- package/dist/heldComments.d.ts +29 -0
- package/dist/heldComments.d.ts.map +1 -0
- package/dist/heldComments.js +61 -0
- package/dist/heldComments.js.map +1 -0
- package/dist/hiddenShows.d.ts +34 -0
- package/dist/hiddenShows.d.ts.map +1 -0
- package/dist/hiddenShows.js +42 -0
- package/dist/hiddenShows.js.map +1 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +93 -3
- package/dist/index.js.map +1 -1
- package/dist/liveHaptics.d.ts +7 -0
- package/dist/liveHaptics.d.ts.map +1 -0
- package/dist/liveHaptics.js +11 -0
- package/dist/liveHaptics.js.map +1 -0
- package/dist/liveHaptics.native.d.ts +7 -0
- package/dist/liveHaptics.native.d.ts.map +1 -0
- package/dist/liveHaptics.native.js +12 -0
- package/dist/liveHaptics.native.js.map +1 -0
- package/dist/liveShow.d.ts +58 -0
- package/dist/liveShow.d.ts.map +1 -0
- package/dist/liveShow.js +55 -0
- package/dist/liveShow.js.map +1 -0
- package/dist/phoneTaps.d.ts +25 -0
- package/dist/phoneTaps.d.ts.map +1 -0
- package/dist/phoneTaps.js +47 -0
- package/dist/phoneTaps.js.map +1 -0
- package/dist/pipWindow.d.ts +85 -0
- package/dist/pipWindow.d.ts.map +1 -0
- package/dist/pipWindow.js +88 -0
- package/dist/pipWindow.js.map +1 -0
- package/dist/polls.d.ts.map +1 -1
- package/dist/polls.js +3 -0
- package/dist/polls.js.map +1 -1
- package/dist/react/LiveSellingProvider.d.ts +10 -1
- package/dist/react/LiveSellingProvider.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.js +6 -2
- package/dist/react/LiveSellingProvider.js.map +1 -1
- package/dist/react/LiveVideoTarget.d.ts.map +1 -1
- package/dist/react/LiveVideoTarget.js +41 -3
- package/dist/react/LiveVideoTarget.js.map +1 -1
- package/dist/react/clocks.d.ts +29 -0
- package/dist/react/clocks.d.ts.map +1 -0
- package/dist/react/clocks.js +124 -0
- package/dist/react/clocks.js.map +1 -0
- package/dist/react/index.d.ts +7 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +15 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.web.d.ts +9 -2
- package/dist/react/index.web.d.ts.map +1 -1
- package/dist/react/index.web.js +27 -4
- package/dist/react/index.web.js.map +1 -1
- package/dist/react/startSignIn.d.ts +3 -0
- package/dist/react/startSignIn.d.ts.map +1 -0
- package/dist/react/startSignIn.js +19 -0
- package/dist/react/startSignIn.js.map +1 -0
- package/dist/react/useAuctionBidGate.d.ts +54 -4
- package/dist/react/useAuctionBidGate.d.ts.map +1 -1
- package/dist/react/useAuctionBidGate.js +169 -25
- package/dist/react/useAuctionBidGate.js.map +1 -1
- package/dist/react/useAuctionWins.d.ts +9 -1
- package/dist/react/useAuctionWins.d.ts.map +1 -1
- package/dist/react/useAuctionWins.js +9 -3
- package/dist/react/useAuctionWins.js.map +1 -1
- package/dist/react/useGiveawayEntry.d.ts +59 -0
- package/dist/react/useGiveawayEntry.d.ts.map +1 -0
- package/dist/react/useGiveawayEntry.js +170 -0
- package/dist/react/useGiveawayEntry.js.map +1 -0
- package/dist/react/useGiveawayPrize.d.ts +12 -0
- package/dist/react/useGiveawayPrize.d.ts.map +1 -0
- package/dist/react/useGiveawayPrize.js +53 -0
- package/dist/react/useGiveawayPrize.js.map +1 -0
- package/dist/react/useHiddenShows.d.ts +10 -0
- package/dist/react/useHiddenShows.d.ts.map +1 -0
- package/dist/react/useHiddenShows.js +30 -0
- package/dist/react/useHiddenShows.js.map +1 -0
- package/dist/react/useLiveSession.d.ts +7 -3
- package/dist/react/useLiveSession.d.ts.map +1 -1
- package/dist/react/useLiveSession.js +522 -157
- package/dist/react/useLiveSession.js.map +1 -1
- package/dist/react/useLiveShow.d.ts +3 -0
- package/dist/react/useLiveShow.d.ts.map +1 -0
- package/dist/react/useLiveShow.js +21 -0
- package/dist/react/useLiveShow.js.map +1 -0
- package/dist/react/useLiveStreams.d.ts.map +1 -1
- package/dist/react/useLiveStreams.js +6 -2
- package/dist/react/useLiveStreams.js.map +1 -1
- package/dist/react/useOngoingLive.d.ts +1 -0
- package/dist/react/useOngoingLive.d.ts.map +1 -1
- package/dist/react/useOngoingLive.js +7 -1
- package/dist/react/useOngoingLive.js.map +1 -1
- package/dist/react/useReplays.d.ts +12 -0
- package/dist/react/useReplays.d.ts.map +1 -1
- package/dist/react/useReplays.js +56 -24
- package/dist/react/useReplays.js.map +1 -1
- package/dist/react/useStreamInfo.d.ts +13 -2
- package/dist/react/useStreamInfo.d.ts.map +1 -1
- package/dist/react/useStreamInfo.js +31 -5
- package/dist/react/useStreamInfo.js.map +1 -1
- package/dist/replayPages.d.ts +31 -0
- package/dist/replayPages.d.ts.map +1 -0
- package/dist/replayPages.js +34 -0
- package/dist/replayPages.js.map +1 -0
- package/dist/replays.d.ts +7 -0
- package/dist/replays.d.ts.map +1 -1
- package/dist/replays.js +52 -22
- package/dist/replays.js.map +1 -1
- package/dist/session.d.ts +39 -6
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +209 -22
- package/dist/session.js.map +1 -1
- package/dist/sessionTypes.d.ts +190 -14
- package/dist/sessionTypes.d.ts.map +1 -1
- package/dist/sessionTypes.js +2 -1
- package/dist/sessionTypes.js.map +1 -1
- package/dist/shopifyCommerce.d.ts +149 -0
- package/dist/shopifyCommerce.d.ts.map +1 -0
- package/dist/shopifyCommerce.js +123 -0
- package/dist/shopifyCommerce.js.map +1 -0
- package/dist/shopifyIdentity.d.ts +51 -0
- package/dist/shopifyIdentity.d.ts.map +1 -0
- package/dist/shopifyIdentity.js +52 -0
- package/dist/shopifyIdentity.js.map +1 -0
- package/dist/shopifyIds.d.ts +9 -0
- package/dist/shopifyIds.d.ts.map +1 -0
- package/dist/shopifyIds.js +18 -0
- package/dist/shopifyIds.js.map +1 -0
- package/dist/showLinks.d.ts +24 -0
- package/dist/showLinks.d.ts.map +1 -0
- package/dist/showLinks.js +23 -0
- package/dist/showLinks.js.map +1 -0
- package/dist/showLots.d.ts +28 -0
- package/dist/showLots.d.ts.map +1 -0
- package/dist/showLots.js +51 -0
- package/dist/showLots.js.map +1 -0
- package/dist/showNames.d.ts +45 -0
- package/dist/showNames.d.ts.map +1 -0
- package/dist/showNames.js +74 -0
- package/dist/showNames.js.map +1 -0
- package/dist/streams.d.ts +27 -1
- package/dist/streams.d.ts.map +1 -1
- package/dist/streams.js +84 -21
- package/dist/streams.js.map +1 -1
- package/dist/types.d.ts +214 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -1
- package/dist/types.js.map +1 -1
- package/dist/wire.d.ts +31 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +25 -0
- package/dist/wire.js.map +1 -1
- package/dist/zego.d.ts +3 -1
- package/dist/zego.d.ts.map +1 -1
- package/dist/zego.js +1 -1
- package/dist/zegoEngine.d.ts +168 -0
- package/dist/zegoEngine.d.ts.map +1 -0
- package/dist/zegoEngine.js +1052 -0
- package/dist/zegoEngine.js.map +1 -0
- package/package.json +3 -2
package/dist/streams.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,iBAAiB,EAGjB,cAAc,EAGf,MAAM,SAAS,CAAC;AAIjB,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0FAA0F;IAC1F,iBAAiB,CAAC,EAAE,MAAM,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACrF,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,G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AAmF;IACnF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,6FAA6F;AAC7F,KAAK,YAAY,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAErE,KAAK,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAiBxD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAMzD;AAiBD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,IAAI,CA4BnF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EAChD,cAAc,EAAE,MAAM,GACrB,aAAa,EAAE,CAYjB;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAC/C,YAAY,GAAG,IAAI,CAwBrB;AAmBD,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,UAAU,CAqC3D;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,UAAU,EAAE,CAKpE;AAYD,eAAO,MAAM,OAAO,EAAE,cAmDrB,CAAC"}
|
package/dist/streams.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.streams = void 0;
|
|
4
|
+
exports.winnerIdOf = winnerIdOf;
|
|
4
5
|
exports.toLiveStreamProduct = toLiveStreamProduct;
|
|
5
6
|
exports.toGiveawayEntries = toGiveawayEntries;
|
|
6
7
|
exports.toLiveGiveaway = toLiveGiveaway;
|
|
@@ -14,7 +15,12 @@ exports.toLiveStreams = toLiveStreams;
|
|
|
14
15
|
* "misconfigured".
|
|
15
16
|
*/
|
|
16
17
|
const client_1 = require("./client");
|
|
18
|
+
const commentHistory_1 = require("./commentHistory");
|
|
17
19
|
const polls_1 = require("./polls");
|
|
20
|
+
const wire_1 = require("./wire");
|
|
21
|
+
const hiddenShows_1 = require("./hiddenShows");
|
|
22
|
+
const showNames_1 = require("./showNames");
|
|
23
|
+
const showLinks_1 = require("./showLinks");
|
|
18
24
|
// ─── Mappers ─────────────────────────────────────────────────────────────────
|
|
19
25
|
function toStatus(status) {
|
|
20
26
|
if (status === 2)
|
|
@@ -26,6 +32,29 @@ function toStatus(status) {
|
|
|
26
32
|
function toMillis(unix) {
|
|
27
33
|
return unix ? unix * 1000 : null;
|
|
28
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The winner's bare customer id from the record's `winner`: the number at the end of a GID, or a bare
|
|
37
|
+
* number. Anything else (`"No One Joined"`, absent) is no winner.
|
|
38
|
+
*/
|
|
39
|
+
function winnerIdOf(winner) {
|
|
40
|
+
var _a;
|
|
41
|
+
if (typeof winner !== 'string')
|
|
42
|
+
return null;
|
|
43
|
+
const trimmed = winner.trim();
|
|
44
|
+
const fromGid = /^gid:\/\/[^/]+\/[^/]+\/([^/\s]+)$/.exec(trimmed);
|
|
45
|
+
if (fromGid)
|
|
46
|
+
return (_a = fromGid[1]) !== null && _a !== void 0 ? _a : null;
|
|
47
|
+
return /^\d+$/.test(trimmed) ? trimmed : null;
|
|
48
|
+
}
|
|
49
|
+
/** An ISO time (or epoch ms) as epoch ms; null when missing or unreadable. */
|
|
50
|
+
function toEpochMs(value) {
|
|
51
|
+
if (typeof value === 'number')
|
|
52
|
+
return Number.isFinite(value) && value > 0 ? value : null;
|
|
53
|
+
if (typeof value !== 'string' || !value.trim())
|
|
54
|
+
return null;
|
|
55
|
+
const ms = Date.parse(value);
|
|
56
|
+
return Number.isFinite(ms) ? ms : null;
|
|
57
|
+
}
|
|
29
58
|
/** Numbers arrive as strings on some dashboard fields; anything unparseable is "not set". */
|
|
30
59
|
function toAmount(value) {
|
|
31
60
|
if (value === null || value === undefined || value === '')
|
|
@@ -33,19 +62,6 @@ function toAmount(value) {
|
|
|
33
62
|
const parsed = Number(value);
|
|
34
63
|
return Number.isFinite(parsed) ? parsed : null;
|
|
35
64
|
}
|
|
36
|
-
/**
|
|
37
|
-
* The lot's thumbnail, whichever way the gateway spelled it.
|
|
38
|
-
*
|
|
39
|
-
* A catalogue lot carries `{ url }`; a link lot carries the URL as a plain string — the same
|
|
40
|
-
* inconsistency the giveaway mapper below already had to absorb. Reading only `.url` left every
|
|
41
|
-
* link lot with a blank square where its picture should be.
|
|
42
|
-
*/
|
|
43
|
-
function toThumbnailUrl(value) {
|
|
44
|
-
var _a;
|
|
45
|
-
if (!value)
|
|
46
|
-
return null;
|
|
47
|
-
return typeof value === 'string' ? value : ((_a = value.url) !== null && _a !== void 0 ? _a : null);
|
|
48
|
-
}
|
|
49
65
|
function toLiveStreamProduct(raw) {
|
|
50
66
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
51
67
|
/*
|
|
@@ -62,7 +78,9 @@ function toLiveStreamProduct(raw) {
|
|
|
62
78
|
productGid: `gid://shopify/Product/${storeProductId}`,
|
|
63
79
|
name: (_d = raw.product_name) !== null && _d !== void 0 ? _d : '',
|
|
64
80
|
price: (_e = raw.product_price) !== null && _e !== void 0 ? _e : null,
|
|
65
|
-
|
|
81
|
+
/* A catalogue lot carries `{ url }`, a link lot a plain string. Reading only `.url` left every
|
|
82
|
+
link lot with a blank square where its picture should be. */
|
|
83
|
+
thumbnailUrl: (0, wire_1.imageUrl)(raw.product_thumbnail),
|
|
66
84
|
isCurrent: !!raw.is_current,
|
|
67
85
|
/* `sell_id` on the wire. A string on the gateway even though it reads as a number, so it is
|
|
68
86
|
carried through as one rather than coerced — a leading zero is meaningful to a host reading
|
|
@@ -70,6 +88,7 @@ function toLiveStreamProduct(raw) {
|
|
|
70
88
|
sellId: raw.sell_id != null ? String(raw.sell_id) : null,
|
|
71
89
|
startedAtMs: (_f = raw.start_time) !== null && _f !== void 0 ? _f : null,
|
|
72
90
|
baseBidPrice: toAmount(raw.base_bid_price),
|
|
91
|
+
bidIncrement: toAmount(raw.bid_incrementer),
|
|
73
92
|
winnerCount: (_h = (_g = raw.auction_winner) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0,
|
|
74
93
|
externalUrl,
|
|
75
94
|
};
|
|
@@ -101,17 +120,24 @@ function toLiveGiveaway(raw, meta) {
|
|
|
101
120
|
const storeProductId = raw.store_product_id;
|
|
102
121
|
if (!storeProductId)
|
|
103
122
|
return null;
|
|
104
|
-
|
|
123
|
+
/* `variant_price` is what the gateway writes; 0.9.0 read only `product_variant_price`, which no
|
|
124
|
+
record has, so the price was always null. */
|
|
125
|
+
const price = (_a = toAmount(raw.variant_price)) !== null && _a !== void 0 ? _a : toAmount(raw.product_variant_price);
|
|
105
126
|
return {
|
|
106
127
|
storeProductId,
|
|
107
|
-
variantId: (
|
|
128
|
+
variantId: (_b = raw.variant_id) !== null && _b !== void 0 ? _b : null,
|
|
108
129
|
status: raw.giveawayStatus === 'active' ? 'active' : 'ended',
|
|
109
|
-
productName: (
|
|
110
|
-
|
|
130
|
+
productName: (_c = raw.product_name) !== null && _c !== void 0 ? _c : '',
|
|
131
|
+
/* Passed through raw before 0.9.0, so an object arrived typed as a string. */
|
|
132
|
+
thumbnailUrl: (0, wire_1.imageUrl)(raw.product_thumbnail),
|
|
111
133
|
variantTitle: (_d = raw.product_variant_title) !== null && _d !== void 0 ? _d : null,
|
|
112
134
|
variantPrice: price === null ? null : String(price),
|
|
135
|
+
variantImageUrl: (0, wire_1.imageUrl)(raw.variant_image),
|
|
136
|
+
startedAtMs: toEpochMs(raw.giveawayStartTime),
|
|
137
|
+
winnerId: winnerIdOf(raw.winner),
|
|
138
|
+
// Names the room will show: never an email (`publicName`).
|
|
113
139
|
entrantNames: ((_e = raw.users) !== null && _e !== void 0 ? _e : [])
|
|
114
|
-
.map((user) => { var _a; return (_a = user === null || user === void 0 ? void 0 : user.displayName) !== null && _a !== void 0 ? _a : ''; })
|
|
140
|
+
.map((user) => { var _a; return (_a = (0, showNames_1.publicName)(user === null || user === void 0 ? void 0 : user.displayName)) !== null && _a !== void 0 ? _a : ''; })
|
|
115
141
|
.filter((name) => !!name),
|
|
116
142
|
entries: toGiveawayEntries(meta, storeProductId),
|
|
117
143
|
};
|
|
@@ -135,7 +161,7 @@ function toReturnable(raw) {
|
|
|
135
161
|
return value === 'returnable' || value === 'non_returnable' ? value : null;
|
|
136
162
|
}
|
|
137
163
|
function toLiveStream(raw) {
|
|
138
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
164
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
139
165
|
const multiplier = Number((_b = (_a = raw.meta) === null || _a === void 0 ? void 0 : _a.viewMultiplier) !== null && _b !== void 0 ? _b : 1);
|
|
140
166
|
const extendedBidding = Number((_c = raw.ext_bidding_duration) !== null && _c !== void 0 ? _c : 0);
|
|
141
167
|
return {
|
|
@@ -160,15 +186,17 @@ function toLiveStream(raw) {
|
|
|
160
186
|
.filter((p) => !!p),
|
|
161
187
|
productSegments: (_m = raw.product_segments) !== null && _m !== void 0 ? _m : [],
|
|
162
188
|
bidCap: toAmount((_o = raw.meta) === null || _o === void 0 ? void 0 : _o.biddingCap),
|
|
189
|
+
minimumBidIncrement: toAmount((_p = raw.meta) === null || _p === void 0 ? void 0 : _p.minimumBidIncrement),
|
|
163
190
|
extendedBiddingMs: Number.isFinite(extendedBidding) && extendedBidding > 0 ? extendedBidding : 0,
|
|
164
191
|
/* Both off the same document: the gateway attaches the Poll row as it stands, and its field names
|
|
165
192
|
are the ones these two already read, so the question and the tally arrive together. */
|
|
166
193
|
poll: (0, polls_1.toLivePoll)(raw.poll),
|
|
167
194
|
pollResults: (0, polls_1.toEmbeddedResults)(raw.poll),
|
|
168
|
-
giveaways: ((
|
|
195
|
+
giveaways: ((_r = (_q = raw.meta) === null || _q === void 0 ? void 0 : _q.giveawayProducts) !== null && _r !== void 0 ? _r : [])
|
|
169
196
|
.map((giveaway) => toLiveGiveaway(giveaway, raw.meta))
|
|
170
197
|
.filter((giveaway) => !!giveaway),
|
|
171
198
|
returnable: toReturnable(raw),
|
|
199
|
+
pinnedComment: (0, wire_1.toPinnedComment)(raw.pinned_comment),
|
|
172
200
|
};
|
|
173
201
|
}
|
|
174
202
|
function toLiveStreams(response) {
|
|
@@ -179,6 +207,13 @@ function toLiveStreams(response) {
|
|
|
179
207
|
.sort((a, b) => { var _a, _b; return ((_a = a.scheduledAtMs) !== null && _a !== void 0 ? _a : 0) - ((_b = b.scheduledAtMs) !== null && _b !== void 0 ? _b : 0); });
|
|
180
208
|
}
|
|
181
209
|
// ─── Namespace ─────────────────────────────────────────────────────────────
|
|
210
|
+
/**
|
|
211
|
+
* Shows that ended with a recording, by streaming id, as `destinationFor` read them: a recording,
|
|
212
|
+
* once it exists, doesn't change, so a second tap on the same link needs no read. Only the record is
|
|
213
|
+
* kept, never the answer: whether the viewer may see the show is asked again each time, as it turns on
|
|
214
|
+
* who is signed in (a team member's answer must not reach the next shopper on the same phone).
|
|
215
|
+
*/
|
|
216
|
+
const endedWithRecording = new Map();
|
|
182
217
|
exports.streams = {
|
|
183
218
|
async list() {
|
|
184
219
|
var _a;
|
|
@@ -203,5 +238,33 @@ exports.streams = {
|
|
|
203
238
|
});
|
|
204
239
|
return (_a = body === null || body === void 0 ? void 0 : body.data) !== null && _a !== void 0 ? _a : null;
|
|
205
240
|
},
|
|
241
|
+
async commentHistory(streamingId) {
|
|
242
|
+
if (!streamingId)
|
|
243
|
+
return [];
|
|
244
|
+
const body = await (0, client_1.liveSellingRequest)('/live-streaming/comments', {
|
|
245
|
+
params: { streaming_id: streamingId, limit: commentHistory_1.COMMENT_HISTORY_FETCH_LIMIT },
|
|
246
|
+
});
|
|
247
|
+
return (0, commentHistory_1.toCommentHistory)(body === null || body === void 0 ? void 0 : body.data);
|
|
248
|
+
},
|
|
249
|
+
async destinationFor(streamingId, options) {
|
|
250
|
+
var _a;
|
|
251
|
+
if (!streamingId)
|
|
252
|
+
return { destination: { to: 'showList' }, show: null, readError: null };
|
|
253
|
+
let record = (_a = endedWithRecording.get(streamingId)) !== null && _a !== void 0 ? _a : null;
|
|
254
|
+
let readError = null;
|
|
255
|
+
if (!record) {
|
|
256
|
+
try {
|
|
257
|
+
record = await exports.streams.byId(streamingId);
|
|
258
|
+
}
|
|
259
|
+
catch (caught) {
|
|
260
|
+
readError = caught;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (record && record.status === 'ended' && record.replayFeedId)
|
|
264
|
+
endedWithRecording.set(streamingId, record);
|
|
265
|
+
// A show hidden from this viewer is handed out nowhere, its record included: as if there were none.
|
|
266
|
+
const visible = record && !(0, hiddenShows_1.isHiddenFrom)(record, options === null || options === void 0 ? void 0 : options.viewerEmail, (0, client_1.hiddenShowsRule)()) ? record : null;
|
|
267
|
+
return { destination: (0, showLinks_1.showLinkDestination)(visible), show: visible, readError };
|
|
268
|
+
},
|
|
206
269
|
};
|
|
207
270
|
//# sourceMappingURL=streams.js.map
|
package/dist/streams.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streams.js","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"streams.js","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":";;;AAqIA,gCAMC;AAiBD,kDA4BC;AAOD,8CAeC;AAED,wCA2BC;AAmBD,oCAqCC;AAED,sCAKC;AA1SD;;;;;;GAMG;AACH,qCAAwF;AACxF,qDAAiF;AACjF,mCAAwD;AACxD,iCAAmD;AACnD,+CAA6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|
|
7
7
|
*
|
|
8
8
|
* Nothing here imports React, React Native or Zego, so the pure data layer typechecks and runs in any
|
|
9
9
|
* JavaScript runtime. Product ids are Shopify GIDs (`gid://shopify/Product/…`), ready to hand to a
|
|
10
|
-
* Storefront client such as `@tiledev/sdk-shopify
|
|
10
|
+
* Storefront client such as `@tiledev/sdk-shopify`. This package resolves a product only through the
|
|
11
|
+
* commerce adapter the app gives it (`createShopifyLiveCommerce` builds one on the app's own client).
|
|
11
12
|
*/
|
|
12
13
|
/**
|
|
13
14
|
* Minimal async key/value store. Satisfied by React Native's AsyncStorage as-is, and by a thin
|
|
@@ -50,6 +51,21 @@ export type CustomerAccountRequest = <T>(query: string, variables?: Record<strin
|
|
|
50
51
|
* is anonymous and the company header scopes the response; there is no token. Deliberately NOT the
|
|
51
52
|
* Shopify store id and not this app's Tile id.
|
|
52
53
|
*/
|
|
54
|
+
/**
|
|
55
|
+
* The parts of `expo-haptics` that `liveHaptics` uses: a module with this shape works (the app passes
|
|
56
|
+
* `import * as Haptics from 'expo-haptics'`).
|
|
57
|
+
*/
|
|
58
|
+
export interface LiveHapticsModule {
|
|
59
|
+
selectionAsync(): Promise<void>;
|
|
60
|
+
impactAsync(style?: string): Promise<void>;
|
|
61
|
+
notificationAsync(type?: string): Promise<void>;
|
|
62
|
+
ImpactFeedbackStyle: {
|
|
63
|
+
Heavy: string;
|
|
64
|
+
};
|
|
65
|
+
NotificationFeedbackType: {
|
|
66
|
+
Success: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
53
69
|
export interface LiveSellingConfig {
|
|
54
70
|
/** Gateway base URL, e.g. `https://live-selling.apptile.io`. No trailing slash. */
|
|
55
71
|
apiUrl: string;
|
|
@@ -85,8 +101,28 @@ export interface LiveSellingConfig {
|
|
|
85
101
|
* product is reasonable; a room showing the wrong one is not.
|
|
86
102
|
*/
|
|
87
103
|
strictActiveProduct?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Milliseconds before any request to the gateway (or the replay-comment CDN) is given up on, with a
|
|
106
|
+
* `LiveSellingTimeoutError`. Defaults to 10 000. Zero, negative or non-numbers mean the default.
|
|
107
|
+
*/
|
|
108
|
+
requestTimeoutMs?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Milliseconds the session waits, with no live record and not connecting, before its status
|
|
111
|
+
* becomes `ended`. Defaults to 4 000. Without it a session whose record never arrives — nothing on
|
|
112
|
+
* air, or a deep link to a show that has gone — spins on `loading` for ever. A forced record read
|
|
113
|
+
* (`refreshStreamRecords()`) starts the wait again, so a stale record cannot end a show that has
|
|
114
|
+
* only just started.
|
|
115
|
+
*/
|
|
116
|
+
offAirGraceMs?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Backs the durable ids, the remembered poll votes, the signed-out shopper's name and the accepted
|
|
119
|
+
* auction terms: `AsyncStorage` on a phone, `window.localStorage` on the web.
|
|
120
|
+
*
|
|
121
|
+
* **Required since 0.9.0**, and `configure` throws without it. It was optional, with an in-memory
|
|
122
|
+
* store on a phone, and two of the three apps on this package shipped without it: every relaunch
|
|
123
|
+
* forgot the votes, and the gateway doesn't dedupe votes, so a forgotten vote is counted twice.
|
|
124
|
+
*/
|
|
125
|
+
storage: StorageAdapter;
|
|
90
126
|
/** Defaults to a silent no-op. */
|
|
91
127
|
logger?: Logger;
|
|
92
128
|
/** See {@link CustomerAccountRequest}. Only the unpaid-wins helpers use it. */
|
|
@@ -101,6 +137,13 @@ export interface LiveSellingConfig {
|
|
|
101
137
|
* without this the session offers neither. See {@link IdentityAdapter}.
|
|
102
138
|
*/
|
|
103
139
|
identity?: import('./sessionTypes').IdentityAdapter;
|
|
140
|
+
/**
|
|
141
|
+
* The phone's haptics, for `liveHaptics` (since 0.9.1): pass `expo-haptics` (`import * as Haptics
|
|
142
|
+
* from 'expo-haptics'`, a native module, so a new native build). Without it, or on the web,
|
|
143
|
+
* `liveHaptics` does nothing. Passed in rather than imported, so an app that doesn't want taps needs
|
|
144
|
+
* no native module (Metro won't bundle an optional `require` it can't resolve).
|
|
145
|
+
*/
|
|
146
|
+
haptics?: LiveHapticsModule;
|
|
104
147
|
/**
|
|
105
148
|
* The one app-wide poll behind `useOngoingLive`, to catch a show starting while the app is open:
|
|
106
149
|
* every 2 minutes while nothing is live, every 30 while a show is (defaults), foreground only, and
|
|
@@ -108,6 +151,32 @@ export interface LiveSellingConfig {
|
|
|
108
151
|
* (foreground, `refresh()`, `refreshOngoingLive()`). See `ongoingLive.ts`.
|
|
109
152
|
*/
|
|
110
153
|
ongoingLivePolling?: import('./ongoingLive').OngoingLivePolling;
|
|
154
|
+
/**
|
|
155
|
+
* Shows to keep from shoppers: a team's practice runs on the store's real gateway, which has no
|
|
156
|
+
* "draft" or "hidden" setting of its own. Unset: nothing is hidden. See {@link HiddenShows}.
|
|
157
|
+
*/
|
|
158
|
+
hiddenShows?: HiddenShows;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Which shows a viewer never sees (0.9.0). A show is hidden when its title contains any of
|
|
162
|
+
* `titleIncludes` (in any case), unless the viewer is signed in with an email at one of
|
|
163
|
+
* `visibleToEmailDomains`.
|
|
164
|
+
*
|
|
165
|
+
* What it reaches: every hook that hands out shows (`useReplays`, `useOngoingLive`, `useLiveStreams`,
|
|
166
|
+
* `useStreamInfo` and so the session, which then never joins a hidden show's room) and
|
|
167
|
+
* `streams.destinationFor`. The imperative reads (`streams.list`, `ongoing`, `byId`, `replays.list`)
|
|
168
|
+
* stay the gateway's, unfiltered. The viewer is `LiveSellingProvider`'s `viewerEmail`.
|
|
169
|
+
*
|
|
170
|
+
* It hides shows in the app only: anyone with the company id can still ask the gateway for them.
|
|
171
|
+
*/
|
|
172
|
+
export interface HiddenShows {
|
|
173
|
+
/** A show whose title contains any of these, in any case, is hidden. Amore: `['apptiletest']`. */
|
|
174
|
+
titleIncludes: string[];
|
|
175
|
+
/**
|
|
176
|
+
* Email domains that still see hidden shows, without the @: `['apptile.io']` lets
|
|
177
|
+
* `host@apptile.io` see them, and not `host@apptile.io.example.com`. A signed-out viewer never does.
|
|
178
|
+
*/
|
|
179
|
+
visibleToEmailDomains: string[];
|
|
111
180
|
}
|
|
112
181
|
export type LiveStreamStatus = 'live' | 'scheduled' | 'ended';
|
|
113
182
|
/** How one reaction tap animates: `single` is one emoji, `multiple` a burst. Per stream. */
|
|
@@ -132,6 +201,12 @@ export interface LiveStreamProduct {
|
|
|
132
201
|
startedAtMs: number | null;
|
|
133
202
|
/** Auction only: opening bid, or null on a lot the host has not priced. */
|
|
134
203
|
baseBidPrice: number | null;
|
|
204
|
+
/**
|
|
205
|
+
* Auction only: the lot's bid step (`bid_incrementer`), or null when the host set none. On a lot with
|
|
206
|
+
* no opening bid, the first bid is this step (`openingBidFor`). Optional, so a record built by hand
|
|
207
|
+
* still type-checks.
|
|
208
|
+
*/
|
|
209
|
+
bidIncrement?: number | null;
|
|
135
210
|
/** Auction only: rounds already won on this lot. Non-zero means bidding closed. */
|
|
136
211
|
winnerCount: number;
|
|
137
212
|
/**
|
|
@@ -172,8 +247,30 @@ export interface LiveGiveaway {
|
|
|
172
247
|
productName: string;
|
|
173
248
|
thumbnailUrl: string | null;
|
|
174
249
|
variantTitle: string | null;
|
|
175
|
-
/**
|
|
250
|
+
/**
|
|
251
|
+
* Retail price, struck through beside FREE: the record's `variant_price` (`"22.0"`). Read since
|
|
252
|
+
* 0.9.0; before, the SDK looked only for `product_variant_price`, which no record carries (none of
|
|
253
|
+
* the 24 giveaways on Amore's 20 latest recorded shows, read 2026-10-06), so this was always null.
|
|
254
|
+
*/
|
|
176
255
|
variantPrice: string | null;
|
|
256
|
+
/**
|
|
257
|
+
* The given-away variant's own photo (`variant_image`), where `thumbnailUrl` is the product's. Null
|
|
258
|
+
* when the record has none. Since 0.9.0; optional so a giveaway built by hand (a test's) still fits.
|
|
259
|
+
*/
|
|
260
|
+
variantImageUrl?: string | null;
|
|
261
|
+
/**
|
|
262
|
+
* When the host started this giveaway (`giveawayStartTime`), epoch ms; null when the record has no
|
|
263
|
+
* readable time. Two giveaways of the same product in one show differ by it, so it is what tells
|
|
264
|
+
* them apart. Since 0.9.0; optional so a giveaway built by hand (a test's) still fits.
|
|
265
|
+
*/
|
|
266
|
+
startedAtMs?: number | null;
|
|
267
|
+
/**
|
|
268
|
+
* Who won, once drawn: the bare customer id of the record's `winner` (`"gid://shopify/Customer/42"`
|
|
269
|
+
* → `"42"`, the id `identity.bidderId` gives). Null while open, and for a draw nobody entered (the
|
|
270
|
+
* record says `"No One Joined"`). Every drawn giveaway on shows `h2rorgm7po` and `dq9r6hd8ml` has it
|
|
271
|
+
* (read 2026-10-06). Since 0.9.0; optional so a giveaway built by hand (a test's) still fits.
|
|
272
|
+
*/
|
|
273
|
+
winnerId?: string | null;
|
|
177
274
|
/** The roster the host keeps on the lot, for the winner-roll animation. */
|
|
178
275
|
entrantNames: string[];
|
|
179
276
|
entries: GiveawayEntry[];
|
|
@@ -207,7 +304,10 @@ export interface LiveStream {
|
|
|
207
304
|
*/
|
|
208
305
|
replayFeedId: string | null;
|
|
209
306
|
isAuction: boolean;
|
|
210
|
-
/**
|
|
307
|
+
/**
|
|
308
|
+
* Epoch ms the stream went live, or null when it has not started. The show's clock counts up from it
|
|
309
|
+
* (`useShowClock(stream.startedAtMs)`), read against the phone's clock as `elapsedMs` always was.
|
|
310
|
+
*/
|
|
211
311
|
startedAtMs: number | null;
|
|
212
312
|
scheduledAtMs: number | null;
|
|
213
313
|
hostName: string | null;
|
|
@@ -231,6 +331,11 @@ export interface LiveStream {
|
|
|
231
331
|
productSegments: ProductSegment[];
|
|
232
332
|
/** Auction only: highest bid the host will accept, or null for no ceiling. */
|
|
233
333
|
bidCap: number | null;
|
|
334
|
+
/**
|
|
335
|
+
* Auction only: the show's smallest bid step (`meta.minimumBidIncrement`), or null. The first bid on a
|
|
336
|
+
* lot with neither an opening bid nor a step of its own. Optional, so a record built by hand still type-checks.
|
|
337
|
+
*/
|
|
338
|
+
minimumBidIncrement?: number | null;
|
|
234
339
|
/** Auction only: ms a late bid adds to the clock. 0 when the host disabled extended bidding. */
|
|
235
340
|
extendedBiddingMs: number;
|
|
236
341
|
/** Every giveaway the host has run on this stream, active and finished. */
|
|
@@ -247,6 +352,21 @@ export interface LiveStream {
|
|
|
247
352
|
pollResults: LivePollResults | null;
|
|
248
353
|
/** The show's returns setting, from `meta.returnable`. Null means each product decides. */
|
|
249
354
|
returnable: LiveStreamReturnable | null;
|
|
355
|
+
/**
|
|
356
|
+
* The comment the host or a moderator pinned, from the record's `pinned_comment`. Null when nothing
|
|
357
|
+
* is pinned, or the saved pin has no id or no text. The room announces changes with a
|
|
358
|
+
* `pinnedCommentChanged` event; read `session.pinnedComment`, which joins the two.
|
|
359
|
+
*/
|
|
360
|
+
pinnedComment: LivePinnedComment | null;
|
|
361
|
+
}
|
|
362
|
+
/** One pinned comment. Text only: the gateway also sends the author's name, which nothing shows. */
|
|
363
|
+
export interface LivePinnedComment {
|
|
364
|
+
id: string;
|
|
365
|
+
/**
|
|
366
|
+
* The words. A broadcast longer than Zego's 1024 bytes arrives cut, ending in "…"; the record keeps
|
|
367
|
+
* the whole text, and the next record read replaces the cut one.
|
|
368
|
+
*/
|
|
369
|
+
text: string;
|
|
250
370
|
}
|
|
251
371
|
export declare const COMMENT_SOURCES: readonly ["USER", "MODERATOR", "HOST", "TIP"];
|
|
252
372
|
export type CommentSource = (typeof COMMENT_SOURCES)[number];
|
|
@@ -290,6 +410,12 @@ export interface LivePoll {
|
|
|
290
410
|
options: LivePollOption[];
|
|
291
411
|
/** The option ids exactly as they arrived, by normalised id — a vote must echo the original type. */
|
|
292
412
|
wireOptionIds: Record<string, string | number>;
|
|
413
|
+
/**
|
|
414
|
+
* The poll's `status` as the gateway wrote it (`"active"` while it runs), or null when it sent none.
|
|
415
|
+
* The session raises a poll off the RECORD only while this is `"active"` or absent. Since 0.9.0;
|
|
416
|
+
* optional so a poll built by hand (a test's) still fits.
|
|
417
|
+
*/
|
|
418
|
+
status?: string | null;
|
|
293
419
|
}
|
|
294
420
|
export interface LivePollResults {
|
|
295
421
|
pollUuid: string | null;
|
|
@@ -315,10 +441,19 @@ export interface AuctionWinItem {
|
|
|
315
441
|
winningBid: number;
|
|
316
442
|
isGiveaway: boolean;
|
|
317
443
|
discountCode: string | null;
|
|
444
|
+
/**
|
|
445
|
+
* The show this lot was won on. A customer can owe on more than one show at once (a giveaway has no
|
|
446
|
+
* unpaid-wins gate), so the items of one {@link AuctionWins} do not all share its `streamingId`.
|
|
447
|
+
*/
|
|
448
|
+
streamingId: string;
|
|
318
449
|
}
|
|
319
450
|
export interface AuctionWins {
|
|
320
|
-
/**
|
|
451
|
+
/**
|
|
452
|
+
* The stream the tab is settled against — `auction_id` on the checkout cart. The first stream with
|
|
453
|
+
* something payable; `items` can come from more streams than this one, and each names its own.
|
|
454
|
+
*/
|
|
321
455
|
streamingId: string;
|
|
456
|
+
/** Every unpaid lot from every stream: stream by stream in the metafield's key order, then entry order. */
|
|
322
457
|
items: AuctionWinItem[];
|
|
323
458
|
}
|
|
324
459
|
export interface Replay {
|
|
@@ -334,8 +469,17 @@ export interface Replay {
|
|
|
334
469
|
publishedAt: string | null;
|
|
335
470
|
}
|
|
336
471
|
export interface ReplayFeed {
|
|
472
|
+
/** The page's finished recordings that have a playlist, in the gateway's order. */
|
|
337
473
|
replays: Replay[];
|
|
474
|
+
/** The gateway has more after this page. Always false after an empty page. */
|
|
338
475
|
hasMore: boolean;
|
|
476
|
+
/**
|
|
477
|
+
* How many entries the gateway sent for this page, before anything was dropped (no playlist, not a
|
|
478
|
+
* finished livestream). The next page's offset moves by this, never by `replays.length`: moving by
|
|
479
|
+
* what was kept asks for entries already read, and a page where nothing is kept would be asked for
|
|
480
|
+
* again forever.
|
|
481
|
+
*/
|
|
482
|
+
receivedCount: number;
|
|
339
483
|
}
|
|
340
484
|
export interface ReplaySegment {
|
|
341
485
|
productGid: string;
|
|
@@ -459,6 +603,11 @@ export type LiveEvent = {
|
|
|
459
603
|
endsAtMs: number | null;
|
|
460
604
|
serverNowMs: number;
|
|
461
605
|
leader: BidLeader | null;
|
|
606
|
+
/**
|
|
607
|
+
* Who to send bids to, when the host's bid info names one (`data.moderatorInCharge`). The
|
|
608
|
+
* gateway does not send it today — only `START_BIDDING` does — so this is null until it does.
|
|
609
|
+
*/
|
|
610
|
+
moderatorId: string | null;
|
|
462
611
|
} | {
|
|
463
612
|
type: 'biddingClosed';
|
|
464
613
|
} | {
|
|
@@ -506,6 +655,15 @@ export type LiveEvent = {
|
|
|
506
655
|
} | {
|
|
507
656
|
type: 'mixer';
|
|
508
657
|
active: boolean;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* The host pinned, replaced or unpinned a comment — `PINNED_COMMENT_CHANGED` on the broadcast
|
|
661
|
+
* channel. `comment` is null for an unpin, and for a pin with no id or no text (a blank banner is
|
|
662
|
+
* worse than none).
|
|
663
|
+
*/
|
|
664
|
+
| {
|
|
665
|
+
type: 'pinnedCommentChanged';
|
|
666
|
+
comment: LivePinnedComment | null;
|
|
509
667
|
} | {
|
|
510
668
|
type: 'unknown';
|
|
511
669
|
channel: string;
|
|
@@ -585,6 +743,47 @@ export interface LiveStreamsAPI {
|
|
|
585
743
|
byId(streamingId: string): Promise<LiveStream | null>;
|
|
586
744
|
/** The anonymous Zego room credential for this viewer. */
|
|
587
745
|
zegoToken(viewerId: string, streamingId: string): Promise<string | null>;
|
|
746
|
+
/**
|
|
747
|
+
* What the room said before this viewer arrived: the last 40 lines of a show that is on air, oldest
|
|
748
|
+
* first, with the gateway's duplicate rows collapsed and muted lines left out. `isOwn` is always
|
|
749
|
+
* false here — the stored rows cannot say which device wrote them. The session puts these in front
|
|
750
|
+
* of `session.comments` by itself; call this only to show history without a session.
|
|
751
|
+
*/
|
|
752
|
+
commentHistory(streamingId: string): Promise<LiveComment[]>;
|
|
753
|
+
/**
|
|
754
|
+
* Where a link about a show should take this viewer (0.9.0): one read of the show's record. On air:
|
|
755
|
+
* the live player. Ended with a recording: the replay. Anything else (scheduled, ended with no
|
|
756
|
+
* recording, unknown, unreadable, or hidden from this viewer by `hiddenShows`): the list of shows.
|
|
757
|
+
* Never throws. A show's recording, once it exists, is remembered for the rest of the app's run.
|
|
758
|
+
*/
|
|
759
|
+
destinationFor(streamingId: string, options?: {
|
|
760
|
+
viewerEmail?: string | null;
|
|
761
|
+
}): Promise<ShowLinkAnswer>;
|
|
762
|
+
}
|
|
763
|
+
/** Where a link about a show goes. The app maps each to a screen of its own. */
|
|
764
|
+
export type ShowLinkDestination =
|
|
765
|
+
/** The show is on air: the live player. */
|
|
766
|
+
{
|
|
767
|
+
to: 'livePlayer';
|
|
768
|
+
}
|
|
769
|
+
/** The show has ended and has a recording: its replay, by `Replay.id`. */
|
|
770
|
+
| {
|
|
771
|
+
to: 'replay';
|
|
772
|
+
feedId: string;
|
|
773
|
+
}
|
|
774
|
+
/** Nothing to play: the list of shows, which says what is on now and what has been. */
|
|
775
|
+
| {
|
|
776
|
+
to: 'showList';
|
|
777
|
+
};
|
|
778
|
+
export interface ShowLinkAnswer {
|
|
779
|
+
destination: ShowLinkDestination;
|
|
780
|
+
/**
|
|
781
|
+
* The record the answer was read from, so its poster and title can stand in while a session reads
|
|
782
|
+
* its own. Null when the show is unknown, the read failed, or it is hidden from this viewer.
|
|
783
|
+
*/
|
|
784
|
+
show: LiveStream | null;
|
|
785
|
+
/** Why the read failed, when it did (the answer is then the list of shows); null otherwise. Not logged. */
|
|
786
|
+
readError: unknown;
|
|
588
787
|
}
|
|
589
788
|
export interface AuctionsAPI {
|
|
590
789
|
/** Records a bid against the stream. Fire-and-forget; the round is decided by the host's broadcast. */
|
|
@@ -613,7 +812,10 @@ export interface AuctionsAPI {
|
|
|
613
812
|
acceptTerms(): Promise<void>;
|
|
614
813
|
/** Streams the customer owes on. Needs `customerAccountRequest`; `[]` without it. Never throws. */
|
|
615
814
|
unpaidStreamIds(): Promise<string[]>;
|
|
616
|
-
/**
|
|
815
|
+
/**
|
|
816
|
+
* Everything the customer has won and not checked out, across every stream with something payable.
|
|
817
|
+
* Needs `customerAccountRequest`; null without it, or when nothing is owed.
|
|
818
|
+
*/
|
|
617
819
|
wins(): Promise<AuctionWins | null>;
|
|
618
820
|
/** Whether bidding is blocked by an unsettled previous auction. Pure. */
|
|
619
821
|
isBiddingBlocked(unpaidStreamIds: string[], streamingId: string | null): boolean;
|
|
@@ -641,7 +843,11 @@ export interface ReplaysAPI {
|
|
|
641
843
|
list(limit?: number, offset?: number): Promise<ReplayFeed>;
|
|
642
844
|
/** Product windows for a recording, keyed by shoppable_feed_id. */
|
|
643
845
|
segments(feedId: string): Promise<ReplaySegment[]>;
|
|
644
|
-
/**
|
|
846
|
+
/**
|
|
847
|
+
* The chat a recording had while it was live, in the order said: the static file
|
|
848
|
+
* `https://cdn.apptile.io/assets/live-replay-comments/<streamingId>.json`. A show nobody talked
|
|
849
|
+
* during has no file (the CDN answers 403), which is an empty list, not an error.
|
|
850
|
+
*/
|
|
645
851
|
comments(streamingId: string): Promise<ReplayComment[]>;
|
|
646
852
|
/** Records a play. Fire-and-forget. */
|
|
647
853
|
incrementViews(feedId: string): Promise<void>;
|