@schedulin/sdk 0.1.2 → 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 (294) hide show
  1. package/README.md +45 -0
  2. package/cjs/BaseClient.d.ts +12 -0
  3. package/cjs/Client.d.ts +9 -0
  4. package/cjs/Client.js +23 -8
  5. package/cjs/api/errors/InternalServerError.d.ts +1 -0
  6. package/cjs/api/errors/UnauthorizedError.d.ts +1 -0
  7. package/cjs/api/resources/ai/client/Client.d.ts +49 -0
  8. package/cjs/api/resources/ai/client/Client.js +181 -0
  9. package/cjs/api/resources/ai/client/index.d.ts +1 -0
  10. package/cjs/api/resources/ai/client/index.js +17 -0
  11. package/cjs/api/resources/ai/client/requests/GenerateImageAiRequest.d.ts +20 -0
  12. package/cjs/api/resources/ai/client/requests/GenerateImageAiRequest.js +12 -0
  13. package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.d.ts → ai/client/requests/GetGenerationAiRequest.d.ts} +1 -1
  14. package/cjs/api/resources/ai/client/requests/index.d.ts +2 -0
  15. package/cjs/api/resources/ai/client/requests/index.js +5 -0
  16. package/cjs/api/resources/ai/exports.d.ts +2 -0
  17. package/cjs/api/resources/ai/exports.js +21 -0
  18. package/cjs/api/resources/ai/index.d.ts +1 -0
  19. package/cjs/api/resources/ai/index.js +17 -0
  20. package/cjs/api/resources/index.d.ts +6 -0
  21. package/cjs/api/resources/index.js +7 -1
  22. package/cjs/api/resources/media/client/Client.d.ts +83 -0
  23. package/cjs/api/resources/media/client/Client.js +260 -3
  24. package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.ts +12 -0
  25. package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.js +3 -0
  26. package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.ts +7 -0
  27. package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.js +3 -0
  28. package/{esm/api/resources/posts/client/requests/GetJobStatusPostsRequest.d.mts → cjs/api/resources/media/client/requests/DeleteMediaRequest.d.ts} +1 -1
  29. package/cjs/api/resources/media/client/requests/DeleteMediaRequest.js +3 -0
  30. package/cjs/api/resources/media/client/requests/UploadMediaRequest.d.ts +13 -0
  31. package/cjs/api/resources/media/client/requests/UploadMediaRequest.js +3 -0
  32. package/cjs/api/resources/media/client/requests/index.d.ts +4 -0
  33. package/cjs/api/resources/platforms/client/Client.d.ts +28 -0
  34. package/cjs/api/resources/platforms/client/Client.js +111 -0
  35. package/cjs/api/resources/platforms/client/index.d.ts +1 -0
  36. package/cjs/api/resources/platforms/client/index.js +2 -0
  37. package/cjs/api/resources/platforms/exports.d.ts +2 -0
  38. package/cjs/api/resources/platforms/exports.js +21 -0
  39. package/cjs/api/resources/platforms/index.d.ts +2 -0
  40. package/cjs/api/resources/platforms/index.js +18 -0
  41. package/cjs/api/resources/platforms/types/ListPlatformsResponse.d.ts +56 -0
  42. package/cjs/api/resources/platforms/types/ListPlatformsResponse.js +24 -0
  43. package/cjs/api/resources/platforms/types/index.d.ts +1 -0
  44. package/cjs/api/resources/platforms/types/index.js +17 -0
  45. package/cjs/api/resources/posts/client/Client.d.ts +22 -18
  46. package/cjs/api/resources/posts/client/Client.js +30 -62
  47. package/cjs/api/resources/posts/client/requests/ListPostsRequest.d.ts +1 -0
  48. package/cjs/api/resources/posts/client/requests/PostCreate.d.ts +64 -0
  49. package/cjs/api/resources/posts/client/requests/PostCreate.js +63 -0
  50. package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.d.ts +0 -2
  51. package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.js +0 -2
  52. package/cjs/api/resources/posts/client/requests/index.d.ts +0 -1
  53. package/cjs/api/resources/posts/types/CreatePostsResponse.d.ts +21 -0
  54. package/cjs/api/resources/posts/types/CreatePostsResponse.js +21 -0
  55. package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.d.ts +8 -0
  56. package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.js +11 -0
  57. package/cjs/api/resources/posts/types/index.d.ts +1 -0
  58. package/cjs/api/resources/posts/types/index.js +1 -0
  59. package/cjs/api/resources/socialAccounts/client/Client.d.ts +68 -1
  60. package/cjs/api/resources/socialAccounts/client/Client.js +210 -4
  61. package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.ts +9 -0
  62. package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.js +3 -0
  63. package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.ts +11 -0
  64. package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.js +3 -0
  65. package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.ts +11 -0
  66. package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.js +3 -0
  67. package/cjs/api/resources/socialAccounts/client/requests/index.d.ts +3 -0
  68. package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.ts +22 -0
  69. package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.js +21 -0
  70. package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.ts +12 -0
  71. package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.js +3 -0
  72. package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.ts +12 -0
  73. package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.js +3 -0
  74. package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.ts +3 -0
  75. package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.js +3 -0
  76. package/cjs/api/resources/socialAccounts/types/index.d.ts +3 -0
  77. package/cjs/api/resources/socialAccounts/types/index.js +3 -0
  78. package/cjs/api/resources/tags/client/Client.d.ts +8 -0
  79. package/cjs/api/resources/tags/client/Client.js +12 -3
  80. package/cjs/api/resources/webhooks/client/Client.d.ts +155 -0
  81. package/cjs/api/resources/webhooks/client/Client.js +538 -0
  82. package/cjs/api/resources/webhooks/client/index.d.ts +1 -0
  83. package/cjs/api/resources/webhooks/client/index.js +17 -0
  84. package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.ts +24 -0
  85. package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.js +16 -0
  86. package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.ts +9 -0
  87. package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.js +3 -0
  88. package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.ts +11 -0
  89. package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.js +3 -0
  90. package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.ts +9 -0
  91. package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.js +3 -0
  92. package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.ts +9 -0
  93. package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.js +3 -0
  94. package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.d.ts +9 -0
  95. package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.js +3 -0
  96. package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.ts +25 -0
  97. package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.js +16 -0
  98. package/cjs/api/resources/webhooks/client/requests/index.d.ts +7 -0
  99. package/cjs/api/resources/webhooks/client/requests/index.js +7 -0
  100. package/cjs/api/resources/webhooks/exports.d.ts +2 -0
  101. package/cjs/api/resources/webhooks/exports.js +21 -0
  102. package/cjs/api/resources/webhooks/index.d.ts +1 -0
  103. package/cjs/api/resources/webhooks/index.js +17 -0
  104. package/cjs/api/types/OauthScope.d.ts +12 -0
  105. package/cjs/api/types/OauthScope.js +12 -0
  106. package/cjs/api/types/PostSearch.d.ts +12 -0
  107. package/cjs/api/types/PostSearch.js +10 -0
  108. package/cjs/api/types/PostWithRelations.d.ts +21 -0
  109. package/cjs/api/types/PostWithRelations.js +21 -0
  110. package/cjs/api/types/SocialAccountDisconnectedReason.d.ts +1 -0
  111. package/cjs/api/types/SocialAccountDisconnectedReason.js +1 -0
  112. package/cjs/api/types/SocialPlatform.d.ts +21 -0
  113. package/cjs/api/types/SocialPlatform.js +21 -0
  114. package/cjs/core/exports.d.ts +1 -0
  115. package/cjs/core/exports.js +1 -0
  116. package/cjs/core/fetcher/Fetcher.js +9 -92
  117. package/cjs/core/fetcher/makePassthroughRequest.js +26 -4
  118. package/cjs/core/fetcher/redactUrl.d.ts +2 -0
  119. package/cjs/core/fetcher/redactUrl.js +88 -0
  120. package/cjs/core/file/exports.d.ts +1 -0
  121. package/cjs/core/file/exports.js +2 -0
  122. package/cjs/core/file/file.d.ts +10 -0
  123. package/cjs/core/file/file.js +225 -0
  124. package/cjs/core/file/index.d.ts +2 -0
  125. package/cjs/core/file/index.js +18 -0
  126. package/cjs/core/file/types.d.ts +66 -0
  127. package/cjs/core/file/types.js +2 -0
  128. package/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
  129. package/cjs/core/form-data-utils/FormDataWrapper.js +188 -0
  130. package/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
  131. package/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
  132. package/cjs/core/form-data-utils/index.d.ts +2 -0
  133. package/cjs/core/form-data-utils/index.js +20 -0
  134. package/cjs/core/index.d.ts +2 -0
  135. package/cjs/core/index.js +3 -1
  136. package/cjs/core/requestBody.d.ts +12 -0
  137. package/cjs/core/requestBody.js +26 -0
  138. package/cjs/core/runtime/index.d.ts +1 -1
  139. package/cjs/core/runtime/index.js +2 -1
  140. package/cjs/core/runtime/runtime.d.ts +19 -0
  141. package/cjs/core/runtime/runtime.js +74 -2
  142. package/cjs/core/url/qs.js +2 -2
  143. package/cjs/errors/SchedulinError.d.ts +1 -0
  144. package/cjs/errors/SchedulinError.js +4 -0
  145. package/cjs/errors/SchedulinTimeoutError.d.ts +2 -2
  146. package/cjs/errors/SchedulinTimeoutError.js +39 -5
  147. package/esm/BaseClient.d.mts +12 -0
  148. package/esm/Client.d.mts +9 -0
  149. package/esm/Client.mjs +15 -0
  150. package/esm/api/errors/InternalServerError.d.mts +1 -0
  151. package/esm/api/errors/UnauthorizedError.d.mts +1 -0
  152. package/esm/api/resources/ai/client/Client.d.mts +49 -0
  153. package/esm/api/resources/ai/client/Client.mjs +144 -0
  154. package/esm/api/resources/ai/client/index.d.mts +1 -0
  155. package/esm/api/resources/ai/client/index.mjs +1 -0
  156. package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.d.mts +20 -0
  157. package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.mjs +9 -0
  158. package/esm/api/resources/ai/client/requests/GetGenerationAiRequest.d.mts +9 -0
  159. package/esm/api/resources/ai/client/requests/index.d.mts +2 -0
  160. package/esm/api/resources/ai/client/requests/index.mjs +1 -0
  161. package/esm/api/resources/ai/exports.d.mts +2 -0
  162. package/esm/api/resources/ai/exports.mjs +3 -0
  163. package/esm/api/resources/ai/index.d.mts +1 -0
  164. package/esm/api/resources/ai/index.mjs +1 -0
  165. package/esm/api/resources/index.d.mts +6 -0
  166. package/esm/api/resources/index.mjs +6 -0
  167. package/esm/api/resources/media/client/Client.d.mts +83 -0
  168. package/esm/api/resources/media/client/Client.mjs +261 -4
  169. package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.mts +12 -0
  170. package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.mjs +2 -0
  171. package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.mts +7 -0
  172. package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.mjs +2 -0
  173. package/esm/api/resources/media/client/requests/DeleteMediaRequest.d.mts +9 -0
  174. package/esm/api/resources/media/client/requests/DeleteMediaRequest.mjs +2 -0
  175. package/esm/api/resources/media/client/requests/UploadMediaRequest.d.mts +13 -0
  176. package/esm/api/resources/media/client/requests/UploadMediaRequest.mjs +2 -0
  177. package/esm/api/resources/media/client/requests/index.d.mts +4 -0
  178. package/esm/api/resources/platforms/client/Client.d.mts +28 -0
  179. package/esm/api/resources/platforms/client/Client.mjs +74 -0
  180. package/esm/api/resources/platforms/client/index.d.mts +1 -0
  181. package/esm/api/resources/platforms/client/index.mjs +1 -0
  182. package/esm/api/resources/platforms/exports.d.mts +2 -0
  183. package/esm/api/resources/platforms/exports.mjs +3 -0
  184. package/esm/api/resources/platforms/index.d.mts +2 -0
  185. package/esm/api/resources/platforms/index.mjs +2 -0
  186. package/esm/api/resources/platforms/types/ListPlatformsResponse.d.mts +56 -0
  187. package/esm/api/resources/platforms/types/ListPlatformsResponse.mjs +21 -0
  188. package/esm/api/resources/platforms/types/index.d.mts +1 -0
  189. package/esm/api/resources/platforms/types/index.mjs +1 -0
  190. package/esm/api/resources/posts/client/Client.d.mts +22 -18
  191. package/esm/api/resources/posts/client/Client.mjs +30 -62
  192. package/esm/api/resources/posts/client/requests/ListPostsRequest.d.mts +1 -0
  193. package/esm/api/resources/posts/client/requests/PostCreate.d.mts +64 -0
  194. package/esm/api/resources/posts/client/requests/PostCreate.mjs +63 -0
  195. package/esm/api/resources/posts/client/requests/UpdatePostsRequest.d.mts +0 -2
  196. package/esm/api/resources/posts/client/requests/UpdatePostsRequest.mjs +0 -2
  197. package/esm/api/resources/posts/client/requests/index.d.mts +0 -1
  198. package/esm/api/resources/posts/types/CreatePostsResponse.d.mts +21 -0
  199. package/esm/api/resources/posts/types/CreatePostsResponse.mjs +21 -0
  200. package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.d.mts +8 -0
  201. package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.mjs +8 -0
  202. package/esm/api/resources/posts/types/index.d.mts +1 -0
  203. package/esm/api/resources/posts/types/index.mjs +1 -0
  204. package/esm/api/resources/socialAccounts/client/Client.d.mts +68 -1
  205. package/esm/api/resources/socialAccounts/client/Client.mjs +210 -4
  206. package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.mts +9 -0
  207. package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.mjs +2 -0
  208. package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.mts +11 -0
  209. package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.mjs +2 -0
  210. package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.mts +11 -0
  211. package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.mjs +2 -0
  212. package/esm/api/resources/socialAccounts/client/requests/index.d.mts +3 -0
  213. package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.mts +22 -0
  214. package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.mjs +21 -0
  215. package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.mts +12 -0
  216. package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.mjs +2 -0
  217. package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.mts +12 -0
  218. package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.mjs +2 -0
  219. package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.mts +3 -0
  220. package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.mjs +2 -0
  221. package/esm/api/resources/socialAccounts/types/index.d.mts +3 -0
  222. package/esm/api/resources/socialAccounts/types/index.mjs +3 -0
  223. package/esm/api/resources/tags/client/Client.d.mts +8 -0
  224. package/esm/api/resources/tags/client/Client.mjs +12 -3
  225. package/esm/api/resources/webhooks/client/Client.d.mts +155 -0
  226. package/esm/api/resources/webhooks/client/Client.mjs +501 -0
  227. package/esm/api/resources/webhooks/client/index.d.mts +1 -0
  228. package/esm/api/resources/webhooks/client/index.mjs +1 -0
  229. package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.mts +24 -0
  230. package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.mjs +13 -0
  231. package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.mts +9 -0
  232. package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.mjs +2 -0
  233. package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.mts +11 -0
  234. package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.mjs +2 -0
  235. package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.mts +9 -0
  236. package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.mjs +2 -0
  237. package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.mts +9 -0
  238. package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.mjs +2 -0
  239. package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.d.mts +9 -0
  240. package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.mjs +2 -0
  241. package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.mts +25 -0
  242. package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.mjs +13 -0
  243. package/esm/api/resources/webhooks/client/requests/index.d.mts +7 -0
  244. package/esm/api/resources/webhooks/client/requests/index.mjs +2 -0
  245. package/esm/api/resources/webhooks/exports.d.mts +2 -0
  246. package/esm/api/resources/webhooks/exports.mjs +3 -0
  247. package/esm/api/resources/webhooks/index.d.mts +1 -0
  248. package/esm/api/resources/webhooks/index.mjs +1 -0
  249. package/esm/api/types/OauthScope.d.mts +12 -0
  250. package/esm/api/types/OauthScope.mjs +12 -0
  251. package/esm/api/types/PostSearch.d.mts +12 -0
  252. package/esm/api/types/PostSearch.mjs +10 -0
  253. package/esm/api/types/PostWithRelations.d.mts +21 -0
  254. package/esm/api/types/PostWithRelations.mjs +21 -0
  255. package/esm/api/types/SocialAccountDisconnectedReason.d.mts +1 -0
  256. package/esm/api/types/SocialAccountDisconnectedReason.mjs +1 -0
  257. package/esm/api/types/SocialPlatform.d.mts +21 -0
  258. package/esm/api/types/SocialPlatform.mjs +21 -0
  259. package/esm/core/exports.d.mts +1 -0
  260. package/esm/core/exports.mjs +1 -0
  261. package/esm/core/fetcher/Fetcher.mjs +1 -84
  262. package/esm/core/fetcher/makePassthroughRequest.mjs +26 -4
  263. package/esm/core/fetcher/redactUrl.d.mts +2 -0
  264. package/esm/core/fetcher/redactUrl.mjs +84 -0
  265. package/esm/core/file/exports.d.mts +1 -0
  266. package/esm/core/file/exports.mjs +1 -0
  267. package/esm/core/file/file.d.mts +10 -0
  268. package/esm/core/file/file.mjs +188 -0
  269. package/esm/core/file/index.d.mts +2 -0
  270. package/esm/core/file/index.mjs +2 -0
  271. package/esm/core/file/types.d.mts +66 -0
  272. package/esm/core/file/types.mjs +1 -0
  273. package/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
  274. package/esm/core/form-data-utils/FormDataWrapper.mjs +150 -0
  275. package/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
  276. package/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
  277. package/esm/core/form-data-utils/index.d.mts +2 -0
  278. package/esm/core/form-data-utils/index.mjs +2 -0
  279. package/esm/core/index.d.mts +2 -0
  280. package/esm/core/index.mjs +2 -0
  281. package/esm/core/requestBody.d.mts +12 -0
  282. package/esm/core/requestBody.mjs +23 -0
  283. package/esm/core/runtime/index.d.mts +1 -1
  284. package/esm/core/runtime/index.mjs +1 -1
  285. package/esm/core/runtime/runtime.d.mts +19 -0
  286. package/esm/core/runtime/runtime.mjs +73 -2
  287. package/esm/core/url/qs.mjs +2 -2
  288. package/esm/errors/SchedulinError.d.mts +1 -0
  289. package/esm/errors/SchedulinError.mjs +4 -0
  290. package/esm/errors/SchedulinTimeoutError.d.mts +2 -2
  291. package/esm/errors/SchedulinTimeoutError.mjs +6 -5
  292. package/package.json +1 -1
  293. /package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.js → ai/client/requests/GetGenerationAiRequest.js} +0 -0
  294. /package/esm/api/resources/{posts/client/requests/GetJobStatusPostsRequest.mjs → ai/client/requests/GetGenerationAiRequest.mjs} +0 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface RotateSecretWebhooksRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface TestWebhooksRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface UpdateWebhooksRequest {
8
+ id: string;
9
+ url?: string;
10
+ events?: UpdateWebhooksRequest.Events.Item[];
11
+ description?: string | null;
12
+ enabled?: boolean;
13
+ }
14
+ export declare namespace UpdateWebhooksRequest {
15
+ type Events = Events.Item[];
16
+ namespace Events {
17
+ const Item: {
18
+ readonly PostPublished: "post.published";
19
+ readonly PostFailed: "post.failed";
20
+ readonly GenerationCompleted: "generation.completed";
21
+ readonly GenerationFailed: "generation.failed";
22
+ };
23
+ type Item = (typeof Item)[keyof typeof Item];
24
+ }
25
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.UpdateWebhooksRequest = void 0;
5
+ var UpdateWebhooksRequest;
6
+ (function (UpdateWebhooksRequest) {
7
+ let Events;
8
+ (function (Events) {
9
+ Events.Item = {
10
+ PostPublished: "post.published",
11
+ PostFailed: "post.failed",
12
+ GenerationCompleted: "generation.completed",
13
+ GenerationFailed: "generation.failed",
14
+ };
15
+ })(Events = UpdateWebhooksRequest.Events || (UpdateWebhooksRequest.Events = {}));
16
+ })(UpdateWebhooksRequest || (exports.UpdateWebhooksRequest = UpdateWebhooksRequest = {}));
@@ -0,0 +1,7 @@
1
+ export { CreateWebhooksRequest } from "./CreateWebhooksRequest.js";
2
+ export type { DeleteWebhooksRequest } from "./DeleteWebhooksRequest.js";
3
+ export type { ListDeliveriesWebhooksRequest } from "./ListDeliveriesWebhooksRequest.js";
4
+ export type { RetrieveWebhooksRequest } from "./RetrieveWebhooksRequest.js";
5
+ export type { RotateSecretWebhooksRequest } from "./RotateSecretWebhooksRequest.js";
6
+ export type { TestWebhooksRequest } from "./TestWebhooksRequest.js";
7
+ export { UpdateWebhooksRequest } from "./UpdateWebhooksRequest.js";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateWebhooksRequest = exports.CreateWebhooksRequest = void 0;
4
+ var CreateWebhooksRequest_js_1 = require("./CreateWebhooksRequest.js");
5
+ Object.defineProperty(exports, "CreateWebhooksRequest", { enumerable: true, get: function () { return CreateWebhooksRequest_js_1.CreateWebhooksRequest; } });
6
+ var UpdateWebhooksRequest_js_1 = require("./UpdateWebhooksRequest.js");
7
+ Object.defineProperty(exports, "UpdateWebhooksRequest", { enumerable: true, get: function () { return UpdateWebhooksRequest_js_1.UpdateWebhooksRequest; } });
@@ -0,0 +1,2 @@
1
+ export { WebhooksClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.WebhooksClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "WebhooksClient", { enumerable: true, get: function () { return Client_js_1.WebhooksClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -32,5 +32,17 @@ export declare const OauthScope: {
32
32
  /**
33
33
  * View organization details */
34
34
  readonly OrgRead: "org:read";
35
+ /**
36
+ * View AI generation jobs and available voices */
37
+ readonly AiRead: "ai:read";
38
+ /**
39
+ * Generate AI images and videos (spends AI credits) */
40
+ readonly AiWrite: "ai:write";
41
+ /**
42
+ * View webhook endpoints and delivery history */
43
+ readonly WebhooksRead: "webhooks:read";
44
+ /**
45
+ * Create, edit, and delete webhook endpoints */
46
+ readonly WebhooksWrite: "webhooks:write";
35
47
  };
36
48
  export type OauthScope = (typeof OauthScope)[keyof typeof OauthScope];
@@ -36,4 +36,16 @@ exports.OauthScope = {
36
36
  /**
37
37
  * View organization details */
38
38
  OrgRead: "org:read",
39
+ /**
40
+ * View AI generation jobs and available voices */
41
+ AiRead: "ai:read",
42
+ /**
43
+ * Generate AI images and videos (spends AI credits) */
44
+ AiWrite: "ai:write",
45
+ /**
46
+ * View webhook endpoints and delivery history */
47
+ WebhooksRead: "webhooks:read",
48
+ /**
49
+ * Create, edit, and delete webhook endpoints */
50
+ WebhooksWrite: "webhooks:write",
39
51
  };
@@ -1,6 +1,7 @@
1
1
  export interface PostSearch {
2
2
  page?: number | undefined;
3
3
  status?: PostSearch.Status | undefined;
4
+ statuses?: PostSearch.Statuses.Item[] | undefined;
4
5
  approvalStatus?: PostSearch.ApprovalStatus | undefined;
5
6
  scheduledAt?: PostSearch.ScheduledAt | undefined;
6
7
  tagIds?: string[] | undefined;
@@ -17,6 +18,17 @@ export declare namespace PostSearch {
17
18
  readonly Failed: "FAILED";
18
19
  };
19
20
  type Status = (typeof Status)[keyof typeof Status];
21
+ type Statuses = Statuses.Item[];
22
+ namespace Statuses {
23
+ const Item: {
24
+ readonly Scheduled: "SCHEDULED";
25
+ readonly Processing: "PROCESSING";
26
+ readonly Completed: "COMPLETED";
27
+ readonly Draft: "DRAFT";
28
+ readonly Failed: "FAILED";
29
+ };
30
+ type Item = (typeof Item)[keyof typeof Item];
31
+ }
20
32
  const ApprovalStatus: {
21
33
  readonly Draft: "DRAFT";
22
34
  readonly PendingApproval: "PENDING_APPROVAL";
@@ -11,6 +11,16 @@ var PostSearch;
11
11
  Draft: "DRAFT",
12
12
  Failed: "FAILED",
13
13
  };
14
+ let Statuses;
15
+ (function (Statuses) {
16
+ Statuses.Item = {
17
+ Scheduled: "SCHEDULED",
18
+ Processing: "PROCESSING",
19
+ Completed: "COMPLETED",
20
+ Draft: "DRAFT",
21
+ Failed: "FAILED",
22
+ };
23
+ })(Statuses = PostSearch.Statuses || (PostSearch.Statuses = {}));
14
24
  PostSearch.ApprovalStatus = {
15
25
  Draft: "DRAFT",
16
26
  PendingApproval: "PENDING_APPROVAL",
@@ -55,10 +55,31 @@ export declare namespace PostWithRelations {
55
55
  readonly Linkedin: "linkedin";
56
56
  readonly Pinterest: "pinterest";
57
57
  readonly Reddit: "reddit";
58
+ readonly Snapchat: "snapchat";
58
59
  readonly Threads: "threads";
59
60
  readonly Tiktok: "tiktok";
60
61
  readonly Twitter: "twitter";
61
62
  readonly Youtube: "youtube";
63
+ readonly Mastodon: "mastodon";
64
+ readonly Telegram: "telegram";
65
+ readonly Devto: "devto";
66
+ readonly Hashnode: "hashnode";
67
+ readonly Medium: "medium";
68
+ readonly Wordpress: "wordpress";
69
+ readonly Lemmy: "lemmy";
70
+ readonly Nostr: "nostr";
71
+ readonly Discord: "discord";
72
+ readonly Dribbble: "dribbble";
73
+ readonly Farcaster: "farcaster";
74
+ readonly Kick: "kick";
75
+ readonly Listmonk: "listmonk";
76
+ readonly Mewe: "mewe";
77
+ readonly Moltbook: "moltbook";
78
+ readonly Skool: "skool";
79
+ readonly Slack: "slack";
80
+ readonly Twitch: "twitch";
81
+ readonly Vk: "vk";
82
+ readonly Whop: "whop";
62
83
  };
63
84
  type Platform = (typeof Platform)[keyof typeof Platform];
64
85
  }
@@ -24,10 +24,31 @@ var PostWithRelations;
24
24
  Linkedin: "linkedin",
25
25
  Pinterest: "pinterest",
26
26
  Reddit: "reddit",
27
+ Snapchat: "snapchat",
27
28
  Threads: "threads",
28
29
  Tiktok: "tiktok",
29
30
  Twitter: "twitter",
30
31
  Youtube: "youtube",
32
+ Mastodon: "mastodon",
33
+ Telegram: "telegram",
34
+ Devto: "devto",
35
+ Hashnode: "hashnode",
36
+ Medium: "medium",
37
+ Wordpress: "wordpress",
38
+ Lemmy: "lemmy",
39
+ Nostr: "nostr",
40
+ Discord: "discord",
41
+ Dribbble: "dribbble",
42
+ Farcaster: "farcaster",
43
+ Kick: "kick",
44
+ Listmonk: "listmonk",
45
+ Mewe: "mewe",
46
+ Moltbook: "moltbook",
47
+ Skool: "skool",
48
+ Slack: "slack",
49
+ Twitch: "twitch",
50
+ Vk: "vk",
51
+ Whop: "whop",
31
52
  };
32
53
  })(Item = Tags.Item || (Tags.Item = {}));
33
54
  })(Tags = Item_1.Tags || (Item_1.Tags = {}));
