@hookdeck/outpost-sdk 0.9.1 → 0.10.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 (376) hide show
  1. package/README.md +14 -7
  2. package/bin/mcp-server.js +1065 -416
  3. package/bin/mcp-server.js.map +57 -50
  4. package/dist/commonjs/funcs/attemptsGet.js.map +1 -1
  5. package/dist/commonjs/funcs/attemptsList.d.ts +2 -0
  6. package/dist/commonjs/funcs/attemptsList.d.ts.map +1 -1
  7. package/dist/commonjs/funcs/attemptsList.js +3 -1
  8. package/dist/commonjs/funcs/attemptsList.js.map +1 -1
  9. package/dist/commonjs/funcs/destinationsCreate.js.map +1 -1
  10. package/dist/commonjs/funcs/destinationsDelete.js.map +1 -1
  11. package/dist/commonjs/funcs/destinationsDisable.js.map +1 -1
  12. package/dist/commonjs/funcs/destinationsEnable.js.map +1 -1
  13. package/dist/commonjs/funcs/destinationsGet.js.map +1 -1
  14. package/dist/commonjs/funcs/destinationsGetAttempt.js.map +1 -1
  15. package/dist/commonjs/funcs/destinationsList.js.map +1 -1
  16. package/dist/commonjs/funcs/destinationsListAttempts.js.map +1 -1
  17. package/dist/commonjs/funcs/destinationsUpdate.js.map +1 -1
  18. package/dist/commonjs/funcs/eventsGet.js.map +1 -1
  19. package/dist/commonjs/funcs/eventsList.d.ts +2 -0
  20. package/dist/commonjs/funcs/eventsList.d.ts.map +1 -1
  21. package/dist/commonjs/funcs/eventsList.js +4 -1
  22. package/dist/commonjs/funcs/eventsList.js.map +1 -1
  23. package/dist/commonjs/funcs/metricsGetAttemptMetrics.d.ts +28 -0
  24. package/dist/commonjs/funcs/metricsGetAttemptMetrics.d.ts.map +1 -0
  25. package/dist/commonjs/funcs/metricsGetAttemptMetrics.js +142 -0
  26. package/dist/commonjs/funcs/metricsGetAttemptMetrics.js.map +1 -0
  27. package/dist/commonjs/funcs/metricsGetEventMetrics.d.ts +26 -0
  28. package/dist/commonjs/funcs/metricsGetEventMetrics.d.ts.map +1 -0
  29. package/dist/commonjs/funcs/metricsGetEventMetrics.js +136 -0
  30. package/dist/commonjs/funcs/metricsGetEventMetrics.js.map +1 -0
  31. package/dist/commonjs/funcs/publishEvent.d.ts +2 -0
  32. package/dist/commonjs/funcs/publishEvent.d.ts.map +1 -1
  33. package/dist/commonjs/funcs/publishEvent.js +3 -1
  34. package/dist/commonjs/funcs/publishEvent.js.map +1 -1
  35. package/dist/commonjs/funcs/schemasGetDestinationType.js.map +1 -1
  36. package/dist/commonjs/funcs/tenantsDelete.js.map +1 -1
  37. package/dist/commonjs/funcs/tenantsGet.js.map +1 -1
  38. package/dist/commonjs/funcs/tenantsGetPortalUrl.d.ts +2 -0
  39. package/dist/commonjs/funcs/tenantsGetPortalUrl.d.ts.map +1 -1
  40. package/dist/commonjs/funcs/tenantsGetPortalUrl.js +3 -1
  41. package/dist/commonjs/funcs/tenantsGetPortalUrl.js.map +1 -1
  42. package/dist/commonjs/funcs/tenantsGetToken.d.ts +2 -0
  43. package/dist/commonjs/funcs/tenantsGetToken.d.ts.map +1 -1
  44. package/dist/commonjs/funcs/tenantsGetToken.js +3 -1
  45. package/dist/commonjs/funcs/tenantsGetToken.js.map +1 -1
  46. package/dist/commonjs/funcs/tenantsList.d.ts +2 -0
  47. package/dist/commonjs/funcs/tenantsList.d.ts.map +1 -1
  48. package/dist/commonjs/funcs/tenantsList.js +3 -1
  49. package/dist/commonjs/funcs/tenantsList.js.map +1 -1
  50. package/dist/commonjs/funcs/tenantsUpsert.js.map +1 -1
  51. package/dist/commonjs/lib/config.d.ts +3 -3
  52. package/dist/commonjs/lib/config.js +3 -3
  53. package/dist/commonjs/lib/config.js.map +1 -1
  54. package/dist/commonjs/lib/encodings.d.ts +1 -0
  55. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  56. package/dist/commonjs/lib/encodings.js +27 -5
  57. package/dist/commonjs/lib/encodings.js.map +1 -1
  58. package/dist/commonjs/lib/files.d.ts +13 -0
  59. package/dist/commonjs/lib/files.d.ts.map +1 -1
  60. package/dist/commonjs/lib/files.js +19 -0
  61. package/dist/commonjs/lib/files.js.map +1 -1
  62. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  63. package/dist/commonjs/lib/sdks.js +8 -4
  64. package/dist/commonjs/lib/sdks.js.map +1 -1
  65. package/dist/commonjs/lib/security.d.ts +1 -1
  66. package/dist/commonjs/lib/security.d.ts.map +1 -1
  67. package/dist/commonjs/lib/security.js +19 -8
  68. package/dist/commonjs/lib/security.js.map +1 -1
  69. package/dist/commonjs/lib/url.d.ts.map +1 -1
  70. package/dist/commonjs/lib/url.js +4 -2
  71. package/dist/commonjs/lib/url.js.map +1 -1
  72. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  73. package/dist/commonjs/mcp-server/mcp-server.js.map +1 -1
  74. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  75. package/dist/commonjs/mcp-server/server.js +5 -1
  76. package/dist/commonjs/mcp-server/server.js.map +1 -1
  77. package/dist/commonjs/mcp-server/tools/metricsGetAttemptMetrics.d.ts +8 -0
  78. package/dist/commonjs/mcp-server/tools/metricsGetAttemptMetrics.d.ts.map +1 -0
  79. package/dist/commonjs/mcp-server/tools/metricsGetAttemptMetrics.js +74 -0
  80. package/dist/commonjs/mcp-server/tools/metricsGetAttemptMetrics.js.map +1 -0
  81. package/dist/commonjs/mcp-server/tools/metricsGetEventMetrics.d.ts +8 -0
  82. package/dist/commonjs/mcp-server/tools/metricsGetEventMetrics.d.ts.map +1 -0
  83. package/dist/commonjs/mcp-server/tools/metricsGetEventMetrics.js +72 -0
  84. package/dist/commonjs/mcp-server/tools/metricsGetEventMetrics.js.map +1 -0
  85. package/dist/commonjs/mcp-server/tools/schemasGetDestinationType.d.ts +1 -0
  86. package/dist/commonjs/mcp-server/tools/schemasGetDestinationType.d.ts.map +1 -1
  87. package/dist/commonjs/models/components/attempt.d.ts +104 -6
  88. package/dist/commonjs/models/components/attempt.d.ts.map +1 -1
  89. package/dist/commonjs/models/components/attempt.js +106 -11
  90. package/dist/commonjs/models/components/attempt.js.map +1 -1
  91. package/dist/commonjs/models/components/destinationschemafield.d.ts +26 -0
  92. package/dist/commonjs/models/components/destinationschemafield.d.ts.map +1 -1
  93. package/dist/commonjs/models/components/destinationschemafield.js +25 -1
  94. package/dist/commonjs/models/components/destinationschemafield.js.map +1 -1
  95. package/dist/commonjs/models/components/event.d.ts +5 -2
  96. package/dist/commonjs/models/components/event.d.ts.map +1 -1
  97. package/dist/commonjs/models/components/event.js +4 -4
  98. package/dist/commonjs/models/components/event.js.map +1 -1
  99. package/dist/commonjs/models/components/index.d.ts +3 -2
  100. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  101. package/dist/commonjs/models/components/index.js +3 -2
  102. package/dist/commonjs/models/components/index.js.map +1 -1
  103. package/dist/commonjs/models/components/metricsdatapoint.d.ts +38 -0
  104. package/dist/commonjs/models/components/metricsdatapoint.d.ts.map +1 -0
  105. package/dist/commonjs/models/components/{eventsummary.js → metricsdatapoint.js} +18 -31
  106. package/dist/commonjs/models/components/metricsdatapoint.js.map +1 -0
  107. package/dist/commonjs/models/components/metricsmetadata.d.ts +40 -0
  108. package/dist/commonjs/models/components/metricsmetadata.d.ts.map +1 -0
  109. package/dist/commonjs/models/components/{eventfull.js → metricsmetadata.js} +26 -33
  110. package/dist/commonjs/models/components/metricsmetadata.js.map +1 -0
  111. package/dist/commonjs/models/components/metricsresponse.d.ts +24 -0
  112. package/dist/commonjs/models/components/metricsresponse.d.ts.map +1 -0
  113. package/dist/commonjs/models/components/metricsresponse.js +62 -0
  114. package/dist/commonjs/models/components/metricsresponse.js.map +1 -0
  115. package/dist/commonjs/models/operations/getattempt.d.ts +2 -0
  116. package/dist/commonjs/models/operations/getattempt.d.ts.map +1 -1
  117. package/dist/commonjs/models/operations/getattempt.js.map +1 -1
  118. package/dist/commonjs/models/operations/getattemptmetrics.d.ts +273 -0
  119. package/dist/commonjs/models/operations/getattemptmetrics.d.ts.map +1 -0
  120. package/dist/commonjs/models/operations/getattemptmetrics.js +326 -0
  121. package/dist/commonjs/models/operations/getattemptmetrics.js.map +1 -0
  122. package/dist/commonjs/models/operations/getdestinationtypeschema.d.ts +1 -0
  123. package/dist/commonjs/models/operations/getdestinationtypeschema.d.ts.map +1 -1
  124. package/dist/commonjs/models/operations/getdestinationtypeschema.js +1 -0
  125. package/dist/commonjs/models/operations/getdestinationtypeschema.js.map +1 -1
  126. package/dist/commonjs/models/operations/geteventmetrics.d.ts +158 -0
  127. package/dist/commonjs/models/operations/geteventmetrics.d.ts.map +1 -0
  128. package/dist/commonjs/models/operations/geteventmetrics.js +208 -0
  129. package/dist/commonjs/models/operations/geteventmetrics.js.map +1 -0
  130. package/dist/commonjs/models/operations/gettenantdestinationattempt.d.ts +2 -0
  131. package/dist/commonjs/models/operations/gettenantdestinationattempt.d.ts.map +1 -1
  132. package/dist/commonjs/models/operations/gettenantdestinationattempt.js.map +1 -1
  133. package/dist/commonjs/models/operations/index.d.ts +2 -0
  134. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  135. package/dist/commonjs/models/operations/index.js +2 -0
  136. package/dist/commonjs/models/operations/index.js.map +1 -1
  137. package/dist/commonjs/models/operations/listattempts.d.ts +8 -6
  138. package/dist/commonjs/models/operations/listattempts.d.ts.map +1 -1
  139. package/dist/commonjs/models/operations/listattempts.js +9 -9
  140. package/dist/commonjs/models/operations/listattempts.js.map +1 -1
  141. package/dist/commonjs/models/operations/listevents.d.ts +17 -0
  142. package/dist/commonjs/models/operations/listevents.d.ts.map +1 -1
  143. package/dist/commonjs/models/operations/listevents.js +17 -1
  144. package/dist/commonjs/models/operations/listevents.js.map +1 -1
  145. package/dist/commonjs/models/operations/listtenantdestinationattempts.d.ts +2 -0
  146. package/dist/commonjs/models/operations/listtenantdestinationattempts.d.ts.map +1 -1
  147. package/dist/commonjs/models/operations/listtenantdestinationattempts.js.map +1 -1
  148. package/dist/commonjs/sdk/metrics.d.ts +36 -0
  149. package/dist/commonjs/sdk/metrics.d.ts.map +1 -0
  150. package/dist/commonjs/sdk/metrics.js +48 -0
  151. package/dist/commonjs/sdk/metrics.js.map +1 -0
  152. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  153. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  154. package/dist/commonjs/sdk/sdk.js +4 -0
  155. package/dist/commonjs/sdk/sdk.js.map +1 -1
  156. package/dist/esm/funcs/attemptsGet.js.map +1 -1
  157. package/dist/esm/funcs/attemptsList.d.ts +2 -0
  158. package/dist/esm/funcs/attemptsList.d.ts.map +1 -1
  159. package/dist/esm/funcs/attemptsList.js +3 -1
  160. package/dist/esm/funcs/attemptsList.js.map +1 -1
  161. package/dist/esm/funcs/destinationsCreate.js.map +1 -1
  162. package/dist/esm/funcs/destinationsDelete.js.map +1 -1
  163. package/dist/esm/funcs/destinationsDisable.js.map +1 -1
  164. package/dist/esm/funcs/destinationsEnable.js.map +1 -1
  165. package/dist/esm/funcs/destinationsGet.js.map +1 -1
  166. package/dist/esm/funcs/destinationsGetAttempt.js.map +1 -1
  167. package/dist/esm/funcs/destinationsList.js.map +1 -1
  168. package/dist/esm/funcs/destinationsListAttempts.js.map +1 -1
  169. package/dist/esm/funcs/destinationsUpdate.js.map +1 -1
  170. package/dist/esm/funcs/eventsGet.js.map +1 -1
  171. package/dist/esm/funcs/eventsList.d.ts +2 -0
  172. package/dist/esm/funcs/eventsList.d.ts.map +1 -1
  173. package/dist/esm/funcs/eventsList.js +4 -1
  174. package/dist/esm/funcs/eventsList.js.map +1 -1
  175. package/dist/esm/funcs/metricsGetAttemptMetrics.d.ts +28 -0
  176. package/dist/esm/funcs/metricsGetAttemptMetrics.d.ts.map +1 -0
  177. package/dist/esm/funcs/metricsGetAttemptMetrics.js +106 -0
  178. package/dist/esm/funcs/metricsGetAttemptMetrics.js.map +1 -0
  179. package/dist/esm/funcs/metricsGetEventMetrics.d.ts +26 -0
  180. package/dist/esm/funcs/metricsGetEventMetrics.d.ts.map +1 -0
  181. package/dist/esm/funcs/metricsGetEventMetrics.js +100 -0
  182. package/dist/esm/funcs/metricsGetEventMetrics.js.map +1 -0
  183. package/dist/esm/funcs/publishEvent.d.ts +2 -0
  184. package/dist/esm/funcs/publishEvent.d.ts.map +1 -1
  185. package/dist/esm/funcs/publishEvent.js +3 -1
  186. package/dist/esm/funcs/publishEvent.js.map +1 -1
  187. package/dist/esm/funcs/schemasGetDestinationType.js.map +1 -1
  188. package/dist/esm/funcs/tenantsDelete.js.map +1 -1
  189. package/dist/esm/funcs/tenantsGet.js.map +1 -1
  190. package/dist/esm/funcs/tenantsGetPortalUrl.d.ts +2 -0
  191. package/dist/esm/funcs/tenantsGetPortalUrl.d.ts.map +1 -1
  192. package/dist/esm/funcs/tenantsGetPortalUrl.js +3 -1
  193. package/dist/esm/funcs/tenantsGetPortalUrl.js.map +1 -1
  194. package/dist/esm/funcs/tenantsGetToken.d.ts +2 -0
  195. package/dist/esm/funcs/tenantsGetToken.d.ts.map +1 -1
  196. package/dist/esm/funcs/tenantsGetToken.js +3 -1
  197. package/dist/esm/funcs/tenantsGetToken.js.map +1 -1
  198. package/dist/esm/funcs/tenantsList.d.ts +2 -0
  199. package/dist/esm/funcs/tenantsList.d.ts.map +1 -1
  200. package/dist/esm/funcs/tenantsList.js +3 -1
  201. package/dist/esm/funcs/tenantsList.js.map +1 -1
  202. package/dist/esm/funcs/tenantsUpsert.js.map +1 -1
  203. package/dist/esm/lib/config.d.ts +3 -3
  204. package/dist/esm/lib/config.js +3 -3
  205. package/dist/esm/lib/config.js.map +1 -1
  206. package/dist/esm/lib/encodings.d.ts +1 -0
  207. package/dist/esm/lib/encodings.d.ts.map +1 -1
  208. package/dist/esm/lib/encodings.js +26 -5
  209. package/dist/esm/lib/encodings.js.map +1 -1
  210. package/dist/esm/lib/files.d.ts +13 -0
  211. package/dist/esm/lib/files.d.ts.map +1 -1
  212. package/dist/esm/lib/files.js +18 -0
  213. package/dist/esm/lib/files.js.map +1 -1
  214. package/dist/esm/lib/sdks.d.ts.map +1 -1
  215. package/dist/esm/lib/sdks.js +8 -4
  216. package/dist/esm/lib/sdks.js.map +1 -1
  217. package/dist/esm/lib/security.d.ts +1 -1
  218. package/dist/esm/lib/security.d.ts.map +1 -1
  219. package/dist/esm/lib/security.js +19 -8
  220. package/dist/esm/lib/security.js.map +1 -1
  221. package/dist/esm/lib/url.d.ts.map +1 -1
  222. package/dist/esm/lib/url.js +4 -2
  223. package/dist/esm/lib/url.js.map +1 -1
  224. package/dist/esm/mcp-server/mcp-server.js +1 -1
  225. package/dist/esm/mcp-server/mcp-server.js.map +1 -1
  226. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  227. package/dist/esm/mcp-server/server.js +5 -1
  228. package/dist/esm/mcp-server/server.js.map +1 -1
  229. package/dist/esm/mcp-server/tools/metricsGetAttemptMetrics.d.ts +8 -0
  230. package/dist/esm/mcp-server/tools/metricsGetAttemptMetrics.d.ts.map +1 -0
  231. package/dist/esm/mcp-server/tools/metricsGetAttemptMetrics.js +38 -0
  232. package/dist/esm/mcp-server/tools/metricsGetAttemptMetrics.js.map +1 -0
  233. package/dist/esm/mcp-server/tools/metricsGetEventMetrics.d.ts +8 -0
  234. package/dist/esm/mcp-server/tools/metricsGetEventMetrics.d.ts.map +1 -0
  235. package/dist/esm/mcp-server/tools/metricsGetEventMetrics.js +36 -0
  236. package/dist/esm/mcp-server/tools/metricsGetEventMetrics.js.map +1 -0
  237. package/dist/esm/mcp-server/tools/schemasGetDestinationType.d.ts +1 -0
  238. package/dist/esm/mcp-server/tools/schemasGetDestinationType.d.ts.map +1 -1
  239. package/dist/esm/models/components/attempt.d.ts +104 -6
  240. package/dist/esm/models/components/attempt.d.ts.map +1 -1
  241. package/dist/esm/models/components/attempt.js +101 -10
  242. package/dist/esm/models/components/attempt.js.map +1 -1
  243. package/dist/esm/models/components/destinationschemafield.d.ts +26 -0
  244. package/dist/esm/models/components/destinationschemafield.d.ts.map +1 -1
  245. package/dist/esm/models/components/destinationschemafield.js +22 -0
  246. package/dist/esm/models/components/destinationschemafield.js.map +1 -1
  247. package/dist/esm/models/components/event.d.ts +5 -2
  248. package/dist/esm/models/components/event.d.ts.map +1 -1
  249. package/dist/esm/models/components/event.js +4 -4
  250. package/dist/esm/models/components/event.js.map +1 -1
  251. package/dist/esm/models/components/index.d.ts +3 -2
  252. package/dist/esm/models/components/index.d.ts.map +1 -1
  253. package/dist/esm/models/components/index.js +3 -2
  254. package/dist/esm/models/components/index.js.map +1 -1
  255. package/dist/esm/models/components/metricsdatapoint.d.ts +38 -0
  256. package/dist/esm/models/components/metricsdatapoint.d.ts.map +1 -0
  257. package/dist/esm/models/components/metricsdatapoint.js +33 -0
  258. package/dist/esm/models/components/metricsdatapoint.js.map +1 -0
  259. package/dist/esm/models/components/metricsmetadata.d.ts +40 -0
  260. package/dist/esm/models/components/metricsmetadata.d.ts.map +1 -0
  261. package/dist/esm/models/components/metricsmetadata.js +41 -0
  262. package/dist/esm/models/components/metricsmetadata.js.map +1 -0
  263. package/dist/esm/models/components/metricsresponse.d.ts +24 -0
  264. package/dist/esm/models/components/metricsresponse.d.ts.map +1 -0
  265. package/dist/esm/models/components/metricsresponse.js +24 -0
  266. package/dist/esm/models/components/metricsresponse.js.map +1 -0
  267. package/dist/esm/models/operations/getattempt.d.ts +2 -0
  268. package/dist/esm/models/operations/getattempt.d.ts.map +1 -1
  269. package/dist/esm/models/operations/getattempt.js.map +1 -1
  270. package/dist/esm/models/operations/getattemptmetrics.d.ts +273 -0
  271. package/dist/esm/models/operations/getattemptmetrics.d.ts.map +1 -0
  272. package/dist/esm/models/operations/getattemptmetrics.js +272 -0
  273. package/dist/esm/models/operations/getattemptmetrics.js.map +1 -0
  274. package/dist/esm/models/operations/getdestinationtypeschema.d.ts +1 -0
  275. package/dist/esm/models/operations/getdestinationtypeschema.d.ts.map +1 -1
  276. package/dist/esm/models/operations/getdestinationtypeschema.js +1 -0
  277. package/dist/esm/models/operations/getdestinationtypeschema.js.map +1 -1
  278. package/dist/esm/models/operations/geteventmetrics.d.ts +158 -0
  279. package/dist/esm/models/operations/geteventmetrics.d.ts.map +1 -0
  280. package/dist/esm/models/operations/geteventmetrics.js +160 -0
  281. package/dist/esm/models/operations/geteventmetrics.js.map +1 -0
  282. package/dist/esm/models/operations/gettenantdestinationattempt.d.ts +2 -0
  283. package/dist/esm/models/operations/gettenantdestinationattempt.d.ts.map +1 -1
  284. package/dist/esm/models/operations/gettenantdestinationattempt.js.map +1 -1
  285. package/dist/esm/models/operations/index.d.ts +2 -0
  286. package/dist/esm/models/operations/index.d.ts.map +1 -1
  287. package/dist/esm/models/operations/index.js +2 -0
  288. package/dist/esm/models/operations/index.js.map +1 -1
  289. package/dist/esm/models/operations/listattempts.d.ts +8 -6
  290. package/dist/esm/models/operations/listattempts.d.ts.map +1 -1
  291. package/dist/esm/models/operations/listattempts.js +6 -6
  292. package/dist/esm/models/operations/listattempts.js.map +1 -1
  293. package/dist/esm/models/operations/listevents.d.ts +17 -0
  294. package/dist/esm/models/operations/listevents.d.ts.map +1 -1
  295. package/dist/esm/models/operations/listevents.js +14 -0
  296. package/dist/esm/models/operations/listevents.js.map +1 -1
  297. package/dist/esm/models/operations/listtenantdestinationattempts.d.ts +2 -0
  298. package/dist/esm/models/operations/listtenantdestinationattempts.d.ts.map +1 -1
  299. package/dist/esm/models/operations/listtenantdestinationattempts.js.map +1 -1
  300. package/dist/esm/sdk/metrics.d.ts +36 -0
  301. package/dist/esm/sdk/metrics.d.ts.map +1 -0
  302. package/dist/esm/sdk/metrics.js +44 -0
  303. package/dist/esm/sdk/metrics.js.map +1 -0
  304. package/dist/esm/sdk/sdk.d.ts +3 -0
  305. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  306. package/dist/esm/sdk/sdk.js +4 -0
  307. package/dist/esm/sdk/sdk.js.map +1 -1
  308. package/jsr.json +1 -1
  309. package/package.json +1 -1
  310. package/src/funcs/attemptsGet.ts +0 -1
  311. package/src/funcs/attemptsList.ts +3 -1
  312. package/src/funcs/destinationsCreate.ts +0 -1
  313. package/src/funcs/destinationsDelete.ts +0 -1
  314. package/src/funcs/destinationsDisable.ts +0 -1
  315. package/src/funcs/destinationsEnable.ts +0 -1
  316. package/src/funcs/destinationsGet.ts +0 -1
  317. package/src/funcs/destinationsGetAttempt.ts +0 -1
  318. package/src/funcs/destinationsList.ts +0 -1
  319. package/src/funcs/destinationsListAttempts.ts +0 -1
  320. package/src/funcs/destinationsUpdate.ts +0 -1
  321. package/src/funcs/eventsGet.ts +0 -1
  322. package/src/funcs/eventsList.ts +4 -1
  323. package/src/funcs/metricsGetAttemptMetrics.ts +206 -0
  324. package/src/funcs/metricsGetEventMetrics.ts +200 -0
  325. package/src/funcs/publishEvent.ts +3 -1
  326. package/src/funcs/schemasGetDestinationType.ts +0 -1
  327. package/src/funcs/tenantsDelete.ts +0 -1
  328. package/src/funcs/tenantsGet.ts +0 -1
  329. package/src/funcs/tenantsGetPortalUrl.ts +3 -2
  330. package/src/funcs/tenantsGetToken.ts +3 -2
  331. package/src/funcs/tenantsList.ts +3 -1
  332. package/src/funcs/tenantsUpsert.ts +0 -1
  333. package/src/lib/config.ts +3 -3
  334. package/src/lib/encodings.ts +32 -4
  335. package/src/lib/files.ts +22 -0
  336. package/src/lib/sdks.ts +7 -5
  337. package/src/lib/security.ts +14 -2
  338. package/src/lib/url.ts +16 -14
  339. package/src/mcp-server/mcp-server.ts +1 -1
  340. package/src/mcp-server/server.ts +5 -1
  341. package/src/mcp-server/tools/metricsGetAttemptMetrics.ts +47 -0
  342. package/src/mcp-server/tools/metricsGetEventMetrics.ts +45 -0
  343. package/src/models/components/attempt.ts +224 -23
  344. package/src/models/components/destinationschemafield.ts +55 -0
  345. package/src/models/components/event.ts +9 -6
  346. package/src/models/components/index.ts +3 -2
  347. package/src/models/components/metricsdatapoint.ts +79 -0
  348. package/src/models/components/metricsmetadata.ts +93 -0
  349. package/src/models/components/metricsresponse.ts +68 -0
  350. package/src/models/operations/getattempt.ts +2 -0
  351. package/src/models/operations/getattemptmetrics.ts +668 -0
  352. package/src/models/operations/getdestinationtypeschema.ts +1 -0
  353. package/src/models/operations/geteventmetrics.ts +434 -0
  354. package/src/models/operations/gettenantdestinationattempt.ts +2 -0
  355. package/src/models/operations/index.ts +2 -0
  356. package/src/models/operations/listattempts.ts +19 -13
  357. package/src/models/operations/listevents.ts +47 -0
  358. package/src/models/operations/listtenantdestinationattempts.ts +2 -0
  359. package/src/sdk/metrics.ts +62 -0
  360. package/src/sdk/sdk.ts +6 -0
  361. package/dist/commonjs/models/components/eventfull.d.ts +0 -57
  362. package/dist/commonjs/models/components/eventfull.d.ts.map +0 -1
  363. package/dist/commonjs/models/components/eventfull.js.map +0 -1
  364. package/dist/commonjs/models/components/eventsummary.d.ts +0 -48
  365. package/dist/commonjs/models/components/eventsummary.d.ts.map +0 -1
  366. package/dist/commonjs/models/components/eventsummary.js.map +0 -1
  367. package/dist/esm/models/components/eventfull.d.ts +0 -57
  368. package/dist/esm/models/components/eventfull.d.ts.map +0 -1
  369. package/dist/esm/models/components/eventfull.js +0 -48
  370. package/dist/esm/models/components/eventfull.js.map +0 -1
  371. package/dist/esm/models/components/eventsummary.d.ts +0 -48
  372. package/dist/esm/models/components/eventsummary.d.ts.map +0 -1
  373. package/dist/esm/models/components/eventsummary.js +0 -46
  374. package/dist/esm/models/components/eventsummary.js.map +0 -1
  375. package/src/models/components/eventfull.ts +0 -107
  376. package/src/models/components/eventsummary.ts +0 -100
