@tivio/sdk-react 9.1.0 → 9.1.2

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -6,8 +6,13 @@ settings in the administration of Tivio Studio while having the freedom to build
6
6
 
7
7
  ## Changelog
8
8
 
9
+ * 9.1.2
10
+ * patch: update PurchaseEndpointPayload type (cityName, externalId, geoPoint)
11
+
12
+ * 9.1.1
13
+ * patch: fix changelog
14
+
9
15
  * 9.1.0
10
- * minor: revert add originalPurchaseId to PurchaseEndpointPayload
11
16
  * patch: add gateway to Purchase type
12
17
  * minor: add QerkoPaymentWebhookByApiKeyRequest to exported types
13
18
 
package/README.md.bak CHANGED
@@ -6,8 +6,13 @@ settings in the administration of Tivio Studio while having the freedom to build
6
6
 
7
7
  ## Changelog
8
8
 
9
+ * 9.1.2
10
+ * patch: update PurchaseEndpointPayload type (cityName, externalId, geoPoint)
11
+
12
+ * 9.1.1
13
+ * patch: fix changelog
14
+
9
15
  * 9.1.0
10
- * minor: revert add originalPurchaseId to PurchaseEndpointPayload
11
16
  * patch: add gateway to Purchase type
12
17
  * minor: add QerkoPaymentWebhookByApiKeyRequest to exported types
13
18
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { ComponentType } from 'react';
2
+ import type dayjs from 'dayjs';
2
3
  import { DocumentReference } from '@firebase/firestore-types';
4
+ import type duration from 'dayjs/plugin/duration';
3
5
  import firebase from '@firebase/app-types';
4
6
  import { FunctionComponentElement } from 'react';
5
- import { GeoPoint } from '@firebase/firestore-types';
7
+ import type { GeoPoint } from '@firebase/firestore-types';
6
8
  import { OperatingSystem } from 'detect-browser';
7
9
  import type { PaletteType } from '@material-ui/core';
8
10
  import { default as React_2 } from 'react';
@@ -487,6 +489,7 @@ export declare interface BannerProps {
487
489
  hoverable: boolean;
488
490
  height: number;
489
491
  cover?: string | null;
492
+ created?: Date | null;
490
493
  overlay: boolean;
491
494
  price: string;
492
495
  borderRadius?: string | number;
@@ -845,12 +848,12 @@ export declare const createPubSub: () => PubSub;
845
848
  * Fetch & load CommonJS remote module.
846
849
  * @public
847
850
  */
848
- export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig) => Promise<TivioBundle>;
851
+ export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<TivioBundle>;
849
852
 
850
853
  /**
851
854
  * @public
852
855
  */
