@purpleschool/gptbot 0.8.57 → 0.8.59
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/api/controllers/http/ai-model.ts +1 -0
- package/api/controllers/http/community.ts +25 -0
- package/api/controllers/http/image-generation.ts +14 -0
- package/api/controllers/http/index.ts +3 -0
- package/api/controllers/http/page.ts +1 -0
- package/api/controllers/http/paraphrase.ts +6 -0
- package/api/controllers/http/payment.ts +1 -0
- package/api/controllers/http/presentation.ts +1 -0
- package/api/controllers/http/product.ts +1 -1
- package/api/controllers/http/referral.ts +1 -1
- package/api/controllers/http/review.ts +1 -0
- package/api/controllers/http/subscription.ts +1 -1
- package/api/controllers/http/ui-notification.ts +2 -2
- package/api/controllers/http/user-profile.ts +8 -0
- package/api/controllers/http/user-to-subscription.ts +1 -0
- package/api/controllers/http/user.ts +2 -0
- package/api/routes.ts +140 -18
- package/build/api/controllers/http/ai-model.js +1 -0
- package/build/api/controllers/http/community.js +25 -0
- package/build/api/controllers/http/image-generation.js +16 -0
- package/build/api/controllers/http/index.js +3 -0
- package/build/api/controllers/http/page.js +1 -0
- package/build/api/controllers/http/paraphrase.js +6 -0
- package/build/api/controllers/http/payment.js +1 -0
- package/build/api/controllers/http/presentation.js +1 -0
- package/build/api/controllers/http/product.js +1 -1
- package/build/api/controllers/http/referral.js +1 -1
- package/build/api/controllers/http/review.js +1 -0
- package/build/api/controllers/http/subscription.js +1 -1
- package/build/api/controllers/http/ui-notification.js +2 -2
- package/build/api/controllers/http/user-profile.js +10 -0
- package/build/api/controllers/http/user-to-subscription.js +1 -0
- package/build/api/controllers/http/user.js +2 -0
- package/build/api/routes.js +100 -18
- package/build/commands/ai-model/find-formatted-ai-model-v2.command.js +23 -0
- package/build/commands/ai-model/find-model-pages.command.js +31 -0
- package/build/commands/ai-model/index.js +2 -0
- package/build/commands/b2b/submit-balance-top-up-form.command.js +5 -3
- package/build/commands/community/archive-community-post.command.js +13 -0
- package/build/commands/community/create-community-post.command.js +34 -0
- package/build/commands/community/delete-community-post.command.js +13 -0
- package/build/commands/community/get-all-community-posts-by-criteria.command.js +25 -0
- package/build/commands/community/get-community-post-by-uuid.command.js +14 -0
- package/build/commands/community/get-count-of-likes-on-my-posts.command.js +10 -0
- package/build/commands/community/get-my-community-posts-by-criteria.command.js +32 -0
- package/build/commands/community/get-my-favorite-community-posts.command.js +19 -0
- package/build/commands/community/get-my-likes-community-posts.command.js +19 -0
- package/build/commands/community/index.js +29 -0
- package/build/commands/community/send-report-to-community-post.command.js +15 -0
- package/build/commands/community/set-favorite-community-post.command.js +13 -0
- package/build/commands/community/set-like-community-post.command.js +14 -0
- package/build/commands/community/share-my-community-post.command.js +13 -0
- package/build/commands/folder/find-folder-by-uuid-with-chats.command.js +1 -0
- package/build/commands/folder/find-folders-by-user.command.js +1 -0
- package/build/commands/index.js +2 -0
- package/build/commands/payment/check.command.js +1 -1
- package/build/commands/payment/index.js +1 -0
- package/build/commands/payment/refund-payment.command.js +15 -0
- package/build/commands/review/create-review.command.js +1 -1
- package/build/commands/review/find-all-reviews.command.js +20 -0
- package/build/commands/review/find-reviews.command.js +1 -1
- package/build/commands/review/get-review-count.command.js +15 -0
- package/build/commands/review/index.js +2 -0
- package/build/commands/subscription/create-custom-subscription-plan.command.js +1 -1
- package/build/commands/tools/image-editor/retry-image-editor-job.command.js +10 -0
- package/build/commands/tools/image-editor/set-reaction-to-image-editor-job.command.js +11 -1
- package/build/commands/tools/image-generation/delete-all-image-generation-jobs.command.js +10 -0
- package/build/commands/tools/image-generation/delete-image-generation-job-by-uuid.command.js +13 -0
- package/build/commands/tools/image-generation/find-image-generation-job-by-uuid.command.js +14 -0
- package/build/commands/tools/image-generation/find-image-generation-jobs.command.js +18 -0
- package/build/commands/tools/image-generation/get-image-generation-config.command.js +11 -0
- package/build/commands/tools/image-generation/image-generation.command.js +23 -0
- package/build/commands/tools/image-generation/index.js +24 -0
- package/build/commands/tools/image-generation/set-reaction-to-image-generation-job.command.js +28 -0
- package/build/commands/tools/image-generation/update-image-generation-job-title.command.js +17 -0
- package/build/commands/tools/index.js +1 -0
- package/build/commands/tools/music/retry-music-job.command.js +4 -0
- package/build/commands/tools/music/set-reaction-to-music-job.command.js +11 -1
- package/build/commands/tools/paraphrase/delete-all-paraphrase-jobs.command.js +8 -0
- package/build/commands/tools/paraphrase/delete-paraphrase-job-by-uuid.command.js +11 -0
- package/build/commands/tools/paraphrase/find-paraphrase-jobs.command.js +18 -0
- package/build/commands/tools/paraphrase/index.js +7 -1
- package/build/commands/tools/paraphrase/retry-paraphrase-job.command.js +14 -0
- package/build/commands/tools/paraphrase/set-reaction-to-paraphrase-job.command.js +28 -0
- package/build/commands/tools/paraphrase/update-paraphrase-job-title.command.js +17 -0
- package/build/commands/tools/presentation/index.js +1 -0
- package/build/commands/tools/presentation/set-reaction-to-presentation.command.js +28 -0
- package/build/commands/tools/stt/set-reaction-to-stt-job.command.js +11 -1
- package/build/commands/tools/tts/set-reaction-to-tts-job.command.js +11 -1
- package/build/commands/tools/video/retry-video-job.command.js +5 -0
- package/build/commands/tools/video/set-reaction-to-video-job.command.js +11 -1
- package/build/commands/tools/video-editor/retry-video-editor-job.command.js +5 -0
- package/build/commands/tools/video-editor/set-reaction-to-video-editor-job.command.js +11 -1
- package/build/commands/tools/writer/set-reaction.writer-document.command.js +11 -1
- package/build/commands/user/cancel-user-subscription.command.js +21 -0
- package/build/commands/user/find-users-by-criteria.command.js +1 -1
- package/build/commands/user/get-me.command.js +2 -0
- package/build/commands/user/get-user-payments.command.js +26 -0
- package/build/commands/user/get-user-products.command.js +1 -1
- package/build/commands/user/get-user-subscriptions.command.js +1 -1
- package/build/commands/user/index.js +2 -0
- package/build/commands/user-profile/delete-avatar.command.js +12 -0
- package/build/commands/user-profile/get-user-profile-by-user-id.command.js +14 -0
- package/build/commands/user-profile/index.js +20 -0
- package/build/commands/user-profile/update-profile.command.js +14 -0
- package/build/commands/user-profile/upload-avatar.command.js +11 -0
- package/build/commands/user-to-subscription/delete-user-to-subscription.command.js +16 -0
- package/build/commands/user-to-subscription/index.js +1 -0
- package/build/commands/webmaster-click/get-webmaster-clicks-overview.command.js +3 -6
- package/build/constants/cloud-payments/index.js +2 -1
- package/build/constants/community/community-post-report/enums/community-post-report-reason.enum.js +18 -0
- package/build/constants/community/community-post-report/enums/index.js +17 -0
- package/build/constants/community/community-post-report/index.js +17 -0
- package/build/constants/community/default-pagination.constant.js +6 -0
- package/build/constants/community/enums/community-aspect-ratio.enum.js +11 -0
- package/build/constants/community/enums/community-post-visibility.enum.js +8 -0
- package/build/constants/community/enums/community-status.enum.js +11 -0
- package/build/constants/community/enums/community-tool-type.enum.js +10 -0
- package/build/constants/community/enums/community-type.enum.js +11 -0
- package/build/constants/community/enums/index.js +21 -0
- package/build/constants/community/index.js +19 -0
- package/build/constants/errors/errors.js +275 -14
- package/build/constants/index.js +4 -0
- package/build/constants/model/enums/index.js +17 -0
- package/build/constants/model/enums/unified-model-content-type.enum.js +21 -0
- package/build/constants/model/index.js +17 -0
- package/build/constants/page/enums/page-type.enum.js +1 -0
- package/build/constants/payment/enums/index.js +1 -0
- package/build/constants/payment/enums/payment-sort-by.enum.js +10 -0
- package/build/constants/payment/enums/payment-status.enum.js +1 -0
- package/build/constants/presentation/enums/slide-content-type.enum.js +1 -0
- package/build/constants/presentation/maps/slide-layout-map.constant.js +1 -0
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +6 -0
- package/build/constants/subscription/enums/subscription-status.enum.js +2 -2
- package/build/constants/tool/enums/index.js +1 -0
- package/build/constants/tool/enums/tool-content-type.enum.js +17 -0
- package/build/constants/tool/enums/tool-job-status.enum.js +1 -0
- package/build/constants/tool-image-generation/enums/image-generation-resolution.enum.js +9 -0
- package/build/constants/tool-image-generation/enums/index.js +17 -0
- package/build/constants/tool-image-generation/index.js +17 -0
- package/build/constants/tool-video/enums/video-pricing-rule-type.enum.js +1 -0
- package/build/constants/user-profile/index.js +17 -0
- package/build/constants/user-profile/user-profile.constant.js +10 -0
- package/build/helpers/image-editor/calculate-image-editor-price.helper.js +13 -0
- package/build/helpers/image-editor/index.js +17 -0
- package/build/helpers/image-generation/calculate-image-generation-price.helper.js +16 -0
- package/build/helpers/image-generation/index.js +17 -0
- package/build/helpers/index.js +2 -0
- package/build/helpers/video/calculate-video-price.helper.js +5 -1
- package/build/models/community/community-post-media-data.schema.js +53 -0
- package/build/models/community/community-post-report/community-post-report.schema.js +13 -0
- package/build/models/community/community-post-report/index.js +17 -0
- package/build/models/community/community-post.schema.js +44 -0
- package/build/models/community/index.js +19 -0
- package/build/models/index.js +2 -0
- package/build/models/order.schema.js +1 -0
- package/build/models/page.schema.js +2 -1
- package/build/models/payment.schema.js +5 -2
- package/build/models/review.schema.js +2 -0
- package/build/models/subscription-feature.schema.js +27 -1
- package/build/models/tool.schema.js +3 -0
- package/build/models/tools/common/attached-tool-file.schema.js +13 -0
- package/build/models/tools/common/index.js +17 -0
- package/build/models/tools/image-editor/image-editor-config.schema.js +1 -0
- package/build/models/tools/image-editor/image-editor-job.schema.js +11 -2
- package/build/models/tools/image-editor/image-editor-model.schema.js +9 -1
- package/build/models/tools/image-generation/image-generation-config.schema.js +23 -0
- package/build/models/tools/image-generation/image-generation-job.schema.js +35 -0
- package/build/models/tools/image-generation/image-generation-model.schema.js +41 -0
- package/build/models/tools/image-generation/index.js +19 -0
- package/build/models/tools/index.js +2 -0
- package/build/models/tools/music/music-track.schema.js +1 -0
- package/build/models/tools/paraphrase/paraphrase-job.schema.js +5 -0
- package/build/models/tools/presentation/pptx-export-payload.schema.js +34 -1
- package/build/models/tools/presentation/slide-content-edit.schema.js +18 -1
- package/build/models/tools/presentation/slide-content.schema.js +26 -1
- package/build/models/tools/stt/stt-job.schema.js +1 -0
- package/build/models/tools/tts/tts-job.schema.js +1 -0
- package/build/models/tools/video/video-job.schema.js +2 -0
- package/build/models/tools/video/video-model.schema.js +8 -1
- package/build/models/tools/video-editor/video-editor-job.schema.js +1 -0
- package/build/models/tools/writer/writer-document-outline.schema.js +1 -2
- package/build/models/user-profile.schema.js +16 -0
- package/build/models/webmaster-click.schema.js +2 -2
- package/commands/ai-model/find-formatted-ai-model-v2.command.ts +23 -0
- package/commands/ai-model/find-model-pages.command.ts +34 -0
- package/commands/ai-model/index.ts +2 -0
- package/commands/b2b/submit-balance-top-up-form.command.ts +5 -3
- package/commands/community/archive-community-post.command.ts +13 -0
- package/commands/community/create-community-post.command.ts +40 -0
- package/commands/community/delete-community-post.command.ts +13 -0
- package/commands/community/get-all-community-posts-by-criteria.command.ts +29 -0
- package/commands/community/get-community-post-by-uuid.command.ts +16 -0
- package/commands/community/get-count-of-likes-on-my-posts.command.ts +9 -0
- package/commands/community/get-my-community-posts-by-criteria.command.ts +40 -0
- package/commands/community/get-my-favorite-community-posts.command.ts +19 -0
- package/commands/community/get-my-likes-community-posts.command.ts +19 -0
- package/commands/community/index.ts +13 -0
- package/commands/community/send-report-to-community-post.command.ts +17 -0
- package/commands/community/set-favorite-community-post.command.ts +13 -0
- package/commands/community/set-like-community-post.command.ts +14 -0
- package/commands/community/share-my-community-post.command.ts +13 -0
- package/commands/folder/find-folder-by-uuid-with-chats.command.ts +1 -0
- package/commands/folder/find-folders-by-user.command.ts +1 -0
- package/commands/index.ts +2 -0
- package/commands/payment/check.command.ts +1 -1
- package/commands/payment/index.ts +1 -0
- package/commands/payment/refund-payment.command.ts +17 -0
- package/commands/review/create-review.command.ts +1 -1
- package/commands/review/find-all-reviews.command.ts +19 -0
- package/commands/review/find-reviews.command.ts +1 -1
- package/commands/review/get-review-count.command.ts +13 -0
- package/commands/review/index.ts +2 -0
- package/commands/subscription/create-custom-subscription-plan.command.ts +1 -1
- package/commands/tools/image-editor/retry-image-editor-job.command.ts +13 -1
- package/commands/tools/image-editor/set-reaction-to-image-editor-job.command.ts +16 -3
- package/commands/tools/image-generation/delete-all-image-generation-jobs.command.ts +8 -0
- package/commands/tools/image-generation/delete-image-generation-job-by-uuid.command.ts +13 -0
- package/commands/tools/image-generation/find-image-generation-job-by-uuid.command.ts +16 -0
- package/commands/tools/image-generation/find-image-generation-jobs.command.ts +18 -0
- package/commands/tools/image-generation/get-image-generation-config.command.ts +9 -0
- package/commands/tools/image-generation/image-generation.command.ts +25 -0
- package/commands/tools/image-generation/index.ts +8 -0
- package/commands/tools/image-generation/set-reaction-to-image-generation-job.command.ts +33 -0
- package/commands/tools/image-generation/update-image-generation-job-title.command.ts +19 -0
- package/commands/tools/index.ts +1 -0
- package/commands/tools/music/retry-music-job.command.ts +7 -1
- package/commands/tools/music/set-reaction-to-music-job.command.ts +16 -3
- package/commands/tools/paraphrase/delete-all-paraphrase-jobs.command.ts +6 -0
- package/commands/tools/paraphrase/delete-paraphrase-job-by-uuid.command.ts +11 -0
- package/commands/tools/paraphrase/find-paraphrase-jobs.command.ts +18 -0
- package/commands/tools/paraphrase/index.ts +7 -1
- package/commands/tools/paraphrase/retry-paraphrase-job.command.ts +14 -0
- package/commands/tools/paraphrase/set-reaction-to-paraphrase-job.command.ts +33 -0
- package/commands/tools/paraphrase/update-paraphrase-job-title.command.ts +19 -0
- package/commands/tools/presentation/index.ts +1 -0
- package/commands/tools/presentation/set-reaction-to-presentation.command.ts +33 -0
- package/commands/tools/stt/set-reaction-to-stt-job.command.ts +16 -3
- package/commands/tools/tts/set-reaction-to-tts-job.command.ts +16 -3
- package/commands/tools/video/retry-video-job.command.ts +8 -1
- package/commands/tools/video/set-reaction-to-video-job.command.ts +16 -3
- package/commands/tools/video-editor/retry-video-editor-job.command.ts +7 -0
- package/commands/tools/video-editor/set-reaction-to-video-editor-job.command.ts +16 -3
- package/commands/tools/writer/set-reaction.writer-document.command.ts +16 -3
- package/commands/user/cancel-user-subscription.command.ts +21 -0
- package/commands/user/find-users-by-criteria.command.ts +1 -1
- package/commands/user/get-me.command.ts +2 -0
- package/commands/user/get-user-payments.command.ts +27 -0
- package/commands/user/get-user-products.command.ts +2 -2
- package/commands/user/get-user-subscriptions.command.ts +2 -2
- package/commands/user/index.ts +2 -0
- package/commands/user-profile/delete-avatar.command.ts +14 -0
- package/commands/user-profile/get-user-profile-by-user-id.command.ts +16 -0
- package/commands/user-profile/index.ts +4 -0
- package/commands/user-profile/update-profile.command.ts +16 -0
- package/commands/user-profile/upload-avatar.command.ts +10 -0
- package/commands/user-to-subscription/delete-user-to-subscription.command.ts +18 -0
- package/commands/user-to-subscription/index.ts +1 -0
- package/commands/webmaster-click/get-webmaster-clicks-overview.command.ts +3 -8
- package/constants/cloud-payments/index.ts +2 -0
- package/constants/community/community-post-report/enums/community-post-report-reason.enum.ts +14 -0
- package/constants/community/community-post-report/enums/index.ts +1 -0
- package/constants/community/community-post-report/index.ts +1 -0
- package/constants/community/default-pagination.constant.ts +4 -0
- package/constants/community/enums/community-aspect-ratio.enum.ts +7 -0
- package/constants/community/enums/community-post-visibility.enum.ts +4 -0
- package/constants/community/enums/community-status.enum.ts +7 -0
- package/constants/community/enums/community-tool-type.enum.ts +6 -0
- package/constants/community/enums/community-type.enum.ts +7 -0
- package/constants/community/enums/index.ts +5 -0
- package/constants/community/index.ts +3 -0
- package/constants/errors/errors.ts +276 -14
- package/constants/index.ts +4 -0
- package/constants/model/enums/index.ts +1 -0
- package/constants/model/enums/unified-model-content-type.enum.ts +17 -0
- package/constants/model/index.ts +1 -0
- package/constants/page/enums/page-type.enum.ts +1 -0
- package/constants/payment/enums/index.ts +1 -0
- package/constants/payment/enums/payment-sort-by.enum.ts +6 -0
- package/constants/payment/enums/payment-status.enum.ts +1 -0
- package/constants/presentation/enums/slide-content-type.enum.ts +1 -0
- package/constants/presentation/maps/slide-layout-map.constant.ts +1 -0
- package/constants/subscription/enums/subscription-feature-type.enum.ts +6 -0
- package/constants/subscription/enums/subscription-status.enum.ts +2 -2
- package/constants/tool/enums/index.ts +1 -0
- package/constants/tool/enums/tool-content-type.enum.ts +13 -0
- package/constants/tool/enums/tool-job-status.enum.ts +1 -0
- package/constants/tool-image-generation/enums/image-generation-resolution.enum.ts +5 -0
- package/constants/tool-image-generation/enums/index.ts +1 -0
- package/constants/tool-image-generation/index.ts +1 -0
- package/constants/tool-video/enums/video-pricing-rule-type.enum.ts +1 -0
- package/constants/user-profile/index.ts +1 -0
- package/constants/user-profile/user-profile.constant.ts +14 -0
- package/helpers/image-editor/calculate-image-editor-price.helper.ts +23 -0
- package/helpers/image-editor/index.ts +1 -0
- package/helpers/image-generation/calculate-image-generation-price.helper.ts +29 -0
- package/helpers/image-generation/index.ts +1 -0
- package/helpers/index.ts +2 -0
- package/helpers/video/calculate-video-price.helper.ts +7 -1
- package/models/community/community-post-media-data.schema.ts +65 -0
- package/models/community/community-post-report/community-post-report.schema.ts +11 -0
- package/models/community/community-post-report/index.ts +1 -0
- package/models/community/community-post.schema.ts +48 -0
- package/models/community/index.ts +3 -0
- package/models/index.ts +2 -0
- package/models/order.schema.ts +1 -0
- package/models/page.schema.ts +2 -1
- package/models/payment.schema.ts +5 -1
- package/models/review.schema.ts +2 -0
- package/models/subscription-feature.schema.ts +34 -0
- package/models/tool.schema.ts +3 -0
- package/models/tools/common/attached-tool-file.schema.ts +13 -0
- package/models/tools/common/index.ts +1 -0
- package/models/tools/image-editor/image-editor-config.schema.ts +1 -0
- package/models/tools/image-editor/image-editor-job.schema.ts +13 -2
- package/models/tools/image-editor/image-editor-model.schema.ts +16 -0
- package/models/tools/image-generation/image-generation-config.schema.ts +29 -0
- package/models/tools/image-generation/image-generation-job.schema.ts +42 -0
- package/models/tools/image-generation/image-generation-model.schema.ts +52 -0
- package/models/tools/image-generation/index.ts +3 -0
- package/models/tools/index.ts +2 -0
- package/models/tools/music/music-track.schema.ts +1 -0
- package/models/tools/paraphrase/paraphrase-job.schema.ts +5 -0
- package/models/tools/presentation/pptx-export-payload.schema.ts +34 -0
- package/models/tools/presentation/slide-content-edit.schema.ts +21 -0
- package/models/tools/presentation/slide-content.schema.ts +45 -0
- package/models/tools/stt/stt-job.schema.ts +1 -0
- package/models/tools/tts/tts-job.schema.ts +1 -0
- package/models/tools/video/video-job.schema.ts +2 -0
- package/models/tools/video/video-model.schema.ts +8 -1
- package/models/tools/video-editor/video-editor-job.schema.ts +1 -0
- package/models/tools/writer/writer-document-outline.schema.ts +1 -2
- package/models/user-profile.schema.ts +15 -0
- package/models/webmaster-click.schema.ts +2 -2
- package/package.json +1 -1
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace RefundPaymentCommand {
|
|
4
|
+
export const RequestSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
isSuccess: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -12,7 +12,7 @@ export namespace CreateReviewCommand {
|
|
|
12
12
|
export type Request = z.infer<typeof RequestSchema>;
|
|
13
13
|
|
|
14
14
|
export const ResponseSchema = z.object({
|
|
15
|
-
data: ReviewSchema,
|
|
15
|
+
data: ReviewSchema.omit({ status: true }),
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { ReviewSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindAllReviewsCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
limit: z.string().transform((val) => parseInt(val, 10)),
|
|
7
|
+
offset: z.string().transform((val) => parseInt(val, 10)),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.array(ReviewSchema),
|
|
14
|
+
totalPages: z.number(),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -10,7 +10,7 @@ export namespace FindReviewsCommand {
|
|
|
10
10
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
11
|
|
|
12
12
|
export const ResponseSchema = z.object({
|
|
13
|
-
data: z.array(ReviewSchema),
|
|
13
|
+
data: z.array(ReviewSchema.omit({ status: true })),
|
|
14
14
|
totalPages: z.number(),
|
|
15
15
|
page: z.number(),
|
|
16
16
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetReviewCountCommand {
|
|
4
|
+
export type Request = void;
|
|
5
|
+
|
|
6
|
+
export const ResponseSchema = z.object({
|
|
7
|
+
data: z.object({
|
|
8
|
+
count: z.number(),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
package/commands/review/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export namespace CreateCustomSubscriptionPlanCommand {
|
|
|
19
19
|
export type Request = z.infer<typeof RequestSchema>;
|
|
20
20
|
|
|
21
21
|
export const ResponseSchema = z.object({
|
|
22
|
-
data: SubscriptionSchema,
|
|
22
|
+
data: z.array(SubscriptionSchema),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ImageEditorJobSchema } from '../../../models';
|
|
2
|
+
import { AttachedToolFileSchema, ImageEditorJobSchema } from '../../../models';
|
|
3
3
|
|
|
4
4
|
export namespace RetryImageEditorJobCommand {
|
|
5
5
|
export const RequestParamsSchema = z.object({
|
|
@@ -7,6 +7,18 @@ export namespace RetryImageEditorJobCommand {
|
|
|
7
7
|
});
|
|
8
8
|
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
9
|
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
modelId: z.string().uuid().optional(),
|
|
12
|
+
prompt: z.string().optional(),
|
|
13
|
+
params: z
|
|
14
|
+
.object({
|
|
15
|
+
attachedFiles: z.array(AttachedToolFileSchema).default([]),
|
|
16
|
+
systemPromptId: z.string().optional(),
|
|
17
|
+
})
|
|
18
|
+
.optional(),
|
|
19
|
+
});
|
|
20
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
21
|
+
|
|
10
22
|
export const ResponseSchema = z.object({
|
|
11
23
|
data: ImageEditorJobSchema,
|
|
12
24
|
});
|
|
@@ -3,9 +3,22 @@ import { ImageEditorJobSchema } from '../../../models';
|
|
|
3
3
|
import { USER_REACTION } from '../../../constants';
|
|
4
4
|
|
|
5
5
|
export namespace SetReactionToImageEditorJobCommand {
|
|
6
|
-
export const RequestSchema = z
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
9
22
|
export type Request = z.infer<typeof RequestSchema>;
|
|
10
23
|
|
|
11
24
|
export const RequestParamsSchema = z.object({
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteImageGenerationJobByUUIDCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.object({
|
|
10
|
+
data: z.boolean(),
|
|
11
|
+
});
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageGenerationJobSchema, ToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindImageGenerationJobByUUIDCommand {
|
|
5
|
+
export const RequestParamsSchema = ToolJobSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: ImageGenerationJobSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageGenerationJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindImageGenerationJobsCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
limit: z.coerce.number().min(1).optional(),
|
|
7
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
8
|
+
title: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.array(ImageGenerationJobSchema),
|
|
14
|
+
totalPages: z.number(),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageGenerationConfigSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetImageGenerationConfigCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: ImageGenerationConfigSchema,
|
|
7
|
+
});
|
|
8
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../../models';
|
|
3
|
+
import { IMAGE_GENERATION_RESOLUTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace ImageGenerationCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
modelId: z.string().uuid(),
|
|
8
|
+
prompt: z.string(),
|
|
9
|
+
params: z.object({
|
|
10
|
+
aspectRatio: z.string(),
|
|
11
|
+
attachedFiles: z.string().array(),
|
|
12
|
+
enhancePrompt: z.boolean(),
|
|
13
|
+
resolution: z.nativeEnum(IMAGE_GENERATION_RESOLUTION).optional(),
|
|
14
|
+
}),
|
|
15
|
+
presetId: z.string().uuid().nullable().optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: ToolJobSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './image-generation.command';
|
|
2
|
+
export * from './find-image-generation-job-by-uuid.command';
|
|
3
|
+
export * from './find-image-generation-jobs.command';
|
|
4
|
+
export * from './set-reaction-to-image-generation-job.command';
|
|
5
|
+
export * from './update-image-generation-job-title.command';
|
|
6
|
+
export * from './delete-image-generation-job-by-uuid.command';
|
|
7
|
+
export * from './delete-all-image-generation-jobs.command';
|
|
8
|
+
export * from './get-image-generation-config.command';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageGenerationJobSchema } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToImageGenerationJobCommand {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
23
|
+
|
|
24
|
+
export const RequestParamsSchema = z.object({
|
|
25
|
+
uuid: z.string().uuid(),
|
|
26
|
+
});
|
|
27
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
28
|
+
|
|
29
|
+
export const ResponseSchema = z.object({
|
|
30
|
+
data: ImageGenerationJobSchema,
|
|
31
|
+
});
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageGenerationJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateImageGenerationJobTitleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
title: z.string(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestParamsSchema = z.object({
|
|
11
|
+
uuid: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: ImageGenerationJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
package/commands/tools/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MusicJobSchema } from '../../../models';
|
|
2
|
+
import { MusicJobParamsSchema, MusicJobSchema } from '../../../models';
|
|
3
3
|
|
|
4
4
|
export namespace RetryMusicJobCommand {
|
|
5
5
|
export const RequestParamsSchema = z.object({
|
|
@@ -7,6 +7,12 @@ export namespace RetryMusicJobCommand {
|
|
|
7
7
|
});
|
|
8
8
|
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
9
|
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
modelId: z.string().uuid().optional(),
|
|
12
|
+
params: MusicJobParamsSchema.optional(),
|
|
13
|
+
});
|
|
14
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
15
|
+
|
|
10
16
|
export const ResponseSchema = z.object({
|
|
11
17
|
data: MusicJobSchema,
|
|
12
18
|
});
|
|
@@ -3,9 +3,22 @@ import { MusicJobSchema } from '../../../models';
|
|
|
3
3
|
import { USER_REACTION } from '../../../constants';
|
|
4
4
|
|
|
5
5
|
export namespace SetReactionToMusicJobCommand {
|
|
6
|
-
export const RequestSchema = z
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
9
22
|
export type Request = z.infer<typeof RequestSchema>;
|
|
10
23
|
|
|
11
24
|
export const RequestParamsSchema = z.object({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteParaphraseJobByUUIDCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.void();
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindParaphraseJobsCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
limit: z.coerce.number().min(1).optional(),
|
|
7
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
8
|
+
title: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.array(ParaphraseToolJobSchema),
|
|
14
|
+
totalPages: z.number(),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export * from './paraphrase.command';
|
|
2
|
+
export * from './delete-paraphrase-job-by-uuid.command';
|
|
3
|
+
export * from './delete-all-paraphrase-jobs.command';
|
|
4
|
+
export * from './set-reaction-to-paraphrase-job.command';
|
|
5
|
+
export * from './update-paraphrase-job-title.command';
|
|
6
|
+
export * from './retry-paraphrase-job.command';
|
|
1
7
|
export * from './find-paraphrase-job-by-uuid.command';
|
|
8
|
+
export * from './find-paraphrase-jobs.command';
|
|
2
9
|
export * from './get-paraphrase-tool-config.command';
|
|
3
|
-
export * from './paraphrase.command';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace RetryParaphraseJobCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: ParaphraseToolJobSchema,
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToParaphraseJobCommand {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
23
|
+
|
|
24
|
+
export const RequestParamsSchema = z.object({
|
|
25
|
+
uuid: z.string().uuid(),
|
|
26
|
+
});
|
|
27
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
28
|
+
|
|
29
|
+
export const ResponseSchema = z.object({
|
|
30
|
+
data: ParaphraseToolJobSchema,
|
|
31
|
+
});
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateParaphraseJobTitleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
title: z.string().min(1).max(40).trim(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestParamsSchema = z.object({
|
|
11
|
+
uuid: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: ParaphraseToolJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PresentationSchema } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToPresentationCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
uuid: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestBodySchema = z
|
|
12
|
+
.object({
|
|
13
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
14
|
+
dislikeReason: z.string().nullable().default(null),
|
|
15
|
+
})
|
|
16
|
+
.refine(
|
|
17
|
+
(data) => {
|
|
18
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
export type RequestParams = z.infer<typeof RequestBodySchema>;
|
|
28
|
+
|
|
29
|
+
export const ResponseSchema = z.object({
|
|
30
|
+
data: PresentationSchema,
|
|
31
|
+
});
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -3,9 +3,22 @@ import { STTJobSchema } from '../../../models';
|
|
|
3
3
|
import { USER_REACTION } from '../../../constants';
|
|
4
4
|
|
|
5
5
|
export namespace SetReactionToSTTJobCommand {
|
|
6
|
-
export const RequestSchema = z
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
9
22
|
export type Request = z.infer<typeof RequestSchema>;
|
|
10
23
|
|
|
11
24
|
export const RequestParamsSchema = z.object({
|
|
@@ -3,9 +3,22 @@ import { TTSJobSchema } from '../../../models';
|
|
|
3
3
|
import { USER_REACTION } from '../../../constants';
|
|
4
4
|
|
|
5
5
|
export namespace SetReactionToTTSJobCommand {
|
|
6
|
-
export const RequestSchema = z
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
9
22
|
export type Request = z.infer<typeof RequestSchema>;
|
|
10
23
|
|
|
11
24
|
export const RequestParamsSchema = z.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { VideoJobSchema } from '../../../models';
|
|
2
|
+
import { VideoGenerationRequestParamsSchema, VideoJobSchema } from '../../../models';
|
|
3
3
|
|
|
4
4
|
export namespace RetryVideoJobCommand {
|
|
5
5
|
export const RequestParamsSchema = z.object({
|
|
@@ -7,6 +7,13 @@ export namespace RetryVideoJobCommand {
|
|
|
7
7
|
});
|
|
8
8
|
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
9
|
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
modelId: z.string().uuid().optional(),
|
|
12
|
+
prompt: z.string().optional(),
|
|
13
|
+
params: VideoGenerationRequestParamsSchema.optional(),
|
|
14
|
+
});
|
|
15
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
16
|
+
|
|
10
17
|
export const ResponseSchema = z.object({
|
|
11
18
|
data: VideoJobSchema,
|
|
12
19
|
});
|
|
@@ -3,9 +3,22 @@ import { VideoJobSchema } from '../../../models';
|
|
|
3
3
|
import { USER_REACTION } from '../../../constants';
|
|
4
4
|
|
|
5
5
|
export namespace SetReactionToVideoJobCommand {
|
|
6
|
-
export const RequestSchema = z
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
9
22
|
export type Request = z.infer<typeof RequestSchema>;
|
|
10
23
|
|
|
11
24
|
export const RequestParamsSchema = z.object({
|