@hookdeck/outpost-sdk 0.1.1 → 0.3.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 (523) hide show
  1. package/FUNCTIONS.md +5 -22
  2. package/README.md +50 -109
  3. package/bin/mcp-server.js +516 -182
  4. package/bin/mcp-server.js.map +59 -53
  5. package/dist/commonjs/funcs/destinationsCreate.d.ts +3 -2
  6. package/dist/commonjs/funcs/destinationsCreate.d.ts.map +1 -1
  7. package/dist/commonjs/funcs/destinationsCreate.js +3 -1
  8. package/dist/commonjs/funcs/destinationsCreate.js.map +1 -1
  9. package/dist/commonjs/funcs/destinationsDelete.d.ts +3 -2
  10. package/dist/commonjs/funcs/destinationsDelete.d.ts.map +1 -1
  11. package/dist/commonjs/funcs/destinationsDelete.js +3 -1
  12. package/dist/commonjs/funcs/destinationsDelete.js.map +1 -1
  13. package/dist/commonjs/funcs/destinationsDisable.d.ts +3 -2
  14. package/dist/commonjs/funcs/destinationsDisable.d.ts.map +1 -1
  15. package/dist/commonjs/funcs/destinationsDisable.js +3 -1
  16. package/dist/commonjs/funcs/destinationsDisable.js.map +1 -1
  17. package/dist/commonjs/funcs/destinationsEnable.d.ts +3 -2
  18. package/dist/commonjs/funcs/destinationsEnable.d.ts.map +1 -1
  19. package/dist/commonjs/funcs/destinationsEnable.js +3 -1
  20. package/dist/commonjs/funcs/destinationsEnable.js.map +1 -1
  21. package/dist/commonjs/funcs/destinationsGet.d.ts +3 -2
  22. package/dist/commonjs/funcs/destinationsGet.d.ts.map +1 -1
  23. package/dist/commonjs/funcs/destinationsGet.js +3 -1
  24. package/dist/commonjs/funcs/destinationsGet.js.map +1 -1
  25. package/dist/commonjs/funcs/destinationsList.d.ts +3 -2
  26. package/dist/commonjs/funcs/destinationsList.d.ts.map +1 -1
  27. package/dist/commonjs/funcs/destinationsList.js +3 -1
  28. package/dist/commonjs/funcs/destinationsList.js.map +1 -1
  29. package/dist/commonjs/funcs/destinationsUpdate.d.ts +3 -2
  30. package/dist/commonjs/funcs/destinationsUpdate.d.ts.map +1 -1
  31. package/dist/commonjs/funcs/destinationsUpdate.js +3 -1
  32. package/dist/commonjs/funcs/destinationsUpdate.js.map +1 -1
  33. package/dist/commonjs/funcs/eventsGet.d.ts +3 -2
  34. package/dist/commonjs/funcs/eventsGet.d.ts.map +1 -1
  35. package/dist/commonjs/funcs/eventsGet.js +3 -1
  36. package/dist/commonjs/funcs/eventsGet.js.map +1 -1
  37. package/dist/commonjs/funcs/eventsGetByDestination.d.ts +3 -2
  38. package/dist/commonjs/funcs/eventsGetByDestination.d.ts.map +1 -1
  39. package/dist/commonjs/funcs/eventsGetByDestination.js +3 -1
  40. package/dist/commonjs/funcs/eventsGetByDestination.js.map +1 -1
  41. package/dist/commonjs/funcs/eventsList.d.ts +3 -2
  42. package/dist/commonjs/funcs/eventsList.d.ts.map +1 -1
  43. package/dist/commonjs/funcs/eventsList.js +3 -1
  44. package/dist/commonjs/funcs/eventsList.js.map +1 -1
  45. package/dist/commonjs/funcs/eventsListByDestination.d.ts +3 -2
  46. package/dist/commonjs/funcs/eventsListByDestination.d.ts.map +1 -1
  47. package/dist/commonjs/funcs/eventsListByDestination.js +3 -1
  48. package/dist/commonjs/funcs/eventsListByDestination.js.map +1 -1
  49. package/dist/commonjs/funcs/eventsListDeliveries.d.ts +3 -2
  50. package/dist/commonjs/funcs/eventsListDeliveries.d.ts.map +1 -1
  51. package/dist/commonjs/funcs/eventsListDeliveries.js +3 -1
  52. package/dist/commonjs/funcs/eventsListDeliveries.js.map +1 -1
  53. package/dist/commonjs/funcs/eventsRetry.d.ts +3 -2
  54. package/dist/commonjs/funcs/eventsRetry.d.ts.map +1 -1
  55. package/dist/commonjs/funcs/eventsRetry.js +3 -1
  56. package/dist/commonjs/funcs/eventsRetry.js.map +1 -1
  57. package/dist/commonjs/funcs/healthCheck.d.ts +3 -2
  58. package/dist/commonjs/funcs/healthCheck.d.ts.map +1 -1
  59. package/dist/commonjs/funcs/healthCheck.js +3 -1
  60. package/dist/commonjs/funcs/healthCheck.js.map +1 -1
  61. package/dist/commonjs/funcs/publishEvent.d.ts +3 -2
  62. package/dist/commonjs/funcs/publishEvent.d.ts.map +1 -1
  63. package/dist/commonjs/funcs/publishEvent.js +4 -2
  64. package/dist/commonjs/funcs/publishEvent.js.map +1 -1
  65. package/dist/commonjs/funcs/schemasGet.d.ts +3 -2
  66. package/dist/commonjs/funcs/schemasGet.d.ts.map +1 -1
  67. package/dist/commonjs/funcs/schemasGet.js +3 -1
  68. package/dist/commonjs/funcs/schemasGet.js.map +1 -1
  69. package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.d.ts +3 -2
  70. package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.d.ts.map +1 -1
  71. package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.js +3 -1
  72. package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.js.map +1 -1
  73. package/dist/commonjs/funcs/schemasListDestinationTypesJwt.d.ts +3 -2
  74. package/dist/commonjs/funcs/schemasListDestinationTypesJwt.d.ts.map +1 -1
  75. package/dist/commonjs/funcs/schemasListDestinationTypesJwt.js +3 -1
  76. package/dist/commonjs/funcs/schemasListDestinationTypesJwt.js.map +1 -1
  77. package/dist/commonjs/funcs/schemasListTenantDestinationTypes.d.ts +3 -2
  78. package/dist/commonjs/funcs/schemasListTenantDestinationTypes.d.ts.map +1 -1
  79. package/dist/commonjs/funcs/schemasListTenantDestinationTypes.js +3 -1
  80. package/dist/commonjs/funcs/schemasListTenantDestinationTypes.js.map +1 -1
  81. package/dist/commonjs/funcs/tenantsDelete.d.ts +3 -2
  82. package/dist/commonjs/funcs/tenantsDelete.d.ts.map +1 -1
  83. package/dist/commonjs/funcs/tenantsDelete.js +3 -1
  84. package/dist/commonjs/funcs/tenantsDelete.js.map +1 -1
  85. package/dist/commonjs/funcs/tenantsGet.d.ts +3 -2
  86. package/dist/commonjs/funcs/tenantsGet.d.ts.map +1 -1
  87. package/dist/commonjs/funcs/tenantsGet.js +3 -1
  88. package/dist/commonjs/funcs/tenantsGet.js.map +1 -1
  89. package/dist/commonjs/funcs/tenantsGetPortalUrl.d.ts +3 -2
  90. package/dist/commonjs/funcs/tenantsGetPortalUrl.d.ts.map +1 -1
  91. package/dist/commonjs/funcs/tenantsGetPortalUrl.js +3 -1
  92. package/dist/commonjs/funcs/tenantsGetPortalUrl.js.map +1 -1
  93. package/dist/commonjs/funcs/tenantsGetToken.d.ts +3 -2
  94. package/dist/commonjs/funcs/tenantsGetToken.d.ts.map +1 -1
  95. package/dist/commonjs/funcs/tenantsGetToken.js +3 -1
  96. package/dist/commonjs/funcs/tenantsGetToken.js.map +1 -1
  97. package/dist/commonjs/funcs/tenantsUpsert.d.ts +3 -2
  98. package/dist/commonjs/funcs/tenantsUpsert.d.ts.map +1 -1
  99. package/dist/commonjs/funcs/tenantsUpsert.js +3 -1
  100. package/dist/commonjs/funcs/tenantsUpsert.js.map +1 -1
  101. package/dist/commonjs/funcs/topicsList.d.ts +3 -2
  102. package/dist/commonjs/funcs/topicsList.d.ts.map +1 -1
  103. package/dist/commonjs/funcs/topicsList.js +3 -1
  104. package/dist/commonjs/funcs/topicsList.js.map +1 -1
  105. package/dist/commonjs/funcs/topicsListJwt.d.ts +3 -2
  106. package/dist/commonjs/funcs/topicsListJwt.d.ts.map +1 -1
  107. package/dist/commonjs/funcs/topicsListJwt.js +3 -1
  108. package/dist/commonjs/funcs/topicsListJwt.js.map +1 -1
  109. package/dist/commonjs/hooks/types.d.ts +2 -0
  110. package/dist/commonjs/hooks/types.d.ts.map +1 -1
  111. package/dist/commonjs/index.d.ts +2 -0
  112. package/dist/commonjs/index.d.ts.map +1 -1
  113. package/dist/commonjs/index.js +3 -1
  114. package/dist/commonjs/index.js.map +1 -1
  115. package/dist/commonjs/lib/config.d.ts +7 -3
  116. package/dist/commonjs/lib/config.d.ts.map +1 -1
  117. package/dist/commonjs/lib/config.js +3 -3
  118. package/dist/commonjs/lib/config.js.map +1 -1
  119. package/dist/commonjs/lib/files.d.ts +5 -0
  120. package/dist/commonjs/lib/files.d.ts.map +1 -1
  121. package/dist/commonjs/lib/files.js +41 -0
  122. package/dist/commonjs/lib/files.js.map +1 -1
  123. package/dist/commonjs/lib/matchers.d.ts +3 -10
  124. package/dist/commonjs/lib/matchers.d.ts.map +1 -1
  125. package/dist/commonjs/lib/matchers.js +33 -31
  126. package/dist/commonjs/lib/matchers.js.map +1 -1
  127. package/dist/commonjs/lib/sdks.d.ts +1 -0
  128. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  129. package/dist/commonjs/lib/sdks.js +3 -3
  130. package/dist/commonjs/lib/sdks.js.map +1 -1
  131. package/dist/commonjs/lib/security.d.ts +2 -2
  132. package/dist/commonjs/lib/security.d.ts.map +1 -1
  133. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
  134. package/dist/commonjs/mcp-server/cli/start/command.js +0 -12
  135. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
  136. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +0 -2
  137. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
  138. package/dist/commonjs/mcp-server/cli/start/impl.js +4 -6
  139. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  140. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  141. package/dist/commonjs/mcp-server/server.js +1 -1
  142. package/dist/commonjs/mcp-server/tools/publishEvent.d.ts.map +1 -1
  143. package/dist/commonjs/mcp-server/tools/publishEvent.js +2 -1
  144. package/dist/commonjs/mcp-server/tools/publishEvent.js.map +1 -1
  145. package/dist/commonjs/models/components/azureservicebusconfig.d.ts +32 -0
  146. package/dist/commonjs/models/components/azureservicebusconfig.d.ts.map +1 -0
  147. package/dist/commonjs/models/components/azureservicebusconfig.js +69 -0
  148. package/dist/commonjs/models/components/azureservicebusconfig.js.map +1 -0
  149. package/dist/commonjs/models/components/azureservicebuscredentials.d.ts +32 -0
  150. package/dist/commonjs/models/components/azureservicebuscredentials.d.ts.map +1 -0
  151. package/dist/commonjs/models/components/azureservicebuscredentials.js +78 -0
  152. package/dist/commonjs/models/components/azureservicebuscredentials.js.map +1 -0
  153. package/dist/commonjs/models/components/destination.d.ts +9 -4
  154. package/dist/commonjs/models/components/destination.d.ts.map +1 -1
  155. package/dist/commonjs/models/components/destination.js +11 -4
  156. package/dist/commonjs/models/components/destination.js.map +1 -1
  157. package/dist/commonjs/models/components/destinationazureservicebus.d.ts +98 -0
  158. package/dist/commonjs/models/components/destinationazureservicebus.d.ts.map +1 -0
  159. package/dist/commonjs/models/components/destinationazureservicebus.js +122 -0
  160. package/dist/commonjs/models/components/destinationazureservicebus.js.map +1 -0
  161. package/dist/commonjs/models/components/destinationcreate.d.ts +15 -10
  162. package/dist/commonjs/models/components/destinationcreate.d.ts.map +1 -1
  163. package/dist/commonjs/models/components/destinationcreate.js +17 -10
  164. package/dist/commonjs/models/components/destinationcreate.js.map +1 -1
  165. package/dist/commonjs/models/components/destinationcreateazureservicebus.d.ts +78 -0
  166. package/dist/commonjs/models/components/destinationcreateazureservicebus.d.ts.map +1 -0
  167. package/dist/commonjs/models/components/destinationcreateazureservicebus.js +101 -0
  168. package/dist/commonjs/models/components/destinationcreateazureservicebus.js.map +1 -0
  169. package/dist/commonjs/models/components/index.d.ts +5 -0
  170. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  171. package/dist/commonjs/models/components/index.js +5 -0
  172. package/dist/commonjs/models/components/index.js.map +1 -1
  173. package/dist/commonjs/models/components/publishrequest.d.ts +12 -7
  174. package/dist/commonjs/models/components/publishrequest.d.ts.map +1 -1
  175. package/dist/commonjs/models/components/publishrequest.js +8 -6
  176. package/dist/commonjs/models/components/publishrequest.js.map +1 -1
  177. package/dist/commonjs/models/components/publishresponse.d.ts +32 -0
  178. package/dist/commonjs/models/components/publishresponse.d.ts.map +1 -0
  179. package/dist/commonjs/models/components/publishresponse.js +69 -0
  180. package/dist/commonjs/models/components/publishresponse.js.map +1 -0
  181. package/dist/commonjs/models/errors/apierror.d.ts +8 -6
  182. package/dist/commonjs/models/errors/apierror.d.ts.map +1 -1
  183. package/dist/commonjs/models/errors/apierror.js +23 -10
  184. package/dist/commonjs/models/errors/apierror.js.map +1 -1
  185. package/dist/commonjs/models/errors/badrequesterror.d.ts +7 -2
  186. package/dist/commonjs/models/errors/badrequesterror.d.ts.map +1 -1
  187. package/dist/commonjs/models/errors/badrequesterror.js +13 -7
  188. package/dist/commonjs/models/errors/badrequesterror.js.map +1 -1
  189. package/dist/commonjs/models/errors/index.d.ts +1 -0
  190. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  191. package/dist/commonjs/models/errors/index.js +1 -0
  192. package/dist/commonjs/models/errors/index.js.map +1 -1
  193. package/dist/commonjs/models/errors/internalservererror.d.ts +7 -2
  194. package/dist/commonjs/models/errors/internalservererror.d.ts.map +1 -1
  195. package/dist/commonjs/models/errors/internalservererror.js +13 -7
  196. package/dist/commonjs/models/errors/internalservererror.js.map +1 -1
  197. package/dist/commonjs/models/errors/notfounderror.d.ts +7 -2
  198. package/dist/commonjs/models/errors/notfounderror.d.ts.map +1 -1
  199. package/dist/commonjs/models/errors/notfounderror.js +13 -7
  200. package/dist/commonjs/models/errors/notfounderror.js.map +1 -1
  201. package/dist/commonjs/models/errors/outposterror.d.ts +19 -0
  202. package/dist/commonjs/models/errors/outposterror.d.ts.map +1 -0
  203. package/dist/commonjs/models/errors/outposterror.js +20 -0
  204. package/dist/commonjs/models/errors/outposterror.js.map +1 -0
  205. package/dist/commonjs/models/errors/ratelimitederror.d.ts +7 -2
  206. package/dist/commonjs/models/errors/ratelimitederror.d.ts.map +1 -1
  207. package/dist/commonjs/models/errors/ratelimitederror.js +13 -7
  208. package/dist/commonjs/models/errors/ratelimitederror.js.map +1 -1
  209. package/dist/commonjs/models/errors/responsevalidationerror.d.ts +26 -0
  210. package/dist/commonjs/models/errors/responsevalidationerror.d.ts.map +1 -0
  211. package/dist/commonjs/models/errors/responsevalidationerror.js +66 -0
  212. package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -0
  213. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +1 -0
  214. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -1
  215. package/dist/commonjs/models/errors/sdkvalidationerror.js +14 -0
  216. package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -1
  217. package/dist/commonjs/models/errors/timeouterror.d.ts +7 -2
  218. package/dist/commonjs/models/errors/timeouterror.d.ts.map +1 -1
  219. package/dist/commonjs/models/errors/timeouterror.js +13 -7
  220. package/dist/commonjs/models/errors/timeouterror.js.map +1 -1
  221. package/dist/commonjs/models/errors/unauthorizederror.d.ts +7 -2
  222. package/dist/commonjs/models/errors/unauthorizederror.d.ts.map +1 -1
  223. package/dist/commonjs/models/errors/unauthorizederror.js +13 -7
  224. package/dist/commonjs/models/errors/unauthorizederror.js.map +1 -1
  225. package/dist/commonjs/sdk/publish.d.ts +1 -1
  226. package/dist/commonjs/sdk/publish.d.ts.map +1 -1
  227. package/dist/commonjs/types/constdatetime.js +1 -1
  228. package/dist/esm/funcs/destinationsCreate.d.ts +3 -2
  229. package/dist/esm/funcs/destinationsCreate.d.ts.map +1 -1
  230. package/dist/esm/funcs/destinationsCreate.js +3 -1
  231. package/dist/esm/funcs/destinationsCreate.js.map +1 -1
  232. package/dist/esm/funcs/destinationsDelete.d.ts +3 -2
  233. package/dist/esm/funcs/destinationsDelete.d.ts.map +1 -1
  234. package/dist/esm/funcs/destinationsDelete.js +3 -1
  235. package/dist/esm/funcs/destinationsDelete.js.map +1 -1
  236. package/dist/esm/funcs/destinationsDisable.d.ts +3 -2
  237. package/dist/esm/funcs/destinationsDisable.d.ts.map +1 -1
  238. package/dist/esm/funcs/destinationsDisable.js +3 -1
  239. package/dist/esm/funcs/destinationsDisable.js.map +1 -1
  240. package/dist/esm/funcs/destinationsEnable.d.ts +3 -2
  241. package/dist/esm/funcs/destinationsEnable.d.ts.map +1 -1
  242. package/dist/esm/funcs/destinationsEnable.js +3 -1
  243. package/dist/esm/funcs/destinationsEnable.js.map +1 -1
  244. package/dist/esm/funcs/destinationsGet.d.ts +3 -2
  245. package/dist/esm/funcs/destinationsGet.d.ts.map +1 -1
  246. package/dist/esm/funcs/destinationsGet.js +3 -1
  247. package/dist/esm/funcs/destinationsGet.js.map +1 -1
  248. package/dist/esm/funcs/destinationsList.d.ts +3 -2
  249. package/dist/esm/funcs/destinationsList.d.ts.map +1 -1
  250. package/dist/esm/funcs/destinationsList.js +3 -1
  251. package/dist/esm/funcs/destinationsList.js.map +1 -1
  252. package/dist/esm/funcs/destinationsUpdate.d.ts +3 -2
  253. package/dist/esm/funcs/destinationsUpdate.d.ts.map +1 -1
  254. package/dist/esm/funcs/destinationsUpdate.js +3 -1
  255. package/dist/esm/funcs/destinationsUpdate.js.map +1 -1
  256. package/dist/esm/funcs/eventsGet.d.ts +3 -2
  257. package/dist/esm/funcs/eventsGet.d.ts.map +1 -1
  258. package/dist/esm/funcs/eventsGet.js +3 -1
  259. package/dist/esm/funcs/eventsGet.js.map +1 -1
  260. package/dist/esm/funcs/eventsGetByDestination.d.ts +3 -2
  261. package/dist/esm/funcs/eventsGetByDestination.d.ts.map +1 -1
  262. package/dist/esm/funcs/eventsGetByDestination.js +3 -1
  263. package/dist/esm/funcs/eventsGetByDestination.js.map +1 -1
  264. package/dist/esm/funcs/eventsList.d.ts +3 -2
  265. package/dist/esm/funcs/eventsList.d.ts.map +1 -1
  266. package/dist/esm/funcs/eventsList.js +3 -1
  267. package/dist/esm/funcs/eventsList.js.map +1 -1
  268. package/dist/esm/funcs/eventsListByDestination.d.ts +3 -2
  269. package/dist/esm/funcs/eventsListByDestination.d.ts.map +1 -1
  270. package/dist/esm/funcs/eventsListByDestination.js +3 -1
  271. package/dist/esm/funcs/eventsListByDestination.js.map +1 -1
  272. package/dist/esm/funcs/eventsListDeliveries.d.ts +3 -2
  273. package/dist/esm/funcs/eventsListDeliveries.d.ts.map +1 -1
  274. package/dist/esm/funcs/eventsListDeliveries.js +3 -1
  275. package/dist/esm/funcs/eventsListDeliveries.js.map +1 -1
  276. package/dist/esm/funcs/eventsRetry.d.ts +3 -2
  277. package/dist/esm/funcs/eventsRetry.d.ts.map +1 -1
  278. package/dist/esm/funcs/eventsRetry.js +3 -1
  279. package/dist/esm/funcs/eventsRetry.js.map +1 -1
  280. package/dist/esm/funcs/healthCheck.d.ts +3 -2
  281. package/dist/esm/funcs/healthCheck.d.ts.map +1 -1
  282. package/dist/esm/funcs/healthCheck.js +3 -1
  283. package/dist/esm/funcs/healthCheck.js.map +1 -1
  284. package/dist/esm/funcs/publishEvent.d.ts +3 -2
  285. package/dist/esm/funcs/publishEvent.d.ts.map +1 -1
  286. package/dist/esm/funcs/publishEvent.js +4 -2
  287. package/dist/esm/funcs/publishEvent.js.map +1 -1
  288. package/dist/esm/funcs/schemasGet.d.ts +3 -2
  289. package/dist/esm/funcs/schemasGet.d.ts.map +1 -1
  290. package/dist/esm/funcs/schemasGet.js +3 -1
  291. package/dist/esm/funcs/schemasGet.js.map +1 -1
  292. package/dist/esm/funcs/schemasGetDestinationTypeJwt.d.ts +3 -2
  293. package/dist/esm/funcs/schemasGetDestinationTypeJwt.d.ts.map +1 -1
  294. package/dist/esm/funcs/schemasGetDestinationTypeJwt.js +3 -1
  295. package/dist/esm/funcs/schemasGetDestinationTypeJwt.js.map +1 -1
  296. package/dist/esm/funcs/schemasListDestinationTypesJwt.d.ts +3 -2
  297. package/dist/esm/funcs/schemasListDestinationTypesJwt.d.ts.map +1 -1
  298. package/dist/esm/funcs/schemasListDestinationTypesJwt.js +3 -1
  299. package/dist/esm/funcs/schemasListDestinationTypesJwt.js.map +1 -1
  300. package/dist/esm/funcs/schemasListTenantDestinationTypes.d.ts +3 -2
  301. package/dist/esm/funcs/schemasListTenantDestinationTypes.d.ts.map +1 -1
  302. package/dist/esm/funcs/schemasListTenantDestinationTypes.js +3 -1
  303. package/dist/esm/funcs/schemasListTenantDestinationTypes.js.map +1 -1
  304. package/dist/esm/funcs/tenantsDelete.d.ts +3 -2
  305. package/dist/esm/funcs/tenantsDelete.d.ts.map +1 -1
  306. package/dist/esm/funcs/tenantsDelete.js +3 -1
  307. package/dist/esm/funcs/tenantsDelete.js.map +1 -1
  308. package/dist/esm/funcs/tenantsGet.d.ts +3 -2
  309. package/dist/esm/funcs/tenantsGet.d.ts.map +1 -1
  310. package/dist/esm/funcs/tenantsGet.js +3 -1
  311. package/dist/esm/funcs/tenantsGet.js.map +1 -1
  312. package/dist/esm/funcs/tenantsGetPortalUrl.d.ts +3 -2
  313. package/dist/esm/funcs/tenantsGetPortalUrl.d.ts.map +1 -1
  314. package/dist/esm/funcs/tenantsGetPortalUrl.js +3 -1
  315. package/dist/esm/funcs/tenantsGetPortalUrl.js.map +1 -1
  316. package/dist/esm/funcs/tenantsGetToken.d.ts +3 -2
  317. package/dist/esm/funcs/tenantsGetToken.d.ts.map +1 -1
  318. package/dist/esm/funcs/tenantsGetToken.js +3 -1
  319. package/dist/esm/funcs/tenantsGetToken.js.map +1 -1
  320. package/dist/esm/funcs/tenantsUpsert.d.ts +3 -2
  321. package/dist/esm/funcs/tenantsUpsert.d.ts.map +1 -1
  322. package/dist/esm/funcs/tenantsUpsert.js +3 -1
  323. package/dist/esm/funcs/tenantsUpsert.js.map +1 -1
  324. package/dist/esm/funcs/topicsList.d.ts +3 -2
  325. package/dist/esm/funcs/topicsList.d.ts.map +1 -1
  326. package/dist/esm/funcs/topicsList.js +3 -1
  327. package/dist/esm/funcs/topicsList.js.map +1 -1
  328. package/dist/esm/funcs/topicsListJwt.d.ts +3 -2
  329. package/dist/esm/funcs/topicsListJwt.d.ts.map +1 -1
  330. package/dist/esm/funcs/topicsListJwt.js +3 -1
  331. package/dist/esm/funcs/topicsListJwt.js.map +1 -1
  332. package/dist/esm/hooks/types.d.ts +2 -0
  333. package/dist/esm/hooks/types.d.ts.map +1 -1
  334. package/dist/esm/index.d.ts +2 -0
  335. package/dist/esm/index.d.ts.map +1 -1
  336. package/dist/esm/index.js +1 -0
  337. package/dist/esm/index.js.map +1 -1
  338. package/dist/esm/lib/config.d.ts +7 -3
  339. package/dist/esm/lib/config.d.ts.map +1 -1
  340. package/dist/esm/lib/config.js +3 -3
  341. package/dist/esm/lib/config.js.map +1 -1
  342. package/dist/esm/lib/files.d.ts +5 -0
  343. package/dist/esm/lib/files.d.ts.map +1 -1
  344. package/dist/esm/lib/files.js +40 -0
  345. package/dist/esm/lib/files.js.map +1 -1
  346. package/dist/esm/lib/matchers.d.ts +3 -10
  347. package/dist/esm/lib/matchers.d.ts.map +1 -1
  348. package/dist/esm/lib/matchers.js +33 -30
  349. package/dist/esm/lib/matchers.js.map +1 -1
  350. package/dist/esm/lib/sdks.d.ts +1 -0
  351. package/dist/esm/lib/sdks.d.ts.map +1 -1
  352. package/dist/esm/lib/sdks.js +3 -3
  353. package/dist/esm/lib/sdks.js.map +1 -1
  354. package/dist/esm/lib/security.d.ts +2 -2
  355. package/dist/esm/lib/security.d.ts.map +1 -1
  356. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
  357. package/dist/esm/mcp-server/cli/start/command.js +0 -12
  358. package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
  359. package/dist/esm/mcp-server/cli/start/impl.d.ts +0 -2
  360. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
  361. package/dist/esm/mcp-server/cli/start/impl.js +4 -6
  362. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  363. package/dist/esm/mcp-server/mcp-server.js +1 -1
  364. package/dist/esm/mcp-server/server.js +1 -1
  365. package/dist/esm/mcp-server/tools/publishEvent.d.ts.map +1 -1
  366. package/dist/esm/mcp-server/tools/publishEvent.js +2 -1
  367. package/dist/esm/mcp-server/tools/publishEvent.js.map +1 -1
  368. package/dist/esm/models/components/azureservicebusconfig.d.ts +32 -0
  369. package/dist/esm/models/components/azureservicebusconfig.d.ts.map +1 -0
  370. package/dist/esm/models/components/azureservicebusconfig.js +31 -0
  371. package/dist/esm/models/components/azureservicebusconfig.js.map +1 -0
  372. package/dist/esm/models/components/azureservicebuscredentials.d.ts +32 -0
  373. package/dist/esm/models/components/azureservicebuscredentials.d.ts.map +1 -0
  374. package/dist/esm/models/components/azureservicebuscredentials.js +40 -0
  375. package/dist/esm/models/components/azureservicebuscredentials.js.map +1 -0
  376. package/dist/esm/models/components/destination.d.ts +9 -4
  377. package/dist/esm/models/components/destination.d.ts.map +1 -1
  378. package/dist/esm/models/components/destination.js +11 -4
  379. package/dist/esm/models/components/destination.js.map +1 -1
  380. package/dist/esm/models/components/destinationazureservicebus.d.ts +98 -0
  381. package/dist/esm/models/components/destinationazureservicebus.d.ts.map +1 -0
  382. package/dist/esm/models/components/destinationazureservicebus.js +84 -0
  383. package/dist/esm/models/components/destinationazureservicebus.js.map +1 -0
  384. package/dist/esm/models/components/destinationcreate.d.ts +15 -10
  385. package/dist/esm/models/components/destinationcreate.d.ts.map +1 -1
  386. package/dist/esm/models/components/destinationcreate.js +17 -10
  387. package/dist/esm/models/components/destinationcreate.js.map +1 -1
  388. package/dist/esm/models/components/destinationcreateazureservicebus.d.ts +78 -0
  389. package/dist/esm/models/components/destinationcreateazureservicebus.d.ts.map +1 -0
  390. package/dist/esm/models/components/destinationcreateazureservicebus.js +63 -0
  391. package/dist/esm/models/components/destinationcreateazureservicebus.js.map +1 -0
  392. package/dist/esm/models/components/index.d.ts +5 -0
  393. package/dist/esm/models/components/index.d.ts.map +1 -1
  394. package/dist/esm/models/components/index.js +5 -0
  395. package/dist/esm/models/components/index.js.map +1 -1
  396. package/dist/esm/models/components/publishrequest.d.ts +12 -7
  397. package/dist/esm/models/components/publishrequest.d.ts.map +1 -1
  398. package/dist/esm/models/components/publishrequest.js +8 -6
  399. package/dist/esm/models/components/publishrequest.js.map +1 -1
  400. package/dist/esm/models/components/publishresponse.d.ts +32 -0
  401. package/dist/esm/models/components/publishresponse.d.ts.map +1 -0
  402. package/dist/esm/models/components/publishresponse.js +31 -0
  403. package/dist/esm/models/components/publishresponse.js.map +1 -0
  404. package/dist/esm/models/errors/apierror.d.ts +8 -6
  405. package/dist/esm/models/errors/apierror.d.ts.map +1 -1
  406. package/dist/esm/models/errors/apierror.js +23 -10
  407. package/dist/esm/models/errors/apierror.js.map +1 -1
  408. package/dist/esm/models/errors/badrequesterror.d.ts +7 -2
  409. package/dist/esm/models/errors/badrequesterror.d.ts.map +1 -1
  410. package/dist/esm/models/errors/badrequesterror.js +13 -7
  411. package/dist/esm/models/errors/badrequesterror.js.map +1 -1
  412. package/dist/esm/models/errors/index.d.ts +1 -0
  413. package/dist/esm/models/errors/index.d.ts.map +1 -1
  414. package/dist/esm/models/errors/index.js +1 -0
  415. package/dist/esm/models/errors/index.js.map +1 -1
  416. package/dist/esm/models/errors/internalservererror.d.ts +7 -2
  417. package/dist/esm/models/errors/internalservererror.d.ts.map +1 -1
  418. package/dist/esm/models/errors/internalservererror.js +13 -7
  419. package/dist/esm/models/errors/internalservererror.js.map +1 -1
  420. package/dist/esm/models/errors/notfounderror.d.ts +7 -2
  421. package/dist/esm/models/errors/notfounderror.d.ts.map +1 -1
  422. package/dist/esm/models/errors/notfounderror.js +13 -7
  423. package/dist/esm/models/errors/notfounderror.js.map +1 -1
  424. package/dist/esm/models/errors/outposterror.d.ts +19 -0
  425. package/dist/esm/models/errors/outposterror.d.ts.map +1 -0
  426. package/dist/esm/models/errors/outposterror.js +16 -0
  427. package/dist/esm/models/errors/outposterror.js.map +1 -0
  428. package/dist/esm/models/errors/ratelimitederror.d.ts +7 -2
  429. package/dist/esm/models/errors/ratelimitederror.d.ts.map +1 -1
  430. package/dist/esm/models/errors/ratelimitederror.js +13 -7
  431. package/dist/esm/models/errors/ratelimitederror.js.map +1 -1
  432. package/dist/esm/models/errors/responsevalidationerror.d.ts +26 -0
  433. package/dist/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
  434. package/dist/esm/models/errors/responsevalidationerror.js +29 -0
  435. package/dist/esm/models/errors/responsevalidationerror.js.map +1 -0
  436. package/dist/esm/models/errors/sdkvalidationerror.d.ts +1 -0
  437. package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -1
  438. package/dist/esm/models/errors/sdkvalidationerror.js +14 -0
  439. package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -1
  440. package/dist/esm/models/errors/timeouterror.d.ts +7 -2
  441. package/dist/esm/models/errors/timeouterror.d.ts.map +1 -1
  442. package/dist/esm/models/errors/timeouterror.js +13 -7
  443. package/dist/esm/models/errors/timeouterror.js.map +1 -1
  444. package/dist/esm/models/errors/unauthorizederror.d.ts +7 -2
  445. package/dist/esm/models/errors/unauthorizederror.d.ts.map +1 -1
  446. package/dist/esm/models/errors/unauthorizederror.js +13 -7
  447. package/dist/esm/models/errors/unauthorizederror.js.map +1 -1
  448. package/dist/esm/sdk/publish.d.ts +1 -1
  449. package/dist/esm/sdk/publish.d.ts.map +1 -1
  450. package/dist/esm/types/constdatetime.js +1 -1
  451. package/docs/sdks/destinations/README.md +68 -95
  452. package/docs/sdks/events/README.md +50 -68
  453. package/docs/sdks/health/README.md +6 -9
  454. package/docs/sdks/publish/README.md +11 -12
  455. package/docs/sdks/schemas/README.md +32 -46
  456. package/docs/sdks/tenants/README.md +50 -75
  457. package/docs/sdks/topics/README.md +16 -24
  458. package/examples/README.md +31 -0
  459. package/examples/healthCheck.example.ts +24 -0
  460. package/examples/package-lock.json +628 -0
  461. package/examples/package.json +18 -0
  462. package/jsr.json +1 -1
  463. package/package.json +13 -8
  464. package/src/funcs/destinationsCreate.ts +23 -26
  465. package/src/funcs/destinationsDelete.ts +23 -26
  466. package/src/funcs/destinationsDisable.ts +23 -26
  467. package/src/funcs/destinationsEnable.ts +23 -26
  468. package/src/funcs/destinationsGet.ts +23 -26
  469. package/src/funcs/destinationsList.ts +23 -26
  470. package/src/funcs/destinationsUpdate.ts +23 -26
  471. package/src/funcs/eventsGet.ts +23 -26
  472. package/src/funcs/eventsGetByDestination.ts +23 -26
  473. package/src/funcs/eventsList.ts +23 -26
  474. package/src/funcs/eventsListByDestination.ts +23 -26
  475. package/src/funcs/eventsListDeliveries.ts +23 -26
  476. package/src/funcs/eventsRetry.ts +23 -26
  477. package/src/funcs/healthCheck.ts +23 -29
  478. package/src/funcs/publishEvent.ts +29 -35
  479. package/src/funcs/schemasGet.ts +23 -26
  480. package/src/funcs/schemasGetDestinationTypeJwt.ts +23 -26
  481. package/src/funcs/schemasListDestinationTypesJwt.ts +23 -29
  482. package/src/funcs/schemasListTenantDestinationTypes.ts +23 -26
  483. package/src/funcs/tenantsDelete.ts +23 -26
  484. package/src/funcs/tenantsGet.ts +23 -26
  485. package/src/funcs/tenantsGetPortalUrl.ts +23 -26
  486. package/src/funcs/tenantsGetToken.ts +23 -26
  487. package/src/funcs/tenantsUpsert.ts +24 -30
  488. package/src/funcs/topicsList.ts +23 -26
  489. package/src/funcs/topicsListJwt.ts +23 -29
  490. package/src/hooks/types.ts +2 -0
  491. package/src/index.ts +2 -0
  492. package/src/lib/config.ts +7 -3
  493. package/src/lib/files.ts +42 -0
  494. package/src/lib/matchers.ts +44 -41
  495. package/src/lib/sdks.ts +10 -4
  496. package/src/lib/security.ts +2 -2
  497. package/src/mcp-server/cli/start/command.ts +0 -13
  498. package/src/mcp-server/cli/start/impl.ts +4 -8
  499. package/src/mcp-server/mcp-server.ts +1 -1
  500. package/src/mcp-server/server.ts +1 -1
  501. package/src/mcp-server/tools/publishEvent.ts +3 -1
  502. package/src/models/components/azureservicebusconfig.ts +69 -0
  503. package/src/models/components/azureservicebuscredentials.ts +78 -0
  504. package/src/models/components/destination.ts +30 -12
  505. package/src/models/components/destinationazureservicebus.ts +187 -0
  506. package/src/models/components/destinationcreate.ts +42 -24
  507. package/src/models/components/destinationcreateazureservicebus.ts +149 -0
  508. package/src/models/components/index.ts +5 -0
  509. package/src/models/components/publishrequest.ts +20 -13
  510. package/src/models/components/publishresponse.ts +67 -0
  511. package/src/models/errors/apierror.ts +29 -16
  512. package/src/models/errors/badrequesterror.ts +16 -8
  513. package/src/models/errors/index.ts +1 -0
  514. package/src/models/errors/internalservererror.ts +16 -8
  515. package/src/models/errors/notfounderror.ts +16 -8
  516. package/src/models/errors/outposterror.ts +35 -0
  517. package/src/models/errors/ratelimitederror.ts +16 -8
  518. package/src/models/errors/responsevalidationerror.ts +50 -0
  519. package/src/models/errors/sdkvalidationerror.ts +12 -0
  520. package/src/models/errors/timeouterror.ts +16 -8
  521. package/src/models/errors/unauthorizederror.ts +16 -8
  522. package/src/sdk/publish.ts +1 -1
  523. package/src/types/constdatetime.ts +1 -1
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js";
8
+ import { OutpostError } from "./outposterror.js";
8
9
 
