@a2hmarket/a2hmarket 0.5.2 → 0.5.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2hmarket/a2hmarket",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "index.ts",
@@ -144,10 +144,11 @@ export function buildA2HNotifyCard(params: {
144
144
  );
145
145
  }
146
146
 
147
+ const peerLabel = params.type === "reply" ? "回复给" : "来自";
147
148
  const elements: FeishuCardElement[] = [
148
149
  {
149
150
  tag: "markdown",
150
- content: `**来自**: \`${params.peerId}\``,
151
+ content: `**${peerLabel}**: \`${params.peerId}\``,
151
152
  },
152
153
  {
153
154
  tag: "markdown",
@@ -71,7 +71,9 @@ export function registerOrderTools(api: OpenClawPluginApi, client: A2HApiClient)
71
71
  required: ["order_id"],
72
72
  },
73
73
  execute: async (params: Record<string, unknown>) => {
74
- const apiPath = `/findu-trade/api/v1/orders/${params.order_id}/detail`;
74
+ const orderId = (params.order_id ?? params.orderId) as string;
75
+ if (!orderId) throw new Error("order_id is required");
76
+ const apiPath = `/findu-trade/api/v1/orders/${orderId}/detail`;
75
77
  const data = await client.getJSON<Record<string, unknown>>(apiPath);
76
78
  return { result: JSON.stringify(data, null, 2) };
77
79
  },
@@ -67,8 +67,10 @@ export function registerPaymentTools(api: OpenClawPluginApi, client: A2HApiClien
67
67
  required: ["order_id"],
68
68
  },
69
69
  execute: async (params: Record<string, unknown>) => {
70
+ const orderId = (params.order_id ?? params.orderId) as string;
71
+ if (!orderId) throw new Error("order_id is required");
70
72
  const body: Record<string, unknown> = {
71
- orderId: params.order_id,
73
+ orderId,
72
74
  };
73
75
  if (params.currency) body.currency = params.currency;
74
76
 
@@ -90,7 +92,9 @@ export function registerPaymentTools(api: OpenClawPluginApi, client: A2HApiClien
90
92
  required: ["order_id"],
91
93
  },
92
94
  execute: async (params: Record<string, unknown>) => {
93
- const apiPath = `${PAYMENT_STATUS_API}/${params.order_id}`;
95
+ const orderId = (params.order_id ?? params.orderId) as string;
96
+ if (!orderId) throw new Error("order_id is required");
97
+ const apiPath = `${PAYMENT_STATUS_API}/${orderId}`;
94
98
  const data = await client.getJSON(apiPath, PAYMENT_STATUS_API);
95
99
  return { result: JSON.stringify(data, null, 2) };
96
100
  },