@@ -0,0 +1,206 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OutpostCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { OutpostError } from "../models/errors/outposterror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get Attempt Metrics
31
+ *
32
+ * @remarks
33
+ * Returns aggregated delivery attempt metrics. Supports time bucketing via granularity,
34
+ * dimensional grouping, and filtering.
35
+ *
36
+ * **Measures:** `count`, `successful_count`, `failed_count`, `error_rate`,
37
+ * `first_attempt_count`, `retry_count`, `manual_retry_count`, `avg_attempt_number`,
38
+ * `rate`, `successful_rate`, `failed_rate`
39
+ *
40
+ * **Dimensions:** `tenant_id` (admin-only), `destination_id`, `topic`, `status`, `code`, `manual`, `attempt_number`
41
+ *
42
+ * **Filters:** `tenant_id` (admin-only), `destination_id`, `topic`, `status`, `code`, `manual`, `attempt_number`
43
+ */
44
+ export function metricsGetAttemptMetrics(
45
+ client: OutpostCore,
46
+ request: operations.GetAttemptMetricsRequest,
47
+ options?: RequestOptions,
48
+ ): APIPromise<
49
+ Result<
50
+ components.MetricsResponse,
51
+ | errors.BadRequestError
52
+ | errors.UnauthorizedError
53
+ | errors.APIErrorResponse
54
+ | errors.InternalServerError
55
+ | OutpostError
56
+ | ResponseValidationError
57
+ | ConnectionError
58
+ | RequestAbortedError
59
+ | RequestTimeoutError
60
+ | InvalidRequestError
61
+ | UnexpectedClientError
62
+ | SDKValidationError
63
+ >
64
+ > {
65
+ return new APIPromise($do(
66
+ client,
67
+ request,
68
+ options,
69
+ ));
70
+ }
71
+
72
+ async function $do(
73
+ client: OutpostCore,
74
+ request: operations.GetAttemptMetricsRequest,
75
+ options?: RequestOptions,
76
+ ): Promise<
77
+ [
78
+ Result<
79
+ components.MetricsResponse,
80
+ | errors.BadRequestError
81
+ | errors.UnauthorizedError
82
+ | errors.APIErrorResponse
83
+ | errors.InternalServerError
84
+ | OutpostError
85
+ | ResponseValidationError
86
+ | ConnectionError
87
+ | RequestAbortedError
88
+ | RequestTimeoutError
89
+ | InvalidRequestError
90
+ | UnexpectedClientError
91
+ | SDKValidationError
92
+ >,
93
+ APICall,
94
+ ]
95
+ > {
96
+ const parsed = safeParse(
97
+ request,
98
+ (value) => operations.GetAttemptMetricsRequest$outboundSchema.parse(value),
99
+ "Input validation failed",
100
+ );
101
+ if (!parsed.ok) {
102
+ return [parsed, { status: "invalid" }];
103
+ }
104
+ const payload = parsed.value;
105
+ const body = null;
106
+
107
+ const path = pathToFunc("/metrics/attempts")();
108
+
109
+ const query = encodeFormQuery({
110
+ "dimensions": payload.dimensions,
111
+ "filters[attempt_number]": payload["filters[attempt_number]"],
112
+ "filters[code]": payload["filters[code]"],
113
+ "filters[destination_id]": payload["filters[destination_id]"],
114
+ "filters[manual]": payload["filters[manual]"],
115
+ "filters[status]": payload["filters[status]"],
116
+ "filters[tenant_id]": payload["filters[tenant_id]"],
117
+ "filters[topic]": payload["filters[topic]"],
118
+ "granularity": payload.granularity,
119
+ "measures": payload.measures,
120
+ "time[end]": payload["time[end]"],
121
+ "time[start]": payload["time[start]"],
122
+ });
123
+
124
+ const headers = new Headers(compactMap({
125
+ Accept: "application/json",
126
+ }));
127
+
128
+ const secConfig = await extractSecurity(client._options.apiKey);
129
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
130
+ const requestSecurity = resolveGlobalSecurity(securityInput);
131
+
132
+ const context = {
133
+ options: client._options,
134
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
135
+ operationID: "getAttemptMetrics",
136
+ oAuth2Scopes: null,
137
+
138
+ resolvedSecurity: requestSecurity,
139
+
140
+ securitySource: client._options.apiKey,
141
+ retryConfig: options?.retries
142
+ || client._options.retryConfig
143
+ || { strategy: "none" },
144
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
145
+ };
146
+
147
+ const requestRes = client._createRequest(context, {
148
+ security: requestSecurity,
149
+ method: "GET",
150
+ baseURL: options?.serverURL,
151
+ path: path,
152
+ headers: headers,
153
+ query: query,
154
+ body: body,
155
+ userAgent: client._options.userAgent,
156
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
157
+ }, options);
158
+ if (!requestRes.ok) {
159
+ return [requestRes, { status: "invalid" }];
160
+ }
161
+ const req = requestRes.value;
162
+
163
+ const doResult = await client._do(req, {
164
+ context,
165
+ errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
166
+ retryConfig: context.retryConfig,
167
+ retryCodes: context.retryCodes,
168
+ });
169
+ if (!doResult.ok) {
170
+ return [doResult, { status: "request-error", request: req }];
171
+ }
172
+ const response = doResult.value;
173
+
174
+ const responseFields = {
175
+ HttpMeta: { Response: response, Request: req },
176
+ };
177
+
178
+ const [result] = await M.match<
179
+ components.MetricsResponse,
180
+ | errors.BadRequestError
181
+ | errors.UnauthorizedError
182
+ | errors.APIErrorResponse
183
+ | errors.InternalServerError
184
+ | OutpostError
185
+ | ResponseValidationError
186
+ | ConnectionError
187
+ | RequestAbortedError
188
+ | RequestTimeoutError
189
+ | InvalidRequestError
190
+ | UnexpectedClientError
191
+ | SDKValidationError
192
+ >(
193
+ M.json(200, components.MetricsResponse$inboundSchema),
194
+ M.jsonErr(400, errors.BadRequestError$inboundSchema),
195
+ M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
196
+ M.jsonErr(403, errors.APIErrorResponse$inboundSchema),
197
+ M.jsonErr(500, errors.InternalServerError$inboundSchema),
198
+ M.fail("4XX"),
199
+ M.fail("5XX"),
200
+ )(response, req, { extraFields: responseFields });
201
+ if (!result.ok) {
202
+ return [result, { status: "complete", request: req, response }];
203
+ }
204
+
205
+ return [result, { status: "complete", request: req, response }];
206
+ }
@@ -0,0 +1,200 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OutpostCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { OutpostError } from "../models/errors/outposterror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get Event Metrics
31
+ *
32
+ * @remarks
33
+ * Returns aggregated event publish metrics. Supports time bucketing via granularity,
34
+ * dimensional grouping, and filtering.
35
+ *
36
+ * **Measures:** `count`, `rate`
37
+ *
38
+ * **Dimensions:** `tenant_id` (admin-only), `topic`, `destination_id`
39
+ *
40
+ * **Filters:** `tenant_id` (admin-only), `topic`, `destination_id`
41
+ */
42
+ export function metricsGetEventMetrics(
43
+ client: OutpostCore,
44
+ request: operations.GetEventMetricsRequest,
45
+ options?: RequestOptions,
46
+ ): APIPromise<
47
+ Result<
48
+ components.MetricsResponse,
49
+ | errors.BadRequestError
50
+ | errors.UnauthorizedError
51
+ | errors.APIErrorResponse
52
+ | errors.InternalServerError
53
+ | OutpostError
54
+ | ResponseValidationError
55
+ | ConnectionError
56
+ | RequestAbortedError
57
+ | RequestTimeoutError
58
+ | InvalidRequestError
59
+ | UnexpectedClientError
60
+ | SDKValidationError
61
+ >
62
+ > {
63
+ return new APIPromise($do(
64
+ client,
65
+ request,
66
+ options,
67
+ ));
68
+ }
69
+
70
+ async function $do(
71
+ client: OutpostCore,
72
+ request: operations.GetEventMetricsRequest,
73
+ options?: RequestOptions,
74
+ ): Promise<
75
+ [
76
+ Result<
77
+ components.MetricsResponse,
78
+ | errors.BadRequestError
79
+ | errors.UnauthorizedError
80
+ | errors.APIErrorResponse
81
+ | errors.InternalServerError
82
+ | OutpostError
83
+ | ResponseValidationError
84
+ | ConnectionError
85
+ | RequestAbortedError
86
+ | RequestTimeoutError
87
+ | InvalidRequestError
88
+ | UnexpectedClientError
89
+ | SDKValidationError
90
+ >,
91
+ APICall,
92
+ ]
93
+ > {
94
+ const parsed = safeParse(
95
+ request,
96
+ (value) => operations.GetEventMetricsRequest$outboundSchema.parse(value),
97
+ "Input validation failed",
98
+ );
99
+ if (!parsed.ok) {
100
+ return [parsed, { status: "invalid" }];
101
+ }
102
+ const payload = parsed.value;
103
+ const body = null;
104
+
105
+ const path = pathToFunc("/metrics/events")();
106
+
107
+ const query = encodeFormQuery({
108
+ "dimensions": payload.dimensions,
109
+ "filters[destination_id]": payload["filters[destination_id]"],
110
+ "filters[tenant_id]": payload["filters[tenant_id]"],
111
+ "filters[topic]": payload["filters[topic]"],
112
+ "granularity": payload.granularity,
113
+ "measures": payload.measures,
114
+ "time[end]": payload["time[end]"],
115
+ "time[start]": payload["time[start]"],
116
+ });
117
+
118
+ const headers = new Headers(compactMap({
119
+ Accept: "application/json",
120
+ }));
121
+
122
+ const secConfig = await extractSecurity(client._options.apiKey);
123
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
124
+ const requestSecurity = resolveGlobalSecurity(securityInput);
125
+
126
+ const context = {
127
+ options: client._options,
128
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
129
+ operationID: "getEventMetrics",
130
+ oAuth2Scopes: null,
131
+
132
+ resolvedSecurity: requestSecurity,
133
+
134
+ securitySource: client._options.apiKey,
135
+ retryConfig: options?.retries
136
+ || client._options.retryConfig
137
+ || { strategy: "none" },
138
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
139
+ };
140
+
141
+ const requestRes = client._createRequest(context, {
142
+ security: requestSecurity,
143
+ method: "GET",
144
+ baseURL: options?.serverURL,
145
+ path: path,
146
+ headers: headers,
147
+ query: query,
148
+ body: body,
149
+ userAgent: client._options.userAgent,
150
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
151
+ }, options);
152
+ if (!requestRes.ok) {
153
+ return [requestRes, { status: "invalid" }];
154
+ }
155
+ const req = requestRes.value;
156
+
157
+ const doResult = await client._do(req, {
158
+ context,
159
+ errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
160
+ retryConfig: context.retryConfig,
161
+ retryCodes: context.retryCodes,
162
+ });
163
+ if (!doResult.ok) {
164
+ return [doResult, { status: "request-error", request: req }];
165
+ }
166
+ const response = doResult.value;
167
+
168
+ const responseFields = {
169
+ HttpMeta: { Response: response, Request: req },
170
+ };
171
+
172
+ const [result] = await M.match<
173
+ components.MetricsResponse,
174
+ | errors.BadRequestError
175
+ | errors.UnauthorizedError
176
+ | errors.APIErrorResponse
177
+ | errors.InternalServerError
178
+ | OutpostError
179
+ | ResponseValidationError
180
+ | ConnectionError
181
+ | RequestAbortedError
182
+ | RequestTimeoutError
183
+ | InvalidRequestError
184
+ | UnexpectedClientError
185
+ | SDKValidationError
186
+ >(
187
+ M.json(200, components.MetricsResponse$inboundSchema),
188
+ M.jsonErr(400, errors.BadRequestError$inboundSchema),
189
+ M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
190
+ M.jsonErr(403, errors.APIErrorResponse$inboundSchema),
191
+ M.jsonErr(500, errors.InternalServerError$inboundSchema),
192
+ M.fail("4XX"),
193
+ M.fail("5XX"),
194
+ )(response, req, { extraFields: responseFields });
195
+ if (!result.ok) {
196
+ return [result, { status: "complete", request: req, response }];
197
+ }
198
+
199
+ return [result, { status: "complete", request: req, response }];
200
+ }
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
30
30
  *