@@ -5,5 +5,6 @@ export declare const SocialAccountDisconnectedReason: {
5
5
  readonly RefreshFailed: "REFRESH_FAILED";
6
6
  readonly AccountSuspended: "ACCOUNT_SUSPENDED";
7
7
  readonly PermissionDenied: "PERMISSION_DENIED";
8
+ readonly EmailUnconfirmed: "EMAIL_UNCONFIRMED";
8
9
  };
9
10
  export type SocialAccountDisconnectedReason = (typeof SocialAccountDisconnectedReason)[keyof typeof SocialAccountDisconnectedReason];
@@ -9,4 +9,5 @@ exports.SocialAccountDisconnectedReason = {
9
9
  RefreshFailed: "REFRESH_FAILED",
10
10
  AccountSuspended: "ACCOUNT_SUSPENDED",
11
11
  PermissionDenied: "PERMISSION_DENIED",
12
+ EmailUnconfirmed: "EMAIL_UNCONFIRMED",
12
13
  };
@@ -6,9 +6,30 @@ export declare const SocialPlatform: {
6
6
  readonly Linkedin: "linkedin";
7
7
  readonly Pinterest: "pinterest";
8
8
  readonly Reddit: "reddit";
9
+ readonly Snapchat: "snapchat";
9
10
  readonly Threads: "threads";
10
11
  readonly Tiktok: "tiktok";
11
12
  readonly Twitter: "twitter";
12
13
  readonly Youtube: "youtube";
14
+ readonly Mastodon: "mastodon";
15
+ readonly Telegram: "telegram";
16
+ readonly Devto: "devto";
17
+ readonly Hashnode: "hashnode";
18
+ readonly Medium: "medium";
19
+ readonly Wordpress: "wordpress";
20
+ readonly Lemmy: "lemmy";
21
+ readonly Nostr: "nostr";
22
+ readonly Discord: "discord";
23
+ readonly Dribbble: "dribbble";
24
+ readonly Farcaster: "farcaster";
25
+ readonly Kick: "kick";
26
+ readonly Listmonk: "listmonk";
27
+ readonly Mewe: "mewe";
28
+ readonly Moltbook: "moltbook";
29
+ readonly Skool: "skool";
30
+ readonly Slack: "slack";
31
+ readonly Twitch: "twitch";
32
+ readonly Vk: "vk";
33
+ readonly Whop: "whop";
13
34
  };