9
10
  /**
10
11
  * A collection of codes that generally means the end user got something wrong in making the request
@@ -18,19 +19,19 @@ export type BadRequestErrorData = {
18
19
  /**
19
20
  * A collection of codes that generally means the end user got something wrong in making the request
20
21
  */
21
- export class BadRequestError extends Error {
22
+ export class BadRequestError extends OutpostError {
22
23
  additionalProperties: { [k: string]: any } = {};
23
24
 
24
25
  /** The original data that was passed to this error instance. */
25
26
  data$: BadRequestErrorData;
26
27
 
27
- constructor(err: BadRequestErrorData) {
28
- const message = "message" in err && typeof err.message === "string"
29
- ? err.message
30
- : `API error occurred: ${JSON.stringify(err)}`;
31
- super(message);
28
+ constructor(
29
+ err: BadRequestErrorData,
30
+ httpMeta: { response: Response; request: Request; body: string },
31
+ ) {
32
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
32
34
  this.data$ = err;
33
-
34
35
  if (err.additionalProperties != null) {
35
36
  this.additionalProperties = err.additionalProperties;
36
37
  }
@@ -47,13 +48,20 @@ export const BadRequestError$inboundSchema: z.ZodType<
47
48
  > = collectExtraKeys$(
48
49
  z.object({
49
50
  message: z.string().optional(),
51
+ request$: z.instanceof(Request),
52
+ response$: z.instanceof(Response),
53
+ body$: z.string(),
50
54
  })
51
55
  .catchall(z.any()),
52
56
  "additionalProperties",
53
57
  true,
54
58
  )
55
59
  .transform((v) => {
56
- return new BadRequestError(v);
60
+ return new BadRequestError(v, {
61
+ request: v.request$,
62
+ response: v.response$,
63
+ body: v.body$,
64
+ });
57
65
  });
58
66
 
59
67
  /** @internal */
@@ -8,6 +8,7 @@ export * from "./httpclienterrors.js";
8
8
  export * from "./internalservererror.js";
9
9
  export * from "./notfounderror.js";
10
10
  export * from "./ratelimitederror.js";
11
+ export * from "./responsevalidationerror.js";
11
12
  export * from "./sdkvalidationerror.js";
12
13
  export * from "./timeouterror.js";
13
14
  export * from "./unauthorizederror.js";
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js";
8
+ import { OutpostError } from "./outposterror.js";
8
9
 
9
10
  /**
10
11
  * A collection of status codes that generally mean the server failed in an unexpected way
@@ -18,19 +19,19 @@ export type InternalServerErrorData = {
18
19
  /**
19
20
  * A collection of status codes that generally mean the server failed in an unexpected way
20
21
  */
21
- export class InternalServerError extends Error {
22
+ export class InternalServerError extends OutpostError {
22
23
  additionalProperties: { [k: string]: any } = {};
23
24
 
24
25
  /** The original data that was passed to this error instance. */
25
26
  data$: InternalServerErrorData;
26
27
 
27
- constructor(err: InternalServerErrorData) {
28
- const message = "message" in err && typeof err.message === "string"
29
- ? err.message
30
- : `API error occurred: ${JSON.stringify(err)}`;
31
- super(message);
28
+ constructor(
29
+ err: InternalServerErrorData,
30
+ httpMeta: { response: Response; request: Request; body: string },
31
+ ) {
32
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
32
34
  this.data$ = err;
33
-
34
35
  if (err.additionalProperties != null) {
35
36
  this.additionalProperties = err.additionalProperties;
36
37
  }
@@ -47,13 +48,20 @@ export const InternalServerError$inboundSchema: z.ZodType<
47
48
  > = collectExtraKeys$(
48
49
  z.object({
49
50
  message: z.string().optional(),
51
+ request$: z.instanceof(Request),
52
+ response$: z.instanceof(Response),
53
+ body$: z.string(),
50
54
  })
51
55
  .catchall(z.any()),
52
56
  "additionalProperties",
53
57
  true,
54
58
  )
55
59
  .transform((v) => {
56
- return new InternalServerError(v);
60
+ return new InternalServerError(v, {
61
+ request: v.request$,
62
+ response: v.response$,
63
+ body: v.body$,
64
+ });
57
65
  });
58
66
 
59
67
  /** @internal */
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js";
8
+ import { OutpostError } from "./outposterror.js";
8
9
 
9
10
  /**
10
11
  * Status codes relating to the resource/entity they are requesting not being found or endpoints/routes not existing
@@ -18,19 +19,19 @@ export type NotFoundErrorData = {
18
19
  /**
19
20
  * Status codes relating to the resource/entity they are requesting not being found or endpoints/routes not existing
20
21
  */
21
- export class NotFoundError extends Error {
22
+ export class NotFoundError extends OutpostError {
22
23
  additionalProperties: { [k: string]: any } = {};
23
24
 
24
25
  /** The original data that was passed to this error instance. */
25
26
  data$: NotFoundErrorData;
26
27
 
27
- constructor(err: NotFoundErrorData) {
28
- const message = "message" in err && typeof err.message === "string"
29
- ? err.message
30
- : `API error occurred: ${JSON.stringify(err)}`;
31
- super(message);
28
+ constructor(
29
+ err: NotFoundErrorData,
30
+ httpMeta: { response: Response; request: Request; body: string },
31
+ ) {
32
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
32
34
  this.data$ = err;
33
-
34
35
  if (err.additionalProperties != null) {
35
36
  this.additionalProperties = err.additionalProperties;
36
37
  }
@@ -47,13 +48,20 @@ export const NotFoundError$inboundSchema: z.ZodType<
47
48
  > = collectExtraKeys$(
48
49
  z.object({
49
50
  message: z.string().optional(),
51
+ request$: z.instanceof(Request),
52
+ response$: z.instanceof(Response),
53
+ body$: z.string(),
50
54
  })
51
55
  .catchall(z.any()),
52
56
  "additionalProperties",
53
57
  true,
54
58
  )
55
59
  .transform((v) => {
56
- return new NotFoundError(v);
60
+ return new NotFoundError(v, {
61
+ request: v.request$,
62
+ response: v.response$,
63
+ body: v.body$,
64
+ });
57
65
  });
58
66
 
59
67
  /** @internal */
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ /** The base class for all HTTP error responses */
6
+ export class OutpostError extends Error {
7
+ /** HTTP status code */
8
+ public readonly statusCode: number;
9
+ /** HTTP body */
10
+ public readonly body: string;
11
+ /** HTTP headers */
12
+ public readonly headers: Headers;
13
+ /** HTTP content type */
14
+ public readonly contentType: string;
15
+ /** Raw response */
16
+ public readonly rawResponse: Response;
17
+
18
+ constructor(
19
+ message: string,
20
+ httpMeta: {
21
+ response: Response;
22
+ request: Request;
23
+ body: string;
24
+ },
25
+ ) {
26
+ super(message);
27
+ this.statusCode = httpMeta.response.status;
28
+ this.body = httpMeta.body;
29
+ this.headers = httpMeta.response.headers;
30
+ this.contentType = httpMeta.response.headers.get("content-type") || "";
31
+ this.rawResponse = httpMeta.response;
32
+
33
+ this.name = "OutpostError";
34
+ }
35
+ }
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js";
8
+ import { OutpostError } from "./outposterror.js";
8
9
 
9
10
  /**
10
11
  * Status codes relating to the client being rate limited by the server
@@ -18,19 +19,19 @@ export type RateLimitedErrorData = {
18
19
  /**
19
20
  * Status codes relating to the client being rate limited by the server
20
21
  */
21
- export class RateLimitedError extends Error {
22
+ export class RateLimitedError extends OutpostError {
22
23
  additionalProperties: { [k: string]: any } = {};
23
24
 
24
25
  /** The original data that was passed to this error instance. */
25
26
  data$: RateLimitedErrorData;
26
27
 
27
- constructor(err: RateLimitedErrorData) {
28
- const message = "message" in err && typeof err.message === "string"
29
- ? err.message
30
- : `API error occurred: ${JSON.stringify(err)}`;
31
- super(message);
28
+ constructor(
29
+ err: RateLimitedErrorData,
30
+ httpMeta: { response: Response; request: Request; body: string },
31
+ ) {
32
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
32
34
  this.data$ = err;
33
-
34
35
  if (err.additionalProperties != null) {
35
36
  this.additionalProperties = err.additionalProperties;
36
37
  }
@@ -47,13 +48,20 @@ export const RateLimitedError$inboundSchema: z.ZodType<
47
48
  > = collectExtraKeys$(
48
49
  z.object({
49
50
  message: z.string().optional(),
51
+ request$: z.instanceof(Request),
52
+ response$: z.instanceof(Response),
53
+ body$: z.string(),
50
54
  })
51
55
  .catchall(z.any()),
52
56
  "additionalProperties",
53
57
  true,
54
58
  )
55
59
  .transform((v) => {
56
- return new RateLimitedError(v);
60
+ return new RateLimitedError(v, {
61
+ request: v.request$,
62
+ response: v.response$,
63
+ body: v.body$,
64
+ });
57
65
  });
58
66
 
59
67
  /** @internal */
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { OutpostError } from "./outposterror.js";
7
+ import { formatZodError } from "./sdkvalidationerror.js";
8
+
9
+ export class ResponseValidationError extends OutpostError {
10
+ /**
11
+ * The raw value that failed validation.
12
+ */
13
+ public readonly rawValue: unknown;
14
+
15
+ /**
16
+ * The raw message that failed validation.
17
+ */
18
+ public readonly rawMessage: unknown;
19
+
20
+ constructor(
21
+ message: string,
22
+ extra: {
23
+ response: Response;
24
+ request: Request;
25
+ body: string;
26
+ cause: unknown;
27
+ rawValue: unknown;
28
+ rawMessage: unknown;
29
+ },
30
+ ) {
31
+ super(message, extra);
32
+ this.name = "ResponseValidationError";
33
+ this.cause = extra.cause;
34
+ this.rawValue = extra.rawValue;
35
+ this.rawMessage = extra.rawMessage;
36
+ }
37
+
38
+ /**
39
+ * Return a pretty-formatted error message if the underlying validation error
40
+ * is a ZodError or some other recognized error type, otherwise return the
41
+ * default error message.
42
+ */
43
+ public pretty(): string {
44
+ if (this.cause instanceof z.ZodError) {
45
+ return `${this.rawMessage}\n${formatZodError(this.cause)}`;
46
+ } else {
47
+ return this.toString();
48
+ }
49
+ }
50
+ }
@@ -15,6 +15,18 @@ export class SDKValidationError extends Error {
15
15
  */
16
16
  public readonly rawMessage: unknown;
17
17
 
18
+ // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError`
19
+ static override [Symbol.hasInstance](
20
+ instance: unknown,
21
+ ): instance is SDKValidationError {
22
+ if (!(instance instanceof Error)) return false;
23
+ if (!("rawValue" in instance)) return false;
24
+ if (!("rawMessage" in instance)) return false;
25
+ if (!("pretty" in instance)) return false;
26
+ if (typeof instance.pretty !== "function") return false;
27
+ return true;
28
+ }
29
+
18
30
  constructor(message: string, cause: unknown, rawValue: unknown) {
19
31
  super(`${message}: ${cause}`);
20
32
  this.name = "SDKValidationError";
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js";
8
+ import { OutpostError } from "./outposterror.js";
8
9
 
9
10
  /**
10
11
  * Timeouts occurred with the request
@@ -18,19 +19,19 @@ export type TimeoutErrorData = {
18
19
  /**
19
20
  * Timeouts occurred with the request
20
21
  */
21
- export class TimeoutError extends Error {
22
+ export class TimeoutError extends OutpostError {
22
23
  additionalProperties: { [k: string]: any } = {};
23
24
 
24
25
  /** The original data that was passed to this error instance. */
25
26
  data$: TimeoutErrorData;
26
27
 
27
- constructor(err: TimeoutErrorData) {
28
- const message = "message" in err && typeof err.message === "string"
29
- ? err.message
30
- : `API error occurred: ${JSON.stringify(err)}`;
31
- super(message);
28
+ constructor(
29
+ err: TimeoutErrorData,
30
+ httpMeta: { response: Response; request: Request; body: string },
31
+ ) {
32
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
32
34
  this.data$ = err;
33
-
34
35
  if (err.additionalProperties != null) {
35
36
  this.additionalProperties = err.additionalProperties;
36
37
  }
@@ -47,13 +48,20 @@ export const TimeoutError$inboundSchema: z.ZodType<
47
48
  > = collectExtraKeys$(
48
49
  z.object({
49
50
  message: z.string().optional(),
51
+ request$: z.instanceof(Request),
52
+ response$: z.instanceof(Response),
53
+ body$: z.string(),
50
54
  })
51
55
  .catchall(z.any()),
52
56
  "additionalProperties",
53
57
  true,
54
58
  )
55
59
  .transform((v) => {
56
- return new TimeoutError(v);
60
+ return new TimeoutError(v, {
61
+ request: v.request$,
62
+ response: v.response$,
63
+ body: v.body$,
64
+ });
57
65
  });
58
66
 
59
67
  /** @internal */
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js";
8
+ import { OutpostError } from "./outposterror.js";
8
9
 
9
10
  /**
10
11
  * A collection of codes that generally means the client was not authenticated correctly for the request they want to make
@@ -18,19 +19,19 @@ export type UnauthorizedErrorData = {
18
19
  /**
19
20
  * A collection of codes that generally means the client was not authenticated correctly for the request they want to make
20
21
  */
21
- export class UnauthorizedError extends Error {
22
+ export class UnauthorizedError extends OutpostError {
22
23
  additionalProperties: { [k: string]: any } = {};
23
24
 
24
25
  /** The original data that was passed to this error instance. */
25
26
  data$: UnauthorizedErrorData;
26
27
 
27
- constructor(err: UnauthorizedErrorData) {
28
- const message = "message" in err && typeof err.message === "string"
29
- ? err.message
30
- : `API error occurred: ${JSON.stringify(err)}`;
31
- super(message);
28
+ constructor(
29
+ err: UnauthorizedErrorData,
30
+ httpMeta: { response: Response; request: Request; body: string },
31
+ ) {
32
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
32
34
  this.data$ = err;
33
-
34
35
  if (err.additionalProperties != null) {
35
36
  this.additionalProperties = err.additionalProperties;
36
37
  }
@@ -47,13 +48,20 @@ export const UnauthorizedError$inboundSchema: z.ZodType<
47
48
  > = collectExtraKeys$(
48
49
  z.object({
49
50
  message: z.string().optional(),
51
+ request$: z.instanceof(Request),
52
+ response$: z.instanceof(Response),
53
+ body$: z.string(),
50
54
  })
51
55
  .catchall(z.any()),
52
56
  "additionalProperties",
53
57
  true,
54
58
  )
55
59
  .transform((v) => {
56
- return new UnauthorizedError(v);
60
+ return new UnauthorizedError(v, {
61
+ request: v.request$,
62
+ response: v.response$,
63
+ body: v.body$,
64
+ });
57
65
  });
58
66
 
59
67
  /** @internal */
@@ -17,7 +17,7 @@ export class Publish extends ClientSDK {
17
17
  async event(
18
18
  request: components.PublishRequest,
19
19
  options?: RequestOptions,
20
- ): Promise<void> {
20
+ ): Promise<components.PublishResponse> {
21
21
  return unwrapAsync(publishEvent(
22
22
  this,
23
23
  request,
@@ -11,5 +11,5 @@ export function constDateTime(
11
11
  return (
12
12
  typeof v === "string" && new Date(v).getTime() === new Date(val).getTime()
13
13
  );
14
- }, `Value must be equivelant to ${val}`);
14
+ }, `Value must be equivalent to ${val}`);
15
15
  }