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