@moneylion/react-native-offer-carousel 1.9.1 → 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.
- package/CHANGELOG.md +6 -0
- package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js +0 -12
- package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -1
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js +0 -16
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -1
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js +0 -120
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js +0 -39
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -1
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js +0 -19
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -1
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js +0 -10
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -1
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js +0 -39
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -1
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +0 -24
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -1
- package/lib/commonjs/capabilities/errors/types/index.js +22 -1
- package/lib/commonjs/capabilities/errors/types/index.js.map +1 -1
- package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js +3 -3
- package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/commonjs/components/MoneyLionOfferCarousel.js +13 -5
- package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/commonjs/components/utils/errorUtils.js +2 -2
- package/lib/commonjs/components/utils/errorUtils.js.map +1 -1
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/getDynamicOffers.js +4 -2
- package/lib/commonjs/services/getDynamicOffers.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js +1 -11
- package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js +1 -11
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js +1 -115
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js +1 -34
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js +1 -14
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js +1 -5
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js +1 -34
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +1 -19
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -1
- package/lib/module/capabilities/errors/types/index.js +21 -0
- package/lib/module/capabilities/errors/types/index.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js +4 -4
- package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
- package/lib/module/components/MoneyLionOfferCarousel.js +14 -6
- package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/module/components/utils/errorUtils.js +3 -3
- package/lib/module/components/utils/errorUtils.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/getDynamicOffers.js +4 -2
- package/lib/module/services/getDynamicOffers.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/CnfContext.d.ts +15 -102
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/App.d.ts +10 -12
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts +101 -472
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts +24 -58
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Request.d.ts +11 -15
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Session.d.ts +4 -7
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts +30 -63
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts +17 -17
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/errors/types/index.d.ts +18 -2
- package/lib/typescript/src/capabilities/errors/types/index.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/contextUtil.d.ts +1 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts +11 -11
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts +1 -1
- package/lib/typescript/src/utils/getProductTypesDefinition.d.ts +8 -8
- package/lib/typescript/src/version.d.ts +1 -1
- package/lib/typescript/src/version.d.ts.map +1 -1
- package/package.json +2 -12
- package/src/capabilities/core/src/system/cnfContext/CnfContext.ts +15 -20
- package/src/capabilities/core/src/system/cnfContext/schemas/App.ts +10 -13
- package/src/capabilities/core/src/system/cnfContext/schemas/Brand.ts +108 -148
- package/src/capabilities/core/src/system/cnfContext/schemas/Configuration.ts +21 -46
- package/src/capabilities/core/src/system/cnfContext/schemas/Request.ts +11 -16
- package/src/capabilities/core/src/system/cnfContext/schemas/Session.ts +4 -8
- package/src/capabilities/core/src/system/cnfContext/schemas/Signals.ts +30 -41
- package/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.ts +16 -24
- package/src/capabilities/errors/types/index.ts +30 -1
- package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +4 -4
- package/src/components/MoneyLionOfferCarousel.tsx +14 -6
- package/src/components/utils/errorUtils.ts +3 -3
- package/src/index.tsx +4 -0
- package/src/services/getDynamicOffers.ts +10 -7
- package/src/version.ts +1 -1
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
export type Links = {
|
|
48
|
+
home?: string;
|
|
49
|
+
terms?: string;
|
|
50
|
+
support?: string;
|
|
51
|
+
privacy?: string;
|
|
52
|
+
};
|
|
68
53
|
|
|
69
|
-
export type
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
80
|
+
export type FontFamily =
|
|
81
|
+
| "nunito"
|
|
82
|
+
| "lato"
|
|
83
|
+
| "sourceSans3"
|
|
84
|
+
| "openSans"
|
|
85
|
+
| "roboto"
|
|
86
|
+
| "arimo"
|
|
87
|
+
| "montserrat";
|
|
107
88
|
|
|
108
|
-
export type
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
name: Schema.Boolean,
|
|
112
|
-
});
|
|
89
|
+
export type Font = {
|
|
90
|
+
family?: FontFamily;
|
|
91
|
+
};
|
|
113
92
|
|
|
114
|
-
export type
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
large: Schema.optional(Schema.Number),
|
|
119
|
-
});
|
|
93
|
+
export type AllowedMarks = {
|
|
94
|
+
logo: boolean;
|
|
95
|
+
name: boolean;
|
|
96
|
+
};
|
|
120
97
|
|
|
121
|
-
type
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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 =
|
|
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
|
-
|
|
1
|
+
type ProductTypesDefinition = {
|
|
2
|
+
id: string;
|
|
3
|
+
partnerPageUrl: string;
|
|
4
|
+
productTypeSlug: string;
|
|
5
|
+
};
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
id:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
7
|
+
type PartnersOverrideDefinition = {
|
|
8
|
+
id: string;
|
|
9
|
+
overrideUrl: string;
|
|
10
|
+
financialInstitutionUuid: string;
|
|
11
|
+
};
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
1
|
+
export type SessionId = string;
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
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
|
-
|
|
1
|
+
export type PartnerSignals = {
|
|
2
|
+
clientTags: Record<string, string>;
|
|
3
|
+
};
|
|
2
4
|
|
|
3
|
-
export type
|
|
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
|
|
9
|
-
|
|
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
|
|
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
|
|
31
|
-
|
|
25
|
+
export type LeadSignals = {
|
|
26
|
+
uuid: LeadUuid;
|
|
27
|
+
};
|
|
32
28
|
|
|
33
|
-
export type
|
|
34
|
-
export const LeadSignals = Schema.Struct({
|
|
35
|
-
uuid: LeadUuid,
|
|
36
|
-
});
|
|
29
|
+
export type ReferralSignals = Record<string, never>;
|
|
37
30
|
|
|
38
|
-
export type
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
1
|
+
type Tag = {
|
|
2
|
+
id: string;
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated use ErrorCodeMap instead.
|
|
3
|
+
* TypeScript 5.8 introduced the --erasableSyntaxOnly flag, which treats enums as
|
|
4
|
+
* a compile error. this enum will be removed in a future version.
|
|
5
|
+
*/
|
|
1
6
|
export enum ErrorCodes {
|
|
2
7
|
// Configuration
|
|
3
8
|
MISSING_CONFIG = "MISSING_CONFIG",
|
|
@@ -12,10 +17,34 @@ export enum ErrorCodes {
|
|
|
12
17
|
NETWORK_REQUEST_ERROR = "NETWORK_REQUEST_ERROR",
|
|
13
18
|
NETWORK_SERVER_ERROR = "NETWORK_SERVER_ERROR",
|
|
14
19
|
NETWORK_OTHER_ERROR = "NETWORK_OTHER_ERROR",
|
|
20
|
+
|
|
21
|
+
// Geo
|
|
22
|
+
NON_US = "NON_US",
|
|
15
23
|
}
|
|
16
24
|
|
|
25
|
+
export const ErrorCodeMap = {
|
|
26
|
+
// Configuration
|
|
27
|
+
MISSING_CONFIG: "MISSING_CONFIG",
|
|
28
|
+
|
|
29
|
+
// UI
|
|
30
|
+
UI_CRASH: "UI_CRASH",
|
|
31
|
+
|
|
32
|
+
// Flow
|
|
33
|
+
FLOW_ERROR: "FLOW_ERROR",
|
|
34
|
+
|
|
35
|
+
// Network
|
|
36
|
+
NETWORK_REQUEST_ERROR: "NETWORK_REQUEST_ERROR",
|
|
37
|
+
NETWORK_SERVER_ERROR: "NETWORK_SERVER_ERROR",
|
|
38
|
+
NETWORK_OTHER_ERROR: "NETWORK_OTHER_ERROR",
|
|
39
|
+
|
|
40
|
+
// Geo
|
|
41
|
+
NON_US: "NON_US",
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
export type ErrorCodeValues = (typeof ErrorCodeMap)[keyof typeof ErrorCodeMap];
|
|
45
|
+
|
|
17
46
|
export interface MoneyLionOfferCarouselError {
|
|
18
|
-
code:
|
|
47
|
+
code: ErrorCodeValues;
|
|
19
48
|
severity: "warning" | "error";
|
|
20
49
|
message: string;
|
|
21
50
|
timestamp: string;
|
|
@@ -14,7 +14,7 @@ import { getOfferCatalogApiBaseUrl } from "../../../../apiEnvironment";
|
|
|
14
14
|
import type { UserData } from "../../../configuration/src/userData/types";
|
|
15
15
|
import type { CnfContext } from "../../../core/src/system/cnfContext/CnfContext";
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
ErrorCodeMap,
|
|
18
18
|
type ApiError,
|
|
19
19
|
type InternalOnErrorCallback,
|
|
20
20
|
} from "../../../errors/types";
|
|
@@ -92,7 +92,7 @@ export const getCachedOffersByProductTypes =
|
|
|
92
92
|
context,
|
|
93
93
|
},
|
|
94
94
|
...(getApiErrorLogProperties(error) || {
|
|
95
|
-
code:
|
|
95
|
+
code: ErrorCodeMap.FLOW_ERROR,
|
|
96
96
|
severity: "error",
|
|
97
97
|
}),
|
|
98
98
|
});
|
|
@@ -203,7 +203,7 @@ export const getOffersForProductTypes =
|
|
|
203
203
|
} catch (error) {
|
|
204
204
|
onError?.({
|
|
205
205
|
message: "Failed to add device signals to payload",
|
|
206
|
-
code:
|
|
206
|
+
code: ErrorCodeMap.FLOW_ERROR,
|
|
207
207
|
severity: "error",
|
|
208
208
|
error,
|
|
209
209
|
additionalInfo: {
|
|
@@ -300,7 +300,7 @@ export const getOffersForProductTypes =
|
|
|
300
300
|
customClientTags,
|
|
301
301
|
},
|
|
302
302
|
...(getApiErrorLogProperties(error) || {
|
|
303
|
-
code:
|
|
303
|
+
code: ErrorCodeMap.FLOW_ERROR,
|
|
304
304
|
severity: "error",
|
|
305
305
|
}),
|
|
306
306
|
});
|
|
@@ -33,7 +33,7 @@ import type {
|
|
|
33
33
|
InternalOnErrorCallback,
|
|
34
34
|
OnErrorCallback,
|
|
35
35
|
} from "../capabilities/errors/types";
|
|
36
|
-
import {
|
|
36
|
+
import { ErrorCodeMap } from "../capabilities/errors/types";
|
|
37
37
|
import { getApiErrorLogProperties } from "./utils/errorUtils";
|
|
38
38
|
|
|
39
39
|
export type CustomError = {
|
|
@@ -114,7 +114,7 @@ const getConfiguration = async ({
|
|
|
114
114
|
isDev,
|
|
115
115
|
},
|
|
116
116
|
...(getApiErrorLogProperties(error) || {
|
|
117
|
-
code:
|
|
117
|
+
code: ErrorCodeMap.FLOW_ERROR,
|
|
118
118
|
severity: "error",
|
|
119
119
|
}),
|
|
120
120
|
});
|
|
@@ -235,7 +235,7 @@ const InternalMoneyLionOfferCarousel = (
|
|
|
235
235
|
isDev,
|
|
236
236
|
},
|
|
237
237
|
...(getApiErrorLogProperties(errorObj) || {
|
|
238
|
-
code:
|
|
238
|
+
code: ErrorCodeMap.FLOW_ERROR,
|
|
239
239
|
severity: "error",
|
|
240
240
|
}),
|
|
241
241
|
});
|
|
@@ -267,7 +267,7 @@ const InternalMoneyLionOfferCarousel = (
|
|
|
267
267
|
if (!subAccountToken) missingParams.push("subAccountToken");
|
|
268
268
|
|
|
269
269
|
onError?.({
|
|
270
|
-
code:
|
|
270
|
+
code: ErrorCodeMap.MISSING_CONFIG,
|
|
271
271
|
message: `Missing required parameters: ${missingParams.join(", ")}`,
|
|
272
272
|
severity: "error",
|
|
273
273
|
});
|
|
@@ -280,6 +280,14 @@ const InternalMoneyLionOfferCarousel = (
|
|
|
280
280
|
// Should only fetch data if context is done fetching
|
|
281
281
|
if (context && !isFetchingConfig) {
|
|
282
282
|
if (isNonUSCountry) {
|
|
283
|
+
onError?.({
|
|
284
|
+
code: ErrorCodeMap.NON_US,
|
|
285
|
+
severity: "warning",
|
|
286
|
+
message: "This service is not available in your country",
|
|
287
|
+
additionalInfo: {
|
|
288
|
+
country,
|
|
289
|
+
},
|
|
290
|
+
});
|
|
283
291
|
setIsFetchingData(false);
|
|
284
292
|
return;
|
|
285
293
|
}
|
|
@@ -315,7 +323,7 @@ const InternalMoneyLionOfferCarousel = (
|
|
|
315
323
|
pageDataParams: getPageDataParams,
|
|
316
324
|
},
|
|
317
325
|
...(getApiErrorLogProperties(errorObj) || {
|
|
318
|
-
code:
|
|
326
|
+
code: ErrorCodeMap.FLOW_ERROR,
|
|
319
327
|
severity: "error",
|
|
320
328
|
}),
|
|
321
329
|
});
|
|
@@ -440,7 +448,7 @@ export const MoneyLionOfferCarousel = (
|
|
|
440
448
|
const logErrorBoundary = useCallback(
|
|
441
449
|
(error: Error) => {
|
|
442
450
|
onError?.({
|
|
443
|
-
code:
|
|
451
|
+
code: ErrorCodeMap.UI_CRASH,
|
|
444
452
|
severity: "error",
|
|
445
453
|
message: "Error boundary crash",
|
|
446
454
|
error,
|