@tivio/sdk-react 9.4.0 → 9.6.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.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AD_SERVICE_PROXY_NAME } from '@tivio/common';
1
2
  import type { ComponentType } from 'react';
2
3
  import type dayjs from 'dayjs';
3
4
  import { DocumentReference } from '@firebase/firestore-types';
@@ -34,6 +35,8 @@ declare interface actualPriceDetails {
34
35
  currency?: primaSupportedCurrency;
35
36
  }
36
37
 
38
+ export { AD_SERVICE_PROXY_NAME }
39
+
37
40
  export declare type AdBannerScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.AD_BANNER>;
38
41
 
39
42
  export declare type AddEditCommentResponse = {
@@ -100,6 +103,7 @@ export declare type AdMetadata = {
100
103
  isSkippable: boolean;
101
104
  order: number | null;
102
105
  totalCount: number | null;
106
+ customAdMetadata?: Record<string, unknown>;
103
107
  skip: () => void;
104
108
  } | null;
105
109
 
@@ -217,6 +221,10 @@ export declare interface AdSourceInterface extends CommonSourceInterface<SourceT
217
221
  skipAll(): void;
218
222
  onRemainingTimeChanged(ms: number): void;
219
223
  click(): void;
224
+ /**
225
+ * Rich IMA ad metadata including customAdMetadata (only available for IMA ads)
226
+ */
227
+ imaAdMetadata?: any;
220
228
  }
221
229
 
222
230
  /**
@@ -1210,7 +1218,8 @@ export declare enum CustomerId {
1210
1218
  KAROL_A_KVIDO = "KAROL_A_KVIDO",
1211
1219
  UZ_BUDU = "UZ_BUDU",
1212
1220
  PRIMA = "PRIMA",
1213
- NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA"
1221
+ NORA_FRIDRICHOVA = "NORA_FRIDRICHOVA",
1222
+ LONGEVITY = "LONGEVITY"
1214
1223
  }
1215
1224
 
1216
1225
  export declare interface CustomScript {
@@ -1594,6 +1603,7 @@ export declare interface ForbiddenOnCallError extends GenericOnCallError {
1594
1603
  }
1595
1604
 
1596
1605
  export declare enum ForbiddenReason {
1606
+ AD_BLOCKING = "AD_BLOCKING",
1597
1607
  MONETIZATION = "MONETIZATION",
1598
1608
  GEO_BLOCKING = "GEO_BLOCKING",
1599
1609
  EMAIL_ALREADY_EXISTS = "EMAIL_ALREADY_EXISTS",
@@ -3056,6 +3066,20 @@ export declare interface PartialRegistrationOverlayContextState {
3056
3066
  voucher?: string;
3057
3067
  }
3058
3068
 
3069
+ /**
3070
+ * @public
3071
+ * Generic interface for sources that can be identified by a path (video or TV channel)
3072
+ */
3073
+ export declare type PathSourceParams = PathSourceParamsTvChannel | PathSourceParamsVideo;
3074
+
3075
+ declare interface PathSourceParamsTvChannel extends Partial<ChannelSourceParams> {
3076
+ path: `tvChannels/${string}`;
3077
+ }
3078
+
3079
+ declare interface PathSourceParamsVideo extends Partial<Omit<VodTivioSourceParams, 'videoPath'>> {
3080
+ path: `videos/${string}`;
3081
+ }
3082
+
3059
3083
  export declare type PatreonCreatorData = {
3060
3084
  campaign: string;
3061
3085
  tiers: Tier[];
@@ -3502,6 +3526,7 @@ export declare interface PlayerSourceInterface<T extends NonAdSourceType = NonAd
3502
3526
  start?: Date;
3503
3527
  from?: Date;
3504
3528
  sourceHistory?: string[];
3529
+ staticAdsConfig?: StaticAdsBreak[];
3505
3530
  }
3506
3531
 
3507
3532
  /**
@@ -3520,6 +3545,7 @@ export declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSou
3520
3545
  seekingMatrix?: SeekingMatrixTemplate;
3521
3546
  sessionType?: VideoSourceField['sessionType'];
3522
3547
  sessionId?: string;
3548
+ staticAdsConfig?: StaticAdsBreak[];
3523
3549
  }
3524
3550
 
3525
3551
  export declare type PlayersScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.PLAYERS>;
@@ -3680,7 +3706,15 @@ export declare enum PlayerWrapperEvents {
3680
3706
  /**
3681
3707
  * Un-pause was triggered
3682
3708
  */
