@tivio/sdk-react 7.2.0-alpha.0 → 7.2.0-alpha.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.
@@ -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
 
@@ -747,21 +758,25 @@ export declare type Currency = 'CZK' | 'EUR' | 'USD';
747
758
  * @public
748
759
  */
749
760
  export declare enum CustomerId {
750
- OKTAGON = "OKTAGON",
751
- JOJ = "JOJ",
752
- MALL = "MALL",
753
- GARAZ = "GARAZ",
754
- U_KULATEHO_STOLU = "U_KULATEHO_STOLU",
755
- INVESTOREES = "INVESTOREES",
761
+ CNC = "CNC",
756
762
  DVTV = "DVTV",
757
763
  DVTV_DEV = "DVTV_DEV",
758
- O2 = "O2",
764
+ GARAZ = "GARAZ",
759
765
  GRAPE = "GRAPE",
760
- TIVIO = "TIVIO",
761
- STORYBOOK = "STORYBOOK",
766
+ HODINA_DEJEPICHU = "HODINA_DEJEPICHU",
767
+ INVESTICNI_PRUVODCE = "INVESTICNI_PRUVODCE",
768
+ INVESTOREES = "INVESTOREES",
769
+ JOJ = "JOJ",
770
+ MALL = "MALL",
771
+ MEDIAR = "MEDIAR",
762
772
  NANGU_DEV = "NANGU_DEV",
763
- CNC = "CNC",
764
- VOJTA_ZIZKA = "VOJTA_ZIZKA"
773
+ O2 = "O2",
774
+ OKTAGON = "OKTAGON",
775
+ ONDREJ_KOBERSKY = "ONDREJ_KOBERSKY",
776
+ STARMAX = "STARMAX",
777
+ STORYBOOK = "STORYBOOK",
778
+ TIVIO = "TIVIO",
779
+ U_KULATEHO_STOLU = "U_KULATEHO_STOLU"
765
780
  }
766
781
 
767
782
  /**
@@ -910,6 +925,13 @@ export declare interface Cutout {
910
925
  endMs: number;
911
926
  }
912
927
 
928
+ declare type Data = {
929
+ attributes: Attributes;
930
+ id: string;
931
+ relationships: Relationship;
932
+ type: 'tier' | 'member' | 'user';
933
+ };
934
+
913
935
  /**
914
936
  * @public
915
937
  */
