@moneylion/react-native-offer-carousel 1.9.0 → 1.10.0

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 (169) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/commonjs/apiEnvironment.js +1 -7
  3. package/lib/commonjs/apiEnvironment.js.map +1 -1
  4. package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js +0 -12
  5. package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -1
  6. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js +0 -16
  7. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -1
  8. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js +0 -120
  9. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
  10. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js +0 -39
  11. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -1
  12. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js +0 -19
  13. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -1
  14. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js +0 -10
  15. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -1
  16. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js +0 -39
  17. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -1
  18. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +0 -24
  19. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -1
  20. package/lib/commonjs/capabilities/errors/types/index.js +22 -1
  21. package/lib/commonjs/capabilities/errors/types/index.js.map +1 -1
  22. package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js +3 -3
  23. package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
  24. package/lib/commonjs/components/MoneyLionOfferCarousel.js +16 -13
  25. package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
  26. package/lib/commonjs/components/utils/errorUtils.js +2 -2
  27. package/lib/commonjs/components/utils/errorUtils.js.map +1 -1
  28. package/lib/commonjs/index.js +11 -0
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/pageData.js +1 -12
  31. package/lib/commonjs/pageData.js.map +1 -1
  32. package/lib/commonjs/services/getDynamicOffers.js +5 -4
  33. package/lib/commonjs/services/getDynamicOffers.js.map +1 -1
  34. package/lib/commonjs/services/getProductTypes.js +3 -22
  35. package/lib/commonjs/services/getProductTypes.js.map +1 -1
  36. package/lib/commonjs/utils/index.js +0 -11
  37. package/lib/commonjs/utils/index.js.map +1 -1
  38. package/lib/commonjs/utils/resolveProductTypes.js.map +1 -1
  39. package/lib/commonjs/version.js +1 -1
  40. package/lib/commonjs/version.js.map +1 -1
  41. package/lib/module/apiEnvironment.js +0 -5
  42. package/lib/module/apiEnvironment.js.map +1 -1
  43. package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js +1 -11
  44. package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -1
  45. package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js +1 -11
  46. package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -1
  47. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js +1 -115
  48. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
  49. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js +1 -34
  50. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -1
  51. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js +1 -14
  52. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -1
  53. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js +1 -5
  54. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -1
  55. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js +1 -34
  56. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -1
  57. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +1 -19
  58. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -1
  59. package/lib/module/capabilities/errors/types/index.js +21 -0
  60. package/lib/module/capabilities/errors/types/index.js.map +1 -1
  61. package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js +4 -4
  62. package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
  63. package/lib/module/components/MoneyLionOfferCarousel.js +17 -14
  64. package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
  65. package/lib/module/components/utils/errorUtils.js +3 -3
  66. package/lib/module/components/utils/errorUtils.js.map +1 -1
  67. package/lib/module/index.js +1 -0
  68. package/lib/module/index.js.map +1 -1
  69. package/lib/module/pageData.js +1 -11
  70. package/lib/module/pageData.js.map +1 -1
  71. package/lib/module/services/getDynamicOffers.js +6 -5
  72. package/lib/module/services/getDynamicOffers.js.map +1 -1
  73. package/lib/module/services/getProductTypes.js +3 -22
  74. package/lib/module/services/getProductTypes.js.map +1 -1
  75. package/lib/module/utils/index.js +0 -1
  76. package/lib/module/utils/index.js.map +1 -1
  77. package/lib/module/utils/resolveProductTypes.js.map +1 -1
  78. package/lib/module/version.js +1 -1
  79. package/lib/module/version.js.map +1 -1
  80. package/lib/typescript/src/apiEnvironment.d.ts +0 -4
  81. package/lib/typescript/src/apiEnvironment.d.ts.map +1 -1
  82. package/lib/typescript/src/capabilities/core/src/system/cnfContext/CnfContext.d.ts +15 -102
  83. package/lib/typescript/src/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +1 -1
  84. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/App.d.ts +10 -12
  85. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +1 -1
  86. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts +101 -472
  87. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +1 -1
  88. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts +24 -58
  89. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +1 -1
  90. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Request.d.ts +11 -15
  91. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +1 -1
  92. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Session.d.ts +4 -7
  93. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +1 -1
  94. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts +30 -63
  95. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +1 -1
  96. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts +17 -17
  97. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +1 -1
  98. package/lib/typescript/src/capabilities/errors/types/index.d.ts +18 -2
  99. package/lib/typescript/src/capabilities/errors/types/index.d.ts.map +1 -1
  100. package/lib/typescript/src/capabilities/offer-catalog/src/utils/contextUtil.d.ts +1 -1
  101. package/lib/typescript/src/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +1 -1
  102. package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts +11 -11
  103. package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts +0 -2
  104. package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
  105. package/lib/typescript/src/index.d.ts +1 -0
  106. package/lib/typescript/src/index.d.ts.map +1 -1
  107. package/lib/typescript/src/pageData.d.ts +0 -2
  108. package/lib/typescript/src/pageData.d.ts.map +1 -1
  109. package/lib/typescript/src/services/getDynamicOffers.d.ts +3 -4
  110. package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
  111. package/lib/typescript/src/services/getProductTypes.d.ts +2 -7
  112. package/lib/typescript/src/services/getProductTypes.d.ts.map +1 -1
  113. package/lib/typescript/src/utils/getOffersByProductTypes.d.ts +1 -1
  114. package/lib/typescript/src/utils/getProductTypesDefinition.d.ts +8 -8
  115. package/lib/typescript/src/utils/index.d.ts +0 -1
  116. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  117. package/lib/typescript/src/utils/resolveProductTypes.d.ts +0 -5
  118. package/lib/typescript/src/utils/resolveProductTypes.d.ts.map +1 -1
  119. package/lib/typescript/src/version.d.ts +1 -1
  120. package/lib/typescript/src/version.d.ts.map +1 -1
  121. package/package.json +2 -12
  122. package/src/apiEnvironment.ts +0 -6
  123. package/src/capabilities/core/src/system/cnfContext/CnfContext.ts +15 -20
  124. package/src/capabilities/core/src/system/cnfContext/schemas/App.ts +10 -13
  125. package/src/capabilities/core/src/system/cnfContext/schemas/Brand.ts +108 -148
  126. package/src/capabilities/core/src/system/cnfContext/schemas/Configuration.ts +21 -46
  127. package/src/capabilities/core/src/system/cnfContext/schemas/Request.ts +11 -16
  128. package/src/capabilities/core/src/system/cnfContext/schemas/Session.ts +4 -8
  129. package/src/capabilities/core/src/system/cnfContext/schemas/Signals.ts +30 -41
  130. package/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.ts +16 -24
  131. package/src/capabilities/errors/types/index.ts +30 -1
  132. package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +4 -4
  133. package/src/components/MoneyLionOfferCarousel.tsx +16 -17
  134. package/src/components/utils/errorUtils.ts +3 -3
  135. package/src/index.tsx +4 -0
  136. package/src/pageData.ts +2 -20
  137. package/src/services/getDynamicOffers.ts +14 -28
  138. package/src/services/getProductTypes.ts +5 -28
  139. package/src/utils/index.ts +0 -1
  140. package/src/utils/resolveProductTypes.ts +0 -5
  141. package/src/version.ts +1 -1
  142. package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js +0 -17
  143. package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js.map +0 -1
  144. package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +0 -33
  145. package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +0 -1
  146. package/lib/commonjs/services/getProductTypesByQuery.js +0 -72
  147. package/lib/commonjs/services/getProductTypesByQuery.js.map +0 -1
  148. package/lib/commonjs/utils/selectDynamicOffers.js +0 -13
  149. package/lib/commonjs/utils/selectDynamicOffers.js.map +0 -1
  150. package/lib/module/capabilities/core/src/domain/third-party-search/index.js +0 -2
  151. package/lib/module/capabilities/core/src/domain/third-party-search/index.js.map +0 -1
  152. package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +0 -26
  153. package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +0 -1
  154. package/lib/module/services/getProductTypesByQuery.js +0 -65
  155. package/lib/module/services/getProductTypesByQuery.js.map +0 -1
  156. package/lib/module/utils/selectDynamicOffers.js +0 -6
  157. package/lib/module/utils/selectDynamicOffers.js.map +0 -1
  158. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/index.d.ts +0 -2
  159. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/index.d.ts.map +0 -1
  160. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts +0 -19
  161. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts.map +0 -1
  162. package/lib/typescript/src/services/getProductTypesByQuery.d.ts +0 -30
  163. package/lib/typescript/src/services/getProductTypesByQuery.d.ts.map +0 -1
  164. package/lib/typescript/src/utils/selectDynamicOffers.d.ts +0 -3
  165. package/lib/typescript/src/utils/selectDynamicOffers.d.ts.map +0 -1
  166. package/src/capabilities/core/src/domain/third-party-search/index.ts +0 -1
  167. package/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.ts +0 -33
  168. package/src/services/getProductTypesByQuery.ts +0 -76
  169. package/src/utils/selectDynamicOffers.ts +0 -17
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC"}
@@ -1,12 +1,7 @@
1
- import type { InternalOnErrorCallback } from "../capabilities/errors/types";
2
1
  import { type ResultType } from "../services/getProductTypes";
