@burdenoff/cli-sdk 2026.1124.1 → 2026.1202.1
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/chunk-BGNPGKJM.js +1 -0
- package/dist/{chunk-ASSY2L5R.js → chunk-E6F56R4K.js} +3 -3
- package/dist/chunk-N7EXKGE2.js +34 -0
- package/dist/core/index.cjs +9 -9
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-BNVKV_pI.d.ts → module-DWSAfs3k.d.cts} +20 -19
- package/dist/{module-BNVKV_pI.d.cts → module-DWSAfs3k.d.ts} +20 -19
- package/dist/modules/adaptercloud/index.cjs +38 -38
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +2 -2
- package/dist/modules/artistrybase/index.cjs +50 -50
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +32 -32
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +34 -34
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +2 -2
- package/dist/modules/auth/index.cjs +34 -34
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +4 -4
- package/dist/modules/billing/index.cjs +18 -18
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +45 -45
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +2 -2
- package/dist/modules/buildmyiq/index.cjs +32 -32
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +2 -2
- package/dist/modules/channels/index.cjs +12 -12
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +34 -34
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +41 -41
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +2 -2
- package/dist/modules/conversations/index.cjs +32 -32
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +41 -41
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +2 -2
- package/dist/modules/cosmicintersection/index.cjs +43 -43
- package/dist/modules/cosmicintersection/index.d.cts +1 -1
- package/dist/modules/cosmicintersection/index.d.ts +1 -1
- package/dist/modules/cosmicintersection/index.js +2 -2
- package/dist/modules/crewfoundry/index.cjs +70 -70
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +2 -2
- package/dist/modules/devportal/index.cjs +23 -23
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +41 -41
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +2 -2
- package/dist/modules/eventfullymanaged/index.cjs +92 -92
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +2 -2
- package/dist/modules/export/index.cjs +14 -14
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +11 -11
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +2 -2
- package/dist/modules/fluidgrids/index.cjs +29 -29
- package/dist/modules/fluidgrids/index.d.cts +1 -1
- package/dist/modules/fluidgrids/index.d.ts +1 -1
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +21 -21
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +2 -2
- package/dist/modules/govcitizenhub/index.cjs +35 -35
- package/dist/modules/govcitizenhub/index.d.cts +1 -1
- package/dist/modules/govcitizenhub/index.d.ts +1 -1
- package/dist/modules/govcitizenhub/index.js +2 -2
- package/dist/modules/groups/index.cjs +12 -12
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +2 -2
- package/dist/modules/headshotmarketing/index.cjs +165 -165
- package/dist/modules/headshotmarketing/index.d.cts +1 -1
- package/dist/modules/headshotmarketing/index.d.ts +1 -1
- package/dist/modules/headshotmarketing/index.js +2 -2
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +43 -43
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +24 -24
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +27 -27
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +37 -37
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +2 -2
- package/dist/modules/kadaikodi/index.cjs +26 -26
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +44 -44
- package/dist/modules/labsofscience/index.d.cts +1 -1
- package/dist/modules/labsofscience/index.d.ts +1 -1
- package/dist/modules/labsofscience/index.js +2 -2
- package/dist/modules/manufacturedops/index.cjs +36 -36
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +2 -2
- package/dist/modules/movethewheels/index.cjs +78 -78
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/mybodyshield/index.cjs +36 -36
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +2 -2
- package/dist/modules/notifications/index.cjs +5 -5
- package/dist/modules/notifications/index.d.cts +1 -1
- package/dist/modules/notifications/index.d.ts +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs +5 -5
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +272 -272
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +2 -2
- package/dist/modules/products/index.cjs +19 -19
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +24 -24
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +2 -2
- package/dist/modules/rbac/index.cjs +8 -8
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +39 -39
- package/dist/modules/sandbox/index.d.cts +1 -1
- package/dist/modules/sandbox/index.d.ts +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +25 -25
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +14 -14
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +44 -44
- package/dist/modules/semanticfed/index.d.cts +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/semanticfed-sql/index.cjs +4 -4
- package/dist/modules/semanticfed-sql/index.d.cts +1 -1
- package/dist/modules/semanticfed-sql/index.d.ts +1 -1
- package/dist/modules/semanticfed-sql/index.js +1 -1
- package/dist/modules/store/index.cjs +21 -21
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +2 -2
- package/dist/modules/subscriberbot/index.cjs +41 -41
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +2 -2
- package/dist/modules/support/index.cjs +8 -8
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +2 -2
- package/dist/modules/tags/index.cjs +10 -10
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +2 -2
- package/dist/modules/technospam/index.cjs +44 -44
- package/dist/modules/technospam/index.d.cts +1 -1
- package/dist/modules/technospam/index.d.ts +1 -1
- package/dist/modules/technospam/index.js +2 -2
- package/dist/modules/theculturepost/index.cjs +32 -32
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +2 -2
- package/dist/modules/theglobalfuel/index.cjs +30 -30
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +2 -2
- package/dist/modules/timecampus/index.cjs +69 -69
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +4 -4
- package/dist/modules/tours/index.cjs +4 -4
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +460 -460
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +5 -5
- package/dist/modules/workspaces/index.cjs +16 -16
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +6 -1
- package/dist/chunk-3ZVMC2AF.js +0 -1
- package/dist/chunk-ZT6KOG7N.js +0 -34
|
@@ -1,33 +1,33 @@
|
|
|
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;}},E=class extends l{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},I=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};function T(o){if(o instanceof E||o instanceof l)return o;let r=O(o)&&O(o.response)?o.response:void 0,t=r?.errors,e=Array.isArray(t)?t[0]:void 0,n=(O(e)&&O(e.extensions)?e.extensions:void 0)?.code,u=r?.status;return n==="UNAUTHENTICATED"||u===401?new E("Authentication required."):n==="FORBIDDEN"||u===403?new l("Permission denied."):n==="BAD_USER_INPUT"||n==="GRAPHQL_VALIDATION_FAILED"||u===400?new l("Invalid request. Check the command arguments."):n==="NOT_FOUND"||u===404?new l("Requested resource was not found."):n==="RATE_LIMITED"||n==="TOO_MANY_REQUESTS"||u===429?new l("Request limit reached. Try again later."):new I("The request could not be completed. Try again later.")}var C=class extends Error{response;constructor(r,t){super(r),this.name="GqlRequestError",this.response=t;}};function O(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}var k=null;function N(o){k=o;}function D(){if(!k)throw new I("vibecontrols module helpers used before setHelpersContext was called");return k}function At(){let o=D();if(!o.auth.isAuthenticated())throw new E("Authentication required.",{hint:`Run \`${o.productName} auth login\` to authenticate.`})}async function s(o,r){return At(),D().gql.workspace.request(o,r)}function c(o){throw o instanceof E||o instanceof l||o instanceof I?o:o instanceof C||o!==null&&typeof o=="object"&&"response"in o?T(o):new I("The command could not be completed. Try again later.")}function a(o,r,t){D().output.formatAndOutput(o,r,t);}function p(o){D().output.printSuccess(o);}function f(o,r){return D().output.truncate(o,r)}var $=`
|
|
2
2
|
query MovethewheelsGetCustomer($id: ID!) {
|
|
3
3
|
customer(id: $id) {
|
|
4
4
|
id name email phone company type taxId businessLicense address rating
|
|
5
5
|
createdAt updatedAt createdBy updatedBy workspaceId
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,_=`
|
|
9
9
|
query MovethewheelsCustomers($filter: CustomerFilterInput, $pagination: PaginationInput) {
|
|
10
10
|
customers(filter: $filter, pagination: $pagination) {
|
|
11
11
|
id name email phone company type rating createdAt
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,L=`
|
|
15
15
|
mutation MovethewheelsCreateCustomer($input: CreateCustomerInput!) {
|
|
16
16
|
createCustomer(input: $input) {
|
|
17
17
|
id name email phone company type taxId businessLicense address rating createdAt
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
`,P=`
|
|
21
21
|
mutation MovethewheelsUpdateCustomer($id: ID!, $input: UpdateCustomerInput!) {
|
|
22
22
|
updateCustomer(id: $id, input: $input) {
|
|
23
23
|
id name email phone company type taxId businessLicense address rating updatedAt
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,U=`
|
|
27
27
|
mutation MovethewheelsDeleteCustomer($id: ID!) {
|
|
28
28
|
deleteCustomer(id: $id)
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,q=`
|
|
31
31
|
query MovethewheelsGetDriver($id: ID!) {
|
|
32
32
|
driver(id: $id) {
|
|
33
33
|
id employeeId firstName lastName email phone status licenseNumber
|
|
@@ -35,86 +35,86 @@
|
|
|
35
35
|
currentLocation performanceMetrics createdAt updatedAt workspaceId
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`,V=`
|
|
39
39
|
query MovethewheelsDrivers($filter: DriverFilterInput, $pagination: PaginationInput) {
|
|
40
40
|
drivers(filter: $filter, pagination: $pagination) {
|
|
41
41
|
id employeeId firstName lastName email phone status vehicleId rating createdAt
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`,
|
|
44
|
+
`,M=`
|
|
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
|
+
`,J=`
|
|
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
|
+
`,F=`
|
|
59
59
|
mutation MovethewheelsDeleteDriver($id: ID!) {
|
|
60
60
|
deleteDriver(id: $id)
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
62
|
+
`,W=`
|
|
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
|
+
`,j=`
|
|
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
|
+
`,G=`
|
|
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
|
+
`,H=`
|
|
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
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,Y=`
|
|
88
88
|
mutation MovethewheelsCreateVehicle($input: CreateVehicleInput!) {
|
|
89
89
|
createVehicle(input: $input) {
|
|
90
90
|
id vehicleNumber type status make model year licensePlate fuelLevel
|
|
91
91
|
mileage ownershipType createdAt
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
`,
|
|
94
|
+
`,z=`
|
|
95
95
|
mutation MovethewheelsUpdateVehicle($id: ID!, $input: UpdateVehicleInput!) {
|
|
96
96
|
updateVehicle(id: $id, input: $input) {
|
|
97
97
|
id vehicleNumber type status make model year licensePlate fuelLevel
|
|
98
98
|
mileage ownershipType updatedAt
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
`,
|
|
101
|
+
`,B=`
|
|
102
102
|
mutation MovethewheelsDeleteVehicle($id: ID!) {
|
|
103
103
|
deleteVehicle(id: $id)
|
|
104
104
|
}
|
|
105
|
-
`,
|
|
105
|
+
`,K=`
|
|
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
|
+
`,Q=`
|
|
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
|
+
`,Z=`
|
|
118
118
|
query MovethewheelsGetWarehouse($id: ID!) {
|
|
119
119
|
warehouse(id: $id) {
|
|
120
120
|
id code name type status address contactInfo operatingHours capabilities
|
|
@@ -122,48 +122,48 @@
|
|
|
122
122
|
locations { id locationCode locationType status zone aisle rack shelf bin capacity }
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
`,
|
|
125
|
+
`,X=`
|
|
126
126
|
query MovethewheelsWarehouses($filter: WarehouseFilterInput, $pagination: PaginationInput) {
|
|
127
127
|
warehouses(filter: $filter, pagination: $pagination) {
|
|
128
128
|
id code name type status totalCapacity usedCapacity createdAt
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
`,
|
|
131
|
+
`,ee=`
|
|
132
132
|
mutation MovethewheelsCreateWarehouse($input: CreateWarehouseInput!) {
|
|
133
133
|
createWarehouse(input: $input) {
|
|
134
134
|
id code name type status address totalCapacity usedCapacity createdAt
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
`,
|
|
137
|
+
`,te=`
|
|
138
138
|
mutation MovethewheelsUpdateWarehouse($id: ID!, $input: UpdateWarehouseInput!) {
|
|
139
139
|
updateWarehouse(id: $id, input: $input) {
|
|
140
140
|
id code name type status address totalCapacity usedCapacity updatedAt
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
`,
|
|
143
|
+
`,ie=`
|
|
144
144
|
mutation MovethewheelsDeleteWarehouse($id: ID!) {
|
|
145
145
|
deleteWarehouse(id: $id)
|
|
146
146
|
}
|
|
147
|
-
`,
|
|
147
|
+
`,ne=`
|
|
148
148
|
mutation MovethewheelsCreateWarehouseLocation($input: CreateWarehouseLocationInput!) {
|
|
149
149
|
createWarehouseLocation(input: $input) {
|
|
150
150
|
id warehouseId locationCode locationType status zone aisle rack shelf bin capacity createdAt
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
`,
|
|
153
|
+
`,re=`
|
|
154
154
|
mutation MovethewheelsUpdateWarehouseLocation($id: ID!, $input: UpdateWarehouseLocationInput!) {
|
|
155
155
|
updateWarehouseLocation(id: $id, input: $input) {
|
|
156
156
|
id warehouseId locationCode locationType status zone aisle rack shelf bin capacity updatedAt
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
`,
|
|
159
|
+
`,oe=`
|
|
160
160
|
query MovethewheelsGetInventoryItem($id: ID!) {
|
|
161
161
|
inventoryItem(id: $id) {
|
|
162
162
|
id cargoItemId warehouseId locationId onHand available allocated damaged reorderPoint safetyStock
|
|
163
163
|
unitCost createdAt updatedAt workspaceId
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
`,
|
|
166
|
+
`,se=`
|
|
167
167
|
query MovethewheelsInventoryItems(
|
|
168
168
|
$filter: InventoryFilterInput
|
|
169
169
|
$pagination: PaginationInput
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
id cargoItemId warehouseId onHand available allocated damaged reorderPoint unitCost createdAt
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
`,
|
|
175
|
+
`,ae=`
|
|
176
176
|
query MovethewheelsInventoryTransactions(
|
|
177
177
|
$filter: InventoryFilterInput
|
|
178
178
|
$pagination: PaginationInput
|
|
@@ -182,37 +182,37 @@
|
|
|
182
182
|
createdAt
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
`,
|
|
185
|
+
`,ce=`
|
|
186
186
|
query MovethewheelsInventoryStats {
|
|
187
187
|
inventoryStats {
|
|
188
188
|
totalOnHand totalAvailable totalAllocated totalDamaged lowStockCount
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
`,
|
|
191
|
+
`,de=`
|
|
192
192
|
mutation MovethewheelsCreateInventoryItem($input: CreateInventoryItemInput!) {
|
|
193
193
|
createInventoryItem(input: $input) {
|
|
194
194
|
id cargoItemId warehouseId locationId onHand available allocated damaged reorderPoint safetyStock
|
|
195
195
|
unitCost createdAt
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
`,
|
|
198
|
+
`,ue=`
|
|
199
199
|
mutation MovethewheelsUpdateInventoryItem($id: ID!, $input: UpdateInventoryItemInput!) {
|
|
200
200
|
updateInventoryItem(id: $id, input: $input) {
|
|
201
201
|
id cargoItemId warehouseId locationId onHand available allocated damaged reorderPoint safetyStock
|
|
202
202
|
unitCost updatedAt
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
`,
|
|
205
|
+
`,pe=`
|
|
206
206
|
mutation MovethewheelsDeleteInventoryItem($id: ID!) {
|
|
207
207
|
deleteInventoryItem(id: $id)
|
|
208
208
|
}
|
|
209
|
-
`,
|
|
209
|
+
`,le=`
|
|
210
210
|
mutation MovethewheelsAdjustInventoryStock($input: AdjustInventoryStockInput!) {
|
|
211
211
|
adjustInventoryStock(input: $input) {
|
|
212
212
|
id cargoItemId warehouseId onHand available allocated damaged updatedAt
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
`,
|
|
215
|
+
`,me=`
|
|
216
216
|
mutation MovethewheelsCreateInventoryTransaction($input: CreateInventoryTransactionInput!) {
|
|
217
217
|
createInventoryTransaction(input: $input) {
|
|
218
218
|
id transactionNumber type cargoItemId warehouseId quantity unitCost referenceType referenceId notes
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
`,b=`
|
|
223
223
|
id deliveryJobNumber status priority customerId driverId vehicleId routeId storeOrderId
|
|
224
224
|
scheduledDelivery trackingNumber createdAt
|
|
225
|
-
`,
|
|
225
|
+
`,fe=`
|
|
226
226
|
query MovethewheelsGetDeliveryJob($id: ID!) {
|
|
227
227
|
deliveryJob(id: $id) {
|
|
228
228
|
${b}
|
|
@@ -234,48 +234,48 @@
|
|
|
234
234
|
statusHistory { id previousStatus status notes location createdAt }
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
`,
|
|
237
|
+
`,ge=`
|
|
238
238
|
query MovethewheelsDeliveryJobs($filter: DeliveryJobFilterInput, $pagination: PaginationInput) {
|
|
239
239
|
deliveryJobs(filter: $filter, pagination: $pagination) { ${b} }
|
|
240
240
|
}
|
|
241
|
-
`,
|
|
241
|
+
`,ye=`
|
|
242
242
|
query MovethewheelsDeliveryJobsCount($filter: DeliveryJobFilterInput) {
|
|
243
243
|
deliveryJobsCount(filter: $filter)
|
|
244
244
|
}
|
|
245
|
-
`,
|
|
245
|
+
`,he=`
|
|
246
246
|
query MovethewheelsDeliveryJobStats {
|
|
247
247
|
deliveryJobStats {
|
|
248
248
|
total pending confirmed assigned pickedUp inTransit outForDelivery delivered failed
|
|
249
249
|
returned cancelled
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
252
|
+
`,ve=`
|
|
253
253
|
query MovethewheelsDeliveryJobTracking($deliveryJobId: ID!, $pagination: PaginationInput) {
|
|
254
254
|
deliveryJobTracking(deliveryJobId: $deliveryJobId, pagination: $pagination) {
|
|
255
255
|
id shipmentId eventType details location timestamp
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
`,
|
|
258
|
+
`,Ie=`
|
|
259
259
|
query MovethewheelsMyPendingEpodDeliveryJobs($pagination: PaginationInput) {
|
|
260
260
|
myPendingEpodDeliveryJobs(pagination: $pagination) { ${b} }
|
|
261
261
|
}
|
|
262
|
-
`,
|
|
262
|
+
`,we=`
|
|
263
263
|
query MovethewheelsMyPendingEpodDeliveryJobsCount { myPendingEpodDeliveryJobsCount }
|
|
264
|
-
`,
|
|
264
|
+
`,Ee=`
|
|
265
265
|
mutation MovethewheelsCreateDeliveryJob($input: CreateDeliveryJobInput!) {
|
|
266
266
|
createDeliveryJob(input: $input) { ${b} }
|
|
267
267
|
}
|
|
268
|
-
`,
|
|
268
|
+
`,be=`
|
|
269
269
|
mutation MovethewheelsUpdateDeliveryJob($id: ID!, $input: UpdateDeliveryJobInput!) {
|
|
270
270
|
updateDeliveryJob(id: $id, input: $input) { ${b} }
|
|
271
271
|
}
|
|
272
|
-
`,
|
|
272
|
+
`,Ce=`
|
|
273
273
|
mutation MovethewheelsUpdateDeliveryJobStatus($id: ID!, $input: UpdateDeliveryJobStatusInput!) {
|
|
274
274
|
updateDeliveryJobStatus(id: $id, input: $input) { ${b} }
|
|
275
275
|
}
|
|
276
|
-
`,
|
|
276
|
+
`,De=`
|
|
277
277
|
mutation MovethewheelsDeleteDeliveryJob($id: ID!) { deleteDeliveryJob(id: $id) }
|
|
278
|
-
`,
|
|
278
|
+
`,Oe=`
|
|
279
279
|
query MovethewheelsGetShipment($id: ID!) {
|
|
280
280
|
shipment(id: $id) {
|
|
281
281
|
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber origin destination
|
|
@@ -283,56 +283,56 @@
|
|
|
283
283
|
trackingEvents { id eventType details location timestamp }
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
`,
|
|
286
|
+
`,Te=`
|
|
287
287
|
query MovethewheelsShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {
|
|
288
288
|
shipments(filter: $filter, pagination: $pagination) {
|
|
289
289
|
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber
|
|
290
290
|
estimatedDelivery createdAt
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
`,
|
|
293
|
+
`,ke=`
|
|
294
294
|
query MovethewheelsActiveDeliveries($pagination: PaginationInput) {
|
|
295
295
|
activeDeliveries(pagination: $pagination) {
|
|
296
296
|
id shipmentNumber deliveryJobId storeOrderId status trackingNumber estimatedDelivery createdAt
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
`,
|
|
299
|
+
`,Se=`
|
|
300
300
|
query MovethewheelsShipmentTracking($shipmentId: ID!, $pagination: PaginationInput) {
|
|
301
301
|
shipmentTracking(shipmentId: $shipmentId, pagination: $pagination) {
|
|
302
302
|
id shipmentId eventType details location timestamp createdAt
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
`,
|
|
305
|
+
`,Re=`
|
|
306
306
|
query MovethewheelsTrackingAlerts($pagination: PaginationInput) {
|
|
307
307
|
trackingAlerts(pagination: $pagination) {
|
|
308
308
|
alertType message shipmentId shipmentNumber
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
`,
|
|
311
|
+
`,Ae=`
|
|
312
312
|
mutation MovethewheelsCreateShipment($input: CreateShipmentInput!) {
|
|
313
313
|
createShipment(input: $input) {
|
|
314
314
|
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber origin destination
|
|
315
315
|
estimatedDelivery createdAt
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
`,
|
|
318
|
+
`,xe=`
|
|
319
319
|
mutation MovethewheelsUpdateShipment($id: ID!, $input: UpdateShipmentInput!) {
|
|
320
320
|
updateShipment(id: $id, input: $input) {
|
|
321
321
|
id shipmentNumber customerId carrierId deliveryJobId storeOrderId status trackingNumber origin destination
|
|
322
322
|
estimatedDelivery actualDelivery updatedAt
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
`,
|
|
325
|
+
`,Ne=`
|
|
326
326
|
mutation MovethewheelsDeleteShipment($id: ID!) {
|
|
327
327
|
deleteShipment(id: $id)
|
|
328
328
|
}
|
|
329
|
-
|
|
329
|
+
`,$e=`
|
|
330
330
|
mutation MovethewheelsAddTrackingEvent($input: AddTrackingEventInput!) {
|
|
331
331
|
addTrackingEvent(input: $input) {
|
|
332
332
|
id shipmentId eventType details location timestamp createdAt
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
`,
|
|
335
|
+
`,_e=`
|
|
336
336
|
query MovethewheelsGetRoute($id: ID!) {
|
|
337
337
|
route(id: $id) {
|
|
338
338
|
id name status driverId vehicleId shipmentId waypoints
|
|
@@ -340,38 +340,38 @@
|
|
|
340
340
|
fuelCost createdAt updatedAt workspaceId
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
`,
|
|
343
|
+
`,Le=`
|
|
344
344
|
query MovethewheelsRoutes($filter: RouteFilterInput, $pagination: PaginationInput) {
|
|
345
345
|
routes(filter: $filter, pagination: $pagination) {
|
|
346
346
|
id name status driverId vehicleId shipmentId estimatedDistance
|
|
347
347
|
estimatedDuration fuelCost createdAt
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
|
|
350
|
+
`,Pe=`
|
|
351
351
|
mutation MovethewheelsCreateRoute($input: CreateRouteInput!) {
|
|
352
352
|
createRoute(input: $input) {
|
|
353
353
|
id name status driverId vehicleId shipmentId waypoints
|
|
354
354
|
estimatedDistance estimatedDuration fuelCost createdAt
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
`,
|
|
357
|
+
`,Ue=`
|
|
358
358
|
mutation MovethewheelsUpdateRoute($id: ID!, $input: UpdateRouteInput!) {
|
|
359
359
|
updateRoute(id: $id, input: $input) {
|
|
360
360
|
id name status driverId vehicleId shipmentId waypoints
|
|
361
361
|
estimatedDistance actualDistance estimatedDuration actualDuration fuelCost updatedAt
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
`,
|
|
364
|
+
`,qe=`
|
|
365
365
|
mutation MovethewheelsDeleteRoute($id: ID!) {
|
|
366
366
|
deleteRoute(id: $id)
|
|
367
367
|
}
|
|
368
|
-
`,
|
|
368
|
+
`,Ve=`
|
|
369
369
|
mutation MovethewheelsOptimizeRoute($id: ID!) {
|
|
370
370
|
optimizeRoute(id: $id) {
|
|
371
371
|
id name status estimatedDistance estimatedDuration fuelCost waypoints updatedAt
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
`,
|
|
374
|
+
`,Me=`
|
|
375
375
|
query MovethewheelsGetServiceProvider($id: ID!) {
|
|
376
376
|
serviceProvider(id: $id) {
|
|
377
377
|
id name type description isActive isVerified rating contactInfo services
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
offerings { id name category price currency }
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
`,
|
|
382
|
+
`,Je=`
|
|
383
383
|
query MovethewheelsServiceProviders(
|
|
384
384
|
$filter: MtwServiceProviderFilterInput
|
|
385
385
|
$pagination: PaginationInput
|
|
@@ -388,13 +388,13 @@
|
|
|
388
388
|
id name type description isActive isVerified rating createdAt
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
`,
|
|
391
|
+
`,Fe=`
|
|
392
392
|
mutation MovethewheelsCreateServiceProvider($input: MtwCreateServiceProviderInput!) {
|
|
393
393
|
createServiceProvider(input: $input) {
|
|
394
394
|
id name type description isActive isVerified rating createdAt
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
`,
|
|
397
|
+
`,We=`
|
|
398
398
|
mutation MovethewheelsUpdateServiceProvider(
|
|
399
399
|
$id: ID!
|
|
400
400
|
$input: MtwUpdateServiceProviderInput!
|
|
@@ -403,18 +403,18 @@
|
|
|
403
403
|
id name type description isActive isVerified rating updatedAt
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
`,
|
|
406
|
+
`,je=`
|
|
407
407
|
mutation MovethewheelsDeleteServiceProvider($id: ID!) {
|
|
408
408
|
deleteServiceProvider(id: $id)
|
|
409
409
|
}
|
|
410
|
-
`,
|
|
410
|
+
`,Ge=`
|
|
411
411
|
query MovethewheelsGetServiceOffering($id: ID!) {
|
|
412
412
|
serviceOffering(id: $id) {
|
|
413
413
|
id providerId name description category price currency availability
|
|
414
414
|
createdAt updatedAt workspaceId
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
`,
|
|
417
|
+
`,He=`
|
|
418
418
|
query MovethewheelsServiceOfferings(
|
|
419
419
|
$filter: MtwServiceOfferingFilterInput
|
|
420
420
|
$pagination: PaginationInput
|
|
@@ -423,13 +423,13 @@
|
|
|
423
423
|
id providerId name category price currency createdAt
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
`,
|
|
426
|
+
`,Ye=`
|
|
427
427
|
mutation MovethewheelsCreateServiceOffering($input: MtwCreateServiceOfferingInput!) {
|
|
428
428
|
createServiceOffering(input: $input) {
|
|
429
429
|
id providerId name description category price currency availability createdAt
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
`,
|
|
432
|
+
`,ze=`
|
|
433
433
|
mutation MovethewheelsUpdateServiceOffering(
|
|
434
434
|
$id: ID!
|
|
435
435
|
$input: MtwUpdateServiceOfferingInput!
|
|
@@ -438,25 +438,25 @@
|
|
|
438
438
|
id providerId name description category price currency availability updatedAt
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
`,
|
|
441
|
+
`,Be=`
|
|
442
442
|
mutation MovethewheelsDeleteServiceOffering($id: ID!) {
|
|
443
443
|
deleteServiceOffering(id: $id)
|
|
444
444
|
}
|
|
445
|
-
`,
|
|
445
|
+
`,Ke=`
|
|
446
446
|
query MovethewheelsModuleSettings {
|
|
447
447
|
mtwModuleSettings {
|
|
448
448
|
workspaceId defaultCurrency defaultDeliveryWindowHours defaultOrderPriority
|
|
449
449
|
distanceUnit weightUnit timezone isCustomized updatedAt updatedBy
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
`,
|
|
452
|
+
`,Qe=`
|
|
453
453
|
mutation MovethewheelsUpdateModuleSettings($input: UpdateMtwModuleSettingsInput!) {
|
|
454
454
|
updateMtwModuleSettings(input: $input) {
|
|
455
455
|
workspaceId defaultCurrency defaultDeliveryWindowHours defaultOrderPriority
|
|
456
456
|
distanceUnit weightUnit timezone isCustomized updatedAt updatedBy
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
`,
|
|
459
|
+
`,Ze=`
|
|
460
460
|
query MovethewheelsAnalytics {
|
|
461
461
|
analytics {
|
|
462
462
|
orderTrend { label value }
|
|
@@ -464,24 +464,24 @@
|
|
|
464
464
|
deliveryTrend { label value }
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
`,
|
|
467
|
+
`,Xe=`
|
|
468
468
|
query MovethewheelsDashboardMetrics {
|
|
469
469
|
dashboardMetrics {
|
|
470
470
|
activeDeliveries totalRevenue activeVehicles availableDrivers lowStockItems
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
`,
|
|
473
|
+
`,et=`
|
|
474
474
|
query MovethewheelsFinanceMetrics {
|
|
475
475
|
financeMetrics {
|
|
476
476
|
fuelCost openInvoices
|
|
477
477
|
revenue { totalRevenue deliveredRevenue averageOrderValue }
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
`,
|
|
480
|
+
`,tt=`
|
|
481
481
|
query MovethewheelsFleetStats {
|
|
482
482
|
fleetStats {
|
|
483
483
|
totalVehicles activeVehicles inTransitVehicles maintenanceVehicles
|
|
484
484
|
totalDrivers availableDrivers onDeliveryDrivers
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
`;function l(o,r){try{return JSON.parse(r)}catch{throw new m(`--${o} must be valid JSON`)}}function d(o){let r=Number.parseInt(o,10);if(Number.isNaN(r))throw new m(`Expected an integer but got "${o}"`);return r}function g(o){let r=Number.parseFloat(o);if(Number.isNaN(r))throw new m(`Expected a number but got "${o}"`);return r}function h(o){let r={};return o.limit!==void 0&&(r.limit=o.limit),o.offset!==void 0&&(r.offset=o.offset),Object.keys(r).length?r:void 0}function Xe(o){let r=o.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 i=await s(x,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.customers,{headers:["ID","Name","Type","Email","Phone","Rating"],rows:i.customers.map(n=>[f(n.id,12),n.name,n.type,n.email??"-",n.phone??"-",n.rating!=null?String(n.rating):"-"])});}catch(e){c(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 i=await s(A,{id:t});if(!i.customer)throw new m(`Customer ${t} not found`);a(e,i.customer);}catch(i){c(i);}}),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",g).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=l("address",t.address));let i=await s(N,{input:e});p(`Customer created: ${i.createCustomer.name}`),a(t,i.createCustomer);}catch(e){c(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",g).option("--address <json>","Address JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.name&&(i.name=e.name),e.email!==void 0&&(i.email=e.email),e.phone!==void 0&&(i.phone=e.phone),e.company!==void 0&&(i.company=e.company),e.type&&(i.type=e.type),e.taxId!==void 0&&(i.taxId=e.taxId),e.businessLicense!==void 0&&(i.businessLicense=e.businessLicense),e.rating!==void 0&&(i.rating=e.rating),e.address&&(i.address=l("address",e.address)),!Object.keys(i).length)throw new m("No updates specified");let n=await s($,{id:t,input:i});p("Customer updated"),a(e,n.updateCustomer);}catch(i){c(i);}}),r.command("remove").description("Delete a customer").argument("<id>","Customer ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(L,{id:t});p(`Customer ${t} deleted`),a(e,{deleted:i.deleteCustomer});}catch(i){c(i);}});}function et(o){let r=o.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 i=await s(P,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.drivers,{headers:["ID","Name","Employee","Status","Vehicle","Rating"],rows:i.drivers.map(n=>[f(n.id,12),`${n.firstName} ${n.lastName}`,n.employeeId,n.status,n.vehicleId?f(n.vehicleId,12):"-",n.rating!=null?String(n.rating):"-"])});}catch(e){c(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 i=await s(_,{id:t});if(!i.driver)throw new m(`Driver ${t} not found`);a(e,i.driver);}catch(i){c(i);}}),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",g).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=l("certifications",t.certifications)),t.currentLocation&&(e.currentLocation=l("current-location",t.currentLocation));let i=await s(U,{input:e});p(`Driver created: ${i.createDriver.firstName} ${i.createDriver.lastName}`),a(t,i.createDriver);}catch(e){c(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",g).option("--certifications <json>","Certifications JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.firstName&&(i.firstName=e.firstName),e.lastName&&(i.lastName=e.lastName),e.email!==void 0&&(i.email=e.email),e.phone!==void 0&&(i.phone=e.phone),e.status&&(i.status=e.status.toUpperCase()),e.licenseNumber!==void 0&&(i.licenseNumber=e.licenseNumber),e.licenseClass!==void 0&&(i.licenseClass=e.licenseClass),e.licenseExpiry&&(i.licenseExpiry=e.licenseExpiry),e.vehicleId!==void 0&&(i.vehicleId=e.vehicleId),e.rating!==void 0&&(i.rating=e.rating),e.certifications&&(i.certifications=l("certifications",e.certifications)),e.currentLocation&&(i.currentLocation=l("current-location",e.currentLocation)),!Object.keys(i).length)throw new m("No updates specified");let n=await s(q,{id:t,input:i});p("Driver updated"),a(e,n.updateDriver);}catch(i){c(i);}}),r.command("remove").description("Delete a driver").argument("<id>","Driver ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(V,{id:t});p(`Driver ${t} deleted`),a(e,{deleted:i.deleteDriver});}catch(i){c(i);}}),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 i=await s(M,{id:t,status:e.status.toUpperCase()});p(`Driver status set to ${i.updateDriverStatus.status}`),a(e,i.updateDriverStatus);}catch(i){c(i);}}),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 i=await s(J,{id:t,vehicleId:e.vehicle});p(e.vehicle?`Vehicle ${e.vehicle} assigned`:"Vehicle assignment cleared"),a(e,i.assignDriverVehicle);}catch(i){c(i);}});}function tt(o){let r=o.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 i=await s(W,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.vehicles,{headers:["ID","Number","Type","Status","Make/Model","Plate"],rows:i.vehicles.map(n=>[f(n.id,12),n.vehicleNumber,n.type,n.status,`${n.make??"-"} ${n.model??""}`.trim(),n.licensePlate??"-"])});}catch(e){c(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 i=await s(F,{id:t});if(!i.vehicle)throw new m(`Vehicle ${t} not found`);a(e,i.vehicle);}catch(i){c(i);}}),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",g).option("--mileage <n>","Mileage",g).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=l("capacity",t.capacity)),t.currentLocation&&(e.currentLocation=l("current-location",t.currentLocation));let i=await s(j,{input:e});p(`Vehicle created: ${i.createVehicle.vehicleNumber}`),a(t,i.createVehicle);}catch(e){c(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",g).option("--mileage <n>","Mileage",g).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 i={};if(e.number&&(i.vehicleNumber=e.number),e.type&&(i.type=e.type.toUpperCase()),e.status&&(i.status=e.status.toUpperCase()),e.make!==void 0&&(i.make=e.make),e.model!==void 0&&(i.model=e.model),e.year!==void 0&&(i.year=e.year),e.licensePlate!==void 0&&(i.licensePlate=e.licensePlate),e.fuelLevel!==void 0&&(i.fuelLevel=e.fuelLevel),e.mileage!==void 0&&(i.mileage=e.mileage),e.ownershipType!==void 0&&(i.ownershipType=e.ownershipType),e.capacity&&(i.capacity=l("capacity",e.capacity)),e.currentLocation&&(i.currentLocation=l("current-location",e.currentLocation)),!Object.keys(i).length)throw new m("No updates specified");let n=await s(G,{id:t,input:i});p("Vehicle updated"),a(e,n.updateVehicle);}catch(i){c(i);}}),r.command("remove").description("Delete a vehicle").argument("<id>","Vehicle ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(H,{id:t});p(`Vehicle ${t} deleted`),a(e,{deleted:i.deleteVehicle});}catch(i){c(i);}}),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 i=await s(z,{id:t,status:e.status.toUpperCase()});p(`Vehicle status set to ${i.updateVehicleStatus.status}`),a(e,i.updateVehicleStatus);}catch(i){c(i);}}),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 i=l("location",e.location),n=await s(Y,{id:t,location:i});p("Vehicle location updated"),a(e,n.updateVehicleLocation);}catch(i){c(i);}});}function it(o){let r=o.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 i=await s(K,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.warehouses,{headers:["ID","Code","Name","Type","Status","Capacity"],rows:i.warehouses.map(n=>[f(n.id,12),n.code,n.name,n.type,n.status,`${n.usedCapacity??0}/${n.totalCapacity??0}`])});}catch(e){c(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 i=await s(B,{id:t});if(!i.warehouse)throw new m(`Warehouse ${t} not found`);a(e,i.warehouse);}catch(i){c(i);}}),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",g).option("--used-capacity <n>","Used capacity",g).option("-f, --format <format>","Output format").action(async t=>{try{let e={code:t.code,name:t.name,type:t.type.toUpperCase(),address:l("address",t.address),status:t.status??"ACTIVE"};t.contactInfo&&(e.contactInfo=l("contact-info",t.contactInfo)),t.operatingHours&&(e.operatingHours=l("operating-hours",t.operatingHours)),t.capabilities&&(e.capabilities=l("capabilities",t.capabilities)),t.totalCapacity!==void 0&&(e.totalCapacity=t.totalCapacity),t.usedCapacity!==void 0&&(e.usedCapacity=t.usedCapacity);let i=await s(Q,{input:e});p(`Warehouse created: ${i.createWarehouse.name}`),a(t,i.createWarehouse);}catch(e){c(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",g).option("--used-capacity <n>","Used capacity",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.code&&(i.code=e.code),e.name&&(i.name=e.name),e.type&&(i.type=e.type.toUpperCase()),e.status&&(i.status=e.status),e.address&&(i.address=l("address",e.address)),e.contactInfo&&(i.contactInfo=l("contact-info",e.contactInfo)),e.operatingHours&&(i.operatingHours=l("operating-hours",e.operatingHours)),e.capabilities&&(i.capabilities=l("capabilities",e.capabilities)),e.totalCapacity!==void 0&&(i.totalCapacity=e.totalCapacity),e.usedCapacity!==void 0&&(i.usedCapacity=e.usedCapacity),!Object.keys(i).length)throw new m("No updates specified");let n=await s(Z,{id:t,input:i});p("Warehouse updated"),a(e,n.updateWarehouse);}catch(i){c(i);}}),r.command("remove").description("Delete a warehouse").argument("<id>","Warehouse ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(X,{id:t});p(`Warehouse ${t} deleted`),a(e,{deleted:i.deleteWarehouse});}catch(i){c(i);}}),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",g).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 i=await s(ee,{input:e});p(`Location created: ${i.createWarehouseLocation.locationCode}`),a(t,i.createWarehouseLocation);}catch(e){c(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",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.code&&(i.locationCode=e.code),e.locationType!==void 0&&(i.locationType=e.locationType),e.status&&(i.status=e.status),e.zone!==void 0&&(i.zone=e.zone),e.aisle!==void 0&&(i.aisle=e.aisle),e.rack!==void 0&&(i.rack=e.rack),e.shelf!==void 0&&(i.shelf=e.shelf),e.bin!==void 0&&(i.bin=e.bin),e.capacity!==void 0&&(i.capacity=e.capacity),!Object.keys(i).length)throw new m("No updates specified");let n=await s(te,{id:t,input:i});p("Location updated"),a(e,n.updateWarehouseLocation);}catch(i){c(i);}});}function nt(o){let r={};return o.cargoItem&&(r.cargoItemId=o.cargoItem),o.warehouse&&(r.warehouseId=o.warehouse),o.location&&(r.locationId=o.location),o.query&&(r.search=o.query),Object.keys(r).length?r:void 0}function rt(o){let r=o.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 s(ne,{filter:nt(t),pagination:h(t)});a(t,e.inventoryItems,{headers:["ID","Cargo item","Warehouse","OnHand","Available","Allocated"],rows:e.inventoryItems.map(i=>[f(i.id,12),f(i.cargoItemId,12),f(i.warehouseId,12),String(i.onHand),String(i.available),String(i.allocated)])});}catch(e){c(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 i=await s(ie,{id:t});if(!i.inventoryItem)throw new m(`Inventory item ${t} not found`);a(e,i.inventoryItem);}catch(i){c(i);}}),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 s(oe);a(t,e.inventoryStats);}catch(e){c(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",g).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 i=await s(se,{input:e});p("Inventory item created"),a(t,i.createInventoryItem);}catch(e){c(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",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.location!==void 0&&(i.locationId=e.location),e.onHand!==void 0&&(i.onHand=e.onHand),e.available!==void 0&&(i.available=e.available),e.allocated!==void 0&&(i.allocated=e.allocated),e.damaged!==void 0&&(i.damaged=e.damaged),e.reorderPoint!==void 0&&(i.reorderPoint=e.reorderPoint),e.safetyStock!==void 0&&(i.safetyStock=e.safetyStock),e.unitCost!==void 0&&(i.unitCost=e.unitCost),!Object.keys(i).length)throw new m("No updates specified");let n=await s(ae,{id:t,input:i});p("Inventory item updated"),a(e,n.updateInventoryItem);}catch(i){c(i);}}),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 i=await s(ce,{id:t});p(`Inventory item ${t} deleted`),a(e,{deleted:i.deleteInventoryItem});}catch(i){c(i);}}),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 i={id:t};if(e.onHand!==void 0&&(i.onHand=e.onHand),e.available!==void 0&&(i.available=e.available),e.allocated!==void 0&&(i.allocated=e.allocated),e.damaged!==void 0&&(i.damaged=e.damaged),Object.keys(i).length===1)throw new m("No stock adjustments specified");let n=await s(de,{input:i});p("Inventory stock adjusted"),a(e,n.adjustInventoryStock);}catch(i){c(i);}}),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 s(re,{filter:nt(t),pagination:h(t)});a(t,e.inventoryTransactions,{headers:["ID","Number","Type","Cargo item","Warehouse","Qty"],rows:e.inventoryTransactions.map(i=>[f(i.id,12),i.transactionNumber,i.type,f(i.cargoItemId,12),f(i.warehouseId,12),String(i.quantity)])});}catch(e){c(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",g).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 i=await s(ue,{input:e});p(`Transaction recorded: ${i.createInventoryTransaction.transactionNumber}`),a(t,i.createInventoryTransaction);}catch(e){c(e);}});}var O="PENDING|CONFIRMED|ASSIGNED|PICKED_UP|IN_TRANSIT|OUT_FOR_DELIVERY|DELIVERED|FAILED|RETURNED|CANCELLED",T="LOW|MEDIUM|HIGH|URGENT|CRITICAL",ot=["ID","Job #","Status","Priority","Driver","Store order","Scheduled"];function st(o){return o.map(r=>[f(r.id,12),r.deliveryJobNumber,r.status,r.priority,f(r.driverId??"-",12),f(r.storeOrderId??"-",12),r.scheduledDelivery??"-"])}function at(o){let r={};return o.status&&(r.status=o.status.toUpperCase()),o.priority&&(r.priority=o.priority.toUpperCase()),o.customer&&(r.customerId=o.customer),o.driver&&(r.driverId=o.driver),o.vehicle&&(r.vehicleId=o.vehicle),o.route&&(r.routeId=o.route),o.storeOrder&&(r.storeOrderId=o.storeOrder),o.unassigned&&(r.unassigned=true),o.query&&(r.search=o.query),Object.keys(r).length?r:void 0}function ct(o){return o.option("--status <s>",`Filter by status (${O})`).option("--priority <p>",`Filter by priority (${T})`).option("--customer <id>","Filter by customer ID").option("--driver <id>","Filter by driver ID").option("--vehicle <id>","Filter by vehicle ID").option("--route <id>","Filter by route ID").option("--store-order <id>","Filter by the store order the job delivers").option("--unassigned","Only jobs with no driver assigned").option("--query <q>","Free-text search")}function dt(o){let r=o.command("delivery-jobs").description("Movethewheels delivery jobs (dispatch units linked to store orders)");ct(r.command("list").description("List delivery jobs")).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 s(le,{filter:at(t),pagination:h(t)});a(t,e.deliveryJobs,{headers:ot,rows:st(e.deliveryJobs)});}catch(e){c(e);}}),ct(r.command("count").description("Count delivery jobs matching a filter")).option("-f, --format <format>","Output format").action(async t=>{try{let e=await s(me,{filter:at(t)});a(t,{count:e.deliveryJobsCount});}catch(e){c(e);}}),r.command("get").description("Get a delivery job (customer, driver, vehicle, shipment, status history)").argument("<id>","Delivery job ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(pe,{id:t});if(!i.deliveryJob)throw new m(`Delivery job ${t} not found`);a(e,i.deliveryJob);}catch(i){c(i);}}),r.command("stats").description("Delivery job counts by status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await s(fe);a(t,e.deliveryJobStats);}catch(e){c(e);}}),r.command("tracking").description("Tracking events of the shipment that fulfils a delivery job").argument("<id>","Delivery job 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 i=await s(ge,{deliveryJobId:t,pagination:h(e)});a(e,i.deliveryJobTracking,{headers:["ID","Event","Details","Timestamp"],rows:i.deliveryJobTracking.map(n=>[f(n.id,12),n.eventType,f(n.details??"-",30),n.timestamp])});}catch(i){c(i);}}),r.command("create").description("Create a delivery job").requiredOption("--number <s>","Delivery job number").requiredOption("--customer <id>","Customer ID").requiredOption("--cargo-items <json>","Cargo items JSON array").requiredOption("--pickup-address <json>","Pickup address JSON").requiredOption("--delivery-address <json>","Delivery address JSON").option("--store-order <id>","Store order the job delivers").option("--priority <p>",`Priority (${T}); server default MEDIUM`).option("--status <s>",`Initial status (${O}); server default PENDING`).option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--route <id>","Route ID").option("--scheduled-delivery <s>","Scheduled delivery (ISO date)").option("--special-instructions <s>","Special instructions").option("--tracking-number <s>","Tracking number").option("--pricing <json>","Pricing JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={deliveryJobNumber:t.number,customerId:t.customer,cargoItems:l("cargo-items",t.cargoItems),pickupAddress:l("pickup-address",t.pickupAddress),deliveryAddress:l("delivery-address",t.deliveryAddress)};t.storeOrder&&(e.storeOrderId=t.storeOrder),t.priority&&(e.priority=t.priority.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.driver&&(e.driverId=t.driver),t.vehicle&&(e.vehicleId=t.vehicle),t.route&&(e.routeId=t.route),t.scheduledDelivery&&(e.scheduledDelivery=t.scheduledDelivery),t.specialInstructions&&(e.specialInstructions=t.specialInstructions),t.trackingNumber&&(e.trackingNumber=t.trackingNumber),t.pricing&&(e.pricing=l("pricing",t.pricing));let i=await s(ve,{input:e});p(`Delivery job created: ${i.createDeliveryJob.deliveryJobNumber}`),a(t,i.createDeliveryJob);}catch(e){c(e);}}),r.command("update").description("Update a delivery job (use set-status to move it through its lifecycle)").argument("<id>","Delivery job ID").option("--customer <id>","Customer ID").option("--store-order <id>","Store order the job delivers").option("--priority <p>",`Priority (${T})`).option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--route <id>","Route ID").option("--cargo-items <json>","Cargo items JSON array").option("--pickup-address <json>","Pickup address JSON").option("--delivery-address <json>","Delivery address JSON").option("--scheduled-delivery <s>","Scheduled delivery (ISO date)").option("--special-instructions <s>","Special instructions").option("--tracking-number <s>","Tracking number").option("--pricing <json>","Pricing JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.customer&&(i.customerId=e.customer),e.storeOrder&&(i.storeOrderId=e.storeOrder),e.priority&&(i.priority=e.priority.toUpperCase()),e.driver&&(i.driverId=e.driver),e.vehicle&&(i.vehicleId=e.vehicle),e.route&&(i.routeId=e.route),e.cargoItems&&(i.cargoItems=l("cargo-items",e.cargoItems)),e.pickupAddress&&(i.pickupAddress=l("pickup-address",e.pickupAddress)),e.deliveryAddress&&(i.deliveryAddress=l("delivery-address",e.deliveryAddress)),e.scheduledDelivery&&(i.scheduledDelivery=e.scheduledDelivery),e.specialInstructions&&(i.specialInstructions=e.specialInstructions),e.trackingNumber&&(i.trackingNumber=e.trackingNumber),e.pricing&&(i.pricing=l("pricing",e.pricing)),!Object.keys(i).length)throw new m("No updates specified");let n=await s(Ie,{id:t,input:i});p("Delivery job updated"),a(e,n.updateDeliveryJob);}catch(i){c(i);}}),r.command("set-status").description("Move a delivery job to a new status (recorded in its status history)").argument("<id>","Delivery job ID").requiredOption("--status <s>",O).option("--notes <s>","Notes for the status history entry").option("--location <json>","Location JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={status:e.status.toUpperCase()};e.notes&&(i.notes=e.notes),e.location&&(i.location=l("location",e.location));let n=await s(we,{id:t,input:i});p(`Delivery job ${t} is now ${n.updateDeliveryJobStatus.status}`),a(e,n.updateDeliveryJobStatus);}catch(i){c(i);}}),r.command("remove").description("Delete a delivery job").argument("<id>","Delivery job ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(Ee,{id:t});p(`Delivery job ${t} deleted`),a(e,{deleted:i.deleteDeliveryJob});}catch(i){c(i);}}),r.command("pending-epod").description("Your delivery jobs still awaiting proof-of-delivery capture").option("--count","Only print how many there are").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{if(t.count){let i=await s(he);a(t,{count:i.myPendingEpodDeliveryJobsCount});return}let e=await s(ye,{pagination:h(t)});a(t,e.myPendingEpodDeliveryJobs,{headers:ot,rows:st(e.myPendingEpodDeliveryJobs)});}catch(e){c(e);}});}function ut(o){let r=o.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 i=await s(Ce,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.shipments,{headers:["ID","Shipment #","Delivery job","Store order","Status","Tracking"],rows:i.shipments.map(n=>[f(n.id,12),n.shipmentNumber,f(n.deliveryJobId??"-",12),f(n.storeOrderId??"-",12),n.status,n.trackingNumber??"-"])});}catch(e){c(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 i=await s(be,{id:t});if(!i.shipment)throw new m(`Shipment ${t} not found`);a(e,i.shipment);}catch(i){c(i);}}),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 s(De,{pagination:h(t)});a(t,e.activeDeliveries,{headers:["ID","Shipment #","Delivery job","Store order","Status","Tracking"],rows:e.activeDeliveries.map(i=>[f(i.id,12),i.shipmentNumber,f(i.deliveryJobId??"-",12),f(i.storeOrderId??"-",12),i.status,i.trackingNumber??"-"])});}catch(e){c(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:l("origin",t.origin),destination:l("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=l("cargo-details",t.cargoDetails)),t.estimatedDelivery&&(e.estimatedDelivery=t.estimatedDelivery),t.actualDelivery&&(e.actualDelivery=t.actualDelivery);let i=await s(ke,{input:e});p(`Shipment created: ${i.createShipment.shipmentNumber}`),a(t,i.createShipment);}catch(e){c(e);}}),r.command("update").description("Update a shipment").argument("<id>","Shipment ID").option("--status <s>","Status").option("--delivery-job <id>","Re-link to another delivery job").option("--store-order <id>","Re-link to another store order").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 i={};if(e.status&&(i.status=e.status.toUpperCase()),e.deliveryJob&&(i.deliveryJobId=e.deliveryJob),e.storeOrder&&(i.storeOrderId=e.storeOrder),e.customer!==void 0&&(i.customerId=e.customer),e.carrier!==void 0&&(i.carrierId=e.carrier),e.trackingNumber!==void 0&&(i.trackingNumber=e.trackingNumber),e.origin&&(i.origin=l("origin",e.origin)),e.destination&&(i.destination=l("destination",e.destination)),e.cargoDetails&&(i.cargoDetails=l("cargo-details",e.cargoDetails)),e.estimatedDelivery&&(i.estimatedDelivery=e.estimatedDelivery),e.actualDelivery&&(i.actualDelivery=e.actualDelivery),!Object.keys(i).length)throw new m("No updates specified");let n=await s(Se,{id:t,input:i});p("Shipment updated"),a(e,n.updateShipment);}catch(i){c(i);}}),r.command("remove").description("Delete a shipment").argument("<id>","Shipment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(Re,{id:t});p(`Shipment ${t} deleted`),a(e,{deleted:i.deleteShipment});}catch(i){c(i);}}),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=l("location",t.location)),t.timestamp&&(e.timestamp=t.timestamp);let i=await s(Ae,{input:e});p(`Tracking event added: ${i.addTrackingEvent.eventType}`),a(t,i.addTrackingEvent);}catch(e){c(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 i=await s(Oe,{shipmentId:t,pagination:h(e)});a(e,i.shipmentTracking,{headers:["ID","Event","Details","Timestamp"],rows:i.shipmentTracking.map(n=>[f(n.id,12),n.eventType,f(n.details??"-",30),n.timestamp])});}catch(i){c(i);}}),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 s(Te,{pagination:h(t)});a(t,e.trackingAlerts,{headers:["Type","Shipment #","Message"],rows:e.trackingAlerts.map(i=>[i.alertType,i.shipmentNumber,f(i.message,40)])});}catch(e){c(e);}});}function pt(o){let r=o.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 i=await s(Ne,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.routes,{headers:["ID","Name","Status","Driver","Vehicle","Distance"],rows:i.routes.map(n=>[f(n.id,12),n.name,n.status,n.driverId?f(n.driverId,12):"-",n.vehicleId?f(n.vehicleId,12):"-",n.estimatedDistance!=null?String(n.estimatedDistance):"-"])});}catch(e){c(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 i=await s(xe,{id:t});if(!i.route)throw new m(`Route ${t} not found`);a(e,i.route);}catch(i){c(i);}}),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",g).option("--estimated-duration <n>","Estimated duration",g).option("--actual-distance <n>","Actual distance",g).option("--actual-duration <n>","Actual duration",g).option("--fuel-cost <n>","Fuel cost",g).option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,waypoints:l("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 i=await s($e,{input:e});p(`Route created: ${i.createRoute.name}`),a(t,i.createRoute);}catch(e){c(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",g).option("--estimated-duration <n>","Estimated duration",g).option("--actual-distance <n>","Actual distance",g).option("--actual-duration <n>","Actual duration",g).option("--fuel-cost <n>","Fuel cost",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.name&&(i.name=e.name),e.status&&(i.status=e.status.toUpperCase()),e.driver!==void 0&&(i.driverId=e.driver),e.vehicle!==void 0&&(i.vehicleId=e.vehicle),e.shipment!==void 0&&(i.shipmentId=e.shipment),e.waypoints&&(i.waypoints=l("waypoints",e.waypoints)),e.estimatedDistance!==void 0&&(i.estimatedDistance=e.estimatedDistance),e.estimatedDuration!==void 0&&(i.estimatedDuration=e.estimatedDuration),e.actualDistance!==void 0&&(i.actualDistance=e.actualDistance),e.actualDuration!==void 0&&(i.actualDuration=e.actualDuration),e.fuelCost!==void 0&&(i.fuelCost=e.fuelCost),!Object.keys(i).length)throw new m("No updates specified");let n=await s(Le,{id:t,input:i});p("Route updated"),a(e,n.updateRoute);}catch(i){c(i);}}),r.command("remove").description("Delete a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(_e,{id:t});p(`Route ${t} deleted`),a(e,{deleted:i.deleteRoute});}catch(i){c(i);}}),r.command("optimize").description("Optimize a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(Pe,{id:t});p("Route optimized"),a(e,i.optimizeRoute);}catch(i){c(i);}});}function mt(o){let r=o.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)",i=>i==="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 i=>{try{let n={};i.type&&(n.type=i.type),i.active!==void 0&&(n.isActive=i.active),i.query&&(n.search=i.query);let u=await s(qe,{filter:Object.keys(n).length?n:void 0,pagination:h(i)});a(i,u.serviceProviders,{headers:["ID","Name","Type","Active","Verified","Rating"],rows:u.serviceProviders.map(v=>[f(v.id,12),v.name,v.type,v.isActive?"yes":"no",v.isVerified?"yes":"no",v.rating!=null?String(v.rating):"-"])});}catch(n){c(n);}}),t.command("get").description("Get a service provider by id (includes offerings)").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(Ue,{id:i});if(!u.serviceProvider)throw new m(`Provider ${i} not found`);a(n,u.serviceProvider);}catch(u){c(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",g).option("--active <bool>","Active (true|false)",i=>i==="true",true).option("--verified <bool>","Verified (true|false)",i=>i==="true",false).option("--contact-info <json>","Contact info JSON").option("--services <list>","Comma-separated services offered").option("-f, --format <format>","Output format").action(async i=>{try{let n={name:i.name,type:i.type,isActive:i.active??!0,isVerified:i.verified??!1};i.description&&(n.description=i.description),i.rating!==void 0&&(n.rating=i.rating),i.contactInfo&&(n.contactInfo=l("contact-info",i.contactInfo)),i.services&&(n.services=lt(i.services));let u=await s(Ve,{input:n});p(`Provider created: ${u.createServiceProvider.name}`),a(i,u.createServiceProvider);}catch(n){c(n);}}),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",g).option("--active <bool>","Active (true|false)",i=>i==="true").option("--verified <bool>","Verified (true|false)",i=>i==="true").option("--contact-info <json>","Contact info JSON").option("--services <list>","Comma-separated services offered").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u={};if(n.name&&(u.name=n.name),n.type&&(u.type=n.type),n.description!==void 0&&(u.description=n.description),n.rating!==void 0&&(u.rating=n.rating),n.active!==void 0&&(u.isActive=n.active),n.verified!==void 0&&(u.isVerified=n.verified),n.contactInfo&&(u.contactInfo=l("contact-info",n.contactInfo)),n.services&&(u.services=lt(n.services)),!Object.keys(u).length)throw new m("No updates specified");let v=await s(Me,{id:i,input:u});p("Provider updated"),a(n,v.updateServiceProvider);}catch(u){c(u);}}),t.command("remove").description("Delete a service provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(Je,{id:i});p(`Provider ${i} deleted`),a(n,{deleted:u.deleteServiceProvider});}catch(u){c(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 i=>{try{let n={};i.provider&&(n.providerId=i.provider),i.category&&(n.category=i.category.toUpperCase()),i.query&&(n.search=i.query);let u=await s(We,{filter:Object.keys(n).length?n:void 0,pagination:h(i)});a(i,u.serviceOfferings,{headers:["ID","Name","Provider","Category","Price","Currency"],rows:u.serviceOfferings.map(v=>[f(v.id,12),v.name,f(v.providerId,12),v.category??"-",String(v.price),v.currency])});}catch(n){c(n);}}),e.command("get").description("Get a service offering by id").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(Fe,{id:i});if(!u.serviceOffering)throw new m(`Offering ${i} not found`);a(n,u.serviceOffering);}catch(u){c(u);}}),e.command("create").description("Create a service offering").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Offering name").requiredOption("--price <n>","Price",g).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 i=>{try{let n={providerId:i.provider,name:i.name,price:i.price,currency:i.currency??"USD"};i.description&&(n.description=i.description),n.category=i.category.toUpperCase(),i.availability&&(n.availability=i.availability.toUpperCase());let u=await s(je,{input:n});p(`Offering created: ${u.createServiceOffering.name}`),a(i,u.createServiceOffering);}catch(n){c(n);}}),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",g).option("--currency <c>","Currency").option("--availability <a>","Availability (AVAILABLE, LIMITED, UNAVAILABLE)").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u={};if(n.name&&(u.name=n.name),n.description!==void 0&&(u.description=n.description),n.category!==void 0&&(u.category=n.category.toUpperCase()),n.price!==void 0&&(u.price=n.price),n.currency&&(u.currency=n.currency),n.availability&&(u.availability=n.availability.toUpperCase()),!Object.keys(u).length)throw new m("No updates specified");let v=await s(Ge,{id:i,input:u});p("Offering updated"),a(n,v.updateServiceOffering);}catch(u){c(u);}}),e.command("remove").description("Delete a service offering").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(He,{id:i});p(`Offering ${i} deleted`),a(n,{deleted:u.deleteServiceOffering});}catch(u){c(u);}});}function lt(o){return o.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function ft(o){let r=o.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 s(ze);a(t,e.mtwModuleSettings);}catch(e){c(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 m("Pass at least one setting to update");let i=await s(Ye,{input:e});p("Module settings updated"),a(t,i.updateMtwModuleSettings);}catch(e){c(e);}});}function gt(o){let r=o.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 s(Ke);a(t,e.dashboardMetrics);}catch(e){c(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 s(Be);a(t,e.analytics);}catch(e){c(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 s(Qe);a(t,e.financeMetrics);}catch(e){c(e);}}),r.command("fleet").description("Fleet stats (vehicles & drivers by status)").option("-f, --format <format>","Output format").action(async t=>{try{let e=await s(Ze);a(t,e.fleetStats);}catch(e){c(e);}});}var St={id:"movethewheels",version:"1.0.0",displayName:"Movethewheels",dependsOn:["auth","workspaces"],register(o,r){R(r);let t=o.command("movethewheels").description("Movethewheels logistics & fleet operations");Xe(t),et(t),tt(t),it(t),rt(t),dt(t),ut(t),pt(t),mt(t),ft(t),gt(t);}},$n=St;module.exports=$n;
|
|
487
|
+
`;function m(o,r){try{return JSON.parse(r)}catch{throw new l(`--${o} must be valid JSON`)}}function d(o){let r=Number.parseInt(o,10);if(Number.isNaN(r))throw new l(`Expected an integer but got "${o}"`);return r}function g(o){let r=Number.parseFloat(o);if(Number.isNaN(r))throw new l(`Expected a number but got "${o}"`);return r}function h(o){let r={};return o.limit!==void 0&&(r.limit=o.limit),o.offset!==void 0&&(r.offset=o.offset),Object.keys(r).length?r:void 0}function it(o){let r=o.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 i=await s(_,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.customers,{headers:["ID","Name","Type","Email","Phone","Rating"],rows:i.customers.map(n=>[f(n.id,12),n.name,n.type,n.email??"-",n.phone??"-",n.rating!=null?String(n.rating):"-"])});}catch(e){c(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 i=await s($,{id:t});if(!i.customer)throw new l(`Customer ${t} not found`);a(e,i.customer);}catch(i){c(i);}}),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",g).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=m("address",t.address));let i=await s(L,{input:e});p(`Customer created: ${i.createCustomer.name}`),a(t,i.createCustomer);}catch(e){c(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",g).option("--address <json>","Address JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.name&&(i.name=e.name),e.email!==void 0&&(i.email=e.email),e.phone!==void 0&&(i.phone=e.phone),e.company!==void 0&&(i.company=e.company),e.type&&(i.type=e.type),e.taxId!==void 0&&(i.taxId=e.taxId),e.businessLicense!==void 0&&(i.businessLicense=e.businessLicense),e.rating!==void 0&&(i.rating=e.rating),e.address&&(i.address=m("address",e.address)),!Object.keys(i).length)throw new l("No updates specified");let n=await s(P,{id:t,input:i});p("Customer updated"),a(e,n.updateCustomer);}catch(i){c(i);}}),r.command("remove").description("Delete a customer").argument("<id>","Customer ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(U,{id:t});p(`Customer ${t} deleted`),a(e,{deleted:i.deleteCustomer});}catch(i){c(i);}});}function nt(o){let r=o.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 i=await s(V,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.drivers,{headers:["ID","Name","Employee","Status","Vehicle","Rating"],rows:i.drivers.map(n=>[f(n.id,12),`${n.firstName} ${n.lastName}`,n.employeeId,n.status,n.vehicleId?f(n.vehicleId,12):"-",n.rating!=null?String(n.rating):"-"])});}catch(e){c(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 i=await s(q,{id:t});if(!i.driver)throw new l(`Driver ${t} not found`);a(e,i.driver);}catch(i){c(i);}}),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",g).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=m("certifications",t.certifications)),t.currentLocation&&(e.currentLocation=m("current-location",t.currentLocation));let i=await s(M,{input:e});p(`Driver created: ${i.createDriver.firstName} ${i.createDriver.lastName}`),a(t,i.createDriver);}catch(e){c(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",g).option("--certifications <json>","Certifications JSON").option("--current-location <json>","Current location JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.firstName&&(i.firstName=e.firstName),e.lastName&&(i.lastName=e.lastName),e.email!==void 0&&(i.email=e.email),e.phone!==void 0&&(i.phone=e.phone),e.status&&(i.status=e.status.toUpperCase()),e.licenseNumber!==void 0&&(i.licenseNumber=e.licenseNumber),e.licenseClass!==void 0&&(i.licenseClass=e.licenseClass),e.licenseExpiry&&(i.licenseExpiry=e.licenseExpiry),e.vehicleId!==void 0&&(i.vehicleId=e.vehicleId),e.rating!==void 0&&(i.rating=e.rating),e.certifications&&(i.certifications=m("certifications",e.certifications)),e.currentLocation&&(i.currentLocation=m("current-location",e.currentLocation)),!Object.keys(i).length)throw new l("No updates specified");let n=await s(J,{id:t,input:i});p("Driver updated"),a(e,n.updateDriver);}catch(i){c(i);}}),r.command("remove").description("Delete a driver").argument("<id>","Driver ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(F,{id:t});p(`Driver ${t} deleted`),a(e,{deleted:i.deleteDriver});}catch(i){c(i);}}),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 i=await s(W,{id:t,status:e.status.toUpperCase()});p(`Driver status set to ${i.updateDriverStatus.status}`),a(e,i.updateDriverStatus);}catch(i){c(i);}}),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 i=await s(j,{id:t,vehicleId:e.vehicle});p(e.vehicle?`Vehicle ${e.vehicle} assigned`:"Vehicle assignment cleared"),a(e,i.assignDriverVehicle);}catch(i){c(i);}});}function rt(o){let r=o.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 i=await s(H,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.vehicles,{headers:["ID","Number","Type","Status","Make/Model","Plate"],rows:i.vehicles.map(n=>[f(n.id,12),n.vehicleNumber,n.type,n.status,`${n.make??"-"} ${n.model??""}`.trim(),n.licensePlate??"-"])});}catch(e){c(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 i=await s(G,{id:t});if(!i.vehicle)throw new l(`Vehicle ${t} not found`);a(e,i.vehicle);}catch(i){c(i);}}),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",g).option("--mileage <n>","Mileage",g).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=m("capacity",t.capacity)),t.currentLocation&&(e.currentLocation=m("current-location",t.currentLocation));let i=await s(Y,{input:e});p(`Vehicle created: ${i.createVehicle.vehicleNumber}`),a(t,i.createVehicle);}catch(e){c(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",g).option("--mileage <n>","Mileage",g).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 i={};if(e.number&&(i.vehicleNumber=e.number),e.type&&(i.type=e.type.toUpperCase()),e.status&&(i.status=e.status.toUpperCase()),e.make!==void 0&&(i.make=e.make),e.model!==void 0&&(i.model=e.model),e.year!==void 0&&(i.year=e.year),e.licensePlate!==void 0&&(i.licensePlate=e.licensePlate),e.fuelLevel!==void 0&&(i.fuelLevel=e.fuelLevel),e.mileage!==void 0&&(i.mileage=e.mileage),e.ownershipType!==void 0&&(i.ownershipType=e.ownershipType),e.capacity&&(i.capacity=m("capacity",e.capacity)),e.currentLocation&&(i.currentLocation=m("current-location",e.currentLocation)),!Object.keys(i).length)throw new l("No updates specified");let n=await s(z,{id:t,input:i});p("Vehicle updated"),a(e,n.updateVehicle);}catch(i){c(i);}}),r.command("remove").description("Delete a vehicle").argument("<id>","Vehicle ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(B,{id:t});p(`Vehicle ${t} deleted`),a(e,{deleted:i.deleteVehicle});}catch(i){c(i);}}),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 i=await s(K,{id:t,status:e.status.toUpperCase()});p(`Vehicle status set to ${i.updateVehicleStatus.status}`),a(e,i.updateVehicleStatus);}catch(i){c(i);}}),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 i=m("location",e.location),n=await s(Q,{id:t,location:i});p("Vehicle location updated"),a(e,n.updateVehicleLocation);}catch(i){c(i);}});}function ot(o){let r=o.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 i=await s(X,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.warehouses,{headers:["ID","Code","Name","Type","Status","Capacity"],rows:i.warehouses.map(n=>[f(n.id,12),n.code,n.name,n.type,n.status,`${n.usedCapacity??0}/${n.totalCapacity??0}`])});}catch(e){c(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 i=await s(Z,{id:t});if(!i.warehouse)throw new l(`Warehouse ${t} not found`);a(e,i.warehouse);}catch(i){c(i);}}),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",g).option("--used-capacity <n>","Used capacity",g).option("-f, --format <format>","Output format").action(async t=>{try{let e={code:t.code,name:t.name,type:t.type.toUpperCase(),address:m("address",t.address),status:t.status??"ACTIVE"};t.contactInfo&&(e.contactInfo=m("contact-info",t.contactInfo)),t.operatingHours&&(e.operatingHours=m("operating-hours",t.operatingHours)),t.capabilities&&(e.capabilities=m("capabilities",t.capabilities)),t.totalCapacity!==void 0&&(e.totalCapacity=t.totalCapacity),t.usedCapacity!==void 0&&(e.usedCapacity=t.usedCapacity);let i=await s(ee,{input:e});p(`Warehouse created: ${i.createWarehouse.name}`),a(t,i.createWarehouse);}catch(e){c(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",g).option("--used-capacity <n>","Used capacity",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.code&&(i.code=e.code),e.name&&(i.name=e.name),e.type&&(i.type=e.type.toUpperCase()),e.status&&(i.status=e.status),e.address&&(i.address=m("address",e.address)),e.contactInfo&&(i.contactInfo=m("contact-info",e.contactInfo)),e.operatingHours&&(i.operatingHours=m("operating-hours",e.operatingHours)),e.capabilities&&(i.capabilities=m("capabilities",e.capabilities)),e.totalCapacity!==void 0&&(i.totalCapacity=e.totalCapacity),e.usedCapacity!==void 0&&(i.usedCapacity=e.usedCapacity),!Object.keys(i).length)throw new l("No updates specified");let n=await s(te,{id:t,input:i});p("Warehouse updated"),a(e,n.updateWarehouse);}catch(i){c(i);}}),r.command("remove").description("Delete a warehouse").argument("<id>","Warehouse ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(ie,{id:t});p(`Warehouse ${t} deleted`),a(e,{deleted:i.deleteWarehouse});}catch(i){c(i);}}),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",g).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 i=await s(ne,{input:e});p(`Location created: ${i.createWarehouseLocation.locationCode}`),a(t,i.createWarehouseLocation);}catch(e){c(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",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.code&&(i.locationCode=e.code),e.locationType!==void 0&&(i.locationType=e.locationType),e.status&&(i.status=e.status),e.zone!==void 0&&(i.zone=e.zone),e.aisle!==void 0&&(i.aisle=e.aisle),e.rack!==void 0&&(i.rack=e.rack),e.shelf!==void 0&&(i.shelf=e.shelf),e.bin!==void 0&&(i.bin=e.bin),e.capacity!==void 0&&(i.capacity=e.capacity),!Object.keys(i).length)throw new l("No updates specified");let n=await s(re,{id:t,input:i});p("Location updated"),a(e,n.updateWarehouseLocation);}catch(i){c(i);}});}function st(o){let r={};return o.cargoItem&&(r.cargoItemId=o.cargoItem),o.warehouse&&(r.warehouseId=o.warehouse),o.location&&(r.locationId=o.location),o.query&&(r.search=o.query),Object.keys(r).length?r:void 0}function at(o){let r=o.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 s(se,{filter:st(t),pagination:h(t)});a(t,e.inventoryItems,{headers:["ID","Cargo item","Warehouse","OnHand","Available","Allocated"],rows:e.inventoryItems.map(i=>[f(i.id,12),f(i.cargoItemId,12),f(i.warehouseId,12),String(i.onHand),String(i.available),String(i.allocated)])});}catch(e){c(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 i=await s(oe,{id:t});if(!i.inventoryItem)throw new l(`Inventory item ${t} not found`);a(e,i.inventoryItem);}catch(i){c(i);}}),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 s(ce);a(t,e.inventoryStats);}catch(e){c(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",g).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 i=await s(de,{input:e});p("Inventory item created"),a(t,i.createInventoryItem);}catch(e){c(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",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.location!==void 0&&(i.locationId=e.location),e.onHand!==void 0&&(i.onHand=e.onHand),e.available!==void 0&&(i.available=e.available),e.allocated!==void 0&&(i.allocated=e.allocated),e.damaged!==void 0&&(i.damaged=e.damaged),e.reorderPoint!==void 0&&(i.reorderPoint=e.reorderPoint),e.safetyStock!==void 0&&(i.safetyStock=e.safetyStock),e.unitCost!==void 0&&(i.unitCost=e.unitCost),!Object.keys(i).length)throw new l("No updates specified");let n=await s(ue,{id:t,input:i});p("Inventory item updated"),a(e,n.updateInventoryItem);}catch(i){c(i);}}),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 i=await s(pe,{id:t});p(`Inventory item ${t} deleted`),a(e,{deleted:i.deleteInventoryItem});}catch(i){c(i);}}),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 i={id:t};if(e.onHand!==void 0&&(i.onHand=e.onHand),e.available!==void 0&&(i.available=e.available),e.allocated!==void 0&&(i.allocated=e.allocated),e.damaged!==void 0&&(i.damaged=e.damaged),Object.keys(i).length===1)throw new l("No stock adjustments specified");let n=await s(le,{input:i});p("Inventory stock adjusted"),a(e,n.adjustInventoryStock);}catch(i){c(i);}}),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 s(ae,{filter:st(t),pagination:h(t)});a(t,e.inventoryTransactions,{headers:["ID","Number","Type","Cargo item","Warehouse","Qty"],rows:e.inventoryTransactions.map(i=>[f(i.id,12),i.transactionNumber,i.type,f(i.cargoItemId,12),f(i.warehouseId,12),String(i.quantity)])});}catch(e){c(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",g).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 i=await s(me,{input:e});p(`Transaction recorded: ${i.createInventoryTransaction.transactionNumber}`),a(t,i.createInventoryTransaction);}catch(e){c(e);}});}var S="PENDING|CONFIRMED|ASSIGNED|PICKED_UP|IN_TRANSIT|OUT_FOR_DELIVERY|DELIVERED|FAILED|RETURNED|CANCELLED",R="LOW|MEDIUM|HIGH|URGENT|CRITICAL",ct=["ID","Job #","Status","Priority","Driver","Store order","Scheduled"];function dt(o){return o.map(r=>[f(r.id,12),r.deliveryJobNumber,r.status,r.priority,f(r.driverId??"-",12),f(r.storeOrderId??"-",12),r.scheduledDelivery??"-"])}function ut(o){let r={};return o.status&&(r.status=o.status.toUpperCase()),o.priority&&(r.priority=o.priority.toUpperCase()),o.customer&&(r.customerId=o.customer),o.driver&&(r.driverId=o.driver),o.vehicle&&(r.vehicleId=o.vehicle),o.route&&(r.routeId=o.route),o.storeOrder&&(r.storeOrderId=o.storeOrder),o.unassigned&&(r.unassigned=true),o.query&&(r.search=o.query),Object.keys(r).length?r:void 0}function pt(o){return o.option("--status <s>",`Filter by status (${S})`).option("--priority <p>",`Filter by priority (${R})`).option("--customer <id>","Filter by customer ID").option("--driver <id>","Filter by driver ID").option("--vehicle <id>","Filter by vehicle ID").option("--route <id>","Filter by route ID").option("--store-order <id>","Filter by the store order the job delivers").option("--unassigned","Only jobs with no driver assigned").option("--query <q>","Free-text search")}function lt(o){let r=o.command("delivery-jobs").description("Movethewheels delivery jobs (dispatch units linked to store orders)");pt(r.command("list").description("List delivery jobs")).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 s(ge,{filter:ut(t),pagination:h(t)});a(t,e.deliveryJobs,{headers:ct,rows:dt(e.deliveryJobs)});}catch(e){c(e);}}),pt(r.command("count").description("Count delivery jobs matching a filter")).option("-f, --format <format>","Output format").action(async t=>{try{let e=await s(ye,{filter:ut(t)});a(t,{count:e.deliveryJobsCount});}catch(e){c(e);}}),r.command("get").description("Get a delivery job (customer, driver, vehicle, shipment, status history)").argument("<id>","Delivery job ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(fe,{id:t});if(!i.deliveryJob)throw new l(`Delivery job ${t} not found`);a(e,i.deliveryJob);}catch(i){c(i);}}),r.command("stats").description("Delivery job counts by status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await s(he);a(t,e.deliveryJobStats);}catch(e){c(e);}}),r.command("tracking").description("Tracking events of the shipment that fulfils a delivery job").argument("<id>","Delivery job 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 i=await s(ve,{deliveryJobId:t,pagination:h(e)});a(e,i.deliveryJobTracking,{headers:["ID","Event","Details","Timestamp"],rows:i.deliveryJobTracking.map(n=>[f(n.id,12),n.eventType,f(n.details??"-",30),n.timestamp])});}catch(i){c(i);}}),r.command("create").description("Create a delivery job").requiredOption("--number <s>","Delivery job number").requiredOption("--customer <id>","Customer ID").requiredOption("--cargo-items <json>","Cargo items JSON array").requiredOption("--pickup-address <json>","Pickup address JSON").requiredOption("--delivery-address <json>","Delivery address JSON").option("--store-order <id>","Store order the job delivers").option("--priority <p>",`Priority (${R}); server default MEDIUM`).option("--status <s>",`Initial status (${S}); server default PENDING`).option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--route <id>","Route ID").option("--scheduled-delivery <s>","Scheduled delivery (ISO date)").option("--special-instructions <s>","Special instructions").option("--tracking-number <s>","Tracking number").option("--pricing <json>","Pricing JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={deliveryJobNumber:t.number,customerId:t.customer,cargoItems:m("cargo-items",t.cargoItems),pickupAddress:m("pickup-address",t.pickupAddress),deliveryAddress:m("delivery-address",t.deliveryAddress)};t.storeOrder&&(e.storeOrderId=t.storeOrder),t.priority&&(e.priority=t.priority.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.driver&&(e.driverId=t.driver),t.vehicle&&(e.vehicleId=t.vehicle),t.route&&(e.routeId=t.route),t.scheduledDelivery&&(e.scheduledDelivery=t.scheduledDelivery),t.specialInstructions&&(e.specialInstructions=t.specialInstructions),t.trackingNumber&&(e.trackingNumber=t.trackingNumber),t.pricing&&(e.pricing=m("pricing",t.pricing));let i=await s(Ee,{input:e});p(`Delivery job created: ${i.createDeliveryJob.deliveryJobNumber}`),a(t,i.createDeliveryJob);}catch(e){c(e);}}),r.command("update").description("Update a delivery job (use set-status to move it through its lifecycle)").argument("<id>","Delivery job ID").option("--customer <id>","Customer ID").option("--store-order <id>","Store order the job delivers").option("--priority <p>",`Priority (${R})`).option("--driver <id>","Driver ID").option("--vehicle <id>","Vehicle ID").option("--route <id>","Route ID").option("--cargo-items <json>","Cargo items JSON array").option("--pickup-address <json>","Pickup address JSON").option("--delivery-address <json>","Delivery address JSON").option("--scheduled-delivery <s>","Scheduled delivery (ISO date)").option("--special-instructions <s>","Special instructions").option("--tracking-number <s>","Tracking number").option("--pricing <json>","Pricing JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.customer&&(i.customerId=e.customer),e.storeOrder&&(i.storeOrderId=e.storeOrder),e.priority&&(i.priority=e.priority.toUpperCase()),e.driver&&(i.driverId=e.driver),e.vehicle&&(i.vehicleId=e.vehicle),e.route&&(i.routeId=e.route),e.cargoItems&&(i.cargoItems=m("cargo-items",e.cargoItems)),e.pickupAddress&&(i.pickupAddress=m("pickup-address",e.pickupAddress)),e.deliveryAddress&&(i.deliveryAddress=m("delivery-address",e.deliveryAddress)),e.scheduledDelivery&&(i.scheduledDelivery=e.scheduledDelivery),e.specialInstructions&&(i.specialInstructions=e.specialInstructions),e.trackingNumber&&(i.trackingNumber=e.trackingNumber),e.pricing&&(i.pricing=m("pricing",e.pricing)),!Object.keys(i).length)throw new l("No updates specified");let n=await s(be,{id:t,input:i});p("Delivery job updated"),a(e,n.updateDeliveryJob);}catch(i){c(i);}}),r.command("set-status").description("Move a delivery job to a new status (recorded in its status history)").argument("<id>","Delivery job ID").requiredOption("--status <s>",S).option("--notes <s>","Notes for the status history entry").option("--location <json>","Location JSON").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={status:e.status.toUpperCase()};e.notes&&(i.notes=e.notes),e.location&&(i.location=m("location",e.location));let n=await s(Ce,{id:t,input:i});p(`Delivery job ${t} is now ${n.updateDeliveryJobStatus.status}`),a(e,n.updateDeliveryJobStatus);}catch(i){c(i);}}),r.command("remove").description("Delete a delivery job").argument("<id>","Delivery job ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(De,{id:t});p(`Delivery job ${t} deleted`),a(e,{deleted:i.deleteDeliveryJob});}catch(i){c(i);}}),r.command("pending-epod").description("Your delivery jobs still awaiting proof-of-delivery capture").option("--count","Only print how many there are").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{if(t.count){let i=await s(we);a(t,{count:i.myPendingEpodDeliveryJobsCount});return}let e=await s(Ie,{pagination:h(t)});a(t,e.myPendingEpodDeliveryJobs,{headers:ct,rows:dt(e.myPendingEpodDeliveryJobs)});}catch(e){c(e);}});}function mt(o){let r=o.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 i=await s(Te,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.shipments,{headers:["ID","Shipment #","Delivery job","Store order","Status","Tracking"],rows:i.shipments.map(n=>[f(n.id,12),n.shipmentNumber,f(n.deliveryJobId??"-",12),f(n.storeOrderId??"-",12),n.status,n.trackingNumber??"-"])});}catch(e){c(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 i=await s(Oe,{id:t});if(!i.shipment)throw new l(`Shipment ${t} not found`);a(e,i.shipment);}catch(i){c(i);}}),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 s(ke,{pagination:h(t)});a(t,e.activeDeliveries,{headers:["ID","Shipment #","Delivery job","Store order","Status","Tracking"],rows:e.activeDeliveries.map(i=>[f(i.id,12),i.shipmentNumber,f(i.deliveryJobId??"-",12),f(i.storeOrderId??"-",12),i.status,i.trackingNumber??"-"])});}catch(e){c(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:m("origin",t.origin),destination:m("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=m("cargo-details",t.cargoDetails)),t.estimatedDelivery&&(e.estimatedDelivery=t.estimatedDelivery),t.actualDelivery&&(e.actualDelivery=t.actualDelivery);let i=await s(Ae,{input:e});p(`Shipment created: ${i.createShipment.shipmentNumber}`),a(t,i.createShipment);}catch(e){c(e);}}),r.command("update").description("Update a shipment").argument("<id>","Shipment ID").option("--status <s>","Status").option("--delivery-job <id>","Re-link to another delivery job").option("--store-order <id>","Re-link to another store order").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 i={};if(e.status&&(i.status=e.status.toUpperCase()),e.deliveryJob&&(i.deliveryJobId=e.deliveryJob),e.storeOrder&&(i.storeOrderId=e.storeOrder),e.customer!==void 0&&(i.customerId=e.customer),e.carrier!==void 0&&(i.carrierId=e.carrier),e.trackingNumber!==void 0&&(i.trackingNumber=e.trackingNumber),e.origin&&(i.origin=m("origin",e.origin)),e.destination&&(i.destination=m("destination",e.destination)),e.cargoDetails&&(i.cargoDetails=m("cargo-details",e.cargoDetails)),e.estimatedDelivery&&(i.estimatedDelivery=e.estimatedDelivery),e.actualDelivery&&(i.actualDelivery=e.actualDelivery),!Object.keys(i).length)throw new l("No updates specified");let n=await s(xe,{id:t,input:i});p("Shipment updated"),a(e,n.updateShipment);}catch(i){c(i);}}),r.command("remove").description("Delete a shipment").argument("<id>","Shipment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(Ne,{id:t});p(`Shipment ${t} deleted`),a(e,{deleted:i.deleteShipment});}catch(i){c(i);}}),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=m("location",t.location)),t.timestamp&&(e.timestamp=t.timestamp);let i=await s($e,{input:e});p(`Tracking event added: ${i.addTrackingEvent.eventType}`),a(t,i.addTrackingEvent);}catch(e){c(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 i=await s(Se,{shipmentId:t,pagination:h(e)});a(e,i.shipmentTracking,{headers:["ID","Event","Details","Timestamp"],rows:i.shipmentTracking.map(n=>[f(n.id,12),n.eventType,f(n.details??"-",30),n.timestamp])});}catch(i){c(i);}}),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 s(Re,{pagination:h(t)});a(t,e.trackingAlerts,{headers:["Type","Shipment #","Message"],rows:e.trackingAlerts.map(i=>[i.alertType,i.shipmentNumber,f(i.message,40)])});}catch(e){c(e);}});}function ft(o){let r=o.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 i=await s(Le,{filter:Object.keys(e).length?e:void 0,pagination:h(t)});a(t,i.routes,{headers:["ID","Name","Status","Driver","Vehicle","Distance"],rows:i.routes.map(n=>[f(n.id,12),n.name,n.status,n.driverId?f(n.driverId,12):"-",n.vehicleId?f(n.vehicleId,12):"-",n.estimatedDistance!=null?String(n.estimatedDistance):"-"])});}catch(e){c(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 i=await s(_e,{id:t});if(!i.route)throw new l(`Route ${t} not found`);a(e,i.route);}catch(i){c(i);}}),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",g).option("--estimated-duration <n>","Estimated duration",g).option("--actual-distance <n>","Actual distance",g).option("--actual-duration <n>","Actual duration",g).option("--fuel-cost <n>","Fuel cost",g).option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,waypoints:m("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 i=await s(Pe,{input:e});p(`Route created: ${i.createRoute.name}`),a(t,i.createRoute);}catch(e){c(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",g).option("--estimated-duration <n>","Estimated duration",g).option("--actual-distance <n>","Actual distance",g).option("--actual-duration <n>","Actual duration",g).option("--fuel-cost <n>","Fuel cost",g).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.name&&(i.name=e.name),e.status&&(i.status=e.status.toUpperCase()),e.driver!==void 0&&(i.driverId=e.driver),e.vehicle!==void 0&&(i.vehicleId=e.vehicle),e.shipment!==void 0&&(i.shipmentId=e.shipment),e.waypoints&&(i.waypoints=m("waypoints",e.waypoints)),e.estimatedDistance!==void 0&&(i.estimatedDistance=e.estimatedDistance),e.estimatedDuration!==void 0&&(i.estimatedDuration=e.estimatedDuration),e.actualDistance!==void 0&&(i.actualDistance=e.actualDistance),e.actualDuration!==void 0&&(i.actualDuration=e.actualDuration),e.fuelCost!==void 0&&(i.fuelCost=e.fuelCost),!Object.keys(i).length)throw new l("No updates specified");let n=await s(Ue,{id:t,input:i});p("Route updated"),a(e,n.updateRoute);}catch(i){c(i);}}),r.command("remove").description("Delete a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(qe,{id:t});p(`Route ${t} deleted`),a(e,{deleted:i.deleteRoute});}catch(i){c(i);}}),r.command("optimize").description("Optimize a route").argument("<id>","Route ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await s(Ve,{id:t});p("Route optimized"),a(e,i.optimizeRoute);}catch(i){c(i);}});}function yt(o){let r=o.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)",i=>i==="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 i=>{try{let n={};i.type&&(n.type=i.type),i.active!==void 0&&(n.isActive=i.active),i.query&&(n.search=i.query);let u=await s(Je,{filter:Object.keys(n).length?n:void 0,pagination:h(i)});a(i,u.serviceProviders,{headers:["ID","Name","Type","Active","Verified","Rating"],rows:u.serviceProviders.map(v=>[f(v.id,12),v.name,v.type,v.isActive?"yes":"no",v.isVerified?"yes":"no",v.rating!=null?String(v.rating):"-"])});}catch(n){c(n);}}),t.command("get").description("Get a service provider by id (includes offerings)").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(Me,{id:i});if(!u.serviceProvider)throw new l(`Provider ${i} not found`);a(n,u.serviceProvider);}catch(u){c(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",g).option("--active <bool>","Active (true|false)",i=>i==="true",true).option("--verified <bool>","Verified (true|false)",i=>i==="true",false).option("--contact-info <json>","Contact info JSON").option("--services <list>","Comma-separated services offered").option("-f, --format <format>","Output format").action(async i=>{try{let n={name:i.name,type:i.type,isActive:i.active??!0,isVerified:i.verified??!1};i.description&&(n.description=i.description),i.rating!==void 0&&(n.rating=i.rating),i.contactInfo&&(n.contactInfo=m("contact-info",i.contactInfo)),i.services&&(n.services=gt(i.services));let u=await s(Fe,{input:n});p(`Provider created: ${u.createServiceProvider.name}`),a(i,u.createServiceProvider);}catch(n){c(n);}}),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",g).option("--active <bool>","Active (true|false)",i=>i==="true").option("--verified <bool>","Verified (true|false)",i=>i==="true").option("--contact-info <json>","Contact info JSON").option("--services <list>","Comma-separated services offered").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u={};if(n.name&&(u.name=n.name),n.type&&(u.type=n.type),n.description!==void 0&&(u.description=n.description),n.rating!==void 0&&(u.rating=n.rating),n.active!==void 0&&(u.isActive=n.active),n.verified!==void 0&&(u.isVerified=n.verified),n.contactInfo&&(u.contactInfo=m("contact-info",n.contactInfo)),n.services&&(u.services=gt(n.services)),!Object.keys(u).length)throw new l("No updates specified");let v=await s(We,{id:i,input:u});p("Provider updated"),a(n,v.updateServiceProvider);}catch(u){c(u);}}),t.command("remove").description("Delete a service provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(je,{id:i});p(`Provider ${i} deleted`),a(n,{deleted:u.deleteServiceProvider});}catch(u){c(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 i=>{try{let n={};i.provider&&(n.providerId=i.provider),i.category&&(n.category=i.category.toUpperCase()),i.query&&(n.search=i.query);let u=await s(He,{filter:Object.keys(n).length?n:void 0,pagination:h(i)});a(i,u.serviceOfferings,{headers:["ID","Name","Provider","Category","Price","Currency"],rows:u.serviceOfferings.map(v=>[f(v.id,12),v.name,f(v.providerId,12),v.category??"-",String(v.price),v.currency])});}catch(n){c(n);}}),e.command("get").description("Get a service offering by id").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(Ge,{id:i});if(!u.serviceOffering)throw new l(`Offering ${i} not found`);a(n,u.serviceOffering);}catch(u){c(u);}}),e.command("create").description("Create a service offering").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Offering name").requiredOption("--price <n>","Price",g).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 i=>{try{let n={providerId:i.provider,name:i.name,price:i.price,currency:i.currency??"USD"};i.description&&(n.description=i.description),n.category=i.category.toUpperCase(),i.availability&&(n.availability=i.availability.toUpperCase());let u=await s(Ye,{input:n});p(`Offering created: ${u.createServiceOffering.name}`),a(i,u.createServiceOffering);}catch(n){c(n);}}),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",g).option("--currency <c>","Currency").option("--availability <a>","Availability (AVAILABLE, LIMITED, UNAVAILABLE)").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u={};if(n.name&&(u.name=n.name),n.description!==void 0&&(u.description=n.description),n.category!==void 0&&(u.category=n.category.toUpperCase()),n.price!==void 0&&(u.price=n.price),n.currency&&(u.currency=n.currency),n.availability&&(u.availability=n.availability.toUpperCase()),!Object.keys(u).length)throw new l("No updates specified");let v=await s(ze,{id:i,input:u});p("Offering updated"),a(n,v.updateServiceOffering);}catch(u){c(u);}}),e.command("remove").description("Delete a service offering").argument("<id>","Offering ID").option("-f, --format <format>","Output format").action(async(i,n)=>{try{let u=await s(Be,{id:i});p(`Offering ${i} deleted`),a(n,{deleted:u.deleteServiceOffering});}catch(u){c(u);}});}function gt(o){return o.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function ht(o){let r=o.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 s(Ke);a(t,e.mtwModuleSettings);}catch(e){c(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 i=await s(Qe,{input:e});p("Module settings updated"),a(t,i.updateMtwModuleSettings);}catch(e){c(e);}});}function vt(o){let r=o.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 s(Xe);a(t,e.dashboardMetrics);}catch(e){c(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 s(Ze);a(t,e.analytics);}catch(e){c(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 s(et);a(t,e.financeMetrics);}catch(e){c(e);}}),r.command("fleet").description("Fleet stats (vehicles & drivers by status)").option("-f, --format <format>","Output format").action(async t=>{try{let e=await s(tt);a(t,e.fleetStats);}catch(e){c(e);}});}var xt={id:"movethewheels",version:"1.0.0",displayName:"Movethewheels",dependsOn:["auth","workspaces"],register(o,r){N(r);let t=o.command("movethewheels").description("Movethewheels logistics & fleet operations");it(t),nt(t),rt(t),ot(t),at(t),lt(t),mt(t),ft(t),yt(t),ht(t),vt(t);}},Pn=xt;module.exports=Pn;
|