@tivio/sdk-react 9.1.5 → 9.1.7

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 CHANGED
@@ -5,15 +5,24 @@ above Tivio Studio. You can comfortably manage all you videos, settings such as
5
5
  settings in the administration of Tivio Studio while having the freedom to build your own application.
6
6
 
7
7
  ## Changelog
8
+ * 9.1.7
9
+ * patch: update remote controller component API
10
+
11
+ * 9.1.6
12
+ * minor: add remote controller
13
+
8
14
  * 9.1.5
9
15
  * patch: expose purchase loyalty points through types
16
+ * patch: enable setUser check
10
17
 
11
18
  * 9.1.4
12
19
  * patch: disable setUser check
20
+ * patch: rollback "add renderWebPlayer method for rendering outside of React"
21
+ * patch: rollback "expose createTivio"
13
22
 
14
23
  * 9.1.3
15
- * minor: add renderWebPlayer method for rendering outside of React
16
- * minor: expose createTivio
24
+ * patch: add renderWebPlayer method for rendering outside of React
25
+ * patch: expose createTivio
17
26
 
18
27
  * 9.1.2
19
28
  * patch: update PurchaseEndpointPayload type (cityName, externalId, geoPoint)
package/README.md.bak CHANGED
@@ -5,15 +5,24 @@ above Tivio Studio. You can comfortably manage all you videos, settings such as
5
5
  settings in the administration of Tivio Studio while having the freedom to build your own application.
6
6
 
7
7
  ## Changelog
8
+ * 9.1.7
9
+ * patch: update remote controller component API
10
+
11
+ * 9.1.6
12
+ * minor: add remote controller
13
+
8
14
  * 9.1.5
9
15
  * patch: expose purchase loyalty points through types
16
+ * patch: enable setUser check
10
17
 
11
18
  * 9.1.4
12
19
  * patch: disable setUser check
20
+ * patch: rollback "add renderWebPlayer method for rendering outside of React"
21
+ * patch: rollback "expose createTivio"
13
22
 
14
23
  * 9.1.3
15
- * minor: add renderWebPlayer method for rendering outside of React
16
- * minor: expose createTivio
24
+ * patch: add renderWebPlayer method for rendering outside of React
25
+ * patch: expose createTivio
17
26
 
18
27
  * 9.1.2
19
28
  * patch: update PurchaseEndpointPayload type (cityName, externalId, geoPoint)
