@securelend/sdk 0.1.0-beta.5
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/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/index.d.mts +81 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +1004 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +942 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.d.mts +5826 -0
- package/dist/types/index.d.ts +5826 -0
- package/dist/types/index.js +631 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +577 -0
- package/dist/types/index.mjs.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/types/index.ts
|
|
4
|
+
var anyObjectSchema = z.object({}).passthrough();
|
|
5
|
+
var CreditTier = /* @__PURE__ */ ((CreditTier2) => {
|
|
6
|
+
CreditTier2["PRIME"] = "PRIME";
|
|
7
|
+
CreditTier2["NEAR_PRIME"] = "NEAR_PRIME";
|
|
8
|
+
CreditTier2["SUBPRIME"] = "SUBPRIME";
|
|
9
|
+
CreditTier2["DEEP_SUBPRIME"] = "DEEP_SUBPRIME";
|
|
10
|
+
CreditTier2["UNKNOWN"] = "UNKNOWN";
|
|
11
|
+
return CreditTier2;
|
|
12
|
+
})(CreditTier || {});
|
|
13
|
+
var ProductType = /* @__PURE__ */ ((ProductType2) => {
|
|
14
|
+
ProductType2["INSTALLMENT_LOAN"] = "INSTALLMENT_LOAN";
|
|
15
|
+
ProductType2["LINE_OF_CREDIT"] = "LINE_OF_CREDIT";
|
|
16
|
+
ProductType2["SHORT_TERM_CREDIT"] = "SHORT_TERM_CREDIT";
|
|
17
|
+
ProductType2["BNPL"] = "BNPL";
|
|
18
|
+
ProductType2["MORTGAGE"] = "MORTGAGE";
|
|
19
|
+
ProductType2["AUTO_LOAN"] = "AUTO_LOAN";
|
|
20
|
+
ProductType2["AUTO_REFINANCE"] = "AUTO_REFINANCE";
|
|
21
|
+
ProductType2["STUDENT_LOAN"] = "STUDENT_LOAN";
|
|
22
|
+
ProductType2["STUDENT_LOAN_REFINANCE"] = "STUDENT_LOAN_REFINANCE";
|
|
23
|
+
ProductType2["BUSINESS_LOAN"] = "BUSINESS_LOAN";
|
|
24
|
+
ProductType2["BUSINESS_BANKING"] = "BUSINESS_BANKING";
|
|
25
|
+
ProductType2["BUSINESS_CREDIT_CARD"] = "BUSINESS_CREDIT_CARD";
|
|
26
|
+
ProductType2["PERSONAL_BANKING"] = "PERSONAL_BANKING";
|
|
27
|
+
ProductType2["SAVINGS_ACCOUNT"] = "SAVINGS_ACCOUNT";
|
|
28
|
+
ProductType2["PERSONAL_CREDIT_CARD"] = "PERSONAL_CREDIT_CARD";
|
|
29
|
+
return ProductType2;
|
|
30
|
+
})(ProductType || {});
|
|
31
|
+
var moneySchema = z.object({
|
|
32
|
+
amount: z.number(),
|
|
33
|
+
currency: z.string().length(3).optional()
|
|
34
|
+
});
|
|
35
|
+
var bankAccountOfferSchema = z.object({
|
|
36
|
+
id: z.string(),
|
|
37
|
+
providerName: z.string(),
|
|
38
|
+
providerLogo: z.string().optional(),
|
|
39
|
+
accountName: z.string(),
|
|
40
|
+
monthlyFee: z.number(),
|
|
41
|
+
minBalance: z.number(),
|
|
42
|
+
interestRate: z.number(),
|
|
43
|
+
features: z.array(z.string()),
|
|
44
|
+
isSecureLendTenant: z.boolean().optional(),
|
|
45
|
+
applicationUrl: z.string().url().optional()
|
|
46
|
+
});
|
|
47
|
+
var creditCardOfferSchema = z.object({
|
|
48
|
+
id: z.string(),
|
|
49
|
+
issuerName: z.string(),
|
|
50
|
+
issuerLogo: z.string().optional(),
|
|
51
|
+
cardName: z.string(),
|
|
52
|
+
apr: z.object({
|
|
53
|
+
min: z.number(),
|
|
54
|
+
max: z.number()
|
|
55
|
+
}),
|
|
56
|
+
annualFee: z.number(),
|
|
57
|
+
rewards: z.object({
|
|
58
|
+
type: z.enum(["cash_back", "points", "miles"]),
|
|
59
|
+
summary: z.string(),
|
|
60
|
+
signupBonus: z.string().optional()
|
|
61
|
+
}),
|
|
62
|
+
isSecureLendTenant: z.boolean().optional(),
|
|
63
|
+
applicationUrl: z.string().url().optional()
|
|
64
|
+
});
|
|
65
|
+
var ApplicationType = /* @__PURE__ */ ((ApplicationType2) => {
|
|
66
|
+
ApplicationType2["PERSONAL"] = "PERSONAL";
|
|
67
|
+
ApplicationType2["BUSINESS"] = "BUSINESS";
|
|
68
|
+
return ApplicationType2;
|
|
69
|
+
})(ApplicationType || {});
|
|
70
|
+
var ApplicationStatus = /* @__PURE__ */ ((ApplicationStatus2) => {
|
|
71
|
+
ApplicationStatus2["DRAFT"] = "DRAFT";
|
|
72
|
+
ApplicationStatus2["SUBMITTED"] = "SUBMITTED";
|
|
73
|
+
ApplicationStatus2["IN_REVIEW"] = "IN_REVIEW";
|
|
74
|
+
ApplicationStatus2["ACTION_REQUIRED"] = "ACTION_REQUIRED";
|
|
75
|
+
ApplicationStatus2["APPROVED"] = "APPROVED";
|
|
76
|
+
ApplicationStatus2["DECLINED"] = "DECLINED";
|
|
77
|
+
ApplicationStatus2["CLOSED"] = "CLOSED";
|
|
78
|
+
return ApplicationStatus2;
|
|
79
|
+
})(ApplicationStatus || {});
|
|
80
|
+
var ProviderStatus = /* @__PURE__ */ ((ProviderStatus2) => {
|
|
81
|
+
ProviderStatus2["PENDING"] = "PENDING";
|
|
82
|
+
ProviderStatus2["SUBMITTED"] = "SUBMITTED";
|
|
83
|
+
ProviderStatus2["REFERRED"] = "REFERRED";
|
|
84
|
+
ProviderStatus2["ERROR"] = "ERROR";
|
|
85
|
+
ProviderStatus2["RECEIVED"] = "RECEIVED";
|
|
86
|
+
return ProviderStatus2;
|
|
87
|
+
})(ProviderStatus || {});
|
|
88
|
+
var personalApplicantSchema = z.object({
|
|
89
|
+
firstName: z.string().describe("The applicant's first name."),
|
|
90
|
+
lastName: z.string().describe("The applicant's last name."),
|
|
91
|
+
email: z.string().email().describe("The applicant's email address."),
|
|
92
|
+
phone: z.string().optional().describe("The applicant's phone number.")
|
|
93
|
+
});
|
|
94
|
+
var lenderSchema = z.object({
|
|
95
|
+
id: z.string(),
|
|
96
|
+
name: z.string(),
|
|
97
|
+
type: z.string(),
|
|
98
|
+
logoUrl: z.string().url().optional()
|
|
99
|
+
});
|
|
100
|
+
var productSchema = z.object({
|
|
101
|
+
name: z.string(),
|
|
102
|
+
type: z.string(),
|
|
103
|
+
description: z.string().optional()
|
|
104
|
+
});
|
|
105
|
+
var loanTermsSchema = z.object({
|
|
106
|
+
amount: moneySchema,
|
|
107
|
+
interestRate: z.object({
|
|
108
|
+
type: z.enum(["fixed", "variable"]),
|
|
109
|
+
rate: z.number().optional(),
|
|
110
|
+
// rate might not always be available if only APR is given
|
|
111
|
+
apr: z.number()
|
|
112
|
+
}),
|
|
113
|
+
termMonths: z.number().int(),
|
|
114
|
+
payment: z.object({
|
|
115
|
+
frequency: z.string().optional(),
|
|
116
|
+
amount: moneySchema
|
|
117
|
+
}),
|
|
118
|
+
totalCost: moneySchema.optional(),
|
|
119
|
+
repayment: z.object({
|
|
120
|
+
totalRepaymentAmount: z.number(),
|
|
121
|
+
costOfFinancing: z.number()
|
|
122
|
+
}).optional()
|
|
123
|
+
});
|
|
124
|
+
var loanFeesSchema = z.object({
|
|
125
|
+
origination: z.object({
|
|
126
|
+
amount: moneySchema.optional(),
|
|
127
|
+
percentage: z.number().optional()
|
|
128
|
+
}).optional()
|
|
129
|
+
}).optional();
|
|
130
|
+
var matchingSchema = z.object({
|
|
131
|
+
approvalProbability: z.number().min(0).max(1).optional(),
|
|
132
|
+
matchScore: z.number().min(0).max(100).optional(),
|
|
133
|
+
matchReasons: z.array(z.string()).optional()
|
|
134
|
+
}).optional();
|
|
135
|
+
var processSchema = z.object({
|
|
136
|
+
applicationMethod: z.string(),
|
|
137
|
+
applicationUrl: z.string().url().optional(),
|
|
138
|
+
fundingSpeed: z.object({
|
|
139
|
+
description: z.string()
|
|
140
|
+
}).optional()
|
|
141
|
+
});
|
|
142
|
+
var loanOfferSchema = z.object({
|
|
143
|
+
offerId: z.string(),
|
|
144
|
+
lender: lenderSchema,
|
|
145
|
+
product: productSchema,
|
|
146
|
+
terms: loanTermsSchema,
|
|
147
|
+
fees: loanFeesSchema,
|
|
148
|
+
matching: matchingSchema,
|
|
149
|
+
process: processSchema.optional(),
|
|
150
|
+
// Additional fields for UI that were in the old schema
|
|
151
|
+
lenderInfo: z.string().optional(),
|
|
152
|
+
badges: z.array(z.string()).optional(),
|
|
153
|
+
isSecureLendTenant: z.boolean().optional()
|
|
154
|
+
});
|
|
155
|
+
var personalLoanSearchSchema = z.object({
|
|
156
|
+
loanAmount: z.number().min(1e3).max(1e5).describe("The desired loan amount in USD (e.g., 25000)."),
|
|
157
|
+
purpose: z.enum([
|
|
158
|
+
"debt_consolidation",
|
|
159
|
+
"home_improvement",
|
|
160
|
+
"major_purchase",
|
|
161
|
+
"medical",
|
|
162
|
+
"vacation",
|
|
163
|
+
"other"
|
|
164
|
+
]).describe("The purpose of the loan."),
|
|
165
|
+
creditScore: z.number().min(300).max(850).optional().describe("The applicant's estimated credit score (300-850)."),
|
|
166
|
+
monthlyIncome: z.number().min(0).optional().describe("Applicant's gross monthly income in USD."),
|
|
167
|
+
employmentStatus: z.enum(["employed", "self_employed", "retired", "unemployed"]).optional().describe("The applicant's employment status."),
|
|
168
|
+
state: z.string().optional().describe("The applicant's state of residence (2-letter code).")
|
|
169
|
+
});
|
|
170
|
+
var businessLoanSearchSchema = z.object({
|
|
171
|
+
loanAmount: z.number().min(1e3).describe("The desired loan amount, e.g., 50000 for $50,000."),
|
|
172
|
+
purpose: z.string().describe("The reason for the loan, e.g., 'working capital'."),
|
|
173
|
+
annualRevenue: z.number().min(0).optional().describe("The business's gross annual revenue in USD."),
|
|
174
|
+
industry: z.string().optional().describe("The industry the business operates in, e.g., 'technology'."),
|
|
175
|
+
state: z.string().optional().describe("The state where the business is located (2-letter code).")
|
|
176
|
+
});
|
|
177
|
+
var mortgageSearchSchema = z.object({
|
|
178
|
+
loanAmount: z.number().min(5e4).max(2e6).describe("The desired mortgage loan amount in USD."),
|
|
179
|
+
homePrice: z.number().min(5e4).max(5e6).optional().describe("The purchase price of the home in USD."),
|
|
180
|
+
downPayment: z.number().min(0).optional().describe("The amount of the down payment in USD."),
|
|
181
|
+
creditScore: z.number().min(500).max(850).optional().describe("The applicant's estimated credit score (500-850)."),
|
|
182
|
+
loanType: z.enum(["conventional", "fha", "va", "jumbo", "refinance"]).describe("The type of mortgage loan."),
|
|
183
|
+
propertyType: z.enum(["primary", "secondary", "investment"]).optional().describe("The intended use of the property."),
|
|
184
|
+
state: z.string().optional().describe("The state where the property is located (2-letter code).")
|
|
185
|
+
});
|
|
186
|
+
var autoLoanSearchSchema = z.object({
|
|
187
|
+
loanAmount: z.number().min(1e3).max(1e5).describe("The desired auto loan amount in USD."),
|
|
188
|
+
creditScore: z.number().min(300).max(850).optional().describe("The applicant's estimated credit score (300-850)."),
|
|
189
|
+
isNew: z.boolean().describe("Specifies if the vehicle is new (true) or used (false)."),
|
|
190
|
+
state: z.string().optional().describe("The applicant's state of residence (2-letter code).")
|
|
191
|
+
});
|
|
192
|
+
var studentLoanSearchSchema = z.object({
|
|
193
|
+
loanAmount: z.number().min(1e3).max(25e4).describe("The total amount needed for the student loan in USD."),
|
|
194
|
+
creditScore: z.number().min(300).max(850).optional().describe("The student's estimated credit score (300-850)."),
|
|
195
|
+
coSignerCreditScore: z.number().min(300).max(850).optional().describe(
|
|
196
|
+
"The co-signer's estimated credit score (300-850), if applicable."
|
|
197
|
+
),
|
|
198
|
+
degreeType: z.enum(["undergraduate", "graduate", "mba", "medical", "law"]).describe("The type of degree the loan is for."),
|
|
199
|
+
state: z.string().optional().describe("The student's state of residence (2-letter code).")
|
|
200
|
+
});
|
|
201
|
+
var businessCreditCardSearchSchema = z.object({
|
|
202
|
+
creditScore: z.number().min(300).max(850).optional().describe("The applicant's estimated credit score (300-850)."),
|
|
203
|
+
annualRevenue: z.number().min(0).optional().describe("The business's annual revenue in USD."),
|
|
204
|
+
businessAgeInYears: z.number().min(0).optional().describe("The age of the business in years.")
|
|
205
|
+
});
|
|
206
|
+
var businessCreditCardOfferSchema = z.object({
|
|
207
|
+
cardId: z.string(),
|
|
208
|
+
name: z.string(),
|
|
209
|
+
issuer: z.string(),
|
|
210
|
+
imageUrl: z.string(),
|
|
211
|
+
rating: z.number().min(0).max(5),
|
|
212
|
+
creditScoreRange: z.string(),
|
|
213
|
+
welcomeBonus: z.string(),
|
|
214
|
+
terms: z.object({
|
|
215
|
+
apr: z.number(),
|
|
216
|
+
annualFee: z.number(),
|
|
217
|
+
creditLimit: moneySchema
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
var businessCreditCardComparisonResponseSchema = z.object({
|
|
221
|
+
offers: z.array(businessCreditCardOfferSchema),
|
|
222
|
+
searchCriteria: businessCreditCardSearchSchema.optional(),
|
|
223
|
+
metadata: z.object({
|
|
224
|
+
queryId: z.string(),
|
|
225
|
+
timestamp: z.string(),
|
|
226
|
+
sessionId: z.string().optional()
|
|
227
|
+
}),
|
|
228
|
+
widget: z.string().optional()
|
|
229
|
+
});
|
|
230
|
+
var businessBankingSearchSchema = z.object({
|
|
231
|
+
industry: z.string().optional().describe("The business's industry."),
|
|
232
|
+
monthlyTransactions: z.number().optional().describe("Estimated number of monthly transactions.")
|
|
233
|
+
});
|
|
234
|
+
var businessBankingOfferSchema = z.object({
|
|
235
|
+
accountId: z.string(),
|
|
236
|
+
name: z.string(),
|
|
237
|
+
issuer: z.string(),
|
|
238
|
+
imageUrl: z.string(),
|
|
239
|
+
rating: z.number().min(0).max(5),
|
|
240
|
+
bestFor: z.string(),
|
|
241
|
+
apy: z.string(),
|
|
242
|
+
interestRate: z.string().optional(),
|
|
243
|
+
monthlyFee: z.string(),
|
|
244
|
+
bonus: z.string()
|
|
245
|
+
});
|
|
246
|
+
var businessBankingComparisonResponseSchema = z.object({
|
|
247
|
+
offers: z.array(businessBankingOfferSchema),
|
|
248
|
+
searchCriteria: businessBankingSearchSchema.optional(),
|
|
249
|
+
metadata: z.object({
|
|
250
|
+
queryId: z.string(),
|
|
251
|
+
timestamp: z.string(),
|
|
252
|
+
sessionId: z.string().optional()
|
|
253
|
+
}),
|
|
254
|
+
widget: z.string().optional()
|
|
255
|
+
});
|
|
256
|
+
var personalBankingSearchSchema = z.object({
|
|
257
|
+
features: z.array(z.string()).optional().describe("Desired account features.")
|
|
258
|
+
});
|
|
259
|
+
var personalBankingOfferSchema = z.object({
|
|
260
|
+
accountId: z.string(),
|
|
261
|
+
name: z.string(),
|
|
262
|
+
issuer: z.string(),
|
|
263
|
+
imageUrl: z.string(),
|
|
264
|
+
rating: z.number().min(0).max(5),
|
|
265
|
+
bestFor: z.string(),
|
|
266
|
+
apy: z.string(),
|
|
267
|
+
interestRate: z.string().optional(),
|
|
268
|
+
bonus: z.string(),
|
|
269
|
+
monthlyFee: z.string(),
|
|
270
|
+
overdraftRating: z.number().min(0).max(5)
|
|
271
|
+
});
|
|
272
|
+
var personalBankingComparisonResponseSchema = z.object({
|
|
273
|
+
offers: z.array(personalBankingOfferSchema),
|
|
274
|
+
searchCriteria: personalBankingSearchSchema.optional(),
|
|
275
|
+
metadata: z.object({
|
|
276
|
+
queryId: z.string(),
|
|
277
|
+
timestamp: z.string(),
|
|
278
|
+
sessionId: z.string().optional()
|
|
279
|
+
}),
|
|
280
|
+
widget: z.string().optional()
|
|
281
|
+
});
|
|
282
|
+
var savingsSearchSchema = z.object({
|
|
283
|
+
initialDeposit: z.number().optional().describe("The initial deposit amount in USD.")
|
|
284
|
+
});
|
|
285
|
+
var savingsOfferSchema = z.object({
|
|
286
|
+
accountId: z.string(),
|
|
287
|
+
name: z.string(),
|
|
288
|
+
issuer: z.string(),
|
|
289
|
+
imageUrl: z.string(),
|
|
290
|
+
rating: z.number().min(0).max(5),
|
|
291
|
+
apy: z.string(),
|
|
292
|
+
interestRate: z.string().optional(),
|
|
293
|
+
minBalanceForApy: z.string(),
|
|
294
|
+
monthlyFee: z.string()
|
|
295
|
+
});
|
|
296
|
+
var savingsComparisonResponseSchema = z.object({
|
|
297
|
+
offers: z.array(savingsOfferSchema),
|
|
298
|
+
searchCriteria: savingsSearchSchema.optional(),
|
|
299
|
+
metadata: z.object({
|
|
300
|
+
queryId: z.string(),
|
|
301
|
+
timestamp: z.string(),
|
|
302
|
+
sessionId: z.string().optional()
|
|
303
|
+
}),
|
|
304
|
+
widget: z.string().optional()
|
|
305
|
+
});
|
|
306
|
+
var personalCreditCardSearchSchema = z.object({
|
|
307
|
+
creditScore: z.number().min(300).max(850).optional().describe("The applicant's estimated credit score (300-850)."),
|
|
308
|
+
rewardsType: z.enum(["cash_back", "travel", "points"]).optional().describe("Preferred rewards type.")
|
|
309
|
+
});
|
|
310
|
+
var personalCreditCardOfferSchema = z.object({
|
|
311
|
+
cardId: z.string(),
|
|
312
|
+
name: z.string(),
|
|
313
|
+
issuer: z.string(),
|
|
314
|
+
imageUrl: z.string(),
|
|
315
|
+
rating: z.number().min(0).max(5),
|
|
316
|
+
bestFor: z.string(),
|
|
317
|
+
rewardsRate: z.string(),
|
|
318
|
+
introOffer: z.string(),
|
|
319
|
+
recommendedCreditScore: z.string(),
|
|
320
|
+
terms: z.object({
|
|
321
|
+
apr: z.object({
|
|
322
|
+
purchase: z.number(),
|
|
323
|
+
balanceTransfer: z.number(),
|
|
324
|
+
penalty: z.number().optional()
|
|
325
|
+
}),
|
|
326
|
+
fees: z.object({
|
|
327
|
+
annual: z.number()
|
|
328
|
+
})
|
|
329
|
+
}),
|
|
330
|
+
applicationUrl: z.string().url().optional()
|
|
331
|
+
});
|
|
332
|
+
var personalCreditCardComparisonResponseSchema = z.object({
|
|
333
|
+
offers: z.array(personalCreditCardOfferSchema),
|
|
334
|
+
searchCriteria: personalCreditCardSearchSchema.optional(),
|
|
335
|
+
metadata: z.object({
|
|
336
|
+
queryId: z.string(),
|
|
337
|
+
timestamp: z.string(),
|
|
338
|
+
sessionId: z.string().optional()
|
|
339
|
+
}),
|
|
340
|
+
widget: z.string().optional()
|
|
341
|
+
});
|
|
342
|
+
var loanComparisonResponseSchema = z.object({
|
|
343
|
+
offers: z.array(loanOfferSchema),
|
|
344
|
+
summary: z.object({
|
|
345
|
+
totalOffers: z.number().int(),
|
|
346
|
+
bestRate: z.number(),
|
|
347
|
+
bestApprovalProbability: z.number().optional(),
|
|
348
|
+
fastestFunding: z.string().optional()
|
|
349
|
+
}),
|
|
350
|
+
searchCriteria: z.union([
|
|
351
|
+
personalLoanSearchSchema,
|
|
352
|
+
businessLoanSearchSchema,
|
|
353
|
+
mortgageSearchSchema,
|
|
354
|
+
autoLoanSearchSchema,
|
|
355
|
+
studentLoanSearchSchema
|
|
356
|
+
]).optional(),
|
|
357
|
+
metadata: z.object({
|
|
358
|
+
queryId: z.string(),
|
|
359
|
+
timestamp: z.string(),
|
|
360
|
+
sessionId: z.string().optional()
|
|
361
|
+
}),
|
|
362
|
+
widget: z.string().optional()
|
|
363
|
+
});
|
|
364
|
+
var applicationProviderSchema = z.object({
|
|
365
|
+
providerId: z.string(),
|
|
366
|
+
providerName: z.string(),
|
|
367
|
+
status: z.nativeEnum(ProviderStatus),
|
|
368
|
+
submittedAt: z.string().optional(),
|
|
369
|
+
providerApplicationId: z.string().optional(),
|
|
370
|
+
referralUrl: z.string().url().optional(),
|
|
371
|
+
error: z.string().optional()
|
|
372
|
+
});
|
|
373
|
+
var personalApplicationSchema = z.object({
|
|
374
|
+
id: z.string(),
|
|
375
|
+
createdAt: z.string(),
|
|
376
|
+
updatedAt: z.string(),
|
|
377
|
+
applicationType: z.nativeEnum(ApplicationType),
|
|
378
|
+
productType: z.union([z.nativeEnum(ProductType), z.string()]),
|
|
379
|
+
status: z.nativeEnum(ApplicationStatus),
|
|
380
|
+
applicant: personalApplicantSchema,
|
|
381
|
+
applicationData: anyObjectSchema,
|
|
382
|
+
providers: z.array(applicationProviderSchema),
|
|
383
|
+
email: z.string().email(),
|
|
384
|
+
widget: z.string().optional()
|
|
385
|
+
});
|
|
386
|
+
var createPersonalApplicationSchema = z.object({
|
|
387
|
+
productType: z.nativeEnum(ProductType),
|
|
388
|
+
applicant: personalApplicantSchema,
|
|
389
|
+
applicationData: anyObjectSchema,
|
|
390
|
+
providers: z.array(z.object({ providerId: z.string(), providerName: z.string() })).optional()
|
|
391
|
+
});
|
|
392
|
+
var displayOfferFormSchema = z.object({
|
|
393
|
+
sessionId: z.string().optional().describe("The session ID from a previous search to retrieve all offers."),
|
|
394
|
+
offerId: z.string().optional().describe("The specific offer ID to pre-select in the form.")
|
|
395
|
+
});
|
|
396
|
+
var anyOfferSchema = z.union([
|
|
397
|
+
loanOfferSchema,
|
|
398
|
+
businessCreditCardOfferSchema,
|
|
399
|
+
businessBankingOfferSchema,
|
|
400
|
+
personalBankingOfferSchema,
|
|
401
|
+
savingsOfferSchema,
|
|
402
|
+
personalCreditCardOfferSchema
|
|
403
|
+
]);
|
|
404
|
+
var displayOfferFormResponseSchema = z.object({
|
|
405
|
+
offer: anyOfferSchema,
|
|
406
|
+
allOffers: z.array(anyOfferSchema),
|
|
407
|
+
applicationData: anyObjectSchema,
|
|
408
|
+
productType: z.string(),
|
|
409
|
+
widget: z.string().optional()
|
|
410
|
+
});
|
|
411
|
+
var getOfferSchema = z.object({
|
|
412
|
+
productType: z.nativeEnum(ProductType).describe("The type of financial product being applied for."),
|
|
413
|
+
applicant: personalApplicantSchema.describe(
|
|
414
|
+
"Personal details of the applicant."
|
|
415
|
+
),
|
|
416
|
+
applicationData: anyObjectSchema.describe(
|
|
417
|
+
"The original search parameters or form data for the application."
|
|
418
|
+
),
|
|
419
|
+
provider: z.object({
|
|
420
|
+
providerId: z.string().describe("The ID of the selected provider."),
|
|
421
|
+
providerName: z.string().describe("The name of the selected provider.")
|
|
422
|
+
}).describe("The selected provider to submit the application to.")
|
|
423
|
+
});
|
|
424
|
+
var getMultipleOffersSchema = z.object({
|
|
425
|
+
productType: z.nativeEnum(ProductType).describe("The type of financial product being applied for."),
|
|
426
|
+
applicant: personalApplicantSchema.describe(
|
|
427
|
+
"Personal details of the applicant."
|
|
428
|
+
),
|
|
429
|
+
applicationData: anyObjectSchema.describe(
|
|
430
|
+
"The original search parameters or form data for the application."
|
|
431
|
+
),
|
|
432
|
+
providers: z.array(
|
|
433
|
+
z.object({
|
|
434
|
+
providerId: z.string().describe("The ID of the selected provider."),
|
|
435
|
+
providerName: z.string().describe("The name of the selected provider.")
|
|
436
|
+
})
|
|
437
|
+
).min(1).describe("The list of selected providers to submit the application to.")
|
|
438
|
+
});
|
|
439
|
+
var trackOfferStatusSchema = z.object({
|
|
440
|
+
applicationId: z.string().optional().describe("The unique ID of the application to track."),
|
|
441
|
+
email: z.string().email().optional().describe("The email address of the applicant to find applications for.")
|
|
442
|
+
}).refine((data) => data.applicationId || data.email, {
|
|
443
|
+
message: "Either applicationId or email must be provided."
|
|
444
|
+
});
|
|
445
|
+
var trackOfferStatusResponseSchema = z.object({
|
|
446
|
+
applications: z.array(personalApplicationSchema),
|
|
447
|
+
widget: z.string().optional()
|
|
448
|
+
});
|
|
449
|
+
var businessApplicantSchema = z.object({
|
|
450
|
+
businessName: z.string(),
|
|
451
|
+
ein: z.string().optional(),
|
|
452
|
+
contact: personalApplicantSchema
|
|
453
|
+
});
|
|
454
|
+
var createBusinessApplicationSchema = z.object({
|
|
455
|
+
productType: z.nativeEnum(ProductType),
|
|
456
|
+
applicant: businessApplicantSchema,
|
|
457
|
+
applicationData: anyObjectSchema,
|
|
458
|
+
providers: z.array(z.object({ providerId: z.string(), providerName: z.string() })).optional()
|
|
459
|
+
});
|
|
460
|
+
var documentTypeEnum = z.enum([
|
|
461
|
+
"articles-of-incorporation",
|
|
462
|
+
"balance-sheet",
|
|
463
|
+
"bank-statement",
|
|
464
|
+
"business-license",
|
|
465
|
+
"business-plan",
|
|
466
|
+
"contract",
|
|
467
|
+
"drivers-license",
|
|
468
|
+
"financial-statement",
|
|
469
|
+
"identity-document",
|
|
470
|
+
"invoice",
|
|
471
|
+
"lease-agreement",
|
|
472
|
+
"other-business-document",
|
|
473
|
+
"other-personal-document",
|
|
474
|
+
"passport",
|
|
475
|
+
"profit-and-loss-statement",
|
|
476
|
+
"proof-of-address",
|
|
477
|
+
"proof-of-income",
|
|
478
|
+
"property-document",
|
|
479
|
+
"purchase-order",
|
|
480
|
+
"tax-return",
|
|
481
|
+
"utility-bill",
|
|
482
|
+
"vehicle-document",
|
|
483
|
+
"voided-check"
|
|
484
|
+
]);
|
|
485
|
+
var displayUploadDocumentsFormSchema = z.object({
|
|
486
|
+
applicationId: z.string().optional().describe("Pre-fill the application ID for the document upload form.")
|
|
487
|
+
});
|
|
488
|
+
var submitDocumentsSchema = z.object({
|
|
489
|
+
applicationId: z.string().describe("The ID of the application to associate the document with."),
|
|
490
|
+
fileName: z.string().describe("The original name of the file."),
|
|
491
|
+
documentType: documentTypeEnum.describe("The category of the document."),
|
|
492
|
+
_openai_meta: z.object({}).passthrough().optional().describe("Internal metadata from OpenAI (automatically injected)")
|
|
493
|
+
});
|
|
494
|
+
var submitDocumentsResponseSchema = z.object({
|
|
495
|
+
success: z.boolean(),
|
|
496
|
+
message: z.string(),
|
|
497
|
+
uploadUrl: z.string().url().optional(),
|
|
498
|
+
uploadFields: z.record(z.string(), z.string()).optional(),
|
|
499
|
+
documentId: z.string().optional(),
|
|
500
|
+
widget: z.string().optional()
|
|
501
|
+
});
|
|
502
|
+
var displayUploadDocumentsFormResponseSchema = z.object({
|
|
503
|
+
widget: z.string().optional()
|
|
504
|
+
});
|
|
505
|
+
var loanPaymentSchema = z.object({
|
|
506
|
+
loanAmount: z.number().describe("The total amount of the loan in USD.").positive("Loan amount must be positive."),
|
|
507
|
+
interestRate: z.number().describe("The annual interest rate (e.g., 5 for 5%).").min(0, "Interest rate cannot be negative."),
|
|
508
|
+
loanTermInMonths: z.number().describe("The duration of the loan in months.").positive("Loan term must be positive.").int()
|
|
509
|
+
});
|
|
510
|
+
var loanPaymentResponseSchema = z.object({
|
|
511
|
+
monthlyPayment: z.number().describe("The calculated monthly payment amount."),
|
|
512
|
+
totalPayment: z.number().describe("The total amount to be paid over the life of the loan."),
|
|
513
|
+
totalInterest: z.number().describe("The total interest paid over the life of the loan."),
|
|
514
|
+
widget: z.string().optional()
|
|
515
|
+
});
|
|
516
|
+
var mortgagePaymentSchema = z.object({
|
|
517
|
+
propertyValue: z.number().describe("The total value of the property in USD.").positive("Property value must be positive."),
|
|
518
|
+
downPayment: z.number().describe("The amount paid upfront in USD.").min(0, "Down payment cannot be negative."),
|
|
519
|
+
interestRate: z.number().describe("The annual interest rate (e.g., 3.5 for 3.5%).").min(0, "Interest rate cannot be negative."),
|
|
520
|
+
loanTermInYears: z.number().describe("The duration of the loan in years.").positive("Loan term must be positive.").int(),
|
|
521
|
+
propertyTaxRate: z.number().describe(
|
|
522
|
+
"The annual property tax rate as a percentage (e.g., 1.2 for 1.2%)."
|
|
523
|
+
).min(0, "Property tax rate cannot be negative."),
|
|
524
|
+
homeInsurance: z.number().describe("The annual home insurance cost in USD.").min(0, "Home insurance cannot be negative.")
|
|
525
|
+
});
|
|
526
|
+
var mortgagePaymentResponseSchema = z.object({
|
|
527
|
+
loanAmount: z.number().describe("The total loan amount after down payment."),
|
|
528
|
+
principalAndInterest: z.number().describe("The monthly payment for principal and interest."),
|
|
529
|
+
monthlyPropertyTax: z.number().describe("The estimated monthly property tax payment."),
|
|
530
|
+
monthlyHomeInsurance: z.number().describe("The estimated monthly home insurance payment."),
|
|
531
|
+
totalMonthlyPayment: z.number().describe("The total estimated monthly payment (PITI)."),
|
|
532
|
+
widget: z.string().optional()
|
|
533
|
+
});
|
|
534
|
+
var leaseVsPurchaseSchema = z.object({
|
|
535
|
+
// Purchase details
|
|
536
|
+
purchasePrice: z.number().positive("Purchase price must be positive.").describe("Total price of the vehicle for purchase in USD."),
|
|
537
|
+
downPayment: z.number().min(0, "Down payment cannot be negative.").describe("Upfront payment amount for purchase in USD."),
|
|
538
|
+
loanTermInMonths: z.number().positive().int().describe("Loan duration in months for purchase."),
|
|
539
|
+
interestRate: z.number().min(0, "Interest rate cannot be negative.").describe("Annual interest rate for purchase loan (e.g., 5 for 5%)."),
|
|
540
|
+
salesTaxRate: z.number().min(0, "Sales tax rate cannot be negative.").describe("Sales tax rate as a percentage (e.g., 7.5 for 7.5%)."),
|
|
541
|
+
// Lease details
|
|
542
|
+
leaseTermInMonths: z.number().positive().int().describe("Lease duration in months."),
|
|
543
|
+
monthlyLeasePayment: z.number().positive().describe("Monthly payment for the lease in USD."),
|
|
544
|
+
moneyFactor: z.number().positive("Money factor must be positive.").describe("The money factor for the lease (similar to interest rate)."),
|
|
545
|
+
acquisitionFee: z.number().min(0).default(0).describe("Fee charged by the lessor to initiate the lease in USD."),
|
|
546
|
+
securityDeposit: z.number().min(0).default(0).describe("Refundable deposit paid at the start of the lease in USD."),
|
|
547
|
+
// Common details
|
|
548
|
+
residualValuePercentage: z.number().min(0).max(100, "Residual value percentage cannot exceed 100.").describe(
|
|
549
|
+
"Estimated value of the vehicle at the end of the lease, as a percentage of MSRP."
|
|
550
|
+
),
|
|
551
|
+
expectedOwnershipInMonths: z.number().positive().int().describe("How long you plan to keep the vehicle, in months.")
|
|
552
|
+
});
|
|
553
|
+
var leaseVsPurchaseResponseSchema = z.object({
|
|
554
|
+
purchaseAnalysis: z.object({
|
|
555
|
+
totalLoanPayment: z.number(),
|
|
556
|
+
totalInterestPaid: z.number(),
|
|
557
|
+
totalSalesTax: z.number(),
|
|
558
|
+
equityAfterOwnership: z.number(),
|
|
559
|
+
totalCostOfOwnership: z.number(),
|
|
560
|
+
monthlyPayment: z.number()
|
|
561
|
+
}),
|
|
562
|
+
leaseAnalysis: z.object({
|
|
563
|
+
totalLeasePayments: z.number(),
|
|
564
|
+
totalUpfrontCosts: z.number(),
|
|
565
|
+
totalCostOfLeasing: z.number()
|
|
566
|
+
}),
|
|
567
|
+
comparison: z.object({
|
|
568
|
+
purchaseCostIsLowerBy: z.number(),
|
|
569
|
+
leaseCostIsLowerBy: z.number(),
|
|
570
|
+
recommendation: z.string()
|
|
571
|
+
}),
|
|
572
|
+
widget: z.string().optional()
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
export { ApplicationStatus, ApplicationType, CreditTier, ProductType, ProviderStatus, anyOfferSchema, applicationProviderSchema, autoLoanSearchSchema, bankAccountOfferSchema, businessApplicantSchema, businessBankingComparisonResponseSchema, businessBankingOfferSchema, businessBankingSearchSchema, businessCreditCardComparisonResponseSchema, businessCreditCardOfferSchema, businessCreditCardSearchSchema, businessLoanSearchSchema, createBusinessApplicationSchema, createPersonalApplicationSchema, creditCardOfferSchema, displayOfferFormResponseSchema, displayOfferFormSchema, displayUploadDocumentsFormResponseSchema, displayUploadDocumentsFormSchema, documentTypeEnum, getMultipleOffersSchema, getOfferSchema, leaseVsPurchaseResponseSchema, leaseVsPurchaseSchema, loanComparisonResponseSchema, loanOfferSchema, loanPaymentResponseSchema, loanPaymentSchema, mortgagePaymentResponseSchema, mortgagePaymentSchema, mortgageSearchSchema, personalApplicantSchema, personalApplicationSchema, personalBankingComparisonResponseSchema, personalBankingOfferSchema, personalBankingSearchSchema, personalCreditCardComparisonResponseSchema, personalCreditCardOfferSchema, personalCreditCardSearchSchema, personalLoanSearchSchema, savingsComparisonResponseSchema, savingsOfferSchema, savingsSearchSchema, studentLoanSearchSchema, submitDocumentsResponseSchema, submitDocumentsSchema, trackOfferStatusResponseSchema, trackOfferStatusSchema };
|
|
576
|
+
//# sourceMappingURL=index.mjs.map
|
|
577
|
+
//# sourceMappingURL=index.mjs.map
|