@tivio/sdk-react 3.2.1 → 3.2.4
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 +11 -0
- package/README.md.bak +11 -0
- package/dist/components/hooks/index.d.ts +2 -0
- package/dist/components/hooks/useApplyInviteCode.d.ts +6 -0
- package/dist/components/hooks/useLastVideoByWidgetId.d.ts +3 -0
- package/dist/components/hooks/usePurchaseRecovery.d.ts +6 -0
- package/dist/components/hooks/useVoucher.d.ts +10 -1
- package/dist/config.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/info.d.ts +2 -0
- package/dist/services/bundleLoader.d.ts +1 -1
- package/dist/types/bundle.types.d.ts +73 -9
- package/package.json +6 -2
package/dist/info.d.ts
ADDED
@@ -2,7 +2,7 @@
|
|
2
2
|
* Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
|
3
3
|
* nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
4
4
|
*/
|
5
|
-
import { InternalConfig, RemoteBundleState, TivioBundle } from '
|
5
|
+
import { InternalConfig, RemoteBundleState, TivioBundle } from '../types/bundle.types';
|
6
6
|
/**
|
7
7
|
* @throws if fetch fails
|
8
8
|
*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Currency, QerkoCancellationInfo, ROW_ITEM_TYPES, SubscribeToTaggedVideos,
|
1
|
+
import { Currency, ItemsInRow, PaginationInterface, PaginationOptions, QerkoCancellationInfo, Row, ROW_ITEM_TYPES, SubscribeToItemsInRowOptions, SubscribeToTaggedVideos, Tag, TilePropsPartial, UseCancelSubscription } from '@tivio/common';
|
2
2
|
import { ComponentType } from 'react';
|
3
3
|
import { Logger } from '../services/logger';
|
4
4
|
import { FetchPackage } from '../services/packageLoader';
|
@@ -24,6 +24,10 @@ declare type InternalConfig = {
|
|
24
24
|
*/
|
25
25
|
bundleUrlOverride?: string;
|
26
26
|
currency: Currency;
|
27
|
+
/**
|
28
|
+
* Tells Tivio which technologies/protocols etc. is the device capable to play.
|
29
|
+
* If not provided, Tivio will try to guess it (based on the browser).
|
30
|
+
*/
|
27
31
|
deviceCapabilities: PlayerCapability[];
|
28
32
|
/**
|
29
33
|
* Additional options for deviceCapabilities
|
@@ -54,6 +58,10 @@ declare type InternalConfig = {
|
|
54
58
|
sdkVersion: string;
|
55
59
|
secret: string | null;
|
56
60
|
verbose?: boolean;
|
61
|
+
/**
|
62
|
+
* @private
|
63
|
+
*/
|
64
|
+
forceCloudFnResolver?: boolean;
|
57
65
|
};
|
58
66
|
declare type Events = {
|
59
67
|
'on-ready': RemoteBundleState;
|
@@ -63,7 +71,7 @@ interface PubSub {
|
|
63
71
|
publish: <K extends keyof Events>(triggerName: K, payload: Events[K]) => Empty;
|
64
72
|
subscribe: <K extends keyof Events>(triggerName: K, onMessage: (data: Events[K]) => Empty) => Disposer;
|
65
73
|
}
|
66
|
-
declare type Config = Pick<InternalConfig, 'bundleUrlOverride' | 'currency' | 'disableUnmounting' | 'capabilitiesOptions' | 'enable' | 'enableSentry' | 'ErrorComponent' | 'language' | 'LoaderComponent' | 'logger' | 'secret' | 'verbose'> & {
|
74
|
+
declare type Config = Pick<InternalConfig, 'bundleUrlOverride' | 'currency' | 'disableUnmounting' | 'capabilitiesOptions' | 'enable' | 'enableSentry' | 'ErrorComponent' | 'language' | 'LoaderComponent' | 'logger' | 'secret' | 'verbose' | 'forceCloudFnResolver'> & {
|
67
75
|
deviceCapabilities: PlayerCapability[] | 'auto';
|
68
76
|
/**
|
69
77
|
* @private
|
@@ -194,9 +202,14 @@ interface TivioAuth {
|
|
194
202
|
signOut: () => Promise<void>;
|
195
203
|
createFreePurchase: (monetizationId: string) => Promise<void>;
|
196
204
|
}
|
197
|
-
interface
|
198
|
-
goToPlayer
|
199
|
-
|
205
|
+
export interface RouterOverrides {
|
206
|
+
goToPlayer: (videoId: string, type: ROW_ITEM_TYPES, rowId?: string) => void;
|
207
|
+
goToTagPage: (tagId: string) => void;
|
208
|
+
goToLoginScreen: () => void;
|
209
|
+
goBack: () => void;
|
210
|
+
}
|
211
|
+
export interface RouterOverridesContextState {
|
212
|
+
routerOverrides: RouterOverrides;
|
200
213
|
}
|
201
214
|
declare type TivioComponents = {
|
202
215
|
AdIndicationButtonWeb: React.ReactNode;
|
@@ -205,6 +218,9 @@ declare type TivioComponents = {
|
|
205
218
|
Provider: React.ComponentType<RemoteProviderProps>;
|
206
219
|
Recommendation: React.ReactNode;
|
207
220
|
SkipButtonWeb: React.ReactNode;
|
221
|
+
/**
|
222
|
+
* @deprecated will be removed in in @tivio/sdk-react@4
|
223
|
+
*/
|
208
224
|
VideoAdBanner: React.ReactNode;
|
209
225
|
WebPlayer: React.ComponentType<WebPlayerProps>;
|
210
226
|
Widget: React.ComponentType<TivioWidgetProps>;
|
@@ -222,9 +238,15 @@ declare type TivioComponents = {
|
|
222
238
|
TvApp: React.ComponentType<TvAppProps>;
|
223
239
|
CustomerScreen: React.ComponentType<{
|
224
240
|
screenId: string;
|
225
|
-
}
|
226
|
-
|
227
|
-
|
241
|
+
}>;
|
242
|
+
WebTagScreen: React.ComponentType<{
|
243
|
+
tagId: string;
|
244
|
+
onError?: (error: Error) => void;
|
245
|
+
}>;
|
246
|
+
WebRow: React.ReactNode;
|
247
|
+
WebTile: React.ComponentType<{
|
248
|
+
item?: Video | Tag;
|
249
|
+
} & TilePropsPartial>;
|
228
250
|
FeatureSupportCheck: React.ComponentType<{}>;
|
229
251
|
};
|
230
252
|
declare type AdSegment = {
|
@@ -250,13 +272,40 @@ declare type TivioHooks = {
|
|
250
272
|
useAd: () => [(AdSource | null)];
|
251
273
|
useAdSegment: () => AdSegment | null;
|
252
274
|
useCancelSubscription: UseCancelSubscription;
|
275
|
+
useItemsInRow: (rowId: string, options: PaginationOptions) => {
|
276
|
+
pagination: PaginationInterface<ItemsInRow> | null;
|
277
|
+
error: Error | null;
|
278
|
+
};
|
279
|
+
usePurchaseRecovery: () => {
|
280
|
+
purchaseRecoveryResult?: string;
|
281
|
+
loading: boolean;
|
282
|
+
error?: any;
|
283
|
+
purchaseRecovery: (monetizationId: string) => void;
|
284
|
+
};
|
285
|
+
useRowsInScreen: (screenId: string, options: PaginationOptions) => {
|
286
|
+
pagination: PaginationInterface<Row> | null;
|
287
|
+
error: Error | null;
|
288
|
+
};
|
289
|
+
useTaggedVideos: (tagIds: string[], options: SubscribeToItemsInRowOptions) => {
|
290
|
+
pagination: PaginationInterface<Video> | null;
|
291
|
+
error: Error | null;
|
292
|
+
};
|
253
293
|
useSearch: UseSearch;
|
254
294
|
useVoucher: (voucherId: string) => any;
|
295
|
+
/**
|
296
|
+
* @deprecated will be removed in version
|
297
|
+
*/
|
255
298
|
useLastVideoByWidgetId: (widgetId: string) => Video | null;
|
256
299
|
useWatchWithoutAdsOffer: () => {
|
257
300
|
canPurchaseWatchWithoutAds: boolean;
|
258
301
|
showPurchaseDialog: () => void;
|
259
302
|
};
|
303
|
+
useApplyInviteCode: () => {
|
304
|
+
applyInviteCodeResult?: boolean;
|
305
|
+
loading: boolean;
|
306
|
+
error?: any;
|
307
|
+
applyInviteCode: (code: string) => void;
|
308
|
+
};
|
260
309
|
};
|
261
310
|
export declare type UserPayload = Record<string, any>;
|
262
311
|
declare type TivioBundle = {
|
@@ -277,11 +326,17 @@ declare type TivioBundle = {
|
|
277
326
|
sources: TivioSources;
|
278
327
|
subscriptions: TivioSubscriptions;
|
279
328
|
internal: {
|
329
|
+
components: TivioInternalComponents;
|
280
330
|
hooks: TivioInternalHooks;
|
281
331
|
providers: TivioInternalProviders;
|
282
332
|
};
|
283
333
|
};
|
334
|
+
declare type TivioInternalComponents = {
|
335
|
+
CustomButton: React.ComponentType;
|
336
|
+
WebLandingScreen: React.ComponentType;
|
337
|
+
};
|
284
338
|
declare type TivioInternalHooks = {
|
339
|
+
useAuthOverlay: () => AuthOverlayState;
|
285
340
|
useSubscriptionsOverlay: () => SubscriptionOverlayState;
|
286
341
|
useQerkoOverlay: () => QerkoOverlayState;
|
287
342
|
usePurchasesWithVideos: () => {
|
@@ -297,16 +352,25 @@ declare type TivioInternalHooks = {
|
|
297
352
|
};
|
298
353
|
declare type TivioInternalProviders = {
|
299
354
|
AppThemeProvider: React.ComponentType;
|
355
|
+
AuthOverlayContextProvider: React.ComponentType;
|
300
356
|
CustomerProvider: React.ComponentType;
|
357
|
+
ConfigProvider: React.ComponentType;
|
301
358
|
UserContextProvider: React.ComponentType;
|
302
359
|
SubscriptionOverlayContextProvider: React.ComponentType;
|
303
360
|
QerkoOverlayContextProvider: React.ComponentType;
|
304
361
|
PurchasesWithVideosContextProvider: React.ComponentType;
|
305
362
|
OrganizationSubscriptionsContextProvider: React.ComponentType;
|
363
|
+
RouterOverridesContextProvider: React.ComponentType<RouterOverridesContextState>;
|
306
364
|
};
|
307
365
|
declare type TivioBundleFile = {
|
308
366
|
Tivio: TivioBundle;
|
309
367
|
};
|
368
|
+
declare type AuthOverlayType = 'login' | 'registration' | 'closed';
|
369
|
+
interface AuthOverlayState {
|
370
|
+
type: AuthOverlayType;
|
371
|
+
closeAuthOverlay: () => void;
|
372
|
+
openAuthOverlay: (type: AuthOverlayType) => void;
|
373
|
+
}
|
310
374
|
interface SubscriptionOverlayData {
|
311
375
|
subscriptions?: Monetization[];
|
312
376
|
onPurchase?: () => void;
|
@@ -334,4 +398,4 @@ declare type RemoteBundleState = {
|
|
334
398
|
settings: Settings;
|
335
399
|
state: 'loading' | 'error' | 'ready';
|
336
400
|
} & Nullable<TivioBundle>;
|
337
|
-
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency, };
|
401
|
+
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalComponents, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency, };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.4",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"typings": "dist/index.d.ts",
|
6
6
|
"source": "src/index.ts",
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"scripts": {
|
12
12
|
"build": "bash ./scripts/build_prod.sh",
|
13
13
|
"build:dev": "bash ./scripts/build_dev.sh",
|
14
|
+
"build:local": "bash ./scripts/build_with_local_bundle.sh",
|
14
15
|
"start": "yarn ts-node ./scripts/start.ts",
|
15
16
|
"test": "jest --config=./jest.config.js --coverage",
|
16
17
|
"clean": "rm -rf dist",
|
@@ -27,7 +28,8 @@
|
|
27
28
|
"@material-ui/core": "^4.11.2",
|
28
29
|
"@material-ui/icons": "^4.11.2",
|
29
30
|
"@sentry/browser": "^6.1.0",
|
30
|
-
"@tivio/common": "1.1.
|
31
|
+
"@tivio/common": "1.1.80",
|
32
|
+
"es7-object-polyfill": "^1.0.1",
|
31
33
|
"firebase": "^8.2.3",
|
32
34
|
"formik": "^2.2.7",
|
33
35
|
"i18next": "^19.8.4",
|
@@ -38,6 +40,7 @@
|
|
38
40
|
"react-spring": "^9.2.4",
|
39
41
|
"react-virtualized": "^9.22.3",
|
40
42
|
"styled-components": "^5.2.1",
|
43
|
+
"whatwg-fetch": "^3.6.2",
|
41
44
|
"yup": "^0.32.9"
|
42
45
|
},
|
43
46
|
"devDependencies": {
|
@@ -57,6 +60,7 @@
|
|
57
60
|
"@typescript-eslint/parser": "^4.14.2",
|
58
61
|
"dotenv": "^8.2.0",
|
59
62
|
"eslint": "^7.19.0",
|
63
|
+
"fork-ts-checker-webpack-plugin": "^7.0.0",
|
60
64
|
"jest": "^27.0.1",
|
61
65
|
"jest-cli": "^26.6.3",
|
62
66
|
"jest-fetch-mock": "^3.0.3",
|