@moneylion/engine-api 1.3.0 → 1.3.2
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/dist/client.js +1 -1
- package/dist/decoders.d.ts +2 -2
- package/dist/decoders.js +2 -0
- package/dist/leads.d.ts +2 -2
- package/dist/leads.test.js +7 -1
- package/dist/rate_tables.d.ts +1 -1
- package/dist/rate_tables.js +2 -2
- package/dist/rate_tables.test.js +7 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -21,7 +21,7 @@ export class Client {
|
|
|
21
21
|
* @param host - The API host URL. Example: https://www.example.com. Should not include a trailing slash.
|
|
22
22
|
* @param auth_token - The auth token used for authenticating with the API.
|
|
23
23
|
*/
|
|
24
|
-
constructor(host = "https://api.evenfinancial.com", auth_token, timeout_ms =
|
|
24
|
+
constructor(host = "https://api.evenfinancial.com", auth_token, timeout_ms = 15 * 1000, fetch_impl = fetch) {
|
|
25
25
|
this.host = host;
|
|
26
26
|
this.auth_token = auth_token;
|
|
27
27
|
this.fetch_impl = fetch_impl;
|
package/dist/decoders.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Decoder } from "@mojotech/json-type-validation";
|
|
2
|
-
import { components } from "./generated/schema";
|
|
1
|
+
import { type Decoder } from "@mojotech/json-type-validation";
|
|
2
|
+
import type { components } from "./generated/schema";
|
|
3
3
|
type FixNull<T> = T extends object ? {
|
|
4
4
|
[P in keyof T]: undefined extends T[P] ? FixNull<T[P] | null> : FixNull<T[P]>;
|
|
5
5
|
} : T extends Array<infer X> ? FixNull<X>[] : T;
|
package/dist/decoders.js
CHANGED
|
@@ -196,6 +196,8 @@ export const specialOfferDecoder = object({
|
|
|
196
196
|
recommendationScore: optional(number()),
|
|
197
197
|
payout: optional(number()),
|
|
198
198
|
productSubType: productSubTypeDecoder,
|
|
199
|
+
disclaimer: optional(string()),
|
|
200
|
+
financialInstitutionUuid: string(),
|
|
199
201
|
});
|
|
200
202
|
export const pendingResponseDecoder = object({
|
|
201
203
|
partner: partnerDecoder,
|
package/dist/leads.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AsyncRateTable, RateTable } from "./rate_tables.js";
|
|
2
|
-
import { components } from "./generated/schema";
|
|
1
|
+
import { AsyncRateTable, type RateTable } from "./rate_tables.js";
|
|
2
|
+
import type { components } from "./generated/schema";
|
|
3
3
|
export type LeadCreateData = components["schemas"]["LeadCreateData"];
|
|
4
4
|
/**
|
|
5
5
|
* The class used to manage leads.
|
package/dist/leads.test.js
CHANGED
|
@@ -83,6 +83,7 @@ const fullRateTable = {
|
|
|
83
83
|
recommendationScore: 10,
|
|
84
84
|
payout: 0.1,
|
|
85
85
|
productSubType: "credit_builder",
|
|
86
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
89
|
uuid: "full-special-offer-uuid-2",
|
|
@@ -94,6 +95,7 @@ const fullRateTable = {
|
|
|
94
95
|
recommendationScore: 10,
|
|
95
96
|
payout: 0.1,
|
|
96
97
|
productSubType: "debt_relief",
|
|
98
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
97
99
|
},
|
|
98
100
|
{
|
|
99
101
|
uuid: "full-special-offer-uuid-3",
|
|
@@ -105,6 +107,7 @@ const fullRateTable = {
|
|
|
105
107
|
recommendationScore: 10,
|
|
106
108
|
payout: 0.1,
|
|
107
109
|
productSubType: "installment_loans",
|
|
110
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
108
111
|
},
|
|
109
112
|
],
|
|
110
113
|
pendingOriginators: [],
|
|
@@ -129,6 +132,7 @@ const pendingRateTable = {
|
|
|
129
132
|
recommendationScore: 10,
|
|
130
133
|
payout: 0.1,
|
|
131
134
|
productSubType: "credit_builder",
|
|
135
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
132
136
|
},
|
|
133
137
|
{
|
|
134
138
|
uuid: "pending-special-offer-uuid-2",
|
|
@@ -140,6 +144,7 @@ const pendingRateTable = {
|
|
|
140
144
|
recommendationScore: 10,
|
|
141
145
|
payout: 0.1,
|
|
142
146
|
productSubType: "debt_relief",
|
|
147
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
143
148
|
},
|
|
144
149
|
{
|
|
145
150
|
uuid: "pending-special-offer-uuid-3",
|
|
@@ -151,6 +156,7 @@ const pendingRateTable = {
|
|
|
151
156
|
recommendationScore: 10,
|
|
152
157
|
payout: 0.1,
|
|
153
158
|
productSubType: "installment_loans",
|
|
159
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
154
160
|
},
|
|
155
161
|
],
|
|
156
162
|
pendingOriginators: [],
|
|
@@ -187,7 +193,7 @@ const handlers = [
|
|
|
187
193
|
status: 200,
|
|
188
194
|
});
|
|
189
195
|
}),
|
|
190
|
-
http.get(`${testHost}/originator/rateTables/${pendingRateTable
|
|
196
|
+
http.get(`${testHost}/originator/rateTables/${pendingRateTable.uuid}`, () => {
|
|
191
197
|
return new HttpResponse(JSON.stringify(fullRateTable), {
|
|
192
198
|
status: 200,
|
|
193
199
|
});
|
package/dist/rate_tables.d.ts
CHANGED
package/dist/rate_tables.js
CHANGED
|
@@ -70,11 +70,11 @@ export class AsyncRateTable {
|
|
|
70
70
|
}, pollInterval);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
if (this.uuid) {
|
|
74
74
|
const resolved = yield this.getRateTable(this.uuid);
|
|
75
75
|
return resolved.resolve();
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
if (this.rateTable) {
|
|
78
78
|
return this.rateTable;
|
|
79
79
|
}
|
|
80
80
|
throw new TypeError("No uuid or rate table was provided to resolve");
|
package/dist/rate_tables.test.js
CHANGED
|
@@ -31,6 +31,7 @@ const fullRateTable = {
|
|
|
31
31
|
recommendationScore: 10,
|
|
32
32
|
payout: 0.1,
|
|
33
33
|
productSubType: "credit_builder",
|
|
34
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
37
|
uuid: "full-special-offer-uuid-2",
|
|
@@ -42,6 +43,7 @@ const fullRateTable = {
|
|
|
42
43
|
recommendationScore: 10,
|
|
43
44
|
payout: 0.1,
|
|
44
45
|
productSubType: "debt_relief",
|
|
46
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
45
47
|
},
|
|
46
48
|
{
|
|
47
49
|
uuid: "full-special-offer-uuid-3",
|
|
@@ -53,6 +55,7 @@ const fullRateTable = {
|
|
|
53
55
|
recommendationScore: 10,
|
|
54
56
|
payout: 0.1,
|
|
55
57
|
productSubType: "installment_loans",
|
|
58
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
56
59
|
},
|
|
57
60
|
],
|
|
58
61
|
pendingOriginators: [],
|
|
@@ -77,6 +80,7 @@ const pendingRateTable = {
|
|
|
77
80
|
recommendationScore: 10,
|
|
78
81
|
payout: 0.1,
|
|
79
82
|
productSubType: "credit_builder",
|
|
83
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
80
84
|
},
|
|
81
85
|
{
|
|
82
86
|
uuid: "pending-special-offer-uuid-2",
|
|
@@ -88,6 +92,7 @@ const pendingRateTable = {
|
|
|
88
92
|
recommendationScore: 10,
|
|
89
93
|
payout: 0.1,
|
|
90
94
|
productSubType: "debt_relief",
|
|
95
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
91
96
|
},
|
|
92
97
|
{
|
|
93
98
|
uuid: "pending-special-offer-uuid-3",
|
|
@@ -99,6 +104,7 @@ const pendingRateTable = {
|
|
|
99
104
|
recommendationScore: 10,
|
|
100
105
|
payout: 0.1,
|
|
101
106
|
productSubType: "installment_loans",
|
|
107
|
+
financialInstitutionUuid: "financial-institution-uuid",
|
|
102
108
|
},
|
|
103
109
|
],
|
|
104
110
|
pendingOriginators: [],
|
|
@@ -122,7 +128,7 @@ const doublePollUuid = "double-poll-uuid";
|
|
|
122
128
|
const testHost = "https://engine.com";
|
|
123
129
|
const token = "good_auth_token";
|
|
124
130
|
const handlers = [
|
|
125
|
-
http.get(`${testHost}/originator/rateTables/${pendingRateTable
|
|
131
|
+
http.get(`${testHost}/originator/rateTables/${pendingRateTable.uuid}`, () => {
|
|
126
132
|
return new HttpResponse(JSON.stringify(fullRateTable), {
|
|
127
133
|
status: 200,
|
|
128
134
|
});
|