@tivio/sdk-react 3.2.2 → 3.2.5

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
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+
6
+
7
+ * v3.2.5
8
+ * fix: added recovery flag to QerkoPaymentInfo type
9
+ * patch: bundle.types changes - internal.components.WebVideoScreen
10
+ * patch: types changes - add new onBack prop to WebPlayerProps
11
+ * patch: Refactor useVideo hook, now uses hook from core-react
12
+ * v3.2.4
13
+ * minor: added useApplyInviteCode
14
+ * minor: better errors from useVoucher
15
+ * v3.2.3
16
+ * minor: added usePurchaseRecovery hook
17
+ * patch: deprecated `useLastVideoByWidgetId`
5
18
  * v3.2.2
6
19
  * minor: useRowsInScreen, useItemsInRow, useTaggedVideos - hasNextPage and loading added to pagination
7
20
  * minor: useRowsInScreen, useItemsInRow, useTaggedVideos - implementation moved to remote bundle
package/README.md.bak CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+
6
+
7
+ * v3.2.5
8
+ * fix: added recovery flag to QerkoPaymentInfo type
9
+ * patch: bundle.types changes - internal.components.WebVideoScreen
10
+ * patch: types changes - add new onBack prop to WebPlayerProps
11
+ * patch: Refactor useVideo hook, now uses hook from core-react
12
+ * v3.2.4
13
+ * minor: added useApplyInviteCode
14
+ * minor: better errors from useVoucher
15
+ * v3.2.3
16
+ * minor: added usePurchaseRecovery hook
17
+ * patch: deprecated `useLastVideoByWidgetId`
5
18
  * v3.2.2
6
19
  * minor: useRowsInScreen, useItemsInRow, useTaggedVideos - hasNextPage and loading added to pagination
7
20
  * minor: useRowsInScreen, useItemsInRow, useTaggedVideos - implementation moved to remote bundle
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { RemoteBundleState } from '../services/bundleLoader';
2
+ import type { RemoteBundleState } from '../types/bundle.types';
3
3
  interface Props {
4
4
  bundleState: RemoteBundleState;
5
- children: any;
6
5
  }
7
6
  declare const ContextProvider: React.FC<Props>;
8
7
  export { ContextProvider, };
@@ -3,8 +3,7 @@
3
3
  * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
4
  */
5
5
  import React from 'react';
6
- import { RemoteBundleState } from '../services/bundleLoader';
7
- import { Config } from '../types/bundle.types';
6
+ import type { Config, RemoteBundleState } from '../types/bundle.types';
8
7
  export declare type TivioProviderProps = {
9
8
  /**
10
9
  * This prop must be set only once and not change value afterwards
@@ -29,8 +29,8 @@ declare const useSection: (sectionId: string) => {
29
29
  * @param videoId - video id
30
30
  */
31
31
  declare const useVideo: (videoId?: string | undefined) => {
32
- error: string | null;
33
32
  data: Video | null;
33
+ error: string | null;
34
34
  };
35
35
  /**
36
36
  * Use videos in section
@@ -6,6 +6,7 @@ export * from './useSearch';
6
6
  export * from './useItemsInRow';
7
7
  export * from './useCancelSubscription';
8
8
  export * from './useTransactionPayment';
9
+ export * from './usePurchaseRecovery';
9
10
  export * from './usePurchaseSubscription';
10
11
  export * from './contentHooks';
11
12
  export * from './playerHooks';
@@ -17,3 +18,4 @@ export * from './useVoucher';
17
18
  export * from './useTivio';
18
19
  export * from './useLastVideoByWidgetId';
19
20
  export * from './useWatchWithoutAdsOffer';
21
+ export * from './useApplyInviteCode';
@@ -0,0 +1,6 @@
1
+ export declare function useApplyInviteCode(): {
2
+ applyInviteCodeResult?: boolean | undefined;
3
+ loading: boolean;
4
+ error?: any;
5
+ applyInviteCode: (code: string) => void;
6
+ };
@@ -1,2 +1,5 @@
1
1
  import { Video } from '@tivio/common';
2
+ /**
3
+ * @deprecated will be removed in v4
4
+ */
2
5
  export declare function useLastVideoByWidgetId(widgetId: string): Video | null;
@@ -0,0 +1,6 @@
1
+ export declare function usePurchaseRecovery(): {
2
+ purchaseRecoveryResult?: string | undefined;
3
+ loading: boolean;
4
+ error?: any;
5
+ purchaseRecovery: (monetizationId: string) => void;
6
+ };
@@ -1,3 +1,8 @@
1
+ export declare type BadRequestError = Error & {
2
+ details?: {
3
+ reason?: 'DOES_NOT_EXIST' | 'EXPIRED' | 'ALREADY_USED';
4
+ };
5
+ };
1
6
  /**
2
7
  * TODO: Should be in core-js, we can't import types from it, though.
3
8
  */
@@ -11,6 +16,10 @@ declare type Voucher = {
11
16
  declare const useVoucher: (voucherId: string) => {
12
17
  activate: (() => Promise<void>) | null;
13
18
  voucher: Voucher | null;
14
- error: Error | null;
19
+ /**
20
+ * You can check error.details if you need to know error type when you want your own error messages
21
+ * (can be one of "DOES_NOT_EXIST", "EXPIRED" and "ALREADY_USED").
22
+ */
23
+ error: Error | BadRequestError | null;
15
24
  };
16
25
  export { useVoucher, };
package/dist/config.d.ts CHANGED
@@ -2,6 +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
+ /// <reference types="react" />
5
6
  import type { Config as ExternalConfig, InternalConfig } from './types/bundle.types';
6
7
  import type { Currency } from '@tivio/common';
7
8
  export declare const defaultConf: {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import 'whatwg-fetch';
2
+ import 'es7-object-polyfill';
1
3
  export { PlayerProvider, withPlayerContext } from './components/PlayerProvider';
2
4
  export type { PlayerProviderProps } from './components/PlayerProvider';
3
5
  export { bundlePromise } from './services/bundlePromise';
@@ -14,6 +16,5 @@ export * from './types/types';
14
16
  export { Disposer } from './types/common';
15
17
  export { Empty } from './types/common';
16
18
  export { Nullable } from './types/common';
17
- export { Config } from './types/bundle.types';
18
- export { TivioBundle, TivioHooks, TivioComponents, TivioAuth, TivioGetters, TivioSubscriptions, PlayerCapability, Currency, TivioInternalHooks, TivioInternalProviders, } from './types/bundle.types';
19
+ export * from './types/bundle.types';
19
20
  export { setUser } from './services/login';