@schedulin/sdk 0.3.0 → 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 (191) 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 +59 -9
  28. package/cjs/api/resources/media/client/Client.js +159 -4
  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 +93 -0
  48. package/cjs/api/resources/socialAccounts/client/Client.js +289 -0
  49. package/cjs/api/resources/socialAccounts/client/requests/ListDiscordChannelsSocialAccountsRequest.d.ts +9 -0
  50. package/cjs/api/resources/socialAccounts/client/requests/ListDiscordChannelsSocialAccountsRequest.js +3 -0
  51. package/cjs/api/resources/socialAccounts/client/requests/ListSlackChannelsSocialAccountsRequest.d.ts +9 -0
  52. package/cjs/api/resources/socialAccounts/client/requests/ListSlackChannelsSocialAccountsRequest.js +3 -0
  53. package/cjs/api/resources/socialAccounts/client/requests/index.d.ts +2 -0
  54. package/cjs/api/resources/socialAccounts/types/ListDiscordChannelsSocialAccountsResponse.d.ts +12 -0
  55. package/cjs/api/resources/socialAccounts/types/ListDiscordChannelsSocialAccountsResponse.js +3 -0
  56. package/cjs/api/resources/socialAccounts/types/ListSlackChannelsSocialAccountsResponse.d.ts +12 -0
  57. package/cjs/api/resources/socialAccounts/types/ListSlackChannelsSocialAccountsResponse.js +3 -0
  58. package/cjs/api/resources/socialAccounts/types/index.d.ts +2 -0
  59. package/cjs/api/resources/socialAccounts/types/index.js +2 -0
  60. package/cjs/api/resources/tags/client/Client.d.ts +21 -0
  61. package/cjs/api/resources/tags/client/Client.js +63 -0
  62. package/cjs/api/resources/webhooks/client/Client.d.ts +51 -8
  63. package/cjs/api/resources/webhooks/client/Client.js +133 -1
  64. package/cjs/api/resources/webhooks/index.d.ts +1 -0
  65. package/cjs/api/resources/webhooks/index.js +1 -0
  66. package/cjs/api/resources/webhooks/types/DeleteWebhooksResponse.d.ts +3 -0
  67. package/cjs/api/resources/webhooks/types/DeleteWebhooksResponse.js +3 -0
  68. package/cjs/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.d.ts +4 -0
  69. package/cjs/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.js +3 -0
  70. package/cjs/api/resources/webhooks/types/ListWebhooksResponse.d.ts +4 -0
  71. package/cjs/api/resources/webhooks/types/ListWebhooksResponse.js +3 -0
  72. package/cjs/api/resources/webhooks/types/TestWebhooksResponse.d.ts +3 -0
  73. package/cjs/api/resources/webhooks/types/TestWebhooksResponse.js +3 -0
  74. package/cjs/api/resources/webhooks/types/index.d.ts +4 -0
  75. package/cjs/api/resources/webhooks/types/index.js +20 -0
  76. package/cjs/api/types/AiGeneration.d.ts +27 -0
  77. package/cjs/api/types/AiGeneration.js +14 -0
  78. package/cjs/api/types/ErrorResponse.d.ts +14 -2
  79. package/cjs/api/types/Media.d.ts +4 -0
  80. package/cjs/api/types/MediaUpdate.d.ts +1 -1
  81. package/cjs/api/types/Post.d.ts +3 -0
  82. package/cjs/api/types/PostMedia.d.ts +14 -0
  83. package/cjs/api/types/PostMedia.js +3 -0
  84. package/cjs/api/types/PostWithRelations.d.ts +5 -68
  85. package/cjs/api/types/PostWithRelations.js +0 -54
  86. package/cjs/api/types/RateLimitErrorResponse.d.ts +17 -0
  87. package/cjs/api/types/RateLimitErrorResponse.js +3 -0
  88. package/cjs/api/types/ValidationErrorResponse.d.ts +17 -0
  89. package/cjs/api/types/ValidationErrorResponse.js +3 -0
  90. package/cjs/api/types/WebhookDelivery.d.ts +20 -0
  91. package/cjs/api/types/WebhookDelivery.js +12 -0
  92. package/cjs/api/types/WebhookEndpoint.d.ts +26 -0
  93. package/cjs/api/types/WebhookEndpoint.js +16 -0
  94. package/cjs/api/types/index.d.ts +6 -0
  95. package/cjs/api/types/index.js +6 -0
  96. package/esm/api/errors/BadRequestError.d.mts +7 -0
  97. package/esm/api/errors/BadRequestError.mjs +17 -0
  98. package/esm/api/errors/ConflictError.d.mts +7 -0
  99. package/esm/api/errors/ConflictError.mjs +17 -0
  100. package/esm/api/errors/ForbiddenError.d.mts +7 -0
  101. package/esm/api/errors/ForbiddenError.mjs +17 -0
  102. package/esm/api/errors/NotFoundError.d.mts +7 -0
  103. package/esm/api/errors/NotFoundError.mjs +17 -0
  104. package/esm/api/errors/PaymentRequiredError.d.mts +7 -0
  105. package/esm/api/errors/PaymentRequiredError.mjs +17 -0
  106. package/esm/api/errors/TooManyRequestsError.d.mts +7 -0
  107. package/esm/api/errors/TooManyRequestsError.mjs +17 -0
  108. package/esm/api/errors/UnprocessableEntityError.d.mts +7 -0
  109. package/esm/api/errors/UnprocessableEntityError.mjs +17 -0
  110. package/esm/api/errors/index.d.mts +7 -0
  111. package/esm/api/errors/index.mjs +7 -0
  112. package/esm/api/resources/ai/client/Client.d.mts +11 -2
  113. package/esm/api/resources/ai/client/Client.mjs +27 -0
  114. package/esm/api/resources/ai/index.d.mts +1 -0
  115. package/esm/api/resources/ai/index.mjs +1 -0
  116. package/esm/api/resources/ai/types/GenerateImageAiResponse.d.mts +3 -0
  117. package/esm/api/resources/ai/types/GenerateImageAiResponse.mjs +2 -0
  118. package/esm/api/resources/ai/types/index.d.mts +1 -0
  119. package/esm/api/resources/ai/types/index.mjs +1 -0
  120. package/esm/api/resources/index.d.mts +2 -0
  121. package/esm/api/resources/index.mjs +2 -0
  122. package/esm/api/resources/media/client/Client.d.mts +59 -9
  123. package/esm/api/resources/media/client/Client.mjs +159 -4
  124. package/esm/api/resources/media/client/requests/UpdateMediaRequest.d.mts +2 -3
  125. package/esm/api/resources/media/types/CreateUploadLinkMediaResponse.d.mts +4 -0
  126. package/esm/api/resources/media/types/CreateUploadLinkMediaResponse.mjs +2 -0
  127. package/esm/api/resources/media/types/DeleteMediaResponse.d.mts +4 -0
  128. package/esm/api/resources/media/types/DeleteMediaResponse.mjs +2 -0
  129. package/esm/api/resources/media/types/SetTagsMediaResponse.d.mts +4 -0
  130. package/esm/api/resources/media/types/SetTagsMediaResponse.mjs +2 -0
  131. package/esm/api/resources/media/types/index.d.mts +3 -0
  132. package/esm/api/resources/media/types/index.mjs +3 -0
  133. package/esm/api/resources/platforms/client/Client.d.mts +4 -0
  134. package/esm/api/resources/platforms/client/Client.mjs +12 -0
  135. package/esm/api/resources/posts/client/Client.d.mts +56 -1
  136. package/esm/api/resources/posts/client/Client.mjs +165 -0
  137. package/esm/api/resources/posts/types/CountByTabPostsResponse.d.mts +7 -0
  138. package/esm/api/resources/posts/types/CountByTabPostsResponse.mjs +2 -0
  139. package/esm/api/resources/posts/types/CreatePostsResponse.d.mts +1 -0
  140. package/esm/api/resources/posts/types/index.d.mts +1 -0
  141. package/esm/api/resources/posts/types/index.mjs +1 -0
  142. package/esm/api/resources/socialAccounts/client/Client.d.mts +93 -0
  143. package/esm/api/resources/socialAccounts/client/Client.mjs +289 -0
  144. package/esm/api/resources/socialAccounts/client/requests/ListDiscordChannelsSocialAccountsRequest.d.mts +9 -0
  145. package/esm/api/resources/socialAccounts/client/requests/ListDiscordChannelsSocialAccountsRequest.mjs +2 -0
  146. package/esm/api/resources/socialAccounts/client/requests/ListSlackChannelsSocialAccountsRequest.d.mts +9 -0
  147. package/esm/api/resources/socialAccounts/client/requests/ListSlackChannelsSocialAccountsRequest.mjs +2 -0
  148. package/esm/api/resources/socialAccounts/client/requests/index.d.mts +2 -0
  149. package/esm/api/resources/socialAccounts/types/ListDiscordChannelsSocialAccountsResponse.d.mts +12 -0
  150. package/esm/api/resources/socialAccounts/types/ListDiscordChannelsSocialAccountsResponse.mjs +2 -0
  151. package/esm/api/resources/socialAccounts/types/ListSlackChannelsSocialAccountsResponse.d.mts +12 -0
  152. package/esm/api/resources/socialAccounts/types/ListSlackChannelsSocialAccountsResponse.mjs +2 -0
  153. package/esm/api/resources/socialAccounts/types/index.d.mts +2 -0
  154. package/esm/api/resources/socialAccounts/types/index.mjs +2 -0
  155. package/esm/api/resources/tags/client/Client.d.mts +21 -0
  156. package/esm/api/resources/tags/client/Client.mjs +63 -0
  157. package/esm/api/resources/webhooks/client/Client.d.mts +51 -8
  158. package/esm/api/resources/webhooks/client/Client.mjs +133 -1
  159. package/esm/api/resources/webhooks/index.d.mts +1 -0
  160. package/esm/api/resources/webhooks/index.mjs +1 -0
  161. package/esm/api/resources/webhooks/types/DeleteWebhooksResponse.d.mts +3 -0
  162. package/esm/api/resources/webhooks/types/DeleteWebhooksResponse.mjs +2 -0
  163. package/esm/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.d.mts +4 -0
  164. package/esm/api/resources/webhooks/types/ListDeliveriesWebhooksResponse.mjs +2 -0
  165. package/esm/api/resources/webhooks/types/ListWebhooksResponse.d.mts +4 -0
  166. package/esm/api/resources/webhooks/types/ListWebhooksResponse.mjs +2 -0
  167. package/esm/api/resources/webhooks/types/TestWebhooksResponse.d.mts +3 -0
  168. package/esm/api/resources/webhooks/types/TestWebhooksResponse.mjs +2 -0
  169. package/esm/api/resources/webhooks/types/index.d.mts +4 -0
  170. package/esm/api/resources/webhooks/types/index.mjs +4 -0
  171. package/esm/api/types/AiGeneration.d.mts +27 -0
  172. package/esm/api/types/AiGeneration.mjs +11 -0
  173. package/esm/api/types/ErrorResponse.d.mts +14 -2
  174. package/esm/api/types/Media.d.mts +4 -0
  175. package/esm/api/types/MediaUpdate.d.mts +1 -1
  176. package/esm/api/types/Post.d.mts +3 -0
  177. package/esm/api/types/PostMedia.d.mts +14 -0
  178. package/esm/api/types/PostMedia.mjs +2 -0
  179. package/esm/api/types/PostWithRelations.d.mts +5 -68
  180. package/esm/api/types/PostWithRelations.mjs +1 -53
  181. package/esm/api/types/RateLimitErrorResponse.d.mts +17 -0
  182. package/esm/api/types/RateLimitErrorResponse.mjs +2 -0
  183. package/esm/api/types/ValidationErrorResponse.d.mts +17 -0
  184. package/esm/api/types/ValidationErrorResponse.mjs +2 -0
  185. package/esm/api/types/WebhookDelivery.d.mts +20 -0
  186. package/esm/api/types/WebhookDelivery.mjs +9 -0
  187. package/esm/api/types/WebhookEndpoint.d.mts +26 -0
  188. package/esm/api/types/WebhookEndpoint.mjs +13 -0
  189. package/esm/api/types/index.d.mts +6 -0
  190. package/esm/api/types/index.mjs +6 -0
  191. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../errors/index.mjs";