3
2
  type ResolveProductTypesProps = {
4
3
  productType?: string;
5
- query?: string;
6
4
  defaultProductType: string;
7
- searchAPIToken: string;
8
- isDev: boolean;
9
- onError?: InternalOnErrorCallback;
10
5
  };
11
6
  export declare const resolveProductTypes: (props: ResolveProductTypesProps) => Promise<{
12
7
  productTypes: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"resolveProductTypes.d.ts","sourceRoot":"","sources":["../../../../src/utils/resolveProductTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE/E,KAAK,wBAAwB,GAAG;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,uBAAuB,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC/B,OAAO,wBAAwB,KAC7B,OAAO,CAAC;IACV,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACvB,CAEA,CAAC"}
1
+ {"version":3,"file":"resolveProductTypes.d.ts","sourceRoot":"","sources":["../../../../src/utils/resolveProductTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE/E,KAAK,wBAAwB,GAAG;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC/B,OAAO,wBAAwB,KAC7B,OAAO,CAAC;IACV,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACvB,CAEA,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.9.0";
1
+ export declare const VERSION = "1.10.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneylion/react-native-offer-carousel",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "React Native components for the Engine by MoneyLion Mobile SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -37,12 +37,8 @@
37
37
  "author": "",
38
38
  "license": "ISC",
39
39
  "devDependencies": {
40
- "@commitlint/config-conventional": "^17.0.2",
41
- "@release-it/conventional-changelog": "^5.0.0",
42
- "commitlint": "^17.0.2",
43
40
  "del-cli": "^5.1.0",
44
41
  "react-native-builder-bob": "^0.20.0",
45
- "release-it": "^15.0.0",
46
42
  "type-fest": "4.26.1"
47
43
  },
48
44
  "peerDependencies": {
@@ -50,11 +46,6 @@
50
46
  "react-native": "*",
51
47
  "react-native-svg": ">=15.11.0 <16"
52
48
  },
53
- "commitlint": {
54
- "extends": [
55
- "@commitlint/config-conventional"
56
- ]
57
- },
58
49
  "react-native-builder-bob": {
59
50
  "source": "src",
60
51
  "output": "lib",
@@ -70,8 +61,7 @@
70
61
  ]
71
62
  },
72
63
  "dependencies": {
73
- "defu": "6.1.4",
74
- "effect": "3.12.0",
64
+ "defu": "6.1.5",
75
65
  "numbro": "^2.5.0",
76
66
  "radash": "11.0.0",
77
67
  "react-native-markdown-display": "^7.0.2",
@@ -9,9 +9,3 @@ export const getConfigApiBaseUrl = (isDev: boolean): string =>
9
9
  */
10
10
  export const getOfferCatalogApiBaseUrl = (isDev: boolean): string =>
11
11
  isDev ? "https://dev-api.engine.tech" : "https://api.engine.tech";
12
-
13
- /**
14
- * Gets the base URL for the EWS Search API.
15
- */
16
- export const getEwsSearchApiBaseUrl = (isDev: boolean): string =>
17
- isDev ? "https://api.dev-ews.engine.tech" : "https://api.ews.engine.tech";
@@ -1,21 +1,16 @@
1
- import { Schema } from "effect";
2
- import {
3
- App,
4
- Brand,
5
- CnfRequest,
6
- Configuration,
7
- Signals,
8
- Subaccount,
9
- } from "./schemas";
1
+ import type { App } from "./schemas/App";
2
+ import type { Brand } from "./schemas/Brand";
3
+ import type { CnfRequest } from "./schemas/Request";
4
+ import type { Configuration } from "./schemas/Configuration";
5
+ import type { Signals } from "./schemas/Signals";
6
+ import type { Subaccount } from "./schemas/Subaccount";
10
7
 
11
- export const CnfContext = Schema.Struct({
12
- app: App,
13
- brand: Brand,
14
- configuration: Configuration,
15
- request: CnfRequest,
16
- signals: Signals,
17
- subaccount: Subaccount,
18
- isDev: Schema.Boolean,
19
- });
20
-
21
- export type CnfContext = Schema.Schema.Type<typeof CnfContext>;
8
+ export type CnfContext = {
9
+ app: App;
10
+ brand: Brand;
11
+ configuration: Configuration;
12
+ request: CnfRequest;
13
+ signals: Signals;
14
+ subaccount: Subaccount;
15
+ isDev: boolean;
16
+ };
@@ -1,13 +1,10 @@
1
- import { Schema } from "effect";
2
-
3
- export type App = Schema.Schema.Type<typeof App>;
4
- export const App = Schema.Struct({
5
- id: Schema.UUID,
6
- name: Schema.String,
7
- registry: Schema.String,
8
- repository: Schema.String,
9
- syncStatus: Schema.String,
10
- createdAt: Schema.String,
11
- updatedAt: Schema.String,
12
- syncTimestamp: Schema.String,
13
- });
1
+ export type App = {
2
+ id: string;
3
+ name: string;
4
+ registry: string;
5
+ repository: string;
6
+ syncStatus: string;
7
+ createdAt: string;
8
+ updatedAt: string;
9
+ syncTimestamp: string;
10
+ };
@@ -1,160 +1,120 @@
1
- import { Schema } from "effect";
2
-
3
- export type ReshapedThemeColorObject = Schema.Schema.Type<
4
- typeof ReshapedThemeColorObject
5
- >;
6
- const ReshapedThemeColorObject = Schema.Struct({
7
- hex: Schema.String,
8
- hexDark: Schema.optional(Schema.String),
9
- });
10
-
11
- export type ReshapedThemeColors = Schema.Schema.Type<
12
- typeof ReshapedThemeColors
13
- >;
14
- const ReshapedThemeColors = Schema.Struct({
15
- backgroundCritical: ReshapedThemeColorObject,
16
- backgroundCriticalFaded: ReshapedThemeColorObject,
17
- backgroundDisabled: ReshapedThemeColorObject,
18
- backgroundDisabledFaded: ReshapedThemeColorObject,
19
- backgroundElevationBase: ReshapedThemeColorObject,
20
- backgroundElevationOverlay: ReshapedThemeColorObject,
21
- backgroundElevationRaised: ReshapedThemeColorObject,
22
- backgroundNeutral: ReshapedThemeColorObject,
23
- backgroundNeutralFaded: ReshapedThemeColorObject,
24
- backgroundPage: ReshapedThemeColorObject,
25
- backgroundPageFaded: ReshapedThemeColorObject,
26
- backgroundPositive: ReshapedThemeColorObject,
27
- backgroundPositiveFaded: ReshapedThemeColorObject,
28
- backgroundPrimary: ReshapedThemeColorObject,
29
- backgroundPrimaryFaded: ReshapedThemeColorObject,
30
- backgroundWarning: ReshapedThemeColorObject,
31
- backgroundWarningFaded: ReshapedThemeColorObject,
32
- black: ReshapedThemeColorObject,
33
- borderCritical: ReshapedThemeColorObject,
34
- borderCriticalFaded: ReshapedThemeColorObject,
35
- borderDisabled: ReshapedThemeColorObject,
36
- borderNeutral: ReshapedThemeColorObject,
37
- borderNeutralFaded: ReshapedThemeColorObject,
38
- borderPositive: ReshapedThemeColorObject,
39
- borderPositiveFaded: ReshapedThemeColorObject,
40
- borderPrimary: ReshapedThemeColorObject,
41
- borderPrimaryFaded: ReshapedThemeColorObject,
42
- borderWarning: ReshapedThemeColorObject,
43
- borderWarningFaded: ReshapedThemeColorObject,
44
- brand: ReshapedThemeColorObject,
45
- foregroundCritical: ReshapedThemeColorObject,
46
- foregroundDisabled: ReshapedThemeColorObject,
47
- foregroundNeutral: ReshapedThemeColorObject,
48
- foregroundNeutralFaded: ReshapedThemeColorObject,
49
- foregroundPositive: ReshapedThemeColorObject,
50
- foregroundPrimary: ReshapedThemeColorObject,
51
- foregroundWarning: ReshapedThemeColorObject,
52
- white: ReshapedThemeColorObject,
53
- });
1
+ export type ReshapedThemeColorObject = {
2
+ hex: string;
3
+ hexDark?: string;
4
+ };
54
5
 
55
- export type Links = Schema.Schema.Type<typeof Links>;
56
- const Links = Schema.Struct({
57
- home: Schema.optional(Schema.String),
58
- terms: Schema.optional(Schema.String),
59
- support: Schema.optional(Schema.String),
60
- privacy: Schema.optional(Schema.String),
61
- });
6
+ export type ReshapedThemeColors = {
7
+ backgroundCritical: ReshapedThemeColorObject;
8
+ backgroundCriticalFaded: ReshapedThemeColorObject;
9
+ backgroundDisabled: ReshapedThemeColorObject;
10
+ backgroundDisabledFaded: ReshapedThemeColorObject;
11
+ backgroundElevationBase: ReshapedThemeColorObject;
12
+ backgroundElevationOverlay: ReshapedThemeColorObject;
13
+ backgroundElevationRaised: ReshapedThemeColorObject;
14
+ backgroundNeutral: ReshapedThemeColorObject;
15
+ backgroundNeutralFaded: ReshapedThemeColorObject;
16
+ backgroundPage: ReshapedThemeColorObject;
17
+ backgroundPageFaded: ReshapedThemeColorObject;
18
+ backgroundPositive: ReshapedThemeColorObject;
19
+ backgroundPositiveFaded: ReshapedThemeColorObject;
20
+ backgroundPrimary: ReshapedThemeColorObject;
21
+ backgroundPrimaryFaded: ReshapedThemeColorObject;
22
+ backgroundWarning: ReshapedThemeColorObject;
23
+ backgroundWarningFaded: ReshapedThemeColorObject;
24
+ black: ReshapedThemeColorObject;
25
+ borderCritical: ReshapedThemeColorObject;
26
+ borderCriticalFaded: ReshapedThemeColorObject;
27
+ borderDisabled: ReshapedThemeColorObject;
28
+ borderNeutral: ReshapedThemeColorObject;
29
+ borderNeutralFaded: ReshapedThemeColorObject;
30
+ borderPositive: ReshapedThemeColorObject;
31
+ borderPositiveFaded: ReshapedThemeColorObject;
32
+ borderPrimary: ReshapedThemeColorObject;
33
+ borderPrimaryFaded: ReshapedThemeColorObject;
34
+ borderWarning: ReshapedThemeColorObject;
35
+ borderWarningFaded: ReshapedThemeColorObject;
36
+ brand: ReshapedThemeColorObject;
37
+ foregroundCritical: ReshapedThemeColorObject;
38
+ foregroundDisabled: ReshapedThemeColorObject;
39
+ foregroundNeutral: ReshapedThemeColorObject;
40
+ foregroundNeutralFaded: ReshapedThemeColorObject;
41
+ foregroundPositive: ReshapedThemeColorObject;
42
+ foregroundPrimary: ReshapedThemeColorObject;
43
+ foregroundWarning: ReshapedThemeColorObject;
44
+ white: ReshapedThemeColorObject;
45
+ };
62
46
 
63
- export type AiInference = Schema.Schema.Type<typeof AiInference>;
64
- const AiInference = Schema.Struct({
65
- status: Schema.String,
66
- error: Schema.optional(Schema.String),
67
- });
47
+ export type Links = {
48
+ home?: string;
49
+ terms?: string;
50
+ support?: string;
51
+ privacy?: string;
52
+ };
68
53
 
69
- export type Media = Schema.Schema.Type<typeof Media>;
70
- const Media = Schema.Struct({
71
- id: Schema.String,
72
- autoCrop: Schema.Boolean,
73
- prefix: Schema.optional(Schema.String),
74
- alt: Schema.optional(Schema.String),
75
- url: Schema.optional(Schema.String),
76
- filename: Schema.optional(Schema.String),
77
- mimeType: Schema.optional(Schema.String),
78
- filesize: Schema.optional(Schema.Number),
79
- width: Schema.optional(Schema.Number),
80
- height: Schema.optional(Schema.Number),
81
- createdAt: Schema.optional(Schema.String),
82
- updatedAt: Schema.optional(Schema.String),
83
- aiInference: Schema.optional(AiInference),
84
- });
54
+ export type AiInference = {
55
+ status: string;
56
+ error?: string;
57
+ };
85
58
 
86
- export type Logos = Schema.Schema.Type<typeof Logos>;
87
- const Logos = Schema.Struct({
88
- horizontal: Schema.optional(Media),
89
- icon: Schema.optional(Schema.NullOr(Media)),
90
- });
59
+ export type Media = {
60
+ id: string;
61
+ autoCrop: boolean;
62
+ prefix?: string;
63
+ alt?: string;
64
+ url?: string;
65
+ filename?: string;
66
+ mimeType?: string;
67
+ filesize?: number;
68
+ width?: number;
69
+ height?: number;
70
+ createdAt?: string;
71
+ updatedAt?: string;
72
+ aiInference?: AiInference;
73
+ };
91
74
 
92
- export type FontFamily = Schema.Schema.Type<typeof FontFamily>;
93
- const FontFamily = Schema.Literal(
94
- "nunito",
95
- "lato",
96
- "sourceSans3",
97
- "openSans",
98
- "roboto",
99
- "arimo",
100
- "montserrat"
101
- );
75
+ export type Logos = {
76
+ horizontal?: Media;
77
+ icon?: Media | null;
78
+ };
102
79
 
103
- export type Font = Schema.Schema.Type<typeof Font>;
104
- const Font = Schema.Struct({
105
- family: Schema.optional(FontFamily),
106
- });
80
+ export type FontFamily =
81
+ | "nunito"
82
+ | "lato"
83
+ | "sourceSans3"
84
+ | "openSans"
85
+ | "roboto"
86
+ | "arimo"
87
+ | "montserrat";
107
88
 
108
- export type AllowedMarks = Schema.Schema.Type<typeof AllowedMarks>;
109
- const AllowedMarks = Schema.Struct({
110
- logo: Schema.Boolean,
111
- name: Schema.Boolean,
112
- });
89
+ export type Font = {
90
+ family?: FontFamily;
91
+ };
113
92
 
114
- export type CtaRoundness = Schema.Schema.Type<typeof CtaRoundness>;
115
- const CtaRoundness = Schema.Struct({
116
- small: Schema.optional(Schema.Number),
117
- medium: Schema.optional(Schema.Number),
118
- large: Schema.optional(Schema.Number),
119
- });
93
+ export type AllowedMarks = {
94
+ logo: boolean;
95
+ name: boolean;
96
+ };
120
97
 
121
- type BrandFields = Schema.Schema.Type<typeof BrandFields>;
122
- const BrandFields = Schema.Struct({
123
- id: Schema.String,
124
- domain: Schema.String,
125
- displayName: Schema.String,
126
- isLicensed: Schema.optional(Schema.Boolean),
127
- hideLicensedLogo: Schema.optional(Schema.Boolean),
128
- reshapedThemeColors: ReshapedThemeColors,
129
- links: Schema.optional(Links),
130
- logos: Schema.optional(Logos),
131
- font: Schema.optional(Font),
132
- type: Schema.optional(Schema.Literal("business", "product", "individual")),
133
- allowedMarks: AllowedMarks,
134
- ctaRoundness: Schema.optional(CtaRoundness),
135
- createdAt: Schema.optional(Schema.String),
136
- updatedAt: Schema.optional(Schema.String),
137
- });
98
+ export type CtaRoundness = {
99
+ small?: number;
100
+ medium?: number;
101
+ large?: number;
102
+ };
138
103
 
139
- export type Brand = BrandFields & {
104
+ export type Brand = {
105
+ id: string;
106
+ domain: string;
107
+ displayName: string;
108
+ isLicensed?: boolean;
109
+ hideLicensedLogo?: boolean;
110
+ reshapedThemeColors: ReshapedThemeColors;
111
+ links?: Links;
112
+ logos?: Logos;
113
+ font?: Font;
114
+ type?: "business" | "product" | "individual";
115
+ allowedMarks: AllowedMarks;
116
+ ctaRoundness?: CtaRoundness;
117
+ createdAt?: string;
118
+ updatedAt?: string;
140
119
  licensedBrand?: Brand | null;
141
120
  };
142
-
143
- export const Brand = Schema.suspend((): Schema.Schema<Brand> => {
144
- const withDepth = (
145
- depth: number
146
- ): Schema.Schema<Brand> | Schema.Schema<BrandFields> => {
147
- if (depth > 2) {
148
- return BrandFields; // We don't want infinite recursion of licensedBrand field
149
- }
150
-
151
- return Schema.Struct({
152
- ...BrandFields.fields,
153
- licensedBrand: Schema.optional(
154
- Schema.NullOr(Schema.suspend(() => withDepth(depth + 1)))
155
- ),
156
- });
157
- };
158
-
159
- return withDepth(0); // Start with depth 0
160
- });
@@ -1,49 +1,24 @@
1
- import { Schema } from "effect";
1
+ type ProductTypesDefinition = {
2
+ id: string;
3
+ partnerPageUrl: string;
4
+ productTypeSlug: string;
5
+ };
2
6
 
3
- const ProductTypesDefinition = Schema.Struct({
4
- id: Schema.String,
5
- partnerPageUrl: Schema.String,
6
- productTypeSlug: Schema.String,
7
- });
7
+ type PartnersOverrideDefinition = {
8
+ id: string;
9
+ overrideUrl: string;
10
+ financialInstitutionUuid: string;
11
+ };
8
12
 
9
- const PartnersOverrideDefinition = Schema.Struct({
10
- id: Schema.String,
11
- overrideUrl: Schema.String,
12
- financialInstitutionUuid: Schema.String,
13
- });
13
+ export type DynamicOffersConfigurationSchema = {
14
+ hideFooter: boolean;
15
+ enableUseCachedOffers: boolean;
16
+ defaultProductTypeSlug: string;
17
+ productTypesDefinition: ProductTypesDefinition[];
18
+ partnersOverrideDefinition: PartnersOverrideDefinition[];
19
+ };
14
20
 
15
- export const DynamicOffersConfigurationSchema = Schema.Struct({
16
- hideFooter: Schema.optionalWith(Schema.Boolean, { default: () => false }),
17
- enableUseCachedOffers: Schema.optionalWith(Schema.Boolean, {
18
- default: () => false,
19
- }),
20
- defaultProductTypeSlug: Schema.optionalWith(Schema.String, {
21
- default: () => "EarnedWageAccess",
22
- }),
23
- productTypesDefinition: Schema.optionalWith(
24
- Schema.Array(ProductTypesDefinition),
25
- {
26
- default: () => [],
27
- }
28
- ),
29
- partnersOverrideDefinition: Schema.optionalWith(
30
- Schema.Array(PartnersOverrideDefinition),
31
- { default: () => [] }
32
- ),
33
- });
34
-
35
- export type DynamicOffersConfigurationSchema = Schema.Schema.Type<
36
- typeof DynamicOffersConfigurationSchema
37
- >;
38
-
39
- export const Configuration = Schema.Struct({
40
- app: Schema.Union(
41
- Schema.String,
42
- Schema.Struct({
43
- name: Schema.String,
44
- })
45
- ),
46
- configuration: DynamicOffersConfigurationSchema,
47
- });
48
-
49
- export type Configuration = Schema.Schema.Type<typeof Configuration>;
21
+ export type Configuration = {
22
+ app: string | { name: string };
23
+ configuration: DynamicOffersConfigurationSchema;
24
+ };
@@ -1,16 +1,11 @@
1
- import { Schema } from "effect";
2
-
3
- export type CnfRequest = Schema.Schema.Type<typeof CnfRequest>;
4
- export const CnfRequest = Schema.Struct({
5
- referer: Schema.optional(Schema.String),
6
- channel: Schema.optional(Schema.String),
7
- zone: Schema.optional(Schema.String),
8
- cnfAppBaseUrl: Schema.optionalWith(Schema.String, {
9
- default: () => "http://localhost:3000",
10
- }),
11
- path: Schema.optional(Schema.String),
12
- pathname: Schema.optional(Schema.String),
13
- query: Schema.optional(Schema.String),
14
- searchParams: Schema.Struct({}),
15
- host: Schema.optional(Schema.String),
16
- });
1
+ export type CnfRequest = {
2
+ referer?: string;
3
+ channel?: string;
4
+ zone?: string;
5
+ cnfAppBaseUrl?: string;
6
+ path?: string;
7
+ pathname?: string;
8
+ query?: string;
9
+ searchParams: Record<string, never>;
10
+ host?: string;
11
+ };
@@ -1,9 +1,5 @@
1
- import { Schema } from "effect";
1
+ export type SessionId = string;
2
2
 
3
- export type SessionId = Schema.Schema.Type<typeof SessionId>;
4
- export const SessionId = Schema.UUID.pipe(Schema.brand("SessionId"));
5
-
6
- export type Session = Schema.Schema.Type<typeof Session>;
7
- export const Session = Schema.Struct({
8
- id: SessionId,
9
- });
3
+ export type Session = {
4
+ id: SessionId;
5
+ };
@@ -1,47 +1,36 @@
1
- import { Schema } from "effect";
1
+ export type PartnerSignals = {
2
+ clientTags: Record<string, string>;
3
+ };
2
4
 
3
- export type PartnerSignals = Schema.Schema.Type<typeof PartnerSignals>;
4
- export const PartnerSignals = Schema.Struct({
5
- clientTags: Schema.Struct({}, { key: Schema.String, value: Schema.String }),
6
- });
5
+ export type DeviceId = string;
7
6
 
8
- export type DeviceId = Schema.Schema.Type<typeof DeviceId>;
9
- export const DeviceId = Schema.UUID;
7
+ export type DeviceSignals = {
8
+ id: DeviceId;
9
+ ipAddress?: string;
10
+ os?: string;
11
+ isMobile?: boolean;
12
+ country?: string;
13
+ state?: {
14
+ name?: string;
15
+ code?: string;
16
+ };
17
+ postalCode: string;
18
+ city: string;
19
+ fingerprintId?: string;
20
+ userAgent?: string;
21
+ };
10
22
 
11
- export type DeviceSignals = Schema.Schema.Type<typeof DeviceSignals>;
12
- const DeviceSignals = Schema.Struct({
13
- id: DeviceId,
14
- ipAddress: Schema.optional(Schema.String),
15
- os: Schema.optional(Schema.String),
16
- isMobile: Schema.optional(Schema.Boolean),
17
- country: Schema.optional(Schema.String),
18
- state: Schema.optional(
19
- Schema.Struct({
20
- name: Schema.optional(Schema.String),
21
- code: Schema.optional(Schema.String),
22
- })
23
- ),
24
- postalCode: Schema.String,
25
- city: Schema.String,
26
- fingerprintId: Schema.optional(Schema.String),
27
- userAgent: Schema.optional(Schema.String),
28
- });
23
+ export type LeadUuid = string;
29
24
 
30
- export type LeadUuid = Schema.Schema.Type<typeof LeadUuid>;
31
- export const LeadUuid = Schema.UUID;
25
+ export type LeadSignals = {
26
+ uuid: LeadUuid;
27
+ };
32
28
 
33
- export type LeadSignals = Schema.Schema.Type<typeof LeadSignals>;
34
- export const LeadSignals = Schema.Struct({
35
- uuid: LeadUuid,
36
- });
29
+ export type ReferralSignals = Record<string, never>;
37
30
 
38
- export type ReferralSignals = Schema.Schema.Type<typeof ReferralSignals>;
39
- export const ReferralSignals = Schema.Struct({});
40
-
41
- export type Signals = Schema.Schema.Type<typeof Signals>;
42
- export const Signals = Schema.Struct({
43
- partnerSignals: PartnerSignals,
44
- deviceSignals: DeviceSignals,
45
- lead: LeadSignals,
46
- referral: ReferralSignals,
47
- });
31
+ export type Signals = {
32
+ partnerSignals: PartnerSignals;
33
+ deviceSignals: DeviceSignals;
34
+ lead: LeadSignals;
35
+ referral: ReferralSignals;
36
+ };
@@ -1,25 +1,17 @@
1
- import { Schema } from "effect";
1
+ type Tag = {
2
+ id: string;
3
+ key: string;
4
+ value: string;
5
+ };
2
6
 
3
- const EmptyString = Schema.Literal("");
4
- const NullOrEmptyString = <S extends Schema.Schema.Any>(schema: S) =>
5
- Schema.Union(Schema.Null, EmptyString, schema);
6
-
7
- const Tag = Schema.Struct({
8
- id: Schema.String,
9
- key: Schema.String,
10
- value: Schema.String,
11
- });
12
-
13
- export const Subaccount = Schema.Struct({
14
- id: Schema.UUID,
15
- publicToken: Schema.String,
16
- name: Schema.String,
17
- companyUuid: Schema.String,
18
- subaccount: Schema.NullOr(Schema.Number),
19
- supplySubaccountUuid: Schema.UUID.pipe(NullOrEmptyString, Schema.optional),
20
- tags: Schema.Array(Tag),
21
- createdAt: Schema.String,
22
- updatedAt: Schema.String,
23
- });
24
-
25
- export type Subaccount = Schema.Schema.Type<typeof Subaccount>;
7
+ export type Subaccount = {
8
+ id: string;
9
+ publicToken: string;
10
+ name: string;
11
+ companyUuid: string;
12
+ subaccount: number | null;
13
+ supplySubaccountUuid?: string;
14
+ tags: Tag[];
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ };