@airweave/sdk 0.6.0 → 0.6.26

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 (257) hide show
  1. package/README.md +14 -3
  2. package/dist/cjs/Client.d.ts +4 -8
  3. package/dist/cjs/Client.js +6 -16
  4. package/dist/cjs/api/resources/collections/client/Client.d.ts +14 -27
  5. package/dist/cjs/api/resources/collections/client/Client.js +37 -85
  6. package/dist/cjs/api/resources/collections/client/requests/ListCollectionsGetRequest.d.ts +6 -7
  7. package/dist/cjs/api/resources/collections/client/requests/SearchCollectionsReadableIdSearchGetRequest.d.ts +10 -16
  8. package/dist/cjs/api/resources/collections/client/requests/index.d.ts +0 -1
  9. package/dist/cjs/api/resources/index.d.ts +0 -4
  10. package/dist/cjs/api/resources/index.js +1 -5
  11. package/dist/cjs/api/resources/sourceConnections/client/Client.d.ts +60 -80
  12. package/dist/cjs/api/resources/sourceConnections/client/Client.js +104 -157
  13. package/dist/cjs/api/resources/sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.d.ts +12 -0
  14. package/dist/cjs/api/resources/sourceConnections/client/requests/ListSourceConnectionsGetRequest.d.ts +6 -10
  15. package/dist/cjs/api/resources/sourceConnections/client/requests/SourceConnectionCreate.d.ts +21 -20
  16. package/dist/cjs/api/resources/sourceConnections/client/requests/SourceConnectionUpdate.d.ts +7 -18
  17. package/dist/cjs/api/resources/sourceConnections/client/requests/index.d.ts +1 -2
  18. package/dist/cjs/api/resources/sources/client/Client.d.ts +17 -17
  19. package/dist/cjs/api/resources/sources/client/Client.js +24 -20
  20. package/dist/cjs/api/types/ActionCheckRequest.d.ts +10 -0
  21. package/dist/cjs/api/types/ActionCheckResponse.d.ts +3 -16
  22. package/dist/cjs/api/types/ActionCheckResponse.js +0 -8
  23. package/dist/cjs/api/types/AuthProvider.d.ts +0 -2
  24. package/dist/cjs/api/types/AuthProviderAuthentication.d.ts +12 -0
  25. package/dist/cjs/api/types/AuthProviderConnection.d.ts +2 -0
  26. package/dist/cjs/api/{resources/authProviders/client/requests → types}/AuthProviderConnectionCreate.d.ts +2 -10
  27. package/dist/cjs/api/types/AuthenticationDetails.d.ts +19 -0
  28. package/dist/cjs/api/types/AuthenticationMethod.d.ts +14 -0
  29. package/dist/cjs/api/types/AuthenticationMethod.js +13 -0
  30. package/dist/cjs/api/{resources/collections/client/requests → types}/CollectionUpdate.d.ts +4 -4
  31. package/dist/cjs/api/types/Destination.d.ts +0 -2
  32. package/dist/cjs/api/types/DestinationWithAuthenticationFields.d.ts +0 -1
  33. package/dist/cjs/api/types/DirectAuthentication.d.ts +10 -0
  34. package/dist/cjs/api/types/EmbeddingModel.d.ts +0 -2
  35. package/dist/cjs/api/types/EmbeddingModelWithAuthenticationFields.d.ts +0 -1
  36. package/dist/cjs/api/types/EntityCountWithDefinition.d.ts +1 -0
  37. package/dist/cjs/api/types/EntitySummary.d.ts +11 -0
  38. package/dist/cjs/api/types/EntityTypeStats.d.ts +10 -0
  39. package/dist/cjs/api/types/FieldCondition.d.ts +3 -3
  40. package/dist/cjs/api/types/IntegrationCredentialInDb.d.ts +2 -1
  41. package/dist/cjs/api/types/IntegrationCredentialRawCreate.d.ts +2 -1
  42. package/dist/cjs/api/types/MatchPhrase.d.ts +10 -0
  43. package/dist/cjs/api/types/OAuthBrowserAuthentication.d.ts +14 -0
  44. package/dist/cjs/api/types/OAuthTokenAuthentication.d.ts +14 -0
  45. package/dist/cjs/api/types/OAuthType.d.ts +12 -0
  46. package/dist/cjs/api/types/OAuthType.js +11 -0
  47. package/dist/cjs/api/types/ScheduleConfig.d.ts +14 -0
  48. package/dist/cjs/api/types/ScheduleDetails.d.ts +13 -0
  49. package/dist/cjs/api/types/SingleActionCheckResponse.d.ts +23 -0
  50. package/dist/cjs/api/types/SingleActionCheckResponse.js +13 -0
  51. package/dist/cjs/api/types/Source.d.ts +13 -9
  52. package/dist/cjs/api/types/SourceConnection.d.ts +9 -52
  53. package/dist/cjs/api/types/SourceConnectionJob.d.ts +9 -34
  54. package/dist/cjs/api/types/SourceConnectionListItem.d.ts +8 -16
  55. package/dist/cjs/api/types/SourceConnectionStatus.d.ts +7 -4
  56. package/dist/cjs/api/types/SourceConnectionStatus.js +5 -2
  57. package/dist/cjs/api/types/SubscriptionInfo.d.ts +12 -0
  58. package/dist/cjs/api/types/Sync.d.ts +0 -1
  59. package/dist/cjs/api/types/SyncCreate.d.ts +0 -1
  60. package/dist/cjs/api/types/SyncDetails.d.ts +13 -0
  61. package/dist/cjs/api/types/SyncJobDetails.d.ts +20 -0
  62. package/dist/cjs/api/types/SyncJobStatus.d.ts +3 -2
  63. package/dist/cjs/api/types/SyncJobStatus.js +2 -1
  64. package/dist/cjs/api/types/SyncUpdate.d.ts +0 -1
  65. package/dist/cjs/api/types/SyncWithSourceConnection.d.ts +0 -1
  66. package/dist/cjs/api/types/UpdatePlanRequest.d.ts +2 -0
  67. package/dist/cjs/api/types/UsageSnapshot.d.ts +4 -8
  68. package/dist/cjs/api/types/index.d.ts +18 -10
  69. package/dist/cjs/api/types/index.js +18 -10
  70. package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
  71. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
  72. package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
  73. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -3
  74. package/dist/cjs/core/fetcher/Fetcher.js +4 -3
  75. package/dist/cjs/core/fetcher/index.d.ts +7 -5
  76. package/dist/cjs/core/fetcher/index.js +7 -5
  77. package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
  78. package/dist/cjs/core/headers.d.ts +2 -3
  79. package/dist/cjs/version.d.ts +1 -1
  80. package/dist/cjs/version.js +1 -1
  81. package/dist/esm/Client.d.mts +4 -8
  82. package/dist/esm/Client.mjs +2 -12
  83. package/dist/esm/api/resources/collections/client/Client.d.mts +14 -27
  84. package/dist/esm/api/resources/collections/client/Client.mjs +37 -85
  85. package/dist/esm/api/resources/collections/client/requests/ListCollectionsGetRequest.d.mts +6 -7
  86. package/dist/esm/api/resources/collections/client/requests/SearchCollectionsReadableIdSearchGetRequest.d.mts +10 -16
  87. package/dist/esm/api/resources/collections/client/requests/index.d.mts +0 -1
  88. package/dist/esm/api/resources/index.d.mts +0 -4
  89. package/dist/esm/api/resources/index.mjs +0 -4
  90. package/dist/esm/api/resources/sourceConnections/client/Client.d.mts +60 -80
  91. package/dist/esm/api/resources/sourceConnections/client/Client.mjs +104 -157
  92. package/dist/esm/api/resources/sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.d.mts +12 -0
  93. package/dist/esm/api/resources/sourceConnections/client/requests/ListSourceConnectionsGetRequest.d.mts +6 -10
  94. package/dist/esm/api/resources/sourceConnections/client/requests/SourceConnectionCreate.d.mts +21 -20
  95. package/dist/esm/api/resources/sourceConnections/client/requests/SourceConnectionUpdate.d.mts +7 -18
  96. package/dist/esm/api/resources/sourceConnections/client/requests/index.d.mts +1 -2
  97. package/dist/esm/api/resources/sources/client/Client.d.mts +17 -17
  98. package/dist/esm/api/resources/sources/client/Client.mjs +24 -20
  99. package/dist/esm/api/types/ActionCheckRequest.d.mts +10 -0
  100. package/dist/esm/api/types/ActionCheckResponse.d.mts +3 -16
  101. package/dist/esm/api/types/ActionCheckResponse.mjs +1 -7
  102. package/dist/esm/api/types/AuthProvider.d.mts +0 -2
  103. package/dist/esm/api/types/AuthProviderAuthentication.d.mts +12 -0
  104. package/dist/esm/api/types/AuthProviderConnection.d.mts +2 -0
  105. package/dist/esm/api/{resources/authProviders/client/requests → types}/AuthProviderConnectionCreate.d.mts +2 -10
  106. package/dist/esm/api/types/AuthenticationDetails.d.mts +19 -0
  107. package/dist/esm/api/types/AuthenticationMethod.d.mts +14 -0
  108. package/dist/esm/api/types/AuthenticationMethod.mjs +10 -0
  109. package/dist/esm/api/{resources/collections/client/requests → types}/CollectionUpdate.d.mts +4 -4
  110. package/dist/esm/api/types/Destination.d.mts +0 -2
  111. package/dist/esm/api/types/DestinationWithAuthenticationFields.d.mts +0 -1
  112. package/dist/esm/api/types/DirectAuthentication.d.mts +10 -0
  113. package/dist/esm/api/types/EmbeddingModel.d.mts +0 -2
  114. package/dist/esm/api/types/EmbeddingModelWithAuthenticationFields.d.mts +0 -1
  115. package/dist/esm/api/types/EntityCountWithDefinition.d.mts +1 -0
  116. package/dist/esm/api/types/EntitySummary.d.mts +11 -0
  117. package/dist/esm/api/types/EntityTypeStats.d.mts +10 -0
  118. package/dist/esm/api/types/FieldCondition.d.mts +3 -3
  119. package/dist/esm/api/types/IntegrationCredentialInDb.d.mts +2 -1
  120. package/dist/esm/api/types/IntegrationCredentialRawCreate.d.mts +2 -1
  121. package/dist/esm/api/types/MatchPhrase.d.mts +10 -0
  122. package/dist/esm/api/types/OAuthBrowserAuthentication.d.mts +14 -0
  123. package/dist/esm/api/types/OAuthTokenAuthentication.d.mts +14 -0
  124. package/dist/esm/api/types/OAuthType.d.mts +12 -0
  125. package/dist/esm/api/types/OAuthType.mjs +8 -0
  126. package/dist/esm/api/types/ScheduleConfig.d.mts +14 -0
  127. package/dist/esm/api/types/ScheduleDetails.d.mts +13 -0
  128. package/dist/esm/api/types/SingleActionCheckResponse.d.mts +23 -0
  129. package/dist/esm/api/types/SingleActionCheckResponse.mjs +10 -0
  130. package/dist/esm/api/types/Source.d.mts +13 -9
  131. package/dist/esm/api/types/SourceConnection.d.mts +9 -52
  132. package/dist/esm/api/types/SourceConnectionJob.d.mts +9 -34
  133. package/dist/esm/api/types/SourceConnectionListItem.d.mts +8 -16
  134. package/dist/esm/api/types/SourceConnectionStatus.d.mts +7 -4
  135. package/dist/esm/api/types/SourceConnectionStatus.mjs +5 -2
  136. package/dist/esm/api/types/SubscriptionInfo.d.mts +12 -0
  137. package/dist/esm/api/types/Sync.d.mts +0 -1
  138. package/dist/esm/api/types/SyncCreate.d.mts +0 -1
  139. package/dist/esm/api/types/SyncDetails.d.mts +13 -0
  140. package/dist/esm/api/types/SyncJobDetails.d.mts +20 -0
  141. package/dist/esm/api/types/SyncJobStatus.d.mts +3 -2
  142. package/dist/esm/api/types/SyncJobStatus.mjs +2 -1
  143. package/dist/esm/api/types/SyncUpdate.d.mts +0 -1
  144. package/dist/esm/api/types/SyncWithSourceConnection.d.mts +0 -1
  145. package/dist/esm/api/types/UpdatePlanRequest.d.mts +2 -0
  146. package/dist/esm/api/types/UsageSnapshot.d.mts +4 -8
  147. package/dist/esm/api/types/index.d.mts +18 -10
  148. package/dist/esm/api/types/index.mjs +18 -10
  149. package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
  150. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
  151. package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
  152. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -3
  153. package/dist/esm/core/fetcher/Fetcher.mjs +4 -3
  154. package/dist/esm/core/fetcher/index.d.mts +7 -5
  155. package/dist/esm/core/fetcher/index.mjs +3 -2
  156. package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
  157. package/dist/esm/core/headers.d.mts +2 -3
  158. package/dist/esm/version.d.mts +1 -1
  159. package/dist/esm/version.mjs +1 -1
  160. package/package.json +8 -13
  161. package/reference.md +218 -1092
  162. package/dist/cjs/api/resources/authProviders/client/Client.d.ts +0 -90
  163. package/dist/cjs/api/resources/authProviders/client/Client.js +0 -213
  164. package/dist/cjs/api/resources/authProviders/client/index.d.ts +0 -2
  165. package/dist/cjs/api/resources/authProviders/client/index.js +0 -17
  166. package/dist/cjs/api/resources/authProviders/client/requests/index.d.ts +0 -1
  167. package/dist/cjs/api/resources/authProviders/index.d.ts +0 -1
  168. package/dist/cjs/api/resources/authProviders/index.js +0 -17
  169. package/dist/cjs/api/resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.d.ts +0 -11
  170. package/dist/cjs/api/resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.d.ts +0 -13
  171. package/dist/cjs/api/resources/whiteLabels/client/Client.d.ts +0 -189
  172. package/dist/cjs/api/resources/whiteLabels/client/Client.js +0 -585
  173. package/dist/cjs/api/resources/whiteLabels/client/index.d.ts +0 -2
  174. package/dist/cjs/api/resources/whiteLabels/client/index.js +0 -17
  175. package/dist/cjs/api/resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.ts +0 -16
  176. package/dist/cjs/api/resources/whiteLabels/client/requests/WhiteLabelCreate.d.ts +0 -28
  177. package/dist/cjs/api/resources/whiteLabels/client/requests/WhiteLabelUpdate.d.ts +0 -23
  178. package/dist/cjs/api/resources/whiteLabels/client/requests/index.d.ts +0 -3
  179. package/dist/cjs/api/resources/whiteLabels/client/requests/index.js +0 -2
  180. package/dist/cjs/api/resources/whiteLabels/index.d.ts +0 -1
  181. package/dist/cjs/api/resources/whiteLabels/index.js +0 -17
  182. package/dist/cjs/api/types/AuthType.d.ts +0 -27
  183. package/dist/cjs/api/types/AuthType.js +0 -16
  184. package/dist/cjs/api/types/BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.d.ts +0 -13
  185. package/dist/cjs/api/types/CancelSubscriptionRequest.d.ts +0 -11
  186. package/dist/cjs/api/types/OAuth2AuthUrl.d.ts +0 -13
  187. package/dist/cjs/api/types/SourceConnectionContinuousResponse.d.ts +0 -67
  188. package/dist/cjs/api/types/SourceConnectionCreateContinuous.d.ts +0 -33
  189. package/dist/cjs/api/types/SourceConnectionCreateWithCredential.d.ts +0 -25
  190. package/dist/cjs/api/types/SourceConnectionCreateWithWhiteLabel.d.ts +0 -29
  191. package/dist/cjs/api/types/SourceConnectionMakeContinuous.d.ts +0 -14
  192. package/dist/cjs/api/types/WhiteLabel.d.ts +0 -32
  193. package/dist/esm/api/resources/authProviders/client/Client.d.mts +0 -90
  194. package/dist/esm/api/resources/authProviders/client/Client.mjs +0 -176
  195. package/dist/esm/api/resources/authProviders/client/index.d.mts +0 -2
  196. package/dist/esm/api/resources/authProviders/client/index.mjs +0 -1
  197. package/dist/esm/api/resources/authProviders/client/requests/index.d.mts +0 -1
  198. package/dist/esm/api/resources/authProviders/index.d.mts +0 -1
  199. package/dist/esm/api/resources/authProviders/index.mjs +0 -1
  200. package/dist/esm/api/resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.d.mts +0 -11
  201. package/dist/esm/api/resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.d.mts +0 -13
  202. package/dist/esm/api/resources/whiteLabels/client/Client.d.mts +0 -189
  203. package/dist/esm/api/resources/whiteLabels/client/Client.mjs +0 -548
  204. package/dist/esm/api/resources/whiteLabels/client/index.d.mts +0 -2
  205. package/dist/esm/api/resources/whiteLabels/client/index.mjs +0 -1
  206. package/dist/esm/api/resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.mts +0 -16
  207. package/dist/esm/api/resources/whiteLabels/client/requests/WhiteLabelCreate.d.mts +0 -28
  208. package/dist/esm/api/resources/whiteLabels/client/requests/WhiteLabelUpdate.d.mts +0 -23
  209. package/dist/esm/api/resources/whiteLabels/client/requests/index.d.mts +0 -3
  210. package/dist/esm/api/resources/whiteLabels/client/requests/index.mjs +0 -1
  211. package/dist/esm/api/resources/whiteLabels/index.d.mts +0 -1
  212. package/dist/esm/api/resources/whiteLabels/index.mjs +0 -1
  213. package/dist/esm/api/types/AuthType.d.mts +0 -27
  214. package/dist/esm/api/types/AuthType.mjs +0 -13
  215. package/dist/esm/api/types/BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.d.mts +0 -13
  216. package/dist/esm/api/types/CancelSubscriptionRequest.d.mts +0 -11
  217. package/dist/esm/api/types/OAuth2AuthUrl.d.mts +0 -13
  218. package/dist/esm/api/types/SourceConnectionContinuousResponse.d.mts +0 -67
  219. package/dist/esm/api/types/SourceConnectionCreateContinuous.d.mts +0 -33
  220. package/dist/esm/api/types/SourceConnectionCreateWithCredential.d.mts +0 -25
  221. package/dist/esm/api/types/SourceConnectionCreateWithWhiteLabel.d.mts +0 -29
  222. package/dist/esm/api/types/SourceConnectionMakeContinuous.d.mts +0 -14
  223. package/dist/esm/api/types/WhiteLabel.d.mts +0 -32
  224. /package/dist/cjs/api/resources/{authProviders/client/requests/AuthProviderConnectionCreate.js → sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.js} +0 -0
  225. /package/dist/cjs/api/{resources/collections/client/requests/CollectionUpdate.js → types/ActionCheckRequest.js} +0 -0
  226. /package/dist/cjs/api/{resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.js → types/AuthProviderAuthentication.js} +0 -0
  227. /package/dist/cjs/api/{resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.js → types/AuthProviderConnectionCreate.js} +0 -0
  228. /package/dist/cjs/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js → types/AuthenticationDetails.js} +0 -0
  229. /package/dist/cjs/api/{resources/whiteLabels/client/requests/WhiteLabelCreate.js → types/CollectionUpdate.js} +0 -0
  230. /package/dist/cjs/api/{resources/whiteLabels/client/requests/WhiteLabelUpdate.js → types/DirectAuthentication.js} +0 -0
  231. /package/dist/cjs/api/types/{BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.js → EntitySummary.js} +0 -0
  232. /package/dist/cjs/api/types/{CancelSubscriptionRequest.js → EntityTypeStats.js} +0 -0
  233. /package/dist/cjs/api/types/{OAuth2AuthUrl.js → MatchPhrase.js} +0 -0
  234. /package/dist/cjs/api/types/{SourceConnectionContinuousResponse.js → OAuthBrowserAuthentication.js} +0 -0
  235. /package/dist/cjs/api/types/{SourceConnectionCreateContinuous.js → OAuthTokenAuthentication.js} +0 -0
  236. /package/dist/cjs/api/types/{SourceConnectionCreateWithCredential.js → ScheduleConfig.js} +0 -0
  237. /package/dist/cjs/api/types/{SourceConnectionCreateWithWhiteLabel.js → ScheduleDetails.js} +0 -0
  238. /package/dist/cjs/api/types/{SourceConnectionMakeContinuous.js → SyncDetails.js} +0 -0
  239. /package/dist/cjs/api/types/{WhiteLabel.js → SyncJobDetails.js} +0 -0
  240. /package/dist/cjs/{api/resources/authProviders/client/requests/index.js → core/fetcher/EndpointMetadata.js} +0 -0
  241. /package/dist/esm/api/resources/{authProviders/client/requests/AuthProviderConnectionCreate.mjs → sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.mjs} +0 -0
  242. /package/dist/esm/api/{resources/collections/client/requests/CollectionUpdate.mjs → types/ActionCheckRequest.mjs} +0 -0
  243. /package/dist/esm/api/{resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.mjs → types/AuthProviderAuthentication.mjs} +0 -0
  244. /package/dist/esm/api/{resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.mjs → types/AuthProviderConnectionCreate.mjs} +0 -0
  245. /package/dist/esm/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs → types/AuthenticationDetails.mjs} +0 -0
  246. /package/dist/esm/api/{resources/whiteLabels/client/requests/WhiteLabelCreate.mjs → types/CollectionUpdate.mjs} +0 -0
  247. /package/dist/esm/api/{resources/whiteLabels/client/requests/WhiteLabelUpdate.mjs → types/DirectAuthentication.mjs} +0 -0
  248. /package/dist/esm/api/types/{BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.mjs → EntitySummary.mjs} +0 -0
  249. /package/dist/esm/api/types/{CancelSubscriptionRequest.mjs → EntityTypeStats.mjs} +0 -0
  250. /package/dist/esm/api/types/{OAuth2AuthUrl.mjs → MatchPhrase.mjs} +0 -0
  251. /package/dist/esm/api/types/{SourceConnectionContinuousResponse.mjs → OAuthBrowserAuthentication.mjs} +0 -0
  252. /package/dist/esm/api/types/{SourceConnectionCreateContinuous.mjs → OAuthTokenAuthentication.mjs} +0 -0
  253. /package/dist/esm/api/types/{SourceConnectionCreateWithCredential.mjs → ScheduleConfig.mjs} +0 -0
  254. /package/dist/esm/api/types/{SourceConnectionCreateWithWhiteLabel.mjs → ScheduleDetails.mjs} +0 -0
  255. /package/dist/esm/api/types/{SourceConnectionMakeContinuous.mjs → SyncDetails.mjs} +0 -0
  256. /package/dist/esm/api/types/{WhiteLabel.mjs → SyncJobDetails.mjs} +0 -0
  257. /package/dist/esm/{api/resources/authProviders/client/requests/index.mjs → core/fetcher/EndpointMetadata.mjs} +0 -0
