@moneylion/react-native-offer-carousel 1.5.1 → 1.6.1
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/lib/commonjs/capabilities/configuration/src/userData/types.js +2 -0
- package/lib/commonjs/capabilities/configuration/src/userData/types.js.map +1 -0
- package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js +14 -3
- package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/commonjs/components/MoneyLionOfferCarousel.js +43 -10
- package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/commonjs/pageData.js +4 -2
- package/lib/commonjs/pageData.js.map +1 -1
- package/lib/commonjs/services/getDynamicOffers.js +6 -3
- package/lib/commonjs/services/getDynamicOffers.js.map +1 -1
- package/lib/commonjs/utils/getOffersByProductTypes.js +4 -2
- package/lib/commonjs/utils/getOffersByProductTypes.js.map +1 -1
- package/lib/module/capabilities/configuration/src/userData/types.js +2 -0
- package/lib/module/capabilities/configuration/src/userData/types.js.map +1 -0
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js +14 -3
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/module/components/MoneyLionOfferCarousel.js +43 -10
- package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/module/pageData.js +4 -2
- package/lib/module/pageData.js.map +1 -1
- package/lib/module/services/getDynamicOffers.js +6 -3
- package/lib/module/services/getDynamicOffers.js.map +1 -1
- package/lib/module/utils/getOffersByProductTypes.js +4 -2
- package/lib/module/utils/getOffersByProductTypes.js.map +1 -1
- package/lib/typescript/src/capabilities/configuration/src/userData/types.d.ts +4 -0
- package/lib/typescript/src/capabilities/configuration/src/userData/types.d.ts.map +1 -0
- package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts +2 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +1 -1
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts +2 -0
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
- package/lib/typescript/src/context/EventHandlerProvider.d.ts +5 -6
- package/lib/typescript/src/context/EventHandlerProvider.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/pageData.d.ts +11 -2
- package/lib/typescript/src/pageData.d.ts.map +1 -1
- package/lib/typescript/src/services/getDynamicOffers.d.ts +3 -1
- package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts +4 -1
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/configuration/src/userData/types.ts +3 -0
- package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +16 -2
- package/src/components/MoneyLionOfferCarousel.tsx +58 -19
- package/src/context/EventHandlerProvider.tsx +5 -5
- package/src/index.tsx +11 -0
- package/src/pageData.ts +14 -2
- package/src/services/getDynamicOffers.ts +5 -0
- package/src/utils/getOffersByProductTypes.ts +6 -1
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
PartnerOverride,
|
|
16
16
|
ProductTypeDefinition,
|
|
17
17
|
} from "../capabilities/offer-catalog/src";
|
|
18
|
+
import type { UserData } from "../capabilities/configuration/src/userData/types";
|
|
18
19
|
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
19
20
|
|
|
20
21
|
export type GetDynamicOffersProps = {
|
|
@@ -25,6 +26,7 @@ export type GetDynamicOffersProps = {
|
|
|
25
26
|
productTypesDefinition: ProductTypeDefinition[];
|
|
26
27
|
partnersOverrideDefinition: PartnerOverride[];
|
|
27
28
|
context: CnfContext;
|
|
29
|
+
userData?: UserData;
|
|
28
30
|
} & Omit<
|
|
29
31
|
GetProductTypesProps,
|
|
30
32
|
| "context"
|
|
@@ -50,6 +52,7 @@ export const getDynamicOffers = async ({
|
|
|
50
52
|
productTypesDefinition,
|
|
51
53
|
partnersOverrideDefinition,
|
|
52
54
|
context,
|
|
55
|
+
userData,
|
|
53
56
|
}: Omit<GetDynamicOffersProps, "isDev">) => {
|
|
54
57
|
// Get the initial offers
|
|
55
58
|
let { offers, rateTableUuid, isError, leadUuid, errorCode } =
|
|
@@ -58,6 +61,7 @@ export const getDynamicOffers = async ({
|
|
|
58
61
|
productTypes,
|
|
59
62
|
tags,
|
|
60
63
|
context,
|
|
64
|
+
userData,
|
|
61
65
|
});
|
|
62
66
|
|
|
63
67
|
// If no offers found, fall back to the default product type
|
|
@@ -67,6 +71,7 @@ export const getDynamicOffers = async ({
|
|
|
67
71
|
productTypes: [defaultProductType],
|
|
68
72
|
tags,
|
|
69
73
|
context,
|
|
74
|
+
userData,
|
|
70
75
|
});
|
|
71
76
|
|
|
72
77
|
// Update the offers, rateTableUuid, isError, leafUuid and productTypes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UserData } from "../capabilities/configuration/src/userData/types";
|
|
1
2
|
import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
|
|
2
3
|
import {
|
|
3
4
|
getCachedOffersByProductTypes,
|
|
@@ -12,6 +13,7 @@ import { parseClientTags } from "../capabilities/offer-catalog/src/utils/context
|
|
|
12
13
|
* @param {boolean} params.isCachedOffersRequest - Indicates if the offers should be retrieved from the cache.
|
|
13
14
|
* @param {string[]} params.productTypes - The product types to retrieve offers for.
|
|
14
15
|
* @param {string} params.tags - The tags to use for retrieving offers.
|
|
16
|
+
* @param {UserData} params.userData - Optional user data.
|
|
15
17
|
* @returns {Promise<OffersData>} A promise that resolves to an array of offers or undefined if no offers are found.
|
|
16
18
|
*/
|
|
17
19
|
export const getOffersByProductTypes = async ({
|
|
@@ -19,11 +21,13 @@ export const getOffersByProductTypes = async ({
|
|
|
19
21
|
productTypes,
|
|
20
22
|
tags,
|
|
21
23
|
context,
|
|
24
|
+
userData,
|
|
22
25
|
}: {
|
|
23
26
|
isCachedOffersRequest: boolean;
|
|
24
27
|
productTypes: string[];
|
|
25
28
|
tags: string;
|
|
26
29
|
context: CnfContext;
|
|
30
|
+
userData?: UserData;
|
|
27
31
|
}) => {
|
|
28
32
|
if (isCachedOffersRequest) {
|
|
29
33
|
const { offers, uuid, isError, leadUuid, errorCode } =
|
|
@@ -35,7 +39,8 @@ export const getOffersByProductTypes = async ({
|
|
|
35
39
|
const { offers, uuid, isError, leadUuid, errorCode } =
|
|
36
40
|
await getOffersForProductTypes(context)(
|
|
37
41
|
productTypes,
|
|
38
|
-
parseClientTags(tags)
|
|
42
|
+
parseClientTags(tags),
|
|
43
|
+
userData
|
|
39
44
|
);
|
|
40
45
|
|
|
41
46
|
return { offers, rateTableUuid: uuid, isError, leadUuid, errorCode };
|