@airweave/sdk 0.7.20 → 0.8.77

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 (277) hide show
  1. package/README.md +1 -5
  2. package/dist/cjs/Client.d.ts +3 -8
  3. package/dist/cjs/Client.js +7 -4
  4. package/dist/cjs/api/errors/ConflictError.d.ts +9 -0
  5. package/dist/cjs/api/errors/ConflictError.js +52 -0
  6. package/dist/cjs/api/errors/NotFoundError.d.ts +9 -0
  7. package/dist/cjs/api/errors/NotFoundError.js +52 -0
  8. package/dist/cjs/api/errors/TooManyRequestsError.d.ts +9 -0
  9. package/dist/cjs/api/errors/TooManyRequestsError.js +52 -0
  10. package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +1 -2
  11. package/dist/cjs/api/errors/index.d.ts +3 -0
  12. package/dist/cjs/api/errors/index.js +3 -0
  13. package/dist/cjs/api/resources/collections/client/Client.d.ts +107 -42
  14. package/dist/cjs/api/resources/collections/client/Client.js +205 -58
  15. package/dist/cjs/api/resources/collections/client/requests/CollectionCreate.d.ts +3 -0
  16. package/dist/cjs/api/resources/collections/client/requests/CollectionUpdate.d.ts +16 -0
  17. package/dist/cjs/api/resources/collections/client/requests/ListCollectionsGetRequest.d.ts +4 -4
  18. package/dist/cjs/api/resources/collections/client/requests/SearchGetLegacyCollectionsReadableIdSearchGetRequest.d.ts +4 -4
  19. package/dist/cjs/api/resources/collections/client/requests/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/collections/types/index.d.ts +0 -1
  21. package/dist/cjs/api/resources/collections/types/index.js +0 -1
  22. package/dist/cjs/api/resources/index.d.ts +2 -0
  23. package/dist/cjs/api/resources/index.js +3 -1
  24. package/dist/cjs/api/resources/sourceConnections/client/Client.d.ts +96 -62
  25. package/dist/cjs/api/resources/sourceConnections/client/Client.js +152 -78
  26. package/dist/cjs/api/resources/sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.d.ts +2 -1
  27. package/dist/cjs/api/resources/sourceConnections/client/requests/ListSourceConnectionsGetRequest.d.ts +4 -2
  28. package/dist/cjs/api/resources/sourceConnections/client/requests/RunSourceConnectionsSourceConnectionIdRunPostRequest.d.ts +2 -2
  29. package/dist/cjs/api/resources/sourceConnections/client/requests/SourceConnectionCreate.d.ts +10 -9
  30. package/dist/cjs/api/resources/sourceConnections/client/requests/SourceConnectionUpdate.d.ts +6 -3
  31. package/dist/cjs/api/resources/sources/client/Client.d.ts +24 -13
  32. package/dist/cjs/api/resources/sources/client/Client.js +36 -11
  33. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +231 -0
  34. package/dist/cjs/api/resources/webhooks/client/Client.js +689 -0
  35. package/dist/cjs/api/resources/webhooks/client/index.d.ts +2 -0
  36. package/dist/cjs/api/resources/webhooks/client/index.js +17 -0
  37. package/dist/cjs/api/resources/webhooks/client/requests/CreateSubscriptionRequest.d.ts +19 -0
  38. package/dist/cjs/api/resources/webhooks/client/requests/GetMessageWebhooksMessagesMessageIdGetRequest.d.ts +13 -0
  39. package/dist/cjs/api/resources/webhooks/client/requests/GetMessagesWebhooksMessagesGetRequest.d.ts +11 -0
  40. package/dist/cjs/api/resources/webhooks/client/requests/GetSubscriptionWebhooksSubscriptionsSubscriptionIdGetRequest.d.ts +13 -0
  41. package/dist/cjs/api/resources/webhooks/client/requests/PatchSubscriptionRequest.d.ts +18 -0
  42. package/dist/cjs/api/resources/webhooks/client/requests/RecoverMessagesRequest.d.ts +15 -0
  43. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +6 -0
  44. package/dist/cjs/api/resources/webhooks/client/requests/index.js +2 -0
  45. package/dist/cjs/api/resources/webhooks/index.d.ts +1 -0
  46. package/dist/cjs/api/resources/webhooks/index.js +17 -0
  47. package/dist/cjs/api/types/AdminSearchDestination.d.ts +11 -0
  48. package/dist/cjs/api/types/AdminSearchDestination.js +10 -0
  49. package/dist/cjs/api/types/{SyncWithSourceConnection.d.ts → AdminSyncInfo.d.ts} +14 -3
  50. package/dist/cjs/api/types/BehaviorConfig.d.ts +14 -0
  51. package/dist/cjs/api/types/BodyResyncWithExecutionConfigAdminResyncSyncIdPost.d.ts +10 -0
  52. package/dist/cjs/api/types/Collection.d.ts +4 -2
  53. package/dist/cjs/api/types/ConfigField.d.ts +2 -0
  54. package/dist/cjs/api/types/ConflictErrorResponse.d.ts +13 -0
  55. package/dist/cjs/api/types/CursorConfig.d.ts +12 -0
  56. package/dist/cjs/api/types/DeliveryAttempt.d.ts +28 -0
  57. package/dist/cjs/api/types/DestinationConfig.d.ts +16 -0
  58. package/dist/cjs/api/types/EventType.d.ts +24 -0
  59. package/dist/cjs/api/types/EventType.js +19 -0
  60. package/dist/cjs/api/types/FeatureFlag.d.ts +4 -1
  61. package/dist/cjs/api/types/FeatureFlag.js +3 -0
  62. package/dist/cjs/api/types/HandlerConfig.d.ts +14 -0
  63. package/dist/cjs/api/types/LegacySearchRequest.d.ts +2 -2
  64. package/dist/cjs/api/types/NotFoundErrorResponse.d.ts +10 -0
  65. package/dist/cjs/api/types/RateLimitErrorResponse.d.ts +13 -0
  66. package/dist/cjs/api/types/RecoveryTask.d.ts +16 -0
  67. package/dist/cjs/api/types/S3ConfigRequest.d.ts +5 -9
  68. package/dist/cjs/api/types/SearchRequest.d.ts +15 -12
  69. package/dist/cjs/api/types/SearchResponse.d.ts +6 -3
  70. package/dist/cjs/api/types/Source.d.ts +4 -0
  71. package/dist/cjs/api/types/SourceConnection.d.ts +21 -3
  72. package/dist/cjs/api/types/SourceConnectionJob.d.ts +16 -1
  73. package/dist/cjs/api/types/SourceConnectionListItem.d.ts +13 -2
  74. package/dist/cjs/api/types/Sync.d.ts +1 -0
  75. package/dist/cjs/api/types/SyncConfig.d.ts +17 -0
  76. package/dist/cjs/api/types/SyncCreate.d.ts +1 -0
  77. package/dist/cjs/api/types/SyncJob.d.ts +2 -0
  78. package/dist/cjs/api/types/SyncUpdate.d.ts +1 -0
  79. package/dist/cjs/api/types/ValidationErrorDetail.d.ts +14 -0
  80. package/dist/cjs/api/types/ValidationErrorResponse.d.ts +14 -0
  81. package/dist/cjs/api/types/WebhookMessage.d.ts +22 -0
  82. package/dist/cjs/api/types/WebhookMessageWithAttempts.d.ts +23 -0
  83. package/dist/cjs/api/types/WebhookSubscription.d.ts +27 -0
  84. package/dist/cjs/api/types/index.d.ts +19 -25
  85. package/dist/cjs/api/types/index.js +19 -25
  86. package/dist/cjs/version.d.ts +1 -1
  87. package/dist/cjs/version.js +1 -1
  88. package/dist/esm/Client.d.mts +3 -8
  89. package/dist/esm/Client.mjs +7 -4
  90. package/dist/esm/api/errors/ConflictError.d.mts +9 -0
  91. package/dist/esm/api/errors/ConflictError.mjs +15 -0
  92. package/dist/esm/api/errors/NotFoundError.d.mts +9 -0
  93. package/dist/esm/api/errors/NotFoundError.mjs +15 -0
  94. package/dist/esm/api/errors/TooManyRequestsError.d.mts +9 -0
  95. package/dist/esm/api/errors/TooManyRequestsError.mjs +15 -0
  96. package/dist/esm/api/errors/UnprocessableEntityError.d.mts +1 -2
  97. package/dist/esm/api/errors/index.d.mts +3 -0
  98. package/dist/esm/api/errors/index.mjs +3 -0
  99. package/dist/esm/api/resources/collections/client/Client.d.mts +107 -42
  100. package/dist/esm/api/resources/collections/client/Client.mjs +205 -58
  101. package/dist/esm/api/resources/collections/client/requests/CollectionCreate.d.mts +3 -0
  102. package/dist/esm/api/resources/collections/client/requests/CollectionUpdate.d.mts +16 -0
  103. package/dist/esm/api/resources/collections/client/requests/ListCollectionsGetRequest.d.mts +4 -4
  104. package/dist/esm/api/resources/collections/client/requests/SearchGetLegacyCollectionsReadableIdSearchGetRequest.d.mts +4 -4
  105. package/dist/esm/api/resources/collections/client/requests/index.d.mts +1 -0
  106. package/dist/esm/api/resources/collections/types/index.d.mts +0 -1
  107. package/dist/esm/api/resources/collections/types/index.mjs +0 -1
  108. package/dist/esm/api/resources/index.d.mts +2 -0
  109. package/dist/esm/api/resources/index.mjs +2 -0
  110. package/dist/esm/api/resources/sourceConnections/client/Client.d.mts +96 -62
  111. package/dist/esm/api/resources/sourceConnections/client/Client.mjs +152 -78
  112. package/dist/esm/api/resources/sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.d.mts +2 -1
  113. package/dist/esm/api/resources/sourceConnections/client/requests/ListSourceConnectionsGetRequest.d.mts +4 -2
  114. package/dist/esm/api/resources/sourceConnections/client/requests/RunSourceConnectionsSourceConnectionIdRunPostRequest.d.mts +2 -2
  115. package/dist/esm/api/resources/sourceConnections/client/requests/SourceConnectionCreate.d.mts +10 -9
  116. package/dist/esm/api/resources/sourceConnections/client/requests/SourceConnectionUpdate.d.mts +6 -3
  117. package/dist/esm/api/resources/sources/client/Client.d.mts +24 -13
  118. package/dist/esm/api/resources/sources/client/Client.mjs +36 -11
  119. package/dist/esm/api/resources/webhooks/client/Client.d.mts +231 -0
  120. package/dist/esm/api/resources/webhooks/client/Client.mjs +652 -0
  121. package/dist/esm/api/resources/webhooks/client/index.d.mts +2 -0
  122. package/dist/esm/api/resources/webhooks/client/index.mjs +1 -0
  123. package/dist/esm/api/resources/webhooks/client/requests/CreateSubscriptionRequest.d.mts +19 -0
  124. package/dist/esm/api/resources/webhooks/client/requests/GetMessageWebhooksMessagesMessageIdGetRequest.d.mts +13 -0
  125. package/dist/esm/api/resources/webhooks/client/requests/GetMessagesWebhooksMessagesGetRequest.d.mts +11 -0
  126. package/dist/esm/api/resources/webhooks/client/requests/GetSubscriptionWebhooksSubscriptionsSubscriptionIdGetRequest.d.mts +13 -0
  127. package/dist/esm/api/resources/webhooks/client/requests/PatchSubscriptionRequest.d.mts +18 -0
  128. package/dist/esm/api/resources/webhooks/client/requests/RecoverMessagesRequest.d.mts +15 -0
  129. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +6 -0
  130. package/dist/esm/api/resources/webhooks/client/requests/index.mjs +1 -0
  131. package/dist/esm/api/resources/webhooks/index.d.mts +1 -0
  132. package/dist/esm/api/resources/webhooks/index.mjs +1 -0
  133. package/dist/esm/api/types/AdminSearchDestination.d.mts +11 -0
  134. package/dist/esm/api/types/AdminSearchDestination.mjs +7 -0
  135. package/dist/esm/api/types/{SyncWithSourceConnection.d.mts → AdminSyncInfo.d.mts} +14 -3
  136. package/dist/esm/api/types/BehaviorConfig.d.mts +14 -0
  137. package/dist/esm/api/types/BodyResyncWithExecutionConfigAdminResyncSyncIdPost.d.mts +10 -0
  138. package/dist/esm/api/types/Collection.d.mts +4 -2
  139. package/dist/esm/api/types/ConfigField.d.mts +2 -0
  140. package/dist/esm/api/types/ConflictErrorResponse.d.mts +13 -0
  141. package/dist/esm/api/types/CursorConfig.d.mts +12 -0
  142. package/dist/esm/api/types/DeliveryAttempt.d.mts +28 -0
  143. package/dist/esm/api/types/DestinationConfig.d.mts +16 -0
  144. package/dist/esm/api/types/EventType.d.mts +24 -0
  145. package/dist/esm/api/types/EventType.mjs +16 -0
  146. package/dist/esm/api/types/FeatureFlag.d.mts +4 -1
  147. package/dist/esm/api/types/FeatureFlag.mjs +3 -0
  148. package/dist/esm/api/types/HandlerConfig.d.mts +14 -0
  149. package/dist/esm/api/types/LegacySearchRequest.d.mts +2 -2
  150. package/dist/esm/api/types/NotFoundErrorResponse.d.mts +10 -0
  151. package/dist/esm/api/types/RateLimitErrorResponse.d.mts +13 -0
  152. package/dist/esm/api/types/RecoveryTask.d.mts +16 -0
  153. package/dist/esm/api/types/S3ConfigRequest.d.mts +5 -9
  154. package/dist/esm/api/types/SearchRequest.d.mts +15 -12
  155. package/dist/esm/api/types/SearchResponse.d.mts +6 -3
  156. package/dist/esm/api/types/Source.d.mts +4 -0
  157. package/dist/esm/api/types/SourceConnection.d.mts +21 -3
  158. package/dist/esm/api/types/SourceConnectionJob.d.mts +16 -1
  159. package/dist/esm/api/types/SourceConnectionListItem.d.mts +13 -2
  160. package/dist/esm/api/types/Sync.d.mts +1 -0
  161. package/dist/esm/api/types/SyncConfig.d.mts +17 -0
  162. package/dist/esm/api/types/SyncCreate.d.mts +1 -0
  163. package/dist/esm/api/types/SyncJob.d.mts +2 -0
  164. package/dist/esm/api/types/SyncUpdate.d.mts +1 -0
  165. package/dist/esm/api/types/ValidationErrorDetail.d.mts +14 -0
  166. package/dist/esm/api/types/ValidationErrorResponse.d.mts +14 -0
  167. package/dist/esm/api/types/WebhookMessage.d.mts +22 -0
  168. package/dist/esm/api/types/WebhookMessageWithAttempts.d.mts +23 -0
  169. package/dist/esm/api/types/WebhookSubscription.d.mts +27 -0
  170. package/dist/esm/api/types/index.d.mts +19 -25
  171. package/dist/esm/api/types/index.mjs +19 -25
  172. package/dist/esm/version.d.mts +1 -1
  173. package/dist/esm/version.mjs +1 -1
  174. package/package.json +1 -1
  175. package/reference.md +891 -121
  176. package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.d.ts +0 -5
  177. package/dist/cjs/api/types/CollectionUpdate.d.ts +0 -13
  178. package/dist/cjs/api/types/DatetimeRange.d.ts +0 -34
  179. package/dist/cjs/api/types/FieldCondition.d.ts +0 -33
  180. package/dist/cjs/api/types/Filter.d.ts +0 -28
  181. package/dist/cjs/api/types/GeoBoundingBox.d.ts +0 -13
  182. package/dist/cjs/api/types/GeoLineString.d.ts +0 -11
  183. package/dist/cjs/api/types/GeoPoint.d.ts +0 -12
  184. package/dist/cjs/api/types/GeoPolygon.d.ts +0 -13
  185. package/dist/cjs/api/types/GeoRadius.d.ts +0 -13
  186. package/dist/cjs/api/types/HasIdCondition.d.ts +0 -16
  187. package/dist/cjs/api/types/HasVectorCondition.d.ts +0 -10
  188. package/dist/cjs/api/types/IsEmptyCondition.d.ts +0 -11
  189. package/dist/cjs/api/types/IsNullCondition.d.ts +0 -11
  190. package/dist/cjs/api/types/MatchAny.d.ts +0 -16
  191. package/dist/cjs/api/types/MatchExcept.d.ts +0 -16
  192. package/dist/cjs/api/types/MatchPhrase.d.ts +0 -10
  193. package/dist/cjs/api/types/MatchText.d.ts +0 -10
  194. package/dist/cjs/api/types/MatchValue.d.ts +0 -16
  195. package/dist/cjs/api/types/MinShould.d.ts +0 -16
  196. package/dist/cjs/api/types/Nested.d.ts +0 -13
  197. package/dist/cjs/api/types/NestedCondition.d.ts +0 -8
  198. package/dist/cjs/api/types/PayloadField.d.ts +0 -10
  199. package/dist/cjs/api/types/Range.d.ts +0 -16
  200. package/dist/cjs/api/types/SyncWithSourceConnection.js +0 -5
  201. package/dist/cjs/api/types/ValuesCount.d.ts +0 -16
  202. package/dist/cjs/api/types/ValuesCount.js +0 -5
  203. package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.d.mts +0 -5
  204. package/dist/esm/api/types/CollectionUpdate.d.mts +0 -13
  205. package/dist/esm/api/types/DatetimeRange.d.mts +0 -34
  206. package/dist/esm/api/types/FieldCondition.d.mts +0 -33
  207. package/dist/esm/api/types/Filter.d.mts +0 -28
  208. package/dist/esm/api/types/GeoBoundingBox.d.mts +0 -13
  209. package/dist/esm/api/types/GeoLineString.d.mts +0 -11
  210. package/dist/esm/api/types/GeoPoint.d.mts +0 -12
  211. package/dist/esm/api/types/GeoPolygon.d.mts +0 -13
  212. package/dist/esm/api/types/GeoRadius.d.mts +0 -13
  213. package/dist/esm/api/types/HasIdCondition.d.mts +0 -16
  214. package/dist/esm/api/types/HasVectorCondition.d.mts +0 -10
  215. package/dist/esm/api/types/IsEmptyCondition.d.mts +0 -11
  216. package/dist/esm/api/types/IsNullCondition.d.mts +0 -11
  217. package/dist/esm/api/types/MatchAny.d.mts +0 -16
  218. package/dist/esm/api/types/MatchExcept.d.mts +0 -16
  219. package/dist/esm/api/types/MatchPhrase.d.mts +0 -10
  220. package/dist/esm/api/types/MatchText.d.mts +0 -10
  221. package/dist/esm/api/types/MatchValue.d.mts +0 -16
  222. package/dist/esm/api/types/MinShould.d.mts +0 -16
  223. package/dist/esm/api/types/Nested.d.mts +0 -13
  224. package/dist/esm/api/types/NestedCondition.d.mts +0 -8
  225. package/dist/esm/api/types/PayloadField.d.mts +0 -10
  226. package/dist/esm/api/types/Range.d.mts +0 -16
  227. package/dist/esm/api/types/SyncWithSourceConnection.mjs +0 -4
  228. package/dist/esm/api/types/ValuesCount.d.mts +0 -16
  229. package/dist/esm/api/types/ValuesCount.mjs +0 -4
  230. /package/dist/cjs/api/{types → resources/collections/client/requests}/CollectionUpdate.js +0 -0
  231. /package/dist/cjs/api/resources/{collections/types/SearchCollectionsReadableIdSearchPostResponse.js → webhooks/client/requests/CreateSubscriptionRequest.js} +0 -0
  232. /package/dist/cjs/api/{types/DatetimeRange.js → resources/webhooks/client/requests/GetMessageWebhooksMessagesMessageIdGetRequest.js} +0 -0
  233. /package/dist/cjs/api/{types/FieldCondition.js → resources/webhooks/client/requests/GetMessagesWebhooksMessagesGetRequest.js} +0 -0
  234. /package/dist/cjs/api/{types/Filter.js → resources/webhooks/client/requests/GetSubscriptionWebhooksSubscriptionsSubscriptionIdGetRequest.js} +0 -0
  235. /package/dist/cjs/api/{types/GeoBoundingBox.js → resources/webhooks/client/requests/PatchSubscriptionRequest.js} +0 -0
  236. /package/dist/cjs/api/{types/GeoLineString.js → resources/webhooks/client/requests/RecoverMessagesRequest.js} +0 -0
  237. /package/dist/cjs/api/types/{GeoPoint.js → AdminSyncInfo.js} +0 -0
  238. /package/dist/cjs/api/types/{GeoPolygon.js → BehaviorConfig.js} +0 -0
  239. /package/dist/cjs/api/types/{GeoRadius.js → BodyResyncWithExecutionConfigAdminResyncSyncIdPost.js} +0 -0
  240. /package/dist/cjs/api/types/{HasIdCondition.js → ConflictErrorResponse.js} +0 -0
  241. /package/dist/cjs/api/types/{HasVectorCondition.js → CursorConfig.js} +0 -0
  242. /package/dist/cjs/api/types/{IsEmptyCondition.js → DeliveryAttempt.js} +0 -0
  243. /package/dist/cjs/api/types/{IsNullCondition.js → DestinationConfig.js} +0 -0
  244. /package/dist/cjs/api/types/{MatchAny.js → HandlerConfig.js} +0 -0
  245. /package/dist/cjs/api/types/{MatchExcept.js → NotFoundErrorResponse.js} +0 -0
  246. /package/dist/cjs/api/types/{MatchPhrase.js → RateLimitErrorResponse.js} +0 -0
  247. /package/dist/cjs/api/types/{MatchText.js → RecoveryTask.js} +0 -0
  248. /package/dist/cjs/api/types/{MatchValue.js → SyncConfig.js} +0 -0
  249. /package/dist/cjs/api/types/{MinShould.js → ValidationErrorDetail.js} +0 -0
  250. /package/dist/cjs/api/types/{Nested.js → ValidationErrorResponse.js} +0 -0
  251. /package/dist/cjs/api/types/{NestedCondition.js → WebhookMessage.js} +0 -0
  252. /package/dist/cjs/api/types/{PayloadField.js → WebhookMessageWithAttempts.js} +0 -0
  253. /package/dist/cjs/api/types/{Range.js → WebhookSubscription.js} +0 -0
  254. /package/dist/esm/api/{types → resources/collections/client/requests}/CollectionUpdate.mjs +0 -0
  255. /package/dist/esm/api/resources/{collections/types/SearchCollectionsReadableIdSearchPostResponse.mjs → webhooks/client/requests/CreateSubscriptionRequest.mjs} +0 -0
  256. /package/dist/esm/api/{types/DatetimeRange.mjs → resources/webhooks/client/requests/GetMessageWebhooksMessagesMessageIdGetRequest.mjs} +0 -0
  257. /package/dist/esm/api/{types/FieldCondition.mjs → resources/webhooks/client/requests/GetMessagesWebhooksMessagesGetRequest.mjs} +0 -0
  258. /package/dist/esm/api/{types/Filter.mjs → resources/webhooks/client/requests/GetSubscriptionWebhooksSubscriptionsSubscriptionIdGetRequest.mjs} +0 -0
  259. /package/dist/esm/api/{types/GeoBoundingBox.mjs → resources/webhooks/client/requests/PatchSubscriptionRequest.mjs} +0 -0
  260. /package/dist/esm/api/{types/GeoLineString.mjs → resources/webhooks/client/requests/RecoverMessagesRequest.mjs} +0 -0
  261. /package/dist/esm/api/types/{GeoPoint.mjs → AdminSyncInfo.mjs} +0 -0
  262. /package/dist/esm/api/types/{GeoPolygon.mjs → BehaviorConfig.mjs} +0 -0
  263. /package/dist/esm/api/types/{GeoRadius.mjs → BodyResyncWithExecutionConfigAdminResyncSyncIdPost.mjs} +0 -0
  264. /package/dist/esm/api/types/{HasIdCondition.mjs → ConflictErrorResponse.mjs} +0 -0
  265. /package/dist/esm/api/types/{HasVectorCondition.mjs → CursorConfig.mjs} +0 -0
  266. /package/dist/esm/api/types/{IsEmptyCondition.mjs → DeliveryAttempt.mjs} +0 -0
  267. /package/dist/esm/api/types/{IsNullCondition.mjs → DestinationConfig.mjs} +0 -0
  268. /package/dist/esm/api/types/{MatchAny.mjs → HandlerConfig.mjs} +0 -0
  269. /package/dist/esm/api/types/{MatchExcept.mjs → NotFoundErrorResponse.mjs} +0 -0
  270. /package/dist/esm/api/types/{MatchPhrase.mjs → RateLimitErrorResponse.mjs} +0 -0
  271. /package/dist/esm/api/types/{MatchText.mjs → RecoveryTask.mjs} +0 -0
  272. /package/dist/esm/api/types/{MatchValue.mjs → SyncConfig.mjs} +0 -0
  273. /package/dist/esm/api/types/{MinShould.mjs → ValidationErrorDetail.mjs} +0 -0
  274. /package/dist/esm/api/types/{Nested.mjs → ValidationErrorResponse.mjs} +0 -0
  275. /package/dist/esm/api/types/{NestedCondition.mjs → WebhookMessage.mjs} +0 -0
  276. /package/dist/esm/api/types/{PayloadField.mjs → WebhookMessageWithAttempts.mjs} +0 -0
  277. /package/dist/esm/api/types/{Range.mjs → WebhookSubscription.mjs} +0 -0