3
+ export class PaymentRequiredError extends errors.SchedulinError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "PaymentRequiredError",
7
+ statusCode: 402,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = "PaymentRequiredError";
16
+ }
17
+ }
@@ -0,0 +1,7 @@
1
+ import type * as core from "../../core/index.mjs";
2
+ import * as errors from "../../errors/index.mjs";
3
+ import type * as Schedulin from "../index.mjs";
4
+ export declare class TooManyRequestsError extends errors.SchedulinError {
5
+ readonly body: Schedulin.RateLimitErrorResponse;
6
+ constructor(body: Schedulin.RateLimitErrorResponse, rawResponse?: core.RawResponse);
7
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../errors/index.mjs";
3
+ export class TooManyRequestsError extends errors.SchedulinError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "TooManyRequestsError",
7
+ statusCode: 429,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = "TooManyRequestsError";
16
+ }
17
+ }
@@ -0,0 +1,7 @@
1
+ import type * as core from "../../core/index.mjs";
2
+ import * as errors from "../../errors/index.mjs";
3
+ import type * as Schedulin from "../index.mjs";
4
+ export declare class UnprocessableEntityError extends errors.SchedulinError {
5
+ readonly body: Schedulin.ValidationErrorResponse;
6
+ constructor(body: Schedulin.ValidationErrorResponse, rawResponse?: core.RawResponse);
7
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../errors/index.mjs";
3
+ export class UnprocessableEntityError extends errors.SchedulinError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "UnprocessableEntityError",
7
+ statusCode: 422,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = "UnprocessableEntityError";
16
+ }
17
+ }
@@ -1,2 +1,9 @@
1
+ export * from "./BadRequestError.mjs";
2
+ export * from "./ConflictError.mjs";
3
+ export * from "./ForbiddenError.mjs";
1
4
  export * from "./InternalServerError.mjs";
