@schedulin/sdk 0.3.1 → 0.4.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 (169) hide show
  1. package/cjs/api/errors/BadRequestError.d.ts +7 -0
  2. package/cjs/api/errors/BadRequestError.js +54 -0
  3. package/cjs/api/errors/ConflictError.d.ts +7 -0
  4. package/cjs/api/errors/ConflictError.js +54 -0
  5. package/cjs/api/errors/ForbiddenError.d.ts +7 -0
  6. package/cjs/api/errors/ForbiddenError.js +54 -0
  7. package/cjs/api/errors/NotFoundError.d.ts +7 -0
  8. package/cjs/api/errors/NotFoundError.js +54 -0
  9. package/cjs/api/errors/PaymentRequiredError.d.ts +7 -0
  10. package/cjs/api/errors/PaymentRequiredError.js +54 -0
  11. package/cjs/api/errors/TooManyRequestsError.d.ts +7 -0
  12. package/cjs/api/errors/TooManyRequestsError.js +54 -0
  13. package/cjs/api/errors/UnprocessableEntityError.d.ts +7 -0
  14. package/cjs/api/errors/UnprocessableEntityError.js +54 -0
  15. package/cjs/api/errors/index.d.ts +7 -0
  16. package/cjs/api/errors/index.js +7 -0
  17. package/cjs/api/resources/ai/client/Client.d.ts +11 -2
  18. package/cjs/api/resources/ai/client/Client.js +27 -0
  19. package/cjs/api/resources/ai/index.d.ts +1 -0
  20. package/cjs/api/resources/ai/index.js +1 -0
  21. package/cjs/api/resources/ai/types/GenerateImageAiResponse.d.ts +3 -0
  22. package/cjs/api/resources/ai/types/GenerateImageAiResponse.js +3 -0
  23. package/cjs/api/resources/ai/types/index.d.ts +1 -0
  24. package/cjs/api/resources/ai/types/index.js +17 -0
  25. package/cjs/api/resources/index.d.ts +2 -0
  26. package/cjs/api/resources/index.js +2 -0
  27. package/cjs/api/resources/media/client/Client.d.ts +58 -8
  28. package/cjs/api/resources/media/client/Client.js +158 -3
  29. package/cjs/api/resources/media/client/requests/UpdateMediaRequest.d.ts +2 -3
  30. package/cjs/api/resources/media/types/CreateUploadLinkMediaResponse.d.ts +4 -0
  31. package/cjs/api/resources/media/types/CreateUploadLinkMediaResponse.js +3 -0
  32. package/cjs/api/resources/media/types/DeleteMediaResponse.d.ts +4 -0
  33. package/cjs/api/resources/media/types/DeleteMediaResponse.js +3 -0
  34. package/cjs/api/resources/media/types/SetTagsMediaResponse.d.ts +4 -0
  35. package/cjs/api/resources/media/types/SetTagsMediaResponse.js +3 -0
  36. package/cjs/api/resources/media/types/index.d.ts +3 -0
  37. package/cjs/api/resources/media/types/index.js +3 -0
  38. package/cjs/api/resources/platforms/client/Client.d.ts +4 -0
  39. package/cjs/api/resources/platforms/client/Client.js +12 -0
  40. package/cjs/api/resources/posts/client/Client.d.ts +56 -1
  41. package/cjs/api/resources/posts/client/Client.js +165 -0
  42. package/cjs/api/resources/posts/types/CountByTabPostsResponse.d.ts +7 -0
  43. package/cjs/api/resources/posts/types/CountByTabPostsResponse.js +3 -0
  44. package/cjs/api/resources/posts/types/CreatePostsResponse.d.ts +1 -0
  45. package/cjs/api/resources/posts/types/index.d.ts +1 -0
  46. package/cjs/api/resources/posts/types/index.js +1 -0
  47. package/cjs/api/resources/socialAccounts/client/Client.d.ts +57 -0
  48. package/cjs/api/resources/socialAccounts/client/Client.js +171 -0
  49. package/cjs/api/resources/tags/client/Client.d.ts +21 -0
  50. package/cjs/api/resources/tags/client/Client.js +63 -0
  51. package/cjs/api/resources/webhooks/client/Client.d.ts +51 -8
  52. package/cjs/api/resources/webhooks/client/Client.js +133 -1
  53. package/cjs/api/resources/webhooks/index.d.ts +1 -0
  54. package/cjs/api/resources/webhooks/index.js +1 -0
  55. package/cjs/api/resources/webhooks/types/DeleteWebhooksResponse.d.ts +3 -0
  56. package/cjs/api/resources/webhooks/types/DeleteWebhooksResponse.js +3 -0
  57. package/cjs/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.d.ts +4 -0
  58. package/cjs/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.js +3 -0
  59. package/cjs/api/resources/webhooks/types/ListWebhooksResponse.d.ts +4 -0
  60. package/cjs/api/resources/webhooks/types/ListWebhooksResponse.js +3 -0
  61. package/cjs/api/resources/webhooks/types/TestWebhooksResponse.d.ts +3 -0
  62. package/cjs/api/resources/webhooks/types/TestWebhooksResponse.js +3 -0
  63. package/cjs/api/resources/webhooks/types/index.d.ts +4 -0
  64. package/cjs/api/resources/webhooks/types/index.js +20 -0
  65. package/cjs/api/types/AiGeneration.d.ts +27 -0
  66. package/cjs/api/types/AiGeneration.js +14 -0
  67. package/cjs/api/types/ErrorResponse.d.ts +14 -2
  68. package/cjs/api/types/Media.d.ts +4 -0
  69. package/cjs/api/types/MediaUpdate.d.ts +1 -1
  70. package/cjs/api/types/Post.d.ts +3 -0
  71. package/cjs/api/types/PostMedia.d.ts +14 -0
  72. package/cjs/api/types/PostMedia.js +3 -0
  73. package/cjs/api/types/PostWithRelations.d.ts +5 -68
  74. package/cjs/api/types/PostWithRelations.js +0 -54
  75. package/cjs/api/types/RateLimitErrorResponse.d.ts +17 -0
  76. package/cjs/api/types/RateLimitErrorResponse.js +3 -0
  77. package/cjs/api/types/ValidationErrorResponse.d.ts +17 -0
  78. package/cjs/api/types/ValidationErrorResponse.js +3 -0
  79. package/cjs/api/types/WebhookDelivery.d.ts +20 -0
  80. package/cjs/api/types/WebhookDelivery.js +12 -0
  81. package/cjs/api/types/WebhookEndpoint.d.ts +26 -0
  82. package/cjs/api/types/WebhookEndpoint.js +16 -0
  83. package/cjs/api/types/index.d.ts +6 -0
  84. package/cjs/api/types/index.js +6 -0
  85. package/esm/api/errors/BadRequestError.d.mts +7 -0
  86. package/esm/api/errors/BadRequestError.mjs +17 -0
  87. package/esm/api/errors/ConflictError.d.mts +7 -0
  88. package/esm/api/errors/ConflictError.mjs +17 -0
  89. package/esm/api/errors/ForbiddenError.d.mts +7 -0
  90. package/esm/api/errors/ForbiddenError.mjs +17 -0
  91. package/esm/api/errors/NotFoundError.d.mts +7 -0
  92. package/esm/api/errors/NotFoundError.mjs +17 -0
  93. package/esm/api/errors/PaymentRequiredError.d.mts +7 -0
  94. package/esm/api/errors/PaymentRequiredError.mjs +17 -0
  95. package/esm/api/errors/TooManyRequestsError.d.mts +7 -0
  96. package/esm/api/errors/TooManyRequestsError.mjs +17 -0
  97. package/esm/api/errors/UnprocessableEntityError.d.mts +7 -0
  98. package/esm/api/errors/UnprocessableEntityError.mjs +17 -0
  99. package/esm/api/errors/index.d.mts +7 -0
  100. package/esm/api/errors/index.mjs +7 -0
  101. package/esm/api/resources/ai/client/Client.d.mts +11 -2
  102. package/esm/api/resources/ai/client/Client.mjs +27 -0
  103. package/esm/api/resources/ai/index.d.mts +1 -0
  104. package/esm/api/resources/ai/index.mjs +1 -0
  105. package/esm/api/resources/ai/types/GenerateImageAiResponse.d.mts +3 -0
  106. package/esm/api/resources/ai/types/GenerateImageAiResponse.mjs +2 -0
  107. package/esm/api/resources/ai/types/index.d.mts +1 -0
  108. package/esm/api/resources/ai/types/index.mjs +1 -0
  109. package/esm/api/resources/index.d.mts +2 -0
  110. package/esm/api/resources/index.mjs +2 -0
  111. package/esm/api/resources/media/client/Client.d.mts +58 -8
  112. package/esm/api/resources/media/client/Client.mjs +158 -3
  113. package/esm/api/resources/media/client/requests/UpdateMediaRequest.d.mts +2 -3
  114. package/esm/api/resources/media/types/CreateUploadLinkMediaResponse.d.mts +4 -0
  115. package/esm/api/resources/media/types/CreateUploadLinkMediaResponse.mjs +2 -0
  116. package/esm/api/resources/media/types/DeleteMediaResponse.d.mts +4 -0
  117. package/esm/api/resources/media/types/DeleteMediaResponse.mjs +2 -0
  118. package/esm/api/resources/media/types/SetTagsMediaResponse.d.mts +4 -0
  119. package/esm/api/resources/media/types/SetTagsMediaResponse.mjs +2 -0
  120. package/esm/api/resources/media/types/index.d.mts +3 -0
  121. package/esm/api/resources/media/types/index.mjs +3 -0
  122. package/esm/api/resources/platforms/client/Client.d.mts +4 -0
  123. package/esm/api/resources/platforms/client/Client.mjs +12 -0
  124. package/esm/api/resources/posts/client/Client.d.mts +56 -1
  125. package/esm/api/resources/posts/client/Client.mjs +165 -0
  126. package/esm/api/resources/posts/types/CountByTabPostsResponse.d.mts +7 -0
  127. package/esm/api/resources/posts/types/CountByTabPostsResponse.mjs +2 -0
  128. package/esm/api/resources/posts/types/CreatePostsResponse.d.mts +1 -0
  129. package/esm/api/resources/posts/types/index.d.mts +1 -0
  130. package/esm/api/resources/posts/types/index.mjs +1 -0
  131. package/esm/api/resources/socialAccounts/client/Client.d.mts +57 -0
  132. package/esm/api/resources/socialAccounts/client/Client.mjs +171 -0
  133. package/esm/api/resources/tags/client/Client.d.mts +21 -0
  134. package/esm/api/resources/tags/client/Client.mjs +63 -0
  135. package/esm/api/resources/webhooks/client/Client.d.mts +51 -8
  136. package/esm/api/resources/webhooks/client/Client.mjs +133 -1
  137. package/esm/api/resources/webhooks/index.d.mts +1 -0
  138. package/esm/api/resources/webhooks/index.mjs +1 -0
  139. package/esm/api/resources/webhooks/types/DeleteWebhooksResponse.d.mts +3 -0
  140. package/esm/api/resources/webhooks/types/DeleteWebhooksResponse.mjs +2 -0
  141. package/esm/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.d.mts +4 -0
  142. package/esm/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.mjs +2 -0
  143. package/esm/api/resources/webhooks/types/ListWebhooksResponse.d.mts +4 -0
  144. package/esm/api/resources/webhooks/types/ListWebhooksResponse.mjs +2 -0
  145. package/esm/api/resources/webhooks/types/TestWebhooksResponse.d.mts +3 -0
  146. package/esm/api/resources/webhooks/types/TestWebhooksResponse.mjs +2 -0
  147. package/esm/api/resources/webhooks/types/index.d.mts +4 -0
  148. package/esm/api/resources/webhooks/types/index.mjs +4 -0
  149. package/esm/api/types/AiGeneration.d.mts +27 -0
  150. package/esm/api/types/AiGeneration.mjs +11 -0
  151. package/esm/api/types/ErrorResponse.d.mts +14 -2
  152. package/esm/api/types/Media.d.mts +4 -0
  153. package/esm/api/types/MediaUpdate.d.mts +1 -1
  154. package/esm/api/types/Post.d.mts +3 -0
  155. package/esm/api/types/PostMedia.d.mts +14 -0
  156. package/esm/api/types/PostMedia.mjs +2 -0
  157. package/esm/api/types/PostWithRelations.d.mts +5 -68
  158. package/esm/api/types/PostWithRelations.mjs +1 -53
  159. package/esm/api/types/RateLimitErrorResponse.d.mts +17 -0
  160. package/esm/api/types/RateLimitErrorResponse.mjs +2 -0
  161. package/esm/api/types/ValidationErrorResponse.d.mts +17 -0
  162. package/esm/api/types/ValidationErrorResponse.mjs +2 -0
  163. package/esm/api/types/WebhookDelivery.d.mts +20 -0
  164. package/esm/api/types/WebhookDelivery.mjs +9 -0
  165. package/esm/api/types/WebhookEndpoint.d.mts +26 -0
  166. package/esm/api/types/WebhookEndpoint.mjs +13 -0
  167. package/esm/api/types/index.d.mts +6 -0
  168. package/esm/api/types/index.mjs +6 -0
  169. package/package.json +1 -1
