@schedulin/sdk 0.1.1 → 0.2.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 (304) 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 +85 -2
  23. package/cjs/api/resources/media/client/Client.js +263 -6
  24. package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.ts +12 -0
  25. package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.ts +7 -0
  26. package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.js +3 -0
  27. package/{esm/api/resources/posts/client/requests/GetJobStatusPostsRequest.d.mts → cjs/api/resources/media/client/requests/DeleteMediaRequest.d.ts} +1 -1
  28. package/cjs/api/resources/media/client/requests/DeleteMediaRequest.js +3 -0
  29. package/cjs/api/resources/media/client/requests/ListMediaRequest.d.ts +1 -1
  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/media/types/ListMediaResponse.d.ts +7 -0
  34. package/cjs/api/resources/media/types/ListMediaResponse.js +3 -0
  35. package/cjs/api/resources/media/types/index.d.ts +1 -1
  36. package/cjs/api/resources/media/types/index.js +1 -1
  37. package/cjs/api/resources/platforms/client/Client.d.ts +28 -0
  38. package/cjs/api/resources/platforms/client/Client.js +111 -0
  39. package/cjs/api/resources/platforms/client/index.d.ts +1 -0
  40. package/cjs/api/resources/platforms/client/index.js +2 -0
  41. package/cjs/api/resources/platforms/exports.d.ts +2 -0
  42. package/cjs/api/resources/platforms/exports.js +21 -0
  43. package/cjs/api/resources/platforms/index.d.ts +2 -0
  44. package/cjs/api/resources/platforms/index.js +18 -0
  45. package/cjs/api/resources/platforms/types/ListPlatformsResponse.d.ts +56 -0
  46. package/cjs/api/resources/platforms/types/ListPlatformsResponse.js +24 -0
  47. package/cjs/api/resources/platforms/types/index.d.ts +1 -0
  48. package/cjs/api/resources/platforms/types/index.js +17 -0
  49. package/cjs/api/resources/posts/client/Client.d.ts +21 -17
  50. package/cjs/api/resources/posts/client/Client.js +29 -61
  51. package/cjs/api/resources/posts/client/requests/ListPostsRequest.d.ts +1 -0
  52. package/cjs/api/resources/posts/client/requests/PostCreate.d.ts +64 -0
  53. package/cjs/api/resources/posts/client/requests/PostCreate.js +63 -0
  54. package/cjs/api/resources/posts/client/requests/index.d.ts +0 -1
  55. package/cjs/api/resources/posts/types/CreatePostsResponse.d.ts +21 -0
  56. package/cjs/api/resources/posts/types/CreatePostsResponse.js +21 -0
  57. package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.d.ts +8 -0
  58. package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.js +11 -0
  59. package/cjs/api/resources/posts/types/index.d.ts +1 -0
  60. package/cjs/api/resources/posts/types/index.js +1 -0
  61. package/cjs/api/resources/socialAccounts/client/Client.d.ts +67 -0
  62. package/cjs/api/resources/socialAccounts/client/Client.js +209 -3
  63. package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.ts +9 -0
  64. package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.js +3 -0
  65. package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.ts +11 -0
  66. package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.js +3 -0
  67. package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.ts +11 -0
  68. package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.js +3 -0
  69. package/cjs/api/resources/socialAccounts/client/requests/index.d.ts +3 -0
  70. package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.ts +22 -0
  71. package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.js +21 -0
  72. package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.ts +12 -0
  73. package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.js +3 -0
  74. package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.ts +12 -0
  75. package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.js +3 -0
  76. package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.ts +3 -0
  77. package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.js +3 -0
  78. package/cjs/api/resources/socialAccounts/types/index.d.ts +3 -0
  79. package/cjs/api/resources/socialAccounts/types/index.js +3 -0
  80. package/cjs/api/resources/tags/client/Client.d.ts +8 -0
  81. package/cjs/api/resources/tags/client/Client.js +12 -3
  82. package/cjs/api/resources/webhooks/client/Client.d.ts +155 -0
  83. package/cjs/api/resources/webhooks/client/Client.js +538 -0
  84. package/cjs/api/resources/webhooks/client/index.d.ts +1 -0
  85. package/cjs/api/resources/webhooks/client/index.js +17 -0
  86. package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.ts +24 -0
  87. package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.js +16 -0
  88. package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.ts +9 -0
  89. package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.js +3 -0
  90. package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.ts +11 -0
  91. package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.js +3 -0
  92. package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.ts +9 -0
  93. package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.js +3 -0
  94. package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.ts +9 -0
  95. package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.js +3 -0
  96. package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.d.ts +9 -0
  97. package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.js +3 -0
  98. package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.ts +25 -0
  99. package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.js +16 -0
  100. package/cjs/api/resources/webhooks/client/requests/index.d.ts +7 -0
  101. package/cjs/api/resources/webhooks/client/requests/index.js +7 -0
  102. package/cjs/api/resources/webhooks/exports.d.ts +2 -0
  103. package/cjs/api/resources/webhooks/exports.js +21 -0
  104. package/cjs/api/resources/webhooks/index.d.ts +1 -0
  105. package/cjs/api/resources/webhooks/index.js +17 -0
  106. package/cjs/api/types/MediaSearch.d.ts +1 -5
  107. package/cjs/api/types/OauthScope.d.ts +12 -0
  108. package/cjs/api/types/OauthScope.js +12 -0
  109. package/cjs/api/types/PostSearch.d.ts +12 -0
  110. package/cjs/api/types/PostSearch.js +10 -0
  111. package/cjs/api/types/PostWithRelations.d.ts +21 -0
  112. package/cjs/api/types/PostWithRelations.js +21 -0
  113. package/cjs/api/types/SocialAccountDisconnectedReason.d.ts +1 -0
  114. package/cjs/api/types/SocialAccountDisconnectedReason.js +1 -0
  115. package/cjs/api/types/SocialPlatform.d.ts +21 -0
  116. package/cjs/api/types/SocialPlatform.js +21 -0
  117. package/cjs/core/exports.d.ts +1 -0
  118. package/cjs/core/exports.js +1 -0
  119. package/cjs/core/fetcher/Fetcher.js +9 -92
  120. package/cjs/core/fetcher/makePassthroughRequest.js +26 -4
  121. package/cjs/core/fetcher/redactUrl.d.ts +2 -0
  122. package/cjs/core/fetcher/redactUrl.js +88 -0
  123. package/cjs/core/file/exports.d.ts +1 -0
  124. package/cjs/core/file/exports.js +2 -0
  125. package/cjs/core/file/file.d.ts +10 -0
  126. package/cjs/core/file/file.js +225 -0
  127. package/cjs/core/file/index.d.ts +2 -0
  128. package/cjs/core/file/index.js +18 -0
  129. package/cjs/core/file/types.d.ts +66 -0
  130. package/cjs/core/file/types.js +2 -0
  131. package/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
  132. package/cjs/core/form-data-utils/FormDataWrapper.js +188 -0
  133. package/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
  134. package/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
  135. package/cjs/core/form-data-utils/index.d.ts +2 -0
  136. package/cjs/core/form-data-utils/index.js +20 -0
  137. package/cjs/core/index.d.ts +2 -0
  138. package/cjs/core/index.js +3 -1
  139. package/cjs/core/requestBody.d.ts +12 -0
  140. package/cjs/core/requestBody.js +26 -0
  141. package/cjs/core/runtime/index.d.ts +1 -1
  142. package/cjs/core/runtime/index.js +2 -1
  143. package/cjs/core/runtime/runtime.d.ts +19 -0
  144. package/cjs/core/runtime/runtime.js +74 -2
  145. package/cjs/core/url/qs.js +2 -2
  146. package/cjs/errors/SchedulinError.d.ts +1 -0
  147. package/cjs/errors/SchedulinError.js +4 -0
  148. package/cjs/errors/SchedulinTimeoutError.d.ts +2 -2
  149. package/cjs/errors/SchedulinTimeoutError.js +39 -5
  150. package/esm/BaseClient.d.mts +12 -0
  151. package/esm/Client.d.mts +9 -0
  152. package/esm/Client.mjs +15 -0
  153. package/esm/api/errors/InternalServerError.d.mts +1 -0
  154. package/esm/api/errors/UnauthorizedError.d.mts +1 -0
  155. package/esm/api/resources/ai/client/Client.d.mts +49 -0
  156. package/esm/api/resources/ai/client/Client.mjs +144 -0
  157. package/esm/api/resources/ai/client/index.d.mts +1 -0
  158. package/esm/api/resources/ai/client/index.mjs +1 -0
  159. package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.d.mts +20 -0
  160. package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.mjs +9 -0
  161. package/esm/api/resources/ai/client/requests/GetGenerationAiRequest.d.mts +9 -0
  162. package/esm/api/resources/ai/client/requests/index.d.mts +2 -0
  163. package/esm/api/resources/ai/client/requests/index.mjs +1 -0
  164. package/esm/api/resources/ai/exports.d.mts +2 -0
  165. package/esm/api/resources/ai/exports.mjs +3 -0
  166. package/esm/api/resources/ai/index.d.mts +1 -0
  167. package/esm/api/resources/ai/index.mjs +1 -0
  168. package/esm/api/resources/index.d.mts +6 -0
  169. package/esm/api/resources/index.mjs +6 -0
  170. package/esm/api/resources/media/client/Client.d.mts +85 -2
  171. package/esm/api/resources/media/client/Client.mjs +264 -7
  172. package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.mts +12 -0
  173. package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.mts +7 -0
  174. package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.mjs +2 -0
  175. package/esm/api/resources/media/client/requests/DeleteMediaRequest.d.mts +9 -0
  176. package/esm/api/resources/media/client/requests/DeleteMediaRequest.mjs +2 -0
  177. package/esm/api/resources/media/client/requests/ListMediaRequest.d.mts +1 -1
  178. package/esm/api/resources/media/client/requests/UploadMediaRequest.d.mts +13 -0
  179. package/esm/api/resources/media/client/requests/UploadMediaRequest.mjs +2 -0
  180. package/esm/api/resources/media/client/requests/index.d.mts +4 -0
  181. package/esm/api/resources/media/types/ListMediaResponse.d.mts +7 -0
  182. package/esm/api/resources/media/types/ListMediaResponse.mjs +2 -0
  183. package/esm/api/resources/media/types/index.d.mts +1 -1
  184. package/esm/api/resources/media/types/index.mjs +1 -1
  185. package/esm/api/resources/platforms/client/Client.d.mts +28 -0
  186. package/esm/api/resources/platforms/client/Client.mjs +74 -0
  187. package/esm/api/resources/platforms/client/index.d.mts +1 -0
  188. package/esm/api/resources/platforms/client/index.mjs +1 -0
  189. package/esm/api/resources/platforms/exports.d.mts +2 -0
  190. package/esm/api/resources/platforms/exports.mjs +3 -0
  191. package/esm/api/resources/platforms/index.d.mts +2 -0
  192. package/esm/api/resources/platforms/index.mjs +2 -0
  193. package/esm/api/resources/platforms/types/ListPlatformsResponse.d.mts +56 -0
  194. package/esm/api/resources/platforms/types/ListPlatformsResponse.mjs +21 -0
  195. package/esm/api/resources/platforms/types/index.d.mts +1 -0
  196. package/esm/api/resources/platforms/types/index.mjs +1 -0
  197. package/esm/api/resources/posts/client/Client.d.mts +21 -17
  198. package/esm/api/resources/posts/client/Client.mjs +29 -61
  199. package/esm/api/resources/posts/client/requests/ListPostsRequest.d.mts +1 -0
  200. package/esm/api/resources/posts/client/requests/PostCreate.d.mts +64 -0
  201. package/esm/api/resources/posts/client/requests/PostCreate.mjs +63 -0
  202. package/esm/api/resources/posts/client/requests/index.d.mts +0 -1
  203. package/esm/api/resources/posts/types/CreatePostsResponse.d.mts +21 -0
  204. package/esm/api/resources/posts/types/CreatePostsResponse.mjs +21 -0
  205. package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.d.mts +8 -0
  206. package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.mjs +8 -0
  207. package/esm/api/resources/posts/types/index.d.mts +1 -0
  208. package/esm/api/resources/posts/types/index.mjs +1 -0
  209. package/esm/api/resources/socialAccounts/client/Client.d.mts +67 -0
  210. package/esm/api/resources/socialAccounts/client/Client.mjs +209 -3
  211. package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.mts +9 -0
  212. package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.mjs +2 -0
  213. package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.mts +11 -0
  214. package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.mjs +2 -0
  215. package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.mts +11 -0
  216. package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.mjs +2 -0
  217. package/esm/api/resources/socialAccounts/client/requests/index.d.mts +3 -0
  218. package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.mts +22 -0
  219. package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.mjs +21 -0
  220. package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.mts +12 -0
  221. package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.mjs +2 -0
  222. package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.mts +12 -0
  223. package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.mjs +2 -0
  224. package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.mts +3 -0
  225. package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.mjs +2 -0
  226. package/esm/api/resources/socialAccounts/types/index.d.mts +3 -0
  227. package/esm/api/resources/socialAccounts/types/index.mjs +3 -0
  228. package/esm/api/resources/tags/client/Client.d.mts +8 -0
  229. package/esm/api/resources/tags/client/Client.mjs +12 -3
  230. package/esm/api/resources/webhooks/client/Client.d.mts +155 -0
  231. package/esm/api/resources/webhooks/client/Client.mjs +501 -0
  232. package/esm/api/resources/webhooks/client/index.d.mts +1 -0
  233. package/esm/api/resources/webhooks/client/index.mjs +1 -0
  234. package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.mts +24 -0
  235. package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.mjs +13 -0
  236. package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.mts +9 -0
  237. package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.mjs +2 -0
  238. package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.mts +11 -0
  239. package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.mjs +2 -0
  240. package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.mts +9 -0
  241. package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.mjs +2 -0
  242. package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.mts +9 -0
  243. package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.mjs +2 -0
  244. package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.d.mts +9 -0
  245. package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.mjs +2 -0
  246. package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.mts +25 -0
  247. package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.mjs +13 -0
  248. package/esm/api/resources/webhooks/client/requests/index.d.mts +7 -0
  249. package/esm/api/resources/webhooks/client/requests/index.mjs +2 -0
  250. package/esm/api/resources/webhooks/exports.d.mts +2 -0
  251. package/esm/api/resources/webhooks/exports.mjs +3 -0
  252. package/esm/api/resources/webhooks/index.d.mts +1 -0
  253. package/esm/api/resources/webhooks/index.mjs +1 -0
  254. package/esm/api/types/MediaSearch.d.mts +1 -5
  255. package/esm/api/types/OauthScope.d.mts +12 -0
  256. package/esm/api/types/OauthScope.mjs +12 -0
  257. package/esm/api/types/PostSearch.d.mts +12 -0
  258. package/esm/api/types/PostSearch.mjs +10 -0
  259. package/esm/api/types/PostWithRelations.d.mts +21 -0
  260. package/esm/api/types/PostWithRelations.mjs +21 -0
  261. package/esm/api/types/SocialAccountDisconnectedReason.d.mts +1 -0
  262. package/esm/api/types/SocialAccountDisconnectedReason.mjs +1 -0
  263. package/esm/api/types/SocialPlatform.d.mts +21 -0
  264. package/esm/api/types/SocialPlatform.mjs +21 -0
  265. package/esm/core/exports.d.mts +1 -0
  266. package/esm/core/exports.mjs +1 -0
  267. package/esm/core/fetcher/Fetcher.mjs +1 -84
  268. package/esm/core/fetcher/makePassthroughRequest.mjs +26 -4
  269. package/esm/core/fetcher/redactUrl.d.mts +2 -0
  270. package/esm/core/fetcher/redactUrl.mjs +84 -0
  271. package/esm/core/file/exports.d.mts +1 -0
  272. package/esm/core/file/exports.mjs +1 -0
  273. package/esm/core/file/file.d.mts +10 -0
  274. package/esm/core/file/file.mjs +188 -0
  275. package/esm/core/file/index.d.mts +2 -0
  276. package/esm/core/file/index.mjs +2 -0
  277. package/esm/core/file/types.d.mts +66 -0
  278. package/esm/core/file/types.mjs +1 -0
  279. package/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
  280. package/esm/core/form-data-utils/FormDataWrapper.mjs +150 -0
  281. package/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
  282. package/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
  283. package/esm/core/form-data-utils/index.d.mts +2 -0
  284. package/esm/core/form-data-utils/index.mjs +2 -0
  285. package/esm/core/index.d.mts +2 -0
  286. package/esm/core/index.mjs +2 -0
  287. package/esm/core/requestBody.d.mts +12 -0
  288. package/esm/core/requestBody.mjs +23 -0
  289. package/esm/core/runtime/index.d.mts +1 -1
  290. package/esm/core/runtime/index.mjs +1 -1
  291. package/esm/core/runtime/runtime.d.mts +19 -0
  292. package/esm/core/runtime/runtime.mjs +73 -2
  293. package/esm/core/url/qs.mjs +2 -2
  294. package/esm/errors/SchedulinError.d.mts +1 -0
  295. package/esm/errors/SchedulinError.mjs +4 -0
  296. package/esm/errors/SchedulinTimeoutError.d.mts +2 -2
  297. package/esm/errors/SchedulinTimeoutError.mjs +6 -5
  298. package/package.json +1 -1
  299. package/cjs/api/resources/media/types/ListMediaRequestCursor.d.ts +0 -4
  300. package/esm/api/resources/media/types/ListMediaRequestCursor.d.mts +0 -4
  301. /package/cjs/api/resources/{media/types/ListMediaRequestCursor.js → ai/client/requests/GetGenerationAiRequest.js} +0 -0
  302. /package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.js → media/client/requests/CreateFromUrlMediaRequest.js} +0 -0
  303. /package/esm/api/resources/{media/types/ListMediaRequestCursor.mjs → ai/client/requests/GetGenerationAiRequest.mjs} +0 -0
  304. /package/esm/api/resources/{posts/client/requests/GetJobStatusPostsRequest.mjs → media/client/requests/CreateFromUrlMediaRequest.mjs} +0 -0
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var GenerateImageAiRequest;
3
+ (function (GenerateImageAiRequest) {
4
+ GenerateImageAiRequest.ModelKey = {
5
+ FluxSchnell: "flux_schnell",
6
+ FluxDev: "flux_dev",
7
+ FluxProUltra: "flux_pro_ultra",
8
+ };
9
+ })(GenerateImageAiRequest || (GenerateImageAiRequest = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface GetGenerationAiRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ export { GenerateImageAiRequest } from "./GenerateImageAiRequest.mjs";
2
+ export type { GetGenerationAiRequest } from "./GetGenerationAiRequest.mjs";
@@ -0,0 +1 @@
1
+ export { GenerateImageAiRequest } from "./GenerateImageAiRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { AiClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { AiClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -1,6 +1,10 @@
1
+ export * from "./ai/client/requests/index.mjs";
2
+ export * as ai from "./ai/index.mjs";
1
3
  export * from "./media/client/requests/index.mjs";
2
4
  export * as media from "./media/index.mjs";
3
5
  export * from "./media/types/index.mjs";
6
+ export * as platforms from "./platforms/index.mjs";
7
+ export * from "./platforms/types/index.mjs";
4
8
  export * from "./posts/client/requests/index.mjs";
5
9
  export * as posts from "./posts/index.mjs";
6
10
  export * from "./posts/types/index.mjs";
@@ -10,3 +14,5 @@ export * from "./socialAccounts/types/index.mjs";
10
14
  export * from "./tags/client/requests/index.mjs";
11
15
  export * as tags from "./tags/index.mjs";
12
16
  export * from "./tags/types/index.mjs";
17
+ export * from "./webhooks/client/requests/index.mjs";
18
+ export * as webhooks from "./webhooks/index.mjs";
@@ -1,6 +1,10 @@
1
+ export * from "./ai/client/requests/index.mjs";
2
+ export * as ai from "./ai/index.mjs";
1
3
  export * from "./media/client/requests/index.mjs";
2
4
  export * as media from "./media/index.mjs";
3
5
  export * from "./media/types/index.mjs";
6
+ export * as platforms from "./platforms/index.mjs";
7
+ export * from "./platforms/types/index.mjs";
4
8
  export * from "./posts/client/requests/index.mjs";
5
9
  export * as posts from "./posts/index.mjs";
6
10
  export * from "./posts/types/index.mjs";
@@ -10,3 +14,5 @@ export * from "./socialAccounts/types/index.mjs";
10
14
  export * from "./tags/client/requests/index.mjs";
11
15
  export * as tags from "./tags/index.mjs";
12
16
  export * from "./tags/types/index.mjs";
17
+ export * from "./webhooks/client/requests/index.mjs";
18
+ export * as webhooks from "./webhooks/index.mjs";
@@ -10,6 +10,59 @@ export declare namespace MediaClient {
10
10
  export declare class MediaClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<MediaClient.Options>;
12
12
  constructor(options: MediaClient.Options);
13
+ /**
14
+ * Downloads a publicly reachable image or video into the media library and returns the media record. Use the returned `url` in `media[].url` when creating a post. Prefer this over the presign flow whenever your client cannot issue a raw HTTP PUT (e.g. an AI agent). The source URL must be public (no auth), http(s), and at most the post upload limit (250 MB); SVG and other active content is rejected.
15
+ *
16
+ * @param {Schedulin.CreateFromUrlMediaRequest} request
17
+ * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Schedulin.UnauthorizedError}
20
+ * @throws {@link Schedulin.InternalServerError}
21
+ * @throws {@link errors.SchedulinError}
22
+ * @throws {@link errors.SchedulinTimeoutError}
23
+ *
24
+ * @example
25
+ * await client.media.createFromUrl({
26
+ * url: "url"
27
+ * })
28
+ */
29
+ createFromUrl(request: Schedulin.CreateFromUrlMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
30
+ private __createFromUrl;
31
+ /**
32
+ * Returns a short-lived URL to a page where the user uploads files from their device (or a pasted attachment) straight into the media library. Hand the URL to the user; once they've uploaded, call GET /v0/media (list media, newest first) and reference the returned `url` when creating a post. Use this whenever the file isn't already at a public URL.
33
+ *
34
+ * @param {Schedulin.CreateUploadLinkMediaRequest} request
35
+ * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link Schedulin.UnauthorizedError}
38
+ * @throws {@link Schedulin.InternalServerError}
39
+ * @throws {@link errors.SchedulinError}
40
+ * @throws {@link errors.SchedulinTimeoutError}
41
+ *
42
+ * @example
43
+ * await client.media.createUploadLink()
44
+ */
45
+ createUploadLink(request?: Schedulin.CreateUploadLinkMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
46
+ private __createUploadLink;
47
+ /**
48
+ * Upload raw image, video, or audio bytes directly as multipart/form-data. The file is stored in your media library and the record is returned; use its `url` in `media[].url` when creating a post. Max 250 MB; SVG and other active content is rejected. For a file already hosted at a public URL, prefer POST /v0/media/from-url.
49
+ *
50
+ * @param {Schedulin.UploadMediaRequest} request
51
+ * @param {MediaClient.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
+ * import { createReadStream } from "fs";
60
+ * await client.media.upload({
61
+ * file: fs.createReadStream("/path/to/your/file")
62
+ * })
63
+ */
64
+ upload(request: Schedulin.UploadMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
65
+ private __upload;
13
66
  /**
14
67
  * Retrieve media information by its ID
15
68
  *
@@ -18,6 +71,8 @@ export declare class MediaClient {
18
71
  *
19
72
  * @throws {@link Schedulin.UnauthorizedError}
20
73
  * @throws {@link Schedulin.InternalServerError}
74
+ * @throws {@link errors.SchedulinError}
75
+ * @throws {@link errors.SchedulinTimeoutError}
21
76
  *
22
77
  * @example
23
78
  * await client.media.retrieve({
@@ -34,6 +89,8 @@ export declare class MediaClient {
34
89
  *
35
90
  * @throws {@link Schedulin.UnauthorizedError}
36
91
  * @throws {@link Schedulin.InternalServerError}
92
+ * @throws {@link errors.SchedulinError}
93
+ * @throws {@link errors.SchedulinTimeoutError}
37
94
  *
38
95
  * @example
39
96
  * await client.media.update({
@@ -44,18 +101,38 @@ export declare class MediaClient {
44
101
  update(request: Schedulin.UpdateMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.Media>;
45
102
  private __update;
46
103
  /**
47
- * List media for the organization with cursor pagination, search, type and tag filters
104
+ * Delete a media object and remove its files from storage. Fails with a conflict when the media is attached to any post — remove it from those posts (or delete them) first.
105
+ *
106
+ * @param {Schedulin.DeleteMediaRequest} request
107
+ * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
108
+ *
109
+ * @throws {@link Schedulin.UnauthorizedError}
110
+ * @throws {@link Schedulin.InternalServerError}
111
+ * @throws {@link errors.SchedulinError}
112
+ * @throws {@link errors.SchedulinTimeoutError}
113
+ *
114
+ * @example
115
+ * await client.media.delete({
116
+ * id: "id"
117
+ * })
118
+ */
119
+ delete(request: Schedulin.DeleteMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
120
+ private __delete;
121
+ /**
122
+ * List media for the organization with page pagination, search, type and tag filters
48
123
  *
49
124
  * @param {Schedulin.ListMediaRequest} request
50
125
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
51
126
  *
52
127
  * @throws {@link Schedulin.UnauthorizedError}
53
128
  * @throws {@link Schedulin.InternalServerError}
129
+ * @throws {@link errors.SchedulinError}
130
+ * @throws {@link errors.SchedulinTimeoutError}
54
131
  *
55
132
  * @example
56
133
  * await client.media.list()
57
134
  */
58
- list(request?: Schedulin.ListMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
135
+ list(request?: Schedulin.ListMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.ListMediaResponse>;
59
136
  private __list;
60
137
  /**
61
138
  * Replace the set of tags attached to a media item with the provided tag IDs
@@ -65,6 +142,8 @@ export declare class MediaClient {
65
142
  *
66
143
  * @throws {@link Schedulin.UnauthorizedError}
67
144
  * @throws {@link Schedulin.InternalServerError}
145
+ * @throws {@link errors.SchedulinError}
146
+ * @throws {@link errors.SchedulinTimeoutError}
68
147
  *
69
148
  * @example
70
149
  * await client.media.setTags({
@@ -81,6 +160,8 @@ export declare class MediaClient {
81
160
  *
82
161
  * @throws {@link Schedulin.UnauthorizedError}
83
162
  * @throws {@link Schedulin.InternalServerError}
163
+ * @throws {@link errors.SchedulinError}
164
+ * @throws {@link errors.SchedulinTimeoutError}
84
165
  *
85
166
  * @example
86
167
  * await client.media.countByTag()
@@ -95,6 +176,8 @@ export declare class MediaClient {
95
176
  *
96
177
  * @throws {@link Schedulin.UnauthorizedError}
97
178
  * @throws {@link Schedulin.InternalServerError}
179
+ * @throws {@link errors.SchedulinError}
180
+ * @throws {@link errors.SchedulinTimeoutError}
98
181
  *
99
182
  * @example
100
183
  * await client.media.createPresignedPost({
@@ -20,8 +20,9 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  return t;
21
21
  };
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
- import { mergeHeaders } from "../../../../core/headers.mjs";
23
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
25
26
  import * as environments from "../../../../environments.mjs";
26
27
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
27
28
  import * as errors from "../../../../errors/index.mjs";
@@ -30,6 +31,191 @@ export class MediaClient {
30
31
  constructor(options) {
31
32
  this._options = normalizeClientOptionsWithAuth(options);
32
33
  }
34
+ /**
35
+ * Downloads a publicly reachable image or video into the media library and returns the media record. Use the returned `url` in `media[].url` when creating a post. Prefer this over the presign flow whenever your client cannot issue a raw HTTP PUT (e.g. an AI agent). The source URL must be public (no auth), http(s), and at most the post upload limit (250 MB); SVG and other active content is rejected.
36
+ *
37
+ * @param {Schedulin.CreateFromUrlMediaRequest} request
38
+ * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link Schedulin.UnauthorizedError}
41
+ * @throws {@link Schedulin.InternalServerError}
42
+ * @throws {@link errors.SchedulinError}
43
+ * @throws {@link errors.SchedulinTimeoutError}
44
+ *
45
+ * @example
46
+ * await client.media.createFromUrl({
47
+ * url: "url"
48
+ * })
49
+ */
50
+ createFromUrl(request, requestOptions) {
51
+ return core.HttpResponsePromise.fromPromise(this.__createFromUrl(request, requestOptions));
52
+ }
53
+ __createFromUrl(request, requestOptions) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
56
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
57
+ 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);
58
+ const _response = yield core.fetcher({
59
+ 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/media/from-url"),
60
+ method: "POST",
61
+ headers: _headers,
62
+ contentType: "application/json",
63
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
64
+ requestType: "json",
65
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
66
+ 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,
67
+ 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,
68
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
69
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
70
+ logging: this._options.logging,
71
+ });
72
+ if (_response.ok) {
73
+ return { data: _response.body, rawResponse: _response.rawResponse };
74
+ }
75
+ if (_response.error.reason === "status-code") {
76
+ switch (_response.error.statusCode) {
77
+ case 401:
78
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
79
+ case 500:
80
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
81
+ default:
82
+ throw new errors.SchedulinError({
83
+ statusCode: _response.error.statusCode,
84
+ body: _response.error.body,
85
+ rawResponse: _response.rawResponse,
86
+ });
87
+ }
88
+ }
89
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/media/from-url");
90
+ });
91
+ }
92
+ /**
93
+ * Returns a short-lived URL to a page where the user uploads files from their device (or a pasted attachment) straight into the media library. Hand the URL to the user; once they've uploaded, call GET /v0/media (list media, newest first) and reference the returned `url` when creating a post. Use this whenever the file isn't already at a public URL.
94
+ *
95
+ * @param {Schedulin.CreateUploadLinkMediaRequest} request
96
+ * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
97
+ *
98
+ * @throws {@link Schedulin.UnauthorizedError}
99
+ * @throws {@link Schedulin.InternalServerError}
100
+ * @throws {@link errors.SchedulinError}
101
+ * @throws {@link errors.SchedulinTimeoutError}
102
+ *
103
+ * @example
104
+ * await client.media.createUploadLink()
105
+ */
106
+ createUploadLink(request = {}, requestOptions) {
107
+ return core.HttpResponsePromise.fromPromise(this.__createUploadLink(request, requestOptions));
108
+ }
109
+ __createUploadLink() {
110
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
111
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
112
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
113
+ 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);
114
+ const _response = yield core.fetcher({
115
+ 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/media/upload-link"),
116
+ method: "POST",
117
+ headers: _headers,
118
+ contentType: "application/json",
119
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
120
+ requestType: "json",
121
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
122
+ 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,
123
+ 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,
124
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
125
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
126
+ logging: this._options.logging,
127
+ });
128
+ if (_response.ok) {
129
+ return { data: _response.body, rawResponse: _response.rawResponse };
130
+ }
131
+ if (_response.error.reason === "status-code") {
132
+ switch (_response.error.statusCode) {
133
+ case 401:
134
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
135
+ case 500:
136
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
137
+ default:
138
+ throw new errors.SchedulinError({
139
+ statusCode: _response.error.statusCode,
140
+ body: _response.error.body,
141
+ rawResponse: _response.rawResponse,
142
+ });
143
+ }
144
+ }
145
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/media/upload-link");
146
+ });
147
+ }
148
+ /**
149
+ * Upload raw image, video, or audio bytes directly as multipart/form-data. The file is stored in your media library and the record is returned; use its `url` in `media[].url` when creating a post. Max 250 MB; SVG and other active content is rejected. For a file already hosted at a public URL, prefer POST /v0/media/from-url.
150
+ *
151
+ * @param {Schedulin.UploadMediaRequest} request
152
+ * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
153
+ *
154
+ * @throws {@link Schedulin.UnauthorizedError}
155
+ * @throws {@link Schedulin.InternalServerError}
156
+ * @throws {@link errors.SchedulinError}
157
+ * @throws {@link errors.SchedulinTimeoutError}
158
+ *
159
+ * @example
160
+ * import { createReadStream } from "fs";
161
+ * await client.media.upload({
162
+ * file: fs.createReadStream("/path/to/your/file")
163
+ * })
164
+ */
165
+ upload(request, requestOptions) {
166
+ return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));
167
+ }
168
+ __upload(request, requestOptions) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
171
+ const _body = yield core.newFormData();
172
+ yield _body.appendFile("file", request.file);
173
+ if (request.name != null) {
174
+ _body.append("name", request.name);
175
+ }
176
+ if (request.alt != null) {
177
+ _body.append("alt", request.alt);
178
+ }
179
+ if (request.contentType != null) {
180
+ _body.append("contentType", request.contentType);
181
+ }
182
+ const _maybeEncodedRequest = yield _body.getRequest();
183
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
184
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
185
+ const _response = yield core.fetcher({
186
+ 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/media/upload"),
187
+ method: "POST",
188
+ headers: _headers,
189
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
190
+ requestType: "file",
191
+ duplex: _maybeEncodedRequest.duplex,
192
+ body: _maybeEncodedRequest.body,
193
+ 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,
194
+ 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,
195
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
196
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
197
+ logging: this._options.logging,
198
+ });
199
+ if (_response.ok) {
200
+ return { data: _response.body, rawResponse: _response.rawResponse };
201
+ }
202
+ if (_response.error.reason === "status-code") {
203
+ switch (_response.error.statusCode) {
204
+ case 401:
205
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
206
+ case 500:
207
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
208
+ default:
209
+ throw new errors.SchedulinError({
210
+ statusCode: _response.error.statusCode,
211
+ body: _response.error.body,
212
+ rawResponse: _response.rawResponse,
213
+ });
214
+ }
215
+ }
216
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/media/upload");
217
+ });
218
+ }
33
219
  /**
34
220
  * Retrieve media information by its ID
35
221
  *
@@ -38,6 +224,8 @@ export class MediaClient {
38
224
  *
39
225
  * @throws {@link Schedulin.UnauthorizedError}
40
226
  * @throws {@link Schedulin.InternalServerError}
227
+ * @throws {@link errors.SchedulinError}
228
+ * @throws {@link errors.SchedulinTimeoutError}
41
229
  *
42
230
  * @example
43
231
  * await client.media.retrieve({
@@ -92,6 +280,8 @@ export class MediaClient {
92
280
  *
93
281
  * @throws {@link Schedulin.UnauthorizedError}
94
282
  * @throws {@link Schedulin.InternalServerError}
283
+ * @throws {@link errors.SchedulinError}
284
+ * @throws {@link errors.SchedulinTimeoutError}
95
285
  *
96
286
  * @example
97
287
  * await client.media.update({
@@ -115,7 +305,7 @@ export class MediaClient {
115
305
  contentType: "application/json",
116
306
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
117
307
  requestType: "json",
118
- body: _body,
308
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
119
309
  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
310
  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
311
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -143,13 +333,74 @@ export class MediaClient {
143
333
  });
144
334
  }
145
335
  /**
146
- * List media for the organization with cursor pagination, search, type and tag filters
336
+ * Delete a media object and remove its files from storage. Fails with a conflict when the media is attached to any post — remove it from those posts (or delete them) first.
337
+ *
338
+ * @param {Schedulin.DeleteMediaRequest} request
339
+ * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
340
+ *
341
+ * @throws {@link Schedulin.UnauthorizedError}
342
+ * @throws {@link Schedulin.InternalServerError}
343
+ * @throws {@link errors.SchedulinError}
344
+ * @throws {@link errors.SchedulinTimeoutError}
345
+ *
346
+ * @example
347
+ * await client.media.delete({
348
+ * id: "id"
349
+ * })
350
+ */
351
+ delete(request, requestOptions) {
352
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
353
+ }
354
+ __delete(request, requestOptions) {
355
+ return __awaiter(this, void 0, void 0, function* () {
356
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
357
+ const { id } = request, _body = __rest(request, ["id"]);
358
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
359
+ 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);
360
+ const _response = yield core.fetcher({
361
+ 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/media/${core.url.encodePathParam(id)}`),
362
+ method: "DELETE",
363
+ headers: _headers,
364
+ contentType: "application/json",
365
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
366
+ requestType: "json",
367
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
368
+ 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,
369
+ 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,
370
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
371
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
372
+ logging: this._options.logging,
373
+ });
374
+ if (_response.ok) {
375
+ return { data: _response.body, rawResponse: _response.rawResponse };
376
+ }
377
+ if (_response.error.reason === "status-code") {
378
+ switch (_response.error.statusCode) {
379
+ case 401:
380
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
381
+ case 500:
382
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
383
+ default:
384
+ throw new errors.SchedulinError({
385
+ statusCode: _response.error.statusCode,
386
+ body: _response.error.body,
387
+ rawResponse: _response.rawResponse,
388
+ });
389
+ }
390
+ }
391
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/media/{id}");
392
+ });
393
+ }
394
+ /**
395
+ * List media for the organization with page pagination, search, type and tag filters
147
396
  *
148
397
  * @param {Schedulin.ListMediaRequest} request
149
398
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
150
399
  *
151
400
  * @throws {@link Schedulin.UnauthorizedError}
152
401
  * @throws {@link Schedulin.InternalServerError}
402
+ * @throws {@link errors.SchedulinError}
403
+ * @throws {@link errors.SchedulinTimeoutError}
153
404
  *
154
405
  * @example
155
406
  * await client.media.list()
@@ -160,9 +411,9 @@ export class MediaClient {
160
411
  __list() {
161
412
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
162
413
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
163
- const { cursor, limit, q, type: type_, tagIds, tagMode } = request;
414
+ const { page, limit, q, type: type_, tagIds, tagMode } = request;
164
415
  const _queryParams = {
165
- cursor,
416
+ page,
166
417
  limit,
167
418
  q,
168
419
  type: type_ != null ? type_ : undefined,
@@ -214,6 +465,8 @@ export class MediaClient {
214
465
  *
215
466
  * @throws {@link Schedulin.UnauthorizedError}
216
467
  * @throws {@link Schedulin.InternalServerError}
468
+ * @throws {@link errors.SchedulinError}
469
+ * @throws {@link errors.SchedulinTimeoutError}
217
470
  *
218
471
  * @example
219
472
  * await client.media.setTags({
@@ -237,7 +490,7 @@ export class MediaClient {
237
490
  contentType: "application/json",
238
491
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
239
492
  requestType: "json",
240
- body: _body,
493
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
241
494
  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,
242
495
  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,
243
496
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -271,6 +524,8 @@ export class MediaClient {
271
524
  *
272
525
  * @throws {@link Schedulin.UnauthorizedError}
273
526
  * @throws {@link Schedulin.InternalServerError}
527
+ * @throws {@link errors.SchedulinError}
528
+ * @throws {@link errors.SchedulinTimeoutError}
274
529
  *
275
530
  * @example
276
531
  * await client.media.countByTag()
@@ -322,6 +577,8 @@ export class MediaClient {
322
577
  *
323
578
  * @throws {@link Schedulin.UnauthorizedError}
324
579
  * @throws {@link Schedulin.InternalServerError}
580
+ * @throws {@link errors.SchedulinError}
581
+ * @throws {@link errors.SchedulinTimeoutError}
325
582
  *
326
583
  * @example
327
584
  * await client.media.createPresignedPost({
@@ -344,7 +601,7 @@ export class MediaClient {
344
601
  contentType: "application/json",
345
602
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
346
603
  requestType: "json",
347
- body: request,
604
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
348
605
  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,
349
606
  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,
350
607
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * url: "url"
5
+ * }
6
+ */
7
+ export interface CreateFromUrlMediaRequest {
8
+ url: string;
9
+ name?: string;
10
+ alt?: string | null;
11
+ contentType?: string;
12
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface CreateUploadLinkMediaRequest {
6
+ expiresInHours?: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface DeleteMediaRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -4,7 +4,7 @@ import type * as Schedulin from "../../../../index.mjs";
4
4
  * {}
5
5
  */
6
6
  export interface ListMediaRequest {
7
- cursor?: Schedulin.ListMediaRequestCursor | null;
7
+ page?: number;
8
8
  limit?: number;
9
9
  q?: string;
10
10
  type?: Schedulin.ListMediaRequestType;
@@ -0,0 +1,13 @@
1
+ import type * as core from "../../../../../core/index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * file: fs.createReadStream("/path/to/your/file")
6
+ * }
7
+ */
8
+ export interface UploadMediaRequest {
9
+ file: core.file.Uploadable;
10
+ name?: string;
11
+ alt?: string;
12
+ contentType?: string;
13
+ }