@burdenoff/cli-sdk 2026.1102.3 → 2026.1102.4
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/modules/assethandler/index.cjs +22 -57
- package/dist/modules/assethandler/index.js +27 -62
- package/dist/modules/crewfoundry/index.cjs +63 -116
- package/dist/modules/crewfoundry/index.js +62 -115
- package/dist/modules/headshotmarketing/index.cjs +92 -261
- package/dist/modules/headshotmarketing/index.js +94 -263
- package/dist/modules/hookmovies/index.cjs +17 -6
- package/dist/modules/hookmovies/index.js +20 -9
- package/dist/modules/housingvista/index.cjs +31 -24
- package/dist/modules/housingvista/index.js +26 -19
- package/dist/modules/kadaikodi/index.cjs +56 -90
- package/dist/modules/kadaikodi/index.js +60 -94
- package/dist/modules/movethewheels/index.cjs +103 -231
- package/dist/modules/movethewheels/index.js +103 -231
- package/dist/modules/timecampus/index.cjs +31 -85
- package/dist/modules/timecampus/index.js +32 -86
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(r,t){super(r),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},C=class extends l{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},w=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};var b=null;function O(c){b=c;}function E(){if(!b)throw new w("vibecontrols module helpers used before setHelpersContext was called");return b}function ct(){let c=E();if(!c.auth.isAuthenticated())throw new C("Authentication required.",{hint:`Run \`${c.productName} auth login\` to authenticate.`})}async function o(c,r){return ct(),E().gql.workspace.request(c,r)}function a(c){let r=c instanceof Error?c.message:String(c);throw new l(r)}function s(c,r,t){E().output.formatAndOutput(c,r,t);}function p(c){E().output.printSuccess(c);}function g(c,r){return E().output.truncate(c,r)}var S=`
|
|
2
2
|
query MovethewheelsGetCustomer($id: ID!) {
|
|
3
3
|
customer(id: $id) {
|
|
4
4
|
id name email phone company type taxId businessLicense address rating
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
id name email phone company type rating createdAt
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,R=`
|
|
15
15
|
mutation MovethewheelsCreateCustomer($input: CreateCustomerInput!) {
|
|
16
16
|
createCustomer(input: $input) {
|
|
17
17
|
id name email phone company type taxId businessLicense address rating createdAt
|
|
@@ -41,44 +41,44 @@
|
|
|
41
41
|
id employeeId firstName lastName email phone status vehicleId rating createdAt
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`,
|
|
44
|
+
`,L=`
|
|
45
45
|
mutation MovethewheelsCreateDriver($input: CreateDriverInput!) {
|
|
46
46
|
createDriver(input: $input) {
|
|
47
47
|
id employeeId firstName lastName email phone status licenseNumber
|
|
48
48
|
licenseClass vehicleId rating createdAt
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,P=`
|
|
52
52
|
mutation MovethewheelsUpdateDriver($id: ID!, $input: UpdateDriverInput!) {
|
|
53
53
|
updateDriver(id: $id, input: $input) {
|
|
54
54
|
id employeeId firstName lastName email phone status licenseNumber
|
|
55
55
|
licenseClass vehicleId rating updatedAt
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,_=`
|
|
59
59
|
mutation MovethewheelsDeleteDriver($id: ID!) {
|
|
60
60
|
deleteDriver(id: $id)
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
62
|
+
`,U=`
|
|
63
63
|
mutation MovethewheelsUpdateDriverStatus($id: ID!, $status: DriverStatus!) {
|
|
64
64
|
updateDriverStatus(id: $id, status: $status) {
|
|
65
65
|
id firstName lastName status updatedAt
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
`,
|
|
68
|
+
`,V=`
|
|
69
69
|
mutation MovethewheelsAssignDriverVehicle($id: ID!, $vehicleId: ID) {
|
|
70
70
|
assignDriverVehicle(id: $id, vehicleId: $vehicleId) {
|
|
71
71
|
id firstName lastName vehicleId status updatedAt
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`,M=`
|
|
75
75
|
query MovethewheelsGetVehicle($id: ID!) {
|
|
76
76
|
vehicle(id: $id) {
|
|
77
77
|
id vehicleNumber type status make model year licensePlate fuelLevel
|
|
78
78
|
mileage ownershipType capacity currentLocation createdAt updatedAt workspaceId
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,q=`
|
|
82
82
|
query MovethewheelsVehicles($filter: VehicleFilterInput, $pagination: PaginationInput) {
|
|
83
83
|
vehicles(filter: $filter, pagination: $pagination) {
|
|
84
84
|
id vehicleNumber type status make model year licensePlate fuelLevel createdAt
|
|
@@ -98,54 +98,23 @@
|
|
|
98
98
|
mileage ownershipType updatedAt
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
`,
|
|
101
|
+
`,H=`
|
|
102
102
|
mutation MovethewheelsDeleteVehicle($id: ID!) {
|
|
103
103
|
deleteVehicle(id: $id)
|
|
104
104
|
}
|
|
105
|
-
`,
|
|
105
|
+
`,j=`
|
|
106
106
|
mutation MovethewheelsUpdateVehicleStatus($id: ID!, $status: VehicleStatus!) {
|
|
107
107
|
updateVehicleStatus(id: $id, status: $status) {
|
|
108
108
|
id vehicleNumber status updatedAt
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
`,
|
|
111
|
+
`,G=`
|
|
112
112
|
mutation MovethewheelsUpdateVehicleLocation($id: ID!, $location: JSON!) {
|
|
113
113
|
updateVehicleLocation(id: $id, location: $location) {
|
|
114
114
|
id vehicleNumber currentLocation updatedAt
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
`,J=`
|
|
118
|
-
query MovethewheelsGetProduct($id: ID!) {
|
|
119
|
-
product(id: $id) {
|
|
120
|
-
id sku name description category brand weight value dimensions
|
|
121
|
-
fragile hazardous temperatureControlled createdAt updatedAt workspaceId
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
`,z=`
|
|
125
|
-
query MovethewheelsProducts($filter: ProductFilterInput, $pagination: PaginationInput) {
|
|
126
|
-
products(filter: $filter, pagination: $pagination) {
|
|
127
|
-
id sku name category brand weight value fragile hazardous createdAt
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
`,Y=`
|
|
131
|
-
mutation MovethewheelsCreateProduct($input: CreateProductInput!) {
|
|
132
|
-
createProduct(input: $input) {
|
|
133
|
-
id sku name description category brand weight value fragile hazardous
|
|
134
|
-
temperatureControlled createdAt
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
`,B=`
|
|
138
|
-
mutation MovethewheelsUpdateProduct($id: ID!, $input: UpdateProductInput!) {
|
|
139
|
-
updateProduct(id: $id, input: $input) {
|
|
140
|
-
id sku name description category brand weight value fragile hazardous
|
|
141
|
-
temperatureControlled updatedAt
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
`,K=`
|
|
145
|
-
mutation MovethewheelsDeleteProduct($id: ID!) {
|
|
146
|
-
deleteProduct(id: $id)
|
|
147
|
-
}
|
|
148
|
-
`,Q=`
|
|
149
118
|
query MovethewheelsGetWarehouse($id: ID!) {
|
|
150
119
|
warehouse(id: $id) {
|
|
151
120
|
id code name type status address contactInfo operatingHours capabilities
|
|
@@ -153,213 +122,161 @@
|
|
|
153
122
|
locations { id locationCode locationType status zone aisle rack shelf bin capacity }
|
|
154
123
|
}
|
|
155
124
|
}
|
|
156
|
-
`,
|
|
125
|
+
`,z=`
|
|
157
126
|
query MovethewheelsWarehouses($filter: WarehouseFilterInput, $pagination: PaginationInput) {
|
|
158
127
|
warehouses(filter: $filter, pagination: $pagination) {
|
|
159
128
|
id code name type status totalCapacity usedCapacity createdAt
|
|
160
129
|
}
|
|
161
130
|
}
|
|
162
|
-
`,
|
|
131
|
+
`,B=`
|
|
163
132
|
mutation MovethewheelsCreateWarehouse($input: CreateWarehouseInput!) {
|
|
164
133
|
createWarehouse(input: $input) {
|
|
165
134
|
id code name type status address totalCapacity usedCapacity createdAt
|
|
166
135
|
}
|
|
167
136
|
}
|
|
168
|
-
`,
|
|
137
|
+
`,Y=`
|
|
169
138
|
mutation MovethewheelsUpdateWarehouse($id: ID!, $input: UpdateWarehouseInput!) {
|
|
170
139
|
updateWarehouse(id: $id, input: $input) {
|
|
171
140
|
id code name type status address totalCapacity usedCapacity updatedAt
|
|
172
141
|
}
|
|
173
142
|
}
|
|
174
|
-
`,
|
|
143
|
+
`,K=`
|
|
175
144
|
mutation MovethewheelsDeleteWarehouse($id: ID!) {
|
|
176
145
|
deleteWarehouse(id: $id)
|
|
177
146
|
}
|
|
178
|
-
`,
|
|
147
|
+
`,Q=`
|
|
179
148
|
mutation MovethewheelsCreateWarehouseLocation($input: CreateWarehouseLocationInput!) {
|
|
180
149
|
createWarehouseLocation(input: $input) {
|
|
181
150
|
id warehouseId locationCode locationType status zone aisle rack shelf bin capacity createdAt
|
|
182
151
|
}
|
|
183
152
|
}
|
|
184
|
-
`,
|
|
153
|
+
`,Z=`
|
|
185
154
|
mutation MovethewheelsUpdateWarehouseLocation($id: ID!, $input: UpdateWarehouseLocationInput!) {
|
|
186
155
|
updateWarehouseLocation(id: $id, input: $input) {
|
|
187
156
|
id warehouseId locationCode locationType status zone aisle rack shelf bin capacity updatedAt
|
|
188
157
|
}
|
|
189
158
|
}
|
|
190
|
-
`,
|
|
159
|
+
`,X=`
|
|
191
160
|
query MovethewheelsGetInventoryItem($id: ID!) {
|
|
192
161
|
inventoryItem(id: $id) {
|
|
193
|
-
id
|
|
194
|
-
|
|
162
|
+
id cargoItemId warehouseId locationId onHand available allocated damaged reorderPoint safetyStock
|
|
163
|
+
unitCost createdAt updatedAt workspaceId
|
|
195
164
|
}
|
|
196
165
|
}
|
|
197
|
-
`,
|
|
198
|
-
query MovethewheelsInventoryItems(
|
|
166
|
+
`,ee=`
|
|
167
|
+
query MovethewheelsInventoryItems(
|
|
168
|
+
$filter: InventoryFilterInput
|
|
169
|
+
$pagination: PaginationInput
|
|
170
|
+
) {
|
|
199
171
|
inventoryItems(filter: $filter, pagination: $pagination) {
|
|
200
|
-
id
|
|
201
|
-
reorderPoint unitCost createdAt
|
|
172
|
+
id cargoItemId warehouseId onHand available allocated damaged reorderPoint unitCost createdAt
|
|
202
173
|
}
|
|
203
174
|
}
|
|
204
|
-
`,
|
|
175
|
+
`,te=`
|
|
205
176
|
query MovethewheelsInventoryTransactions(
|
|
206
177
|
$filter: InventoryFilterInput
|
|
207
178
|
$pagination: PaginationInput
|
|
208
179
|
) {
|
|
209
180
|
inventoryTransactions(filter: $filter, pagination: $pagination) {
|
|
210
|
-
id transactionNumber type
|
|
211
|
-
|
|
181
|
+
id transactionNumber type cargoItemId warehouseId quantity unitCost referenceType referenceId notes
|
|
182
|
+
createdAt
|
|
212
183
|
}
|
|
213
184
|
}
|
|
214
|
-
`,
|
|
185
|
+
`,ne=`
|
|
215
186
|
query MovethewheelsInventoryStats {
|
|
216
187
|
inventoryStats {
|
|
217
188
|
totalOnHand totalAvailable totalAllocated totalDamaged lowStockCount
|
|
218
189
|
}
|
|
219
190
|
}
|
|
220
|
-
`,
|
|
191
|
+
`,ie=`
|
|
221
192
|
mutation MovethewheelsCreateInventoryItem($input: CreateInventoryItemInput!) {
|
|
222
193
|
createInventoryItem(input: $input) {
|
|
223
|
-
id
|
|
224
|
-
|
|
194
|
+
id cargoItemId warehouseId locationId onHand available allocated damaged reorderPoint safetyStock
|
|
195
|
+
unitCost createdAt
|
|
225
196
|
}
|
|
226
197
|
}
|
|
227
|
-
`,
|
|
198
|
+
`,re=`
|
|
228
199
|
mutation MovethewheelsUpdateInventoryItem($id: ID!, $input: UpdateInventoryItemInput!) {
|
|
229
200
|
updateInventoryItem(id: $id, input: $input) {
|
|
230
|
-
id
|
|
231
|
-
|
|
201
|
+
id cargoItemId warehouseId locationId onHand available allocated damaged reorderPoint safetyStock
|
|
202
|
+
unitCost updatedAt
|
|
232
203
|
}
|
|
233
204
|
}
|
|
234
|
-
`,
|
|
205
|
+
`,oe=`
|
|
235
206
|
mutation MovethewheelsDeleteInventoryItem($id: ID!) {
|
|
236
207
|
deleteInventoryItem(id: $id)
|
|
237
208
|
}
|
|
238
|
-
`,
|
|
209
|
+
`,ae=`
|
|
239
210
|
mutation MovethewheelsAdjustInventoryStock($input: AdjustInventoryStockInput!) {
|
|
240
211
|
adjustInventoryStock(input: $input) {
|
|
241
|
-
id
|
|
212
|
+
id cargoItemId warehouseId onHand available allocated damaged updatedAt
|
|
242
213
|
}
|
|
243
214
|
}
|
|
244
|
-
`,
|
|
215
|
+
`,se=`
|
|
245
216
|
mutation MovethewheelsCreateInventoryTransaction($input: CreateInventoryTransactionInput!) {
|
|
246
217
|
createInventoryTransaction(input: $input) {
|
|
247
|
-
id transactionNumber type
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
`,me=`
|
|
252
|
-
query MovethewheelsGetOrder($id: ID!) {
|
|
253
|
-
movethewheelsOrder(id: $id) {
|
|
254
|
-
id orderNumber customerId driverId vehicleId orderType status priority
|
|
255
|
-
trackingNumber pickupAddress deliveryAddress items pricing
|
|
256
|
-
scheduledDelivery specialInstructions createdAt updatedAt workspaceId
|
|
257
|
-
statusHistory { id status previousStatus notes location createdAt }
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
`,fe=`
|
|
261
|
-
query MovethewheelsOrders($filter: OrderFilterInput, $pagination: PaginationInput) {
|
|
262
|
-
movethewheelsOrders(filter: $filter, pagination: $pagination) {
|
|
263
|
-
id orderNumber customerId driverId orderType status priority
|
|
264
|
-
trackingNumber scheduledDelivery createdAt
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
`,ge=`
|
|
268
|
-
mutation MovethewheelsCreateOrder($input: CreateOrderInput!) {
|
|
269
|
-
createMovethewheelsOrder(input: $input) {
|
|
270
|
-
id orderNumber customerId driverId vehicleId orderType status priority
|
|
271
|
-
trackingNumber pickupAddress deliveryAddress items pricing createdAt
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
`,he=`
|
|
275
|
-
mutation MovethewheelsUpdateOrder($id: ID!, $input: UpdateOrderInput!) {
|
|
276
|
-
updateMovethewheelsOrder(id: $id, input: $input) {
|
|
277
|
-
id orderNumber customerId driverId vehicleId orderType status priority
|
|
278
|
-
trackingNumber deliveryAddress items pricing updatedAt
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
`,ye=`
|
|
282
|
-
mutation MovethewheelsDeleteOrder($id: ID!) {
|
|
283
|
-
deleteMovethewheelsOrder(id: $id)
|
|
284
|
-
}
|
|
285
|
-
`,ve=`
|
|
286
|
-
mutation MovethewheelsUpdateOrderStatus($id: ID!, $input: UpdateOrderStatusInput!) {
|
|
287
|
-
updateMovethewheelsOrderStatus(id: $id, input: $input) {
|
|
288
|
-
id orderNumber status priority trackingNumber updatedAt
|
|
289
|
-
statusHistory { id status previousStatus notes createdAt }
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
`,Ie=`
|
|
293
|
-
query MovethewheelsOrderStats {
|
|
294
|
-
orderStats {
|
|
295
|
-
total pending inTransit delivered cancelled failed
|
|
218
|
+
id transactionNumber type cargoItemId warehouseId quantity unitCost referenceType referenceId notes
|
|
219
|
+
createdAt
|
|
296
220
|
}
|
|
297
221
|
}
|
|
298
|
-
`,
|
|
222
|
+
`,ce=`
|
|
299
223
|
query MovethewheelsGetShipment($id: ID!) {
|
|
300
224
|
shipment(id: $id) {
|
|
301
|
-
id shipmentNumber
|
|
302
|
-
|
|
303
|
-
createdAt updatedAt workspaceId
|
|
225
|
+
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber origin destination
|
|
226
|
+
cargoDetails estimatedDelivery actualDelivery createdAt updatedAt workspaceId
|
|
304
227
|
trackingEvents { id eventType details location timestamp }
|
|
305
228
|
}
|
|
306
229
|
}
|
|
307
|
-
`,
|
|
230
|
+
`,de=`
|
|
308
231
|
query MovethewheelsShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {
|
|
309
232
|
shipments(filter: $filter, pagination: $pagination) {
|
|
310
|
-
id shipmentNumber
|
|
233
|
+
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber
|
|
311
234
|
estimatedDelivery createdAt
|
|
312
235
|
}
|
|
313
236
|
}
|
|
314
|
-
`,
|
|
237
|
+
`,ue=`
|
|
315
238
|
query MovethewheelsActiveDeliveries($pagination: PaginationInput) {
|
|
316
239
|
activeDeliveries(pagination: $pagination) {
|
|
317
|
-
id shipmentNumber
|
|
240
|
+
id shipmentNumber deliveryJobId storeOrderId status trackingNumber estimatedDelivery createdAt
|
|
318
241
|
}
|
|
319
242
|
}
|
|
320
|
-
`,
|
|
243
|
+
`,pe=`
|
|
321
244
|
query MovethewheelsShipmentTracking($shipmentId: ID!, $pagination: PaginationInput) {
|
|
322
245
|
shipmentTracking(shipmentId: $shipmentId, pagination: $pagination) {
|
|
323
246
|
id shipmentId eventType details location timestamp createdAt
|
|
324
247
|
}
|
|
325
248
|
}
|
|
326
|
-
`,
|
|
327
|
-
query MovethewheelsOrderTracking($orderId: ID!, $pagination: PaginationInput) {
|
|
328
|
-
orderTracking(orderId: $orderId, pagination: $pagination) {
|
|
329
|
-
id shipmentId eventType details location timestamp createdAt
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
`,Te=`
|
|
249
|
+
`,le=`
|
|
333
250
|
query MovethewheelsTrackingAlerts($pagination: PaginationInput) {
|
|
334
251
|
trackingAlerts(pagination: $pagination) {
|
|
335
252
|
alertType message shipmentId shipmentNumber
|
|
336
253
|
}
|
|
337
254
|
}
|
|
338
|
-
`,
|
|
255
|
+
`,me=`
|
|
339
256
|
mutation MovethewheelsCreateShipment($input: CreateShipmentInput!) {
|
|
340
257
|
createShipment(input: $input) {
|
|
341
|
-
id shipmentNumber
|
|
342
|
-
|
|
258
|
+
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber origin destination
|
|
259
|
+
estimatedDelivery createdAt
|
|
343
260
|
}
|
|
344
261
|
}
|
|
345
|
-
`,
|
|
262
|
+
`,fe=`
|
|
346
263
|
mutation MovethewheelsUpdateShipment($id: ID!, $input: UpdateShipmentInput!) {
|
|
347
264
|
updateShipment(id: $id, input: $input) {
|
|
348
|
-
id shipmentNumber
|
|
349
|
-
|
|
265
|
+
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber origin destination
|
|
266
|
+
estimatedDelivery actualDelivery updatedAt
|
|
350
267
|
}
|
|
351
268
|
}
|
|
352
|
-
`,
|
|
269
|
+
`,ge=`
|
|
353
270
|
mutation MovethewheelsDeleteShipment($id: ID!) {
|
|
354
271
|
deleteShipment(id: $id)
|
|
355
272
|
}
|
|
356
|
-
`,
|
|
273
|
+
`,he=`
|
|
357
274
|
mutation MovethewheelsAddTrackingEvent($input: AddTrackingEventInput!) {
|
|
358
275
|
addTrackingEvent(input: $input) {
|
|
359
276
|
id shipmentId eventType details location timestamp createdAt
|
|
360
277
|
}
|
|
361
278
|
}
|
|
362
|
-
`,
|
|
279
|
+
`,ye=`
|
|
363
280
|
query MovethewheelsGetRoute($id: ID!) {
|
|
364
281
|
route(id: $id) {
|
|
365
282
|
id name status driverId vehicleId shipmentId waypoints
|
|
@@ -367,38 +284,38 @@
|
|
|
367
284
|
fuelCost createdAt updatedAt workspaceId
|
|
368
285
|
}
|
|
369
286
|
}
|
|
370
|
-
`,
|
|
287
|
+
`,ve=`
|
|
371
288
|
query MovethewheelsRoutes($filter: RouteFilterInput, $pagination: PaginationInput) {
|
|
372
289
|
routes(filter: $filter, pagination: $pagination) {
|
|
373
290
|
id name status driverId vehicleId shipmentId estimatedDistance
|
|
374
291
|
estimatedDuration fuelCost createdAt
|
|
375
292
|
}
|
|
376
293
|
}
|
|
377
|
-
`,
|
|
294
|
+
`,Ie=`
|
|
378
295
|
mutation MovethewheelsCreateRoute($input: CreateRouteInput!) {
|
|
379
296
|
createRoute(input: $input) {
|
|
380
297
|
id name status driverId vehicleId shipmentId waypoints
|
|
381
298
|
estimatedDistance estimatedDuration fuelCost createdAt
|
|
382
299
|
}
|
|
383
300
|
}
|
|
384
|
-
|
|
301
|
+
`,we=`
|
|
385
302
|
mutation MovethewheelsUpdateRoute($id: ID!, $input: UpdateRouteInput!) {
|
|
386
303
|
updateRoute(id: $id, input: $input) {
|
|
387
304
|
id name status driverId vehicleId shipmentId waypoints
|
|
388
305
|
estimatedDistance actualDistance estimatedDuration actualDuration fuelCost updatedAt
|
|
389
306
|
}
|
|
390
307
|
}
|
|
391
|
-
`,
|
|
308
|
+
`,Ce=`
|
|
392
309
|
mutation MovethewheelsDeleteRoute($id: ID!) {
|
|
393
310
|
deleteRoute(id: $id)
|
|
394
311
|
}
|
|
395
|
-
`,
|
|
312
|
+
`,Ee=`
|
|
396
313
|
mutation MovethewheelsOptimizeRoute($id: ID!) {
|
|
397
314
|
optimizeRoute(id: $id) {
|
|
398
315
|
id name status estimatedDistance estimatedDuration fuelCost waypoints updatedAt
|
|
399
316
|
}
|
|
400
317
|
}
|
|
401
|
-
`,
|
|
318
|
+
`,be=`
|
|
402
319
|
query MovethewheelsGetServiceProvider($id: ID!) {
|
|
403
320
|
serviceProvider(id: $id) {
|
|
404
321
|
id name type description isActive isVerified rating contactInfo services
|
|
@@ -406,127 +323,84 @@
|
|
|
406
323
|
offerings { id name category price currency }
|
|
407
324
|
}
|
|
408
325
|
}
|
|
409
|
-
`,
|
|
326
|
+
`,Te=`
|
|
410
327
|
query MovethewheelsServiceProviders(
|
|
411
|
-
$filter:
|
|
328
|
+
$filter: MtwServiceProviderFilterInput
|
|
412
329
|
$pagination: PaginationInput
|
|
413
330
|
) {
|
|
414
331
|
serviceProviders(filter: $filter, pagination: $pagination) {
|
|
415
332
|
id name type description isActive isVerified rating createdAt
|
|
416
333
|
}
|
|
417
334
|
}
|
|
418
|
-
`,
|
|
419
|
-
mutation MovethewheelsCreateServiceProvider($input:
|
|
335
|
+
`,De=`
|
|
336
|
+
mutation MovethewheelsCreateServiceProvider($input: MtwCreateServiceProviderInput!) {
|
|
420
337
|
createServiceProvider(input: $input) {
|
|
421
338
|
id name type description isActive isVerified rating createdAt
|
|
422
339
|
}
|
|
423
340
|
}
|
|
424
|
-
`,
|
|
425
|
-
mutation MovethewheelsUpdateServiceProvider(
|
|
341
|
+
`,Oe=`
|
|
342
|
+
mutation MovethewheelsUpdateServiceProvider(
|
|
343
|
+
$id: ID!
|
|
344
|
+
$input: MtwUpdateServiceProviderInput!
|
|
345
|
+
) {
|
|
426
346
|
updateServiceProvider(id: $id, input: $input) {
|
|
427
347
|
id name type description isActive isVerified rating updatedAt
|
|
428
348
|
}
|
|
429
349
|
}
|
|
430
|
-
`,
|
|
350
|
+
`,Se=`
|
|
431
351
|
mutation MovethewheelsDeleteServiceProvider($id: ID!) {
|
|
432
352
|
deleteServiceProvider(id: $id)
|
|
433
353
|
}
|
|
434
|
-
`,
|
|
354
|
+
`,ke=`
|
|
435
355
|
query MovethewheelsGetServiceOffering($id: ID!) {
|
|
436
356
|
serviceOffering(id: $id) {
|
|
437
357
|
id providerId name description category price currency availability
|
|
438
358
|
createdAt updatedAt workspaceId
|
|
439
359
|
}
|
|
440
360
|
}
|
|
441
|
-
`,
|
|
361
|
+
`,Re=`
|
|
442
362
|
query MovethewheelsServiceOfferings(
|
|
443
|
-
$filter:
|
|
363
|
+
$filter: MtwServiceOfferingFilterInput
|
|
444
364
|
$pagination: PaginationInput
|
|
445
365
|
) {
|
|
446
366
|
serviceOfferings(filter: $filter, pagination: $pagination) {
|
|
447
367
|
id providerId name category price currency createdAt
|
|
448
368
|
}
|
|
449
369
|
}
|
|
450
|
-
`,
|
|
451
|
-
mutation MovethewheelsCreateServiceOffering($input:
|
|
370
|
+
`,Ae=`
|
|
371
|
+
mutation MovethewheelsCreateServiceOffering($input: MtwCreateServiceOfferingInput!) {
|
|
452
372
|
createServiceOffering(input: $input) {
|
|
453
373
|
id providerId name description category price currency availability createdAt
|
|
454
374
|
}
|
|
455
375
|
}
|
|
456
|
-
`,
|
|
457
|
-
mutation MovethewheelsUpdateServiceOffering(
|
|
376
|
+
`,xe=`
|
|
377
|
+
mutation MovethewheelsUpdateServiceOffering(
|
|
378
|
+
$id: ID!
|
|
379
|
+
$input: MtwUpdateServiceOfferingInput!
|
|
380
|
+
) {
|
|
458
381
|
updateServiceOffering(id: $id, input: $input) {
|
|
459
382
|
id providerId name description category price currency availability updatedAt
|
|
460
383
|
}
|
|
461
384
|
}
|
|
462
|
-
`,
|
|
385
|
+
`,Ne=`
|
|
463
386
|
mutation MovethewheelsDeleteServiceOffering($id: ID!) {
|
|
464
387
|
deleteServiceOffering(id: $id)
|
|
465
388
|
}
|
|
466
|
-
|
|
467
|
-
query MovethewheelsGetReport($id: ID!) {
|
|
468
|
-
movethewheelsReport(id: $id) {
|
|
469
|
-
id name description type status schedule configuration lastGenerated
|
|
470
|
-
createdAt updatedAt workspaceId
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
`,ze=`
|
|
474
|
-
query MovethewheelsReports(
|
|
475
|
-
$filter: MovethewheelsReportFilterInput
|
|
476
|
-
$pagination: PaginationInput
|
|
477
|
-
) {
|
|
478
|
-
movethewheelsReports(filter: $filter, pagination: $pagination) {
|
|
479
|
-
id name type status schedule lastGenerated createdAt
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
`,Ye=`
|
|
483
|
-
mutation MovethewheelsCreateReport($input: CreateMovethewheelsReportInput!) {
|
|
484
|
-
createMovethewheelsReport(input: $input) {
|
|
485
|
-
id name description type status schedule configuration createdAt
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
`,Be=`
|
|
489
|
-
mutation MovethewheelsUpdateReport($id: ID!, $input: UpdateMovethewheelsReportInput!) {
|
|
490
|
-
updateMovethewheelsReport(id: $id, input: $input) {
|
|
491
|
-
id name description type status schedule configuration updatedAt
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
`,Ke=`
|
|
495
|
-
mutation MovethewheelsDeleteReport($id: ID!) {
|
|
496
|
-
deleteMovethewheelsReport(id: $id)
|
|
497
|
-
}
|
|
498
|
-
`,Qe=`
|
|
499
|
-
mutation MovethewheelsGenerateReport($input: GenerateMovethewheelsReportInput!) {
|
|
500
|
-
generateMovethewheelsReport(input: $input) {
|
|
501
|
-
generatedAt result
|
|
502
|
-
report { id name type status lastGenerated }
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
`,Xe=`
|
|
506
|
-
mutation MovethewheelsExportData($input: MovethewheelsExportDataInput!) {
|
|
507
|
-
exportData(input: $input) {
|
|
508
|
-
success message payload
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
`,Ze=`
|
|
512
|
-
mutation MovethewheelsImportData($input: MovethewheelsImportDataInput!) {
|
|
513
|
-
importData(input: $input) {
|
|
514
|
-
success message payload
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
`,et=`
|
|
389
|
+
`,$e=`
|
|
518
390
|
query MovethewheelsModuleSettings {
|
|
519
|
-
|
|
520
|
-
workspaceId
|
|
391
|
+
mtwModuleSettings {
|
|
392
|
+
workspaceId defaultCurrency defaultDeliveryWindowHours defaultOrderPriority
|
|
393
|
+
distanceUnit weightUnit timezone isCustomized updatedAt updatedBy
|
|
521
394
|
}
|
|
522
395
|
}
|
|
523
|
-
`,
|
|
524
|
-
mutation MovethewheelsUpdateModuleSettings($input:
|
|
525
|
-
|
|
526
|
-
workspaceId
|
|
396
|
+
`,Le=`
|
|
397
|
+
mutation MovethewheelsUpdateModuleSettings($input: UpdateMtwModuleSettingsInput!) {
|
|
398
|
+
updateMtwModuleSettings(input: $input) {
|
|
399
|
+
workspaceId defaultCurrency defaultDeliveryWindowHours defaultOrderPriority
|
|
400
|
+
distanceUnit weightUnit timezone isCustomized updatedAt updatedBy
|
|
527
401
|
}
|
|
528
402
|
}
|
|
529
|
-
`,
|
|
403
|
+
`,Pe=`
|
|
530
404
|
query MovethewheelsAnalytics {
|
|
531
405
|
analytics {
|
|
532
406
|
orderTrend { label value }
|
|
@@ -534,26 +408,24 @@
|
|
|
534
408
|
deliveryTrend { label value }
|
|
535
409
|
}
|
|
536
410
|
}
|
|
537
|
-
`,
|
|
411
|
+
`,_e=`
|
|
538
412
|
query MovethewheelsDashboardMetrics {
|
|
539
413
|
dashboardMetrics {
|
|
540
|
-
|
|
541
|
-
lowStockItems
|
|
542
|
-
recentOrders { id orderNumber status priority createdAt }
|
|
414
|
+
activeDeliveries totalRevenue activeVehicles availableDrivers lowStockItems
|
|
543
415
|
}
|
|
544
416
|
}
|
|
545
|
-
`,
|
|
417
|
+
`,Ue=`
|
|
546
418
|
query MovethewheelsFinanceMetrics {
|
|
547
419
|
financeMetrics {
|
|
548
420
|
fuelCost openInvoices
|
|
549
421
|
revenue { totalRevenue deliveredRevenue averageOrderValue }
|
|
550
422
|
}
|
|
551
423
|
}
|
|
552
|
-
`,
|
|
424
|
+
`,Ve=`
|
|
553
425
|
query MovethewheelsFleetStats {
|
|
554
426
|
fleetStats {
|
|
555
427
|
totalVehicles activeVehicles inTransitVehicles maintenanceVehicles
|
|
556
428
|
totalDrivers availableDrivers onDeliveryDrivers
|
|
557
429
|
}
|
|
558
430
|
}
|
|
559
|
-
`;function l(c,r){try{return JSON.parse(r)}catch{throw new m(`--${c} must be valid JSON`)}}function u(c){let r=Number.parseInt(c,10);if(Number.isNaN(r))throw new m(`Expected an integer but got "${c}"`);return r}function f(c){let r=Number.parseFloat(c);if(Number.isNaN(r))throw new m(`Expected a number but got "${c}"`);return r}function h(c){let r={};return c.limit!==void 0&&(r.limit=c.limit),c.offset!==void 0&&(r.offset=c.offset),Object.keys(r).length?r:void 0}function at(c){let r=c.command("customers").description("Movethewheels customers");r.command("list").description("List customers").option("--type <t>","Filter by customer type (b2c/b2b)").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.type&&(e.type=n.type),n.query&&(e.search=n.query);let t=await o(k,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.customers,{headers:["ID","Name","Type","Email","Phone","Rating"],rows:t.customers.map(i=>[g(i.id,12),i.name,i.type,i.email??"-",i.phone??"-",i.rating!=null?String(i.rating):"-"])});}catch(e){a(e);}}),r.command("get").description("Get a customer by id").argument("<id>","Customer ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(R,{id:n});if(!t.customer)throw new m(`Customer ${n} not found`);s(e,t.customer);}catch(t){a(t);}}),r.command("create").description("Create a customer").requiredOption("--name <name>","Customer name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--company <company>","Company").option("--type <t>","Customer type","b2c").option("--tax-id <s>","Tax ID").option("--business-license <s>","Business license").option("--rating <n>","Rating",f).option("--address <json>","Address JSON").option("-f, --format <format>","Output format").action(async n=>{try{let e={name:n.name,type:n.type??"b2c"};n.email&&(e.email=n.email),n.phone&&(e.phone=n.phone),n.company&&(e.company=n.company),n.taxId&&(e.taxId=n.taxId),n.businessLicense&&(e.businessLicense=n.businessLicense),n.rating!==void 0&&(e.rating=n.rating),n.address&&(e.address=l("address",n.address));let t=await o(S,{input:e});p(`Customer created: ${t.createCustomer.name}`),s(n,t.createCustomer);}catch(e){a(e);}}),r.command("update").description("Update a customer").argument("<id>","Customer ID").option("--name <name>","Customer name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--company <company>","Company").option("--type <t>","Customer type").option("--tax-id <s>","Tax ID").option("--business-license <s>","Business license").option("--rating <n>","Rating",f).option("--address <json>","Address JSON").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.name&&(t.name=e.name),e.email!==void 0&&(t.email=e.email),e.phone!==void 0&&(t.phone=e.phone),e.company!==void 0&&(t.company=e.company),e.type&&(t.type=e.type),e.taxId!==void 0&&(t.taxId=e.taxId),e.businessLicense!==void 0&&(t.businessLicense=e.businessLicense),e.rating!==void 0&&(t.rating=e.rating),e.address&&(t.address=l("address",e.address)),!Object.keys(t).length)throw new m("No updates specified");let i=await o(A,{id:n,input:t});p("Customer updated"),s(e,i.updateCustomer);}catch(t){a(t);}}),r.command("remove").description("Delete a customer").argument("<id>","Customer ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(x,{id:n});p(`Customer ${n} deleted`),s(e,{deleted:t.deleteCustomer});}catch(t){a(t);}});}function st(c){let r=c.command("drivers").description("Movethewheels drivers");r.command("list").description("List drivers").option("--status <s>","Filter by driver status").option("--vehicle <id>","Filter by vehicle ID").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.status&&(e.status=n.status.toUpperCase()),n.vehicle&&(e.vehicleId=n.vehicle),n.query&&(e.search=n.query);let t=await o($,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.drivers,{headers:["ID","Name","Employee","Status","Vehicle","Rating"],rows:t.drivers.map(i=>[g(i.id,12),`${i.firstName} ${i.lastName}`,i.employeeId,i.status,i.vehicleId?g(i.vehicleId,12):"-",i.rating!=null?String(i.rating):"-"])});}catch(e){a(e);}}),r.command("get").description("Get a driver by id").argument("<id>","Driver ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(N,{id:n});if(!t.driver)throw new m(`Driver ${n} not found`);s(e,t.driver);}catch(t){a(t);}}),r.command("create").description("Create a driver").requiredOption("--employee-id <s>","Employee ID").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--status <s>","Driver status","AVAILABLE").option("--license-number <s>","License number").option("--license-class <s>","License class").option("--license-expiry <s>","License expiry (ISO date)").option("--vehicle-id <id>","Vehicle ID").option("--user-id <id>","User ID").option("--rating <n>","Rating",f).option("--certifications <json>","Certifications JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async n=>{try{let e={employeeId:n.employeeId,firstName:n.firstName,lastName:n.lastName,status:(n.status??"AVAILABLE").toUpperCase()};n.email&&(e.email=n.email),n.phone&&(e.phone=n.phone),n.licenseNumber&&(e.licenseNumber=n.licenseNumber),n.licenseClass&&(e.licenseClass=n.licenseClass),n.licenseExpiry&&(e.licenseExpiry=n.licenseExpiry),n.vehicleId&&(e.vehicleId=n.vehicleId),n.userId&&(e.userId=n.userId),n.rating!==void 0&&(e.rating=n.rating),n.certifications&&(e.certifications=l("certifications",n.certifications)),n.currentLocation&&(e.currentLocation=l("current-location",n.currentLocation));let t=await o(P,{input:e});p(`Driver created: ${t.createDriver.firstName} ${t.createDriver.lastName}`),s(n,t.createDriver);}catch(e){a(e);}}),r.command("update").description("Update a driver").argument("<id>","Driver ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--status <s>","Driver status").option("--license-number <s>","License number").option("--license-class <s>","License class").option("--license-expiry <s>","License expiry (ISO date)").option("--vehicle-id <id>","Vehicle ID").option("--rating <n>","Rating",f).option("--certifications <json>","Certifications JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.firstName&&(t.firstName=e.firstName),e.lastName&&(t.lastName=e.lastName),e.email!==void 0&&(t.email=e.email),e.phone!==void 0&&(t.phone=e.phone),e.status&&(t.status=e.status.toUpperCase()),e.licenseNumber!==void 0&&(t.licenseNumber=e.licenseNumber),e.licenseClass!==void 0&&(t.licenseClass=e.licenseClass),e.licenseExpiry&&(t.licenseExpiry=e.licenseExpiry),e.vehicleId!==void 0&&(t.vehicleId=e.vehicleId),e.rating!==void 0&&(t.rating=e.rating),e.certifications&&(t.certifications=l("certifications",e.certifications)),e.currentLocation&&(t.currentLocation=l("current-location",e.currentLocation)),!Object.keys(t).length)throw new m("No updates specified");let i=await o(_,{id:n,input:t});p("Driver updated"),s(e,i.updateDriver);}catch(t){a(t);}}),r.command("remove").description("Delete a driver").argument("<id>","Driver ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(L,{id:n});p(`Driver ${n} deleted`),s(e,{deleted:t.deleteDriver});}catch(t){a(t);}}),r.command("set-status").description("Update a driver status").argument("<id>","Driver ID").requiredOption("--status <s>","AVAILABLE|ON_DELIVERY|ON_BREAK|OFF_DUTY|INACTIVE").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(M,{id:n,status:e.status.toUpperCase()});p(`Driver status set to ${t.updateDriverStatus.status}`),s(e,t.updateDriverStatus);}catch(t){a(t);}}),r.command("assign-vehicle").description("Assign (or clear) a vehicle for a driver").argument("<id>","Driver ID").option("--vehicle <id>","Vehicle ID (omit to clear assignment)").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(U,{id:n,vehicleId:e.vehicle});p(e.vehicle?`Vehicle ${e.vehicle} assigned`:"Vehicle assignment cleared"),s(e,t.assignDriverVehicle);}catch(t){a(t);}});}function ct(c){let r=c.command("vehicles").description("Movethewheels fleet vehicles");r.command("list").description("List vehicles").option("--type <t>","Filter by vehicle type").option("--status <s>","Filter by vehicle status").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.type&&(e.type=n.type.toUpperCase()),n.status&&(e.status=n.status.toUpperCase()),n.query&&(e.search=n.query);let t=await o(V,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.vehicles,{headers:["ID","Number","Type","Status","Make/Model","Plate"],rows:t.vehicles.map(i=>[g(i.id,12),i.vehicleNumber,i.type,i.status,`${i.make??"-"} ${i.model??""}`.trim(),i.licensePlate??"-"])});}catch(e){a(e);}}),r.command("get").description("Get a vehicle by id").argument("<id>","Vehicle ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(q,{id:n});if(!t.vehicle)throw new m(`Vehicle ${n} not found`);s(e,t.vehicle);}catch(t){a(t);}}),r.command("create").description("Create a vehicle").requiredOption("--number <s>","Vehicle number").requiredOption("--type <t>","Vehicle type (TRUCK|VAN|MOTORCYCLE|\u2026)").option("--status <s>","Vehicle status","ACTIVE").option("--make <s>","Make").option("--model <s>","Model").option("--year <n>","Year",u).option("--license-plate <s>","License plate").option("--fuel-level <n>","Fuel level",f).option("--mileage <n>","Mileage",f).option("--ownership-type <s>","Ownership type").option("--capacity <json>","Capacity JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async n=>{try{let e={vehicleNumber:n.number,type:n.type.toUpperCase(),status:(n.status??"ACTIVE").toUpperCase()};n.make&&(e.make=n.make),n.model&&(e.model=n.model),n.year!==void 0&&(e.year=n.year),n.licensePlate&&(e.licensePlate=n.licensePlate),n.fuelLevel!==void 0&&(e.fuelLevel=n.fuelLevel),n.mileage!==void 0&&(e.mileage=n.mileage),n.ownershipType&&(e.ownershipType=n.ownershipType),n.capacity&&(e.capacity=l("capacity",n.capacity)),n.currentLocation&&(e.currentLocation=l("current-location",n.currentLocation));let t=await o(F,{input:e});p(`Vehicle created: ${t.createVehicle.vehicleNumber}`),s(n,t.createVehicle);}catch(e){a(e);}}),r.command("update").description("Update a vehicle").argument("<id>","Vehicle ID").option("--number <s>","Vehicle number").option("--type <t>","Vehicle type").option("--status <s>","Vehicle status").option("--make <s>","Make").option("--model <s>","Model").option("--year <n>","Year",u).option("--license-plate <s>","License plate").option("--fuel-level <n>","Fuel level",f).option("--mileage <n>","Mileage",f).option("--ownership-type <s>","Ownership type").option("--capacity <json>","Capacity JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.number&&(t.vehicleNumber=e.number),e.type&&(t.type=e.type.toUpperCase()),e.status&&(t.status=e.status.toUpperCase()),e.make!==void 0&&(t.make=e.make),e.model!==void 0&&(t.model=e.model),e.year!==void 0&&(t.year=e.year),e.licensePlate!==void 0&&(t.licensePlate=e.licensePlate),e.fuelLevel!==void 0&&(t.fuelLevel=e.fuelLevel),e.mileage!==void 0&&(t.mileage=e.mileage),e.ownershipType!==void 0&&(t.ownershipType=e.ownershipType),e.capacity&&(t.capacity=l("capacity",e.capacity)),e.currentLocation&&(t.currentLocation=l("current-location",e.currentLocation)),!Object.keys(t).length)throw new m("No updates specified");let i=await o(W,{id:n,input:t});p("Vehicle updated"),s(e,i.updateVehicle);}catch(t){a(t);}}),r.command("remove").description("Delete a vehicle").argument("<id>","Vehicle ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(j,{id:n});p(`Vehicle ${n} deleted`),s(e,{deleted:t.deleteVehicle});}catch(t){a(t);}}),r.command("set-status").description("Update a vehicle status").argument("<id>","Vehicle ID").requiredOption("--status <s>","ACTIVE|INACTIVE|IN_TRANSIT|MAINTENANCE|DECOMMISSIONED").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(G,{id:n,status:e.status.toUpperCase()});p(`Vehicle status set to ${t.updateVehicleStatus.status}`),s(e,t.updateVehicleStatus);}catch(t){a(t);}}),r.command("set-location").description("Update a vehicle current location").argument("<id>","Vehicle ID").requiredOption("--location <json>","Location JSON (latitude/longitude/\u2026)").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=l("location",e.location),i=await o(H,{id:n,location:t});p("Vehicle location updated"),s(e,i.updateVehicleLocation);}catch(t){a(t);}});}function dt(c){let r=c.command("products").description("Movethewheels catalog products");r.command("list").description("List products").option("--category <c>","Filter by category").option("--sku <s>","Filter by SKU").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.category&&(e.category=n.category),n.sku&&(e.sku=n.sku),n.query&&(e.search=n.query);let t=await o(z,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.products,{headers:["ID","SKU","Name","Category","Brand","Weight"],rows:t.products.map(i=>[g(i.id,12),i.sku,i.name,i.category??"-",i.brand??"-",i.weight!=null?String(i.weight):"-"])});}catch(e){a(e);}}),r.command("get").description("Get a product by id").argument("<id>","Product ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(J,{id:n});if(!t.product)throw new m(`Product ${n} not found`);s(e,t.product);}catch(t){a(t);}}),r.command("create").description("Create a product").requiredOption("--name <name>","Product name").requiredOption("--sku <sku>","SKU").option("--description <s>","Description").option("--category <c>","Category").option("--brand <s>","Brand").option("--weight <n>","Weight",f).option("--value <n>","Value",f).option("--dimensions <json>","Dimensions JSON").option("--fragile","Mark as fragile").option("--hazardous","Mark as hazardous").option("--temperature-controlled","Mark as temperature controlled").option("-f, --format <format>","Output format").action(async n=>{try{let e={name:n.name,sku:n.sku};n.description&&(e.description=n.description),n.category&&(e.category=n.category),n.brand&&(e.brand=n.brand),n.weight!==void 0&&(e.weight=n.weight),n.value!==void 0&&(e.value=n.value),n.dimensions&&(e.dimensions=l("dimensions",n.dimensions)),n.fragile&&(e.fragile=!0),n.hazardous&&(e.hazardous=!0),n.temperatureControlled&&(e.temperatureControlled=!0);let t=await o(Y,{input:e});p(`Product created: ${t.createProduct.name}`),s(n,t.createProduct);}catch(e){a(e);}}),r.command("update").description("Update a product").argument("<id>","Product ID").option("--name <name>","Product name").option("--sku <sku>","SKU").option("--description <s>","Description").option("--category <c>","Category").option("--brand <s>","Brand").option("--weight <n>","Weight",f).option("--value <n>","Value",f).option("--dimensions <json>","Dimensions JSON").option("--fragile <bool>","true|false",n=>n==="true").option("--hazardous <bool>","true|false",n=>n==="true").option("--temperature-controlled <bool>","true|false",n=>n==="true").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.name&&(t.name=e.name),e.sku&&(t.sku=e.sku),e.description!==void 0&&(t.description=e.description),e.category!==void 0&&(t.category=e.category),e.brand!==void 0&&(t.brand=e.brand),e.weight!==void 0&&(t.weight=e.weight),e.value!==void 0&&(t.value=e.value),e.dimensions&&(t.dimensions=l("dimensions",e.dimensions)),e.fragile!==void 0&&(t.fragile=e.fragile),e.hazardous!==void 0&&(t.hazardous=e.hazardous),e.temperatureControlled!==void 0&&(t.temperatureControlled=e.temperatureControlled),!Object.keys(t).length)throw new m("No updates specified");let i=await o(B,{id:n,input:t});p("Product updated"),s(e,i.updateProduct);}catch(t){a(t);}}),r.command("remove").description("Delete a product").argument("<id>","Product ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(K,{id:n});p(`Product ${n} deleted`),s(e,{deleted:t.deleteProduct});}catch(t){a(t);}});}function ut(c){let r=c.command("warehouses").description("Movethewheels warehouses & locations");r.command("list").description("List warehouses").option("--type <t>","Filter by warehouse type").option("--status <s>","Filter by status").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.type&&(e.type=n.type.toUpperCase()),n.status&&(e.status=n.status),n.query&&(e.search=n.query);let t=await o(X,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.warehouses,{headers:["ID","Code","Name","Type","Status","Capacity"],rows:t.warehouses.map(i=>[g(i.id,12),i.code,i.name,i.type,i.status,`${i.usedCapacity??0}/${i.totalCapacity??0}`])});}catch(e){a(e);}}),r.command("get").description("Get a warehouse by id (includes locations)").argument("<id>","Warehouse ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(Q,{id:n});if(!t.warehouse)throw new m(`Warehouse ${n} not found`);s(e,t.warehouse);}catch(t){a(t);}}),r.command("create").description("Create a warehouse").requiredOption("--code <code>","Warehouse code").requiredOption("--name <name>","Warehouse name").requiredOption("--type <t>","Warehouse type (DISTRIBUTION|FULFILLMENT|\u2026)").requiredOption("--address <json>","Address JSON").option("--status <s>","Status","ACTIVE").option("--contact-info <json>","Contact info JSON").option("--operating-hours <json>","Operating hours JSON").option("--capabilities <json>","Capabilities JSON").option("--total-capacity <n>","Total capacity",f).option("--used-capacity <n>","Used capacity",f).option("-f, --format <format>","Output format").action(async n=>{try{let e={code:n.code,name:n.name,type:n.type.toUpperCase(),address:l("address",n.address),status:n.status??"ACTIVE"};n.contactInfo&&(e.contactInfo=l("contact-info",n.contactInfo)),n.operatingHours&&(e.operatingHours=l("operating-hours",n.operatingHours)),n.capabilities&&(e.capabilities=l("capabilities",n.capabilities)),n.totalCapacity!==void 0&&(e.totalCapacity=n.totalCapacity),n.usedCapacity!==void 0&&(e.usedCapacity=n.usedCapacity);let t=await o(Z,{input:e});p(`Warehouse created: ${t.createWarehouse.name}`),s(n,t.createWarehouse);}catch(e){a(e);}}),r.command("update").description("Update a warehouse").argument("<id>","Warehouse ID").option("--code <code>","Warehouse code").option("--name <name>","Warehouse name").option("--type <t>","Warehouse type").option("--status <s>","Status").option("--address <json>","Address JSON").option("--contact-info <json>","Contact info JSON").option("--operating-hours <json>","Operating hours JSON").option("--capabilities <json>","Capabilities JSON").option("--total-capacity <n>","Total capacity",f).option("--used-capacity <n>","Used capacity",f).option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.code&&(t.code=e.code),e.name&&(t.name=e.name),e.type&&(t.type=e.type.toUpperCase()),e.status&&(t.status=e.status),e.address&&(t.address=l("address",e.address)),e.contactInfo&&(t.contactInfo=l("contact-info",e.contactInfo)),e.operatingHours&&(t.operatingHours=l("operating-hours",e.operatingHours)),e.capabilities&&(t.capabilities=l("capabilities",e.capabilities)),e.totalCapacity!==void 0&&(t.totalCapacity=e.totalCapacity),e.usedCapacity!==void 0&&(t.usedCapacity=e.usedCapacity),!Object.keys(t).length)throw new m("No updates specified");let i=await o(ee,{id:n,input:t});p("Warehouse updated"),s(e,i.updateWarehouse);}catch(t){a(t);}}),r.command("remove").description("Delete a warehouse").argument("<id>","Warehouse ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(te,{id:n});p(`Warehouse ${n} deleted`),s(e,{deleted:t.deleteWarehouse});}catch(t){a(t);}}),r.command("create-location").description("Create a warehouse location").requiredOption("--warehouse <id>","Warehouse ID").requiredOption("--code <s>","Location code").option("--location-type <s>","Location type").option("--status <s>","Status","ACTIVE").option("--zone <s>","Zone").option("--aisle <s>","Aisle").option("--rack <s>","Rack").option("--shelf <s>","Shelf").option("--bin <s>","Bin").option("--capacity <n>","Capacity",f).option("-f, --format <format>","Output format").action(async n=>{try{let e={warehouseId:n.warehouse,locationCode:n.code,status:n.status??"ACTIVE"};n.locationType&&(e.locationType=n.locationType),n.zone&&(e.zone=n.zone),n.aisle&&(e.aisle=n.aisle),n.rack&&(e.rack=n.rack),n.shelf&&(e.shelf=n.shelf),n.bin&&(e.bin=n.bin),n.capacity!==void 0&&(e.capacity=n.capacity);let t=await o(ne,{input:e});p(`Location created: ${t.createWarehouseLocation.locationCode}`),s(n,t.createWarehouseLocation);}catch(e){a(e);}}),r.command("update-location").description("Update a warehouse location").argument("<id>","Location ID").option("--code <s>","Location code").option("--location-type <s>","Location type").option("--status <s>","Status").option("--zone <s>","Zone").option("--aisle <s>","Aisle").option("--rack <s>","Rack").option("--shelf <s>","Shelf").option("--bin <s>","Bin").option("--capacity <n>","Capacity",f).option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.code&&(t.locationCode=e.code),e.locationType!==void 0&&(t.locationType=e.locationType),e.status&&(t.status=e.status),e.zone!==void 0&&(t.zone=e.zone),e.aisle!==void 0&&(t.aisle=e.aisle),e.rack!==void 0&&(t.rack=e.rack),e.shelf!==void 0&&(t.shelf=e.shelf),e.bin!==void 0&&(t.bin=e.bin),e.capacity!==void 0&&(t.capacity=e.capacity),!Object.keys(t).length)throw new m("No updates specified");let i=await o(ie,{id:n,input:t});p("Location updated"),s(e,i.updateWarehouseLocation);}catch(t){a(t);}});}function pt(c){let r={};return c.product&&(r.productId=c.product),c.warehouse&&(r.warehouseId=c.warehouse),c.location&&(r.locationId=c.location),c.query&&(r.search=c.query),Object.keys(r).length?r:void 0}function lt(c){let r=c.command("inventory").description("Movethewheels inventory");r.command("list").description("List inventory items").option("--product <id>","Filter by product ID").option("--warehouse <id>","Filter by warehouse ID").option("--location <id>","Filter by location ID").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(oe,{filter:pt(n),pagination:h(n)});s(n,e.inventoryItems,{headers:["ID","Product","Warehouse","OnHand","Available","Allocated"],rows:e.inventoryItems.map(t=>[g(t.id,12),g(t.productId,12),g(t.warehouseId,12),String(t.onHand),String(t.available),String(t.allocated)])});}catch(e){a(e);}}),r.command("get").description("Get an inventory item by id").argument("<id>","Inventory item ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(re,{id:n});if(!t.inventoryItem)throw new m(`Inventory item ${n} not found`);s(e,t.inventoryItem);}catch(t){a(t);}}),r.command("stats").description("Inventory stats (on-hand, available, allocated, damaged, low-stock)").option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(se);s(n,e.inventoryStats);}catch(e){a(e);}}),r.command("create").description("Create an inventory item").requiredOption("--product <id>","Product ID").requiredOption("--warehouse <id>","Warehouse ID").option("--location <id>","Location ID").option("--on-hand <n>","On-hand quantity",u).option("--available <n>","Available quantity",u).option("--allocated <n>","Allocated quantity",u).option("--damaged <n>","Damaged quantity",u).option("--reorder-point <n>","Reorder point",u).option("--safety-stock <n>","Safety stock",u).option("--unit-cost <n>","Unit cost",f).option("-f, --format <format>","Output format").action(async n=>{try{let e={productId:n.product,warehouseId:n.warehouse};n.location&&(e.locationId=n.location),n.onHand!==void 0&&(e.onHand=n.onHand),n.available!==void 0&&(e.available=n.available),n.allocated!==void 0&&(e.allocated=n.allocated),n.damaged!==void 0&&(e.damaged=n.damaged),n.reorderPoint!==void 0&&(e.reorderPoint=n.reorderPoint),n.safetyStock!==void 0&&(e.safetyStock=n.safetyStock),n.unitCost!==void 0&&(e.unitCost=n.unitCost);let t=await o(ce,{input:e});p("Inventory item created"),s(n,t.createInventoryItem);}catch(e){a(e);}}),r.command("update").description("Update an inventory item").argument("<id>","Inventory item ID").option("--location <id>","Location ID").option("--on-hand <n>","On-hand quantity",u).option("--available <n>","Available quantity",u).option("--allocated <n>","Allocated quantity",u).option("--damaged <n>","Damaged quantity",u).option("--reorder-point <n>","Reorder point",u).option("--safety-stock <n>","Safety stock",u).option("--unit-cost <n>","Unit cost",f).option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.location!==void 0&&(t.locationId=e.location),e.onHand!==void 0&&(t.onHand=e.onHand),e.available!==void 0&&(t.available=e.available),e.allocated!==void 0&&(t.allocated=e.allocated),e.damaged!==void 0&&(t.damaged=e.damaged),e.reorderPoint!==void 0&&(t.reorderPoint=e.reorderPoint),e.safetyStock!==void 0&&(t.safetyStock=e.safetyStock),e.unitCost!==void 0&&(t.unitCost=e.unitCost),!Object.keys(t).length)throw new m("No updates specified");let i=await o(de,{id:n,input:t});p("Inventory item updated"),s(e,i.updateInventoryItem);}catch(t){a(t);}}),r.command("remove").description("Delete an inventory item").argument("<id>","Inventory item ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(ue,{id:n});p(`Inventory item ${n} deleted`),s(e,{deleted:t.deleteInventoryItem});}catch(t){a(t);}}),r.command("adjust").description("Adjust inventory stock levels").argument("<id>","Inventory item ID").option("--on-hand <n>","On-hand quantity",u).option("--available <n>","Available quantity",u).option("--allocated <n>","Allocated quantity",u).option("--damaged <n>","Damaged quantity",u).option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={id:n};if(e.onHand!==void 0&&(t.onHand=e.onHand),e.available!==void 0&&(t.available=e.available),e.allocated!==void 0&&(t.allocated=e.allocated),e.damaged!==void 0&&(t.damaged=e.damaged),Object.keys(t).length===1)throw new m("No stock adjustments specified");let i=await o(pe,{input:t});p("Inventory stock adjusted"),s(e,i.adjustInventoryStock);}catch(t){a(t);}}),r.command("transactions").description("List inventory transactions").option("--product <id>","Filter by product ID").option("--warehouse <id>","Filter by warehouse ID").option("--location <id>","Filter by location ID").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(ae,{filter:pt(n),pagination:h(n)});s(n,e.inventoryTransactions,{headers:["ID","Number","Type","Product","Warehouse","Qty"],rows:e.inventoryTransactions.map(t=>[g(t.id,12),t.transactionNumber,t.type,g(t.productId,12),g(t.warehouseId,12),String(t.quantity)])});}catch(e){a(e);}}),r.command("record-transaction").description("Record an inventory transaction").requiredOption("--number <s>","Transaction number").requiredOption("--type <t>","Transaction type (RECEIPT|ISSUE|TRANSFER|ADJUSTMENT|RETURN)").requiredOption("--product <id>","Product ID").requiredOption("--warehouse <id>","Warehouse ID").requiredOption("--quantity <n>","Quantity",u).option("--inventory-item <id>","Inventory item ID").option("--unit-cost <n>","Unit cost",f).option("--reference-type <s>","Reference type").option("--reference-id <s>","Reference ID").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async n=>{try{let e={transactionNumber:n.number,type:n.type.toUpperCase(),productId:n.product,warehouseId:n.warehouse,quantity:n.quantity};n.inventoryItem&&(e.inventoryItemId=n.inventoryItem),n.unitCost!==void 0&&(e.unitCost=n.unitCost),n.referenceType&&(e.referenceType=n.referenceType),n.referenceId&&(e.referenceId=n.referenceId),n.notes&&(e.notes=n.notes);let t=await o(le,{input:e});p(`Transaction recorded: ${t.createInventoryTransaction.transactionNumber}`),s(n,t.createInventoryTransaction);}catch(e){a(e);}});}function mt(c){let r=c.command("orders").description("Movethewheels delivery orders");r.command("list").description("List orders").option("--customer <id>","Filter by customer ID").option("--driver <id>","Filter by driver ID").option("--vehicle <id>","Filter by vehicle ID").option("--status <s>","Filter by order status").option("--order-type <t>","Filter by order type").option("--priority <p>","Filter by priority").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.customer&&(e.customerId=n.customer),n.driver&&(e.driverId=n.driver),n.vehicle&&(e.vehicleId=n.vehicle),n.status&&(e.status=n.status.toUpperCase()),n.orderType&&(e.orderType=n.orderType.toUpperCase()),n.priority&&(e.priority=n.priority.toUpperCase()),n.query&&(e.search=n.query);let t=await o(fe,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.movethewheelsOrders,{headers:["ID","Order #","Type","Status","Priority","Tracking"],rows:t.movethewheelsOrders.map(i=>[g(i.id,12),i.orderNumber,i.orderType,i.status,i.priority,i.trackingNumber??"-"])});}catch(e){a(e);}}),r.command("get").description("Get an order by id").argument("<id>","Order ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(me,{id:n});if(!t.movethewheelsOrder)throw new m(`Order ${n} not found`);s(e,t.movethewheelsOrder);}catch(t){a(t);}}),r.command("create").description("Create an order").requiredOption("--customer <id>","Customer ID").requiredOption("--order-number <s>","Order number").requiredOption("--pickup-address <json>","Pickup address JSON").requiredOption("--delivery-address <json>","Delivery address JSON").requiredOption("--items <json>","Items JSON").option("--order-type <t>","Order type","B2C").option("--priority <p>","Priority","MEDIUM").option("--status <s>","Status","PENDING").option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--tracking-number <s>","Tracking number").option("--scheduled-delivery <s>","Scheduled delivery (ISO date)").option("--special-instructions <s>","Special instructions").option("--pricing <json>","Pricing JSON").option("-f, --format <format>","Output format").action(async n=>{try{let e={customerId:n.customer,orderNumber:n.orderNumber,pickupAddress:l("pickup-address",n.pickupAddress),deliveryAddress:l("delivery-address",n.deliveryAddress),items:l("items",n.items),orderType:(n.orderType??"B2C").toUpperCase(),priority:(n.priority??"MEDIUM").toUpperCase(),status:(n.status??"PENDING").toUpperCase()};n.driver&&(e.driverId=n.driver),n.vehicle&&(e.vehicleId=n.vehicle),n.trackingNumber&&(e.trackingNumber=n.trackingNumber),n.scheduledDelivery&&(e.scheduledDelivery=n.scheduledDelivery),n.specialInstructions&&(e.specialInstructions=n.specialInstructions),n.pricing&&(e.pricing=l("pricing",n.pricing));let t=await o(ge,{input:e});p(`Order created: ${t.createMovethewheelsOrder.orderNumber}`),s(n,t.createMovethewheelsOrder);}catch(e){a(e);}}),r.command("update").description("Update an order").argument("<id>","Order ID").option("--customer <id>","Customer ID").option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--order-type <t>","Order type").option("--priority <p>","Priority").option("--status <s>","Status").option("--tracking-number <s>","Tracking number").option("--scheduled-delivery <s>","Scheduled delivery (ISO date)").option("--special-instructions <s>","Special instructions").option("--delivery-address <json>","Delivery address JSON").option("--pickup-address <json>","Pickup address JSON").option("--items <json>","Items JSON").option("--pricing <json>","Pricing JSON").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.customer&&(t.customerId=e.customer),e.driver!==void 0&&(t.driverId=e.driver),e.vehicle!==void 0&&(t.vehicleId=e.vehicle),e.orderType&&(t.orderType=e.orderType.toUpperCase()),e.priority&&(t.priority=e.priority.toUpperCase()),e.status&&(t.status=e.status.toUpperCase()),e.trackingNumber!==void 0&&(t.trackingNumber=e.trackingNumber),e.scheduledDelivery&&(t.scheduledDelivery=e.scheduledDelivery),e.specialInstructions!==void 0&&(t.specialInstructions=e.specialInstructions),e.deliveryAddress&&(t.deliveryAddress=l("delivery-address",e.deliveryAddress)),e.pickupAddress&&(t.pickupAddress=l("pickup-address",e.pickupAddress)),e.items&&(t.items=l("items",e.items)),e.pricing&&(t.pricing=l("pricing",e.pricing)),!Object.keys(t).length)throw new m("No updates specified");let i=await o(he,{id:n,input:t});p("Order updated"),s(e,i.updateMovethewheelsOrder);}catch(t){a(t);}}),r.command("remove").description("Delete an order").argument("<id>","Order ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(ye,{id:n});p(`Order ${n} deleted`),s(e,{deleted:t.deleteMovethewheelsOrder});}catch(t){a(t);}}),r.command("set-status").description("Update an order status").argument("<id>","Order ID").requiredOption("--status <s>","PENDING|CONFIRMED|ASSIGNED|PICKED_UP|IN_TRANSIT|OUT_FOR_DELIVERY|DELIVERED|FAILED|RETURNED|CANCELLED").option("--notes <s>","Status notes").option("--location <json>","Location JSON").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={status:e.status.toUpperCase()};e.notes&&(t.notes=e.notes),e.location&&(t.location=l("location",e.location));let i=await o(ve,{id:n,input:t});p(`Order status set to ${i.updateMovethewheelsOrderStatus.status}`),s(e,i.updateMovethewheelsOrderStatus);}catch(t){a(t);}}),r.command("stats").description("Order stats (total, pending, in-transit, delivered, \u2026)").option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(Ie);s(n,e.orderStats);}catch(e){a(e);}});}function ft(c){let r=c.command("shipments").description("Movethewheels shipments & tracking");r.command("list").description("List shipments").option("--order <id>","Filter by order ID").option("--customer <id>","Filter by customer ID").option("--carrier <id>","Filter by carrier ID").option("--status <s>","Filter by status").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.order&&(e.orderId=n.order),n.customer&&(e.customerId=n.customer),n.carrier&&(e.carrierId=n.carrier),n.status&&(e.status=n.status.toUpperCase()),n.query&&(e.search=n.query);let t=await o(Ee,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.shipments,{headers:["ID","Shipment #","Order","Status","Tracking"],rows:t.shipments.map(i=>[g(i.id,12),i.shipmentNumber,g(i.orderId,12),i.status,i.trackingNumber??"-"])});}catch(e){a(e);}}),r.command("get").description("Get a shipment by id (includes tracking events)").argument("<id>","Shipment ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(we,{id:n});if(!t.shipment)throw new m(`Shipment ${n} not found`);s(e,t.shipment);}catch(t){a(t);}}),r.command("active").description("List active deliveries (in-transit shipments)").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(Ce,{pagination:h(n)});s(n,e.activeDeliveries,{headers:["ID","Shipment #","Order","Status","Tracking"],rows:e.activeDeliveries.map(t=>[g(t.id,12),t.shipmentNumber,g(t.orderId,12),t.status,t.trackingNumber??"-"])});}catch(e){a(e);}}),r.command("create").description("Create a shipment").requiredOption("--shipment-number <s>","Shipment number").requiredOption("--order <id>","Order ID").requiredOption("--origin <json>","Origin JSON").requiredOption("--destination <json>","Destination JSON").option("--status <s>","Status","PLANNED").option("--customer <id>","Customer ID").option("--carrier <id>","Carrier ID").option("--tracking-number <s>","Tracking number").option("--cargo-details <json>","Cargo details JSON").option("--estimated-delivery <s>","Estimated delivery (ISO date)").option("--actual-delivery <s>","Actual delivery (ISO date)").option("-f, --format <format>","Output format").action(async n=>{try{let e={shipmentNumber:n.shipmentNumber,orderId:n.order,origin:l("origin",n.origin),destination:l("destination",n.destination),status:(n.status??"PLANNED").toUpperCase()};n.customer&&(e.customerId=n.customer),n.carrier&&(e.carrierId=n.carrier),n.trackingNumber&&(e.trackingNumber=n.trackingNumber),n.cargoDetails&&(e.cargoDetails=l("cargo-details",n.cargoDetails)),n.estimatedDelivery&&(e.estimatedDelivery=n.estimatedDelivery),n.actualDelivery&&(e.actualDelivery=n.actualDelivery);let t=await o(De,{input:e});p(`Shipment created: ${t.createShipment.shipmentNumber}`),s(n,t.createShipment);}catch(e){a(e);}}),r.command("update").description("Update a shipment").argument("<id>","Shipment ID").option("--status <s>","Status").option("--customer <id>","Customer ID").option("--carrier <id>","Carrier ID").option("--tracking-number <s>","Tracking number").option("--origin <json>","Origin JSON").option("--destination <json>","Destination JSON").option("--cargo-details <json>","Cargo details JSON").option("--estimated-delivery <s>","Estimated delivery (ISO date)").option("--actual-delivery <s>","Actual delivery (ISO date)").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.status&&(t.status=e.status.toUpperCase()),e.customer!==void 0&&(t.customerId=e.customer),e.carrier!==void 0&&(t.carrierId=e.carrier),e.trackingNumber!==void 0&&(t.trackingNumber=e.trackingNumber),e.origin&&(t.origin=l("origin",e.origin)),e.destination&&(t.destination=l("destination",e.destination)),e.cargoDetails&&(t.cargoDetails=l("cargo-details",e.cargoDetails)),e.estimatedDelivery&&(t.estimatedDelivery=e.estimatedDelivery),e.actualDelivery&&(t.actualDelivery=e.actualDelivery),!Object.keys(t).length)throw new m("No updates specified");let i=await o(Re,{id:n,input:t});p("Shipment updated"),s(e,i.updateShipment);}catch(t){a(t);}}),r.command("remove").description("Delete a shipment").argument("<id>","Shipment ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(ke,{id:n});p(`Shipment ${n} deleted`),s(e,{deleted:t.deleteShipment});}catch(t){a(t);}}),r.command("add-event").description("Add a tracking event to a shipment").requiredOption("--shipment <id>","Shipment ID").requiredOption("--event-type <t>","CREATED|PICKED_UP|IN_TRANSIT|ARRIVED|DEPARTED|OUT_FOR_DELIVERY|DELIVERED|FAILED|RETURNED").option("--details <s>","Event details").option("--location <json>","Location JSON").option("--timestamp <s>","Timestamp (ISO date)").option("-f, --format <format>","Output format").action(async n=>{try{let e={shipmentId:n.shipment,eventType:n.eventType.toUpperCase()};n.details&&(e.details=n.details),n.location&&(e.location=l("location",n.location)),n.timestamp&&(e.timestamp=n.timestamp);let t=await o(Se,{input:e});p(`Tracking event added: ${t.addTrackingEvent.eventType}`),s(n,t.addTrackingEvent);}catch(e){a(e);}}),r.command("tracking").description("List tracking events for a shipment").argument("<shipmentId>","Shipment ID").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(be,{shipmentId:n,pagination:h(e)});s(e,t.shipmentTracking,{headers:["ID","Event","Details","Timestamp"],rows:t.shipmentTracking.map(i=>[g(i.id,12),i.eventType,g(i.details??"-",30),i.timestamp])});}catch(t){a(t);}}),r.command("order-tracking").description("List tracking events for an order").argument("<orderId>","Order ID").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(Oe,{orderId:n,pagination:h(e)});s(e,t.orderTracking,{headers:["ID","Event","Details","Timestamp"],rows:t.orderTracking.map(i=>[g(i.id,12),i.eventType,g(i.details??"-",30),i.timestamp])});}catch(t){a(t);}}),r.command("alerts").description("List tracking alerts (delayed / at-risk shipments)").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(Te,{pagination:h(n)});s(n,e.trackingAlerts,{headers:["Type","Shipment #","Message"],rows:e.trackingAlerts.map(t=>[t.alertType,t.shipmentNumber,g(t.message,40)])});}catch(e){a(e);}});}function gt(c){let r=c.command("routes").description("Movethewheels delivery routes");r.command("list").description("List routes").option("--driver <id>","Filter by driver ID").option("--vehicle <id>","Filter by vehicle ID").option("--shipment <id>","Filter by shipment ID").option("--status <s>","Filter by status").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async n=>{try{let e={};n.driver&&(e.driverId=n.driver),n.vehicle&&(e.vehicleId=n.vehicle),n.shipment&&(e.shipmentId=n.shipment),n.status&&(e.status=n.status.toUpperCase()),n.query&&(e.search=n.query);let t=await o(xe,{filter:Object.keys(e).length?e:void 0,pagination:h(n)});s(n,t.routes,{headers:["ID","Name","Status","Driver","Vehicle","Distance"],rows:t.routes.map(i=>[g(i.id,12),i.name,i.status,i.driverId?g(i.driverId,12):"-",i.vehicleId?g(i.vehicleId,12):"-",i.estimatedDistance!=null?String(i.estimatedDistance):"-"])});}catch(e){a(e);}}),r.command("get").description("Get a route by id").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(Ae,{id:n});if(!t.route)throw new m(`Route ${n} not found`);s(e,t.route);}catch(t){a(t);}}),r.command("create").description("Create a route").requiredOption("--name <name>","Route name").requiredOption("--waypoints <json>","Waypoints JSON").option("--status <s>","Status","PLANNED").option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--shipment <id>","Shipment ID").option("--estimated-distance <n>","Estimated distance",f).option("--estimated-duration <n>","Estimated duration",f).option("--actual-distance <n>","Actual distance",f).option("--actual-duration <n>","Actual duration",f).option("--fuel-cost <n>","Fuel cost",f).option("-f, --format <format>","Output format").action(async n=>{try{let e={name:n.name,waypoints:l("waypoints",n.waypoints),status:(n.status??"PLANNED").toUpperCase()};n.driver&&(e.driverId=n.driver),n.vehicle&&(e.vehicleId=n.vehicle),n.shipment&&(e.shipmentId=n.shipment),n.estimatedDistance!==void 0&&(e.estimatedDistance=n.estimatedDistance),n.estimatedDuration!==void 0&&(e.estimatedDuration=n.estimatedDuration),n.actualDistance!==void 0&&(e.actualDistance=n.actualDistance),n.actualDuration!==void 0&&(e.actualDuration=n.actualDuration),n.fuelCost!==void 0&&(e.fuelCost=n.fuelCost);let t=await o(Ne,{input:e});p(`Route created: ${t.createRoute.name}`),s(n,t.createRoute);}catch(e){a(e);}}),r.command("update").description("Update a route").argument("<id>","Route ID").option("--name <name>","Route name").option("--status <s>","Status").option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--shipment <id>","Shipment ID").option("--waypoints <json>","Waypoints JSON").option("--estimated-distance <n>","Estimated distance",f).option("--estimated-duration <n>","Estimated duration",f).option("--actual-distance <n>","Actual distance",f).option("--actual-duration <n>","Actual duration",f).option("--fuel-cost <n>","Fuel cost",f).option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t={};if(e.name&&(t.name=e.name),e.status&&(t.status=e.status.toUpperCase()),e.driver!==void 0&&(t.driverId=e.driver),e.vehicle!==void 0&&(t.vehicleId=e.vehicle),e.shipment!==void 0&&(t.shipmentId=e.shipment),e.waypoints&&(t.waypoints=l("waypoints",e.waypoints)),e.estimatedDistance!==void 0&&(t.estimatedDistance=e.estimatedDistance),e.estimatedDuration!==void 0&&(t.estimatedDuration=e.estimatedDuration),e.actualDistance!==void 0&&(t.actualDistance=e.actualDistance),e.actualDuration!==void 0&&(t.actualDuration=e.actualDuration),e.fuelCost!==void 0&&(t.fuelCost=e.fuelCost),!Object.keys(t).length)throw new m("No updates specified");let i=await o($e,{id:n,input:t});p("Route updated"),s(e,i.updateRoute);}catch(t){a(t);}}),r.command("remove").description("Delete a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(Pe,{id:n});p(`Route ${n} deleted`),s(e,{deleted:t.deleteRoute});}catch(t){a(t);}}),r.command("optimize").description("Optimize a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(n,e)=>{try{let t=await o(_e,{id:n});p("Route optimized"),s(e,t.optimizeRoute);}catch(t){a(t);}});}function ht(c){let r=c.command("marketplace").description("Movethewheels logistics marketplace (providers & offerings)"),n=r.command("providers").description("Service providers");n.command("list").description("List service providers").option("--type <t>","Filter by provider type").option("--active <bool>","Filter by active state (true|false)",t=>t==="true").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async t=>{try{let i={};t.type&&(i.type=t.type),t.active!==void 0&&(i.isActive=t.active),t.query&&(i.search=t.query);let d=await o(Me,{filter:Object.keys(i).length?i:void 0,pagination:h(t)});s(t,d.serviceProviders,{headers:["ID","Name","Type","Active","Verified","Rating"],rows:d.serviceProviders.map(v=>[g(v.id,12),v.name,v.type,v.isActive?"yes":"no",v.isVerified?"yes":"no",v.rating!=null?String(v.rating):"-"])});}catch(i){a(i);}}),n.command("get").description("Get a service provider by id (includes offerings)").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let d=await o(Le,{id:t});if(!d.serviceProvider)throw new m(`Provider ${t} not found`);s(i,d.serviceProvider);}catch(d){a(d);}}),n.command("create").description("Create a service provider").requiredOption("--name <name>","Provider name").requiredOption("--type <t>","Provider type").option("--description <s>","Description").option("--rating <n>","Rating",f).option("--active <bool>","Active (true|false)",t=>t==="true",true).option("--verified <bool>","Verified (true|false)",t=>t==="true",false).option("--contact-info <json>","Contact info JSON").option("--services <json>","Services JSON").option("-f, --format <format>","Output format").action(async t=>{try{let i={name:t.name,type:t.type,isActive:t.active??!0,isVerified:t.verified??!1};t.description&&(i.description=t.description),t.rating!==void 0&&(i.rating=t.rating),t.contactInfo&&(i.contactInfo=l("contact-info",t.contactInfo)),t.services&&(i.services=l("services",t.services));let d=await o(Ue,{input:i});p(`Provider created: ${d.createServiceProvider.name}`),s(t,d.createServiceProvider);}catch(i){a(i);}}),n.command("update").description("Update a service provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--type <t>","Provider type").option("--description <s>","Description").option("--rating <n>","Rating",f).option("--active <bool>","Active (true|false)",t=>t==="true").option("--verified <bool>","Verified (true|false)",t=>t==="true").option("--contact-info <json>","Contact info JSON").option("--services <json>","Services JSON").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let d={};if(i.name&&(d.name=i.name),i.type&&(d.type=i.type),i.description!==void 0&&(d.description=i.description),i.rating!==void 0&&(d.rating=i.rating),i.active!==void 0&&(d.isActive=i.active),i.verified!==void 0&&(d.isVerified=i.verified),i.contactInfo&&(d.contactInfo=l("contact-info",i.contactInfo)),i.services&&(d.services=l("services",i.services)),!Object.keys(d).length)throw new m("No updates specified");let v=await o(qe,{id:t,input:d});p("Provider updated"),s(i,v.updateServiceProvider);}catch(d){a(d);}}),n.command("remove").description("Delete a service provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let d=await o(Ve,{id:t});p(`Provider ${t} deleted`),s(i,{deleted:d.deleteServiceProvider});}catch(d){a(d);}});let e=r.command("offerings").description("Service offerings");e.command("list").description("List service offerings").option("--provider <id>","Filter by provider ID").option("--category <c>","Filter by category").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async t=>{try{let i={};t.provider&&(i.providerId=t.provider),t.category&&(i.category=t.category),t.query&&(i.search=t.query);let d=await o(We,{filter:Object.keys(i).length?i:void 0,pagination:h(t)});s(t,d.serviceOfferings,{headers:["ID","Name","Provider","Category","Price","Currency"],rows:d.serviceOfferings.map(v=>[g(v.id,12),v.name,g(v.providerId,12),v.category??"-",String(v.price),v.currency])});}catch(i){a(i);}}),e.command("get").description("Get a service offering by id").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let d=await o(Fe,{id:t});if(!d.serviceOffering)throw new m(`Offering ${t} not found`);s(i,d.serviceOffering);}catch(d){a(d);}}),e.command("create").description("Create a service offering").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Offering name").requiredOption("--price <n>","Price",f).option("--description <s>","Description").option("--category <c>","Category").option("--currency <c>","Currency","USD").option("--availability <json>","Availability JSON").option("-f, --format <format>","Output format").action(async t=>{try{let i={providerId:t.provider,name:t.name,price:t.price,currency:t.currency??"USD"};t.description&&(i.description=t.description),t.category&&(i.category=t.category),t.availability&&(i.availability=l("availability",t.availability));let d=await o(je,{input:i});p(`Offering created: ${d.createServiceOffering.name}`),s(t,d.createServiceOffering);}catch(i){a(i);}}),e.command("update").description("Update a service offering").argument("<id>","Offering ID").option("--name <name>","Offering name").option("--description <s>","Description").option("--category <c>","Category").option("--price <n>","Price",f).option("--currency <c>","Currency").option("--availability <json>","Availability JSON").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let d={};if(i.name&&(d.name=i.name),i.description!==void 0&&(d.description=i.description),i.category!==void 0&&(d.category=i.category),i.price!==void 0&&(d.price=i.price),i.currency&&(d.currency=i.currency),i.availability&&(d.availability=l("availability",i.availability)),!Object.keys(d).length)throw new m("No updates specified");let v=await o(Ge,{id:t,input:d});p("Offering updated"),s(i,v.updateServiceOffering);}catch(d){a(d);}}),e.command("remove").description("Delete a service offering").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let d=await o(He,{id:t});p(`Offering ${t} deleted`),s(i,{deleted:d.deleteServiceOffering});}catch(d){a(d);}});}function yt(c){let r=c.command("reports").description("Movethewheels reports & data import/export");r.command("list").description("List reports").option("--type <t>","Filter by report type").option("--status <s>","Filter by status").option("--query <q>","Free-text search").option("--limit <n>","Page size",u,50).option("--offset <n>","Offset",u,0).option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.type&&(t.type=e.type),e.status&&(t.status=e.status),e.query&&(t.search=e.query);let i=await o(ze,{filter:Object.keys(t).length?t:void 0,pagination:h(e)});s(e,i.movethewheelsReports,{headers:["ID","Name","Type","Status","Schedule","Last Generated"],rows:i.movethewheelsReports.map(d=>[g(d.id,12),d.name,d.type,d.status,d.schedule??"-",d.lastGenerated??"-"])});}catch(t){a(t);}}),r.command("get").description("Get a report by id").argument("<id>","Report ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let i=await o(Je,{id:e});if(!i.movethewheelsReport)throw new m(`Report ${e} not found`);s(t,i.movethewheelsReport);}catch(i){a(i);}}),r.command("create").description("Create a report").requiredOption("--name <name>","Report name").requiredOption("--type <t>","Report type").option("--description <s>","Description").option("--status <s>","Status","DRAFT").option("--schedule <s>","Schedule (cron-like)").option("--configuration <json>","Configuration JSON").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,type:e.type,status:e.status??"DRAFT"};e.description&&(t.description=e.description),e.schedule&&(t.schedule=e.schedule),e.configuration&&(t.configuration=l("configuration",e.configuration));let i=await o(Ye,{input:t});p(`Report created: ${i.createMovethewheelsReport.name}`),s(e,i.createMovethewheelsReport);}catch(t){a(t);}}),r.command("update").description("Update a report").argument("<id>","Report ID").option("--name <name>","Report name").option("--type <t>","Report type").option("--description <s>","Description").option("--status <s>","Status").option("--schedule <s>","Schedule (cron-like)").option("--configuration <json>","Configuration JSON").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let i={};if(t.name&&(i.name=t.name),t.type&&(i.type=t.type),t.description!==void 0&&(i.description=t.description),t.status&&(i.status=t.status),t.schedule!==void 0&&(i.schedule=t.schedule),t.configuration&&(i.configuration=l("configuration",t.configuration)),!Object.keys(i).length)throw new m("No updates specified");let d=await o(Be,{id:e,input:i});p("Report updated"),s(t,d.updateMovethewheelsReport);}catch(i){a(i);}}),r.command("remove").description("Delete a report").argument("<id>","Report ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let i=await o(Ke,{id:e});p(`Report ${e} deleted`),s(t,{deleted:i.deleteMovethewheelsReport});}catch(i){a(i);}}),r.command("generate").description("Generate a report run").argument("<id>","Report ID").option("--parameters <json>","Parameters JSON").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let i={reportId:e};t.parameters&&(i.parameters=l("parameters",t.parameters));let d=await o(Qe,{input:i});p("Report generated"),s(t,d.generateMovethewheelsReport);}catch(i){a(i);}}),r.command("export").description("Export resource data").requiredOption("--resource <r>","Resource to export").option("--export-format <f>","Export format","json").option("-f, --format <format>","Output format").action(async e=>{try{let t={resource:e.resource,format:e.exportFormat??"json"},i=await o(Xe,{input:t});p("Data exported"),s(e,i.exportData);}catch(t){a(t);}}),r.command("import").description("Import resource data").requiredOption("--resource <r>","Resource to import").requiredOption("--payload <json>","Payload JSON").option("-f, --format <format>","Output format").action(async e=>{try{let t={resource:e.resource,payload:l("payload",e.payload)},i=await o(Ze,{input:t});p("Data imported"),s(e,i.importData);}catch(t){a(t);}});let n=c.command("settings").description("Movethewheels module settings");n.command("get").description("Get module settings").option("-f, --format <format>","Output format").action(async e=>{try{let t=await o(et);s(e,t.moduleSettings);}catch(t){a(t);}}),n.command("update").description("Update module settings preferences").requiredOption("--preferences <json>","Preferences JSON").option("-f, --format <format>","Output format").action(async e=>{try{let t={preferences:l("preferences",e.preferences)},i=await o(tt,{input:t});p("Module settings updated"),s(e,i.updateModuleSettings);}catch(t){a(t);}});}function vt(c){let r=c.command("analytics").description("Movethewheels analytics & dashboards");r.command("dashboard").description("Dashboard metrics (orders, deliveries, revenue, fleet, low stock)").option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(it);s(n,e.dashboardMetrics);}catch(e){a(e);}}),r.command("trends").description("Analytics time series (order, revenue, delivery trends)").option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(nt);s(n,e.analytics);}catch(e){a(e);}}),r.command("finance").description("Finance metrics (revenue, fuel cost, open invoices)").option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(rt);s(n,e.financeMetrics);}catch(e){a(e);}}),r.command("fleet").description("Fleet stats (vehicles & drivers by status)").option("-f, --format <format>","Output format").action(async n=>{try{let e=await o(ot);s(n,e.fleetStats);}catch(e){a(e);}});}var xt={id:"movethewheels",version:"1.0.0",displayName:"Movethewheels",dependsOn:["auth","workspaces"],register(c,r){D(r);let n=c.command("movethewheels").description("Movethewheels logistics & fleet operations");at(n),st(n),ct(n),dt(n),ut(n),lt(n),mt(n),ft(n),gt(n),ht(n),yt(n),vt(n);}},Ui=xt;module.exports=Ui;
|
|
431
|
+
`;function f(c,r){try{return JSON.parse(r)}catch{throw new l(`--${c} must be valid JSON`)}}function d(c){let r=Number.parseInt(c,10);if(Number.isNaN(r))throw new l(`Expected an integer but got "${c}"`);return r}function m(c){let r=Number.parseFloat(c);if(Number.isNaN(r))throw new l(`Expected a number but got "${c}"`);return r}function y(c){let r={};return c.limit!==void 0&&(r.limit=c.limit),c.offset!==void 0&&(r.offset=c.offset),Object.keys(r).length?r:void 0}function Me(c){let r=c.command("customers").description("Movethewheels customers");r.command("list").description("List customers").option("--type <t>","Filter by customer type (b2c/b2b)").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.type&&(e.type=t.type),t.query&&(e.search=t.query);let n=await o(k,{filter:Object.keys(e).length?e:void 0,pagination:y(t)});s(t,n.customers,{headers:["ID","Name","Type","Email","Phone","Rating"],rows:n.customers.map(i=>[g(i.id,12),i.name,i.type,i.email??"-",i.phone??"-",i.rating!=null?String(i.rating):"-"])});}catch(e){a(e);}}),r.command("get").description("Get a customer by id").argument("<id>","Customer ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(S,{id:t});if(!n.customer)throw new l(`Customer ${t} not found`);s(e,n.customer);}catch(n){a(n);}}),r.command("create").description("Create a customer").requiredOption("--name <name>","Customer name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--company <company>","Company").option("--type <t>","Customer type","b2c").option("--tax-id <s>","Tax ID").option("--business-license <s>","Business license").option("--rating <n>","Rating",m).option("--address <json>","Address JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,type:t.type??"b2c"};t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.company&&(e.company=t.company),t.taxId&&(e.taxId=t.taxId),t.businessLicense&&(e.businessLicense=t.businessLicense),t.rating!==void 0&&(e.rating=t.rating),t.address&&(e.address=f("address",t.address));let n=await o(R,{input:e});p(`Customer created: ${n.createCustomer.name}`),s(t,n.createCustomer);}catch(e){a(e);}}),r.command("update").description("Update a customer").argument("<id>","Customer ID").option("--name <name>","Customer name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--company <company>","Company").option("--type <t>","Customer type").option("--tax-id <s>","Tax ID").option("--business-license <s>","Business license").option("--rating <n>","Rating",m).option("--address <json>","Address JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.email!==void 0&&(n.email=e.email),e.phone!==void 0&&(n.phone=e.phone),e.company!==void 0&&(n.company=e.company),e.type&&(n.type=e.type),e.taxId!==void 0&&(n.taxId=e.taxId),e.businessLicense!==void 0&&(n.businessLicense=e.businessLicense),e.rating!==void 0&&(n.rating=e.rating),e.address&&(n.address=f("address",e.address)),!Object.keys(n).length)throw new l("No updates specified");let i=await o(A,{id:t,input:n});p("Customer updated"),s(e,i.updateCustomer);}catch(n){a(n);}}),r.command("remove").description("Delete a customer").argument("<id>","Customer ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(x,{id:t});p(`Customer ${t} deleted`),s(e,{deleted:n.deleteCustomer});}catch(n){a(n);}});}function qe(c){let r=c.command("drivers").description("Movethewheels drivers");r.command("list").description("List drivers").option("--status <s>","Filter by driver status").option("--vehicle <id>","Filter by vehicle ID").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.status&&(e.status=t.status.toUpperCase()),t.vehicle&&(e.vehicleId=t.vehicle),t.query&&(e.search=t.query);let n=await o($,{filter:Object.keys(e).length?e:void 0,pagination:y(t)});s(t,n.drivers,{headers:["ID","Name","Employee","Status","Vehicle","Rating"],rows:n.drivers.map(i=>[g(i.id,12),`${i.firstName} ${i.lastName}`,i.employeeId,i.status,i.vehicleId?g(i.vehicleId,12):"-",i.rating!=null?String(i.rating):"-"])});}catch(e){a(e);}}),r.command("get").description("Get a driver by id").argument("<id>","Driver ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(N,{id:t});if(!n.driver)throw new l(`Driver ${t} not found`);s(e,n.driver);}catch(n){a(n);}}),r.command("create").description("Create a driver").requiredOption("--employee-id <s>","Employee ID").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--status <s>","Driver status","AVAILABLE").option("--license-number <s>","License number").option("--license-class <s>","License class").option("--license-expiry <s>","License expiry (ISO date)").option("--vehicle-id <id>","Vehicle ID").option("--user-id <id>","User ID").option("--rating <n>","Rating",m).option("--certifications <json>","Certifications JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={employeeId:t.employeeId,firstName:t.firstName,lastName:t.lastName,status:(t.status??"AVAILABLE").toUpperCase()};t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.licenseNumber&&(e.licenseNumber=t.licenseNumber),t.licenseClass&&(e.licenseClass=t.licenseClass),t.licenseExpiry&&(e.licenseExpiry=t.licenseExpiry),t.vehicleId&&(e.vehicleId=t.vehicleId),t.userId&&(e.userId=t.userId),t.rating!==void 0&&(e.rating=t.rating),t.certifications&&(e.certifications=f("certifications",t.certifications)),t.currentLocation&&(e.currentLocation=f("current-location",t.currentLocation));let n=await o(L,{input:e});p(`Driver created: ${n.createDriver.firstName} ${n.createDriver.lastName}`),s(t,n.createDriver);}catch(e){a(e);}}),r.command("update").description("Update a driver").argument("<id>","Driver ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <email>","Email").option("--phone <phone>","Phone").option("--status <s>","Driver status").option("--license-number <s>","License number").option("--license-class <s>","License class").option("--license-expiry <s>","License expiry (ISO date)").option("--vehicle-id <id>","Vehicle ID").option("--rating <n>","Rating",m).option("--certifications <json>","Certifications JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.firstName&&(n.firstName=e.firstName),e.lastName&&(n.lastName=e.lastName),e.email!==void 0&&(n.email=e.email),e.phone!==void 0&&(n.phone=e.phone),e.status&&(n.status=e.status.toUpperCase()),e.licenseNumber!==void 0&&(n.licenseNumber=e.licenseNumber),e.licenseClass!==void 0&&(n.licenseClass=e.licenseClass),e.licenseExpiry&&(n.licenseExpiry=e.licenseExpiry),e.vehicleId!==void 0&&(n.vehicleId=e.vehicleId),e.rating!==void 0&&(n.rating=e.rating),e.certifications&&(n.certifications=f("certifications",e.certifications)),e.currentLocation&&(n.currentLocation=f("current-location",e.currentLocation)),!Object.keys(n).length)throw new l("No updates specified");let i=await o(P,{id:t,input:n});p("Driver updated"),s(e,i.updateDriver);}catch(n){a(n);}}),r.command("remove").description("Delete a driver").argument("<id>","Driver ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(_,{id:t});p(`Driver ${t} deleted`),s(e,{deleted:n.deleteDriver});}catch(n){a(n);}}),r.command("set-status").description("Update a driver status").argument("<id>","Driver ID").requiredOption("--status <s>","AVAILABLE|ON_DELIVERY|ON_BREAK|OFF_DUTY|INACTIVE").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(U,{id:t,status:e.status.toUpperCase()});p(`Driver status set to ${n.updateDriverStatus.status}`),s(e,n.updateDriverStatus);}catch(n){a(n);}}),r.command("assign-vehicle").description("Assign (or clear) a vehicle for a driver").argument("<id>","Driver ID").option("--vehicle <id>","Vehicle ID (omit to clear assignment)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(V,{id:t,vehicleId:e.vehicle});p(e.vehicle?`Vehicle ${e.vehicle} assigned`:"Vehicle assignment cleared"),s(e,n.assignDriverVehicle);}catch(n){a(n);}});}function Fe(c){let r=c.command("vehicles").description("Movethewheels fleet vehicles");r.command("list").description("List vehicles").option("--type <t>","Filter by vehicle type").option("--status <s>","Filter by vehicle status").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.type&&(e.type=t.type.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.query&&(e.search=t.query);let n=await o(q,{filter:Object.keys(e).length?e:void 0,pagination:y(t)});s(t,n.vehicles,{headers:["ID","Number","Type","Status","Make/Model","Plate"],rows:n.vehicles.map(i=>[g(i.id,12),i.vehicleNumber,i.type,i.status,`${i.make??"-"} ${i.model??""}`.trim(),i.licensePlate??"-"])});}catch(e){a(e);}}),r.command("get").description("Get a vehicle by id").argument("<id>","Vehicle ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(M,{id:t});if(!n.vehicle)throw new l(`Vehicle ${t} not found`);s(e,n.vehicle);}catch(n){a(n);}}),r.command("create").description("Create a vehicle").requiredOption("--number <s>","Vehicle number").requiredOption("--type <t>","Vehicle type (TRUCK|VAN|MOTORCYCLE|\u2026)").option("--status <s>","Vehicle status","ACTIVE").option("--make <s>","Make").option("--model <s>","Model").option("--year <n>","Year",d).option("--license-plate <s>","License plate").option("--fuel-level <n>","Fuel level",m).option("--mileage <n>","Mileage",m).option("--ownership-type <s>","Ownership type").option("--capacity <json>","Capacity JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={vehicleNumber:t.number,type:t.type.toUpperCase(),status:(t.status??"ACTIVE").toUpperCase()};t.make&&(e.make=t.make),t.model&&(e.model=t.model),t.year!==void 0&&(e.year=t.year),t.licensePlate&&(e.licensePlate=t.licensePlate),t.fuelLevel!==void 0&&(e.fuelLevel=t.fuelLevel),t.mileage!==void 0&&(e.mileage=t.mileage),t.ownershipType&&(e.ownershipType=t.ownershipType),t.capacity&&(e.capacity=f("capacity",t.capacity)),t.currentLocation&&(e.currentLocation=f("current-location",t.currentLocation));let n=await o(F,{input:e});p(`Vehicle created: ${n.createVehicle.vehicleNumber}`),s(t,n.createVehicle);}catch(e){a(e);}}),r.command("update").description("Update a vehicle").argument("<id>","Vehicle ID").option("--number <s>","Vehicle number").option("--type <t>","Vehicle type").option("--status <s>","Vehicle status").option("--make <s>","Make").option("--model <s>","Model").option("--year <n>","Year",d).option("--license-plate <s>","License plate").option("--fuel-level <n>","Fuel level",m).option("--mileage <n>","Mileage",m).option("--ownership-type <s>","Ownership type").option("--capacity <json>","Capacity JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.number&&(n.vehicleNumber=e.number),e.type&&(n.type=e.type.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.make!==void 0&&(n.make=e.make),e.model!==void 0&&(n.model=e.model),e.year!==void 0&&(n.year=e.year),e.licensePlate!==void 0&&(n.licensePlate=e.licensePlate),e.fuelLevel!==void 0&&(n.fuelLevel=e.fuelLevel),e.mileage!==void 0&&(n.mileage=e.mileage),e.ownershipType!==void 0&&(n.ownershipType=e.ownershipType),e.capacity&&(n.capacity=f("capacity",e.capacity)),e.currentLocation&&(n.currentLocation=f("current-location",e.currentLocation)),!Object.keys(n).length)throw new l("No updates specified");let i=await o(W,{id:t,input:n});p("Vehicle updated"),s(e,i.updateVehicle);}catch(n){a(n);}}),r.command("remove").description("Delete a vehicle").argument("<id>","Vehicle ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(H,{id:t});p(`Vehicle ${t} deleted`),s(e,{deleted:n.deleteVehicle});}catch(n){a(n);}}),r.command("set-status").description("Update a vehicle status").argument("<id>","Vehicle ID").requiredOption("--status <s>","ACTIVE|INACTIVE|IN_TRANSIT|MAINTENANCE|DECOMMISSIONED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(j,{id:t,status:e.status.toUpperCase()});p(`Vehicle status set to ${n.updateVehicleStatus.status}`),s(e,n.updateVehicleStatus);}catch(n){a(n);}}),r.command("set-location").description("Update a vehicle current location").argument("<id>","Vehicle ID").requiredOption("--location <json>","Location JSON (latitude/longitude/\u2026)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=f("location",e.location),i=await o(G,{id:t,location:n});p("Vehicle location updated"),s(e,i.updateVehicleLocation);}catch(n){a(n);}});}function We(c){let r=c.command("warehouses").description("Movethewheels warehouses & locations");r.command("list").description("List warehouses").option("--type <t>","Filter by warehouse type").option("--status <s>","Filter by status").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.type&&(e.type=t.type.toUpperCase()),t.status&&(e.status=t.status),t.query&&(e.search=t.query);let n=await o(z,{filter:Object.keys(e).length?e:void 0,pagination:y(t)});s(t,n.warehouses,{headers:["ID","Code","Name","Type","Status","Capacity"],rows:n.warehouses.map(i=>[g(i.id,12),i.code,i.name,i.type,i.status,`${i.usedCapacity??0}/${i.totalCapacity??0}`])});}catch(e){a(e);}}),r.command("get").description("Get a warehouse by id (includes locations)").argument("<id>","Warehouse ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(J,{id:t});if(!n.warehouse)throw new l(`Warehouse ${t} not found`);s(e,n.warehouse);}catch(n){a(n);}}),r.command("create").description("Create a warehouse").requiredOption("--code <code>","Warehouse code").requiredOption("--name <name>","Warehouse name").requiredOption("--type <t>","Warehouse type (DISTRIBUTION|FULFILLMENT|\u2026)").requiredOption("--address <json>","Address JSON").option("--status <s>","Status","ACTIVE").option("--contact-info <json>","Contact info JSON").option("--operating-hours <json>","Operating hours JSON").option("--capabilities <json>","Capabilities JSON").option("--total-capacity <n>","Total capacity",m).option("--used-capacity <n>","Used capacity",m).option("-f, --format <format>","Output format").action(async t=>{try{let e={code:t.code,name:t.name,type:t.type.toUpperCase(),address:f("address",t.address),status:t.status??"ACTIVE"};t.contactInfo&&(e.contactInfo=f("contact-info",t.contactInfo)),t.operatingHours&&(e.operatingHours=f("operating-hours",t.operatingHours)),t.capabilities&&(e.capabilities=f("capabilities",t.capabilities)),t.totalCapacity!==void 0&&(e.totalCapacity=t.totalCapacity),t.usedCapacity!==void 0&&(e.usedCapacity=t.usedCapacity);let n=await o(B,{input:e});p(`Warehouse created: ${n.createWarehouse.name}`),s(t,n.createWarehouse);}catch(e){a(e);}}),r.command("update").description("Update a warehouse").argument("<id>","Warehouse ID").option("--code <code>","Warehouse code").option("--name <name>","Warehouse name").option("--type <t>","Warehouse type").option("--status <s>","Status").option("--address <json>","Address JSON").option("--contact-info <json>","Contact info JSON").option("--operating-hours <json>","Operating hours JSON").option("--capabilities <json>","Capabilities JSON").option("--total-capacity <n>","Total capacity",m).option("--used-capacity <n>","Used capacity",m).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.code&&(n.code=e.code),e.name&&(n.name=e.name),e.type&&(n.type=e.type.toUpperCase()),e.status&&(n.status=e.status),e.address&&(n.address=f("address",e.address)),e.contactInfo&&(n.contactInfo=f("contact-info",e.contactInfo)),e.operatingHours&&(n.operatingHours=f("operating-hours",e.operatingHours)),e.capabilities&&(n.capabilities=f("capabilities",e.capabilities)),e.totalCapacity!==void 0&&(n.totalCapacity=e.totalCapacity),e.usedCapacity!==void 0&&(n.usedCapacity=e.usedCapacity),!Object.keys(n).length)throw new l("No updates specified");let i=await o(Y,{id:t,input:n});p("Warehouse updated"),s(e,i.updateWarehouse);}catch(n){a(n);}}),r.command("remove").description("Delete a warehouse").argument("<id>","Warehouse ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(K,{id:t});p(`Warehouse ${t} deleted`),s(e,{deleted:n.deleteWarehouse});}catch(n){a(n);}}),r.command("create-location").description("Create a warehouse location").requiredOption("--warehouse <id>","Warehouse ID").requiredOption("--code <s>","Location code").option("--location-type <s>","Location type").option("--status <s>","Status","ACTIVE").option("--zone <s>","Zone").option("--aisle <s>","Aisle").option("--rack <s>","Rack").option("--shelf <s>","Shelf").option("--bin <s>","Bin").option("--capacity <n>","Capacity",m).option("-f, --format <format>","Output format").action(async t=>{try{let e={warehouseId:t.warehouse,locationCode:t.code,status:t.status??"ACTIVE"};t.locationType&&(e.locationType=t.locationType),t.zone&&(e.zone=t.zone),t.aisle&&(e.aisle=t.aisle),t.rack&&(e.rack=t.rack),t.shelf&&(e.shelf=t.shelf),t.bin&&(e.bin=t.bin),t.capacity!==void 0&&(e.capacity=t.capacity);let n=await o(Q,{input:e});p(`Location created: ${n.createWarehouseLocation.locationCode}`),s(t,n.createWarehouseLocation);}catch(e){a(e);}}),r.command("update-location").description("Update a warehouse location").argument("<id>","Location ID").option("--code <s>","Location code").option("--location-type <s>","Location type").option("--status <s>","Status").option("--zone <s>","Zone").option("--aisle <s>","Aisle").option("--rack <s>","Rack").option("--shelf <s>","Shelf").option("--bin <s>","Bin").option("--capacity <n>","Capacity",m).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.code&&(n.locationCode=e.code),e.locationType!==void 0&&(n.locationType=e.locationType),e.status&&(n.status=e.status),e.zone!==void 0&&(n.zone=e.zone),e.aisle!==void 0&&(n.aisle=e.aisle),e.rack!==void 0&&(n.rack=e.rack),e.shelf!==void 0&&(n.shelf=e.shelf),e.bin!==void 0&&(n.bin=e.bin),e.capacity!==void 0&&(n.capacity=e.capacity),!Object.keys(n).length)throw new l("No updates specified");let i=await o(Z,{id:t,input:n});p("Location updated"),s(e,i.updateWarehouseLocation);}catch(n){a(n);}});}function He(c){let r={};return c.cargoItem&&(r.cargoItemId=c.cargoItem),c.warehouse&&(r.warehouseId=c.warehouse),c.location&&(r.locationId=c.location),c.query&&(r.search=c.query),Object.keys(r).length?r:void 0}function je(c){let r=c.command("inventory").description("Movethewheels inventory");r.command("list").description("List inventory items").option("--cargo-item <id>","Filter by cargo item ID").option("--warehouse <id>","Filter by warehouse ID").option("--location <id>","Filter by location ID").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(ee,{filter:He(t),pagination:y(t)});s(t,e.inventoryItems,{headers:["ID","Cargo item","Warehouse","OnHand","Available","Allocated"],rows:e.inventoryItems.map(n=>[g(n.id,12),g(n.cargoItemId,12),g(n.warehouseId,12),String(n.onHand),String(n.available),String(n.allocated)])});}catch(e){a(e);}}),r.command("get").description("Get an inventory item by id").argument("<id>","Inventory item ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(X,{id:t});if(!n.inventoryItem)throw new l(`Inventory item ${t} not found`);s(e,n.inventoryItem);}catch(n){a(n);}}),r.command("stats").description("Inventory stats (on-hand, available, allocated, damaged, low-stock)").option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(ne);s(t,e.inventoryStats);}catch(e){a(e);}}),r.command("create").description("Create an inventory item").requiredOption("--cargo-item <id>","Cargo item ID").requiredOption("--warehouse <id>","Warehouse ID").option("--location <id>","Location ID").option("--on-hand <n>","On-hand quantity",d).option("--available <n>","Available quantity",d).option("--allocated <n>","Allocated quantity",d).option("--damaged <n>","Damaged quantity",d).option("--reorder-point <n>","Reorder point",d).option("--safety-stock <n>","Safety stock",d).option("--unit-cost <n>","Unit cost",m).option("-f, --format <format>","Output format").action(async t=>{try{let e={cargoItemId:t.cargoItem,warehouseId:t.warehouse};t.location&&(e.locationId=t.location),t.onHand!==void 0&&(e.onHand=t.onHand),t.available!==void 0&&(e.available=t.available),t.allocated!==void 0&&(e.allocated=t.allocated),t.damaged!==void 0&&(e.damaged=t.damaged),t.reorderPoint!==void 0&&(e.reorderPoint=t.reorderPoint),t.safetyStock!==void 0&&(e.safetyStock=t.safetyStock),t.unitCost!==void 0&&(e.unitCost=t.unitCost);let n=await o(ie,{input:e});p("Inventory item created"),s(t,n.createInventoryItem);}catch(e){a(e);}}),r.command("update").description("Update an inventory item").argument("<id>","Inventory item ID").option("--location <id>","Location ID").option("--on-hand <n>","On-hand quantity",d).option("--available <n>","Available quantity",d).option("--allocated <n>","Allocated quantity",d).option("--damaged <n>","Damaged quantity",d).option("--reorder-point <n>","Reorder point",d).option("--safety-stock <n>","Safety stock",d).option("--unit-cost <n>","Unit cost",m).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.location!==void 0&&(n.locationId=e.location),e.onHand!==void 0&&(n.onHand=e.onHand),e.available!==void 0&&(n.available=e.available),e.allocated!==void 0&&(n.allocated=e.allocated),e.damaged!==void 0&&(n.damaged=e.damaged),e.reorderPoint!==void 0&&(n.reorderPoint=e.reorderPoint),e.safetyStock!==void 0&&(n.safetyStock=e.safetyStock),e.unitCost!==void 0&&(n.unitCost=e.unitCost),!Object.keys(n).length)throw new l("No updates specified");let i=await o(re,{id:t,input:n});p("Inventory item updated"),s(e,i.updateInventoryItem);}catch(n){a(n);}}),r.command("remove").description("Delete an inventory item").argument("<id>","Inventory item ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(oe,{id:t});p(`Inventory item ${t} deleted`),s(e,{deleted:n.deleteInventoryItem});}catch(n){a(n);}}),r.command("adjust").description("Adjust inventory stock levels").argument("<id>","Inventory item ID").option("--on-hand <n>","On-hand quantity",d).option("--available <n>","Available quantity",d).option("--allocated <n>","Allocated quantity",d).option("--damaged <n>","Damaged quantity",d).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={id:t};if(e.onHand!==void 0&&(n.onHand=e.onHand),e.available!==void 0&&(n.available=e.available),e.allocated!==void 0&&(n.allocated=e.allocated),e.damaged!==void 0&&(n.damaged=e.damaged),Object.keys(n).length===1)throw new l("No stock adjustments specified");let i=await o(ae,{input:n});p("Inventory stock adjusted"),s(e,i.adjustInventoryStock);}catch(n){a(n);}}),r.command("transactions").description("List inventory transactions").option("--cargo-item <id>","Filter by cargo item ID").option("--warehouse <id>","Filter by warehouse ID").option("--location <id>","Filter by location ID").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(te,{filter:He(t),pagination:y(t)});s(t,e.inventoryTransactions,{headers:["ID","Number","Type","Cargo item","Warehouse","Qty"],rows:e.inventoryTransactions.map(n=>[g(n.id,12),n.transactionNumber,n.type,g(n.cargoItemId,12),g(n.warehouseId,12),String(n.quantity)])});}catch(e){a(e);}}),r.command("record-transaction").description("Record an inventory transaction").requiredOption("--number <s>","Transaction number").requiredOption("--type <t>","Transaction type (RECEIPT|ISSUE|TRANSFER|ADJUSTMENT|RETURN)").requiredOption("--cargo-item <id>","Cargo item ID").requiredOption("--warehouse <id>","Warehouse ID").requiredOption("--quantity <n>","Quantity",d).option("--inventory-item <id>","Inventory item ID").option("--unit-cost <n>","Unit cost",m).option("--reference-type <s>","Reference type").option("--reference-id <s>","Reference ID").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={transactionNumber:t.number,type:t.type.toUpperCase(),cargoItemId:t.cargoItem,warehouseId:t.warehouse,quantity:t.quantity};t.inventoryItem&&(e.inventoryItemId=t.inventoryItem),t.unitCost!==void 0&&(e.unitCost=t.unitCost),t.referenceType&&(e.referenceType=t.referenceType),t.referenceId&&(e.referenceId=t.referenceId),t.notes&&(e.notes=t.notes);let n=await o(se,{input:e});p(`Transaction recorded: ${n.createInventoryTransaction.transactionNumber}`),s(t,n.createInventoryTransaction);}catch(e){a(e);}});}function Ge(c){let r=c.command("shipments").description("Movethewheels shipments & tracking");r.command("list").description("List shipments").option("--delivery-job <id>","Filter by delivery job ID").option("--store-order <id>","Filter by store order ID").option("--customer <id>","Filter by customer ID").option("--carrier <id>","Filter by carrier ID").option("--status <s>","Filter by status").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.deliveryJob&&(e.deliveryJobId=t.deliveryJob),t.storeOrder&&(e.storeOrderId=t.storeOrder),t.customer&&(e.customerId=t.customer),t.carrier&&(e.carrierId=t.carrier),t.status&&(e.status=t.status.toUpperCase()),t.query&&(e.search=t.query);let n=await o(de,{filter:Object.keys(e).length?e:void 0,pagination:y(t)});s(t,n.shipments,{headers:["ID","Shipment #","Delivery job","Store order","Status","Tracking"],rows:n.shipments.map(i=>[g(i.id,12),i.shipmentNumber,g(i.deliveryJobId??"-",12),g(i.storeOrderId??"-",12),i.status,i.trackingNumber??"-"])});}catch(e){a(e);}}),r.command("get").description("Get a shipment by id (includes tracking events)").argument("<id>","Shipment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(ce,{id:t});if(!n.shipment)throw new l(`Shipment ${t} not found`);s(e,n.shipment);}catch(n){a(n);}}),r.command("active").description("List active deliveries (in-transit shipments)").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(ue,{pagination:y(t)});s(t,e.activeDeliveries,{headers:["ID","Shipment #","Delivery job","Store order","Status","Tracking"],rows:e.activeDeliveries.map(n=>[g(n.id,12),n.shipmentNumber,g(n.deliveryJobId??"-",12),g(n.storeOrderId??"-",12),n.status,n.trackingNumber??"-"])});}catch(e){a(e);}}),r.command("create").description("Create a shipment").requiredOption("--shipment-number <s>","Shipment number").option("--delivery-job <id>","Delivery job the shipment fulfils").option("--store-order <id>","Store order the shipment fulfils").requiredOption("--origin <json>","Origin JSON").requiredOption("--destination <json>","Destination JSON").option("--status <s>","Status","PLANNED").option("--customer <id>","Customer ID").option("--carrier <id>","Carrier ID").option("--tracking-number <s>","Tracking number").option("--cargo-details <json>","Cargo details JSON").option("--estimated-delivery <s>","Estimated delivery (ISO date)").option("--actual-delivery <s>","Actual delivery (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={shipmentNumber:t.shipmentNumber,origin:f("origin",t.origin),destination:f("destination",t.destination),status:(t.status??"PLANNED").toUpperCase()};t.deliveryJob&&(e.deliveryJobId=t.deliveryJob),t.storeOrder&&(e.storeOrderId=t.storeOrder),t.customer&&(e.customerId=t.customer),t.carrier&&(e.carrierId=t.carrier),t.trackingNumber&&(e.trackingNumber=t.trackingNumber),t.cargoDetails&&(e.cargoDetails=f("cargo-details",t.cargoDetails)),t.estimatedDelivery&&(e.estimatedDelivery=t.estimatedDelivery),t.actualDelivery&&(e.actualDelivery=t.actualDelivery);let n=await o(me,{input:e});p(`Shipment created: ${n.createShipment.shipmentNumber}`),s(t,n.createShipment);}catch(e){a(e);}}),r.command("update").description("Update a shipment").argument("<id>","Shipment ID").option("--status <s>","Status").option("--customer <id>","Customer ID").option("--carrier <id>","Carrier ID").option("--tracking-number <s>","Tracking number").option("--origin <json>","Origin JSON").option("--destination <json>","Destination JSON").option("--cargo-details <json>","Cargo details JSON").option("--estimated-delivery <s>","Estimated delivery (ISO date)").option("--actual-delivery <s>","Actual delivery (ISO date)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.status&&(n.status=e.status.toUpperCase()),e.customer!==void 0&&(n.customerId=e.customer),e.carrier!==void 0&&(n.carrierId=e.carrier),e.trackingNumber!==void 0&&(n.trackingNumber=e.trackingNumber),e.origin&&(n.origin=f("origin",e.origin)),e.destination&&(n.destination=f("destination",e.destination)),e.cargoDetails&&(n.cargoDetails=f("cargo-details",e.cargoDetails)),e.estimatedDelivery&&(n.estimatedDelivery=e.estimatedDelivery),e.actualDelivery&&(n.actualDelivery=e.actualDelivery),!Object.keys(n).length)throw new l("No updates specified");let i=await o(fe,{id:t,input:n});p("Shipment updated"),s(e,i.updateShipment);}catch(n){a(n);}}),r.command("remove").description("Delete a shipment").argument("<id>","Shipment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(ge,{id:t});p(`Shipment ${t} deleted`),s(e,{deleted:n.deleteShipment});}catch(n){a(n);}}),r.command("add-event").description("Add a tracking event to a shipment").requiredOption("--shipment <id>","Shipment ID").requiredOption("--event-type <t>","CREATED|PICKED_UP|IN_TRANSIT|ARRIVED|DEPARTED|OUT_FOR_DELIVERY|DELIVERED|FAILED|RETURNED").option("--details <s>","Event details").option("--location <json>","Location JSON").option("--timestamp <s>","Timestamp (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={shipmentId:t.shipment,eventType:t.eventType.toUpperCase()};t.details&&(e.details=t.details),t.location&&(e.location=f("location",t.location)),t.timestamp&&(e.timestamp=t.timestamp);let n=await o(he,{input:e});p(`Tracking event added: ${n.addTrackingEvent.eventType}`),s(t,n.addTrackingEvent);}catch(e){a(e);}}),r.command("tracking").description("List tracking events for a shipment").argument("<shipmentId>","Shipment ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(pe,{shipmentId:t,pagination:y(e)});s(e,n.shipmentTracking,{headers:["ID","Event","Details","Timestamp"],rows:n.shipmentTracking.map(i=>[g(i.id,12),i.eventType,g(i.details??"-",30),i.timestamp])});}catch(n){a(n);}}),r.command("alerts").description("List tracking alerts (delayed / at-risk shipments)").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(le,{pagination:y(t)});s(t,e.trackingAlerts,{headers:["Type","Shipment #","Message"],rows:e.trackingAlerts.map(n=>[n.alertType,n.shipmentNumber,g(n.message,40)])});}catch(e){a(e);}});}function Je(c){let r=c.command("routes").description("Movethewheels delivery routes");r.command("list").description("List routes").option("--driver <id>","Filter by driver ID").option("--vehicle <id>","Filter by vehicle ID").option("--shipment <id>","Filter by shipment ID").option("--status <s>","Filter by status").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.driver&&(e.driverId=t.driver),t.vehicle&&(e.vehicleId=t.vehicle),t.shipment&&(e.shipmentId=t.shipment),t.status&&(e.status=t.status.toUpperCase()),t.query&&(e.search=t.query);let n=await o(ve,{filter:Object.keys(e).length?e:void 0,pagination:y(t)});s(t,n.routes,{headers:["ID","Name","Status","Driver","Vehicle","Distance"],rows:n.routes.map(i=>[g(i.id,12),i.name,i.status,i.driverId?g(i.driverId,12):"-",i.vehicleId?g(i.vehicleId,12):"-",i.estimatedDistance!=null?String(i.estimatedDistance):"-"])});}catch(e){a(e);}}),r.command("get").description("Get a route by id").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(ye,{id:t});if(!n.route)throw new l(`Route ${t} not found`);s(e,n.route);}catch(n){a(n);}}),r.command("create").description("Create a route").requiredOption("--name <name>","Route name").requiredOption("--waypoints <json>","Waypoints JSON").option("--status <s>","Status","PLANNED").option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--shipment <id>","Shipment ID").option("--estimated-distance <n>","Estimated distance",m).option("--estimated-duration <n>","Estimated duration",m).option("--actual-distance <n>","Actual distance",m).option("--actual-duration <n>","Actual duration",m).option("--fuel-cost <n>","Fuel cost",m).option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,waypoints:f("waypoints",t.waypoints),status:(t.status??"PLANNED").toUpperCase()};t.driver&&(e.driverId=t.driver),t.vehicle&&(e.vehicleId=t.vehicle),t.shipment&&(e.shipmentId=t.shipment),t.estimatedDistance!==void 0&&(e.estimatedDistance=t.estimatedDistance),t.estimatedDuration!==void 0&&(e.estimatedDuration=t.estimatedDuration),t.actualDistance!==void 0&&(e.actualDistance=t.actualDistance),t.actualDuration!==void 0&&(e.actualDuration=t.actualDuration),t.fuelCost!==void 0&&(e.fuelCost=t.fuelCost);let n=await o(Ie,{input:e});p(`Route created: ${n.createRoute.name}`),s(t,n.createRoute);}catch(e){a(e);}}),r.command("update").description("Update a route").argument("<id>","Route ID").option("--name <name>","Route name").option("--status <s>","Status").option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--shipment <id>","Shipment ID").option("--waypoints <json>","Waypoints JSON").option("--estimated-distance <n>","Estimated distance",m).option("--estimated-duration <n>","Estimated duration",m).option("--actual-distance <n>","Actual distance",m).option("--actual-duration <n>","Actual duration",m).option("--fuel-cost <n>","Fuel cost",m).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.status&&(n.status=e.status.toUpperCase()),e.driver!==void 0&&(n.driverId=e.driver),e.vehicle!==void 0&&(n.vehicleId=e.vehicle),e.shipment!==void 0&&(n.shipmentId=e.shipment),e.waypoints&&(n.waypoints=f("waypoints",e.waypoints)),e.estimatedDistance!==void 0&&(n.estimatedDistance=e.estimatedDistance),e.estimatedDuration!==void 0&&(n.estimatedDuration=e.estimatedDuration),e.actualDistance!==void 0&&(n.actualDistance=e.actualDistance),e.actualDuration!==void 0&&(n.actualDuration=e.actualDuration),e.fuelCost!==void 0&&(n.fuelCost=e.fuelCost),!Object.keys(n).length)throw new l("No updates specified");let i=await o(we,{id:t,input:n});p("Route updated"),s(e,i.updateRoute);}catch(n){a(n);}}),r.command("remove").description("Delete a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(Ce,{id:t});p(`Route ${t} deleted`),s(e,{deleted:n.deleteRoute});}catch(n){a(n);}}),r.command("optimize").description("Optimize a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await o(Ee,{id:t});p("Route optimized"),s(e,n.optimizeRoute);}catch(n){a(n);}});}function Be(c){let r=c.command("marketplace").description("Movethewheels logistics marketplace (providers & offerings)"),t=r.command("providers").description("Service providers");t.command("list").description("List service providers").option("--type <t>","Filter by provider type").option("--active <bool>","Filter by active state (true|false)",n=>n==="true").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async n=>{try{let i={};n.type&&(i.type=n.type),n.active!==void 0&&(i.isActive=n.active),n.query&&(i.search=n.query);let u=await o(Te,{filter:Object.keys(i).length?i:void 0,pagination:y(n)});s(n,u.serviceProviders,{headers:["ID","Name","Type","Active","Verified","Rating"],rows:u.serviceProviders.map(v=>[g(v.id,12),v.name,v.type,v.isActive?"yes":"no",v.isVerified?"yes":"no",v.rating!=null?String(v.rating):"-"])});}catch(i){a(i);}}),t.command("get").description("Get a service provider by id (includes offerings)").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(n,i)=>{try{let u=await o(be,{id:n});if(!u.serviceProvider)throw new l(`Provider ${n} not found`);s(i,u.serviceProvider);}catch(u){a(u);}}),t.command("create").description("Create a service provider").requiredOption("--name <name>","Provider name").requiredOption("--type <t>","Provider type").option("--description <s>","Description").option("--rating <n>","Rating",m).option("--active <bool>","Active (true|false)",n=>n==="true",true).option("--verified <bool>","Verified (true|false)",n=>n==="true",false).option("--contact-info <json>","Contact info JSON").option("--services <list>","Comma-separated services offered").option("-f, --format <format>","Output format").action(async n=>{try{let i={name:n.name,type:n.type,isActive:n.active??!0,isVerified:n.verified??!1};n.description&&(i.description=n.description),n.rating!==void 0&&(i.rating=n.rating),n.contactInfo&&(i.contactInfo=f("contact-info",n.contactInfo)),n.services&&(i.services=ze(n.services));let u=await o(De,{input:i});p(`Provider created: ${u.createServiceProvider.name}`),s(n,u.createServiceProvider);}catch(i){a(i);}}),t.command("update").description("Update a service provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--type <t>","Provider type").option("--description <s>","Description").option("--rating <n>","Rating",m).option("--active <bool>","Active (true|false)",n=>n==="true").option("--verified <bool>","Verified (true|false)",n=>n==="true").option("--contact-info <json>","Contact info JSON").option("--services <list>","Comma-separated services offered").option("-f, --format <format>","Output format").action(async(n,i)=>{try{let u={};if(i.name&&(u.name=i.name),i.type&&(u.type=i.type),i.description!==void 0&&(u.description=i.description),i.rating!==void 0&&(u.rating=i.rating),i.active!==void 0&&(u.isActive=i.active),i.verified!==void 0&&(u.isVerified=i.verified),i.contactInfo&&(u.contactInfo=f("contact-info",i.contactInfo)),i.services&&(u.services=ze(i.services)),!Object.keys(u).length)throw new l("No updates specified");let v=await o(Oe,{id:n,input:u});p("Provider updated"),s(i,v.updateServiceProvider);}catch(u){a(u);}}),t.command("remove").description("Delete a service provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(n,i)=>{try{let u=await o(Se,{id:n});p(`Provider ${n} deleted`),s(i,{deleted:u.deleteServiceProvider});}catch(u){a(u);}});let e=r.command("offerings").description("Service offerings");e.command("list").description("List service offerings").option("--provider <id>","Filter by provider ID").option("--category <c>","Filter by category").option("--query <q>","Free-text search").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async n=>{try{let i={};n.provider&&(i.providerId=n.provider),n.category&&(i.category=n.category.toUpperCase()),n.query&&(i.search=n.query);let u=await o(Re,{filter:Object.keys(i).length?i:void 0,pagination:y(n)});s(n,u.serviceOfferings,{headers:["ID","Name","Provider","Category","Price","Currency"],rows:u.serviceOfferings.map(v=>[g(v.id,12),v.name,g(v.providerId,12),v.category??"-",String(v.price),v.currency])});}catch(i){a(i);}}),e.command("get").description("Get a service offering by id").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(n,i)=>{try{let u=await o(ke,{id:n});if(!u.serviceOffering)throw new l(`Offering ${n} not found`);s(i,u.serviceOffering);}catch(u){a(u);}}),e.command("create").description("Create a service offering").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Offering name").requiredOption("--price <n>","Price",m).requiredOption("--category <c>","Category (FULL_TRUCKLOAD, LESS_THAN_TRUCKLOAD, LAST_MILE, EXPRESS, AIR_FREIGHT, OCEAN_FREIGHT, RAIL_FREIGHT, COLD_CHAIN, CUSTOMS_CLEARANCE, WAREHOUSING, OTHER)").option("--description <s>","Description").option("--currency <c>","Currency","USD").option("--availability <a>","Availability (AVAILABLE, LIMITED, UNAVAILABLE)").option("-f, --format <format>","Output format").action(async n=>{try{let i={providerId:n.provider,name:n.name,price:n.price,currency:n.currency??"USD"};n.description&&(i.description=n.description),i.category=n.category.toUpperCase(),n.availability&&(i.availability=n.availability.toUpperCase());let u=await o(Ae,{input:i});p(`Offering created: ${u.createServiceOffering.name}`),s(n,u.createServiceOffering);}catch(i){a(i);}}),e.command("update").description("Update a service offering").argument("<id>","Offering ID").option("--name <name>","Offering name").option("--description <s>","Description").option("--category <c>","Category").option("--price <n>","Price",m).option("--currency <c>","Currency").option("--availability <a>","Availability (AVAILABLE, LIMITED, UNAVAILABLE)").option("-f, --format <format>","Output format").action(async(n,i)=>{try{let u={};if(i.name&&(u.name=i.name),i.description!==void 0&&(u.description=i.description),i.category!==void 0&&(u.category=i.category.toUpperCase()),i.price!==void 0&&(u.price=i.price),i.currency&&(u.currency=i.currency),i.availability&&(u.availability=i.availability.toUpperCase()),!Object.keys(u).length)throw new l("No updates specified");let v=await o(xe,{id:n,input:u});p("Offering updated"),s(i,v.updateServiceOffering);}catch(u){a(u);}}),e.command("remove").description("Delete a service offering").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(n,i)=>{try{let u=await o(Ne,{id:n});p(`Offering ${n} deleted`),s(i,{deleted:u.deleteServiceOffering});}catch(u){a(u);}});}function ze(c){return c.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function Ye(c){let r=c.command("settings").description("Movethewheels module settings");r.command("get").description("Get module settings").option("-f, --format <format>","Output format").action(async t=>{try{let e=await o($e);s(t,e.mtwModuleSettings);}catch(e){a(e);}}),r.command("update").description("Update module settings (only the options passed are changed)").option("--currency <code>","Default ISO 4217 currency code").option("--delivery-window-hours <n>","Default delivery window in hours (1 to 720)",d).option("--order-priority <p>","Default order priority (LOW, MEDIUM, HIGH, URGENT, CRITICAL)").option("--distance-unit <u>","Distance unit (KM or MI)").option("--weight-unit <u>","Weight unit (KG or LB)").option("--timezone <tz>","IANA timezone").option("-f, --format <format>","Output format").action(async t=>{try{let e={};if(t.currency!==void 0&&(e.defaultCurrency=t.currency.toUpperCase()),t.deliveryWindowHours!==void 0&&(e.defaultDeliveryWindowHours=t.deliveryWindowHours),t.orderPriority!==void 0&&(e.defaultOrderPriority=t.orderPriority.toUpperCase()),t.distanceUnit!==void 0&&(e.distanceUnit=t.distanceUnit.toUpperCase()),t.weightUnit!==void 0&&(e.weightUnit=t.weightUnit.toUpperCase()),t.timezone!==void 0&&(e.timezone=t.timezone),Object.keys(e).length===0)throw new l("Pass at least one setting to update");let n=await o(Le,{input:e});p("Module settings updated"),s(t,n.updateMtwModuleSettings);}catch(e){a(e);}});}function Ke(c){let r=c.command("analytics").description("Movethewheels analytics & dashboards");r.command("dashboard").description("Dashboard metrics (orders, deliveries, revenue, fleet, low stock)").option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(_e);s(t,e.dashboardMetrics);}catch(e){a(e);}}),r.command("trends").description("Analytics time series (order, revenue, delivery trends)").option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(Pe);s(t,e.analytics);}catch(e){a(e);}}),r.command("finance").description("Finance metrics (revenue, fuel cost, open invoices)").option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(Ue);s(t,e.financeMetrics);}catch(e){a(e);}}),r.command("fleet").description("Fleet stats (vehicles & drivers by status)").option("-f, --format <format>","Output format").action(async t=>{try{let e=await o(Ve);s(t,e.fleetStats);}catch(e){a(e);}});}var dt={id:"movethewheels",version:"1.0.0",displayName:"Movethewheels",dependsOn:["auth","workspaces"],register(c,r){O(r);let t=c.command("movethewheels").description("Movethewheels logistics & fleet operations");Me(t),qe(t),Fe(t),We(t),je(t),Ge(t),Je(t),Be(t),Ye(t),Ke(t);}},ci=dt;module.exports=ci;
|