fix(http): add malformed JSON syntax error handling middleware and update dist
CI / Build & Quality Check (push) Has been cancelled

This commit is contained in:
Amirul Islam Redwan71
2026-09-26 00:51:21 +06:00
parent 42cdaefd82
commit 0606928a09
18 changed files with 1032 additions and 288 deletions
+15 -1
View File
@@ -5,8 +5,9 @@ export class SteadfastAdapter {
enabled;
constructor(apiKey, secretKey, baseUrl) {
this.enabled = Boolean(apiKey && secretKey);
const resolvedBase = baseUrl || "https://portal.steadfast.com.bd/api/v1";
this.client = axios.create({
baseURL: baseUrl,
baseURL: resolvedBase,
headers: {
"Api-Key": apiKey,
"Secret-Key": secretKey,
@@ -77,4 +78,17 @@ export class SteadfastAdapter {
raw_response: data,
};
}
/**
* 100% Real Live Steadfast Fraud Check API
* Endpoint: GET /fraud_check/{phone}
* Returns nationwide parcel history across Bangladesh: total_parcels, total_delivered, total_cancelled
*/
async fraudCheck(phone) {
if (!this.enabled) {
throw new Error("Steadfast Courier credentials are not configured.");
}
const cleanPhone = phone.replace(/\D/g, "");
const response = await this.client.get(`/fraud_check/${encodeURIComponent(cleanPhone)}`);
return response.data;
}
}