3683
- 'unpause_triggered' = "unpause_triggered"
3709
+ 'unpause_triggered' = "unpause_triggered",
3710
+ /**
3711
+ * Triggered when an ad starts playing
3712
+ */
3713
+ 'ad-started' = "ad-started",
3714
+ /**
3715
+ * Triggered when an ad finishes playing
3716
+ */
3717
+ 'ad-ended' = "ad-ended"
3684
3718
  }
3685
3719
 
3686
3720
  /**
@@ -3940,6 +3974,11 @@ export declare type Purchase = {
3940
3974
  voucherId: string | null;
3941
3975
  isVoucherActivation?: boolean;
3942
3976
  rebalancingVideoRef?: any;
3977
+ /**
3978
+ * Returns all purchases that are connected via originalPurchaseRef.
3979
+ * For example, if user has subscription purchase, this method will return all purchases that are RENEWED + PAID/CANCELLED latest one.
3980
+ */
3981
+ getRelatedPurchases: () => Promise<Purchase[]>;
3943
3982
  };
3944
3983
 
3945
3984
  /**
@@ -5059,6 +5098,14 @@ export declare type SdkReactConfig = Omit<TivioConfig, 'language'> & {
5059
5098
  language?: LangCode;
5060
5099
  };
5061
5100
 
5101
+ /**
5102
+ * @public
5103
+ */
5104
+ export declare interface SDKUserAuthCallbacks {
5105
+ onGoToLogin?: () => void;
5106
+ onGoToRegistration?: () => void;
5107
+ }
5108
+
5062
5109
  /**
5063
5110
  * @public
5064
5111
  * @deprecated sections are no longer used.
@@ -5362,6 +5409,21 @@ export declare interface SimplifiedVideoController {
5362
5409
  muted: boolean;
5363
5410
  volume: number;
5364
5411
  }) => void): void;
5412
+ /**
5413
+ * Add an event listener for ad started events
5414
+ * @param event - Must be 'ad-started'
5415
+ * @param callback - Function called when an ad starts playing
5416
+ */
5417
+ addEventListener(event: 'ad-started', callback: (adMetadata: AdMetadata & {
5418
+ customAdMetadata?: Record<string, unknown> | null;
5419
+ ctaElement: HTMLElement | null;
5420
+ }) => void): void;
5421
+ /**
5422
+ * Add an event listener for ad ended events
5423
+ * @param event - Must be 'ad-ended'
5424
+ * @param callback - Function called when an ad finishes playing
5425
+ */
5426
+ addEventListener(event: 'ad-ended', callback: () => void): void;
5365
5427
  /**
5366
5428
  * Remove an event listener
5367
5429
  * @param event - The event name to stop listening for
@@ -5373,6 +5435,7 @@ export declare interface SimplifiedVideoController {
5373
5435
  * @param source - The new source to load (can be a video path, channel path, or source parameters)
5374
5436
  */
5375
5437
  setSource(source: WebPlayerProps['source']): void;
5438
+ setAdsConfig(adsConfig: StaticAdsBreak[]): void;
5376
5439
  /**
5377
5440
  * Destroy the player and clean up all resources
5378
5441
  */
@@ -5492,6 +5555,19 @@ export declare interface StartLiveStreamResponse {
5492
5555
  error?: string;
5493
5556
  }
5494
5557
 
5558
+ export declare type StaticAdsBreak = StaticAdsBreakPostrollPreroll | StaticAdsBreakMidroll;
5559
+
5560
+ export declare interface StaticAdsBreakMidroll {
5561
+ type: 'midroll';
5562
+ from: number;
5563
+ url: string;
5564
+ }
5565
+
5566
+ declare interface StaticAdsBreakPostrollPreroll {
5567
+ type: 'preroll' | 'postroll';
5568
+ url: string;
5569
+ }
5570
+
5495
5571
  /**
5496
5572
  * @public
5497
5573
  */
