@moneylion/react-native-offer-carousel 1.8.8 → 1.9.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.
Files changed (113) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/lib/commonjs/apiEnvironment.js +1 -7
  3. package/lib/commonjs/apiEnvironment.js.map +1 -1
  4. package/lib/commonjs/components/Common/BaseOfferCard/index.js.map +1 -1
  5. package/lib/commonjs/components/MoneyLionOfferCarousel.js +3 -8
  6. package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
  7. package/lib/commonjs/pageData.js +1 -12
  8. package/lib/commonjs/pageData.js.map +1 -1
  9. package/lib/commonjs/services/getDynamicOffers.js +1 -2
  10. package/lib/commonjs/services/getDynamicOffers.js.map +1 -1
  11. package/lib/commonjs/services/getProductTypes.js +3 -22
  12. package/lib/commonjs/services/getProductTypes.js.map +1 -1
  13. package/lib/commonjs/utils/index.js +0 -11
  14. package/lib/commonjs/utils/index.js.map +1 -1
  15. package/lib/commonjs/utils/resolveProductTypes.js.map +1 -1
  16. package/lib/commonjs/version.js +1 -1
  17. package/lib/module/apiEnvironment.js +0 -5
  18. package/lib/module/apiEnvironment.js.map +1 -1
  19. package/lib/module/components/Common/BaseOfferCard/index.js.map +1 -1
  20. package/lib/module/components/MoneyLionOfferCarousel.js +3 -8
  21. package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
  22. package/lib/module/pageData.js +1 -11
  23. package/lib/module/pageData.js.map +1 -1
  24. package/lib/module/services/getDynamicOffers.js +2 -3
  25. package/lib/module/services/getDynamicOffers.js.map +1 -1
  26. package/lib/module/services/getProductTypes.js +3 -22
  27. package/lib/module/services/getProductTypes.js.map +1 -1
  28. package/lib/module/utils/index.js +0 -1
  29. package/lib/module/utils/index.js.map +1 -1
  30. package/lib/module/utils/resolveProductTypes.js.map +1 -1
  31. package/lib/module/version.js +1 -1
  32. package/lib/typescript/src/apiEnvironment.d.ts +0 -4
  33. package/lib/typescript/src/apiEnvironment.d.ts.map +1 -1
  34. package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +1 -1
  35. package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts +0 -2
  36. package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
  37. package/lib/typescript/src/pageData.d.ts +0 -2
  38. package/lib/typescript/src/pageData.d.ts.map +1 -1
  39. package/lib/typescript/src/services/getDynamicOffers.d.ts +3 -4
  40. package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
  41. package/lib/typescript/src/services/getProductTypes.d.ts +2 -7
  42. package/lib/typescript/src/services/getProductTypes.d.ts.map +1 -1
  43. package/lib/typescript/src/utils/index.d.ts +0 -1
  44. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  45. package/lib/typescript/src/utils/resolveProductTypes.d.ts +0 -5
  46. package/lib/typescript/src/utils/resolveProductTypes.d.ts.map +1 -1
  47. package/lib/typescript/src/version.d.ts +1 -1
  48. package/package.json +2 -4
  49. package/src/apiEnvironment.ts +0 -6
  50. package/src/components/Common/BaseOfferCard/index.tsx +0 -2
  51. package/src/components/MoneyLionOfferCarousel.tsx +2 -11
  52. package/src/pageData.ts +2 -20
  53. package/src/services/getDynamicOffers.ts +4 -21
  54. package/src/services/getProductTypes.ts +5 -28
  55. package/src/utils/index.ts +0 -1
  56. package/src/utils/resolveProductTypes.ts +0 -5
  57. package/src/version.ts +1 -1
  58. package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js +0 -17
  59. package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js.map +0 -1
  60. package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +0 -33
  61. package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +0 -1
  62. package/lib/commonjs/components/Cards/VideosCard/VideoContent.js +0 -38
  63. package/lib/commonjs/components/Cards/VideosCard/VideoContent.js.map +0 -1
  64. package/lib/commonjs/components/Cards/VideosCard/VideosCard.js +0 -56
  65. package/lib/commonjs/components/Cards/VideosCard/VideosCard.js.map +0 -1
  66. package/lib/commonjs/components/Cards/index.js +0 -3
  67. package/lib/commonjs/components/Cards/index.js.map +0 -1
  68. package/lib/commonjs/components/Common/BaseOfferCard/ThumbsUpIcon.js +0 -29
  69. package/lib/commonjs/components/Common/BaseOfferCard/ThumbsUpIcon.js.map +0 -1
  70. package/lib/commonjs/services/getProductTypesByQuery.js +0 -72
  71. package/lib/commonjs/services/getProductTypesByQuery.js.map +0 -1
  72. package/lib/commonjs/utils/selectDynamicOffers.js +0 -13
  73. package/lib/commonjs/utils/selectDynamicOffers.js.map +0 -1
  74. package/lib/module/capabilities/core/src/domain/third-party-search/index.js +0 -2
  75. package/lib/module/capabilities/core/src/domain/third-party-search/index.js.map +0 -1
  76. package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +0 -26
  77. package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +0 -1
  78. package/lib/module/components/Cards/VideosCard/VideoContent.js +0 -37
  79. package/lib/module/components/Cards/VideosCard/VideoContent.js.map +0 -1
  80. package/lib/module/components/Cards/VideosCard/VideosCard.js +0 -55
  81. package/lib/module/components/Cards/VideosCard/VideosCard.js.map +0 -1
  82. package/lib/module/components/Cards/index.js +0 -2
  83. package/lib/module/components/Cards/index.js.map +0 -1
  84. package/lib/module/components/Common/BaseOfferCard/ThumbsUpIcon.js +0 -21
  85. package/lib/module/components/Common/BaseOfferCard/ThumbsUpIcon.js.map +0 -1
  86. package/lib/module/services/getProductTypesByQuery.js +0 -65
  87. package/lib/module/services/getProductTypesByQuery.js.map +0 -1
  88. package/lib/module/utils/selectDynamicOffers.js +0 -6
  89. package/lib/module/utils/selectDynamicOffers.js.map +0 -1
  90. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/index.d.ts +0 -2
  91. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/index.d.ts.map +0 -1
  92. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts +0 -19
  93. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts.map +0 -1
  94. package/lib/typescript/src/components/Cards/VideosCard/VideoContent.d.ts +0 -1
  95. package/lib/typescript/src/components/Cards/VideosCard/VideoContent.d.ts.map +0 -1
  96. package/lib/typescript/src/components/Cards/VideosCard/VideosCard.d.ts +0 -1
  97. package/lib/typescript/src/components/Cards/VideosCard/VideosCard.d.ts.map +0 -1
  98. package/lib/typescript/src/components/Cards/index.d.ts +0 -1
  99. package/lib/typescript/src/components/Cards/index.d.ts.map +0 -1
  100. package/lib/typescript/src/components/Common/BaseOfferCard/ThumbsUpIcon.d.ts +0 -3
  101. package/lib/typescript/src/components/Common/BaseOfferCard/ThumbsUpIcon.d.ts.map +0 -1
  102. package/lib/typescript/src/services/getProductTypesByQuery.d.ts +0 -30
  103. package/lib/typescript/src/services/getProductTypesByQuery.d.ts.map +0 -1
  104. package/lib/typescript/src/utils/selectDynamicOffers.d.ts +0 -3
  105. package/lib/typescript/src/utils/selectDynamicOffers.d.ts.map +0 -1
  106. package/src/capabilities/core/src/domain/third-party-search/index.ts +0 -1
  107. package/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.ts +0 -33
  108. package/src/components/Cards/VideosCard/VideoContent.tsx +0 -36
  109. package/src/components/Cards/VideosCard/VideosCard.tsx +0 -54
  110. package/src/components/Cards/index.ts +0 -1
  111. package/src/components/Common/BaseOfferCard/ThumbsUpIcon.tsx +0 -27
  112. package/src/services/getProductTypesByQuery.ts +0 -76
  113. package/src/utils/selectDynamicOffers.ts +0 -17