853
- export declare const createUseRemoteBundle: () => (conf: InternalConfig) => RemoteBundleState;
856
+ export declare const createUseRemoteBundle: () => (conf: InternalConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
854
857
 
855
858
  export declare interface CreateUserPayload {
856
859
  displayName?: string;
@@ -924,7 +927,9 @@ export declare enum CustomerId {
924
927
  VIRTUAL_CHANNEL_VIDEOS = "VIRTUAL_CHANNEL_VIDEOS",
925
928
  VOJTA_ZIZKA = "VOJTA_ZIZKA",
926
929
  LIGA_NARUBY = "LIGA_NARUBY",
927
- VIC_NEZ_SI_MYSLITE = "VIC_NEZ_SI_MYSLITE"
930
+ VIC_NEZ_SI_MYSLITE = "VIC_NEZ_SI_MYSLITE",
931
+ ZIMAK = "ZIMAK",
932
+ TYDENIK_HOROSKOPU = "TYDENIK_HOROSKOPU"
928
933
  }
929
934
 
930
935
  export declare interface CustomScript {
@@ -990,6 +995,23 @@ export declare type DeviceInfo = ArrisDeviceInfo | ReactNativeDeviceInfo;
990
995
  */
991
996
  export declare type DeviceOs = OperatingSystem | 'Tizen' | 'webOS' | 'Arris' | 'Android TV' | 'tvOS';
992
997
 
998
+ /**
999
+ * Window object with Didomi SDK properties.
1000
+ */
1001
+ export declare interface DidomiWindow {
1002
+ didomiEventListeners: Array<{
1003
+ event: string;
1004
+ listener: () => void;
1005
+ }>;
1006
+ /**
1007
+ * The window.didomiOnReady callbacks are called after the SDK
1008
+ * is initialized and has loaded its configuration.
1009
+ *
1010
+ * https://developers.didomi.io/cmp/web-sdk/reference/api
1011
+ */
1012
+ didomiOnReady: (() => void)[];
1013
+ }
1014
+
993
1015
  /**
994
1016
  * @public
995
1017
  */
@@ -1059,6 +1081,8 @@ export declare interface Duration {
1059
1081
  value: number;
1060
1082
  }
1061
1083
 
1084
+ declare type DurationUnit = duration.DurationUnitType & ('day' | 'week' | 'month' | 'year');
1085
+
1062
1086
  /**
1063
1087
  * @public
1064
1088
  */
@@ -1067,6 +1091,14 @@ export declare enum DurationUnits {
1067
1091
  MONTH = "month"
1068
1092
  }
1069
1093
 
1094
+ /**
1095
+ * Duration field using dayjs duration
1096
+ */
1097
+ export declare interface DurationWithUnit {
1098
+ value: number;
1099
+ unit: DurationUnit;
1100
+ }
1101
+
1070
1102
  /**
1071
1103
  * @public
1072
1104
  */
@@ -1209,7 +1241,7 @@ export declare type ExternalTvConfig = {
1209
1241
  * @throws if fetch fails
1210
1242
  * @public
1211
1243
  */
1212
- export declare const fetchBundle: (secret: string, conf: InternalConfig) => Promise<string>;
1244
+ export declare const fetchBundle: (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<string>;
1213
1245
 
1214
1246
  /**
1215
1247
  * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
@@ -1664,7 +1696,7 @@ export declare type ItemComponent = RowItemComponent | BannerItemComponent;
1664
1696
  /**
1665
1697
  * @public
1666
1698
  */
1667
- export declare type ItemInRow = Tag | Video | TvChannel | Advertisement | Application | Article;
1699
+ export declare type ItemInRow = Tag | Video | TvChannel | Advertisement | Application | Article | Series;
1668
1700
 
1669
1701
  /**
1670
1702
  * @public
@@ -2074,19 +2106,84 @@ export declare type NonAdSourceType = Exclude<SourceType, SourceType.ADVERTISEME
2074
2106
  declare interface Notification_2 {
2075
2107
  id: string;
2076
2108
  name: string;
2077
- targeting: UserGroup;
2109
+ targeting: NotificationTargeting | null;
2078
2110
  templateId: string;
2079
2111
  thumbnailUrl?: string;
2080
- triggerType: TriggerType;
2112
+ triggerType: NotificationTriggerType;
2113
+ scheduleTime?: Date;
2081
2114
  status?: NotificationStatus;
2115
+ substitutions: NotificationSubstitution[];
2082
2116
  }
2083
2117
  export { Notification_2 as Notification }
2084
2118
 
2119
+ export declare interface NotificationDuration {
2120
+ value: number;
2121
+ unit: dayjs.ManipulateType;
2122
+ }
2123
+
2124
+ export declare type NotificationFilterType = NotificationFirestoreFilterType | NotificationSurveyFilterType | NotificationLastActivityFilterType;
2125
+
2126
+ export declare type NotificationFirestoreFilterType = NotificationSubscriptionFilterType | NotificationMembershipFilterType;
2127
+
2128
+ export declare interface NotificationLastActivity {
2129
+ value: number;
2130
+ unit: 'DAY' | 'WEEK' | 'MONTH';
2131
+ }
2132
+
2133
+ export declare interface NotificationLastActivityFilterType {
2134
+ type: 'lastActivity';
2135
+ value: NotificationLastActivity;
2136
+ }
2137
+
2138
+ export declare interface NotificationMembershipFilterType {
2139
+ type: 'membership';
2140
+ value: {
2141
+ membershipId: string;
2142
+ isActive: boolean;
2143
+ };
2144
+ }
2145
+
2085
2146
  export declare enum NotificationStatus {
2147
+ AUTOMATIC = "automatic",
2148
+ DRAFT = "draft",
2086
2149
  PLANNED = "planned",
2087
- SENT = "sent"
2150
+ SENT = "sent",
2151
+ WAITING = "waiting",
2152
+ RUNNING = "running"
2153
+ }
2154
+
2155
+ export declare interface NotificationSubscriptionFilterType {
2156
+ type: 'subscription';
2157
+ value: {
2158
+ subscriptionId: string;
2159
+ isActive: boolean;
2160
+ };
2161
+ }
2162
+
2163
+ export declare interface NotificationSubstitution {
2164
+ key: string;
2165
+ value: string;
2166
+ }
2167
+
2168
+ export declare interface NotificationSurveyFilterType {
2169
+ type: 'survey';
2170
+ value: {
2171
+ ageFrom: number;
2172
+ ageTo?: number;
2173
+ gender: 'm' | 'f' | 'all';
2174
+ };
2088
2175
  }
2089
2176
 
2177
+ export declare interface NotificationTargeting {
2178
+ monetizationId: string;
2179
+ membershipId: string;
2180
+ isActive: boolean;
2181
+ from?: Date;
2182
+ to?: Date;
2183
+ }
2184
+
2185
+ export declare type NotificationTriggerType = 'scheduled' | 'manual' | 'purchaseStatusChange' | 'duration' | 'userRegistration';
2186
+
2090
2187
  /**
2091
2188
  * @public
2092
2189
  */
@@ -2139,6 +2236,10 @@ export declare interface Organization {
2139
2236
  profilePhoto: string | null;
2140
2237
  }
2141
2238
 
2239
+ export declare interface OrganizationInterface {
2240
+ allowedSignInProviders: SignInProvider[];
2241
+ }
2242
+
2142
2243
  /**
2143
2244
  * If Tivio PlayerWrapper is an interception layer, it should allow the pass-through
2144
2245
  * of not just Tivio source types but any other source types that the 3rd party app may be using.
@@ -2545,6 +2646,7 @@ export declare interface PlayerInterface {
2545
2646
  */
2546
2647
  getNativeImaAdUrl?: () => string | null;
2547
2648
  lastQuality?: number | null;
2649
+ getQualities?: () => Track[];
2548
2650
  /**
2549
2651
  * Attribute indicating that the video is to be played "inline"
2550
2652
  * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#playsinline
@@ -2709,6 +2811,7 @@ export declare interface PlayerWrapper {
2709
2811
  changeVolumeBy: (volume: number) => void;
2710
2812
  setMuted: (muted: boolean) => void;
2711
2813
  toggleMuted: () => void;
2814
+ getQualities: () => Track[];
2712
2815
  }
2713
2816
 
2714
2817
  /**
@@ -2859,7 +2962,8 @@ export declare enum PurchaseDocumentGateway {
2859
2962
  'comgate' = "comgate",
2860
2963
  'tivio' = "tivio",
2861
2964
  'patreon' = "patreon",
2862
- 'paypal' = "paypal"
2965
+ 'paypal' = "paypal",
2966
+ 'unknown' = "unknown"
2863
2967
  }
2864
2968
 
2865
2969
  /**
@@ -2873,6 +2977,17 @@ export declare type PurchaseEndpointPayload = {
2873
2977
  * Information about the purchase which changes status to PAID.
2874
2978
  */
2875
2979
  purchase: {
2980
+ /**
2981
+ * See {@link LocationField["city"]["cityName"]} type.
2982
+ */
2983
+ cityName?: string;
2984
+ /**
2985
+ * See {@link LocationField["geoPoint"]} type. Here it is serialized from Firebase.GeoPoint type.
2986
+ */
2987
+ geoPoint?: {
2988
+ latitude: number;
2989
+ longitude: number;
2990
+ };
2876
2991
  /**
2877
2992
  * Two-letter upper-case continent code.
2878
2993
  */
@@ -2887,7 +3002,7 @@ export declare type PurchaseEndpointPayload = {
2887
3002
  */
2888
3003
  expiration?: number;
2889
3004
  /**
2890
- * If purchase was made outside of standard Tivio payment method (e.g PayPal), this is its ID.
3005
+ * Paypal Id, Qerko Id or Voucher Id based on the gateway.
2891
3006
  */
2892
3007
  externalId?: string;
2893
3008
  /**
@@ -3332,6 +3447,7 @@ export declare interface RouterOverrides {
3332
3447
  goToRecommendedFromOrganizationRow: (screenId: string, rowId: string) => void;
3333
3448
  goToMagentaMomentsPage: (voucher?: string) => void;
3334
3449
  goToVoucherRedeemPage: () => void;
3450
+ updateParams: (params: URLSearchParams) => void;
3335
3451
  }
3336
3452
 
3337
3453
  /**
@@ -3375,7 +3491,8 @@ export declare enum ROW_ITEM_TYPES {
3375
3491
  TAG = "TAG",
3376
3492
  TV_CHANNEL = "TV_CHANNEL",
3377
3493
  ADVERTISEMENT = "ADVERTISEMENT",
3378
- ARTICLE = "ARTICLE"
3494
+ ARTICLE = "ARTICLE",
3495
+ SERIES = "SERIES"
3379
3496
  }
3380
3497
 
3381
3498
  /**
@@ -3579,6 +3696,10 @@ export declare type ScalableAsset = {
3579
3696
  */
3580
3697
  export declare type Scale = '@1' | '@2' | '@3';
3581
3698
 
3699
+ export declare interface ScheduleNotificationRequest {
3700
+ notificationPath: string;
3701
+ }
3702
+
3582
3703
  /**
3583
3704
  * @public
3584
3705
  */
@@ -3698,6 +3819,35 @@ export declare interface SendFinalizeRegistrationEmailPayload {
3698
3819
  authUserId: string;
3699
3820
  }
3700
3821
 
3822
+ export declare interface SendTivioTemplateEmailRequest {
3823
+ notificationId: string;
3824
+ organizationId: string;
3825
+ testEmailAddress?: string;
3826
+ }
3827
+
3828
+ /**
3829
+ * @public
3830
+ */
3831
+ export declare interface Series extends RowItem, MonetizableItem, ReactableContent {
3832
+ id: string;
3833
+ itemType: ROW_ITEM_TYPES.SERIES;
3834
+ cover: string;
3835
+ organizationId?: string;
3836
+ /**
3837
+ * Only used for non migrated series
3838
+ */
3839
+ originalSeriesTagRef?: any;
3840
+ ref: DocumentReference<any>;
3841
+ availableSeasons: AvailableSeason[];
3842
+ actors?: DocumentReference<any>[];
3843
+ }
3844
+
3845
+ export declare interface SeriesTileSpecificData {
3846
+ organizationId: string;
3847
+ assets?: AssetsField;
3848
+ availableSeasons: AvailableSeason[];
3849
+ }
3850
+
3701
3851
  /**
3702
3852
  * Used for entities, that can be global (e.g. asset presets, tag types).
3703
3853
  * Non-global is stored under organizations (in sub-collection), and shown for organization's users and super-admin.
@@ -3723,6 +3873,11 @@ export declare const setUser: (userId: string | null, payload?: UserPayload) =>
3723
3873
  */
3724
3874
  export declare const showGdprConsentPreferences: () => Promise<void>;
3725
3875
 
3876
+ /**
3877
+ * @public
3878
+ */
3879
+ export declare type SignInProvider = 'google' | 'patreon' | 'apple';
3880
+
3726
3881
  export declare enum SocialNetworks {
3727
3882
  FACEBOOK = 0,
3728
3883
  INSTAGRAM = 1,
@@ -3844,6 +3999,18 @@ export declare type SubscribeToItemsInRowOptions = Partial<{
3844
3999
  */
3845
4000
  export declare type SubscribeToRowsInScreen = (screenId: string, cb: (error: Error | null, data: PaginationInterface<Row> | null) => void, options?: PaginationOptions) => Disposer_2;
3846
4001
 
4002
+ /**
4003
+ * @public
4004
+ */
4005
+ export declare type SubscribeToSeriesEpisodes = (seriesRef: any, cb: (error: Error | null, data: PaginationInterface<Video> | null) => void, options?: SubscribeToSeriesEpisodesOptions) => Disposer_2;
4006
+
4007
+ /**
4008
+ * @public
4009
+ */
4010
+ export declare type SubscribeToSeriesEpisodesOptions = Omit<SubscribeToItemsInRowOptions, 'orderBy'> & {
4011
+ orderBy?: OrderBy<TaggedVideosOrderByField>[];
4012
+ };
4013
+
3847
4014
  /**
3848
4015
  * @public
3849
4016
  */
@@ -3890,6 +4057,11 @@ export declare interface Tag extends RowItem {
3890
4057
  removeFromFavorites: () => void;
3891
4058
  cover: string;
3892
4059
  getApplicationName: () => string | undefined;
4060
+ seriesRef?: DocumentReference<any>;
4061
+ fetchData: () => Promise<void>;
4062
+ getSeriesEntity: (path: string) => Promise<Series>;
4063
+ ref: DocumentReference<any>;
4064
+ seriesEntity: Series | null;
3893
4065
  }
3894
4066
 
3895
4067
  export declare interface TagAvailableSeasonsFieldType extends TagMetadataFieldDefinition {
@@ -3962,6 +4134,8 @@ export declare interface TagTranslationFieldType extends TagMetadataFieldDefinit
3962
4134
  value: Translation;
3963
4135
  }
3964
4136
 
4137
+ export declare type TemplateSubstitutionType = 'text' | 'html' | 'image' | 'video';
4138
+
3965
4139
  export declare type Tier = {
3966
4140
  attributes: {
3967
4141
  amount_cents: number;
@@ -3987,7 +4161,7 @@ export declare interface TileApplicationData {
3987
4161
  profilePhoto?: string;
3988
4162
  }
3989
4163
 
3990
- export declare interface TileData<ItemSpecificData = VideoTileSpecificData | TvChannelTileSpecificData | TagTileSpecificData | ArticleTileSpecificData> {
4164
+ export declare interface TileData<ItemSpecificData = VideoTileSpecificData | TvChannelTileSpecificData | TagTileSpecificData | ArticleTileSpecificData | SeriesTileSpecificData> {
3991
4165
  /**
3992
4166
  * Tile item ID.
3993
4167
  */
@@ -4616,12 +4790,13 @@ export declare interface TopWatchItem {
4616
4790
  * @public
4617
4791
  * Video track
4618
4792
  */
4619
- declare interface Track {
4793
+ export declare interface Track {
4620
4794
  id: number;
4621
4795
  /**
4622
4796
  * e.g. 480, 720, 1080
4623
4797
  */
4624
4798
  height: number;
4799
+ width: number;
4625
4800
  active: boolean;
4626
4801
  language: LangCode;
4627
4802
  }
@@ -4642,8 +4817,6 @@ export declare type Translation = {
4642
4817
  [key in LangCode]?: string;
4643
4818
  };
4644
4819
 
4645
- export declare type TriggerType = 'scheduled' | 'manual';
4646
-
4647
4820
  /**
4648
4821
  * @public
4649
4822
  */
@@ -5021,7 +5194,7 @@ export declare type User = {
5021
5194
  * Returns last expired subscription which user can renew or undefined
5022
5195
  */
5023
5196
  extendableSubscription?: Purchase;
5024
- getPurchasedVideos: () => Video[];
5197
+ getPurchasedVideos: () => unknown[];
5025
5198
  getOneTimePurchases: () => Purchase[];
5026
5199
  isPurchasesInitialized: boolean;
5027
5200
  isSignedIn: boolean;
@@ -5254,6 +5427,9 @@ export declare type VastApiFramework = string | 'VPAID' | null;
5254
5427
  */
5255
5428
  export declare enum VastProvider {
5256
5429
  CNC_PREBID = "cnc-prebid",
5430
+ CNC_STARGAZE_PREROLL_1 = "cnc-stargaze-preroll-1",
5431
+ CNC_STARGAZE_PREROLL_2 = "cnc-stargaze-preroll-2",
5432
+ CNC_STARGAZE_MIDROLL = "cnc-stargaze-midroll",
5257
5433
  ETARGET_PREBID = "etarget-prebid",
5258
5434
  FALLBACK_HLS = "fallback-hls",
5259
5435
  FALLBACK_MP4 = "fallback",
@@ -5366,6 +5542,8 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
5366
5542
  setApplicationData: (applicationData: RowItemApplicationData) => void;
5367
5543
  linkedVideosInNotLoaded: () => boolean | undefined;
5368
5544
  initApplication: () => Promise<void>;
5545
+ init: () => Promise<void>;
5546
+ progress?: number;
5369
5547
  }
5370
5548
 
5371
5549
  /**