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

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
  };
@@ -2703,7 +2793,7 @@ export declare enum PurchaseStatus {
2703
2793
  }
2704
2794
 
2705
2795
  /**
2706
- * 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.
2707
2797
  *
2708
2798
  * @public
2709
2799
  */
@@ -2804,6 +2894,12 @@ export declare enum RegistrationRedirect {
2804
2894
  PAYMENT = "payment"
2805
2895
  }
2806
2896
 
2897
+ declare type Relationship = {
2898
+ memberships: {
2899
+ data: Membership[];
2900
+ };
2901
+ };
2902
+
2807
2903
  /**
2808
2904
  * @public
2809
2905
  */
@@ -2822,6 +2918,24 @@ export declare type RemoteProviderProps = {
2822
2918
  children: React_2.ReactNode;
2823
2919
  };
2824
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
+
2825
2939
  /**
2826
2940
  * Makes optional attributes in given type to be required and nullable.
2827
2941
  * e.g. will make `attribute?: string` to be `attribute: string | null`
@@ -3048,6 +3162,14 @@ declare interface Screen_2 {
3048
3162
  }
3049
3163
  export { Screen_2 as Screen }
3050
3164
 
3165
+ export declare enum ScreenConditionElse {
3166
+ SET_QUERY_PARAMS = "setQueryParams"
3167
+ }
3168
+
3169
+ export declare enum ScreenConditionType {
3170
+ SUBSCRIBED = "subscribed"
3171
+ }
3172
+
3051
3173
  /**
3052
3174
  * @public
3053
3175
  */
@@ -3314,6 +3436,19 @@ export declare interface Tag extends RowItem {
3314
3436
  */
3315
3437
  export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber' | 'contentType' | DefaultOrderByField;
3316
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
+
3317
3452
  /**
3318
3453
  * @internal
3319
3454
  */
@@ -3669,9 +3804,6 @@ export declare type TivioInternalHooks = {
3669
3804
  useConfirmationOverlay: () => ConfirmationOverlayContextState;
3670
3805
  useMonetizationActions: () => MonetizationActions;
3671
3806
  useCancelSubscriptions: () => UseCancelSubscriptionsResult;
3672
- usePurchasesWithVideos: () => {
3673
- purchases: Purchase[];
3674
- };
3675
3807
  useEpisodes: (seriesTagId: string | null | undefined, seasonNumber: number | null, options: UseEpisodesQueryOptions) => UseEpisodesResult;
3676
3808
  useVideosInScreen: (filters: RowFilterField) => {
3677
3809
  pagination: PaginationInterface<Video> | null;
@@ -4299,21 +4431,17 @@ export declare function usePurchaseRecovery(): {
4299
4431
  */
4300
4432
  export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
4301
4433
 
4302
- /**
4303
- * Return purchases with initialized video (purchases[i].video not null)
4304
- * @public
4305
- */
4306
- export declare const usePurchasesWithVideos: () => {
4307
- purchases: Purchase[];
4308
- };
4309
-
4310
4434
  /**
4311
4435
  * @public
4312
4436
  */
4313
4437
  export declare type User = {
4314
4438
  /**
4315
- * Returns "active" (non-expired) purchases, so they give access to some content.
4316
- * 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
4317
4445
  * not for user who purchases it.
4318
4446
  */
4319
4447
  purchases: Purchase[];
@@ -4333,6 +4461,7 @@ export declare type User = {
4333
4461
  * Returns last expired subscription which user can renew or undefined
4334
4462
  */
4335
4463
  extendableSubscription?: Purchase;
4464
+ getPurchasedVideos: () => Video[];
4336
4465
  isPurchasesInitialized: boolean;
4337
4466
  isSignedIn: boolean;
4338
4467
  isReady: boolean;
@@ -4340,11 +4469,15 @@ export declare type User = {
4340
4469
  type?: UserType;
4341
4470
  photoURL: string | null;
4342
4471
  name?: string;
4472
+ /**
4473
+ * Authentication id differs from {@link id}.
4474
+ */
4343
4475
  authUserId?: string;
4344
4476
  favorites: any[];
4345
4477
  watchedPositions: any[];
4346
4478
  profiles: any[];
4347
4479
  activeUserProfileId: string | null;
4480
+ patreon?: PatreonUserAuth;
4348
4481
  createUserProfile: (request: any) => Promise<void>;
4349
4482
  deleteUserProfile: (profileId: string) => Promise<void>;
4350
4483
  setActiveUserProfileId: (id: string) => void;
@@ -4539,7 +4672,8 @@ export declare enum VastProvider {
4539
4672
  GARAZ_TV = "garaz.tv",
4540
4673
  GARAZ_TV_DEV = "garaz.tv.dev",
4541
4674
  IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
4542
- JOJ = "joj",
4675
+ JOJ_ADFORM = "joj",
4676
+ JOJ_SMART = "joj-smart",
4543
4677
  JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
4544
4678
  JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
4545
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.1.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,7 +34,7 @@
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.113",
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",