@@ -1 +0,0 @@
1
- {"version":3,"names":["pipe","getEwsSearchApiBaseUrl","orderProductTypesByRank","ErrorCodes","getApiErrorLogProperties","getProductTypesByQuery","query","searchAPIToken","isDev","onError","url","encodeURIComponent","headers","Authorization","response","fetch","ok","error","Error","code","status","productTypes","json","console","JSON","stringify","message","additionalInfo","FLOW_ERROR","severity"],"sourceRoot":"../../../src","sources":["services/getProductTypesByQuery.ts"],"mappings":"AAAA,SAASA,IAAI,QAAQ,QAAQ;AAC7B,SAASC,sBAAsB,QAAQ,mBAAmB;AAC1D,SAASC,uBAAuB,QAAQ,oDAAoD;AAC5F,SACCC,UAAU,QAGJ,8BAA8B;AACrC,SAASC,wBAAwB,QAAQ,gCAAgC;AASzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,sBAAsB,GAAG,MAAAA,CAAO;EAC5CC,KAAK;EACLC,cAAc;EACdC,KAAK;EACLC;AAC4B,CAAC,KAAK;EAClC,MAAMC,GAAG,GAAG,GAAGT,sBAAsB,CAACO,KAAK,CAAC,+BAA+BG,kBAAkB,CAACL,KAAK,CAAC,EAAE;EACtG,MAAMM,OAAO,GAAG;IACfC,aAAa,EAAE,UAAUN,cAAc;EACxC,CAAC;EACD,IAAI;IACH,MAAMO,QAAQ,GAAG,MAAMC,KAAK,CAACL,GAAG,EAAE;MAAEE;IAAQ,CAAC,CAAC;IAC9C,IAAI,CAACE,QAAQ,CAACE,EAAE,EAAE;MACjB,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC,CAAa;MACrCD,KAAK,CAACE,IAAI,GAAGL,QAAQ,CAACM,MAAM;MAC5B,MAAMH,KAAK;IACZ;IACA,MAAMI,YAAY,GAAG,MAAMP,QAAQ,CAACQ,IAAI,CAAC,CAAC;IAE1C,OAAOtB,IAAI,CAACqB,YAAY,EAAEnB,uBAAuB,CAAC;EACnD,CAAC,CAAC,OAAOe,KAAK,EAAE;IACfM,OAAO,CAACN,KAAK,CAAC,oCAAoC,EAAEO,IAAI,CAACC,SAAS,CAACR,KAAK,CAAC,CAAC;IAC1ER,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAG;MACTiB,OAAO,EAAE,wCAAwC;MACjDT,KAAK;MACLU,cAAc,EAAE;QACfrB,KAAK;QACLE;MACD,CAAC;MACD,IAAIJ,wBAAwB,CAACa,KAAK,CAAC,IAAI;QACtCE,IAAI,EAAEhB,UAAU,CAACyB,UAAU;QAC3BC,QAAQ,EAAE;MACX,CAAC;IACF,CAAC,CAAC;IAEF,OAAO,EAAE;EACV;AACD,CAAC","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- import { sortOffersByRecommendationScore } from "./sortOffersByRecommendationScore";
2
- export const selectDynamicOffers = (offers, productTypes) => {
3
- const resultOffers = productTypes.flatMap(productType => sortOffersByRecommendationScore(offers.filter(offer => offer.productType === productType))).slice(0, 10);
4
- return resultOffers;
5
- };
6
- //# sourceMappingURL=selectDynamicOffers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["sortOffersByRecommendationScore","selectDynamicOffers","offers","productTypes","resultOffers","flatMap","productType","filter","offer","slice"],"sourceRoot":"../../../src","sources":["utils/selectDynamicOffers.ts"],"mappings":"AACA,SAASA,+BAA+B,QAAQ,mCAAmC;AAEnF,OAAO,MAAMC,mBAAmB,GAAGA,CAClCC,MAAmB,EACnBC,YAAsB,KAClB;EACJ,MAAMC,YAAY,GAAGD,YAAY,CAC/BE,OAAO,CAAEC,WAAW,IACpBN,+BAA+B,CAC9BE,MAAM,CAACK,MAAM,CAAEC,KAAK,IAAKA,KAAK,CAACF,WAAW,KAAKA,WAAW,CAC3D,CACD,CAAC,CACAG,KAAK,CAAC,CAAC,EAAE,EAAE,CAAgB;EAE7B,OAAOL,YAAY;AACpB,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export * from "./orderProductTypesByRankUtils";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/capabilities/core/src/domain/third-party-search/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Orders product types by rank.
3
- *
4
- * @param productTypes {Record<string, number>} - The product types to order.
5
- * @returns {string[]} The product types ordered by rank.
6
- *
7
- * @example
8
- * ```ts
9
- * const productTypes = {
10
- * 'credit-card': 1,
11
- * 'loan': 2,
12
- * 'insurance': 3,
13
- * }
14
- * const orderedProductTypes = orderProductTypesByRank(productTypes)
15
- * // orderedProductTypes = ['insurance', 'loan', 'credit-card']
16
- * ```
17
- */
18
- export declare const orderProductTypesByRank: (productTypes: Record<string, number>) => string[];
19
- //# sourceMappingURL=orderProductTypesByRankUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orderProductTypesByRankUtils.d.ts","sourceRoot":"","sources":["../../../../../../../../src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,GACnC,cAAc,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAcpC,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=VideoContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoContent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Cards/VideosCard/VideoContent.tsx"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=VideosCard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideosCard.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Cards/VideosCard/VideosCard.tsx"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Cards/index.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- export declare const ThumbsUpIcon: () => React.JSX.Element;
3
- //# sourceMappingURL=ThumbsUpIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThumbsUpIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Common/BaseOfferCard/ThumbsUpIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,YAAY,yBAwBxB,CAAC"}
@@ -1,30 +0,0 @@
1
- import { type InternalOnErrorCallback } from "../capabilities/errors/types";
2
- type GetProductTypesByQueryProps = {
3
- query: string;
4
- searchAPIToken: string;
5
- isDev: boolean;
6
- onError?: InternalOnErrorCallback;
7
- };
8
- /**
9
- * Get product types by query
10
- * @param query {string} - The query to get the product types for
11
- * @param context The context to get the product types from
12
- * @returns {Promise<string[]>} The product types
13
- *
14
- * @example
15
- * ```ts
16
- * const productTypes = await getProductTypesByQuery('best credit cards', {
17
- * cnfEnv: {
18
- * THIRD_PARTY_SEARCH_API_URL: 'https://api.third-party-search.com',
19
- * THIRD_PARTY_SEARCH_API_TOKEN: 'your-token',
20
- * },
21
- * thirdPartySearchApiClient: makeThirdPartySearchApiClient,
22
- * })
23
- * // productTypes = ['credit-card', 'loan', 'insurance']
24
- * or
25
- * // productTypes = []
26
- * ```
27
- */
28
- export declare const getProductTypesByQuery: ({ query, searchAPIToken, isDev, onError, }: GetProductTypesByQueryProps) => Promise<string[]>;
29
- export {};
30
- //# sourceMappingURL=getProductTypesByQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getProductTypesByQuery.d.ts","sourceRoot":"","sources":["../../../../src/services/getProductTypesByQuery.ts"],"names":[],"mappings":"AAGA,OAAO,EAGN,KAAK,uBAAuB,EAC5B,MAAM,8BAA8B,CAAC;AAGtC,KAAK,2BAA2B,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,uBAAuB,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,sBAAsB,GAAU,4CAK1C,2BAA2B,sBAgC7B,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { BaseOffer } from "../capabilities/offer-catalog/src";
2
- export declare const selectDynamicOffers: (offers: BaseOffer[], productTypes: string[]) => BaseOffer[];
3
- //# sourceMappingURL=selectDynamicOffers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectDynamicOffers.d.ts","sourceRoot":"","sources":["../../../../src/utils/selectDynamicOffers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAGnE,eAAO,MAAM,mBAAmB,GAC/B,QAAQ,SAAS,EAAE,EACnB,cAAc,MAAM,EAAE,gBAWtB,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./orderProductTypesByRankUtils";
@@ -1,33 +0,0 @@
1
- /**
2
- * Orders product types by rank.
3
- *
4
- * @param productTypes {Record<string, number>} - The product types to order.
5
- * @returns {string[]} The product types ordered by rank.
6
- *
7
- * @example
8
- * ```ts
9
- * const productTypes = {
10
- * 'credit-card': 1,
11
- * 'loan': 2,
12
- * 'insurance': 3,
13
- * }
14
- * const orderedProductTypes = orderProductTypesByRank(productTypes)
15
- * // orderedProductTypes = ['insurance', 'loan', 'credit-card']
16
- * ```
17
- */
18
- export const orderProductTypesByRank = (
19
- productTypes: Record<string, number>
20
- ) => {
21
- const productTypesWithRank = Object.entries(productTypes).map(
22
- ([productType, count]) => ({
23
- productType,
24
- rank: count as number,
25
- })
26
- );
27
-
28
- const sortedProductTypes = productTypesWithRank.sort(
29
- (a, b) => b.rank - a.rank
30
- );
31
-
32
- return sortedProductTypes.map((pt) => pt.productType);
33
- };
@@ -1,36 +0,0 @@
1
- // "use client";
2
-
3
- // import { memo } from "react";
4
- // import React from "react";
5
- // import Text from "../../Text";
6
-
7
- // type Video = {
8
- // muxId: string;
9
- // subtitle: string;
10
- // };
11
-
12
- // export type VideoContentProps = Video;
13
-
14
- // export const VideoContent = memo(({ muxId, subtitle }: VideoContentProps) => (
15
- // <View gap={2} direction="column" width={27}>
16
- // <View width={27} height={48} borderRadius="large">
17
- // {/* TODO: Add the video player logic */}
18
- // <View key={`${muxId}`} />
19
- // {/* <VideoPlayer playbackId={muxId} /> */}
20
- // </View>
21
- // <Tooltip text={subtitle}>
22
- // {(attributes) => (
23
- // <Actionable attributes={attributes} as="div">
24
- // <Text
25
- // variant="caption-2"
26
- // weight="medium"
27
- // color="neutral-faded"
28
- // numberOfLines={2}
29
- // >
30
- // {subtitle}
31
- // </Text>
32
- // </Actionable>
33
- // )}
34
- // </Tooltip>
35
- // </View>
36
- // ));
@@ -1,54 +0,0 @@
1
- // import { memo } from "react";
2
- // import { VideoContent, type VideoContentProps } from "./VideoContent";
3
- // import { GenericOfferVertical } from "../../../../src/capabilities/ui/elements/src";
4
- // import React from "react";
5
- // import Text from "../../Text";
6
- // import { View, StyleSheet } from "react-native";
7
-
8
- // type VideosContent = {
9
- // title: string;
10
- // subtitle: string;
11
- // videos: VideoContentProps[];
12
- // };
13
-
14
- // export type VideosCardProps = {
15
- // videosContent: VideosContent;
16
- // showCardBorder: boolean;
17
- // };
18
-
19
- // export const VideosCard = memo(
20
- // ({
21
- // videosContent: { title, subtitle, videos },
22
- // showCardBorder,
23
- // }: VideosCardProps) => {
24
- // const renderVideos = () =>
25
- // videos.map((video) => <VideoContent key={video.muxId} {...video} />);
26
-
27
- // return (
28
- // <GenericOfferVertical showCardBorder={showCardBorder}>
29
- // <GenericOfferVertical.Container>
30
- // <View style={styles.textContainer}>
31
- // <Text variant="featured-2" weight="bold">
32
- // {title}
33
- // </Text>
34
- // <Text variant="body-3" weight="normal">
35
- // {subtitle}
36
- // </Text>
37
- // </View>
38
- // <View style={styles.videoContainer}>{renderVideos()}</View>
39
- // </GenericOfferVertical.Container>
40
- // </GenericOfferVertical>
41
- // );
42
- // }
43
- // );
44
-
45
- // const styles = StyleSheet.create({
46
- // textContainer: {
47
- // gap: 1,
48
- // },
49
- // videoContainer: {
50
- // flexDirection: "row",
51
- // gap: 3,
52
- // justifyContent: "space-between",
53
- // },
54
- // });
@@ -1 +0,0 @@
1
- // export * from "./VideosCard/VideosCard";
@@ -1,27 +0,0 @@
1
- import React from "react";
2
-
3
- export const ThumbsUpIcon = () => (
4
- <svg
5
- width="13"
6
- height="12"
7
- viewBox="0 0 13 12"
8
- fill="none"
9
- xmlns="http://www.w3.org/2000/svg"
10
- >
11
- <path
12
- d="M12.8349 4.99359L12.0782 7.71044C11.9052 8.33122 11.4165 8.8054 10.8156 8.97501C10.5694 9.04451 10.3256 8.85546 10.3256 8.5996C10.3256 8.42574 10.4407 8.27334 10.6081 8.22597C10.9522 8.12787 11.2329 7.85591 11.3314 7.50307L12.0885 4.78622C12.1765 4.47516 12.109 4.13304 11.9122 3.87382C11.7151 3.61438 11.404 3.46421 11.0825 3.46421H7.93031C7.82148 3.46421 7.71779 3.41751 7.64517 3.33461C7.57254 3.2517 7.53634 3.14265 7.54662 3.03383L7.68137 1.63406C7.71266 1.32814 7.52093 1.043 7.22528 0.949597C7.14238 0.923675 7.07489 0.954737 7.04897 1.01708L6.5987 2.14802C6.51937 2.34713 6.31937 2.47718 6.10641 2.45484C5.94596 2.43808 5.84541 2.34042 5.813 2.15071C5.79021 2.01707 5.81122 1.87965 5.86641 1.75607L6.33345 0.711163C6.52004 0.291278 6.99177 0.0734024 7.42752 0.208373C8.09612 0.410383 8.51622 1.043 8.44874 1.71697L8.37388 2.49551C8.36405 2.59808 8.44449 2.68657 8.54729 2.68657H11.0773C11.6425 2.68657 12.1868 2.95606 12.5292 3.40723C12.8713 3.85818 12.9855 4.44924 12.8349 4.99359Z"
13
- fill="black"
14
- fillOpacity="0.6"
15
- />
16
- <path
17
- d="M9.76404 5.48096C9.42192 5.03001 8.87756 4.76029 8.31243 4.76029H5.59066L5.68384 3.79092C5.71982 3.4307 5.61681 3.08254 5.41077 2.80523C5.23133 2.56389 4.97391 2.37618 4.6624 2.2821C4.22687 2.14735 3.75514 2.36501 3.56833 2.78511L2.43292 5.36185H1.00723C0.509358 5.36185 0.0999756 5.77146 0.0999756 6.26911V9.28115C0.0999756 9.77903 0.509358 10.1889 1.00723 10.1889H2.56275L3.0966 10.5725C3.59447 10.9303 4.18039 11.1167 4.79201 11.1167H7.5607C8.37477 11.1167 9.09544 10.5674 9.31309 9.78439L10.07 7.06776C10.2203 6.52341 10.1064 5.93191 9.76404 5.48096ZM9.32337 6.86017L8.5665 9.57679C8.44204 10.0228 8.02751 10.339 7.5607 10.339H4.79201C4.34084 10.339 3.91045 10.1991 3.54777 9.93992L2.91515 9.48361C2.84766 9.43691 2.7699 9.41098 2.687 9.41098H1.00723C0.934606 9.41098 0.877623 9.354 0.877623 9.28138V6.26933C0.877623 6.19671 0.934606 6.13973 1.00723 6.13973V6.13459H2.687C2.75046 6.13459 2.81124 6.11917 2.86509 6.09101C2.94353 6.05056 3.00789 5.98397 3.04476 5.90107L4.28385 3.09103C4.30978 3.02891 4.37704 2.99785 4.46017 3.02377C4.60877 3.0707 4.731 3.16612 4.8119 3.28813C4.89257 3.40902 4.93212 3.55583 4.91648 3.70801L4.78173 5.10778C4.77122 5.21683 4.80743 5.32565 4.88027 5.40878C4.9196 5.4537 4.9681 5.48811 5.02195 5.51001C5.06687 5.52878 5.11558 5.53839 5.16564 5.53839H8.31757C8.63913 5.53839 8.95019 5.68856 9.14728 5.94777C9.34415 6.20699 9.41141 6.54888 9.32337 6.86017Z"
18
- fill="black"
19
- fillOpacity="0.6"
20
- />
21
- <path
22
- d="M3.03448 6.92743V8.52965C3.03448 8.74216 2.85817 8.91848 2.64565 8.91848C2.43314 8.91848 2.25661 8.74216 2.25661 8.52965V6.92743C2.25661 6.71492 2.43314 6.53861 2.64565 6.53861C2.72677 6.53861 2.80253 6.5643 2.86509 6.60788C2.96699 6.67849 3.03448 6.79603 3.03448 6.92743Z"
23
- fill="black"
24
- fillOpacity="0.6"
25
- />
26
- </svg>
27
- );
@@ -1,76 +0,0 @@
1
- import { pipe } from "effect";
2
- import { getEwsSearchApiBaseUrl } from "../apiEnvironment";
3
- import { orderProductTypesByRank } from "../capabilities/core/src/domain/third-party-search";
4
- import {
5
- ErrorCodes,
6
- type ApiError,
7
- type InternalOnErrorCallback,
8
- } from "../capabilities/errors/types";
9
- import { getApiErrorLogProperties } from "../components/utils/errorUtils";
10
-
11
- type GetProductTypesByQueryProps = {
12
- query: string;
13
- searchAPIToken: string;
14
- isDev: boolean;
15
- onError?: InternalOnErrorCallback;
16
- };
17
-
18
- /**
19
- * Get product types by query
20
- * @param query {string} - The query to get the product types for
21
- * @param context The context to get the product types from
22
- * @returns {Promise<string[]>} The product types
23
- *
24
- * @example
25
- * ```ts
26
- * const productTypes = await getProductTypesByQuery('best credit cards', {
27
- * cnfEnv: {
28
- * THIRD_PARTY_SEARCH_API_URL: 'https://api.third-party-search.com',
29
- * THIRD_PARTY_SEARCH_API_TOKEN: 'your-token',
30
- * },
31
- * thirdPartySearchApiClient: makeThirdPartySearchApiClient,
32
- * })
33
- * // productTypes = ['credit-card', 'loan', 'insurance']
34
- * or
35
- * // productTypes = []
36
- * ```
37
- */
38
-
39
- export const getProductTypesByQuery = async ({
40
- query,
41
- searchAPIToken,
42
- isDev,
43
- onError,
44
- }: GetProductTypesByQueryProps) => {
45
- const url = `${getEwsSearchApiBaseUrl(isDev)}/search/product-types?query=${encodeURIComponent(query)}`;
46
- const headers = {
47
- Authorization: `Bearer ${searchAPIToken}`,
48
- };
49
- try {
50
- const response = await fetch(url, { headers });
51
- if (!response.ok) {
52
- const error = new Error() as ApiError;
53
- error.code = response.status;
54
- throw error;
55
- }
56
- const productTypes = await response.json();
57
-
58
- return pipe(productTypes, orderProductTypesByRank);
59
- } catch (error) {
60
- console.error("Error fetching ProductTypesByQuery", JSON.stringify(error));
61
- onError?.({
62
- message: "Failed to fetch product types by query",
63
- error,
64
- additionalInfo: {
65
- query,
66
- isDev,
67
- },
68
- ...(getApiErrorLogProperties(error) || {
69
- code: ErrorCodes.FLOW_ERROR,
70
- severity: "error",
71
- }),
72
- });
73
-
74
- return [];
75
- }
76
- };
@@ -1,17 +0,0 @@
1
- import type { BaseOffer } from "../capabilities/offer-catalog/src";
2
- import { sortOffersByRecommendationScore } from "./sortOffersByRecommendationScore";
3
-
4
- export const selectDynamicOffers = (
5
- offers: BaseOffer[],
6
- productTypes: string[]
7
- ) => {
8
- const resultOffers = productTypes
9
- .flatMap((productType) =>
10
- sortOffersByRecommendationScore(
11
- offers.filter((offer) => offer.productType === productType)
12
- )
13
- )
14
- .slice(0, 10) as BaseOffer[];
15
-
16
- return resultOffers;
17
- };