@schedulin/sdk 0.4.0 → 0.4.2
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.
- package/cjs/api/resources/ai/client/Client.d.ts +1 -0
- package/cjs/api/resources/ai/client/Client.js +3 -0
- package/cjs/api/resources/media/types/DeleteMediaResponse.d.ts +1 -1
- package/cjs/api/resources/posts/client/Client.d.ts +2 -1
- package/cjs/api/resources/posts/client/Client.js +4 -1
- package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.d.ts +10 -5
- package/cjs/api/resources/socialAccounts/client/Client.d.ts +2 -2
- package/cjs/api/resources/socialAccounts/client/Client.js +11 -4
- package/cjs/api/resources/socialAccounts/client/requests/DeleteSocialAccountsRequest.d.ts +1 -0
- package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.ts +2 -0
- package/cjs/api/types/ValidationErrorResponse.d.ts +4 -2
- package/cjs/core/fetcher/Fetcher.js +1 -1
- package/esm/api/resources/ai/client/Client.d.mts +1 -0
- package/esm/api/resources/ai/client/Client.mjs +3 -0
- package/esm/api/resources/media/types/DeleteMediaResponse.d.mts +1 -1
- package/esm/api/resources/posts/client/Client.d.mts +2 -1
- package/esm/api/resources/posts/client/Client.mjs +4 -1
- package/esm/api/resources/posts/client/requests/UpdatePostsRequest.d.mts +10 -5
- package/esm/api/resources/socialAccounts/client/Client.d.mts +2 -2
- package/esm/api/resources/socialAccounts/client/Client.mjs +11 -4
- package/esm/api/resources/socialAccounts/client/requests/DeleteSocialAccountsRequest.d.mts +1 -0
- package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.mts +2 -0
- package/esm/api/types/ValidationErrorResponse.d.mts +4 -2
- package/esm/core/fetcher/Fetcher.mjs +1 -1
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@ export declare class AiClient {
|
|
|
42
42
|
* @throws {@link Schedulin.BadRequestError}
|
|
43
43
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
44
44
|
* @throws {@link Schedulin.ForbiddenError}
|
|
45
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
45
46
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
46
47
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
47
48
|
* @throws {@link Schedulin.InternalServerError}
|
|
@@ -138,6 +138,7 @@ class AiClient {
|
|
|
138
138
|
* @throws {@link Schedulin.BadRequestError}
|
|
139
139
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
140
140
|
* @throws {@link Schedulin.ForbiddenError}
|
|
141
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
141
142
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
142
143
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
143
144
|
* @throws {@link Schedulin.InternalServerError}
|
|
@@ -187,6 +188,8 @@ class AiClient {
|
|
|
187
188
|
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
188
189
|
case 403:
|
|
189
190
|
throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
191
|
+
case 404:
|
|
192
|
+
throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
|
|
190
193
|
case 422:
|
|
191
194
|
throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
192
195
|
case 429:
|
|
@@ -40,6 +40,7 @@ export declare class PostsClient {
|
|
|
40
40
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
41
41
|
* @throws {@link Schedulin.PaymentRequiredError}
|
|
42
42
|
* @throws {@link Schedulin.ForbiddenError}
|
|
43
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
43
44
|
* @throws {@link Schedulin.ConflictError}
|
|
44
45
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
45
46
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
@@ -99,7 +100,7 @@ export declare class PostsClient {
|
|
|
99
100
|
retrieve(request: Schedulin.RetrievePostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<Schedulin.PostWithRelations>;
|
|
100
101
|
private __retrieve;
|
|
101
102
|
/**
|
|
102
|
-
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. Posts that are already publishing, published, or failed can't be edited (409).
|
|
103
|
+
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. A new `scheduledAt` must not be in the past, whatever the status (422). `media` replaces the post's media and accepts the same items as create — a stored or public URL (`{ url }`) or a media library id (`{ id }`), so the `media` array from `GET /v0/posts/{id}` can be sent back as-is. Posts that are already publishing, published, or failed can't be edited (409).
|
|
103
104
|
*
|
|
104
105
|
* @param {Schedulin.UpdatePostsRequest} request
|
|
105
106
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -158,6 +158,7 @@ class PostsClient {
|
|
|
158
158
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
159
159
|
* @throws {@link Schedulin.PaymentRequiredError}
|
|
160
160
|
* @throws {@link Schedulin.ForbiddenError}
|
|
161
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
161
162
|
* @throws {@link Schedulin.ConflictError}
|
|
162
163
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
163
164
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
@@ -206,6 +207,8 @@ class PostsClient {
|
|
|
206
207
|
throw new Schedulin.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
207
208
|
case 403:
|
|
208
209
|
throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
210
|
+
case 404:
|
|
211
|
+
throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
|
|
209
212
|
case 409:
|
|
210
213
|
throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
|
|
211
214
|
case 422:
|
|
@@ -370,7 +373,7 @@ class PostsClient {
|
|
|
370
373
|
});
|
|
371
374
|
}
|
|
372
375
|
/**
|
|
373
|
-
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. Posts that are already publishing, published, or failed can't be edited (409).
|
|
376
|
+
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. A new `scheduledAt` must not be in the past, whatever the status (422). `media` replaces the post's media and accepts the same items as create — a stored or public URL (`{ url }`) or a media library id (`{ id }`), so the `media` array from `GET /v0/posts/{id}` can be sent back as-is. Posts that are already publishing, published, or failed can't be edited (409).
|
|
374
377
|
*
|
|
375
378
|
* @param {Schedulin.UpdatePostsRequest} request
|
|
376
379
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -17,12 +17,17 @@ export declare namespace UpdatePostsRequest {
|
|
|
17
17
|
type Media = Media.Item[];
|
|
18
18
|
namespace Media {
|
|
19
19
|
interface Item {
|
|
20
|
-
id
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
mimeType
|
|
20
|
+
id?: string | undefined;
|
|
21
|
+
url?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
mimeType?: string | undefined;
|
|
24
|
+
width?: (number | null) | undefined;
|
|
25
|
+
height?: (number | null) | undefined;
|
|
26
|
+
size?: (number | null) | undefined;
|
|
27
|
+
duration?: (number | null) | undefined;
|
|
28
|
+
alt?: (string | null) | undefined;
|
|
24
29
|
bucket?: string | undefined;
|
|
25
|
-
key
|
|
30
|
+
key?: string | undefined;
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
const Status: {
|
|
@@ -77,7 +77,7 @@ export declare class SocialAccountsClient {
|
|
|
77
77
|
listWhopForums(request: Schedulin.ListWhopForumsSocialAccountsRequest, requestOptions?: SocialAccountsClient.RequestOptions): core.HttpResponsePromise<Schedulin.ListWhopForumsSocialAccountsResponse>;
|
|
78
78
|
private __listWhopForums;
|
|
79
79
|
/**
|
|
80
|
-
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
80
|
+
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server — only channels where the bot's effective permissions (its roles plus the channel's permission overwrites) include View Channel and Send Messages; channels it can't post in are omitted. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
81
81
|
*
|
|
82
82
|
* @param {Schedulin.ListDiscordChannelsSocialAccountsRequest} request
|
|
83
83
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -147,7 +147,7 @@ export declare class SocialAccountsClient {
|
|
|
147
147
|
update(request: Schedulin.UpdateSocialAccountsRequest, requestOptions?: SocialAccountsClient.RequestOptions): core.HttpResponsePromise<Schedulin.UpdateSocialAccountsResponse>;
|
|
148
148
|
private __update;
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
150
|
+
* Disconnect a social account. By default this is a soft disconnect: the stored credentials are wiped, the account stops counting toward your plan's account limit, and it stays in `GET /v0/social-accounts` with `status: "disconnected"` and `disconnectedReason: "TOKEN_REVOKED"` until it is reconnected from the dashboard. All of its posts, analytics, and history are kept; scheduled posts that come due while it is disconnected fail with a "reconnect" error instead of publishing. Pass `permanent=true` to delete the account instead — this **permanently deletes every post** (scheduled, draft, and published history) of the account and cannot be undone.
|
|
151
151
|
*
|
|
152
152
|
* @param {Schedulin.DeleteSocialAccountsRequest} request
|
|
153
153
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -288,7 +288,7 @@ class SocialAccountsClient {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
|
-
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
291
|
+
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server — only channels where the bot's effective permissions (its roles plus the channel's permission overwrites) include View Channel and Send Messages; channels it can't post in are omitted. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
292
292
|
*
|
|
293
293
|
* @param {Schedulin.ListDiscordChannelsSocialAccountsRequest} request
|
|
294
294
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -516,7 +516,7 @@ class SocialAccountsClient {
|
|
|
516
516
|
});
|
|
517
517
|
}
|
|
518
518
|
/**
|
|
519
|
-
*
|
|
519
|
+
* Disconnect a social account. By default this is a soft disconnect: the stored credentials are wiped, the account stops counting toward your plan's account limit, and it stays in `GET /v0/social-accounts` with `status: "disconnected"` and `disconnectedReason: "TOKEN_REVOKED"` until it is reconnected from the dashboard. All of its posts, analytics, and history are kept; scheduled posts that come due while it is disconnected fail with a "reconnect" error instead of publishing. Pass `permanent=true` to delete the account instead — this **permanently deletes every post** (scheduled, draft, and published history) of the account and cannot be undone.
|
|
520
520
|
*
|
|
521
521
|
* @param {Schedulin.DeleteSocialAccountsRequest} request
|
|
522
522
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -543,7 +543,10 @@ class SocialAccountsClient {
|
|
|
543
543
|
__delete(request, requestOptions) {
|
|
544
544
|
return __awaiter(this, void 0, void 0, function* () {
|
|
545
545
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
546
|
-
const { id } = request, _body = __rest(request, ["id"]);
|
|
546
|
+
const { id, permanent } = request, _body = __rest(request, ["id", "permanent"]);
|
|
547
|
+
const _queryParams = {
|
|
548
|
+
permanent,
|
|
549
|
+
};
|
|
547
550
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
548
551
|
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);
|
|
549
552
|
const _response = yield core.fetcher({
|
|
@@ -551,7 +554,11 @@ class SocialAccountsClient {
|
|
|
551
554
|
method: "DELETE",
|
|
552
555
|
headers: _headers,
|
|
553
556
|
contentType: "application/json",
|
|
554
|
-
queryString: core.url
|
|
557
|
+
queryString: core.url
|
|
558
|
+
.queryBuilder()
|
|
559
|
+
.addMany(_queryParams)
|
|
560
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
561
|
+
.build(),
|
|
555
562
|
requestType: "json",
|
|
556
563
|
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
557
564
|
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,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Schedulin from "../../../index.js";
|
|
1
2
|
export interface ListSocialAccountsResponse {
|
|
2
3
|
data: ListSocialAccountsResponse.Data.Item[];
|
|
3
4
|
}
|
|
@@ -8,6 +9,7 @@ export declare namespace ListSocialAccountsResponse {
|
|
|
8
9
|
id: string;
|
|
9
10
|
platform: Item.Platform;
|
|
10
11
|
status: Item.Status;
|
|
12
|
+
disconnectedReason: Schedulin.SocialAccountDisconnectedReason | null;
|
|
11
13
|
username: string | null;
|
|
12
14
|
displayName: string | null;
|
|
13
15
|
profileImageUrl: string | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 422
|
|
2
|
+
* 422 error. `data.fieldErrors` maps each invalid field to its messages; `data.formErrors` holds errors not tied to one field. `code` is "INPUT_VALIDATION_FAILED" for schema validation and "UNPROCESSABLE_CONTENT" for business-rule rejections, whose reason is also in `data.message`.
|
|
3
3
|
*/
|
|
4
4
|
export interface ValidationErrorResponse {
|
|
5
|
-
/** "INPUT_VALIDATION_FAILED" */
|
|
5
|
+
/** "INPUT_VALIDATION_FAILED" or "UNPROCESSABLE_CONTENT" */
|
|
6
6
|
code: string;
|
|
7
7
|
status: number;
|
|
8
8
|
message?: string | undefined;
|
|
@@ -11,6 +11,8 @@ export interface ValidationErrorResponse {
|
|
|
11
11
|
}
|
|
12
12
|
export declare namespace ValidationErrorResponse {
|
|
13
13
|
interface Data {
|
|
14
|
+
/** Human-readable reason (business-rule rejections only). */
|
|
15
|
+
message?: string | undefined;
|
|
14
16
|
formErrors?: string[] | undefined;
|
|
15
17
|
fieldErrors?: Record<string, string[]> | undefined;
|
|
16
18
|
}
|
|
@@ -184,7 +184,7 @@ function fetcherImpl(args) {
|
|
|
184
184
|
rawResponse: RawResponse_js_1.abortRawResponse,
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
|
-
else if (error instanceof Error && error.name === "AbortError") {
|
|
187
|
+
else if (/* schedulin-patch: timeout-abort */ error === "timeout" || (error instanceof Error && (error.name === "AbortError" || error.name === "TimeoutError"))) {
|
|
188
188
|
if (logger.isError()) {
|
|
189
189
|
const metadata = {
|
|
190
190
|
method: args.method,
|
|
@@ -42,6 +42,7 @@ export declare class AiClient {
|
|
|
42
42
|
* @throws {@link Schedulin.BadRequestError}
|
|
43
43
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
44
44
|
* @throws {@link Schedulin.ForbiddenError}
|
|
45
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
45
46
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
46
47
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
47
48
|
* @throws {@link Schedulin.InternalServerError}
|
|
@@ -102,6 +102,7 @@ export class AiClient {
|
|
|
102
102
|
* @throws {@link Schedulin.BadRequestError}
|
|
103
103
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
104
104
|
* @throws {@link Schedulin.ForbiddenError}
|
|
105
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
105
106
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
106
107
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
107
108
|
* @throws {@link Schedulin.InternalServerError}
|
|
@@ -151,6 +152,8 @@ export class AiClient {
|
|
|
151
152
|
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
152
153
|
case 403:
|
|
153
154
|
throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
155
|
+
case 404:
|
|
156
|
+
throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
|
|
154
157
|
case 422:
|
|
155
158
|
throw new Schedulin.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
156
159
|
case 429:
|
|
@@ -40,6 +40,7 @@ export declare class PostsClient {
|
|
|
40
40
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
41
41
|
* @throws {@link Schedulin.PaymentRequiredError}
|
|
42
42
|
* @throws {@link Schedulin.ForbiddenError}
|
|
43
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
43
44
|
* @throws {@link Schedulin.ConflictError}
|
|
44
45
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
45
46
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
@@ -99,7 +100,7 @@ export declare class PostsClient {
|
|
|
99
100
|
retrieve(request: Schedulin.RetrievePostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<Schedulin.PostWithRelations>;
|
|
100
101
|
private __retrieve;
|
|
101
102
|
/**
|
|
102
|
-
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. Posts that are already publishing, published, or failed can't be edited (409).
|
|
103
|
+
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. A new `scheduledAt` must not be in the past, whatever the status (422). `media` replaces the post's media and accepts the same items as create — a stored or public URL (`{ url }`) or a media library id (`{ id }`), so the `media` array from `GET /v0/posts/{id}` can be sent back as-is. Posts that are already publishing, published, or failed can't be edited (409).
|
|
103
104
|
*
|
|
104
105
|
* @param {Schedulin.UpdatePostsRequest} request
|
|
105
106
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -122,6 +122,7 @@ export class PostsClient {
|
|
|
122
122
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
123
123
|
* @throws {@link Schedulin.PaymentRequiredError}
|
|
124
124
|
* @throws {@link Schedulin.ForbiddenError}
|
|
125
|
+
* @throws {@link Schedulin.NotFoundError}
|
|
125
126
|
* @throws {@link Schedulin.ConflictError}
|
|
126
127
|
* @throws {@link Schedulin.UnprocessableEntityError}
|
|
127
128
|
* @throws {@link Schedulin.TooManyRequestsError}
|
|
@@ -170,6 +171,8 @@ export class PostsClient {
|
|
|
170
171
|
throw new Schedulin.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
171
172
|
case 403:
|
|
172
173
|
throw new Schedulin.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
174
|
+
case 404:
|
|
175
|
+
throw new Schedulin.NotFoundError(_response.error.body, _response.rawResponse);
|
|
173
176
|
case 409:
|
|
174
177
|
throw new Schedulin.ConflictError(_response.error.body, _response.rawResponse);
|
|
175
178
|
case 422:
|
|
@@ -334,7 +337,7 @@ export class PostsClient {
|
|
|
334
337
|
});
|
|
335
338
|
}
|
|
336
339
|
/**
|
|
337
|
-
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. Posts that are already publishing, published, or failed can't be edited (409).
|
|
340
|
+
* Update an existing draft or scheduled post by its ID. `status` may be DRAFT, SCHEDULED (requires a future `scheduledAt`, either in this request or already on the post), or PROCESSING (publish now). COMPLETED and FAILED are set only by the publisher. A new `scheduledAt` must not be in the past, whatever the status (422). `media` replaces the post's media and accepts the same items as create — a stored or public URL (`{ url }`) or a media library id (`{ id }`), so the `media` array from `GET /v0/posts/{id}` can be sent back as-is. Posts that are already publishing, published, or failed can't be edited (409).
|
|
338
341
|
*
|
|
339
342
|
* @param {Schedulin.UpdatePostsRequest} request
|
|
340
343
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -17,12 +17,17 @@ export declare namespace UpdatePostsRequest {
|
|
|
17
17
|
type Media = Media.Item[];
|
|
18
18
|
namespace Media {
|
|
19
19
|
interface Item {
|
|
20
|
-
id
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
mimeType
|
|
20
|
+
id?: string | undefined;
|
|
21
|
+
url?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
mimeType?: string | undefined;
|
|
24
|
+
width?: (number | null) | undefined;
|
|
25
|
+
height?: (number | null) | undefined;
|
|
26
|
+
size?: (number | null) | undefined;
|
|
27
|
+
duration?: (number | null) | undefined;
|
|
28
|
+
alt?: (string | null) | undefined;
|
|
24
29
|
bucket?: string | undefined;
|
|
25
|
-
key
|
|
30
|
+
key?: string | undefined;
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
const Status: {
|
|
@@ -77,7 +77,7 @@ export declare class SocialAccountsClient {
|
|
|
77
77
|
listWhopForums(request: Schedulin.ListWhopForumsSocialAccountsRequest, requestOptions?: SocialAccountsClient.RequestOptions): core.HttpResponsePromise<Schedulin.ListWhopForumsSocialAccountsResponse>;
|
|
78
78
|
private __listWhopForums;
|
|
79
79
|
/**
|
|
80
|
-
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
80
|
+
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server — only channels where the bot's effective permissions (its roles plus the channel's permission overwrites) include View Channel and Send Messages; channels it can't post in are omitted. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
81
81
|
*
|
|
82
82
|
* @param {Schedulin.ListDiscordChannelsSocialAccountsRequest} request
|
|
83
83
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -147,7 +147,7 @@ export declare class SocialAccountsClient {
|
|
|
147
147
|
update(request: Schedulin.UpdateSocialAccountsRequest, requestOptions?: SocialAccountsClient.RequestOptions): core.HttpResponsePromise<Schedulin.UpdateSocialAccountsResponse>;
|
|
148
148
|
private __update;
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
150
|
+
* Disconnect a social account. By default this is a soft disconnect: the stored credentials are wiped, the account stops counting toward your plan's account limit, and it stays in `GET /v0/social-accounts` with `status: "disconnected"` and `disconnectedReason: "TOKEN_REVOKED"` until it is reconnected from the dashboard. All of its posts, analytics, and history are kept; scheduled posts that come due while it is disconnected fail with a "reconnect" error instead of publishing. Pass `permanent=true` to delete the account instead — this **permanently deletes every post** (scheduled, draft, and published history) of the account and cannot be undone.
|
|
151
151
|
*
|
|
152
152
|
* @param {Schedulin.DeleteSocialAccountsRequest} request
|
|
153
153
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -252,7 +252,7 @@ export class SocialAccountsClient {
|
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
|
-
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
255
|
+
* List the text and announcement channels the Schedulin bot can post into for a connected Discord server — only channels where the bot's effective permissions (its roles plus the channel's permission overwrites) include View Channel and Send Messages; channels it can't post in are omitted. Use an item id as `platformConfiguration.channel` when creating a Discord post.
|
|
256
256
|
*
|
|
257
257
|
* @param {Schedulin.ListDiscordChannelsSocialAccountsRequest} request
|
|
258
258
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -480,7 +480,7 @@ export class SocialAccountsClient {
|
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
482
|
/**
|
|
483
|
-
*
|
|
483
|
+
* Disconnect a social account. By default this is a soft disconnect: the stored credentials are wiped, the account stops counting toward your plan's account limit, and it stays in `GET /v0/social-accounts` with `status: "disconnected"` and `disconnectedReason: "TOKEN_REVOKED"` until it is reconnected from the dashboard. All of its posts, analytics, and history are kept; scheduled posts that come due while it is disconnected fail with a "reconnect" error instead of publishing. Pass `permanent=true` to delete the account instead — this **permanently deletes every post** (scheduled, draft, and published history) of the account and cannot be undone.
|
|
484
484
|
*
|
|
485
485
|
* @param {Schedulin.DeleteSocialAccountsRequest} request
|
|
486
486
|
* @param {SocialAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -507,7 +507,10 @@ export class SocialAccountsClient {
|
|
|
507
507
|
__delete(request, requestOptions) {
|
|
508
508
|
return __awaiter(this, void 0, void 0, function* () {
|
|
509
509
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
510
|
-
const { id } = request, _body = __rest(request, ["id"]);
|
|
510
|
+
const { id, permanent } = request, _body = __rest(request, ["id", "permanent"]);
|
|
511
|
+
const _queryParams = {
|
|
512
|
+
permanent,
|
|
513
|
+
};
|
|
511
514
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
512
515
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
513
516
|
const _response = yield core.fetcher({
|
|
@@ -515,7 +518,11 @@ export class SocialAccountsClient {
|
|
|
515
518
|
method: "DELETE",
|
|
516
519
|
headers: _headers,
|
|
517
520
|
contentType: "application/json",
|
|
518
|
-
queryString: core.url
|
|
521
|
+
queryString: core.url
|
|
522
|
+
.queryBuilder()
|
|
523
|
+
.addMany(_queryParams)
|
|
524
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
525
|
+
.build(),
|
|
519
526
|
requestType: "json",
|
|
520
527
|
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
521
528
|
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,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Schedulin from "../../../index.mjs";
|
|
1
2
|
export interface ListSocialAccountsResponse {
|
|
2
3
|
data: ListSocialAccountsResponse.Data.Item[];
|
|
3
4
|
}
|
|
@@ -8,6 +9,7 @@ export declare namespace ListSocialAccountsResponse {
|
|
|
8
9
|
id: string;
|
|
9
10
|
platform: Item.Platform;
|
|
10
11
|
status: Item.Status;
|
|
12
|
+
disconnectedReason: Schedulin.SocialAccountDisconnectedReason | null;
|
|
11
13
|
username: string | null;
|
|
12
14
|
displayName: string | null;
|
|
13
15
|
profileImageUrl: string | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 422
|
|
2
|
+
* 422 error. `data.fieldErrors` maps each invalid field to its messages; `data.formErrors` holds errors not tied to one field. `code` is "INPUT_VALIDATION_FAILED" for schema validation and "UNPROCESSABLE_CONTENT" for business-rule rejections, whose reason is also in `data.message`.
|
|
3
3
|
*/
|
|
4
4
|
export interface ValidationErrorResponse {
|
|
5
|
-
/** "INPUT_VALIDATION_FAILED" */
|
|
5
|
+
/** "INPUT_VALIDATION_FAILED" or "UNPROCESSABLE_CONTENT" */
|
|
6
6
|
code: string;
|
|
7
7
|
status: number;
|
|
8
8
|
message?: string | undefined;
|
|
@@ -11,6 +11,8 @@ export interface ValidationErrorResponse {
|
|
|
11
11
|
}
|
|
12
12
|
export declare namespace ValidationErrorResponse {
|
|
13
13
|
interface Data {
|
|
14
|
+
/** Human-readable reason (business-rule rejections only). */
|
|
15
|
+
message?: string | undefined;
|
|
14
16
|
formErrors?: string[] | undefined;
|
|
15
17
|
fieldErrors?: Record<string, string[]> | undefined;
|
|
16
18
|
}
|
|
@@ -180,7 +180,7 @@ export function fetcherImpl(args) {
|
|
|
180
180
|
rawResponse: abortRawResponse,
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
else if (error instanceof Error && error.name === "AbortError") {
|
|
183
|
+
else if (/* schedulin-patch: timeout-abort */ error === "timeout" || (error instanceof Error && (error.name === "AbortError" || error.name === "TimeoutError"))) {
|
|
184
184
|
if (logger.isError()) {
|
|
185
185
|
const metadata = {
|
|
186
186
|
method: args.method,
|