@@ -1096,7 +1118,7 @@ export declare interface EmailTemplateVersion {
1096
1118
 
1097
1119
  export declare type EmbedScreenMessageNavigateType = {
1098
1120
  type: EmbedScreenMessageType.NAVIGATE;
1099
- to: string | 'Profile' | 'Home' | 'Search' | 'Video' | 'Series';
1121
+ to: string | 'Profile' | 'Home' | 'Search' | 'Video' | 'Series' | 'Subscription';
1100
1122
  value?: string;
1101
1123
  };
1102
1124
 
@@ -1372,6 +1394,24 @@ export declare enum GRID_TYPES {
1372
1394
  SERIES = "SERIES"
1373
1395
  }
1374
1396
 
1397
+ declare type IncludedItem = {
1398
+ attributes: {
1399
+ next_charge_date: string;
1400
+ /**
1401
+ * A null value indicates the member has never pledged. Can be null.
1402
+ */
1403
+ patron_status: 'active_patron' | 'declined_patron' | 'former_patron' | null;
1404
+ /**
1405
+ * The only successful status is Paid. null if never charged. Can be null.
1406
+ * One of Paid Declined Deleted Pending Refunded Fraud Other.
1407
+ */
1408
+ last_charge_status: 'Paid' | 'Declined' | 'Deleted' | 'Pending' | 'Refunded' | 'Fraud' | 'Other';
1409
+ last_charge_date: string;
1410
+ };
1411
+ id: string;
1412
+ type: string;
1413
+ };
1414
+
1375
1415
  /**
1376
1416
  * @public
1377
1417
  */
@@ -1575,6 +1615,10 @@ export declare type LinkedVideo = {
1575
1615
  type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD';
1576
1616
  };
1577
1617
 
1618
+ declare type Links = {
1619
+ self: string;
1620
+ };
1621
+
1578
1622
  /**
1579
1623
  * @public
1580
1624
  */
@@ -1707,6 +1751,11 @@ export declare type MarkersProps = {
1707
1751
  className?: string;
1708
1752
  };
1709
1753
 
1754
+ declare type Membership = {
1755
+ id: string;
1756
+ type: string;
1757
+ };
1758
+
1710
1759
  /**
1711
1760
  * External information of video migrated via our Public API.
1712
1761
  * @public
@@ -1962,6 +2011,37 @@ export declare type PaginationOptions = Partial<{
1962
2011
  noAutoFetch: boolean;
1963
2012
  }>;
1964
2013
 
2014
+ export declare type PatreonCreatorData = {
2015
+ campaign: string;
2016
+ tiers: Tier[];
2017
+ };
2018
+
2019
+ declare type PatreonError = {
2020
+ challenge_metadata?: string | null;
2021
+ code?: number;
2022
+ code_name?: string;
2023
+ detail?: string;
2024
+ id: string;
2025
+ status: string;
2026
+ title?: string;
2027
+ };
2028
+
2029
+ export declare type PatreonUserAuth = {
2030
+ access_token: string;
2031
+ refresh_token: string;
2032
+ expires_in: number;
2033
+ token_type?: string;
2034
+ scope?: string;
2035
+ version?: string;
2036
+ };
2037
+
2038
+ export declare type PatreonUserResponse = {
2039
+ data: Data;
2040
+ included: IncludedItem[];
2041
+ links: Links;
2042
+ errors?: PatreonError[];
2043
+ };
2044
+
1965
2045
  /**
1966
2046
  * @public
1967
2047
  */
@@ -2062,11 +2142,11 @@ export declare type PlayerConfig = {
2062
2142
  */
2063
2143
  adService?: {
2064
2144
  /**
2065
- * Tivio - can be used in websites and TV apps. Does not support VPAID
2145
+ * TIVIO AD SERVICE - can be used in websites and TV apps. Does not support VPAID
2066
2146
  * IMA - can be used only in websites. Supports VAST 2, partially VAST 3, VAST 4, SIMID 1.0, OM SDK 1.3,
2067
2147
  * VPAID 2 (HTML5) https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/compatibility
2068
2148
  */
2069
- name: 'IMA SDK' | 'Tivio';
2149
+ name: 'IMA SDK' | 'TIVIO AD SERVICE';
2070
2150
  };
2071
2151
  };
2072
2152
 
@@ -2186,6 +2266,11 @@ export declare interface PlayerEngineInterface {
2186
2266
  destroy(): Promise<void>;
2187
2267
  getBufferedInfo?(): BufferChunk[];
2188
2268
  lastQuality: number | null;
2269
+ /**
2270
+ * Attribute indicating that the video is to be played "inline"
2271
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#playsinline
2272
+ */
2273
+ setPlaysInline(value: boolean): void;
2189
2274
  }
2190
2275
 
2191
2276
  /**
@@ -2260,6 +2345,11 @@ export declare interface PlayerInterface {
2260
2345
  */
2261
2346
  getNativeImaAdUrl?: () => string | null;
2262
2347
  lastQuality?: number | null;
2348
+ /**
2349
+ * Attribute indicating that the video is to be played "inline"
2350
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#playsinline
2351
+ */
2352
+ setPlaysInline?: (value: boolean) => void;
2263
2353
  }
2264
2354
 
2265
2355
  /**
@@ -2519,10 +2609,9 @@ export declare type Purchase = {
2519
2609
  * Timestamp of the last purchase status update in milliseconds.
2520
2610
  */
2521
2611
  updated: number | null;
2522
- video: Video | null;
2523
2612
  videoId: string | null;
2524
2613
  videoRef: any | null;
2525
- voucherId?: string;
2614
+ voucherId: string | null;
2526
2615
  };
2527
2616
 
2528
2617
  /**
@@ -2533,7 +2622,8 @@ export declare enum PurchaseDocumentGateway {
2533
2622
  'oktagon' = "oktagon",
2534
2623
  'voucher' = "voucher",
2535
2624
  'comgate' = "comgate",
2536
- 'tivio' = "tivio"
2625
+ 'tivio' = "tivio",
2626
+ 'patreon' = "patreon"
2537
2627
  }
2538
2628
 
2539
2629
  /**
@@ -2676,14 +2766,14 @@ export declare type PurchaseMonetization = {
2676
2766
  period?: number;
2677
2767
  price?: number;
2678
2768
  /**
2679
- * Here are only transaction and subscription, because purchasing of advertisement monetization doesn't make sense.
2769
+ * Here are only transaction and subscription because purchasing of advertisement monetization doesn't make sense.
2680
2770
  */
2681
2771
  type: 'transaction' | 'subscription';
2682
2772
  title?: string;
2683
2773
  frequency?: MONETIZATION_FREQUENCY | null;
2684
2774
  /**
2685
- * If set, purchase (subscription) activated by voucher will stay valid for this amount of seconds.
2686
- * Otherwise, purchase will be valid for one "monetization frequency" period.
2775
+ * If set purchase (subscription) activated by voucher will stay valid for this amount of seconds.
2776
+ * Otherwise purchase will be valid for one "monetization frequency" period.
2687
2777
  */
2688
2778
  voucherPurchaseDuration?: number;
