@tivio/sdk-react 7.2.0-alpha.0 → 7.2.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -6,6 +6,14 @@ settings in the administration of Tivio Studio while having the freedom to build
6
6
 
7
7
  ## Changelog
8
8
 
9
+ * UNRELEASED
10
+ * major: deprecated usePurchasesWithVideos hook removed
11
+ * patch: add id to user type
12
+
13
+ * 7.1.0
14
+ * minor: export useTvChannelHook
15
+ * patch: bump "react-i18next", "i18next" versions.
16
+
9
17
  * 7.0.1
10
18
  * patch: fix dependency to @tivio/common
11
19
 
package/README.md.bak CHANGED
@@ -6,6 +6,14 @@ settings in the administration of Tivio Studio while having the freedom to build
6
6
 
7
7
  ## Changelog
8
8
 
9
+ * UNRELEASED
10
+ * major: deprecated usePurchasesWithVideos hook removed
11
+ * patch: add id to user type
12
+
13
+ * 7.1.0
14
+ * minor: export useTvChannelHook
15
+ * patch: bump "react-i18next", "i18next" versions.
16
+
9
17
  * 7.0.1
10
18
  * patch: fix dependency to @tivio/common
11
19
 
package/dist/index.d.ts CHANGED
@@ -336,6 +336,14 @@ export declare type Assets = {
336
336
  [assetName: string]: ScalableAsset;
337
337
  };
338
338
 
339
+ declare type Attributes = {
340
+ created: string;
341
+ email: string;
342
+ full_name: string;
343
+ url: string;
344
+ image_url: string;
345
+ };
346
+
339
347
  /**
340
348
  * @public
341
349
  */
