@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
package/cjs/core/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./auth/index.js";
|
|
2
2
|
export * from "./base64.js";
|
|
3
3
|
export * from "./fetcher/index.js";
|
|
4
|
+
export * as file from "./file/index.js";
|
|
5
|
+
export * from "./form-data-utils/index.js";
|
|
4
6
|
export * as logging from "./logging/index.js";
|
|
5
7
|
export * from "./runtime/index.js";
|
|
6
8
|
export * as url from "./url/index.js";
|
package/cjs/core/index.js
CHANGED
|
@@ -36,10 +36,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.url = exports.logging = void 0;
|
|
39
|
+
exports.url = exports.logging = exports.file = void 0;
|
|
40
40
|
__exportStar(require("./auth/index.js"), exports);
|
|
41
41
|
__exportStar(require("./base64.js"), exports);
|
|
42
42
|
__exportStar(require("./fetcher/index.js"), exports);
|
|
43
|
+
exports.file = __importStar(require("./file/index.js"));
|
|
44
|
+
__exportStar(require("./form-data-utils/index.js"), exports);
|
|
43
45
|
exports.logging = __importStar(require("./logging/index.js"));
|
|
44
46
|
__exportStar(require("./runtime/index.js"), exports);
|
|
45
47
|
exports.url = __importStar(require("./url/index.js"));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`)
|
|
3
|
+
* on top of the request body. Caller-supplied properties win over the endpoint body. When no
|
|
4
|
+
* additional body parameters are provided, the original body is returned unchanged so serialization
|
|
5
|
+
* is unaffected.
|
|
6
|
+
*
|
|
7
|
+
* The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`
|
|
8
|
+
* the additional parameters become the body; when the body is an array or a primitive JSON value it
|
|
9
|
+
* is returned unchanged, since object properties cannot be spread into it. This mirrors the Python
|
|
10
|
+
* SDK, which only merges additional body parameters into mapping bodies.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeAdditionalBodyParameters(body: unknown, additionalBodyParameters: Record<string, unknown> | undefined): unknown;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeAdditionalBodyParameters = mergeAdditionalBodyParameters;
|
|
4
|
+
/**
|
|
5
|
+
* Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`)
|
|
6
|
+
* on top of the request body. Caller-supplied properties win over the endpoint body. When no
|
|
7
|
+
* additional body parameters are provided, the original body is returned unchanged so serialization
|
|
8
|
+
* is unaffected.
|
|
9
|
+
*
|
|
10
|
+
* The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`
|
|
11
|
+
* the additional parameters become the body; when the body is an array or a primitive JSON value it
|
|
12
|
+
* is returned unchanged, since object properties cannot be spread into it. This mirrors the Python
|
|
13
|
+
* SDK, which only merges additional body parameters into mapping bodies.
|
|
14
|
+
*/
|
|
15
|
+
function mergeAdditionalBodyParameters(body, additionalBodyParameters) {
|
|
16
|
+
if (additionalBodyParameters == null) {
|
|
17
|
+
return body;
|
|
18
|
+
}
|
|
19
|
+
if (body == null) {
|
|
20
|
+
return Object.assign({}, additionalBodyParameters);
|
|
21
|
+
}
|
|
22
|
+
if (typeof body === "object" && !Array.isArray(body)) {
|
|
23
|
+
return Object.assign(Object.assign({}, body), additionalBodyParameters);
|
|
24
|
+
}
|
|
25
|
+
return body;
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { RUNTIME } from "./runtime.js";
|
|
1
|
+
export { getUserAgent, RUNTIME } from "./runtime.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RUNTIME = void 0;
|
|
3
|
+
exports.RUNTIME = exports.getUserAgent = void 0;
|
|
4
4
|
var runtime_js_1 = require("./runtime.js");
|
|
5
|
+
Object.defineProperty(exports, "getUserAgent", { enumerable: true, get: function () { return runtime_js_1.getUserAgent; } });
|
|
5
6
|
Object.defineProperty(exports, "RUNTIME", { enumerable: true, get: function () { return runtime_js_1.RUNTIME; } });
|
|
@@ -6,4 +6,23 @@ export interface Runtime {
|
|
|
6
6
|
type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime";
|
|
7
7
|
version?: string;
|
|
8
8
|
parsedVersion?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The operating system the SDK is running on, when it can be determined
|
|
11
|
+
* (e.g. "linux", "darwin", "win32" on server runtimes). Undefined in
|
|
12
|
+
* environments where the OS is not observable (e.g. browsers).
|
|
13
|
+
*/
|
|
14
|
+
os?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The CPU architecture the SDK is running on, when it can be determined
|
|
17
|
+
* (e.g. "x64", "arm64" on server runtimes). Undefined in environments where
|
|
18
|
+
* the architecture is not observable (e.g. browsers).
|
|
19
|
+
*/
|
|
20
|
+
arch?: string;
|
|
9
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Builds a structured User-Agent string of the form
|
|
24
|
+
* `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}`
|
|
25
|
+
* where the platform group and runtime segment are omitted gracefully when the
|
|
26
|
+
* underlying values cannot be determined (e.g. in a browser).
|
|
27
|
+
*/
|
|
28
|
+
export declare function getUserAgent(sdkName: string, sdkVersion: string): string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RUNTIME = void 0;
|
|
4
|
+
exports.getUserAgent = getUserAgent;
|
|
4
5
|
/**
|
|
5
6
|
* A constant that indicates which environment and version the SDK is running in.
|
|
6
7
|
*/
|
|
7
8
|
exports.RUNTIME = evaluateRuntime();
|
|
8
9
|
function evaluateRuntime() {
|
|
9
|
-
var _a, _b, _c, _d, _e;
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
11
|
/**
|
|
11
12
|
* A constant that indicates whether the environment the code is running is a Web Browser.
|
|
12
13
|
*/
|
|
@@ -59,6 +60,8 @@ function evaluateRuntime() {
|
|
|
59
60
|
return {
|
|
60
61
|
type: "deno",
|
|
61
62
|
version: Deno.version.deno,
|
|
63
|
+
os: (_e = Deno.build) === null || _e === void 0 ? void 0 : _e.os,
|
|
64
|
+
arch: (_f = Deno.build) === null || _f === void 0 ? void 0 : _f.arch,
|
|
62
65
|
};
|
|
63
66
|
}
|
|
64
67
|
/**
|
|
@@ -69,6 +72,8 @@ function evaluateRuntime() {
|
|
|
69
72
|
return {
|
|
70
73
|
type: "bun",
|
|
71
74
|
version: Bun.version,
|
|
75
|
+
os: typeof process !== "undefined" ? process.platform : undefined,
|
|
76
|
+
arch: typeof process !== "undefined" ? process.arch : undefined,
|
|
72
77
|
};
|
|
73
78
|
}
|
|
74
79
|
/**
|
|
@@ -90,15 +95,82 @@ function evaluateRuntime() {
|
|
|
90
95
|
* Edge Runtime warns about Node.js APIs even when they are guarded).
|
|
91
96
|
*/
|
|
92
97
|
const _process = typeof process !== "undefined" ? process : undefined;
|
|
93
|
-
const isNode = typeof _process !== "undefined" && typeof ((
|
|
98
|
+
const isNode = typeof _process !== "undefined" && typeof ((_g = _process.versions) === null || _g === void 0 ? void 0 : _g.node) === "string";
|
|
94
99
|
if (isNode) {
|
|
95
100
|
return {
|
|
96
101
|
type: "node",
|
|
97
102
|
version: _process.versions.node,
|
|
98
103
|
parsedVersion: Number(_process.versions.node.split(".")[0]),
|
|
104
|
+
os: _process.platform,
|
|
105
|
+
arch: _process.arch,
|
|
99
106
|
};
|
|
100
107
|
}
|
|
101
108
|
return {
|
|
102
109
|
type: "unknown",
|
|
103
110
|
};
|
|
104
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Display names for the language runtimes whose version is meaningful to encode
|
|
114
|
+
* in a User-Agent. Environments where a version string is not useful (e.g.
|
|
115
|
+
* browsers, where `version` is the full navigator UA) are intentionally mapped
|
|
116
|
+
* to `undefined` so they are omitted from the User-Agent.
|
|
117
|
+
*/
|
|
118
|
+
const RUNTIME_DISPLAY_NAMES = {
|
|
119
|
+
node: "Node",
|
|
120
|
+
deno: "Deno",
|
|
121
|
+
bun: "Bun",
|
|
122
|
+
browser: undefined,
|
|
123
|
+
"web-worker": undefined,
|
|
124
|
+
"react-native": undefined,
|
|
125
|
+
workerd: undefined,
|
|
126
|
+
"edge-runtime": undefined,
|
|
127
|
+
unknown: undefined,
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* CPU architecture aliases that all refer to 64-bit x86. They are normalized to
|
|
131
|
+
* the single canonical token `x86_64` so the User-Agent architecture label is
|
|
132
|
+
* consistent regardless of which runtime reports it (Node reports `x64`, others
|
|
133
|
+
* report `amd64` or `x86_64`).
|
|
134
|
+
*/
|
|
135
|
+
const X86_64_ARCH_ALIASES = new Set(["x64", "amd64", "x86_64"]);
|
|
136
|
+
/**
|
|
137
|
+
* Normalizes a CPU architecture token, collapsing the 64-bit x86 aliases
|
|
138
|
+
* (`x64`, `amd64`, `x86_64`) to `x86_64`. Other architectures are returned
|
|
139
|
+
* unchanged.
|
|
140
|
+
*/
|
|
141
|
+
function normalizeArch(arch) {
|
|
142
|
+
if (arch == null) {
|
|
143
|
+
return arch;
|
|
144
|
+
}
|
|
145
|
+
return X86_64_ARCH_ALIASES.has(arch.toLowerCase()) ? "x86_64" : arch;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Percent-encodes the `@` and `/` characters in an npm package name so the
|
|
149
|
+
* User-Agent product token stays within the RFC 7230 token grammar. The
|
|
150
|
+
* original scoped package name can be recovered by URL-decoding (e.g.
|
|
151
|
+
* `@dummy/sdk` becomes `%40dummy%2Fsdk`).
|
|
152
|
+
*/
|
|
153
|
+
function encodeProductName(sdkName) {
|
|
154
|
+
return sdkName.replace(/@/g, "%40").replace(/\//g, "%2F");
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Builds a structured User-Agent string of the form
|
|
158
|
+
* `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}`
|
|
159
|
+
* where the platform group and runtime segment are omitted gracefully when the
|
|
160
|
+
* underlying values cannot be determined (e.g. in a browser).
|
|
161
|
+
*/
|
|
162
|
+
function getUserAgent(sdkName, sdkVersion) {
|
|
163
|
+
let userAgent = `${encodeProductName(sdkName)}/${sdkVersion}`;
|
|
164
|
+
const platform = [exports.RUNTIME.os, normalizeArch(exports.RUNTIME.arch)].filter((part) => part != null && part.length > 0);
|
|
165
|
+
if (platform.length > 0) {
|
|
166
|
+
userAgent += ` (${platform.join("; ")})`;
|
|
167
|
+
}
|
|
168
|
+
const runtimeName = RUNTIME_DISPLAY_NAMES[exports.RUNTIME.type];
|
|
169
|
+
if (runtimeName != null) {
|
|
170
|
+
userAgent += ` ${runtimeName}`;
|
|
171
|
+
if (exports.RUNTIME.version != null && exports.RUNTIME.version.length > 0) {
|
|
172
|
+
userAgent += `/${exports.RUNTIME.version}`;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return userAgent;
|
|
176
|
+
}
|
package/cjs/core/url/qs.js
CHANGED
|
@@ -19,7 +19,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
19
19
|
const parts = [];
|
|
20
20
|
for (const [key, value] of Object.entries(obj)) {
|
|
21
21
|
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
22
|
-
if (value
|
|
22
|
+
if (value == null) {
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
25
|
if (Array.isArray(value)) {
|
|
@@ -39,7 +39,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
39
39
|
else {
|
|
40
40
|
for (let i = 0; i < value.length; i++) {
|
|
41
41
|
const item = value[i];
|
|
42
|
-
if (item
|
|
42
|
+
if (item == null) {
|
|
43
43
|
continue;
|
|
44
44
|
}
|
|
45
45
|
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
@@ -18,6 +18,10 @@ class SchedulinError extends Error {
|
|
|
18
18
|
this.cause = cause;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
get requestId() {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
return (_c = (_b = (_a = this.rawResponse) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.get("x-request-id")) !== null && _c !== void 0 ? _c : undefined;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
exports.SchedulinError = SchedulinError;
|
|
23
27
|
function buildMessage({ message, statusCode, body, }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as errors from "./index.js";
|
|
2
|
+
export declare class SchedulinTimeoutError extends errors.SchedulinError {
|
|
3
3
|
constructor(message: string, opts?: {
|
|
4
4
|
cause?: unknown;
|
|
5
5
|
});
|
|
@@ -1,18 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
exports.SchedulinTimeoutError = void 0;
|
|
5
|
-
|
|
38
|
+
const errors = __importStar(require("./index.js"));
|
|
39
|
+
class SchedulinTimeoutError extends errors.SchedulinError {
|
|
6
40
|
constructor(message, opts) {
|
|
7
|
-
super(
|
|
41
|
+
super({
|
|
42
|
+
message: message,
|
|
43
|
+
cause: opts === null || opts === void 0 ? void 0 : opts.cause,
|
|
44
|
+
});
|
|
8
45
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
9
46
|
if (Error.captureStackTrace) {
|
|
10
47
|
Error.captureStackTrace(this, this.constructor);
|
|
11
48
|
}
|
|
12
49
|
this.name = "SchedulinTimeoutError";
|
|
13
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
|
|
14
|
-
this.cause = opts.cause;
|
|
15
|
-
}
|
|
16
50
|
}
|
|
17
51
|
}
|
|
18
52
|
exports.SchedulinTimeoutError = SchedulinTimeoutError;
|
package/esm/BaseClient.d.mts
CHANGED
|
@@ -16,6 +16,11 @@ export type BaseClientOptions = {
|
|
|
16
16
|
fetch?: typeof fetch;
|
|
17
17
|
/** Configure logging for the client. */
|
|
18
18
|
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
19
|
+
/** Default options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
20
|
+
stream?: {
|
|
21
|
+
reconnectionEnabled?: boolean;
|
|
22
|
+
maxReconnectionAttempts?: number;
|
|
23
|
+
};
|
|
19
24
|
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
|
|
20
25
|
auth?: AuthOption;
|
|
21
26
|
} & HeaderAuthProvider.AuthOptions;
|
|
@@ -28,8 +33,15 @@ export interface BaseRequestOptions {
|
|
|
28
33
|
abortSignal?: AbortSignal;
|
|
29
34
|
/** Additional query string parameters to include in the request. */
|
|
30
35
|
queryParams?: Record<string, unknown>;
|
|
36
|
+
/** A dictionary containing additional parameters to spread into the request's body. */
|
|
37
|
+
additionalBodyParameters?: Record<string, unknown>;
|
|
31
38
|
/** Additional headers to include in the request. */
|
|
32
39
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
40
|
+
/** Options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
41
|
+
stream?: {
|
|
42
|
+
reconnectionEnabled?: boolean;
|
|
43
|
+
maxReconnectionAttempts?: number;
|
|
44
|
+
};
|
|
33
45
|
}
|
|
34
46
|
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
35
47
|
logging: core.logging.Logger;
|
package/esm/Client.d.mts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { AiClient } from "./api/resources/ai/client/Client.mjs";
|
|
1
2
|
import { MediaClient } from "./api/resources/media/client/Client.mjs";
|
|
3
|
+
import { PlatformsClient } from "./api/resources/platforms/client/Client.mjs";
|
|
2
4
|
import { PostsClient } from "./api/resources/posts/client/Client.mjs";
|
|
3
5
|
import { SocialAccountsClient } from "./api/resources/socialAccounts/client/Client.mjs";
|
|
4
6
|
import { TagsClient } from "./api/resources/tags/client/Client.mjs";
|
|
7
|
+
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
5
8
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
6
9
|
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
7
10
|
import * as core from "./core/index.mjs";
|
|
@@ -16,11 +19,17 @@ export declare class SchedulinClient {
|
|
|
16
19
|
protected _socialAccounts: SocialAccountsClient | undefined;
|
|
17
20
|
protected _tags: TagsClient | undefined;
|
|
18
21
|
protected _media: MediaClient | undefined;
|
|
22
|
+
protected _platforms: PlatformsClient | undefined;
|
|
23
|
+
protected _ai: AiClient | undefined;
|
|
24
|
+
protected _webhooks: WebhooksClient | undefined;
|
|
19
25
|
constructor(options: SchedulinClient.Options);
|
|
20
26
|
get posts(): PostsClient;
|
|
21
27
|
get socialAccounts(): SocialAccountsClient;
|
|
22
28
|
get tags(): TagsClient;
|
|
23
29
|
get media(): MediaClient;
|
|
30
|
+
get platforms(): PlatformsClient;
|
|
31
|
+
get ai(): AiClient;
|
|
32
|
+
get webhooks(): WebhooksClient;
|
|
24
33
|
/**
|
|
25
34
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
26
35
|
* This is useful for making requests to endpoints not yet supported in the SDK.
|
package/esm/Client.mjs
CHANGED
|
@@ -8,10 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
import { AiClient } from "./api/resources/ai/client/Client.mjs";
|
|
11
12
|
import { MediaClient } from "./api/resources/media/client/Client.mjs";
|
|
13
|
+
import { PlatformsClient } from "./api/resources/platforms/client/Client.mjs";
|
|
12
14
|
import { PostsClient } from "./api/resources/posts/client/Client.mjs";
|
|
13
15
|
import { SocialAccountsClient } from "./api/resources/socialAccounts/client/Client.mjs";
|
|
14
16
|
import { TagsClient } from "./api/resources/tags/client/Client.mjs";
|
|
17
|
+
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
15
18
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
16
19
|
import * as core from "./core/index.mjs";
|
|
17
20
|
export class SchedulinClient {
|
|
@@ -34,6 +37,18 @@ export class SchedulinClient {
|
|
|
34
37
|
var _a;
|
|
35
38
|
return ((_a = this._media) !== null && _a !== void 0 ? _a : (this._media = new MediaClient(this._options)));
|
|
36
39
|
}
|
|
40
|
+
get platforms() {
|
|
41
|
+
var _a;
|
|
42
|
+
return ((_a = this._platforms) !== null && _a !== void 0 ? _a : (this._platforms = new PlatformsClient(this._options)));
|
|
43
|
+
}
|
|
44
|
+
get ai() {
|
|
45
|
+
var _a;
|
|
46
|
+
return ((_a = this._ai) !== null && _a !== void 0 ? _a : (this._ai = new AiClient(this._options)));
|
|
47
|
+
}
|
|
48
|
+
get webhooks() {
|
|
49
|
+
var _a;
|
|
50
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new WebhooksClient(this._options)));
|
|
51
|
+
}
|
|
37
52
|
/**
|
|
38
53
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
39
54
|
* This is useful for making requests to endpoints not yet supported in the SDK.
|
|
@@ -2,5 +2,6 @@ import type * as core from "../../core/index.mjs";
|
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
3
|
import type * as Schedulin from "../index.mjs";
|
|
4
4
|
export declare class InternalServerError extends errors.SchedulinError {
|
|
5
|
+
readonly body: Schedulin.ErrorResponse;
|
|
5
6
|
constructor(body: Schedulin.ErrorResponse, rawResponse?: core.RawResponse);
|
|
6
7
|
}
|
|
@@ -2,5 +2,6 @@ import type * as core from "../../core/index.mjs";
|
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
3
|
import type * as Schedulin from "../index.mjs";
|
|
4
4
|
export declare class UnauthorizedError extends errors.SchedulinError {
|
|
5
|
+
readonly body: Schedulin.ErrorResponse;
|
|
5
6
|
constructor(body: Schedulin.ErrorResponse, rawResponse?: core.RawResponse);
|
|
6
7
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Schedulin from "../../../index.mjs";
|
|
5
|
+
export declare namespace AiClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AiClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AiClient.Options>;
|
|
12
|
+
constructor(options: AiClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Submit an AI image generation job
|
|
15
|
+
*
|
|
16
|
+
* @param {Schedulin.GenerateImageAiRequest} request
|
|
17
|
+
* @param {AiClient.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.ai.generateImage({
|
|
26
|
+
* prompt: "prompt"
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
generateImage(request: Schedulin.GenerateImageAiRequest, requestOptions?: AiClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
30
|
+
private __generateImage;
|
|
31
|
+
/**
|
|
32
|
+
* Get the status and details of a generation job
|
|
33
|
+
*
|
|
34
|
+
* @param {Schedulin.GetGenerationAiRequest} request
|
|
35
|
+
* @param {AiClient.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.ai.getGeneration({
|
|
44
|
+
* id: "id"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
getGeneration(request: Schedulin.GetGenerationAiRequest, requestOptions?: AiClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
48
|
+
private __getGeneration;
|
|
49
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
15
|
+
import * as environments from "../../../../environments.mjs";
|
|
16
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
17
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
+
import * as Schedulin from "../../../index.mjs";
|
|
19
|
+
export class AiClient {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Submit an AI image generation job
|
|
25
|
+
*
|
|
26
|
+
* @param {Schedulin.GenerateImageAiRequest} request
|
|
27
|
+
* @param {AiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
30
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
31
|
+
* @throws {@link errors.SchedulinError}
|
|
32
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.ai.generateImage({
|
|
36
|
+
* prompt: "prompt"
|
|
37
|
+
* })
|
|
38
|
+
*/
|
|
39
|
+
generateImage(request, requestOptions) {
|
|
40
|
+
return core.HttpResponsePromise.fromPromise(this.__generateImage(request, requestOptions));
|
|
41
|
+
}
|
|
42
|
+
__generateImage(request, requestOptions) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
46
|
+
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);
|
|
47
|
+
const _response = yield core.fetcher({
|
|
48
|
+
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/studio/generateImage"),
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: _headers,
|
|
51
|
+
contentType: "application/json",
|
|
52
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
53
|
+
requestType: "json",
|
|
54
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
55
|
+
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,
|
|
56
|
+
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,
|
|
57
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
58
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
59
|
+
logging: this._options.logging,
|
|
60
|
+
});
|
|
61
|
+
if (_response.ok) {
|
|
62
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
63
|
+
}
|
|
64
|
+
if (_response.error.reason === "status-code") {
|
|
65
|
+
switch (_response.error.statusCode) {
|
|
66
|
+
case 401:
|
|
67
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
68
|
+
case 500:
|
|
69
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
70
|
+
default:
|
|
71
|
+
throw new errors.SchedulinError({
|
|
72
|
+
statusCode: _response.error.statusCode,
|
|
73
|
+
body: _response.error.body,
|
|
74
|
+
rawResponse: _response.rawResponse,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/studio/generateImage");
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get the status and details of a generation job
|
|
83
|
+
*
|
|
84
|
+
* @param {Schedulin.GetGenerationAiRequest} request
|
|
85
|
+
* @param {AiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
88
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
89
|
+
* @throws {@link errors.SchedulinError}
|
|
90
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await client.ai.getGeneration({
|
|
94
|
+
* id: "id"
|
|
95
|
+
* })
|
|
96
|
+
*/
|
|
97
|
+
getGeneration(request, requestOptions) {
|
|
98
|
+
return core.HttpResponsePromise.fromPromise(this.__getGeneration(request, requestOptions));
|
|
99
|
+
}
|
|
100
|
+
__getGeneration(request, requestOptions) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
103
|
+
const { id } = request;
|
|
104
|
+
const _queryParams = {
|
|
105
|
+
id,
|
|
106
|
+
};
|
|
107
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
108
|
+
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);
|
|
109
|
+
const _response = yield core.fetcher({
|
|
110
|
+
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/studio/getGeneration"),
|
|
111
|
+
method: "GET",
|
|
112
|
+
headers: _headers,
|
|
113
|
+
queryString: core.url
|
|
114
|
+
.queryBuilder()
|
|
115
|
+
.addMany(_queryParams)
|
|
116
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
117
|
+
.build(),
|
|
118
|
+
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,
|
|
119
|
+
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,
|
|
120
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
121
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
122
|
+
logging: this._options.logging,
|
|
123
|
+
});
|
|
124
|
+
if (_response.ok) {
|
|
125
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
126
|
+
}
|
|
127
|
+
if (_response.error.reason === "status-code") {
|
|
128
|
+
switch (_response.error.statusCode) {
|
|
129
|
+
case 401:
|
|
130
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
131
|
+
case 500:
|
|
132
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
133
|
+
default:
|
|
134
|
+
throw new errors.SchedulinError({
|
|
135
|
+
statusCode: _response.error.statusCode,
|
|
136
|
+
body: _response.error.body,
|
|
137
|
+
rawResponse: _response.rawResponse,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/studio/getGeneration");
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* prompt: "prompt"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface GenerateImageAiRequest {
|
|
8
|
+
prompt: string;
|
|
9
|
+
modelKey?: GenerateImageAiRequest.ModelKey;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace GenerateImageAiRequest {
|
|
14
|
+
const ModelKey: {
|
|
15
|
+
readonly FluxSchnell: "flux_schnell";
|
|
16
|
+
readonly FluxDev: "flux_dev";
|
|
17
|
+
readonly FluxProUltra: "flux_pro_ultra";
|
|
18
|
+
};
|
|
19
|
+
type ModelKey = (typeof ModelKey)[keyof typeof ModelKey];
|
|
20
|
+
}
|