fix(build): add pg and @types/pg dependencies, add master courier fallbacks and compile live tracking (v2.4.1)

This commit is contained in:
root
2026-10-04 09:04:31 +00:00
parent be3eb4fcd9
commit caa1a0c81e
19 changed files with 1261 additions and 186 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;
}
}