@@ -363,7 +371,8 @@ export declare type BadRequestError = Error & {
363
371
 
364
372
  export declare enum BannerItemComponent {
365
373
  CLASSIC = "CLASSIC",
366
- SPLIT = "SPLIT"
374
+ SPLIT = "SPLIT",
375
+ BACKGROUND = "BACKGROUND"
367
376
  }
368
377
 
369
378
  /**
@@ -372,6 +381,7 @@ export declare enum BannerItemComponent {
372
381
  export declare type BannerProps = {
373
382
  isLoading: boolean;
374
383
  text: string;
384
+ description?: string;
375
385
  focused: boolean;
376
386
  onClick?: () => void;
377
387
  hoverable: boolean;
@@ -382,6 +392,7 @@ export declare type BannerProps = {
382
392
  borderRadius?: string | number;
383
393
  buttonText?: string;
384
394
  onButtonClick?: () => void;
395
+ buttonHref?: string;
385
396
  numberOfLines?: number;
386
397
  };
387
398
 
@@ -721,21 +732,25 @@ export declare type Currency = 'CZK' | 'EUR' | 'USD';
721
732
  * @public
722
733
  */
723
734
  export declare enum CustomerId {
724
- OKTAGON = "OKTAGON",
725
- JOJ = "JOJ",
726
- MALL = "MALL",
727
- GARAZ = "GARAZ",
728
- U_KULATEHO_STOLU = "U_KULATEHO_STOLU",
729
- INVESTOREES = "INVESTOREES",
735
+ CNC = "CNC",
730
736
  DVTV = "DVTV",
731
737
  DVTV_DEV = "DVTV_DEV",
732
- O2 = "O2",
738
+ GARAZ = "GARAZ",
733
739
  GRAPE = "GRAPE",
734
- TIVIO = "TIVIO",
735
- STORYBOOK = "STORYBOOK",
740
+ HODINA_DEJEPICHU = "HODINA_DEJEPICHU",
741
+ INVESTICNI_PRUVODCE = "INVESTICNI_PRUVODCE",
742
+ INVESTOREES = "INVESTOREES",
743
+ JOJ = "JOJ",
744
+ MALL = "MALL",
745
+ MEDIAR = "MEDIAR",
736
746
  NANGU_DEV = "NANGU_DEV",
737
- CNC = "CNC",
738
- VOJTA_ZIZKA = "VOJTA_ZIZKA"
747
+ O2 = "O2",
748
+ OKTAGON = "OKTAGON",
749
+ ONDREJ_KOBERSKY = "ONDREJ_KOBERSKY",
750
+ STARMAX = "STARMAX",
751
+ STORYBOOK = "STORYBOOK",
752
+ TIVIO = "TIVIO",
753
+ U_KULATEHO_STOLU = "U_KULATEHO_STOLU"
739
754
  }
740
755
 
741
756
  /**
@@ -746,6 +761,13 @@ export declare interface Cutout {
746
761
  endMs: number;
747
762
  }
748
763
 
764
+ declare type Data = {
765
+ attributes: Attributes;
766
+ id: string;
767
+ relationships: Relationship;
768
+ type: 'tier' | 'member' | 'user';
769
+ };
770
+
749
771
  /**
750
772
  * @public
751
773
  */
@@ -932,7 +954,7 @@ export declare interface EmailTemplateVersion {
932
954
 
933
955
  export declare type EmbedScreenMessageNavigateType = {
934
956
  type: EmbedScreenMessageType.NAVIGATE;
935
- to: string | 'Profile' | 'Home' | 'Search' | 'Video' | 'Series';
957
+ to: string | 'Profile' | 'Home' | 'Search' | 'Video' | 'Series' | 'Subscription';
936
958
  value?: string;
937
959
  };
938
960
 
@@ -1208,6 +1230,24 @@ export declare enum GRID_TYPES {
1208
1230
  SERIES = "SERIES"
1209
1231
  }
1210
1232
 
1233
+ declare type IncludedItem = {
1234
+ attributes: {
1235
+ next_charge_date: string;
1236
+ /**
1237
+ * A null value indicates the member has never pledged. Can be null.
1238
+ */
1239
+ patron_status: 'active_patron' | 'declined_patron' | 'former_patron' | null;
1240
+ /**
1241
+ * The only successful status is Paid. null if never charged. Can be null.
1242
+ * One of Paid Declined Deleted Pending Refunded Fraud Other.
1243
+ */
1244
+ last_charge_status: 'Paid' | 'Declined' | 'Deleted' | 'Pending' | 'Refunded' | 'Fraud' | 'Other';
1245
+ last_charge_date: string;
1246
+ };
1247
+ id: string;
1248
+ type: string;
1249
+ };
1250
+
1211
1251
  /**
1212
1252
  * @public
1213
1253
  */
@@ -1404,6 +1444,10 @@ export declare type LinkedVideo = {
1404
1444
  type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD';
1405
1445
  };
1406
1446
 
1447
+ declare type Links = {
1448
+ self: string;
1449
+ };
1450
+
1407
1451
  /**
1408
1452
  * @public
1409
1453
  */
@@ -1536,6 +1580,11 @@ export declare type MarkersProps = {
1536
1580
  className?: string;
1537
1581
  };
1538
1582
 
1583
+ declare type Membership = {
1584
+ id: string;
1585
+ type: string;
1586
+ };
1587
+
1539
1588
  /**
1540
1589
  * External information of video migrated via our Public API.
1541
1590
  * @public
@@ -1781,6 +1830,37 @@ export declare type PaginationOptions = Partial<{
1781
1830
  noAutoFetch: boolean;
1782
1831
  }>;
1783
1832
 
1833
+ export declare type PatreonCreatorData = {
1834
+ campaign: string;
1835
+ tiers: Tier[];
1836
+ };
1837
+
1838
+ declare type PatreonError = {
1839
+ challenge_metadata?: string | null;
1840
+ code?: number;
1841
+ code_name?: string;
1842
+ detail?: string;
1843
+ id: string;
1844
+ status: string;
1845
+ title?: string;
1846
+ };
1847
+
1848
+ export declare type PatreonUserAuth = {
1849
+ access_token: string;
1850
+ refresh_token: string;
1851
+ expires_in: number;
1852
+ token_type?: string;
1853
+ scope?: string;
1854
+ version?: string;
1855
+ };
1856
+
1857
+ export declare type PatreonUserResponse = {
1858
+ data: Data;
1859
+ included: IncludedItem[];
1860
+ links: Links;
1861
+ errors?: PatreonError[];
1862
+ };
1863
+
1784
1864
  /**
1785
1865
  * @public
1786
1866
  */
@@ -1881,11 +1961,11 @@ export declare type PlayerConfig = {
1881
1961
  */
1882
1962
  adService?: {
1883
1963
  /**
1884
- * Tivio - can be used in websites and TV apps. Does not support VPAID
1964
+ * TIVIO AD SERVICE - can be used in websites and TV apps. Does not support VPAID
1885
1965
  * IMA - can be used only in websites. Supports VAST 2, partially VAST 3, VAST 4, SIMID 1.0, OM SDK 1.3,
1886
1966
  * VPAID 2 (HTML5) https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/compatibility
1887
1967
  */
1888
- name: 'IMA SDK' | 'Tivio';
1968
+ name: 'IMA SDK' | 'TIVIO AD SERVICE';
1889
1969
  };
1890
1970
  };
1891
1971
 
@@ -2005,6 +2085,11 @@ export declare interface PlayerEngineInterface {
2005
2085
  destroy(): Promise<void>;
2006
2086
  getBufferedInfo?(): BufferChunk[];
2007
2087
  lastQuality: number | null;
2088
+ /**
2089
+ * Attribute indicating that the video is to be played "inline"
2090
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#playsinline
2091
+ */
2092
+ setPlaysInline(value: boolean): void;
2008
2093
  }
2009
2094
 
2010
2095
  /**
@@ -2079,6 +2164,11 @@ export declare interface PlayerInterface {
2079
2164
  */
2080
2165
  getNativeImaAdUrl?: () => string | null;
2081
2166
  lastQuality?: number | null;
2167
+ /**
2168
+ * Attribute indicating that the video is to be played "inline"
2169
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#playsinline
2170
+ */
2171
+ setPlaysInline?: (value: boolean) => void;
2082
2172
  }
2083
2173
 
2084
2174
  /**
@@ -2338,10 +2428,9 @@ export declare type Purchase = {
2338
2428
  * Timestamp of the last purchase status update in milliseconds.
2339
2429
  */
2340
2430
  updated: number | null;
2341
- video: Video | null;
2342
2431
  videoId: string | null;
2343
2432
  videoRef: any | null;
2344
- voucherId?: string;
2433
+ voucherId: string | null;
2345
2434
  };
