@schedulin/sdk 0.1.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 (599) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +303 -0
  3. package/cjs/BaseClient.d.ts +42 -0
  4. package/cjs/BaseClient.js +74 -0
  5. package/cjs/Client.d.ts +35 -0
  6. package/cjs/Client.js +98 -0
  7. package/cjs/api/errors/InternalServerError.d.ts +6 -0
  8. package/cjs/api/errors/InternalServerError.js +54 -0
  9. package/cjs/api/errors/UnauthorizedError.d.ts +6 -0
  10. package/cjs/api/errors/UnauthorizedError.js +54 -0
  11. package/cjs/api/errors/index.d.ts +2 -0
  12. package/cjs/api/errors/index.js +18 -0
  13. package/cjs/api/index.d.ts +3 -0
  14. package/cjs/api/index.js +19 -0
  15. package/cjs/api/resources/index.d.ts +12 -0
  16. package/cjs/api/resources/index.js +51 -0
  17. package/cjs/api/resources/media/client/Client.d.ts +107 -0
  18. package/cjs/api/resources/media/client/Client.js +411 -0
  19. package/cjs/api/resources/media/client/index.d.ts +1 -0
  20. package/cjs/api/resources/media/client/index.js +17 -0
  21. package/cjs/api/resources/media/client/requests/CreatePresignedPost.d.ts +21 -0
  22. package/cjs/api/resources/media/client/requests/CreatePresignedPost.js +12 -0
  23. package/cjs/api/resources/media/client/requests/ListMediaRequest.d.ts +13 -0
  24. package/cjs/api/resources/media/client/requests/ListMediaRequest.js +3 -0
  25. package/cjs/api/resources/media/client/requests/RetrieveMediaRequest.d.ts +9 -0
  26. package/cjs/api/resources/media/client/requests/RetrieveMediaRequest.js +3 -0
  27. package/cjs/api/resources/media/client/requests/SetTagsMediaRequest.d.ts +11 -0
  28. package/cjs/api/resources/media/client/requests/SetTagsMediaRequest.js +3 -0
  29. package/cjs/api/resources/media/client/requests/UpdateMediaRequest.d.ts +16 -0
  30. package/cjs/api/resources/media/client/requests/UpdateMediaRequest.js +3 -0
  31. package/cjs/api/resources/media/client/requests/index.d.ts +5 -0
  32. package/cjs/api/resources/media/client/requests/index.js +5 -0
  33. package/cjs/api/resources/media/exports.d.ts +2 -0
  34. package/cjs/api/resources/media/exports.js +21 -0
  35. package/cjs/api/resources/media/index.d.ts +2 -0
  36. package/cjs/api/resources/media/index.js +18 -0
  37. package/cjs/api/resources/media/types/CountByTagMediaResponse.d.ts +12 -0
  38. package/cjs/api/resources/media/types/CountByTagMediaResponse.js +3 -0
  39. package/cjs/api/resources/media/types/ListMediaRequestCursor.d.ts +4 -0
  40. package/cjs/api/resources/media/types/ListMediaRequestCursor.js +3 -0
  41. package/cjs/api/resources/media/types/ListMediaRequestTagMode.d.ts +5 -0
  42. package/cjs/api/resources/media/types/ListMediaRequestTagMode.js +8 -0
  43. package/cjs/api/resources/media/types/ListMediaRequestType.d.ts +6 -0
  44. package/cjs/api/resources/media/types/ListMediaRequestType.js +9 -0
  45. package/cjs/api/resources/media/types/index.d.ts +4 -0
  46. package/cjs/api/resources/media/types/index.js +20 -0
  47. package/cjs/api/resources/posts/client/Client.d.ts +187 -0
  48. package/cjs/api/resources/posts/client/Client.js +710 -0
  49. package/cjs/api/resources/posts/client/index.d.ts +1 -0
  50. package/cjs/api/resources/posts/client/index.js +17 -0
  51. package/cjs/api/resources/posts/client/requests/AnalyticsSeriesPostsRequest.d.ts +10 -0
  52. package/cjs/api/resources/posts/client/requests/AnalyticsSeriesPostsRequest.js +3 -0
  53. package/cjs/api/resources/posts/client/requests/AnalyticsSummaryPostsRequest.d.ts +9 -0
  54. package/cjs/api/resources/posts/client/requests/AnalyticsSummaryPostsRequest.js +3 -0
  55. package/cjs/api/resources/posts/client/requests/DeletePostsRequest.d.ts +9 -0
  56. package/cjs/api/resources/posts/client/requests/DeletePostsRequest.js +3 -0
  57. package/cjs/api/resources/posts/client/requests/GetJobStatusPostsRequest.d.ts +9 -0
  58. package/cjs/api/resources/posts/client/requests/GetJobStatusPostsRequest.js +3 -0
  59. package/cjs/api/resources/posts/client/requests/ListPostsRequest.d.ts +15 -0
  60. package/cjs/api/resources/posts/client/requests/ListPostsRequest.js +3 -0
  61. package/cjs/api/resources/posts/client/requests/PostCreate.d.ts +183 -0
  62. package/cjs/api/resources/posts/client/requests/PostCreate.js +103 -0
  63. package/cjs/api/resources/posts/client/requests/PublishDraftPostsRequest.d.ts +10 -0
  64. package/cjs/api/resources/posts/client/requests/PublishDraftPostsRequest.js +3 -0
  65. package/cjs/api/resources/posts/client/requests/RetrievePostsRequest.d.ts +9 -0
  66. package/cjs/api/resources/posts/client/requests/RetrievePostsRequest.js +3 -0
  67. package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.d.ts +36 -0
  68. package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.js +14 -0
  69. package/cjs/api/resources/posts/client/requests/UpdateTagsPostsRequest.d.ts +11 -0
  70. package/cjs/api/resources/posts/client/requests/UpdateTagsPostsRequest.js +3 -0
  71. package/cjs/api/resources/posts/client/requests/V0PostCountByTabRequest.d.ts +7 -0
  72. package/cjs/api/resources/posts/client/requests/V0PostCountByTabRequest.js +3 -0
  73. package/cjs/api/resources/posts/client/requests/index.d.ts +11 -0
  74. package/cjs/api/resources/posts/client/requests/index.js +7 -0
  75. package/cjs/api/resources/posts/exports.d.ts +2 -0
  76. package/cjs/api/resources/posts/exports.js +21 -0
  77. package/cjs/api/resources/posts/index.d.ts +2 -0
  78. package/cjs/api/resources/posts/index.js +18 -0
  79. package/cjs/api/resources/posts/types/AnalyticsSeriesPostsResponse.d.ts +15 -0
  80. package/cjs/api/resources/posts/types/AnalyticsSeriesPostsResponse.js +3 -0
  81. package/cjs/api/resources/posts/types/AnalyticsSummaryPostsResponse.d.ts +6 -0
  82. package/cjs/api/resources/posts/types/AnalyticsSummaryPostsResponse.js +3 -0
  83. package/cjs/api/resources/posts/types/CreatePostsResponse.d.ts +59 -0
  84. package/cjs/api/resources/posts/types/CreatePostsResponse.js +36 -0
  85. package/cjs/api/resources/posts/types/ListPostsRequestApprovalStatus.d.ts +7 -0
  86. package/cjs/api/resources/posts/types/ListPostsRequestApprovalStatus.js +10 -0
  87. package/cjs/api/resources/posts/types/ListPostsRequestStatus.d.ts +8 -0
  88. package/cjs/api/resources/posts/types/ListPostsRequestStatus.js +11 -0
  89. package/cjs/api/resources/posts/types/ListPostsRequestTagMode.d.ts +5 -0
  90. package/cjs/api/resources/posts/types/ListPostsRequestTagMode.js +8 -0
  91. package/cjs/api/resources/posts/types/ListPostsResponse.d.ts +7 -0
  92. package/cjs/api/resources/posts/types/ListPostsResponse.js +3 -0
  93. package/cjs/api/resources/posts/types/index.d.ts +7 -0
  94. package/cjs/api/resources/posts/types/index.js +23 -0
  95. package/cjs/api/resources/socialAccounts/client/Client.d.ts +107 -0
  96. package/cjs/api/resources/socialAccounts/client/Client.js +415 -0
  97. package/cjs/api/resources/socialAccounts/client/index.d.ts +1 -0
  98. package/cjs/api/resources/socialAccounts/client/index.js +17 -0
  99. package/cjs/api/resources/socialAccounts/client/requests/DeleteSocialAccountsRequest.d.ts +9 -0
  100. package/cjs/api/resources/socialAccounts/client/requests/DeleteSocialAccountsRequest.js +3 -0
  101. package/cjs/api/resources/socialAccounts/client/requests/PinterestBoardsSocialAccountsRequest.d.ts +9 -0
  102. package/cjs/api/resources/socialAccounts/client/requests/PinterestBoardsSocialAccountsRequest.js +3 -0
  103. package/cjs/api/resources/socialAccounts/client/requests/TiktokCreatorInfoSocialAccountsRequest.d.ts +9 -0
  104. package/cjs/api/resources/socialAccounts/client/requests/TiktokCreatorInfoSocialAccountsRequest.js +3 -0
  105. package/cjs/api/resources/socialAccounts/client/requests/UpdateSocialAccountsRequest.d.ts +17 -0
  106. package/cjs/api/resources/socialAccounts/client/requests/UpdateSocialAccountsRequest.js +11 -0
  107. package/cjs/api/resources/socialAccounts/client/requests/UpdateTimezoneSocialAccountsRequest.d.ts +11 -0
  108. package/cjs/api/resources/socialAccounts/client/requests/UpdateTimezoneSocialAccountsRequest.js +3 -0
  109. package/cjs/api/resources/socialAccounts/client/requests/index.d.ts +5 -0
  110. package/cjs/api/resources/socialAccounts/client/requests/index.js +5 -0
  111. package/cjs/api/resources/socialAccounts/exports.d.ts +2 -0
  112. package/cjs/api/resources/socialAccounts/exports.js +21 -0
  113. package/cjs/api/resources/socialAccounts/index.d.ts +2 -0
  114. package/cjs/api/resources/socialAccounts/index.js +18 -0
  115. package/cjs/api/resources/socialAccounts/types/DeleteSocialAccountsResponse.d.ts +3 -0
  116. package/cjs/api/resources/socialAccounts/types/DeleteSocialAccountsResponse.js +3 -0
  117. package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.ts +41 -0
  118. package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.js +30 -0
  119. package/cjs/api/resources/socialAccounts/types/PinterestBoardsSocialAccountsResponse.d.ts +21 -0
  120. package/cjs/api/resources/socialAccounts/types/PinterestBoardsSocialAccountsResponse.js +18 -0
  121. package/cjs/api/resources/socialAccounts/types/TiktokCreatorInfoSocialAccountsResponse.d.ts +21 -0
  122. package/cjs/api/resources/socialAccounts/types/TiktokCreatorInfoSocialAccountsResponse.js +3 -0
  123. package/cjs/api/resources/socialAccounts/types/UpdateSocialAccountsResponse.d.ts +3 -0
  124. package/cjs/api/resources/socialAccounts/types/UpdateSocialAccountsResponse.js +3 -0
  125. package/cjs/api/resources/socialAccounts/types/UpdateTimezoneSocialAccountsResponse.d.ts +3 -0
  126. package/cjs/api/resources/socialAccounts/types/UpdateTimezoneSocialAccountsResponse.js +3 -0
  127. package/cjs/api/resources/socialAccounts/types/index.d.ts +6 -0
  128. package/cjs/api/resources/socialAccounts/types/index.js +22 -0
  129. package/cjs/api/resources/tags/client/Client.d.ts +78 -0
  130. package/cjs/api/resources/tags/client/Client.js +303 -0
  131. package/cjs/api/resources/tags/client/index.d.ts +1 -0
  132. package/cjs/api/resources/tags/client/index.js +17 -0
  133. package/cjs/api/resources/tags/client/requests/CreateTagsRequest.d.ts +11 -0
  134. package/cjs/api/resources/tags/client/requests/CreateTagsRequest.js +3 -0
  135. package/cjs/api/resources/tags/client/requests/DeleteTagsRequest.d.ts +9 -0
  136. package/cjs/api/resources/tags/client/requests/DeleteTagsRequest.js +3 -0
  137. package/cjs/api/resources/tags/client/requests/ListTagsRequest.d.ts +8 -0
  138. package/cjs/api/resources/tags/client/requests/ListTagsRequest.js +3 -0
  139. package/cjs/api/resources/tags/client/requests/UpdateTagsRequest.d.ts +13 -0
  140. package/cjs/api/resources/tags/client/requests/UpdateTagsRequest.js +3 -0
  141. package/cjs/api/resources/tags/client/requests/index.d.ts +4 -0
  142. package/cjs/api/resources/tags/client/requests/index.js +2 -0
  143. package/cjs/api/resources/tags/exports.d.ts +2 -0
  144. package/cjs/api/resources/tags/exports.js +21 -0
  145. package/cjs/api/resources/tags/index.d.ts +2 -0
  146. package/cjs/api/resources/tags/index.js +18 -0
  147. package/cjs/api/resources/tags/types/ListTagsResponse.d.ts +4 -0
  148. package/cjs/api/resources/tags/types/ListTagsResponse.js +3 -0
  149. package/cjs/api/resources/tags/types/index.d.ts +1 -0
  150. package/cjs/api/resources/tags/types/index.js +17 -0
  151. package/cjs/api/types/AnalyticsStatus.d.ts +6 -0
  152. package/cjs/api/types/AnalyticsStatus.js +9 -0
  153. package/cjs/api/types/ErrorResponse.d.ts +10 -0
  154. package/cjs/api/types/ErrorResponse.js +3 -0
  155. package/cjs/api/types/ImageProcessingStatus.d.ts +7 -0
  156. package/cjs/api/types/ImageProcessingStatus.js +10 -0
  157. package/cjs/api/types/ListPostsRequestScheduledAt.d.ts +4 -0
  158. package/cjs/api/types/ListPostsRequestScheduledAt.js +3 -0
  159. package/cjs/api/types/Media.d.ts +14 -0
  160. package/cjs/api/types/Media.js +3 -0
  161. package/cjs/api/types/MediaSearch.d.ts +25 -0
  162. package/cjs/api/types/MediaSearch.js +16 -0
  163. package/cjs/api/types/MediaSetTags.d.ts +4 -0
  164. package/cjs/api/types/MediaSetTags.js +3 -0
  165. package/cjs/api/types/MediaUpdate.d.ts +9 -0
  166. package/cjs/api/types/MediaUpdate.js +3 -0
  167. package/cjs/api/types/OauthScope.d.ts +36 -0
  168. package/cjs/api/types/OauthScope.js +39 -0
  169. package/cjs/api/types/Post.d.ts +19 -0
  170. package/cjs/api/types/Post.js +3 -0
  171. package/cjs/api/types/PostApprovalStatus.d.ts +7 -0
  172. package/cjs/api/types/PostApprovalStatus.js +10 -0
  173. package/cjs/api/types/PostPublishDraft.d.ts +4 -0
  174. package/cjs/api/types/PostPublishDraft.js +3 -0
  175. package/cjs/api/types/PostSearch.d.ts +36 -0
  176. package/cjs/api/types/PostSearch.js +24 -0
  177. package/cjs/api/types/PostStatus.d.ts +8 -0
  178. package/cjs/api/types/PostStatus.js +11 -0
  179. package/cjs/api/types/PostWithRelations.d.ts +68 -0
  180. package/cjs/api/types/PostWithRelations.js +36 -0
  181. package/cjs/api/types/PresignedPost.d.ts +11 -0
  182. package/cjs/api/types/PresignedPost.js +10 -0
  183. package/cjs/api/types/SocialAccount.d.ts +20 -0
  184. package/cjs/api/types/SocialAccount.js +11 -0
  185. package/cjs/api/types/SocialAccountDisconnectedReason.d.ts +9 -0
  186. package/cjs/api/types/SocialAccountDisconnectedReason.js +12 -0
  187. package/cjs/api/types/SocialAccountPublic.d.ts +17 -0
  188. package/cjs/api/types/SocialAccountPublic.js +11 -0
  189. package/cjs/api/types/SocialAccountUpdate.d.ts +11 -0
  190. package/cjs/api/types/SocialAccountUpdate.js +11 -0
  191. package/cjs/api/types/SocialPlatform.d.ts +14 -0
  192. package/cjs/api/types/SocialPlatform.js +17 -0
  193. package/cjs/api/types/Tag.d.ts +7 -0
  194. package/cjs/api/types/Tag.js +3 -0
  195. package/cjs/api/types/TagSearch.d.ts +4 -0
  196. package/cjs/api/types/TagSearch.js +3 -0
  197. package/cjs/api/types/TagUpsert.d.ts +5 -0
  198. package/cjs/api/types/TagUpsert.js +3 -0
  199. package/cjs/api/types/index.d.ts +24 -0
  200. package/cjs/api/types/index.js +40 -0
  201. package/cjs/auth/HeaderAuthProvider.d.ts +20 -0
  202. package/cjs/auth/HeaderAuthProvider.js +80 -0
  203. package/cjs/auth/index.d.ts +1 -0
  204. package/cjs/auth/index.js +5 -0
  205. package/cjs/core/auth/AuthProvider.d.ts +8 -0
  206. package/cjs/core/auth/AuthProvider.js +9 -0
  207. package/cjs/core/auth/AuthRequest.d.ts +9 -0
  208. package/cjs/core/auth/AuthRequest.js +2 -0
  209. package/cjs/core/auth/BasicAuth.d.ts +8 -0
  210. package/cjs/core/auth/BasicAuth.js +33 -0
  211. package/cjs/core/auth/BearerToken.d.ts +7 -0
  212. package/cjs/core/auth/BearerToken.js +16 -0
  213. package/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  214. package/cjs/core/auth/NoOpAuthProvider.js +9 -0
  215. package/cjs/core/auth/index.d.ts +5 -0
  216. package/cjs/core/auth/index.js +11 -0
  217. package/cjs/core/base64.d.ts +2 -0
  218. package/cjs/core/base64.js +26 -0
  219. package/cjs/core/exports.d.ts +1 -0
  220. package/cjs/core/exports.js +17 -0
  221. package/cjs/core/fetcher/APIResponse.d.ts +20 -0
  222. package/cjs/core/fetcher/APIResponse.js +2 -0
  223. package/cjs/core/fetcher/BinaryResponse.d.ts +19 -0
  224. package/cjs/core/fetcher/BinaryResponse.js +17 -0
  225. package/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
  226. package/cjs/core/fetcher/EndpointMetadata.js +2 -0
  227. package/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
  228. package/cjs/core/fetcher/EndpointSupplier.js +22 -0
  229. package/cjs/core/fetcher/Fetcher.d.ts +56 -0
  230. package/cjs/core/fetcher/Fetcher.js +327 -0
  231. package/cjs/core/fetcher/Headers.d.ts +2 -0
  232. package/cjs/core/fetcher/Headers.js +84 -0
  233. package/cjs/core/fetcher/HttpResponsePromise.d.ts +58 -0
  234. package/cjs/core/fetcher/HttpResponsePromise.js +103 -0
  235. package/cjs/core/fetcher/RawResponse.d.ts +29 -0
  236. package/cjs/core/fetcher/RawResponse.js +44 -0
  237. package/cjs/core/fetcher/Supplier.d.ts +4 -0
  238. package/cjs/core/fetcher/Supplier.js +22 -0
  239. package/cjs/core/fetcher/createRequestUrl.d.ts +1 -0
  240. package/cjs/core/fetcher/createRequestUrl.js +8 -0
  241. package/cjs/core/fetcher/getErrorResponseBody.d.ts +1 -0
  242. package/cjs/core/fetcher/getErrorResponseBody.js +45 -0
  243. package/cjs/core/fetcher/getFetchFn.d.ts +1 -0
  244. package/cjs/core/fetcher/getFetchFn.js +17 -0
  245. package/cjs/core/fetcher/getHeader.d.ts +1 -0
  246. package/cjs/core/fetcher/getHeader.js +11 -0
  247. package/cjs/core/fetcher/getRequestBody.d.ts +7 -0
  248. package/cjs/core/fetcher/getRequestBody.js +27 -0
  249. package/cjs/core/fetcher/getResponseBody.d.ts +1 -0
  250. package/cjs/core/fetcher/getResponseBody.js +80 -0
  251. package/cjs/core/fetcher/index.d.ts +13 -0
  252. package/cjs/core/fetcher/index.js +19 -0
  253. package/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
  254. package/cjs/core/fetcher/makePassthroughRequest.js +135 -0
  255. package/cjs/core/fetcher/makeRequest.d.ts +6 -0
  256. package/cjs/core/fetcher/makeRequest.js +61 -0
  257. package/cjs/core/fetcher/requestWithRetries.d.ts +1 -0
  258. package/cjs/core/fetcher/requestWithRetries.js +70 -0
  259. package/cjs/core/fetcher/signals.d.ts +5 -0
  260. package/cjs/core/fetcher/signals.js +32 -0
  261. package/cjs/core/headers.d.ts +2 -0
  262. package/cjs/core/headers.js +31 -0
  263. package/cjs/core/index.d.ts +6 -0
  264. package/cjs/core/index.js +45 -0
  265. package/cjs/core/json.d.ts +15 -0
  266. package/cjs/core/json.js +24 -0
  267. package/cjs/core/logging/exports.d.ts +18 -0
  268. package/cjs/core/logging/exports.js +45 -0
  269. package/cjs/core/logging/index.d.ts +1 -0
  270. package/cjs/core/logging/index.js +17 -0
  271. package/cjs/core/logging/logger.d.ts +126 -0
  272. package/cjs/core/logging/logger.js +144 -0
  273. package/cjs/core/runtime/index.d.ts +1 -0
  274. package/cjs/core/runtime/index.js +5 -0
  275. package/cjs/core/runtime/runtime.d.ts +9 -0
  276. package/cjs/core/runtime/runtime.js +104 -0
  277. package/cjs/core/url/QueryStringBuilder.d.ts +47 -0
  278. package/cjs/core/url/QueryStringBuilder.js +83 -0
  279. package/cjs/core/url/encodePathParam.d.ts +1 -0
  280. package/cjs/core/url/encodePathParam.js +21 -0
  281. package/cjs/core/url/index.d.ts +4 -0
  282. package/cjs/core/url/index.js +11 -0
  283. package/cjs/core/url/join.d.ts +1 -0
  284. package/cjs/core/url/join.js +68 -0
  285. package/cjs/core/url/qs.d.ts +7 -0
  286. package/cjs/core/url/qs.js +76 -0
  287. package/cjs/environments.d.ts +4 -0
  288. package/cjs/environments.js +7 -0
  289. package/cjs/errors/SchedulinError.d.ts +14 -0
  290. package/cjs/errors/SchedulinError.js +35 -0
  291. package/cjs/errors/SchedulinTimeoutError.d.ts +6 -0
  292. package/cjs/errors/SchedulinTimeoutError.js +18 -0
  293. package/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  294. package/cjs/errors/handleNonStatusCodeError.js +68 -0
  295. package/cjs/errors/index.d.ts +2 -0
  296. package/cjs/errors/index.js +7 -0
  297. package/cjs/exports.d.ts +1 -0
  298. package/cjs/exports.js +17 -0
  299. package/cjs/index.d.ts +6 -0
  300. package/cjs/index.js +48 -0
  301. package/esm/BaseClient.d.mts +42 -0
  302. package/esm/BaseClient.mjs +37 -0
  303. package/esm/Client.d.mts +35 -0
  304. package/esm/Client.mjs +61 -0
  305. package/esm/api/errors/InternalServerError.d.mts +6 -0
  306. package/esm/api/errors/InternalServerError.mjs +17 -0
  307. package/esm/api/errors/UnauthorizedError.d.mts +6 -0
  308. package/esm/api/errors/UnauthorizedError.mjs +17 -0
  309. package/esm/api/errors/index.d.mts +2 -0
  310. package/esm/api/errors/index.mjs +2 -0
  311. package/esm/api/index.d.mts +3 -0
  312. package/esm/api/index.mjs +3 -0
  313. package/esm/api/resources/index.d.mts +12 -0
  314. package/esm/api/resources/index.mjs +12 -0
  315. package/esm/api/resources/media/client/Client.d.mts +107 -0
  316. package/esm/api/resources/media/client/Client.mjs +374 -0
  317. package/esm/api/resources/media/client/index.d.mts +1 -0
  318. package/esm/api/resources/media/client/index.mjs +1 -0
  319. package/esm/api/resources/media/client/requests/CreatePresignedPost.d.mts +21 -0
  320. package/esm/api/resources/media/client/requests/CreatePresignedPost.mjs +9 -0
  321. package/esm/api/resources/media/client/requests/ListMediaRequest.d.mts +13 -0
  322. package/esm/api/resources/media/client/requests/ListMediaRequest.mjs +2 -0
  323. package/esm/api/resources/media/client/requests/RetrieveMediaRequest.d.mts +9 -0
  324. package/esm/api/resources/media/client/requests/RetrieveMediaRequest.mjs +2 -0
  325. package/esm/api/resources/media/client/requests/SetTagsMediaRequest.d.mts +11 -0
  326. package/esm/api/resources/media/client/requests/SetTagsMediaRequest.mjs +2 -0
  327. package/esm/api/resources/media/client/requests/UpdateMediaRequest.d.mts +16 -0
  328. package/esm/api/resources/media/client/requests/UpdateMediaRequest.mjs +2 -0
  329. package/esm/api/resources/media/client/requests/index.d.mts +5 -0
  330. package/esm/api/resources/media/client/requests/index.mjs +1 -0
  331. package/esm/api/resources/media/exports.d.mts +2 -0
  332. package/esm/api/resources/media/exports.mjs +3 -0
  333. package/esm/api/resources/media/index.d.mts +2 -0
  334. package/esm/api/resources/media/index.mjs +2 -0
  335. package/esm/api/resources/media/types/CountByTagMediaResponse.d.mts +12 -0
  336. package/esm/api/resources/media/types/CountByTagMediaResponse.mjs +2 -0
  337. package/esm/api/resources/media/types/ListMediaRequestCursor.d.mts +4 -0
  338. package/esm/api/resources/media/types/ListMediaRequestCursor.mjs +2 -0
  339. package/esm/api/resources/media/types/ListMediaRequestTagMode.d.mts +5 -0
  340. package/esm/api/resources/media/types/ListMediaRequestTagMode.mjs +5 -0
  341. package/esm/api/resources/media/types/ListMediaRequestType.d.mts +6 -0
  342. package/esm/api/resources/media/types/ListMediaRequestType.mjs +6 -0
  343. package/esm/api/resources/media/types/index.d.mts +4 -0
  344. package/esm/api/resources/media/types/index.mjs +4 -0
  345. package/esm/api/resources/posts/client/Client.d.mts +187 -0
  346. package/esm/api/resources/posts/client/Client.mjs +673 -0
  347. package/esm/api/resources/posts/client/index.d.mts +1 -0
  348. package/esm/api/resources/posts/client/index.mjs +1 -0
  349. package/esm/api/resources/posts/client/requests/AnalyticsSeriesPostsRequest.d.mts +10 -0
  350. package/esm/api/resources/posts/client/requests/AnalyticsSeriesPostsRequest.mjs +2 -0
  351. package/esm/api/resources/posts/client/requests/AnalyticsSummaryPostsRequest.d.mts +9 -0
  352. package/esm/api/resources/posts/client/requests/AnalyticsSummaryPostsRequest.mjs +2 -0
  353. package/esm/api/resources/posts/client/requests/DeletePostsRequest.d.mts +9 -0
  354. package/esm/api/resources/posts/client/requests/DeletePostsRequest.mjs +2 -0
  355. package/esm/api/resources/posts/client/requests/GetJobStatusPostsRequest.d.mts +9 -0
  356. package/esm/api/resources/posts/client/requests/GetJobStatusPostsRequest.mjs +2 -0
  357. package/esm/api/resources/posts/client/requests/ListPostsRequest.d.mts +15 -0
  358. package/esm/api/resources/posts/client/requests/ListPostsRequest.mjs +2 -0
  359. package/esm/api/resources/posts/client/requests/PostCreate.d.mts +183 -0
  360. package/esm/api/resources/posts/client/requests/PostCreate.mjs +100 -0
  361. package/esm/api/resources/posts/client/requests/PublishDraftPostsRequest.d.mts +10 -0
  362. package/esm/api/resources/posts/client/requests/PublishDraftPostsRequest.mjs +2 -0
  363. package/esm/api/resources/posts/client/requests/RetrievePostsRequest.d.mts +9 -0
  364. package/esm/api/resources/posts/client/requests/RetrievePostsRequest.mjs +2 -0
  365. package/esm/api/resources/posts/client/requests/UpdatePostsRequest.d.mts +36 -0
  366. package/esm/api/resources/posts/client/requests/UpdatePostsRequest.mjs +11 -0
  367. package/esm/api/resources/posts/client/requests/UpdateTagsPostsRequest.d.mts +11 -0
  368. package/esm/api/resources/posts/client/requests/UpdateTagsPostsRequest.mjs +2 -0
  369. package/esm/api/resources/posts/client/requests/V0PostCountByTabRequest.d.mts +7 -0
  370. package/esm/api/resources/posts/client/requests/V0PostCountByTabRequest.mjs +2 -0
  371. package/esm/api/resources/posts/client/requests/index.d.mts +11 -0
  372. package/esm/api/resources/posts/client/requests/index.mjs +2 -0
  373. package/esm/api/resources/posts/exports.d.mts +2 -0
  374. package/esm/api/resources/posts/exports.mjs +3 -0
  375. package/esm/api/resources/posts/index.d.mts +2 -0
  376. package/esm/api/resources/posts/index.mjs +2 -0
  377. package/esm/api/resources/posts/types/AnalyticsSeriesPostsResponse.d.mts +15 -0
  378. package/esm/api/resources/posts/types/AnalyticsSeriesPostsResponse.mjs +2 -0
  379. package/esm/api/resources/posts/types/AnalyticsSummaryPostsResponse.d.mts +6 -0
  380. package/esm/api/resources/posts/types/AnalyticsSummaryPostsResponse.mjs +2 -0
  381. package/esm/api/resources/posts/types/CreatePostsResponse.d.mts +59 -0
  382. package/esm/api/resources/posts/types/CreatePostsResponse.mjs +33 -0
  383. package/esm/api/resources/posts/types/ListPostsRequestApprovalStatus.d.mts +7 -0
  384. package/esm/api/resources/posts/types/ListPostsRequestApprovalStatus.mjs +7 -0
  385. package/esm/api/resources/posts/types/ListPostsRequestStatus.d.mts +8 -0
  386. package/esm/api/resources/posts/types/ListPostsRequestStatus.mjs +8 -0
  387. package/esm/api/resources/posts/types/ListPostsRequestTagMode.d.mts +5 -0
  388. package/esm/api/resources/posts/types/ListPostsRequestTagMode.mjs +5 -0
  389. package/esm/api/resources/posts/types/ListPostsResponse.d.mts +7 -0
  390. package/esm/api/resources/posts/types/ListPostsResponse.mjs +2 -0
  391. package/esm/api/resources/posts/types/index.d.mts +7 -0
  392. package/esm/api/resources/posts/types/index.mjs +7 -0
  393. package/esm/api/resources/socialAccounts/client/Client.d.mts +107 -0
  394. package/esm/api/resources/socialAccounts/client/Client.mjs +378 -0
  395. package/esm/api/resources/socialAccounts/client/index.d.mts +1 -0
  396. package/esm/api/resources/socialAccounts/client/index.mjs +1 -0
  397. package/esm/api/resources/socialAccounts/client/requests/DeleteSocialAccountsRequest.d.mts +9 -0
  398. package/esm/api/resources/socialAccounts/client/requests/DeleteSocialAccountsRequest.mjs +2 -0
  399. package/esm/api/resources/socialAccounts/client/requests/PinterestBoardsSocialAccountsRequest.d.mts +9 -0
  400. package/esm/api/resources/socialAccounts/client/requests/PinterestBoardsSocialAccountsRequest.mjs +2 -0
  401. package/esm/api/resources/socialAccounts/client/requests/TiktokCreatorInfoSocialAccountsRequest.d.mts +9 -0
  402. package/esm/api/resources/socialAccounts/client/requests/TiktokCreatorInfoSocialAccountsRequest.mjs +2 -0
  403. package/esm/api/resources/socialAccounts/client/requests/UpdateSocialAccountsRequest.d.mts +17 -0
  404. package/esm/api/resources/socialAccounts/client/requests/UpdateSocialAccountsRequest.mjs +8 -0
  405. package/esm/api/resources/socialAccounts/client/requests/UpdateTimezoneSocialAccountsRequest.d.mts +11 -0
  406. package/esm/api/resources/socialAccounts/client/requests/UpdateTimezoneSocialAccountsRequest.mjs +2 -0
  407. package/esm/api/resources/socialAccounts/client/requests/index.d.mts +5 -0
  408. package/esm/api/resources/socialAccounts/client/requests/index.mjs +1 -0
  409. package/esm/api/resources/socialAccounts/exports.d.mts +2 -0
  410. package/esm/api/resources/socialAccounts/exports.mjs +3 -0
  411. package/esm/api/resources/socialAccounts/index.d.mts +2 -0
  412. package/esm/api/resources/socialAccounts/index.mjs +2 -0
  413. package/esm/api/resources/socialAccounts/types/DeleteSocialAccountsResponse.d.mts +3 -0
  414. package/esm/api/resources/socialAccounts/types/DeleteSocialAccountsResponse.mjs +2 -0
  415. package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.mts +41 -0
  416. package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.mjs +27 -0
  417. package/esm/api/resources/socialAccounts/types/PinterestBoardsSocialAccountsResponse.d.mts +21 -0
  418. package/esm/api/resources/socialAccounts/types/PinterestBoardsSocialAccountsResponse.mjs +15 -0
  419. package/esm/api/resources/socialAccounts/types/TiktokCreatorInfoSocialAccountsResponse.d.mts +21 -0
  420. package/esm/api/resources/socialAccounts/types/TiktokCreatorInfoSocialAccountsResponse.mjs +2 -0
  421. package/esm/api/resources/socialAccounts/types/UpdateSocialAccountsResponse.d.mts +3 -0
  422. package/esm/api/resources/socialAccounts/types/UpdateSocialAccountsResponse.mjs +2 -0
  423. package/esm/api/resources/socialAccounts/types/UpdateTimezoneSocialAccountsResponse.d.mts +3 -0
  424. package/esm/api/resources/socialAccounts/types/UpdateTimezoneSocialAccountsResponse.mjs +2 -0
  425. package/esm/api/resources/socialAccounts/types/index.d.mts +6 -0
  426. package/esm/api/resources/socialAccounts/types/index.mjs +6 -0
  427. package/esm/api/resources/tags/client/Client.d.mts +78 -0
  428. package/esm/api/resources/tags/client/Client.mjs +266 -0
  429. package/esm/api/resources/tags/client/index.d.mts +1 -0
  430. package/esm/api/resources/tags/client/index.mjs +1 -0
  431. package/esm/api/resources/tags/client/requests/CreateTagsRequest.d.mts +11 -0
  432. package/esm/api/resources/tags/client/requests/CreateTagsRequest.mjs +2 -0
  433. package/esm/api/resources/tags/client/requests/DeleteTagsRequest.d.mts +9 -0
  434. package/esm/api/resources/tags/client/requests/DeleteTagsRequest.mjs +2 -0
  435. package/esm/api/resources/tags/client/requests/ListTagsRequest.d.mts +8 -0
  436. package/esm/api/resources/tags/client/requests/ListTagsRequest.mjs +2 -0
  437. package/esm/api/resources/tags/client/requests/UpdateTagsRequest.d.mts +13 -0
  438. package/esm/api/resources/tags/client/requests/UpdateTagsRequest.mjs +2 -0
  439. package/esm/api/resources/tags/client/requests/index.d.mts +4 -0
  440. package/esm/api/resources/tags/client/requests/index.mjs +1 -0
  441. package/esm/api/resources/tags/exports.d.mts +2 -0
  442. package/esm/api/resources/tags/exports.mjs +3 -0
  443. package/esm/api/resources/tags/index.d.mts +2 -0
  444. package/esm/api/resources/tags/index.mjs +2 -0
  445. package/esm/api/resources/tags/types/ListTagsResponse.d.mts +4 -0
  446. package/esm/api/resources/tags/types/ListTagsResponse.mjs +2 -0
  447. package/esm/api/resources/tags/types/index.d.mts +1 -0
  448. package/esm/api/resources/tags/types/index.mjs +1 -0
  449. package/esm/api/types/AnalyticsStatus.d.mts +6 -0
  450. package/esm/api/types/AnalyticsStatus.mjs +6 -0
  451. package/esm/api/types/ErrorResponse.d.mts +10 -0
  452. package/esm/api/types/ErrorResponse.mjs +2 -0
  453. package/esm/api/types/ImageProcessingStatus.d.mts +7 -0
  454. package/esm/api/types/ImageProcessingStatus.mjs +7 -0
  455. package/esm/api/types/ListPostsRequestScheduledAt.d.mts +4 -0
  456. package/esm/api/types/ListPostsRequestScheduledAt.mjs +2 -0
  457. package/esm/api/types/Media.d.mts +14 -0
  458. package/esm/api/types/Media.mjs +2 -0
  459. package/esm/api/types/MediaSearch.d.mts +25 -0
  460. package/esm/api/types/MediaSearch.mjs +13 -0
  461. package/esm/api/types/MediaSetTags.d.mts +4 -0
  462. package/esm/api/types/MediaSetTags.mjs +2 -0
  463. package/esm/api/types/MediaUpdate.d.mts +9 -0
  464. package/esm/api/types/MediaUpdate.mjs +2 -0
  465. package/esm/api/types/OauthScope.d.mts +36 -0
  466. package/esm/api/types/OauthScope.mjs +36 -0
  467. package/esm/api/types/Post.d.mts +19 -0
  468. package/esm/api/types/Post.mjs +2 -0
  469. package/esm/api/types/PostApprovalStatus.d.mts +7 -0
  470. package/esm/api/types/PostApprovalStatus.mjs +7 -0
  471. package/esm/api/types/PostPublishDraft.d.mts +4 -0
  472. package/esm/api/types/PostPublishDraft.mjs +2 -0
  473. package/esm/api/types/PostSearch.d.mts +36 -0
  474. package/esm/api/types/PostSearch.mjs +21 -0
  475. package/esm/api/types/PostStatus.d.mts +8 -0
  476. package/esm/api/types/PostStatus.mjs +8 -0
  477. package/esm/api/types/PostWithRelations.d.mts +68 -0
  478. package/esm/api/types/PostWithRelations.mjs +33 -0
  479. package/esm/api/types/PresignedPost.d.mts +11 -0
  480. package/esm/api/types/PresignedPost.mjs +7 -0
  481. package/esm/api/types/SocialAccount.d.mts +20 -0
  482. package/esm/api/types/SocialAccount.mjs +8 -0
  483. package/esm/api/types/SocialAccountDisconnectedReason.d.mts +9 -0
  484. package/esm/api/types/SocialAccountDisconnectedReason.mjs +9 -0
  485. package/esm/api/types/SocialAccountPublic.d.mts +17 -0
  486. package/esm/api/types/SocialAccountPublic.mjs +8 -0
  487. package/esm/api/types/SocialAccountUpdate.d.mts +11 -0
  488. package/esm/api/types/SocialAccountUpdate.mjs +8 -0
  489. package/esm/api/types/SocialPlatform.d.mts +14 -0
  490. package/esm/api/types/SocialPlatform.mjs +14 -0
  491. package/esm/api/types/Tag.d.mts +7 -0
  492. package/esm/api/types/Tag.mjs +2 -0
  493. package/esm/api/types/TagSearch.d.mts +4 -0
  494. package/esm/api/types/TagSearch.mjs +2 -0
  495. package/esm/api/types/TagUpsert.d.mts +5 -0
  496. package/esm/api/types/TagUpsert.mjs +2 -0
  497. package/esm/api/types/index.d.mts +24 -0
  498. package/esm/api/types/index.mjs +24 -0
  499. package/esm/auth/HeaderAuthProvider.d.mts +20 -0
  500. package/esm/auth/HeaderAuthProvider.mjs +43 -0
  501. package/esm/auth/index.d.mts +1 -0
  502. package/esm/auth/index.mjs +1 -0
  503. package/esm/core/auth/AuthProvider.d.mts +8 -0
  504. package/esm/core/auth/AuthProvider.mjs +6 -0
  505. package/esm/core/auth/AuthRequest.d.mts +9 -0
  506. package/esm/core/auth/AuthRequest.mjs +1 -0
  507. package/esm/core/auth/BasicAuth.d.mts +8 -0
  508. package/esm/core/auth/BasicAuth.mjs +30 -0
  509. package/esm/core/auth/BearerToken.d.mts +7 -0
  510. package/esm/core/auth/BearerToken.mjs +13 -0
  511. package/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  512. package/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  513. package/esm/core/auth/index.d.mts +5 -0
  514. package/esm/core/auth/index.mjs +4 -0
  515. package/esm/core/base64.d.mts +2 -0
  516. package/esm/core/base64.mjs +22 -0
  517. package/esm/core/exports.d.mts +1 -0
  518. package/esm/core/exports.mjs +1 -0
  519. package/esm/core/fetcher/APIResponse.d.mts +20 -0
  520. package/esm/core/fetcher/APIResponse.mjs +1 -0
  521. package/esm/core/fetcher/BinaryResponse.d.mts +19 -0
  522. package/esm/core/fetcher/BinaryResponse.mjs +14 -0
  523. package/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
  524. package/esm/core/fetcher/EndpointMetadata.mjs +1 -0
  525. package/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
  526. package/esm/core/fetcher/EndpointSupplier.mjs +19 -0
  527. package/esm/core/fetcher/Fetcher.d.mts +56 -0
  528. package/esm/core/fetcher/Fetcher.mjs +323 -0
  529. package/esm/core/fetcher/Headers.d.mts +2 -0
  530. package/esm/core/fetcher/Headers.mjs +82 -0
  531. package/esm/core/fetcher/HttpResponsePromise.d.mts +58 -0
  532. package/esm/core/fetcher/HttpResponsePromise.mjs +99 -0
  533. package/esm/core/fetcher/RawResponse.d.mts +29 -0
  534. package/esm/core/fetcher/RawResponse.mjs +40 -0
  535. package/esm/core/fetcher/Supplier.d.mts +4 -0
  536. package/esm/core/fetcher/Supplier.mjs +19 -0
  537. package/esm/core/fetcher/createRequestUrl.d.mts +1 -0
  538. package/esm/core/fetcher/createRequestUrl.mjs +5 -0
  539. package/esm/core/fetcher/getErrorResponseBody.d.mts +1 -0
  540. package/esm/core/fetcher/getErrorResponseBody.mjs +42 -0
  541. package/esm/core/fetcher/getFetchFn.d.mts +1 -0
  542. package/esm/core/fetcher/getFetchFn.mjs +14 -0
  543. package/esm/core/fetcher/getHeader.d.mts +1 -0
  544. package/esm/core/fetcher/getHeader.mjs +8 -0
  545. package/esm/core/fetcher/getRequestBody.d.mts +7 -0
  546. package/esm/core/fetcher/getRequestBody.mjs +24 -0
  547. package/esm/core/fetcher/getResponseBody.d.mts +1 -0
  548. package/esm/core/fetcher/getResponseBody.mjs +77 -0
  549. package/esm/core/fetcher/index.d.mts +13 -0
  550. package/esm/core/fetcher/index.mjs +7 -0
  551. package/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
  552. package/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
  553. package/esm/core/fetcher/makeRequest.d.mts +6 -0
  554. package/esm/core/fetcher/makeRequest.mjs +55 -0
  555. package/esm/core/fetcher/requestWithRetries.d.mts +1 -0
  556. package/esm/core/fetcher/requestWithRetries.mjs +67 -0
  557. package/esm/core/fetcher/signals.d.mts +5 -0
  558. package/esm/core/fetcher/signals.mjs +28 -0
  559. package/esm/core/headers.d.mts +2 -0
  560. package/esm/core/headers.mjs +27 -0
  561. package/esm/core/index.d.mts +6 -0
  562. package/esm/core/index.mjs +6 -0
  563. package/esm/core/json.d.mts +15 -0
  564. package/esm/core/json.mjs +19 -0
  565. package/esm/core/logging/exports.d.mts +18 -0
  566. package/esm/core/logging/exports.mjs +9 -0
  567. package/esm/core/logging/index.d.mts +1 -0
  568. package/esm/core/logging/index.mjs +1 -0
  569. package/esm/core/logging/logger.d.mts +126 -0
  570. package/esm/core/logging/logger.mjs +138 -0
  571. package/esm/core/runtime/index.d.mts +1 -0
  572. package/esm/core/runtime/index.mjs +1 -0
  573. package/esm/core/runtime/runtime.d.mts +9 -0
  574. package/esm/core/runtime/runtime.mjs +101 -0
  575. package/esm/core/url/QueryStringBuilder.d.mts +47 -0
  576. package/esm/core/url/QueryStringBuilder.mjs +80 -0
  577. package/esm/core/url/encodePathParam.d.mts +1 -0
  578. package/esm/core/url/encodePathParam.mjs +18 -0
  579. package/esm/core/url/index.d.mts +4 -0
  580. package/esm/core/url/index.mjs +4 -0
  581. package/esm/core/url/join.d.mts +1 -0
  582. package/esm/core/url/join.mjs +65 -0
  583. package/esm/core/url/qs.d.mts +7 -0
  584. package/esm/core/url/qs.mjs +73 -0
  585. package/esm/environments.d.mts +4 -0
  586. package/esm/environments.mjs +4 -0
  587. package/esm/errors/SchedulinError.d.mts +14 -0
  588. package/esm/errors/SchedulinError.mjs +31 -0
  589. package/esm/errors/SchedulinTimeoutError.d.mts +6 -0
  590. package/esm/errors/SchedulinTimeoutError.mjs +14 -0
  591. package/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  592. package/esm/errors/handleNonStatusCodeError.mjs +32 -0
  593. package/esm/errors/index.d.mts +2 -0
  594. package/esm/errors/index.mjs +2 -0
  595. package/esm/exports.d.mts +1 -0
  596. package/esm/exports.mjs +1 -0
  597. package/esm/index.d.mts +6 -0
  598. package/esm/index.mjs +5 -0
  599. package/package.json +44 -0
