@agenzo/merchant-cli 0.8.8 → 0.8.10
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 +55 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// ../../packages/cli-core/dist/index.js
|
|
7
7
|
import { readFileSync } from "fs";
|
|
8
8
|
import { dirname, join } from "path";
|
|
9
9
|
import { fileURLToPath } from "url";
|
|
@@ -861,6 +861,22 @@ var PromptEngine = class {
|
|
|
861
861
|
}
|
|
862
862
|
};
|
|
863
863
|
|
|
864
|
+
// src/member.ts
|
|
865
|
+
var MEMBER_OPTION_DESCRIPTION = "End-user member id this order is attributed to (optional, max 128 chars). On write it is stored on the order; on list it filters to that member only (orders without a member_id are excluded).";
|
|
866
|
+
var MEMBER_FLAG_SCHEMA = {
|
|
867
|
+
type: "string",
|
|
868
|
+
required: false,
|
|
869
|
+
source: "session",
|
|
870
|
+
description: MEMBER_OPTION_DESCRIPTION,
|
|
871
|
+
constraints: "1-128 characters; any character set. Omit to keep the order unattributed."
|
|
872
|
+
};
|
|
873
|
+
function memberIdOf(opts) {
|
|
874
|
+
const raw = opts.member;
|
|
875
|
+
if (typeof raw !== "string") return void 0;
|
|
876
|
+
const trimmed = raw.trim();
|
|
877
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
878
|
+
}
|
|
879
|
+
|
|
864
880
|
// src/ride-elife/watch.ts
|
|
865
881
|
var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
866
882
|
"At destination",
|
|
@@ -1031,6 +1047,7 @@ var bookSchema = {
|
|
|
1031
1047
|
required: false,
|
|
1032
1048
|
description: "Bound payment method id to charge (pay_per_call only). Opaque id from `token payment-methods list`; ignored for monthly_settlement"
|
|
1033
1049
|
},
|
|
1050
|
+
member: MEMBER_FLAG_SCHEMA,
|
|
1034
1051
|
"passenger-name": { type: "string", required: true, description: "Passenger full name" },
|
|
1035
1052
|
"passenger-phone": { type: "string", required: true, description: "Passenger phone in E.164 format (e.g. +14155551234)" },
|
|
1036
1053
|
"passenger-email": { type: "string", required: true, description: "Passenger email (required by eLife for booking)" },
|
|
@@ -1173,6 +1190,7 @@ var listOrdersSchema = {
|
|
|
1173
1190
|
flags: {
|
|
1174
1191
|
status: { type: "string", required: false, description: "Filter by ride status (case-sensitive server casing)" },
|
|
1175
1192
|
"order-type": { type: "string", required: false, description: "Filter by order type (e.g. realtime / airport)" },
|
|
1193
|
+
member: MEMBER_FLAG_SCHEMA,
|
|
1176
1194
|
page: { type: "int", required: false, default: 1, description: "Page number", constraints: ">= 1" },
|
|
1177
1195
|
"page-size": { type: "int", required: false, default: 20, description: "Items per page", constraints: ">= 1" }
|
|
1178
1196
|
},
|
|
@@ -1182,6 +1200,7 @@ var listOrdersSchema = {
|
|
|
1182
1200
|
description: "List of ride orders (slim list-item shape)",
|
|
1183
1201
|
items: {
|
|
1184
1202
|
order_id: { type: "string", description: "Internal order id" },
|
|
1203
|
+
member_id: { type: "string|null", description: "End-user this order is attributed to; null when unattributed" },
|
|
1185
1204
|
ride_id: { type: "string", description: "Ride id (same as ride_id from book)" },
|
|
1186
1205
|
status: { type: "string", description: "Current ride status" },
|
|
1187
1206
|
vehicle_class: { type: "string", description: "Vehicle class" },
|
|
@@ -1350,6 +1369,7 @@ var hotelCreateOrderSchema = {
|
|
|
1350
1369
|
"contact-phone": { type: "string", required: true, description: "Booking contact phone number", constraints: "Digits; collect country code separately in --contact-country-code" },
|
|
1351
1370
|
"contact-country-code": { type: "string", required: false, default: "86", description: "Phone country calling code without '+'" },
|
|
1352
1371
|
"contact-email": { type: "string", required: false, description: "Booking contact email" },
|
|
1372
|
+
member: MEMBER_FLAG_SCHEMA,
|
|
1353
1373
|
"arrive-time": { type: "string", required: false, description: "Expected arrival time", constraints: "HH:mm, hotel local time" },
|
|
1354
1374
|
"special-requests": { type: "string", required: false, description: "Free-text special requests (non-binding)" },
|
|
1355
1375
|
tips: { type: "string", required: false, description: "FCG \u5BA2\u6237\u81EA\u6D4B\u70B95 \u63D0\u793A\u4FE1\u606F: the chosen quote rate's tips (tips[].tipsDetails[]) as a JSON array [{title,text}], captured at booking. Stored on the order for the order-detail page only; platform-local, not sent upstream", constraints: "JSON array of {title (string, optional), text (string, optional)}; else PARAM_INVALID" },
|
|
@@ -1627,6 +1647,7 @@ var hotelListOrdersSchema = {
|
|
|
1627
1647
|
description: "List the developer's hotel orders with optional status filtering and pagination",
|
|
1628
1648
|
flags: {
|
|
1629
1649
|
status: { type: "string", required: false, description: "Filter by order status (e.g. PROCESSING / CONFIRMED / CANCELLED / COMPLETED). Omitted entirely when absent (all statuses)" },
|
|
1650
|
+
member: MEMBER_FLAG_SCHEMA,
|
|
1630
1651
|
page: { type: "int", required: false, default: 1, description: "Page number", constraints: ">= 1" },
|
|
1631
1652
|
"page-size": { type: "int", required: false, default: 20, description: "Items per page", constraints: ">= 1 (platform caps at 100 server-side)" }
|
|
1632
1653
|
},
|
|
@@ -1636,6 +1657,7 @@ var hotelListOrdersSchema = {
|
|
|
1636
1657
|
description: "List of hotel orders (slim list-item shape).",
|
|
1637
1658
|
items: {
|
|
1638
1659
|
order_id: { type: "string", description: "Our order reference." },
|
|
1660
|
+
member_id: { type: "string|null", description: "End-user this order is attributed to; null when unattributed" },
|
|
1639
1661
|
fc_order_code: { type: "string", description: "Supplier order reference." },
|
|
1640
1662
|
status: { type: "string", description: "Current order status (string)." },
|
|
1641
1663
|
provider: { type: "string", description: "Service provider ('redaug')." },
|
|
@@ -1913,6 +1935,7 @@ var unifiedOrdersListSchema = {
|
|
|
1913
1935
|
description: 'List orders across ALL providers (ride + hotel) in one call. Use this for generic "my orders" / "order history" requests. Prefer ride-elife/hotel-redaug list-orders when the user names a specific business.',
|
|
1914
1936
|
flags: {
|
|
1915
1937
|
"order-type": { type: "string", required: false, description: "Filter by provider: ride | hotel" },
|
|
1938
|
+
member: MEMBER_FLAG_SCHEMA,
|
|
1916
1939
|
status: { type: "string", required: false, description: "Filter by NORMALIZED status (NOT the domain-specific status): PENDING | CONFIRMED | COMPLETED | CANCELLED | FAILED" },
|
|
1917
1940
|
page: { type: "int", required: false, default: 1, description: "Page number", constraints: ">= 1" },
|
|
1918
1941
|
"page-size": { type: "int", required: false, default: 20, description: "Items per page", constraints: ">= 1" }
|
|
@@ -1923,6 +1946,7 @@ var unifiedOrdersListSchema = {
|
|
|
1923
1946
|
description: "Slim cross-provider order-index items. For business-specific fields (vehicle_class, hotel_name, etc.), call `orders get --order-id <id>` or the domain-specific `get`.",
|
|
1924
1947
|
items: {
|
|
1925
1948
|
order_id: { type: "string", description: "Order id (rio_... for ride, hho_... for hotel). Pass to `orders get`." },
|
|
1949
|
+
member_id: { type: "string|null", description: "End-user this order is attributed to; null when unattributed" },
|
|
1926
1950
|
order_type: { type: "string", description: "'ride' or 'hotel'" },
|
|
1927
1951
|
status: { type: "string", description: "Normalized status: PENDING | CONFIRMED | COMPLETED | CANCELLED | FAILED" },
|
|
1928
1952
|
amount: { type: "float|null", description: "Order amount in DECIMAL currency units (NOT cents)" },
|
|
@@ -2060,6 +2084,7 @@ var flightCreateOrderSchema = flightSchema(
|
|
|
2060
2084
|
"contact-phone": { type: "string", required: true, description: "Contact phone." },
|
|
2061
2085
|
"contact-email": { type: "string", required: true, description: "Contact email." },
|
|
2062
2086
|
passengers: { type: "json", required: true, description: 'JSON array of passengers. gender/id_type are STRINGS ("1"/"2"). child/infant require adult_passenger_name.' },
|
|
2087
|
+
member: MEMBER_FLAG_SCHEMA,
|
|
2063
2088
|
"idempotency-key": { type: "string", required: true, description: "Forwarded verbatim as the Idempotency-Key header." }
|
|
2064
2089
|
},
|
|
2065
2090
|
{
|
|
@@ -2127,10 +2152,11 @@ var flightListOrdersSchema = flightSchema(
|
|
|
2127
2152
|
"List the developer's flight orders (local read, no upstream call).",
|
|
2128
2153
|
{
|
|
2129
2154
|
status: { type: "string", required: false, description: "Optional status filter." },
|
|
2155
|
+
member: MEMBER_FLAG_SCHEMA,
|
|
2130
2156
|
page: { type: "int", required: false, default: 1, description: "1-based page." },
|
|
2131
2157
|
"page-size": { type: "int", required: false, default: 20, description: "Items per page (1-100)." }
|
|
2132
2158
|
},
|
|
2133
|
-
{ orders: { type: "array", description: "Flight order summaries." }, total: { type: "int", description: "Total count." } },
|
|
2159
|
+
{ orders: { type: "array", description: "Flight order summaries; each item carries member_id (null when unattributed)." }, total: { type: "int", description: "Total count." } },
|
|
2134
2160
|
{ command: "agenzo-merchant-cli flight-flink list-orders", output_summary: "Paged flight orders." }
|
|
2135
2161
|
);
|
|
2136
2162
|
var flightChangeSearchSchema = flightSchema(
|
|
@@ -2424,7 +2450,10 @@ function registerBookCommand(parent, deps) {
|
|
|
2424
2450
|
const cmd = parent.command("book").description("Book a ride using a quote_id returned by quote").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--quote-id <id>", "Quote id from `ride-elife quote`").option("--vehicle-class <class>", "Chosen vehicle class").option("--price-amount <amount>", "Fare in decimal currency units (not cents)").option("--price-currency <currency>", "Currency code (default USD)").option("--payment-order-id <id>", "Paid payment order id (pay_per_call mode only)").option(
|
|
2425
2451
|
"--payment-method-id <id>",
|
|
2426
2452
|
"Bound payment method id to charge (pay_per_call mode only)"
|
|
2427
|
-
).option(
|
|
2453
|
+
).option(
|
|
2454
|
+
"--authorized-merchant-trans-id <id>",
|
|
2455
|
+
"EVO merchant transaction id of an already-authorised preauth (3DS challenge resume). When set, the server reuses that authorization instead of creating a new one, avoiding a second hold on the card (pay_per_call mode only)."
|
|
2456
|
+
).option("--passenger-name <name>", "Passenger full name").option("--passenger-phone <phone>", "Passenger phone").option("--passenger-email <email>", "Passenger email").option("--luggage-count <n>", "Luggage count").option("--special-requests <text>", "Free-text special requests").option("--pickup-lat <lat>", "Pickup latitude").option("--pickup-lng <lng>", "Pickup longitude").option("--pickup-name <name>", "Pickup location name").option("--dropoff-lat <lat>", "Dropoff latitude").option("--dropoff-lng <lng>", "Dropoff longitude").option("--dropoff-name <name>", "Dropoff location name").option("--pickup-time <time>", 'Pickup time: epoch seconds, or "now"').option("--meet-and-greet", "Enable meet & greet service").option("--meet-and-greet-price <amount>", "Meet & greet surcharge").option("--welcome-sign <text>", "Welcome sign text").option("--child-seat-count <n>", "Number of child seats needed (0-5)").option("--infant-seat-count <n>", "Number of infant seats needed (0-5)").option("--toddler-seat-count <n>", "Number of toddler seats needed (0-5)").option("--arrival-flight-no <no>", "Arrival flight number").option("--arrival-airline <airline>", "Arrival airline").option("--departure-flight-no <no>", "Departure flight number").option("--departure-airline <airline>", "Departure airline").option("--member <id>", MEMBER_OPTION_DESCRIPTION).option(
|
|
2428
2457
|
"--idempotency-key <key>",
|
|
2429
2458
|
"Idempotency key forwarded verbatim as the Idempotency-Key header"
|
|
2430
2459
|
);
|
|
@@ -2448,6 +2477,11 @@ function registerBookCommand(parent, deps) {
|
|
|
2448
2477
|
};
|
|
2449
2478
|
if (opts.paymentOrderId) body.payment_order_id = opts.paymentOrderId;
|
|
2450
2479
|
if (opts.paymentMethodId) body.payment_method_id = opts.paymentMethodId;
|
|
2480
|
+
if (opts.authorizedMerchantTransId) {
|
|
2481
|
+
body.authorized_merchant_trans_id = opts.authorizedMerchantTransId;
|
|
2482
|
+
}
|
|
2483
|
+
const member = memberIdOf(opts);
|
|
2484
|
+
if (member !== void 0) body.member_id = member;
|
|
2451
2485
|
if (opts.passengerEmail) body.passenger_email = opts.passengerEmail;
|
|
2452
2486
|
if (opts.luggageCount !== void 0) {
|
|
2453
2487
|
body.luggage_count = num2(opts.luggageCount, "luggage-count");
|
|
@@ -2730,7 +2764,7 @@ function formatOrders(data) {
|
|
|
2730
2764
|
${Formatter.keyValue(summary)}`;
|
|
2731
2765
|
}
|
|
2732
2766
|
function registerListOrdersCommand(parent, deps) {
|
|
2733
|
-
const cmd = parent.command("list-orders").description("List previously placed ride orders").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--page <page>", "Page number", DEFAULT_PAGE).option("--page-size <size>", "Page size", DEFAULT_PAGE_SIZE).option("--status <status>", "Filter by order status").option("--order-type <type>", "Filter by order type");
|
|
2767
|
+
const cmd = parent.command("list-orders").description("List previously placed ride orders").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--page <page>", "Page number", DEFAULT_PAGE).option("--page-size <size>", "Page size", DEFAULT_PAGE_SIZE).option("--status <status>", "Filter by order status").option("--order-type <type>", "Filter by order type").option("--member <id>", MEMBER_OPTION_DESCRIPTION);
|
|
2734
2768
|
attachSchemaHelp(cmd, listOrdersSchema);
|
|
2735
2769
|
cmd.action(async () => {
|
|
2736
2770
|
const opts = cmd.optsWithGlobals();
|
|
@@ -2745,6 +2779,8 @@ function registerListOrdersCommand(parent, deps) {
|
|
|
2745
2779
|
};
|
|
2746
2780
|
if (opts.status !== void 0) params.status = opts.status;
|
|
2747
2781
|
if (opts.orderType !== void 0) params.order_type = opts.orderType;
|
|
2782
|
+
const member = memberIdOf(opts);
|
|
2783
|
+
if (member !== void 0) params.member_id = member;
|
|
2748
2784
|
const spinner = format === "json" ? null : createSpinner("Fetching orders...");
|
|
2749
2785
|
const result = await deps.apiClient.get(
|
|
2750
2786
|
"/ride/orders",
|
|
@@ -3123,7 +3159,7 @@ function formatOrders2(data) {
|
|
|
3123
3159
|
${Formatter.keyValue(summary)}`;
|
|
3124
3160
|
}
|
|
3125
3161
|
function registerOrdersListCommand(parent, deps) {
|
|
3126
|
-
const cmd = parent.command("list").description("List orders across ALL providers (ride + hotel), with optional type/status filters").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--order-type <type>", "Filter by order type: ride | hotel").option("--status <status>", "Filter by normalized status: PENDING | CONFIRMED | COMPLETED | CANCELLED | FAILED").option("--page <page>", "Page number", DEFAULT_PAGE2).option("--page-size <size>", "Page size", DEFAULT_PAGE_SIZE2);
|
|
3162
|
+
const cmd = parent.command("list").description("List orders across ALL providers (ride + hotel), with optional type/status filters").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--order-type <type>", "Filter by order type: ride | hotel").option("--status <status>", "Filter by normalized status: PENDING | CONFIRMED | COMPLETED | CANCELLED | FAILED").option("--page <page>", "Page number", DEFAULT_PAGE2).option("--page-size <size>", "Page size", DEFAULT_PAGE_SIZE2).option("--member <id>", MEMBER_OPTION_DESCRIPTION);
|
|
3127
3163
|
attachSchemaHelp(cmd, unifiedOrdersListSchema);
|
|
3128
3164
|
cmd.action(async () => {
|
|
3129
3165
|
const opts = cmd.optsWithGlobals();
|
|
@@ -3138,6 +3174,8 @@ function registerOrdersListCommand(parent, deps) {
|
|
|
3138
3174
|
};
|
|
3139
3175
|
if (opts.orderType !== void 0) params.order_type = opts.orderType;
|
|
3140
3176
|
if (opts.status !== void 0) params.status = opts.status;
|
|
3177
|
+
const member = memberIdOf(opts);
|
|
3178
|
+
if (member !== void 0) params.member_id = member;
|
|
3141
3179
|
const spinner = format === "json" ? null : createSpinner("Fetching orders...");
|
|
3142
3180
|
const result = await deps.apiClient.get(
|
|
3143
3181
|
"/orders",
|
|
@@ -3550,7 +3588,7 @@ function registerHotelCreateOrderCommand(parent, deps) {
|
|
|
3550
3588
|
).option(
|
|
3551
3589
|
"--payment-token-id <id>",
|
|
3552
3590
|
"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)."
|
|
3553
|
-
).option(
|
|
3591
|
+
).option("--member <id>", MEMBER_OPTION_DESCRIPTION).option(
|
|
3554
3592
|
"--idempotency-key <key>",
|
|
3555
3593
|
"Idempotency key forwarded verbatim as the Idempotency-Key header"
|
|
3556
3594
|
);
|
|
@@ -3601,6 +3639,8 @@ function registerHotelCreateOrderCommand(parent, deps) {
|
|
|
3601
3639
|
if (opts.bedType !== void 0) body.bed_type = opts.bedType;
|
|
3602
3640
|
if (opts.paymentMethodId !== void 0) body.payment_method_id = opts.paymentMethodId;
|
|
3603
3641
|
if (opts.paymentTokenId !== void 0) body.payment_token_id = opts.paymentTokenId;
|
|
3642
|
+
const member = memberIdOf(opts);
|
|
3643
|
+
if (member !== void 0) body.member_id = member;
|
|
3604
3644
|
if (!isYes) {
|
|
3605
3645
|
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.";
|
|
3606
3646
|
const confirmed = await confirm3({
|
|
@@ -4295,7 +4335,7 @@ function formatOrders3(data) {
|
|
|
4295
4335
|
${Formatter.keyValue(summary)}`;
|
|
4296
4336
|
}
|
|
4297
4337
|
function registerHotelListOrdersCommand(parent, deps) {
|
|
4298
|
-
const cmd = parent.command("list-orders").description("List the developer's hotel orders with optional status filtering and pagination").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--status <status>", "Filter by order status (omitted entirely when absent \u2192 all statuses)").option("--page <page>", "Page number", DEFAULT_PAGE3).option("--page-size <size>", "Page size", DEFAULT_PAGE_SIZE3);
|
|
4338
|
+
const cmd = parent.command("list-orders").description("List the developer's hotel orders with optional status filtering and pagination").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--status <status>", "Filter by order status (omitted entirely when absent \u2192 all statuses)").option("--page <page>", "Page number", DEFAULT_PAGE3).option("--page-size <size>", "Page size", DEFAULT_PAGE_SIZE3).option("--member <id>", MEMBER_OPTION_DESCRIPTION);
|
|
4299
4339
|
attachSchemaHelp(cmd, hotelListOrdersSchema);
|
|
4300
4340
|
cmd.action(async () => {
|
|
4301
4341
|
const opts = cmd.optsWithGlobals();
|
|
@@ -4309,6 +4349,8 @@ function registerHotelListOrdersCommand(parent, deps) {
|
|
|
4309
4349
|
page_size: positiveInt4(opts.pageSize ?? DEFAULT_PAGE_SIZE3, "page-size")
|
|
4310
4350
|
};
|
|
4311
4351
|
if (opts.status !== void 0) params.status = opts.status;
|
|
4352
|
+
const member = memberIdOf(opts);
|
|
4353
|
+
if (member !== void 0) params.member_id = member;
|
|
4312
4354
|
const spinner = format === "json" ? null : createSpinner("Fetching orders...");
|
|
4313
4355
|
const result = await deps.apiClient.get(
|
|
4314
4356
|
"/hotel/orders",
|
|
@@ -5124,7 +5166,7 @@ function registerVerifyCommand(parent, deps) {
|
|
|
5124
5166
|
// src/flight-flink/create-order.ts
|
|
5125
5167
|
import { confirm as confirm6 } from "@inquirer/prompts";
|
|
5126
5168
|
function registerCreateOrderCommand(parent, deps) {
|
|
5127
|
-
const cmd = parent.command("create-order").description("Create a flight order without charging (locks the fare, await payment)").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--product-token <token>", "Authoritative rate token from verify").option("--total-amount <amount>", "Verified total price in decimal units").option("--currency <currency>", "ISO 4217 currency code").option("--trip-type <n>", "1/2/3", "1").option("--contact-name <name>", "Booking contact name").option("--contact-region <code>", "Contact phone country code (no '+')").option("--contact-phone <phone>", "Booking contact phone").option("--contact-email <email>", "Booking contact email").option("--passengers <json>", "JSON array of passengers (gender/id_type are strings)").option("--payment-method-id <id>", "Optional bound-card id (pay_per_call only)").option("--payment-token-id <id>", "Optional UPI network-token id (unionpay charge path)").option("--idempotency-key <key>", "Forwarded verbatim as the Idempotency-Key header");
|
|
5169
|
+
const cmd = parent.command("create-order").description("Create a flight order without charging (locks the fare, await payment)").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--product-token <token>", "Authoritative rate token from verify").option("--total-amount <amount>", "Verified total price in decimal units").option("--currency <currency>", "ISO 4217 currency code").option("--trip-type <n>", "1/2/3", "1").option("--contact-name <name>", "Booking contact name").option("--contact-region <code>", "Contact phone country code (no '+')").option("--contact-phone <phone>", "Booking contact phone").option("--contact-email <email>", "Booking contact email").option("--passengers <json>", "JSON array of passengers (gender/id_type are strings)").option("--payment-method-id <id>", "Optional bound-card id (pay_per_call only)").option("--payment-token-id <id>", "Optional UPI network-token id (unionpay charge path)").option("--member <id>", MEMBER_OPTION_DESCRIPTION).option("--idempotency-key <key>", "Forwarded verbatim as the Idempotency-Key header");
|
|
5128
5170
|
attachSchemaHelp(cmd, flightCreateOrderSchema);
|
|
5129
5171
|
cmd.action(async () => {
|
|
5130
5172
|
const opts = cmd.optsWithGlobals();
|
|
@@ -5147,6 +5189,8 @@ function registerCreateOrderCommand(parent, deps) {
|
|
|
5147
5189
|
};
|
|
5148
5190
|
if (opts.paymentMethodId !== void 0) body.payment_method_id = opts.paymentMethodId;
|
|
5149
5191
|
if (opts.paymentTokenId !== void 0) body.payment_token_id = opts.paymentTokenId;
|
|
5192
|
+
const member = memberIdOf(opts);
|
|
5193
|
+
if (member !== void 0) body.member_id = member;
|
|
5150
5194
|
if (!isYes) {
|
|
5151
5195
|
const ok = await confirm6({
|
|
5152
5196
|
message: `Create this flight order for ${totalAmount} ${currency}? This locks the fare but does NOT charge yet.`,
|
|
@@ -5327,7 +5371,7 @@ function registerCancelOrderCommand(parent, deps) {
|
|
|
5327
5371
|
|
|
5328
5372
|
// src/flight-flink/list-orders.ts
|
|
5329
5373
|
function registerListOrdersCommand2(parent, deps) {
|
|
5330
|
-
const cmd = parent.command("list-orders").description("List the developer's flight orders (local read, no upstream call)").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--status <status>", "Optional status filter").option("--page <n>", "Page (1-based)", "1").option("--page-size <n>", "Items per page (1-100)", "20");
|
|
5374
|
+
const cmd = parent.command("list-orders").description("List the developer's flight orders (local read, no upstream call)").option("--api-key <key>", "API Key for authentication (X-Api-Key)").option("--status <status>", "Optional status filter").option("--page <n>", "Page (1-based)", "1").option("--page-size <n>", "Items per page (1-100)", "20").option("--member <id>", MEMBER_OPTION_DESCRIPTION);
|
|
5331
5375
|
attachSchemaHelp(cmd, flightListOrdersSchema);
|
|
5332
5376
|
cmd.action(async () => {
|
|
5333
5377
|
const opts = cmd.optsWithGlobals();
|
|
@@ -5335,6 +5379,8 @@ function registerListOrdersCommand2(parent, deps) {
|
|
|
5335
5379
|
const apiKey = await resolveApiKey(opts.apiKey);
|
|
5336
5380
|
const params = new URLSearchParams();
|
|
5337
5381
|
if (opts.status !== void 0) params.set("status", opts.status);
|
|
5382
|
+
const member = memberIdOf(opts);
|
|
5383
|
+
if (member !== void 0) params.set("member_id", member);
|
|
5338
5384
|
params.set("page", String(num8(opts.page, "page")));
|
|
5339
5385
|
params.set("page_size", String(num8(opts.pageSize, "page-size")));
|
|
5340
5386
|
const spinner = format === "json" ? null : createSpinner("Fetching flight orders...");
|