@domu-ai/kiban-sdk 1.72.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/README.md +35 -0
- package/dashboard/client.d.ts +799 -0
- package/dashboard/client.js +195 -0
- package/dashboard/index.d.ts +3 -0
- package/dashboard/index.js +42 -0
- package/dashboard/schemas.d.ts +1002 -0
- package/dashboard/schemas.js +258 -0
- package/fetcher.d.ts +2 -0
- package/fetcher.js +23 -0
- package/index.d.ts +11 -0
- package/index.js +55 -0
- package/internal/client.d.ts +3055 -0
- package/internal/client.js +495 -0
- package/internal/index.d.ts +3 -0
- package/internal/index.js +42 -0
- package/internal/schemas.d.ts +12845 -0
- package/internal/schemas.js +1870 -0
- package/package.json +43 -0
- package/public/client.d.ts +871 -0
- package/public/client.js +251 -0
- package/public/index.d.ts +3 -0
- package/public/index.js +42 -0
- package/public/schemas.d.ts +1487 -0
- package/public/schemas.js +455 -0
- package/shared/fetcher.d.ts +94 -0
- package/shared/fetcher.js +189 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ProcessSwervePayPaymentResponse = exports.ProcessSwervePayPaymentBody = exports.ProcessSpeedPayPaymentResponse = exports.ProcessSpeedPayPaymentBody = exports.ProcessRepayPaymentResponse = exports.ProcessRepayPaymentBody = exports.ProcessPayrazrPaymentResponse = exports.ProcessPayrazrPaymentBody = exports.ProcessPNMPaymentResponse = exports.ProcessPNMPaymentBody = exports.ProcessPayliancePaymentResponse = exports.ProcessPayliancePaymentBody = exports.ProcessMonerisPaymentResponse = exports.ProcessMonerisPaymentBody = exports.UpdateContactResponse = exports.UpdateContactBody = exports.UpdateContactQueryParams = exports.UpdateContactParams = exports.GetContactResponse = exports.GetContactQueryParams = exports.GetContactParams = exports.CreateAloricaNoteResponse = exports.CreateAloricaNoteBody = exports.CreateAloricaNoteQueryParams = exports.GetDebtsResponse = exports.GetDebtsQueryParams = exports.getDebtsQueryIncludeOffersDefault = exports.GetDebtsParams = exports.EndResponse = exports.EndBody = exports.StartBody = exports.startBodyTypeDefault = exports.startBodyPhoneNumberRegExp = exports.MeResponse = exports.CheckResponse = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* Generated by orval v8.2.0 🍺
|
|
39
|
+
* Do not edit manually.
|
|
40
|
+
* Kiban API
|
|
41
|
+
* REST API for application integration. Production-ready endpoints with enterprise-grade reliability.
|
|
42
|
+
* OpenAPI spec version: 1.0.0
|
|
43
|
+
*/
|
|
44
|
+
const zod = __importStar(require("zod"));
|
|
45
|
+
/**
|
|
46
|
+
* Lightweight endpoint that returns 200 OK when the service is operational. Designed for load balancers, uptime monitors, and client-side connectivity checks. Does not perform dependency validation.
|
|
47
|
+
* @summary Basic service availability check
|
|
48
|
+
*/
|
|
49
|
+
exports.CheckResponse = zod.object({
|
|
50
|
+
"status": zod.enum(['ok']).describe('Service operational status - always returns \'ok\' when available'),
|
|
51
|
+
"timestamp": zod.string().describe('ISO 8601 UTC timestamp of health check execution')
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Returns the authenticated user information including userId, sessionId, and organization details. Requires valid Bearer token in Authorization header.
|
|
55
|
+
* @summary Get authenticated user information
|
|
56
|
+
*/
|
|
57
|
+
exports.MeResponse = zod.object({
|
|
58
|
+
"userId": zod.string().describe('Authenticated user identifier'),
|
|
59
|
+
"sessionId": zod.string().describe('Current session identifier'),
|
|
60
|
+
"orgId": zod.string().nullable().describe('Organization identifier if present'),
|
|
61
|
+
"orgRole": zod.string().nullable().describe('User\'s role in the organization')
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Initiates an interaction session with Nubank for a customer. Returns a sourceId that must be used to end the interaction.
|
|
65
|
+
* @summary Start a Nubank customer interaction
|
|
66
|
+
*/
|
|
67
|
+
exports.startBodyPhoneNumberRegExp = new RegExp('^\\d+$');
|
|
68
|
+
exports.startBodyTypeDefault = `ai-voice-dialer`;
|
|
69
|
+
exports.StartBody = zod.object({
|
|
70
|
+
"customerId": zod.string().min(1),
|
|
71
|
+
"phoneNumber": zod.string().min(1).regex(exports.startBodyPhoneNumberRegExp),
|
|
72
|
+
"type": zod.string().default(exports.startBodyTypeDefault)
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Closes an interaction session with Nubank. The sourceId from the start interaction must be provided.
|
|
76
|
+
* @summary End a Nubank customer interaction
|
|
77
|
+
*/
|
|
78
|
+
exports.EndBody = zod.object({
|
|
79
|
+
"sourceId": zod.string().min(1),
|
|
80
|
+
"customerId": zod.string().min(1)
|
|
81
|
+
});
|
|
82
|
+
exports.EndResponse = zod.object({
|
|
83
|
+
"success": zod.boolean()
|
|
84
|
+
});
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves debts for a Nubank customer. Optionally includes available payment offers when include_offers=true.
|
|
87
|
+
* @summary Get customer debts
|
|
88
|
+
*/
|
|
89
|
+
exports.GetDebtsParams = zod.object({
|
|
90
|
+
"customerId": zod.string().min(1)
|
|
91
|
+
});
|
|
92
|
+
exports.getDebtsQueryIncludeOffersDefault = false;
|
|
93
|
+
exports.GetDebtsQueryParams = zod.object({
|
|
94
|
+
"include_offers": zod.boolean().default(exports.getDebtsQueryIncludeOffersDefault)
|
|
95
|
+
});
|
|
96
|
+
exports.GetDebtsResponse = zod.union([zod.object({
|
|
97
|
+
"customerId": zod.string(),
|
|
98
|
+
"debts": zod.union([zod.array(zod.object({
|
|
99
|
+
"late": zod.string().optional(),
|
|
100
|
+
"start": zod.string().optional(),
|
|
101
|
+
"total": zod.string().optional(),
|
|
102
|
+
"current": zod.string().optional(),
|
|
103
|
+
"principal": zod.string().optional(),
|
|
104
|
+
"days_late": zod.number().optional(),
|
|
105
|
+
"product": zod.object({
|
|
106
|
+
"type": zod.string(),
|
|
107
|
+
"reference_id": zod.string()
|
|
108
|
+
}).optional()
|
|
109
|
+
})), zod.object({
|
|
110
|
+
"error": zod.string(),
|
|
111
|
+
"statusCode": zod.string().optional()
|
|
112
|
+
})])
|
|
113
|
+
}), zod.object({
|
|
114
|
+
"customerId": zod.string(),
|
|
115
|
+
"debts": zod.union([zod.array(zod.object({
|
|
116
|
+
"late": zod.string().optional(),
|
|
117
|
+
"start": zod.string().optional(),
|
|
118
|
+
"total": zod.string().optional(),
|
|
119
|
+
"current": zod.string().optional(),
|
|
120
|
+
"principal": zod.string().optional(),
|
|
121
|
+
"days_late": zod.number().optional(),
|
|
122
|
+
"product": zod.object({
|
|
123
|
+
"type": zod.string(),
|
|
124
|
+
"reference_id": zod.string()
|
|
125
|
+
}).optional()
|
|
126
|
+
})), zod.object({
|
|
127
|
+
"error": zod.string(),
|
|
128
|
+
"statusCode": zod.string().optional()
|
|
129
|
+
})]),
|
|
130
|
+
"offers": zod.union([zod.array(zod.object({
|
|
131
|
+
"type": zod.string(),
|
|
132
|
+
"offers": zod.object({
|
|
133
|
+
"single_payment": zod.object({
|
|
134
|
+
"debt": zod.string(),
|
|
135
|
+
"discount": zod.string(),
|
|
136
|
+
"discount_percentage": zod.string(),
|
|
137
|
+
"downpayment": zod.string(),
|
|
138
|
+
"downpayment_due_date": zod.string(),
|
|
139
|
+
"simulation_id": zod.string(),
|
|
140
|
+
"created_at": zod.string()
|
|
141
|
+
}).optional(),
|
|
142
|
+
"installments": zod.object({
|
|
143
|
+
"downpayment": zod.string(),
|
|
144
|
+
"downpayment_due_date": zod.string(),
|
|
145
|
+
"has_installments_boleto": zod.boolean(),
|
|
146
|
+
"first_installment_due_date": zod.string(),
|
|
147
|
+
"due_day": zod.number(),
|
|
148
|
+
"created_at": zod.string(),
|
|
149
|
+
"installment_options": zod.array(zod.object({
|
|
150
|
+
"simulation_id": zod.string(),
|
|
151
|
+
"number_of_installments": zod.number(),
|
|
152
|
+
"installment_amount": zod.string(),
|
|
153
|
+
"debt": zod.string(),
|
|
154
|
+
"discount_percentage": zod.string(),
|
|
155
|
+
"total_to_pay": zod.string(),
|
|
156
|
+
"iof": zod.string(),
|
|
157
|
+
"interest_rate": zod.string(),
|
|
158
|
+
"interest": zod.string(),
|
|
159
|
+
"discount": zod.string(),
|
|
160
|
+
"monthly_cet": zod.string(),
|
|
161
|
+
"yearly_cet": zod.string()
|
|
162
|
+
}))
|
|
163
|
+
}).optional()
|
|
164
|
+
}),
|
|
165
|
+
"product": zod.object({
|
|
166
|
+
"type": zod.string(),
|
|
167
|
+
"reference_id": zod.string()
|
|
168
|
+
})
|
|
169
|
+
})), zod.object({
|
|
170
|
+
"error": zod.string(),
|
|
171
|
+
"statusCode": zod.string().optional()
|
|
172
|
+
})])
|
|
173
|
+
})]);
|
|
174
|
+
/**
|
|
175
|
+
* Creates a call result note in SST Loan Services for Domu.AI integration.
|
|
176
|
+
* @summary Create note in SST
|
|
177
|
+
*/
|
|
178
|
+
exports.CreateAloricaNoteQueryParams = zod.object({
|
|
179
|
+
"campaignId": zod.string().min(1)
|
|
180
|
+
});
|
|
181
|
+
exports.CreateAloricaNoteBody = zod.object({
|
|
182
|
+
"phoneNumber": zod.string().min(1),
|
|
183
|
+
"result": zod.enum(['PAYMENT', 'PROMISE', 'PAYOFF_QUOTE_REQUEST', 'ACCOUNT_INQUIRY', 'ACCOUNT_UNLOCK', 'GENERAL']),
|
|
184
|
+
"note": zod.string().min(1)
|
|
185
|
+
});
|
|
186
|
+
exports.CreateAloricaNoteResponse = zod.object({
|
|
187
|
+
"returnMessage": zod.enum(['OK', 'INVALID_ACCOUNT_NUMBER', 'INVALID_RESULT_TYPE', 'INTERNAL'])
|
|
188
|
+
});
|
|
189
|
+
/**
|
|
190
|
+
* @summary Get a contact by ID
|
|
191
|
+
*/
|
|
192
|
+
exports.GetContactParams = zod.object({
|
|
193
|
+
"id": zod.string()
|
|
194
|
+
});
|
|
195
|
+
exports.GetContactQueryParams = zod.object({
|
|
196
|
+
"campaignId": zod.string()
|
|
197
|
+
});
|
|
198
|
+
exports.GetContactResponse = zod.object({
|
|
199
|
+
"contactId": zod.string(),
|
|
200
|
+
"contact": zod.record(zod.string(), zod.unknown())
|
|
201
|
+
});
|
|
202
|
+
/**
|
|
203
|
+
* @summary Update contact disposition data by ID
|
|
204
|
+
*/
|
|
205
|
+
exports.UpdateContactParams = zod.object({
|
|
206
|
+
"id": zod.string()
|
|
207
|
+
});
|
|
208
|
+
exports.UpdateContactQueryParams = zod.object({
|
|
209
|
+
"campaignId": zod.string()
|
|
210
|
+
});
|
|
211
|
+
exports.UpdateContactBody = zod.object({
|
|
212
|
+
"resultCode": zod.string().optional(),
|
|
213
|
+
"attributes": zod.record(zod.string(), zod.string().nullable()).optional()
|
|
214
|
+
});
|
|
215
|
+
exports.UpdateContactResponse = zod.object({
|
|
216
|
+
"contactId": zod.string()
|
|
217
|
+
});
|
|
218
|
+
/**
|
|
219
|
+
* Moneris Generic Payment Connector
|
|
220
|
+
* @summary Process an end-to-end Moneris payment
|
|
221
|
+
*/
|
|
222
|
+
exports.ProcessMonerisPaymentBody = zod.object({
|
|
223
|
+
"transaction_id": zod.string(),
|
|
224
|
+
"amount": zod.string(),
|
|
225
|
+
"currency_code": zod.string().optional(),
|
|
226
|
+
"method": zod.string().optional(),
|
|
227
|
+
"description": zod.string().nullish(),
|
|
228
|
+
"cardnumber": zod.string().optional(),
|
|
229
|
+
"cvv": zod.string().optional(),
|
|
230
|
+
"expiry_month": zod.string().optional(),
|
|
231
|
+
"expiry_year": zod.string().optional(),
|
|
232
|
+
"postal_code": zod.string().nullish(),
|
|
233
|
+
"bankaccountnumber": zod.string().optional(),
|
|
234
|
+
"routing_number": zod.string().optional(),
|
|
235
|
+
"account_type": zod.string().optional(),
|
|
236
|
+
"parameters": zod.object({
|
|
237
|
+
"campaignid": zod.string(),
|
|
238
|
+
"callerphone": zod.string(),
|
|
239
|
+
"sessionid": zod.string().optional(),
|
|
240
|
+
"payment_method_id": zod.string().optional(),
|
|
241
|
+
"paymentdate": zod.string().optional(),
|
|
242
|
+
"planfrequency": zod.string().optional(),
|
|
243
|
+
"plantype": zod.string().optional(),
|
|
244
|
+
"numberofpayments": zod.string().optional()
|
|
245
|
+
})
|
|
246
|
+
});
|
|
247
|
+
exports.ProcessMonerisPaymentResponse = zod.object({
|
|
248
|
+
"charge_id": zod.string(),
|
|
249
|
+
"error_code": zod.string().nullable(),
|
|
250
|
+
"error_message": zod.string().nullable()
|
|
251
|
+
});
|
|
252
|
+
/**
|
|
253
|
+
* Payliance Generic Payment Connector
|
|
254
|
+
* @summary Process a Payliance card verify, tokenize, and optional payment delegate
|
|
255
|
+
*/
|
|
256
|
+
exports.ProcessPayliancePaymentBody = zod.object({
|
|
257
|
+
"transaction_id": zod.string(),
|
|
258
|
+
"amount": zod.string(),
|
|
259
|
+
"currency_code": zod.string().optional(),
|
|
260
|
+
"method": zod.string().optional(),
|
|
261
|
+
"description": zod.string().nullish(),
|
|
262
|
+
"cardnumber": zod.string().optional(),
|
|
263
|
+
"cvv": zod.string().optional(),
|
|
264
|
+
"expiry_month": zod.string().optional(),
|
|
265
|
+
"expiry_year": zod.string().optional(),
|
|
266
|
+
"postal_code": zod.string().nullish(),
|
|
267
|
+
"bankaccountnumber": zod.string().optional(),
|
|
268
|
+
"routing_number": zod.string().optional(),
|
|
269
|
+
"account_type": zod.string().optional(),
|
|
270
|
+
"parameters": zod.object({
|
|
271
|
+
"campaignid": zod.string(),
|
|
272
|
+
"callerphone": zod.string(),
|
|
273
|
+
"sessionid": zod.string().optional(),
|
|
274
|
+
"payment_method_id": zod.string().optional(),
|
|
275
|
+
"paymentdate": zod.string().optional(),
|
|
276
|
+
"planfrequency": zod.string().optional(),
|
|
277
|
+
"plantype": zod.string().optional(),
|
|
278
|
+
"numberofpayments": zod.string().optional()
|
|
279
|
+
})
|
|
280
|
+
});
|
|
281
|
+
exports.ProcessPayliancePaymentResponse = zod.object({
|
|
282
|
+
"charge_id": zod.string(),
|
|
283
|
+
"error_code": zod.string().nullable(),
|
|
284
|
+
"error_message": zod.string().nullable()
|
|
285
|
+
});
|
|
286
|
+
/**
|
|
287
|
+
* Accepts Twilio Generic Pay Connector JSON callback. Orchestrates the full PayNearMe payment flow: resolves target by phone, finds or creates an order, reconciles amounts, tokenizes payment method, and processes payment.
|
|
288
|
+
* @summary Process an end-to-end PayNearMe payment
|
|
289
|
+
*/
|
|
290
|
+
exports.ProcessPNMPaymentBody = zod.object({
|
|
291
|
+
"transaction_id": zod.string(),
|
|
292
|
+
"amount": zod.string(),
|
|
293
|
+
"currency_code": zod.string().optional(),
|
|
294
|
+
"method": zod.string().optional(),
|
|
295
|
+
"description": zod.string().nullish(),
|
|
296
|
+
"cardnumber": zod.string().optional(),
|
|
297
|
+
"cvv": zod.string().optional(),
|
|
298
|
+
"expiry_month": zod.string().optional(),
|
|
299
|
+
"expiry_year": zod.string().optional(),
|
|
300
|
+
"postal_code": zod.string().nullish(),
|
|
301
|
+
"bankaccountnumber": zod.string().optional(),
|
|
302
|
+
"routing_number": zod.string().optional(),
|
|
303
|
+
"account_type": zod.string().optional(),
|
|
304
|
+
"parameters": zod.object({
|
|
305
|
+
"campaignid": zod.string(),
|
|
306
|
+
"callerphone": zod.string(),
|
|
307
|
+
"sessionid": zod.string().optional(),
|
|
308
|
+
"payment_method_id": zod.string().optional(),
|
|
309
|
+
"paymentdate": zod.string().optional(),
|
|
310
|
+
"planfrequency": zod.string().optional(),
|
|
311
|
+
"plantype": zod.string().optional(),
|
|
312
|
+
"numberofpayments": zod.string().optional()
|
|
313
|
+
})
|
|
314
|
+
});
|
|
315
|
+
exports.ProcessPNMPaymentResponse = zod.object({
|
|
316
|
+
"charge_id": zod.string(),
|
|
317
|
+
"error_code": zod.string().nullable(),
|
|
318
|
+
"error_message": zod.string().nullable()
|
|
319
|
+
});
|
|
320
|
+
/**
|
|
321
|
+
* Payrazr Generic Payment Connector
|
|
322
|
+
* @summary Process a Payrazr card or ACH payment with customer resolution and fee calculation
|
|
323
|
+
*/
|
|
324
|
+
exports.ProcessPayrazrPaymentBody = zod.object({
|
|
325
|
+
"transaction_id": zod.string(),
|
|
326
|
+
"amount": zod.string(),
|
|
327
|
+
"currency_code": zod.string().optional(),
|
|
328
|
+
"method": zod.string().optional(),
|
|
329
|
+
"description": zod.string().nullish(),
|
|
330
|
+
"cardnumber": zod.string().optional(),
|
|
331
|
+
"cvv": zod.string().optional(),
|
|
332
|
+
"expiry_month": zod.string().optional(),
|
|
333
|
+
"expiry_year": zod.string().optional(),
|
|
334
|
+
"postal_code": zod.string().nullish(),
|
|
335
|
+
"bankaccountnumber": zod.string().optional(),
|
|
336
|
+
"routing_number": zod.string().optional(),
|
|
337
|
+
"account_type": zod.string().optional(),
|
|
338
|
+
"parameters": zod.object({
|
|
339
|
+
"campaignid": zod.string(),
|
|
340
|
+
"callerphone": zod.string(),
|
|
341
|
+
"sessionid": zod.string().optional(),
|
|
342
|
+
"payment_method_id": zod.string().optional(),
|
|
343
|
+
"paymentdate": zod.string().optional(),
|
|
344
|
+
"planfrequency": zod.string().optional(),
|
|
345
|
+
"plantype": zod.string().optional(),
|
|
346
|
+
"numberofpayments": zod.string().optional()
|
|
347
|
+
})
|
|
348
|
+
});
|
|
349
|
+
exports.ProcessPayrazrPaymentResponse = zod.object({
|
|
350
|
+
"charge_id": zod.string(),
|
|
351
|
+
"error_code": zod.string().nullable(),
|
|
352
|
+
"error_message": zod.string().nullable()
|
|
353
|
+
});
|
|
354
|
+
/**
|
|
355
|
+
* Repay Generic Payment Connector
|
|
356
|
+
* @summary Process an end-to-end Repay payment
|
|
357
|
+
*/
|
|
358
|
+
exports.ProcessRepayPaymentBody = zod.object({
|
|
359
|
+
"transaction_id": zod.string(),
|
|
360
|
+
"amount": zod.string(),
|
|
361
|
+
"currency_code": zod.string().optional(),
|
|
362
|
+
"method": zod.string().optional(),
|
|
363
|
+
"description": zod.string().nullish(),
|
|
364
|
+
"cardnumber": zod.string().optional(),
|
|
365
|
+
"cvv": zod.string().optional(),
|
|
366
|
+
"expiry_month": zod.string().optional(),
|
|
367
|
+
"expiry_year": zod.string().optional(),
|
|
368
|
+
"postal_code": zod.string().nullish(),
|
|
369
|
+
"bankaccountnumber": zod.string().optional(),
|
|
370
|
+
"routing_number": zod.string().optional(),
|
|
371
|
+
"account_type": zod.string().optional(),
|
|
372
|
+
"parameters": zod.object({
|
|
373
|
+
"campaignid": zod.string(),
|
|
374
|
+
"callerphone": zod.string(),
|
|
375
|
+
"sessionid": zod.string().optional(),
|
|
376
|
+
"payment_method_id": zod.string().optional(),
|
|
377
|
+
"paymentdate": zod.string().optional(),
|
|
378
|
+
"planfrequency": zod.string().optional(),
|
|
379
|
+
"plantype": zod.string().optional(),
|
|
380
|
+
"numberofpayments": zod.string().optional()
|
|
381
|
+
})
|
|
382
|
+
});
|
|
383
|
+
exports.ProcessRepayPaymentResponse = zod.object({
|
|
384
|
+
"charge_id": zod.string(),
|
|
385
|
+
"error_code": zod.string().nullable(),
|
|
386
|
+
"error_message": zod.string().nullable()
|
|
387
|
+
});
|
|
388
|
+
/**
|
|
389
|
+
* Accepts Twilio Generic Pay Connector JSON callback. Resolves target by phone, determines funding account (existing via payment_method_id or new card/ACH), and processes payment through SpeedPay.
|
|
390
|
+
* @summary Process an end-to-end SpeedPay payment
|
|
391
|
+
*/
|
|
392
|
+
exports.ProcessSpeedPayPaymentBody = zod.object({
|
|
393
|
+
"transaction_id": zod.string(),
|
|
394
|
+
"amount": zod.string(),
|
|
395
|
+
"currency_code": zod.string().optional(),
|
|
396
|
+
"method": zod.string().optional(),
|
|
397
|
+
"description": zod.string().nullish(),
|
|
398
|
+
"cardnumber": zod.string().optional(),
|
|
399
|
+
"cvv": zod.string().optional(),
|
|
400
|
+
"expiry_month": zod.string().optional(),
|
|
401
|
+
"expiry_year": zod.string().optional(),
|
|
402
|
+
"postal_code": zod.string().nullish(),
|
|
403
|
+
"bankaccountnumber": zod.string().optional(),
|
|
404
|
+
"routing_number": zod.string().optional(),
|
|
405
|
+
"account_type": zod.string().optional(),
|
|
406
|
+
"parameters": zod.object({
|
|
407
|
+
"campaignid": zod.string(),
|
|
408
|
+
"callerphone": zod.string(),
|
|
409
|
+
"sessionid": zod.string().optional(),
|
|
410
|
+
"payment_method_id": zod.string().optional(),
|
|
411
|
+
"paymentdate": zod.string().optional(),
|
|
412
|
+
"planfrequency": zod.string().optional(),
|
|
413
|
+
"plantype": zod.string().optional(),
|
|
414
|
+
"numberofpayments": zod.string().optional()
|
|
415
|
+
})
|
|
416
|
+
});
|
|
417
|
+
exports.ProcessSpeedPayPaymentResponse = zod.object({
|
|
418
|
+
"charge_id": zod.string(),
|
|
419
|
+
"error_code": zod.string().nullable(),
|
|
420
|
+
"error_message": zod.string().nullable()
|
|
421
|
+
});
|
|
422
|
+
/**
|
|
423
|
+
* Accepts Twilio Generic Pay Connector JSON callback. Resolves target by phone, processes payment through SwervePay, and returns charge_id or error.
|
|
424
|
+
* @summary Process an end-to-end SwervePay payment
|
|
425
|
+
*/
|
|
426
|
+
exports.ProcessSwervePayPaymentBody = zod.object({
|
|
427
|
+
"transaction_id": zod.string(),
|
|
428
|
+
"amount": zod.string(),
|
|
429
|
+
"currency_code": zod.string().optional(),
|
|
430
|
+
"method": zod.string().optional(),
|
|
431
|
+
"description": zod.string().nullish(),
|
|
432
|
+
"cardnumber": zod.string().optional(),
|
|
433
|
+
"cvv": zod.string().optional(),
|
|
434
|
+
"expiry_month": zod.string().optional(),
|
|
435
|
+
"expiry_year": zod.string().optional(),
|
|
436
|
+
"postal_code": zod.string().nullish(),
|
|
437
|
+
"bankaccountnumber": zod.string().optional(),
|
|
438
|
+
"routing_number": zod.string().optional(),
|
|
439
|
+
"account_type": zod.string().optional(),
|
|
440
|
+
"parameters": zod.object({
|
|
441
|
+
"campaignid": zod.string(),
|
|
442
|
+
"callerphone": zod.string(),
|
|
443
|
+
"sessionid": zod.string().optional(),
|
|
444
|
+
"payment_method_id": zod.string().optional(),
|
|
445
|
+
"paymentdate": zod.string().optional(),
|
|
446
|
+
"planfrequency": zod.string().optional(),
|
|
447
|
+
"plantype": zod.string().optional(),
|
|
448
|
+
"numberofpayments": zod.string().optional()
|
|
449
|
+
})
|
|
450
|
+
});
|
|
451
|
+
exports.ProcessSwervePayPaymentResponse = zod.object({
|
|
452
|
+
"charge_id": zod.string(),
|
|
453
|
+
"error_code": zod.string().nullable(),
|
|
454
|
+
"error_message": zod.string().nullable()
|
|
455
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom HTTP fetcher for the Kiban API client.
|
|
3
|
+
*
|
|
4
|
+
* Supports Orval's mutator signature (`customFetcher(url, options)`) while
|
|
5
|
+
* preserving auth-token injection and robust JSON/non-JSON response parsing.
|
|
6
|
+
*/
|
|
7
|
+
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
8
|
+
type QueryValue = string | number | boolean | null | undefined;
|
|
9
|
+
type SuccessStatus = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
10
|
+
export interface FetcherOptions<TBody = unknown> {
|
|
11
|
+
url: string;
|
|
12
|
+
method: HttpMethod;
|
|
13
|
+
headers?: HeadersInit;
|
|
14
|
+
params?: Record<string, QueryValue>;
|
|
15
|
+
data?: TBody;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
export interface FetcherResponse<TData> {
|
|
19
|
+
data: TData;
|
|
20
|
+
status: number;
|
|
21
|
+
headers: Headers;
|
|
22
|
+
}
|
|
23
|
+
export type MutatorResponseEnvelope = {
|
|
24
|
+
data: unknown;
|
|
25
|
+
status: number;
|
|
26
|
+
headers: Headers;
|
|
27
|
+
};
|
|
28
|
+
export type SuccessResponse<TResponse extends {
|
|
29
|
+
status: number;
|
|
30
|
+
}> = Extract<TResponse, {
|
|
31
|
+
status: SuccessStatus;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Set the authentication token getter
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // After user login:
|
|
38
|
+
* setAuthToken(() => localStorage.getItem('authToken'));
|
|
39
|
+
*
|
|
40
|
+
* // With Clerk:
|
|
41
|
+
* setAuthToken(() => clerk.session?.getToken() ?? null);
|
|
42
|
+
*/
|
|
43
|
+
export declare function setAuthToken(getter: () => string | null): void;
|
|
44
|
+
/**
|
|
45
|
+
* Clear the authentication token (call on logout)
|
|
46
|
+
*/
|
|
47
|
+
export declare function clearAuthToken(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Set API base URL at runtime.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* setApiBaseUrl("https://api.example.com");
|
|
53
|
+
*/
|
|
54
|
+
export declare function setApiBaseUrl(url: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Clear runtime API base URL override and fall back to env/default.
|
|
57
|
+
*/
|
|
58
|
+
export declare function clearApiBaseUrl(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Get the effective API base URL used by the fetcher.
|
|
61
|
+
*/
|
|
62
|
+
export declare function getApiBaseUrl(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Type guard for SDK response unions that discriminates 2xx responses.
|
|
65
|
+
*/
|
|
66
|
+
export declare function isSuccessResponse<TResponse extends {
|
|
67
|
+
status: number;
|
|
68
|
+
}>(response: TResponse): response is SuccessResponse<TResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* Assert an SDK response is successful (2xx), otherwise throw with payload context.
|
|
71
|
+
*/
|
|
72
|
+
export declare function ensureSuccess<TResponse extends {
|
|
73
|
+
status: number;
|
|
74
|
+
data: unknown;
|
|
75
|
+
}>(response: TResponse, operationName?: string): asserts response is SuccessResponse<TResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Return the success payload from an SDK response or throw for non-2xx responses.
|
|
78
|
+
*/
|
|
79
|
+
export declare function getSuccessData<TResponse extends {
|
|
80
|
+
status: number;
|
|
81
|
+
data: unknown;
|
|
82
|
+
}>(response: TResponse, operationName?: string): SuccessResponse<TResponse>["data"];
|
|
83
|
+
/**
|
|
84
|
+
* Orval mutator signature (used by generated SDK clients).
|
|
85
|
+
*
|
|
86
|
+
* `TResponse` is expected to be the full response envelope shape
|
|
87
|
+
* ({ data, status, headers }), not just the parsed body payload.
|
|
88
|
+
*/
|
|
89
|
+
export declare function customFetcher<TResponse extends MutatorResponseEnvelope>(url: string, options?: RequestInit): Promise<TResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* Alternate object-style fetcher signature.
|
|
92
|
+
*/
|
|
93
|
+
export declare function customFetcher<TData, TBody = unknown>(options: FetcherOptions<TBody>): Promise<FetcherResponse<TData>>;
|
|
94
|
+
export default customFetcher;
|