@@ -24,7 +24,11 @@ export class PlatformsClient {
24
24
  *
25
25
  * @param {PlatformsClient.RequestOptions} requestOptions - Request-specific configuration.
26
26
  *
27
+ * @throws {@link Schedulin.BadRequestError}
27
28
  * @throws {@link Schedulin.UnauthorizedError}
29
+ * @throws {@link Schedulin.ForbiddenError}
30
+ * @throws {@link Schedulin.UnprocessableEntityError}
31
+ * @throws {@link Schedulin.TooManyRequestsError}
28
32
  * @throws {@link Schedulin.InternalServerError}
29
33
  * @throws {@link errors.SchedulinError}
30
34
  * @throws {@link errors.SchedulinTimeoutError}
@@ -56,8 +60,16 @@ export class PlatformsClient {
56
60
  }
57
61
  if (_response.error.reason === "status-code") {
58
62
  switch (_response.error.statusCode) {
63
+ case 400:
64
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
59
65
  case 401:
60
66
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
67
+ case 403:
68
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
69
+ case 422:
70
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
71
+ case 429:
72
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
61
73
  case 500:
62
74
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
63
75
  default:
@@ -16,7 +16,11 @@ export declare class PostsClient {
16
16
  * @param {Schedulin.ListPostsRequest} request
17
17
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
18
18
  *
19
+ * @throws {@link Schedulin.BadRequestError}
19
20
  * @throws {@link Schedulin.UnauthorizedError}
21
+ * @throws {@link Schedulin.ForbiddenError}
22
+ * @throws {@link Schedulin.UnprocessableEntityError}
23
+ * @throws {@link Schedulin.TooManyRequestsError}
20
24
  * @throws {@link Schedulin.InternalServerError}
21
25
  * @throws {@link errors.SchedulinError}
22
26
  * @throws {@link errors.SchedulinTimeoutError}
@@ -32,7 +36,13 @@ export declare class PostsClient {
32
36
  * @param {Schedulin.PostCreate} request
33
37
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
34
38
  *
39
+ * @throws {@link Schedulin.BadRequestError}
35
40
  * @throws {@link Schedulin.UnauthorizedError}
41
+ * @throws {@link Schedulin.PaymentRequiredError}
42
+ * @throws {@link Schedulin.ForbiddenError}
43
+ * @throws {@link Schedulin.ConflictError}
44
+ * @throws {@link Schedulin.UnprocessableEntityError}
45
+ * @throws {@link Schedulin.TooManyRequestsError}
36
46
  * @throws {@link Schedulin.InternalServerError}
37
47
  * @throws {@link errors.SchedulinError}
38
48
  * @throws {@link errors.SchedulinTimeoutError}
@@ -51,7 +61,11 @@ export declare class PostsClient {
51
61
  * @param {Schedulin.CountByTabPostsRequest} request
52
62
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
53
63
  *
64
+ * @throws {@link Schedulin.BadRequestError}
54
65
  * @throws {@link Schedulin.UnauthorizedError}
66
+ * @throws {@link Schedulin.ForbiddenError}
67
+ * @throws {@link Schedulin.UnprocessableEntityError}
68
+ * @throws {@link Schedulin.TooManyRequestsError}
55
69
  * @throws {@link Schedulin.InternalServerError}
56
70
  * @throws {@link errors.SchedulinError}
57
71
  * @throws {@link errors.SchedulinTimeoutError}
@@ -59,7 +73,7 @@ export declare class PostsClient {
59
73
  * @example
60
74
  * await client.posts.countByTab()
61
75
  */
62
- countByTab(request?: Schedulin.CountByTabPostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<unknown>;
76
+ countByTab(request?: Schedulin.CountByTabPostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<Schedulin.CountByTabPostsResponse>;
63
77
  private __countByTab;
64
78
  /**
65
79
  * Retrieve a single post by its ID with all relations
@@ -67,7 +81,12 @@ export declare class PostsClient {
67
81
  * @param {Schedulin.RetrievePostsRequest} request
68
82
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
69
83
  *
84
+ * @throws {@link Schedulin.BadRequestError}
70
85
  * @throws {@link Schedulin.UnauthorizedError}
86
+ * @throws {@link Schedulin.ForbiddenError}
87
+ * @throws {@link Schedulin.NotFoundError}
88
+ * @throws {@link Schedulin.UnprocessableEntityError}
89
+ * @throws {@link Schedulin.TooManyRequestsError}
71
90
  * @throws {@link Schedulin.InternalServerError}
72
91
  * @throws {@link errors.SchedulinError}
73
92
  * @throws {@link errors.SchedulinTimeoutError}
@@ -85,7 +104,14 @@ export declare class PostsClient {
85
104
  * @param {Schedulin.UpdatePostsRequest} request
86
105
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
87
106
  *
107
+ * @throws {@link Schedulin.BadRequestError}
88
108
  * @throws {@link Schedulin.UnauthorizedError}
109
+ * @throws {@link Schedulin.PaymentRequiredError}
110
+ * @throws {@link Schedulin.ForbiddenError}
111
+ * @throws {@link Schedulin.NotFoundError}
112
+ * @throws {@link Schedulin.ConflictError}
113
+ * @throws {@link Schedulin.UnprocessableEntityError}
114
+ * @throws {@link Schedulin.TooManyRequestsError}
89
115
  * @throws {@link Schedulin.InternalServerError}
90
116
  * @throws {@link errors.SchedulinError}
91
117
  * @throws {@link errors.SchedulinTimeoutError}
@@ -103,7 +129,13 @@ export declare class PostsClient {
103
129
  * @param {Schedulin.DeletePostsRequest} request
104
130
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
105
131
  *
132
+ * @throws {@link Schedulin.BadRequestError}
106
133
  * @throws {@link Schedulin.UnauthorizedError}
134
+ * @throws {@link Schedulin.ForbiddenError}
135
+ * @throws {@link Schedulin.NotFoundError}
136
+ * @throws {@link Schedulin.ConflictError}
137
+ * @throws {@link Schedulin.UnprocessableEntityError}
138
+ * @throws {@link Schedulin.TooManyRequestsError}
107
139
  * @throws {@link Schedulin.InternalServerError}
108
140
  * @throws {@link errors.SchedulinError}
109
141
  * @throws {@link errors.SchedulinTimeoutError}
@@ -121,7 +153,12 @@ export declare class PostsClient {
121
153
  * @param {Schedulin.AnalyticsSummaryPostsRequest} request
122
154
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
123
155
  *
156
+ * @throws {@link Schedulin.BadRequestError}
124
157
  * @throws {@link Schedulin.UnauthorizedError}
158
+ * @throws {@link Schedulin.ForbiddenError}
159
+ * @throws {@link Schedulin.NotFoundError}
160
+ * @throws {@link Schedulin.UnprocessableEntityError}
161
+ * @throws {@link Schedulin.TooManyRequestsError}
125
162
  * @throws {@link Schedulin.InternalServerError}
126
163
  * @throws {@link errors.SchedulinError}
127
164
  * @throws {@link errors.SchedulinTimeoutError}
@@ -139,7 +176,12 @@ export declare class PostsClient {
139
176
  * @param {Schedulin.AnalyticsSeriesPostsRequest} request
140
177
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
141
178
  *
179
+ * @throws {@link Schedulin.BadRequestError}
142
180
  * @throws {@link Schedulin.UnauthorizedError}
181
+ * @throws {@link Schedulin.ForbiddenError}
182
+ * @throws {@link Schedulin.NotFoundError}
183
+ * @throws {@link Schedulin.UnprocessableEntityError}
184
+ * @throws {@link Schedulin.TooManyRequestsError}
143
185
  * @throws {@link Schedulin.InternalServerError}
144
186
  * @throws {@link errors.SchedulinError}
145
187
  * @throws {@link errors.SchedulinTimeoutError}
@@ -157,7 +199,14 @@ export declare class PostsClient {
157
199
  * @param {Schedulin.PublishDraftPostsRequest} request
158
200
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
159
201
  *
202
+ * @throws {@link Schedulin.BadRequestError}
160
203
  * @throws {@link Schedulin.UnauthorizedError}
204
+ * @throws {@link Schedulin.PaymentRequiredError}
205
+ * @throws {@link Schedulin.ForbiddenError}
206
+ * @throws {@link Schedulin.NotFoundError}
207
+ * @throws {@link Schedulin.ConflictError}
208
+ * @throws {@link Schedulin.UnprocessableEntityError}
209
+ * @throws {@link Schedulin.TooManyRequestsError}
161
210
  * @throws {@link Schedulin.InternalServerError}
162
211
  * @throws {@link errors.SchedulinError}
163
212
  * @throws {@link errors.SchedulinTimeoutError}
@@ -175,7 +224,13 @@ export declare class PostsClient {
175
224
  * @param {Schedulin.UpdateTagsPostsRequest} request
176
225
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
177
226
  *
227
+ * @throws {@link Schedulin.BadRequestError}
178
228
  * @throws {@link Schedulin.UnauthorizedError}
229
+ * @throws {@link Schedulin.ForbiddenError}
230
+ * @throws {@link Schedulin.NotFoundError}
231
+ * @throws {@link Schedulin.ConflictError}
232
+ * @throws {@link Schedulin.UnprocessableEntityError}
233
+ * @throws {@link Schedulin.TooManyRequestsError}
179
234
  * @throws {@link Schedulin.InternalServerError}
180
235
  * @throws {@link errors.SchedulinError}
181
236
  * @throws {@link errors.SchedulinTimeoutError}
@@ -37,7 +37,11 @@ export class PostsClient {
37
37
  * @param {Schedulin.ListPostsRequest} request
38
38
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
39
39
  *
40
+ * @throws {@link Schedulin.BadRequestError}
40
41
  * @throws {@link Schedulin.UnauthorizedError}
42
+ * @throws {@link Schedulin.ForbiddenError}
43
+ * @throws {@link Schedulin.UnprocessableEntityError}
44
+ * @throws {@link Schedulin.TooManyRequestsError}
41
45
  * @throws {@link Schedulin.InternalServerError}
42
46
  * @throws {@link errors.SchedulinError}
43
47
  * @throws {@link errors.SchedulinTimeoutError}
@@ -85,8 +89,16 @@ export class PostsClient {
85
89
  }
86
90
  if (_response.error.reason === "status-code") {
87
91
  switch (_response.error.statusCode) {
92
+ case 400:
93
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
88
94
  case 401:
89
95
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
96
+ case 403:
97
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
98
+ case 422:
99
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
100
+ case 429:
101
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
90
102
  case 500:
91
103
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
92
104
  default:
@@ -106,7 +118,13 @@ export class PostsClient {
106
118
  * @param {Schedulin.PostCreate} request
107
119
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
108
120
  *
121
+ * @throws {@link Schedulin.BadRequestError}
109
122
  * @throws {@link Schedulin.UnauthorizedError}
123
+ * @throws {@link Schedulin.PaymentRequiredError}
124
+ * @throws {@link Schedulin.ForbiddenError}
125
+ * @throws {@link Schedulin.ConflictError}
126
+ * @throws {@link Schedulin.UnprocessableEntityError}
127
+ * @throws {@link Schedulin.TooManyRequestsError}
110
128
  * @throws {@link Schedulin.InternalServerError}
111
129
  * @throws {@link errors.SchedulinError}
112
130
  * @throws {@link errors.SchedulinTimeoutError}
@@ -144,8 +162,20 @@ export class PostsClient {
144
162
  }
145
163
  if (_response.error.reason === "status-code") {
146
164
  switch (_response.error.statusCode) {
165
+ case 400:
166
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
147
167
  case 401:
148
168
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
169
+ case 402:
170
+ throw new Schedulin.PaymentRequiredError(_response.error.body, _response.rawResponse);
171
+ case 403:
172
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
173
+ case 409:
174
+ throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
175
+ case 422:
176
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
177
+ case 429:
178
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
149
179
  case 500:
150
180
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
151
181
  default:
@@ -165,7 +195,11 @@ export class PostsClient {
165
195
  * @param {Schedulin.CountByTabPostsRequest} request
166
196
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
167
197
  *
198
+ * @throws {@link Schedulin.BadRequestError}
168
199
  * @throws {@link Schedulin.UnauthorizedError}
200
+ * @throws {@link Schedulin.ForbiddenError}
201
+ * @throws {@link Schedulin.UnprocessableEntityError}
202
+ * @throws {@link Schedulin.TooManyRequestsError}
169
203
  * @throws {@link Schedulin.InternalServerError}
170
204
  * @throws {@link errors.SchedulinError}
171
205
  * @throws {@link errors.SchedulinTimeoutError}
@@ -205,8 +239,16 @@ export class PostsClient {
205
239
  }
206
240
  if (_response.error.reason === "status-code") {
207
241
  switch (_response.error.statusCode) {
242
+ case 400:
243
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
208
244
  case 401:
209
245
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
246
+ case 403:
247
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
248
+ case 422:
249
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
250
+ case 429:
251
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
210
252
  case 500:
211
253
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
212
254
  default:
@@ -226,7 +268,12 @@ export class PostsClient {
226
268
  * @param {Schedulin.RetrievePostsRequest} request
227
269
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
228
270
  *
271
+ * @throws {@link Schedulin.BadRequestError}
229
272
  * @throws {@link Schedulin.UnauthorizedError}
273
+ * @throws {@link Schedulin.ForbiddenError}
274
+ * @throws {@link Schedulin.NotFoundError}
275
+ * @throws {@link Schedulin.UnprocessableEntityError}
276
+ * @throws {@link Schedulin.TooManyRequestsError}
230
277
  * @throws {@link Schedulin.InternalServerError}
231
278
  * @throws {@link errors.SchedulinError}
232
279
  * @throws {@link errors.SchedulinTimeoutError}
@@ -261,8 +308,18 @@ export class PostsClient {
261
308
  }
262
309
  if (_response.error.reason === "status-code") {
263
310
  switch (_response.error.statusCode) {
311
+ case 400:
312
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
264
313
  case 401:
265
314
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
315
+ case 403:
316
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
317
+ case 404:
318
+ throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
319
+ case 422:
320
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
321
+ case 429:
322
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
266
323
  case 500:
267
324
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
268
325
  default:
@@ -282,7 +339,14 @@ export class PostsClient {
282
339
  * @param {Schedulin.UpdatePostsRequest} request
283
340
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
284
341
  *
342
+ * @throws {@link Schedulin.BadRequestError}
285
343
  * @throws {@link Schedulin.UnauthorizedError}
344
+ * @throws {@link Schedulin.PaymentRequiredError}
345
+ * @throws {@link Schedulin.ForbiddenError}
346
+ * @throws {@link Schedulin.NotFoundError}
347
+ * @throws {@link Schedulin.ConflictError}
348
+ * @throws {@link Schedulin.UnprocessableEntityError}
349
+ * @throws {@link Schedulin.TooManyRequestsError}
286
350
  * @throws {@link Schedulin.InternalServerError}
287
351
  * @throws {@link errors.SchedulinError}
288
352
  * @throws {@link errors.SchedulinTimeoutError}
@@ -320,8 +384,22 @@ export class PostsClient {
320
384
  }
321
385
  if (_response.error.reason === "status-code") {
322
386
  switch (_response.error.statusCode) {
387
+ case 400:
388
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
323
389
  case 401:
324
390
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
391
+ case 402:
392
+ throw new Schedulin.PaymentRequiredError(_response.error.body, _response.rawResponse);
393
+ case 403:
394
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
395
+ case 404:
396
+ throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
397
+ case 409:
398
+ throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
399
+ case 422:
400
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
401
+ case 429:
402
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
325
403
  case 500:
326
404
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
327
405
  default:
@@ -341,7 +419,13 @@ export class PostsClient {
341
419
  * @param {Schedulin.DeletePostsRequest} request
342
420
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
343
421
  *
422
+ * @throws {@link Schedulin.BadRequestError}
344
423
  * @throws {@link Schedulin.UnauthorizedError}
424
+ * @throws {@link Schedulin.ForbiddenError}
425
+ * @throws {@link Schedulin.NotFoundError}
426
+ * @throws {@link Schedulin.ConflictError}
427
+ * @throws {@link Schedulin.UnprocessableEntityError}
428
+ * @throws {@link Schedulin.TooManyRequestsError}
345
429
  * @throws {@link Schedulin.InternalServerError}
346
430
  * @throws {@link errors.SchedulinError}
347
431
  * @throws {@link errors.SchedulinTimeoutError}
@@ -379,8 +463,20 @@ export class PostsClient {
379
463
  }
380
464
  if (_response.error.reason === "status-code") {
381
465
  switch (_response.error.statusCode) {
466
+ case 400:
467
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
382
468
  case 401:
383
469
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
470
+ case 403:
471
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
472
+ case 404:
473
+ throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
474
+ case 409:
475
+ throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
476
+ case 422:
477
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
478
+ case 429:
479
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
384
480
  case 500:
385
481
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
386
482
  default:
@@ -400,7 +496,12 @@ export class PostsClient {
400
496
  * @param {Schedulin.AnalyticsSummaryPostsRequest} request
401
497
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
402
498
  *
499
+ * @throws {@link Schedulin.BadRequestError}
403
500
  * @throws {@link Schedulin.UnauthorizedError}
501
+ * @throws {@link Schedulin.ForbiddenError}
502
+ * @throws {@link Schedulin.NotFoundError}
503
+ * @throws {@link Schedulin.UnprocessableEntityError}
504
+ * @throws {@link Schedulin.TooManyRequestsError}
404
505
  * @throws {@link Schedulin.InternalServerError}
405
506
  * @throws {@link errors.SchedulinError}
406
507
  * @throws {@link errors.SchedulinTimeoutError}
@@ -438,8 +539,18 @@ export class PostsClient {
438
539
  }
439
540
  if (_response.error.reason === "status-code") {
440
541
  switch (_response.error.statusCode) {
542
+ case 400:
543
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
441
544
  case 401:
442
545
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
546
+ case 403:
547
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
548
+ case 404:
549
+ throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
550
+ case 422:
551
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
552
+ case 429:
553
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
443
554
  case 500:
444
555
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
445
556
  default:
@@ -459,7 +570,12 @@ export class PostsClient {
459
570
  * @param {Schedulin.AnalyticsSeriesPostsRequest} request
460
571
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
461
572
  *
573
+ * @throws {@link Schedulin.BadRequestError}
462
574
  * @throws {@link Schedulin.UnauthorizedError}
575
+ * @throws {@link Schedulin.ForbiddenError}
576
+ * @throws {@link Schedulin.NotFoundError}
577
+ * @throws {@link Schedulin.UnprocessableEntityError}
578
+ * @throws {@link Schedulin.TooManyRequestsError}
463
579
  * @throws {@link Schedulin.InternalServerError}
464
580
  * @throws {@link errors.SchedulinError}
465
581
  * @throws {@link errors.SchedulinTimeoutError}
@@ -504,8 +620,18 @@ export class PostsClient {
504
620
  }
505
621
  if (_response.error.reason === "status-code") {
506
622
  switch (_response.error.statusCode) {
623
+ case 400:
624
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
507
625
  case 401:
508
626
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
627
+ case 403:
628
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
629
+ case 404:
630
+ throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
631
+ case 422:
632
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
633
+ case 429:
634
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
509
635
  case 500:
510
636
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
511
637
  default:
@@ -525,7 +651,14 @@ export class PostsClient {
525
651
  * @param {Schedulin.PublishDraftPostsRequest} request
526
652
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
527
653
  *
654
+ * @throws {@link Schedulin.BadRequestError}
528
655
  * @throws {@link Schedulin.UnauthorizedError}
656
+ * @throws {@link Schedulin.PaymentRequiredError}
657
+ * @throws {@link Schedulin.ForbiddenError}
658
+ * @throws {@link Schedulin.NotFoundError}
659
+ * @throws {@link Schedulin.ConflictError}
660
+ * @throws {@link Schedulin.UnprocessableEntityError}
661
+ * @throws {@link Schedulin.TooManyRequestsError}
529
662
  * @throws {@link Schedulin.InternalServerError}
530
663
  * @throws {@link errors.SchedulinError}
531
664
  * @throws {@link errors.SchedulinTimeoutError}
@@ -563,8 +696,22 @@ export class PostsClient {
563
696
  }
564
697
  if (_response.error.reason === "status-code") {
565
698
  switch (_response.error.statusCode) {
699
+ case 400:
700
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
566
701
  case 401:
567
702
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
703
+ case 402:
704
+ throw new Schedulin.PaymentRequiredError(_response.error.body, _response.rawResponse);
705
+ case 403:
706
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
707
+ case 404:
708
+ throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
709
+ case 409:
710
+ throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
711
+ case 422:
712
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
713
+ case 429:
714
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
568
715
  case 500:
569
716
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
570
717
  default:
@@ -584,7 +731,13 @@ export class PostsClient {
584
731
  * @param {Schedulin.UpdateTagsPostsRequest} request
585
732
  * @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
586
733
  *
734
+ * @throws {@link Schedulin.BadRequestError}
587
735
  * @throws {@link Schedulin.UnauthorizedError}
736
+ * @throws {@link Schedulin.ForbiddenError}
737
+ * @throws {@link Schedulin.NotFoundError}
738
+ * @throws {@link Schedulin.ConflictError}
739
+ * @throws {@link Schedulin.UnprocessableEntityError}
740
+ * @throws {@link Schedulin.TooManyRequestsError}
588
741
  * @throws {@link Schedulin.InternalServerError}
589
742
  * @throws {@link errors.SchedulinError}
590
743
  * @throws {@link errors.SchedulinTimeoutError}
@@ -623,8 +776,20 @@ export class PostsClient {
623
776
  }
624
777
  if (_response.error.reason === "status-code") {
625
778
  switch (_response.error.statusCode) {
779
+ case 400:
780
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
626
781
  case 401:
627
782
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
783
+ case 403:
784
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
785
+ case 404:
786
+ throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
787
+ case 409:
788
+ throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
789
+ case 422:
790
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
791
+ case 429:
792
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
628
793
  case 500:
629
794
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
630
795
  default:
@@ -0,0 +1,7 @@
1
+ export interface CountByTabPostsResponse {
2
+ queue: number;
3
+ drafts: number;
4
+ approvals: number;
5
+ sent: number;
6
+ failed: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -7,6 +7,7 @@ export interface CreatePostsResponse {
7
7
  scheduledAt: string | null;
8
8
  platformConfiguration: Record<string, unknown> | null;
9
9
  media: CreatePostsResponse.Media.Item[];
10
+ socialAccountId: string;
10
11
  socialAccounts: Schedulin.SocialAccountPublic[];
11
12
  createdAt: string;
12
13
  updatedAt: string;
@@ -1,5 +1,6 @@
1
1
  export * from "./AnalyticsSeriesPostsResponse.mjs";
2
2
  export * from "./AnalyticsSummaryPostsResponse.mjs";
3
+ export * from "./CountByTabPostsResponse.mjs";
3
4
  export * from "./CreatePostsResponse.mjs";
4
5
  export * from "./ListPostsRequestApprovalStatus.mjs";
5
6
  export * from "./ListPostsRequestStatus.mjs";
@@ -1,5 +1,6 @@
1
1
  export * from "./AnalyticsSeriesPostsResponse.mjs";
2
2
  export * from "./AnalyticsSummaryPostsResponse.mjs";
3
+ export * from "./CountByTabPostsResponse.mjs";
3
4
  export * from "./CreatePostsResponse.mjs";
4
5
  export * from "./ListPostsRequestApprovalStatus.mjs";
5
6
  export * from "./ListPostsRequestStatus.mjs";