aura-courier-mcp 2.3.0 → 2.3.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.
@@ -12,7 +12,7 @@ export class PaperflyAdapter {
12
12
  this.username = username;
13
13
  this.password = password;
14
14
  this.storeName = storeName;
15
- this.enabled = Boolean(apiKey && storeName);
15
+ this.enabled = Boolean(apiKey && username && password);
16
16
  this.client = axios.create({
17
17
  baseURL: baseUrl,
18
18
  timeout: 15000,
@@ -24,7 +24,10 @@ export class PaperflyAdapter {
24
24
  }
25
25
  async createParcel(req) {
26
26
  if (!this.enabled) {
27
- throw new Error("Paperfly credentials (paperflykey + store name) are not configured.");
27
+ throw new Error("Paperfly credentials (paperflykey + merchant username & password) are not configured.");
28
+ }
29
+ if (!this.storeName) {
30
+ throw new Error("Paperfly store name is required to create a parcel.");
28
31
  }
29
32
  const payload = {
30
33
  merchantOrderReference: req.invoice,
@@ -38,6 +41,7 @@ export class PaperflyAdapter {
38
41
  };
39
42
  const response = await this.client.post("/merchant/api/service/new_order_v2.php", payload, {
40
43
  headers: { paperflykey: this.apiKey },
44
+ auth: { username: this.username, password: this.password },
41
45
  });
42
46
  const data = response.data;
43
47
  const ok = data?.success;
@@ -64,7 +68,7 @@ export class PaperflyAdapter {
64
68
  throw new Error("Paperfly tracking needs your merchant-panel username & password (Basic Auth). Add them to use track_parcel.");
65
69
  }
66
70
  // Paperfly tracks by your merchant order reference (merchantOrderReference), not its tracking number.
67
- const response = await this.client.post("/API-Order-Tracking", { ReferenceNumber: trackingCode }, { auth: { username: this.username, password: this.password } });
71
+ const response = await this.client.post("/API-Order-Tracking", { ReferenceNumber: trackingCode }, { headers: { paperflykey: this.apiKey }, auth: { username: this.username, password: this.password } });
68
72
  const data = response.data;
69
73
  const st = data?.success?.trackingStatus?.[0] || {};
70
74
  const stages = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aura-courier-mcp",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Universal Bangladesh courier MCP server — Steadfast, Pathao, RedX & Paperfly with a built-in fraud-risk engine — for Claude, Antigravity, Cursor & n8n AI agents. Runs as a local npx (STDIO) server or a remote HTTP endpoint.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",