@tivio/sdk-react 7.1.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.
- package/README.md +4 -0
- package/README.md.bak +4 -0
- package/dist/index.d.ts +170 -36
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +170 -36
- package/package.json +3 -2
package/README.md
CHANGED
@@ -6,6 +6,10 @@ 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
|
+
|
9
13
|
* 7.1.0
|
10
14
|
* minor: export useTvChannelHook
|
11
15
|
* patch: bump "react-i18next", "i18next" versions.
|
package/README.md.bak
CHANGED
@@ -6,6 +6,10 @@ 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
|
+
|
9
13
|
* 7.1.0
|
10
14
|
* minor: export useTvChannelHook
|
11
15
|
* patch: bump "react-i18next", "i18next" versions.
|
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
|
-
|
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
|
-
|
738
|
+
GARAZ = "GARAZ",
|
733
739
|
GRAPE = "GRAPE",
|
734
|
-
|
735
|
-
|
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
|
-
|
738
|
-
|
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
|
-
*
|
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' | '
|
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
|
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
|
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
|
2505
|
-
* Otherwise
|
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
|
};
|
@@ -2522,7 +2612,7 @@ export declare enum PurchaseStatus {
|
|
2522
2612
|
}
|
2523
2613
|
|
2524
2614
|
/**
|
2525
|
-
* Purchase is a purchase of one video (transaction type)
|
2615
|
+
* Purchase is a purchase of one video (transaction type) purchase of subscription or voucher.
|
2526
2616
|
*
|
2527
2617
|
* @public
|
2528
2618
|
*/
|
@@ -2623,6 +2713,12 @@ export declare enum RegistrationRedirect {
|
|
2623
2713
|
PAYMENT = "payment"
|
2624
2714
|
}
|
2625
2715
|
|
2716
|
+
declare type Relationship = {
|
2717
|
+
memberships: {
|
2718
|
+
data: Membership[];
|
2719
|
+
};
|
2720
|
+
};
|
2721
|
+
|
2626
2722
|
/**
|
2627
2723
|
* @public
|
2628
2724
|
*/
|
@@ -2641,6 +2737,24 @@ export declare type RemoteProviderProps = {
|
|
2641
2737
|
children: React_2.ReactNode;
|
2642
2738
|
};
|
2643
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
|
+
|
2644
2758
|
/**
|
2645
2759
|
* @public
|
2646
2760
|
*/
|
@@ -2858,6 +2972,14 @@ declare interface Screen_2 {
|
|
2858
2972
|
}
|
2859
2973
|
export { Screen_2 as Screen }
|
2860
2974
|
|
2975
|
+
export declare enum ScreenConditionElse {
|
2976
|
+
SET_QUERY_PARAMS = "setQueryParams"
|
2977
|
+
}
|
2978
|
+
|
2979
|
+
export declare enum ScreenConditionType {
|
2980
|
+
SUBSCRIBED = "subscribed"
|
2981
|
+
}
|
2982
|
+
|
2861
2983
|
/**
|
2862
2984
|
* @public
|
2863
2985
|
*/
|
@@ -3124,6 +3246,19 @@ export declare interface Tag extends RowItem {
|
|
3124
3246
|
*/
|
3125
3247
|
export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber' | 'contentType' | DefaultOrderByField;
|
3126
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
|
+
|
3127
3262
|
/**
|
3128
3263
|
* @public
|
3129
3264
|
*/
|
@@ -3408,9 +3543,6 @@ export declare type TivioInternalHooks = {
|
|
3408
3543
|
useConfirmationOverlay: () => ConfirmationOverlayContextState;
|
3409
3544
|
useMonetizationActions: () => MonetizationActions;
|
3410
3545
|
useCancelSubscriptions: () => UseCancelSubscriptionsResult;
|
3411
|
-
usePurchasesWithVideos: () => {
|
3412
|
-
purchases: Purchase[];
|
3413
|
-
};
|
3414
3546
|
useEpisodes: (seriesTagId: string | null | undefined, seasonNumber: number | null, options: UseEpisodesQueryOptions) => UseEpisodesResult;
|
3415
3547
|
useVideosInScreen: (filters: RowFilterField) => {
|
3416
3548
|
pagination: PaginationInterface<Video> | null;
|
@@ -4030,21 +4162,17 @@ export declare function usePurchaseRecovery(): {
|
|
4030
4162
|
*/
|
4031
4163
|
export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
|
4032
4164
|
|
4033
|
-
/**
|
4034
|
-
* Return purchases with initialized video (purchases[i].video not null)
|
4035
|
-
* @public
|
4036
|
-
*/
|
4037
|
-
export declare const usePurchasesWithVideos: () => {
|
4038
|
-
purchases: Purchase[];
|
4039
|
-
};
|
4040
|
-
|
4041
4165
|
/**
|
4042
4166
|
* @public
|
4043
4167
|
*/
|
4044
4168
|
export declare type User = {
|
4045
4169
|
/**
|
4046
|
-
*
|
4047
|
-
|
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
|
4048
4176
|
* not for user who purchases it.
|
4049
4177
|
*/
|
4050
4178
|
purchases: Purchase[];
|
@@ -4064,6 +4192,7 @@ export declare type User = {
|
|
4064
4192
|
* Returns last expired subscription which user can renew or undefined
|
4065
4193
|
*/
|
4066
4194
|
extendableSubscription?: Purchase;
|
4195
|
+
getPurchasedVideos: () => Video[];
|
4067
4196
|
isPurchasesInitialized: boolean;
|
4068
4197
|
isSignedIn: boolean;
|
4069
4198
|
isReady: boolean;
|
@@ -4071,11 +4200,15 @@ export declare type User = {
|
|
4071
4200
|
type?: UserType;
|
4072
4201
|
photoURL: string | null;
|
4073
4202
|
name?: string;
|
4203
|
+
/**
|
4204
|
+
* Authentication id differs from {@link id}.
|
4205
|
+
*/
|
4074
4206
|
authUserId?: string;
|
4075
4207
|
favorites: any[];
|
4076
4208
|
watchedPositions: any[];
|
4077
4209
|
profiles: any[];
|
4078
4210
|
activeUserProfileId: string | null;
|
4211
|
+
patreon?: PatreonUserAuth;
|
4079
4212
|
createUserProfile: (request: any) => Promise<void>;
|
4080
4213
|
deleteUserProfile: (profileId: string) => Promise<void>;
|
4081
4214
|
setActiveUserProfileId: (id: string) => void;
|
@@ -4270,7 +4403,8 @@ export declare enum VastProvider {
|
|
4270
4403
|
GARAZ_TV = "garaz.tv",
|
4271
4404
|
GARAZ_TV_DEV = "garaz.tv.dev",
|
4272
4405
|
IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
|
4273
|
-
|
4406
|
+
JOJ_ADFORM = "joj",
|
4407
|
+
JOJ_SMART = "joj-smart",
|
4274
4408
|
JOJ_AD_MANAGER_VOD_PREROLL = "joj-ad-manager-vod-preroll",
|
4275
4409
|
JOJ_AD_MANAGER_VOD_MIDROLL = "joj-ad-manager-vod-midroll",
|
4276
4410
|
JOJ_AD_MANAGER_LIVE_PREROLL = "joj-ad-manager-live-preroll",
|