5
+ export * from "./NotFoundError.mjs";
6
+ export * from "./PaymentRequiredError.mjs";
7
+ export * from "./TooManyRequestsError.mjs";
2
8
  export * from "./UnauthorizedError.mjs";
9
+ export * from "./UnprocessableEntityError.mjs";
@@ -1,2 +1,9 @@
1
+ export * from "./BadRequestError.mjs";
2
+ export * from "./ConflictError.mjs";
3
+ export * from "./ForbiddenError.mjs";
1
4
  export * from "./InternalServerError.mjs";
5
+ export * from "./NotFoundError.mjs";
6
+ export * from "./PaymentRequiredError.mjs";
7
+ export * from "./TooManyRequestsError.mjs";
2
8
  export * from "./UnauthorizedError.mjs";
9
+ export * from "./UnprocessableEntityError.mjs";
@@ -16,7 +16,12 @@ export declare class AiClient {
16
16
  * @param {Schedulin.GenerateImageAiRequest} request
17
17
  * @param {AiClient.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.ConflictError}
23
+ * @throws {@link Schedulin.UnprocessableEntityError}
24
+ * @throws {@link Schedulin.TooManyRequestsError}
20
25
  * @throws {@link Schedulin.InternalServerError}
21
26
  * @throws {@link errors.SchedulinError}
22
27
  * @throws {@link errors.SchedulinTimeoutError}
@@ -26,7 +31,7 @@ export declare class AiClient {
26
31
  * prompt: "prompt"
27
32
  * })
