@singularity-payments/elysia 0.1.0-alpha.1
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 +201 -0
- package/dist/index.d.mts +332 -0
- package/dist/index.d.ts +332 -0
- package/dist/index.js +514 -0
- package/dist/index.mjs +489 -0
- package/package.json +48 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { MpesaClient } from "@singularity-payments/core";
|
|
3
|
+
import { Elysia } from "elysia";
|
|
4
|
+
|
|
5
|
+
// src/handlers.ts
|
|
6
|
+
function createMpesaHandlers(client) {
|
|
7
|
+
const handlers = {
|
|
8
|
+
stkCallback: async (ctx) => {
|
|
9
|
+
try {
|
|
10
|
+
const body = ctx.body;
|
|
11
|
+
const ipAddress = ctx.request.headers.get("x-forwarded-for") || ctx.request.headers.get("x-real-ip") || void 0;
|
|
12
|
+
const response = await client.handleSTKCallback(body, ipAddress);
|
|
13
|
+
ctx.set.status = 200;
|
|
14
|
+
return response;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error("STK Callback error:", error);
|
|
17
|
+
ctx.set.status = 200;
|
|
18
|
+
return {
|
|
19
|
+
ResultCode: 1,
|
|
20
|
+
ResultDesc: "Internal error processing callback"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
c2bValidation: async (ctx) => {
|
|
25
|
+
try {
|
|
26
|
+
const body = ctx.body;
|
|
27
|
+
const response = await client.handleC2BValidation(body);
|
|
28
|
+
ctx.set.status = 200;
|
|
29
|
+
return response;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error("C2B Validation error:", error);
|
|
32
|
+
ctx.set.status = 200;
|
|
33
|
+
return {
|
|
34
|
+
ResultCode: 1,
|
|
35
|
+
ResultDesc: "Validation failed"
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
c2bConfirmation: async (ctx) => {
|
|
40
|
+
try {
|
|
41
|
+
const body = ctx.body;
|
|
42
|
+
const response = await client.handleC2BConfirmation(body);
|
|
43
|
+
ctx.set.status = 200;
|
|
44
|
+
return response;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error("C2B Confirmation error:", error);
|
|
47
|
+
ctx.set.status = 200;
|
|
48
|
+
return {
|
|
49
|
+
ResultCode: 1,
|
|
50
|
+
ResultDesc: "Processing failed"
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
b2cResult: async (ctx) => {
|
|
55
|
+
try {
|
|
56
|
+
const body = ctx.body;
|
|
57
|
+
const parsed = client.getCallbackHandler().parseB2CCallback(body);
|
|
58
|
+
console.log("B2C Result:", parsed);
|
|
59
|
+
ctx.set.status = 200;
|
|
60
|
+
return {
|
|
61
|
+
ResultCode: 0,
|
|
62
|
+
ResultDesc: "Accepted"
|
|
63
|
+
};
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error("B2C Result error:", error);
|
|
66
|
+
ctx.set.status = 200;
|
|
67
|
+
return {
|
|
68
|
+
ResultCode: 1,
|
|
69
|
+
ResultDesc: "Processing failed"
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
b2cTimeout: async (ctx) => {
|
|
74
|
+
try {
|
|
75
|
+
const body = ctx.body;
|
|
76
|
+
console.log("B2C Timeout:", body);
|
|
77
|
+
ctx.set.status = 200;
|
|
78
|
+
return {
|
|
79
|
+
ResultCode: 0,
|
|
80
|
+
ResultDesc: "Timeout received"
|
|
81
|
+
};
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error("B2C Timeout error:", error);
|
|
84
|
+
ctx.set.status = 200;
|
|
85
|
+
return {
|
|
86
|
+
ResultCode: 1,
|
|
87
|
+
ResultDesc: "Processing failed"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
b2bResult: async (ctx) => {
|
|
92
|
+
try {
|
|
93
|
+
const body = ctx.body;
|
|
94
|
+
const parsed = client.getCallbackHandler().parseB2BCallback(body);
|
|
95
|
+
console.log("B2B Result:", parsed);
|
|
96
|
+
ctx.set.status = 200;
|
|
97
|
+
return {
|
|
98
|
+
ResultCode: 0,
|
|
99
|
+
ResultDesc: "Accepted"
|
|
100
|
+
};
|
|
101
|
+
} catch (error) {
|
|
102
|
+
console.error("B2B Result error:", error);
|
|
103
|
+
ctx.set.status = 200;
|
|
104
|
+
return {
|
|
105
|
+
ResultCode: 1,
|
|
106
|
+
ResultDesc: "Processing failed"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
b2bTimeout: async (ctx) => {
|
|
111
|
+
try {
|
|
112
|
+
const body = ctx.body;
|
|
113
|
+
console.log("B2B Timeout:", body);
|
|
114
|
+
ctx.set.status = 200;
|
|
115
|
+
return {
|
|
116
|
+
ResultCode: 0,
|
|
117
|
+
ResultDesc: "Timeout received"
|
|
118
|
+
};
|
|
119
|
+
} catch (error) {
|
|
120
|
+
console.error("B2B Timeout error:", error);
|
|
121
|
+
ctx.set.status = 200;
|
|
122
|
+
return {
|
|
123
|
+
ResultCode: 1,
|
|
124
|
+
ResultDesc: "Processing failed"
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
balanceResult: async (ctx) => {
|
|
129
|
+
try {
|
|
130
|
+
const body = ctx.body;
|
|
131
|
+
const parsed = client.getCallbackHandler().parseAccountBalanceCallback(body);
|
|
132
|
+
console.log("Balance Result:", parsed);
|
|
133
|
+
ctx.set.status = 200;
|
|
134
|
+
return {
|
|
135
|
+
ResultCode: 0,
|
|
136
|
+
ResultDesc: "Accepted"
|
|
137
|
+
};
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error("Balance Result error:", error);
|
|
140
|
+
ctx.set.status = 200;
|
|
141
|
+
return {
|
|
142
|
+
ResultCode: 1,
|
|
143
|
+
ResultDesc: "Processing failed"
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
balanceTimeout: async (ctx) => {
|
|
148
|
+
try {
|
|
149
|
+
const body = ctx.body;
|
|
150
|
+
console.log("Balance Timeout:", body);
|
|
151
|
+
ctx.set.status = 200;
|
|
152
|
+
return {
|
|
153
|
+
ResultCode: 0,
|
|
154
|
+
ResultDesc: "Timeout received"
|
|
155
|
+
};
|
|
156
|
+
} catch (error) {
|
|
157
|
+
console.error("Balance Timeout error:", error);
|
|
158
|
+
ctx.set.status = 200;
|
|
159
|
+
return {
|
|
160
|
+
ResultCode: 1,
|
|
161
|
+
ResultDesc: "Processing failed"
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
reversalResult: async (ctx) => {
|
|
166
|
+
try {
|
|
167
|
+
const body = ctx.body;
|
|
168
|
+
const parsed = client.getCallbackHandler().parseReversalCallback(body);
|
|
169
|
+
console.log("Reversal Result:", parsed);
|
|
170
|
+
ctx.set.status = 200;
|
|
171
|
+
return {
|
|
172
|
+
ResultCode: 0,
|
|
173
|
+
ResultDesc: "Accepted"
|
|
174
|
+
};
|
|
175
|
+
} catch (error) {
|
|
176
|
+
console.error("Reversal Result error:", error);
|
|
177
|
+
ctx.set.status = 200;
|
|
178
|
+
return {
|
|
179
|
+
ResultCode: 1,
|
|
180
|
+
ResultDesc: "Processing failed"
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
reversalTimeout: async (ctx) => {
|
|
185
|
+
try {
|
|
186
|
+
const body = ctx.body;
|
|
187
|
+
console.log("Reversal Timeout:", body);
|
|
188
|
+
ctx.set.status = 200;
|
|
189
|
+
return {
|
|
190
|
+
ResultCode: 0,
|
|
191
|
+
ResultDesc: "Timeout received"
|
|
192
|
+
};
|
|
193
|
+
} catch (error) {
|
|
194
|
+
console.error("Reversal Timeout error:", error);
|
|
195
|
+
ctx.set.status = 200;
|
|
196
|
+
return {
|
|
197
|
+
ResultCode: 1,
|
|
198
|
+
ResultDesc: "Processing failed"
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
statusResult: async (ctx) => {
|
|
203
|
+
try {
|
|
204
|
+
const body = ctx.body;
|
|
205
|
+
const parsed = client.getCallbackHandler().parseTransactionStatusCallback(body);
|
|
206
|
+
console.log("Status Result:", parsed);
|
|
207
|
+
ctx.set.status = 200;
|
|
208
|
+
return {
|
|
209
|
+
ResultCode: 0,
|
|
210
|
+
ResultDesc: "Accepted"
|
|
211
|
+
};
|
|
212
|
+
} catch (error) {
|
|
213
|
+
console.error("Status Result error:", error);
|
|
214
|
+
ctx.set.status = 200;
|
|
215
|
+
return {
|
|
216
|
+
ResultCode: 1,
|
|
217
|
+
ResultDesc: "Processing failed"
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
statusTimeout: async (ctx) => {
|
|
222
|
+
try {
|
|
223
|
+
const body = ctx.body;
|
|
224
|
+
console.log("Status Timeout:", body);
|
|
225
|
+
ctx.set.status = 200;
|
|
226
|
+
return {
|
|
227
|
+
ResultCode: 0,
|
|
228
|
+
ResultDesc: "Timeout received"
|
|
229
|
+
};
|
|
230
|
+
} catch (error) {
|
|
231
|
+
console.error("Status Timeout error:", error);
|
|
232
|
+
ctx.set.status = 200;
|
|
233
|
+
return {
|
|
234
|
+
ResultCode: 1,
|
|
235
|
+
ResultDesc: "Processing failed"
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
stkPush: async (ctx) => {
|
|
240
|
+
try {
|
|
241
|
+
const {
|
|
242
|
+
amount,
|
|
243
|
+
phoneNumber,
|
|
244
|
+
accountReference,
|
|
245
|
+
transactionDesc,
|
|
246
|
+
callbackUrl
|
|
247
|
+
} = ctx.body;
|
|
248
|
+
if (!amount || !phoneNumber) {
|
|
249
|
+
ctx.set.status = 400;
|
|
250
|
+
return { error: "Amount and phone number are required" };
|
|
251
|
+
}
|
|
252
|
+
const response = await client.stkPush({
|
|
253
|
+
amount: Number(amount),
|
|
254
|
+
phoneNumber: String(phoneNumber),
|
|
255
|
+
accountReference: accountReference || "Payment",
|
|
256
|
+
transactionDesc: transactionDesc || "Payment",
|
|
257
|
+
callbackUrl
|
|
258
|
+
});
|
|
259
|
+
return response;
|
|
260
|
+
} catch (error) {
|
|
261
|
+
console.error("STK Push error:", error);
|
|
262
|
+
ctx.set.status = 500;
|
|
263
|
+
return { error: error.message || "Request failed" };
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
stkQuery: async (ctx) => {
|
|
267
|
+
try {
|
|
268
|
+
const { CheckoutRequestID } = ctx.body;
|
|
269
|
+
if (!CheckoutRequestID) {
|
|
270
|
+
ctx.set.status = 400;
|
|
271
|
+
return { error: "CheckoutRequestID is required" };
|
|
272
|
+
}
|
|
273
|
+
const response = await client.stkQuery({ CheckoutRequestID });
|
|
274
|
+
return response;
|
|
275
|
+
} catch (error) {
|
|
276
|
+
console.error("STK Query error:", error);
|
|
277
|
+
ctx.set.status = 500;
|
|
278
|
+
return { error: error.message || "Request failed" };
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
b2c: async (ctx) => {
|
|
282
|
+
try {
|
|
283
|
+
const {
|
|
284
|
+
amount,
|
|
285
|
+
phoneNumber,
|
|
286
|
+
commandID,
|
|
287
|
+
remarks,
|
|
288
|
+
occasion,
|
|
289
|
+
resultUrl,
|
|
290
|
+
timeoutUrl
|
|
291
|
+
} = ctx.body;
|
|
292
|
+
if (!amount || !phoneNumber || !commandID) {
|
|
293
|
+
ctx.set.status = 400;
|
|
294
|
+
return {
|
|
295
|
+
error: "Amount, phone number, and command ID are required"
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
const response = await client.b2c({
|
|
299
|
+
amount: Number(amount),
|
|
300
|
+
phoneNumber: String(phoneNumber),
|
|
301
|
+
commandID,
|
|
302
|
+
remarks: remarks || "Payment",
|
|
303
|
+
occasion,
|
|
304
|
+
resultUrl,
|
|
305
|
+
timeoutUrl
|
|
306
|
+
});
|
|
307
|
+
return response;
|
|
308
|
+
} catch (error) {
|
|
309
|
+
console.error("B2C error:", error);
|
|
310
|
+
ctx.set.status = 500;
|
|
311
|
+
return { error: error.message || "Request failed" };
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
b2b: async (ctx) => {
|
|
315
|
+
try {
|
|
316
|
+
const {
|
|
317
|
+
amount,
|
|
318
|
+
partyB,
|
|
319
|
+
commandID,
|
|
320
|
+
senderIdentifierType,
|
|
321
|
+
receiverIdentifierType,
|
|
322
|
+
accountReference,
|
|
323
|
+
remarks,
|
|
324
|
+
resultUrl,
|
|
325
|
+
timeoutUrl
|
|
326
|
+
} = ctx.body;
|
|
327
|
+
console.log("B2B Request Parameters:", {
|
|
328
|
+
amount,
|
|
329
|
+
partyB,
|
|
330
|
+
commandID,
|
|
331
|
+
senderIdentifierType,
|
|
332
|
+
receiverIdentifierType,
|
|
333
|
+
accountReference,
|
|
334
|
+
remarks
|
|
335
|
+
});
|
|
336
|
+
if (!amount || !partyB || !commandID || !accountReference) {
|
|
337
|
+
ctx.set.status = 400;
|
|
338
|
+
return {
|
|
339
|
+
error: "Amount, partyB, commandID, and account reference are required"
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
const response = await client.b2b({
|
|
343
|
+
amount: Number(amount),
|
|
344
|
+
partyB: String(partyB),
|
|
345
|
+
commandID,
|
|
346
|
+
senderIdentifierType,
|
|
347
|
+
receiverIdentifierType,
|
|
348
|
+
accountReference: String(accountReference),
|
|
349
|
+
remarks: remarks || "Payment",
|
|
350
|
+
resultUrl,
|
|
351
|
+
timeoutUrl
|
|
352
|
+
});
|
|
353
|
+
console.log("B2B Response:", response);
|
|
354
|
+
return response;
|
|
355
|
+
} catch (error) {
|
|
356
|
+
console.error("B2B error:", error);
|
|
357
|
+
ctx.set.status = 500;
|
|
358
|
+
return { error: error.message || "Request failed" };
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
balance: async (ctx) => {
|
|
362
|
+
try {
|
|
363
|
+
const response = await client.accountBalance(
|
|
364
|
+
ctx.body
|
|
365
|
+
);
|
|
366
|
+
return response;
|
|
367
|
+
} catch (error) {
|
|
368
|
+
console.error("Balance error:", error);
|
|
369
|
+
ctx.set.status = 500;
|
|
370
|
+
return { error: error.message || "Request failed" };
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
transactionStatus: async (ctx) => {
|
|
374
|
+
try {
|
|
375
|
+
const { transactionID } = ctx.body;
|
|
376
|
+
if (!transactionID) {
|
|
377
|
+
ctx.set.status = 400;
|
|
378
|
+
return { error: "Transaction ID is required" };
|
|
379
|
+
}
|
|
380
|
+
const response = await client.transactionStatus(ctx.body);
|
|
381
|
+
return response;
|
|
382
|
+
} catch (error) {
|
|
383
|
+
console.error("Transaction Status error:", error);
|
|
384
|
+
ctx.set.status = 500;
|
|
385
|
+
return { error: error.message || "Request failed" };
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
reversal: async (ctx) => {
|
|
389
|
+
try {
|
|
390
|
+
const { transactionID, amount } = ctx.body;
|
|
391
|
+
if (!transactionID || !amount) {
|
|
392
|
+
ctx.set.status = 400;
|
|
393
|
+
return { error: "Transaction ID and amount are required" };
|
|
394
|
+
}
|
|
395
|
+
const response = await client.reversal(ctx.body);
|
|
396
|
+
return response;
|
|
397
|
+
} catch (error) {
|
|
398
|
+
console.error("Reversal error:", error);
|
|
399
|
+
ctx.set.status = 500;
|
|
400
|
+
return { error: error.message || "Request failed" };
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
registerC2B: async (ctx) => {
|
|
404
|
+
try {
|
|
405
|
+
const { shortCode, responseType, confirmationURL, validationURL } = ctx.body;
|
|
406
|
+
if (!confirmationURL || !validationURL) {
|
|
407
|
+
ctx.set.status = 400;
|
|
408
|
+
return {
|
|
409
|
+
error: "Confirmation URL and validation URL are required"
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
const response = await client.registerC2BUrl({
|
|
413
|
+
shortCode,
|
|
414
|
+
responseType,
|
|
415
|
+
confirmationURL,
|
|
416
|
+
validationURL
|
|
417
|
+
});
|
|
418
|
+
return response;
|
|
419
|
+
} catch (error) {
|
|
420
|
+
console.error("Register C2B error:", error);
|
|
421
|
+
ctx.set.status = 500;
|
|
422
|
+
return { error: error.message || "Request failed" };
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
generateQR: async (ctx) => {
|
|
426
|
+
try {
|
|
427
|
+
const {
|
|
428
|
+
merchantName,
|
|
429
|
+
refNo,
|
|
430
|
+
amount,
|
|
431
|
+
transactionType,
|
|
432
|
+
creditPartyIdentifier,
|
|
433
|
+
size
|
|
434
|
+
} = ctx.body;
|
|
435
|
+
if (!merchantName || !refNo || !amount || !transactionType || !creditPartyIdentifier) {
|
|
436
|
+
ctx.set.status = 400;
|
|
437
|
+
return {
|
|
438
|
+
error: "Merchant name, reference number, amount, transaction type, and credit party identifier are required",
|
|
439
|
+
received: ctx.body
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
let qrSize = void 0;
|
|
443
|
+
if (size) {
|
|
444
|
+
if (size !== "500" && size !== "300") {
|
|
445
|
+
ctx.set.status = 400;
|
|
446
|
+
return {
|
|
447
|
+
error: "Size must be either '300' or '500'"
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
qrSize = size;
|
|
451
|
+
}
|
|
452
|
+
const response = await client.generateDynamicQR({
|
|
453
|
+
merchantName,
|
|
454
|
+
refNo,
|
|
455
|
+
amount: Number(amount),
|
|
456
|
+
transactionType,
|
|
457
|
+
creditPartyIdentifier,
|
|
458
|
+
size: qrSize
|
|
459
|
+
});
|
|
460
|
+
return response;
|
|
461
|
+
} catch (error) {
|
|
462
|
+
console.error("Generate QR error:", error);
|
|
463
|
+
ctx.set.status = 500;
|
|
464
|
+
return { error: error.message || "Request failed" };
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
return handlers;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// src/index.ts
|
|
472
|
+
import {
|
|
473
|
+
MpesaClient as MpesaClient2
|
|
474
|
+
} from "@singularity-payments/core";
|
|
475
|
+
function createMpesa(config, options) {
|
|
476
|
+
const client = new MpesaClient(config, options);
|
|
477
|
+
const handlers = createMpesaHandlers(client);
|
|
478
|
+
const app = new Elysia({ prefix: "/mpesa" }).post("/stk-push", handlers.stkPush).post("/stk-query", handlers.stkQuery).post("/callback", handlers.stkCallback).post("/b2c", handlers.b2c).post("/b2b", handlers.b2b).post("/balance", handlers.balance).post("/transaction-status", handlers.transactionStatus).post("/reversal", handlers.reversal).post("/register-c2b", handlers.registerC2B).post("/generate-qr", handlers.generateQR).post("/c2b-validation", handlers.c2bValidation).post("/c2b-confirmation", handlers.c2bConfirmation).post("/b2c-result", handlers.b2cResult).post("/b2c-timeout", handlers.b2cTimeout).post("/b2b-result", handlers.b2bResult).post("/b2b-timeout", handlers.b2bTimeout).post("/balance-result", handlers.balanceResult).post("/balance-timeout", handlers.balanceTimeout).post("/reversal-result", handlers.reversalResult).post("/reversal-timeout", handlers.reversalTimeout).post("/status-result", handlers.statusResult).post("/status-timeout", handlers.statusTimeout);
|
|
479
|
+
return {
|
|
480
|
+
client,
|
|
481
|
+
handlers,
|
|
482
|
+
app
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
export {
|
|
486
|
+
MpesaClient2 as MpesaClient,
|
|
487
|
+
createMpesa,
|
|
488
|
+
createMpesaHandlers
|
|
489
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@singularity-payments/elysia",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Elysia integration for M-Pesa payments",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"require": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"mpesa",
|
|
24
|
+
"elysia",
|
|
25
|
+
"bun",
|
|
26
|
+
"payments",
|
|
27
|
+
"kenya"
|
|
28
|
+
],
|
|
29
|
+
"author": "",
|
|
30
|
+
"license": "Apache-2.0",
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"elysia": ">=1.0.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@singularity-payments/core": "0.1.0-alpha.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^25.0.3",
|
|
39
|
+
"elysia": "^1.1.29",
|
|
40
|
+
"tsup": "^8.5.1",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
45
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --external elysia",
|
|
46
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --external elysia --watch"
|
|
47
|
+
}
|
|
48
|
+
}
|