@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;;;;;;;;;;;;;EAuE5C"}
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.productName || product.name || 'Unknown product';
30
- const quantity = product.quantity || 1;
31
- const price = product.price || product.totalPrice || 0;
32
- const brand = product.brand || '';
33
- return ` ${index + 1}. ${name}${brand ? ` (${brand})` : ''}
34
- Quantity: ${quantity}
35
- Price: ${price} ${getCurrency()}`;
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.orderNumber || order.id || orderId;
39
- const orderDate = order.deliveredAt || order.createdAt || 'Unknown date';
40
- const totalPrice = order.totalPrice || order.price || 'Unknown price';
41
- const status = order.status || 'Unknown status';
42
- const deliveryDate = order.deliveryDate || order.deliveredAt || 'Unknown delivery date';
43
- const products = order.products || order.items || [];
44
- const output = `📦 ORDER DETAILS - ${orderNumber}
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 Date: ${deliveryDate}
53
+ Delivery Slot: ${deliveryInfo}
54
+ Delivery Type: ${order.deliveryType || 'N/A'}
48
55
  Status: ${status}
49
- Total Price: ${totalPrice} ${getCurrency()}
56
+ Total: ${totalPrice} ${getCurrency()} (delivery: ${deliveryPrice} ${getCurrency()})
50
57
 
51
- 📋 PRODUCTS (${products.length} items):
52
- ${products.map(formatProduct).join('\n\n')}
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":[],"mappings":"AAAA,OAAO,EAAE,CAAC,E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AM,CAAC;;;SAG9B,UAAU,IAAI,WAAW,EAAE,EAAE,CAAC;gBAE/B,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,MAAM;yBACb;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomaspavlin/rohlik-mcp",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "type": "module",
5
5
  "description": "MCP server for controlling Rohlik.cz grocery shopping website",
6
6
  "keywords": [