2346
2435
 
2347
2436
  /**
@@ -2352,7 +2441,8 @@ export declare enum PurchaseDocumentGateway {
2352
2441
  'oktagon' = "oktagon",
2353
2442
  'voucher' = "voucher",
2354
2443
  'comgate' = "comgate",
2355
- 'tivio' = "tivio"
2444
+ 'tivio' = "tivio",
2445
+ 'patreon' = "patreon"
2356
2446
  }
2357
2447
 
2358
2448
  /**
@@ -2495,14 +2585,14 @@ export declare type PurchaseMonetization = {
2495
2585
  period?: number;
2496
2586
  price?: number;
2497
2587
  /**
2498
- * Here are only transaction and subscription, because purchasing of advertisement monetization doesn't make sense.
2588
+ * Here are only transaction and subscription because purchasing of advertisement monetization doesn't make sense.
2499
2589
  */
2500
2590
  type: 'transaction' | 'subscription';
2501
2591
  title?: string;
2502
2592
  frequency?: MONETIZATION_FREQUENCY | null;
2503
2593
  /**
2504
- * If set, purchase (subscription) activated by voucher will stay valid for this amount of seconds.
2505
- * Otherwise, purchase will be valid for one "monetization frequency" period.
2594
+ * If set purchase (subscription) activated by voucher will stay valid for this amount of seconds.
2595
+ * Otherwise purchase will be valid for one "monetization frequency" period.
2506
2596
  */
