@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,155 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as Schedulin from "../../../index.mjs";
5
+ export declare namespace WebhooksClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class WebhooksClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
12
+ constructor(options: WebhooksClient.Options);
13
+ /**
14
+ * List the organization's webhook endpoints. Signing secrets are masked.
15
+ *
16
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @throws {@link Schedulin.UnauthorizedError}
19
+ * @throws {@link Schedulin.InternalServerError}
20
+ * @throws {@link errors.SchedulinError}
21
+ * @throws {@link errors.SchedulinTimeoutError}
22
+ *
23
+ * @example
24
+ * await client.webhooks.list()
25
+ */
26
+ list(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
27
+ private __list;
28
+ /**
29
+ * Register an HTTPS endpoint for event deliveries. The response includes the signing secret ONCE — store it; later reads return a masked value.
30
+ *
31
+ * @param {Schedulin.CreateWebhooksRequest} request
32
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
33
+ *
34
+ * @throws {@link Schedulin.UnauthorizedError}
35
+ * @throws {@link Schedulin.InternalServerError}
36
+ * @throws {@link errors.SchedulinError}
37
+ * @throws {@link errors.SchedulinTimeoutError}
38
+ *
39
+ * @example
40
+ * await client.webhooks.create({
41
+ * url: "url",
42
+ * events: ["post.published"]
43
+ * })
44
+ */
45
+ create(request: Schedulin.CreateWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
46
+ private __create;
47
+ /**
48
+ * Retrieve one webhook endpoint, including failure counters. The signing secret is masked.
49
+ *
50
+ * @param {Schedulin.RetrieveWebhooksRequest} request
51
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
52
+ *
53
+ * @throws {@link Schedulin.UnauthorizedError}
54
+ * @throws {@link Schedulin.InternalServerError}
55
+ * @throws {@link errors.SchedulinError}
56
+ * @throws {@link errors.SchedulinTimeoutError}
57
+ *
58
+ * @example
59
+ * await client.webhooks.retrieve({
60
+ * id: "id"
61
+ * })
62
+ */
63
+ retrieve(request: Schedulin.RetrieveWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
64
+ private __retrieve;
65
+ /**
66
+ * Delete a webhook endpoint and its delivery history. Deliveries already in flight are dropped.
67
+ *
68
+ * @param {Schedulin.DeleteWebhooksRequest} request
69
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
70
+ *
71
+ * @throws {@link Schedulin.UnauthorizedError}
72
+ * @throws {@link Schedulin.InternalServerError}
73
+ * @throws {@link errors.SchedulinError}
74
+ * @throws {@link errors.SchedulinTimeoutError}
75
+ *
76
+ * @example
77
+ * await client.webhooks.delete({
78
+ * id: "id"
79
+ * })
80
+ */
81
+ delete(request: Schedulin.DeleteWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
82
+ private __delete;
83
+ /**
84
+ * Update URL, subscribed events, description, or enabled state. Re-enabling resets the failure streak.
85
+ *
86
+ * @param {Schedulin.UpdateWebhooksRequest} request
87
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
88
+ *
89
+ * @throws {@link Schedulin.UnauthorizedError}
90
+ * @throws {@link Schedulin.InternalServerError}
91
+ * @throws {@link errors.SchedulinError}
92
+ * @throws {@link errors.SchedulinTimeoutError}
93
+ *
94
+ * @example
95
+ * await client.webhooks.update({
96
+ * id: "id"
97
+ * })
98
+ */
99
+ update(request: Schedulin.UpdateWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
100
+ private __update;
101
+ /**
102
+ * Generate a new signing secret for the endpoint and return it ONCE. The old secret stops signing immediately.
103
+ *
104
+ * @param {Schedulin.RotateSecretWebhooksRequest} request
105
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
106
+ *
107
+ * @throws {@link Schedulin.UnauthorizedError}
108
+ * @throws {@link Schedulin.InternalServerError}
109
+ * @throws {@link errors.SchedulinError}
110
+ * @throws {@link errors.SchedulinTimeoutError}
111
+ *
112
+ * @example
113
+ * await client.webhooks.rotateSecret({
114
+ * id: "id"
115
+ * })
116
+ */
117
+ rotateSecret(request: Schedulin.RotateSecretWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
118
+ private __rotateSecret;
119
+ /**
120
+ * Send a signed `ping` event to the endpoint URL and record it in the delivery history.
121
+ *
122
+ * @param {Schedulin.TestWebhooksRequest} request
123
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
124
+ *
125
+ * @throws {@link Schedulin.UnauthorizedError}
126
+ * @throws {@link Schedulin.InternalServerError}
127
+ * @throws {@link errors.SchedulinError}
128
+ * @throws {@link errors.SchedulinTimeoutError}
129
+ *
130
+ * @example
131
+ * await client.webhooks.test({
132
+ * id: "id"
133
+ * })
134
+ */
135
+ test(request: Schedulin.TestWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
136
+ private __test;
137
+ /**
138
+ * Delivery history for a webhook endpoint: event, status, attempts, last response code, and payload.
139
+ *
140
+ * @param {Schedulin.ListDeliveriesWebhooksRequest} request
141
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @throws {@link Schedulin.UnauthorizedError}
144
+ * @throws {@link Schedulin.InternalServerError}
145
+ * @throws {@link errors.SchedulinError}
146
+ * @throws {@link errors.SchedulinTimeoutError}
147
+ *
148
+ * @example
149
+ * await client.webhooks.listDeliveries({
150
+ * id: "id"
151
+ * })
152
+ */
153
+ listDeliveries(request: Schedulin.ListDeliveriesWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
154
+ private __listDeliveries;
155
+ }
@@ -0,0 +1,501 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
+ import { mergeHeaders } from "../../../../core/headers.mjs";
24
+ import * as core from "../../../../core/index.mjs";
25
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
26
+ import * as environments from "../../../../environments.mjs";
27
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
28
+ import * as errors from "../../../../errors/index.mjs";
29
+ import * as Schedulin from "../../../index.mjs";
30
+ export class WebhooksClient {
31
+ constructor(options) {
32
+ this._options = normalizeClientOptionsWithAuth(options);
33
+ }
34
+ /**
35
+ * List the organization's webhook endpoints. Signing secrets are masked.
36
+ *
37
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Schedulin.UnauthorizedError}
40
+ * @throws {@link Schedulin.InternalServerError}
41
+ * @throws {@link errors.SchedulinError}
42
+ * @throws {@link errors.SchedulinTimeoutError}
43
+ *
44
+ * @example
45
+ * await client.webhooks.list()
46
+ */
47
+ list(requestOptions) {
48
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
49
+ }
50
+ __list(requestOptions) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
54
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
55
+ const _response = yield core.fetcher({
56
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, "v0/webhooks"),
57
+ method: "GET",
58
+ headers: _headers,
59
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
60
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
61
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
62
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
63
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
64
+ logging: this._options.logging,
65
+ });
66
+ if (_response.ok) {
67
+ return { data: _response.body, rawResponse: _response.rawResponse };
68
+ }
69
+ if (_response.error.reason === "status-code") {
70
+ switch (_response.error.statusCode) {
71
+ case 401:
72
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
73
+ case 500:
74
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
75
+ default:
76
+ throw new errors.SchedulinError({
77
+ statusCode: _response.error.statusCode,
78
+ body: _response.error.body,
79
+ rawResponse: _response.rawResponse,
80
+ });
81
+ }
82
+ }
83
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/webhooks");
84
+ });
85
+ }
86
+ /**
87
+ * Register an HTTPS endpoint for event deliveries. The response includes the signing secret ONCE — store it; later reads return a masked value.
88
+ *
89
+ * @param {Schedulin.CreateWebhooksRequest} request
90
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
91
+ *
92
+ * @throws {@link Schedulin.UnauthorizedError}
93
+ * @throws {@link Schedulin.InternalServerError}
94
+ * @throws {@link errors.SchedulinError}
95
+ * @throws {@link errors.SchedulinTimeoutError}
96
+ *
97
+ * @example
98
+ * await client.webhooks.create({
99
+ * url: "url",
100
+ * events: ["post.published"]
101
+ * })
102
+ */
103
+ create(request, requestOptions) {
104
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
105
+ }
106
+ __create(request, requestOptions) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
109
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
110
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
111
+ const _response = yield core.fetcher({
112
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, "v0/webhooks"),
113
+ method: "POST",
114
+ headers: _headers,
115
+ contentType: "application/json",
116
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
117
+ requestType: "json",
118
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
119
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
120
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
121
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
122
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
123
+ logging: this._options.logging,
124
+ });
125
+ if (_response.ok) {
126
+ return { data: _response.body, rawResponse: _response.rawResponse };
127
+ }
128
+ if (_response.error.reason === "status-code") {
129
+ switch (_response.error.statusCode) {
130
+ case 401:
131
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
132
+ case 500:
133
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
134
+ default:
135
+ throw new errors.SchedulinError({
136
+ statusCode: _response.error.statusCode,
137
+ body: _response.error.body,
138
+ rawResponse: _response.rawResponse,
139
+ });
140
+ }
141
+ }
142
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/webhooks");
143
+ });
144
+ }
145
+ /**
146
+ * Retrieve one webhook endpoint, including failure counters. The signing secret is masked.
147
+ *
148
+ * @param {Schedulin.RetrieveWebhooksRequest} request
149
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
150
+ *
151
+ * @throws {@link Schedulin.UnauthorizedError}
152
+ * @throws {@link Schedulin.InternalServerError}
153
+ * @throws {@link errors.SchedulinError}
154
+ * @throws {@link errors.SchedulinTimeoutError}
155
+ *
156
+ * @example
157
+ * await client.webhooks.retrieve({
158
+ * id: "id"
159
+ * })
160
+ */
161
+ retrieve(request, requestOptions) {
162
+ return core.HttpResponsePromise.fromPromise(this.__retrieve(request, requestOptions));
163
+ }
164
+ __retrieve(request, requestOptions) {
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
167
+ const { id } = request;
168
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
169
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
170
+ const _response = yield core.fetcher({
171
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/webhooks/${core.url.encodePathParam(id)}`),
172
+ method: "GET",
173
+ headers: _headers,
174
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
175
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
176
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
177
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
178
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
179
+ logging: this._options.logging,
180
+ });
181
+ if (_response.ok) {
182
+ return { data: _response.body, rawResponse: _response.rawResponse };
183
+ }
184
+ if (_response.error.reason === "status-code") {
185
+ switch (_response.error.statusCode) {
186
+ case 401:
187
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
188
+ case 500:
189
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
190
+ default:
191
+ throw new errors.SchedulinError({
192
+ statusCode: _response.error.statusCode,
193
+ body: _response.error.body,
194
+ rawResponse: _response.rawResponse,
195
+ });
196
+ }
197
+ }
198
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/webhooks/{id}");
199
+ });
200
+ }
201
+ /**
202
+ * Delete a webhook endpoint and its delivery history. Deliveries already in flight are dropped.
203
+ *
204
+ * @param {Schedulin.DeleteWebhooksRequest} request
205
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
206
+ *
207
+ * @throws {@link Schedulin.UnauthorizedError}
208
+ * @throws {@link Schedulin.InternalServerError}
209
+ * @throws {@link errors.SchedulinError}
210
+ * @throws {@link errors.SchedulinTimeoutError}
211
+ *
212
+ * @example
213
+ * await client.webhooks.delete({
214
+ * id: "id"
215
+ * })
216
+ */
217
+ delete(request, requestOptions) {
218
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
219
+ }
220
+ __delete(request, requestOptions) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
223
+ const { id } = request, _body = __rest(request, ["id"]);
224
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
225
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
226
+ const _response = yield core.fetcher({
227
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/webhooks/${core.url.encodePathParam(id)}`),
228
+ method: "DELETE",
229
+ headers: _headers,
230
+ contentType: "application/json",
231
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
232
+ requestType: "json",
233
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
234
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
235
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
236
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
237
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
238
+ logging: this._options.logging,
239
+ });
240
+ if (_response.ok) {
241
+ return { data: _response.body, rawResponse: _response.rawResponse };
242
+ }
243
+ if (_response.error.reason === "status-code") {
244
+ switch (_response.error.statusCode) {
245
+ case 401:
246
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
247
+ case 500:
248
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
249
+ default:
250
+ throw new errors.SchedulinError({
251
+ statusCode: _response.error.statusCode,
252
+ body: _response.error.body,
253
+ rawResponse: _response.rawResponse,
254
+ });
255
+ }
256
+ }
257
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/webhooks/{id}");
258
+ });
259
+ }
260
+ /**
261
+ * Update URL, subscribed events, description, or enabled state. Re-enabling resets the failure streak.
262
+ *
263
+ * @param {Schedulin.UpdateWebhooksRequest} request
264
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
265
+ *
266
+ * @throws {@link Schedulin.UnauthorizedError}
267
+ * @throws {@link Schedulin.InternalServerError}
268
+ * @throws {@link errors.SchedulinError}
269
+ * @throws {@link errors.SchedulinTimeoutError}
270
+ *
271
+ * @example
272
+ * await client.webhooks.update({
273
+ * id: "id"
274
+ * })
275
+ */
276
+ update(request, requestOptions) {
277
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
278
+ }
279
+ __update(request, requestOptions) {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
282
+ const { id } = request, _body = __rest(request, ["id"]);
283
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
284
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
+ const _response = yield core.fetcher({
286
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/webhooks/${core.url.encodePathParam(id)}`),
287
+ method: "PATCH",
288
+ headers: _headers,
289
+ contentType: "application/json",
290
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
291
+ requestType: "json",
292
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
293
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
294
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
295
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
296
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
297
+ logging: this._options.logging,
298
+ });
299
+ if (_response.ok) {
300
+ return { data: _response.body, rawResponse: _response.rawResponse };
301
+ }
302
+ if (_response.error.reason === "status-code") {
303
+ switch (_response.error.statusCode) {
304
+ case 401:
305
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
306
+ case 500:
307
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
308
+ default:
309
+ throw new errors.SchedulinError({
310
+ statusCode: _response.error.statusCode,
311
+ body: _response.error.body,
312
+ rawResponse: _response.rawResponse,
313
+ });
314
+ }
315
+ }
316
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/webhooks/{id}");
317
+ });
318
+ }
319
+ /**
320
+ * Generate a new signing secret for the endpoint and return it ONCE. The old secret stops signing immediately.
321
+ *
322
+ * @param {Schedulin.RotateSecretWebhooksRequest} request
323
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
324
+ *
325
+ * @throws {@link Schedulin.UnauthorizedError}
326
+ * @throws {@link Schedulin.InternalServerError}
327
+ * @throws {@link errors.SchedulinError}
328
+ * @throws {@link errors.SchedulinTimeoutError}
329
+ *
330
+ * @example
331
+ * await client.webhooks.rotateSecret({
332
+ * id: "id"
333
+ * })
334
+ */
335
+ rotateSecret(request, requestOptions) {
336
+ return core.HttpResponsePromise.fromPromise(this.__rotateSecret(request, requestOptions));
337
+ }
338
+ __rotateSecret(request, requestOptions) {
339
+ return __awaiter(this, void 0, void 0, function* () {
340
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
341
+ const { id } = request, _body = __rest(request, ["id"]);
342
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
343
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
344
+ const _response = yield core.fetcher({
345
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/webhooks/${core.url.encodePathParam(id)}/rotate-secret`),
346
+ method: "POST",
347
+ headers: _headers,
348
+ contentType: "application/json",
349
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
350
+ requestType: "json",
351
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
352
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
353
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
354
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
355
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
356
+ logging: this._options.logging,
357
+ });
358
+ if (_response.ok) {
359
+ return { data: _response.body, rawResponse: _response.rawResponse };
360
+ }
361
+ if (_response.error.reason === "status-code") {
362
+ switch (_response.error.statusCode) {
363
+ case 401:
364
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
365
+ case 500:
366
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
367
+ default:
368
+ throw new errors.SchedulinError({
369
+ statusCode: _response.error.statusCode,
370
+ body: _response.error.body,
371
+ rawResponse: _response.rawResponse,
372
+ });
373
+ }
374
+ }
375
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/webhooks/{id}/rotate-secret");
376
+ });
377
+ }
378
+ /**
379
+ * Send a signed `ping` event to the endpoint URL and record it in the delivery history.
380
+ *
381
+ * @param {Schedulin.TestWebhooksRequest} request
382
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
383
+ *
384
+ * @throws {@link Schedulin.UnauthorizedError}
385
+ * @throws {@link Schedulin.InternalServerError}
386
+ * @throws {@link errors.SchedulinError}
387
+ * @throws {@link errors.SchedulinTimeoutError}
388
+ *
389
+ * @example
390
+ * await client.webhooks.test({
391
+ * id: "id"
392
+ * })
393
+ */
394
+ test(request, requestOptions) {
395
+ return core.HttpResponsePromise.fromPromise(this.__test(request, requestOptions));
396
+ }
397
+ __test(request, requestOptions) {
398
+ return __awaiter(this, void 0, void 0, function* () {
399
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
400
+ const { id } = request, _body = __rest(request, ["id"]);
401
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
402
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
403
+ const _response = yield core.fetcher({
404
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/webhooks/${core.url.encodePathParam(id)}/test`),
405
+ method: "POST",
406
+ headers: _headers,
407
+ contentType: "application/json",
408
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
409
+ requestType: "json",
410
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
411
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
412
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
413
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
414
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
415
+ logging: this._options.logging,
416
+ });
417
+ if (_response.ok) {
418
+ return { data: _response.body, rawResponse: _response.rawResponse };
419
+ }
420
+ if (_response.error.reason === "status-code") {
421
+ switch (_response.error.statusCode) {
422
+ case 401:
423
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
424
+ case 500:
425
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
426
+ default:
427
+ throw new errors.SchedulinError({
428
+ statusCode: _response.error.statusCode,
429
+ body: _response.error.body,
430
+ rawResponse: _response.rawResponse,
431
+ });
432
+ }
433
+ }
434
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/webhooks/{id}/test");
435
+ });
436
+ }
437
+ /**
438
+ * Delivery history for a webhook endpoint: event, status, attempts, last response code, and payload.
439
+ *
440
+ * @param {Schedulin.ListDeliveriesWebhooksRequest} request
441
+ * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
442
+ *
443
+ * @throws {@link Schedulin.UnauthorizedError}
444
+ * @throws {@link Schedulin.InternalServerError}
445
+ * @throws {@link errors.SchedulinError}
446
+ * @throws {@link errors.SchedulinTimeoutError}
447
+ *
448
+ * @example
449
+ * await client.webhooks.listDeliveries({
450
+ * id: "id"
451
+ * })
452
+ */
453
+ listDeliveries(request, requestOptions) {
454
+ return core.HttpResponsePromise.fromPromise(this.__listDeliveries(request, requestOptions));
455
+ }
456
+ __listDeliveries(request, requestOptions) {
457
+ return __awaiter(this, void 0, void 0, function* () {
458
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
459
+ const { id, limit, page } = request;
460
+ const _queryParams = {
461
+ limit,
462
+ page,
463
+ };
464
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
465
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
466
+ const _response = yield core.fetcher({
467
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/webhooks/${core.url.encodePathParam(id)}/deliveries`),
468
+ method: "GET",
469
+ headers: _headers,
470
+ queryString: core.url
471
+ .queryBuilder()
472
+ .addMany(_queryParams)
473
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
474
+ .build(),
475
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
476
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
477
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
478
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
479
+ logging: this._options.logging,
480
+ });
481
+ if (_response.ok) {
482
+ return { data: _response.body, rawResponse: _response.rawResponse };
483
+ }
484
+ if (_response.error.reason === "status-code") {
485
+ switch (_response.error.statusCode) {
486
+ case 401:
487
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
488
+ case 500:
489
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
490
+ default:
491
+ throw new errors.SchedulinError({
492
+ statusCode: _response.error.statusCode,
493
+ body: _response.error.body,
494
+ rawResponse: _response.rawResponse,
495
+ });
496
+ }
497
+ }
498
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/webhooks/{id}/deliveries");
499
+ });
500
+ }
501
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";