14
35
  export type SocialPlatform = (typeof SocialPlatform)[keyof typeof SocialPlatform];
@@ -10,8 +10,29 @@ exports.SocialPlatform = {
10
10
  Linkedin: "linkedin",
11
11
  Pinterest: "pinterest",
12
12
  Reddit: "reddit",
13
+ Snapchat: "snapchat",
13
14
  Threads: "threads",
14
15
  Tiktok: "tiktok",
15
16
  Twitter: "twitter",
16
17
  Youtube: "youtube",
18
+ Mastodon: "mastodon",
19
+ Telegram: "telegram",
20
+ Devto: "devto",
21
+ Hashnode: "hashnode",
22
+ Medium: "medium",
23
+ Wordpress: "wordpress",
24
+ Lemmy: "lemmy",
25
+ Nostr: "nostr",
26
+ Discord: "discord",
27
+ Dribbble: "dribbble",
28
+ Farcaster: "farcaster",
29
+ Kick: "kick",
30
+ Listmonk: "listmonk",
31
+ Mewe: "mewe",
32
+ Moltbook: "moltbook",
33
+ Skool: "skool",
34
+ Slack: "slack",
35
+ Twitch: "twitch",
36
+ Vk: "vk",
37
+ Whop: "whop",
17
38
  };
