@tivio/sdk-react 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
package/.madgerc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "detectiveOptions": {
3
+ "ts": {
4
+ "skipTypeImports": true
5
+ }
6
+ }
7
+ }
package/README.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ * UNRELEASED
6
+
7
+ * v3.4.0
8
+ * minor: more precise type for errors in usePurchaseRecovery and usePurchaseRecovery
9
+ * patch: jsdocs for usePurchaseRecovery and usePurchaseRecovery
10
+ * minor: inviteCodeReset in useApplyInviteCode
11
+ * minor: Reset forgotten password
12
+ * minor: Consolidating monetization logic
13
+ * v3.3.2
14
+ * patch: Adding new optional parameters (where, orderBy) to useTaggedVideos hook
15
+ * v3.3.1
16
+ * patch: Fixed types of `setUser`
5
17
  * v3.3.0
6
18
  * minor: Add getPlayerCapabilities to getters.
7
19
  * patch: Added option to log out via `setUser(null)`, requires @tivio/core-react-dom@2.17.9
@@ -25,7 +37,7 @@
25
37
  * patch: fix of @tivio/common version
26
38
  * v3.2.0
27
39
  * minor: Added `capabilitiesOptions` for finer configuration of device capabilities
28
- * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "Language"
40
+ * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "LangCode"
29
41
  * v3.1.3
30
42
  * patch: Hotfix made sure disabled Tivio does not break React Native
31
43
  * v3.1.2
package/README.md.bak CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ * UNRELEASED
6
+
7
+ * v3.4.0
8
+ * minor: more precise type for errors in usePurchaseRecovery and usePurchaseRecovery
9
+ * patch: jsdocs for usePurchaseRecovery and usePurchaseRecovery
10
+ * minor: inviteCodeReset in useApplyInviteCode
11
+ * minor: Reset forgotten password
12
+ * minor: Consolidating monetization logic
13
+ * v3.3.2
14
+ * patch: Adding new optional parameters (where, orderBy) to useTaggedVideos hook
15
+ * v3.3.1
16
+ * patch: Fixed types of `setUser`
5
17
  * v3.3.0
6
18
  * minor: Add getPlayerCapabilities to getters.
7
19
  * patch: Added option to log out via `setUser(null)`, requires @tivio/core-react-dom@2.17.9
@@ -25,19 +37,15 @@
25
37
  * patch: fix of @tivio/common version
26
38
  * v3.2.0
27
39
  * minor: Added `capabilitiesOptions` for finer configuration of device capabilities
28
- * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "Language"
40
+ * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "LangCode"
29
41
  * v3.1.3
30
42
  * patch: Hotfix made sure disabled Tivio does not break React Native
31
- * internal: Fixed conf.bundleUrlOverride error handling
32
43
  * v3.1.2
33
44
  * patch: Allow `conf` prop of `TivioProvider` to be `null` or `undefined` in order to turn off Tivio
34
- * internal: Added `runFeatureSupportCheck` to `TivioProvider`
35
45
  * v3.1.1
36
46
  * patch: fixed `setUser()` crash when bundle fails to load
37
47
  * v3.1.0
38
- * internal: refactored `useAd`, `useAdSegment`
39
48
  * patch: `useAdSegment()` now returns null if no monetization is configured, ad segments are not managed in that situation
40
- * internal: fixed refactored `setUser()`
41
49
  * minor: enriched `AdSegment` type from `useAdSegment()`
42
50
  * minor: Added `setUser()` function for login and logout
43
51
  * v3.0.0
@@ -11,6 +11,7 @@ export * from './usePurchaseSubscription';
11
11
  export * from './contentHooks';
12
12
  export * from './playerHooks';
13
13
  export * from './useOrganizationSubscriptions';
14
+ export * from './useIsMonetizationPurchased';
14
15
  export * from './usePurchasesWithVideos';
15
16
  export * from './useFreePurchase';
16
17
  export * from './useRowsInScreen';
@@ -1,6 +1,17 @@
1
+ /**
2
+ * Is used to login user through different device in which user is already logged in.
3
+ * (e.g. login in tv app through web app)
4
+ *
5
+ * @return applyInviteCodeResult - true if code was applied successfully, false otherwise.
6
+ * loading - loading state
7
+ * error - error in case request failure
8
+ * applyInviteCode - function to apply invite code
9
+ * inviteCodeReset - function to reset to initial state
10
+ */
1
11
  export declare function useApplyInviteCode(): {
2
12
  applyInviteCodeResult?: boolean | undefined;
3
13
  loading: boolean;
4
- error?: any;
14
+ error?: import("../..").GenericOnCallError | undefined;
5
15
  applyInviteCode: (code: string) => void;
16
+ inviteCodeReset: () => void;
6
17
  };
@@ -0,0 +1,3 @@
1
+ export declare const useIsMonetizationPurchased: () => {
2
+ isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
3
+ };
@@ -1,6 +1,14 @@
1
+ /**
2
+ * Is used to mark purchase in recovery state as PAID.
3
+ *
4
+ * @return purchaseRecoveryResult - message describing result of the recovery
5
+ * loading - loading state
6
+ * error - error in case request failure
7
+ * purchaseRecovery - functions to execute purchase recovery
8
+ */
1
9
  export declare function usePurchaseRecovery(): {
2
10
  purchaseRecoveryResult?: string | undefined;
3
11
  loading: boolean;
4
- error?: any;
12
+ error?: import("../..").GenericOnCallError | undefined;
5
13
  purchaseRecovery: (monetizationId: string) => void;
6
14
  };
@@ -1,4 +1,5 @@
1
1
  export declare const useUser: () => {
2
2
  user: import("@tivio/common/dist/types/externalTypes/user").User | null;
3
3
  error: string | null;
4
+ isInitialized: boolean;
4
5
  };
@@ -11,7 +11,20 @@ declare type Voucher = {
11
11
  isUsed: boolean;
12
12
  isExpired: boolean;
13
13
  status: 'NEW' | 'USED';
14
- voucherInfo: any;
14
+ voucherInfo: SubscriptionInfo | TransactionInfo;
15
+ };
16
+ declare type SubscriptionInfo = {
17
+ type: 'subscription';
18
+ name: string;
19
+ benefits: string[];
20
+ frequency: string;
21
+ };
22
+ declare type TransactionInfo = {
23
+ type: 'transaction';
24
+ name: string;
25
+ videoId: string;
26
+ cover: string;
27
+ description: string;
15
28
  };
16
29
  declare const useVoucher: (voucherId: string) => {
17
30
  activate: (() => Promise<void>) | null;
@@ -21,5 +34,9 @@ declare const useVoucher: (voucherId: string) => {
21
34
  * (can be one of "DOES_NOT_EXIST", "EXPIRED" and "ALREADY_USED").
22
35
  */
23
36
  error: Error | BadRequestError | null;
37
+ /**
38
+ * True if voucher has been successfully activated in current session.
39
+ */
40
+ activationSuccess: boolean;
24
41
  };
25
42
  export { useVoucher, };
package/dist/index.d.ts CHANGED
@@ -18,3 +18,4 @@ export { Empty } from './types/common';
18
18
  export { Nullable } from './types/common';
19
19
  export * from './types/bundle.types';
20
20
  export { setUser } from './services/login';
21
+ export { showGdprConsentPreferences } from './services/gdpr';