@@ -5908,6 +5984,10 @@ export declare interface TivioComponents {
5908
5984
  ContentSortPicker: React_2.ComponentType<ContentSortPickerProps>;
5909
5985
  WebTivioProVideoScreen: React_2.ComponentType<WebTivioProVideoScreenProps>;
5910
5986
  RemoteController: React_2.ComponentType<RemoteControllerProps>;
5987
+ MonetizationsSelectOverlay: React_2.ComponentType;
5988
+ MonetizationsSelectOverlayContextProvider: React_2.ComponentType<{
5989
+ children: React_2.ReactNode;
5990
+ }>;
5911
5991
  }
5912
5992
 
5913
5993
  /**
@@ -5969,6 +6049,12 @@ export declare interface TivioConfig {
5969
6049
  * (otherwise organizations would share login token).
5970
6050
  */
5971
6051
  customerId?: CustomerId;
6052
+ /**
6053
+ * An optional variable that enables Single Sign-On (SSO) for all subdomains under the same parent domain.
6054
+ * @example
6055
+ * customTokenCookiesDomain: 'example.com'
6056
+ */
6057
+ customTokenCookiesDomain?: string;
5972
6058
  }
5973
6059
 
5974
6060
  /**
@@ -6172,7 +6258,9 @@ export declare type TivioInternalProviders = {
6172
6258
  UserContextProvider: React_2.ComponentType<{
6173
6259
  children?: React_2.ReactNode;
6174
6260
  }>;
6175
- MonetizationsSelectOverlayContextProvider: React_2.ComponentType;
6261
+ MonetizationsSelectOverlayContextProvider: React_2.ComponentType<{
6262
+ children: React_2.ReactNode;
6263
+ }>;
6176
6264
  QerkoOverlayContextProvider: React_2.ComponentType;
6177
6265
  /**
6178
6266
  * @deprecated do not use, this provider will be removed in the future
@@ -6407,7 +6495,7 @@ export declare interface TvAppProps {
6407
6495
  /**
6408
6496
  * @public
6409
6497
  */
