@chrt-inc/typescript-sdk 1.303.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.
Files changed (163) hide show
  1. package/README.md +0 -604
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/connections/client/Client.d.ts +3 -3
  4. package/dist/cjs/api/resources/connections/client/Client.js +3 -3
  5. package/dist/cjs/api/resources/connections/resources/connectionToCourier/client/Client.d.ts +1 -1
  6. package/dist/cjs/api/resources/connections/resources/connectionToCourier/client/Client.js +1 -1
  7. package/dist/cjs/api/resources/connections/resources/connectionToForwarder/client/Client.d.ts +1 -1
  8. package/dist/cjs/api/resources/connections/resources/connectionToForwarder/client/Client.js +1 -1
  9. package/dist/cjs/api/resources/connections/resources/connectionToShipper/client/Client.d.ts +1 -1
  10. package/dist/cjs/api/resources/connections/resources/connectionToShipper/client/Client.js +1 -1
  11. package/dist/cjs/api/resources/dev/client/Client.d.ts +9 -9
  12. package/dist/cjs/api/resources/dev/client/Client.js +9 -9
  13. package/dist/cjs/api/resources/notifications/resources/courier/client/Client.d.ts +2 -2
  14. package/dist/cjs/api/resources/notifications/resources/courier/client/Client.js +2 -2
  15. package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.d.ts +2 -2
  16. package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.js +2 -2
  17. package/dist/cjs/api/resources/orderDrafts/client/Client.d.ts +27 -0
  18. package/dist/cjs/api/resources/orderDrafts/client/Client.js +125 -0
  19. package/dist/cjs/api/resources/orderDrafts/client/requests/index.d.ts +2 -0
  20. package/dist/cjs/api/resources/orders/client/Client.d.ts +0 -3
  21. package/dist/cjs/api/resources/orders/client/Client.js +0 -5
  22. package/dist/cjs/api/resources/orders/resources/index.d.ts +0 -1
  23. package/dist/cjs/api/resources/orders/resources/index.js +1 -2
  24. package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/Client.d.ts +3 -3
  25. package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/Client.js +3 -3
  26. package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/Client.d.ts +3 -3
  27. package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/Client.js +3 -3
  28. package/dist/cjs/api/resources/orgProfiles/client/Client.d.ts +7 -7
  29. package/dist/cjs/api/resources/orgProfiles/client/Client.js +7 -7
  30. package/dist/cjs/api/resources/orgs/client/Client.d.ts +8 -8
  31. package/dist/cjs/api/resources/orgs/client/Client.js +7 -7
  32. package/dist/cjs/api/resources/root/client/Client.d.ts +8 -8
  33. package/dist/cjs/api/resources/root/client/Client.js +5 -5
  34. package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.d.ts +2 -2
  35. package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.js +2 -2
  36. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.d.ts +1 -1
  37. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.js +1 -1
  38. package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.d.ts +1 -1
  39. package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.js +1 -1
  40. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +7 -7
  41. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +7 -7
  42. package/dist/cjs/api/resources/tracking/resources/driver/client/Client.d.ts +2 -2
  43. package/dist/cjs/api/resources/tracking/resources/driver/client/Client.js +1 -1
  44. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.d.ts +14 -14
  45. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.js +14 -14
  46. package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.ts +1 -1
  47. package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.js +1 -1
  48. package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
  49. package/dist/cjs/api/resources/users/client/Client.js +1 -1
  50. package/dist/cjs/api/resources/utils/client/Client.d.ts +1 -1
  51. package/dist/cjs/api/resources/utils/client/Client.js +1 -1
  52. package/dist/cjs/api/types/Cargo1.d.ts +1 -1
  53. package/dist/cjs/api/types/CargoClientCreate1.d.ts +1 -1
  54. package/dist/cjs/api/types/CargoClientUpdate1.d.ts +1 -1
  55. package/dist/{esm/api/types/DriverUpdateResp.d.mts → cjs/api/types/DriverUpdateRes.d.ts} +1 -1
  56. package/dist/cjs/api/types/TaskClientUpdate1.d.ts +0 -1
  57. package/dist/cjs/api/types/index.d.ts +1 -1
  58. package/dist/cjs/api/types/index.js +1 -1
  59. package/dist/cjs/version.d.ts +1 -1
  60. package/dist/cjs/version.js +1 -1
  61. package/dist/esm/Client.mjs +2 -2
  62. package/dist/esm/api/resources/connections/client/Client.d.mts +3 -3
  63. package/dist/esm/api/resources/connections/client/Client.mjs +3 -3
  64. package/dist/esm/api/resources/connections/resources/connectionToCourier/client/Client.d.mts +1 -1
  65. package/dist/esm/api/resources/connections/resources/connectionToCourier/client/Client.mjs +1 -1
  66. package/dist/esm/api/resources/connections/resources/connectionToForwarder/client/Client.d.mts +1 -1
  67. package/dist/esm/api/resources/connections/resources/connectionToForwarder/client/Client.mjs +1 -1
  68. package/dist/esm/api/resources/connections/resources/connectionToShipper/client/Client.d.mts +1 -1
  69. package/dist/esm/api/resources/connections/resources/connectionToShipper/client/Client.mjs +1 -1
  70. package/dist/esm/api/resources/dev/client/Client.d.mts +9 -9
  71. package/dist/esm/api/resources/dev/client/Client.mjs +9 -9
  72. package/dist/esm/api/resources/notifications/resources/courier/client/Client.d.mts +2 -2
  73. package/dist/esm/api/resources/notifications/resources/courier/client/Client.mjs +2 -2
  74. package/dist/esm/api/resources/notifications/resources/shipper/client/Client.d.mts +2 -2
  75. package/dist/esm/api/resources/notifications/resources/shipper/client/Client.mjs +2 -2
  76. package/dist/esm/api/resources/orderDrafts/client/Client.d.mts +27 -0
  77. package/dist/esm/api/resources/orderDrafts/client/Client.mjs +125 -0
  78. package/dist/esm/api/resources/orderDrafts/client/requests/index.d.mts +2 -0
  79. package/dist/esm/api/resources/orders/client/Client.d.mts +0 -3
  80. package/dist/esm/api/resources/orders/client/Client.mjs +0 -5
  81. package/dist/esm/api/resources/orders/resources/index.d.mts +0 -1
  82. package/dist/esm/api/resources/orders/resources/index.mjs +0 -1
  83. package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/Client.d.mts +3 -3
  84. package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/Client.mjs +3 -3
  85. package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/Client.d.mts +3 -3
  86. package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/Client.mjs +3 -3
  87. package/dist/esm/api/resources/orgProfiles/client/Client.d.mts +7 -7
  88. package/dist/esm/api/resources/orgProfiles/client/Client.mjs +7 -7
  89. package/dist/esm/api/resources/orgs/client/Client.d.mts +8 -8
  90. package/dist/esm/api/resources/orgs/client/Client.mjs +7 -7
  91. package/dist/esm/api/resources/root/client/Client.d.mts +8 -8
  92. package/dist/esm/api/resources/root/client/Client.mjs +5 -5
  93. package/dist/esm/api/resources/taskArtifactNotifications/client/Client.d.mts +2 -2
  94. package/dist/esm/api/resources/taskArtifactNotifications/client/Client.mjs +2 -2
  95. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.d.mts +1 -1
  96. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.mjs +1 -1
  97. package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.d.mts +1 -1
  98. package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.mjs +1 -1
  99. package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +7 -7
  100. package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +7 -7
  101. package/dist/esm/api/resources/tracking/resources/driver/client/Client.d.mts +2 -2
  102. package/dist/esm/api/resources/tracking/resources/driver/client/Client.mjs +1 -1
  103. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.d.mts +14 -14
  104. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.mjs +14 -14
  105. package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.mts +1 -1
  106. package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.mjs +1 -1
  107. package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
  108. package/dist/esm/api/resources/users/client/Client.mjs +1 -1
  109. package/dist/esm/api/resources/utils/client/Client.d.mts +1 -1
  110. package/dist/esm/api/resources/utils/client/Client.mjs +1 -1
  111. package/dist/esm/api/types/Cargo1.d.mts +1 -1
  112. package/dist/esm/api/types/CargoClientCreate1.d.mts +1 -1
  113. package/dist/esm/api/types/CargoClientUpdate1.d.mts +1 -1
  114. package/dist/{cjs/api/types/DriverUpdateResp.d.ts → esm/api/types/DriverUpdateRes.d.mts} +1 -1
  115. package/dist/esm/api/types/TaskClientUpdate1.d.mts +0 -1
  116. package/dist/esm/api/types/index.d.mts +1 -1
  117. package/dist/esm/api/types/index.mjs +1 -1
  118. package/dist/esm/version.d.mts +1 -1
  119. package/dist/esm/version.mjs +1 -1
  120. package/package.json +1 -1
  121. package/reference.md +212 -214
  122. package/dist/cjs/api/resources/orders/resources/draft/client/Client.d.ts +0 -23
  123. package/dist/cjs/api/resources/orders/resources/draft/client/Client.js +0 -17
  124. package/dist/cjs/api/resources/orders/resources/draft/client/index.d.ts +0 -1
  125. package/dist/cjs/api/resources/orders/resources/draft/client/index.js +0 -2
  126. package/dist/cjs/api/resources/orders/resources/draft/index.d.ts +0 -2
  127. package/dist/cjs/api/resources/orders/resources/draft/index.js +0 -18
  128. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/Client.d.ts +0 -61
  129. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/Client.js +0 -193
  130. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/index.d.ts +0 -2
  131. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/index.js +0 -17
  132. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/requests/index.d.ts +0 -2
  133. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/requests/index.js +0 -2
  134. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/index.d.ts +0 -1
  135. package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/index.js +0 -17
  136. package/dist/cjs/api/resources/orders/resources/draft/resources/index.d.ts +0 -2
  137. package/dist/cjs/api/resources/orders/resources/draft/resources/index.js +0 -41
  138. package/dist/esm/api/resources/orders/resources/draft/client/Client.d.mts +0 -23
  139. package/dist/esm/api/resources/orders/resources/draft/client/Client.mjs +0 -13
  140. package/dist/esm/api/resources/orders/resources/draft/client/index.d.mts +0 -1
  141. package/dist/esm/api/resources/orders/resources/draft/client/index.mjs +0 -1
  142. package/dist/esm/api/resources/orders/resources/draft/index.d.mts +0 -2
  143. package/dist/esm/api/resources/orders/resources/draft/index.mjs +0 -2
  144. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/Client.d.mts +0 -61
  145. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/Client.mjs +0 -156
  146. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/index.d.mts +0 -2
  147. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/index.mjs +0 -1
  148. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/requests/index.d.mts +0 -2
  149. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/requests/index.mjs +0 -1
  150. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/index.d.mts +0 -1
  151. package/dist/esm/api/resources/orders/resources/draft/resources/expanded/index.mjs +0 -1
  152. package/dist/esm/api/resources/orders/resources/draft/resources/index.d.mts +0 -2
  153. package/dist/esm/api/resources/orders/resources/draft/resources/index.mjs +0 -2
  154. /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.d.ts +0 -0
  155. /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.js +0 -0
  156. /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.d.ts +0 -0
  157. /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.js +0 -0
  158. /package/dist/cjs/api/types/{DriverUpdateResp.js → DriverUpdateRes.js} +0 -0
  159. /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.d.mts +0 -0
  160. /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.mjs +0 -0
  161. /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.d.mts +0 -0
  162. /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.mjs +0 -0
  163. /package/dist/esm/api/types/{DriverUpdateResp.mjs → DriverUpdateRes.mjs} +0 -0
