@chrt-inc/typescript-sdk 1.1020.0 → 1.1024.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 (205) hide show
  1. package/README.md +12 -9
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/chrtGpt/client/Client.d.ts +6 -13
  4. package/dist/cjs/api/resources/chrtGpt/client/Client.js +24 -17
  5. package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.ts → ChrtGptReq.d.ts} +1 -1
  6. package/dist/cjs/api/resources/chrtGpt/client/requests/index.d.ts +1 -1
  7. package/dist/cjs/api/resources/chrtGpt/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/chrtGpt/index.js +1 -0
  9. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.d.ts +65 -0
  10. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.js +205 -0
  11. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.js +17 -0
  13. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.ts +21 -0
  14. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.js +17 -0
  18. package/dist/cjs/api/resources/chrtGpt/resources/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/chrtGpt/resources/index.js +41 -0
  20. package/dist/cjs/api/resources/orgs/resources/connections/client/Client.d.ts +18 -1
  21. package/dist/cjs/api/resources/orgs/resources/connections/client/Client.js +75 -6
  22. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.ts +4 -1
  23. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.ts +12 -0
  24. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.js +5 -0
  25. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.d.ts +3 -0
  27. package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.js +5 -0
  28. package/dist/cjs/api/resources/orgs/resources/publicData/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/orgs/resources/publicData/index.js +1 -0
  30. package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.d.ts +2 -0
  31. package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.js +41 -0
  32. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.ts +86 -0
  33. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.js +319 -0
  34. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.ts +2 -0
  35. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.js +17 -0
  36. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.ts +13 -0
  37. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.js +5 -0
  38. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.js +2 -0
  40. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.js +17 -0
  42. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +47 -1
  43. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +195 -1
  44. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.d.ts +12 -0
  45. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.js +5 -0
  46. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.ts +14 -0
  47. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.js +5 -0
  48. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.ts +12 -0
  49. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.js +5 -0
  50. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +3 -0
  51. package/dist/cjs/api/types/ChrtGptAssistantMessageItem.d.ts +8 -0
  52. package/dist/cjs/api/types/ChrtGptAssistantMessageItem.js +5 -0
  53. package/dist/cjs/api/types/ChrtGptCompletedEvent.d.ts +11 -0
  54. package/dist/cjs/api/types/ChrtGptCompletedEvent.js +5 -0
  55. package/dist/cjs/api/types/ChrtGptConversation1.d.ts +14 -0
  56. package/dist/cjs/api/types/ChrtGptConversation1.js +5 -0
  57. package/dist/cjs/api/types/ChrtGptConversationListRes.d.ts +8 -0
  58. package/dist/cjs/api/types/ChrtGptConversationListRes.js +5 -0
  59. package/dist/cjs/api/types/ChrtGptConversationRes.d.ts +9 -0
  60. package/dist/cjs/api/types/ChrtGptConversationRes.js +5 -0
  61. package/dist/cjs/api/types/ChrtGptConversationSortByEnum.d.ts +8 -0
  62. package/dist/cjs/api/types/ChrtGptConversationSortByEnum.js +10 -0
  63. package/dist/cjs/api/types/ChrtGptErrorEvent.d.ts +9 -0
  64. package/dist/cjs/api/types/ChrtGptErrorEvent.js +5 -0
  65. package/dist/cjs/api/types/ChrtGptEvent.d.ts +31 -0
  66. package/dist/cjs/api/types/ChrtGptEvent.js +5 -0
  67. package/dist/cjs/api/types/ChrtGptHistoryItem.d.ts +22 -0
  68. package/dist/cjs/api/types/ChrtGptHistoryItem.js +5 -0
  69. package/dist/{esm/api/types/ChrtGptMessageRes.d.mts → cjs/api/types/ChrtGptStartedEvent.d.ts} +4 -2
  70. package/dist/cjs/api/types/ChrtGptStartedEvent.js +5 -0
  71. package/dist/cjs/api/types/ChrtGptTextDeltaEvent.d.ts +8 -0
  72. package/dist/cjs/api/types/ChrtGptTextDeltaEvent.js +5 -0
  73. package/dist/cjs/api/types/ChrtGptTitleEvent.d.ts +11 -0
  74. package/dist/cjs/api/types/ChrtGptTitleEvent.js +5 -0
  75. package/dist/cjs/api/types/ChrtGptToolCalledEvent.d.ts +12 -0
  76. package/dist/cjs/api/types/ChrtGptToolCalledEvent.js +5 -0
  77. package/dist/cjs/api/types/ChrtGptToolOutputEvent.d.ts +9 -0
  78. package/dist/cjs/api/types/ChrtGptToolOutputEvent.js +5 -0
  79. package/dist/cjs/api/types/ChrtGptUserMessageItem.d.ts +6 -0
  80. package/dist/cjs/api/types/ChrtGptUserMessageItem.js +5 -0
  81. package/dist/cjs/api/types/ChrtGptWebSearchEvent.d.ts +18 -0
  82. package/dist/cjs/api/types/ChrtGptWebSearchEvent.js +5 -0
  83. package/dist/cjs/api/types/DeviceForCargoRes.d.ts +17 -0
  84. package/dist/cjs/api/types/DeviceForCargoRes.js +5 -0
  85. package/dist/cjs/api/types/OrgPublicData1.d.ts +1 -0
  86. package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.d.ts +21 -0
  87. package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.js +5 -0
  88. package/dist/cjs/api/types/ShipperCoordinatorConnection1.d.ts +4 -0
  89. package/dist/cjs/api/types/SpecialHandlingCodeEnum1.d.ts +63 -1
  90. package/dist/cjs/api/types/SpecialHandlingCodeEnum1.js +62 -0
  91. package/dist/cjs/api/types/index.d.ts +18 -1
  92. package/dist/cjs/api/types/index.js +18 -1
  93. package/dist/cjs/core/index.d.ts +1 -0
  94. package/dist/cjs/core/index.js +1 -0
  95. package/dist/cjs/core/stream/Stream.d.ts +46 -0
  96. package/dist/cjs/core/stream/Stream.js +169 -0
  97. package/dist/cjs/core/stream/index.d.ts +1 -0
  98. package/dist/cjs/core/stream/index.js +5 -0
  99. package/dist/cjs/version.d.ts +1 -1
  100. package/dist/cjs/version.js +1 -1
  101. package/dist/esm/Client.mjs +2 -2
  102. package/dist/esm/api/resources/chrtGpt/client/Client.d.mts +6 -13
  103. package/dist/esm/api/resources/chrtGpt/client/Client.mjs +24 -17
  104. package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.mts → ChrtGptReq.d.mts} +1 -1
  105. package/dist/esm/api/resources/chrtGpt/client/requests/index.d.mts +1 -1
  106. package/dist/esm/api/resources/chrtGpt/index.d.mts +1 -0
  107. package/dist/esm/api/resources/chrtGpt/index.mjs +1 -0
  108. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.d.mts +65 -0
  109. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.mjs +168 -0
  110. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.d.mts +2 -0
  111. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.mjs +1 -0
  112. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.mts +21 -0
  113. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.d.mts +1 -0
  114. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.mjs +1 -0
  115. package/dist/esm/api/resources/chrtGpt/resources/conversations/index.d.mts +1 -0
  116. package/dist/esm/api/resources/chrtGpt/resources/conversations/index.mjs +1 -0
  117. package/dist/esm/api/resources/chrtGpt/resources/index.d.mts +2 -0
  118. package/dist/esm/api/resources/chrtGpt/resources/index.mjs +2 -0
  119. package/dist/esm/api/resources/orgs/resources/connections/client/Client.d.mts +18 -1
  120. package/dist/esm/api/resources/orgs/resources/connections/client/Client.mjs +75 -6
  121. package/dist/esm/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.mts +4 -1
  122. package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.mts +12 -0
  123. package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.mjs +4 -0
  124. package/dist/esm/api/resources/orgs/resources/connections/client/requests/index.d.mts +1 -0
  125. package/dist/esm/api/resources/orgs/resources/publicData/client/Client.d.mts +3 -0
  126. package/dist/esm/api/resources/orgs/resources/publicData/client/Client.mjs +5 -0
  127. package/dist/esm/api/resources/orgs/resources/publicData/index.d.mts +1 -0
  128. package/dist/esm/api/resources/orgs/resources/publicData/index.mjs +1 -0
  129. package/dist/esm/api/resources/orgs/resources/publicData/resources/index.d.mts +2 -0
  130. package/dist/esm/api/resources/orgs/resources/publicData/resources/index.mjs +2 -0
  131. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.mts +86 -0
  132. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.mjs +282 -0
  133. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.mts +2 -0
  134. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.mjs +1 -0
  135. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.mts +13 -0
  136. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.mjs +4 -0
  137. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.mts +1 -0
  138. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.mjs +1 -0
  139. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.d.mts +1 -0
  140. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.mjs +1 -0
  141. package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +47 -1
  142. package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +195 -1
  143. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.d.mts +12 -0
  144. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.mjs +4 -0
  145. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.mts +14 -0
  146. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.mjs +4 -0
  147. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.mts +12 -0
  148. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.mjs +4 -0
  149. package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +3 -0
  150. package/dist/esm/api/types/ChrtGptAssistantMessageItem.d.mts +8 -0
  151. package/dist/esm/api/types/ChrtGptAssistantMessageItem.mjs +4 -0
  152. package/dist/esm/api/types/ChrtGptCompletedEvent.d.mts +11 -0
  153. package/dist/esm/api/types/ChrtGptCompletedEvent.mjs +4 -0
  154. package/dist/esm/api/types/ChrtGptConversation1.d.mts +14 -0
  155. package/dist/esm/api/types/ChrtGptConversation1.mjs +4 -0
  156. package/dist/esm/api/types/ChrtGptConversationListRes.d.mts +8 -0
  157. package/dist/esm/api/types/ChrtGptConversationListRes.mjs +4 -0
  158. package/dist/esm/api/types/ChrtGptConversationRes.d.mts +9 -0
  159. package/dist/esm/api/types/ChrtGptConversationRes.mjs +4 -0
  160. package/dist/esm/api/types/ChrtGptConversationSortByEnum.d.mts +8 -0
  161. package/dist/esm/api/types/ChrtGptConversationSortByEnum.mjs +7 -0
  162. package/dist/esm/api/types/ChrtGptErrorEvent.d.mts +9 -0
  163. package/dist/esm/api/types/ChrtGptErrorEvent.mjs +4 -0
  164. package/dist/esm/api/types/ChrtGptEvent.d.mts +31 -0
  165. package/dist/esm/api/types/ChrtGptEvent.mjs +4 -0
  166. package/dist/esm/api/types/ChrtGptHistoryItem.d.mts +22 -0
  167. package/dist/esm/api/types/ChrtGptHistoryItem.mjs +4 -0
  168. package/dist/{cjs/api/types/ChrtGptMessageRes.d.ts → esm/api/types/ChrtGptStartedEvent.d.mts} +4 -2
  169. package/dist/esm/api/types/ChrtGptStartedEvent.mjs +4 -0
  170. package/dist/esm/api/types/ChrtGptTextDeltaEvent.d.mts +8 -0
  171. package/dist/esm/api/types/ChrtGptTextDeltaEvent.mjs +4 -0
  172. package/dist/esm/api/types/ChrtGptTitleEvent.d.mts +11 -0
  173. package/dist/esm/api/types/ChrtGptTitleEvent.mjs +4 -0
  174. package/dist/esm/api/types/ChrtGptToolCalledEvent.d.mts +12 -0
  175. package/dist/esm/api/types/ChrtGptToolCalledEvent.mjs +4 -0
  176. package/dist/esm/api/types/ChrtGptToolOutputEvent.d.mts +9 -0
  177. package/dist/esm/api/types/ChrtGptToolOutputEvent.mjs +4 -0
  178. package/dist/esm/api/types/ChrtGptUserMessageItem.d.mts +6 -0
  179. package/dist/esm/api/types/ChrtGptUserMessageItem.mjs +4 -0
  180. package/dist/esm/api/types/ChrtGptWebSearchEvent.d.mts +18 -0
  181. package/dist/esm/api/types/ChrtGptWebSearchEvent.mjs +4 -0
  182. package/dist/esm/api/types/DeviceForCargoRes.d.mts +17 -0
  183. package/dist/esm/api/types/DeviceForCargoRes.mjs +4 -0
  184. package/dist/esm/api/types/OrgPublicData1.d.mts +1 -0
  185. package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.d.mts +21 -0
  186. package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.mjs +4 -0
  187. package/dist/esm/api/types/ShipperCoordinatorConnection1.d.mts +4 -0
  188. package/dist/esm/api/types/SpecialHandlingCodeEnum1.d.mts +63 -1
  189. package/dist/esm/api/types/SpecialHandlingCodeEnum1.mjs +62 -0
  190. package/dist/esm/api/types/index.d.mts +18 -1
  191. package/dist/esm/api/types/index.mjs +18 -1
  192. package/dist/esm/core/index.d.mts +1 -0
  193. package/dist/esm/core/index.mjs +1 -0
  194. package/dist/esm/core/stream/Stream.d.mts +46 -0
  195. package/dist/esm/core/stream/Stream.mjs +164 -0
  196. package/dist/esm/core/stream/index.d.mts +1 -0
  197. package/dist/esm/core/stream/index.mjs +1 -0
  198. package/dist/esm/version.d.mts +1 -1
  199. package/dist/esm/version.mjs +1 -1
  200. package/package.json +1 -1
  201. package/reference.md +843 -181
  202. /package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.js → ChrtGptReq.js} +0 -0
  203. /package/dist/cjs/api/{types/ChrtGptMessageRes.js → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.js} +0 -0
  204. /package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.mjs → ChrtGptReq.mjs} +0 -0
  205. /package/dist/esm/api/{types/ChrtGptMessageRes.mjs → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.mjs} +0 -0
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
5
+ /**
6
+ * A device as seen by the cargo's order parties, who may not own or share the device.
7
+ *
8
+ * NOTE - excludes device_token (the webhook secret), location, and owner-only fields.
9
+ */
10
+ export interface DeviceForCargoRes {
11
+ device_id: string;
12
+ device_mac_address: string;
13
+ is_currently_linked: boolean;
14
+ last_seen_at_timestamp?: string | null;
15
+ last_seen_battery_level?: string | null;
16
+ type?: Chrt.TrackingDeviceTypeEnum1 | null;
17
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,6 +12,7 @@ export interface OrgPublicData1 {
12
12
  name: string;
13
13
  /** Must be a string starting with `org_` */
14
14
  org_id: string;
15
+ org_public_data_s3_object_metadata_ids?: string[];
15
16
  org_type: Chrt.OrgTypeEnum;
16
17
  phone_number?: string | null;
17
18
  schema_version: number;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface OrgPublicDataS3ObjectMetadata1 {
5
+ _id: string;
6
+ ai_generated_description?: string | null;
7
+ blurhash?: string | null;
8
+ /** MIME type of the uploaded file (e.g., 'image/jpeg', 'application/pdf') */
9
+ content_type?: string | null;
10
+ /** Original filename of the uploaded file */
11
+ filename?: string | null;
12
+ org_public_data_id: string;
13
+ s3_key_prefix?: "orgs/org_public_data_s3_object_metadata";
14
+ schema_version: number;
15
+ uploaded_at_timestamp: string;
16
+ /** Must be a string starting with `org_` */
17
+ uploaded_by_org_id: string;
18
+ /** Must be a string starting with `user_` */
19
+ uploaded_by_user_id: string;
20
+ user_generated_description?: string | null;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,6 +7,10 @@ export interface ShipperCoordinatorConnection1 {
7
7
  coordinator_default_department_id?: string | null;
8
8
  /** Must be a string starting with `org_` */
9
9
  coordinator_org_id: string;
10
+ known_shipper?: boolean | null;
11
+ known_shipper_last_edited_at_timestamp?: string | null;
12
+ /** Must be a string starting with `user_` */
13
+ known_shipper_last_edited_by_user_id?: string | null;
10
14
  off_chrt_shipper_org_data_id?: string | null;
11
15
  schema_version: number;
12
16
  shipper_customer_id_for_coordinator_stripe_connect_account?: string | null;
@@ -1,61 +1,105 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type SpecialHandlingCodeEnum1 = "ACT" | "AOG" | "ATT" | "AVI" | "BIG" | "BUP" | "CAO" | "CAT" | "COL" | "COM" | "CRT" | "DIP" | "EAP" | "EAT" | "EAW" | "ECC" | "ECP" | "ELI" | "ELM" | "EMD" | "ERT" | "FIL" | "FRI" | "FRO" | "GOH" | "HEA" | "HEG" | "HUM" | "ICE" | "LHO" | "LIC" | "MAG" | "MAL" | "MUW" | "NSC" | "NWP" | "OBX" | "OHG" | "PAC" | "PEA" | "PEF" | "PEM" | "PEP" | "PER" | "PES" | "PIL" | "PIP" | "QRT" | "RAC" | "RBI" | "RBM" | "RCL" | "RCM" | "RCX" | "RDS" | "REQ" | "REX" | "RFG" | "RFL" | "RFS" | "RFW" | "RGX" | "RIS" | "RLI" | "RLM" | "RMD" | "RNG" | "ROP" | "ROX" | "RPB" | "RPG" | "RRE" | "RRW" | "RRY" | "RSB" | "RSC" | "RXB" | "RXC" | "RXD" | "RXE" | "RXG" | "RXS" | "SCO" | "SHL" | "SHR" | "SPF" | "SPX" | "SUR" | "SWP" | "VAL" | "VOL" | "VUN" | "WET" | "XPS";
4
+ export type SpecialHandlingCodeEnum1 = "ACT" | "AGC" | "ALO" | "AOG" | "ATT" | "AVI" | "AXA" | "BIG" | "BSA" | "BUP" | "CAO" | "CAT" | "CC" | "COF" | "COL" | "COM" | "COU" | "CRT" | "CSL" | "CUR" | "DDX" | "DGD" | "DGR" | "DIC" | "DIP" | "DIR" | "DNS" | "EAP" | "EAT" | "EAW" | "EBI" | "EBM" | "ECC" | "ECP" | "ELI" | "ELM" | "EMD" | "ERT" | "EXC" | "FIL" | "FRA" | "FRC" | "FRI" | "FRO" | "FTR" | "GCR" | "GLD" | "GOB" | "GOH" | "HEA" | "HEG" | "HNT" | "HST" | "HUM" | "IAT" | "IBS" | "ICE" | "IMP" | "LHO" | "LIC" | "MAG" | "MAL" | "MDC" | "MEX" | "MUW" | "NSC" | "NST" | "NWP" | "OBX" | "OHG" | "PAC" | "PAX" | "PEA" | "PEB" | "PED" | "PEF" | "PEL" | "PEM" | "PEP" | "PER" | "PES" | "PHY" | "PIL" | "PIP" | "PPR" | "PRI" | "PRO" | "PXD" | "PXS" | "QRT" | "QWT" | "RAC" | "RBI" | "RBM" | "RCL" | "RCM" | "RCS" | "RCX" | "RDS" | "REQ" | "REX" | "RFG" | "RFL" | "RFS" | "RFW" | "RGX" | "RIS" | "RLI" | "RLM" | "RMD" | "RNG" | "ROP" | "ROX" | "RPB" | "RPG" | "RRE" | "RRW" | "RRY" | "RSB" | "RSC" | "RXB" | "RXC" | "RXD" | "RXE" | "RXG" | "RXS" | "SBU" | "SCO" | "SEC" | "SEN" | "SHL" | "SHR" | "SMC" | "SML" | "SMU" | "SPF" | "SPX" | "SSS" | "SUR" | "SVC" | "SWP" | "TRC" | "TRU" | "TTS" | "TTT" | "UCB" | "UKS" | "ULD" | "UNKN" | "VAL" | "VEH" | "VIC" | "VOL" | "VUN" | "WET" | "XPS";
5
5
  export declare const SpecialHandlingCodeEnum1: {
6
6
  readonly Act: "ACT";
7
+ readonly Agc: "AGC";
8
+ readonly Alo: "ALO";
7
9
  readonly Aog: "AOG";
8
10
  readonly Att: "ATT";
9
11
  readonly Avi: "AVI";
12
+ readonly Axa: "AXA";
10
13
  readonly Big: "BIG";
14
+ readonly Bsa: "BSA";
11
15
  readonly Bup: "BUP";
12
16
  readonly Cao: "CAO";
13
17
  readonly Cat: "CAT";
18
+ readonly Cc: "CC";
19
+ readonly Cof: "COF";
14
20
  readonly Col: "COL";
15
21
  readonly Com: "COM";
22
+ readonly Cou: "COU";
16
23
  readonly Crt: "CRT";
24
+ readonly Csl: "CSL";
25
+ readonly Cur: "CUR";
26
+ readonly Ddx: "DDX";
27
+ readonly Dgd: "DGD";
28
+ readonly Dgr: "DGR";
29
+ readonly Dic: "DIC";
17
30
  readonly Dip: "DIP";
31
+ readonly Dir: "DIR";
32
+ readonly Dns: "DNS";
18
33
  readonly Eap: "EAP";
19
34
  readonly Eat: "EAT";
20
35
  readonly Eaw: "EAW";
36
+ readonly Ebi: "EBI";
37
+ readonly Ebm: "EBM";
21
38
  readonly Ecc: "ECC";
22
39
  readonly Ecp: "ECP";
23
40
  readonly Eli: "ELI";
24
41
  readonly Elm: "ELM";
25
42
  readonly Emd: "EMD";
26
43
  readonly Ert: "ERT";
44
+ readonly Exc: "EXC";
27
45
  readonly Fil: "FIL";
46
+ readonly Fra: "FRA";
47
+ readonly Frc: "FRC";
28
48
  readonly Fri: "FRI";
29
49
  readonly Fro: "FRO";
50
+ readonly Ftr: "FTR";
51
+ readonly Gcr: "GCR";
52
+ readonly Gld: "GLD";
53
+ readonly Gob: "GOB";
30
54
  readonly Goh: "GOH";
31
55
  readonly Hea: "HEA";
32
56
  readonly Heg: "HEG";
57
+ readonly Hnt: "HNT";
58
+ readonly Hst: "HST";
33
59
  readonly Hum: "HUM";
60
+ readonly Iat: "IAT";
61
+ readonly Ibs: "IBS";
34
62
  readonly Ice: "ICE";
63
+ readonly Imp: "IMP";
35
64
  readonly Lho: "LHO";
36
65
  readonly Lic: "LIC";
37
66
  readonly Mag: "MAG";
38
67
  readonly Mal: "MAL";
68
+ readonly Mdc: "MDC";
69
+ readonly Mex: "MEX";
39
70
  readonly Muw: "MUW";
40
71
  readonly Nsc: "NSC";
72
+ readonly Nst: "NST";
41
73
  readonly Nwp: "NWP";
42
74
  readonly Obx: "OBX";
43
75
  readonly Ohg: "OHG";
44
76
  readonly Pac: "PAC";
77
+ readonly Pax: "PAX";
45
78
  readonly Pea: "PEA";
79
+ readonly Peb: "PEB";
80
+ readonly Ped: "PED";
46
81
  readonly Pef: "PEF";
82
+ readonly Pel: "PEL";
47
83
  readonly Pem: "PEM";
48
84
  readonly Pep: "PEP";
49
85
  readonly Per: "PER";
50
86
  readonly Pes: "PES";
87
+ readonly Phy: "PHY";
51
88
  readonly Pil: "PIL";
52
89
  readonly Pip: "PIP";
90
+ readonly Ppr: "PPR";
91
+ readonly Pri: "PRI";
92
+ readonly Pro: "PRO";
93
+ readonly Pxd: "PXD";
94
+ readonly Pxs: "PXS";
53
95
  readonly Qrt: "QRT";
96
+ readonly Qwt: "QWT";
54
97
  readonly Rac: "RAC";
55
98
  readonly Rbi: "RBI";
56
99
  readonly Rbm: "RBM";
57
100
  readonly Rcl: "RCL";
58
101
  readonly Rcm: "RCM";
102
+ readonly Rcs: "RCS";
59
103
  readonly Rcx: "RCX";
60
104
  readonly Rds: "RDS";
61
105
  readonly Req: "REQ";
@@ -85,14 +129,32 @@ export declare const SpecialHandlingCodeEnum1: {
85
129
  readonly Rxe: "RXE";
86
130
  readonly Rxg: "RXG";
87
131
  readonly Rxs: "RXS";
132
+ readonly Sbu: "SBU";
88
133
  readonly Sco: "SCO";
134
+ readonly Sec: "SEC";
135
+ readonly Sen: "SEN";
89
136
  readonly Shl: "SHL";
90
137
  readonly Shr: "SHR";
138
+ readonly Smc: "SMC";
139
+ readonly Sml: "SML";
140
+ readonly Smu: "SMU";
91
141
  readonly Spf: "SPF";
92
142
  readonly Spx: "SPX";
143
+ readonly Sss: "SSS";
93
144
  readonly Sur: "SUR";
145
+ readonly Svc: "SVC";
94
146
  readonly Swp: "SWP";
147
+ readonly Trc: "TRC";
148
+ readonly Tru: "TRU";
149
+ readonly Tts: "TTS";
150
+ readonly Ttt: "TTT";
151
+ readonly Ucb: "UCB";
152
+ readonly Uks: "UKS";
153
+ readonly Uld: "ULD";
154
+ readonly Unkn: "UNKN";
95
155
  readonly Val: "VAL";
156
+ readonly Veh: "VEH";
157
+ readonly Vic: "VIC";
96
158
  readonly Vol: "VOL";
97
159
  readonly Vun: "VUN";
98
160
  readonly Wet: "WET";
@@ -6,58 +6,102 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SpecialHandlingCodeEnum1 = void 0;
7
7
  exports.SpecialHandlingCodeEnum1 = {
8
8
  Act: "ACT",
9
+ Agc: "AGC",
10
+ Alo: "ALO",
9
11
  Aog: "AOG",
10
12
  Att: "ATT",
11
13
  Avi: "AVI",
14
+ Axa: "AXA",
12
15
  Big: "BIG",
16
+ Bsa: "BSA",
13
17
  Bup: "BUP",
14
18
  Cao: "CAO",
15
19
  Cat: "CAT",
20
+ Cc: "CC",
21
+ Cof: "COF",
16
22
  Col: "COL",
17
23
  Com: "COM",
24
+ Cou: "COU",
18
25
  Crt: "CRT",
26
+ Csl: "CSL",
27
+ Cur: "CUR",
28
+ Ddx: "DDX",
29
+ Dgd: "DGD",
30
+ Dgr: "DGR",
31
+ Dic: "DIC",
19
32
  Dip: "DIP",
33
+ Dir: "DIR",
34
+ Dns: "DNS",
20
35
  Eap: "EAP",
21
36
  Eat: "EAT",
22
37
  Eaw: "EAW",
38
+ Ebi: "EBI",
39
+ Ebm: "EBM",
23
40
  Ecc: "ECC",
24
41
  Ecp: "ECP",
25
42
  Eli: "ELI",
26
43
  Elm: "ELM",
27
44
  Emd: "EMD",
28
45
  Ert: "ERT",
46
+ Exc: "EXC",
29
47
  Fil: "FIL",
48
+ Fra: "FRA",
49
+ Frc: "FRC",
30
50
  Fri: "FRI",
31
51
  Fro: "FRO",
52
+ Ftr: "FTR",
53
+ Gcr: "GCR",
54
+ Gld: "GLD",
55
+ Gob: "GOB",
32
56
  Goh: "GOH",
33
57
  Hea: "HEA",
34
58
  Heg: "HEG",
59
+ Hnt: "HNT",
60
+ Hst: "HST",
35
61
  Hum: "HUM",
62
+ Iat: "IAT",
63
+ Ibs: "IBS",
36
64
  Ice: "ICE",
65
+ Imp: "IMP",
37
66
  Lho: "LHO",
38
67
  Lic: "LIC",
39
68
  Mag: "MAG",
40
69
  Mal: "MAL",
70
+ Mdc: "MDC",
71
+ Mex: "MEX",
41
72
  Muw: "MUW",
42
73
  Nsc: "NSC",
74
+ Nst: "NST",
43
75
  Nwp: "NWP",
44
76
  Obx: "OBX",
45
77
  Ohg: "OHG",
46
78
  Pac: "PAC",
79
+ Pax: "PAX",
47
80
  Pea: "PEA",
81
+ Peb: "PEB",
82
+ Ped: "PED",
48
83
  Pef: "PEF",
84
+ Pel: "PEL",
49
85
  Pem: "PEM",
50
86
  Pep: "PEP",
51
87
  Per: "PER",
52
88
  Pes: "PES",
89
+ Phy: "PHY",
53
90
  Pil: "PIL",
54
91
  Pip: "PIP",
92
+ Ppr: "PPR",
93
+ Pri: "PRI",
94
+ Pro: "PRO",
95
+ Pxd: "PXD",
96
+ Pxs: "PXS",
55
97
  Qrt: "QRT",
98
+ Qwt: "QWT",
56
99
  Rac: "RAC",
57
100
  Rbi: "RBI",
58
101
  Rbm: "RBM",
59
102
  Rcl: "RCL",
60
103
  Rcm: "RCM",
104
+ Rcs: "RCS",
61
105
  Rcx: "RCX",
62
106
  Rds: "RDS",
63
107
  Req: "REQ",
@@ -87,14 +131,32 @@ exports.SpecialHandlingCodeEnum1 = {
87
131
  Rxe: "RXE",
88
132
  Rxg: "RXG",
89
133
  Rxs: "RXS",
134
+ Sbu: "SBU",
90
135
  Sco: "SCO",
136
+ Sec: "SEC",
137
+ Sen: "SEN",
91
138
  Shl: "SHL",
92
139
  Shr: "SHR",
140
+ Smc: "SMC",
141
+ Sml: "SML",
142
+ Smu: "SMU",
93
143
  Spf: "SPF",
94
144
  Spx: "SPX",
145
+ Sss: "SSS",
95
146
  Sur: "SUR",
147
+ Svc: "SVC",
96
148
  Swp: "SWP",
149
+ Trc: "TRC",
150
+ Tru: "TRU",
151
+ Tts: "TTS",
152
+ Ttt: "TTT",
153
+ Ucb: "UCB",
154
+ Uks: "UKS",
155
+ Uld: "ULD",
156
+ Unkn: "UNKN",
97
157
  Val: "VAL",
158
+ Veh: "VEH",
159
+ Vic: "VIC",
98
160
  Vol: "VOL",
99
161
  Vun: "VUN",
100
162
  Wet: "WET",
@@ -204,7 +204,22 @@ export * from "./ChampFlightStatus1.js";
204
204
  export * from "./ChampFlightStatusEvent1.js";
205
205
  export * from "./ChampOriginAndDestination.js";
206
206
  export * from "./ChampQuantity.js";
207
- export * from "./ChrtGptMessageRes.js";
207
+ export * from "./ChrtGptAssistantMessageItem.js";
208
+ export * from "./ChrtGptCompletedEvent.js";
209
+ export * from "./ChrtGptConversation1.js";
210
+ export * from "./ChrtGptConversationListRes.js";
211
+ export * from "./ChrtGptConversationRes.js";
212
+ export * from "./ChrtGptConversationSortByEnum.js";
213
+ export * from "./ChrtGptErrorEvent.js";
214
+ export * from "./ChrtGptEvent.js";
215
+ export * from "./ChrtGptHistoryItem.js";
216
+ export * from "./ChrtGptStartedEvent.js";
217
+ export * from "./ChrtGptTextDeltaEvent.js";
218
+ export * from "./ChrtGptTitleEvent.js";
219
+ export * from "./ChrtGptToolCalledEvent.js";
220
+ export * from "./ChrtGptToolOutputEvent.js";
221
+ export * from "./ChrtGptUserMessageItem.js";
222
+ export * from "./ChrtGptWebSearchEvent.js";
208
223
  export * from "./ChrtGroundProviderRates1.js";
209
224
  export * from "./ChrtGroundProviderRatesListRes.js";
210
225
  export * from "./ChrtGroundProviderRatesSortByEnum.js";
@@ -298,6 +313,7 @@ export * from "./DepartmentTypeaheadFieldEnum.js";
298
313
  export * from "./DepartmentTypeaheadResult.js";
299
314
  export * from "./DepartmentTypeaheadValue.js";
300
315
  export * from "./DeviceExpandedRes.js";
316
+ export * from "./DeviceForCargoRes.js";
301
317
  export * from "./DeviceLimitedForList1.js";
302
318
  export * from "./DeviceListRes.js";
303
319
  export * from "./DevicePausedTimeWindow1.js";
@@ -590,6 +606,7 @@ export * from "./OrgMembersAndDrivers.js";
590
606
  export * from "./OrgMembersAndDriversListRes.js";
591
607
  export * from "./OrgPrivateData1.js";
592
608
  export * from "./OrgPublicData1.js";
609
+ export * from "./OrgPublicDataS3ObjectMetadata1.js";
593
610
  export * from "./OrgRoleEnum.js";
594
611
  export * from "./OrgShippingIntegrationEnum1.js";
595
612
  export * from "./OrgTypeEnum.js";
@@ -220,7 +220,22 @@ __exportStar(require("./ChampFlightStatus1.js"), exports);
220
220
  __exportStar(require("./ChampFlightStatusEvent1.js"), exports);
221
221
  __exportStar(require("./ChampOriginAndDestination.js"), exports);
222
222
  __exportStar(require("./ChampQuantity.js"), exports);
223
- __exportStar(require("./ChrtGptMessageRes.js"), exports);
223
+ __exportStar(require("./ChrtGptAssistantMessageItem.js"), exports);
224
+ __exportStar(require("./ChrtGptCompletedEvent.js"), exports);
225
+ __exportStar(require("./ChrtGptConversation1.js"), exports);
226
+ __exportStar(require("./ChrtGptConversationListRes.js"), exports);
227
+ __exportStar(require("./ChrtGptConversationRes.js"), exports);
228
+ __exportStar(require("./ChrtGptConversationSortByEnum.js"), exports);
229
+ __exportStar(require("./ChrtGptErrorEvent.js"), exports);
230
+ __exportStar(require("./ChrtGptEvent.js"), exports);
231
+ __exportStar(require("./ChrtGptHistoryItem.js"), exports);
232
+ __exportStar(require("./ChrtGptStartedEvent.js"), exports);
233
+ __exportStar(require("./ChrtGptTextDeltaEvent.js"), exports);
234
+ __exportStar(require("./ChrtGptTitleEvent.js"), exports);
235
+ __exportStar(require("./ChrtGptToolCalledEvent.js"), exports);
236
+ __exportStar(require("./ChrtGptToolOutputEvent.js"), exports);
237
+ __exportStar(require("./ChrtGptUserMessageItem.js"), exports);
238
+ __exportStar(require("./ChrtGptWebSearchEvent.js"), exports);
224
239
  __exportStar(require("./ChrtGroundProviderRates1.js"), exports);
225
240
  __exportStar(require("./ChrtGroundProviderRatesListRes.js"), exports);
226
241
  __exportStar(require("./ChrtGroundProviderRatesSortByEnum.js"), exports);
@@ -314,6 +329,7 @@ __exportStar(require("./DepartmentTypeaheadFieldEnum.js"), exports);
314
329
  __exportStar(require("./DepartmentTypeaheadResult.js"), exports);
315
330
  __exportStar(require("./DepartmentTypeaheadValue.js"), exports);
316
331
  __exportStar(require("./DeviceExpandedRes.js"), exports);
332
+ __exportStar(require("./DeviceForCargoRes.js"), exports);
317
333
  __exportStar(require("./DeviceLimitedForList1.js"), exports);
318
334
  __exportStar(require("./DeviceListRes.js"), exports);
319
335
  __exportStar(require("./DevicePausedTimeWindow1.js"), exports);
@@ -606,6 +622,7 @@ __exportStar(require("./OrgMembersAndDrivers.js"), exports);
606
622
  __exportStar(require("./OrgMembersAndDriversListRes.js"), exports);
607
623
  __exportStar(require("./OrgPrivateData1.js"), exports);
608
624
  __exportStar(require("./OrgPublicData1.js"), exports);
625
+ __exportStar(require("./OrgPublicDataS3ObjectMetadata1.js"), exports);
609
626
  __exportStar(require("./OrgRoleEnum.js"), exports);
610
627
  __exportStar(require("./OrgShippingIntegrationEnum1.js"), exports);
611
628
  __exportStar(require("./OrgTypeEnum.js"), exports);
@@ -3,5 +3,6 @@ export * from "./runtime/index.js";
3
3
  export * as url from "./url/index.js";
4
4
  export * from "./auth/index.js";
5
5
  export * from "./base64.js";
6
+ export * from "./stream/index.js";
6
7
  export * from "./form-data-utils/index.js";
7
8
  export * as file from "./file/index.js";
@@ -42,5 +42,6 @@ __exportStar(require("./runtime/index.js"), exports);
42
42
  exports.url = __importStar(require("./url/index.js"));
43
43
  __exportStar(require("./auth/index.js"), exports);
44
44
  __exportStar(require("./base64.js"), exports);
45
+ __exportStar(require("./stream/index.js"), exports);
45
46
  __exportStar(require("./form-data-utils/index.js"), exports);
46
47
  exports.file = __importStar(require("./file/index.js"));
@@ -0,0 +1,46 @@
1
+ export declare namespace Stream {
2
+ interface Args {
3
+ /**
4
+ * The HTTP response stream to read from.
5
+ */
6
+ stream: ReadableStream;
7
+ /**
8
+ * The event shape to use for parsing the stream data.
9
+ */
10
+ eventShape: JsonEvent | SseEvent;
11
+ /**
12
+ * An abort signal to stop the stream.
13
+ */
14
+ signal?: AbortSignal;
15
+ }
16
+ interface JsonEvent {
17
+ type: "json";
18
+ messageTerminator: string;
19
+ }
20
+ interface SseEvent {
21
+ type: "sse";
22
+ streamTerminator?: string;
23
+ }
24
+ }
25
+ export declare class Stream<T> implements AsyncIterable<T> {
26
+ private stream;
27
+ private parse;
28
+ /**
29
+ * The prefix to use for each message. For example,
30
+ * for SSE, the prefix is "data: ".
31
+ */
32
+ private prefix;
33
+ private messageTerminator;
34
+ private streamTerminator;
35
+ private controller;
36
+ constructor({ stream, parse, eventShape, signal }: Stream.Args & {
37
+ parse: (val: unknown) => Promise<T>;
38
+ });
39
+ private iterMessages;
40
+ [Symbol.asyncIterator](): AsyncIterator<T, void, unknown>;
41
+ private decodeChunk;
42
+ }
43
+ /**
44
+ * Browser polyfill for ReadableStream
45
+ */
46
+ export declare function readableStreamAsyncIterable<T>(stream: any): AsyncIterableIterator<T>;
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
12
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
13
+ var m = o[Symbol.asyncIterator], i;
14
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
15
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
16
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
17
+ };
18
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
19
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
20
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
21
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
22
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
23
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
24
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
25
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
26
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
27
+ function fulfill(value) { resume("next", value); }
28
+ function reject(value) { resume("throw", value); }
29
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.Stream = void 0;
33
+ exports.readableStreamAsyncIterable = readableStreamAsyncIterable;
34
+ const index_js_1 = require("../runtime/index.js");
35
+ const DATA_PREFIX = "data:";
36
+ class Stream {
37
+ constructor({ stream, parse, eventShape, signal }) {
38
+ this.controller = new AbortController();
39
+ this.stream = stream;
40
+ this.parse = parse;
41
+ if (eventShape.type === "sse") {
42
+ this.prefix = DATA_PREFIX;
43
+ this.messageTerminator = "\n";
44
+ this.streamTerminator = eventShape.streamTerminator;
45
+ }
46
+ else {
47
+ this.messageTerminator = eventShape.messageTerminator;
48
+ }
49
+ signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", () => this.controller.abort());
50
+ }
51
+ iterMessages() {
52
+ return __asyncGenerator(this, arguments, function* iterMessages_1() {
53
+ var _a, e_1, _b, _c;
54
+ this.controller.signal;
55
+ const stream = readableStreamAsyncIterable(this.stream);
56
+ let buf = "";
57
+ let prefixSeen = false;
58
+ try {
59
+ for (var _d = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield __await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) {
60
+ _c = stream_1_1.value;
61
+ _d = false;
62
+ const chunk = _c;
63
+ buf += this.decodeChunk(chunk);
64
+ let terminatorIndex;
65
+ while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) {
66
+ let line = buf.slice(0, terminatorIndex + 1);
67
+ buf = buf.slice(terminatorIndex + this.messageTerminator.length);
68
+ if (!line.trim()) {
69
+ continue;
70
+ }
71
+ if (!prefixSeen && this.prefix != null) {
72
+ const prefixIndex = line.indexOf(this.prefix);
73
+ if (prefixIndex === -1) {
74
+ continue;
75
+ }
76
+ prefixSeen = true;
77
+ line = line.slice(prefixIndex + this.prefix.length);
78
+ }
79
+ if (this.streamTerminator != null && line.includes(this.streamTerminator)) {
80
+ return yield __await(void 0);
81
+ }
82
+ const message = yield __await(this.parse(JSON.parse(line)));
83
+ yield yield __await(message);
84
+ prefixSeen = false;
85
+ }
86
+ }
87
+ }
88
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
89
+ finally {
90
+ try {
91
+ if (!_d && !_a && (_b = stream_1.return)) yield __await(_b.call(stream_1));
92
+ }
93
+ finally { if (e_1) throw e_1.error; }
94
+ }
95
+ });
96
+ }
97
+ [Symbol.asyncIterator]() {
98
+ return __asyncGenerator(this, arguments, function* _a() {
99
+ var _b, e_2, _c, _d;
100
+ try {
101
+ for (var _e = true, _f = __asyncValues(this.iterMessages()), _g; _g = yield __await(_f.next()), _b = _g.done, !_b; _e = true) {
102
+ _d = _g.value;
103
+ _e = false;
104
+ const message = _d;
105
+ yield yield __await(message);
106
+ }
107
+ }
108
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
109
+ finally {
110
+ try {
111
+ if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
112
+ }
113
+ finally { if (e_2) throw e_2.error; }
114
+ }
115
+ });
116
+ }
117
+ decodeChunk(chunk) {
118
+ let decoded = "";
119
+ // If TextDecoder is present, use it
120
+ if (typeof TextDecoder !== "undefined") {
121
+ const decoder = new TextDecoder("utf8");
122
+ decoded += decoder.decode(chunk);
123
+ }
124
+ // Buffer is present in Node.js environment
125
+ else if (index_js_1.RUNTIME.type === "node" && typeof chunk !== "undefined") {
126
+ decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
127
+ }
128
+ return decoded;
129
+ }
130
+ }
131
+ exports.Stream = Stream;
132
+ /**
133
+ * Browser polyfill for ReadableStream
134
+ */
135
+ // biome-ignore lint/suspicious/noExplicitAny: allow explicit any
136
+ function readableStreamAsyncIterable(stream) {
137
+ if (stream[Symbol.asyncIterator]) {
138
+ return stream;
139
+ }
140
+ const reader = stream.getReader();
141
+ return {
142
+ next() {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ try {
145
+ const result = yield reader.read();
146
+ if (result === null || result === void 0 ? void 0 : result.done) {
147
+ reader.releaseLock();
148
+ } // release lock when stream becomes closed
149
+ return result;
150
+ }
151
+ catch (e) {
152
+ reader.releaseLock(); // release lock when stream becomes errored
153
+ throw e;
154
+ }
155
+ });
156
+ },
157
+ return() {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ const cancelPromise = reader.cancel();
160
+ reader.releaseLock();
161
+ yield cancelPromise;
162
+ return { done: true, value: undefined };
163
+ });
164
+ },
165
+ [Symbol.asyncIterator]() {
166
+ return this;
167
+ },
168
+ };
169
+ }
@@ -0,0 +1 @@
1
+ export { Stream } from "./Stream.js";