@chrt-inc/typescript-sdk 1.302.0 → 1.303.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.
Files changed (155) hide show
  1. package/README.md +29 -8
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +25 -20
  4. package/dist/cjs/api/resources/index.d.ts +2 -0
  5. package/dist/cjs/api/resources/index.js +3 -1
  6. package/dist/cjs/api/resources/orderDrafts/client/Client.d.ts +100 -0
  7. package/dist/cjs/api/resources/orderDrafts/client/Client.js +332 -0
  8. package/dist/cjs/api/resources/orderDrafts/client/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/orderDrafts/client/index.js +17 -0
  10. package/dist/cjs/api/resources/orderDrafts/client/requests/index.d.ts +2 -0
  11. package/dist/cjs/api/resources/orderDrafts/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/orderDrafts/index.js +18 -0
  13. package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/Client.d.ts +99 -0
  14. package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/Client.js +326 -0
  15. package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/index.js +17 -0
  17. package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.d.ts → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.d.ts} +1 -1
  18. package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/requests/index.d.ts +3 -0
  19. package/dist/cjs/api/resources/orderDrafts/resources/cargo/client/requests/index.js +2 -0
  20. package/dist/cjs/api/resources/orderDrafts/resources/cargo/index.d.ts +1 -0
  21. package/dist/cjs/api/resources/orderDrafts/resources/cargo/index.js +17 -0
  22. package/dist/cjs/api/resources/orderDrafts/resources/index.d.ts +8 -0
  23. package/dist/cjs/api/resources/orderDrafts/resources/index.js +47 -0
  24. package/dist/cjs/api/resources/orderDrafts/resources/task/client/Client.d.ts +81 -0
  25. package/dist/cjs/api/resources/orderDrafts/resources/task/client/Client.js +259 -0
  26. package/dist/cjs/api/resources/orderDrafts/resources/task/client/index.d.ts +2 -0
  27. package/dist/cjs/api/resources/orderDrafts/resources/task/client/index.js +17 -0
  28. package/dist/cjs/api/resources/orderDrafts/resources/task/client/requests/index.d.ts +2 -0
  29. package/dist/cjs/api/resources/orderDrafts/resources/task/client/requests/index.js +2 -0
  30. package/dist/cjs/api/resources/orderDrafts/resources/task/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/orderDrafts/resources/task/index.js +17 -0
  32. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/Client.d.ts +63 -0
  33. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/Client.js +192 -0
  34. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/index.d.ts +2 -0
  35. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/index.js +17 -0
  36. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.js +2 -0
  38. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/orderDrafts/resources/taskArtifact/index.js +17 -0
  40. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +63 -0
  41. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.js +192 -0
  42. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/index.d.ts +2 -0
  43. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/index.js +17 -0
  44. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/index.d.ts +1 -0
  47. package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/index.js +17 -0
  48. package/dist/cjs/api/resources/orders/resources/draft/client/Client.d.ts +0 -238
  49. package/dist/cjs/api/resources/orders/resources/draft/client/Client.js +0 -997
  50. package/dist/cjs/api/resources/orders/resources/draft/client/index.d.ts +0 -1
  51. package/dist/cjs/api/resources/orders/resources/draft/client/index.js +0 -15
  52. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/Client.js +4 -4
  53. package/dist/cjs/api/resources/orders/resources/index.d.ts +0 -1
  54. package/dist/cjs/api/resources/orders/resources/index.js +0 -1
  55. package/dist/cjs/api/resources/payments/client/Client.d.ts +20 -20
  56. package/dist/cjs/api/resources/payments/client/Client.js +83 -83
  57. package/dist/cjs/version.d.ts +1 -1
  58. package/dist/cjs/version.js +1 -1
  59. package/dist/esm/Client.d.mts +3 -0
  60. package/dist/esm/Client.mjs +7 -2
  61. package/dist/esm/api/resources/index.d.mts +2 -0
  62. package/dist/esm/api/resources/index.mjs +2 -0
  63. package/dist/esm/api/resources/orderDrafts/client/Client.d.mts +100 -0
  64. package/dist/esm/api/resources/orderDrafts/client/Client.mjs +295 -0
  65. package/dist/esm/api/resources/orderDrafts/client/index.d.mts +2 -0
  66. package/dist/esm/api/resources/orderDrafts/client/index.mjs +1 -0
  67. package/dist/esm/api/resources/orderDrafts/client/requests/index.d.mts +2 -0
  68. package/dist/esm/api/resources/orderDrafts/index.d.mts +2 -0
  69. package/dist/esm/api/resources/orderDrafts/index.mjs +2 -0
  70. package/dist/esm/api/resources/orderDrafts/resources/cargo/client/Client.d.mts +99 -0
  71. package/dist/esm/api/resources/orderDrafts/resources/cargo/client/Client.mjs +289 -0
  72. package/dist/esm/api/resources/orderDrafts/resources/cargo/client/index.d.mts +2 -0
  73. package/dist/esm/api/resources/orderDrafts/resources/cargo/client/index.mjs +1 -0
  74. package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.d.mts → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.d.mts} +1 -1
  75. package/dist/esm/api/resources/orderDrafts/resources/cargo/client/requests/index.d.mts +3 -0
  76. package/dist/esm/api/resources/orderDrafts/resources/cargo/client/requests/index.mjs +1 -0
  77. package/dist/esm/api/resources/orderDrafts/resources/cargo/index.d.mts +1 -0
  78. package/dist/esm/api/resources/orderDrafts/resources/cargo/index.mjs +1 -0
  79. package/dist/esm/api/resources/orderDrafts/resources/index.d.mts +8 -0
  80. package/dist/esm/api/resources/orderDrafts/resources/index.mjs +8 -0
  81. package/dist/esm/api/resources/orderDrafts/resources/task/client/Client.d.mts +81 -0
  82. package/dist/esm/api/resources/orderDrafts/resources/task/client/Client.mjs +222 -0
  83. package/dist/esm/api/resources/orderDrafts/resources/task/client/index.d.mts +2 -0
  84. package/dist/esm/api/resources/orderDrafts/resources/task/client/index.mjs +1 -0
  85. package/dist/esm/api/resources/orderDrafts/resources/task/client/requests/index.d.mts +2 -0
  86. package/dist/esm/api/resources/orderDrafts/resources/task/client/requests/index.mjs +1 -0
  87. package/dist/esm/api/resources/orderDrafts/resources/task/index.d.mts +1 -0
  88. package/dist/esm/api/resources/orderDrafts/resources/task/index.mjs +1 -0
  89. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/Client.d.mts +63 -0
  90. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/Client.mjs +155 -0
  91. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/index.d.mts +2 -0
  92. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/index.mjs +1 -0
  93. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.d.mts +1 -0
  94. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/client/requests/index.mjs +1 -0
  95. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/index.d.mts +1 -0
  96. package/dist/esm/api/resources/orderDrafts/resources/taskArtifact/index.mjs +1 -0
  97. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +63 -0
  98. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.mjs +155 -0
  99. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/index.d.mts +2 -0
  100. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/index.mjs +1 -0
  101. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.mts +1 -0
  102. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.mjs +1 -0
  103. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/index.d.mts +1 -0
  104. package/dist/esm/api/resources/orderDrafts/resources/taskGroup/index.mjs +1 -0
  105. package/dist/esm/api/resources/orders/resources/draft/client/Client.d.mts +0 -238
  106. package/dist/esm/api/resources/orders/resources/draft/client/Client.mjs +0 -964
  107. package/dist/esm/api/resources/orders/resources/draft/client/index.d.mts +0 -1
  108. package/dist/esm/api/resources/orders/resources/draft/client/index.mjs +1 -1
  109. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/Client.mjs +4 -4
  110. package/dist/esm/api/resources/orders/resources/index.d.mts +0 -1
  111. package/dist/esm/api/resources/orders/resources/index.mjs +0 -1
  112. package/dist/esm/api/resources/payments/client/Client.d.mts +20 -20
  113. package/dist/esm/api/resources/payments/client/Client.mjs +83 -83
  114. package/dist/esm/version.d.mts +1 -1
  115. package/dist/esm/version.mjs +1 -1
  116. package/package.json +1 -1
  117. package/reference.md +511 -503
  118. package/dist/cjs/api/resources/orders/resources/draft/client/requests/index.d.ts +0 -9
  119. package/dist/esm/api/resources/orders/resources/draft/client/requests/index.d.mts +0 -9
  120. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.d.ts +0 -0
  121. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.js +0 -0
  122. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.d.ts +0 -0
  123. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.js +0 -0
  124. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts}/client/requests/index.js +0 -0
  125. /package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskArtifactReq.js → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.js} +0 -0
  126. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.d.ts +0 -0
  127. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.js +0 -0
  128. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.d.ts +0 -0
  129. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.js +0 -0
  130. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.d.ts +0 -0
  131. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.js +0 -0
  132. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.d.ts +0 -0
  133. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.js +0 -0
  134. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/taskArtifact}/client/requests/OrderDraftAddTaskArtifactReq.d.ts +0 -0
  135. /package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskGroupReq.js → orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.js} +0 -0
  136. /package/dist/cjs/api/resources/{orders/resources/draft → orderDrafts/resources/taskGroup}/client/requests/OrderDraftAddTaskGroupReq.d.ts +0 -0
  137. /package/dist/cjs/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.js → orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.js} +0 -0
  138. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.d.mts +0 -0
  139. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersDraftUpdateReq.mjs +0 -0
  140. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.d.mts +0 -0
  141. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/OrdersNewDraftReq.mjs +0 -0
  142. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts}/client/requests/index.mjs +0 -0
  143. /package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskArtifactReq.mjs → orderDrafts/resources/cargo/client/requests/OrderDraftAddCargoReq.mjs} +0 -0
  144. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.d.mts +0 -0
  145. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftAssociateCargoWithTaskReq.mjs +0 -0
  146. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.d.mts +0 -0
  147. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/cargo}/client/requests/OrderDraftUpdateCargoReq.mjs +0 -0
  148. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.d.mts +0 -0
  149. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftAddTaskReqV1.mjs +0 -0
  150. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.d.mts +0 -0
  151. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/task}/client/requests/OrderDraftUpdateTaskReq.mjs +0 -0
  152. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/taskArtifact}/client/requests/OrderDraftAddTaskArtifactReq.d.mts +0 -0
  153. /package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftAddTaskGroupReq.mjs → orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.mjs} +0 -0
  154. /package/dist/esm/api/resources/{orders/resources/draft → orderDrafts/resources/taskGroup}/client/requests/OrderDraftAddTaskGroupReq.d.mts +0 -0
  155. /package/dist/esm/api/resources/{orders/resources/draft/client/requests/OrderDraftCreateCargoReq.mjs → orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.mjs} +0 -0
