@tivio/sdk-react 3.3.2 → 3.5.1

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,19 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ * 3.5.1
6
+ * patch: remove incorrect dependency (@tivio/types)
7
+
8
+ * 3.5.0
9
+ * minor: Types change - Video.price and Video.detailedPrice can be null
10
+ * minor: Types change - Video.cover is marked as deprecated
11
+
12
+ * v3.4.0
13
+ * minor: more precise type for errors in usePurchaseRecovery and usePurchaseRecovery
14
+ * patch: jsdocs for usePurchaseRecovery and usePurchaseRecovery
15
+ * minor: inviteCodeReset in useApplyInviteCode
16
+ * minor: Reset forgotten password
17
+ * minor: Consolidating monetization logic
5
18
  * v3.3.2
6
19
  * patch: Adding new optional parameters (where, orderBy) to useTaggedVideos hook
7
20
  * v3.3.1
@@ -29,7 +42,7 @@
29
42
  * patch: fix of @tivio/common version
30
43
  * v3.2.0
31
44
  * minor: Added `capabilitiesOptions` for finer configuration of device capabilities
32
- * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "Language"
45
+ * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "LangCode"
33
46
  * v3.1.3
34
47
  * patch: Hotfix made sure disabled Tivio does not break React Native
35
48
  * v3.1.2
@@ -531,8 +544,4 @@ useTaggedItems: (tagIds: string[], {limit?: number, noLimit?: boolean, fecthTags
531
544
  error: Error | null
532
545
  data: PaginationData<Video> | null
533
546
  }
534
-
535
-
536
- # Deprecations
537
- - Video.url will be removed in version 3.0.0, use Video.uri attribute instead
538
- - Video.cover will be removed in version 3.0.0, use Video.assets attribute instead
547
+ ```
package/README.md.bak CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ * 3.5.1
6
+ * patch: remove incorrect dependency (@tivio/types)
7
+
8
+ * 3.5.0
9
+ * minor: Types change - Video.price and Video.detailedPrice can be null
10
+ * minor: Types change - Video.cover is marked as deprecated
11
+
12
+ * v3.4.0
13
+ * minor: more precise type for errors in usePurchaseRecovery and usePurchaseRecovery
14
+ * patch: jsdocs for usePurchaseRecovery and usePurchaseRecovery
15
+ * minor: inviteCodeReset in useApplyInviteCode
16
+ * minor: Reset forgotten password
17
+ * minor: Consolidating monetization logic
5
18
  * v3.3.2
6
19
  * patch: Adding new optional parameters (where, orderBy) to useTaggedVideos hook
7
20
  * v3.3.1
@@ -29,19 +42,15 @@
29
42
  * patch: fix of @tivio/common version
30
43
  * v3.2.0
31
44
  * minor: Added `capabilitiesOptions` for finer configuration of device capabilities
32
- * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "Language"
45
+ * minor: tag names are returned in correct language (the one from tivio config); language value should be one from enum "LangCode"
33
46
  * v3.1.3
34
47
  * patch: Hotfix made sure disabled Tivio does not break React Native
35
- * internal: Fixed conf.bundleUrlOverride error handling
36
48
  * v3.1.2
37
49
  * patch: Allow `conf` prop of `TivioProvider` to be `null` or `undefined` in order to turn off Tivio
38
- * internal: Added `runFeatureSupportCheck` to `TivioProvider`
39
50
  * v3.1.1
40
51
  * patch: fixed `setUser()` crash when bundle fails to load
41
52
  * v3.1.0
42
- * internal: refactored `useAd`, `useAdSegment`
43
53
  * patch: `useAdSegment()` now returns null if no monetization is configured, ad segments are not managed in that situation
44
- * internal: fixed refactored `setUser()`
45
54
  * minor: enriched `AdSegment` type from `useAdSegment()`
46
55
  * minor: Added `setUser()` function for login and logout
47
56
  * v3.0.0
@@ -535,8 +544,4 @@ useTaggedItems: (tagIds: string[], {limit?: number, noLimit?: boolean, fecthTags
535
544
  error: Error | null
536
545
  data: PaginationData<Video> | null
537
546
  }
538
-
539
-
540
- # Deprecations
541
- - Video.url will be removed in version 3.0.0, use Video.uri attribute instead
542
- - Video.cover will be removed in version 3.0.0, use Video.assets attribute instead
547
+ ```
@@ -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';