@agenzo/merchant-cli 0.5.1 → 0.6.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.
- package/README.md +10 -12
- package/dist/index.js +312 -121
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
- **`services`** (capability discovery): list what's currently available and how to call it — run this first to learn the current capability set.
|
|
17
17
|
- **`ride-elife`** (ride-hailing): the full loop of quote → book → query/poll → cancel → list-orders.
|
|
18
|
-
- **`hotel-redaug`** (hotel booking): search, find-destination, hotel-filters, list-cities, hotel-detail, quote, create-order
|
|
18
|
+
- **`hotel-redaug`** (hotel booking): search, find-destination, hotel-filters, list-cities, hotel-detail, quote, create-order, pay-order, get (status/poll), cancel, checkout, get-checkout, list-orders. Supports both **monthly_settlement** (on-account deduction) and **pay_per_call** (user pays via EVO using the order_id as the merchantTransID).
|
|
19
19
|
|
|
20
20
|
More fulfillment capabilities are added as new nouns over time; `services list` always reflects the current set.
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@ More fulfillment capabilities are added as new nouns over time; `services list`
|
|
|
24
24
|
| Noun | Verb | Type | HTTP | Description |
|
|
25
25
|
|---|---|---|---|---|
|
|
26
26
|
| `services` | `list` | Read | — (local) | List available merchant-fulfillment capabilities |
|
|
27
|
-
| `services` | `get <service-id>` | Read | — (local) |
|
|
27
|
+
| `services` | `get <service-id>` | Read | — (local) | View the full metadata of a single capability (miss → `SERVICE_NOT_FOUND`) |
|
|
28
28
|
| `ride-elife` | `quote` | Read | `POST /ride/quote` | Point-to-point quote (`vehicle_classes[]` + meet-and-greet) |
|
|
29
29
|
| `ride-elife` | `book` | Write/Y | `POST /ride/book` | Book against a quote (monthly_settlement-aware, see below) |
|
|
30
30
|
| `ride-elife` | `get` | Read | `GET /ride/<id>/status` | Query order status; `--watch` emits an NDJSON polling stream |
|
|
@@ -36,8 +36,8 @@ More fulfillment capabilities are added as new nouns over time; `services list`
|
|
|
36
36
|
| `hotel-redaug` | `list-cities` | Read | `POST /hotel/cities` | List cities for a country (destination_id + coordinates) |
|
|
37
37
|
| `hotel-redaug` | `hotel-detail` | Read | `POST /hotel/detail` | Hotel detail with facilities/images AND `rooms[]` (area/floor/beds/photos) — call before quote |
|
|
38
38
|
| `hotel-redaug` | `quote` | Read | `POST /hotel/quote` | Real-time rooms/rates for one hotel (`product_token` + `price_items`) |
|
|
39
|
-
| `hotel-redaug` | `create-order` | Write/Y | `POST /hotel/create-order` | Create
|
|
40
|
-
| `hotel-redaug` | `pay-order` | Write/Y | `POST /hotel/{order_id}/pay` |
|
|
39
|
+
| `hotel-redaug` | `create-order` | Write/Y | `POST /hotel/create-order` | Create a hotel order without charging (locks rate + returns `order_id` + payable amount) |
|
|
40
|
+
| `hotel-redaug` | `pay-order` | Write/Y | `POST /hotel/{order_id}/pay` | Pay for a created order (takes only `--order-id`); billing path (`monthly_settlement` or `pay_per_call`) is chosen server-side |
|
|
41
41
|
| `hotel-redaug` | `get` | Read | `GET /hotel/<id>/status` | Query order status; `--watch` emits an NDJSON polling stream |
|
|
42
42
|
| `hotel-redaug` | `cancel` | Write/Y | `POST /hotel/<id>/cancel` | Cancel a whole order (acceptance ≠ proof; poll `get`) |
|
|
43
43
|
| `hotel-redaug` | `checkout` | Write/Y | `POST /hotel/<id>/checkout` | Partial check-out / out-of-policy cancellation (async) |
|
|
@@ -76,8 +76,7 @@ A runtime-plane CLI that uses an **API Key** (`--api-key`, carried per command a
|
|
|
76
76
|
```bash
|
|
77
77
|
# 1. Discover capabilities
|
|
78
78
|
agenzo-merchant-cli services list
|
|
79
|
-
agenzo-merchant-cli services get ride-elife
|
|
80
|
-
agenzo-merchant-cli ride-elife book --help --format json # capability layer: this verb's full flags/response schema
|
|
79
|
+
agenzo-merchant-cli services get ride-elife
|
|
81
80
|
|
|
82
81
|
# 2. Quote (produces quote_id)
|
|
83
82
|
agenzo-merchant-cli ride-elife quote --api-key "$API_KEY" \
|
|
@@ -104,12 +103,11 @@ agenzo-merchant-cli ride-elife cancel --api-key "$API_KEY" --yes \
|
|
|
104
103
|
|
|
105
104
|
### Hotel booking end-to-end example
|
|
106
105
|
|
|
107
|
-
The core Agent loop is `search → quote → create-order →
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- **
|
|
112
|
-
- **pay_per_call**: `total_amount` is authorized + captured on the developer's bound card via the platform's own server-side EVO integration — no EVO parameters are ever passed through this CLI. Optionally pass `--payment-method-id` to charge a specific bound card instead of the auto-selected one.
|
|
106
|
+
The core Agent loop is `search → quote → create-order → pay-order → get`. Amounts are decimal currency
|
|
107
|
+
units (e.g. `320.00` = 320.00 yuan). `pay-order` takes only `--order-id`; the billing path is chosen
|
|
108
|
+
server-side by the developer's `billing_mode`:
|
|
109
|
+
- **monthly_settlement**: deducted from the monthly-settlement account.
|
|
110
|
+
- **pay_per_call**: the user pays via shared EVO parameters using the `order_id` as the EVO merchantTransID; the platform verifies that payment for the same `order_id` before confirming.
|
|
113
111
|
|
|
114
112
|
```bash
|
|
115
113
|
# 1. Search hotels by coordinates + stay dates (or use --destination-id from find-destination).
|