@schedulin/sdk 0.1.2 → 0.2.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 +21 -17
- package/cjs/api/resources/posts/client/Client.js +29 -61
- 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/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 +67 -0
- package/cjs/api/resources/socialAccounts/client/Client.js +209 -3
- 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 +21 -17
- package/esm/api/resources/posts/client/Client.mjs +29 -61
- 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/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 +67 -0
- package/esm/api/resources/socialAccounts/client/Client.mjs +209 -3
- 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,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var GenerateImageAiRequest;
|
|
3
|
+
(function (GenerateImageAiRequest) {
|
|
4
|
+
GenerateImageAiRequest.ModelKey = {
|
|
5
|
+
FluxSchnell: "flux_schnell",
|
|
6
|
+
FluxDev: "flux_dev",
|
|
7
|
+
FluxProUltra: "flux_pro_ultra",
|
|
8
|
+
};
|
|
9
|
+
})(GenerateImageAiRequest || (GenerateImageAiRequest = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GenerateImageAiRequest } from "./GenerateImageAiRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
export * from "./ai/client/requests/index.mjs";
|
|
2
|
+
export * as ai from "./ai/index.mjs";
|
|
1
3
|
export * from "./media/client/requests/index.mjs";
|
|
2
4
|
export * as media from "./media/index.mjs";
|
|
3
5
|
export * from "./media/types/index.mjs";
|
|
6
|
+
export * as platforms from "./platforms/index.mjs";
|
|
7
|
+
export * from "./platforms/types/index.mjs";
|
|
4
8
|
export * from "./posts/client/requests/index.mjs";
|
|
5
9
|
export * as posts from "./posts/index.mjs";
|
|
6
10
|
export * from "./posts/types/index.mjs";
|
|
@@ -10,3 +14,5 @@ export * from "./socialAccounts/types/index.mjs";
|
|
|
10
14
|
export * from "./tags/client/requests/index.mjs";
|
|
11
15
|
export * as tags from "./tags/index.mjs";
|
|
12
16
|
export * from "./tags/types/index.mjs";
|
|
17
|
+
export * from "./webhooks/client/requests/index.mjs";
|
|
18
|
+
export * as webhooks from "./webhooks/index.mjs";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
export * from "./ai/client/requests/index.mjs";
|
|
2
|
+
export * as ai from "./ai/index.mjs";
|
|
1
3
|
export * from "./media/client/requests/index.mjs";
|
|
2
4
|
export * as media from "./media/index.mjs";
|
|
3
5
|
export * from "./media/types/index.mjs";
|
|
6
|
+
export * as platforms from "./platforms/index.mjs";
|
|
7
|
+
export * from "./platforms/types/index.mjs";
|
|
4
8
|
export * from "./posts/client/requests/index.mjs";
|
|
5
9
|
export * as posts from "./posts/index.mjs";
|
|
6
10
|
export * from "./posts/types/index.mjs";
|
|
@@ -10,3 +14,5 @@ export * from "./socialAccounts/types/index.mjs";
|
|
|
10
14
|
export * from "./tags/client/requests/index.mjs";
|
|
11
15
|
export * as tags from "./tags/index.mjs";
|
|
12
16
|
export * from "./tags/types/index.mjs";
|
|
17
|
+
export * from "./webhooks/client/requests/index.mjs";
|
|
18
|
+
export * as webhooks from "./webhooks/index.mjs";
|
|
@@ -10,6 +10,59 @@ export declare namespace MediaClient {
|
|
|
10
10
|
export declare class MediaClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<MediaClient.Options>;
|
|
12
12
|
constructor(options: MediaClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Downloads a publicly reachable image or video into the media library and returns the media record. Use the returned `url` in `media[].url` when creating a post. Prefer this over the presign flow whenever your client cannot issue a raw HTTP PUT (e.g. an AI agent). The source URL must be public (no auth), http(s), and at most the post upload limit (250 MB); SVG and other active content is rejected.
|
|
15
|
+
*
|
|
16
|
+
* @param {Schedulin.CreateFromUrlMediaRequest} request
|
|
17
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
20
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
21
|
+
* @throws {@link errors.SchedulinError}
|
|
22
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.media.createFromUrl({
|
|
26
|
+
* url: "url"
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
createFromUrl(request: Schedulin.CreateFromUrlMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
30
|
+
private __createFromUrl;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a short-lived URL to a page where the user uploads files from their device (or a pasted attachment) straight into the media library. Hand the URL to the user; once they've uploaded, call GET /v0/media (list media, newest first) and reference the returned `url` when creating a post. Use this whenever the file isn't already at a public URL.
|
|
33
|
+
*
|
|
34
|
+
* @param {Schedulin.CreateUploadLinkMediaRequest} request
|
|
35
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
38
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
39
|
+
* @throws {@link errors.SchedulinError}
|
|
40
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.media.createUploadLink()
|
|
44
|
+
*/
|
|
45
|
+
createUploadLink(request?: Schedulin.CreateUploadLinkMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
46
|
+
private __createUploadLink;
|
|
47
|
+
/**
|
|
48
|
+
* Upload raw image, video, or audio bytes directly as multipart/form-data. The file is stored in your media library and the record is returned; use its `url` in `media[].url` when creating a post. Max 250 MB; SVG and other active content is rejected. For a file already hosted at a public URL, prefer POST /v0/media/from-url.
|
|
49
|
+
*
|
|
50
|
+
* @param {Schedulin.UploadMediaRequest} request
|
|
51
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
54
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
55
|
+
* @throws {@link errors.SchedulinError}
|
|
56
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* import { createReadStream } from "fs";
|
|
60
|
+
* await client.media.upload({
|
|
61
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
62
|
+
* })
|
|
63
|
+
*/
|
|
64
|
+
upload(request: Schedulin.UploadMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
65
|
+
private __upload;
|
|
13
66
|
/**
|
|
14
67
|
* Retrieve media information by its ID
|
|
15
68
|
*
|
|
@@ -18,6 +71,8 @@ export declare class MediaClient {
|
|
|
18
71
|
*
|
|
19
72
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
20
73
|
* @throws {@link Schedulin.InternalServerError}
|
|
74
|
+
* @throws {@link errors.SchedulinError}
|
|
75
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
21
76
|
*
|
|
22
77
|
* @example
|
|
23
78
|
* await client.media.retrieve({
|
|
@@ -34,6 +89,8 @@ export declare class MediaClient {
|
|
|
34
89
|
*
|
|
35
90
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
36
91
|
* @throws {@link Schedulin.InternalServerError}
|
|
92
|
+
* @throws {@link errors.SchedulinError}
|
|
93
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
37
94
|
*
|
|
38
95
|
* @example
|
|
39
96
|
* await client.media.update({
|
|
@@ -43,6 +100,24 @@ export declare class MediaClient {
|
|
|
43
100
|
*/
|
|
44
101
|
update(request: Schedulin.UpdateMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<Schedulin.Media>;
|
|
45
102
|
private __update;
|
|
103
|
+
/**
|
|
104
|
+
* Delete a media object and remove its files from storage. Fails with a conflict when the media is attached to any post — remove it from those posts (or delete them) first.
|
|
105
|
+
*
|
|
106
|
+
* @param {Schedulin.DeleteMediaRequest} request
|
|
107
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
110
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
111
|
+
* @throws {@link errors.SchedulinError}
|
|
112
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* await client.media.delete({
|
|
116
|
+
* id: "id"
|
|
117
|
+
* })
|
|
118
|
+
*/
|
|
119
|
+
delete(request: Schedulin.DeleteMediaRequest, requestOptions?: MediaClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
120
|
+
private __delete;
|
|
46
121
|
/**
|
|
47
122
|
* List media for the organization with page pagination, search, type and tag filters
|
|
48
123
|
*
|
|
@@ -51,6 +126,8 @@ export declare class MediaClient {
|
|
|
51
126
|
*
|
|
52
127
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
53
128
|
* @throws {@link Schedulin.InternalServerError}
|
|
129
|
+
* @throws {@link errors.SchedulinError}
|
|
130
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
54
131
|
*
|
|
55
132
|
* @example
|
|
56
133
|
* await client.media.list()
|
|
@@ -65,6 +142,8 @@ export declare class MediaClient {
|
|
|
65
142
|
*
|
|
66
143
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
67
144
|
* @throws {@link Schedulin.InternalServerError}
|
|
145
|
+
* @throws {@link errors.SchedulinError}
|
|
146
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
68
147
|
*
|
|
69
148
|
* @example
|
|
70
149
|
* await client.media.setTags({
|
|
@@ -81,6 +160,8 @@ export declare class MediaClient {
|
|
|
81
160
|
*
|
|
82
161
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
83
162
|
* @throws {@link Schedulin.InternalServerError}
|
|
163
|
+
* @throws {@link errors.SchedulinError}
|
|
164
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
84
165
|
*
|
|
85
166
|
* @example
|
|
86
167
|
* await client.media.countByTag()
|
|
@@ -95,6 +176,8 @@ export declare class MediaClient {
|
|
|
95
176
|
*
|
|
96
177
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
97
178
|
* @throws {@link Schedulin.InternalServerError}
|
|
179
|
+
* @throws {@link errors.SchedulinError}
|
|
180
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
98
181
|
*
|
|
99
182
|
* @example
|
|
100
183
|
* await client.media.createPresignedPost({
|
|
@@ -20,8 +20,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
25
26
|
import * as environments from "../../../../environments.mjs";
|
|
26
27
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
28
|
import * as errors from "../../../../errors/index.mjs";
|
|
@@ -30,6 +31,191 @@ export class MediaClient {
|
|
|
30
31
|
constructor(options) {
|
|
31
32
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Downloads a publicly reachable image or video into the media library and returns the media record. Use the returned `url` in `media[].url` when creating a post. Prefer this over the presign flow whenever your client cannot issue a raw HTTP PUT (e.g. an AI agent). The source URL must be public (no auth), http(s), and at most the post upload limit (250 MB); SVG and other active content is rejected.
|
|
36
|
+
*
|
|
37
|
+
* @param {Schedulin.CreateFromUrlMediaRequest} request
|
|
38
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
41
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
42
|
+
* @throws {@link errors.SchedulinError}
|
|
43
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.media.createFromUrl({
|
|
47
|
+
* url: "url"
|
|
48
|
+
* })
|
|
49
|
+
*/
|
|
50
|
+
createFromUrl(request, requestOptions) {
|
|
51
|
+
return core.HttpResponsePromise.fromPromise(this.__createFromUrl(request, requestOptions));
|
|
52
|
+
}
|
|
53
|
+
__createFromUrl(request, requestOptions) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
56
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
57
|
+
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);
|
|
58
|
+
const _response = yield core.fetcher({
|
|
59
|
+
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/media/from-url"),
|
|
60
|
+
method: "POST",
|
|
61
|
+
headers: _headers,
|
|
62
|
+
contentType: "application/json",
|
|
63
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
64
|
+
requestType: "json",
|
|
65
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
66
|
+
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,
|
|
67
|
+
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,
|
|
68
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
69
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
70
|
+
logging: this._options.logging,
|
|
71
|
+
});
|
|
72
|
+
if (_response.ok) {
|
|
73
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
74
|
+
}
|
|
75
|
+
if (_response.error.reason === "status-code") {
|
|
76
|
+
switch (_response.error.statusCode) {
|
|
77
|
+
case 401:
|
|
78
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 500:
|
|
80
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
81
|
+
default:
|
|
82
|
+
throw new errors.SchedulinError({
|
|
83
|
+
statusCode: _response.error.statusCode,
|
|
84
|
+
body: _response.error.body,
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/media/from-url");
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Returns a short-lived URL to a page where the user uploads files from their device (or a pasted attachment) straight into the media library. Hand the URL to the user; once they've uploaded, call GET /v0/media (list media, newest first) and reference the returned `url` when creating a post. Use this whenever the file isn't already at a public URL.
|
|
94
|
+
*
|
|
95
|
+
* @param {Schedulin.CreateUploadLinkMediaRequest} request
|
|
96
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
97
|
+
*
|
|
98
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
99
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
100
|
+
* @throws {@link errors.SchedulinError}
|
|
101
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* await client.media.createUploadLink()
|
|
105
|
+
*/
|
|
106
|
+
createUploadLink(request = {}, requestOptions) {
|
|
107
|
+
return core.HttpResponsePromise.fromPromise(this.__createUploadLink(request, requestOptions));
|
|
108
|
+
}
|
|
109
|
+
__createUploadLink() {
|
|
110
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
112
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
113
|
+
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);
|
|
114
|
+
const _response = yield core.fetcher({
|
|
115
|
+
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/media/upload-link"),
|
|
116
|
+
method: "POST",
|
|
117
|
+
headers: _headers,
|
|
118
|
+
contentType: "application/json",
|
|
119
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
120
|
+
requestType: "json",
|
|
121
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
122
|
+
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,
|
|
123
|
+
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,
|
|
124
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
125
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
126
|
+
logging: this._options.logging,
|
|
127
|
+
});
|
|
128
|
+
if (_response.ok) {
|
|
129
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
130
|
+
}
|
|
131
|
+
if (_response.error.reason === "status-code") {
|
|
132
|
+
switch (_response.error.statusCode) {
|
|
133
|
+
case 401:
|
|
134
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
135
|
+
case 500:
|
|
136
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
137
|
+
default:
|
|
138
|
+
throw new errors.SchedulinError({
|
|
139
|
+
statusCode: _response.error.statusCode,
|
|
140
|
+
body: _response.error.body,
|
|
141
|
+
rawResponse: _response.rawResponse,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/media/upload-link");
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Upload raw image, video, or audio bytes directly as multipart/form-data. The file is stored in your media library and the record is returned; use its `url` in `media[].url` when creating a post. Max 250 MB; SVG and other active content is rejected. For a file already hosted at a public URL, prefer POST /v0/media/from-url.
|
|
150
|
+
*
|
|
151
|
+
* @param {Schedulin.UploadMediaRequest} request
|
|
152
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
153
|
+
*
|
|
154
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
155
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
156
|
+
* @throws {@link errors.SchedulinError}
|
|
157
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* import { createReadStream } from "fs";
|
|
161
|
+
* await client.media.upload({
|
|
162
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
163
|
+
* })
|
|
164
|
+
*/
|
|
165
|
+
upload(request, requestOptions) {
|
|
166
|
+
return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));
|
|
167
|
+
}
|
|
168
|
+
__upload(request, requestOptions) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
171
|
+
const _body = yield core.newFormData();
|
|
172
|
+
yield _body.appendFile("file", request.file);
|
|
173
|
+
if (request.name != null) {
|
|
174
|
+
_body.append("name", request.name);
|
|
175
|
+
}
|
|
176
|
+
if (request.alt != null) {
|
|
177
|
+
_body.append("alt", request.alt);
|
|
178
|
+
}
|
|
179
|
+
if (request.contentType != null) {
|
|
180
|
+
_body.append("contentType", request.contentType);
|
|
181
|
+
}
|
|
182
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
183
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
184
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
185
|
+
const _response = yield core.fetcher({
|
|
186
|
+
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/media/upload"),
|
|
187
|
+
method: "POST",
|
|
188
|
+
headers: _headers,
|
|
189
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
190
|
+
requestType: "file",
|
|
191
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
192
|
+
body: _maybeEncodedRequest.body,
|
|
193
|
+
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,
|
|
194
|
+
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,
|
|
195
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
196
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
197
|
+
logging: this._options.logging,
|
|
198
|
+
});
|
|
199
|
+
if (_response.ok) {
|
|
200
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
201
|
+
}
|
|
202
|
+
if (_response.error.reason === "status-code") {
|
|
203
|
+
switch (_response.error.statusCode) {
|
|
204
|
+
case 401:
|
|
205
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
206
|
+
case 500:
|
|
207
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
208
|
+
default:
|
|
209
|
+
throw new errors.SchedulinError({
|
|
210
|
+
statusCode: _response.error.statusCode,
|
|
211
|
+
body: _response.error.body,
|
|
212
|
+
rawResponse: _response.rawResponse,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/media/upload");
|
|
217
|
+
});
|
|
218
|
+
}
|
|
33
219
|
/**
|
|
34
220
|
* Retrieve media information by its ID
|
|
35
221
|
*
|
|
@@ -38,6 +224,8 @@ export class MediaClient {
|
|
|
38
224
|
*
|
|
39
225
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
40
226
|
* @throws {@link Schedulin.InternalServerError}
|
|
227
|
+
* @throws {@link errors.SchedulinError}
|
|
228
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
41
229
|
*
|
|
42
230
|
* @example
|
|
43
231
|
* await client.media.retrieve({
|
|
@@ -92,6 +280,8 @@ export class MediaClient {
|
|
|
92
280
|
*
|
|
93
281
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
94
282
|
* @throws {@link Schedulin.InternalServerError}
|
|
283
|
+
* @throws {@link errors.SchedulinError}
|
|
284
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
95
285
|
*
|
|
96
286
|
* @example
|
|
97
287
|
* await client.media.update({
|
|
@@ -115,7 +305,7 @@ export class MediaClient {
|
|
|
115
305
|
contentType: "application/json",
|
|
116
306
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
117
307
|
requestType: "json",
|
|
118
|
-
body: _body,
|
|
308
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
119
309
|
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,
|
|
120
310
|
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,
|
|
121
311
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -142,6 +332,65 @@ export class MediaClient {
|
|
|
142
332
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v0/media/{id}");
|
|
143
333
|
});
|
|
144
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Delete a media object and remove its files from storage. Fails with a conflict when the media is attached to any post — remove it from those posts (or delete them) first.
|
|
337
|
+
*
|
|
338
|
+
* @param {Schedulin.DeleteMediaRequest} request
|
|
339
|
+
* @param {MediaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
340
|
+
*
|
|
341
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
342
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
343
|
+
* @throws {@link errors.SchedulinError}
|
|
344
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* await client.media.delete({
|
|
348
|
+
* id: "id"
|
|
349
|
+
* })
|
|
350
|
+
*/
|
|
351
|
+
delete(request, requestOptions) {
|
|
352
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
353
|
+
}
|
|
354
|
+
__delete(request, requestOptions) {
|
|
355
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
356
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
357
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
358
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
359
|
+
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);
|
|
360
|
+
const _response = yield core.fetcher({
|
|
361
|
+
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/media/${core.url.encodePathParam(id)}`),
|
|
362
|
+
method: "DELETE",
|
|
363
|
+
headers: _headers,
|
|
364
|
+
contentType: "application/json",
|
|
365
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
366
|
+
requestType: "json",
|
|
367
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
368
|
+
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,
|
|
369
|
+
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,
|
|
370
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
371
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
372
|
+
logging: this._options.logging,
|
|
373
|
+
});
|
|
374
|
+
if (_response.ok) {
|
|
375
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
376
|
+
}
|
|
377
|
+
if (_response.error.reason === "status-code") {
|
|
378
|
+
switch (_response.error.statusCode) {
|
|
379
|
+
case 401:
|
|
380
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
381
|
+
case 500:
|
|
382
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
383
|
+
default:
|
|
384
|
+
throw new errors.SchedulinError({
|
|
385
|
+
statusCode: _response.error.statusCode,
|
|
386
|
+
body: _response.error.body,
|
|
387
|
+
rawResponse: _response.rawResponse,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/media/{id}");
|
|
392
|
+
});
|
|
393
|
+
}
|
|
145
394
|
/**
|
|
146
395
|
* List media for the organization with page pagination, search, type and tag filters
|
|
147
396
|
*
|
|
@@ -150,6 +399,8 @@ export class MediaClient {
|
|
|
150
399
|
*
|
|
151
400
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
152
401
|
* @throws {@link Schedulin.InternalServerError}
|
|
402
|
+
* @throws {@link errors.SchedulinError}
|
|
403
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
153
404
|
*
|
|
154
405
|
* @example
|
|
155
406
|
* await client.media.list()
|
|
@@ -214,6 +465,8 @@ export class MediaClient {
|
|
|
214
465
|
*
|
|
215
466
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
216
467
|
* @throws {@link Schedulin.InternalServerError}
|
|
468
|
+
* @throws {@link errors.SchedulinError}
|
|
469
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
217
470
|
*
|
|
218
471
|
* @example
|
|
219
472
|
* await client.media.setTags({
|
|
@@ -237,7 +490,7 @@ export class MediaClient {
|
|
|
237
490
|
contentType: "application/json",
|
|
238
491
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
239
492
|
requestType: "json",
|
|
240
|
-
body: _body,
|
|
493
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
241
494
|
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,
|
|
242
495
|
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,
|
|
243
496
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -271,6 +524,8 @@ export class MediaClient {
|
|
|
271
524
|
*
|
|
272
525
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
273
526
|
* @throws {@link Schedulin.InternalServerError}
|
|
527
|
+
* @throws {@link errors.SchedulinError}
|
|
528
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
274
529
|
*
|
|
275
530
|
* @example
|
|
276
531
|
* await client.media.countByTag()
|
|
@@ -322,6 +577,8 @@ export class MediaClient {
|
|
|
322
577
|
*
|
|
323
578
|
* @throws {@link Schedulin.UnauthorizedError}
|
|
324
579
|
* @throws {@link Schedulin.InternalServerError}
|
|
580
|
+
* @throws {@link errors.SchedulinError}
|
|
581
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
325
582
|
*
|
|
326
583
|
* @example
|
|
327
584
|
* await client.media.createPresignedPost({
|
|
@@ -344,7 +601,7 @@ export class MediaClient {
|
|
|
344
601
|
contentType: "application/json",
|
|
345
602
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
346
603
|
requestType: "json",
|
|
347
|
-
body: request,
|
|
604
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
348
605
|
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,
|
|
349
606
|
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,
|
|
350
607
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as core from "../../../../../core/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface UploadMediaRequest {
|
|
9
|
+
file: core.file.Uploadable;
|
|
10
|
+
name?: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export type { CreateFromUrlMediaRequest } from "./CreateFromUrlMediaRequest.mjs";
|
|
1
2
|
export { CreatePresignedPost } from "./CreatePresignedPost.mjs";
|
|
3
|
+
export type { CreateUploadLinkMediaRequest } from "./CreateUploadLinkMediaRequest.mjs";
|
|
4
|
+
export type { DeleteMediaRequest } from "./DeleteMediaRequest.mjs";
|
|
2
5
|
export type { ListMediaRequest } from "./ListMediaRequest.mjs";
|
|
3
6
|
export type { RetrieveMediaRequest } from "./RetrieveMediaRequest.mjs";
|
|
4
7
|
export type { SetTagsMediaRequest } from "./SetTagsMediaRequest.mjs";
|
|
5
8
|
export type { UpdateMediaRequest } from "./UpdateMediaRequest.mjs";
|
|
9
|
+
export type { UploadMediaRequest } from "./UploadMediaRequest.mjs";
|