2507
2597
  voucherPurchaseDuration?: number;
2508
2598
  };
@@ -2518,27 +2608,11 @@ export declare enum PurchaseStatus {
2518
2608
  /**
2519
2609
  * Used when purchase is terminated due to terms and conditions violation (e.g. restreaming).
2520
2610
  */
2521
- BLOCKED = "BLOCKED",
2522
- /**
2523
- * Used in subscription purchases when subscription is renewed.
2524
- */
2525
- RENEWED = "RENEWED",
2526
- /**
2527
- * From NEW to ABORTED when user cancels purchase before payment or when payment fails.
2528
- */
2529
- ABORTED = "ABORTED",
2530
- /**
2531
- * When user manually cancels purchase but still has access to content until expiration date.
2532
- */
2533
- CANCELLING = "CANCELLING",
2534
- /**
2535
- * From PAID to EXPIRED when payment fails to renew subscription.
2536
- */
2537
- EXPIRED = "EXPIRED"
2611
+ BLOCKED = "BLOCKED"
2538
2612
  }
2539
2613
 
2540
2614
  /**
2541
- * Purchase is a purchase of one video (transaction type), purchase of subscription or voucher.
2615
+ * Purchase is a purchase of one video (transaction type) purchase of subscription or voucher.
2542
2616
  *
2543
2617
  * @public
2544
2618
  */
@@ -2639,6 +2713,12 @@ export declare enum RegistrationRedirect {
2639
2713
  PAYMENT = "payment"
2640
2714
  }
2641
2715
 
2716
+ declare type Relationship = {
2717
+ memberships: {
2718
+ data: Membership[];
2719
+ };
2720
+ };
2721
+
2642
2722
  /**
2643
2723
  * @public
2644
2724
  */
@@ -2657,6 +2737,24 @@ export declare type RemoteProviderProps = {
2657
2737
  children: React_2.ReactNode;
2658
2738
  };
2659
2739
 
2740
+ /**
2741
+ * Conditions that are dynamically applied to screens before they are rendered.
2742
+ * eg. when we want to render an embed only if certain conditions are met.
2743
+ * 'type' indicates type of the condition, eg. 'subscribed'.
2744
+ * 'else' indicates what should happen if the conditions are not met.
2745
+ * 'elseValue' is a payload.
2746
+ */
2747
+ export declare type RenderCondition = {
2748
+ type: ScreenConditionType;
2749
+ else: ScreenConditionElse;
2750
+ elseValue: RenderConditionElseValue[];
2751
+ };
2752
+
2753
+ export declare type RenderConditionElseValue = {
2754
+ key: string;
2755
+ value: string;
2756
+ };
2757
+
2660
2758
  /**
2661
2759
  * @public
2662
2760
  */
@@ -2874,6 +2972,14 @@ declare interface Screen_2 {
2874
2972
  }
2875
2973
  export { Screen_2 as Screen }
2876
2974
 
2975
+ export declare enum ScreenConditionElse {
2976
+ SET_QUERY_PARAMS = "setQueryParams"
2977
+ }
2978
+
2979
+ export declare enum ScreenConditionType {
2980
+ SUBSCRIBED = "subscribed"
2981
+ }
2982
+
2877
2983
  /**
2878
2984
  * @public
2879
2985
  */