@@ -1 +1,2 @@
1
+ export * from "./file/exports.js";
1
2
  export * from "./logging/exports.js";
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./file/exports.js"), exports);
17
18
  __exportStar(require("./logging/exports.js"), exports);
@@ -22,6 +22,7 @@ const getResponseBody_js_1 = require("./getResponseBody.js");
22
22
  const Headers_js_1 = require("./Headers.js");
23
23
  const makeRequest_js_1 = require("./makeRequest.js");
24
24
  const RawResponse_js_1 = require("./RawResponse.js");
25
+ const redactUrl_js_1 = require("./redactUrl.js");
25
26
  const requestWithRetries_js_1 = require("./requestWithRetries.js");
26
27
  const SENSITIVE_HEADERS = new Set([
27
28
  "authorization",
@@ -53,100 +54,16 @@ function redactHeaders(headers) {
53
54
  }
54
55
  return filtered;
55
56
  }
56
- const SENSITIVE_QUERY_PARAMS = new Set([
57
- "api_key",
58
- "api-key",
59
- "apikey",
60
- "token",
61
- "access_token",
62
- "access-token",
63
- "auth_token",
64
- "auth-token",
65
- "password",
66
- "passwd",
67
- "secret",
68
- "api_secret",
69
- "api-secret",
70
- "apisecret",
71
- "key",
72
- "session",
73
- "session_id",
74
- "session-id",
75
- ]);
76
57
  function redactQueryParameters(queryParameters) {
77
58
  if (queryParameters == null) {
78
59
  return undefined;
79
60
  }
80
61
  const redacted = {};
81
62
  for (const [key, value] of Object.entries(queryParameters)) {
82
- redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
63
+ redacted[key] = redactUrl_js_1.SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
83
64
  }
84
65
  return redacted;
85
66
  }
86
- function redactUrl(url) {
87
- const protocolIndex = url.indexOf("://");
88
- if (protocolIndex === -1)
89
- return url;
90
- const afterProtocol = protocolIndex + 3;
91
- // Find the first delimiter that marks the end of the authority section
92
- const pathStart = url.indexOf("/", afterProtocol);
93
- let queryStart = url.indexOf("?", afterProtocol);
94
- let fragmentStart = url.indexOf("#", afterProtocol);
95
- const firstDelimiter = Math.min(pathStart === -1 ? url.length : pathStart, queryStart === -1 ? url.length : queryStart, fragmentStart === -1 ? url.length : fragmentStart);
96
- // Find the LAST @ before the delimiter (handles multiple @ in credentials)
97
- let atIndex = -1;
98
- for (let i = afterProtocol; i < firstDelimiter; i++) {
99
- if (url[i] === "@") {
100
- atIndex = i;
101
- }
102
- }
103
- if (atIndex !== -1) {
104
- url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`;
105
- }
106
- // Recalculate queryStart since url might have changed
107
- queryStart = url.indexOf("?");
108
- if (queryStart === -1)
109
- return url;
110
- fragmentStart = url.indexOf("#", queryStart);
111
- const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length;
112
- const queryString = url.slice(queryStart + 1, queryEnd);
113
- if (queryString.length === 0)
114
- return url;
115
- // FAST PATH: Quick check if any sensitive keywords present
116
- // Using indexOf is faster than regex for simple substring matching
117
- const lower = queryString.toLowerCase();
118
- const hasSensitive = lower.includes("token") ||
119
- lower.includes("key") ||
120
- lower.includes("password") ||
121
- lower.includes("passwd") ||
122
- lower.includes("secret") ||
123
- lower.includes("session") ||
124
- lower.includes("auth");
125
- if (!hasSensitive) {
126
- return url;
127
- }
128
- // SLOW PATH: Parse and redact
129
- const redactedParams = [];
130
- const params = queryString.split("&");
131
- for (const param of params) {
132
- const equalIndex = param.indexOf("=");
133
- if (equalIndex === -1) {
134
- redactedParams.push(param);
135
- continue;
136
- }
137
- const key = param.slice(0, equalIndex);
138
- let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase());
139
- if (!shouldRedact && key.includes("%")) {
140
- try {
141
- const decodedKey = decodeURIComponent(key);
142
- shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase());
143
- }
144
- catch (_a) { }
145
- }
146
- redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param);
147
- }
148
- return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd);
149
- }
150
67
  function getHeaders(args) {
151
68
  return __awaiter(this, void 0, void 0, function* () {
152
69
  var _a;
@@ -198,7 +115,7 @@ function fetcherImpl(args) {
198
115
  if (logger.isDebug()) {
199
116
  const metadata = {
200
117
  method: args.method,
201
- url: redactUrl(url),
118
+ url: (0, redactUrl_js_1.redactUrl)(url),
202
119
  headers: redactHeaders(headers),
203
120
  queryParameters: redactQueryParameters(args.queryParameters),
204
121
  hasBody: requestBody != null,
@@ -213,7 +130,7 @@ function fetcherImpl(args) {
213
130
  if (logger.isDebug()) {
214
131
  const metadata = {
215
132
  method: args.method,
216
- url: redactUrl(url),
133
+ url: (0, redactUrl_js_1.redactUrl)(url),
217
134
  statusCode: response.status,
218
135
  responseHeaders: redactHeaders(response.headers),
219
136
  };
@@ -231,7 +148,7 @@ function fetcherImpl(args) {
231
148
  if (logger.isError()) {
232
149
  const metadata = {
233
150
  method: args.method,
234
- url: redactUrl(url),
151
+ url: (0, redactUrl_js_1.redactUrl)(url),
235
152
  statusCode: response.status,
236
153
  responseHeaders: redactHeaders(Object.fromEntries(response.headers.entries())),
237
154
  };
@@ -253,7 +170,7 @@ function fetcherImpl(args) {
253
170
  if (logger.isError()) {
254
171
  const metadata = {
255
172
  method: args.method,
256
- url: redactUrl(url),
173
+ url: (0, redactUrl_js_1.redactUrl)(url),
257
174
  };
258
175
  logger.error("HTTP request was aborted", metadata);
259
176
  }
@@ -271,7 +188,7 @@ function fetcherImpl(args) {
271
188
  if (logger.isError()) {
272
189
  const metadata = {
273
190
  method: args.method,
274
- url: redactUrl(url),
191
+ url: (0, redactUrl_js_1.redactUrl)(url),
275
192
  timeoutMs: args.timeoutMs,
276
193
  };
277
194
  logger.error("HTTP request timed out", metadata);
@@ -289,7 +206,7 @@ function fetcherImpl(args) {
289
206
  if (logger.isError()) {
290
207
  const metadata = {
291
208
  method: args.method,
292
- url: redactUrl(url),
209
+ url: (0, redactUrl_js_1.redactUrl)(url),
293
210
  errorMessage: error.message,
294
211
  };
295
212
  logger.error("HTTP request failed with error", metadata);
@@ -307,7 +224,7 @@ function fetcherImpl(args) {
307
224
  if (logger.isError()) {
308
225
  const metadata = {
309
226
  method: args.method,
310
- url: redactUrl(url),
227
+ url: (0, redactUrl_js_1.redactUrl)(url),
311
228
  error: (0, json_js_1.toJson)(error),
312
229
  };
313
230
  logger.error("HTTP request failed with unknown error", metadata);
@@ -15,6 +15,7 @@ const join_js_1 = require("../url/join.js");
15
15
  const EndpointSupplier_js_1 = require("./EndpointSupplier.js");
16
16
  const getFetchFn_js_1 = require("./getFetchFn.js");
17
17
  const makeRequest_js_1 = require("./makeRequest.js");
18
+ const redactUrl_js_1 = require("./redactUrl.js");
18
19
  const requestWithRetries_js_1 = require("./requestWithRetries.js");
19
20
  const Supplier_js_1 = require("./Supplier.js");
20
21
  /**
@@ -79,8 +80,10 @@ function makePassthroughRequest(input, init, clientOptions, requestOptions) {
79
80
  }
80
81
  }
81
82
  }
82
- // Apply auth headers
83
- if (clientOptions.getAuthHeaders != null) {
83
+ // Apply auth headers, but only when the resolved URL targets the configured base URL.
84
+ // This prevents the SDK's credentials from leaking to an unrelated host when a caller
85
+ // passes an absolute cross-origin URL into the passthrough fetch escape hatch.
86
+ if (clientOptions.getAuthHeaders != null && targetsBaseUrl(fullUrl, baseUrl)) {
84
87
  const authHeaders = yield clientOptions.getAuthHeaders();
85
88
  for (const [key, value] of Object.entries(authHeaders)) {
86
89
  mergedHeaders[key.toLowerCase()] = value;
@@ -115,7 +118,7 @@ function makePassthroughRequest(input, init, clientOptions, requestOptions) {
115
118
  if (logger.isDebug()) {
116
119
  logger.debug("Making passthrough HTTP request", {
117
120
  method,
118
- url: fullUrl,
121
+ url: (0, redactUrl_js_1.redactUrl)(fullUrl),
119
122
  hasBody: body != null,
120
123
  });
121
124
  }
@@ -126,10 +129,29 @@ function makePassthroughRequest(input, init, clientOptions, requestOptions) {
126
129
  if (logger.isDebug()) {
127
130
  logger.debug("Passthrough HTTP request completed", {
128
131
  method,
129
- url: fullUrl,
132
+ url: (0, redactUrl_js_1.redactUrl)(fullUrl),
130
133
  statusCode: response.status,
131
134
  });
132
135
  }
133
136
  return response;
134
137
  });
135
138
  }
139
+ /**
140
+ * Returns true when the resolved request URL points at the same origin as the
141
+ * configured base URL. Relative paths are always joined onto the base URL, so
142
+ * they resolve to the base origin and return true. Absolute URLs only match when
143
+ * their origin equals the base origin. When there is no base URL to compare
144
+ * against, or either value is not a parseable absolute URL, this returns false so
145
+ * auth headers are not attached.
146
+ */
147
+ function targetsBaseUrl(fullUrl, baseUrl) {
148
+ if (baseUrl == null) {
149
+ return false;
150
+ }
151
+ try {
152
+ return new URL(fullUrl).origin === new URL(baseUrl).origin;
153
+ }
154
+ catch (_a) {
155
+ return false;
156
+ }
157
+ }
@@ -0,0 +1,2 @@
1
+ export declare const SENSITIVE_QUERY_PARAMS: Set<string>;
2
+ export declare function redactUrl(url: string): string;