2689
2779
  };
@@ -2699,27 +2789,11 @@ export declare enum PurchaseStatus {
2699
2789
  /**
2700
2790
  * Used when purchase is terminated due to terms and conditions violation (e.g. restreaming).
2701
2791
  */
2702
- BLOCKED = "BLOCKED",
2703
- /**
2704
- * Used in subscription purchases when subscription is renewed.
2705
- */
2706
- RENEWED = "RENEWED",
2707
- /**
2708
- * From NEW to ABORTED when user cancels purchase before payment or when payment fails.
2709
- */
2710
- ABORTED = "ABORTED",
2711
- /**
2712
- * When user manually cancels purchase but still has access to content until expiration date.
2713
- */
2714
- CANCELLING = "CANCELLING",
2715
- /**
2716
- * From PAID to EXPIRED when payment fails to renew subscription.
2717
- */
2718
- EXPIRED = "EXPIRED"
2792
+ BLOCKED = "BLOCKED"
2719
2793
  }
2720
2794
 
2721
2795
  /**
2722
- * Purchase is a purchase of one video (transaction type), purchase of subscription or voucher.
2796
+ * Purchase is a purchase of one video (transaction type) purchase of subscription or voucher.
2723
2797
  *
2724
2798
  * @public
2725
2799
  */
@@ -2820,6 +2894,12 @@ export declare enum RegistrationRedirect {
2820
2894
  PAYMENT = "payment"
2821
2895
  }
2822
2896
 
2897
+ declare type Relationship = {
2898
+ memberships: {
2899
+ data: Membership[];
2900
+ };
2901
+ };
2902
+
2823
2903
  /**
2824
2904
  * @public
2825
2905
  */
@@ -2838,6 +2918,24 @@ export declare type RemoteProviderProps = {
2838
2918
  children: React_2.ReactNode;
2839
2919
  };
2840
2920
 
2921
+ /**
2922
+ * Conditions that are dynamically applied to screens before they are rendered.
2923
+ * eg. when we want to render an embed only if certain conditions are met.
2924
+ * 'type' indicates type of the condition, eg. 'subscribed'.
2925
+ * 'else' indicates what should happen if the conditions are not met.
2926
+ * 'elseValue' is a payload.
2927
+ */
2928
+ export declare type RenderCondition = {
2929
+ type: ScreenConditionType;
2930
+ else: ScreenConditionElse;
2931
+ elseValue: RenderConditionElseValue[];
2932
+ };
2933
+
2934
+ export declare type RenderConditionElseValue = {
2935
+ key: string;
2936
+ value: string;
2937
+ };
2938
+
2841
2939
  /**
2842
2940
  * Makes optional attributes in given type to be required and nullable.
2843
2941
  * e.g. will make `attribute?: string` to be `attribute: string | null`
@@ -3064,6 +3162,14 @@ declare interface Screen_2 {
3064
3162
  }
3065
3163
  export { Screen_2 as Screen }
3066
3164
 
3165
+ export declare enum ScreenConditionElse {
3166
+ SET_QUERY_PARAMS = "setQueryParams"
3167
+ }
3168
+
3169
+ export declare enum ScreenConditionType {
3170
+ SUBSCRIBED = "subscribed"
3171
+ }
3172
+
3067
3173
  /**
3068
3174
  * @public
3069
3175
  */