@@ -0,0 +1,710 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.PostsClient = void 0;
58
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
59
+ const headers_js_1 = require("../../../../core/headers.js");
60
+ const core = __importStar(require("../../../../core/index.js"));
61
+ const environments = __importStar(require("../../../../environments.js"));
62
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
63
+ const errors = __importStar(require("../../../../errors/index.js"));
64
+ const Schedulin = __importStar(require("../../../index.js"));
65
+ class PostsClient {
66
+ constructor(options) {
67
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
+ }
69
+ /**
70
+ * Search and filter posts with various criteria including status, date range, social accounts, and tags
71
+ *
72
+ * @param {Schedulin.ListPostsRequest} request
73
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Schedulin.UnauthorizedError}
76
+ * @throws {@link Schedulin.InternalServerError}
77
+ *
78
+ * @example
79
+ * await client.posts.list()
80
+ */
81
+ list(request = {}, requestOptions) {
82
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
83
+ }
84
+ __list() {
85
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
86
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
87
+ const { page, status, approvalStatus, scheduledAt, tagIds, tagMode, socialAccountIds, limit } = request;
88
+ const _queryParams = {
89
+ page,
90
+ status: status != null ? status : undefined,
91
+ approvalStatus: approvalStatus != null ? approvalStatus : undefined,
92
+ scheduledAt,
93
+ tagIds,
94
+ tagMode: tagMode != null ? tagMode : undefined,
95
+ socialAccountIds,
96
+ limit,
97
+ };
98
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
99
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
100
+ const _response = yield core.fetcher({
101
+ 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/posts"),
102
+ method: "GET",
103
+ headers: _headers,
104
+ queryString: core.url
105
+ .queryBuilder()
106
+ .addMany(_queryParams)
107
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
108
+ .build(),
109
+ 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,
110
+ 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,
111
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
112
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
113
+ logging: this._options.logging,
114
+ });
115
+ if (_response.ok) {
116
+ return { data: _response.body, rawResponse: _response.rawResponse };
117
+ }
118
+ if (_response.error.reason === "status-code") {
119
+ switch (_response.error.statusCode) {
120
+ case 401:
121
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
122
+ case 500:
123
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
124
+ default:
125
+ throw new errors.SchedulinError({
126
+ statusCode: _response.error.statusCode,
127
+ body: _response.error.body,
128
+ rawResponse: _response.rawResponse,
129
+ });
130
+ }
131
+ }
132
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/posts");
133
+ });
134
+ }
135
+ /**
136
+ * Create a new post with media, tags, and scheduling options
137
+ *
138
+ * @param {Schedulin.PostCreate} request
139
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
140
+ *
141
+ * @throws {@link Schedulin.UnauthorizedError}
142
+ * @throws {@link Schedulin.InternalServerError}
143
+ *
144
+ * @example
145
+ * await client.posts.create({
146
+ * caption: "caption",
147
+ * socialAccountId: "socialAccountId"
148
+ * })
149
+ */
150
+ create(request, requestOptions) {
151
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
152
+ }
153
+ __create(request, requestOptions) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
156
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
157
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
158
+ const _response = yield core.fetcher({
159
+ 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/posts"),
160
+ method: "POST",
161
+ headers: _headers,
162
+ contentType: "application/json",
163
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
164
+ requestType: "json",
165
+ body: request,
166
+ 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,
167
+ 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,
168
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
170
+ logging: this._options.logging,
171
+ });
172
+ if (_response.ok) {
173
+ return { data: _response.body, rawResponse: _response.rawResponse };
174
+ }
175
+ if (_response.error.reason === "status-code") {
176
+ switch (_response.error.statusCode) {
177
+ case 401:
178
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
179
+ case 500:
180
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
181
+ default:
182
+ throw new errors.SchedulinError({
183
+ statusCode: _response.error.statusCode,
184
+ body: _response.error.body,
185
+ rawResponse: _response.rawResponse,
186
+ });
187
+ }
188
+ }
189
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/posts");
190
+ });
191
+ }
192
+ /**
193
+ * Returns counts of posts for the Queue, Drafts, Approvals, and Sent tabs
194
+ *
195
+ * @param {Schedulin.V0PostCountByTabRequest} request
196
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
197
+ *
198
+ * @throws {@link Schedulin.UnauthorizedError}
199
+ * @throws {@link Schedulin.InternalServerError}
200
+ *
201
+ * @example
202
+ * await client.posts.v0PostCountByTab()
203
+ */
204
+ v0PostCountByTab(request = {}, requestOptions) {
205
+ return core.HttpResponsePromise.fromPromise(this.__v0PostCountByTab(request, requestOptions));
206
+ }
207
+ __v0PostCountByTab() {
208
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
209
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
210
+ const { socialAccountIds } = request;
211
+ const _queryParams = {
212
+ socialAccountIds,
213
+ };
214
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
215
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
216
+ const _response = yield core.fetcher({
217
+ 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/posts/counts/by-tab"),
218
+ method: "GET",
219
+ headers: _headers,
220
+ queryString: core.url
221
+ .queryBuilder()
222
+ .addMany(_queryParams)
223
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
224
+ .build(),
225
+ 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,
226
+ 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,
227
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
228
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
229
+ logging: this._options.logging,
230
+ });
231
+ if (_response.ok) {
232
+ return { data: _response.body, rawResponse: _response.rawResponse };
233
+ }
234
+ if (_response.error.reason === "status-code") {
235
+ switch (_response.error.statusCode) {
236
+ case 401:
237
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
238
+ case 500:
239
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
240
+ default:
241
+ throw new errors.SchedulinError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.body,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ }
248
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/posts/counts/by-tab");
249
+ });
250
+ }
251
+ /**
252
+ * Retrieve a single post by its ID with all relations
253
+ *
254
+ * @param {Schedulin.RetrievePostsRequest} request
255
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
256
+ *
257
+ * @throws {@link Schedulin.UnauthorizedError}
258
+ * @throws {@link Schedulin.InternalServerError}
259
+ *
260
+ * @example
261
+ * await client.posts.retrieve({
262
+ * id: "id"
263
+ * })
264
+ */
265
+ retrieve(request, requestOptions) {
266
+ return core.HttpResponsePromise.fromPromise(this.__retrieve(request, requestOptions));
267
+ }
268
+ __retrieve(request, requestOptions) {
269
+ return __awaiter(this, void 0, void 0, function* () {
270
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
271
+ const { id } = request;
272
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
273
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
274
+ const _response = yield core.fetcher({
275
+ 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/posts/${core.url.encodePathParam(id)}`),
276
+ method: "GET",
277
+ headers: _headers,
278
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
279
+ 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,
280
+ 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,
281
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
282
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
283
+ logging: this._options.logging,
284
+ });
285
+ if (_response.ok) {
286
+ return { data: _response.body, rawResponse: _response.rawResponse };
287
+ }
288
+ if (_response.error.reason === "status-code") {
289
+ switch (_response.error.statusCode) {
290
+ case 401:
291
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
292
+ case 500:
293
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
294
+ default:
295
+ throw new errors.SchedulinError({
296
+ statusCode: _response.error.statusCode,
297
+ body: _response.error.body,
298
+ rawResponse: _response.rawResponse,
299
+ });
300
+ }
301
+ }
302
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/posts/{id}");
303
+ });
304
+ }
305
+ /**
306
+ * Update an existing post by its ID
307
+ *
308
+ * @param {Schedulin.UpdatePostsRequest} request
309
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
310
+ *
311
+ * @throws {@link Schedulin.UnauthorizedError}
312
+ * @throws {@link Schedulin.InternalServerError}
313
+ *
314
+ * @example
315
+ * await client.posts.update({
316
+ * id: "id"
317
+ * })
318
+ */
319
+ update(request, requestOptions) {
320
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
321
+ }
322
+ __update(request, requestOptions) {
323
+ return __awaiter(this, void 0, void 0, function* () {
324
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
325
+ const { id } = request, _body = __rest(request, ["id"]);
326
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
327
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
328
+ const _response = yield core.fetcher({
329
+ 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/posts/${core.url.encodePathParam(id)}`),
330
+ method: "PUT",
331
+ headers: _headers,
332
+ contentType: "application/json",
333
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
334
+ requestType: "json",
335
+ body: _body,
336
+ 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,
337
+ 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,
338
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
339
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
340
+ logging: this._options.logging,
341
+ });
342
+ if (_response.ok) {
343
+ return { data: _response.body, rawResponse: _response.rawResponse };
344
+ }
345
+ if (_response.error.reason === "status-code") {
346
+ switch (_response.error.statusCode) {
347
+ case 401:
348
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
349
+ case 500:
350
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
351
+ default:
352
+ throw new errors.SchedulinError({
353
+ statusCode: _response.error.statusCode,
354
+ body: _response.error.body,
355
+ rawResponse: _response.rawResponse,
356
+ });
357
+ }
358
+ }
359
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/v0/posts/{id}");
360
+ });
361
+ }
362
+ /**
363
+ * Delete a post by its ID
364
+ *
365
+ * @param {Schedulin.DeletePostsRequest} request
366
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
367
+ *
368
+ * @throws {@link Schedulin.UnauthorizedError}
369
+ * @throws {@link Schedulin.InternalServerError}
370
+ *
371
+ * @example
372
+ * await client.posts.delete({
373
+ * id: "id"
374
+ * })
375
+ */
376
+ delete(request, requestOptions) {
377
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
378
+ }
379
+ __delete(request, requestOptions) {
380
+ return __awaiter(this, void 0, void 0, function* () {
381
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
382
+ const { id } = request, _body = __rest(request, ["id"]);
383
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
384
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
385
+ const _response = yield core.fetcher({
386
+ 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/posts/${core.url.encodePathParam(id)}`),
387
+ method: "DELETE",
388
+ headers: _headers,
389
+ contentType: "application/json",
390
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
391
+ requestType: "json",
392
+ body: _body,
393
+ 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,
394
+ 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,
395
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
396
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
397
+ logging: this._options.logging,
398
+ });
399
+ if (_response.ok) {
400
+ return { data: _response.body, rawResponse: _response.rawResponse };
401
+ }
402
+ if (_response.error.reason === "status-code") {
403
+ switch (_response.error.statusCode) {
404
+ case 401:
405
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
406
+ case 500:
407
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
408
+ default:
409
+ throw new errors.SchedulinError({
410
+ statusCode: _response.error.statusCode,
411
+ body: _response.error.body,
412
+ rawResponse: _response.rawResponse,
413
+ });
414
+ }
415
+ }
416
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/posts/{id}");
417
+ });
418
+ }
419
+ /**
420
+ * Retrieve the latest analytics snapshot for a post
421
+ *
422
+ * @param {Schedulin.AnalyticsSummaryPostsRequest} request
423
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
424
+ *
425
+ * @throws {@link Schedulin.UnauthorizedError}
426
+ * @throws {@link Schedulin.InternalServerError}
427
+ *
428
+ * @example
429
+ * await client.posts.analyticsSummary({
430
+ * id: "id"
431
+ * })
432
+ */
433
+ analyticsSummary(request, requestOptions) {
434
+ return core.HttpResponsePromise.fromPromise(this.__analyticsSummary(request, requestOptions));
435
+ }
436
+ __analyticsSummary(request, requestOptions) {
437
+ return __awaiter(this, void 0, void 0, function* () {
438
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
439
+ const { id } = request;
440
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
441
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
442
+ const _response = yield core.fetcher({
443
+ 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/posts/${core.url.encodePathParam(id)}/analytics/summary`),
444
+ method: "GET",
445
+ headers: _headers,
446
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
447
+ 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,
448
+ 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,
449
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
450
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
451
+ logging: this._options.logging,
452
+ });
453
+ if (_response.ok) {
454
+ return {
455
+ data: _response.body,
456
+ rawResponse: _response.rawResponse,
457
+ };
458
+ }
459
+ if (_response.error.reason === "status-code") {
460
+ switch (_response.error.statusCode) {
461
+ case 401:
462
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
463
+ case 500:
464
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
465
+ default:
466
+ throw new errors.SchedulinError({
467
+ statusCode: _response.error.statusCode,
468
+ body: _response.error.body,
469
+ rawResponse: _response.rawResponse,
470
+ });
471
+ }
472
+ }
473
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/posts/{id}/analytics/summary");
474
+ });
475
+ }
476
+ /**
477
+ * Retrieve time series analytics metrics for a post
478
+ *
479
+ * @param {Schedulin.AnalyticsSeriesPostsRequest} request
480
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
481
+ *
482
+ * @throws {@link Schedulin.UnauthorizedError}
483
+ * @throws {@link Schedulin.InternalServerError}
484
+ *
485
+ * @example
486
+ * await client.posts.analyticsSeries({
487
+ * id: "id"
488
+ * })
489
+ */
490
+ analyticsSeries(request, requestOptions) {
491
+ return core.HttpResponsePromise.fromPromise(this.__analyticsSeries(request, requestOptions));
492
+ }
493
+ __analyticsSeries(request, requestOptions) {
494
+ return __awaiter(this, void 0, void 0, function* () {
495
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
496
+ const { id, limit } = request;
497
+ const _queryParams = {
498
+ limit,
499
+ };
500
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
501
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
502
+ const _response = yield core.fetcher({
503
+ 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/posts/${core.url.encodePathParam(id)}/analytics/series`),
504
+ method: "GET",
505
+ headers: _headers,
506
+ queryString: core.url
507
+ .queryBuilder()
508
+ .addMany(_queryParams)
509
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
510
+ .build(),
511
+ 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,
512
+ 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,
513
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
514
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
515
+ logging: this._options.logging,
516
+ });
517
+ if (_response.ok) {
518
+ return {
519
+ data: _response.body,
520
+ rawResponse: _response.rawResponse,
521
+ };
522
+ }
523
+ if (_response.error.reason === "status-code") {
524
+ switch (_response.error.statusCode) {
525
+ case 401:
526
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
527
+ case 500:
528
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
529
+ default:
530
+ throw new errors.SchedulinError({
531
+ statusCode: _response.error.statusCode,
532
+ body: _response.error.body,
533
+ rawResponse: _response.rawResponse,
534
+ });
535
+ }
536
+ }
537
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/posts/{id}/analytics/series");
538
+ });
539
+ }
540
+ /**
541
+ * Publish a draft post to connected social media accounts
542
+ *
543
+ * @param {Schedulin.PublishDraftPostsRequest} request
544
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
545
+ *
546
+ * @throws {@link Schedulin.UnauthorizedError}
547
+ * @throws {@link Schedulin.InternalServerError}
548
+ *
549
+ * @example
550
+ * await client.posts.publishDraft({
551
+ * id: "id"
552
+ * })
553
+ */
554
+ publishDraft(request, requestOptions) {
555
+ return core.HttpResponsePromise.fromPromise(this.__publishDraft(request, requestOptions));
556
+ }
557
+ __publishDraft(request, requestOptions) {
558
+ return __awaiter(this, void 0, void 0, function* () {
559
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
560
+ const { id } = request, _body = __rest(request, ["id"]);
561
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
562
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
563
+ const _response = yield core.fetcher({
564
+ 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/posts/${core.url.encodePathParam(id)}/publish`),
565
+ method: "POST",
566
+ headers: _headers,
567
+ contentType: "application/json",
568
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
569
+ requestType: "json",
570
+ body: _body,
571
+ 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,
572
+ 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,
573
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
574
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
575
+ logging: this._options.logging,
576
+ });
577
+ if (_response.ok) {
578
+ return { data: _response.body, rawResponse: _response.rawResponse };
579
+ }
580
+ if (_response.error.reason === "status-code") {
581
+ switch (_response.error.statusCode) {
582
+ case 401:
583
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
584
+ case 500:
585
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
586
+ default:
587
+ throw new errors.SchedulinError({
588
+ statusCode: _response.error.statusCode,
589
+ body: _response.error.body,
590
+ rawResponse: _response.rawResponse,
591
+ });
592
+ }
593
+ }
594
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/posts/{id}/publish");
595
+ });
596
+ }
597
+ /**
598
+ * Replace all tags on a post. No status restrictions apply.
599
+ *
600
+ * @param {Schedulin.UpdateTagsPostsRequest} request
601
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
602
+ *
603
+ * @throws {@link Schedulin.UnauthorizedError}
604
+ * @throws {@link Schedulin.InternalServerError}
605
+ *
606
+ * @example
607
+ * await client.posts.updateTags({
608
+ * id: "id",
609
+ * tagIds: ["tagIds"]
610
+ * })
611
+ */
612
+ updateTags(request, requestOptions) {
613
+ return core.HttpResponsePromise.fromPromise(this.__updateTags(request, requestOptions));
614
+ }
615
+ __updateTags(request, requestOptions) {
616
+ return __awaiter(this, void 0, void 0, function* () {
617
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
618
+ const { id } = request, _body = __rest(request, ["id"]);
619
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
620
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
621
+ const _response = yield core.fetcher({
622
+ 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/posts/${core.url.encodePathParam(id)}/tags`),
623
+ method: "PUT",
624
+ headers: _headers,
625
+ contentType: "application/json",
626
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
627
+ requestType: "json",
628
+ body: _body,
629
+ 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,
630
+ 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,
631
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
632
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
633
+ logging: this._options.logging,
634
+ });
635
+ if (_response.ok) {
636
+ return { data: _response.body, rawResponse: _response.rawResponse };
637
+ }
638
+ if (_response.error.reason === "status-code") {
639
+ switch (_response.error.statusCode) {
640
+ case 401:
641
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
642
+ case 500:
643
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
644
+ default:
645
+ throw new errors.SchedulinError({
646
+ statusCode: _response.error.statusCode,
647
+ body: _response.error.body,
648
+ rawResponse: _response.rawResponse,
649
+ });
650
+ }
651
+ }
652
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/v0/posts/{id}/tags");
653
+ });
654
+ }
655
+ /**
656
+ * Retrieve the processing job status and logs for a post
657
+ *
658
+ * @param {Schedulin.GetJobStatusPostsRequest} request
659
+ * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
660
+ *
661
+ * @throws {@link Schedulin.UnauthorizedError}
662
+ * @throws {@link Schedulin.InternalServerError}
663
+ *
664
+ * @example
665
+ * await client.posts.getJobStatus({
666
+ * id: "id"
667
+ * })
668
+ */
669
+ getJobStatus(request, requestOptions) {
670
+ return core.HttpResponsePromise.fromPromise(this.__getJobStatus(request, requestOptions));
671
+ }
672
+ __getJobStatus(request, requestOptions) {
673
+ return __awaiter(this, void 0, void 0, function* () {
674
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
675
+ const { id } = request;
676
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
677
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
678
+ const _response = yield core.fetcher({
679
+ 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/posts/${core.url.encodePathParam(id)}/jobs`),
680
+ method: "GET",
681
+ headers: _headers,
682
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
683
+ 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,
684
+ 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,
685
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
686
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
687
+ logging: this._options.logging,
688
+ });
689
+ if (_response.ok) {
690
+ return { data: _response.body, rawResponse: _response.rawResponse };
691
+ }
692
+ if (_response.error.reason === "status-code") {
693
+ switch (_response.error.statusCode) {
694
+ case 401:
695
+ throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
696
+ case 500:
697
+ throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
698
+ default:
699
+ throw new errors.SchedulinError({
700
+ statusCode: _response.error.statusCode,
701
+ body: _response.error.body,
702
+ rawResponse: _response.rawResponse,
703
+ });
704
+ }
705
+ }
706
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/posts/{id}/jobs");
707
+ });
708
+ }
709
+ }
710
+ exports.PostsClient = PostsClient;