@tivio/sdk-react 3.2.5 → 3.3.2
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 +9 -4
- package/README.md.bak +9 -4
- package/dist/components/hooks/usePurchaseSubscription.d.ts +1 -1
- package/dist/components/hooks/useScreen.d.ts +3 -5
- package/dist/components/hooks/useTransactionPayment.d.ts +1 -6
- package/dist/index.js +1 -1
- package/dist/services/login.d.ts +8 -1
- package/dist/types/bundle.types.d.ts +17 -3
- package/package.json +2 -2
- package/doc/changelog.md +0 -0
package/dist/services/login.d.ts
CHANGED
@@ -1,2 +1,9 @@
|
|
1
1
|
import type { UserPayload } from '../types/bundle.types';
|
2
|
-
|
2
|
+
/**
|
3
|
+
* Set user to sign in/out.
|
4
|
+
*
|
5
|
+
* Sign in - setUser('userID', { token: 'xxx' })
|
6
|
+
* Sign out - setUser(null)
|
7
|
+
*/
|
8
|
+
declare const setUser: (userId: string | null, payload?: UserPayload | undefined) => Promise<void>;
|
9
|
+
export { setUser };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Currency, ItemsInRow, PaginationInterface, PaginationOptions, QerkoCancellationInfo, Row, ROW_ITEM_TYPES, SubscribeToItemsInRowOptions, SubscribeToTaggedVideos, Tag, TilePropsPartial, UseCancelSubscription, CUSTOMER_BUILD, PLATFORM, WebRowProps } from '@tivio/common';
|
1
|
+
import { Currency, ItemsInRow, PaginationInterface, PaginationOptions, QerkoCancellationInfo, Row, ROW_ITEM_TYPES, SubscribeToItemsInRowOptions, SubscribeToTaggedVideos, Tag, TilePropsPartial, UseCancelSubscription, CUSTOMER_BUILD, PLATFORM, WebRowProps, WebSeriesDetailScreenProps } from '@tivio/common';
|
2
2
|
import { ComponentType } from 'react';
|
3
3
|
import { Logger } from '../services/logger';
|
4
4
|
import { FetchPackage } from '../services/packageLoader';
|
@@ -181,6 +181,11 @@ declare type TivioGetters = {
|
|
181
181
|
* @returns {Promise<Widget | null>} widget or null if widget does not exists
|
182
182
|
*/
|
183
183
|
getWidgetById: (widgetId: string) => Promise<Widget | null>;
|
184
|
+
/**
|
185
|
+
* Get player capabilities based on user's browser and OS as resolved by Tivio.
|
186
|
+
* @returns PlayerCapability[]
|
187
|
+
*/
|
188
|
+
getPlayerCapabilities: () => PlayerCapability[];
|
184
189
|
};
|
185
190
|
interface TivioAuth {
|
186
191
|
changePassword: (newPassword: string) => Promise<void>;
|
@@ -203,6 +208,8 @@ interface TivioAuth {
|
|
203
208
|
createFreePurchase: (monetizationId: string) => Promise<void>;
|
204
209
|
}
|
205
210
|
export interface RouterOverrides {
|
211
|
+
goToVideoDetailPage: (videoId: string, type: ROW_ITEM_TYPES, rowId?: string) => void;
|
212
|
+
goToSeriesDetailPage: (tagId: string) => void;
|
206
213
|
goToPlayer: (videoId: string, type: ROW_ITEM_TYPES, rowId?: string) => void;
|
207
214
|
goToTagPage: (tagId: string) => void;
|
208
215
|
goToLoginScreen: () => void;
|
@@ -326,7 +333,7 @@ declare type TivioBundle = {
|
|
326
333
|
}) => Promise<QerkoPaymentInfo>;
|
327
334
|
cancelSubscriptionWithQerko: (subscriptionId: string) => Promise<QerkoCancellationInfo>;
|
328
335
|
setLanguage: (language: Language) => void;
|
329
|
-
setUser: (userId: string, userPayload
|
336
|
+
setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
|
330
337
|
sources: TivioSources;
|
331
338
|
subscriptions: TivioSubscriptions;
|
332
339
|
internal: {
|
@@ -341,6 +348,7 @@ declare type TivioInternalComponents = {
|
|
341
348
|
WebVideoScreen: React.ComponentType<{
|
342
349
|
videoId: string;
|
343
350
|
}>;
|
351
|
+
WebSeriesDetailScreen: React.ComponentType<WebSeriesDetailScreenProps>;
|
344
352
|
};
|
345
353
|
declare type TivioInternalHooks = {
|
346
354
|
useAuthOverlay: () => AuthOverlayState;
|
@@ -409,4 +417,10 @@ declare type RemoteBundleState = {
|
|
409
417
|
settings: Settings;
|
410
418
|
state: 'loading' | 'error' | 'ready';
|
411
419
|
} & Nullable<TivioBundle>;
|
412
|
-
|
420
|
+
/**
|
421
|
+
* TODO: Duplicate, because we can't import types from core-js.
|
422
|
+
*/
|
423
|
+
declare type NewVoucher = {
|
424
|
+
expirationDate: Date | number;
|
425
|
+
};
|
426
|
+
export type { RemoteBundleState, Config, Settings, InternalConfig, TivioBundle, TivioBundleFile, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, TivioInternalComponents, TivioInternalHooks, TivioInternalProviders, Events, PubSub, PlayerCapability, Currency, AuthOverlayState, AuthOverlayType, SubscriptionOverlayData, SubscriptionOverlayState, QerkoData, QerkoOverlayState, NewVoucher, };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "3.2
|
3
|
+
"version": "3.3.2",
|
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.83",
|
32
32
|
"es7-object-polyfill": "^1.0.1",
|
33
33
|
"firebase": "^8.2.3",
|
34
34
|
"formik": "^2.2.7",
|
package/doc/changelog.md
DELETED
File without changes
|