@chrt-inc/typescript-sdk 1.302.0 → 1.304.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -583
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +25 -20
- package/dist/cjs/api/resources/connections/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/connections/client/Client.js +3 -3
- package/dist/cjs/api/resources/connections/resources/connectionToCourier/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToCourier/client/Client.js +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToForwarder/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToForwarder/client/Client.js +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToShipper/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToShipper/client/Client.js +1 -1
- package/dist/cjs/api/resources/dev/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/dev/client/Client.js +9 -9
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/notifications/resources/courier/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/resources/courier/client/Client.js +2 -2
- package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.js +2 -2
- package/dist/cjs/api/resources/orderDrafts/client/Client.d.ts +127 -0
- package/dist/cjs/api/resources/orderDrafts/client/Client.js +457 -0
- package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/Client.d.ts +99 -0
- package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/Client.js +326 -0
- package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.d.ts → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.d.ts} +1 -1
- package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/orderDrafts/resources/index.d.ts +8 -0
- package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/resources/index.js +9 -3
- package/dist/cjs/api/resources/orderDrafts/resources/task/client/Client.d.ts +81 -0
- package/dist/cjs/api/resources/orderDrafts/resources/task/client/Client.js +259 -0
- package/dist/cjs/api/resources/orderDrafts/resources/task/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/task/client/index.js +17 -0
- package/dist/cjs/api/resources/orderDrafts/resources/task/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/task/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/task/index.d.ts +1 -0
- package/dist/cjs/api/resources/orderDrafts/resources/task/index.js +17 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/Client.d.ts +63 -0
- package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/taskArtifact}/client/Client.js +32 -33
- package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/index.js +17 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/index.d.ts +1 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/index.js +17 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +63 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.js +192 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/index.js +17 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/index.d.ts +1 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/index.js +17 -0
- package/dist/cjs/api/resources/orders/client/Client.d.ts +0 -3
- package/dist/cjs/api/resources/orders/client/Client.js +0 -5
- package/dist/cjs/api/resources/orders/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/orders/resources/index.js +1 -3
- package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/Client.js +3 -3
- package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/Client.js +3 -3
- package/dist/cjs/api/resources/orgProfiles/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/orgProfiles/client/Client.js +7 -7
- package/dist/cjs/api/resources/orgs/client/Client.d.ts +8 -8
- package/dist/cjs/api/resources/orgs/client/Client.js +7 -7
- package/dist/cjs/api/resources/payments/client/Client.d.ts +20 -20
- package/dist/cjs/api/resources/payments/client/Client.js +83 -83
- package/dist/cjs/api/resources/root/client/Client.d.ts +8 -8
- package/dist/cjs/api/resources/root/client/Client.js +5 -5
- package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.js +2 -2
- package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.js +1 -1
- package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.js +1 -1
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +7 -7
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.js +1 -1
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.d.ts +14 -14
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.js +14 -14
- package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.js +1 -1
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/users/client/Client.js +1 -1
- package/dist/cjs/api/resources/utils/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/utils/client/Client.js +1 -1
- package/dist/cjs/api/types/Cargo1.d.ts +1 -1
- package/dist/cjs/api/types/CargoClientCreate1.d.ts +1 -1
- package/dist/cjs/api/types/CargoClientUpdate1.d.ts +1 -1
- package/dist/cjs/api/types/{DriverUpdateResp.d.ts → DriverUpdateRes.d.ts} +1 -1
- package/dist/cjs/api/types/TaskClientUpdate1.d.ts +0 -1
- package/dist/cjs/api/types/index.d.ts +1 -1
- package/dist/cjs/api/types/index.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/resources/connections/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/connections/client/Client.mjs +3 -3
- package/dist/esm/api/resources/connections/resources/connectionToCourier/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToCourier/client/Client.mjs +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToForwarder/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToForwarder/client/Client.mjs +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToShipper/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToShipper/client/Client.mjs +1 -1
- package/dist/esm/api/resources/dev/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/dev/client/Client.mjs +9 -9
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/notifications/resources/courier/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/notifications/resources/courier/client/Client.mjs +2 -2
- package/dist/esm/api/resources/notifications/resources/shipper/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/notifications/resources/shipper/client/Client.mjs +2 -2
- package/dist/esm/api/resources/orderDrafts/client/Client.d.mts +127 -0
- package/dist/esm/api/resources/orderDrafts/client/Client.mjs +420 -0
- package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/orderDrafts/resources/cargo/client/Client.d.mts +99 -0
- package/dist/esm/api/resources/orderDrafts/resources/cargo/client/Client.mjs +289 -0
- package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.d.mts → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.d.mts} +1 -1
- package/dist/esm/api/resources/orderDrafts/resources/cargo/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/orderDrafts/resources/index.d.mts +8 -0
- package/dist/esm/api/resources/orderDrafts/resources/index.mjs +8 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/client/Client.d.mts +81 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/client/Client.mjs +222 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/client/index.d.mts +2 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/client/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/index.d.mts +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/task/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/Client.d.mts +63 -0
- package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/taskArtifact}/client/Client.mjs +30 -31
- package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/index.d.mts +2 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/index.d.mts +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +63 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.mjs +155 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/index.d.mts +2 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/index.d.mts +1 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/index.mjs +1 -0
- package/dist/esm/api/resources/orders/client/Client.d.mts +0 -3
- package/dist/esm/api/resources/orders/client/Client.mjs +0 -5
- package/dist/esm/api/resources/orders/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/orders/resources/index.mjs +0 -2
- package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/Client.mjs +3 -3
- package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/Client.mjs +3 -3
- package/dist/esm/api/resources/orgProfiles/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/orgProfiles/client/Client.mjs +7 -7
- package/dist/esm/api/resources/orgs/client/Client.d.mts +8 -8
- package/dist/esm/api/resources/orgs/client/Client.mjs +7 -7
- package/dist/esm/api/resources/payments/client/Client.d.mts +20 -20
- package/dist/esm/api/resources/payments/client/Client.mjs +83 -83
- package/dist/esm/api/resources/root/client/Client.d.mts +8 -8
- package/dist/esm/api/resources/root/client/Client.mjs +5 -5
- package/dist/esm/api/resources/taskArtifactNotifications/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/taskArtifactNotifications/client/Client.mjs +2 -2
- package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +7 -7
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.d.mts +14 -14
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.mjs +14 -14
- package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.mjs +1 -1
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/users/client/Client.mjs +1 -1
- package/dist/esm/api/resources/utils/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/utils/client/Client.mjs +1 -1
- package/dist/esm/api/types/Cargo1.d.mts +1 -1
- package/dist/esm/api/types/CargoClientCreate1.d.mts +1 -1
- package/dist/esm/api/types/CargoClientUpdate1.d.mts +1 -1
- package/dist/esm/api/types/{DriverUpdateResp.d.mts → DriverUpdateRes.d.mts} +1 -1
- package/dist/esm/api/types/TaskClientUpdate1.d.mts +0 -1
- package/dist/esm/api/types/index.d.mts +1 -1
- package/dist/esm/api/types/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +569 -563
- package/dist/cjs/api/resources/orders/resources/draft/client/Client.d.ts +0 -261
- package/dist/cjs/api/resources/orders/resources/draft/client/Client.js +0 -1014
- package/dist/cjs/api/resources/orders/resources/draft/client/requests/index.d.ts +0 -9
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/Client.d.ts +0 -61
- package/dist/cjs/api/resources/orders/resources/draft/resources/index.d.ts +0 -2
- package/dist/esm/api/resources/orders/resources/draft/client/Client.d.mts +0 -261
- package/dist/esm/api/resources/orders/resources/draft/client/Client.mjs +0 -977
- package/dist/esm/api/resources/orders/resources/draft/client/requests/index.d.mts +0 -9
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/Client.d.mts +0 -61
- package/dist/esm/api/resources/orders/resources/draft/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/orders/resources/draft/resources/index.mjs +0 -2
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/index.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskArtifactReq.js → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.js} +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/index.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/taskArtifact}/client/requests/OrderDraftAddTaskArtifactReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskGroupReq.js → orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.js} +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/taskGroup}/client/requests/OrderDraftAddTaskGroupReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.js → orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.js} +0 -0
- /package/dist/cjs/api/types/{DriverUpdateResp.js → DriverUpdateRes.js} +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/index.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskArtifactReq.mjs → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts/resources/cargo}/index.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/taskArtifact}/client/requests/OrderDraftAddTaskArtifactReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskGroupReq.mjs → orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/taskGroup}/client/requests/OrderDraftAddTaskGroupReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.mjs → orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.mjs} +0 -0
- /package/dist/esm/api/types/{DriverUpdateResp.mjs → DriverUpdateRes.mjs} +0 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
+
import { TaskGroup } from "../resources/taskGroup/client/Client.mjs";
|
|
19
|
+
import { Task } from "../resources/task/client/Client.mjs";
|
|
20
|
+
import { TaskArtifact } from "../resources/taskArtifact/client/Client.mjs";
|
|
21
|
+
import { Cargo } from "../resources/cargo/client/Client.mjs";
|
|
22
|
+
export class OrderDrafts {
|
|
23
|
+
constructor(_options = {}) {
|
|
24
|
+
this._options = _options;
|
|
25
|
+
}
|
|
26
|
+
get taskGroup() {
|
|
27
|
+
var _a;
|
|
28
|
+
return ((_a = this._taskGroup) !== null && _a !== void 0 ? _a : (this._taskGroup = new TaskGroup(this._options)));
|
|
29
|
+
}
|
|
30
|
+
get task() {
|
|
31
|
+
var _a;
|
|
32
|
+
return ((_a = this._task) !== null && _a !== void 0 ? _a : (this._task = new Task(this._options)));
|
|
33
|
+
}
|
|
34
|
+
get taskArtifact() {
|
|
35
|
+
var _a;
|
|
36
|
+
return ((_a = this._taskArtifact) !== null && _a !== void 0 ? _a : (this._taskArtifact = new TaskArtifact(this._options)));
|
|
37
|
+
}
|
|
38
|
+
get cargo() {
|
|
39
|
+
var _a;
|
|
40
|
+
return ((_a = this._cargo) !== null && _a !== void 0 ? _a : (this._cargo = new Cargo(this._options)));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a new draft order with org assignments based on caller's organization type.
|
|
44
|
+
*
|
|
45
|
+
* @param {Chrt.OrdersNewDraftReq} request
|
|
46
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
48
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.orderDrafts.newV1()
|
|
52
|
+
*/
|
|
53
|
+
newV1(request = {}, requestOptions) {
|
|
54
|
+
return core.HttpResponsePromise.fromPromise(this.__newV1(request, requestOptions));
|
|
55
|
+
}
|
|
56
|
+
__newV1() {
|
|
57
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
58
|
+
var _a, _b, _c, _d;
|
|
59
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
60
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
61
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "oort/order_drafts/new/v1"),
|
|
62
|
+
method: "POST",
|
|
63
|
+
headers: _headers,
|
|
64
|
+
contentType: "application/json",
|
|
65
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
66
|
+
requestType: "json",
|
|
67
|
+
body: request,
|
|
68
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
69
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
70
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
71
|
+
});
|
|
72
|
+
if (_response.ok) {
|
|
73
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
74
|
+
}
|
|
75
|
+
if (_response.error.reason === "status-code") {
|
|
76
|
+
switch (_response.error.statusCode) {
|
|
77
|
+
case 422:
|
|
78
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
79
|
+
default:
|
|
80
|
+
throw new errors.ChrtError({
|
|
81
|
+
statusCode: _response.error.statusCode,
|
|
82
|
+
body: _response.error.body,
|
|
83
|
+
rawResponse: _response.rawResponse,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
switch (_response.error.reason) {
|
|
88
|
+
case "non-json":
|
|
89
|
+
throw new errors.ChrtError({
|
|
90
|
+
statusCode: _response.error.statusCode,
|
|
91
|
+
body: _response.error.rawBody,
|
|
92
|
+
rawResponse: _response.rawResponse,
|
|
93
|
+
});
|
|
94
|
+
case "timeout":
|
|
95
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/order_drafts/new/v1.");
|
|
96
|
+
case "unknown":
|
|
97
|
+
throw new errors.ChrtError({
|
|
98
|
+
message: _response.error.errorMessage,
|
|
99
|
+
rawResponse: _response.rawResponse,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Updates forwarder and/or shipper org assignments for a draft order
|
|
106
|
+
*
|
|
107
|
+
* @param {Chrt.OrdersDraftUpdateReq} request
|
|
108
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.orderDrafts.updateV1({
|
|
114
|
+
* order_id: "order_id"
|
|
115
|
+
* })
|
|
116
|
+
*/
|
|
117
|
+
updateV1(request, requestOptions) {
|
|
118
|
+
return core.HttpResponsePromise.fromPromise(this.__updateV1(request, requestOptions));
|
|
119
|
+
}
|
|
120
|
+
__updateV1(request, requestOptions) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
var _a, _b, _c, _d;
|
|
123
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
124
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
125
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "oort/order_drafts/update/v1"),
|
|
126
|
+
method: "PATCH",
|
|
127
|
+
headers: _headers,
|
|
128
|
+
contentType: "application/json",
|
|
129
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
130
|
+
requestType: "json",
|
|
131
|
+
body: request,
|
|
132
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
133
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
134
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
135
|
+
});
|
|
136
|
+
if (_response.ok) {
|
|
137
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
138
|
+
}
|
|
139
|
+
if (_response.error.reason === "status-code") {
|
|
140
|
+
switch (_response.error.statusCode) {
|
|
141
|
+
case 422:
|
|
142
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
143
|
+
default:
|
|
144
|
+
throw new errors.ChrtError({
|
|
145
|
+
statusCode: _response.error.statusCode,
|
|
146
|
+
body: _response.error.body,
|
|
147
|
+
rawResponse: _response.rawResponse,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
switch (_response.error.reason) {
|
|
152
|
+
case "non-json":
|
|
153
|
+
throw new errors.ChrtError({
|
|
154
|
+
statusCode: _response.error.statusCode,
|
|
155
|
+
body: _response.error.rawBody,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
});
|
|
158
|
+
case "timeout":
|
|
159
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/update/v1.");
|
|
160
|
+
case "unknown":
|
|
161
|
+
throw new errors.ChrtError({
|
|
162
|
+
message: _response.error.errorMessage,
|
|
163
|
+
rawResponse: _response.rawResponse,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Deletes a draft order and all associated entities
|
|
170
|
+
*
|
|
171
|
+
* @param {string} orderId
|
|
172
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
|
+
*
|
|
174
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* await client.orderDrafts.deleteV1("order_id")
|
|
178
|
+
*/
|
|
179
|
+
deleteV1(orderId, requestOptions) {
|
|
180
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteV1(orderId, requestOptions));
|
|
181
|
+
}
|
|
182
|
+
__deleteV1(orderId, requestOptions) {
|
|
183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
var _a, _b, _c, _d;
|
|
185
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
186
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
187
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/delete/v1/${encodeURIComponent(orderId)}`),
|
|
188
|
+
method: "DELETE",
|
|
189
|
+
headers: _headers,
|
|
190
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
191
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
192
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
193
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
194
|
+
});
|
|
195
|
+
if (_response.ok) {
|
|
196
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
197
|
+
}
|
|
198
|
+
if (_response.error.reason === "status-code") {
|
|
199
|
+
switch (_response.error.statusCode) {
|
|
200
|
+
case 422:
|
|
201
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
202
|
+
default:
|
|
203
|
+
throw new errors.ChrtError({
|
|
204
|
+
statusCode: _response.error.statusCode,
|
|
205
|
+
body: _response.error.body,
|
|
206
|
+
rawResponse: _response.rawResponse,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
switch (_response.error.reason) {
|
|
211
|
+
case "non-json":
|
|
212
|
+
throw new errors.ChrtError({
|
|
213
|
+
statusCode: _response.error.statusCode,
|
|
214
|
+
body: _response.error.rawBody,
|
|
215
|
+
rawResponse: _response.rawResponse,
|
|
216
|
+
});
|
|
217
|
+
case "timeout":
|
|
218
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/order_drafts/delete/v1/{order_id}.");
|
|
219
|
+
case "unknown":
|
|
220
|
+
throw new errors.ChrtError({
|
|
221
|
+
message: _response.error.errorMessage,
|
|
222
|
+
rawResponse: _response.rawResponse,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Fetches a single draft order with optional expanded related data. Only the creator of the draft order can access it.
|
|
229
|
+
*
|
|
230
|
+
* @param {string} orderIdOrShortId
|
|
231
|
+
* @param {Chrt.OrderDraftExpandedReq} request
|
|
232
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
233
|
+
*
|
|
234
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* await client.orderDrafts.expandedV1("order_id_or_short_id")
|
|
238
|
+
*/
|
|
239
|
+
expandedV1(orderIdOrShortId, request = {}, requestOptions) {
|
|
240
|
+
return core.HttpResponsePromise.fromPromise(this.__expandedV1(orderIdOrShortId, request, requestOptions));
|
|
241
|
+
}
|
|
242
|
+
__expandedV1(orderIdOrShortId_1) {
|
|
243
|
+
return __awaiter(this, arguments, void 0, function* (orderIdOrShortId, request = {}, requestOptions) {
|
|
244
|
+
var _a, _b, _c, _d;
|
|
245
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
246
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
247
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/expanded/v1/${encodeURIComponent(orderIdOrShortId)}`),
|
|
248
|
+
method: "POST",
|
|
249
|
+
headers: _headers,
|
|
250
|
+
contentType: "application/json",
|
|
251
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
252
|
+
requestType: "json",
|
|
253
|
+
body: request,
|
|
254
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
255
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
256
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
257
|
+
});
|
|
258
|
+
if (_response.ok) {
|
|
259
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
260
|
+
}
|
|
261
|
+
if (_response.error.reason === "status-code") {
|
|
262
|
+
switch (_response.error.statusCode) {
|
|
263
|
+
case 422:
|
|
264
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
265
|
+
default:
|
|
266
|
+
throw new errors.ChrtError({
|
|
267
|
+
statusCode: _response.error.statusCode,
|
|
268
|
+
body: _response.error.body,
|
|
269
|
+
rawResponse: _response.rawResponse,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
switch (_response.error.reason) {
|
|
274
|
+
case "non-json":
|
|
275
|
+
throw new errors.ChrtError({
|
|
276
|
+
statusCode: _response.error.statusCode,
|
|
277
|
+
body: _response.error.rawBody,
|
|
278
|
+
rawResponse: _response.rawResponse,
|
|
279
|
+
});
|
|
280
|
+
case "timeout":
|
|
281
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/order_drafts/expanded/v1/{order_id_or_short_id}.");
|
|
282
|
+
case "unknown":
|
|
283
|
+
throw new errors.ChrtError({
|
|
284
|
+
message: _response.error.errorMessage,
|
|
285
|
+
rawResponse: _response.rawResponse,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Lists all draft orders created by the authenticated user with optional expanded related data.
|
|
292
|
+
*
|
|
293
|
+
* @param {Chrt.OrderDraftExpandedListReq} request
|
|
294
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
295
|
+
*
|
|
296
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* await client.orderDrafts.expandedListV1()
|
|
300
|
+
*/
|
|
301
|
+
expandedListV1(request = {}, requestOptions) {
|
|
302
|
+
return core.HttpResponsePromise.fromPromise(this.__expandedListV1(request, requestOptions));
|
|
303
|
+
}
|
|
304
|
+
__expandedListV1() {
|
|
305
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
306
|
+
var _a, _b, _c, _d;
|
|
307
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
308
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
309
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "oort/order_drafts/expanded/list/v1"),
|
|
310
|
+
method: "POST",
|
|
311
|
+
headers: _headers,
|
|
312
|
+
contentType: "application/json",
|
|
313
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
314
|
+
requestType: "json",
|
|
315
|
+
body: request,
|
|
316
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
317
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
318
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
319
|
+
});
|
|
320
|
+
if (_response.ok) {
|
|
321
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
322
|
+
}
|
|
323
|
+
if (_response.error.reason === "status-code") {
|
|
324
|
+
switch (_response.error.statusCode) {
|
|
325
|
+
case 422:
|
|
326
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
327
|
+
default:
|
|
328
|
+
throw new errors.ChrtError({
|
|
329
|
+
statusCode: _response.error.statusCode,
|
|
330
|
+
body: _response.error.body,
|
|
331
|
+
rawResponse: _response.rawResponse,
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
switch (_response.error.reason) {
|
|
336
|
+
case "non-json":
|
|
337
|
+
throw new errors.ChrtError({
|
|
338
|
+
statusCode: _response.error.statusCode,
|
|
339
|
+
body: _response.error.rawBody,
|
|
340
|
+
rawResponse: _response.rawResponse,
|
|
341
|
+
});
|
|
342
|
+
case "timeout":
|
|
343
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/order_drafts/expanded/list/v1.");
|
|
344
|
+
case "unknown":
|
|
345
|
+
throw new errors.ChrtError({
|
|
346
|
+
message: _response.error.errorMessage,
|
|
347
|
+
rawResponse: _response.rawResponse,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Checks whether the draft order satisfies all requirements to move into staging.
|
|
354
|
+
*
|
|
355
|
+
* @param {string} orderId
|
|
356
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
357
|
+
*
|
|
358
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* await client.orderDrafts.validateV1("order_id")
|
|
362
|
+
*/
|
|
363
|
+
validateV1(orderId, requestOptions) {
|
|
364
|
+
return core.HttpResponsePromise.fromPromise(this.__validateV1(orderId, requestOptions));
|
|
365
|
+
}
|
|
366
|
+
__validateV1(orderId, requestOptions) {
|
|
367
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
+
var _a, _b, _c, _d;
|
|
369
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
370
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
371
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/validate/v1/${encodeURIComponent(orderId)}`),
|
|
372
|
+
method: "GET",
|
|
373
|
+
headers: _headers,
|
|
374
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
375
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
376
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
377
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
378
|
+
});
|
|
379
|
+
if (_response.ok) {
|
|
380
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
381
|
+
}
|
|
382
|
+
if (_response.error.reason === "status-code") {
|
|
383
|
+
switch (_response.error.statusCode) {
|
|
384
|
+
case 422:
|
|
385
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
386
|
+
default:
|
|
387
|
+
throw new errors.ChrtError({
|
|
388
|
+
statusCode: _response.error.statusCode,
|
|
389
|
+
body: _response.error.body,
|
|
390
|
+
rawResponse: _response.rawResponse,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
switch (_response.error.reason) {
|
|
395
|
+
case "non-json":
|
|
396
|
+
throw new errors.ChrtError({
|
|
397
|
+
statusCode: _response.error.statusCode,
|
|
398
|
+
body: _response.error.rawBody,
|
|
399
|
+
rawResponse: _response.rawResponse,
|
|
400
|
+
});
|
|
401
|
+
case "timeout":
|
|
402
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/order_drafts/validate/v1/{order_id}.");
|
|
403
|
+
case "unknown":
|
|
404
|
+
throw new errors.ChrtError({
|
|
405
|
+
message: _response.error.errorMessage,
|
|
406
|
+
rawResponse: _response.rawResponse,
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
_getAuthorizationHeader() {
|
|
412
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
414
|
+
if (bearer != null) {
|
|
415
|
+
return `Bearer ${bearer}`;
|
|
416
|
+
}
|
|
417
|
+
return undefined;
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { type OrdersNewDraftReq } from "./OrdersNewDraftReq.mjs";
|
|
2
|
+
export { type OrdersDraftUpdateReq } from "./OrdersDraftUpdateReq.mjs";
|
|
1
3
|
export { type OrderDraftExpandedReq } from "./OrderDraftExpandedReq.mjs";
|
|
2
4
|
export { type OrderDraftExpandedListReq } from "./OrderDraftExpandedListReq.mjs";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
6
|
+
import * as Chrt from "../../../../../index.mjs";
|
|
7
|
+
export declare namespace Cargo {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
fetcher?: core.FetchFunction;
|
|
16
|
+
}
|
|
17
|
+
interface RequestOptions {
|
|
18
|
+
/** The maximum time to wait for a response in seconds. */
|
|
19
|
+
timeoutInSeconds?: number;
|
|
20
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** A hook to abort the request. */
|
|
23
|
+
abortSignal?: AbortSignal;
|
|
24
|
+
/** Additional query string parameters to include in the request. */
|
|
25
|
+
queryParams?: Record<string, unknown>;
|
|
26
|
+
/** Additional headers to include in the request. */
|
|
27
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare class Cargo {
|
|
31
|
+
protected readonly _options: Cargo.Options;
|
|
32
|
+
constructor(_options?: Cargo.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Adds a cargo item to an existing draft order. Validates order is in DRAFT status and owned by caller.
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.orderDrafts.OrderDraftAddCargoReq} request
|
|
37
|
+
* @param {Cargo.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.orderDrafts.cargo.addV1({
|
|
43
|
+
* order_id: "order_id",
|
|
44
|
+
* cargo: {
|
|
45
|
+
* schema_version: 1,
|
|
46
|
+
* cargo_type: "spare_parts"
|
|
47
|
+
* }
|
|
48
|
+
* })
|
|
49
|
+
*/
|
|
50
|
+
addV1(request: Chrt.orderDrafts.OrderDraftAddCargoReq, requestOptions?: Cargo.RequestOptions): core.HttpResponsePromise<string>;
|
|
51
|
+
private __addV1;
|
|
52
|
+
/**
|
|
53
|
+
* Associates existing cargo with a task in a draft order.
|
|
54
|
+
*
|
|
55
|
+
* @param {Chrt.orderDrafts.OrderDraftAssociateCargoWithTaskReq} request
|
|
56
|
+
* @param {Cargo.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await client.orderDrafts.cargo.associateWithTaskV1({
|
|
62
|
+
* order_id: "order_id",
|
|
63
|
+
* task_id: "task_id",
|
|
64
|
+
* cargo_id: "cargo_id"
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
associateWithTaskV1(request: Chrt.orderDrafts.OrderDraftAssociateCargoWithTaskReq, requestOptions?: Cargo.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
68
|
+
private __associateWithTaskV1;
|
|
69
|
+
/**
|
|
70
|
+
* Updates a cargo item in an existing draft order. Validates order is in DRAFT status and owned by caller.
|
|
71
|
+
*
|
|
72
|
+
* @param {Chrt.orderDrafts.OrderDraftUpdateCargoReq} request
|
|
73
|
+
* @param {Cargo.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.orderDrafts.cargo.updateV1({
|
|
79
|
+
* cargo_id: "cargo_id",
|
|
80
|
+
* cargo_update: {}
|
|
81
|
+
* })
|
|
82
|
+
*/
|
|
83
|
+
updateV1(request: Chrt.orderDrafts.OrderDraftUpdateCargoReq, requestOptions?: Cargo.RequestOptions): core.HttpResponsePromise<string>;
|
|
84
|
+
private __updateV1;
|
|
85
|
+
/**
|
|
86
|
+
* Deletes a cargo item from a draft order and removes references from associated tasks
|
|
87
|
+
*
|
|
88
|
+
* @param {string} cargoId
|
|
89
|
+
* @param {Cargo.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
|
+
*
|
|
91
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* await client.orderDrafts.cargo.deleteV1("cargo_id")
|
|
95
|
+
*/
|
|
96
|
+
deleteV1(cargoId: string, requestOptions?: Cargo.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
97
|
+
private __deleteV1;
|
|
98
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
99
|
+
}
|