28
33
  */
29
- generateImage(request: Schedulin.GenerateImageAiRequest, requestOptions?: AiClient.RequestOptions): core.HttpResponsePromise<unknown>;
34
+ generateImage(request: Schedulin.GenerateImageAiRequest, requestOptions?: AiClient.RequestOptions): core.HttpResponsePromise<Schedulin.GenerateImageAiResponse>;
30
35
  private __generateImage;
31
36
  /**
32
37
  * Get the status and details of a generation job
@@ -34,7 +39,11 @@ export declare class AiClient {
34
39
  * @param {Schedulin.GetGenerationAiRequest} request
35
40
  * @param {AiClient.RequestOptions} requestOptions - Request-specific configuration.
36
41
  *
42
+ * @throws {@link Schedulin.BadRequestError}
37
43
  * @throws {@link Schedulin.UnauthorizedError}
44
+ * @throws {@link Schedulin.ForbiddenError}
45
+ * @throws {@link Schedulin.UnprocessableEntityError}
46
+ * @throws {@link Schedulin.TooManyRequestsError}
38
47
  * @throws {@link Schedulin.InternalServerError}
39
48
  * @throws {@link errors.SchedulinError}
40
49
  * @throws {@link errors.SchedulinTimeoutError}
@@ -44,6 +53,6 @@ export declare class AiClient {
44
53
  * id: "id"
45
54
  * })
46
55
  */
