@schedulin/sdk 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/cjs/BaseClient.d.ts +12 -0
- package/cjs/Client.d.ts +9 -0
- package/cjs/Client.js +23 -8
- package/cjs/api/errors/InternalServerError.d.ts +1 -0
- package/cjs/api/errors/UnauthorizedError.d.ts +1 -0
- package/cjs/api/resources/ai/client/Client.d.ts +49 -0
- package/cjs/api/resources/ai/client/Client.js +181 -0
- package/cjs/api/resources/ai/client/index.d.ts +1 -0
- package/cjs/api/resources/ai/client/index.js +17 -0
- package/cjs/api/resources/ai/client/requests/GenerateImageAiRequest.d.ts +20 -0
- package/cjs/api/resources/ai/client/requests/GenerateImageAiRequest.js +12 -0
- package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.d.ts → ai/client/requests/GetGenerationAiRequest.d.ts} +1 -1
- package/cjs/api/resources/ai/client/requests/index.d.ts +2 -0
- package/cjs/api/resources/ai/client/requests/index.js +5 -0
- package/cjs/api/resources/ai/exports.d.ts +2 -0
- package/cjs/api/resources/ai/exports.js +21 -0
- package/cjs/api/resources/ai/index.d.ts +1 -0
- package/cjs/api/resources/ai/index.js +17 -0
- package/cjs/api/resources/index.d.ts +6 -0
- package/cjs/api/resources/index.js +7 -1
- package/cjs/api/resources/media/client/Client.d.ts +83 -0
- package/cjs/api/resources/media/client/Client.js +260 -3
- package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.ts +12 -0
- package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.js +3 -0
- package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.ts +7 -0
- package/cjs/api/resources/media/client/requests/CreateUploadLinkMediaRequest.js +3 -0
- package/{esm/api/resources/posts/client/requests/GetJobStatusPostsRequest.d.mts → cjs/api/resources/media/client/requests/DeleteMediaRequest.d.ts} +1 -1
- package/cjs/api/resources/media/client/requests/DeleteMediaRequest.js +3 -0
- package/cjs/api/resources/media/client/requests/UploadMediaRequest.d.ts +13 -0
- package/cjs/api/resources/media/client/requests/UploadMediaRequest.js +3 -0
- package/cjs/api/resources/media/client/requests/index.d.ts +4 -0
- package/cjs/api/resources/platforms/client/Client.d.ts +28 -0
- package/cjs/api/resources/platforms/client/Client.js +111 -0
- package/cjs/api/resources/platforms/client/index.d.ts +1 -0
- package/cjs/api/resources/platforms/client/index.js +2 -0
- package/cjs/api/resources/platforms/exports.d.ts +2 -0
- package/cjs/api/resources/platforms/exports.js +21 -0
- package/cjs/api/resources/platforms/index.d.ts +2 -0
- package/cjs/api/resources/platforms/index.js +18 -0
- package/cjs/api/resources/platforms/types/ListPlatformsResponse.d.ts +56 -0
- package/cjs/api/resources/platforms/types/ListPlatformsResponse.js +24 -0
- package/cjs/api/resources/platforms/types/index.d.ts +1 -0
- package/cjs/api/resources/platforms/types/index.js +17 -0
- package/cjs/api/resources/posts/client/Client.d.ts +22 -18
- package/cjs/api/resources/posts/client/Client.js +30 -62
- package/cjs/api/resources/posts/client/requests/ListPostsRequest.d.ts +1 -0
- package/cjs/api/resources/posts/client/requests/PostCreate.d.ts +64 -0
- package/cjs/api/resources/posts/client/requests/PostCreate.js +63 -0
- package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.d.ts +0 -2
- package/cjs/api/resources/posts/client/requests/UpdatePostsRequest.js +0 -2
- package/cjs/api/resources/posts/client/requests/index.d.ts +0 -1
- package/cjs/api/resources/posts/types/CreatePostsResponse.d.ts +21 -0
- package/cjs/api/resources/posts/types/CreatePostsResponse.js +21 -0
- package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.d.ts +8 -0
- package/cjs/api/resources/posts/types/ListPostsRequestStatusesItem.js +11 -0
- package/cjs/api/resources/posts/types/index.d.ts +1 -0
- package/cjs/api/resources/posts/types/index.js +1 -0
- package/cjs/api/resources/socialAccounts/client/Client.d.ts +68 -1
- package/cjs/api/resources/socialAccounts/client/Client.js +210 -4
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.ts +9 -0
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.js +3 -0
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.ts +11 -0
- package/cjs/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.js +3 -0
- package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.ts +11 -0
- package/cjs/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.js +3 -0
- package/cjs/api/resources/socialAccounts/client/requests/index.d.ts +3 -0
- package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.ts +22 -0
- package/cjs/api/resources/socialAccounts/types/ListSocialAccountsResponse.js +21 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.ts +12 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.js +3 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.ts +12 -0
- package/cjs/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.js +3 -0
- package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.ts +3 -0
- package/cjs/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.js +3 -0
- package/cjs/api/resources/socialAccounts/types/index.d.ts +3 -0
- package/cjs/api/resources/socialAccounts/types/index.js +3 -0
- package/cjs/api/resources/tags/client/Client.d.ts +8 -0
- package/cjs/api/resources/tags/client/Client.js +12 -3
- package/cjs/api/resources/webhooks/client/Client.d.ts +155 -0
- package/cjs/api/resources/webhooks/client/Client.js +538 -0
- package/cjs/api/resources/webhooks/client/index.d.ts +1 -0
- package/cjs/api/resources/webhooks/client/index.js +17 -0
- package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.ts +24 -0
- package/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.js +16 -0
- package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/DeleteWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.ts +11 -0
- package/cjs/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.d.ts +9 -0
- package/cjs/api/resources/webhooks/client/requests/TestWebhooksRequest.js +3 -0
- package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.ts +25 -0
- package/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.js +16 -0
- package/cjs/api/resources/webhooks/client/requests/index.d.ts +7 -0
- package/cjs/api/resources/webhooks/client/requests/index.js +7 -0
- package/cjs/api/resources/webhooks/exports.d.ts +2 -0
- package/cjs/api/resources/webhooks/exports.js +21 -0
- package/cjs/api/resources/webhooks/index.d.ts +1 -0
- package/cjs/api/resources/webhooks/index.js +17 -0
- package/cjs/api/types/OauthScope.d.ts +12 -0
- package/cjs/api/types/OauthScope.js +12 -0
- package/cjs/api/types/PostSearch.d.ts +12 -0
- package/cjs/api/types/PostSearch.js +10 -0
- package/cjs/api/types/PostWithRelations.d.ts +21 -0
- package/cjs/api/types/PostWithRelations.js +21 -0
- package/cjs/api/types/SocialAccountDisconnectedReason.d.ts +1 -0
- package/cjs/api/types/SocialAccountDisconnectedReason.js +1 -0
- package/cjs/api/types/SocialPlatform.d.ts +21 -0
- package/cjs/api/types/SocialPlatform.js +21 -0
- package/cjs/core/exports.d.ts +1 -0
- package/cjs/core/exports.js +1 -0
- package/cjs/core/fetcher/Fetcher.js +9 -92
- package/cjs/core/fetcher/makePassthroughRequest.js +26 -4
- package/cjs/core/fetcher/redactUrl.d.ts +2 -0
- package/cjs/core/fetcher/redactUrl.js +88 -0
- package/cjs/core/file/exports.d.ts +1 -0
- package/cjs/core/file/exports.js +2 -0
- package/cjs/core/file/file.d.ts +10 -0
- package/cjs/core/file/file.js +225 -0
- package/cjs/core/file/index.d.ts +2 -0
- package/cjs/core/file/index.js +18 -0
- package/cjs/core/file/types.d.ts +66 -0
- package/cjs/core/file/types.js +2 -0
- package/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/cjs/core/form-data-utils/FormDataWrapper.js +188 -0
- package/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/cjs/core/form-data-utils/index.d.ts +2 -0
- package/cjs/core/form-data-utils/index.js +20 -0
- package/cjs/core/index.d.ts +2 -0
- package/cjs/core/index.js +3 -1
- package/cjs/core/requestBody.d.ts +12 -0
- package/cjs/core/requestBody.js +26 -0
- package/cjs/core/runtime/index.d.ts +1 -1
- package/cjs/core/runtime/index.js +2 -1
- package/cjs/core/runtime/runtime.d.ts +19 -0
- package/cjs/core/runtime/runtime.js +74 -2
- package/cjs/core/url/qs.js +2 -2
- package/cjs/errors/SchedulinError.d.ts +1 -0
- package/cjs/errors/SchedulinError.js +4 -0
- package/cjs/errors/SchedulinTimeoutError.d.ts +2 -2
- package/cjs/errors/SchedulinTimeoutError.js +39 -5
- package/esm/BaseClient.d.mts +12 -0
- package/esm/Client.d.mts +9 -0
- package/esm/Client.mjs +15 -0
- package/esm/api/errors/InternalServerError.d.mts +1 -0
- package/esm/api/errors/UnauthorizedError.d.mts +1 -0
- package/esm/api/resources/ai/client/Client.d.mts +49 -0
- package/esm/api/resources/ai/client/Client.mjs +144 -0
- package/esm/api/resources/ai/client/index.d.mts +1 -0
- package/esm/api/resources/ai/client/index.mjs +1 -0
- package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.d.mts +20 -0
- package/esm/api/resources/ai/client/requests/GenerateImageAiRequest.mjs +9 -0
- package/esm/api/resources/ai/client/requests/GetGenerationAiRequest.d.mts +9 -0
- package/esm/api/resources/ai/client/requests/index.d.mts +2 -0
- package/esm/api/resources/ai/client/requests/index.mjs +1 -0
- package/esm/api/resources/ai/exports.d.mts +2 -0
- package/esm/api/resources/ai/exports.mjs +3 -0
- package/esm/api/resources/ai/index.d.mts +1 -0
- package/esm/api/resources/ai/index.mjs +1 -0
- package/esm/api/resources/index.d.mts +6 -0
- package/esm/api/resources/index.mjs +6 -0
- package/esm/api/resources/media/client/Client.d.mts +83 -0
- package/esm/api/resources/media/client/Client.mjs +261 -4
- package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.mts +12 -0
- package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.d.mts +7 -0
- package/esm/api/resources/media/client/requests/CreateUploadLinkMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/DeleteMediaRequest.d.mts +9 -0
- package/esm/api/resources/media/client/requests/DeleteMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/UploadMediaRequest.d.mts +13 -0
- package/esm/api/resources/media/client/requests/UploadMediaRequest.mjs +2 -0
- package/esm/api/resources/media/client/requests/index.d.mts +4 -0
- package/esm/api/resources/platforms/client/Client.d.mts +28 -0
- package/esm/api/resources/platforms/client/Client.mjs +74 -0
- package/esm/api/resources/platforms/client/index.d.mts +1 -0
- package/esm/api/resources/platforms/client/index.mjs +1 -0
- package/esm/api/resources/platforms/exports.d.mts +2 -0
- package/esm/api/resources/platforms/exports.mjs +3 -0
- package/esm/api/resources/platforms/index.d.mts +2 -0
- package/esm/api/resources/platforms/index.mjs +2 -0
- package/esm/api/resources/platforms/types/ListPlatformsResponse.d.mts +56 -0
- package/esm/api/resources/platforms/types/ListPlatformsResponse.mjs +21 -0
- package/esm/api/resources/platforms/types/index.d.mts +1 -0
- package/esm/api/resources/platforms/types/index.mjs +1 -0
- package/esm/api/resources/posts/client/Client.d.mts +22 -18
- package/esm/api/resources/posts/client/Client.mjs +30 -62
- package/esm/api/resources/posts/client/requests/ListPostsRequest.d.mts +1 -0
- package/esm/api/resources/posts/client/requests/PostCreate.d.mts +64 -0
- package/esm/api/resources/posts/client/requests/PostCreate.mjs +63 -0
- package/esm/api/resources/posts/client/requests/UpdatePostsRequest.d.mts +0 -2
- package/esm/api/resources/posts/client/requests/UpdatePostsRequest.mjs +0 -2
- package/esm/api/resources/posts/client/requests/index.d.mts +0 -1
- package/esm/api/resources/posts/types/CreatePostsResponse.d.mts +21 -0
- package/esm/api/resources/posts/types/CreatePostsResponse.mjs +21 -0
- package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.d.mts +8 -0
- package/esm/api/resources/posts/types/ListPostsRequestStatusesItem.mjs +8 -0
- package/esm/api/resources/posts/types/index.d.mts +1 -0
- package/esm/api/resources/posts/types/index.mjs +1 -0
- package/esm/api/resources/socialAccounts/client/Client.d.mts +68 -1
- package/esm/api/resources/socialAccounts/client/Client.mjs +210 -4
- package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.d.mts +9 -0
- package/esm/api/resources/socialAccounts/client/requests/ListWhopCompaniesSocialAccountsRequest.mjs +2 -0
- package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.d.mts +11 -0
- package/esm/api/resources/socialAccounts/client/requests/ListWhopForumsSocialAccountsRequest.mjs +2 -0
- package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.d.mts +11 -0
- package/esm/api/resources/socialAccounts/client/requests/NextSlotsSocialAccountsRequest.mjs +2 -0
- package/esm/api/resources/socialAccounts/client/requests/index.d.mts +3 -0
- package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.d.mts +22 -0
- package/esm/api/resources/socialAccounts/types/ListSocialAccountsResponse.mjs +21 -0
- package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.d.mts +12 -0
- package/esm/api/resources/socialAccounts/types/ListWhopCompaniesSocialAccountsResponse.mjs +2 -0
- package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.d.mts +12 -0
- package/esm/api/resources/socialAccounts/types/ListWhopForumsSocialAccountsResponse.mjs +2 -0
- package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.d.mts +3 -0
- package/esm/api/resources/socialAccounts/types/NextSlotsSocialAccountsResponse.mjs +2 -0
- package/esm/api/resources/socialAccounts/types/index.d.mts +3 -0
- package/esm/api/resources/socialAccounts/types/index.mjs +3 -0
- package/esm/api/resources/tags/client/Client.d.mts +8 -0
- package/esm/api/resources/tags/client/Client.mjs +12 -3
- package/esm/api/resources/webhooks/client/Client.d.mts +155 -0
- package/esm/api/resources/webhooks/client/Client.mjs +501 -0
- package/esm/api/resources/webhooks/client/index.d.mts +1 -0
- package/esm/api/resources/webhooks/client/index.mjs +1 -0
- package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.mts +24 -0
- package/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.mjs +13 -0
- package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/DeleteWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.mts +11 -0
- package/esm/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/RetrieveWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/RotateSecretWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.d.mts +9 -0
- package/esm/api/resources/webhooks/client/requests/TestWebhooksRequest.mjs +2 -0
- package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.mts +25 -0
- package/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.mjs +13 -0
- package/esm/api/resources/webhooks/client/requests/index.d.mts +7 -0
- package/esm/api/resources/webhooks/client/requests/index.mjs +2 -0
- package/esm/api/resources/webhooks/exports.d.mts +2 -0
- package/esm/api/resources/webhooks/exports.mjs +3 -0
- package/esm/api/resources/webhooks/index.d.mts +1 -0
- package/esm/api/resources/webhooks/index.mjs +1 -0
- package/esm/api/types/OauthScope.d.mts +12 -0
- package/esm/api/types/OauthScope.mjs +12 -0
- package/esm/api/types/PostSearch.d.mts +12 -0
- package/esm/api/types/PostSearch.mjs +10 -0
- package/esm/api/types/PostWithRelations.d.mts +21 -0
- package/esm/api/types/PostWithRelations.mjs +21 -0
- package/esm/api/types/SocialAccountDisconnectedReason.d.mts +1 -0
- package/esm/api/types/SocialAccountDisconnectedReason.mjs +1 -0
- package/esm/api/types/SocialPlatform.d.mts +21 -0
- package/esm/api/types/SocialPlatform.mjs +21 -0
- package/esm/core/exports.d.mts +1 -0
- package/esm/core/exports.mjs +1 -0
- package/esm/core/fetcher/Fetcher.mjs +1 -84
- package/esm/core/fetcher/makePassthroughRequest.mjs +26 -4
- package/esm/core/fetcher/redactUrl.d.mts +2 -0
- package/esm/core/fetcher/redactUrl.mjs +84 -0
- package/esm/core/file/exports.d.mts +1 -0
- package/esm/core/file/exports.mjs +1 -0
- package/esm/core/file/file.d.mts +10 -0
- package/esm/core/file/file.mjs +188 -0
- package/esm/core/file/index.d.mts +2 -0
- package/esm/core/file/index.mjs +2 -0
- package/esm/core/file/types.d.mts +66 -0
- package/esm/core/file/types.mjs +1 -0
- package/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
- package/esm/core/form-data-utils/FormDataWrapper.mjs +150 -0
- package/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
- package/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
- package/esm/core/form-data-utils/index.d.mts +2 -0
- package/esm/core/form-data-utils/index.mjs +2 -0
- package/esm/core/index.d.mts +2 -0
- package/esm/core/index.mjs +2 -0
- package/esm/core/requestBody.d.mts +12 -0
- package/esm/core/requestBody.mjs +23 -0
- package/esm/core/runtime/index.d.mts +1 -1
- package/esm/core/runtime/index.mjs +1 -1
- package/esm/core/runtime/runtime.d.mts +19 -0
- package/esm/core/runtime/runtime.mjs +73 -2
- package/esm/core/url/qs.mjs +2 -2
- package/esm/errors/SchedulinError.d.mts +1 -0
- package/esm/errors/SchedulinError.mjs +4 -0
- package/esm/errors/SchedulinTimeoutError.d.mts +2 -2
- package/esm/errors/SchedulinTimeoutError.mjs +6 -5
- package/package.json +1 -1
- /package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.js → ai/client/requests/GetGenerationAiRequest.js} +0 -0
- /package/esm/api/resources/{posts/client/requests/GetJobStatusPostsRequest.mjs → ai/client/requests/GetGenerationAiRequest.mjs} +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
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 WebhooksClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class WebhooksClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
|
|
12
|
+
constructor(options: WebhooksClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* List the organization's webhook endpoints. Signing secrets are masked.
|
|
15
|
+
*
|
|
16
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
19
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
20
|
+
* @throws {@link errors.SchedulinError}
|
|
21
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.webhooks.list()
|
|
25
|
+
*/
|
|
26
|
+
list(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
27
|
+
private __list;
|
|
28
|
+
/**
|
|
29
|
+
* Register an HTTPS endpoint for event deliveries. The response includes the signing secret ONCE — store it; later reads return a masked value.
|
|
30
|
+
*
|
|
31
|
+
* @param {Schedulin.CreateWebhooksRequest} request
|
|
32
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
|
+
*
|
|
34
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
35
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
36
|
+
* @throws {@link errors.SchedulinError}
|
|
37
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await client.webhooks.create({
|
|
41
|
+
* url: "url",
|
|
42
|
+
* events: ["post.published"]
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
create(request: Schedulin.CreateWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
46
|
+
private __create;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieve one webhook endpoint, including failure counters. The signing secret is masked.
|
|
49
|
+
*
|
|
50
|
+
* @param {Schedulin.RetrieveWebhooksRequest} request
|
|
51
|
+
* @param {WebhooksClient.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
|
+
* await client.webhooks.retrieve({
|
|
60
|
+
* id: "id"
|
|
61
|
+
* })
|
|
62
|
+
*/
|
|
63
|
+
retrieve(request: Schedulin.RetrieveWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
64
|
+
private __retrieve;
|
|
65
|
+
/**
|
|
66
|
+
* Delete a webhook endpoint and its delivery history. Deliveries already in flight are dropped.
|
|
67
|
+
*
|
|
68
|
+
* @param {Schedulin.DeleteWebhooksRequest} request
|
|
69
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
72
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
73
|
+
* @throws {@link errors.SchedulinError}
|
|
74
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.webhooks.delete({
|
|
78
|
+
* id: "id"
|
|
79
|
+
* })
|
|
80
|
+
*/
|
|
81
|
+
delete(request: Schedulin.DeleteWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
82
|
+
private __delete;
|
|
83
|
+
/**
|
|
84
|
+
* Update URL, subscribed events, description, or enabled state. Re-enabling resets the failure streak.
|
|
85
|
+
*
|
|
86
|
+
* @param {Schedulin.UpdateWebhooksRequest} request
|
|
87
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
88
|
+
*
|
|
89
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
90
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
91
|
+
* @throws {@link errors.SchedulinError}
|
|
92
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* await client.webhooks.update({
|
|
96
|
+
* id: "id"
|
|
97
|
+
* })
|
|
98
|
+
*/
|
|
99
|
+
update(request: Schedulin.UpdateWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
100
|
+
private __update;
|
|
101
|
+
/**
|
|
102
|
+
* Generate a new signing secret for the endpoint and return it ONCE. The old secret stops signing immediately.
|
|
103
|
+
*
|
|
104
|
+
* @param {Schedulin.RotateSecretWebhooksRequest} request
|
|
105
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
106
|
+
*
|
|
107
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
108
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
109
|
+
* @throws {@link errors.SchedulinError}
|
|
110
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.webhooks.rotateSecret({
|
|
114
|
+
* id: "id"
|
|
115
|
+
* })
|
|
116
|
+
*/
|
|
117
|
+
rotateSecret(request: Schedulin.RotateSecretWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
118
|
+
private __rotateSecret;
|
|
119
|
+
/**
|
|
120
|
+
* Send a signed `ping` event to the endpoint URL and record it in the delivery history.
|
|
121
|
+
*
|
|
122
|
+
* @param {Schedulin.TestWebhooksRequest} request
|
|
123
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
|
+
*
|
|
125
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
126
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
127
|
+
* @throws {@link errors.SchedulinError}
|
|
128
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* await client.webhooks.test({
|
|
132
|
+
* id: "id"
|
|
133
|
+
* })
|
|
134
|
+
*/
|
|
135
|
+
test(request: Schedulin.TestWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
136
|
+
private __test;
|
|
137
|
+
/**
|
|
138
|
+
* Delivery history for a webhook endpoint: event, status, attempts, last response code, and payload.
|
|
139
|
+
*
|
|
140
|
+
* @param {Schedulin.ListDeliveriesWebhooksRequest} request
|
|
141
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
|
+
*
|
|
143
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
144
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
145
|
+
* @throws {@link errors.SchedulinError}
|
|
146
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* await client.webhooks.listDeliveries({
|
|
150
|
+
* id: "id"
|
|
151
|
+
* })
|
|
152
|
+
*/
|
|
153
|
+
listDeliveries(request: Schedulin.ListDeliveriesWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
154
|
+
private __listDeliveries;
|
|
155
|
+
}
|
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
26
|
+
import * as environments from "../../../../environments.mjs";
|
|
27
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
28
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
29
|
+
import * as Schedulin from "../../../index.mjs";
|
|
30
|
+
export class WebhooksClient {
|
|
31
|
+
constructor(options) {
|
|
32
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* List the organization's webhook endpoints. Signing secrets are masked.
|
|
36
|
+
*
|
|
37
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
40
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
41
|
+
* @throws {@link errors.SchedulinError}
|
|
42
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await client.webhooks.list()
|
|
46
|
+
*/
|
|
47
|
+
list(requestOptions) {
|
|
48
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
49
|
+
}
|
|
50
|
+
__list(requestOptions) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
54
|
+
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);
|
|
55
|
+
const _response = yield core.fetcher({
|
|
56
|
+
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/webhooks"),
|
|
57
|
+
method: "GET",
|
|
58
|
+
headers: _headers,
|
|
59
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
60
|
+
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,
|
|
61
|
+
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,
|
|
62
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
63
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
64
|
+
logging: this._options.logging,
|
|
65
|
+
});
|
|
66
|
+
if (_response.ok) {
|
|
67
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
68
|
+
}
|
|
69
|
+
if (_response.error.reason === "status-code") {
|
|
70
|
+
switch (_response.error.statusCode) {
|
|
71
|
+
case 401:
|
|
72
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
73
|
+
case 500:
|
|
74
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
75
|
+
default:
|
|
76
|
+
throw new errors.SchedulinError({
|
|
77
|
+
statusCode: _response.error.statusCode,
|
|
78
|
+
body: _response.error.body,
|
|
79
|
+
rawResponse: _response.rawResponse,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/webhooks");
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Register an HTTPS endpoint for event deliveries. The response includes the signing secret ONCE — store it; later reads return a masked value.
|
|
88
|
+
*
|
|
89
|
+
* @param {Schedulin.CreateWebhooksRequest} request
|
|
90
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
93
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
94
|
+
* @throws {@link errors.SchedulinError}
|
|
95
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* await client.webhooks.create({
|
|
99
|
+
* url: "url",
|
|
100
|
+
* events: ["post.published"]
|
|
101
|
+
* })
|
|
102
|
+
*/
|
|
103
|
+
create(request, requestOptions) {
|
|
104
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
105
|
+
}
|
|
106
|
+
__create(request, requestOptions) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
109
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
110
|
+
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);
|
|
111
|
+
const _response = yield core.fetcher({
|
|
112
|
+
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/webhooks"),
|
|
113
|
+
method: "POST",
|
|
114
|
+
headers: _headers,
|
|
115
|
+
contentType: "application/json",
|
|
116
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
117
|
+
requestType: "json",
|
|
118
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
119
|
+
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
|
+
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
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
122
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
123
|
+
logging: this._options.logging,
|
|
124
|
+
});
|
|
125
|
+
if (_response.ok) {
|
|
126
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
127
|
+
}
|
|
128
|
+
if (_response.error.reason === "status-code") {
|
|
129
|
+
switch (_response.error.statusCode) {
|
|
130
|
+
case 401:
|
|
131
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
132
|
+
case 500:
|
|
133
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
134
|
+
default:
|
|
135
|
+
throw new errors.SchedulinError({
|
|
136
|
+
statusCode: _response.error.statusCode,
|
|
137
|
+
body: _response.error.body,
|
|
138
|
+
rawResponse: _response.rawResponse,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/webhooks");
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Retrieve one webhook endpoint, including failure counters. The signing secret is masked.
|
|
147
|
+
*
|
|
148
|
+
* @param {Schedulin.RetrieveWebhooksRequest} request
|
|
149
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
150
|
+
*
|
|
151
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
152
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
153
|
+
* @throws {@link errors.SchedulinError}
|
|
154
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* await client.webhooks.retrieve({
|
|
158
|
+
* id: "id"
|
|
159
|
+
* })
|
|
160
|
+
*/
|
|
161
|
+
retrieve(request, requestOptions) {
|
|
162
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieve(request, requestOptions));
|
|
163
|
+
}
|
|
164
|
+
__retrieve(request, requestOptions) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
167
|
+
const { id } = request;
|
|
168
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
169
|
+
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);
|
|
170
|
+
const _response = yield core.fetcher({
|
|
171
|
+
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/webhooks/${core.url.encodePathParam(id)}`),
|
|
172
|
+
method: "GET",
|
|
173
|
+
headers: _headers,
|
|
174
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
175
|
+
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,
|
|
176
|
+
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,
|
|
177
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
178
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
179
|
+
logging: this._options.logging,
|
|
180
|
+
});
|
|
181
|
+
if (_response.ok) {
|
|
182
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
183
|
+
}
|
|
184
|
+
if (_response.error.reason === "status-code") {
|
|
185
|
+
switch (_response.error.statusCode) {
|
|
186
|
+
case 401:
|
|
187
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
188
|
+
case 500:
|
|
189
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
190
|
+
default:
|
|
191
|
+
throw new errors.SchedulinError({
|
|
192
|
+
statusCode: _response.error.statusCode,
|
|
193
|
+
body: _response.error.body,
|
|
194
|
+
rawResponse: _response.rawResponse,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/webhooks/{id}");
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Delete a webhook endpoint and its delivery history. Deliveries already in flight are dropped.
|
|
203
|
+
*
|
|
204
|
+
* @param {Schedulin.DeleteWebhooksRequest} request
|
|
205
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
206
|
+
*
|
|
207
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
208
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
209
|
+
* @throws {@link errors.SchedulinError}
|
|
210
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* await client.webhooks.delete({
|
|
214
|
+
* id: "id"
|
|
215
|
+
* })
|
|
216
|
+
*/
|
|
217
|
+
delete(request, requestOptions) {
|
|
218
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
219
|
+
}
|
|
220
|
+
__delete(request, requestOptions) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
223
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
224
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
225
|
+
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);
|
|
226
|
+
const _response = yield core.fetcher({
|
|
227
|
+
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/webhooks/${core.url.encodePathParam(id)}`),
|
|
228
|
+
method: "DELETE",
|
|
229
|
+
headers: _headers,
|
|
230
|
+
contentType: "application/json",
|
|
231
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
232
|
+
requestType: "json",
|
|
233
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
234
|
+
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,
|
|
235
|
+
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,
|
|
236
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
237
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
238
|
+
logging: this._options.logging,
|
|
239
|
+
});
|
|
240
|
+
if (_response.ok) {
|
|
241
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
242
|
+
}
|
|
243
|
+
if (_response.error.reason === "status-code") {
|
|
244
|
+
switch (_response.error.statusCode) {
|
|
245
|
+
case 401:
|
|
246
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
247
|
+
case 500:
|
|
248
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
249
|
+
default:
|
|
250
|
+
throw new errors.SchedulinError({
|
|
251
|
+
statusCode: _response.error.statusCode,
|
|
252
|
+
body: _response.error.body,
|
|
253
|
+
rawResponse: _response.rawResponse,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/webhooks/{id}");
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Update URL, subscribed events, description, or enabled state. Re-enabling resets the failure streak.
|
|
262
|
+
*
|
|
263
|
+
* @param {Schedulin.UpdateWebhooksRequest} request
|
|
264
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
265
|
+
*
|
|
266
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
267
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
268
|
+
* @throws {@link errors.SchedulinError}
|
|
269
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* await client.webhooks.update({
|
|
273
|
+
* id: "id"
|
|
274
|
+
* })
|
|
275
|
+
*/
|
|
276
|
+
update(request, requestOptions) {
|
|
277
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
278
|
+
}
|
|
279
|
+
__update(request, requestOptions) {
|
|
280
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
282
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
283
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
284
|
+
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);
|
|
285
|
+
const _response = yield core.fetcher({
|
|
286
|
+
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/webhooks/${core.url.encodePathParam(id)}`),
|
|
287
|
+
method: "PATCH",
|
|
288
|
+
headers: _headers,
|
|
289
|
+
contentType: "application/json",
|
|
290
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
291
|
+
requestType: "json",
|
|
292
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
293
|
+
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,
|
|
294
|
+
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,
|
|
295
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
296
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
297
|
+
logging: this._options.logging,
|
|
298
|
+
});
|
|
299
|
+
if (_response.ok) {
|
|
300
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
301
|
+
}
|
|
302
|
+
if (_response.error.reason === "status-code") {
|
|
303
|
+
switch (_response.error.statusCode) {
|
|
304
|
+
case 401:
|
|
305
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
306
|
+
case 500:
|
|
307
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
308
|
+
default:
|
|
309
|
+
throw new errors.SchedulinError({
|
|
310
|
+
statusCode: _response.error.statusCode,
|
|
311
|
+
body: _response.error.body,
|
|
312
|
+
rawResponse: _response.rawResponse,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/webhooks/{id}");
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Generate a new signing secret for the endpoint and return it ONCE. The old secret stops signing immediately.
|
|
321
|
+
*
|
|
322
|
+
* @param {Schedulin.RotateSecretWebhooksRequest} request
|
|
323
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
324
|
+
*
|
|
325
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
326
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
327
|
+
* @throws {@link errors.SchedulinError}
|
|
328
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* await client.webhooks.rotateSecret({
|
|
332
|
+
* id: "id"
|
|
333
|
+
* })
|
|
334
|
+
*/
|
|
335
|
+
rotateSecret(request, requestOptions) {
|
|
336
|
+
return core.HttpResponsePromise.fromPromise(this.__rotateSecret(request, requestOptions));
|
|
337
|
+
}
|
|
338
|
+
__rotateSecret(request, requestOptions) {
|
|
339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
340
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
341
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
342
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
343
|
+
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);
|
|
344
|
+
const _response = yield core.fetcher({
|
|
345
|
+
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/webhooks/${core.url.encodePathParam(id)}/rotate-secret`),
|
|
346
|
+
method: "POST",
|
|
347
|
+
headers: _headers,
|
|
348
|
+
contentType: "application/json",
|
|
349
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
350
|
+
requestType: "json",
|
|
351
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
352
|
+
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,
|
|
353
|
+
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,
|
|
354
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
355
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
356
|
+
logging: this._options.logging,
|
|
357
|
+
});
|
|
358
|
+
if (_response.ok) {
|
|
359
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
360
|
+
}
|
|
361
|
+
if (_response.error.reason === "status-code") {
|
|
362
|
+
switch (_response.error.statusCode) {
|
|
363
|
+
case 401:
|
|
364
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
365
|
+
case 500:
|
|
366
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
367
|
+
default:
|
|
368
|
+
throw new errors.SchedulinError({
|
|
369
|
+
statusCode: _response.error.statusCode,
|
|
370
|
+
body: _response.error.body,
|
|
371
|
+
rawResponse: _response.rawResponse,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/webhooks/{id}/rotate-secret");
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Send a signed `ping` event to the endpoint URL and record it in the delivery history.
|
|
380
|
+
*
|
|
381
|
+
* @param {Schedulin.TestWebhooksRequest} request
|
|
382
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
383
|
+
*
|
|
384
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
385
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
386
|
+
* @throws {@link errors.SchedulinError}
|
|
387
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* await client.webhooks.test({
|
|
391
|
+
* id: "id"
|
|
392
|
+
* })
|
|
393
|
+
*/
|
|
394
|
+
test(request, requestOptions) {
|
|
395
|
+
return core.HttpResponsePromise.fromPromise(this.__test(request, requestOptions));
|
|
396
|
+
}
|
|
397
|
+
__test(request, requestOptions) {
|
|
398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
400
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
401
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
402
|
+
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);
|
|
403
|
+
const _response = yield core.fetcher({
|
|
404
|
+
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/webhooks/${core.url.encodePathParam(id)}/test`),
|
|
405
|
+
method: "POST",
|
|
406
|
+
headers: _headers,
|
|
407
|
+
contentType: "application/json",
|
|
408
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
409
|
+
requestType: "json",
|
|
410
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
411
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
412
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
413
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
414
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
415
|
+
logging: this._options.logging,
|
|
416
|
+
});
|
|
417
|
+
if (_response.ok) {
|
|
418
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
419
|
+
}
|
|
420
|
+
if (_response.error.reason === "status-code") {
|
|
421
|
+
switch (_response.error.statusCode) {
|
|
422
|
+
case 401:
|
|
423
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
424
|
+
case 500:
|
|
425
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
426
|
+
default:
|
|
427
|
+
throw new errors.SchedulinError({
|
|
428
|
+
statusCode: _response.error.statusCode,
|
|
429
|
+
body: _response.error.body,
|
|
430
|
+
rawResponse: _response.rawResponse,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/webhooks/{id}/test");
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Delivery history for a webhook endpoint: event, status, attempts, last response code, and payload.
|
|
439
|
+
*
|
|
440
|
+
* @param {Schedulin.ListDeliveriesWebhooksRequest} request
|
|
441
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
442
|
+
*
|
|
443
|
+
* @throws {@link Schedulin.UnauthorizedError}
|
|
444
|
+
* @throws {@link Schedulin.InternalServerError}
|
|
445
|
+
* @throws {@link errors.SchedulinError}
|
|
446
|
+
* @throws {@link errors.SchedulinTimeoutError}
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* await client.webhooks.listDeliveries({
|
|
450
|
+
* id: "id"
|
|
451
|
+
* })
|
|
452
|
+
*/
|
|
453
|
+
listDeliveries(request, requestOptions) {
|
|
454
|
+
return core.HttpResponsePromise.fromPromise(this.__listDeliveries(request, requestOptions));
|
|
455
|
+
}
|
|
456
|
+
__listDeliveries(request, requestOptions) {
|
|
457
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
458
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
459
|
+
const { id, limit, page } = request;
|
|
460
|
+
const _queryParams = {
|
|
461
|
+
limit,
|
|
462
|
+
page,
|
|
463
|
+
};
|
|
464
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
465
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
466
|
+
const _response = yield core.fetcher({
|
|
467
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchedulinEnvironment.Default, `v0/webhooks/${core.url.encodePathParam(id)}/deliveries`),
|
|
468
|
+
method: "GET",
|
|
469
|
+
headers: _headers,
|
|
470
|
+
queryString: core.url
|
|
471
|
+
.queryBuilder()
|
|
472
|
+
.addMany(_queryParams)
|
|
473
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
474
|
+
.build(),
|
|
475
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
476
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
477
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
478
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
479
|
+
logging: this._options.logging,
|
|
480
|
+
});
|
|
481
|
+
if (_response.ok) {
|
|
482
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
483
|
+
}
|
|
484
|
+
if (_response.error.reason === "status-code") {
|
|
485
|
+
switch (_response.error.statusCode) {
|
|
486
|
+
case 401:
|
|
487
|
+
throw new Schedulin.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
488
|
+
case 500:
|
|
489
|
+
throw new Schedulin.InternalServerError(_response.error.body, _response.rawResponse);
|
|
490
|
+
default:
|
|
491
|
+
throw new errors.SchedulinError({
|
|
492
|
+
statusCode: _response.error.statusCode,
|
|
493
|
+
body: _response.error.body,
|
|
494
|
+
rawResponse: _response.rawResponse,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/webhooks/{id}/deliveries");
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|