31
31
  * @remarks
32
32
  * Publishes an event to the specified topic, potentially routed to a specific destination. Requires Admin API Key.
33
+ *
34
+ * If set, this operation will use {@link Security.apiKey} from the global security.
33
35
  */
34
36
  export function publishEvent(
35
37
  client: OutpostCore,
@@ -107,7 +109,7 @@ async function $do(
107
109
 
108
110
  const secConfig = await extractSecurity(client._options.apiKey);
109
111
  const securityInput = secConfig == null ? {} : { apiKey: secConfig };
110
- const requestSecurity = resolveGlobalSecurity(securityInput);
112
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
111
113
 
112
114
  const context = {
113
115
  options: client._options,
@@ -110,7 +110,6 @@ async function $do(
110
110
  charEncoding: "percent",
111
111
  }),
112
112
  };
113
-
114
113
  const path = pathToFunc("/destination-types/{type}")(pathParams);
115
114
 
116
115
  const headers = new Headers(compactMap({
@@ -103,7 +103,6 @@ async function $do(
103
103
  charEncoding: "percent",
104
104
  }),
105
105
  };
106
-
107
106
  const path = pathToFunc("/tenants/{tenant_id}")(pathParams);
108
107
 
109
108
  const headers = new Headers(compactMap({
@@ -103,7 +103,6 @@ async function $do(
103
103
  charEncoding: "percent",
104
104
  }),
105
105
  };
106
-
107
106
  const path = pathToFunc("/tenants/{tenant_id}")(pathParams);
108
107
 
109
108
  const headers = new Headers(compactMap({
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
31
31
  *
32
32
  * @remarks
33
33
  * Returns a redirect URL containing a JWT to authenticate the user with the portal. Requires Admin API Key.
34
+ *
35
+ * If set, this operation will use {@link Security.apiKey} from the global security.
34
36
  */
35
37
  export function tenantsGetPortalUrl(
36
38
  client: OutpostCore,
@@ -107,7 +109,6 @@ async function $do(
107
109
  charEncoding: "percent",
108
110
  }),
109
111
  };
110
-
111
112
  const path = pathToFunc("/tenants/{tenant_id}/portal")(pathParams);
112
113
 
113
114
  const query = encodeFormQuery({
@@ -120,7 +121,7 @@ async function $do(
120
121
 
121
122
  const secConfig = await extractSecurity(client._options.apiKey);
122
123
  const securityInput = secConfig == null ? {} : { apiKey: secConfig };
123
- const requestSecurity = resolveGlobalSecurity(securityInput);
124
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
124
125
 
125
126
  const context = {
126
127
  options: client._options,
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
31
31
  *
32
32
  * @remarks
33
33
  * Returns a JWT token scoped to the tenant for safe browser API calls. Requires Admin API Key.
34
+ *
35
+ * If set, this operation will use {@link Security.apiKey} from the global security.
34
36
  */
35
37
  export function tenantsGetToken(
36
38
  client: OutpostCore,
@@ -103,7 +105,6 @@ async function $do(
103
105
  charEncoding: "percent",
104
106
  }),
105
107
  };
106
-
107
108
  const path = pathToFunc("/tenants/{tenant_id}/token")(pathParams);
108
109
 
109
110
  const headers = new Headers(compactMap({
@@ -112,7 +113,7 @@ async function $do(
112
113
 
113
114
  const secConfig = await extractSecurity(client._options.apiKey);
114
115
  const securityInput = secConfig == null ? {} : { apiKey: secConfig };
115
- const requestSecurity = resolveGlobalSecurity(securityInput);
116
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
116
117
 
117
118
  const context = {
118
119
  options: client._options,
@@ -42,6 +42,8 @@ import {
42
42
  * If RediSearch is not available, this endpoint returns `501 Not Implemented`.
43
43
  *
44
44
  * When authenticated with a Tenant JWT, returns only the authenticated tenant. Pagination is not used in this case.
45
+ *
46
+ * If set, this operation will use {@link Security.apiKey} from the global security.
45
47
  */
46
48
  export function tenantsList(
47
49
  client: OutpostCore,
@@ -128,7 +130,7 @@ async function $do(
128
130
 
129
131
  const secConfig = await extractSecurity(client._options.apiKey);
130
132
  const securityInput = secConfig == null ? {} : { apiKey: secConfig };
131
- const requestSecurity = resolveGlobalSecurity(securityInput);
133
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
132
134
 
133
135
  const context = {
134
136
  options: client._options,
@@ -107,7 +107,6 @@ async function $do(
107
107
  charEncoding: "percent",
108
108
  }),
109
109
  };
110
-
111
110
  const path = pathToFunc("/tenants/{tenant_id}")(pathParams);
112
111
 
113
112
  const headers = new Headers(compactMap({
package/src/lib/config.ts CHANGED
@@ -65,8 +65,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "0.0.1",
68
- sdkVersion: "0.9.1",
69
- genVersion: "2.865.2",
68
+ sdkVersion: "0.10.0",
69
+ genVersion: "2.879.11",
70
70
  userAgent:
71
- "speakeasy-sdk/typescript 0.9.1 2.865.2 0.0.1 @hookdeck/outpost-sdk",
71
+ "speakeasy-sdk/typescript 0.10.0 2.879.11 0.0.1 @hookdeck/outpost-sdk",
72
72
  } as const;
@@ -479,6 +479,23 @@ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
479
479
  export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
480
480
  export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
481
481
 
482
+ function isBlobLike(val: unknown): val is Blob {
483
+ if (val instanceof Blob) {
484
+ return true;
485
+ }
486
+
487
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
488
+ return false;
489
+ }
490
+
491
+ const tag = val[Symbol.toStringTag];
492
+ if (tag !== "Blob" && tag !== "File") {
493
+ return false;
494
+ }
495
+
496
+ return "stream" in val && typeof val.stream === "function";
497
+ }
498
+
482
499
  export function appendForm(
483
500
  fd: FormData,
484
501
  key: string,
@@ -487,11 +504,22 @@ export function appendForm(
487
504
  ): void {
488
505
  if (value == null) {
489
506
  return;
490
- } else if (value instanceof Blob && fileName) {
491
- fd.append(key, value, fileName);
492
- } else if (value instanceof Blob) {
493
- fd.append(key, value);
507
+ } else if (isBlobLike(value)) {
508
+ if (fileName) {
509
+ fd.append(key, value as Blob, fileName);
510
+ } else {
511
+ fd.append(key, value as Blob);
512
+ }
494
513
  } else {
495
514
  fd.append(key, String(value));
496
515
  }
497
516
  }
517
+
518
+ export async function normalizeBlob(
519
+ value: Pick<Blob, "arrayBuffer" | "type">,
520
+ ): Promise<Blob> {
521
+ if (value instanceof Blob) {
522
+ return value;
523
+ }
524
+ return new Blob([await value.arrayBuffer()], { type: value.type });
525
+ }
package/src/lib/files.ts CHANGED
@@ -80,3 +80,25 @@ export function getContentTypeFromFileName(fileName: string): string | null {
80
80
 
81
81
  return mimeTypes[ext] || null;
82
82
  }
83
+
84
+ /**
85
+ * Creates a Blob from file content with the given MIME type.
86
+ *
87
+ * Node.js Buffers are Uint8Array subclasses that may share a pooled
88
+ * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing
89
+ * such a Buffer directly to `new Blob([buf])` can include the entire
90
+ * underlying pool on some runtimes, producing a Blob with extra bytes
91
+ * that corrupts multipart uploads.
92
+ *
93
+ * Copying into a standalone Uint8Array ensures the Blob receives only the
94
+ * intended bytes regardless of runtime behaviour.
95
+ */
96
+ export function bytesToBlob(
97
+ content: Uint8Array<ArrayBufferLike> | ArrayBuffer | Blob | string,
98
+ contentType: string,
99
+ ): Blob {
100
+ if (content instanceof Uint8Array) {
101
+ return new Blob([new Uint8Array(content)], { type: contentType });
102
+ }
103
+ return new Blob([content as BlobPart], { type: contentType });
104
+ }
package/src/lib/sdks.ts CHANGED
@@ -124,13 +124,15 @@ export class ClientSDK {
124
124
  if (!base) {
125
125
  return ERR(new InvalidRequestError("No base URL provided for operation"));
126
126
  }
127
- const reqURL = new URL(base);
128
- const inputURL = new URL(path, reqURL);
129
-
127
+ const baseURL = new URL(base);
128
+ let reqURL: URL;
130
129
  if (path) {
131
- reqURL.pathname += reqURL.pathname.endsWith("/") ? "" : "/";
132
- reqURL.pathname += inputURL.pathname.replace(/^\/+/, "");
130
+ baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
131
+ reqURL = new URL(path, baseURL);
132
+ } else {
133
+ reqURL = baseURL;
133
134
  }
135
+ reqURL.hash = "";
134
136
 
135
137
  let finalQuery = query || "";
136
138
 
@@ -239,8 +239,9 @@ function applyBearer(
239
239
 
240
240
  export function resolveGlobalSecurity(
241
241
  security: Partial<components.Security> | null | undefined,
242
+ allowedFields?: number[],
242
243
  ): SecurityState | null {
243
- return resolveSecurity(
244
+ let inputs: SecurityInput[][] = [
244
245
  [
245
246
  {
246
247
  fieldName: "Authorization",
@@ -248,7 +249,18 @@ export function resolveGlobalSecurity(
248
249
  value: security?.apiKey,
249
250
  },
250
251
  ],
251
- );
252
+ ];
253
+
254
+ if (allowedFields) {
255
+ inputs = allowedFields.map((i) => {
256
+ if (i < 0 || i >= inputs.length) {
257
+ throw new RangeError(`invalid allowedFields index ${i}`);
258
+ }
259
+ return inputs[i]!;
260
+ });
261
+ }
262
+
263
+ return resolveSecurity(...inputs);
252
264
  }
253
265
 
254
266
  export async function extractSecurity<