@@ -0,0 +1,652 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../environments.mjs";
14
+ import * as core from "../../../../core/index.mjs";
15
+ import * as AirweaveSDK from "../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
17
+ import * as errors from "../../../../errors/index.mjs";
18
+ /**
19
+ * API endpoints for managing webhook subscriptions and messages. Subscribe to events like sync completions to receive real-time notifications at your webhook URL
20
+ */
21
+ export class Webhooks {
22
+ constructor(_options) {
23
+ this._options = _options;
24
+ }
25
+ /**
26
+ * Retrieve all webhook messages for your organization.
27
+ *
28
+ * Webhook messages represent payloads that were sent (or attempted to be sent)
29
+ * to your subscribed endpoints. Each message contains the event type, payload data,
30
+ * and delivery status information.
31
+ *
32
+ * Use the `event_types` query parameter to filter messages by specific event types,
33
+ * such as `sync.completed` or `sync.failed`.
34
+ *
35
+ * @param {AirweaveSDK.GetMessagesWebhooksMessagesGetRequest} request
36
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
39
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
40
+ *
41
+ * @example
42
+ * await client.webhooks.getMessages()
43
+ */
44
+ getMessages(request = {}, requestOptions) {
45
+ return core.HttpResponsePromise.fromPromise(this.__getMessages(request, requestOptions));
46
+ }
47
+ __getMessages() {
48
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
49
+ var _a, _b, _c;
50
+ const { event_types: eventTypes } = request;
51
+ const _queryParams = {};
52
+ if (eventTypes != null) {
53
+ if (Array.isArray(eventTypes)) {
54
+ _queryParams["event_types"] = eventTypes.map((item) => item);
55
+ }
56
+ else {
57
+ _queryParams["event_types"] = eventTypes;
58
+ }
59
+ }
60
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
61
+ const _response = yield core.fetcher({
62
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, "webhooks/messages"),
63
+ method: "GET",
64
+ headers: _headers,
65
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
66
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
67
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
68
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
69
+ });
70
+ if (_response.ok) {
71
+ return { data: _response.body, rawResponse: _response.rawResponse };
72
+ }
73
+ if (_response.error.reason === "status-code") {
74
+ switch (_response.error.statusCode) {
75
+ case 422:
76
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
77
+ case 429:
78
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
79
+ default:
80
+ throw new errors.AirweaveSDKError({
81
+ statusCode: _response.error.statusCode,
82
+ body: _response.error.body,
83
+ rawResponse: _response.rawResponse,
84
+ });
85
+ }
86
+ }
87
+ switch (_response.error.reason) {
88
+ case "non-json":
89
+ throw new errors.AirweaveSDKError({
90
+ statusCode: _response.error.statusCode,
91
+ body: _response.error.rawBody,
92
+ rawResponse: _response.rawResponse,
93
+ });
94
+ case "timeout":
95
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /webhooks/messages.");
96
+ case "unknown":
97
+ throw new errors.AirweaveSDKError({
98
+ message: _response.error.errorMessage,
99
+ rawResponse: _response.rawResponse,
100
+ });
101
+ }
102
+ });
103
+ }
104
+ /**
105
+ * Retrieve a specific webhook message by its ID.
106
+ *
107
+ * Returns the full message details including the event type, payload data,
108
+ * timestamp, and delivery channel information. Use this to inspect the
109
+ * exact payload that was sent to your webhook endpoints.
110
+ *
111
+ * Use `include_attempts=true` to also retrieve delivery attempts for this message,
112
+ * which include HTTP response codes, response bodies, and timestamps for debugging
113
+ * delivery failures.
114
+ *
115
+ * @param {string} messageId - The unique identifier of the message to retrieve (UUID).
116
+ * @param {AirweaveSDK.GetMessageWebhooksMessagesMessageIdGetRequest} request
117
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
118
+ *
119
+ * @throws {@link AirweaveSDK.NotFoundError}
120
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
121
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
122
+ *
123
+ * @example
124
+ * await client.webhooks.getMessage("550e8400-e29b-41d4-a716-446655440000", {
125
+ * include_attempts: true
126
+ * })
127
+ */
128
+ getMessage(messageId, request = {}, requestOptions) {
129
+ return core.HttpResponsePromise.fromPromise(this.__getMessage(messageId, request, requestOptions));
130
+ }
131
+ __getMessage(messageId_1) {
132
+ return __awaiter(this, arguments, void 0, function* (messageId, request = {}, requestOptions) {
133
+ var _a, _b, _c;
134
+ const { include_attempts: includeAttempts } = request;
135
+ const _queryParams = {};
136
+ if (includeAttempts != null) {
137
+ _queryParams["include_attempts"] = includeAttempts.toString();
138
+ }
139
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
140
+ const _response = yield core.fetcher({
141
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `webhooks/messages/${encodeURIComponent(messageId)}`),
142
+ method: "GET",
143
+ headers: _headers,
144
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
145
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
146
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
147
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
148
+ });
149
+ if (_response.ok) {
150
+ return {
151
+ data: _response.body,
152
+ rawResponse: _response.rawResponse,
153
+ };
154
+ }
155
+ if (_response.error.reason === "status-code") {
156
+ switch (_response.error.statusCode) {
157
+ case 404:
158
+ throw new AirweaveSDK.NotFoundError(_response.error.body, _response.rawResponse);
159
+ case 422:
160
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
161
+ case 429:
162
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
163
+ default:
164
+ throw new errors.AirweaveSDKError({
165
+ statusCode: _response.error.statusCode,
166
+ body: _response.error.body,
167
+ rawResponse: _response.rawResponse,
168
+ });
169
+ }
170
+ }
171
+ switch (_response.error.reason) {
172
+ case "non-json":
173
+ throw new errors.AirweaveSDKError({
174
+ statusCode: _response.error.statusCode,
175
+ body: _response.error.rawBody,
176
+ rawResponse: _response.rawResponse,
177
+ });
178
+ case "timeout":
179
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /webhooks/messages/{message_id}.");
180
+ case "unknown":
181
+ throw new errors.AirweaveSDKError({
182
+ message: _response.error.errorMessage,
183
+ rawResponse: _response.rawResponse,
184
+ });
185
+ }
186
+ });
187
+ }
188
+ /**
189
+ * List all webhook subscriptions for your organization.
190
+ *
191
+ * Returns all configured webhook endpoints, including their URLs, subscribed
192
+ * event types, and current status (enabled/disabled). Use this to audit
193
+ * your webhook configuration or find a specific subscription.
194
+ *
195
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
196
+ *
197
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
198
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
199
+ *
200
+ * @example
201
+ * await client.webhooks.getSubscriptions()
202
+ */
203
+ getSubscriptions(requestOptions) {
204
+ return core.HttpResponsePromise.fromPromise(this.__getSubscriptions(requestOptions));
205
+ }
206
+ __getSubscriptions(requestOptions) {
207
+ return __awaiter(this, void 0, void 0, function* () {
208
+ var _a, _b, _c;
209
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
210
+ const _response = yield core.fetcher({
211
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, "webhooks/subscriptions"),
212
+ method: "GET",
213
+ headers: _headers,
214
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
215
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
216
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
217
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
+ });
219
+ if (_response.ok) {
220
+ return { data: _response.body, rawResponse: _response.rawResponse };
221
+ }
222
+ if (_response.error.reason === "status-code") {
223
+ switch (_response.error.statusCode) {
224
+ case 422:
225
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
226
+ case 429:
227
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
228
+ default:
229
+ throw new errors.AirweaveSDKError({
230
+ statusCode: _response.error.statusCode,
231
+ body: _response.error.body,
232
+ rawResponse: _response.rawResponse,
233
+ });
234
+ }
235
+ }
236
+ switch (_response.error.reason) {
237
+ case "non-json":
238
+ throw new errors.AirweaveSDKError({
239
+ statusCode: _response.error.statusCode,
240
+ body: _response.error.rawBody,
241
+ rawResponse: _response.rawResponse,
242
+ });
243
+ case "timeout":
244
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /webhooks/subscriptions.");
245
+ case "unknown":
246
+ throw new errors.AirweaveSDKError({
247
+ message: _response.error.errorMessage,
248
+ rawResponse: _response.rawResponse,
249
+ });
250
+ }
251
+ });
252
+ }
253
+ /**
254
+ * Create a new webhook subscription.
255
+ *
256
+ * Webhook subscriptions allow you to receive real-time notifications when events
257
+ * occur in Airweave. When you create a subscription, you specify:
258
+ *
259
+ * - **URL**: The HTTPS endpoint where events will be delivered
260
+ * - **Event Types**: Which events you want to receive (e.g., `sync.completed`, `sync.failed`)
261
+ * - **Secret** (optional): A custom signing secret for verifying webhook signatures
262
+ *
263
+ * After creation, Airweave will send HTTP POST requests to your URL whenever
264
+ * matching events occur. Each request includes a signature header for verification.
265
+ *
266
+ * @param {AirweaveSDK.CreateSubscriptionRequest} request
267
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
268
+ *
269
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
270
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
271
+ *
272
+ * @example
273
+ * await client.webhooks.createSubscription({
274
+ * url: "https://api.mycompany.com/webhooks/airweave",
275
+ * event_types: ["sync.completed", "sync.failed"]
276
+ * })
277
+ */
278
+ createSubscription(request, requestOptions) {
279
+ return core.HttpResponsePromise.fromPromise(this.__createSubscription(request, requestOptions));
280
+ }
281
+ __createSubscription(request, requestOptions) {
282
+ return __awaiter(this, void 0, void 0, function* () {
283
+ var _a, _b, _c;
284
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
+ const _response = yield core.fetcher({
286
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, "webhooks/subscriptions"),
287
+ method: "POST",
288
+ headers: _headers,
289
+ contentType: "application/json",
290
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
291
+ requestType: "json",
292
+ body: request,
293
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
294
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
295
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
296
+ });
297
+ if (_response.ok) {
298
+ return { data: _response.body, rawResponse: _response.rawResponse };
299
+ }
300
+ if (_response.error.reason === "status-code") {
301
+ switch (_response.error.statusCode) {
302
+ case 422:
303
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
304
+ case 429:
305
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
306
+ default:
307
+ throw new errors.AirweaveSDKError({
308
+ statusCode: _response.error.statusCode,
309
+ body: _response.error.body,
310
+ rawResponse: _response.rawResponse,
311
+ });
312
+ }
313
+ }
314
+ switch (_response.error.reason) {
315
+ case "non-json":
316
+ throw new errors.AirweaveSDKError({
317
+ statusCode: _response.error.statusCode,
318
+ body: _response.error.rawBody,
319
+ rawResponse: _response.rawResponse,
320
+ });
321
+ case "timeout":
322
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /webhooks/subscriptions.");
323
+ case "unknown":
324
+ throw new errors.AirweaveSDKError({
325
+ message: _response.error.errorMessage,
326
+ rawResponse: _response.rawResponse,
327
+ });
328
+ }
329
+ });
330
+ }
331
+ /**
332
+ * Retrieve a specific webhook subscription with its recent delivery attempts.
333
+ *
334
+ * Returns the subscription configuration along with a history of message delivery
335
+ * attempts. This is useful for debugging delivery issues or verifying that your
336
+ * endpoint is correctly receiving events.
337
+ *
338
+ * Use `include_secret=true` to also retrieve the signing secret for webhook
339
+ * signature verification. Keep this secret secure.
340
+ *
341
+ * @param {string} subscriptionId - The unique identifier of the subscription to retrieve (UUID).
342
+ * @param {AirweaveSDK.GetSubscriptionWebhooksSubscriptionsSubscriptionIdGetRequest} request
343
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
344
+ *
345
+ * @throws {@link AirweaveSDK.NotFoundError}
346
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
347
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
348
+ *
349
+ * @example
350
+ * await client.webhooks.getSubscription("550e8400-e29b-41d4-a716-446655440000", {
351
+ * include_secret: true
352
+ * })
353
+ */
354
+ getSubscription(subscriptionId, request = {}, requestOptions) {
355
+ return core.HttpResponsePromise.fromPromise(this.__getSubscription(subscriptionId, request, requestOptions));
356
+ }
357
+ __getSubscription(subscriptionId_1) {
358
+ return __awaiter(this, arguments, void 0, function* (subscriptionId, request = {}, requestOptions) {
359
+ var _a, _b, _c;
360
+ const { include_secret: includeSecret } = request;
361
+ const _queryParams = {};
362
+ if (includeSecret != null) {
363
+ _queryParams["include_secret"] = includeSecret.toString();
364
+ }
365
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
366
+ const _response = yield core.fetcher({
367
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`),
368
+ method: "GET",
369
+ headers: _headers,
370
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
371
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
372
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
373
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
374
+ });
375
+ if (_response.ok) {
376
+ return { data: _response.body, rawResponse: _response.rawResponse };
377
+ }
378
+ if (_response.error.reason === "status-code") {
379
+ switch (_response.error.statusCode) {
380
+ case 404:
381
+ throw new AirweaveSDK.NotFoundError(_response.error.body, _response.rawResponse);
382
+ case 422:
383
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
384
+ case 429:
385
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
386
+ default:
387
+ throw new errors.AirweaveSDKError({
388
+ statusCode: _response.error.statusCode,
389
+ body: _response.error.body,
390
+ rawResponse: _response.rawResponse,
391
+ });
392
+ }
393
+ }
394
+ switch (_response.error.reason) {
395
+ case "non-json":
396
+ throw new errors.AirweaveSDKError({
397
+ statusCode: _response.error.statusCode,
398
+ body: _response.error.rawBody,
399
+ rawResponse: _response.rawResponse,
400
+ });
401
+ case "timeout":
402
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /webhooks/subscriptions/{subscription_id}.");
403
+ case "unknown":
404
+ throw new errors.AirweaveSDKError({
405
+ message: _response.error.errorMessage,
406
+ rawResponse: _response.rawResponse,
407
+ });
408
+ }
409
+ });
410
+ }
411
+ /**
412
+ * Permanently delete a webhook subscription.
413
+ *
414
+ * Once deleted, Airweave will stop sending events to this endpoint immediately.
415
+ * This action cannot be undone. Any pending message deliveries will be cancelled.
416
+ *
417
+ * If you want to temporarily stop receiving events, consider disabling the
418
+ * subscription instead using the PATCH endpoint.
419
+ *
420
+ * @param {string} subscriptionId - The unique identifier of the subscription to delete (UUID).
421
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
422
+ *
423
+ * @throws {@link AirweaveSDK.NotFoundError}
424
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
425
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
426
+ *
427
+ * @example
428
+ * await client.webhooks.deleteSubscription("550e8400-e29b-41d4-a716-446655440000")
429
+ */
430
+ deleteSubscription(subscriptionId, requestOptions) {
431
+ return core.HttpResponsePromise.fromPromise(this.__deleteSubscription(subscriptionId, requestOptions));
432
+ }
433
+ __deleteSubscription(subscriptionId, requestOptions) {
434
+ return __awaiter(this, void 0, void 0, function* () {
435
+ var _a, _b, _c;
436
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
437
+ const _response = yield core.fetcher({
438
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`),
439
+ method: "DELETE",
440
+ headers: _headers,
441
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
442
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
443
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
444
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
445
+ });
446
+ if (_response.ok) {
447
+ return { data: _response.body, rawResponse: _response.rawResponse };
448
+ }
449
+ if (_response.error.reason === "status-code") {
450
+ switch (_response.error.statusCode) {
451
+ case 404:
452
+ throw new AirweaveSDK.NotFoundError(_response.error.body, _response.rawResponse);
453
+ case 422:
454
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
455
+ case 429:
456
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
457
+ default:
458
+ throw new errors.AirweaveSDKError({
459
+ statusCode: _response.error.statusCode,
460
+ body: _response.error.body,
461
+ rawResponse: _response.rawResponse,
462
+ });
463
+ }
464
+ }
465
+ switch (_response.error.reason) {
466
+ case "non-json":
467
+ throw new errors.AirweaveSDKError({
468
+ statusCode: _response.error.statusCode,
469
+ body: _response.error.rawBody,
470
+ rawResponse: _response.rawResponse,
471
+ });
472
+ case "timeout":
473
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling DELETE /webhooks/subscriptions/{subscription_id}.");
474
+ case "unknown":
475
+ throw new errors.AirweaveSDKError({
476
+ message: _response.error.errorMessage,
477
+ rawResponse: _response.rawResponse,
478
+ });
479
+ }
480
+ });
481
+ }
482
+ /**
483
+ * Update an existing webhook subscription.
484
+ *
485
+ * Use this endpoint to modify a subscription's configuration. You can:
486
+ *
487
+ * - **Change the URL**: Update where events are delivered
488
+ * - **Update event types**: Modify which events trigger notifications
489
+ * - **Enable/disable**: Temporarily pause delivery without deleting the subscription
490
+ * - **Recover messages**: When re-enabling, optionally recover missed messages
491
+ *
492
+ * Only include the fields you want to change. Omitted fields will retain their
493
+ * current values.
494
+ *
495
+ * When re-enabling a subscription (`disabled: false`), you can optionally provide
496
+ * `recover_since` to automatically retry all messages that were generated while
497
+ * the subscription was disabled.
498
+ *
499
+ * @param {string} subscriptionId - The unique identifier of the subscription to update (UUID).
500
+ * @param {AirweaveSDK.PatchSubscriptionRequest} request
501
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
502
+ *
503
+ * @throws {@link AirweaveSDK.NotFoundError}
504
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
505
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
506
+ *
507
+ * @example
508
+ * await client.webhooks.patchSubscription("550e8400-e29b-41d4-a716-446655440000")
509
+ */
510
+ patchSubscription(subscriptionId, request = {}, requestOptions) {
511
+ return core.HttpResponsePromise.fromPromise(this.__patchSubscription(subscriptionId, request, requestOptions));
512
+ }
513
+ __patchSubscription(subscriptionId_1) {
514
+ return __awaiter(this, arguments, void 0, function* (subscriptionId, request = {}, requestOptions) {
515
+ var _a, _b, _c;
516
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
517
+ const _response = yield core.fetcher({
518
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`),
519
+ method: "PATCH",
520
+ headers: _headers,
521
+ contentType: "application/json",
522
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
523
+ requestType: "json",
524
+ body: request,
525
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
526
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
527
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
528
+ });
529
+ if (_response.ok) {
530
+ return { data: _response.body, rawResponse: _response.rawResponse };
531
+ }
532
+ if (_response.error.reason === "status-code") {
533
+ switch (_response.error.statusCode) {
534
+ case 404:
535
+ throw new AirweaveSDK.NotFoundError(_response.error.body, _response.rawResponse);
536
+ case 422:
537
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
538
+ case 429:
539
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
540
+ default:
541
+ throw new errors.AirweaveSDKError({
542
+ statusCode: _response.error.statusCode,
543
+ body: _response.error.body,
544
+ rawResponse: _response.rawResponse,
545
+ });
546
+ }
547
+ }
548
+ switch (_response.error.reason) {
549
+ case "non-json":
550
+ throw new errors.AirweaveSDKError({
551
+ statusCode: _response.error.statusCode,
552
+ body: _response.error.rawBody,
553
+ rawResponse: _response.rawResponse,
554
+ });
555
+ case "timeout":
556
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling PATCH /webhooks/subscriptions/{subscription_id}.");
557
+ case "unknown":
558
+ throw new errors.AirweaveSDKError({
559
+ message: _response.error.errorMessage,
560
+ rawResponse: _response.rawResponse,
561
+ });
562
+ }
563
+ });
564
+ }
565
+ /**
566
+ * Retry failed message deliveries for a webhook subscription.
567
+ *
568
+ * Triggers a recovery process that replays all failed messages within the
569
+ * specified time window. This is useful when:
570
+ *
571
+ * - Your endpoint was temporarily down and you want to catch up
572
+ * - You've fixed a bug in your webhook handler
573
+ * - You want to reprocess events after re-enabling a disabled subscription
574
+ *
575
+ * Messages are retried in chronological order. Successfully delivered messages
576
+ * are skipped; only failed or pending messages are retried.
577
+ *
578
+ * @param {string} subscriptionId - The unique identifier of the subscription to recover messages for (UUID).
579
+ * @param {AirweaveSDK.RecoverMessagesRequest} request
580
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
581
+ *
582
+ * @throws {@link AirweaveSDK.NotFoundError}
583
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
584
+ * @throws {@link AirweaveSDK.TooManyRequestsError}
585
+ *
586
+ * @example
587
+ * await client.webhooks.recoverFailedMessages("550e8400-e29b-41d4-a716-446655440000", {
588
+ * since: "2024-03-14T00:00:00Z"
589
+ * })
590
+ */
591
+ recoverFailedMessages(subscriptionId, request, requestOptions) {
592
+ return core.HttpResponsePromise.fromPromise(this.__recoverFailedMessages(subscriptionId, request, requestOptions));
593
+ }
594
+ __recoverFailedMessages(subscriptionId, request, requestOptions) {
595
+ return __awaiter(this, void 0, void 0, function* () {
596
+ var _a, _b, _c;
597
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
598
+ const _response = yield core.fetcher({
599
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `webhooks/subscriptions/${encodeURIComponent(subscriptionId)}/recover`),
600
+ method: "POST",
601
+ headers: _headers,
602
+ contentType: "application/json",
603
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
604
+ requestType: "json",
605
+ body: request,
606
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
607
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
608
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
609
+ });
610
+ if (_response.ok) {
611
+ return { data: _response.body, rawResponse: _response.rawResponse };
612
+ }
613
+ if (_response.error.reason === "status-code") {
614
+ switch (_response.error.statusCode) {
615
+ case 404:
616
+ throw new AirweaveSDK.NotFoundError(_response.error.body, _response.rawResponse);
617
+ case 422:
618
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
619
+ case 429:
620
+ throw new AirweaveSDK.TooManyRequestsError(_response.error.body, _response.rawResponse);
621
+ default:
622
+ throw new errors.AirweaveSDKError({
623
+ statusCode: _response.error.statusCode,
624
+ body: _response.error.body,
625
+ rawResponse: _response.rawResponse,
626
+ });
627
+ }
628
+ }
629
+ switch (_response.error.reason) {
630
+ case "non-json":
631
+ throw new errors.AirweaveSDKError({
632
+ statusCode: _response.error.statusCode,
633
+ body: _response.error.rawBody,
634
+ rawResponse: _response.rawResponse,
635
+ });
636
+ case "timeout":
637
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /webhooks/subscriptions/{subscription_id}/recover.");
638
+ case "unknown":
639
+ throw new errors.AirweaveSDKError({
640
+ message: _response.error.errorMessage,
641
+ rawResponse: _response.rawResponse,
642
+ });
643
+ }
644
+ });
645
+ }
646
+ _getCustomAuthorizationHeaders() {
647
+ return __awaiter(this, void 0, void 0, function* () {
648
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
649
+ return { "x-api-key": apiKeyValue };
650
+ });
651
+ }
652
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";