feat(v2.6.0): authentic 4-courier cancellation, 3-column docs and AI connector fixes
This commit is contained in:
Vendored
+40
@@ -137,4 +137,44 @@ export class RedxAdapter {
|
||||
hint: "Use RedX merchant portal",
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Authentic Upstream RedX Cancellation
|
||||
* Endpoint: PATCH /parcels
|
||||
*/
|
||||
async cancelParcel(trackingId, reason) {
|
||||
if (!this.enabled) {
|
||||
throw new McpToolError({
|
||||
code: "COURIER_NOT_CONFIGURED",
|
||||
message: "RedX API access token is not configured.",
|
||||
courier: "redx",
|
||||
});
|
||||
}
|
||||
try {
|
||||
const response = await this.client.patch("/parcels", {
|
||||
entity_type: "parcel-tracking-id",
|
||||
entity_id: trackingId,
|
||||
update_details: {
|
||||
property_name: "status",
|
||||
new_value: "cancelled",
|
||||
reason: reason || "Cancelled by merchant via Aura Courier MCP",
|
||||
},
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
courier: "redx",
|
||||
consignment_id: trackingId,
|
||||
message: response.data?.message || "Parcel successfully cancelled in RedX Delivery.",
|
||||
raw_response: response.data,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
const msg = err.response?.data?.message || err.message;
|
||||
throw new McpToolError({
|
||||
code: "COURIER_UPSTREAM_ERROR",
|
||||
message: `RedX cancellation failed: ${msg}`,
|
||||
courier: "redx",
|
||||
retryable: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user