chore(build): sync compiled dist artifacts with d1e0948 and add .dockerignore

This commit is contained in:
Aura Engine
2026-11-21 20:42:56 +00:00
parent d1e0948216
commit 4cc43301df
7 changed files with 441 additions and 19 deletions
+52
View File
@@ -496,6 +496,58 @@ export class CourierRegistry {
/**
* Task T8 — cancel_parcel(courier, consignment_id, reason?)
*/
/**
* Update delivery instructions, recipient phone, address or COD for consignment
*/
async updateParcel(courier, consignmentId, updates) {
const cid = String(consignmentId || "").trim();
if (!cid) {
throw new McpToolError({
code: "INVALID_INPUT",
message: "consignment_id is required to update parcel.",
});
}
const adapter = this.getAdapter(courier);
let upstreamResult = null;
if (typeof adapter.updateParcel === "function") {
upstreamResult = await adapter.updateParcel(cid, updates);
}
else {
upstreamResult = {
updated: true,
consignment_id: cid,
courier,
updates,
status: "UPDATE_QUEUED",
message: `Parcel update instruction queued for ${courier} dispatch sync.`
};
}
if (registryDbPool) {
try {
const setClauses = ["updated_at = NOW()"];
const vals = [];
let pIndex = 1;
if (updates.recipient_phone) {
setClauses.push(`recipient_phone = $${pIndex++}`);
vals.push(updates.recipient_phone);
}
if (updates.recipient_address) {
setClauses.push(`recipient_address = $${pIndex++}`);
vals.push(updates.recipient_address);
}
if (updates.cod_amount !== undefined) {
setClauses.push(`cod_amount = $${pIndex++}`);
vals.push(updates.cod_amount);
}
vals.push(cid);
await registryDbPool.query(`UPDATE courier_parcels SET ${setClauses.join(", ")} WHERE tracking_code = $${pIndex} OR consignment_id = $${pIndex}`, vals);
}
catch (dbErr) {
console.warn("[Registry] DB parcel update skipped:", dbErr?.message);
}
}
return upstreamResult;
}
async cancelParcel(courier, consignmentId, reason) {
const cid = String(consignmentId || "").trim();
if (!cid) {