@agenzo/merchant-cli 0.6.0 → 0.7.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/dist/index.js CHANGED
@@ -1280,6 +1280,11 @@ var hotelCreateOrderSchema = {
1280
1280
  "contact-email": { type: "string", required: false, description: "Booking contact email" },
1281
1281
  "arrive-time": { type: "string", required: false, description: "Expected arrival time", constraints: "HH:mm, hotel local time" },
1282
1282
  "special-requests": { type: "string", required: false, description: "Free-text special requests (non-binding)" },
1283
+ "payment-token-id": {
1284
+ type: "string",
1285
+ required: false,
1286
+ description: "UPI Agent Pay only: payment token id from an already-completed UnionPay network-token capture (funds already charged). When set, the platform skips EVO preauth/capture and only locks the order."
1287
+ },
1283
1288
  "idempotency-key": {
1284
1289
  type: "string",
1285
1290
  required: true,
@@ -2353,10 +2358,10 @@ function registerListOrdersCommand(parent, deps) {
2353
2358
  // src/services/registry.ts
2354
2359
  var SERVICE_REGISTRY = [
2355
2360
  {
2356
- // service_id 是平台级不透明内部引用(svc_ 前缀 + ULID),不进 Agent 日常拼的命令
2357
- // ——Agent 拼命令用的是 cli_noun="ride-elife"。与后端
2358
- // services/merchant_service/discovery/catalog.py 的 RIDE_ELIFE_SERVICE_ID 保持一致。
2359
- service_id: "svc_01KWTPBWDH5YZ52H717BFVWZA8",
2361
+ // Agent-facing service_id = cli_noun(Agent 拼命令用这个标识)。
2362
+ // 平台级不透明内部 ULID: svc_01KWTPBWDH5YZ52H717BFVWZA8(与后端
2363
+ // services/merchant_service/discovery/catalog.py 的 RIDE_ELIFE_SERVICE_ID 对应)。
2364
+ service_id: "ride-elife",
2360
2365
  name: "Ride hailing (eLife)",
2361
2366
  description: "On-demand ride ordering: quote a fare, book it, poll status, and cancel.",
2362
2367
  category: "ride",
@@ -2378,7 +2383,7 @@ var SERVICE_REGISTRY = [
2378
2383
  }
2379
2384
  },
2380
2385
  {
2381
- service_id: "svc_01J0HT5REDAUG0001",
2386
+ service_id: "hotel-redaug",
2382
2387
  name: "Hotel booking (Redaug)",
2383
2388
  description: "International hotel booking via Redaug: search by location, real-time room/rate availability, two-step create-then-pay flow supporting monthly_settlement and pay_per_call (EVO) billing modes, cancel and partial check-out.",
2384
2389
  category: "hotel",
@@ -2433,7 +2438,7 @@ var SERVICE_REGISTRY = [
2433
2438
  }
2434
2439
  ];
2435
2440
  function findService(serviceId) {
2436
- return SERVICE_REGISTRY.find((s) => s.service_id === serviceId);
2441
+ return SERVICE_REGISTRY.find((s) => s.service_id === serviceId || s.cli_noun === serviceId);
2437
2442
  }
2438
2443
 
2439
2444
  // src/services/local-caps.ts
@@ -3015,6 +3020,9 @@ function formatCreateOrder(data) {
3015
3020
  }
3016
3021
  function registerHotelCreateOrderCommand(parent, deps) {
3017
3022
  const cmd = parent.command("create-order").description("Create a hotel order without charging (lock inventory, await payment)").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--product-token <token>", "Chosen rate token from quote (rates[].product_token)").option("--total-amount <amount>", "Total stay price in decimal currency units (not cents)").option("--currency <currency>", "ISO 4217 currency code from the chosen rate").option("--price-items <json>", "Per-night price breakdown JSON array (copied verbatim from quote)").option("--check-in <date>", "Check-in date (YYYY-MM-DD, match quote)").option("--check-out <date>", "Check-out date (YYYY-MM-DD, strictly after check-in)").option("--room-num <n>", "Number of rooms (match quote)", "1").option("--adults <n>", "Adults per room (match quote)", "2").option("--children <n>", "Children per room (match quote)", "0").option("--nationality <code>", "Guest nationality (ISO country code)", "CN").option("--guest-name <name>", "Primary guest name").option("--contact-name <name>", "Booking contact name (may equal guest-name)").option("--contact-phone <phone>", "Booking contact phone number (digits)").option("--contact-country-code <code>", "Phone country calling code without '+'", "86").option("--contact-email <email>", "Booking contact email").option("--arrive-time <time>", "Expected arrival time (HH:mm, hotel local time)").option("--special-requests <text>", "Free-text special requests (non-binding)").option("--hotel-name <name>", "Hotel name (display-only, stored for order summary)").option(
3023
+ "--payment-token-id <id>",
3024
+ "UPI Agent Pay: payment token id from an already-completed UnionPay network-token capture. When set, the platform skips EVO preauth/capture and only locks the order + records this credential (funds already charged)."
3025
+ ).option(
3018
3026
  "--idempotency-key <key>",
3019
3027
  "Idempotency key forwarded verbatim as the Idempotency-Key header"
3020
3028
  );
@@ -3059,9 +3067,11 @@ function registerHotelCreateOrderCommand(parent, deps) {
3059
3067
  if (opts.arriveTime !== void 0) body.arrive_time = opts.arriveTime;
3060
3068
  if (opts.specialRequests !== void 0) body.special_requests = opts.specialRequests;
3061
3069
  if (opts.hotelName !== void 0) body.hotel_name = opts.hotelName;
3070
+ if (opts.paymentTokenId !== void 0) body.payment_token_id = opts.paymentTokenId;
3062
3071
  if (!isYes) {
3072
+ const chargeNote = opts.paymentTokenId !== void 0 ? "Payment has already been captured via UPI Agent Pay; this only locks the room." : "This locks the rate but does NOT charge anything yet.";
3063
3073
  const confirmed = await confirm3({
3064
- message: `Create this hotel order for ${totalAmount} ${currency} (check-in ${checkIn}, check-out ${checkOut})? This locks the rate but does NOT charge anything yet.`,
3074
+ message: `Create this hotel order for ${totalAmount} ${currency} (check-in ${checkIn}, check-out ${checkOut})? ${chargeNote}`,
3065
3075
  default: false
3066
3076
  });
3067
3077
  if (!confirmed) {