@tiledev/sdk-apptile-live-selling 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ import type { LiveStreamStatus } from './types';
2
+ /** Same shape as sdk-shopify's `AttributionSource`; kept local so this package never depends on it. */
3
+ export type AttributionSource = {
4
+ type: 'live';
5
+ showId: string;
6
+ } | {
7
+ type: 'replay';
8
+ showId: string;
9
+ } | {
10
+ type: 'app';
11
+ };
12
+ export declare function liveAttributionSourceFor(stream: {
13
+ streamingId: string;
14
+ status: LiveStreamStatus;
15
+ } | null): AttributionSource | null;
16
+ /** Takes the streamingId of the show the replay is of, never the replay feed id. */
17
+ export declare function replayAttributionSourceFor(showStreamingId: string | null): AttributionSource | null;
18
+ //# sourceMappingURL=attribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../src/attribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,uGAAuG;AACvG,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpB,wBAAgB,wBAAwB,CACtC,MAAM,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,GAAG,IAAI,GAC/D,iBAAiB,GAAG,IAAI,CAE1B;AAED,oFAAoF;AACpF,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,iBAAiB,GAAG,IAAI,CAEnG"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.liveAttributionSourceFor = liveAttributionSourceFor;
4
+ exports.replayAttributionSourceFor = replayAttributionSourceFor;
5
+ function liveAttributionSourceFor(stream) {
6
+ return (stream === null || stream === void 0 ? void 0 : stream.status) === 'live' ? { type: 'live', showId: stream.streamingId } : null;
7
+ }
8
+ /** Takes the streamingId of the show the replay is of, never the replay feed id. */
9
+ function replayAttributionSourceFor(showStreamingId) {
10
+ return showStreamingId ? { type: 'replay', showId: showStreamingId } : null;
11
+ }
12
+ //# sourceMappingURL=attribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribution.js","sourceRoot":"","sources":["../src/attribution.ts"],"names":[],"mappings":";;AAQA,4DAIC;AAGD,gEAEC;AATD,SAAgB,wBAAwB,CACtC,MAAgE;IAEhE,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,MAAK,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACzF,CAAC;AAED,oFAAoF;AACpF,SAAgB,0BAA0B,CAAC,eAA8B;IACvE,OAAO,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9E,CAAC"}
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export { toMixerLayout } from './guest';
23
23
  export { resetCompanyFlagsCache } from './flags';
24
24
  export { MAX_VIEWER_NAME } from './viewer';
25
25
  export { LIVE_STREAM_ID_ATTRIBUTE, REPLAY_ID_ATTRIBUTE, liveCartAttributesFor, replayCartAttributesFor, addLiveLine, } from './cartAttributes';
26
+ export { liveAttributionSourceFor, replayAttributionSourceFor, type AttributionSource, } from './attribution';
26
27
  export { toCommentSegments, hasCommentLink, classifyCommentLink, toUrlPreview, displayHost, type CommentLink, type CommentSegment, } from './commentLinks';
27
28
  export { sessionReducer, initialSessionState, deriveStatus, remainingMs, timeLeftMs, SOLD_CARD_MS, REACTION_MS, } from './session';
28
29
  export { capabilitiesFor, LIVE_CAPABILITIES, AUCTION_CAPABILITIES, REPLAY_CAPABILITIES, IDLE_AUCTION, IDLE_GIVEAWAY, } from './sessionTypes';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,WAAW,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG1D,OAAO,EACL,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,iB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C1B,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAGvF,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,gBAAgB,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
30
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.ONGOING_LIVE_POLL_LIVE_MS = exports.ONGOING_LIVE_POLL_IDLE_MS = exports.createOngoingLiveStore = exports.COMMENT_SOURCES = exports.isLivePipSupported = exports.livePip = exports.IDLE_GIVEAWAY = exports.IDLE_AUCTION = exports.REPLAY_CAPABILITIES = exports.AUCTION_CAPABILITIES = exports.LIVE_CAPABILITIES = exports.capabilitiesFor = exports.REACTION_MS = exports.SOLD_CARD_MS = exports.timeLeftMs = exports.remainingMs = exports.deriveStatus = exports.initialSessionState = exports.sessionReducer = exports.displayHost = exports.toUrlPreview = exports.classifyCommentLink = exports.hasCommentLink = exports.toCommentSegments = exports.addLiveLine = exports.replayCartAttributesFor = exports.liveCartAttributesFor = exports.REPLAY_ID_ATTRIBUTE = exports.LIVE_STREAM_ID_ATTRIBUTE = exports.MAX_VIEWER_NAME = exports.resetCompanyFlagsCache = exports.toMixerLayout = exports.toEmbeddedResults = exports.toLivePollResults = exports.toLivePoll = exports.toGiveawayEntries = exports.toLiveGiveaway = exports.toLiveStreamProduct = exports.toLiveStreams = exports.toLiveStream = exports.toProductGid = exports.LiveSellingError = exports.liveEngine = exports.default = exports.liveSelling = void 0;
33
+ exports.ONGOING_LIVE_POLL_LIVE_MS = exports.ONGOING_LIVE_POLL_IDLE_MS = exports.createOngoingLiveStore = exports.COMMENT_SOURCES = exports.isLivePipSupported = exports.livePip = exports.IDLE_GIVEAWAY = exports.IDLE_AUCTION = exports.REPLAY_CAPABILITIES = exports.AUCTION_CAPABILITIES = exports.LIVE_CAPABILITIES = exports.capabilitiesFor = exports.REACTION_MS = exports.SOLD_CARD_MS = exports.timeLeftMs = exports.remainingMs = exports.deriveStatus = exports.initialSessionState = exports.sessionReducer = exports.displayHost = exports.toUrlPreview = exports.classifyCommentLink = exports.hasCommentLink = exports.toCommentSegments = exports.replayAttributionSourceFor = exports.liveAttributionSourceFor = exports.addLiveLine = exports.replayCartAttributesFor = exports.liveCartAttributesFor = exports.REPLAY_ID_ATTRIBUTE = exports.LIVE_STREAM_ID_ATTRIBUTE = exports.MAX_VIEWER_NAME = exports.resetCompanyFlagsCache = exports.toMixerLayout = exports.toEmbeddedResults = exports.toLivePollResults = exports.toLivePoll = exports.toGiveawayEntries = exports.toLiveGiveaway = exports.toLiveStreamProduct = exports.toLiveStreams = exports.toLiveStream = exports.toProductGid = exports.LiveSellingError = exports.liveEngine = exports.default = exports.liveSelling = void 0;
34
34
  // The imperative client (default + named).
