@woopsocial/typescript-sdk 0.0.7
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/FUNCTIONS.md +87 -0
- package/README.md +474 -0
- package/RUNTIMES.md +48 -0
- package/esm/core.d.ts +10 -0
- package/esm/core.d.ts.map +1 -0
- package/esm/core.js +13 -0
- package/esm/core.js.map +1 -0
- package/esm/funcs/health-get-health.d.ts +17 -0
- package/esm/funcs/health-get-health.d.ts.map +1 -0
- package/esm/funcs/health-get-health.js +68 -0
- package/esm/funcs/health-get-health.js.map +1 -0
- package/esm/funcs/media-complete-upload-session.d.ts +15 -0
- package/esm/funcs/media-complete-upload-session.d.ts.map +1 -0
- package/esm/funcs/media-complete-upload-session.js +82 -0
- package/esm/funcs/media-complete-upload-session.js.map +1 -0
- package/esm/funcs/media-create-media.d.ts +25 -0
- package/esm/funcs/media-create-media.d.ts.map +1 -0
- package/esm/funcs/media-create-media.js +93 -0
- package/esm/funcs/media-create-media.js.map +1 -0
- package/esm/funcs/media-create-upload-session.d.ts +27 -0
- package/esm/funcs/media-create-upload-session.d.ts.map +1 -0
- package/esm/funcs/media-create-upload-session.js +89 -0
- package/esm/funcs/media-create-upload-session.js.map +1 -0
- package/esm/funcs/media-get-upload-session.d.ts +15 -0
- package/esm/funcs/media-get-upload-session.d.ts.map +1 -0
- package/esm/funcs/media-get-upload-session.js +82 -0
- package/esm/funcs/media-get-upload-session.js.map +1 -0
- package/esm/funcs/posts-create-posts.d.ts +23 -0
- package/esm/funcs/posts-create-posts.d.ts.map +1 -0
- package/esm/funcs/posts-create-posts.js +85 -0
- package/esm/funcs/posts-create-posts.js.map +1 -0
- package/esm/funcs/posts-delete-posts.d.ts +21 -0
- package/esm/funcs/posts-delete-posts.d.ts.map +1 -0
- package/esm/funcs/posts-delete-posts.js +83 -0
- package/esm/funcs/posts-delete-posts.js.map +1 -0
- package/esm/funcs/posts-list-posts.d.ts +17 -0
- package/esm/funcs/posts-list-posts.d.ts.map +1 -0
- package/esm/funcs/posts-list-posts.js +81 -0
- package/esm/funcs/posts-list-posts.js.map +1 -0
- package/esm/funcs/posts-update-posts.d.ts +21 -0
- package/esm/funcs/posts-update-posts.d.ts.map +1 -0
- package/esm/funcs/posts-update-posts.js +83 -0
- package/esm/funcs/posts-update-posts.js.map +1 -0
- package/esm/funcs/projects-list-projects.d.ts +17 -0
- package/esm/funcs/projects-list-projects.d.ts.map +1 -0
- package/esm/funcs/projects-list-projects.js +69 -0
- package/esm/funcs/projects-list-projects.js.map +1 -0
- package/esm/funcs/social-accounts-create-o-auth-authorization.d.ts +17 -0
- package/esm/funcs/social-accounts-create-o-auth-authorization.d.ts.map +1 -0
- package/esm/funcs/social-accounts-create-o-auth-authorization.js +79 -0
- package/esm/funcs/social-accounts-create-o-auth-authorization.js.map +1 -0
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.d.ts +20 -0
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.d.ts.map +1 -0
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.js +87 -0
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.js.map +1 -0
- package/esm/funcs/social-accounts-list-social-accounts.d.ts +20 -0
- package/esm/funcs/social-accounts-list-social-accounts.d.ts.map +1 -0
- package/esm/funcs/social-accounts-list-social-accounts.js +85 -0
- package/esm/funcs/social-accounts-list-social-accounts.js.map +1 -0
- package/esm/hooks/hooks.d.ts +25 -0
- package/esm/hooks/hooks.d.ts.map +1 -0
- package/esm/hooks/hooks.js +80 -0
- package/esm/hooks/hooks.js.map +1 -0
- package/esm/hooks/index.d.ts +3 -0
- package/esm/hooks/index.d.ts.map +1 -0
- package/esm/hooks/index.js +6 -0
- package/esm/hooks/index.js.map +1 -0
- package/esm/hooks/types.d.ts +76 -0
- package/esm/hooks/types.d.ts.map +1 -0
- package/esm/hooks/types.js +5 -0
- package/esm/hooks/types.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +8 -0
- package/esm/index.js.map +1 -0
- package/esm/lib/base64.d.ts +10 -0
- package/esm/lib/base64.d.ts.map +1 -0
- package/esm/lib/base64.js +31 -0
- package/esm/lib/base64.js.map +1 -0
- package/esm/lib/config.d.ts +38 -0
- package/esm/lib/config.d.ts.map +1 -0
- package/esm/lib/config.js +34 -0
- package/esm/lib/config.js.map +1 -0
- package/esm/lib/dlv.d.ts +14 -0
- package/esm/lib/dlv.d.ts.map +1 -0
- package/esm/lib/dlv.js +46 -0
- package/esm/lib/dlv.js.map +1 -0
- package/esm/lib/encodings.d.ts +53 -0
- package/esm/lib/encodings.d.ts.map +1 -0
- package/esm/lib/encodings.js +385 -0
- package/esm/lib/encodings.js.map +1 -0
- package/esm/lib/env.d.ts +15 -0
- package/esm/lib/env.d.ts.map +1 -0
- package/esm/lib/env.js +44 -0
- package/esm/lib/env.js.map +1 -0
- package/esm/lib/files.d.ts +26 -0
- package/esm/lib/files.d.ts.map +1 -0
- package/esm/lib/files.js +91 -0
- package/esm/lib/files.js.map +1 -0
- package/esm/lib/http.d.ts +67 -0
- package/esm/lib/http.d.ts.map +1 -0
- package/esm/lib/http.js +209 -0
- package/esm/lib/http.js.map +1 -0
- package/esm/lib/is-plain-object.d.ts +2 -0
- package/esm/lib/is-plain-object.d.ts.map +1 -0
- package/esm/lib/is-plain-object.js +38 -0
- package/esm/lib/is-plain-object.js.map +1 -0
- package/esm/lib/logger.d.ts +6 -0
- package/esm/lib/logger.d.ts.map +1 -0
- package/esm/lib/logger.js +5 -0
- package/esm/lib/logger.js.map +1 -0
- package/esm/lib/matchers.d.ts +59 -0
- package/esm/lib/matchers.d.ts.map +1 -0
- package/esm/lib/matchers.js +202 -0
- package/esm/lib/matchers.js.map +1 -0
- package/esm/lib/primitives.d.ts +26 -0
- package/esm/lib/primitives.d.ts.map +1 -0
- package/esm/lib/primitives.js +103 -0
- package/esm/lib/primitives.js.map +1 -0
- package/esm/lib/retries.d.ts +38 -0
- package/esm/lib/retries.d.ts.map +1 -0
- package/esm/lib/retries.js +150 -0
- package/esm/lib/retries.js.map +1 -0
- package/esm/lib/schemas.d.ts +21 -0
- package/esm/lib/schemas.d.ts.map +1 -0
- package/esm/lib/schemas.js +57 -0
- package/esm/lib/schemas.js.map +1 -0
- package/esm/lib/sdks.d.ts +63 -0
- package/esm/lib/sdks.d.ts.map +1 -0
- package/esm/lib/sdks.js +262 -0
- package/esm/lib/sdks.js.map +1 -0
- package/esm/lib/security.d.ts +83 -0
- package/esm/lib/security.d.ts.map +1 -0
- package/esm/lib/security.js +149 -0
- package/esm/lib/security.js.map +1 -0
- package/esm/lib/url.d.ts +5 -0
- package/esm/lib/url.d.ts.map +1 -0
- package/esm/lib/url.js +24 -0
- package/esm/lib/url.js.map +1 -0
- package/esm/models/create-media-response.d.ts +13 -0
- package/esm/models/create-media-response.d.ts.map +1 -0
- package/esm/models/create-media-response.js +14 -0
- package/esm/models/create-media-response.js.map +1 -0
- package/esm/models/create-o-auth-authorization-request.d.ts +21 -0
- package/esm/models/create-o-auth-authorization-request.d.ts.map +1 -0
- package/esm/models/create-o-auth-authorization-request.js +14 -0
- package/esm/models/create-o-auth-authorization-request.js.map +1 -0
- package/esm/models/create-o-auth-authorization-response.d.ts +13 -0
- package/esm/models/create-o-auth-authorization-response.d.ts.map +1 -0
- package/esm/models/create-o-auth-authorization-response.js +14 -0
- package/esm/models/create-o-auth-authorization-response.js.map +1 -0
- package/esm/models/create-post-failure-code.d.ts +16 -0
- package/esm/models/create-post-failure-code.d.ts.map +1 -0
- package/esm/models/create-post-failure-code.js +17 -0
- package/esm/models/create-post-failure-code.js.map +1 -0
- package/esm/models/create-post-failure-result.d.ts +33 -0
- package/esm/models/create-post-failure-result.d.ts.map +1 -0
- package/esm/models/create-post-failure-result.js +22 -0
- package/esm/models/create-post-failure-result.js.map +1 -0
- package/esm/models/create-post-item.d.ts +47 -0
- package/esm/models/create-post-item.d.ts.map +1 -0
- package/esm/models/create-post-item.js +21 -0
- package/esm/models/create-post-item.js.map +1 -0
- package/esm/models/create-post-result.d.ts +11 -0
- package/esm/models/create-post-result.d.ts.map +1 -0
- package/esm/models/create-post-result.js +16 -0
- package/esm/models/create-post-result.js.map +1 -0
- package/esm/models/create-post-success-result.d.ts +23 -0
- package/esm/models/create-post-success-result.d.ts.map +1 -0
- package/esm/models/create-post-success-result.js +18 -0
- package/esm/models/create-post-success-result.js.map +1 -0
- package/esm/models/create-posts-response.d.ts +14 -0
- package/esm/models/create-posts-response.d.ts.map +1 -0
- package/esm/models/create-posts-response.js +14 -0
- package/esm/models/create-posts-response.js.map +1 -0
- package/esm/models/create-upload-session-request.d.ts +20 -0
- package/esm/models/create-upload-session-request.d.ts.map +1 -0
- package/esm/models/create-upload-session-request.js +13 -0
- package/esm/models/create-upload-session-request.js.map +1 -0
- package/esm/models/delete-post-failure-code.d.ts +11 -0
- package/esm/models/delete-post-failure-code.d.ts.map +1 -0
- package/esm/models/delete-post-failure-code.js +12 -0
- package/esm/models/delete-post-failure-code.js.map +1 -0
- package/esm/models/delete-post-failure-result.d.ts +17 -0
- package/esm/models/delete-post-failure-result.d.ts.map +1 -0
- package/esm/models/delete-post-failure-result.js +18 -0
- package/esm/models/delete-post-failure-result.js.map +1 -0
- package/esm/models/delete-post-result.d.ts +11 -0
- package/esm/models/delete-post-result.d.ts.map +1 -0
- package/esm/models/delete-post-result.js +16 -0
- package/esm/models/delete-post-result.js.map +1 -0
- package/esm/models/delete-post-success-result.d.ts +14 -0
- package/esm/models/delete-post-success-result.d.ts.map +1 -0
- package/esm/models/delete-post-success-result.js +15 -0
- package/esm/models/delete-post-success-result.js.map +1 -0
- package/esm/models/delete-posts-response.d.ts +14 -0
- package/esm/models/delete-posts-response.d.ts.map +1 -0
- package/esm/models/delete-posts-response.js +14 -0
- package/esm/models/delete-posts-response.js.map +1 -0
- package/esm/models/delivery-status.d.ts +34 -0
- package/esm/models/delivery-status.d.ts.map +1 -0
- package/esm/models/delivery-status.js +25 -0
- package/esm/models/delivery-status.js.map +1 -0
- package/esm/models/errors/http-client-errors.d.ts +44 -0
- package/esm/models/errors/http-client-errors.d.ts.map +1 -0
- package/esm/models/errors/http-client-errors.js +56 -0
- package/esm/models/errors/http-client-errors.js.map +1 -0
- package/esm/models/errors/index.d.ts +6 -0
- package/esm/models/errors/index.d.ts.map +1 -0
- package/esm/models/errors/index.js +9 -0
- package/esm/models/errors/index.js.map +1 -0
- package/esm/models/errors/response-validation-error.d.ts +26 -0
- package/esm/models/errors/response-validation-error.d.ts.map +1 -0
- package/esm/models/errors/response-validation-error.js +37 -0
- package/esm/models/errors/response-validation-error.js.map +1 -0
- package/esm/models/errors/sdk-validation-error.d.ts +21 -0
- package/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
- package/esm/models/errors/sdk-validation-error.js +52 -0
- package/esm/models/errors/sdk-validation-error.js.map +1 -0
- package/esm/models/errors/woop-social-default-error.d.ts +10 -0
- package/esm/models/errors/woop-social-default-error.d.ts.map +1 -0
- package/esm/models/errors/woop-social-default-error.js +30 -0
- package/esm/models/errors/woop-social-default-error.js.map +1 -0
- package/esm/models/errors/woop-social-error.d.ts +19 -0
- package/esm/models/errors/woop-social-error.d.ts.map +1 -0
- package/esm/models/errors/woop-social-error.js +26 -0
- package/esm/models/errors/woop-social-error.js.map +1 -0
- package/esm/models/facebook-post-type.d.ts +14 -0
- package/esm/models/facebook-post-type.d.ts.map +1 -0
- package/esm/models/facebook-post-type.js +15 -0
- package/esm/models/facebook-post-type.js.map +1 -0
- package/esm/models/facebook-specifics.d.ts +22 -0
- package/esm/models/facebook-specifics.d.ts.map +1 -0
- package/esm/models/facebook-specifics.js +26 -0
- package/esm/models/facebook-specifics.js.map +1 -0
- package/esm/models/health-response.d.ts +21 -0
- package/esm/models/health-response.d.ts.map +1 -0
- package/esm/models/health-response.js +16 -0
- package/esm/models/health-response.js.map +1 -0
- package/esm/models/index.d.ts +61 -0
- package/esm/models/index.d.ts.map +1 -0
- package/esm/models/index.js +64 -0
- package/esm/models/index.js.map +1 -0
- package/esm/models/instagram-post-type.d.ts +13 -0
- package/esm/models/instagram-post-type.d.ts.map +1 -0
- package/esm/models/instagram-post-type.js +14 -0
- package/esm/models/instagram-post-type.js.map +1 -0
- package/esm/models/instagram-specifics.d.ts +20 -0
- package/esm/models/instagram-specifics.d.ts.map +1 -0
- package/esm/models/instagram-specifics.js +24 -0
- package/esm/models/instagram-specifics.js.map +1 -0
- package/esm/models/linked-in-pages-specifics.d.ts +17 -0
- package/esm/models/linked-in-pages-specifics.d.ts.map +1 -0
- package/esm/models/linked-in-pages-specifics.js +21 -0
- package/esm/models/linked-in-pages-specifics.js.map +1 -0
- package/esm/models/linked-in-specifics.d.ts +17 -0
- package/esm/models/linked-in-specifics.d.ts.map +1 -0
- package/esm/models/linked-in-specifics.js +21 -0
- package/esm/models/linked-in-specifics.js.map +1 -0
- package/esm/models/list-posts-request.d.ts +43 -0
- package/esm/models/list-posts-request.d.ts.map +1 -0
- package/esm/models/list-posts-request.js +17 -0
- package/esm/models/list-posts-request.js.map +1 -0
- package/esm/models/list-posts-response.d.ts +15 -0
- package/esm/models/list-posts-response.d.ts.map +1 -0
- package/esm/models/list-posts-response.js +16 -0
- package/esm/models/list-posts-response.js.map +1 -0
- package/esm/models/operations/complete-upload-session.d.ts +15 -0
- package/esm/models/operations/complete-upload-session.d.ts.map +1 -0
- package/esm/models/operations/complete-upload-session.js +12 -0
- package/esm/models/operations/complete-upload-session.js.map +1 -0
- package/esm/models/operations/create-media.d.ts +17 -0
- package/esm/models/operations/create-media.d.ts.map +1 -0
- package/esm/models/operations/create-media.js +18 -0
- package/esm/models/operations/create-media.js.map +1 -0
- package/esm/models/operations/get-social-account-platform-inputs.d.ts +15 -0
- package/esm/models/operations/get-social-account-platform-inputs.d.ts.map +1 -0
- package/esm/models/operations/get-social-account-platform-inputs.js +12 -0
- package/esm/models/operations/get-social-account-platform-inputs.js.map +1 -0
- package/esm/models/operations/get-upload-session.d.ts +15 -0
- package/esm/models/operations/get-upload-session.d.ts.map +1 -0
- package/esm/models/operations/get-upload-session.js +12 -0
- package/esm/models/operations/get-upload-session.js.map +1 -0
- package/esm/models/operations/index.d.ts +6 -0
- package/esm/models/operations/index.d.ts.map +1 -0
- package/esm/models/operations/index.js +9 -0
- package/esm/models/operations/index.js.map +1 -0
- package/esm/models/operations/list-social-accounts.d.ts +15 -0
- package/esm/models/operations/list-social-accounts.d.ts.map +1 -0
- package/esm/models/operations/list-social-accounts.js +12 -0
- package/esm/models/operations/list-social-accounts.js.map +1 -0
- package/esm/models/pinterest-account-platform-inputs.d.ts +19 -0
- package/esm/models/pinterest-account-platform-inputs.d.ts.map +1 -0
- package/esm/models/pinterest-account-platform-inputs.js +14 -0
- package/esm/models/pinterest-account-platform-inputs.js.map +1 -0
- package/esm/models/pinterest-board-option.d.ts +17 -0
- package/esm/models/pinterest-board-option.d.ts.map +1 -0
- package/esm/models/pinterest-board-option.js +15 -0
- package/esm/models/pinterest-board-option.js.map +1 -0
- package/esm/models/pinterest-social-account-platform-specific-inputs.d.ts +12 -0
- package/esm/models/pinterest-social-account-platform-specific-inputs.d.ts.map +1 -0
- package/esm/models/pinterest-social-account-platform-specific-inputs.js +17 -0
- package/esm/models/pinterest-social-account-platform-specific-inputs.js.map +1 -0
- package/esm/models/pinterest-specifics.d.ts +19 -0
- package/esm/models/pinterest-specifics.d.ts.map +1 -0
- package/esm/models/pinterest-specifics.js +23 -0
- package/esm/models/pinterest-specifics.js.map +1 -0
- package/esm/models/platform-specifics.d.ts +25 -0
- package/esm/models/platform-specifics.d.ts.map +1 -0
- package/esm/models/platform-specifics.js +43 -0
- package/esm/models/platform-specifics.js.map +1 -0
- package/esm/models/post-media.d.ts +30 -0
- package/esm/models/post-media.d.ts.map +1 -0
- package/esm/models/post-media.js +26 -0
- package/esm/models/post-media.js.map +1 -0
- package/esm/models/post.d.ts +69 -0
- package/esm/models/post.d.ts.map +1 -0
- package/esm/models/post.js +33 -0
- package/esm/models/post.js.map +1 -0
- package/esm/models/project.d.ts +17 -0
- package/esm/models/project.d.ts.map +1 -0
- package/esm/models/project.js +15 -0
- package/esm/models/project.js.map +1 -0
- package/esm/models/security.d.ts +12 -0
- package/esm/models/security.d.ts.map +1 -0
- package/esm/models/security.js +17 -0
- package/esm/models/security.js.map +1 -0
- package/esm/models/social-account-platform-inputs.d.ts +20 -0
- package/esm/models/social-account-platform-inputs.d.ts.map +1 -0
- package/esm/models/social-account-platform-inputs.js +18 -0
- package/esm/models/social-account-platform-inputs.js.map +1 -0
- package/esm/models/social-account-platform-specific-inputs.d.ts +11 -0
- package/esm/models/social-account-platform-specific-inputs.d.ts.map +1 -0
- package/esm/models/social-account-platform-specific-inputs.js +16 -0
- package/esm/models/social-account-platform-specific-inputs.js.map +1 -0
- package/esm/models/social-account-status.d.ts +10 -0
- package/esm/models/social-account-status.d.ts.map +1 -0
- package/esm/models/social-account-status.js +11 -0
- package/esm/models/social-account-status.js.map +1 -0
- package/esm/models/social-account.d.ts +28 -0
- package/esm/models/social-account.d.ts.map +1 -0
- package/esm/models/social-account.js +20 -0
- package/esm/models/social-account.js.map +1 -0
- package/esm/models/social-platform.d.ts +24 -0
- package/esm/models/social-platform.d.ts.map +1 -0
- package/esm/models/social-platform.js +22 -0
- package/esm/models/social-platform.js.map +1 -0
- package/esm/models/tik-tok-account-platform-inputs.d.ts +35 -0
- package/esm/models/tik-tok-account-platform-inputs.d.ts.map +1 -0
- package/esm/models/tik-tok-account-platform-inputs.js +19 -0
- package/esm/models/tik-tok-account-platform-inputs.js.map +1 -0
- package/esm/models/tik-tok-post-type.d.ts +12 -0
- package/esm/models/tik-tok-post-type.d.ts.map +1 -0
- package/esm/models/tik-tok-post-type.js +13 -0
- package/esm/models/tik-tok-post-type.js.map +1 -0
- package/esm/models/tik-tok-privacy-level.d.ts +14 -0
- package/esm/models/tik-tok-privacy-level.d.ts.map +1 -0
- package/esm/models/tik-tok-privacy-level.js +15 -0
- package/esm/models/tik-tok-privacy-level.js.map +1 -0
- package/esm/models/tik-tok-social-account-platform-specific-inputs.d.ts +12 -0
- package/esm/models/tik-tok-social-account-platform-specific-inputs.d.ts.map +1 -0
- package/esm/models/tik-tok-social-account-platform-specific-inputs.js +16 -0
- package/esm/models/tik-tok-social-account-platform-specific-inputs.js.map +1 -0
- package/esm/models/tik-tok-specifics.d.ts +37 -0
- package/esm/models/tik-tok-specifics.d.ts.map +1 -0
- package/esm/models/tik-tok-specifics.js +41 -0
- package/esm/models/tik-tok-specifics.js.map +1 -0
- package/esm/models/update-post-failure-code.d.ts +14 -0
- package/esm/models/update-post-failure-code.d.ts.map +1 -0
- package/esm/models/update-post-failure-code.js +15 -0
- package/esm/models/update-post-failure-code.js.map +1 -0
- package/esm/models/update-post-failure-result.d.ts +33 -0
- package/esm/models/update-post-failure-result.d.ts.map +1 -0
- package/esm/models/update-post-failure-result.js +22 -0
- package/esm/models/update-post-failure-result.js.map +1 -0
- package/esm/models/update-post-item.d.ts +37 -0
- package/esm/models/update-post-item.d.ts.map +1 -0
- package/esm/models/update-post-item.js +19 -0
- package/esm/models/update-post-item.js.map +1 -0
- package/esm/models/update-post-result.d.ts +11 -0
- package/esm/models/update-post-result.d.ts.map +1 -0
- package/esm/models/update-post-result.js +16 -0
- package/esm/models/update-post-result.js.map +1 -0
- package/esm/models/update-post-success-result.d.ts +19 -0
- package/esm/models/update-post-success-result.d.ts.map +1 -0
- package/esm/models/update-post-success-result.js +17 -0
- package/esm/models/update-post-success-result.js.map +1 -0
- package/esm/models/update-posts-response.d.ts +14 -0
- package/esm/models/update-posts-response.d.ts.map +1 -0
- package/esm/models/update-posts-response.js +14 -0
- package/esm/models/update-posts-response.js.map +1 -0
- package/esm/models/upload-session-part.d.ts +17 -0
- package/esm/models/upload-session-part.d.ts.map +1 -0
- package/esm/models/upload-session-part.js +15 -0
- package/esm/models/upload-session-part.js.map +1 -0
- package/esm/models/upload-session-status-value.d.ts +13 -0
- package/esm/models/upload-session-status-value.d.ts.map +1 -0
- package/esm/models/upload-session-status-value.js +14 -0
- package/esm/models/upload-session-status-value.js.map +1 -0
- package/esm/models/upload-session-status.d.ts +18 -0
- package/esm/models/upload-session-status.d.ts.map +1 -0
- package/esm/models/upload-session-status.js +19 -0
- package/esm/models/upload-session-status.js.map +1 -0
- package/esm/models/upload-session.d.ts +36 -0
- package/esm/models/upload-session.d.ts.map +1 -0
- package/esm/models/upload-session.js +19 -0
- package/esm/models/upload-session.js.map +1 -0
- package/esm/models/validation-error.d.ts +12 -0
- package/esm/models/validation-error.d.ts.map +1 -0
- package/esm/models/validation-error.js +16 -0
- package/esm/models/validation-error.js.map +1 -0
- package/esm/models/validation-field.d.ts +20 -0
- package/esm/models/validation-field.d.ts.map +1 -0
- package/esm/models/validation-field.js +21 -0
- package/esm/models/validation-field.js.map +1 -0
- package/esm/models/validation-warning.d.ts +12 -0
- package/esm/models/validation-warning.d.ts.map +1 -0
- package/esm/models/validation-warning.js +16 -0
- package/esm/models/validation-warning.js.map +1 -0
- package/esm/models/x-specifics.d.ts +17 -0
- package/esm/models/x-specifics.d.ts.map +1 -0
- package/esm/models/x-specifics.js +22 -0
- package/esm/models/x-specifics.js.map +1 -0
- package/esm/models/you-tube-privacy.d.ts +13 -0
- package/esm/models/you-tube-privacy.d.ts.map +1 -0
- package/esm/models/you-tube-privacy.js +14 -0
- package/esm/models/you-tube-privacy.js.map +1 -0
- package/esm/models/you-tube-specifics.d.ts +26 -0
- package/esm/models/you-tube-specifics.d.ts.map +1 -0
- package/esm/models/you-tube-specifics.js +30 -0
- package/esm/models/you-tube-specifics.js.map +1 -0
- package/esm/sdk/health.d.ts +12 -0
- package/esm/sdk/health.d.ts.map +1 -0
- package/esm/sdk/health.js +18 -0
- package/esm/sdk/health.js.map +1 -0
- package/esm/sdk/index.d.ts +2 -0
- package/esm/sdk/index.d.ts.map +1 -0
- package/esm/sdk/index.js +5 -0
- package/esm/sdk/index.js.map +1 -0
- package/esm/sdk/media.d.ts +45 -0
- package/esm/sdk/media.d.ts.map +1 -0
- package/esm/sdk/media.js +59 -0
- package/esm/sdk/media.js.map +1 -0
- package/esm/sdk/posts.d.ts +47 -0
- package/esm/sdk/posts.d.ts.map +1 -0
- package/esm/sdk/posts.js +62 -0
- package/esm/sdk/posts.js.map +1 -0
- package/esm/sdk/projects.d.ts +12 -0
- package/esm/sdk/projects.d.ts.map +1 -0
- package/esm/sdk/projects.js +18 -0
- package/esm/sdk/projects.js.map +1 -0
- package/esm/sdk/sdk.d.ts +19 -0
- package/esm/sdk/sdk.d.ts.map +1 -0
- package/esm/sdk/sdk.js +32 -0
- package/esm/sdk/sdk.js.map +1 -0
- package/esm/sdk/social-accounts.d.ts +31 -0
- package/esm/sdk/social-accounts.d.ts.map +1 -0
- package/esm/sdk/social-accounts.js +42 -0
- package/esm/sdk/social-accounts.js.map +1 -0
- package/esm/types/async.d.ts +23 -0
- package/esm/types/async.d.ts.map +1 -0
- package/esm/types/async.js +28 -0
- package/esm/types/async.js.map +1 -0
- package/esm/types/blobs.d.ts +4 -0
- package/esm/types/blobs.d.ts.map +1 -0
- package/esm/types/blobs.js +25 -0
- package/esm/types/blobs.js.map +1 -0
- package/esm/types/const-date-time.d.ts +3 -0
- package/esm/types/const-date-time.d.ts.map +1 -0
- package/esm/types/const-date-time.js +10 -0
- package/esm/types/const-date-time.js.map +1 -0
- package/esm/types/default-to-zero-value.d.ts +12 -0
- package/esm/types/default-to-zero-value.d.ts.map +1 -0
- package/esm/types/default-to-zero-value.js +31 -0
- package/esm/types/default-to-zero-value.js.map +1 -0
- package/esm/types/discriminated-union.d.ts +25 -0
- package/esm/types/discriminated-union.d.ts.map +1 -0
- package/esm/types/discriminated-union.js +61 -0
- package/esm/types/discriminated-union.js.map +1 -0
- package/esm/types/enums.d.ts +9 -0
- package/esm/types/enums.d.ts.map +1 -0
- package/esm/types/enums.js +27 -0
- package/esm/types/enums.js.map +1 -0
- package/esm/types/fp.d.ts +31 -0
- package/esm/types/fp.d.ts.map +1 -0
- package/esm/types/fp.js +31 -0
- package/esm/types/fp.js.map +1 -0
- package/esm/types/index.d.ts +10 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/index.js +10 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/operations.d.ts +27 -0
- package/esm/types/operations.d.ts.map +1 -0
- package/esm/types/operations.js +77 -0
- package/esm/types/operations.js.map +1 -0
- package/esm/types/primitives.d.ts +11 -0
- package/esm/types/primitives.d.ts.map +1 -0
- package/esm/types/primitives.js +132 -0
- package/esm/types/primitives.js.map +1 -0
- package/esm/types/rfcdate.d.ts +21 -0
- package/esm/types/rfcdate.d.ts.map +1 -0
- package/esm/types/rfcdate.js +43 -0
- package/esm/types/rfcdate.js.map +1 -0
- package/esm/types/smart-union.d.ts +7 -0
- package/esm/types/smart-union.d.ts.map +1 -0
- package/esm/types/smart-union.js +118 -0
- package/esm/types/smart-union.js.map +1 -0
- package/esm/types/streams.d.ts +2 -0
- package/esm/types/streams.d.ts.map +1 -0
- package/esm/types/streams.js +15 -0
- package/esm/types/streams.js.map +1 -0
- package/esm/types/unrecognized.d.ts +16 -0
- package/esm/types/unrecognized.d.ts.map +1 -0
- package/esm/types/unrecognized.js +31 -0
- package/esm/types/unrecognized.js.map +1 -0
- package/jsr.json +27 -0
- package/package.json +75 -0
- package/src/core.ts +13 -0
- package/src/funcs/health-get-health.ts +142 -0
- package/src/funcs/media-complete-upload-session.ts +167 -0
- package/src/funcs/media-create-media.ts +176 -0
- package/src/funcs/media-create-upload-session.ts +171 -0
- package/src/funcs/media-get-upload-session.ts +167 -0
- package/src/funcs/posts-create-posts.ts +167 -0
- package/src/funcs/posts-delete-posts.ts +165 -0
- package/src/funcs/posts-list-posts.ts +164 -0
- package/src/funcs/posts-update-posts.ts +165 -0
- package/src/funcs/projects-list-projects.ts +143 -0
- package/src/funcs/social-accounts-create-o-auth-authorization.ts +162 -0
- package/src/funcs/social-accounts-get-social-account-platform-inputs.ts +175 -0
- package/src/funcs/social-accounts-list-social-accounts.ts +172 -0
- package/src/hooks/hooks.ts +129 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/types.ts +107 -0
- package/src/index.ts +9 -0
- package/src/lib/base64.ts +39 -0
- package/src/lib/config.ts +68 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +520 -0
- package/src/lib/env.ts +57 -0
- package/src/lib/files.ts +104 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +353 -0
- package/src/lib/primitives.ts +150 -0
- package/src/lib/retries.ts +218 -0
- package/src/lib/schemas.ts +94 -0
- package/src/lib/sdks.ts +408 -0
- package/src/lib/security.ts +275 -0
- package/src/lib/url.ts +35 -0
- package/src/models/create-media-response.ts +34 -0
- package/src/models/create-o-auth-authorization-request.ts +45 -0
- package/src/models/create-o-auth-authorization-response.ts +34 -0
- package/src/models/create-post-failure-code.ts +25 -0
- package/src/models/create-post-failure-result.ts +68 -0
- package/src/models/create-post-item.ts +73 -0
- package/src/models/create-post-result.ts +42 -0
- package/src/models/create-post-success-result.ts +50 -0
- package/src/models/create-posts-response.ts +37 -0
- package/src/models/create-upload-session-request.ts +39 -0
- package/src/models/delete-post-failure-code.ts +20 -0
- package/src/models/delete-post-failure-result.ts +44 -0
- package/src/models/delete-post-result.ts +42 -0
- package/src/models/delete-post-success-result.ts +36 -0
- package/src/models/delete-posts-response.ts +37 -0
- package/src/models/delivery-status.ts +46 -0
- package/src/models/errors/http-client-errors.ts +62 -0
- package/src/models/errors/index.ts +9 -0
- package/src/models/errors/response-validation-error.ts +50 -0
- package/src/models/errors/sdk-validation-error.ts +54 -0
- package/src/models/errors/woop-social-default-error.ts +40 -0
- package/src/models/errors/woop-social-error.ts +35 -0
- package/src/models/facebook-post-type.ts +26 -0
- package/src/models/facebook-specifics.ts +63 -0
- package/src/models/health-response.ts +44 -0
- package/src/models/index.ts +64 -0
- package/src/models/instagram-post-type.ts +25 -0
- package/src/models/instagram-specifics.ts +59 -0
- package/src/models/linked-in-pages-specifics.ts +50 -0
- package/src/models/linked-in-specifics.ts +50 -0
- package/src/models/list-posts-request.ts +68 -0
- package/src/models/list-posts-response.ts +37 -0
- package/src/models/operations/complete-upload-session.ts +35 -0
- package/src/models/operations/create-media.ts +41 -0
- package/src/models/operations/get-social-account-platform-inputs.ts +36 -0
- package/src/models/operations/get-upload-session.ts +33 -0
- package/src/models/operations/index.ts +9 -0
- package/src/models/operations/list-social-accounts.ts +33 -0
- package/src/models/pinterest-account-platform-inputs.ts +42 -0
- package/src/models/pinterest-board-option.ts +39 -0
- package/src/models/pinterest-social-account-platform-specific-inputs.ts +42 -0
- package/src/models/pinterest-specifics.ts +54 -0
- package/src/models/platform-specifics.ts +129 -0
- package/src/models/post-media.ts +56 -0
- package/src/models/post.ts +111 -0
- package/src/models/project.ts +36 -0
- package/src/models/security.ts +34 -0
- package/src/models/social-account-platform-inputs.ts +49 -0
- package/src/models/social-account-platform-specific-inputs.ts +43 -0
- package/src/models/social-account-status.ts +19 -0
- package/src/models/social-account.ts +59 -0
- package/src/models/social-platform.ts +36 -0
- package/src/models/tik-tok-account-platform-inputs.ts +63 -0
- package/src/models/tik-tok-post-type.ts +24 -0
- package/src/models/tik-tok-privacy-level.ts +26 -0
- package/src/models/tik-tok-social-account-platform-specific-inputs.ts +41 -0
- package/src/models/tik-tok-specifics.ts +94 -0
- package/src/models/update-post-failure-code.ts +23 -0
- package/src/models/update-post-failure-result.ts +68 -0
- package/src/models/update-post-item.ts +61 -0
- package/src/models/update-post-result.ts +42 -0
- package/src/models/update-post-success-result.ts +45 -0
- package/src/models/update-posts-response.ts +37 -0
- package/src/models/upload-session-part.ts +39 -0
- package/src/models/upload-session-status-value.ts +24 -0
- package/src/models/upload-session-status.ts +46 -0
- package/src/models/upload-session.ts +64 -0
- package/src/models/validation-error.ts +37 -0
- package/src/models/validation-field.ts +29 -0
- package/src/models/validation-warning.ts +37 -0
- package/src/models/x-specifics.ts +44 -0
- package/src/models/you-tube-privacy.ts +25 -0
- package/src/models/you-tube-specifics.ts +71 -0
- package/src/sdk/health.ts +25 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/media.ts +93 -0
- package/src/sdk/posts.ts +95 -0
- package/src/sdk/projects.ts +25 -0
- package/src/sdk/sdk.ts +37 -0
- package/src/sdk/social-accounts.ts +68 -0
- package/src/types/async.ts +68 -0
- package/src/types/blobs.ts +33 -0
- package/src/types/const-date-time.ts +15 -0
- package/src/types/default-to-zero-value.ts +33 -0
- package/src/types/discriminated-union.ts +101 -0
- package/src/types/enums.ts +45 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +13 -0
- package/src/types/operations.ts +105 -0
- package/src/types/primitives.ts +168 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/smart-union.ts +154 -0
- package/src/types/streams.ts +21 -0
- package/src/types/unrecognized.ts +35 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type APICall =
|
|
6
|
+
| {
|
|
7
|
+
status: "complete";
|
|
8
|
+
request: Request;
|
|
9
|
+
response: Response;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
status: "request-error";
|
|
13
|
+
request: Request;
|
|
14
|
+
response?: undefined;
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
status: "invalid";
|
|
18
|
+
request?: undefined;
|
|
19
|
+
response?: undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export class APIPromise<T> implements Promise<T> {
|
|
23
|
+
readonly #promise: Promise<[T, APICall]>;
|
|
24
|
+
readonly #unwrapped: Promise<T>;
|
|
25
|
+
|
|
26
|
+
readonly [Symbol.toStringTag] = "APIPromise";
|
|
27
|
+
|
|
28
|
+
constructor(p: [T, APICall] | Promise<[T, APICall]>) {
|
|
29
|
+
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
30
|
+
this.#unwrapped =
|
|
31
|
+
p instanceof Promise
|
|
32
|
+
? this.#promise.then(([value]) => value)
|
|
33
|
+
: Promise.resolve(p[0]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
then<TResult1 = T, TResult2 = never>(
|
|
37
|
+
onfulfilled?:
|
|
38
|
+
| ((value: T) => TResult1 | PromiseLike<TResult1>)
|
|
39
|
+
| null
|
|
40
|
+
| undefined,
|
|
41
|
+
onrejected?:
|
|
42
|
+
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
|
|
43
|
+
| null
|
|
44
|
+
| undefined,
|
|
45
|
+
): Promise<TResult1 | TResult2> {
|
|
46
|
+
return this.#promise.then(
|
|
47
|
+
onfulfilled ? ([value]) => onfulfilled(value) : void 0,
|
|
48
|
+
onrejected,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
catch<TResult = never>(
|
|
53
|
+
onrejected?:
|
|
54
|
+
| ((reason: any) => TResult | PromiseLike<TResult>)
|
|
55
|
+
| null
|
|
56
|
+
| undefined,
|
|
57
|
+
): Promise<T | TResult> {
|
|
58
|
+
return this.#unwrapped.catch(onrejected);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
|
|
62
|
+
return this.#unwrapped.finally(onfinally);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
$inspect(): Promise<[T, APICall]> {
|
|
66
|
+
return this.#promise;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export const blobLikeSchema: z.ZodMiniType<Blob, Blob> = z.custom<Blob>(
|
|
8
|
+
isBlobLike,
|
|
9
|
+
{
|
|
10
|
+
message: "expected a Blob, File or Blob-like object",
|
|
11
|
+
abort: true,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export function isBlobLike(val: unknown): val is Blob {
|
|
16
|
+
if (val instanceof Blob) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const name = val[Symbol.toStringTag];
|
|
25
|
+
if (typeof name !== "string") {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (name !== "Blob" && name !== "File") {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return "stream" in val && typeof val.stream === "function";
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export function constDateTime(
|
|
8
|
+
val: string,
|
|
9
|
+
): z.ZodMiniType<string, unknown> {
|
|
10
|
+
return z.custom<string>((v) => {
|
|
11
|
+
return (
|
|
12
|
+
typeof v === "string" && new Date(v).getTime() === new Date(val).getTime()
|
|
13
|
+
);
|
|
14
|
+
}, `Value must be equivalent to ${val}`);
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { type Unrecognized, unrecognized } from "./unrecognized.js";
|
|
6
|
+
|
|
7
|
+
let globalCount = 0;
|
|
8
|
+
let refCount = 0;
|
|
9
|
+
|
|
10
|
+
export function defaultToZeroValue<T>(value: T): Unrecognized<T> {
|
|
11
|
+
globalCount++;
|
|
12
|
+
return unrecognized(value);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function startCountingDefaultToZeroValue() {
|
|
16
|
+
refCount++;
|
|
17
|
+
const start = globalCount;
|
|
18
|
+
return {
|
|
19
|
+
/**
|
|
20
|
+
* Ends counting and returns the delta.
|
|
21
|
+
* @param delta - If provided, only this amount is added to the parent counter
|
|
22
|
+
* (used for nested unions where we only want to record the winning option's count).
|
|
23
|
+
* If not provided, records all counts since start().
|
|
24
|
+
*/
|
|
25
|
+
end: (delta?: number) => {
|
|
26
|
+
const count = globalCount - start;
|
|
27
|
+
// Reset globalCount back to start, then add only the specified delta
|
|
28
|
+
globalCount = start + (delta ?? count);
|
|
29
|
+
if (--refCount === 0) globalCount = 0;
|
|
30
|
+
return count;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { startCountingDefaultToZeroValue } from "./default-to-zero-value.js";
|
|
7
|
+
import { startCountingUnrecognized } from "./unrecognized.js";
|
|
8
|
+
|
|
9
|
+
const UNKNOWN = Symbol("UNKNOWN");
|
|
10
|
+
|
|
11
|
+
export type Unknown<Discriminator extends string, UnknownValue = "UNKNOWN"> =
|
|
12
|
+
& {
|
|
13
|
+
[K in Discriminator]: UnknownValue;
|
|
14
|
+
}
|
|
15
|
+
& {
|
|
16
|
+
raw: unknown;
|
|
17
|
+
isUnknown: true;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function isUnknown<Discriminator extends string>(
|
|
21
|
+
value: unknown,
|
|
22
|
+
): value is Unknown<Discriminator> {
|
|
23
|
+
return typeof value === "object" && value !== null && UNKNOWN in value;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Forward-compatible discriminated union parser.
|
|
28
|
+
*
|
|
29
|
+
* If the input does not match one of the predefined options, it will be
|
|
30
|
+
* captured and available as `{ raw: <original input>, [discriminator]: "UNKNOWN", isUnknown: true }`.
|
|
31
|
+
*
|
|
32
|
+
* @param inputPropertyName - The discriminator property name in the input payload
|
|
33
|
+
* @param options - Map of discriminator values to their corresponding schemas
|
|
34
|
+
* @param opts - Optional configuration object
|
|
35
|
+
* @param opts.unknownValue - The value to use for the discriminator when the input is unknown (default: "UNKNOWN")
|
|
36
|
+
* @param opts.outputPropertyName - Output property name if the sanitized (camelCase) property name differs from inputPropertyName
|
|
37
|
+
*/
|
|
38
|
+
export function discriminatedUnion<
|
|
39
|
+
InputDiscriminator extends string,
|
|
40
|
+
TOptions extends Readonly<Record<string, z.ZodMiniType>>,
|
|
41
|
+
UnknownValue extends string = "UNKNOWN",
|
|
42
|
+
OutputDiscriminator extends string = InputDiscriminator,
|
|
43
|
+
>(
|
|
44
|
+
inputPropertyName: InputDiscriminator,
|
|
45
|
+
options: TOptions,
|
|
46
|
+
opts: {
|
|
47
|
+
unknownValue?: UnknownValue;
|
|
48
|
+
outputPropertyName?: OutputDiscriminator;
|
|
49
|
+
} = {},
|
|
50
|
+
): z.ZodMiniType<
|
|
51
|
+
| z.output<TOptions[keyof TOptions]>
|
|
52
|
+
| Unknown<OutputDiscriminator, UnknownValue>,
|
|
53
|
+
unknown
|
|
54
|
+
> {
|
|
55
|
+
const { unknownValue = "UNKNOWN" as UnknownValue, outputPropertyName } = opts;
|
|
56
|
+
return z.pipe(
|
|
57
|
+
z.unknown(),
|
|
58
|
+
z.transform((input) => {
|
|
59
|
+
const fallback = Object.defineProperties(
|
|
60
|
+
{
|
|
61
|
+
raw: input,
|
|
62
|
+
[outputPropertyName ?? inputPropertyName]: unknownValue,
|
|
63
|
+
isUnknown: true as const,
|
|
64
|
+
},
|
|
65
|
+
{ [UNKNOWN]: { value: true, enumerable: false, configurable: false } },
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const isObject = typeof input === "object" && input !== null;
|
|
69
|
+
if (!isObject) return fallback;
|
|
70
|
+
|
|
71
|
+
const discriminator = input[inputPropertyName as keyof typeof input];
|
|
72
|
+
if (typeof discriminator !== "string") return fallback;
|
|
73
|
+
if (!(discriminator in options)) return fallback;
|
|
74
|
+
|
|
75
|
+
const schema = options[discriminator];
|
|
76
|
+
if (!schema) return fallback;
|
|
77
|
+
|
|
78
|
+
// Start counters before parsing to track nested unrecognized/zeroDefault values
|
|
79
|
+
const unrecognizedCtr = startCountingUnrecognized();
|
|
80
|
+
const zeroDefaultCtr = startCountingDefaultToZeroValue();
|
|
81
|
+
|
|
82
|
+
const result = z.safeParse(schema, input);
|
|
83
|
+
if (!result.success) {
|
|
84
|
+
// Parse failed - don't propagate any counts from the failed attempt
|
|
85
|
+
unrecognizedCtr.end(0);
|
|
86
|
+
zeroDefaultCtr.end(0);
|
|
87
|
+
return fallback;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Parse succeeded - propagate the actual counts
|
|
91
|
+
unrecognizedCtr.end();
|
|
92
|
+
zeroDefaultCtr.end();
|
|
93
|
+
|
|
94
|
+
if (outputPropertyName) {
|
|
95
|
+
(result.data as any)[outputPropertyName] = discriminator;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return result.data;
|
|
99
|
+
}),
|
|
100
|
+
) as any;
|
|
101
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { Unrecognized, unrecognized } from "./unrecognized.js";
|
|
7
|
+
|
|
8
|
+
export type ClosedEnum<T extends Readonly<Record<string, string | number>>> =
|
|
9
|
+
T[keyof T];
|
|
10
|
+
export type OpenEnum<T extends Readonly<Record<string, string | number>>> =
|
|
11
|
+
| T[keyof T]
|
|
12
|
+
| Unrecognized<T[keyof T] extends number ? number : string>;
|
|
13
|
+
|
|
14
|
+
export function inboundSchema<T extends Record<string, string>>(
|
|
15
|
+
enumObj: T,
|
|
16
|
+
): z.ZodMiniType<OpenEnum<T>, unknown> {
|
|
17
|
+
const options = Object.values(enumObj);
|
|
18
|
+
return z.union([
|
|
19
|
+
...options.map(x => z.literal(x)),
|
|
20
|
+
z.pipe(z.string(), z.transform(x => unrecognized(x))),
|
|
21
|
+
] as any);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function inboundSchemaInt<T extends Record<string, number | string>>(
|
|
25
|
+
enumObj: T,
|
|
26
|
+
): z.ZodMiniType<OpenEnum<T>, unknown> {
|
|
27
|
+
// For numeric enums, Object.values returns both numbers and string keys
|
|
28
|
+
const options = Object.values(enumObj).filter(v => typeof v === "number");
|
|
29
|
+
return z.union([
|
|
30
|
+
...options.map(x => z.literal(x)),
|
|
31
|
+
z.pipe(z.int(), z.transform(x => unrecognized(x))),
|
|
32
|
+
] as any);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function outboundSchema<T extends Record<string, string>>(
|
|
36
|
+
_: T,
|
|
37
|
+
): z.ZodMiniType<string, OpenEnum<T>> {
|
|
38
|
+
return z.string() as any;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function outboundSchemaInt<T extends Record<string, number | string>>(
|
|
42
|
+
_: T,
|
|
43
|
+
): z.ZodMiniType<number, OpenEnum<T>> {
|
|
44
|
+
return z.int() as any;
|
|
45
|
+
}
|
package/src/types/fp.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A monad that captures the result of a function call or an error if it was not
|
|
7
|
+
* successful. Railway programming, enabled by this type, can be a nicer
|
|
8
|
+
* alternative to traditional exception throwing because it allows functions to
|
|
9
|
+
* declare all _known_ errors with static types and then check for them
|
|
10
|
+
* exhaustively in application code. Thrown exception have a type of `unknown`
|
|
11
|
+
* and break out of regular control flow of programs making them harder to
|
|
12
|
+
* inspect and more verbose work with due to try-catch blocks.
|
|
13
|
+
*/
|
|
14
|
+
export type Result<T, E = unknown> =
|
|
15
|
+
| { ok: true; value: T; error?: never }
|
|
16
|
+
| { ok: false; value?: never; error: E };
|
|
17
|
+
|
|
18
|
+
export function OK<V>(value: V): Result<V, never> {
|
|
19
|
+
return { ok: true, value };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function ERR<E>(error: E): Result<never, E> {
|
|
23
|
+
return { ok: false, error };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* unwrap is a convenience function for extracting a value from a result or
|
|
28
|
+
* throwing if there was an error.
|
|
29
|
+
*/
|
|
30
|
+
export function unwrap<T>(r: Result<T, unknown>): T {
|
|
31
|
+
if (!r.ok) {
|
|
32
|
+
throw r.error;
|
|
33
|
+
}
|
|
34
|
+
return r.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* unwrapAsync is a convenience function for resolving a value from a Promise
|
|
39
|
+
* of a result or rejecting if an error occurred.
|
|
40
|
+
*/
|
|
41
|
+
export async function unwrapAsync<T>(
|
|
42
|
+
pr: Promise<Result<T, unknown>>,
|
|
43
|
+
): Promise<T> {
|
|
44
|
+
const r = await pr;
|
|
45
|
+
if (!r.ok) {
|
|
46
|
+
throw r.error;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return r.value;
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
6
|
+
export * from "./default-to-zero-value.js";
|
|
7
|
+
export type { ClosedEnum, OpenEnum } from "./enums.js";
|
|
8
|
+
export type { Result } from "./fp.js";
|
|
9
|
+
export type { PageIterator, Paginator } from "./operations.js";
|
|
10
|
+
export { createPageIterator } from "./operations.js";
|
|
11
|
+
export * from "./primitives.js";
|
|
12
|
+
export { RFCDate } from "./rfcdate.js";
|
|
13
|
+
export * from "./unrecognized.js";
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Result } from "./fp.js";
|
|
6
|
+
|
|
7
|
+
export type Paginator<V> = () => Promise<V & { next: Paginator<V> }> | null;
|
|
8
|
+
|
|
9
|
+
export type PageIterator<V, PageState = unknown> = V & {
|
|
10
|
+
next: Paginator<V>;
|
|
11
|
+
[Symbol.asyncIterator]: () => AsyncIterableIterator<V>;
|
|
12
|
+
"~next"?: PageState | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function createPageIterator<V>(
|
|
16
|
+
page: V & { next: Paginator<V> },
|
|
17
|
+
halt: (v: V) => boolean,
|
|
18
|
+
): {
|
|
19
|
+
[Symbol.asyncIterator]: () => AsyncIterableIterator<V>;
|
|
20
|
+
} {
|
|
21
|
+
return {
|
|
22
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
23
|
+
yield page;
|
|
24
|
+
if (halt(page)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let p: typeof page | null = page;
|
|
29
|
+
for (p = await p.next(); p != null; p = await p.next()) {
|
|
30
|
+
yield p;
|
|
31
|
+
if (halt(p)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This utility create a special iterator that yields a single value and
|
|
41
|
+
* terminates. It is useful in paginated SDK functions that have early return
|
|
42
|
+
* paths when things go wrong.
|
|
43
|
+
*/
|
|
44
|
+
export function haltIterator<V extends object>(
|
|
45
|
+
v: V,
|
|
46
|
+
): PageIterator<V, undefined> {
|
|
47
|
+
return {
|
|
48
|
+
...v,
|
|
49
|
+
next: () => null,
|
|
50
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
51
|
+
yield v;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Converts an async iterator of `Result<V, E>` into an async iterator of `V`.
|
|
58
|
+
* When error results occur, the underlying error value is thrown.
|
|
59
|
+
*/
|
|
60
|
+
export async function unwrapResultIterator<V, PageState>(
|
|
61
|
+
iteratorPromise: Promise<PageIterator<Result<V, unknown>, PageState>>,
|
|
62
|
+
): Promise<PageIterator<V, PageState>> {
|
|
63
|
+
const resultIter = await iteratorPromise;
|
|
64
|
+
|
|
65
|
+
if (!resultIter.ok) {
|
|
66
|
+
throw resultIter.error;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
...resultIter.value,
|
|
71
|
+
next: unwrapPaginator(resultIter.next),
|
|
72
|
+
"~next": resultIter["~next"],
|
|
73
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
74
|
+
for await (const page of resultIter) {
|
|
75
|
+
if (!page.ok) {
|
|
76
|
+
throw page.error;
|
|
77
|
+
}
|
|
78
|
+
yield page.value;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function unwrapPaginator<V>(
|
|
85
|
+
paginator: Paginator<Result<V, unknown>>,
|
|
86
|
+
): Paginator<V> {
|
|
87
|
+
return () => {
|
|
88
|
+
const nextResult = paginator();
|
|
89
|
+
if (nextResult == null) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return nextResult.then((res) => {
|
|
93
|
+
if (!res.ok) {
|
|
94
|
+
throw res.error;
|
|
95
|
+
}
|
|
96
|
+
const out = {
|
|
97
|
+
...res.value,
|
|
98
|
+
next: unwrapPaginator(res.next),
|
|
99
|
+
};
|
|
100
|
+
return out;
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const URL_OVERRIDE = Symbol("URL_OVERRIDE");
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { defaultToZeroValue } from "./default-to-zero-value.js";
|
|
7
|
+
import { unrecognized } from "./unrecognized.js";
|
|
8
|
+
|
|
9
|
+
export function string(): z.ZodMiniType<string> {
|
|
10
|
+
return z.union([
|
|
11
|
+
z.string(),
|
|
12
|
+
|
|
13
|
+
// Null or undefined -> ""
|
|
14
|
+
zodDefaultToZeroValue(""),
|
|
15
|
+
|
|
16
|
+
// Any other value -> String(x)
|
|
17
|
+
z.pipe(z.any(), z.transform((x) => unrecognized(JSON.stringify(x)))),
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function boolean(): z.ZodMiniType<boolean> {
|
|
22
|
+
return z.union([
|
|
23
|
+
z.boolean(),
|
|
24
|
+
|
|
25
|
+
// String "true" (case insensitive) -> true, "false" -> false
|
|
26
|
+
z.pipe(
|
|
27
|
+
z.string(),
|
|
28
|
+
z.transform((x, ctx) => {
|
|
29
|
+
const lower = x.toLowerCase();
|
|
30
|
+
if (lower === "true") return unrecognized(true);
|
|
31
|
+
if (lower === "false") return unrecognized(false);
|
|
32
|
+
ctx.issues.push({
|
|
33
|
+
input: x,
|
|
34
|
+
code: "invalid_type",
|
|
35
|
+
expected: "boolean",
|
|
36
|
+
received: "string",
|
|
37
|
+
});
|
|
38
|
+
return z.NEVER;
|
|
39
|
+
}),
|
|
40
|
+
),
|
|
41
|
+
|
|
42
|
+
zodDefaultToZeroValue(false),
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function number(): z.ZodMiniType<number> {
|
|
47
|
+
return z.union([
|
|
48
|
+
z.number(),
|
|
49
|
+
|
|
50
|
+
// String -> Number
|
|
51
|
+
z.pipe(
|
|
52
|
+
z.string(),
|
|
53
|
+
z.transform((x, ctx) => {
|
|
54
|
+
const num = Number(x);
|
|
55
|
+
if (isNaN(num)) {
|
|
56
|
+
ctx.issues.push({
|
|
57
|
+
input: x,
|
|
58
|
+
code: "invalid_type",
|
|
59
|
+
expected: "number",
|
|
60
|
+
received: "string",
|
|
61
|
+
});
|
|
62
|
+
return z.NEVER;
|
|
63
|
+
}
|
|
64
|
+
return unrecognized(num);
|
|
65
|
+
}),
|
|
66
|
+
),
|
|
67
|
+
|
|
68
|
+
// Null or undefined -> 0
|
|
69
|
+
zodDefaultToZeroValue(0),
|
|
70
|
+
]);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function bigint(): z.ZodMiniType<bigint> {
|
|
74
|
+
return z.union([
|
|
75
|
+
z.pipe(
|
|
76
|
+
z.string(),
|
|
77
|
+
z.transform((x, ctx) => {
|
|
78
|
+
try {
|
|
79
|
+
return BigInt(x);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
ctx.issues.push({
|
|
82
|
+
input: x,
|
|
83
|
+
code: "invalid_type",
|
|
84
|
+
expected: "bigint",
|
|
85
|
+
received: "string",
|
|
86
|
+
});
|
|
87
|
+
return z.NEVER;
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
),
|
|
91
|
+
zodDefaultToZeroValue(0n),
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function date(): z.ZodMiniType<Date> {
|
|
96
|
+
return z.union([
|
|
97
|
+
z.pipe(
|
|
98
|
+
z.pipe(
|
|
99
|
+
z.union([z.string(), zodDefaultToZeroValue(0)]),
|
|
100
|
+
z.transform((x) => new Date(x)),
|
|
101
|
+
),
|
|
102
|
+
z.date(),
|
|
103
|
+
),
|
|
104
|
+
z.pipe(
|
|
105
|
+
z.number(),
|
|
106
|
+
z.transform((x, ctx) => {
|
|
107
|
+
const date = new Date(x);
|
|
108
|
+
if (isNaN(date.getTime())) {
|
|
109
|
+
ctx.issues.push({
|
|
110
|
+
input: x,
|
|
111
|
+
code: "invalid_type",
|
|
112
|
+
expected: "date",
|
|
113
|
+
received: "number",
|
|
114
|
+
});
|
|
115
|
+
return z.NEVER;
|
|
116
|
+
}
|
|
117
|
+
return unrecognized(date);
|
|
118
|
+
}),
|
|
119
|
+
),
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function literal<T extends string | number | boolean>(
|
|
124
|
+
value: T,
|
|
125
|
+
): z.ZodMiniType<T> {
|
|
126
|
+
return z.union([z.literal(value), zodDefaultToZeroValue(value)]);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function literalBigInt<T extends bigint>(value: T): z.ZodMiniType<T> {
|
|
130
|
+
return z.pipe(z.literal(String(value)), z.transform((x) => BigInt(x))) as any;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function optional<T extends z.ZodMiniType>(t: T) {
|
|
134
|
+
return z.union([
|
|
135
|
+
z.undefined(),
|
|
136
|
+
|
|
137
|
+
// Null -> undefined
|
|
138
|
+
z.pipe(z.null(), z.transform(() => unrecognized(undefined))),
|
|
139
|
+
t,
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function nullable<T extends z.ZodMiniType>(t: T) {
|
|
144
|
+
return z.union([
|
|
145
|
+
z.null(),
|
|
146
|
+
|
|
147
|
+
// Undefined -> null
|
|
148
|
+
z.pipe(z.undefined(), z.transform(() => defaultToZeroValue(null))),
|
|
149
|
+
t,
|
|
150
|
+
]);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function zodDefaultToZeroValue<T>(value: T): z.ZodMiniType<T> {
|
|
154
|
+
return z.pipe(
|
|
155
|
+
z.any(),
|
|
156
|
+
z.transform((input, ctx) => {
|
|
157
|
+
if (input === undefined) return defaultToZeroValue(value);
|
|
158
|
+
if (input === null) return defaultToZeroValue(value);
|
|
159
|
+
ctx.issues.push({
|
|
160
|
+
input: input,
|
|
161
|
+
code: "invalid_type",
|
|
162
|
+
expected: "undefined",
|
|
163
|
+
received: "unknown",
|
|
164
|
+
});
|
|
165
|
+
return z.NEVER;
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const dateRE = /^\d{4}-\d{2}-\d{2}$/;
|
|
6
|
+
|
|
7
|
+
export class RFCDate {
|
|
8
|
+
private serialized: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new RFCDate instance using today's date.
|
|
12
|
+
*/
|
|
13
|
+
static today(): RFCDate {
|
|
14
|
+
return new RFCDate(new Date());
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new RFCDate instance using the provided input.
|
|
19
|
+
* If a string is used then in must be in the format YYYY-MM-DD.
|
|
20
|
+
*
|
|
21
|
+
* @param date A Date object or a date string in YYYY-MM-DD format
|
|
22
|
+
* @example
|
|
23
|
+
* new RFCDate("2022-01-01")
|
|
24
|
+
* @example
|
|
25
|
+
* new RFCDate(new Date())
|
|
26
|
+
*/
|
|
27
|
+
constructor(date: Date | string) {
|
|
28
|
+
if (typeof date === "string" && !dateRE.test(date)) {
|
|
29
|
+
throw new RangeError(
|
|
30
|
+
"RFCDate: date strings must be in the format YYYY-MM-DD: " + date,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = new Date(date);
|
|
35
|
+
if (isNaN(+value)) {
|
|
36
|
+
throw new RangeError("RFCDate: invalid date provided: " + date);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length);
|
|
40
|
+
if (!dateRE.test(this.serialized)) {
|
|
41
|
+
throw new TypeError(
|
|
42
|
+
`RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
toJSON(): string {
|
|
48
|
+
return this.toString();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
toString(): string {
|
|
52
|
+
return this.serialized;
|
|
53
|
+
}
|
|
54
|
+
}
|