magic-hour 0.0.2
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/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.js +19 -0
- package/dist/core/api-error.d.ts +9 -0
- package/dist/core/api-error.js +14 -0
- package/dist/core/api-promise.d.ts +22 -0
- package/dist/core/api-promise.js +67 -0
- package/dist/core/auth.d.ts +36 -0
- package/dist/core/auth.js +98 -0
- package/dist/core/binary-response.d.ts +9 -0
- package/dist/core/binary-response.js +13 -0
- package/dist/core/content-type.d.ts +7 -0
- package/dist/core/content-type.js +15 -0
- package/dist/core/core-client.d.ts +46 -0
- package/dist/core/core-client.js +149 -0
- package/dist/core/form-data.d.ts +30 -0
- package/dist/core/form-data.js +87 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.js +26 -0
- package/dist/core/runtime.d.ts +7 -0
- package/dist/core/runtime.js +23 -0
- package/dist/environment.d.ts +6 -0
- package/dist/environment.js +10 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +39 -0
- package/dist/resources/index.d.ts +4 -0
- package/dist/resources/index.js +30 -0
- package/dist/resources/v1/ai-image-generator/index.d.ts +5 -0
- package/dist/resources/v1/ai-image-generator/index.js +8 -0
- package/dist/resources/v1/ai-image-generator/request-types.d.ts +7 -0
- package/dist/resources/v1/ai-image-generator/request-types.js +5 -0
- package/dist/resources/v1/ai-image-generator/resource-client.d.ts +13 -0
- package/dist/resources/v1/ai-image-generator/resource-client.js +27 -0
- package/dist/resources/v1/face-swap/index.d.ts +5 -0
- package/dist/resources/v1/face-swap/index.js +8 -0
- package/dist/resources/v1/face-swap/request-types.d.ts +7 -0
- package/dist/resources/v1/face-swap/request-types.js +5 -0
- package/dist/resources/v1/face-swap/resource-client.d.ts +16 -0
- package/dist/resources/v1/face-swap/resource-client.js +30 -0
- package/dist/resources/v1/face-swap-photo/index.d.ts +5 -0
- package/dist/resources/v1/face-swap-photo/index.js +8 -0
- package/dist/resources/v1/face-swap-photo/request-types.d.ts +7 -0
- package/dist/resources/v1/face-swap-photo/request-types.js +5 -0
- package/dist/resources/v1/face-swap-photo/resource-client.d.ts +13 -0
- package/dist/resources/v1/face-swap-photo/resource-client.js +27 -0
- package/dist/resources/v1/files/index.d.ts +5 -0
- package/dist/resources/v1/files/index.js +32 -0
- package/dist/resources/v1/files/resource-client.d.ts +9 -0
- package/dist/resources/v1/files/resource-client.js +15 -0
- package/dist/resources/v1/files/upload-urls/index.d.ts +5 -0
- package/dist/resources/v1/files/upload-urls/index.js +8 -0
- package/dist/resources/v1/files/upload-urls/request-types.d.ts +7 -0
- package/dist/resources/v1/files/upload-urls/request-types.js +5 -0
- package/dist/resources/v1/files/upload-urls/resource-client.d.ts +32 -0
- package/dist/resources/v1/files/upload-urls/resource-client.js +46 -0
- package/dist/resources/v1/image-projects/index.d.ts +5 -0
- package/dist/resources/v1/image-projects/index.js +8 -0
- package/dist/resources/v1/image-projects/request-types.d.ts +6 -0
- package/dist/resources/v1/image-projects/request-types.js +5 -0
- package/dist/resources/v1/image-projects/resource-client.d.ts +22 -0
- package/dist/resources/v1/image-projects/resource-client.js +34 -0
- package/dist/resources/v1/image-to-video/index.d.ts +5 -0
- package/dist/resources/v1/image-to-video/index.js +8 -0
- package/dist/resources/v1/image-to-video/request-types.d.ts +7 -0
- package/dist/resources/v1/image-to-video/request-types.js +5 -0
- package/dist/resources/v1/image-to-video/resource-client.d.ts +16 -0
- package/dist/resources/v1/image-to-video/resource-client.js +30 -0
- package/dist/resources/v1/index.d.ts +14 -0
- package/dist/resources/v1/index.js +41 -0
- package/dist/resources/v1/lip-sync/index.d.ts +5 -0
- package/dist/resources/v1/lip-sync/index.js +8 -0
- package/dist/resources/v1/lip-sync/request-types.d.ts +7 -0
- package/dist/resources/v1/lip-sync/request-types.js +5 -0
- package/dist/resources/v1/lip-sync/resource-client.d.ts +16 -0
- package/dist/resources/v1/lip-sync/resource-client.js +30 -0
- package/dist/resources/v1/resource-client.d.ts +27 -0
- package/dist/resources/v1/resource-client.js +33 -0
- package/dist/resources/v1/text-to-video/index.d.ts +5 -0
- package/dist/resources/v1/text-to-video/index.js +8 -0
- package/dist/resources/v1/text-to-video/request-types.d.ts +7 -0
- package/dist/resources/v1/text-to-video/request-types.js +5 -0
- package/dist/resources/v1/text-to-video/resource-client.d.ts +16 -0
- package/dist/resources/v1/text-to-video/resource-client.js +30 -0
- package/dist/resources/v1/video-projects/index.d.ts +5 -0
- package/dist/resources/v1/video-projects/index.js +8 -0
- package/dist/resources/v1/video-projects/request-types.d.ts +6 -0
- package/dist/resources/v1/video-projects/request-types.js +5 -0
- package/dist/resources/v1/video-projects/resource-client.d.ts +22 -0
- package/dist/resources/v1/video-projects/resource-client.js +34 -0
- package/dist/resources/v1/video-to-video/index.d.ts +5 -0
- package/dist/resources/v1/video-to-video/index.js +8 -0
- package/dist/resources/v1/video-to-video/request-types.d.ts +7 -0
- package/dist/resources/v1/video-to-video/request-types.js +5 -0
- package/dist/resources/v1/video-to-video/resource-client.d.ts +16 -0
- package/dist/resources/v1/video-to-video/resource-client.js +30 -0
- package/dist/types/get-v1-image-projects-id-response-downloads-item.d.ts +7 -0
- package/dist/types/get-v1-image-projects-id-response-downloads-item.js +5 -0
- package/dist/types/get-v1-image-projects-id-response-status-enum.d.ts +11 -0
- package/dist/types/get-v1-image-projects-id-response-status-enum.js +15 -0
- package/dist/types/get-v1-image-projects-id-response-type-enum.d.ts +10 -0
- package/dist/types/get-v1-image-projects-id-response-type-enum.js +14 -0
- package/dist/types/get-v1-image-projects-id-response.d.ts +29 -0
- package/dist/types/get-v1-image-projects-id-response.js +5 -0
- package/dist/types/get-v1-image-projects-id-response400.d.ts +6 -0
- package/dist/types/get-v1-image-projects-id-response400.js +5 -0
- package/dist/types/get-v1-image-projects-id-response401-message-enum.d.ts +6 -0
- package/dist/types/get-v1-image-projects-id-response401-message-enum.js +10 -0
- package/dist/types/get-v1-image-projects-id-response401.d.ts +7 -0
- package/dist/types/get-v1-image-projects-id-response401.js +5 -0
- package/dist/types/get-v1-image-projects-id-response404-message-enum.d.ts +6 -0
- package/dist/types/get-v1-image-projects-id-response404-message-enum.js +10 -0
- package/dist/types/get-v1-image-projects-id-response404.d.ts +7 -0
- package/dist/types/get-v1-image-projects-id-response404.js +5 -0
- package/dist/types/get-v1-video-projects-id-response-download.d.ts +7 -0
- package/dist/types/get-v1-video-projects-id-response-download.js +5 -0
- package/dist/types/get-v1-video-projects-id-response-status-enum.d.ts +11 -0
- package/dist/types/get-v1-video-projects-id-response-status-enum.js +15 -0
- package/dist/types/get-v1-video-projects-id-response-type-enum.d.ts +11 -0
- package/dist/types/get-v1-video-projects-id-response-type-enum.js +15 -0
- package/dist/types/get-v1-video-projects-id-response.d.ts +48 -0
- package/dist/types/get-v1-video-projects-id-response.js +5 -0
- package/dist/types/get-v1-video-projects-id-response400.d.ts +6 -0
- package/dist/types/get-v1-video-projects-id-response400.js +5 -0
- package/dist/types/get-v1-video-projects-id-response401-message-enum.d.ts +6 -0
- package/dist/types/get-v1-video-projects-id-response401-message-enum.js +10 -0
- package/dist/types/get-v1-video-projects-id-response401.d.ts +7 -0
- package/dist/types/get-v1-video-projects-id-response401.js +5 -0
- package/dist/types/get-v1-video-projects-id-response404-message-enum.d.ts +6 -0
- package/dist/types/get-v1-video-projects-id-response404-message-enum.js +10 -0
- package/dist/types/get-v1-video-projects-id-response404.d.ts +7 -0
- package/dist/types/get-v1-video-projects-id-response404.js +5 -0
- package/dist/types/index.d.ts +107 -0
- package/dist/types/index.js +76 -0
- package/dist/types/post-v1-ai-image-generator-body-orientation-enum.d.ts +8 -0
- package/dist/types/post-v1-ai-image-generator-body-orientation-enum.js +12 -0
- package/dist/types/post-v1-ai-image-generator-body-style.d.ts +9 -0
- package/dist/types/post-v1-ai-image-generator-body-style.js +5 -0
- package/dist/types/post-v1-ai-image-generator-body.d.ts +16 -0
- package/dist/types/post-v1-ai-image-generator-body.js +5 -0
- package/dist/types/post-v1-ai-image-generator-response.d.ts +10 -0
- package/dist/types/post-v1-ai-image-generator-response.js +5 -0
- package/dist/types/post-v1-ai-image-generator-response400.d.ts +6 -0
- package/dist/types/post-v1-ai-image-generator-response400.js +5 -0
- package/dist/types/post-v1-ai-image-generator-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-ai-image-generator-response401-message-enum.js +10 -0
- package/dist/types/post-v1-ai-image-generator-response401.d.ts +7 -0
- package/dist/types/post-v1-ai-image-generator-response401.js +5 -0
- package/dist/types/post-v1-ai-image-generator-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-ai-image-generator-response404-message-enum.js +10 -0
- package/dist/types/post-v1-ai-image-generator-response404.d.ts +7 -0
- package/dist/types/post-v1-ai-image-generator-response404.js +5 -0
- package/dist/types/post-v1-ai-image-generator-response422.d.ts +6 -0
- package/dist/types/post-v1-ai-image-generator-response422.js +5 -0
- package/dist/types/post-v1-face-swap-body-assets-video-source-enum.d.ts +7 -0
- package/dist/types/post-v1-face-swap-body-assets-video-source-enum.js +11 -0
- package/dist/types/post-v1-face-swap-body-assets.d.ts +19 -0
- package/dist/types/post-v1-face-swap-body-assets.js +5 -0
- package/dist/types/post-v1-face-swap-body.d.ts +30 -0
- package/dist/types/post-v1-face-swap-body.js +5 -0
- package/dist/types/post-v1-face-swap-photo-body-assets.d.ts +13 -0
- package/dist/types/post-v1-face-swap-photo-body-assets.js +5 -0
- package/dist/types/post-v1-face-swap-photo-body.d.ts +14 -0
- package/dist/types/post-v1-face-swap-photo-body.js +5 -0
- package/dist/types/post-v1-face-swap-photo-response.d.ts +10 -0
- package/dist/types/post-v1-face-swap-photo-response.js +5 -0
- package/dist/types/post-v1-face-swap-photo-response400.d.ts +6 -0
- package/dist/types/post-v1-face-swap-photo-response400.js +5 -0
- package/dist/types/post-v1-face-swap-photo-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-face-swap-photo-response401-message-enum.js +10 -0
- package/dist/types/post-v1-face-swap-photo-response401.d.ts +7 -0
- package/dist/types/post-v1-face-swap-photo-response401.js +5 -0
- package/dist/types/post-v1-face-swap-photo-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-face-swap-photo-response404-message-enum.js +10 -0
- package/dist/types/post-v1-face-swap-photo-response404.d.ts +7 -0
- package/dist/types/post-v1-face-swap-photo-response404.js +5 -0
- package/dist/types/post-v1-face-swap-photo-response422.d.ts +6 -0
- package/dist/types/post-v1-face-swap-photo-response422.js +5 -0
- package/dist/types/post-v1-face-swap-response.d.ts +13 -0
- package/dist/types/post-v1-face-swap-response.js +5 -0
- package/dist/types/post-v1-face-swap-response400.d.ts +6 -0
- package/dist/types/post-v1-face-swap-response400.js +5 -0
- package/dist/types/post-v1-face-swap-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-face-swap-response401-message-enum.js +10 -0
- package/dist/types/post-v1-face-swap-response401.d.ts +7 -0
- package/dist/types/post-v1-face-swap-response401.js +5 -0
- package/dist/types/post-v1-face-swap-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-face-swap-response404-message-enum.js +10 -0
- package/dist/types/post-v1-face-swap-response404.d.ts +7 -0
- package/dist/types/post-v1-face-swap-response404.js +5 -0
- package/dist/types/post-v1-face-swap-response422.d.ts +6 -0
- package/dist/types/post-v1-face-swap-response422.js +5 -0
- package/dist/types/post-v1-files-upload-urls-body-items-item-type-enum.d.ts +8 -0
- package/dist/types/post-v1-files-upload-urls-body-items-item-type-enum.js +12 -0
- package/dist/types/post-v1-files-upload-urls-body-items-item.d.ts +14 -0
- package/dist/types/post-v1-files-upload-urls-body-items-item.js +5 -0
- package/dist/types/post-v1-files-upload-urls-body.d.ts +7 -0
- package/dist/types/post-v1-files-upload-urls-body.js +5 -0
- package/dist/types/post-v1-files-upload-urls-response-items-item.d.ts +8 -0
- package/dist/types/post-v1-files-upload-urls-response-items-item.js +5 -0
- package/dist/types/post-v1-files-upload-urls-response.d.ts +7 -0
- package/dist/types/post-v1-files-upload-urls-response.js +5 -0
- package/dist/types/post-v1-files-upload-urls-response400.d.ts +6 -0
- package/dist/types/post-v1-files-upload-urls-response400.js +5 -0
- package/dist/types/post-v1-files-upload-urls-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-files-upload-urls-response401-message-enum.js +10 -0
- package/dist/types/post-v1-files-upload-urls-response401.d.ts +7 -0
- package/dist/types/post-v1-files-upload-urls-response401.js +5 -0
- package/dist/types/post-v1-files-upload-urls-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-files-upload-urls-response404-message-enum.js +10 -0
- package/dist/types/post-v1-files-upload-urls-response404.d.ts +7 -0
- package/dist/types/post-v1-files-upload-urls-response404.js +5 -0
- package/dist/types/post-v1-files-upload-urls-response422.d.ts +6 -0
- package/dist/types/post-v1-files-upload-urls-response422.js +5 -0
- package/dist/types/post-v1-image-to-video-body-assets.d.ts +9 -0
- package/dist/types/post-v1-image-to-video-body-assets.js +5 -0
- package/dist/types/post-v1-image-to-video-body-style.d.ts +9 -0
- package/dist/types/post-v1-image-to-video-body-style.js +5 -0
- package/dist/types/post-v1-image-to-video-body.d.ts +27 -0
- package/dist/types/post-v1-image-to-video-body.js +5 -0
- package/dist/types/post-v1-image-to-video-response.d.ts +13 -0
- package/dist/types/post-v1-image-to-video-response.js +5 -0
- package/dist/types/post-v1-image-to-video-response400.d.ts +6 -0
- package/dist/types/post-v1-image-to-video-response400.js +5 -0
- package/dist/types/post-v1-image-to-video-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-image-to-video-response401-message-enum.js +10 -0
- package/dist/types/post-v1-image-to-video-response401.d.ts +7 -0
- package/dist/types/post-v1-image-to-video-response401.js +5 -0
- package/dist/types/post-v1-image-to-video-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-image-to-video-response404-message-enum.js +10 -0
- package/dist/types/post-v1-image-to-video-response404.d.ts +7 -0
- package/dist/types/post-v1-image-to-video-response404.js +5 -0
- package/dist/types/post-v1-image-to-video-response422.d.ts +6 -0
- package/dist/types/post-v1-image-to-video-response422.js +5 -0
- package/dist/types/post-v1-lip-sync-body-assets-video-source-enum.d.ts +7 -0
- package/dist/types/post-v1-lip-sync-body-assets-video-source-enum.js +11 -0
- package/dist/types/post-v1-lip-sync-body-assets.d.ts +19 -0
- package/dist/types/post-v1-lip-sync-body-assets.js +5 -0
- package/dist/types/post-v1-lip-sync-body.d.ts +30 -0
- package/dist/types/post-v1-lip-sync-body.js +5 -0
- package/dist/types/post-v1-lip-sync-response.d.ts +13 -0
- package/dist/types/post-v1-lip-sync-response.js +5 -0
- package/dist/types/post-v1-lip-sync-response400.d.ts +6 -0
- package/dist/types/post-v1-lip-sync-response400.js +5 -0
- package/dist/types/post-v1-lip-sync-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-lip-sync-response401-message-enum.js +10 -0
- package/dist/types/post-v1-lip-sync-response401.d.ts +7 -0
- package/dist/types/post-v1-lip-sync-response401.js +5 -0
- package/dist/types/post-v1-lip-sync-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-lip-sync-response404-message-enum.js +10 -0
- package/dist/types/post-v1-lip-sync-response404.d.ts +7 -0
- package/dist/types/post-v1-lip-sync-response404.js +5 -0
- package/dist/types/post-v1-lip-sync-response422.d.ts +6 -0
- package/dist/types/post-v1-lip-sync-response422.js +5 -0
- package/dist/types/post-v1-text-to-video-body-orientation-enum.d.ts +8 -0
- package/dist/types/post-v1-text-to-video-body-orientation-enum.js +12 -0
- package/dist/types/post-v1-text-to-video-body-style.d.ts +9 -0
- package/dist/types/post-v1-text-to-video-body-style.js +5 -0
- package/dist/types/post-v1-text-to-video-body.d.ts +19 -0
- package/dist/types/post-v1-text-to-video-body.js +5 -0
- package/dist/types/post-v1-text-to-video-response.d.ts +13 -0
- package/dist/types/post-v1-text-to-video-response.js +5 -0
- package/dist/types/post-v1-text-to-video-response400.d.ts +6 -0
- package/dist/types/post-v1-text-to-video-response400.js +5 -0
- package/dist/types/post-v1-text-to-video-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-text-to-video-response401-message-enum.js +10 -0
- package/dist/types/post-v1-text-to-video-response401.d.ts +7 -0
- package/dist/types/post-v1-text-to-video-response401.js +5 -0
- package/dist/types/post-v1-text-to-video-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-text-to-video-response404-message-enum.js +10 -0
- package/dist/types/post-v1-text-to-video-response404.d.ts +7 -0
- package/dist/types/post-v1-text-to-video-response404.js +5 -0
- package/dist/types/post-v1-text-to-video-response422.d.ts +6 -0
- package/dist/types/post-v1-text-to-video-response422.js +5 -0
- package/dist/types/post-v1-video-to-video-body-assets-video-source-enum.d.ts +7 -0
- package/dist/types/post-v1-video-to-video-body-assets-video-source-enum.js +11 -0
- package/dist/types/post-v1-video-to-video-body-assets.d.ts +15 -0
- package/dist/types/post-v1-video-to-video-body-assets.js +5 -0
- package/dist/types/post-v1-video-to-video-body-fps-resolution-enum.d.ts +7 -0
- package/dist/types/post-v1-video-to-video-body-fps-resolution-enum.js +11 -0
- package/dist/types/post-v1-video-to-video-body-style-art-style-enum.d.ts +64 -0
- package/dist/types/post-v1-video-to-video-body-style-art-style-enum.js +68 -0
- package/dist/types/post-v1-video-to-video-body-style-model-enum.d.ts +9 -0
- package/dist/types/post-v1-video-to-video-body-style-model-enum.js +13 -0
- package/dist/types/post-v1-video-to-video-body-style-prompt-type-enum.d.ts +8 -0
- package/dist/types/post-v1-video-to-video-body-style-prompt-type-enum.js +12 -0
- package/dist/types/post-v1-video-to-video-body-style-version-enum.d.ts +8 -0
- package/dist/types/post-v1-video-to-video-body-style-version-enum.js +12 -0
- package/dist/types/post-v1-video-to-video-body-style.d.ts +30 -0
- package/dist/types/post-v1-video-to-video-body-style.js +5 -0
- package/dist/types/post-v1-video-to-video-body.d.ts +37 -0
- package/dist/types/post-v1-video-to-video-body.js +5 -0
- package/dist/types/post-v1-video-to-video-response.d.ts +13 -0
- package/dist/types/post-v1-video-to-video-response.js +5 -0
- package/dist/types/post-v1-video-to-video-response400.d.ts +6 -0
- package/dist/types/post-v1-video-to-video-response400.js +5 -0
- package/dist/types/post-v1-video-to-video-response401-message-enum.d.ts +6 -0
- package/dist/types/post-v1-video-to-video-response401-message-enum.js +10 -0
- package/dist/types/post-v1-video-to-video-response401.d.ts +7 -0
- package/dist/types/post-v1-video-to-video-response401.js +5 -0
- package/dist/types/post-v1-video-to-video-response404-message-enum.d.ts +6 -0
- package/dist/types/post-v1-video-to-video-response404-message-enum.js +10 -0
- package/dist/types/post-v1-video-to-video-response404.d.ts +7 -0
- package/dist/types/post-v1-video-to-video-response404.js +5 -0
- package/dist/types/post-v1-video-to-video-response422.d.ts +6 -0
- package/dist/types/post-v1-video-to-video-response422.js +5 -0
- package/package.json +37 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createForm = exports.isBlobLike = exports.isFileLike = exports.isNodeReadStream = exports.isUploadFile = void 0;
|
|
7
|
+
const runtime_1 = require("./runtime");
|
|
8
|
+
function isUploadFile(val) {
|
|
9
|
+
return isFileLike(val) || isNodeReadStream(val);
|
|
10
|
+
}
|
|
11
|
+
exports.isUploadFile = isUploadFile;
|
|
12
|
+
function isNodeReadStream(val) {
|
|
13
|
+
// node read stream ducktyping check
|
|
14
|
+
return (runtime_1.RUNTIME.type === "node" &&
|
|
15
|
+
typeof val === "object" &&
|
|
16
|
+
typeof val.bytesRead === "number" &&
|
|
17
|
+
(typeof val.path === "string" || val.path instanceof Buffer) &&
|
|
18
|
+
typeof val.pending === "boolean" &&
|
|
19
|
+
typeof val.readable === "boolean" &&
|
|
20
|
+
typeof val.read === "function" &&
|
|
21
|
+
typeof val.setEncoding === "function" &&
|
|
22
|
+
typeof val.pause === "function" &&
|
|
23
|
+
typeof val.resume === "function" &&
|
|
24
|
+
typeof val.isPaused === "function" &&
|
|
25
|
+
typeof val.pipe === "function" &&
|
|
26
|
+
typeof val.unpipe === "function" &&
|
|
27
|
+
typeof val.unshift === "function" &&
|
|
28
|
+
typeof val.wrap === "function");
|
|
29
|
+
}
|
|
30
|
+
exports.isNodeReadStream = isNodeReadStream;
|
|
31
|
+
function isFileLike(val) {
|
|
32
|
+
// https://developer.mozilla.org/docs/Web/API/File
|
|
33
|
+
// https://github.com/node-fetch/fetch-blob/blob/main/file.js
|
|
34
|
+
return (typeof (val === null || val === void 0 ? void 0 : val.lastModified) === "number" &&
|
|
35
|
+
typeof (val === null || val === void 0 ? void 0 : val.name) === "string" &&
|
|
36
|
+
isBlobLike(val));
|
|
37
|
+
}
|
|
38
|
+
exports.isFileLike = isFileLike;
|
|
39
|
+
function isBlobLike(val) {
|
|
40
|
+
// https://developer.mozilla.org/docs/Web/API/Blob
|
|
41
|
+
// https://github.com/node-fetch/fetch-blob/blob/main/index.js
|
|
42
|
+
return (typeof (val === null || val === void 0 ? void 0 : val.size) === "number" &&
|
|
43
|
+
typeof (val === null || val === void 0 ? void 0 : val.type) === "string" &&
|
|
44
|
+
typeof (val === null || val === void 0 ? void 0 : val.slice) === "function" &&
|
|
45
|
+
typeof (val === null || val === void 0 ? void 0 : val.text) === "function" &&
|
|
46
|
+
typeof (val === null || val === void 0 ? void 0 : val.arrayBuffer) === "function");
|
|
47
|
+
}
|
|
48
|
+
exports.isBlobLike = isBlobLike;
|
|
49
|
+
function appendFormData(form, key, val) {
|
|
50
|
+
if (val === null || typeof val === "undefined") {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
else if (["string", "boolean", "number"].includes(typeof val)) {
|
|
54
|
+
form.append(key, val.toString());
|
|
55
|
+
}
|
|
56
|
+
else if (Array.isArray(val)) {
|
|
57
|
+
for (const arrVal of val) {
|
|
58
|
+
appendFormData(form, key, arrVal);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else if (isUploadFile(val)) {
|
|
62
|
+
form.append(key, val);
|
|
63
|
+
}
|
|
64
|
+
else if (typeof val === "object") {
|
|
65
|
+
for (const [objKey, objVal] of Object.entries(val)) {
|
|
66
|
+
appendFormData(form, `${key}[${objKey}]`, objVal);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
throw new TypeError(`Invalid value given to form: ${val}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function createForm(data) {
|
|
74
|
+
let form;
|
|
75
|
+
if (runtime_1.RUNTIME.type === "node") {
|
|
76
|
+
const NodeFormData = require("form-data");
|
|
77
|
+
form = new NodeFormData();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
form = new FormData();
|
|
81
|
+
}
|
|
82
|
+
for (const [key, val] of Object.entries(data)) {
|
|
83
|
+
appendFormData(form, key, val);
|
|
84
|
+
}
|
|
85
|
+
return form;
|
|
86
|
+
}
|
|
87
|
+
exports.createForm = createForm;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Sideko (sideko.dev)
|
|
3
|
+
**/
|
|
4
|
+
export { CoreClient, CoreClientProps, CoreResourceClient, RequestOptions, } from "./core-client";
|
|
5
|
+
export { AuthProvider, AuthBasic, AuthBearer, AuthKeyQuery, AuthKeyHeader, AuthCookieHeader, } from "./auth";
|
|
6
|
+
export { RUNTIME } from "./runtime";
|
|
7
|
+
export { ApiPromise } from "./api-promise";
|
|
8
|
+
export { BinaryResponse } from "./binary-response";
|
|
9
|
+
export { ApiError } from "./api-error";
|
|
10
|
+
export { createForm, UploadFile, isUploadFile } from "./form-data";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isUploadFile = exports.createForm = exports.ApiError = exports.BinaryResponse = exports.ApiPromise = exports.RUNTIME = exports.AuthCookieHeader = exports.AuthKeyHeader = exports.AuthKeyQuery = exports.AuthBearer = exports.AuthBasic = exports.CoreResourceClient = exports.CoreClient = void 0;
|
|
7
|
+
var core_client_1 = require("./core-client");
|
|
8
|
+
Object.defineProperty(exports, "CoreClient", { enumerable: true, get: function () { return core_client_1.CoreClient; } });
|
|
9
|
+
Object.defineProperty(exports, "CoreResourceClient", { enumerable: true, get: function () { return core_client_1.CoreResourceClient; } });
|
|
10
|
+
var auth_1 = require("./auth");
|
|
11
|
+
Object.defineProperty(exports, "AuthBasic", { enumerable: true, get: function () { return auth_1.AuthBasic; } });
|
|
12
|
+
Object.defineProperty(exports, "AuthBearer", { enumerable: true, get: function () { return auth_1.AuthBearer; } });
|
|
13
|
+
Object.defineProperty(exports, "AuthKeyQuery", { enumerable: true, get: function () { return auth_1.AuthKeyQuery; } });
|
|
14
|
+
Object.defineProperty(exports, "AuthKeyHeader", { enumerable: true, get: function () { return auth_1.AuthKeyHeader; } });
|
|
15
|
+
Object.defineProperty(exports, "AuthCookieHeader", { enumerable: true, get: function () { return auth_1.AuthCookieHeader; } });
|
|
16
|
+
var runtime_1 = require("./runtime");
|
|
17
|
+
Object.defineProperty(exports, "RUNTIME", { enumerable: true, get: function () { return runtime_1.RUNTIME; } });
|
|
18
|
+
var api_promise_1 = require("./api-promise");
|
|
19
|
+
Object.defineProperty(exports, "ApiPromise", { enumerable: true, get: function () { return api_promise_1.ApiPromise; } });
|
|
20
|
+
var binary_response_1 = require("./binary-response");
|
|
21
|
+
Object.defineProperty(exports, "BinaryResponse", { enumerable: true, get: function () { return binary_response_1.BinaryResponse; } });
|
|
22
|
+
var api_error_1 = require("./api-error");
|
|
23
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return api_error_1.ApiError; } });
|
|
24
|
+
var form_data_1 = require("./form-data");
|
|
25
|
+
Object.defineProperty(exports, "createForm", { enumerable: true, get: function () { return form_data_1.createForm; } });
|
|
26
|
+
Object.defineProperty(exports, "isUploadFile", { enumerable: true, get: function () { return form_data_1.isUploadFile; } });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
var _a;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.RUNTIME = void 0;
|
|
8
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
9
|
+
const isNode = typeof process !== "undefined" &&
|
|
10
|
+
Boolean(process.version) &&
|
|
11
|
+
Boolean((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
12
|
+
function getRuntime() {
|
|
13
|
+
if (isBrowser) {
|
|
14
|
+
return { type: "browser" };
|
|
15
|
+
}
|
|
16
|
+
else if (isNode) {
|
|
17
|
+
return { type: "node" };
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return { type: "unknown" };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.RUNTIME = getRuntime();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Environment = void 0;
|
|
7
|
+
var Environment;
|
|
8
|
+
(function (Environment) {
|
|
9
|
+
Environment["Environment"] = "https://api.magichour.ai";
|
|
10
|
+
})(Environment = exports.Environment || (exports.Environment = {}));
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Client as default } from "./client";
|
|
2
|
+
export { ApiError, BinaryResponse, RequestOptions, UploadFile, isUploadFile, } from "./core";
|
|
3
|
+
export { Environment } from "./environment";
|
|
4
|
+
export * as resources from "./resources";
|
|
5
|
+
export * as types from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* Generated by Sideko (sideko.dev)
|
|
8
|
+
**/
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.types = exports.resources = exports.Environment = exports.isUploadFile = exports.BinaryResponse = exports.ApiError = exports.default = void 0;
|
|
27
|
+
var client_1 = require("./client");
|
|
28
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_1.Client; } });
|
|
29
|
+
var core_1 = require("./core");
|
|
30
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return core_1.ApiError; } });
|
|
31
|
+
Object.defineProperty(exports, "BinaryResponse", { enumerable: true, get: function () { return core_1.BinaryResponse; } });
|
|
32
|
+
Object.defineProperty(exports, "isUploadFile", { enumerable: true, get: function () { return core_1.isUploadFile; } });
|
|
33
|
+
var environment_1 = require("./environment");
|
|
34
|
+
Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return environment_1.Environment; } });
|
|
35
|
+
exports.resources = __importStar(require("./resources"));
|
|
36
|
+
exports.types = __importStar(require("./types"));
|
|
37
|
+
/**
|
|
38
|
+
* Generated by Sideko (sideko.dev)
|
|
39
|
+
**/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.v1 = void 0;
|
|
27
|
+
exports.v1 = __importStar(require("./v1"));
|
|
28
|
+
/**
|
|
29
|
+
* Generated by Sideko (sideko.dev)
|
|
30
|
+
**/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AiImageGeneratorClient = void 0;
|
|
7
|
+
var resource_client_1 = require("./resource-client");
|
|
8
|
+
Object.defineProperty(exports, "AiImageGeneratorClient", { enumerable: true, get: function () { return resource_client_1.AiImageGeneratorClient; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Sideko (sideko.dev)
|
|
3
|
+
**/
|
|
4
|
+
import { types } from "../../../index.js";
|
|
5
|
+
import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions } from "../../../core";
|
|
6
|
+
import * as requests from "../../../resources/v1/ai-image-generator/request-types";
|
|
7
|
+
export declare class AiImageGeneratorClient extends CoreResourceClient {
|
|
8
|
+
constructor(client: CoreClient);
|
|
9
|
+
/**
|
|
10
|
+
* Create an AI image. Each image costs 5 frames.
|
|
11
|
+
*/
|
|
12
|
+
create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.PostV1AiImageGeneratorResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AiImageGeneratorClient = void 0;
|
|
7
|
+
const core_1 = require("../../../core");
|
|
8
|
+
class AiImageGeneratorClient extends core_1.CoreResourceClient {
|
|
9
|
+
constructor(client) {
|
|
10
|
+
super(client);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create an AI image. Each image costs 5 frames.
|
|
14
|
+
*/
|
|
15
|
+
create(request, opts) {
|
|
16
|
+
return this._client.makeRequest({
|
|
17
|
+
method: "post",
|
|
18
|
+
path: "/v1/ai-image-generator",
|
|
19
|
+
auth: ["bearerAuth"],
|
|
20
|
+
contentType: "application/json",
|
|
21
|
+
body: request.data,
|
|
22
|
+
responseType: "json",
|
|
23
|
+
opts,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.AiImageGeneratorClient = AiImageGeneratorClient;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FaceSwapClient = void 0;
|
|
7
|
+
var resource_client_1 = require("./resource-client");
|
|
8
|
+
Object.defineProperty(exports, "FaceSwapClient", { enumerable: true, get: function () { return resource_client_1.FaceSwapClient; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Sideko (sideko.dev)
|
|
3
|
+
**/
|
|
4
|
+
import { types } from "../../../index.js";
|
|
5
|
+
import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions } from "../../../core";
|
|
6
|
+
import * as requests from "../../../resources/v1/face-swap/request-types";
|
|
7
|
+
export declare class FaceSwapClient extends CoreResourceClient {
|
|
8
|
+
constructor(client: CoreClient);
|
|
9
|
+
/**
|
|
10
|
+
* Create a Face Swap video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
11
|
+
*
|
|
12
|
+
* Get more information about this mode at our [product page](/products/face-swap).
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.PostV1FaceSwapResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FaceSwapClient = void 0;
|
|
7
|
+
const core_1 = require("../../../core");
|
|
8
|
+
class FaceSwapClient extends core_1.CoreResourceClient {
|
|
9
|
+
constructor(client) {
|
|
10
|
+
super(client);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create a Face Swap video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
14
|
+
*
|
|
15
|
+
* Get more information about this mode at our [product page](/products/face-swap).
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
create(request, opts) {
|
|
19
|
+
return this._client.makeRequest({
|
|
20
|
+
method: "post",
|
|
21
|
+
path: "/v1/face-swap",
|
|
22
|
+
auth: ["bearerAuth"],
|
|
23
|
+
contentType: "application/json",
|
|
24
|
+
body: request.data,
|
|
25
|
+
responseType: "json",
|
|
26
|
+
opts,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.FaceSwapClient = FaceSwapClient;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FaceSwapPhotoClient = void 0;
|
|
7
|
+
var resource_client_1 = require("./resource-client");
|
|
8
|
+
Object.defineProperty(exports, "FaceSwapPhotoClient", { enumerable: true, get: function () { return resource_client_1.FaceSwapPhotoClient; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Sideko (sideko.dev)
|
|
3
|
+
**/
|
|
4
|
+
import { types } from "../../../index.js";
|
|
5
|
+
import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions } from "../../../core";
|
|
6
|
+
import * as requests from "../../../resources/v1/face-swap-photo/request-types";
|
|
7
|
+
export declare class FaceSwapPhotoClient extends CoreResourceClient {
|
|
8
|
+
constructor(client: CoreClient);
|
|
9
|
+
/**
|
|
10
|
+
* Create a face swap photo. Each photo costs 5 frames. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
11
|
+
*/
|
|
12
|
+
create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.PostV1FaceSwapPhotoResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FaceSwapPhotoClient = void 0;
|
|
7
|
+
const core_1 = require("../../../core");
|
|
8
|
+
class FaceSwapPhotoClient extends core_1.CoreResourceClient {
|
|
9
|
+
constructor(client) {
|
|
10
|
+
super(client);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create a face swap photo. Each photo costs 5 frames. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
14
|
+
*/
|
|
15
|
+
create(request, opts) {
|
|
16
|
+
return this._client.makeRequest({
|
|
17
|
+
method: "post",
|
|
18
|
+
path: "/v1/face-swap-photo",
|
|
19
|
+
auth: ["bearerAuth"],
|
|
20
|
+
contentType: "application/json",
|
|
21
|
+
body: request.data,
|
|
22
|
+
responseType: "json",
|
|
23
|
+
opts,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.FaceSwapPhotoClient = FaceSwapPhotoClient;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.uploadUrls = exports.FilesClient = void 0;
|
|
30
|
+
var resource_client_1 = require("./resource-client");
|
|
31
|
+
Object.defineProperty(exports, "FilesClient", { enumerable: true, get: function () { return resource_client_1.FilesClient; } });
|
|
32
|
+
exports.uploadUrls = __importStar(require("./upload-urls"));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Sideko (sideko.dev)
|
|
3
|
+
**/
|
|
4
|
+
import { CoreClient, CoreResourceClient } from "../../../core";
|
|
5
|
+
import { UploadUrlsClient } from "../../../resources/v1/files/upload-urls";
|
|
6
|
+
export declare class FilesClient extends CoreResourceClient {
|
|
7
|
+
uploadUrls: UploadUrlsClient;
|
|
8
|
+
constructor(client: CoreClient);
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FilesClient = void 0;
|
|
7
|
+
const core_1 = require("../../../core");
|
|
8
|
+
const upload_urls_1 = require("../../../resources/v1/files/upload-urls");
|
|
9
|
+
class FilesClient extends core_1.CoreResourceClient {
|
|
10
|
+
constructor(client) {
|
|
11
|
+
super(client);
|
|
12
|
+
this.uploadUrls = new upload_urls_1.UploadUrlsClient(this._client);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.FilesClient = FilesClient;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by Sideko (sideko.dev)
|
|
4
|
+
**/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UploadUrlsClient = void 0;
|
|
7
|
+
var resource_client_1 = require("./resource-client");
|
|
8
|
+
Object.defineProperty(exports, "UploadUrlsClient", { enumerable: true, get: function () { return resource_client_1.UploadUrlsClient; } });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by Sideko (sideko.dev)
|
|
3
|
+
**/
|
|
4
|
+
import { types } from "../../../../index.js";
|
|
5
|
+
import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions } from "../../../../core";
|
|
6
|
+
import * as requests from "../../../../resources/v1/files/upload-urls/request-types";
|
|
7
|
+
export declare class UploadUrlsClient extends CoreResourceClient {
|
|
8
|
+
constructor(client: CoreClient);
|
|
9
|
+
/**
|
|
10
|
+
* Create a list of urls used to upload the assets needed to generate a video. Each video type has their own requirements on what assets are required. Please refer to the specific mode API for more details. The response array will be in the same order as the request body.
|
|
11
|
+
*
|
|
12
|
+
* Below is the list of valid extensions for each asset type:
|
|
13
|
+
*
|
|
14
|
+
* - video: mp4, mov, webm
|
|
15
|
+
* - audio: mp3, mpeg, wav, aac, aiff, flac
|
|
16
|
+
* - image: png, jpg, jpeg, webp, avif, jp2, tiff, bmp
|
|
17
|
+
*
|
|
18
|
+
* Note: `.gif` is supported for face swap API `video_file_path` field.
|
|
19
|
+
*
|
|
20
|
+
* After receiving the upload url, you can upload the file by sending a PUT request with the header `'Content-Type: application/octet-stream'`.
|
|
21
|
+
*
|
|
22
|
+
* For example using curl
|
|
23
|
+
*
|
|
24
|
+
* ```
|
|
25
|
+
* curl -X PUT -H 'Content-Type: application/octet-stream' \
|
|
26
|
+
* --data '@/path/to/file/video.mp4' \
|
|
27
|
+
* https://videos.magichour.ai/api-assets/id/video.mp4?auth-value=1234567890
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.PostV1FilesUploadUrlsResponse>;
|
|
32
|
+
}
|