6410
- export declare interface TvChannel extends RowItem {
6498
+ export declare interface TvChannel extends RowItem, MonetizableItem {
6411
6499
  id: string;
6412
6500
  itemType: ROW_ITEM_TYPES.TV_CHANNEL;
6413
6501
  name: string;
@@ -6418,17 +6506,11 @@ export declare interface TvChannel extends RowItem {
6418
6506
  logoPendingOverlayWidth?: string;
6419
6507
  hls: string;
6420
6508
  dash: string;
6421
- /**
6422
- * Returns all transactions and subscriptions applied to this tv channel.
6423
- * Transactions before subscriptions, sorted by price ascending.
6424
- */
6425
- getPurchasableMonetizations(options?: GetPurchasableMonetizationsOptions): PurchasableMonetization[];
6426
6509
  getSourceUrl(options?: {
6427
6510
  language?: LangCode;
6428
6511
  }): Promise<GetSourceUrlResponse & {
6429
6512
  language?: LangCode;
6430
6513
  }>;
6431
- purchasableMonetization: any | null;
6432
6514
  price: number;
6433
6515
  cover: string;
6434
6516
  isPlayable: boolean;
@@ -7192,6 +7274,7 @@ export declare enum VastProvider {
7192
7274
  TEST = "test",
7193
7275
  TEST_VPAID = "test-vpaid",
7194
7276
  TIVIO_ADS = "tivio-ads",
7277
+ STATIC_ADS_PROVIDER = "static-ads-provider",
7195
7278
  JOJ_TEST_AD_FORM_PROGRAMMATIC = "joj-test-ad-form-programmatic",
7196
7279
  JOJ_TEST_TESTER_VASTERIX = "joj-test-tester-vasterix",
7197
7280
  JOJ_TEST_TESTER_ADFORM_30 = "joj-test-tester-adform-30"
@@ -7333,6 +7416,9 @@ export declare interface VideoController {
7333
7416
  muted: boolean;
7334
7417
  volume: number;
7335
7418
  }) => void): void;
7419
+ addEventListener(event: 'ad-started', callback: (value: AdMetadata & {
7420
+ adCtaElement: HTMLElement | null;
7421
+ }) => void): void;
7336
7422
  /**
7337
7423
  * Remove an event listener
7338
7424
  * @param event - The event name to stop listening for
@@ -7458,6 +7544,7 @@ export declare interface VideoController {
7458
7544
  * @param mutations - Array of DOM mutation records
7459
7545
  */
7460
7546
  onWatermarkElementChange(mutations: MutationRecord[]): void;
7547
+ setAdCtaElement: (element: HTMLElement | null) => void;
7461
7548
  }
7462
7549
 
7463
7550
  declare type VideoDetailResponsiveField = OrganizationResponsiveSetting<{
@@ -7833,6 +7920,7 @@ export declare interface Watermark {
7833
7920
 
7834
7921
  export declare interface WebConfig {
7835
7922
  customer: CustomerId;
7923
+ customerName?: string;
7836
7924
  title?: string;
7837
7925
  description?: string;
7838
7926
  logo: string;
@@ -7848,16 +7936,35 @@ export declare interface WebConfig {
7848
7936
  * Text on buy voucher button, if not provided the default text will be used.
7849
7937
  */
7850
7938
  buyVoucherButtonText?: string;
7939
+ /**
7940
+ * If true, the voucher button will be shown in the header.
7941
+ */
7942
+ showVoucherButton?: boolean;
7851
7943
  allowSearch?: boolean;
7852
7944
  logoHeight?: string;
7853
7945
  mobileLogoHeight?: string;
7854
7946
  buySubscriptionButtonText?: string;
7947
+ isHidden?: boolean;
7948
+ /**
7949
+ * Additional menu items to be shown in the rounded menu in the header (external or internal)
7950
+ */
7951
+ additionalMenuItems?: {
7952
+ name: string;
7953
+ href: string;
7954
+ newTab?: boolean;
7955
+ }[];
7855
7956
  };
7856
7957
  footer?: {
7958
+ isHidden?: boolean;
7857
7959
  /**
7858
7960
  * If logo is different from logo in header
7859
7961
  */
7860
7962
  logo?: string;
7963
+ /**
7964
+ * @fixme https://app.clickup.com/t/90151157205/TIV-1515
7965
+ * If multiple logos are provided, the multiple logos are prioritized over the single logo.
7966
+ */
7967
+ multipleLogos?: string[];
7861
7968
  showLogo?: boolean;
7862
7969
  /**
7863
7970
  * right panel - various type of contacts to owners of website
@@ -7900,6 +8007,19 @@ export declare interface WebConfig {
7900
8007
  email?: string;
7901
8008
  };
7902
8009
  cookieSettingsLabel?: string;
8010
+ disclaimer?: string;
8011
+ showDivider?: boolean;
8012
+ /**
8013
+ * Additional links to be shown in the footer
8014
+ */
8015
+ additionalLinks?: {
8016
+ name: string;
8017
+ href: string;
8018
+ }[];
8019
+ /**
8020
+ * Hide footer on these paths
8021
+ */
8022
+ hideFooter?: string[];
7903
8023
  partners?: {
7904
8024
  name: string;
7905
8025
  logo: string;
@@ -7915,6 +8035,14 @@ export declare interface WebConfig {
7915
8035
  * so app requires authorization to see them.
7916
8036
  */
7917
8037
  securedContent?: boolean;
8038
+ /**
8039
+ * If true, then auth is required for all pages.
8040
+ */
8041
+ isAuthRequired?: boolean;
8042
+ /**
8043
+ * If true, then buy subscription button is hidden.
8044
+ */
8045
+ hideBuySubscriptionButton?: boolean;
7918
8046
  /**
7919
8047
  * CSS styles for application background.
7920
8048
  */
@@ -7933,6 +8061,10 @@ export declare interface WebConfig {
7933
8061
  * Default is TRUE (see {@link AppLoadingOverlay}
7934
8062
  */
7935
8063
  showProgressBar?: boolean;
8064
+ /**
8065
+ * URL to background image shown on loading screen.
8066
+ */
8067
+ backgroundUrl?: string;
7936
8068
  };
7937
8069
  /**
7938
8070
  * Slug of all pages where user will be forced to fill login form if he's not logged in.
@@ -7960,6 +8092,7 @@ export declare interface WebConfig {
7960
8092
  */
7961
8093
  showChooseSubscription?: boolean;
7962
8094
  registration?: {
8095
+ logoMarginTop?: string;
7963
8096
  /**
7964
8097
  * Customization of auth form
7965
8098
  */
@@ -7979,6 +8112,7 @@ export declare interface WebConfig {
7979
8112
  showAcceptanceOfTermsAndConditions?: boolean;
7980
8113
  };
7981
8114
  registrationConsent?: string;
8115
+ socialRegistrationConsent?: string;
7982
8116
  };
7983
8117
  payment?: {
7984
8118
  paymentConsent?: string;
@@ -7989,9 +8123,11 @@ export declare interface WebConfig {
7989
8123
  */
7990
8124
  supportVouchers?: boolean;
7991
8125
  /**
7992
- * Config for Google Tag Manager
8126
+ * Config for Google Tag Manager with optional shouldWaitForDidomi flag
7993
8127
  */
7994
- googleTagManagerConfig?: TagManagerArgs;
8128
+ googleTagManagerConfig?: TagManagerArgs & {
8129
+ shouldWaitForDidomi?: boolean;
8130
+ };
7995
8131
  customScripts?: CustomScript[];
7996
8132
  /**
7997
8133
  * Favicons config
@@ -8010,6 +8146,8 @@ export declare interface WebConfig {
8010
8146
  };
8011
8147
  monetizationSelectOverlay?: {
8012
8148
  title?: string;
8149
+ benefitLeftIcon?: string;
8150
+ showFullMonetizationOnMobile?: boolean;
8013
8151
  };
8014
8152
  /**
8015
8153
  * Google Analytics ID. If provided, Google Analytics will be enabled.
@@ -8021,6 +8159,7 @@ export declare interface WebConfig {
8021
8159
  centeredMenu?: boolean;
8022
8160
  /**
8023
8161
  * All values are considered as false if not provided.
8162
+ * @deprecated - use settings.allowedSignInProviders inside OrganizationDocument
8024
8163
  */
8025
8164
  socialLogins?: {
8026
8165
  showAppleLogin?: boolean;
@@ -8035,11 +8174,24 @@ export declare interface WebConfig {
8035
8174
  * If true, robots.txt will prevent crawling of the website.
8036
8175
  */
8037
8176
  norobots?: boolean;
8038
- customTranslations?: {
8039
- [key: string]: {
8040
- [key: string]: string;
8041
- };
8177
+ voucher?: {
8178
+ voucherConsent: string;
8179
+ };
8180
+ customTranslations?: Record<string, Record<string, string>>;
8181
+ onPurchase?: (monetization: Purchase) => void;
8182
+ facebookPixelConfig?: {
8183
+ pixelId: string;
8184
+ shouldWaitForDidomi?: boolean;
8042
8185
  };
8186
+ /**
8187
+ * If true, the app will be locked in the "remote controller" mode.
8188
+ * This means that the app will not be able to navigate to other pages and will only show the remote controller.
8189
+ */
8190
+ isRemoteControllerApp?: boolean;
8191
+ /**
8192
+ * Determines if application should check allowed URL handles when switching applications.
8193
+ */
8194
+ disableUrlHandleCheck?: boolean;
8043
8195
  /**
8044
8196
  * Map for all handlers
8045
8197
  */
@@ -8062,7 +8214,7 @@ export declare interface WebGridScreenProps {
8062
8214
  */
8063
8215
  export declare interface WebPlayerProps {
8064
8216
  id: string;
8065
- source?: InputSourceParams | VideoPath | ChannelPath | null;
8217
+ source?: InputSourceParams | PathSourceParams | VideoPath | ChannelPath | null;
8066
8218
  onEnded?: () => any;
8067
8219
  /**
8068
8220
  * If true, the player will inherit the width and height of its parent element.
@@ -8148,6 +8300,8 @@ export declare interface WebPlayerProps {
8148
8300
  setPaymentOverlayVisible?: React_2.Dispatch<React_2.SetStateAction<boolean>>;
8149
8301
  hideOverlay?: boolean;
8150
8302
  sourcePlayMode?: SourcePlayMode;
8303
+ adsConfig?: StaticAdsBreak[];
8304
+ userAuthCallbacks?: SDKUserAuthCallbacks;
8151
8305
  }
8152
8306
 
8153
8307
  /**