package/README.md CHANGED
@@ -7,6 +7,25 @@ The Chrt TypeScript library provides convenient access to the Chrt APIs from Typ
7
7
 
8
8
  ## Table of Contents
9
9
 
10
+ - [Table of Contents](#table-of-contents)
11
+ - [Installation](#installation)
12
+ - [Reference](#reference)
13
+ - [Usage](#usage)
14
+ - [Request and Response Types](#request-and-response-types)
15
+ - [Exception Handling](#exception-handling)
16
+ - [Advanced](#advanced)
17
+ - [Additional Headers](#additional-headers)
18
+ - [Additional Query String Parameters](#additional-query-string-parameters)
19
+ - [Retries](#retries)
20
+ - [Timeouts](#timeouts)
21
+ - [Aborting Requests](#aborting-requests)
22
+ - [Access Raw Response Data](#access-raw-response-data)
23
+ - [Runtime Compatibility](#runtime-compatibility)
24
+ - [Contributing](#contributing)
25
+ - [Binary Response](#binary-response)
26
+
27
+ ## Table of Contents
28
+
10
29
  - [Installation](#installation)
11
30
  - [Reference](#reference)
12
31
  - [Usage](#usage)
@@ -41,7 +60,9 @@ Instantiate and use the client with the following:
41
60
  import { ChrtClient } from "@chrt-inc/typescript-sdk";
42
61
 
43
62
  const client = new ChrtClient({ token: "YOUR_TOKEN" });
44
- await client.payments.createConnectAccountV1();
63
+ await client.payments.generateInvoiceV1({
64
+ shipper_pay_courier_statement_id: "shipper_pay_courier_statement_id",
65
+ });
45
66
  ```
46
67
 
47
68
  ## Request and Response Types
@@ -66,7 +87,7 @@ will be thrown.
66
87
  import { ChrtError } from "@chrt-inc/typescript-sdk";
67
88
 
68
89
  try {
69
- await client.payments.createConnectAccountV1(...);
90
+ await client.payments.generateInvoiceV1(...);
70
91
  } catch (err) {
71
92
  if (err instanceof ChrtError) {
72
93
  console.log(err.statusCode);
@@ -84,7 +105,7 @@ try {
84
105
  If you would like to send additional headers as part of the request, use the `headers` request option.
85
106
 
86
107
  ```typescript
87
- const response = await client.payments.createConnectAccountV1(..., {
108
+ const response = await client.payments.generateInvoiceV1(..., {
88
109
  headers: {
89
110
  'X-Custom-Header': 'custom value'
90
111
  }
@@ -96,7 +117,7 @@ const response = await client.payments.createConnectAccountV1(..., {
96
117
  If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
97
118
 
98
119
  ```typescript
99
- const response = await client.payments.createConnectAccountV1(..., {
120
+ const response = await client.payments.generateInvoiceV1(..., {
100
121
  queryParams: {
101
122
  'customQueryParamKey': 'custom query param value'
102
123
  }
@@ -118,7 +139,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
118
139
  Use the `maxRetries` request option to configure this behavior.
119
140
 
120
141
  ```typescript
121
- const response = await client.payments.createConnectAccountV1(..., {
142
+ const response = await client.payments.generateInvoiceV1(..., {
122
143
  maxRetries: 0 // override maxRetries at the request level
123
144
  });
124
145
  ```
@@ -128,7 +149,7 @@ const response = await client.payments.createConnectAccountV1(..., {
128
149
  The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
129
150
 
130
151
  ```typescript
131
- const response = await client.payments.createConnectAccountV1(..., {
152
+ const response = await client.payments.generateInvoiceV1(..., {
132
153
  timeoutInSeconds: 30 // override timeout to 30s
133
154
  });
134
155
  ```
@@ -139,7 +160,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
139
160
 
140
161
  ```typescript
141
162
  const controller = new AbortController();
142
- const response = await client.payments.createConnectAccountV1(..., {
163
+ const response = await client.payments.generateInvoiceV1(..., {
143
164
  abortSignal: controller.signal
144
165
  });
145
166
  controller.abort(); // aborts the request
@@ -151,7 +172,7 @@ The SDK provides access to raw response data, including headers, through the `.w
151
172
  The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
152
173
 
153
174
  ```typescript
154
- const { data, rawResponse } = await client.payments.createConnectAccountV1(...).withRawResponse();
175
+ const { data, rawResponse } = await client.payments.generateInvoiceV1(...).withRawResponse();
155
176
 
156
177
  console.log(data);
157
178
  console.log(rawResponse.headers['X-My-Header']);
@@ -20,6 +20,7 @@ import { Drivers } from "./api/resources/drivers/client/Client.js";
20
20
  import { TaskArtifacts } from "./api/resources/taskArtifacts/client/Client.js";
21
21
  import { OffChrtShipperOrg } from "./api/resources/offChrtShipperOrg/client/Client.js";
22
22
  import { Orders } from "./api/resources/orders/client/Client.js";
23
+ import { OrderDrafts } from "./api/resources/orderDrafts/client/Client.js";
23
24
  import { TaskGroups } from "./api/resources/taskGroups/client/Client.js";
24
25
  import { ShipperContactInfo } from "./api/resources/shipperContactInfo/client/Client.js";
25
26
  import { Orgs } from "./api/resources/orgs/client/Client.js";
@@ -71,6 +72,7 @@ export declare class ChrtClient {
71
72
  protected _taskArtifacts: TaskArtifacts | undefined;
72
73
  protected _offChrtShipperOrg: OffChrtShipperOrg | undefined;
73
74
  protected _orders: Orders | undefined;
75
+ protected _orderDrafts: OrderDrafts | undefined;
74
76
  protected _taskGroups: TaskGroups | undefined;
75
77
  protected _shipperContactInfo: ShipperContactInfo | undefined;
76
78
  protected _orgs: Orgs | undefined;
@@ -98,6 +100,7 @@ export declare class ChrtClient {
98
100
  get taskArtifacts(): TaskArtifacts;
99
101
  get offChrtShipperOrg(): OffChrtShipperOrg;
100
102
  get orders(): Orders;
103
+ get orderDrafts(): OrderDrafts;
101
104
  get taskGroups(): TaskGroups;
102
105
  get shipperContactInfo(): ShipperContactInfo;
103
106
  get orgs(): Orgs;
@@ -56,22 +56,23 @@ const Client_js_14 = require("./api/resources/drivers/client/Client.js");
56
56
  const Client_js_15 = require("./api/resources/taskArtifacts/client/Client.js");
57
57
  const Client_js_16 = require("./api/resources/offChrtShipperOrg/client/Client.js");
58
58
  const Client_js_17 = require("./api/resources/orders/client/Client.js");
59
- const Client_js_18 = require("./api/resources/taskGroups/client/Client.js");
60
- const Client_js_19 = require("./api/resources/shipperContactInfo/client/Client.js");
61
- const Client_js_20 = require("./api/resources/orgs/client/Client.js");
62
- const Client_js_21 = require("./api/resources/root/client/Client.js");
63
- const Client_js_22 = require("./api/resources/users/client/Client.js");
64
- const Client_js_23 = require("./api/resources/utils/client/Client.js");
65
- const Client_js_24 = require("./api/resources/notifications/client/Client.js");
66
- const Client_js_25 = require("./api/resources/orgConnectionInfos/client/Client.js");
67
- const Client_js_26 = require("./api/resources/tracking/client/Client.js");
59
+ const Client_js_18 = require("./api/resources/orderDrafts/client/Client.js");
60
+ const Client_js_19 = require("./api/resources/taskGroups/client/Client.js");
61
+ const Client_js_20 = require("./api/resources/shipperContactInfo/client/Client.js");
62
+ const Client_js_21 = require("./api/resources/orgs/client/Client.js");
63
+ const Client_js_22 = require("./api/resources/root/client/Client.js");
64
+ const Client_js_23 = require("./api/resources/users/client/Client.js");
65
+ const Client_js_24 = require("./api/resources/utils/client/Client.js");
66
+ const Client_js_25 = require("./api/resources/notifications/client/Client.js");
67
+ const Client_js_26 = require("./api/resources/orgConnectionInfos/client/Client.js");
68
+ const Client_js_27 = require("./api/resources/tracking/client/Client.js");
68
69
  class ChrtClient {
69
70
  constructor(_options = {}) {
70
71
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
71
72
  "X-Fern-Language": "JavaScript",
72
73
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
73
- "X-Fern-SDK-Version": "1.302.0",
74
- "User-Agent": "@chrt-inc/typescript-sdk/1.302.0",
74
+ "X-Fern-SDK-Version": "1.303.0",
75
+ "User-Agent": "@chrt-inc/typescript-sdk/1.303.0",
75
76
  "X-Fern-Runtime": core.RUNTIME.type,
76
77
  "X-Fern-Runtime-Version": core.RUNTIME.version,
77
78
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -144,41 +145,45 @@ class ChrtClient {
144
145
  var _a;
145
146
  return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Client_js_17.Orders(this._options)));
146
147
  }
148
+ get orderDrafts() {
149
+ var _a;
150
+ return ((_a = this._orderDrafts) !== null && _a !== void 0 ? _a : (this._orderDrafts = new Client_js_18.OrderDrafts(this._options)));
151
+ }
147
152
  get taskGroups() {
148
153
  var _a;
149
- return ((_a = this._taskGroups) !== null && _a !== void 0 ? _a : (this._taskGroups = new Client_js_18.TaskGroups(this._options)));
154
+ return ((_a = this._taskGroups) !== null && _a !== void 0 ? _a : (this._taskGroups = new Client_js_19.TaskGroups(this._options)));
150
155
  }
151
156
  get shipperContactInfo() {
152
157
  var _a;
153
- return ((_a = this._shipperContactInfo) !== null && _a !== void 0 ? _a : (this._shipperContactInfo = new Client_js_19.ShipperContactInfo(this._options)));
158
+ return ((_a = this._shipperContactInfo) !== null && _a !== void 0 ? _a : (this._shipperContactInfo = new Client_js_20.ShipperContactInfo(this._options)));
154
159
  }
155
160
  get orgs() {
156
161
  var _a;
157
- return ((_a = this._orgs) !== null && _a !== void 0 ? _a : (this._orgs = new Client_js_20.Orgs(this._options)));
162
+ return ((_a = this._orgs) !== null && _a !== void 0 ? _a : (this._orgs = new Client_js_21.Orgs(this._options)));
158
163
  }
159
164
  get root() {
160
165
  var _a;
161
- return ((_a = this._root) !== null && _a !== void 0 ? _a : (this._root = new Client_js_21.Root(this._options)));
166
+ return ((_a = this._root) !== null && _a !== void 0 ? _a : (this._root = new Client_js_22.Root(this._options)));
162
167
  }
163
168
  get users() {
164
169
  var _a;
165
- return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_22.Users(this._options)));
170
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_23.Users(this._options)));
166
171
  }
167
172
  get utils() {
168
173
  var _a;
169
- return ((_a = this._utils) !== null && _a !== void 0 ? _a : (this._utils = new Client_js_23.Utils(this._options)));
174
+ return ((_a = this._utils) !== null && _a !== void 0 ? _a : (this._utils = new Client_js_24.Utils(this._options)));
170
175
  }
171
176
  get notifications() {
172
177
  var _a;
173
- return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new Client_js_24.Notifications(this._options)));
178
+ return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new Client_js_25.Notifications(this._options)));
174
179
  }
175
180
  get orgConnectionInfos() {
176
181
  var _a;
177
- return ((_a = this._orgConnectionInfos) !== null && _a !== void 0 ? _a : (this._orgConnectionInfos = new Client_js_25.OrgConnectionInfos(this._options)));
182
+ return ((_a = this._orgConnectionInfos) !== null && _a !== void 0 ? _a : (this._orgConnectionInfos = new Client_js_26.OrgConnectionInfos(this._options)));
178
183
  }
179
184
  get tracking() {
180
185
  var _a;
181
- return ((_a = this._tracking) !== null && _a !== void 0 ? _a : (this._tracking = new Client_js_26.Tracking(this._options)));
186
+ return ((_a = this._tracking) !== null && _a !== void 0 ? _a : (this._tracking = new Client_js_27.Tracking(this._options)));
182
187
  }
183
188
  }
184
189
  exports.ChrtClient = ChrtClient;
@@ -15,6 +15,7 @@ export * as drivers from "./drivers/index.js";
15
15
  export * as taskArtifacts from "./taskArtifacts/index.js";
16
16
  export * as offChrtShipperOrg from "./offChrtShipperOrg/index.js";
17
17
  export * as orders from "./orders/index.js";
18
+ export * as orderDrafts from "./orderDrafts/index.js";
18
19
  export * as taskGroups from "./taskGroups/index.js";
19
20
  export * as shipperContactInfo from "./shipperContactInfo/index.js";
20
21
  export * as orgs from "./orgs/index.js";
@@ -35,6 +36,7 @@ export * from "./taskArtifactNotifications/client/requests/index.js";
35
36
  export * from "./drivers/client/requests/index.js";
36
37
  export * from "./taskArtifacts/client/requests/index.js";
37
38
  export * from "./offChrtShipperOrg/client/requests/index.js";
39
+ export * from "./orderDrafts/client/requests/index.js";
38
40
  export * from "./taskGroups/client/requests/index.js";
39
41
  export * from "./shipperContactInfo/client/requests/index.js";
40
42
  export * from "./orgs/client/requests/index.js";
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.tracking = exports.orgConnectionInfos = exports.notifications = exports.utils = exports.users = exports.root = exports.orgs = exports.shipperContactInfo = exports.taskGroups = exports.orders = exports.offChrtShipperOrg = exports.taskArtifacts = exports.drivers = exports.taskArtifactNotifications = exports.dev = exports.orgProfiles = exports.connections = exports.shipperPayCourierStatements = exports.shipperPayCourierRateSheets = exports.shipperPayCourierPayments = exports.shipperPayCourierLineItemGroups = exports.courierPayDriverStatements = exports.courierPayDriverRateSheets = exports.courierPayDriverPayouts = exports.courierPayDriverLineItemGroups = exports.payments = void 0;
39
+ exports.tracking = exports.orgConnectionInfos = exports.notifications = exports.utils = exports.users = exports.root = exports.orgs = exports.shipperContactInfo = exports.taskGroups = exports.orderDrafts = exports.orders = exports.offChrtShipperOrg = exports.taskArtifacts = exports.drivers = exports.taskArtifactNotifications = exports.dev = exports.orgProfiles = exports.connections = exports.shipperPayCourierStatements = exports.shipperPayCourierRateSheets = exports.shipperPayCourierPayments = exports.shipperPayCourierLineItemGroups = exports.courierPayDriverStatements = exports.courierPayDriverRateSheets = exports.courierPayDriverPayouts = exports.courierPayDriverLineItemGroups = exports.payments = void 0;
40
40
  exports.payments = __importStar(require("./payments/index.js"));
41
41
  exports.courierPayDriverLineItemGroups = __importStar(require("./courierPayDriverLineItemGroups/index.js"));
42
42
  exports.courierPayDriverPayouts = __importStar(require("./courierPayDriverPayouts/index.js"));
@@ -54,6 +54,7 @@ exports.drivers = __importStar(require("./drivers/index.js"));
54
54
  exports.taskArtifacts = __importStar(require("./taskArtifacts/index.js"));
55
55
  exports.offChrtShipperOrg = __importStar(require("./offChrtShipperOrg/index.js"));
56
56
  exports.orders = __importStar(require("./orders/index.js"));
57
+ exports.orderDrafts = __importStar(require("./orderDrafts/index.js"));
57
58
  exports.taskGroups = __importStar(require("./taskGroups/index.js"));
58
59
  exports.shipperContactInfo = __importStar(require("./shipperContactInfo/index.js"));
59
60
  exports.orgs = __importStar(require("./orgs/index.js"));
@@ -74,6 +75,7 @@ __exportStar(require("./taskArtifactNotifications/client/requests/index.js"), ex
74
75
  __exportStar(require("./drivers/client/requests/index.js"), exports);
75
76
  __exportStar(require("./taskArtifacts/client/requests/index.js"), exports);
76
77
  __exportStar(require("./offChrtShipperOrg/client/requests/index.js"), exports);
78
+ __exportStar(require("./orderDrafts/client/requests/index.js"), exports);
77
79
  __exportStar(require("./taskGroups/client/requests/index.js"), exports);
78
80
  __exportStar(require("./shipperContactInfo/client/requests/index.js"), exports);
79
81
  __exportStar(require("./orgs/client/requests/index.js"), exports);
@@ -0,0 +1,100 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments.js";
5
+ import * as core from "../../../../core/index.js";
6
+ import * as Chrt from "../../../index.js";
7
+ import { TaskGroup } from "../resources/taskGroup/client/Client.js";
8
+ import { Task } from "../resources/task/client/Client.js";
9
+ import { TaskArtifact } from "../resources/taskArtifact/client/Client.js";
10
+ import { Cargo } from "../resources/cargo/client/Client.js";
11
+ export declare namespace OrderDrafts {
12
+ interface Options {
13
+ environment?: core.Supplier<environments.ChrtEnvironment | string>;
14
+ /** Specify a custom URL to connect the client to. */
15
+ baseUrl?: core.Supplier<string>;
16
+ token?: core.Supplier<core.BearerToken | undefined>;
17
+ /** Additional headers to include in requests. */
18
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
19
+ fetcher?: core.FetchFunction;
20
+ }
21
+ interface RequestOptions {
22
+ /** The maximum time to wait for a response in seconds. */
23
+ timeoutInSeconds?: number;
24
+ /** The number of times to retry the request. Defaults to 2. */
25
+ maxRetries?: number;
26
+ /** A hook to abort the request. */
27
+ abortSignal?: AbortSignal;
28
+ /** Additional query string parameters to include in the request. */
29
+ queryParams?: Record<string, unknown>;
30
+ /** Additional headers to include in the request. */
31
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
32
+ }
33
+ }
34
+ export declare class OrderDrafts {
35
+ protected readonly _options: OrderDrafts.Options;
36
+ protected _taskGroup: TaskGroup | undefined;
37
+ protected _task: Task | undefined;
38
+ protected _taskArtifact: TaskArtifact | undefined;
39
+ protected _cargo: Cargo | undefined;
40
+ constructor(_options?: OrderDrafts.Options);
41
+ get taskGroup(): TaskGroup;
42
+ get task(): Task;
43
+ get taskArtifact(): TaskArtifact;
44
+ get cargo(): Cargo;
45
+ /**
46
+ * Creates a new draft order with org assignments based on caller's organization type.
47
+ *
48
+ * @param {Chrt.OrdersNewDraftReq} request
49
+ * @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
50
+ *
51
+ * @throws {@link Chrt.UnprocessableEntityError}
52
+ *
53
+ * @example
54
+ * await client.orderDrafts.newV1()
55
+ */
56
+ newV1(request?: Chrt.OrdersNewDraftReq, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<Chrt.OrdersNewDraftRes>;
57
+ private __newV1;
58
+ /**
59
+ * Updates forwarder and/or shipper org assignments for a draft order
60
+ *
61
+ * @param {Chrt.OrdersDraftUpdateReq} request
62
+ * @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Chrt.UnprocessableEntityError}
65
+ *
66
+ * @example
67
+ * await client.orderDrafts.updateV1({
68
+ * order_id: "order_id"
69
+ * })
70
+ */
71
+ updateV1(request: Chrt.OrdersDraftUpdateReq, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<Chrt.OrdersDraftUpdateRes>;
72
+ private __updateV1;
73
+ /**
74
+ * Deletes a draft order and all associated entities
75
+ *
76
+ * @param {string} orderId
77
+ * @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
78
+ *
79
+ * @throws {@link Chrt.UnprocessableEntityError}
80
+ *
81
+ * @example
82
+ * await client.orderDrafts.deleteV1("order_id")
83
+ */
84
+ deleteV1(orderId: string, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<boolean>;
85
+ private __deleteV1;
86
+ /**
87
+ * Checks whether the draft order satisfies all requirements to move into staging.
88
+ *
89
+ * @param {string} orderId
90
+ * @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
91
+ *
92
+ * @throws {@link Chrt.UnprocessableEntityError}
93
+ *
94
+ * @example
95
+ * await client.orderDrafts.validateV1("order_id")
96
+ */
97
+ validateV1(orderId: string, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<boolean>;
98
+ private __validateV1;
99
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
100
+ }