35
35
  var liveSelling_1 = require("./liveSelling");
36
36
  Object.defineProperty(exports, "liveSelling", { enumerable: true, get: function () { return liveSelling_1.liveSelling; } });
@@ -65,6 +65,9 @@ Object.defineProperty(exports, "REPLAY_ID_ATTRIBUTE", { enumerable: true, get: f
65
65
  Object.defineProperty(exports, "liveCartAttributesFor", { enumerable: true, get: function () { return cartAttributes_1.liveCartAttributesFor; } });
66
66
  Object.defineProperty(exports, "replayCartAttributesFor", { enumerable: true, get: function () { return cartAttributes_1.replayCartAttributesFor; } });
67
67
  Object.defineProperty(exports, "addLiveLine", { enumerable: true, get: function () { return cartAttributes_1.addLiveLine; } });
68
+ var attribution_1 = require("./attribution");
69
+ Object.defineProperty(exports, "liveAttributionSourceFor", { enumerable: true, get: function () { return attribution_1.liveAttributionSourceFor; } });
70
+ Object.defineProperty(exports, "replayAttributionSourceFor", { enumerable: true, get: function () { return attribution_1.replayAttributionSourceFor; } });
68
71
  var commentLinks_1 = require("./commentLinks");
69
72
  Object.defineProperty(exports, "toCommentSegments", { enumerable: true, get: function () { return commentLinks_1.toCommentSegments; } });
70
73
  Object.defineProperty(exports, "hasCommentLink", { enumerable: true, get: function () { return commentLinks_1.hasCommentLink; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;AAEH,2CAA2C;AAC3C,6CAAoE;AAA3D,0GAAA,WAAW,OAAA;AAAE,sGAAA,WAAW,OAAW;AAE5C,0EAA0E;AAC1E,mCAAgD;AAAvC,oGAAA,MAAM,OAAc;AAE7B,uGAAuG;AACvG,mCAA0D;AAAjD,0GAAA,gBAAgB,OAAA;AAAE,sGAAA,YAAY,OAAA;AAEvC,yGAAyG;AACzG,qCAMmB;AALjB,uGAAA,YAAY,OAAA;AACZ,wGAAA,aAAa,OAAA;AACb,8GAAA,mBAAmB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OAAA;AACX,qGAAA,UAAU,OAAA;AACV,uGAAA,YAAY,OAAA;AACZ,sGAAA,WAAW,OAAA;AAEb,+CAOwB;AANtB,+GAAA,eAAe,OAAA;AACf,iHAAA,iBAAiB,OAAA;AACjB,oHAAA,oBAAoB,OAAA;AACpB,mHAAA,mBAAmB,OAAA;AACnB,4GAAA,YAAY,OAAA;AACZ,6GAAA,aAAa,OAAA;AAGf,kFAAkF;AAClF;;;;;;GAMG;AACH,4FAAuF;AAA9E,0HAAA,OAAO,OAAA;AAAE,qIAAA,kBAAkB,OAAA;AAEpC,iCAAiC;AACjC,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AAIxB;;;;;;;;;;;;GAYG;AACH,6CAOuB;AANrB,qHAAA,sBAAsB,OAAA;AACtB,wHAAA,yBAAyB,OAAA;AACzB,wHAAA,yBAAyB,OAAA;AAK3B,gDAA8B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledev/sdk-apptile-live-selling",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Live selling, auctions and giveaways for React Native — the Apptile live-selling gateway as a typed singleton, a Zego room engine behind a platform boundary, an assembled session state machine, and system picture-in-picture with its own config plugin. Commerce comes from an adapter.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,