@@ -3140,6 +3246,19 @@ export declare interface Tag extends RowItem {
3140
3246
  */
3141
3247
  export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber' | 'contentType' | DefaultOrderByField;
3142
3248
 
3249
+ export declare type Tier = {
3250
+ attributes: {
3251
+ amount_cents: number;
3252
+ description: string;
3253
+ image_url: string | null;
3254
+ patron_count: number;
3255
+ title: string;
3256
+ url: string;
3257
+ };
3258
+ id: string;
3259
+ type: 'tier';
3260
+ };
3261
+
3143
3262
  /**
3144
3263
  * @public
3145
3264
  */
@@ -3424,9 +3543,6 @@ export declare type TivioInternalHooks = {
3424
3543
  useConfirmationOverlay: () => ConfirmationOverlayContextState;
3425
3544
  useMonetizationActions: () => MonetizationActions;
3426
3545
  useCancelSubscriptions: () => UseCancelSubscriptionsResult;
3427
- usePurchasesWithVideos: () => {
3428
- purchases: Purchase[];
3429
- };
3430
3546
  useEpisodes: (seriesTagId: string | null | undefined, seasonNumber: number | null, options: UseEpisodesQueryOptions) => UseEpisodesResult;
3431
3547
  useVideosInScreen: (filters: RowFilterField) => {
3432
3548
  pagination: PaginationInterface<Video> | null;
@@ -4046,21 +4162,17 @@ export declare function usePurchaseRecovery(): {
4046
4162
  */
4047
4163
  export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
4048
4164
 
4049
- /**
4050
- * Return purchases with initialized video (purchases[i].video not null)
4051
- * @public
4052
- */
4053
- export declare const usePurchasesWithVideos: () => {
4054
- purchases: Purchase[];
4055
- };
4056
-
4057
4165
  /**
4058
4166
  * @public
4059
4167
  */
4060
4168
  export declare type User = {
4061
4169
  /**
4062
- * Returns "active" (non-expired) purchases, so they give access to some content.
4063
- * Does not return voucher purchases, because they give access to videos/subscriptions only for user who activates voucher,
4170
+ * Unique id of the corresponding user document.
4171
+ */
4172
+ id: string;
4173
+ /**
4174
+ * Returns "active" (non-expired) purchases so they give access to some content.
4175
+ * Does not return voucher purchases because they give access to videos/subscriptions only for user who activates voucher
4064
4176
  * not for user who purchases it.
4065
4177
  */
4066
4178
  purchases: Purchase[];
@@ -4080,6 +4192,7 @@ export declare type User = {
4080
4192
  * Returns last expired subscription which user can renew or undefined
4081
4193
  */
4082
4194
  extendableSubscription?: Purchase;
4195
+ getPurchasedVideos: () => Video[];
4083
4196
  isPurchasesInitialized: boolean;
4084
4197
  isSignedIn: boolean;
4085
4198
  isReady: boolean;
@@ -4087,11 +4200,15 @@ export declare type User = {
4087
4200
  type?: UserType;
4088
4201
  photoURL: string | null;
4089
4202
  name?: string;
4203
+ /**
4204
+ * Authentication id differs from {@link id}.
4205
+ */
4090
4206
  authUserId?: string;
4091
4207
  favorites: any[];
4092
4208
  watchedPositions: any[];
4093
4209
  profiles: any[];
4094
4210
  activeUserProfileId: string | null;
4211
+ patreon?: PatreonUserAuth;
4095
4212
  createUserProfile: (request: any) => Promise<void>;
4096
4213
  deleteUserProfile: (profileId: string) => Promise<void>;
4097
4214
  setActiveUserProfileId: (id: string) => void;
@@ -4214,6 +4331,17 @@ export declare type UseTvChannel = (tvChannelId: string) => {
4214
4331
  loading: boolean;
4215
4332
  };
4216
4333
 
4334
+ /**
4335
+ * Use Tv channel
4336
+ * @param tvChannelId
4337
+ * @public
4338
+ */
4339
+ export declare const useTvChannel: (tvChannelId: string) => {
4340
+ tvChannel: TvChannel | null;
4341
+ error: Error | null;
4342
+ loading: boolean;
4343
+ } | undefined;
4344
+
4217
4345
  /**
4218
4346
  * @public
4219
4347
  */
@@ -4275,7 +4403,8 @@ export declare enum VastProvider {
4275
4403
  GARAZ_TV = "garaz.tv",
4276
4404
  GARAZ_TV_DEV = "garaz.tv.dev",
4277
4405
  IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
4278
- JOJ = "joj",
4406
+ JOJ_ADFORM = "joj",
4407
+ JOJ_SMART = "joj-smart",
4279
4408
  JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
4280
4409
  JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
4281
4410
  JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",