@@ -1,13 +1,14 @@
1
1
  import { APIResponse } from "./APIResponse.mjs";
2
- import { Supplier } from "./Supplier.mjs";
2
+ import { EndpointMetadata } from "./EndpointMetadata.mjs";
3
+ import { EndpointSupplier } from "./EndpointSupplier.mjs";
3
4
  export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
4
5
  export declare namespace Fetcher {
5
6
  interface Args {
6
7
  url: string;
7
8
  method: string;
8
9
  contentType?: string;
9
- headers?: Record<string, string | Supplier<string | undefined> | undefined>;
10
- queryParameters?: Record<string, string | string[] | object | object[] | null>;
10
+ headers?: Record<string, string | EndpointSupplier<string | null | undefined> | null | undefined>;
11
+ queryParameters?: Record<string, unknown>;
11
12
  body?: unknown;
12
13
  timeoutMs?: number;
13
14
  maxRetries?: number;
@@ -16,6 +17,7 @@ export declare namespace Fetcher {
16
17
  requestType?: "json" | "file" | "bytes";
17
18
  responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response";
18
19
  duplex?: "half";
20
+ endpointMetadata?: EndpointMetadata;
19
21
  }
20
22
  type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
21
23
  interface FailedStatusCodeError {
@@ -8,17 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { toJson } from "../json.mjs";
11
- import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
12
- import { Supplier } from "./Supplier.mjs";
13
11
  import { createRequestUrl } from "./createRequestUrl.mjs";
12
+ import { EndpointSupplier } from "./EndpointSupplier.mjs";
14
13
  import { getErrorResponseBody } from "./getErrorResponseBody.mjs";
15
14
  import { getFetchFn } from "./getFetchFn.mjs";
16
15
  import { getRequestBody } from "./getRequestBody.mjs";
17
16
  import { getResponseBody } from "./getResponseBody.mjs";
18
17
  import { makeRequest } from "./makeRequest.mjs";
18
+ import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
19
19
  import { requestWithRetries } from "./requestWithRetries.mjs";
20
20
  function getHeaders(args) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
+ var _a;
22
23
  const newHeaders = {};
23
24
  if (args.body !== undefined && args.contentType != null) {
24
25
  newHeaders["Content-Type"] = args.contentType;
@@ -27,7 +28,7 @@ function getHeaders(args) {
27
28
  return newHeaders;
28
29
  }
29
30
  for (const [key, value] of Object.entries(args.headers)) {
30
- const result = yield Supplier.get(value);
31
+ const result = yield EndpointSupplier.get(value, { endpointMetadata: (_a = args.endpointMetadata) !== null && _a !== void 0 ? _a : {} });
31
32
  if (typeof result === "string") {
32
33
  newHeaders[key] = result;
33
34
  continue;
@@ -1,9 +1,11 @@
1
1
  export type { APIResponse } from "./APIResponse.mjs";
2
- export { fetcher } from "./Fetcher.mjs";
2
+ export type { BinaryResponse } from "./BinaryResponse.mjs";
3
+ export type { EndpointMetadata } from "./EndpointMetadata.mjs";
4
+ export { EndpointSupplier } from "./EndpointSupplier.mjs";
3
5
  export type { Fetcher, FetchFunction } from "./Fetcher.mjs";
6
+ export { fetcher } from "./Fetcher.mjs";
4
7
  export { getHeader } from "./getHeader.mjs";
5
- export { Supplier } from "./Supplier.mjs";
6
- export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
7
- export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
8
8
  export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
9
- export { BinaryResponse } from "./BinaryResponse.mjs";
9
+ export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
10
+ export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
11
+ export { Supplier } from "./Supplier.mjs";
@@ -1,5 +1,6 @@
1
+ export { EndpointSupplier } from "./EndpointSupplier.mjs";
1
2
  export { fetcher } from "./Fetcher.mjs";
2
3
  export { getHeader } from "./getHeader.mjs";
3
- export { Supplier } from "./Supplier.mjs";
4
- export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
5
4
  export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
5
+ export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
6
+ export { Supplier } from "./Supplier.mjs";
@@ -11,21 +11,57 @@ const INITIAL_RETRY_DELAY = 1000; // in milliseconds
11
11
  const MAX_RETRY_DELAY = 60000; // in milliseconds
12
12
  const DEFAULT_MAX_RETRIES = 2;
13
13
  const JITTER_FACTOR = 0.2; // 20% random jitter
14
- function addJitter(delay) {
15
- // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR
16
- const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
14
+ function addPositiveJitter(delay) {
15
+ // Generate a random value between 0 and +JITTER_FACTOR
16
+ const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;
17
17
  return delay * jitterMultiplier;
18
18
  }
19
+ function addSymmetricJitter(delay) {
20
+ // Generate a random value in a JITTER_FACTOR-sized percentage range around delay
21
+ const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR;
22
+ return delay * jitterMultiplier;
23
+ }
24
+ function getRetryDelayFromHeaders(response, retryAttempt) {
25
+ // Check for Retry-After header first (RFC 7231), with no jitter
26
+ const retryAfter = response.headers.get("Retry-After");
27
+ if (retryAfter) {
28
+ // Parse as number of seconds...
29
+ const retryAfterSeconds = parseInt(retryAfter, 10);
30
+ if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) {
31
+ return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY);
32
+ }
33
+ // ...or as an HTTP date; both are valid
34
+ const retryAfterDate = new Date(retryAfter);
35
+ if (!isNaN(retryAfterDate.getTime())) {
36
+ const delay = retryAfterDate.getTime() - Date.now();
37
+ if (delay > 0) {
38
+ return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY);
39
+ }
40
+ }
41
+ }
42
+ // Then check for industry-standard X-RateLimit-Reset header, with positive jitter
43
+ const rateLimitReset = response.headers.get("X-RateLimit-Reset");
44
+ if (rateLimitReset) {
45
+ const resetTime = parseInt(rateLimitReset, 10);
46
+ if (!isNaN(resetTime)) {
47
+ // Assume Unix timestamp in epoch seconds
48
+ const delay = resetTime * 1000 - Date.now();
49
+ if (delay > 0) {
50
+ return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY));
51
+ }
52
+ }
53
+ }
54
+ // Fall back to exponential backoff, with symmetric jitter
55
+ return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY));
56
+ }
19
57
  export function requestWithRetries(requestFn_1) {
20
58
  return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
21
59
  let response = yield requestFn();
22
60
  for (let i = 0; i < maxRetries; ++i) {
23
61
  if ([408, 429].includes(response.status) || response.status >= 500) {
24
- // Calculate base delay using exponential backoff (in milliseconds)
25
- const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
26
- // Add jitter to the delay
27
- const delayWithJitter = addJitter(baseDelay);
28
- yield new Promise((resolve) => setTimeout(resolve, delayWithJitter));
62
+ // Get delay with appropriate jitter applied
63
+ const delay = getRetryDelayFromHeaders(response, i);
64
+ yield new Promise((resolve) => setTimeout(resolve, delay));
29
65
  response = yield requestFn();
30
66
  }
31
67
  else {
@@ -1,3 +1,2 @@
1
- import * as core from "./index.mjs";
2
- export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
3
- export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
1
+ export declare function mergeHeaders<THeaderValue>(...headersArray: (Record<string, THeaderValue> | null | undefined)[]): Record<string, string | THeaderValue>;
2
+ export declare function mergeOnlyDefinedHeaders<THeaderValue>(...headersArray: (Record<string, THeaderValue> | null | undefined)[]): Record<string, THeaderValue>;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "v0.6.0";
1
+ export declare const SDK_VERSION = "v0.6.26";
@@ -1 +1 @@
1
- export const SDK_VERSION = "v0.6.0";
1
+ export const SDK_VERSION = "v0.6.26";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airweave/sdk",
3
- "version": "v0.6.0",
3
+ "version": "v0.6.26",
4
4
  "private": false,
5
5
  "repository": "github:airweave-ai/typescript-sdk",
6
6
  "type": "commonjs",
@@ -30,23 +30,18 @@
30
30
  ],
31
31
  "scripts": {
32
32
  "format": "prettier . --write --ignore-unknown",
33
- "build": "yarn build:cjs && yarn build:esm",
33
+ "build": "pnpm build:cjs && pnpm build:esm",
34
34
  "build:cjs": "tsc --project ./tsconfig.cjs.json",
35
35
  "build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
36
- "test": "jest --config jest.config.mjs",
37
- "test:unit": "jest --selectProjects unit",
38
- "test:browser": "jest --selectProjects browser",
39
- "test:wire": "jest --selectProjects wire"
36
+ "test": "vitest",
37
+ "test:unit": "vitest --project unit",
38
+ "test:wire": "vitest --project wire"
40
39
  },
41
40
  "devDependencies": {
42
41
  "webpack": "^5.97.1",
43
42
  "ts-loader": "^9.5.1",
44
- "jest": "^29.7.0",
45
- "@jest/globals": "^29.7.0",
46
- "@types/jest": "^29.5.14",
47
- "ts-jest": "^29.3.4",
48
- "jest-environment-jsdom": "^29.7.0",
49
- "msw": "^2.8.4",
43
+ "vitest": "^3.2.4",
44
+ "msw": "2.11.2",
50
45
  "@types/node": "^18.19.70",
51
46
  "prettier": "^3.4.2",
52
47
  "typescript": "~5.7.2"
@@ -57,7 +52,7 @@
57
52
  "path": false,
58
53
  "stream": false
59
54
  },
60
- "packageManager": "yarn@1.22.22",
55
+ "packageManager": "pnpm@10.14.0",
61
56
  "engines": {
62
57
  "node": ">=18.0.0"
63
58
  },