package/README.md CHANGED
@@ -1,604 +0,0 @@
1
- # Chrt TypeScript Library
2
-
3
- [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fchrt-inc%2Ftypescript-sdk)
4
- [![npm shield](https://img.shields.io/npm/v/@chrt-inc/typescript-sdk)](https://www.npmjs.com/package/@chrt-inc/typescript-sdk)
5
-
6
- The Chrt TypeScript library provides convenient access to the Chrt APIs from TypeScript.
7
-
8
- ## Table of Contents
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
-
29
- - [Installation](#installation)
30
- - [Reference](#reference)
31
- - [Usage](#usage)
32
- - [Request and Response Types](#request-and-response-types)
33
- - [Exception Handling](#exception-handling)
34
- - [Advanced](#advanced)
35
- - [Additional Headers](#additional-headers)
36
- - [Additional Query String Parameters](#additional-query-string-parameters)
37
- - [Retries](#retries)
38
- - [Timeouts](#timeouts)
39
- - [Aborting Requests](#aborting-requests)
40
- - [Access Raw Response Data](#access-raw-response-data)
41
- - [Runtime Compatibility](#runtime-compatibility)
42
- - [Contributing](#contributing)
43
- - [Binary Response](#binary-response)
44
-
45
- ## Installation
46
-
47
- ```sh
48
- npm i -s @chrt-inc/typescript-sdk
49
- ```
50
-
51
- ## Reference
52
-
53
- A full reference for this library is available [here](https://github.com/chrt-inc/typescript-sdk/blob/HEAD/./reference.md).
54
-
55
- ## Usage
56
-
57
- Instantiate and use the client with the following:
58
-
59
- ```typescript
60
- import { ChrtClient } from "@chrt-inc/typescript-sdk";
61
-
62
- const client = new ChrtClient({ token: "YOUR_TOKEN" });
63
- await client.payments.generateInvoiceV1({
64
- shipper_pay_courier_statement_id: "shipper_pay_courier_statement_id",
65
- });
66
- ```
67
-
68
- ## Request and Response Types
69
-
70
- The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
71
- following namespace:
72
-
73
- ```typescript
74
- import { Chrt } from "@chrt-inc/typescript-sdk";
75
-
76
- const request: Chrt.GenerateInvoiceReq = {
77
- ...
78
- };
79
- ```
80
-
81
- ## Exception Handling
82
-
83
- When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
84
- will be thrown.
85
-
86
- ```typescript
87
- import { ChrtError } from "@chrt-inc/typescript-sdk";
88
-
89
- try {
90
- await client.payments.generateInvoiceV1(...);
91
- } catch (err) {
92
- if (err instanceof ChrtError) {
93
- console.log(err.statusCode);
94
- console.log(err.message);
95
- console.log(err.body);
96
- console.log(err.rawResponse);
97
- }
98
- }
99
- ```
100
-
101
- ## Advanced
102
-
103
- ### Additional Headers
104
-
105
- If you would like to send additional headers as part of the request, use the `headers` request option.
106
-
107
- ```typescript
108
- const response = await client.payments.generateInvoiceV1(..., {
109
- headers: {
110
- 'X-Custom-Header': 'custom value'
111
- }
112
- });
113
- ```
114
-
115
- ### Additional Query String Parameters
116
-
117
- If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
118
-
119
- ```typescript
120
- const response = await client.payments.generateInvoiceV1(..., {
121
- queryParams: {
122
- 'customQueryParamKey': 'custom query param value'
123
- }
124
- });
125
- ```
126
-
127
- ### Retries
128
-
129
- The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
130
- as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
131
- retry limit (default: 2).
132
-
133
- A request is deemed retryable when any of the following HTTP status codes is returned:
134
-
135
- - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
136
- - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
137
- - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
138
-
139
- Use the `maxRetries` request option to configure this behavior.
140
-
141
- ```typescript
142
- const response = await client.payments.generateInvoiceV1(..., {
143
- maxRetries: 0 // override maxRetries at the request level
144
- });
145
- ```
146
-
147
- ### Timeouts
148
-
149
- The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
150
-
151
- ```typescript
152
- const response = await client.payments.generateInvoiceV1(..., {
153
- timeoutInSeconds: 30 // override timeout to 30s
154
- });
155
- ```
156
-
157
- ### Aborting Requests
158
-
159
- The SDK allows users to abort requests at any point by passing in an abort signal.
160
-
161
- ```typescript
162
- const controller = new AbortController();
163
- const response = await client.payments.generateInvoiceV1(..., {
164
- abortSignal: controller.signal
165
- });
166
- controller.abort(); // aborts the request
167
- ```
168
-
169
- ### Access Raw Response Data
170
-
171
- The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
172
- The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
173
-
174
- ```typescript
175
- const { data, rawResponse } = await client.payments.generateInvoiceV1(...).withRawResponse();
176
-
177
- console.log(data);
178
- console.log(rawResponse.headers['X-My-Header']);
179
- ```
180
-
181
- ### Runtime Compatibility
182
-
183
- The SDK works in the following runtimes:
184
-
185
- - Node.js 18+
186
- - Vercel
187
- - Cloudflare Workers
188
- - Deno v1.25+
189
- - Bun 1.0+
190
- - React Native
191
-
192
- ### Customizing Fetch Client
193
-
194
- The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
195
- unsupported environment, this provides a way for you to break glass and ensure the SDK works.
196
-
197
- ```typescript
198
- import { ChrtClient } from "@chrt-inc/typescript-sdk";
199
-
200
- const client = new ChrtClient({
201
- ...
202
- fetcher: // provide your implementation here
203
- });
204
- ```
205
-
206
- ## Contributing
207
-
208
- While we value open-source contributions to this SDK, this library is generated programmatically.
209
- Additions made directly to this library would have to be moved over to our generation code,
210
- otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
211
- a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
212
- an issue first to discuss with us!
213
-
214
- On the other hand, contributions to the README are always very welcome!
215
-
216
- ## Binary Response
217
-
218
- You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data:
219
-
220
- ```typescript
221
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
222
- const stream: ReadableStream<Uint8Array> = response.stream();
223
- // const arrayBuffer: ArrayBuffer = await response.arrayBuffer();
224
- // const blob: Blob = response.blob();
225
- // const bytes: Uint8Array = response.bytes();
226
- // You can only use the response body once, so you must choose one of the above methods.
227
- // If you want to check if the response body has been used, you can use the following property.
228
- const bodyUsed = response.bodyUsed;
229
- ```
230
-
231
- <details>
232
- <summary>Save binary response to a file</summary>
233
-
234
- <blockquote>
235
- <details>
236
- <summary>Node.js</summary>
237
-
238
- <blockquote>
239
- <details>
240
- <summary>ReadableStream (most-efficient)</summary>
241
-
242
- ```ts
243
- import { createWriteStream } from 'fs';
244
- import { Readable } from 'stream';
245
- import { pipeline } from 'stream/promises';
246
-
247
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
248
-
249
- const stream = response.stream();
250
- const nodeStream = Readable.fromWeb(stream);
251
- const writeStream = createWriteStream('path/to/file');
252
-
253
- await pipeline(nodeStream, writeStream);
254
- ```
255
-
256
- </details>
257
- </blockquote>
258
-
259
- <blockquote>
260
- <details>
261
- <summary>ArrayBuffer</summary>
262
-
263
- ```ts
264
- import { writeFile } from 'fs/promises';
265
-
266
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
267
-
268
- const arrayBuffer = await response.arrayBuffer();
269
- await writeFile('path/to/file', Buffer.from(arrayBuffer));
270
- ```
271
-
272
- </details>
273
- </blockquote>
274
-
275
- <blockquote>
276
- <details>
277
- <summary>Blob</summary>
278
-
279
- ```ts
280
- import { writeFile } from 'fs/promises';
281
-
282
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
283
-
284
- const blob = await response.blob();
285
- const arrayBuffer = await blob.arrayBuffer();
286
- await writeFile('output.bin', Buffer.from(arrayBuffer));
287
- ```
288
-
289
- </details>
290
- </blockquote>
291
-
292
- <blockquote>
293
- <details>
294
- <summary>Bytes (UIntArray8)</summary>
295
-
296
- ```ts
297
- import { writeFile } from 'fs/promises';
298
-
299
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
300
-
301
- const bytes = await response.bytes();
302
- await writeFile('path/to/file', bytes);
303
- ```
304
-
305
- </details>
306
- </blockquote>
307
-
308
- </details>
309
- </blockquote>
310
-
311
- <blockquote>
312
- <details>
313
- <summary>Bun</summary>
314
-
315
- <blockquote>
316
- <details>
317
- <summary>ReadableStream (most-efficient)</summary>
318
-
319
- ```ts
320
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
321
-
322
- const stream = response.stream();
323
- await Bun.write('path/to/file', stream);
324
- ```
325
-
326
- </details>
327
- </blockquote>
328
-
329
- <blockquote>
330
- <details>
331
- <summary>ArrayBuffer</summary>
332
-
333
- ```ts
334
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
335
-
336
- const arrayBuffer = await response.arrayBuffer();
337
- await Bun.write('path/to/file', arrayBuffer);
338
- ```
339
-
340
- </details>
341
- </blockquote>
342
-
343
- <blockquote>
344
- <details>
345
- <summary>Blob</summary>
346
-
347
- ```ts
348
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
349
-
350
- const blob = await response.blob();
351
- await Bun.write('path/to/file', blob);
352
- ```
353
-
354
- </details>
355
- </blockquote>
356
-
357
- <blockquote>
358
- <details>
359
- <summary>Bytes (UIntArray8)</summary>
360
-
361
- ```ts
362
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
363
-
364
- const bytes = await response.bytes();
365
- await Bun.write('path/to/file', bytes);
366
- ```
367
-
368
- </details>
369
- </blockquote>
370
-
371
- </details>
372
- </blockquote>
373
-
374
- <blockquote>
375
- <details>
376
- <summary>Deno</summary>
377
-
378
- <blockquote>
379
- <details>
380
- <summary>ReadableStream (most-efficient)</summary>
381
-
382
- ```ts
383
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
384
-
385
- const stream = response.stream();
386
- const file = await Deno.open('path/to/file', { write: true, create: true });
387
- await stream.pipeTo(file.writable);
388
- ```
389
-
390
- </details>
391
- </blockquote>
392
-
393
- <blockquote>
394
- <details>
395
- <summary>ArrayBuffer</summary>
396
-
397
- ```ts
398
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
399
-
400
- const arrayBuffer = await response.arrayBuffer();
401
- await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
402
- ```
403
-
404
- </details>
405
- </blockquote>
406
-
407
- <blockquote>
408
- <details>
409
- <summary>Blob</summary>
410
-
411
- ```ts
412
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
413
-
414
- const blob = await response.blob();
415
- const arrayBuffer = await blob.arrayBuffer();
416
- await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
417
- ```
418
-
419
- </details>
420
- </blockquote>
421
-
422
- <blockquote>
423
- <details>
424
- <summary>Bytes (UIntArray8)</summary>
425
-
426
- ```ts
427
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
428
-
429
- const bytes = await response.bytes();
430
- await Deno.writeFile('path/to/file', bytes);
431
- ```
432
-
433
- </details>
434
- </blockquote>
435
-
436
- </details>
437
- </blockquote>
438
-
439
- <blockquote>
440
- <details>
441
- <summary>Browser</summary>
442
-
443
- <blockquote>
444
- <details>
445
- <summary>Blob (most-efficient)</summary>
446
-
447
- ```ts
448
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
449
-
450
- const blob = await response.blob();
451
- const url = URL.createObjectURL(blob);
452
-
453
- // trigger download
454
- const a = document.createElement('a');
455
- a.href = url;
456
- a.download = 'filename';
457
- a.click();
458
- URL.revokeObjectURL(url);
459
- ```
460
-
461
- </details>
462
- </blockquote>
463
-
464
- <blockquote>
465
- <details>
466
- <summary>ReadableStream</summary>
467
-
468
- ```ts
469
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
470
-
471
- const stream = response.stream();
472
- const reader = stream.getReader();
473
- const chunks = [];
474
-
475
- while (true) {
476
- const { done, value } = await reader.read();
477
- if (done) break;
478
- chunks.push(value);
479
- }
480
-
481
- const blob = new Blob(chunks);
482
- const url = URL.createObjectURL(blob);
483
-
484
- // trigger download
485
- const a = document.createElement('a');
486
- a.href = url;
487
- a.download = 'filename';
488
- a.click();
489
- URL.revokeObjectURL(url);
490
- ```
491
-
492
- </details>
493
- </blockquote>
494
-
495
- <blockquote>
496
- <details>
497
- <summary>ArrayBuffer</summary>
498
-
499
- ```ts
500
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
501
-
502
- const arrayBuffer = await response.arrayBuffer();
503
- const blob = new Blob([arrayBuffer]);
504
- const url = URL.createObjectURL(blob);
505
-
506
- // trigger download
507
- const a = document.createElement('a');
508
- a.href = url;
509
- a.download = 'filename';
510
- a.click();
511
- URL.revokeObjectURL(url);
512
- ```
513
-
514
- </details>
515
- </blockquote>
516
-
517
- <blockquote>
518
- <details>
519
- <summary>Bytes (UIntArray8)</summary>
520
-
521
- ```ts
522
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
523
-
524
- const bytes = await response.bytes();
525
- const blob = new Blob([bytes]);
526
- const url = URL.createObjectURL(blob);
527
-
528
- // trigger download
529
- const a = document.createElement('a');
530
- a.href = url;
531
- a.download = 'filename';
532
- a.click();
533
- URL.revokeObjectURL(url);
534
- ```
535
-
536
- </details>
537
- </blockquote>
538
-
539
- </details>
540
- </blockquote>
541
-
542
- </details>
543
- </blockquote>
544
-
545
- <details>
546
- <summary>Convert binary response to text</summary>
547
-
548
- <blockquote>
549
- <details>
550
- <summary>ReadableStream</summary>
551
-
552
- ```ts
553
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
554
-
555
- const stream = response.stream();
556
- const text = await new Response(stream).text();
557
- ```
558
-
559
- </details>
560
- </blockquote>
561
-
562
- <blockquote>
563
- <details>
564
- <summary>ArrayBuffer</summary>
565
-
566
- ```ts
567
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
568
-
569
- const arrayBuffer = await response.arrayBuffer();
570
- const text = new TextDecoder().decode(arrayBuffer);
571
- ```
572
-
573
- </details>
574
- </blockquote>
575
-
576
- <blockquote>
577
- <details>
578
- <summary>Blob</summary>
579
-
580
- ```ts
581
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
582
-
583
- const blob = await response.blob();
584
- const text = await blob.text();
585
- ```
586
-
587
- </details>
588
- </blockquote>
589
-
590
- <blockquote>
591
- <details>
592
- <summary>Bytes (UIntArray8)</summary>
593
-
594
- ```ts
595
- const response = await client.taskArtifacts.images.getByMetadataIdV1(...);
596
-
597
- const bytes = await response.bytes();
598
- const text = new TextDecoder().decode(bytes);
599
- ```
600
-
601
- </details>
602
- </blockquote>
603
-
604
- </details>
@@ -71,8 +71,8 @@ class ChrtClient {
71
71
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
72
72
  "X-Fern-Language": "JavaScript",
73
73
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
74
- "X-Fern-SDK-Version": "1.303.0",
75
- "User-Agent": "@chrt-inc/typescript-sdk/1.303.0",
74
+ "X-Fern-SDK-Version": "1.304.0",
75
+ "User-Agent": "@chrt-inc/typescript-sdk/1.304.0",
76
76
  "X-Fern-Runtime": core.RUNTIME.type,
77
77
  "X-Fern-Runtime-Version": core.RUNTIME.version,
78
78
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -40,7 +40,7 @@ export declare class Connections {
40
40
  get connectionToShipper(): ConnectionToShipper;
41
41
  get connectionToForwarder(): ConnectionToForwarder;
42
42
  /**
43
- * Lists shipper organizations based on the authenticated organization type. Couriers see connected shippers, forwarders see connected shippers.
43
+ * Lists shipper organizations based on the authenticated organization type. Couriers see connected shippers, forwarders see connected shippers. | () -> (list[ShipperConnectionRes])
44
44
  *
45
45
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
46
46
  *
@@ -50,7 +50,7 @@ export declare class Connections {
50
50
  listShippersV1(requestOptions?: Connections.RequestOptions): core.HttpResponsePromise<Chrt.ShipperConnectionRes[]>;
51
51
  private __listShippersV1;
52
52
  /**
53
- * Lists courier organizations based on the authenticated organization type. Shippers see connected couriers, forwarders see connected couriers.
53
+ * Lists courier organizations based on the authenticated organization type. Shippers see connected couriers, forwarders see connected couriers. | () -> (list[CourierConnectionRes])
54
54
  *
55
55
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
56
56
  *
@@ -60,7 +60,7 @@ export declare class Connections {
60
60
  listCouriersV1(requestOptions?: Connections.RequestOptions): core.HttpResponsePromise<Chrt.CourierConnectionRes[]>;
61
61
  private __listCouriersV1;
62
62
  /**
63
- * Lists forwarder organizations based on the authenticated organization type. Shippers see connected forwarders, couriers see connected forwarders.
63
+ * Lists forwarder organizations based on the authenticated organization type. Shippers see connected forwarders, couriers see connected forwarders. | () -> (list[ForwarderConnectionRes])
64
64
  *
65
65
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
66
66
  *
@@ -70,7 +70,7 @@ class Connections {
70
70
  return ((_a = this._connectionToForwarder) !== null && _a !== void 0 ? _a : (this._connectionToForwarder = new Client_js_3.ConnectionToForwarder(this._options)));
71
71
  }
72
72
  /**
73
- * Lists shipper organizations based on the authenticated organization type. Couriers see connected shippers, forwarders see connected shippers.
73
+ * Lists shipper organizations based on the authenticated organization type. Couriers see connected shippers, forwarders see connected shippers. | () -> (list[ShipperConnectionRes])
74
74
  *
75
75
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
76
76
  *
@@ -121,7 +121,7 @@ class Connections {
121
121
  });
122
122
  }
123
123
  /**
124
- * Lists courier organizations based on the authenticated organization type. Shippers see connected couriers, forwarders see connected couriers.
124
+ * Lists courier organizations based on the authenticated organization type. Shippers see connected couriers, forwarders see connected couriers. | () -> (list[CourierConnectionRes])
125
125
  *
126
126
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
127
127
  *
@@ -172,7 +172,7 @@ class Connections {
172
172
  });
173
173
  }
174
174
  /**
175
- * Lists forwarder organizations based on the authenticated organization type. Shippers see connected forwarders, couriers see connected forwarders.
175
+ * Lists forwarder organizations based on the authenticated organization type. Shippers see connected forwarders, couriers see connected forwarders. | () -> (list[ForwarderConnectionRes])
176
176
  *
177
177
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
178
178
  *
@@ -31,7 +31,7 @@ export declare class ConnectionToCourier {
31
31
  protected readonly _options: ConnectionToCourier.Options;
32
32
  constructor(_options?: ConnectionToCourier.Options);
33
33
  /**
34
- * Creates a new connection to a courier organization. Shippers and forwarders can initiate connections to couriers.
34
+ * Creates a new connection to a courier organization. Shippers and forwarders can initiate connections to couriers. | (CreateConnectionReq) -> (PydanticObjectId)
35
35
  *
36
36
  * @param {Chrt.CreateConnectionReq} request
37
37
  * @param {ConnectionToCourier.RequestOptions} requestOptions - Request-specific configuration.
@@ -56,7 +56,7 @@ class ConnectionToCourier {
56
56
  this._options = _options;
57
57
  }
58
58
  /**
59
- * Creates a new connection to a courier organization. Shippers and forwarders can initiate connections to couriers.
59
+ * Creates a new connection to a courier organization. Shippers and forwarders can initiate connections to couriers. | (CreateConnectionReq) -> (PydanticObjectId)
60
60
  *
61
61
  * @param {Chrt.CreateConnectionReq} request
62
62
  * @param {ConnectionToCourier.RequestOptions} requestOptions - Request-specific configuration.
@@ -31,7 +31,7 @@ export declare class ConnectionToForwarder {
31
31
  protected readonly _options: ConnectionToForwarder.Options;
32
32
  constructor(_options?: ConnectionToForwarder.Options);
33
33
  /**
34
- * Creates a new connection to a forwarder organization. Only shippers can initiate connections to forwarders.
34
+ * Creates a new connection to a forwarder organization. Only shippers can initiate connections to forwarders. | (CreateConnectionReq) -> (PydanticObjectId)
35
35
  *
36
36
  * @param {Chrt.CreateConnectionReq} request
37
37
  * @param {ConnectionToForwarder.RequestOptions} requestOptions - Request-specific configuration.
@@ -56,7 +56,7 @@ class ConnectionToForwarder {
56
56
  this._options = _options;
57
57
  }
58
58
  /**
59
- * Creates a new connection to a forwarder organization. Only shippers can initiate connections to forwarders.
59
+ * Creates a new connection to a forwarder organization. Only shippers can initiate connections to forwarders. | (CreateConnectionReq) -> (PydanticObjectId)
60
60
  *
61
61
  * @param {Chrt.CreateConnectionReq} request
62
62
  * @param {ConnectionToForwarder.RequestOptions} requestOptions - Request-specific configuration.