@tomaspavlin/rohlik-mcp 3.2.0 → 3.3.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-detail.d.ts","sourceRoot":"","sources":["../../src/tools/order-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;oBAU5C;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"order-detail.d.ts","sourceRoot":"","sources":["../../src/tools/order-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,MAAM,SAAS;;;;;;;;;oBAU5C;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;EA8E5C"}
|
|
@@ -26,30 +26,37 @@ export function createOrderDetailTool(createRohlikAPI) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
const formatProduct = (product, index) => {
|
|
29
|
-
const name = product.
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const name = product.name || 'Unknown product';
|
|
30
|
+
const amount = product.amount || 1;
|
|
31
|
+
const textualAmount = product.textualAmount || '';
|
|
32
|
+
const totalPrice = product.priceComposition?.total?.amount ?? 0;
|
|
33
|
+
const unitPrice = product.priceComposition?.unit?.amount ?? 0;
|
|
34
|
+
const productId = product.id || 'N/A';
|
|
35
|
+
return ` ${index + 1}. [${productId}] ${name}
|
|
36
|
+
Amount: ${amount}x (${textualAmount})
|
|
37
|
+
Price: ${totalPrice} ${getCurrency()} (unit: ${unitPrice} ${getCurrency()})`;
|
|
36
38
|
};
|
|
37
39
|
const order = orderDetail;
|
|
38
|
-
const orderNumber = order.
|
|
39
|
-
const orderDate = order.
|
|
40
|
-
const totalPrice = order.
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
40
|
+
const orderNumber = order.id || orderId;
|
|
41
|
+
const orderDate = order.orderTime || 'Unknown date';
|
|
42
|
+
const totalPrice = order.priceComposition?.total?.amount ?? 'Unknown';
|
|
43
|
+
const deliveryPrice = order.priceComposition?.delivery?.amount ?? 0;
|
|
44
|
+
const status = order.state || 'Unknown status';
|
|
45
|
+
const deliverySlot = order.deliverySlot;
|
|
46
|
+
const deliveryInfo = deliverySlot
|
|
47
|
+
? `${deliverySlot.since} - ${deliverySlot.till}`
|
|
48
|
+
: 'N/A';
|
|
49
|
+
const items = order.items || [];
|
|
50
|
+
const output = `ORDER DETAILS - ${orderNumber}
|
|
45
51
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
46
52
|
Order Date: ${orderDate}
|
|
47
|
-
Delivery
|
|
53
|
+
Delivery Slot: ${deliveryInfo}
|
|
54
|
+
Delivery Type: ${order.deliveryType || 'N/A'}
|
|
48
55
|
Status: ${status}
|
|
49
|
-
Total
|
|
56
|
+
Total: ${totalPrice} ${getCurrency()} (delivery: ${deliveryPrice} ${getCurrency()})
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
${
|
|
58
|
+
PRODUCTS (${items.length} items):
|
|
59
|
+
${items.map(formatProduct).join('\n\n')}
|
|
53
60
|
|
|
54
61
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
55
62
|
Total: ${totalPrice} ${getCurrency()}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-detail.js","sourceRoot":"","sources":["../../src/tools/order-detail.ts"],"names":[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