@schedulin/sdk 0.1.1 → 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 +85 -2
- package/cjs/api/resources/media/client/Client.js +263 -6
- package/cjs/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.ts +12 -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/ListMediaRequest.d.ts +1 -1
- 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/media/types/ListMediaResponse.d.ts +7 -0
- package/cjs/api/resources/media/types/ListMediaResponse.js +3 -0
- package/cjs/api/resources/media/types/index.d.ts +1 -1
- package/cjs/api/resources/media/types/index.js +1 -1
- 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/MediaSearch.d.ts +1 -5
- 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 +85 -2
- package/esm/api/resources/media/client/Client.mjs +264 -7
- package/esm/api/resources/media/client/requests/CreateFromUrlMediaRequest.d.mts +12 -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/ListMediaRequest.d.mts +1 -1
- 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/media/types/ListMediaResponse.d.mts +7 -0
- package/esm/api/resources/media/types/ListMediaResponse.mjs +2 -0
- package/esm/api/resources/media/types/index.d.mts +1 -1
- package/esm/api/resources/media/types/index.mjs +1 -1
- 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/MediaSearch.d.mts +1 -5
- 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/media/types/ListMediaRequestCursor.d.ts +0 -4
- package/esm/api/resources/media/types/ListMediaRequestCursor.d.mts +0 -4
- /package/cjs/api/resources/{media/types/ListMediaRequestCursor.js → ai/client/requests/GetGenerationAiRequest.js} +0 -0
- /package/cjs/api/resources/{posts/client/requests/GetJobStatusPostsRequest.js → media/client/requests/CreateFromUrlMediaRequest.js} +0 -0
- /package/esm/api/resources/{media/types/ListMediaRequestCursor.mjs → ai/client/requests/GetGenerationAiRequest.mjs} +0 -0
- /package/esm/api/resources/{posts/client/requests/GetJobStatusPostsRequest.mjs → media/client/requests/CreateFromUrlMediaRequest.mjs} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* url: "url",
|
|
5
|
+
* events: ["post.published"]
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateWebhooksRequest {
|
|
9
|
+
url: string;
|
|
10
|
+
events: CreateWebhooksRequest.Events.Item[];
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace CreateWebhooksRequest {
|
|
14
|
+
type Events = Events.Item[];
|
|
15
|
+
namespace Events {
|
|
16
|
+
const Item: {
|
|
17
|
+
readonly PostPublished: "post.published";
|
|
18
|
+
readonly PostFailed: "post.failed";
|
|
19
|
+
readonly GenerationCompleted: "generation.completed";
|
|
20
|
+
readonly GenerationFailed: "generation.failed";
|
|
21
|
+
};
|
|
22
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CreateWebhooksRequest;
|
|
3
|
+
(function (CreateWebhooksRequest) {
|
|
4
|
+
let Events;
|
|
5
|
+
(function (Events) {
|
|
6
|
+
Events.Item = {
|
|
7
|
+
PostPublished: "post.published",
|
|
8
|
+
PostFailed: "post.failed",
|
|
9
|
+
GenerationCompleted: "generation.completed",
|
|
10
|
+
GenerationFailed: "generation.failed",
|
|
11
|
+
};
|
|
12
|
+
})(Events = CreateWebhooksRequest.Events || (CreateWebhooksRequest.Events = {}));
|
|
13
|
+
})(CreateWebhooksRequest || (CreateWebhooksRequest = {}));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "id"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface UpdateWebhooksRequest {
|
|
8
|
+
id: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
events?: UpdateWebhooksRequest.Events.Item[];
|
|
11
|
+
description?: string | null;
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace UpdateWebhooksRequest {
|
|
15
|
+
type Events = Events.Item[];
|
|
16
|
+
namespace Events {
|
|
17
|
+
const Item: {
|
|
18
|
+
readonly PostPublished: "post.published";
|
|
19
|
+
readonly PostFailed: "post.failed";
|
|
20
|
+
readonly GenerationCompleted: "generation.completed";
|
|
21
|
+
readonly GenerationFailed: "generation.failed";
|
|
22
|
+
};
|
|
23
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var UpdateWebhooksRequest;
|
|
3
|
+
(function (UpdateWebhooksRequest) {
|
|
4
|
+
let Events;
|
|
5
|
+
(function (Events) {
|
|
6
|
+
Events.Item = {
|
|
7
|
+
PostPublished: "post.published",
|
|
8
|
+
PostFailed: "post.failed",
|
|
9
|
+
GenerationCompleted: "generation.completed",
|
|
10
|
+
GenerationFailed: "generation.failed",
|
|
11
|
+
};
|
|
12
|
+
})(Events = UpdateWebhooksRequest.Events || (UpdateWebhooksRequest.Events = {}));
|
|
13
|
+
})(UpdateWebhooksRequest || (UpdateWebhooksRequest = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CreateWebhooksRequest } from "./CreateWebhooksRequest.mjs";
|
|
2
|
+
export type { DeleteWebhooksRequest } from "./DeleteWebhooksRequest.mjs";
|
|
3
|
+
export type { ListDeliveriesWebhooksRequest } from "./ListDeliveriesWebhooksRequest.mjs";
|
|
4
|
+
export type { RetrieveWebhooksRequest } from "./RetrieveWebhooksRequest.mjs";
|
|
5
|
+
export type { RotateSecretWebhooksRequest } from "./RotateSecretWebhooksRequest.mjs";
|
|
6
|
+
export type { TestWebhooksRequest } from "./TestWebhooksRequest.mjs";
|
|
7
|
+
export { UpdateWebhooksRequest } from "./UpdateWebhooksRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface MediaSearch {
|
|
2
|
-
|
|
2
|
+
page?: number | undefined;
|
|
3
3
|
limit?: number | undefined;
|
|
4
4
|
q?: string | undefined;
|
|
5
5
|
type?: MediaSearch.Type | undefined;
|
|
@@ -7,10 +7,6 @@ export interface MediaSearch {
|
|
|
7
7
|
tagMode?: MediaSearch.TagMode | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare namespace MediaSearch {
|
|
10
|
-
interface Cursor {
|
|
11
|
-
id: string;
|
|
12
|
-
updatedAt: string;
|
|
13
|
-
}
|
|
14
10
|
const Type: {
|
|
15
11
|
readonly Image: "image";
|
|
16
12
|
readonly Video: "video";
|
|
@@ -32,5 +32,17 @@ export declare const OauthScope: {
|
|
|
32
32
|
/**
|
|
33
33
|
* View organization details */
|
|
34
34
|
readonly OrgRead: "org:read";
|
|
35
|
+
/**
|
|
36
|
+
* View AI generation jobs and available voices */
|
|
37
|
+
readonly AiRead: "ai:read";
|
|
38
|
+
/**
|
|
39
|
+
* Generate AI images and videos (spends AI credits) */
|
|
40
|
+
readonly AiWrite: "ai:write";
|
|
41
|
+
/**
|
|
42
|
+
* View webhook endpoints and delivery history */
|
|
43
|
+
readonly WebhooksRead: "webhooks:read";
|
|
44
|
+
/**
|
|
45
|
+
* Create, edit, and delete webhook endpoints */
|
|
46
|
+
readonly WebhooksWrite: "webhooks:write";
|
|
35
47
|
};
|
|
36
48
|
export type OauthScope = (typeof OauthScope)[keyof typeof OauthScope];
|
|
@@ -33,4 +33,16 @@ export const OauthScope = {
|
|
|
33
33
|
/**
|
|
34
34
|
* View organization details */
|
|
35
35
|
OrgRead: "org:read",
|
|
36
|
+
/**
|
|
37
|
+
* View AI generation jobs and available voices */
|
|
38
|
+
AiRead: "ai:read",
|
|
39
|
+
/**
|
|
40
|
+
* Generate AI images and videos (spends AI credits) */
|
|
41
|
+
AiWrite: "ai:write",
|
|
42
|
+
/**
|
|
43
|
+
* View webhook endpoints and delivery history */
|
|
44
|
+
WebhooksRead: "webhooks:read",
|
|
45
|
+
/**
|
|
46
|
+
* Create, edit, and delete webhook endpoints */
|
|
47
|
+
WebhooksWrite: "webhooks:write",
|
|
36
48
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface PostSearch {
|
|
2
2
|
page?: number | undefined;
|
|
3
3
|
status?: PostSearch.Status | undefined;
|
|
4
|
+
statuses?: PostSearch.Statuses.Item[] | undefined;
|
|
4
5
|
approvalStatus?: PostSearch.ApprovalStatus | undefined;
|
|
5
6
|
scheduledAt?: PostSearch.ScheduledAt | undefined;
|
|
6
7
|
tagIds?: string[] | undefined;
|
|
@@ -17,6 +18,17 @@ export declare namespace PostSearch {
|
|
|
17
18
|
readonly Failed: "FAILED";
|
|
18
19
|
};
|
|
19
20
|
type Status = (typeof Status)[keyof typeof Status];
|
|
21
|
+
type Statuses = Statuses.Item[];
|
|
22
|
+
namespace Statuses {
|
|
23
|
+
const Item: {
|
|
24
|
+
readonly Scheduled: "SCHEDULED";
|
|
25
|
+
readonly Processing: "PROCESSING";
|
|
26
|
+
readonly Completed: "COMPLETED";
|
|
27
|
+
readonly Draft: "DRAFT";
|
|
28
|
+
readonly Failed: "FAILED";
|
|
29
|
+
};
|
|
30
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
31
|
+
}
|
|
20
32
|
const ApprovalStatus: {
|
|
21
33
|
readonly Draft: "DRAFT";
|
|
22
34
|
readonly PendingApproval: "PENDING_APPROVAL";
|
|
@@ -8,6 +8,16 @@ export var PostSearch;
|
|
|
8
8
|
Draft: "DRAFT",
|
|
9
9
|
Failed: "FAILED",
|
|
10
10
|
};
|
|
11
|
+
let Statuses;
|
|
12
|
+
(function (Statuses) {
|
|
13
|
+
Statuses.Item = {
|
|
14
|
+
Scheduled: "SCHEDULED",
|
|
15
|
+
Processing: "PROCESSING",
|
|
16
|
+
Completed: "COMPLETED",
|
|
17
|
+
Draft: "DRAFT",
|
|
18
|
+
Failed: "FAILED",
|
|
19
|
+
};
|
|
20
|
+
})(Statuses = PostSearch.Statuses || (PostSearch.Statuses = {}));
|
|
11
21
|
PostSearch.ApprovalStatus = {
|
|
12
22
|
Draft: "DRAFT",
|
|
13
23
|
PendingApproval: "PENDING_APPROVAL",
|
|
@@ -55,10 +55,31 @@ export declare namespace PostWithRelations {
|
|
|
55
55
|
readonly Linkedin: "linkedin";
|
|
56
56
|
readonly Pinterest: "pinterest";
|
|
57
57
|
readonly Reddit: "reddit";
|
|
58
|
+
readonly Snapchat: "snapchat";
|
|
58
59
|
readonly Threads: "threads";
|
|
59
60
|
readonly Tiktok: "tiktok";
|
|
60
61
|
readonly Twitter: "twitter";
|
|
61
62
|
readonly Youtube: "youtube";
|
|
63
|
+
readonly Mastodon: "mastodon";
|
|
64
|
+
readonly Telegram: "telegram";
|
|
65
|
+
readonly Devto: "devto";
|
|
66
|
+
readonly Hashnode: "hashnode";
|
|
67
|
+
readonly Medium: "medium";
|
|
68
|
+
readonly Wordpress: "wordpress";
|
|
69
|
+
readonly Lemmy: "lemmy";
|
|
70
|
+
readonly Nostr: "nostr";
|
|
71
|
+
readonly Discord: "discord";
|
|
72
|
+
readonly Dribbble: "dribbble";
|
|
73
|
+
readonly Farcaster: "farcaster";
|
|
74
|
+
readonly Kick: "kick";
|
|
75
|
+
readonly Listmonk: "listmonk";
|
|
76
|
+
readonly Mewe: "mewe";
|
|
77
|
+
readonly Moltbook: "moltbook";
|
|
78
|
+
readonly Skool: "skool";
|
|
79
|
+
readonly Slack: "slack";
|
|
80
|
+
readonly Twitch: "twitch";
|
|
81
|
+
readonly Vk: "vk";
|
|
82
|
+
readonly Whop: "whop";
|
|
62
83
|
};
|
|
63
84
|
type Platform = (typeof Platform)[keyof typeof Platform];
|
|
64
85
|
}
|
|
@@ -21,10 +21,31 @@ export var PostWithRelations;
|
|
|
21
21
|
Linkedin: "linkedin",
|
|
22
22
|
Pinterest: "pinterest",
|
|
23
23
|
Reddit: "reddit",
|
|
24
|
+
Snapchat: "snapchat",
|
|
24
25
|
Threads: "threads",
|
|
25
26
|
Tiktok: "tiktok",
|
|
26
27
|
Twitter: "twitter",
|
|
27
28
|
Youtube: "youtube",
|
|
29
|
+
Mastodon: "mastodon",
|
|
30
|
+
Telegram: "telegram",
|
|
31
|
+
Devto: "devto",
|
|
32
|
+
Hashnode: "hashnode",
|
|
33
|
+
Medium: "medium",
|
|
34
|
+
Wordpress: "wordpress",
|
|
35
|
+
Lemmy: "lemmy",
|
|
36
|
+
Nostr: "nostr",
|
|
37
|
+
Discord: "discord",
|
|
38
|
+
Dribbble: "dribbble",
|
|
39
|
+
Farcaster: "farcaster",
|
|
40
|
+
Kick: "kick",
|
|
41
|
+
Listmonk: "listmonk",
|
|
42
|
+
Mewe: "mewe",
|
|
43
|
+
Moltbook: "moltbook",
|
|
44
|
+
Skool: "skool",
|
|
45
|
+
Slack: "slack",
|
|
46
|
+
Twitch: "twitch",
|
|
47
|
+
Vk: "vk",
|
|
48
|
+
Whop: "whop",
|
|
28
49
|
};
|
|
29
50
|
})(Item = Tags.Item || (Tags.Item = {}));
|
|
30
51
|
})(Tags = Item_1.Tags || (Item_1.Tags = {}));
|
|
@@ -5,5 +5,6 @@ export declare const SocialAccountDisconnectedReason: {
|
|
|
5
5
|
readonly RefreshFailed: "REFRESH_FAILED";
|
|
6
6
|
readonly AccountSuspended: "ACCOUNT_SUSPENDED";
|
|
7
7
|
readonly PermissionDenied: "PERMISSION_DENIED";
|
|
8
|
+
readonly EmailUnconfirmed: "EMAIL_UNCONFIRMED";
|
|
8
9
|
};
|
|
9
10
|
export type SocialAccountDisconnectedReason = (typeof SocialAccountDisconnectedReason)[keyof typeof SocialAccountDisconnectedReason];
|
|
@@ -6,9 +6,30 @@ export declare const SocialPlatform: {
|
|
|
6
6
|
readonly Linkedin: "linkedin";
|
|
7
7
|
readonly Pinterest: "pinterest";
|
|
8
8
|
readonly Reddit: "reddit";
|
|
9
|
+
readonly Snapchat: "snapchat";
|
|
9
10
|
readonly Threads: "threads";
|
|
10
11
|
readonly Tiktok: "tiktok";
|
|
11
12
|
readonly Twitter: "twitter";
|
|
12
13
|
readonly Youtube: "youtube";
|
|
14
|
+
readonly Mastodon: "mastodon";
|
|
15
|
+
readonly Telegram: "telegram";
|
|
16
|
+
readonly Devto: "devto";
|
|
17
|
+
readonly Hashnode: "hashnode";
|
|
18
|
+
readonly Medium: "medium";
|
|
19
|
+
readonly Wordpress: "wordpress";
|
|
20
|
+
readonly Lemmy: "lemmy";
|
|
21
|
+
readonly Nostr: "nostr";
|
|
22
|
+
readonly Discord: "discord";
|
|
23
|
+
readonly Dribbble: "dribbble";
|
|
24
|
+
readonly Farcaster: "farcaster";
|
|
25
|
+
readonly Kick: "kick";
|
|
26
|
+
readonly Listmonk: "listmonk";
|
|
27
|
+
readonly Mewe: "mewe";
|
|
28
|
+
readonly Moltbook: "moltbook";
|
|
29
|
+
readonly Skool: "skool";
|
|
30
|
+
readonly Slack: "slack";
|
|
31
|
+
readonly Twitch: "twitch";
|
|
32
|
+
readonly Vk: "vk";
|
|
33
|
+
readonly Whop: "whop";
|
|
13
34
|
};
|
|
14
35
|
export type SocialPlatform = (typeof SocialPlatform)[keyof typeof SocialPlatform];
|
|
@@ -7,8 +7,29 @@ export const SocialPlatform = {
|
|
|
7
7
|
Linkedin: "linkedin",
|
|
8
8
|
Pinterest: "pinterest",
|
|
9
9
|
Reddit: "reddit",
|
|
10
|
+
Snapchat: "snapchat",
|
|
10
11
|
Threads: "threads",
|
|
11
12
|
Tiktok: "tiktok",
|
|
12
13
|
Twitter: "twitter",
|
|
13
14
|
Youtube: "youtube",
|
|
15
|
+
Mastodon: "mastodon",
|
|
16
|
+
Telegram: "telegram",
|
|
17
|
+
Devto: "devto",
|
|
18
|
+
Hashnode: "hashnode",
|
|
19
|
+
Medium: "medium",
|
|
20
|
+
Wordpress: "wordpress",
|
|
21
|
+
Lemmy: "lemmy",
|
|
22
|
+
Nostr: "nostr",
|
|
23
|
+
Discord: "discord",
|
|
24
|
+
Dribbble: "dribbble",
|
|
25
|
+
Farcaster: "farcaster",
|
|
26
|
+
Kick: "kick",
|
|
27
|
+
Listmonk: "listmonk",
|
|
28
|
+
Mewe: "mewe",
|
|
29
|
+
Moltbook: "moltbook",
|
|
30
|
+
Skool: "skool",
|
|
31
|
+
Slack: "slack",
|
|
32
|
+
Twitch: "twitch",
|
|
33
|
+
Vk: "vk",
|
|
34
|
+
Whop: "whop",
|
|
14
35
|
};
|
package/esm/core/exports.d.mts
CHANGED
package/esm/core/exports.mjs
CHANGED
|
@@ -18,6 +18,7 @@ import { getResponseBody } from "./getResponseBody.mjs";
|
|
|
18
18
|
import { Headers } from "./Headers.mjs";
|
|
19
19
|
import { makeRequest } from "./makeRequest.mjs";
|
|
20
20
|
import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
21
|
+
import { redactUrl, SENSITIVE_QUERY_PARAMS } from "./redactUrl.mjs";
|
|
21
22
|
import { requestWithRetries } from "./requestWithRetries.mjs";
|
|
22
23
|
const SENSITIVE_HEADERS = new Set([
|
|
23
24
|
"authorization",
|
|
@@ -49,26 +50,6 @@ function redactHeaders(headers) {
|
|
|
49
50
|
}
|
|
50
51
|
return filtered;
|
|
51
52
|
}
|
|
52
|
-
const SENSITIVE_QUERY_PARAMS = new Set([
|
|
53
|
-
"api_key",
|
|
54
|
-
"api-key",
|
|
55
|
-
"apikey",
|
|
56
|
-
"token",
|
|
57
|
-
"access_token",
|
|
58
|
-
"access-token",
|
|
59
|
-
"auth_token",
|
|
60
|
-
"auth-token",
|
|
61
|
-
"password",
|
|
62
|
-
"passwd",
|
|
63
|
-
"secret",
|
|
64
|
-
"api_secret",
|
|
65
|
-
"api-secret",
|
|
66
|
-
"apisecret",
|
|
67
|
-
"key",
|
|
68
|
-
"session",
|
|
69
|
-
"session_id",
|
|
70
|
-
"session-id",
|
|
71
|
-
]);
|
|
72
53
|
function redactQueryParameters(queryParameters) {
|
|
73
54
|
if (queryParameters == null) {
|
|
74
55
|
return undefined;
|
|
@@ -79,70 +60,6 @@ function redactQueryParameters(queryParameters) {
|
|
|
79
60
|
}
|
|
80
61
|
return redacted;
|
|
81
62
|
}
|
|
82
|
-
function redactUrl(url) {
|
|
83
|
-
const protocolIndex = url.indexOf("://");
|
|
84
|
-
if (protocolIndex === -1)
|
|
85
|
-
return url;
|
|
86
|
-
const afterProtocol = protocolIndex + 3;
|
|
87
|
-
// Find the first delimiter that marks the end of the authority section
|
|
88
|
-
const pathStart = url.indexOf("/", afterProtocol);
|
|
89
|
-
let queryStart = url.indexOf("?", afterProtocol);
|
|
90
|
-
let fragmentStart = url.indexOf("#", afterProtocol);
|
|
91
|
-
const firstDelimiter = Math.min(pathStart === -1 ? url.length : pathStart, queryStart === -1 ? url.length : queryStart, fragmentStart === -1 ? url.length : fragmentStart);
|
|
92
|
-
// Find the LAST @ before the delimiter (handles multiple @ in credentials)
|
|
93
|
-
let atIndex = -1;
|
|
94
|
-
for (let i = afterProtocol; i < firstDelimiter; i++) {
|
|
95
|
-
if (url[i] === "@") {
|
|
96
|
-
atIndex = i;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (atIndex !== -1) {
|
|
100
|
-
url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`;
|
|
101
|
-
}
|
|
102
|
-
// Recalculate queryStart since url might have changed
|
|
103
|
-
queryStart = url.indexOf("?");
|
|
104
|
-
if (queryStart === -1)
|
|
105
|
-
return url;
|
|
106
|
-
fragmentStart = url.indexOf("#", queryStart);
|
|
107
|
-
const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length;
|
|
108
|
-
const queryString = url.slice(queryStart + 1, queryEnd);
|
|
109
|
-
if (queryString.length === 0)
|
|
110
|
-
return url;
|
|
111
|
-
// FAST PATH: Quick check if any sensitive keywords present
|
|
112
|
-
// Using indexOf is faster than regex for simple substring matching
|
|
113
|
-
const lower = queryString.toLowerCase();
|
|
114
|
-
const hasSensitive = lower.includes("token") ||
|
|
115
|
-
lower.includes("key") ||
|
|
116
|
-
lower.includes("password") ||
|
|
117
|
-
lower.includes("passwd") ||
|
|
118
|
-
lower.includes("secret") ||
|
|
119
|
-
lower.includes("session") ||
|
|
120
|
-
lower.includes("auth");
|
|
121
|
-
if (!hasSensitive) {
|
|
122
|
-
return url;
|
|
123
|
-
}
|
|
124
|
-
// SLOW PATH: Parse and redact
|
|
125
|
-
const redactedParams = [];
|
|
126
|
-
const params = queryString.split("&");
|
|
127
|
-
for (const param of params) {
|
|
128
|
-
const equalIndex = param.indexOf("=");
|
|
129
|
-
if (equalIndex === -1) {
|
|
130
|
-
redactedParams.push(param);
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
const key = param.slice(0, equalIndex);
|
|
134
|
-
let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase());
|
|
135
|
-
if (!shouldRedact && key.includes("%")) {
|
|
136
|
-
try {
|
|
137
|
-
const decodedKey = decodeURIComponent(key);
|
|
138
|
-
shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase());
|
|
139
|
-
}
|
|
140
|
-
catch (_a) { }
|
|
141
|
-
}
|
|
142
|
-
redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param);
|
|
143
|
-
}
|
|
144
|
-
return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd);
|
|
145
|
-
}
|
|
146
63
|
function getHeaders(args) {
|
|
147
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
65
|
var _a;
|
|
@@ -12,6 +12,7 @@ import { join } from "../url/join.mjs";
|
|
|
12
12
|
import { EndpointSupplier } from "./EndpointSupplier.mjs";
|
|
13
13
|
import { getFetchFn } from "./getFetchFn.mjs";
|
|
14
14
|
import { makeRequest } from "./makeRequest.mjs";
|
|
15
|
+
import { redactUrl } from "./redactUrl.mjs";
|
|
15
16
|
import { requestWithRetries } from "./requestWithRetries.mjs";
|
|
16
17
|
import { Supplier } from "./Supplier.mjs";
|
|
17
18
|
/**
|
|
@@ -76,8 +77,10 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
// Apply auth headers
|
|
80
|
-
|
|
80
|
+
// Apply auth headers, but only when the resolved URL targets the configured base URL.
|
|
81
|
+
// This prevents the SDK's credentials from leaking to an unrelated host when a caller
|
|
82
|
+
// passes an absolute cross-origin URL into the passthrough fetch escape hatch.
|
|
83
|
+
if (clientOptions.getAuthHeaders != null && targetsBaseUrl(fullUrl, baseUrl)) {
|
|
81
84
|
const authHeaders = yield clientOptions.getAuthHeaders();
|
|
82
85
|
for (const [key, value] of Object.entries(authHeaders)) {
|
|
83
86
|
mergedHeaders[key.toLowerCase()] = value;
|
|
@@ -112,7 +115,7 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
|
|
|
112
115
|
if (logger.isDebug()) {
|
|
113
116
|
logger.debug("Making passthrough HTTP request", {
|
|
114
117
|
method,
|
|
115
|
-
url: fullUrl,
|
|
118
|
+
url: redactUrl(fullUrl),
|
|
116
119
|
hasBody: body != null,
|
|
117
120
|
});
|
|
118
121
|
}
|
|
@@ -123,10 +126,29 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
|
|
|
123
126
|
if (logger.isDebug()) {
|
|
124
127
|
logger.debug("Passthrough HTTP request completed", {
|
|
125
128
|
method,
|
|
126
|
-
url: fullUrl,
|
|
129
|
+
url: redactUrl(fullUrl),
|
|
127
130
|
statusCode: response.status,
|
|
128
131
|
});
|
|
129
132
|
}
|
|
130
133
|
return response;
|
|
131
134
|
});
|
|
132
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns true when the resolved request URL points at the same origin as the
|
|
138
|
+
* configured base URL. Relative paths are always joined onto the base URL, so
|
|
139
|
+
* they resolve to the base origin and return true. Absolute URLs only match when
|
|
140
|
+
* their origin equals the base origin. When there is no base URL to compare
|
|
141
|
+
* against, or either value is not a parseable absolute URL, this returns false so
|
|
142
|
+
* auth headers are not attached.
|
|
143
|
+
*/
|
|
144
|
+
function targetsBaseUrl(fullUrl, baseUrl) {
|
|
145
|
+
if (baseUrl == null) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
return new URL(fullUrl).origin === new URL(baseUrl).origin;
|
|
150
|
+
}
|
|
151
|
+
catch (_a) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|