@schedulin/sdk 0.1.2 → 0.3.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.
- package/README.md +45 -0
- package/cjs/BaseClient.d.ts +12 -0
- package/cjs/Client.d.ts +9 -0
- package/cjs/Client.js +23 -8
- package/cjs/api/errors/InternalServerError.d.ts +1 -0
- package/cjs/api/errors/UnauthorizedError.d.ts +1 -0
- package/cjs/api/resources/ai/client/Client.d.ts +49 -0
- package/cjs/api/resources/ai/client/Client.js +181 -0
- package/cjs/api/resources/ai/client/index.d.ts +1 -0
- package/cjs/api/resources/ai/client/index.js +17 -0
- package/cjs/api/resources/ai/client/requests/GenerateImageAiRequest.d.ts +20 -0
- package/cjs/api/resources/ai/client/requests/GenerateImageAiRequest.js +12 -0
- package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.d.ts → ai/client/requests/GetGenerationAiRequest.d.ts} +1 -1
- package/cjs/api/resources/ai/client/requests/index.d.ts +2 -0
- package/cjs/api/resources/ai/client/requests/index.js +5 -0
- package/cjs/api/resources/ai/exports.d.ts +2 -0
- package/cjs/api/resources/ai/exports.js +21 -0
- package/cjs/api/resources/ai/index.d.ts +1 -0
- package/cjs/api/resources/ai/index.js +17 -0
- package/cjs/api/resources/index.d.ts +6 -0
- package/cjs/api/resources/index.js +7 -1
- package/cjs/api/resources/media/client/Client.d.ts +83 -0
- package/cjs/api/resources/media/client/Client.js +260 -3
- package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.ts +12 -0
- package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.js +3 -0
- package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.ts +7 -0
- package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.js +3 -0
- package/{esm/api/resources/posts/client/requests/GetJobStatusPostsRequest.d.mts → cjs/api/resources/media/client/requests/DeleteMediaRequest.d.ts} +1 -1
- package/cjs/api/resources/media/client/requests/DeleteMediaRequest.js +3 -0
- package/cjs/api/resources/media/client/requests/UploadMediaRequest.d.ts +13 -0
- package/cjs/api/resources/media/client/requests/UploadMediaRequest.js +3 -0
- package/cjs/api/resources/media/client/requests/index.d.ts +4 -0
- package/cjs/api/resources/platforms/client/Client.d.ts +28 -0
- package/cjs/api/resources/platforms/client/Client.js +111 -0
- package/cjs/api/resources/platforms/client/index.d.ts +1 -0
- package/cjs/api/resources/platforms/client/index.js +2 -0
- package/cjs/api/resources/platforms/exports.d.ts +2 -0
- package/cjs/api/resources/platforms/exports.js +21 -0
- package/cjs/api/resources/platforms/index.d.ts +2 -0
- package/cjs/api/resources/platforms/index.js +18 -0
- package/cjs/api/resources/platforms/types/ListPlatformsResponse.d.ts +56 -0
- package/cjs/api/resources/platforms/types/ListPlatformsResponse.js +24 -0
- package/cjs/api/resources/platforms/types/index.d.ts +1 -0
- package/cjs/api/resources/platforms/types/index.js +17 -0
- package/cjs/api/resources/posts/client/Client.d.ts +22 -18
- package/cjs/api/resources/posts/client/Client.js +30 -62
- package/cjs/api/resources/posts/client/requests/ListPostsRequest.d.ts +1 -0
- package/cjs/api/resources/posts/client/requests/PostCreate.d.ts +64 -0
- package/cjs/api/resources/posts/client/requests/PostCreate.js +63 -0
- package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.d.ts +0 -2
- package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.js +0 -2
- package/cjs/api/resources/posts/client/requests/index.d.ts +0 -1
- package/cjs/api/resources/posts/types/CreatePostsResponse.d.ts +21 -0
- package/cjs/api/resources/posts/types/CreatePostsResponse.js +21 -0
- package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.d.ts +8 -0
- package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.js +11 -0
- package/cjs/api/resources/posts/types/index.d.ts +1 -0
- package/cjs/api/resources/posts/types/index.js +1 -0
- package/cjs/api/resources/socialAccounts/client/Client.d.ts +68 -1
- package/cjs/api/resources/socialAccounts/client/Client.js +210 -4
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.ts +9 -0
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.js +3 -0
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.ts +11 -0
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.js +3 -0
- package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.ts +11 -0
- package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.js +3 -0
- package/cjs/api/resources/socialAccounts/client/requests/index.d.ts +3 -0
- package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.ts +22 -0
- package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.js +21 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.ts +12 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.js +3 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.ts +12 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.js +3 -0
- package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.ts +3 -0
- package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.js +3 -0
- package/cjs/api/resources/socialAccounts/types/index.d.ts +3 -0
- package/cjs/api/resources/socialAccounts/types/index.js +3 -0
- package/cjs/api/resources/tags/client/Client.d.ts +8 -0
- package/cjs/api/resources/tags/client/Client.js +12 -3
- package/cjs/api/resources/webhooks/client/Client.d.ts +155 -0
- package/cjs/api/resources/webhooks/client/Client.js +538 -0
- package/cjs/api/resources/webhooks/client/index.d.ts +1 -0
- package/cjs/api/resources/webhooks/client/index.js +17 -0
- package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.ts +24 -0
- package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.js +16 -0
- package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.ts +11 -0
- package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.ts +25 -0
- package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.js +16 -0
- package/cjs/api/resources/webhooks/client/requests/index.d.ts +7 -0
- package/cjs/api/resources/webhooks/client/requests/index.js +7 -0
- package/cjs/api/resources/webhooks/exports.d.ts +2 -0
- package/cjs/api/resources/webhooks/exports.js +21 -0
- package/cjs/api/resources/webhooks/index.d.ts +1 -0
- package/cjs/api/resources/webhooks/index.js +17 -0
- package/cjs/api/types/OauthScope.d.ts +12 -0
- package/cjs/api/types/OauthScope.js +12 -0
- package/cjs/api/types/PostSearch.d.ts +12 -0
- package/cjs/api/types/PostSearch.js +10 -0
- package/cjs/api/types/PostWithRelations.d.ts +21 -0
- package/cjs/api/types/PostWithRelations.js +21 -0
- package/cjs/api/types/SocialAccountDisconnectedReason.d.ts +1 -0
- package/cjs/api/types/SocialAccountDisconnectedReason.js +1 -0
- package/cjs/api/types/SocialPlatform.d.ts +21 -0
- package/cjs/api/types/SocialPlatform.js +21 -0
- package/cjs/core/exports.d.ts +1 -0
- package/cjs/core/exports.js +1 -0
- package/cjs/core/fetcher/Fetcher.js +9 -92
- package/cjs/core/fetcher/makePassthroughRequest.js +26 -4
- package/cjs/core/fetcher/redactUrl.d.ts +2 -0
- package/cjs/core/fetcher/redactUrl.js +88 -0
- package/cjs/core/file/exports.d.ts +1 -0
- package/cjs/core/file/exports.js +2 -0
- package/cjs/core/file/file.d.ts +10 -0
- package/cjs/core/file/file.js +225 -0
- package/cjs/core/file/index.d.ts +2 -0
- package/cjs/core/file/index.js +18 -0
- package/cjs/core/file/types.d.ts +66 -0
- package/cjs/core/file/types.js +2 -0
- package/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/cjs/core/form-data-utils/FormDataWrapper.js +188 -0
- package/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/cjs/core/form-data-utils/index.d.ts +2 -0
- package/cjs/core/form-data-utils/index.js +20 -0
- package/cjs/core/index.d.ts +2 -0
- package/cjs/core/index.js +3 -1
- package/cjs/core/requestBody.d.ts +12 -0
- package/cjs/core/requestBody.js +26 -0
- package/cjs/core/runtime/index.d.ts +1 -1
- package/cjs/core/runtime/index.js +2 -1
- package/cjs/core/runtime/runtime.d.ts +19 -0
- package/cjs/core/runtime/runtime.js +74 -2
- package/cjs/core/url/qs.js +2 -2
- package/cjs/errors/SchedulinError.d.ts +1 -0
- package/cjs/errors/SchedulinError.js +4 -0
- package/cjs/errors/SchedulinTimeoutError.d.ts +2 -2
- package/cjs/errors/SchedulinTimeoutError.js +39 -5
- package/esm/BaseClient.d.mts +12 -0
- package/esm/Client.d.mts +9 -0
- package/esm/Client.mjs +15 -0
- package/esm/api/errors/InternalServerError.d.mts +1 -0
- package/esm/api/errors/UnauthorizedError.d.mts +1 -0
- package/esm/api/resources/ai/client/Client.d.mts +49 -0
- package/esm/api/resources/ai/client/Client.mjs +144 -0
- package/esm/api/resources/ai/client/index.d.mts +1 -0
- package/esm/api/resources/ai/client/index.mjs +1 -0
- package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.d.mts +20 -0
- package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.mjs +9 -0
- package/esm/api/resources/ai/client/requests/GetGenerationAiRequest.d.mts +9 -0
- package/esm/api/resources/ai/client/requests/index.d.mts +2 -0
- package/esm/api/resources/ai/client/requests/index.mjs +1 -0
- package/esm/api/resources/ai/exports.d.mts +2 -0
- package/esm/api/resources/ai/exports.mjs +3 -0
- package/esm/api/resources/ai/index.d.mts +1 -0
- package/esm/api/resources/ai/index.mjs +1 -0
- package/esm/api/resources/index.d.mts +6 -0
- package/esm/api/resources/index.mjs +6 -0
- package/esm/api/resources/media/client/Client.d.mts +83 -0
- package/esm/api/resources/media/client/Client.mjs +261 -4
- package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.mts +12 -0
- package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.mts +7 -0
- package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/DeleteMediaRequest.d.mts +9 -0
- package/esm/api/resources/media/client/requests/DeleteMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/UploadMediaRequest.d.mts +13 -0
- package/esm/api/resources/media/client/requests/UploadMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/index.d.mts +4 -0
- package/esm/api/resources/platforms/client/Client.d.mts +28 -0
- package/esm/api/resources/platforms/client/Client.mjs +74 -0
- package/esm/api/resources/platforms/client/index.d.mts +1 -0
- package/esm/api/resources/platforms/client/index.mjs +1 -0
- package/esm/api/resources/platforms/exports.d.mts +2 -0
- package/esm/api/resources/platforms/exports.mjs +3 -0
- package/esm/api/resources/platforms/index.d.mts +2 -0
- package/esm/api/resources/platforms/index.mjs +2 -0
- package/esm/api/resources/platforms/types/ListPlatformsResponse.d.mts +56 -0
- package/esm/api/resources/platforms/types/ListPlatformsResponse.mjs +21 -0
- package/esm/api/resources/platforms/types/index.d.mts +1 -0
- package/esm/api/resources/platforms/types/index.mjs +1 -0
- package/esm/api/resources/posts/client/Client.d.mts +22 -18
- package/esm/api/resources/posts/client/Client.mjs +30 -62
- package/esm/api/resources/posts/client/requests/ListPostsRequest.d.mts +1 -0
- package/esm/api/resources/posts/client/requests/PostCreate.d.mts +64 -0
- package/esm/api/resources/posts/client/requests/PostCreate.mjs +63 -0
- package/esm/api/resources/posts/client/requests/UpdatePostsRequest.d.mts +0 -2
- package/esm/api/resources/posts/client/requests/UpdatePostsRequest.mjs +0 -2
- package/esm/api/resources/posts/client/requests/index.d.mts +0 -1
- package/esm/api/resources/posts/types/CreatePostsResponse.d.mts +21 -0
- package/esm/api/resources/posts/types/CreatePostsResponse.mjs +21 -0
- package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.d.mts +8 -0
- package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.mjs +8 -0
- package/esm/api/resources/posts/types/index.d.mts +1 -0
- package/esm/api/resources/posts/types/index.mjs +1 -0
- package/esm/api/resources/socialAccounts/client/Client.d.mts +68 -1
- package/esm/api/resources/socialAccounts/client/Client.mjs +210 -4
- package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.mts +9 -0
- package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.mjs +2 -0
- package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.mts +11 -0
- package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.mjs +2 -0
- package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.mts +11 -0
- package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.mjs +2 -0
- package/esm/api/resources/socialAccounts/client/requests/index.d.mts +3 -0
- package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.mts +22 -0
- package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.mjs +21 -0
- package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.mts +12 -0
- package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.mjs +2 -0
- package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.mts +12 -0
- package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.mjs +2 -0
- package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.mts +3 -0
- package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.mjs +2 -0
- package/esm/api/resources/socialAccounts/types/index.d.mts +3 -0
- package/esm/api/resources/socialAccounts/types/index.mjs +3 -0
- package/esm/api/resources/tags/client/Client.d.mts +8 -0
- package/esm/api/resources/tags/client/Client.mjs +12 -3
- package/esm/api/resources/webhooks/client/Client.d.mts +155 -0
- package/esm/api/resources/webhooks/client/Client.mjs +501 -0
- package/esm/api/resources/webhooks/client/index.d.mts +1 -0
- package/esm/api/resources/webhooks/client/index.mjs +1 -0
- package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.mts +24 -0
- package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.mjs +13 -0
- package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.mts +11 -0
- package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.mts +25 -0
- package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.mjs +13 -0
- package/esm/api/resources/webhooks/client/requests/index.d.mts +7 -0
- package/esm/api/resources/webhooks/client/requests/index.mjs +2 -0
- package/esm/api/resources/webhooks/exports.d.mts +2 -0
- package/esm/api/resources/webhooks/exports.mjs +3 -0
- package/esm/api/resources/webhooks/index.d.mts +1 -0
- package/esm/api/resources/webhooks/index.mjs +1 -0
- package/esm/api/types/OauthScope.d.mts +12 -0
- package/esm/api/types/OauthScope.mjs +12 -0
- package/esm/api/types/PostSearch.d.mts +12 -0
- package/esm/api/types/PostSearch.mjs +10 -0
- package/esm/api/types/PostWithRelations.d.mts +21 -0
- package/esm/api/types/PostWithRelations.mjs +21 -0
- package/esm/api/types/SocialAccountDisconnectedReason.d.mts +1 -0
- package/esm/api/types/SocialAccountDisconnectedReason.mjs +1 -0
- package/esm/api/types/SocialPlatform.d.mts +21 -0
- package/esm/api/types/SocialPlatform.mjs +21 -0
- package/esm/core/exports.d.mts +1 -0
- package/esm/core/exports.mjs +1 -0
- package/esm/core/fetcher/Fetcher.mjs +1 -84
- package/esm/core/fetcher/makePassthroughRequest.mjs +26 -4
- package/esm/core/fetcher/redactUrl.d.mts +2 -0
- package/esm/core/fetcher/redactUrl.mjs +84 -0
- package/esm/core/file/exports.d.mts +1 -0
- package/esm/core/file/exports.mjs +1 -0
- package/esm/core/file/file.d.mts +10 -0
- package/esm/core/file/file.mjs +188 -0
- package/esm/core/file/index.d.mts +2 -0
- package/esm/core/file/index.mjs +2 -0
- package/esm/core/file/types.d.mts +66 -0
- package/esm/core/file/types.mjs +1 -0
- package/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
- package/esm/core/form-data-utils/FormDataWrapper.mjs +150 -0
- package/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
- package/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
- package/esm/core/form-data-utils/index.d.mts +2 -0
- package/esm/core/form-data-utils/index.mjs +2 -0
- package/esm/core/index.d.mts +2 -0
- package/esm/core/index.mjs +2 -0
- package/esm/core/requestBody.d.mts +12 -0
- package/esm/core/requestBody.mjs +23 -0
- package/esm/core/runtime/index.d.mts +1 -1
- package/esm/core/runtime/index.mjs +1 -1
- package/esm/core/runtime/runtime.d.mts +19 -0
- package/esm/core/runtime/runtime.mjs +73 -2
- package/esm/core/url/qs.mjs +2 -2
- package/esm/errors/SchedulinError.d.mts +1 -0
- package/esm/errors/SchedulinError.mjs +4 -0
- package/esm/errors/SchedulinTimeoutError.d.mts +2 -2
- package/esm/errors/SchedulinTimeoutError.mjs +6 -5
- package/package.json +1 -1
- /package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.js → ai/client/requests/GetGenerationAiRequest.js} +0 -0
- /package/esm/api/resources/{posts/client/requests/GetJobStatusPostsRequest.mjs → ai/client/requests/GetGenerationAiRequest.mjs} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.PlatformsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
+
const Schedulin = __importStar(require("../../../index.js"));
|
|
54
|
+
class PlatformsClient {
|
|
55
|
+
constructor(options) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Per-platform posting requirements: caption length limits, media count/type rules, whether `platformConfiguration` is required, its JSON Schema when server-validated, and helper endpoints for fetching dynamic values (e.g. Pinterest boards). Platforms marked `comingSoon` cannot be posted to yet.
|
|
60
|
+
*
|
|
61
|
+
* @param {PlatformsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
64
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
65
|
+
* @throws {@link errors.SchedulinError}
|
|
66
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.platforms.list()
|
|
70
|
+
*/
|
|
71
|
+
list(requestOptions) {
|
|
72
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
73
|
+
}
|
|
74
|
+
__list(requestOptions) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
77
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
78
|
+
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);
|
|
79
|
+
const _response = yield core.fetcher({
|
|
80
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, "v0/platforms"),
|
|
81
|
+
method: "GET",
|
|
82
|
+
headers: _headers,
|
|
83
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
84
|
+
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,
|
|
85
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
86
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
87
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
88
|
+
logging: this._options.logging,
|
|
89
|
+
});
|
|
90
|
+
if (_response.ok) {
|
|
91
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
92
|
+
}
|
|
93
|
+
if (_response.error.reason === "status-code") {
|
|
94
|
+
switch (_response.error.statusCode) {
|
|
95
|
+
case 401:
|
|
96
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
97
|
+
case 500:
|
|
98
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
99
|
+
default:
|
|
100
|
+
throw new errors.SchedulinError({
|
|
101
|
+
statusCode: _response.error.statusCode,
|
|
102
|
+
body: _response.error.body,
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/platforms");
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.PlatformsClient = PlatformsClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PlatformsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "PlatformsClient", { enumerable: true, get: function () { return Client_js_1.PlatformsClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface ListPlatformsResponse {
|
|
2
|
+
data: ListPlatformsResponse.Data.Item[];
|
|
3
|
+
}
|
|
4
|
+
export declare namespace ListPlatformsResponse {
|
|
5
|
+
type Data = Data.Item[];
|
|
6
|
+
namespace Data {
|
|
7
|
+
interface Item {
|
|
8
|
+
platform: string;
|
|
9
|
+
name: string;
|
|
10
|
+
comingSoon?: boolean | undefined;
|
|
11
|
+
captionMaxLength?: number | undefined;
|
|
12
|
+
mediaRules?: Item.MediaRules | undefined;
|
|
13
|
+
platformConfiguration: Item.PlatformConfiguration;
|
|
14
|
+
helperEndpoints?: Item.HelperEndpoints.Item[] | undefined;
|
|
15
|
+
}
|
|
16
|
+
namespace Item {
|
|
17
|
+
interface MediaRules {
|
|
18
|
+
min?: number | undefined;
|
|
19
|
+
max: number;
|
|
20
|
+
allowedTypes?: MediaRules.AllowedTypes.Item[] | undefined;
|
|
21
|
+
allowedDimensions?: MediaRules.AllowedDimensions.Item[] | undefined;
|
|
22
|
+
}
|
|
23
|
+
namespace MediaRules {
|
|
24
|
+
type AllowedTypes = AllowedTypes.Item[];
|
|
25
|
+
namespace AllowedTypes {
|
|
26
|
+
const Item: {
|
|
27
|
+
readonly Image: "IMAGE";
|
|
28
|
+
readonly Video: "VIDEO";
|
|
29
|
+
readonly Gif: "GIF";
|
|
30
|
+
};
|
|
31
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
32
|
+
}
|
|
33
|
+
type AllowedDimensions = AllowedDimensions.Item[];
|
|
34
|
+
namespace AllowedDimensions {
|
|
35
|
+
interface Item {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
interface PlatformConfiguration {
|
|
42
|
+
required: boolean;
|
|
43
|
+
validated: boolean;
|
|
44
|
+
schema?: Record<string, unknown> | undefined;
|
|
45
|
+
}
|
|
46
|
+
type HelperEndpoints = HelperEndpoints.Item[];
|
|
47
|
+
namespace HelperEndpoints {
|
|
48
|
+
interface Item {
|
|
49
|
+
method: string;
|
|
50
|
+
path: string;
|
|
51
|
+
description: string;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ListPlatformsResponse = void 0;
|
|
5
|
+
var ListPlatformsResponse;
|
|
6
|
+
(function (ListPlatformsResponse) {
|
|
7
|
+
let Data;
|
|
8
|
+
(function (Data) {
|
|
9
|
+
let Item;
|
|
10
|
+
(function (Item_1) {
|
|
11
|
+
let MediaRules;
|
|
12
|
+
(function (MediaRules) {
|
|
13
|
+
let AllowedTypes;
|
|
14
|
+
(function (AllowedTypes) {
|
|
15
|
+
AllowedTypes.Item = {
|
|
16
|
+
Image: "IMAGE",
|
|
17
|
+
Video: "VIDEO",
|
|
18
|
+
Gif: "GIF",
|
|
19
|
+
};
|
|
20
|
+
})(AllowedTypes = MediaRules.AllowedTypes || (MediaRules.AllowedTypes = {}));
|
|
21
|
+
})(MediaRules = Item_1.MediaRules || (Item_1.MediaRules = {}));
|
|
22
|
+
})(Item = Data.Item || (Data.Item = {}));
|
|
23
|
+
})(Data = ListPlatformsResponse.Data || (ListPlatformsResponse.Data = {}));
|
|
24
|
+
})(ListPlatformsResponse || (exports.ListPlatformsResponse = ListPlatformsResponse = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListPlatformsResponse.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ListPlatformsResponse.js"), exports);
|
|
@@ -18,6 +18,8 @@ export declare class PostsClient {
|
|
|
18
18
|
*
|
|
19
19
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
20
20
|
* @throws {@link Schedulin.InternalServerError}
|
|
21
|
+
* @throws {@link errors.SchedulinError}
|
|
22
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
21
23
|
*
|
|
22
24
|
* @example
|
|
23
25
|
* await client.posts.list()
|
|
@@ -25,13 +27,15 @@ export declare class PostsClient {
|
|
|
25
27
|
list(request?: Schedulin.ListPostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<Schedulin.ListPostsResponse>;
|
|
26
28
|
private __list;
|
|
27
29
|
/**
|
|
28
|
-
* Create a new post with media, tags, and scheduling options
|
|
30
|
+
* Create a new post with media, tags, and scheduling options. Media items may reference a stored library URL or any publicly reachable image/video URL — external URLs are downloaded into the media library automatically, so clients that cannot issue a raw presigned PUT can attach media in one call.
|
|
29
31
|
*
|
|
30
32
|
* @param {Schedulin.PostCreate} request
|
|
31
33
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
34
|
*
|
|
33
35
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
34
36
|
* @throws {@link Schedulin.InternalServerError}
|
|
37
|
+
* @throws {@link errors.SchedulinError}
|
|
38
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
35
39
|
*
|
|
36
40
|
* @example
|
|
37
41
|
* await client.posts.create({
|
|
@@ -49,6 +53,8 @@ export declare class PostsClient {
|
|
|
49
53
|
*
|
|
50
54
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
51
55
|
* @throws {@link Schedulin.InternalServerError}
|
|
56
|
+
* @throws {@link errors.SchedulinError}
|
|
57
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
52
58
|
*
|
|
53
59
|
* @example
|
|
54
60
|
* await client.posts.countByTab()
|
|
@@ -63,6 +69,8 @@ export declare class PostsClient {
|
|
|
63
69
|
*
|
|
64
70
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
65
71
|
* @throws {@link Schedulin.InternalServerError}
|
|
72
|
+
* @throws {@link errors.SchedulinError}
|
|
73
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
66
74
|
*
|
|
67
75
|
* @example
|
|
68
76
|
* await client.posts.retrieve({
|
|
@@ -72,13 +80,15 @@ export declare class PostsClient {
|
|
|
72
80
|
retrieve(request: Schedulin.RetrievePostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<Schedulin.PostWithRelations>;
|
|
73
81
|
private __retrieve;
|
|
74
82
|
/**
|
|
75
|
-
* Update an existing post by its ID
|
|
83
|
+
* 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).
|
|
76
84
|
*
|
|
77
85
|
* @param {Schedulin.UpdatePostsRequest} request
|
|
78
86
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
79
87
|
*
|
|
80
88
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
81
89
|
* @throws {@link Schedulin.InternalServerError}
|
|
90
|
+
* @throws {@link errors.SchedulinError}
|
|
91
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
82
92
|
*
|
|
83
93
|
* @example
|
|
84
94
|
* await client.posts.update({
|
|
@@ -95,6 +105,8 @@ export declare class PostsClient {
|
|
|
95
105
|
*
|
|
96
106
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
97
107
|
* @throws {@link Schedulin.InternalServerError}
|
|
108
|
+
* @throws {@link errors.SchedulinError}
|
|
109
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
98
110
|
*
|
|
99
111
|
* @example
|
|
100
112
|
* await client.posts.delete({
|
|
@@ -111,6 +123,8 @@ export declare class PostsClient {
|
|
|
111
123
|
*
|
|
112
124
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
113
125
|
* @throws {@link Schedulin.InternalServerError}
|
|
126
|
+
* @throws {@link errors.SchedulinError}
|
|
127
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
114
128
|
*
|
|
115
129
|
* @example
|
|
116
130
|
* await client.posts.analyticsSummary({
|
|
@@ -127,6 +141,8 @@ export declare class PostsClient {
|
|
|
127
141
|
*
|
|
128
142
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
129
143
|
* @throws {@link Schedulin.InternalServerError}
|
|
144
|
+
* @throws {@link errors.SchedulinError}
|
|
145
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
130
146
|
*
|
|
131
147
|
* @example
|
|
132
148
|
* await client.posts.analyticsSeries({
|
|
@@ -143,6 +159,8 @@ export declare class PostsClient {
|
|
|
143
159
|
*
|
|
144
160
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
145
161
|
* @throws {@link Schedulin.InternalServerError}
|
|
162
|
+
* @throws {@link errors.SchedulinError}
|
|
163
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
146
164
|
*
|
|
147
165
|
* @example
|
|
148
166
|
* await client.posts.publishDraft({
|
|
@@ -159,6 +177,8 @@ export declare class PostsClient {
|
|
|
159
177
|
*
|
|
160
178
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
161
179
|
* @throws {@link Schedulin.InternalServerError}
|
|
180
|
+
* @throws {@link errors.SchedulinError}
|
|
181
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
162
182
|
*
|
|
163
183
|
* @example
|
|
164
184
|
* await client.posts.updateTags({
|
|
@@ -168,20 +188,4 @@ export declare class PostsClient {
|
|
|
168
188
|
*/
|
|
169
189
|
updateTags(request: Schedulin.UpdateTagsPostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<Schedulin.Post>;
|
|
170
190
|
private __updateTags;
|
|
171
|
-
/**
|
|
172
|
-
* Retrieve the processing job status and logs for a post
|
|
173
|
-
*
|
|
174
|
-
* @param {Schedulin.GetJobStatusPostsRequest} request
|
|
175
|
-
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
176
|
-
*
|
|
177
|
-
* @throws {@link Schedulin.UnauthorizedError}
|
|
178
|
-
* @throws {@link Schedulin.InternalServerError}
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* await client.posts.getJobStatus({
|
|
182
|
-
* id: "id"
|
|
183
|
-
* })
|
|
184
|
-
*/
|
|
185
|
-
getJobStatus(request: Schedulin.GetJobStatusPostsRequest, requestOptions?: PostsClient.RequestOptions): core.HttpResponsePromise<unknown | null>;
|
|
186
|
-
private __getJobStatus;
|
|
187
191
|
}
|
|
@@ -58,6 +58,7 @@ exports.PostsClient = void 0;
|
|
|
58
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
59
59
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
+
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
61
62
|
const environments = __importStar(require("../../../../environments.js"));
|
|
62
63
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
63
64
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
@@ -74,6 +75,8 @@ class PostsClient {
|
|
|
74
75
|
*
|
|
75
76
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
76
77
|
* @throws {@link Schedulin.InternalServerError}
|
|
78
|
+
* @throws {@link errors.SchedulinError}
|
|
79
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
77
80
|
*
|
|
78
81
|
* @example
|
|
79
82
|
* await client.posts.list()
|
|
@@ -84,10 +87,11 @@ class PostsClient {
|
|
|
84
87
|
__list() {
|
|
85
88
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
86
89
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
|
-
const { page, status, approvalStatus, scheduledAt, tagIds, tagMode, socialAccountIds, limit } = request;
|
|
90
|
+
const { page, status, statuses, approvalStatus, scheduledAt, tagIds, tagMode, socialAccountIds, limit } = request;
|
|
88
91
|
const _queryParams = {
|
|
89
92
|
page,
|
|
90
93
|
status: status != null ? status : undefined,
|
|
94
|
+
statuses: Array.isArray(statuses) ? statuses.map((item) => item) : statuses != null ? statuses : undefined,
|
|
91
95
|
approvalStatus: approvalStatus != null ? approvalStatus : undefined,
|
|
92
96
|
scheduledAt,
|
|
93
97
|
tagIds,
|
|
@@ -133,13 +137,15 @@ class PostsClient {
|
|
|
133
137
|
});
|
|
134
138
|
}
|
|
135
139
|
/**
|
|
136
|
-
* Create a new post with media, tags, and scheduling options
|
|
140
|
+
* Create a new post with media, tags, and scheduling options. Media items may reference a stored library URL or any publicly reachable image/video URL — external URLs are downloaded into the media library automatically, so clients that cannot issue a raw presigned PUT can attach media in one call.
|
|
137
141
|
*
|
|
138
142
|
* @param {Schedulin.PostCreate} request
|
|
139
143
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
144
|
*
|
|
141
145
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
142
146
|
* @throws {@link Schedulin.InternalServerError}
|
|
147
|
+
* @throws {@link errors.SchedulinError}
|
|
148
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
143
149
|
*
|
|
144
150
|
* @example
|
|
145
151
|
* await client.posts.create({
|
|
@@ -162,7 +168,7 @@ class PostsClient {
|
|
|
162
168
|
contentType: "application/json",
|
|
163
169
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
164
170
|
requestType: "json",
|
|
165
|
-
body: request,
|
|
171
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
166
172
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
167
173
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
168
174
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -197,6 +203,8 @@ class PostsClient {
|
|
|
197
203
|
*
|
|
198
204
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
199
205
|
* @throws {@link Schedulin.InternalServerError}
|
|
206
|
+
* @throws {@link errors.SchedulinError}
|
|
207
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
200
208
|
*
|
|
201
209
|
* @example
|
|
202
210
|
* await client.posts.countByTab()
|
|
@@ -256,6 +264,8 @@ class PostsClient {
|
|
|
256
264
|
*
|
|
257
265
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
258
266
|
* @throws {@link Schedulin.InternalServerError}
|
|
267
|
+
* @throws {@link errors.SchedulinError}
|
|
268
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
259
269
|
*
|
|
260
270
|
* @example
|
|
261
271
|
* await client.posts.retrieve({
|
|
@@ -303,13 +313,15 @@ class PostsClient {
|
|
|
303
313
|
});
|
|
304
314
|
}
|
|
305
315
|
/**
|
|
306
|
-
* Update an existing post by its ID
|
|
316
|
+
* 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).
|
|
307
317
|
*
|
|
308
318
|
* @param {Schedulin.UpdatePostsRequest} request
|
|
309
319
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
310
320
|
*
|
|
311
321
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
312
322
|
* @throws {@link Schedulin.InternalServerError}
|
|
323
|
+
* @throws {@link errors.SchedulinError}
|
|
324
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
313
325
|
*
|
|
314
326
|
* @example
|
|
315
327
|
* await client.posts.update({
|
|
@@ -332,7 +344,7 @@ class PostsClient {
|
|
|
332
344
|
contentType: "application/json",
|
|
333
345
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
334
346
|
requestType: "json",
|
|
335
|
-
body: _body,
|
|
347
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
336
348
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
337
349
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
338
350
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -367,6 +379,8 @@ class PostsClient {
|
|
|
367
379
|
*
|
|
368
380
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
369
381
|
* @throws {@link Schedulin.InternalServerError}
|
|
382
|
+
* @throws {@link errors.SchedulinError}
|
|
383
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
370
384
|
*
|
|
371
385
|
* @example
|
|
372
386
|
* await client.posts.delete({
|
|
@@ -389,7 +403,7 @@ class PostsClient {
|
|
|
389
403
|
contentType: "application/json",
|
|
390
404
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
391
405
|
requestType: "json",
|
|
392
|
-
body: _body,
|
|
406
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
393
407
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
394
408
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
395
409
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -424,6 +438,8 @@ class PostsClient {
|
|
|
424
438
|
*
|
|
425
439
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
426
440
|
* @throws {@link Schedulin.InternalServerError}
|
|
441
|
+
* @throws {@link errors.SchedulinError}
|
|
442
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
427
443
|
*
|
|
428
444
|
* @example
|
|
429
445
|
* await client.posts.analyticsSummary({
|
|
@@ -481,6 +497,8 @@ class PostsClient {
|
|
|
481
497
|
*
|
|
482
498
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
483
499
|
* @throws {@link Schedulin.InternalServerError}
|
|
500
|
+
* @throws {@link errors.SchedulinError}
|
|
501
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
484
502
|
*
|
|
485
503
|
* @example
|
|
486
504
|
* await client.posts.analyticsSeries({
|
|
@@ -545,6 +563,8 @@ class PostsClient {
|
|
|
545
563
|
*
|
|
546
564
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
547
565
|
* @throws {@link Schedulin.InternalServerError}
|
|
566
|
+
* @throws {@link errors.SchedulinError}
|
|
567
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
548
568
|
*
|
|
549
569
|
* @example
|
|
550
570
|
* await client.posts.publishDraft({
|
|
@@ -567,7 +587,7 @@ class PostsClient {
|
|
|
567
587
|
contentType: "application/json",
|
|
568
588
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
569
589
|
requestType: "json",
|
|
570
|
-
body: _body,
|
|
590
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
571
591
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
572
592
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
573
593
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -602,6 +622,8 @@ class PostsClient {
|
|
|
602
622
|
*
|
|
603
623
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
604
624
|
* @throws {@link Schedulin.InternalServerError}
|
|
625
|
+
* @throws {@link errors.SchedulinError}
|
|
626
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
605
627
|
*
|
|
606
628
|
* @example
|
|
607
629
|
* await client.posts.updateTags({
|
|
@@ -625,7 +647,7 @@ class PostsClient {
|
|
|
625
647
|
contentType: "application/json",
|
|
626
648
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
627
649
|
requestType: "json",
|
|
628
|
-
body: _body,
|
|
650
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
629
651
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
630
652
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
631
653
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -652,59 +674,5 @@ class PostsClient {
|
|
|
652
674
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/v0/posts/{id}/tags");
|
|
653
675
|
});
|
|
654
676
|
}
|
|
655
|
-
/**
|
|
656
|
-
* Retrieve the processing job status and logs for a post
|
|
657
|
-
*
|
|
658
|
-
* @param {Schedulin.GetJobStatusPostsRequest} request
|
|
659
|
-
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
660
|
-
*
|
|
661
|
-
* @throws {@link Schedulin.UnauthorizedError}
|
|
662
|
-
* @throws {@link Schedulin.InternalServerError}
|
|
663
|
-
*
|
|
664
|
-
* @example
|
|
665
|
-
* await client.posts.getJobStatus({
|
|
666
|
-
* id: "id"
|
|
667
|
-
* })
|
|
668
|
-
*/
|
|
669
|
-
getJobStatus(request, requestOptions) {
|
|
670
|
-
return core.HttpResponsePromise.fromPromise(this.__getJobStatus(request, requestOptions));
|
|
671
|
-
}
|
|
672
|
-
__getJobStatus(request, requestOptions) {
|
|
673
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
674
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
675
|
-
const { id } = request;
|
|
676
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
677
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
678
|
-
const _response = yield core.fetcher({
|
|
679
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/posts/${core.url.encodePathParam(id)}/jobs`),
|
|
680
|
-
method: "GET",
|
|
681
|
-
headers: _headers,
|
|
682
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
683
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
684
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
685
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
686
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
687
|
-
logging: this._options.logging,
|
|
688
|
-
});
|
|
689
|
-
if (_response.ok) {
|
|
690
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
691
|
-
}
|
|
692
|
-
if (_response.error.reason === "status-code") {
|
|
693
|
-
switch (_response.error.statusCode) {
|
|
694
|
-
case 401:
|
|
695
|
-
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
696
|
-
case 500:
|
|
697
|
-
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
698
|
-
default:
|
|
699
|
-
throw new errors.SchedulinError({
|
|
700
|
-
statusCode: _response.error.statusCode,
|
|
701
|
-
body: _response.error.body,
|
|
702
|
-
rawResponse: _response.rawResponse,
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/posts/{id}/jobs");
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
677
|
}
|
|
710
678
|
exports.PostsClient = PostsClient;
|
|
@@ -6,6 +6,7 @@ import type * as Schedulin from "../../../../index.js";
|
|
|
6
6
|
export interface ListPostsRequest {
|
|
7
7
|
page?: number;
|
|
8
8
|
status?: Schedulin.ListPostsRequestStatus;
|
|
9
|
+
statuses?: Schedulin.ListPostsRequestStatusesItem | Schedulin.ListPostsRequestStatusesItem[];
|
|
9
10
|
approvalStatus?: Schedulin.ListPostsRequestApprovalStatus;
|
|
10
11
|
scheduledAt?: Schedulin.ListPostsRequestScheduledAt;
|
|
11
12
|
tagIds?: string | string[];
|