package/dist/index.d.ts CHANGED
@@ -28,6 +28,11 @@ export declare interface ActivatedPromotionsWithIdsResponse {
28
28
 
29
29
  export declare type ActivateVoucherResponse = string | ActivatedPromotionsResponse | ActivatedPromotionsWithIdsResponse;
30
30
 
31
+ declare interface actualPriceDetails {
32
+ amountCents: number;
33
+ currency?: primaSupportedCurrency;
34
+ }
35
+
31
36
  export declare type AdBannerScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.AD_BANNER>;
32
37
 
33
38
  export declare type AddEditCommentResponse = {
@@ -854,6 +859,22 @@ export declare type ContentType = 'ARTICLE' | 'VIDEO' | 'SERIES' | 'EPISODE';
854
859
  */
855
860
  export declare type ContinuePosition = number | null | Promise<number | null>;
856
861
 
862
+ export declare interface ControlPlayback {
863
+ delaySegmentCount?: number;
864
+ status: ControlPlaybackStatus;
865
+ }
866
+
867
+ export declare enum ControlPlaybackStatus {
868
+ PAUSED = "paused",
869
+ PLAYING = "playing"
870
+ }
871
+
872
+ export declare interface ControlReplay {
873
+ videoId: string;
874
+ fromSegment?: number;
875
+ toSegment?: number;
876
+ }
877
+
857
878
  /**
858
879
  * @public
859
880
  */
@@ -1069,6 +1090,14 @@ export declare interface CurrentQuestion {
1069
1090
 
1070
1091
  export declare type CurrentQuestionScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.CURRENT_QUESTION>;
1071
1092
 
1093
+ export declare interface currentSubscription {
1094
+ subscriptionId?: string;
1095
+ subscriptionItemType: primaSubscriptionItemType;
1096
+ startDatetime?: Date;
1097
+ endDateTime?: Date;
1098
+ actualPrice: actualPriceDetails;
1099
+ }
1100
+
1072
1101
  /**
1073
1102
  * @public
1074
1103
  */
@@ -1126,7 +1155,8 @@ export declare enum CustomerId {
1126
1155
  LEPSI_UZ_TO_NEBUDE = "LEPSI_UZ_TO_NEBUDE",
1127
1156
  BEAT_SEXISM = "BEAT_SEXISM",
1128
1157
  KAROL_A_KVIDO = "KAROL_A_KVIDO",
1129
- UZ_BUDU = "UZ_BUDU"
1158
+ UZ_BUDU = "UZ_BUDU",
1159
+ PRIMA = "PRIMA"
1130
1160
  }
1131
1161
 
1132
1162
  export declare interface CustomScript {
@@ -1280,6 +1310,15 @@ export declare enum DurationUnits {
1280
1310
  MONTH = "month"
1281
1311
  }
1282
1312
 
1313
+ /**
1314
+ * Custom text for duration units used by formatDuration
1315
+ */
1316
+ export declare interface DurationUnitTexts {
1317
+ hour: string;
1318
+ minute: string;
1319
+ seconds?: string;
1320
+ }
1321
+
1283
1322
  /**
1284
1323
  * Duration field using dayjs duration
1285
1324
  */
@@ -1467,6 +1506,14 @@ export declare interface ForbiddenOnCallError extends GenericOnCallError {
1467
1506
  export declare enum ForbiddenReason {
1468
1507
  MONETIZATION = "MONETIZATION",
1469
1508
  GEO_BLOCKING = "GEO_BLOCKING",
1509
+ EMAIL_ALREADY_EXISTS = "EMAIL_ALREADY_EXISTS",
1510
+ EMAIL_CONTAINS_PLUS_SIGN = "EMAIL_CONTAINS_PLUS_SIGN",
1511
+ EMAIL_NOT_VERIFIED = "EMAIL_NOT_VERIFIED",
1512
+ INVALID_BIRTH_YEAR = "INVALID_BIRTH_YEAR",
1513
+ INVALID_EMAIL_ADDRESS = "INVALID_EMAIL_ADDRESS",
1514
+ NAME_CONTAINS_INVALID_CHAR = "NAME_CONTAINS_INVALID_CHAR",
1515
+ USER_ACCOUNT_LOCKED = "USER_ACCOUNT_LOCKED",
1516
+ USER_NOT_FOUND = "USER_NOT_FOUND",
1470
1517
  UNSUPPORTED_BROWSER = "UNSUPPORTED_BROWSER"
1471
1518
  }
1472
1519
 
@@ -1554,6 +1601,7 @@ export declare const getPubSub: () => PubSub;
1554
1601
  */
1555
1602
  export declare interface GetPurchasableMonetizationsOptions {
1556
1603
  includeMonetizationsWithPurchaseDisabled: boolean;
1604
+ ignoreActiveOrganizationCheck?: boolean;
1557
1605
  }
1558
1606
 
1559
1607
  /**
@@ -1654,6 +1702,10 @@ export declare interface GetSourceUrlResponse {
1654
1702
  * Current session id for given user and source.
1655
1703
  */
1656
1704
  sessionId?: string;
1705
+ /**
1706
+ * Active content (e.g. video) id in generated session.
1707
+ */
1708
+ activeContentId?: string;
1657
1709
  /**
1658
1710
  * Template for generating image previews for user scrubbing in player.
1659
1711
  */
@@ -2149,7 +2201,10 @@ export declare interface LinkedVideo {
2149
2201
  /**
2150
2202
  * Will not render separate player, it will override main video source.
2151
2203
  */
2152
- | 'COMPOSED_PIP';
2204
+ | 'COMPOSED_PIP' | 'MATRIX';
2205
+ name?: string;
2206
+ color?: string;
2207
+ language?: LangCode;
2153
2208
  }
2154
2209
 
2155
2210
  /**
@@ -2420,7 +2475,8 @@ export declare enum MONETIZATION_FREQUENCY {
2420
2475
  WEEKLY = "WEEKLY",
2421
2476
  MONTHLY = "MONTHLY",
2422
2477
  HALF_ANNUALLY = "HALF_ANNUALLY",
2423
- ANNUALLY = "ANNUALLY"
2478
+ ANNUALLY = "ANNUALLY",
2479
+ EVENT = "EVENT"
2424
2480
  }
2425
2481
 
2426
2482
  /**
@@ -3299,6 +3355,8 @@ export declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSou
3299
3355
  from?: Date;
3300
3356
  sourceHistory?: string[];
3301
3357
  seekingMatrix?: SeekingMatrixTemplate;
3358
+ sessionType?: VideoSourceField['sessionType'];
3359
+ sessionId?: string;
3302
3360
  }
3303
3361
 
3304
3362
  export declare type PlayersScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.PLAYERS>;
@@ -3401,6 +3459,80 @@ export declare enum PlayerWrapperEventType {
3401
3459
  */
3402
3460
  export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
3403
3461
 
3462
+ export declare enum primaPlusMonetizationLevel {
3463
+ light = "z7soJTA2dYSxnOOJw7B0",
3464
+ premium = "kwfM0D7Vzv5wfLf5go8o",
3465
+ noAds = "L4dzWZHCZenezYawqEbl"
3466
+ }
3467
+
3468
+ export declare interface primaPlusRefreshTokenResponse {
3469
+ result?: {
3470
+ data: {
3471
+ payload: {
3472
+ sessionId: string | null;
3473
+ userUuid: string;
3474
+ accessToken: {
3475
+ token: string;
3476
+ insecure: boolean;
3477
+ expiresAt: string;
3478
+ };
3479
+ refreshToken: {
3480
+ token: string;
3481
+ insecure: boolean;
3482
+ expiresAt: string;
3483
+ };
3484
+ };
3485
+ };
3486
+ datetime: string;
3487
+ };
3488
+ error?: {
3489
+ code: number;
3490
+ message: string;
3491
+ datetime: string;
3492
+ };
3493
+ }
3494
+
3495
+ export declare interface primaPlusSubscription {
3496
+ result?: {
3497
+ data: {
3498
+ subscription: {
3499
+ currentSubscription?: currentSubscription;
3500
+ };
3501
+ };
3502
+ };
3503
+ error?: {
3504
+ code: number;
3505
+ message: string;
3506
+ datetime: string;
3507
+ };
3508
+ }
3509
+
3510
+ export declare enum primaSubscriptionItemType {
3511
+ REGISTERED = "REGISTERED",
3512
+ HVOD_STANDARD = "HVOD_STANDARD",
3513
+ SVOD_STANDARD = "SVOD_STANDARD",
3514
+ IPBR_STANDARD = "IPBR_STANDARD",
3515
+ PREMIUM_STANDARD = "PREMIUM_STANDARD",
3516
+ IPRIMA_NO_ADS_STANDARD = "IPRIMA_NO_ADS_STANDARD",
3517
+ HVOD_PARTIAL = "HVOD_PARTIAL",
3518
+ IPBR_PARTIAL = "IPBR_PARTIAL",
3519
+ PREMIUM_PARTIAL = "PREMIUM_PARTIAL",
3520
+ IPRIMA_NO_ADS_PARTIAL = "IPRIMA_NO_ADS_PARTIAL",
3521
+ SVOD_PREPAID_VOUCHER = "SVOD_PREPAID_VOUCHER",
3522
+ SVOD_DISCOUNT_VOUCHER = "SVOD_DISCOUNT_VOUCHER",
3523
+ HVOD_PREPAID_VOUCHER = "HVOD_PREPAID_VOUCHER",
3524
+ HVOD_DISCOUNT_VOUCHER = "HVOD_DISCOUNT_VOUCHER"
3525
+ }
3526
+
3527
+ declare enum primaSupportedCurrency {
3528
+ CZK = "CZK",
3529
+ EUR = "EUR",
3530
+ PLN = "PLN",
3531
+ USD = "USD",
3532
+ GBP = "GBP",
3533
+ HUF = "HUF"
3534
+ }
3535
+
3404
3536
  /**
3405
3537
  * Values that user entered in survey for given profile.
3406
3538
  */
@@ -3561,7 +3693,8 @@ export declare enum PurchaseDocumentGateway {
3561
3693
  'patreon' = "patreon",
3562
3694
  'paypal' = "paypal",
3563
3695
  'unknown' = "unknown",
3564
- 'stargaze' = "stargaze"
3696
+ 'stargaze' = "stargaze",
3697
+ 'prima' = "prima"
3565
3698
  }
3566
3699
 
3567
3700
  /**
@@ -4048,6 +4181,75 @@ export declare type RemoteBundleState = {
4048
4181
  state: 'loading' | 'error' | 'ready';
4049
4182
  } & Nullable<TivioBundle>;
4050
4183
 
4184
+ export declare interface RemoteControlGenerateSourceResponse {
4185
+ sessionId?: string;
4186
+ url?: string;
4187
+ }
4188
+
4189
+ export declare interface RemoteControlGetSourceUrlPayload {
4190
+ videoId: string;
4191
+ userId: string;
4192
+ profileId: string;
4193
+ capabilities: PlayerCapability[];
4194
+ activeVideoId: string;
4195
+ }
4196
+
4197
+ /**
4198
+ * @public
4199
+ */
4200
+ export declare interface RemoteControllerProps {
4201
+ className?: string;
4202
+ }
4203
+
4204
+ export declare enum RemoteControlMethod {
4205
+ pairDevice = "pairDevice",
4206
+ unpairDevice = "unpairDevice",
4207
+ playHighlight = "playHighlight",
4208
+ playbackControl = "playbackControl",
4209
+ selectCamera = "selectCamera",
4210
+ getSourceUrl = "getSourceUrl"
4211
+ }
4212
+
4213
+ export declare interface RemoteControlPairPayload {
4214
+ code: string;
4215
+ videoId: string;
4216
+ profileId: string;
4217
+ }
4218
+
4219
+ export declare interface RemoteControlPlaybackControlPayload {
4220
+ sessionId: string;
4221
+ videoId: string;
4222
+ playback: ControlPlayback;
4223
+ activeVideoId?: string;
4224
+ }
4225
+
4226
+ export declare interface RemoteControlPlayHighlightPayload {
4227
+ sessionId: string;
4228
+ videoId: string;
4229
+ activeVideoId: string;
4230
+ replay: ControlReplay;
4231
+ }
4232
+
4233
+ export declare type RemoteControlRequest = RemoteControlRequestBase<RemoteControlMethod.pairDevice> | RemoteControlRequestBase<RemoteControlMethod.unpairDevice> | RemoteControlRequestBase<RemoteControlMethod.playHighlight> | RemoteControlRequestBase<RemoteControlMethod.playbackControl> | RemoteControlRequestBase<RemoteControlMethod.selectCamera> | RemoteControlRequestBase<RemoteControlMethod.getSourceUrl>;
4234
+
4235
+ declare interface RemoteControlRequestBase<TMethod extends RemoteControlMethod> {
4236
+ method: TMethod;
4237
+ payload: RemoteControlRequestPayload<TMethod>;
4238
+ }
4239
+
4240
+ export declare type RemoteControlRequestPayload<TMethod extends RemoteControlMethod> = TMethod extends RemoteControlMethod.pairDevice ? RemoteControlPairPayload : TMethod extends RemoteControlMethod.unpairDevice ? RemoteControlUnpairPayload : TMethod extends RemoteControlMethod.playHighlight ? RemoteControlPlayHighlightPayload : TMethod extends RemoteControlMethod.playbackControl ? RemoteControlPlaybackControlPayload : TMethod extends RemoteControlMethod.selectCamera ? RemoteControlSelectCameraPayload : TMethod extends RemoteControlMethod.getSourceUrl ? RemoteControlGetSourceUrlPayload : object;
4241
+
4242
+ export declare interface RemoteControlSelectCameraPayload {
4243
+ sessionId: string;
4244
+ videoId: string;
4245
+ activeVideoId: string;
4246
+ }
4247
+
4248
+ export declare interface RemoteControlUnpairPayload {
4249
+ sessionId: string;
4250
+ videoId: string;
4251
+ }
4252
+
4051
4253
  /**
4052
4254
  * @public
4053
4255
  */
@@ -4881,7 +5083,9 @@ export declare enum SurveyItemComponent {
4881
5083
  SURVEY = "SURVEY"
4882
5084
  }
4883
5085
 
4884
- export declare type SynchronizeUserTypeFunction = (payload: CreateUserPayload, tenantId: string, tenantUserId: string, organizationId?: string) => Promise<string>;
5086
+ export declare type SynchronizeUserTypeFunction = (payload: CreateUserPayload, tenantId: string, tenantUserId: string, organizationId?: string, additionalData?: {
5087
+ [key: string]: any;
5088
+ }) => Promise<string>;
4885
5089
 
4886
5090
  /**
4887
5091
  * @public
@@ -5185,6 +5389,7 @@ export declare interface TivioComponents {
5185
5389
  ContentSortPicker: React_2.ComponentType<ContentSortPickerProps>;
5186
5390
  WebProfileScreen: React_2.ComponentType<WebProfileScreenProps>;
5187
5391
  WebTivioProVideoScreen: React_2.ComponentType<WebTivioProVideoScreenProps>;
5392
+ RemoteController: React_2.ComponentType<RemoteControllerProps>;
5188
5393
  }
5189
5394
 
5190
5395
  /**
@@ -6150,6 +6355,7 @@ export declare type User = {
6150
6355
  invalidateAllTokens: (type: TokenType) => Promise<void>;
6151
6356
  isPartiallyRegistered: boolean;
6152
6357
  conversationStore: ConversationStore;
6358
+ streamingSessions?: UserStreamingSessionFieldInterface[];
6153
6359
  };
6154
6360
 
6155
6361
  /**
@@ -6216,6 +6422,14 @@ export declare type UserProfile = {
6216
6422
  survey?: ProfileSurvey;
6217
6423
  };
6218
6424
 
6425
+ export declare interface UserStreamingSessionFieldInterface {
6426
+ sessionId: string;
6427
+ sessionType: Exclude<VideoSourceField['sessionType'], undefined>;
6428
+ contentId: string;
6429
+ activeContentId?: string;
6430
+ created: Date;
6431
+ }
6432
+
6219
6433
  /**
6220
6434
  * @public
6221
6435
  */
@@ -6505,6 +6719,8 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
6505
6719
  initApplication: () => Promise<void>;
6506
6720
  init: () => Promise<void>;
6507
6721
  progress?: number;
6722
+ purchasableMonetizationPurchase: Purchase | null;
6723
+ purchaseByVideoId: Purchase | null;
6508
6724
  backgroundBlurBannerMobile?: string | null;
6509
6725
  isWatched?: boolean;
6510
6726
  pgRating?: string;
@@ -6512,6 +6728,8 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
6512
6728
  publishedStatus?: PublishedStatus;
6513
6729
  widgetPaths?: string[];
6514
6730
  forcedCapabilities: PlayerCapability[] | null;
6731
+ mainLinkedVideoId?: string;
6732
+ getLinkedVideoIdByLanguage: (lang: LangCode) => string | undefined;
6515
6733
  }
6516
6734
 
6517
6735
  /**
@@ -6552,11 +6770,12 @@ export declare interface VideoHighlight {
6552
6770
  id: string;
6553
6771
  title: string;
6554
6772
  description?: string;
6555
- fromTimestamp?: number;
6556
- toTimestamp?: number;
6773
+ fromSegment?: number;
6774
+ toSegment?: number;
6557
6775
  imageUrl?: string;
6558
6776
  videoTime?: string;
6559
6777
  videoId?: string;
6778
+ created?: Date;
6560
6779
  }
6561
6780
 
6562
6781
  declare type VideoPath = string;
@@ -6808,9 +7027,10 @@ export declare interface VodTivioSourceInterface extends PlayerSourceInterface<S
6808
7027
  canWatchOnDevice: boolean;
6809
7028
  isAvailable: boolean;
6810
7029
  availability: ContentAvailability | null;
6811
- managementUrl?: string;
6812
7030
  video: Video;
6813
7031
  clone: (params?: Partial<VodTivioSourceParams>) => VodTivioSourceInterface;
7032
+ sessionType?: VideoSourceField['sessionType'];
7033
+ sessionId?: string;
6814
7034
  }
6815
7035
 
6816
7036
  /**
@@ -6823,10 +7043,9 @@ export declare interface VodTivioSourceParams extends PlayerSourceParams<SourceT
6823
7043
  drm?: Drm;
6824
7044
  ignoreWatchPosition?: boolean;
6825
7045
  /**
6826
- * URL for source modification for user (e.g. add PIP window to livestream).
6827
- * TODO mb move to PlayerSourceParams
7046
+ * Session ID for authentication and optionally controlling the cameras
6828
7047
  */
6829
- managementUrl?: string;
7048
+ sessionId?: string;
6830
7049
  }
6831
7050
 
6832
7051
  /**