@tivio/sdk-react 9.1.3-alpha3 → 9.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ComponentType } from 'react';
1
+ import type { ComponentType } from 'react';
2
2
  import type dayjs from 'dayjs';
3
3
  import { DocumentReference } from '@firebase/firestore-types';
4
4
  import type duration from 'dayjs/plugin/duration';
5
- import firebase from '@firebase/app-types';
5
+ import type firebase from '@firebase/app-types';
6
6
  import { FunctionComponentElement } from 'react';
7
7
  import type { GeoPoint } from '@firebase/firestore-types';
8
8
  import { OperatingSystem } from 'detect-browser';
@@ -21,6 +21,8 @@ export declare type ActivateVoucherResponse = string | {
21
21
  activatedPromotions: ActivatedPromotionResponse[];
22
22
  };
23
23
 
24
+ export declare type AdBannerScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.AD_BANNER>;
25
+
24
26
  export declare type AddEditCommentResponse = {
25
27
  id: string;
26
28
  error?: string;
@@ -515,7 +517,8 @@ export declare enum BannerItemComponent {
515
517
  BACKGROUND = "BACKGROUND",
516
518
  BACKGROUND_BLUR = "BACKGROUND_BLUR",
517
519
  ORGANIZATION_BANNER = "ORGANIZATION_BANNER",
518
- CAROUSEL = "CAROUSEL"
520
+ CAROUSEL = "CAROUSEL",
521
+ RATIO = "RATIO"
519
522
  }
520
523
 
521
524
  /**
@@ -940,6 +943,8 @@ export declare interface ConversionsTargetItem {
940
943
  totalCount: number;
941
944
  }
942
945
 
946
+ export declare type CountdownScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.COUNTDOWN>;
947
+
943
948
  /**
944
949
  * @public
945
950
  * @TODO move somewhere else
@@ -962,6 +967,10 @@ export declare const createPubSub: () => PubSub;
962
967
  */
963
968
  export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<TivioBundle>;
964
969
 
970
+ export declare const createTivio: () => (conf: SdkReactConfig) => Promise<RemoteBundleState>;
971
+
972
+ export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
973
+
965
974
  export declare interface CreateUserPayload {
966
975
  displayName?: string;
967
976
  email?: string;
@@ -1002,6 +1011,17 @@ export declare type Currency = 'CZK' | 'EUR' | 'USD';
1002
1011
  */
1003
1012
  export declare type CurrencyLowerCase = 'czk' | 'eur' | 'usd';
1004
1013
 
1014
+ export declare interface CurrentQuestion {
1015
+ id: string;
1016
+ question: Translation;
1017
+ answers?: QuestionAnswer[];
1018
+ index?: number;
1019
+ endTimestampMs?: number;
1020
+ status?: QuizGameStatus;
1021
+ }
1022
+
1023
+ export declare type CurrentQuestionScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.CURRENT_QUESTION>;
1024
+
1005
1025
  /**
1006
1026
  * @public
1007
1027
  */
@@ -1057,7 +1077,8 @@ export declare enum CustomerId {
1057
1077
  NERUDA_TV = "NERUDA_TV",
1058
1078
  DAVID_FRANK_TV = "DAVID_FRANK_TV",
1059
1079
  LEPSI_UZ_TO_NEBUDE = "LEPSI_UZ_TO_NEBUDE",
1060
- BEAT_SEXISM = "BEAT_SEXISM"
1080
+ BEAT_SEXISM = "BEAT_SEXISM",
1081
+ KAROL_A_KVIDO = "KAROL_A_KVIDO"
1061
1082
  }
1062
1083
 
1063
1084
  export declare interface CustomScript {
@@ -1564,9 +1585,9 @@ export declare interface GetSourceUrlResponse {
1564
1585
  */
1565
1586
  audioOnly?: boolean;
1566
1587
  /**
1567
- * URL for source modification for user (e.g. add PIP window to livestream).
1588
+ * Current session id for given user and source.
1568
1589
  */
1569
- managementUrl?: string;
1590
+ sessionId?: string;
1570
1591
  /**
1571
1592
  * Template for generating image previews for user scrubbing in player.
1572
1593
  */
@@ -1644,6 +1665,8 @@ export declare interface GetViewAnalyticsResponse {
1644
1665
 
1645
1666
  export declare type GetViewsAnalyticsRequest = GetBaseAnalyticsRequest;
1646
1667
 
1668
+ export declare let globalSdkReactConfig: SdkReactConfig | undefined;
1669
+
1647
1670
  /**
1648
1671
  * @public
1649
1672
  */
@@ -1758,6 +1781,117 @@ export declare interface IndexedVideo extends IndexedObject {
1758
1781
 
1759
1782
  export declare type IntegrationType = 'discord' | 'patreon';
1760
1783
 
1784
+ export declare interface InteractiveWidget<T extends InteractiveWidgetScene = InteractiveWidgetScene> {
1785
+ readonly id: string;
1786
+ readonly path: string;
1787
+ readonly currentQuestion: CurrentQuestion | null;
1788
+ readonly status: QuizGameStatus;
1789
+ readonly questionsCount: number;
1790
+ readonly currentAnswerId?: string;
1791
+ readonly currentState: InteractiveWidgetState;
1792
+ /**
1793
+ * State delayed for end users, which is used to toggle scenes just like in OBS and host view
1794
+ */
1795
+ readonly currentStateWithDelay: InteractiveWidgetCurrentStateWithDelay;
1796
+ readonly answers?: QuestionAnswer[];
1797
+ readonly questionIndex?: number;
1798
+ readonly isSubmitted?: boolean;
1799
+ readonly leaderboard: LeaderboardGroupItem | null;
1800
+ readonly highlightedUsersIds: string[];
1801
+ readonly userRole: QuizGameRole;
1802
+ readonly secondsToAnswer: number;
1803
+ readonly scenes: T[];
1804
+ readonly activeScene: T | null;
1805
+ readonly theme?: InteractiveWidgetTheme;
1806
+ readonly showCountdown: boolean;
1807
+ readonly lastQuestionTopScorers: LeaderboardPlayer[];
1808
+ readonly questionRepository: QuestionRepository;
1809
+ readonly isWaitingForStart: boolean;
1810
+ answerQuestion(answerId: string): void;
1811
+ submitAnswer(request: Pick<SubmitAnswerRequest, 'answerOptionId' | 'answerText'>): Promise<void>;
1812
+ destroy(): void;
1813
+ }
1814
+
1815
+ export declare interface InteractiveWidgetCurrentStateWithDelay {
1816
+ state: InteractiveWidgetState;
1817
+ enteredAt: Date;
1818
+ }
1819
+
1820
+ export declare enum InteractiveWidgetDisplayComponent {
1821
+ LEADERBOARD_SUMMARY = "leaderboardSummary",
1822
+ FULLSCREEN_LEADERBOARD = "fullscreenLeaderboard",
1823
+ CURRENT_QUESTION = "currentQuestion",
1824
+ PLAYERS = "players",
1825
+ QR_CODE = "qrCode",
1826
+ AD_BANNER = "adBanner",
1827
+ AD_VAST = "adVast"
1828
+ }
1829
+
1830
+ export declare type InteractiveWidgetScene = CurrentQuestionScene | LeaderboardScene | QRCodeScene | AdBannerScene | PlayersScene | NoGraphicsScene | CountdownScene;
1831
+
1832
+ export declare interface InteractiveWidgetSceneBase<TType extends InteractiveWidgetSceneTemplateType> {
1833
+ id: string;
1834
+ type: TType;
1835
+ name: Translation;
1836
+ metadata: SceneMetadata<TType>;
1837
+ }
1838
+
1839
+ export declare enum InteractiveWidgetSceneTemplateType {
1840
+ COUNTDOWN = "countdown",
1841
+ CURRENT_QUESTION = "currentQuestion",
1842
+ LEADERBOARD = "leaderboard",
1843
+ PLAYERS = "players",
1844
+ AD_BANNER = "adBanner",
1845
+ QR_CODE = "qrCode",
1846
+ NO_GRAPHICS = "noGraphics"
1847
+ }
1848
+
1849
+ export declare enum InteractiveWidgetState {
1850
+ /**
1851
+ * Transition to the next state
1852
+ */
1853
+ NEXT_STATE = "NextState",
1854
+ /**
1855
+ * Idle state
1856
+ * activeSceneIds: noGraphics, adBanner, players
1857
+ * Idle -> Countdown
1858
+ */
1859
+ IDLE = "Idle",
1860
+ /**
1861
+ * Countdown -> CurrentQuestion
1862
+ */
1863
+ COUNTDOWN = "Countdown",
1864
+ /**
1865
+ * Displays the current question
1866
+ */
1867
+ CURRENT_QUESTION = "CurrentQuestion",
1868
+ /**
1869
+ * CurrentQuestion -> GuestsAnsweredQuestions
1870
+ */
1871
+ GUESTS_ANSWERED_QUESTIONS = "GuestsAnsweredQuestions",
1872
+ /**
1873
+ * GuestsAnsweredQuestions -> ResolvedQuestion
1874
+ */
1875
+ RESOLVED_QUESTION = "ResolvedQuestion",
1876
+ /**
1877
+ * ResolvedQuestion -> ShowResults
1878
+ */
1879
+ LEADERBOARD = "Leaderboard",
1880
+ /**
1881
+ * Reset Game can be called only from Idle state
1882
+ */
1883
+ RESET_GAME = "ResetGame"
1884
+ }
1885
+
1886
+ export declare interface InteractiveWidgetTheme {
1887
+ palette: Record<string, string>;
1888
+ components: {
1889
+ [key in InteractiveWidgetThemeKey]?: Record<string, string>;
1890
+ };
1891
+ }
1892
+
1893
+ declare type InteractiveWidgetThemeKey = InteractiveWidgetDisplayComponent | `${InteractiveWidgetDisplayComponent.CURRENT_QUESTION}${AnswerStatus}` | 'timeLeftBar';
1894
+
1761
1895
  /**
1762
1896
  * @public
1763
1897
  */
@@ -1835,7 +1969,7 @@ export declare function isVodTivioSource(source?: CommonSource | null): source i
1835
1969
  /**
1836
1970
  * @public
1837
1971
  */
1838
- export declare type ItemComponent = RowItemComponent | BannerItemComponent;
1972
+ export declare type ItemComponent = RowItemComponent | BannerItemComponent | SurveyItemComponent;
1839
1973
 
1840
1974
  /**
1841
1975
  * @public
@@ -1900,6 +2034,31 @@ export declare interface LastMessage {
1900
2034
  createdAt: Date;
1901
2035
  }
1902
2036
 
2037
+ export declare interface LeaderboardGroupItem {
2038
+ groupPath?: string;
2039
+ groupName?: string;
2040
+ type: QuizGameGroupType;
2041
+ /**
2042
+ * Consists of top 3 players of the group (global or private team)
2043
+ * the player's rank in the group
2044
+ * and adjacent players in the group leaderboard
2045
+ */
2046
+ players: LeaderboardPlayer[];
2047
+ }
2048
+
2049
+ export declare interface LeaderboardPlayer {
2050
+ id: string;
2051
+ rank: number;
2052
+ name?: string;
2053
+ score: number;
2054
+ /**
2055
+ * We use this date to distinguish between players with the same name
2056
+ */
2057
+ userCreatedDate: Date;
2058
+ }
2059
+
2060
+ export declare type LeaderboardScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.LEADERBOARD>;
2061
+
1903
2062
  /**
1904
2063
  * @public
1905
2064
  */
@@ -2324,6 +2483,8 @@ export declare type NewVoucher = {
2324
2483
 
2325
2484
  declare type NextPageParamType = 'screenId' | 'rowId' | 'filter';
2326
2485
 
2486
+ export declare type NoGraphicsScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.NO_GRAPHICS>;
2487
+
2327
2488
  /**
2328
2489
  * @public
2329
2490
  */
@@ -2534,6 +2695,11 @@ export declare interface OrganizationSettingsField extends OrganizationResponsiv
2534
2695
  cancelledSubscriptionDiscount?: {
2535
2696
  enabled: boolean;
2536
2697
  };
2698
+ modalDetail?: {
2699
+ tagModal?: {
2700
+ hideTitle?: boolean;
2701
+ };
2702
+ };
2537
2703
  }
2538
2704
 
2539
2705
  /**
@@ -2887,6 +3053,18 @@ export declare interface PlayerError {
2887
3053
  message: string;
2888
3054
  }
2889
3055
 
3056
+ /**
3057
+ * @public
3058
+ */
3059
+ export declare type PlayerEvent = {
3060
+ name: PlayerEventName;
3061
+ };
3062
+
3063
+ /**
3064
+ * @public
3065
+ */
3066
+ export declare type PlayerEventName = `${PlayerWrapperEvents}`;
3067
+
2890
3068
  /**
2891
3069
  * @public
2892
3070
  */
@@ -3029,6 +3207,8 @@ export declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSou
3029
3207
  sourcePlayMode: SourcePlayMode;
3030
3208
  }
3031
3209
 
3210
+ export declare type PlayersScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.PLAYERS>;
3211
+
3032
3212
  /**
3033
3213
  * @public
3034
3214
  */
@@ -3070,11 +3250,19 @@ export declare interface PlayerWrapper {
3070
3250
  * Pause video
3071
3251
  */
3072
3252
  pause: () => void;
3253
+ ad: AdSourceInterface | null;
3254
+ adMetadata: AdMetadata | null;
3255
+ adSegment: AdSegment | null;
3256
+ availableLanguages: LangCode[] | null;
3257
+ canReplay: boolean;
3258
+ currentTime: number;
3073
3259
  /**
3074
3260
  * Currently playing source
3075
3261
  */
3076
3262
  source: PlayerSource | null;
3263
+ seekInterceptor: SeekInterceptor;
3077
3264
  events: EmitterInterface;
3265
+ event: PlayerEvent | null;
3078
3266
  /**
3079
3267
  * Register a low level player that implements player methods, like play video, change volume, etc.
3080
3268
  */
@@ -3082,12 +3270,29 @@ export declare interface PlayerWrapper {
3082
3270
  /**
3083
3271
  * duration of current source in ms (both setter and getter)
3084
3272
  */
3085
- durationMs: number | null;
3273
+ durationMs: number;
3274
+ intro: {
3275
+ marker: any;
3276
+ skip: () => void;
3277
+ } | null;
3278
+ isBuffering: boolean;
3279
+ isCurrentTimeLive: boolean;
3280
+ isLiveSeekingEnabled: boolean;
3281
+ isMuted: boolean;
3086
3282
  isPlaybackStarted?: boolean;
3087
3283
  isPaused: boolean;
3088
3284
  isPlaying: boolean;
3089
3285
  isIdle: boolean;
3286
+ language: LangCode | null;
3287
+ nextRecommendedVideo: Video | null;
3288
+ prerollCheck: PrerollCheck;
3289
+ previousSource: PlayerSource | null;
3290
+ progress: number | null;
3291
+ progressMetadata: ProgressMetadata;
3292
+ requestedSource: PlayerSource | null;
3090
3293
  error: PlayerError | null;
3294
+ state: PlayerState;
3295
+ volume: number;
3091
3296
  /**
3092
3297
  * Replay the video that finished playback
3093
3298
  */
@@ -3102,6 +3307,7 @@ export declare interface PlayerWrapper {
3102
3307
  * set volume to value between 0,1
3103
3308
  */
3104
3309
  setVolume: (volume: number) => void;
3310
+ changeLanguage: (langCode: LangCode) => Promise<void>;
3105
3311
  /**
3106
3312
  * change volume by value between -1,1
3107
3313
  */
@@ -3109,6 +3315,48 @@ export declare interface PlayerWrapper {
3109
3315
  setMuted: (muted: boolean) => void;
3110
3316
  toggleMuted: () => void;
3111
3317
  getQualities: () => Track[];
3318
+ playNativeImaAd: (url: string) => void;
3319
+ playSourceAfterAdsRun: () => void;
3320
+ putAd: (ad: AdSourceInterface) => void;
3321
+ putAdMetadata: (ad: AdSourceInterface) => void;
3322
+ reportLoadError: (error: Error) => void;
3323
+ reportStateChanged: (state: PlayerState) => void;
3324
+ reportTimeProgress: (ms: number) => void;
3325
+ reportPlaybackCancelled: () => void;
3326
+ reportPlaybackError: (error: Error) => void;
3327
+ reportPlaybackEnded: () => void;
3328
+ seekToPercent: (percentage: number) => void;
3329
+ seekToInternal: (ms: number) => void;
3330
+ seekToLive: () => void;
3331
+ seekToLiveInternal: () => void;
3332
+ setIsBuffering: (isBuffering: boolean) => void;
3333
+ skipAd: () => void;
3334
+ skipAllAds: () => void;
3335
+ }
3336
+
3337
+ /**
3338
+ * @public
3339
+ */
3340
+ export declare enum PlayerWrapperEvents {
3341
+ 'playback_cancelled' = "playback_cancelled",
3342
+ /**
3343
+ * Triggered when content video or ad finished playing until the end
3344
+ */
3345
+ 'playback_ended' = "playback_ended",
3346
+ /**
3347
+ * Triggered when both content video and all its associated ads finished playing until the end.
3348
+ * Or in case of postroll, when content video finished playing unit the end and all postroll
3349
+ * ads either finished / failed or were skipped.
3350
+ */
3351
+ 'video_unit_ended' = "video_unit_ended",
3352
+ /**
3353
+ * Pause was triggered
3354
+ */
3355
+ 'pause_triggered' = "pause_triggered",
3356
+ /**
3357
+ * Un-pause was triggered
3358
+ */
3359
+ 'unpause_triggered' = "unpause_triggered"
3112
3360
  }
3113
3361
 
3114
3362
  /**
@@ -3124,6 +3372,18 @@ export declare enum PlayerWrapperEventType {
3124
3372
  */
3125
3373
  export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
3126
3374
 
3375
+ /**
3376
+ * @public
3377
+ */
3378
+ /**
3379
+ * A promise that ads will be loaded. Resolves to the first ad source,
3380
+ * other ads are linked to it via `ad.next` attribute.
3381
+ *
3382
+ * In case preroll is not configured or no ad
3383
+ * manages to load successfully, resolves to null.
3384
+ */
3385
+ export declare type PrerollCheck = (source: PlayerSource) => Promise<AdSourceInterface | null>;
3386
+
3127
3387
  /**
3128
3388
  * Values that user entered in survey for given profile.
3129
3389
  */
@@ -3132,6 +3392,18 @@ export declare type ProfileSurvey = {
3132
3392
  age?: AgeRange;
3133
3393
  };
3134
3394
 
3395
+ /**
3396
+ * @public
3397
+ */
3398
+ export declare interface ProgressMetadata {
3399
+ currentTimeMs: number;
3400
+ durationMs: number;
3401
+ percent: number;
3402
+ remainingMs: number;
3403
+ type: 'original' | 'cutout';
3404
+ cutout?: Cutout;
3405
+ }
3406
+
3135
3407
  /**
3136
3408
  * @public
3137
3409
  */
@@ -3481,7 +3753,12 @@ export declare enum PurchaseStatus {
3481
3753
  /**
3482
3754
  * From PAID to EXPIRED when payment fails to renew subscription.
3483
3755
  */
3484
- EXPIRED = "EXPIRED"
3756
+ EXPIRED = "EXPIRED",
3757
+ /**
3758
+ * From PAID to EXPIRING when a Stargaze purchase has passed its expire date but hasn't been fully expired yet.
3759
+ * Stargaze will try to renew the purchase even after it has expired.
3760
+ */
3761
+ EXPIRING = "EXPIRING"
3485
3762
  }
3486
3763
 
3487
3764
  /**
@@ -3612,6 +3889,58 @@ export declare interface QerkoTransaction {
3612
3889
  voucherId?: string;
3613
3890
  }
3614
3891
 
3892
+ export declare type QRCodeScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.QR_CODE>;
3893
+
3894
+ export declare interface QuestionAnswer {
3895
+ id: string;
3896
+ answer: Translation;
3897
+ isCorrect?: boolean;
3898
+ votes?: number;
3899
+ status?: AnswerStatus;
3900
+ }
3901
+
3902
+ export declare enum QuestionEvents {
3903
+ NEW_QUESTION = "new_question",
3904
+ ANSWER_SELECTED = "answer_selected",
3905
+ COUNTDOWN_START = "countdown_start",
3906
+ COUNTDOWN_END = "countdown_end",
3907
+ QUESTION_TIMEOUT = "question_timeout"
3908
+ }
3909
+
3910
+ export declare interface QuestionRepository {
3911
+ on<K extends keyof QuestionRepositoryEventMap>(event: K, listener: QuestionRepositoryEventMap[K]): void;
3912
+ off<K extends keyof QuestionRepositoryEventMap>(event: K, listener: QuestionRepositoryEventMap[K]): void;
3913
+ readonly showCountdown: boolean;
3914
+ readonly currentQuestion: CurrentQuestion | null;
3915
+ readonly selectedAnswerId: string | undefined;
3916
+ isSubmitted: boolean;
3917
+ isSubmitting: boolean;
3918
+ setCurrentQuestion: (question: CurrentQuestion | null, role: QuizGameRole, secondsToAnswer: number, shouldEnterAtTimestampMs?: number) => void;
3919
+ selectAnswer: (answerId: string | undefined) => void;
3920
+ setShowCountdown: (showCountdown: boolean) => void;
3921
+ reset: () => void;
3922
+ }
3923
+
3924
+ export declare type QuestionRepositoryEventMap = {
3925
+ [QuestionEvents.NEW_QUESTION]: (question: CurrentQuestion | null) => void;
3926
+ [QuestionEvents.ANSWER_SELECTED]: (answerId: string | undefined) => void;
3927
+ [QuestionEvents.COUNTDOWN_START]: () => void;
3928
+ [QuestionEvents.COUNTDOWN_END]: () => void;
3929
+ [QuestionEvents.QUESTION_TIMEOUT]: (question: CurrentQuestion | null) => void;
3930
+ };
3931
+
3932
+ export declare interface QuizGameGroupStats {
3933
+ answerPercentages: Record<string, number>;
3934
+ averageScore: number;
3935
+ correctAnswersRatio: number;
3936
+ }
3937
+
3938
+ export declare enum QuizGameGroupType {
3939
+ HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
3940
+ ALL = "ALL",
3941
+ PARTY = "PARTY"
3942
+ }
3943
+
3615
3944
  export declare enum QuizGameRole {
3616
3945
  OBS = "OBS",
3617
3946
  HOST = "HOST",
@@ -3703,10 +4032,11 @@ declare type Relationship = {
3703
4032
  * @public
3704
4033
  */
3705
4034
  export declare type RemoteBundleState = {
3706
- config: InternalConfig;
3707
- error: string | null;
3708
4035
  state: 'loading' | 'error' | 'ready';
3709
- } & Nullable<TivioBundle>;
4036
+ error: string | null;
4037
+ config: InternalConfig;
4038
+ settings: Settings;
4039
+ } & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'> & Nullable<TivioBundle>;
3710
4040
 
3711
4041
  /**
3712
4042
  * @public
@@ -3740,6 +4070,8 @@ export declare interface RenderConditionValue {
3740
4070
  subscriptionRefs?: any[];
3741
4071
  }
3742
4072
 
4073
+ export declare const renderWebPlayer: (container: HTMLElement, props: WebPlayerProps) => void;
4074
+
3743
4075
  /**
3744
4076
  * Make all attributes in given type required, non-nullable and defined.
3745
4077
  * e.g. will make `{ attribute?: string | null }` to be `{ attribute: string }`
@@ -4065,6 +4397,26 @@ export declare type ScalableAsset = {
4065
4397
  */
4066
4398
  export declare type Scale = '@1' | '@2' | '@3';
4067
4399
 
4400
+ declare type SceneMetadata<TType extends InteractiveWidgetSceneTemplateType> = TType extends InteractiveWidgetSceneTemplateType.CURRENT_QUESTION ? {
4401
+ highlightedUsersAnswers: Array<{
4402
+ answerId: string;
4403
+ userId: string;
4404
+ }>;
4405
+ } : TType extends InteractiveWidgetSceneTemplateType.LEADERBOARD ? {
4406
+ highlightedPlayers: LeaderboardPlayer[];
4407
+ topPlayers: LeaderboardPlayer[];
4408
+ stats?: QuizGameGroupStats;
4409
+ } : TType extends InteractiveWidgetSceneTemplateType.QR_CODE ? Record<Extract<SceneMetadataKeys[TType], string>, string> : TType extends InteractiveWidgetSceneTemplateType.AD_BANNER ? Record<Extract<SceneMetadataKeys[TType], string>, string> : TType extends InteractiveWidgetSceneTemplateType.PLAYERS ? Record<Extract<SceneMetadataKeys[TType], string>, string> : object;
4410
+
4411
+ export declare interface SceneMetadataKeys {
4412
+ [InteractiveWidgetSceneTemplateType.CURRENT_QUESTION]: 'highlightedUsersAnswers';
4413
+ [InteractiveWidgetSceneTemplateType.LEADERBOARD]: 'highlightedPlayers';
4414
+ [InteractiveWidgetSceneTemplateType.QR_CODE]: 'qrCodeUrl' | 'title' | 'subtitle';
4415
+ [InteractiveWidgetSceneTemplateType.AD_BANNER]: 'bannerImage';
4416
+ [InteractiveWidgetSceneTemplateType.PLAYERS]: 'centerHtml' | 'player1Name' | 'player2Name' | 'player1Image' | 'player2Image' | 'player1Id' | 'player2Id';
4417
+ [InteractiveWidgetSceneTemplateType.NO_GRAPHICS]: never;
4418
+ }
4419
+
4068
4420
  export declare interface ScheduleNotificationRequest {
4069
4421
  notificationPath: string;
4070
4422
  }
@@ -4202,6 +4554,26 @@ export declare interface SeekingMatrixTemplate {
4202
4554
  interval: number;
4203
4555
  }
4204
4556
 
4557
+ export declare interface SeekInterceptionResult {
4558
+ position: number | null;
4559
+ didChangePosition: boolean;
4560
+ priority: number;
4561
+ }
4562
+
4563
+ /**
4564
+ * @public
4565
+ */
4566
+ export declare interface SeekInterceptor {
4567
+ addInterceptor(interceptor: SeekInterceptorFunction, callback?: SeekInterceptorCallback): void;
4568
+ applyInterceptors(currentPosition: number, seekPosition: number): SeekInterceptionResult;
4569
+ callCallbacksAfterInterception(): void;
4570
+ removeInterceptor(interceptor: SeekInterceptorFunction): void;
4571
+ }
4572
+
4573
+ export declare type SeekInterceptorCallback = (requestedSeekPosition: number) => void;
4574
+
4575
+ export declare type SeekInterceptorFunction = (currentPosition: number, seekPosition: number) => SeekInterceptionResult;
4576
+
4205
4577
  export declare enum SemanticDate {
4206
4578
  YESTERDAY = "Yesterday",
4207
4579
  TODAY = "Today",
@@ -4271,6 +4643,13 @@ export declare interface SetCustomClaimsRequest {
4271
4643
  organizationId: string;
4272
4644
  }
4273
4645
 
4646
+ export declare const setSdkReactConfig: (tivioConfig: SdkReactConfig) => void;
4647
+
4648
+ declare type Settings = {
4649
+ onSetUser: (handler: (userId: string, userPayload: UserPayload) => void) => void;
4650
+ setUser: (userId: string, userPayload: UserPayload) => void;
4651
+ };
4652
+
4274
4653
  /**
4275
4654
  * Used for entities, that can be global (e.g. asset presets, tag types).
4276
4655
  * Non-global is stored under organizations (in sub-collection), and shown for organization's users and super-admin.
@@ -4415,6 +4794,15 @@ export declare interface StoreBadgeConfig {
4415
4794
  appId: string;
4416
4795
  }
4417
4796
 
4797
+ export declare interface SubmitAnswerRequest {
4798
+ answerOptionId?: string;
4799
+ answerText?: string;
4800
+ clientTimestamp: number;
4801
+ questionEndTimestamp?: number;
4802
+ widgetPath: string;
4803
+ questionId: string;
4804
+ }
4805
+
4418
4806
  export declare interface SubmitAnswerResponse {
4419
4807
  id: string;
4420
4808
  receivedTimestamp: number;
@@ -4481,6 +4869,10 @@ export declare interface SuccessConfirmationOverlayPayload extends ConfirmationO
4481
4869
  confirmButtonText?: string;
4482
4870
  }
4483
4871
 
4872
+ export declare enum SurveyItemComponent {
4873
+ SURVEY = "SURVEY"
4874
+ }
4875
+
4484
4876
  export declare type SynchronizeUserTypeFunction = (payload: CreateUserPayload, tenantId: string, tenantUserId: string, organizationId?: string) => Promise<string>;
4485
4877
 
4486
4878
  /**
@@ -4857,13 +5249,25 @@ export declare type TivioGetters = {
4857
5249
  getPlayerWrapper: (opt: {
4858
5250
  playerWrapperId?: string;
4859
5251
  }) => PlayerWrapper;
4860
- getOrganizationSubscriptions: () => Promise<Monetization[] | undefined>;
5252
+ organization: {
5253
+ /**
5254
+ * Get organization subscriptions
5255
+ * @returns {Promise<Monetization[] | undefined>} organization subscriptions or undefined if organization does not exists
5256
+ */
5257
+ getSubscriptions: () => Promise<Monetization[] | undefined>;
5258
+ } | null;
4861
5259
  /**
4862
5260
  * Get video by its id.
4863
5261
  * @param videoId - video id
4864
5262
  * @returns {Promise<Video | null>} video or null if video does not exists
4865
5263
  */
4866
5264
  getVideoById: (videoId: string) => Promise<Video | null>;
5265
+ /**
5266
+ * Get screen by its id.
5267
+ * @param screenId - screen id
5268
+ * @returns {Promise<Screen | null>} screen or null if screen does not exists
5269
+ */
5270
+ getScreenById: (screenId: string, cb?: (error: Error | null, data: Screen_2 | null, disposer?: Disposer_2) => void) => Promise<Screen_2 | null>;
4867
5271
  /**
4868
5272
  * Get player capabilities based on user's browser and OS as resolved by Tivio.
4869
5273
  * @returns PlayerCapability[]
@@ -5049,7 +5453,7 @@ export declare type TivioJsBundleExposedApi = {
5049
5453
  * @param id - player wrapper id
5050
5454
  * @returns {Player} player wrapper instance
5051
5455
  */
5052
- getPlayerWrapper: (id: string) => Player;
5456
+ getPlayerWrapper: (id: string) => PlayerWrapper;
5053
5457
  /**
5054
5458
  * Get tv channel by its id.
5055
5459
  * @param tvChannelId - tv channel id
@@ -5064,7 +5468,7 @@ export declare type TivioJsBundleExposedApi = {
5064
5468
  getTagById: (tagId: string) => Promise<Tag | null>;
5065
5469
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
5066
5470
  destroy: () => Promise<void>;
5067
- } & Pick<TivioGetters, 'getVideoById'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
5471
+ } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
5068
5472
 
5069
5473
  /**
5070
5474
  * @public
@@ -5090,13 +5494,12 @@ export declare const TivioProvider: React_2.FC<TivioProviderProps>;
5090
5494
  /**
5091
5495
  * @public
5092
5496
  */
5093
- export declare type TivioProviderProps = {
5497
+ export declare interface TivioProviderProps extends React_2.PropsWithChildren {
5094
5498
  /**
5095
5499
  * This prop must be set only once and not change value afterwards
5096
5500
  */
5097
5501
  conf: SdkReactConfig | undefined | null;
5098
- children: React_2.ReactNode;
5099
- };
5502
+ }
5100
5503
 
5101
5504
  /**
5102
5505
  * @public
@@ -5125,7 +5528,7 @@ export declare type TivioReactBundle = {
5125
5528
  internal: TivioInternalBundle;
5126
5529
  analytics: TivioAnalytics;
5127
5530
  destroy: () => Promise<void>;
5128
- } & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
5531
+ } & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'> & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'>;
5129
5532
 
5130
5533
  /**
5131
5534
  * @public
@@ -5750,11 +6153,6 @@ export declare interface UseReactionsOptions {
5750
6153
  onError?: (error: Error) => void;
5751
6154
  }
5752
6155
 
5753
- /**
5754
- * @public
5755
- */
5756
- export declare const useRemoteBundle: (conf: InternalConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
5757
-
5758
6156
  export declare enum UserGroup {
5759
6157
  ALL = "all",
5760
6158
  FREE = "free",
@@ -6098,6 +6496,7 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
6098
6496
  pgRating?: string;
6099
6497
  contentDescriptors?: string[];
6100
6498
  publishedStatus?: PublishedStatus;
6499
+ widgetPaths?: string[];
6101
6500
  }
6102
6501
 
6103
6502
  /**
@@ -6160,7 +6559,7 @@ export declare enum VideoSourceEncryption {
6160
6559
  PLAYREADY = "playready"
6161
6560
  }
6162
6561
 
6163
- export declare interface VideoSourceField {
6562
+ export declare type VideoSourceField = {
6164
6563
  codec: VideoSourceCodec;
6165
6564
  /**
6166
6565
  * DRM provider for given encrypted source.
@@ -6176,24 +6575,40 @@ export declare interface VideoSourceField {
6176
6575
  priority: VideoSourcePriority;
6177
6576
  protocol: VideoSourceProtocol;
6178
6577
  provider?: VideoSourceProvider;
6179
- url: string;
6180
6578
  languages?: LangCode[];
6181
- /**
6182
- * URL for source modification for user (e.g. add PIP window to livestream).
6183
- */
6184
- managementUrl?: string;
6185
6579
  /**
6186
6580
  * Seeking matrix override for given source.
6187
6581
  */
6188
6582
  seekingMatrix?: Partial<SeekingMatrixTemplate>;
6189
6583
  /**
6190
- * Content id override to include generated jwt token.
6584
+ * Determines session type generated for source. If no provided it will be considered 'ondemand' session type.
6585
+ */
6586
+ sessionType?: 'channel' | 'interactive' | 'live' | 'ondemand';
6587
+ /**
6588
+ * Content id override to include in authentication for api-streaming worker.
6191
6589
  * Used when you have several sources from different contents (videos).
6192
- * Without it {@link getSourceUrl} will use document's id, and jwt token validation might fail
6193
- * because content id in source url and in token will not match.
6590
+ * Without it {@link getSourceUrl} will use document's id, and authentication might fail
6591
+ * because content id in source url and authentication will not match.
6194
6592
  */
6195
6593
  contentId?: string;
6196
- }
6594
+ } & ({
6595
+ url: string;
6596
+ provider?: Exclude<VideoSourceProvider, VideoSourceProvider.CLOUDFLARE>;
6597
+ } | {
6598
+ url: string;
6599
+ /**
6600
+ * If both contentId and profileId provided, we don't need url, we have enough information to generate cloudflare source.
6601
+ */
6602
+ provider: VideoSourceProvider.CLOUDFLARE;
6603
+ profileId: string;
6604
+ /**
6605
+ * Options to send to session source generation api. See {@link GenerateSessionSourceRequest} in @tivio/api.
6606
+ * TODO type duplication, but have no way to import ^ here.
6607
+ */
6608
+ options?: {
6609
+ delaySegmentCount?: number;
6610
+ };
6611
+ });
6197
6612
 
6198
6613
  /**
6199
6614
  * Lower number = higher priority.
@@ -6737,6 +7152,7 @@ export declare interface WebPlayerProps {
6737
7152
  disablePlayNext?: boolean;
6738
7153
  setPaymentOverlayVisible?: React_2.Dispatch<React_2.SetStateAction<boolean>>;
6739
7154
  hideOverlay?: boolean;
7155
+ sourcePlayMode?: SourcePlayMode;
6740
7156
  }
6741
7157
 
6742
7158
  /**