47
- getGeneration(request: Schedulin.GetGenerationAiRequest, requestOptions?: AiClient.RequestOptions): core.HttpResponsePromise<unknown>;
56
+ getGeneration(request: Schedulin.GetGenerationAiRequest, requestOptions?: AiClient.RequestOptions): core.HttpResponsePromise<Schedulin.AiGeneration>;
48
57
  private __getGeneration;
49
58
  }
@@ -26,7 +26,12 @@ export class AiClient {
26
26
  * @param {Schedulin.GenerateImageAiRequest} request
27
27
  * @param {AiClient.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
+ * @throws {@link Schedulin.BadRequestError}
29
30
  * @throws {@link Schedulin.UnauthorizedError}
31
+ * @throws {@link Schedulin.ForbiddenError}
32
+ * @throws {@link Schedulin.ConflictError}
33
+ * @throws {@link Schedulin.UnprocessableEntityError}
34
+ * @throws {@link Schedulin.TooManyRequestsError}
30
35
  * @throws {@link Schedulin.InternalServerError}
31
36
  * @throws {@link errors.SchedulinError}
32
37
  * @throws {@link errors.SchedulinTimeoutError}
@@ -63,8 +68,18 @@ export class AiClient {
63
68
  }
64
69
  if (_response.error.reason === "status-code") {
65
70
  switch (_response.error.statusCode) {
71
+ case 400:
72
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
66
73
  case 401:
67
74
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
75
+ case 403:
76
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
77
+ case 409:
78
+ throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
79
+ case 422:
80
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
81
+ case 429:
82
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
68
83
  case 500:
69
84
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
70
85
  default:
@@ -84,7 +99,11 @@ export class AiClient {
84
99
  * @param {Schedulin.GetGenerationAiRequest} request
85
100
  * @param {AiClient.RequestOptions} requestOptions - Request-specific configuration.
86
101
  *
102
+ * @throws {@link Schedulin.BadRequestError}
87
103
  * @throws {@link Schedulin.UnauthorizedError}
104
+ * @throws {@link Schedulin.ForbiddenError}
105
+ * @throws {@link Schedulin.UnprocessableEntityError}
106
+ * @throws {@link Schedulin.TooManyRequestsError}
88
107
  * @throws {@link Schedulin.InternalServerError}
89
108
  * @throws {@link errors.SchedulinError}
90
109
  * @throws {@link errors.SchedulinTimeoutError}
@@ -126,8 +145,16 @@ export class AiClient {
126
145
  }
127
146
  if (_response.error.reason === "status-code") {
128
147
  switch (_response.error.statusCode) {
148
+ case 400:
149
+ throw new Schedulin.BadRequestError(_response.error.body, _response.rawResponse);
129
150
  case 401:
130
151
  throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
152
+ case 403:
153
+ throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
154
+ case 422:
155
+ throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
156
+ case 429:
157
+ throw new Schedulin.TooManyRequestsError(_response.error.body, _response.rawResponse);
131
158
  case 500:
132
159
  throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
133
160
  default:
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,3 @@
1
+ export interface GenerateImageAiResponse {
2
+ generationId: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./GenerateImageAiResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./GenerateImageAiResponse.mjs";
@@ -1,5 +1,6 @@
1
1
  export * from "./ai/client/requests/index.mjs";
2
2
  export * as ai from "./ai/index.mjs";
3
+ export * from "./ai/types/index.mjs";
3
4
  export * from "./media/client/requests/index.mjs";
4
5
  export * as media from "./media/index.mjs";
5
6
  export * from "./media/types/index.mjs";
@@ -16,3 +17,4 @@ export * as tags from "./tags/index.mjs";
16
17
  export * from "./tags/types/index.mjs";
17
18
  export * from "./webhooks/client/requests/index.mjs";
18
19
  export * as webhooks from "./webhooks/index.mjs";
20
+ export * from "./webhooks/types/index.mjs";
@@ -1,5 +1,6 @@
1
1
  export * from "./ai/client/requests/index.mjs";
2
2
  export * as ai from "./ai/index.mjs";
3
+ export * from "./ai/types/index.mjs";
3
4
  export * from "./media/client/requests/index.mjs";
4
5
  export * as media from "./media/index.mjs";
5
6
  export * from "./media/types/index.mjs";
@@ -16,3 +17,4 @@ export * as tags from "./tags/index.mjs";
16
17
  export * from "./tags/types/index.mjs";
17
18
  export * from "./webhooks/client/requests/index.mjs";
18
19
  export * as webhooks from "./webhooks/index.mjs";
20
+ export * from "./webhooks/types/index.mjs";
@@ -16,7 +16,12 @@ export declare class MediaClient {
16
16
  * @param {Schedulin.CreateFromUrlMediaRequest} request
17
17
  * @param {MediaClient.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.ConflictError}
23
+ * @throws {@link Schedulin.UnprocessableEntityError}
24
+ * @throws {@link Schedulin.TooManyRequestsError}
20
25
  * @throws {@link Schedulin.InternalServerError}
21
26
  * @throws {@link errors.SchedulinError}
22
27
  * @throws {@link errors.SchedulinTimeoutError}
@@ -26,7 +31,7 @@ export declare class MediaClient {
26
31
  * url: "url"
27
32
  * })
28
33
  */
29
- createFromUrl(request: Schedulin.CreateFromUrlMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
34
+ createFromUrl(request: Schedulin.CreateFromUrlMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.Media>;
30
35
  private __createFromUrl;
31
36
  /**
32
37
  * Returns a short-lived URL to a page where the user uploads files from their device (or a pasted attachment) straight into the media library. Hand the URL to the user; once they've uploaded, call GET /v0/media (list media, newest first) and reference the returned `url` when creating a post. Use this whenever the file isn't already at a public URL.
@@ -34,7 +39,12 @@ export declare class MediaClient {
34
39
  * @param {Schedulin.CreateUploadLinkMediaRequest} request
35
40
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
36
41
  *
42
+ * @throws {@link Schedulin.BadRequestError}
37
43
  * @throws {@link Schedulin.UnauthorizedError}
44
+ * @throws {@link Schedulin.ForbiddenError}
45
+ * @throws {@link Schedulin.ConflictError}
46
+ * @throws {@link Schedulin.UnprocessableEntityError}
47
+ * @throws {@link Schedulin.TooManyRequestsError}
38
48
  * @throws {@link Schedulin.InternalServerError}
39
49
  * @throws {@link errors.SchedulinError}
40
50
  * @throws {@link errors.SchedulinTimeoutError}
@@ -42,15 +52,20 @@ export declare class MediaClient {
42
52
  * @example
43
53
  * await client.media.createUploadLink()
44
54
  */
45
- createUploadLink(request?: Schedulin.CreateUploadLinkMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
55
+ createUploadLink(request?: Schedulin.CreateUploadLinkMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.CreateUploadLinkMediaResponse>;
46
56
  private __createUploadLink;
47
57
  /**
48
- * Upload raw image, video, or audio bytes directly as multipart/form-data. The file is stored in your media library and the record is returned; use its `url` in `media[].url` when creating a post. Max 250 MB; SVG and other active content is rejected. For a file already hosted at a public URL, prefer POST /v0/media/from-url.
58
+ * Upload raw image, video, or audio bytes directly as multipart/form-data. The file is stored in your media library and the record is returned; use its `url` in `media[].url` when creating a post. When the file part's type is missing or generic (`application/octet-stream`, `text/plain`), the type is detected from the file's bytes, then its filename extension. Max 250 MB; SVG and other active content is rejected. For a file already hosted at a public URL, prefer POST /v0/media/from-url.
49
59
  *
50
60
  * @param {Schedulin.UploadMediaRequest} request
51
61
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
52
62
  *
63
+ * @throws {@link Schedulin.BadRequestError}
53
64
  * @throws {@link Schedulin.UnauthorizedError}
65
+ * @throws {@link Schedulin.ForbiddenError}
66
+ * @throws {@link Schedulin.ConflictError}
67
+ * @throws {@link Schedulin.UnprocessableEntityError}
68
+ * @throws {@link Schedulin.TooManyRequestsError}
54
69
  * @throws {@link Schedulin.InternalServerError}
55
70
  * @throws {@link errors.SchedulinError}
56
71
  * @throws {@link errors.SchedulinTimeoutError}
@@ -61,7 +76,7 @@ export declare class MediaClient {
61
76
  * file: fs.createReadStream("/path/to/your/file")
62
77
  * })
63
78
  */
64
- upload(request: Schedulin.UploadMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
79
+ upload(request: Schedulin.UploadMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.Media>;
65
80
  private __upload;
66
81
  /**
67
82
  * Retrieve media information by its ID
@@ -69,7 +84,12 @@ export declare class MediaClient {
69
84
  * @param {Schedulin.RetrieveMediaRequest} request
70
85
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
71
86
  *
87
+ * @throws {@link Schedulin.BadRequestError}
72
88
  * @throws {@link Schedulin.UnauthorizedError}
89
+ * @throws {@link Schedulin.ForbiddenError}
90
+ * @throws {@link Schedulin.NotFoundError}
91
+ * @throws {@link Schedulin.UnprocessableEntityError}
92
+ * @throws {@link Schedulin.TooManyRequestsError}
73
93
  * @throws {@link Schedulin.InternalServerError}
74
94
  * @throws {@link errors.SchedulinError}
75
95
  * @throws {@link errors.SchedulinTimeoutError}
@@ -79,7 +99,7 @@ export declare class MediaClient {
79
99
  * id: "id"
80
100
  * })
81
101
  */
82
- retrieve(request: Schedulin.RetrieveMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.Media | null>;
102
+ retrieve(request: Schedulin.RetrieveMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.Media>;
83
103
  private __retrieve;
84
104
  /**
85
105
  * Update media information and metadata
@@ -87,15 +107,20 @@ export declare class MediaClient {
87
107
  * @param {Schedulin.UpdateMediaRequest} request
88
108
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
89
109
  *
110
+ * @throws {@link Schedulin.BadRequestError}
90
111
  * @throws {@link Schedulin.UnauthorizedError}
112
+ * @throws {@link Schedulin.ForbiddenError}
113
+ * @throws {@link Schedulin.NotFoundError}
114
+ * @throws {@link Schedulin.ConflictError}
115
+ * @throws {@link Schedulin.UnprocessableEntityError}
116
+ * @throws {@link Schedulin.TooManyRequestsError}
91
117
  * @throws {@link Schedulin.InternalServerError}
92
118
  * @throws {@link errors.SchedulinError}
93
119
  * @throws {@link errors.SchedulinTimeoutError}
94
120
  *
95
121
  * @example
96
122
  * await client.media.update({
97
- * id: "id",
98
- * url: "url"
123
+ * id: "id"
99
124
  * })
100
125
  */
101
126
  update(request: Schedulin.UpdateMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.Media>;
@@ -106,7 +131,13 @@ export declare class MediaClient {
106
131
  * @param {Schedulin.DeleteMediaRequest} request
107
132
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
108
133
  *
134
+ * @throws {@link Schedulin.BadRequestError}
109
135
  * @throws {@link Schedulin.UnauthorizedError}
136
+ * @throws {@link Schedulin.ForbiddenError}
137
+ * @throws {@link Schedulin.NotFoundError}
138
+ * @throws {@link Schedulin.ConflictError}
139
+ * @throws {@link Schedulin.UnprocessableEntityError}
140
+ * @throws {@link Schedulin.TooManyRequestsError}
110
141
  * @throws {@link Schedulin.InternalServerError}
111
142
  * @throws {@link errors.SchedulinError}
112
143
  * @throws {@link errors.SchedulinTimeoutError}
@@ -116,7 +147,7 @@ export declare class MediaClient {
116
147
  * id: "id"
117
148
  * })
118
149
  */
119
- delete(request: Schedulin.DeleteMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
150
+ delete(request: Schedulin.DeleteMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.DeleteMediaResponse>;
120
151
  private __delete;
121
152
  /**
122
153
  * List media for the organization with page pagination, search, type and tag filters
@@ -124,7 +155,11 @@ export declare class MediaClient {
124
155
  * @param {Schedulin.ListMediaRequest} request
125
156
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
126
157
  *
158
+ * @throws {@link Schedulin.BadRequestError}
127
159
  * @throws {@link Schedulin.UnauthorizedError}
160
+ * @throws {@link Schedulin.ForbiddenError}
161
+ * @throws {@link Schedulin.UnprocessableEntityError}
162
+ * @throws {@link Schedulin.TooManyRequestsError}
128
163
  * @throws {@link Schedulin.InternalServerError}
129
164
  * @throws {@link errors.SchedulinError}
130
165
  * @throws {@link errors.SchedulinTimeoutError}
@@ -140,7 +175,13 @@ export declare class MediaClient {
140
175
  * @param {Schedulin.SetTagsMediaRequest} request
141
176
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
142
177
  *
178
+ * @throws {@link Schedulin.BadRequestError}
143
179
  * @throws {@link Schedulin.UnauthorizedError}
180
+ * @throws {@link Schedulin.ForbiddenError}
181
+ * @throws {@link Schedulin.NotFoundError}
182
+ * @throws {@link Schedulin.ConflictError}
183
+ * @throws {@link Schedulin.UnprocessableEntityError}
184
+ * @throws {@link Schedulin.TooManyRequestsError}
144
185
  * @throws {@link Schedulin.InternalServerError}
145
186
  * @throws {@link errors.SchedulinError}
146
187
  * @throws {@link errors.SchedulinTimeoutError}
@@ -151,14 +192,18 @@ export declare class MediaClient {
151
192
  * tagIds: ["tagIds"]
152
193
  * })
153
194
  */
154
- setTags(request: Schedulin.SetTagsMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
195
+ setTags(request: Schedulin.SetTagsMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.SetTagsMediaResponse>;
155
196
  private __setTags;
156
197
  /**
157
198
  * Return media counts grouped by tag for the organization
158
199
  *
159
200
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
160
201
  *
202
+ * @throws {@link Schedulin.BadRequestError}
161
203
  * @throws {@link Schedulin.UnauthorizedError}
204
+ * @throws {@link Schedulin.ForbiddenError}
205
+ * @throws {@link Schedulin.UnprocessableEntityError}
206
+ * @throws {@link Schedulin.TooManyRequestsError}
162
207
  * @throws {@link Schedulin.InternalServerError}
163
208
  * @throws {@link errors.SchedulinError}
164
209
  * @throws {@link errors.SchedulinTimeoutError}
@@ -174,7 +219,12 @@ export declare class MediaClient {
174
219
  * @param {Schedulin.CreatePresignedPost} request
175
220
  * @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
176
221
  *
222
+ * @throws {@link Schedulin.BadRequestError}
177
223
  * @throws {@link Schedulin.UnauthorizedError}
224
+ * @throws {@link Schedulin.ForbiddenError}
225
+ * @throws {@link Schedulin.ConflictError}
226
+ * @throws {@link Schedulin.UnprocessableEntityError}
227
+ * @throws {@link Schedulin.TooManyRequestsError}
178
228
  * @throws {@link Schedulin.InternalServerError}
179
229
  * @throws {@link errors.SchedulinError}
180
230
  * @throws {@link errors.SchedulinTimeoutError}