@tivio/sdk-react 4.1.0 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +12 -0
- package/README.md.bak +12 -0
- package/dist/index.d.ts +281 -58
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +352 -60
- package/package.json +2 -2
package/dist/sdk-react.d.ts
CHANGED
@@ -55,6 +55,12 @@ export declare type AdMetadata = {
|
|
55
55
|
skip: () => void;
|
56
56
|
} | null;
|
57
57
|
|
58
|
+
/**
|
59
|
+
* @public
|
60
|
+
*/
|
61
|
+
export declare interface AdMonetization extends Monetization {
|
62
|
+
}
|
63
|
+
|
58
64
|
/**
|
59
65
|
* @public
|
60
66
|
*/
|
@@ -156,35 +162,6 @@ export declare type Assets = {
|
|
156
162
|
[assetName: string]: ScalableAsset;
|
157
163
|
};
|
158
164
|
|
159
|
-
/**
|
160
|
-
* @public
|
161
|
-
*/
|
162
|
-
export declare type AuthOverlayPayload = {
|
163
|
-
prefilledData?: {
|
164
|
-
email: string;
|
165
|
-
};
|
166
|
-
/**
|
167
|
-
* "Goto" function (see router.utils.ts) to run after the overlay is closed. Null if no redirect is required.
|
168
|
-
* Defaults to homepage.
|
169
|
-
*/
|
170
|
-
redirectAfterSubmit?: ((...args: any[]) => void) | null;
|
171
|
-
};
|
172
|
-
|
173
|
-
/**
|
174
|
-
* @public
|
175
|
-
*/
|
176
|
-
export declare type AuthOverlayState = {
|
177
|
-
type: AuthOverlayType;
|
178
|
-
closeAuthOverlay: () => void;
|
179
|
-
openAuthOverlay: (type: AuthOverlayType, payload?: AuthOverlayPayload) => void;
|
180
|
-
payload?: AuthOverlayPayload | null;
|
181
|
-
};
|
182
|
-
|
183
|
-
/**
|
184
|
-
* @public
|
185
|
-
*/
|
186
|
-
export declare type AuthOverlayType = 'login' | 'registration' | 'closed' | 'reset-password';
|
187
|
-
|
188
165
|
/**
|
189
166
|
* @public
|
190
167
|
*/
|
@@ -210,6 +187,11 @@ export declare type BadRequestError = Error & {
|
|
210
187
|
};
|
211
188
|
};
|
212
189
|
|
190
|
+
export declare enum BannerItemComponent {
|
191
|
+
CLASSIC = "CLASSIC",
|
192
|
+
SPLITTED = "SPLITTED"
|
193
|
+
}
|
194
|
+
|
213
195
|
/**
|
214
196
|
* @public
|
215
197
|
*/
|
@@ -224,7 +206,7 @@ export declare type BannerProps = {
|
|
224
206
|
cover: string;
|
225
207
|
overlay: boolean;
|
226
208
|
price: string;
|
227
|
-
|
209
|
+
borderRadius?: string | number;
|
228
210
|
buttonText?: string;
|
229
211
|
onButtonClick?: () => void;
|
230
212
|
};
|
@@ -380,6 +362,7 @@ export declare type CreateUserWithEmailAndPassword = (email: string, password: s
|
|
380
362
|
export declare const CURRENCIES: string[];
|
381
363
|
|
382
364
|
/**
|
365
|
+
* Three upper-case letters according to ISO-4217.
|
383
366
|
* @public
|
384
367
|
*/
|
385
368
|
export declare type Currency = 'CZK' | 'EUR' | 'USD';
|
@@ -414,11 +397,60 @@ export declare type Customizations = {
|
|
414
397
|
*/
|
415
398
|
coverWidth: number;
|
416
399
|
fontWeight: string | number;
|
400
|
+
overlayWidth: string | number;
|
401
|
+
text: {
|
402
|
+
width: string;
|
403
|
+
location: 'center' | 'bottom';
|
404
|
+
/**
|
405
|
+
* Font size in px
|
406
|
+
*/
|
407
|
+
fontSize: number;
|
408
|
+
};
|
409
|
+
};
|
410
|
+
Row: {
|
411
|
+
/**
|
412
|
+
* Customizations of Banner component that is used as Row on Customer screen (e.g. WebBannerData)
|
413
|
+
*/
|
414
|
+
Banner: {
|
415
|
+
borderRadius: string | number;
|
416
|
+
};
|
417
|
+
header: {
|
418
|
+
opacity: number;
|
419
|
+
};
|
417
420
|
};
|
418
421
|
Header: {
|
419
422
|
backgroundColor: string;
|
420
423
|
activeLinkUnderlineColor: string;
|
421
424
|
logoHeight: string;
|
425
|
+
borderBottom: string;
|
426
|
+
};
|
427
|
+
VideoDetail: {
|
428
|
+
Banner: {
|
429
|
+
title: {
|
430
|
+
fontSize: string;
|
431
|
+
marginTop: number | string;
|
432
|
+
width: string;
|
433
|
+
};
|
434
|
+
overlays: {
|
435
|
+
left: {
|
436
|
+
width: string;
|
437
|
+
backgroundImage: string;
|
438
|
+
};
|
439
|
+
bottom: {
|
440
|
+
backgroundImage: string;
|
441
|
+
};
|
442
|
+
};
|
443
|
+
};
|
444
|
+
TagsRow: {
|
445
|
+
/**
|
446
|
+
* Tags of this tag type is shown in tags row on video detail screen
|
447
|
+
*/
|
448
|
+
tagTypeId: string;
|
449
|
+
/**
|
450
|
+
* Row title
|
451
|
+
*/
|
452
|
+
title: string;
|
453
|
+
};
|
422
454
|
};
|
423
455
|
Input: InputOptions;
|
424
456
|
landing: {
|
@@ -513,6 +545,22 @@ export declare type DocumentOptions = Partial<{
|
|
513
545
|
subscribeOnChanges: boolean;
|
514
546
|
}>;
|
515
547
|
|
548
|
+
/**
|
549
|
+
* @public
|
550
|
+
*/
|
551
|
+
export declare interface Duration {
|
552
|
+
units: DurationUnits;
|
553
|
+
value: number;
|
554
|
+
}
|
555
|
+
|
556
|
+
/**
|
557
|
+
* @public
|
558
|
+
*/
|
559
|
+
export declare enum DurationUnits {
|
560
|
+
DAY = "day",
|
561
|
+
MONTH = "month"
|
562
|
+
}
|
563
|
+
|
516
564
|
/**
|
517
565
|
* @public
|
518
566
|
*/
|
@@ -565,6 +613,21 @@ export declare interface GenericOnCallError {
|
|
565
613
|
*/
|
566
614
|
export declare const getPubSub: () => PubSub;
|
567
615
|
|
616
|
+
/**
|
617
|
+
* Response from Tivio getPurchaseInfo HTTP endpoint.
|
618
|
+
*
|
619
|
+
* @public
|
620
|
+
*/
|
621
|
+
export declare type GetPurchaseInfoResponse = {
|
622
|
+
monetizationId: string;
|
623
|
+
monetization: PurchaseMonetization;
|
624
|
+
status: PurchaseStatus;
|
625
|
+
video?: {
|
626
|
+
id: string;
|
627
|
+
name: string | Translation;
|
628
|
+
};
|
629
|
+
};
|
630
|
+
|
568
631
|
/**
|
569
632
|
* @public
|
570
633
|
*/
|
@@ -709,6 +772,7 @@ export declare enum LangCode {
|
|
709
772
|
FR = "fr",
|
710
773
|
IT = "it",
|
711
774
|
PL = "pl",
|
775
|
+
PT = "pt",
|
712
776
|
SK = "sk",
|
713
777
|
ES = "es"
|
714
778
|
}
|
@@ -761,6 +825,20 @@ export declare type LiveTvChannelSource = SourceBase & {
|
|
761
825
|
channelName: string;
|
762
826
|
};
|
763
827
|
|
828
|
+
/**
|
829
|
+
* @public
|
830
|
+
*/
|
831
|
+
export declare type LocationField = {
|
832
|
+
/**
|
833
|
+
* Two-letter uppercase continent code (TODO not sure if this ISO-3166 format or something else, we get these from maxmind service)
|
834
|
+
*/
|
835
|
+
continentCode?: 'AF' | 'AN' | 'AS' | 'EU' | 'NA' | 'OC' | 'SA';
|
836
|
+
/**
|
837
|
+
* Two-letter uppercase country code according to ISO-3166 format (see https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
|
838
|
+
*/
|
839
|
+
countryIsoCode?: string;
|
840
|
+
};
|
841
|
+
|
764
842
|
declare interface Logger {
|
765
843
|
/** important messages */
|
766
844
|
warn(...data: LoggerArgs): void;
|
@@ -816,14 +894,9 @@ export declare interface MigratedVideoExternals {
|
|
816
894
|
*/
|
817
895
|
export declare interface Monetization {
|
818
896
|
id: string;
|
819
|
-
price?: string | number;
|
820
897
|
type?: MonetizationType;
|
821
|
-
frequency?: MONETIZATION_FREQUENCY;
|
822
|
-
isPurchased?: boolean;
|
823
898
|
name?: string;
|
824
899
|
description?: string;
|
825
|
-
benefits?: Translation[];
|
826
|
-
localizedBenefits?: string[];
|
827
900
|
}
|
828
901
|
|
829
902
|
/**
|
@@ -893,6 +966,13 @@ export declare interface OrderBy {
|
|
893
966
|
directionStr?: OrderByDirection;
|
894
967
|
}
|
895
968
|
|
969
|
+
/**
|
970
|
+
* The same as WhereFilter, but in array, for easier usage.
|
971
|
+
* Format: [field, directionStr] or [field]
|
972
|
+
* @public
|
973
|
+
*/
|
974
|
+
export declare type OrderByArray = [string, OrderByDirection] | [string];
|
975
|
+
|
896
976
|
declare type OrderByDirection = 'desc' | 'asc';
|
897
977
|
|
898
978
|
/**
|
@@ -1183,6 +1263,14 @@ export declare enum PlayerWrapperEventType {
|
|
1183
1263
|
*/
|
1184
1264
|
export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
1185
1265
|
|
1266
|
+
/**
|
1267
|
+
* @public
|
1268
|
+
*/
|
1269
|
+
export declare interface Promotion {
|
1270
|
+
duration?: Duration;
|
1271
|
+
price?: number;
|
1272
|
+
}
|
1273
|
+
|
1186
1274
|
/**
|
1187
1275
|
* @public
|
1188
1276
|
*/
|
@@ -1191,6 +1279,30 @@ export declare interface PubSub {
|
|
1191
1279
|
subscribe: <K extends keyof Events>(triggerName: K, onMessage: (data: Events[K]) => Empty) => Disposer;
|
1192
1280
|
}
|
1193
1281
|
|
1282
|
+
/**
|
1283
|
+
* @public
|
1284
|
+
*/
|
1285
|
+
export declare interface PurchasableMonetization extends Monetization {
|
1286
|
+
/**
|
1287
|
+
* Price before any discounts (e.g. promotions).
|
1288
|
+
*/
|
1289
|
+
originalPrice: number;
|
1290
|
+
/**
|
1291
|
+
* Final price (after discounts).
|
1292
|
+
*/
|
1293
|
+
price?: string | number;
|
1294
|
+
promotion: Promotion | null;
|
1295
|
+
frequency?: MONETIZATION_FREQUENCY;
|
1296
|
+
isPurchased?: boolean;
|
1297
|
+
benefits?: Translation[];
|
1298
|
+
localizedBenefits?: string[];
|
1299
|
+
/**
|
1300
|
+
* Set to true for subscriptions which is not possible to buy - typically for historical subscriptions which users
|
1301
|
+
* still have bought but can't be purchased anymore.
|
1302
|
+
*/
|
1303
|
+
purchaseDisabled?: boolean;
|
1304
|
+
}
|
1305
|
+
|
1194
1306
|
/**
|
1195
1307
|
* @public
|
1196
1308
|
*/
|
@@ -1222,6 +1334,132 @@ export declare type Purchase = {
|
|
1222
1334
|
voucherId?: string;
|
1223
1335
|
};
|
1224
1336
|
|
1337
|
+
/**
|
1338
|
+
* @public
|
1339
|
+
*/
|
1340
|
+
export declare enum PurchaseDocumentGateway {
|
1341
|
+
'qerko' = "qerko",
|
1342
|
+
'oktagon' = "oktagon",
|
1343
|
+
'voucher' = "voucher",
|
1344
|
+
'comgate' = "comgate"
|
1345
|
+
}
|
1346
|
+
|
1347
|
+
/**
|
1348
|
+
* Payload which is sent to organization's webhook (if provided). It is send only when purchase status changes to PAID,
|
1349
|
+
* it means that it is send also when user applies the voucher.
|
1350
|
+
*
|
1351
|
+
* @public
|
1352
|
+
*/
|
1353
|
+
export declare type PurchaseEndpointPayload = {
|
1354
|
+
/**
|
1355
|
+
* Information about the purchase which changes status to PAID.
|
1356
|
+
*/
|
1357
|
+
purchase: {
|
1358
|
+
/**
|
1359
|
+
* Two-letter upper-case continent code.
|
1360
|
+
*/
|
1361
|
+
continentCode?: LocationField['continentCode'];
|
1362
|
+
/**
|
1363
|
+
* Two-letter upper-case country code according to ISO-3166 format (see https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes).
|
1364
|
+
*/
|
1365
|
+
countryIsoCode?: LocationField['countryIsoCode'];
|
1366
|
+
/**
|
1367
|
+
* Gateway name or "voucher".
|
1368
|
+
*/
|
1369
|
+
gateway: PurchaseDocumentGateway;
|
1370
|
+
/**
|
1371
|
+
* Tivio ID of the purchase.
|
1372
|
+
*/
|
1373
|
+
id: string;
|
1374
|
+
/**
|
1375
|
+
* Timestamp of the last change of the purchase - in this case it is timestamp when it was paid.
|
1376
|
+
*/
|
1377
|
+
updated: number;
|
1378
|
+
};
|
1379
|
+
/**
|
1380
|
+
* Information about the monetization which has been bought by this purchase. Monetization definition may change in time so information provided here
|
1381
|
+
* reflects monetization definition in time of the purchase.
|
1382
|
+
*/
|
1383
|
+
monetization: {
|
1384
|
+
/**
|
1385
|
+
* Currency in which the purchase has been made. Three upper-case letters according to ISO-4217.
|
1386
|
+
*/
|
1387
|
+
currency?: Currency;
|
1388
|
+
/**
|
1389
|
+
* Frequency in which the user will be charged.
|
1390
|
+
* One of "ONE_TIME_PAYMENT", "DAILY", "WEEKLY", "MONTHLY" and "ANNUALLY.
|
1391
|
+
*/
|
1392
|
+
frequency?: MONETIZATION_FREQUENCY | null;
|
1393
|
+
/**
|
1394
|
+
* Tivio ID of the monetization.
|
1395
|
+
*/
|
1396
|
+
id: string;
|
1397
|
+
/**
|
1398
|
+
* Price of the purchase.
|
1399
|
+
*/
|
1400
|
+
price?: number;
|
1401
|
+
/**
|
1402
|
+
* Name of the monetization.
|
1403
|
+
*/
|
1404
|
+
title?: string;
|
1405
|
+
/**
|
1406
|
+
* Type of the monetization ("transaction" or "subscription").
|
1407
|
+
*/
|
1408
|
+
type: MonetizationType;
|
1409
|
+
};
|
1410
|
+
/**
|
1411
|
+
* Information about the video which has been bought by this purchase. Provided only for transaction purchases.
|
1412
|
+
*/
|
1413
|
+
video?: {
|
1414
|
+
/**
|
1415
|
+
* Tivio ID of the video.
|
1416
|
+
*/
|
1417
|
+
id: string;
|
1418
|
+
/**
|
1419
|
+
* Name of the video.
|
1420
|
+
*/
|
1421
|
+
name: string | Translation;
|
1422
|
+
};
|
1423
|
+
/**
|
1424
|
+
* Information about the user who made this purchase.
|
1425
|
+
*/
|
1426
|
+
user: {
|
1427
|
+
/**
|
1428
|
+
* User's e-mail.
|
1429
|
+
*/
|
1430
|
+
email: string;
|
1431
|
+
/**
|
1432
|
+
* External ID of the user.
|
1433
|
+
*/
|
1434
|
+
externalUserId: string;
|
1435
|
+
/**
|
1436
|
+
* Tivio ID of the user.
|
1437
|
+
*/
|
1438
|
+
id: string;
|
1439
|
+
/**
|
1440
|
+
* User's name.
|
1441
|
+
*/
|
1442
|
+
name: string;
|
1443
|
+
};
|
1444
|
+
/**
|
1445
|
+
* Information about the voucher. Provided only when purchase is purchase (not application) of the voucher.
|
1446
|
+
*/
|
1447
|
+
voucher?: {
|
1448
|
+
/**
|
1449
|
+
* Voucher code.
|
1450
|
+
*/
|
1451
|
+
code: string;
|
1452
|
+
/**
|
1453
|
+
* Voucher expiration timestamp.
|
1454
|
+
*/
|
1455
|
+
expiration: number;
|
1456
|
+
/**
|
1457
|
+
* Duration (in seconds) after which purchase is considered expired. If undefined, monetization's duration is used.
|
1458
|
+
*/
|
1459
|
+
purchaseDuration?: number;
|
1460
|
+
};
|
1461
|
+
};
|
1462
|
+
|
1225
1463
|
/**
|
1226
1464
|
* @public
|
1227
1465
|
*/
|
@@ -1275,7 +1513,7 @@ export declare interface QerkoCancellationInfo {
|
|
1275
1513
|
* @public
|
1276
1514
|
*/
|
1277
1515
|
export declare interface QerkoData {
|
1278
|
-
monetization:
|
1516
|
+
monetization: PurchasableMonetization;
|
1279
1517
|
item?: Video | TvChannel;
|
1280
1518
|
onPurchase?: () => void;
|
1281
1519
|
onClose?: () => void;
|
@@ -1373,13 +1611,14 @@ export declare type RequiredNullable<T> = {
|
|
1373
1611
|
* @public
|
1374
1612
|
*/
|
1375
1613
|
export declare interface RouterOverrides {
|
1376
|
-
goToVideoDetailPage: (
|
1614
|
+
goToVideoDetailPage: (videoIdOrUrlName: string) => void;
|
1377
1615
|
goToSeriesDetailPage: (tagId: string) => void;
|
1378
1616
|
goToTagPage: (tagId: string) => void;
|
1379
|
-
|
1617
|
+
goToLoginPage: () => void;
|
1618
|
+
goToRegistrationPage: () => void;
|
1380
1619
|
goBack: () => void;
|
1381
|
-
goLivePlayer: (
|
1382
|
-
goVodPlayer: (
|
1620
|
+
goLivePlayer: (tvChannelId: string) => void;
|
1621
|
+
goVodPlayer: (videoIdOrUrlName: string) => void;
|
1383
1622
|
goToHome: () => void;
|
1384
1623
|
}
|
1385
1624
|
|
@@ -1676,8 +1915,8 @@ export declare type SubscribeToTaggedVideosOptions = SubscribeToItemsInRowOption
|
|
1676
1915
|
* @public
|
1677
1916
|
*/
|
1678
1917
|
export declare interface SubscriptionCardProps {
|
1679
|
-
subscription:
|
1680
|
-
onClick: (subscription:
|
1918
|
+
subscription: PurchasableMonetization;
|
1919
|
+
onClick: (subscription: PurchasableMonetization) => void;
|
1681
1920
|
buttonLabel: string;
|
1682
1921
|
purchased: boolean;
|
1683
1922
|
focused?: boolean;
|
@@ -1694,7 +1933,7 @@ declare type SubscriptionInfo = {
|
|
1694
1933
|
* @public
|
1695
1934
|
*/
|
1696
1935
|
export declare interface SubscriptionOverlayData {
|
1697
|
-
subscriptions?:
|
1936
|
+
subscriptions?: PurchasableMonetization[];
|
1698
1937
|
onPurchase?: () => void;
|
1699
1938
|
onClose?: () => void;
|
1700
1939
|
}
|
@@ -1733,9 +1972,15 @@ export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber'
|
|
1733
1972
|
* @internal
|
1734
1973
|
*/
|
1735
1974
|
export declare type TileOptions = {
|
1736
|
-
focusedShadow: boolean;
|
1737
1975
|
focusedShadowColor?: string;
|
1738
1976
|
borderColor: string;
|
1977
|
+
/**
|
1978
|
+
* This property is ignored for CIRCLED tiles, they always have border-radius: 50%;
|
1979
|
+
*/
|
1980
|
+
borderRadius: string | number;
|
1981
|
+
innerContainer: {
|
1982
|
+
margin: string;
|
1983
|
+
};
|
1739
1984
|
innerLabel: {
|
1740
1985
|
/**
|
1741
1986
|
* Font size in px
|
@@ -1745,10 +1990,20 @@ export declare type TileOptions = {
|
|
1745
1990
|
bottomLabel: {
|
1746
1991
|
opacity: string | number;
|
1747
1992
|
fontWeight: string;
|
1993
|
+
/**
|
1994
|
+
* Font size in px
|
1995
|
+
*/
|
1996
|
+
fontSize: number;
|
1748
1997
|
};
|
1749
1998
|
sizes: {
|
1750
1999
|
[variant in TileSizeVariant]: TileSizesMap;
|
1751
2000
|
};
|
2001
|
+
badge: {
|
2002
|
+
/**
|
2003
|
+
* Font size in px
|
2004
|
+
*/
|
2005
|
+
fontSize: number;
|
2006
|
+
};
|
1752
2007
|
};
|
1753
2008
|
|
1754
2009
|
/**
|
@@ -1758,6 +2013,7 @@ export declare type TileProps = {
|
|
1758
2013
|
cover: string;
|
1759
2014
|
bottomLabel: string;
|
1760
2015
|
bottomLabelAreaHeight: number;
|
2016
|
+
bottomLabelTextLinesCount: number;
|
1761
2017
|
innerLabel: string;
|
1762
2018
|
duration: string;
|
1763
2019
|
price: string | null;
|
@@ -1792,7 +2048,11 @@ export declare type TileSizes = {
|
|
1792
2048
|
coverWidth: number;
|
1793
2049
|
coverHeight: number;
|
1794
2050
|
cellPaddingRight: number;
|
1795
|
-
|
2051
|
+
/**
|
2052
|
+
* Count of lines of label text.
|
2053
|
+
* Now only bottom label supports multiline text.
|
2054
|
+
*/
|
2055
|
+
labelLinesCount: number;
|
1796
2056
|
};
|
1797
2057
|
|
1798
2058
|
/**
|
@@ -1826,6 +2086,7 @@ export declare interface TivioAuth {
|
|
1826
2086
|
* @param password
|
1827
2087
|
*/
|
1828
2088
|
signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
|
2089
|
+
signInWithCustomToken: (token: string) => Promise<string | null>;
|
1829
2090
|
signOut: () => Promise<void>;
|
1830
2091
|
/**
|
1831
2092
|
* Used for reset forgotten password by user
|
@@ -2017,7 +2278,7 @@ export declare type TivioInternalComponents = {
|
|
2017
2278
|
logo?: string;
|
2018
2279
|
}>;
|
2019
2280
|
WebVideoScreen: React_2.ComponentType<{
|
2020
|
-
|
2281
|
+
videoIdOrUrlName: string;
|
2021
2282
|
}>;
|
2022
2283
|
WebSeriesDetailScreen: React_2.ComponentType<WebSeriesDetailScreenProps>;
|
2023
2284
|
};
|
@@ -2026,20 +2287,33 @@ export declare type TivioInternalComponents = {
|
|
2026
2287
|
* @public
|
2027
2288
|
*/
|
2028
2289
|
export declare type TivioInternalHooks = {
|
2029
|
-
useAuthOverlay: () => AuthOverlayState;
|
2030
2290
|
useSubscriptionsOverlay: () => SubscriptionOverlayState;
|
2031
2291
|
useQerkoOverlay: () => QerkoOverlayState;
|
2032
2292
|
usePurchasesWithVideos: () => {
|
2033
2293
|
purchases: Purchase[];
|
2034
2294
|
};
|
2035
|
-
useOrganizationSubscriptions: () => {
|
2036
|
-
subscriptions:
|
2295
|
+
useOrganizationSubscriptions: (onlyPurchasableSubscriptions?: boolean) => {
|
2296
|
+
subscriptions: PurchasableMonetization[];
|
2037
2297
|
};
|
2038
2298
|
useIsMonetizationPurchased: () => {
|
2039
2299
|
isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
|
2040
2300
|
};
|
2041
|
-
useReferralInfo:
|
2301
|
+
useReferralInfo: (referralToken: string) => ({
|
2302
|
+
data: {
|
2303
|
+
email: string;
|
2304
|
+
externalUserId: string;
|
2305
|
+
promotionId?: string;
|
2306
|
+
referralId: string;
|
2307
|
+
promotion?: any;
|
2308
|
+
};
|
2309
|
+
error: Error | null;
|
2310
|
+
loading: boolean;
|
2311
|
+
});
|
2042
2312
|
useTvChannel: UseTvChannel;
|
2313
|
+
usePaymentOverlay: () => {
|
2314
|
+
videoIdOrUrlName: string | null;
|
2315
|
+
setVideoIdOrUrlName: (videoIdOrUrlName: string | null) => void;
|
2316
|
+
};
|
2043
2317
|
useChannelSource: UseChannelSource;
|
2044
2318
|
useUser: () => {
|
2045
2319
|
user: User | null;
|
@@ -2053,7 +2327,6 @@ export declare type TivioInternalHooks = {
|
|
2053
2327
|
*/
|
2054
2328
|
export declare type TivioInternalProviders = {
|
2055
2329
|
AppThemeProvider: React_2.ComponentType;
|
2056
|
-
AuthOverlayContextProvider: React_2.ComponentType;
|
2057
2330
|
CustomerProvider: React_2.ComponentType<{
|
2058
2331
|
customer: CUSTOMER_BUILD;
|
2059
2332
|
platform: PLATFORM;
|
@@ -2064,6 +2337,10 @@ export declare type TivioInternalProviders = {
|
|
2064
2337
|
SubscriptionOverlayContextProvider: React_2.ComponentType;
|
2065
2338
|
QerkoOverlayContextProvider: React_2.ComponentType;
|
2066
2339
|
PurchasesWithVideosContextProvider: React_2.ComponentType;
|
2340
|
+
PaymentOverlayContextProvider: React_2.ComponentType;
|
2341
|
+
/**
|
2342
|
+
* @deprecated not used in our app, can be removed when no sdk in production uses it
|
2343
|
+
*/
|
2067
2344
|
OrganizationSubscriptionsContextProvider: React_2.ComponentType;
|
2068
2345
|
RouterOverridesContextProvider: React_2.ComponentType<RouterOverridesContextState>;
|
2069
2346
|
};
|
@@ -2451,8 +2728,8 @@ export declare const useMarkers: () => Marker[] | null;
|
|
2451
2728
|
/**
|
2452
2729
|
* @public
|
2453
2730
|
*/
|
2454
|
-
export declare const useOrganizationSubscriptions: () => {
|
2455
|
-
subscriptions:
|
2731
|
+
export declare const useOrganizationSubscriptions: (onlyPurchasableSubscriptions?: boolean | undefined) => {
|
2732
|
+
subscriptions: PurchasableMonetization[];
|
2456
2733
|
};
|
2457
2734
|
|
2458
2735
|
/**
|
@@ -2553,7 +2830,7 @@ export declare enum UserType {
|
|
2553
2830
|
*/
|
2554
2831
|
export declare type UseSearch = <T extends ALGOLIA_INDEX_NAME>(indexName: T, options?: UseSearchOptions) => {
|
2555
2832
|
search: (query: string) => void;
|
2556
|
-
pagination: PaginationInterface<UseSearchResult<T
|
2833
|
+
pagination: Omit<PaginationInterface<UseSearchResult<T>>, 'loading'> | null;
|
2557
2834
|
error: Error | null;
|
2558
2835
|
isLoading: boolean;
|
2559
2836
|
lastQuery: string;
|
@@ -2630,10 +2907,10 @@ export declare const useUser: () => {
|
|
2630
2907
|
|
2631
2908
|
/**
|
2632
2909
|
* Use video
|
2633
|
-
* @param
|
2910
|
+
* @param videoIdOrUrlName - video id or video nice url (e.g. some-interesting-video)
|
2634
2911
|
* @public
|
2635
2912
|
*/
|
2636
|
-
export declare const useVideo: (
|
2913
|
+
export declare const useVideo: (videoIdOrUrlName?: string | undefined) => {
|
2637
2914
|
data: Video | null;
|
2638
2915
|
error: string | null;
|
2639
2916
|
};
|
@@ -2719,14 +2996,15 @@ export declare interface Video extends RowItem {
|
|
2719
2996
|
image: string | null;
|
2720
2997
|
isPlayable: boolean;
|
2721
2998
|
monetizations: Monetization[];
|
2722
|
-
monetization: Monetization | undefined;
|
2723
2999
|
transactionId?: string;
|
2724
|
-
|
2725
|
-
|
3000
|
+
sources?: any[];
|
3001
|
+
transaction: PurchasableMonetization | undefined;
|
3002
|
+
subscriptions: PurchasableMonetization[];
|
2726
3003
|
subscriptionIds: string[];
|
2727
3004
|
isPlaylist: boolean;
|
2728
3005
|
name: string;
|
2729
|
-
|
3006
|
+
urlNames?: string[];
|
3007
|
+
urlName?: string;
|
2730
3008
|
price: number | null;
|
2731
3009
|
detailedPrice: DetailedPrice | null;
|
2732
3010
|
uri: string;
|
@@ -2801,6 +3079,13 @@ export declare enum VideoType {
|
|
2801
3079
|
SERIES = "SERIES"
|
2802
3080
|
}
|
2803
3081
|
|
3082
|
+
/**
|
3083
|
+
* @public
|
3084
|
+
*/
|
3085
|
+
export declare type VideoUrlName = {
|
3086
|
+
[key in LangCode]?: string[];
|
3087
|
+
};
|
3088
|
+
|
2804
3089
|
/**
|
2805
3090
|
* @public
|
2806
3091
|
*/
|
@@ -2926,6 +3211,13 @@ export declare interface WhereFilter {
|
|
2926
3211
|
value: any;
|
2927
3212
|
}
|
2928
3213
|
|
3214
|
+
/**
|
3215
|
+
* The same as WhereFilter, but in array, for easier usage.
|
3216
|
+
* Format: [field, operator, value]
|
3217
|
+
* @public
|
3218
|
+
*/
|
3219
|
+
export declare type WhereFilterArray = [string, WhereFilterOp, any];
|
3220
|
+
|
2929
3221
|
declare type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
|
2930
3222
|
|
2931
3223
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.3.0",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"typings": "dist/index.d.ts",
|
6
6
|
"source": "src/index.ts",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"@material-ui/core": "^4.11.2",
|
31
31
|
"@material-ui/icons": "^4.11.2",
|
32
32
|
"@sentry/browser": "^6.1.0",
|
33
|
-
"@tivio/common": "1.1.
|
33
|
+
"@tivio/common": "1.1.99",
|
34
34
|
"dayjs": "^1.11.0",
|
35
35
|
"es7-object-polyfill": "^1.0.1",
|
36
36
|
"firebase": "8.10.1",
|