@@ -3330,6 +3436,19 @@ export declare interface Tag extends RowItem {
3330
3436
  */
3331
3437
  export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber' | 'contentType' | DefaultOrderByField;
3332
3438
 
3439
+ export declare type Tier = {
3440
+ attributes: {
3441
+ amount_cents: number;
3442
+ description: string;
3443
+ image_url: string | null;
3444
+ patron_count: number;
3445
+ title: string;
3446
+ url: string;
3447
+ };
3448
+ id: string;
3449
+ type: 'tier';
3450
+ };
3451
+
3333
3452
  /**
3334
3453
  * @internal
3335
3454
  */
@@ -3685,9 +3804,6 @@ export declare type TivioInternalHooks = {
3685
3804
  useConfirmationOverlay: () => ConfirmationOverlayContextState;
3686
3805
  useMonetizationActions: () => MonetizationActions;
3687
3806
  useCancelSubscriptions: () => UseCancelSubscriptionsResult;
3688
- usePurchasesWithVideos: () => {
3689
- purchases: Purchase[];
3690
- };
3691
3807
  useEpisodes: (seriesTagId: string | null | undefined, seasonNumber: number | null, options: UseEpisodesQueryOptions) => UseEpisodesResult;
3692
3808
  useVideosInScreen: (filters: RowFilterField) => {
3693
3809
  pagination: PaginationInterface<Video> | null;
@@ -4315,21 +4431,17 @@ export declare function usePurchaseRecovery(): {
4315
4431
  */
4316
4432
  export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
4317
4433
 
4318
- /**
4319
- * Return purchases with initialized video (purchases[i].video not null)
4320
- * @public
4321
- */
4322
- export declare const usePurchasesWithVideos: () => {
4323
- purchases: Purchase[];
4324
- };
4325
-
4326
4434
  /**
4327
4435
  * @public
4328
4436
  */
4329
4437
  export declare type User = {
4330
4438
  /**
4331
- * Returns "active" (non-expired) purchases, so they give access to some content.
4332
- * Does not return voucher purchases, because they give access to videos/subscriptions only for user who activates voucher,
4439
+ * Unique id of the corresponding user document.
4440
+ */
4441
+ id: string;
4442
+ /**
4443
+ * Returns "active" (non-expired) purchases so they give access to some content.
4444
+ * Does not return voucher purchases because they give access to videos/subscriptions only for user who activates voucher
4333
4445
  * not for user who purchases it.
4334
4446
  */
4335
4447
  purchases: Purchase[];
@@ -4349,6 +4461,7 @@ export declare type User = {
4349
4461
  * Returns last expired subscription which user can renew or undefined
4350
4462
  */
4351
4463
  extendableSubscription?: Purchase;
4464
+ getPurchasedVideos: () => Video[];
4352
4465
  isPurchasesInitialized: boolean;
4353
4466
  isSignedIn: boolean;
4354
4467
  isReady: boolean;
@@ -4356,11 +4469,15 @@ export declare type User = {
4356
4469
  type?: UserType;
4357
4470
  photoURL: string | null;
4358
4471
  name?: string;
4472
+ /**
4473
+ * Authentication id differs from {@link id}.
4474
+ */
4359
4475
  authUserId?: string;
4360
4476
  favorites: any[];
4361
4477
  watchedPositions: any[];
4362
4478
  profiles: any[];
4363
4479
  activeUserProfileId: string | null;
4480
+ patreon?: PatreonUserAuth;
4364
4481
  createUserProfile: (request: any) => Promise<void>;
4365
4482
  deleteUserProfile: (profileId: string) => Promise<void>;
4366
4483
  setActiveUserProfileId: (id: string) => void;
@@ -4483,6 +4600,17 @@ export declare type UseTvChannel = (tvChannelId: string) => {
4483
4600
  loading: boolean;
4484
4601
  };
4485
4602
 
4603
+ /**
4604
+ * Use Tv channel
4605
+ * @param tvChannelId
4606
+ * @public
4607
+ */
4608
+ export declare const useTvChannel: (tvChannelId: string) => {
4609
+ tvChannel: TvChannel | null;
4610
+ error: Error | null;
4611
+ loading: boolean;
4612
+ } | undefined;
4613
+
4486
4614
  /**
4487
4615
  * @public
4488
4616
  */
@@ -4544,7 +4672,8 @@ export declare enum VastProvider {
4544
4672
  GARAZ_TV = "garaz.tv",
4545
4673
  GARAZ_TV_DEV = "garaz.tv.dev",
4546
4674
  IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
4547
- JOJ = "joj",
4675
+ JOJ_ADFORM = "joj",
4676
+ JOJ_SMART = "joj-smart",
4548
4677
  JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
4549
4678
  JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
4550
4679
  JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "7.2.0-alpha.0",
3
+ "version": "7.2.0-alpha.1",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -26,6 +26,7 @@
26
26
  "typesRollup": "yarn ts-node ./scripts/typesRollup.ts"
27
27
  },
28
28
  "peerDependencies": {
29
+ "@types/react": "17.x || 18.x",
29
30
  "react": "17.x || 18.x",
30
31
  "react-dom": "17.x || 18.x"
31
32
  },
@@ -33,15 +34,15 @@
33
34
  "@material-ui/core": "^4.11.2",
34
35
  "@material-ui/icons": "^4.11.2",
35
36
  "@sentry/browser": "^6.1.0",
36
- "@tivio/common": "1.1.114",
37
+ "@tivio/common": "1.1.115",
37
38
  "dayjs": "^1.11.0",
38
39
  "es7-object-polyfill": "^1.0.1",
39
40
  "firebase": "8.10.1",
40
41
  "formik": "^2.2.7",
41
- "i18next": "^19.8.4",
42
+ "i18next": "^20.1.0",
42
43
  "mobx": "^6.0.4",
43
44
  "mobx-react": "^7.1.0",
44
- "react-i18next": "^9.0.10",
45
+ "react-i18next": "^13.0.1",
45
46
  "react-router-dom": "^5.3.4",
46
47
  "react-spring": "^9.2.4",
47
48
  "react-virtualized": "^9.22.3",