@tivio/sdk-react 3.3.2 → 3.4.0
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/.madgerc +7 -0
- package/README.md +9 -1
- package/README.md.bak +9 -5
- package/dist/components/hooks/index.d.ts +1 -0
- package/dist/components/hooks/useApplyInviteCode.d.ts +12 -1
- package/dist/components/hooks/useIsMonetizationPurchased.d.ts +3 -0
- package/dist/components/hooks/usePurchaseRecovery.d.ts +9 -1
- package/dist/components/hooks/useUser.d.ts +1 -0
- package/dist/components/hooks/useVoucher.d.ts +18 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/services/gdpr.d.ts +1 -0
- package/dist/types/bundle.types.d.ts +37 -19
- package/dist/types/types.d.ts +6 -7
- package/doc/changelog.md +0 -0
- package/package.json +5 -8
@@ -0,0 +1 @@
|
|
1
|
+
export declare const showGdprConsentPreferences: () => Promise<void>;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { Currency, ItemsInRow, PaginationInterface, PaginationOptions, QerkoCancellationInfo, Row,
|
1
|
+
import { Currency, ItemsInRow, PaginationInterface, PaginationOptions, QerkoCancellationInfo, Row, SubscribeToItemsInRowOptions, SubscribeToTaggedVideos, Tag, TilePropsPartial, UseCancelSubscription, CUSTOMER_BUILD, PLATFORM, WebRowProps, WebSeriesDetailScreenProps, AuthOverlayState, CreateUserWithEmailAndPassword, UseChannelSource } from '@tivio/common';
|
2
2
|
import { ComponentType } from 'react';
|
3
3
|
import { Logger } from '../services/logger';
|
4
4
|
import { FetchPackage } from '../services/packageLoader';
|
5
5
|
import { Disposer, Empty, Nullable } from './common';
|
6
|
-
import { Channel,
|
6
|
+
import { Channel, LangCode, RemoteProviderProps, Section, TivioSources, TivioWidgetProps, WebPlayerProps, Widget } from './types';
|
7
7
|
import type { AdSource, PlayerWrapper } from './customPlayer.types';
|
8
|
-
import type { Monetization, Purchase, QerkoPaymentInfo, Screen, SubscribeToItemsInRow, SubscribeToRowsInScreen, SubscribeToScreen, TvAppProps, User, UseSearch, Video } from '@tivio/common';
|
8
|
+
import type { Monetization, Purchase, QerkoPaymentInfo, Screen, SubscribeToItemsInRow, SubscribeToRowsInScreen, SubscribeToScreen, TvAppProps, User, UseSearch, UseTvChannel, Video } from '@tivio/common';
|
9
9
|
import type React from 'react';
|
10
10
|
declare type Settings = {
|
11
11
|
/**
|
@@ -47,7 +47,7 @@ declare type InternalConfig = {
|
|
47
47
|
error: string | null;
|
48
48
|
}>;
|
49
49
|
fetchPackage: FetchPackage;
|
50
|
-
language?:
|
50
|
+
language?: LangCode;
|
51
51
|
LoaderComponent?: ComponentType;
|
52
52
|
logger?: Logger | null;
|
53
53
|
pubSub: PubSub;
|
@@ -71,6 +71,11 @@ interface PubSub {
|
|
71
71
|
publish: <K extends keyof Events>(triggerName: K, payload: Events[K]) => Empty;
|
72
72
|
subscribe: <K extends keyof Events>(triggerName: K, onMessage: (data: Events[K]) => Empty) => Disposer;
|
73
73
|
}
|
74
|
+
export interface GenericOnCallError {
|
75
|
+
code: string;
|
76
|
+
message?: string;
|
77
|
+
details?: string[];
|
78
|
+
}
|
74
79
|
declare type Config = Pick<InternalConfig, 'bundleUrlOverride' | 'currency' | 'disableUnmounting' | 'capabilitiesOptions' | 'enable' | 'enableSentry' | 'ErrorComponent' | 'language' | 'LoaderComponent' | 'logger' | 'secret' | 'verbose' | 'forceCloudFnResolver'> & {
|
75
80
|
deviceCapabilities: PlayerCapability[] | 'auto';
|
76
81
|
/**
|
@@ -196,7 +201,7 @@ interface TivioAuth {
|
|
196
201
|
* @param email
|
197
202
|
* @param password
|
198
203
|
*/
|
199
|
-
createUserWithEmailAndPassword:
|
204
|
+
createUserWithEmailAndPassword: CreateUserWithEmailAndPassword;
|
200
205
|
/**
|
201
206
|
* Sign in the user and starts listening on his purchases
|
202
207
|
* @param email
|
@@ -205,15 +210,20 @@ interface TivioAuth {
|
|
205
210
|
signInWithEmailAndPassword: (email: string, password: string) => Promise<void>;
|
206
211
|
initializeUser: () => Promise<void>;
|
207
212
|
signOut: () => Promise<void>;
|
213
|
+
/**
|
214
|
+
* Used for reset forgotten password by user
|
215
|
+
*/
|
216
|
+
resetPassword: (email: string) => Promise<void>;
|
208
217
|
createFreePurchase: (monetizationId: string) => Promise<void>;
|
209
218
|
}
|
210
219
|
export interface RouterOverrides {
|
211
|
-
goToVideoDetailPage: (videoId: string
|
220
|
+
goToVideoDetailPage: (videoId: string) => void;
|
212
221
|
goToSeriesDetailPage: (tagId: string) => void;
|
213
|
-
goToPlayer: (videoId: string, type: ROW_ITEM_TYPES, rowId?: string) => void;
|
214
222
|
goToTagPage: (tagId: string) => void;
|
215
223
|
goToLoginScreen: () => void;
|
216
224
|
goBack: () => void;
|
225
|
+
goLivePlayer: (videoId: string) => void;
|
226
|
+
goVodPlayer: (tvChannelId: string) => void;
|
217
227
|
}
|
218
228
|
export interface RouterOverridesContextState {
|
219
229
|
routerOverrides: RouterOverrides;
|
@@ -250,6 +260,9 @@ declare type TivioComponents = {
|
|
250
260
|
tagId: string;
|
251
261
|
onError?: (error: Error) => void;
|
252
262
|
}>;
|
263
|
+
WebSearchScreen: React.ComponentType<{
|
264
|
+
searchQuery?: string;
|
265
|
+
}>;
|
253
266
|
WebRow: React.ComponentType<WebRowProps>;
|
254
267
|
WebTile: React.ComponentType<{
|
255
268
|
item?: Video | Tag;
|
@@ -286,7 +299,7 @@ declare type TivioHooks = {
|
|
286
299
|
usePurchaseRecovery: () => {
|
287
300
|
purchaseRecoveryResult?: string;
|
288
301
|
loading: boolean;
|
289
|
-
error?:
|
302
|
+
error?: GenericOnCallError;
|
290
303
|
purchaseRecovery: (monetizationId: string) => void;
|
291
304
|
};
|
292
305
|
useRowsInScreen: (screenId: string, options: PaginationOptions) => {
|
@@ -314,8 +327,9 @@ declare type TivioHooks = {
|
|
314
327
|
useApplyInviteCode: () => {
|
315
328
|
applyInviteCodeResult?: boolean;
|
316
329
|
loading: boolean;
|
317
|
-
error?:
|
330
|
+
error?: GenericOnCallError;
|
318
331
|
applyInviteCode: (code: string) => void;
|
332
|
+
inviteCodeReset: () => void;
|
319
333
|
};
|
320
334
|
};
|
321
335
|
export declare type UserPayload = Record<string, any>;
|
@@ -332,8 +346,9 @@ declare type TivioBundle = {
|
|
332
346
|
expirationDate: Date;
|
333
347
|
}) => Promise<QerkoPaymentInfo>;
|
334
348
|
cancelSubscriptionWithQerko: (subscriptionId: string) => Promise<QerkoCancellationInfo>;
|
335
|
-
setLanguage: (language:
|
349
|
+
setLanguage: (language: LangCode) => void;
|
336
350
|
setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
|
351
|
+
showConsentPreferences: () => void;
|
337
352
|
sources: TivioSources;
|
338
353
|
subscriptions: TivioSubscriptions;
|
339
354
|
internal: {
|
@@ -343,8 +358,10 @@ declare type TivioBundle = {
|
|
343
358
|
};
|
344
359
|
};
|
345
360
|
declare type TivioInternalComponents = {
|
346
|
-
|
347
|
-
WebLandingScreen: React.ComponentType
|
361
|
+
PrimaryButton: React.ComponentType;
|
362
|
+
WebLandingScreen: React.ComponentType<{
|
363
|
+
logo?: string;
|
364
|
+
}>;
|
348
365
|
WebVideoScreen: React.ComponentType<{
|
349
366
|
videoId: string;
|
350
367
|
}>;
|
@@ -360,9 +377,16 @@ declare type TivioInternalHooks = {
|
|
360
377
|
useOrganizationSubscriptions: () => {
|
361
378
|
subscriptions: Monetization[];
|
362
379
|
};
|
380
|
+
useIsMonetizationPurchased: () => {
|
381
|
+
isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
|
382
|
+
};
|
383
|
+
useReferralInfo: any;
|
384
|
+
useTvChannel: UseTvChannel;
|
385
|
+
useChannelSource: UseChannelSource;
|
363
386
|
useUser: () => {
|
364
387
|
user: User | null;
|
365
388
|
error: string | null;
|
389
|
+
isInitialized: boolean;
|
366
390
|
};
|
367
391
|
};
|
368
392
|
declare type TivioInternalProviders = {
|
@@ -384,12 +408,6 @@ declare type TivioInternalProviders = {
|
|
384
408
|
declare type TivioBundleFile = {
|
385
409
|
Tivio: TivioBundle;
|
386
410
|
};
|
387
|
-
declare type AuthOverlayType = 'login' | 'registration' | 'closed';
|
388
|
-
interface AuthOverlayState {
|
389
|
-
type: AuthOverlayType;
|
390
|
-
closeAuthOverlay: () => void;
|
391
|
-
openAuthOverlay: (type: AuthOverlayType) => void;
|
392
|
-
}
|
393
411
|
interface SubscriptionOverlayData {
|
394
412
|
subscriptions?: Monetization[];
|
395
413
|
onPurchase?: () => void;
|
@@ -423,4 +441,4 @@ declare type RemoteBundleState = {
|
|
423
441
|
declare type NewVoucher = {
|
424
442
|
expirationDate: Date | number;
|
425
443
|
};
|
426
|
-
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalComponents, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency,
|
444
|
+
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalComponents, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency, SubscriptionOverlayData, SubscriptionOverlayState, QerkoData, QerkoOverlayState, NewVoucher, };
|
package/dist/types/types.d.ts
CHANGED
@@ -11,7 +11,7 @@ declare type RemoteProviderProps = {
|
|
11
11
|
disableUnmounting?: boolean;
|
12
12
|
language?: string;
|
13
13
|
};
|
14
|
-
declare enum
|
14
|
+
declare enum LangCode {
|
15
15
|
CS = "cs",
|
16
16
|
DE = "de",
|
17
17
|
EN = "en",
|
@@ -20,9 +20,6 @@ declare enum Language {
|
|
20
20
|
SK = "sk",
|
21
21
|
SP = "sp"
|
22
22
|
}
|
23
|
-
interface UserData {
|
24
|
-
name?: string;
|
25
|
-
}
|
26
23
|
declare type Widget = {
|
27
24
|
id: string;
|
28
25
|
channels: Channel[];
|
@@ -162,7 +159,9 @@ interface WebPlayerProps {
|
|
162
159
|
*/
|
163
160
|
enableKeyboardShortcuts?: boolean;
|
164
161
|
onProgress?: (event: React.ChangeEvent<HTMLVideoElement>) => void;
|
165
|
-
|
162
|
+
/**
|
163
|
+
* @deprecated this callback is never called. Will be removed in @tivio/sdk-react version 4
|
164
|
+
*/
|
166
165
|
onPlayerControllerCreated?: (playerController: any) => void;
|
167
166
|
}
|
168
167
|
declare type TivioSources = {
|
@@ -171,5 +170,5 @@ declare type TivioSources = {
|
|
171
170
|
VodExternalSource: any;
|
172
171
|
VodTivioSource: any;
|
173
172
|
};
|
174
|
-
export type { RemoteProviderProps, WebPlayerProps, Marker, BetOffer, Purchase, Chapter, Widget, Channel, Section, Video, TivioSources,
|
175
|
-
export {
|
173
|
+
export type { RemoteProviderProps, WebPlayerProps, Marker, BetOffer, Purchase, Chapter, Widget, Channel, Section, Video, TivioSources, User, Monetization, VodTivioSourcePojo, ChannelSourcePojo, };
|
174
|
+
export { LangCode };
|
package/doc/changelog.md
ADDED
File without changes
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.4.0",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"typings": "dist/index.d.ts",
|
6
6
|
"source": "src/index.ts",
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"@material-ui/core": "^4.11.2",
|
29
29
|
"@material-ui/icons": "^4.11.2",
|
30
30
|
"@sentry/browser": "^6.1.0",
|
31
|
-
"@tivio/common": "1.1.
|
31
|
+
"@tivio/common": "1.1.86",
|
32
32
|
"es7-object-polyfill": "^1.0.1",
|
33
33
|
"firebase": "^8.2.3",
|
34
34
|
"formik": "^2.2.7",
|
@@ -51,14 +51,14 @@
|
|
51
51
|
"@types/jest": "^26.0.15",
|
52
52
|
"@types/node": "^12.0.0",
|
53
53
|
"@types/node-fetch": "^2.5.8",
|
54
|
-
"@types/react": "^17.0.
|
55
|
-
"@types/react-dom": "^17.0.
|
54
|
+
"@types/react": "^17.0.13",
|
55
|
+
"@types/react-dom": "^17.0.2",
|
56
56
|
"@types/react-router-dom": "^5.1.6",
|
57
57
|
"@types/react-virtualized": "^9.21.13",
|
58
58
|
"@types/styled-components": "^5.1.7",
|
59
59
|
"@typescript-eslint/eslint-plugin": "^4.14.0",
|
60
60
|
"@typescript-eslint/parser": "^4.14.2",
|
61
|
-
"dotenv": "^
|
61
|
+
"dotenv": "^9.0.0",
|
62
62
|
"eslint": "^7.19.0",
|
63
63
|
"fork-ts-checker-webpack-plugin": "^7.0.0",
|
64
64
|
"jest": "^27.0.1",
|
@@ -73,9 +73,6 @@
|
|
73
73
|
"ts-jest": "^26.4.4",
|
74
74
|
"typescript": "^4.1.3",
|
75
75
|
"web-vitals": "^1.0.1",
|
76
|
-
"webpack": "^5.15.0",
|
77
|
-
"webpack-cli": "^4.4.0",
|
78
|
-
"webpack-merge": "^5.7.3",
|
79
76
|
"yargs": "17"
|
80
77
|
}
|
81
78
|
}
|