@purpleschool/gptbot 0.8.56 → 0.8.57
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 +0 -1
- package/api/controllers/http/ai-proxy.ts +5 -0
- package/api/controllers/http/b2b.ts +10 -0
- package/api/controllers/http/index.ts +2 -4
- package/api/controllers/http/page.ts +0 -1
- package/api/controllers/http/paraphrase.ts +0 -6
- package/api/controllers/http/payment.ts +0 -1
- package/api/controllers/http/presentation.ts +0 -1
- package/api/controllers/http/product.ts +1 -1
- package/api/controllers/http/referral.ts +1 -1
- package/api/controllers/http/review.ts +0 -1
- package/api/controllers/http/subscription.ts +1 -1
- package/api/controllers/http/ui-notification.ts +2 -2
- package/api/controllers/http/user-to-subscription.ts +0 -1
- package/api/controllers/http/user.ts +0 -2
- package/api/routes.ts +27 -141
- package/build/api/controllers/http/ai-model.js +0 -1
- package/build/api/controllers/http/ai-proxy.js +7 -0
- package/build/api/controllers/http/b2b.js +12 -0
- package/build/api/controllers/http/index.js +2 -4
- package/build/api/controllers/http/page.js +0 -1
- package/build/api/controllers/http/paraphrase.js +0 -6
- package/build/api/controllers/http/payment.js +0 -1
- package/build/api/controllers/http/presentation.js +0 -1
- 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 +0 -1
- 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-to-subscription.js +0 -1
- package/build/api/controllers/http/user.js +0 -2
- package/build/api/routes.js +27 -101
- package/build/commands/ai-model/index.js +0 -2
- package/build/commands/b2b/get-api-key.command.js +12 -0
- package/build/{constants/community/community-post-report/enums → commands/b2b}/index.js +5 -1
- package/build/commands/b2b/refresh-api-key.command.js +12 -0
- package/build/commands/b2b/send-image-request.command.js +24 -0
- package/build/commands/b2b/send-text-request.command.js +22 -0
- package/build/commands/b2b/submit-balance-top-up-form.command.js +19 -0
- package/build/commands/folder/find-folder-by-uuid-with-chats.command.js +0 -1
- package/build/commands/folder/find-folders-by-user.command.js +0 -1
- package/build/commands/index.js +1 -2
- package/build/commands/payment/check.command.js +1 -1
- package/build/commands/payment/index.js +0 -1
- package/build/commands/review/create-review.command.js +1 -1
- package/build/commands/review/find-reviews.command.js +1 -1
- package/build/commands/review/index.js +0 -2
- package/build/commands/subscription/create-custom-subscription-plan.command.js +1 -1
- package/build/commands/tools/image-editor/retry-image-editor-job.command.js +0 -10
- package/build/commands/tools/image-editor/set-reaction-to-image-editor-job.command.js +1 -11
- package/build/commands/tools/index.js +0 -1
- package/build/commands/tools/music/retry-music-job.command.js +0 -4
- package/build/commands/tools/music/set-reaction-to-music-job.command.js +1 -11
- package/build/commands/tools/paraphrase/index.js +1 -7
- package/build/commands/tools/presentation/index.js +0 -1
- package/build/commands/tools/stt/set-reaction-to-stt-job.command.js +1 -11
- package/build/commands/tools/tts/set-reaction-to-tts-job.command.js +1 -11
- package/build/commands/tools/video/retry-video-job.command.js +0 -5
- package/build/commands/tools/video/set-reaction-to-video-job.command.js +1 -11
- package/build/commands/tools/video-editor/retry-video-editor-job.command.js +0 -5
- package/build/commands/tools/video-editor/set-reaction-to-video-editor-job.command.js +1 -11
- package/build/commands/tools/writer/set-reaction.writer-document.command.js +1 -11
- package/build/commands/user/find-users-by-criteria.command.js +1 -1
- package/build/commands/user/get-me.command.js +0 -2
- 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 +0 -2
- package/build/commands/user-to-subscription/index.js +0 -1
- package/build/commands/webmaster-click/get-webmaster-clicks-overview.command.js +6 -3
- package/build/constants/cloud-payments/index.js +1 -2
- package/build/constants/errors/errors.js +21 -257
- package/build/constants/form-submission/enums/form-type.enum.js +1 -0
- package/build/constants/index.js +0 -4
- package/build/constants/page/enums/page-type.enum.js +0 -1
- package/build/constants/payment/enums/index.js +0 -1
- package/build/constants/payment/enums/payment-status.enum.js +0 -1
- package/build/constants/presentation/enums/slide-content-type.enum.js +0 -1
- package/build/constants/presentation/maps/slide-layout-map.constant.js +0 -1
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +0 -6
- package/build/constants/subscription/enums/subscription-status.enum.js +2 -2
- package/build/constants/tool/enums/index.js +0 -1
- package/build/constants/tool/enums/tool-job-status.enum.js +0 -1
- package/build/constants/tool-video/enums/video-pricing-rule-type.enum.js +0 -1
- package/build/helpers/index.js +0 -2
- package/build/helpers/video/calculate-video-price.helper.js +1 -5
- package/build/models/api-key.schema.js +15 -0
- package/build/models/index.js +1 -2
- package/build/models/order.schema.js +0 -1
- package/build/models/page.schema.js +1 -2
- package/build/models/payment.schema.js +2 -5
- package/build/models/review.schema.js +0 -2
- package/build/models/subscription-feature.schema.js +1 -27
- package/build/models/tool.schema.js +0 -3
- package/build/models/tools/image-editor/image-editor-config.schema.js +0 -1
- package/build/models/tools/image-editor/image-editor-job.schema.js +2 -11
- package/build/models/tools/image-editor/image-editor-model.schema.js +1 -9
- package/build/models/tools/index.js +0 -2
- package/build/models/tools/music/music-track.schema.js +0 -1
- package/build/models/tools/paraphrase/paraphrase-job.schema.js +0 -5
- package/build/models/tools/presentation/pptx-export-payload.schema.js +1 -34
- package/build/models/tools/presentation/slide-content-edit.schema.js +1 -18
- package/build/models/tools/presentation/slide-content.schema.js +1 -26
- package/build/models/tools/stt/stt-job.schema.js +0 -1
- package/build/models/tools/tts/tts-job.schema.js +0 -1
- package/build/models/tools/video/video-job.schema.js +0 -2
- package/build/models/tools/video/video-model.schema.js +1 -8
- package/build/models/tools/video-editor/video-editor-job.schema.js +0 -1
- package/build/models/tools/writer/writer-document-outline.schema.js +2 -1
- package/build/models/webmaster-click.schema.js +2 -2
- package/commands/ai-model/index.ts +0 -2
- package/commands/{community/get-count-of-likes-on-my-posts.command.ts → b2b/get-api-key.command.ts} +4 -2
- package/commands/b2b/index.ts +5 -0
- package/commands/{tools/image-generation/delete-all-image-generation-jobs.command.ts → b2b/refresh-api-key.command.ts} +5 -2
- package/commands/b2b/send-image-request.command.ts +28 -0
- package/commands/b2b/send-text-request.command.ts +26 -0
- package/commands/b2b/submit-balance-top-up-form.command.ts +20 -0
- package/commands/folder/find-folder-by-uuid-with-chats.command.ts +0 -1
- package/commands/folder/find-folders-by-user.command.ts +0 -1
- package/commands/index.ts +1 -2
- package/commands/payment/check.command.ts +1 -1
- package/commands/payment/index.ts +0 -1
- package/commands/review/create-review.command.ts +1 -1
- package/commands/review/find-reviews.command.ts +1 -1
- package/commands/review/index.ts +0 -2
- package/commands/subscription/create-custom-subscription-plan.command.ts +1 -1
- package/commands/tools/image-editor/retry-image-editor-job.command.ts +1 -13
- package/commands/tools/image-editor/set-reaction-to-image-editor-job.command.ts +3 -16
- package/commands/tools/index.ts +0 -1
- package/commands/tools/music/retry-music-job.command.ts +1 -7
- package/commands/tools/music/set-reaction-to-music-job.command.ts +3 -16
- package/commands/tools/paraphrase/index.ts +1 -7
- package/commands/tools/presentation/index.ts +0 -1
- package/commands/tools/stt/set-reaction-to-stt-job.command.ts +3 -16
- package/commands/tools/tts/set-reaction-to-tts-job.command.ts +3 -16
- package/commands/tools/video/retry-video-job.command.ts +1 -8
- package/commands/tools/video/set-reaction-to-video-job.command.ts +3 -16
- package/commands/tools/video-editor/retry-video-editor-job.command.ts +0 -7
- package/commands/tools/video-editor/set-reaction-to-video-editor-job.command.ts +3 -16
- package/commands/tools/writer/set-reaction.writer-document.command.ts +3 -16
- package/commands/user/find-users-by-criteria.command.ts +1 -1
- package/commands/user/get-me.command.ts +0 -2
- 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 +0 -2
- package/commands/user-to-subscription/index.ts +0 -1
- package/commands/webmaster-click/get-webmaster-clicks-overview.command.ts +8 -3
- package/constants/cloud-payments/index.ts +0 -2
- package/constants/errors/errors.ts +21 -258
- package/constants/form-submission/enums/form-type.enum.ts +1 -0
- package/constants/index.ts +0 -4
- package/constants/page/enums/page-type.enum.ts +0 -1
- package/constants/payment/enums/index.ts +0 -1
- package/constants/payment/enums/payment-status.enum.ts +0 -1
- package/constants/presentation/enums/slide-content-type.enum.ts +0 -1
- package/constants/presentation/maps/slide-layout-map.constant.ts +0 -1
- package/constants/subscription/enums/subscription-feature-type.enum.ts +0 -6
- package/constants/subscription/enums/subscription-status.enum.ts +2 -2
- package/constants/tool/enums/index.ts +0 -1
- package/constants/tool/enums/tool-job-status.enum.ts +0 -1
- package/constants/tool-video/enums/video-pricing-rule-type.enum.ts +0 -1
- package/helpers/index.ts +0 -2
- package/helpers/video/calculate-video-price.helper.ts +1 -7
- package/models/api-key.schema.ts +10 -0
- package/models/index.ts +1 -2
- package/models/order.schema.ts +0 -1
- package/models/page.schema.ts +1 -2
- package/models/payment.schema.ts +1 -5
- package/models/review.schema.ts +0 -2
- package/models/subscription-feature.schema.ts +0 -34
- package/models/tool.schema.ts +0 -3
- package/models/tools/image-editor/image-editor-config.schema.ts +0 -1
- package/models/tools/image-editor/image-editor-job.schema.ts +2 -13
- package/models/tools/image-editor/image-editor-model.schema.ts +0 -16
- package/models/tools/index.ts +0 -2
- package/models/tools/music/music-track.schema.ts +0 -1
- package/models/tools/paraphrase/paraphrase-job.schema.ts +0 -5
- package/models/tools/presentation/pptx-export-payload.schema.ts +0 -34
- package/models/tools/presentation/slide-content-edit.schema.ts +0 -21
- package/models/tools/presentation/slide-content.schema.ts +0 -45
- package/models/tools/stt/stt-job.schema.ts +0 -1
- package/models/tools/tts/tts-job.schema.ts +0 -1
- package/models/tools/video/video-job.schema.ts +0 -2
- package/models/tools/video/video-model.schema.ts +1 -8
- package/models/tools/video-editor/video-editor-job.schema.ts +0 -1
- package/models/tools/writer/writer-document-outline.schema.ts +2 -1
- package/models/webmaster-click.schema.ts +2 -2
- package/package.json +1 -1
- package/api/controllers/http/community.ts +0 -25
- package/api/controllers/http/image-generation.ts +0 -14
- package/api/controllers/http/kie.ts +0 -5
- package/api/controllers/http/user-profile.ts +0 -8
- package/build/api/controllers/http/community.js +0 -25
- package/build/api/controllers/http/image-generation.js +0 -16
- package/build/api/controllers/http/kie.js +0 -7
- package/build/api/controllers/http/user-profile.js +0 -10
- package/build/commands/ai-model/find-formatted-ai-model-v2.command.js +0 -23
- package/build/commands/ai-model/find-model-pages.command.js +0 -31
- package/build/commands/community/archive-community-post.command.js +0 -13
- package/build/commands/community/create-community-post.command.js +0 -34
- package/build/commands/community/delete-community-post.command.js +0 -13
- package/build/commands/community/get-all-community-posts-by-criteria.command.js +0 -25
- package/build/commands/community/get-community-post-by-uuid.command.js +0 -14
- package/build/commands/community/get-count-of-likes-on-my-posts.command.js +0 -10
- package/build/commands/community/get-my-community-posts-by-criteria.command.js +0 -32
- package/build/commands/community/get-my-favorite-community-posts.command.js +0 -19
- package/build/commands/community/get-my-likes-community-posts.command.js +0 -19
- package/build/commands/community/index.js +0 -29
- package/build/commands/community/send-report-to-community-post.command.js +0 -15
- package/build/commands/community/set-favorite-community-post.command.js +0 -13
- package/build/commands/community/set-like-community-post.command.js +0 -14
- package/build/commands/community/share-my-community-post.command.js +0 -13
- package/build/commands/payment/refund-payment.command.js +0 -15
- package/build/commands/review/find-all-reviews.command.js +0 -20
- package/build/commands/review/get-review-count.command.js +0 -15
- package/build/commands/tools/image-generation/delete-all-image-generation-jobs.command.js +0 -10
- package/build/commands/tools/image-generation/delete-image-generation-job-by-uuid.command.js +0 -13
- package/build/commands/tools/image-generation/find-image-generation-job-by-uuid.command.js +0 -14
- package/build/commands/tools/image-generation/find-image-generation-jobs.command.js +0 -18
- package/build/commands/tools/image-generation/get-image-generation-config.command.js +0 -11
- package/build/commands/tools/image-generation/image-generation.command.js +0 -23
- package/build/commands/tools/image-generation/index.js +0 -24
- package/build/commands/tools/image-generation/set-reaction-to-image-generation-job.command.js +0 -28
- package/build/commands/tools/image-generation/update-image-generation-job-title.command.js +0 -17
- package/build/commands/tools/paraphrase/delete-all-paraphrase-jobs.command.js +0 -8
- package/build/commands/tools/paraphrase/delete-paraphrase-job-by-uuid.command.js +0 -11
- package/build/commands/tools/paraphrase/find-paraphrase-jobs.command.js +0 -18
- package/build/commands/tools/paraphrase/retry-paraphrase-job.command.js +0 -14
- package/build/commands/tools/paraphrase/set-reaction-to-paraphrase-job.command.js +0 -28
- package/build/commands/tools/paraphrase/update-paraphrase-job-title.command.js +0 -17
- package/build/commands/tools/presentation/set-reaction-to-presentation.command.js +0 -28
- package/build/commands/user/cancel-user-subscription.command.js +0 -21
- package/build/commands/user/get-user-payments.command.js +0 -26
- package/build/commands/user-profile/delete-avatar.command.js +0 -12
- package/build/commands/user-profile/get-user-profile-by-user-id.command.js +0 -14
- package/build/commands/user-profile/index.js +0 -20
- package/build/commands/user-profile/update-profile.command.js +0 -14
- package/build/commands/user-profile/upload-avatar.command.js +0 -11
- package/build/commands/user-to-subscription/delete-user-to-subscription.command.js +0 -16
- package/build/constants/community/community-post-report/enums/community-post-report-reason.enum.js +0 -18
- package/build/constants/community/community-post-report/index.js +0 -17
- package/build/constants/community/default-pagination.constant.js +0 -6
- package/build/constants/community/enums/community-aspect-ratio.enum.js +0 -11
- package/build/constants/community/enums/community-post-visibility.enum.js +0 -8
- package/build/constants/community/enums/community-status.enum.js +0 -11
- package/build/constants/community/enums/community-tool-type.enum.js +0 -10
- package/build/constants/community/enums/community-type.enum.js +0 -11
- package/build/constants/community/enums/index.js +0 -21
- package/build/constants/community/index.js +0 -19
- package/build/constants/model/enums/index.js +0 -17
- package/build/constants/model/enums/unified-model-content-type.enum.js +0 -21
- package/build/constants/model/index.js +0 -17
- package/build/constants/payment/enums/payment-sort-by.enum.js +0 -10
- package/build/constants/tool/enums/tool-content-type.enum.js +0 -17
- package/build/constants/tool-image-generation/enums/image-generation-resolution.enum.js +0 -9
- package/build/constants/tool-image-generation/enums/index.js +0 -17
- package/build/constants/tool-image-generation/index.js +0 -17
- package/build/constants/user-profile/index.js +0 -17
- package/build/constants/user-profile/user-profile.constant.js +0 -10
- package/build/helpers/image-editor/calculate-image-editor-price.helper.js +0 -13
- package/build/helpers/image-editor/index.js +0 -17
- package/build/helpers/image-generation/calculate-image-generation-price.helper.js +0 -16
- package/build/helpers/image-generation/index.js +0 -17
- package/build/models/community/community-post-media-data.schema.js +0 -53
- package/build/models/community/community-post-report/community-post-report.schema.js +0 -13
- package/build/models/community/community-post-report/index.js +0 -17
- package/build/models/community/community-post.schema.js +0 -44
- package/build/models/community/index.js +0 -19
- package/build/models/tools/common/attached-tool-file.schema.js +0 -13
- package/build/models/tools/common/index.js +0 -17
- package/build/models/tools/image-generation/image-generation-config.schema.js +0 -23
- package/build/models/tools/image-generation/image-generation-job.schema.js +0 -35
- package/build/models/tools/image-generation/image-generation-model.schema.js +0 -41
- package/build/models/tools/image-generation/index.js +0 -19
- package/build/models/user-profile.schema.js +0 -16
- package/commands/ai-model/find-formatted-ai-model-v2.command.ts +0 -23
- package/commands/ai-model/find-model-pages.command.ts +0 -34
- package/commands/community/archive-community-post.command.ts +0 -13
- package/commands/community/create-community-post.command.ts +0 -40
- package/commands/community/delete-community-post.command.ts +0 -13
- package/commands/community/get-all-community-posts-by-criteria.command.ts +0 -29
- package/commands/community/get-community-post-by-uuid.command.ts +0 -16
- package/commands/community/get-my-community-posts-by-criteria.command.ts +0 -40
- package/commands/community/get-my-favorite-community-posts.command.ts +0 -19
- package/commands/community/get-my-likes-community-posts.command.ts +0 -19
- package/commands/community/index.ts +0 -13
- package/commands/community/send-report-to-community-post.command.ts +0 -17
- package/commands/community/set-favorite-community-post.command.ts +0 -13
- package/commands/community/set-like-community-post.command.ts +0 -14
- package/commands/community/share-my-community-post.command.ts +0 -13
- package/commands/payment/refund-payment.command.ts +0 -17
- package/commands/review/find-all-reviews.command.ts +0 -19
- package/commands/review/get-review-count.command.ts +0 -13
- package/commands/tools/image-generation/delete-image-generation-job-by-uuid.command.ts +0 -13
- package/commands/tools/image-generation/find-image-generation-job-by-uuid.command.ts +0 -16
- package/commands/tools/image-generation/find-image-generation-jobs.command.ts +0 -18
- package/commands/tools/image-generation/get-image-generation-config.command.ts +0 -9
- package/commands/tools/image-generation/image-generation.command.ts +0 -25
- package/commands/tools/image-generation/index.ts +0 -8
- package/commands/tools/image-generation/set-reaction-to-image-generation-job.command.ts +0 -33
- package/commands/tools/image-generation/update-image-generation-job-title.command.ts +0 -19
- package/commands/tools/paraphrase/delete-all-paraphrase-jobs.command.ts +0 -6
- package/commands/tools/paraphrase/delete-paraphrase-job-by-uuid.command.ts +0 -11
- package/commands/tools/paraphrase/find-paraphrase-jobs.command.ts +0 -18
- package/commands/tools/paraphrase/retry-paraphrase-job.command.ts +0 -14
- package/commands/tools/paraphrase/set-reaction-to-paraphrase-job.command.ts +0 -33
- package/commands/tools/paraphrase/update-paraphrase-job-title.command.ts +0 -19
- package/commands/tools/presentation/set-reaction-to-presentation.command.ts +0 -33
- package/commands/user/cancel-user-subscription.command.ts +0 -21
- package/commands/user/get-user-payments.command.ts +0 -27
- package/commands/user-profile/delete-avatar.command.ts +0 -14
- package/commands/user-profile/get-user-profile-by-user-id.command.ts +0 -16
- package/commands/user-profile/index.ts +0 -4
- package/commands/user-profile/update-profile.command.ts +0 -16
- package/commands/user-profile/upload-avatar.command.ts +0 -10
- package/commands/user-to-subscription/delete-user-to-subscription.command.ts +0 -18
- package/constants/community/community-post-report/enums/community-post-report-reason.enum.ts +0 -14
- package/constants/community/community-post-report/enums/index.ts +0 -1
- package/constants/community/community-post-report/index.ts +0 -1
- package/constants/community/default-pagination.constant.ts +0 -4
- package/constants/community/enums/community-aspect-ratio.enum.ts +0 -7
- package/constants/community/enums/community-post-visibility.enum.ts +0 -4
- package/constants/community/enums/community-status.enum.ts +0 -7
- package/constants/community/enums/community-tool-type.enum.ts +0 -6
- package/constants/community/enums/community-type.enum.ts +0 -7
- package/constants/community/enums/index.ts +0 -5
- package/constants/community/index.ts +0 -3
- package/constants/model/enums/index.ts +0 -1
- package/constants/model/enums/unified-model-content-type.enum.ts +0 -17
- package/constants/model/index.ts +0 -1
- package/constants/payment/enums/payment-sort-by.enum.ts +0 -6
- package/constants/tool/enums/tool-content-type.enum.ts +0 -13
- package/constants/tool-image-generation/enums/image-generation-resolution.enum.ts +0 -5
- package/constants/tool-image-generation/enums/index.ts +0 -1
- package/constants/tool-image-generation/index.ts +0 -1
- package/constants/user-profile/index.ts +0 -1
- package/constants/user-profile/user-profile.constant.ts +0 -14
- package/helpers/image-editor/calculate-image-editor-price.helper.ts +0 -23
- package/helpers/image-editor/index.ts +0 -1
- package/helpers/image-generation/calculate-image-generation-price.helper.ts +0 -29
- package/helpers/image-generation/index.ts +0 -1
- package/models/community/community-post-media-data.schema.ts +0 -65
- package/models/community/community-post-report/community-post-report.schema.ts +0 -11
- package/models/community/community-post-report/index.ts +0 -1
- package/models/community/community-post.schema.ts +0 -48
- package/models/community/index.ts +0 -3
- package/models/tools/common/attached-tool-file.schema.ts +0 -13
- package/models/tools/common/index.ts +0 -1
- package/models/tools/image-generation/image-generation-config.schema.ts +0 -29
- package/models/tools/image-generation/image-generation-job.schema.ts +0 -42
- package/models/tools/image-generation/image-generation-model.schema.ts +0 -52
- package/models/tools/image-generation/index.ts +0 -3
- package/models/user-profile.schema.ts +0 -15
|
@@ -6,16 +6,18 @@ export const ERRORS = {
|
|
|
6
6
|
message: 'Произошла ошибка при создании пользователя',
|
|
7
7
|
httpCode: 500,
|
|
8
8
|
},
|
|
9
|
+
LOGIN_ERROR: { code: 'U02', message: 'Неверный логин или пароль', httpCode: 401 },
|
|
9
10
|
RESTORE_PASSWORD: {
|
|
10
11
|
code: 'U03',
|
|
11
12
|
message: 'Возникла ошибка при восстановлении пароля',
|
|
12
13
|
httpCode: 401,
|
|
13
14
|
},
|
|
14
|
-
|
|
15
|
+
AUTH_INCORRECT_PASSWORD: {
|
|
15
16
|
code: 'U02',
|
|
16
|
-
message: 'Неверный
|
|
17
|
+
message: 'Неверный пароль',
|
|
17
18
|
httpCode: 401,
|
|
18
19
|
},
|
|
20
|
+
REGISTER_ERROR: { code: 'U01', message: 'Произошла ошибка при регистрации', httpCode: 500 },
|
|
19
21
|
REGISTER_CONFLICT: { code: 'U04', message: 'Пользователь уже зарегистрирован', httpCode: 409 },
|
|
20
22
|
USER_NOT_FOUND: { code: 'A002', message: 'Пользователь не найден', httpCode: 404 },
|
|
21
23
|
USER_CONFLICT: {
|
|
@@ -1224,7 +1226,6 @@ export const ERRORS = {
|
|
|
1224
1226
|
TTS_MAX_SYMBOLS_EXCEEDED: {
|
|
1225
1227
|
code: 'A259',
|
|
1226
1228
|
message: 'Превышена максимальная количество символов',
|
|
1227
|
-
httpCode: 400,
|
|
1228
1229
|
},
|
|
1229
1230
|
TTS_SET_REACTION_ERROR: {
|
|
1230
1231
|
code: 'A260',
|
|
@@ -1535,7 +1536,6 @@ export const ERRORS = {
|
|
|
1535
1536
|
VIDEO_MAX_SYMBOLS_EXCEEDED: {
|
|
1536
1537
|
code: 'A319',
|
|
1537
1538
|
message: 'Превышена максимальная количество символов',
|
|
1538
|
-
httpCode: 400,
|
|
1539
1539
|
},
|
|
1540
1540
|
VIDEO_SET_REACTION_ERROR: {
|
|
1541
1541
|
code: 'A320',
|
|
@@ -1681,7 +1681,6 @@ export const ERRORS = {
|
|
|
1681
1681
|
IMAGE_EDITOR_MAX_SYMBOLS_EXCEEDED: {
|
|
1682
1682
|
code: 'A348',
|
|
1683
1683
|
message: 'Превышена максимальная количество символов',
|
|
1684
|
-
httpCode: 400,
|
|
1685
1684
|
},
|
|
1686
1685
|
IMAGE_EDITOR_SET_REACTION_ERROR: {
|
|
1687
1686
|
code: 'A349',
|
|
@@ -2345,275 +2344,39 @@ export const ERRORS = {
|
|
|
2345
2344
|
message: 'Ошибка при получении записей о переходе по ссылке вебмастера',
|
|
2346
2345
|
httpCode: 500,
|
|
2347
2346
|
},
|
|
2348
|
-
|
|
2347
|
+
WEBMASTER_CLICK_CONFLICT_ERROR: {
|
|
2349
2348
|
code: 'A478',
|
|
2350
|
-
message: '
|
|
2349
|
+
message: 'Запись о переходе этого юзера по ссылке вебмастера уже существует',
|
|
2351
2350
|
httpCode: 409,
|
|
2352
2351
|
},
|
|
2353
|
-
|
|
2352
|
+
WEBMASTER_CLICK_GET_OVERVIEW_ERROR: {
|
|
2354
2353
|
code: 'A479',
|
|
2355
|
-
message: 'Ошибка при получении
|
|
2356
|
-
httpCode:
|
|
2354
|
+
message: 'Ошибка при получении сводки записей о переходе по ссылке вебмастера',
|
|
2355
|
+
httpCode: 409,
|
|
2357
2356
|
},
|
|
2358
|
-
|
|
2357
|
+
FAILED_TO_GENERATE_API_KEY: {
|
|
2359
2358
|
code: 'A480',
|
|
2360
|
-
message: '
|
|
2359
|
+
message: 'Не удалось сгенерировать ключ API',
|
|
2361
2360
|
httpCode: 500,
|
|
2362
2361
|
},
|
|
2363
|
-
|
|
2362
|
+
FAILED_TO_REFRESH_API_KEY: {
|
|
2364
2363
|
code: 'A481',
|
|
2365
|
-
message: '
|
|
2364
|
+
message: 'Не удалось обновить ключ API',
|
|
2366
2365
|
httpCode: 500,
|
|
2367
2366
|
},
|
|
2368
|
-
|
|
2367
|
+
API_KEY_NOT_FOUND: {
|
|
2369
2368
|
code: 'A482',
|
|
2370
|
-
message: '
|
|
2369
|
+
message: 'Ключ API не найден',
|
|
2371
2370
|
httpCode: 404,
|
|
2372
2371
|
},
|
|
2373
|
-
|
|
2372
|
+
API_KEY_IS_INACTIVE: {
|
|
2374
2373
|
code: 'A483',
|
|
2375
|
-
message: '
|
|
2376
|
-
httpCode: 500,
|
|
2377
|
-
},
|
|
2378
|
-
COMMUNITY_POST_CREATE_ERROR: {
|
|
2379
|
-
code: 'A484',
|
|
2380
|
-
message: 'Произошла ошибка при создании поста в сообществе',
|
|
2381
|
-
httpCode: 500,
|
|
2382
|
-
},
|
|
2383
|
-
COMMUNITY_POST_UPDATE_ERROR: {
|
|
2384
|
-
code: 'A485',
|
|
2385
|
-
message: 'Произошла ошибка при обновлении поста в сообществе',
|
|
2386
|
-
httpCode: 500,
|
|
2387
|
-
},
|
|
2388
|
-
COMMUNITY_POST_FIND_ERROR: {
|
|
2389
|
-
code: 'A486',
|
|
2390
|
-
message: 'Произошла ошибка при получении поста в сообществе',
|
|
2391
|
-
httpCode: 500,
|
|
2392
|
-
},
|
|
2393
|
-
COMMUNITY_POST_SET_LIKE_ERROR: {
|
|
2394
|
-
code: 'A487',
|
|
2395
|
-
message: 'Произошла ошибка при установке лайка к посту в сообществе',
|
|
2396
|
-
httpCode: 500,
|
|
2397
|
-
},
|
|
2398
|
-
COMMUNITY_POST_SET_FAVORITE_ERROR: {
|
|
2399
|
-
code: 'A488',
|
|
2400
|
-
message: 'Произошла ошибка при переключении избранного поста в сообществе',
|
|
2401
|
-
httpCode: 500,
|
|
2402
|
-
},
|
|
2403
|
-
COMMUNITY_POST_OWNERSHIP_ERROR: {
|
|
2404
|
-
code: 'A489',
|
|
2405
|
-
message: 'Вы не можете переключать избранное для своего поста',
|
|
2406
|
-
httpCode: 403,
|
|
2407
|
-
},
|
|
2408
|
-
COMMUNITY_POST_PERMISSION_ERROR: {
|
|
2409
|
-
code: 'A490',
|
|
2410
|
-
message: 'У вас нет доступа к этому посту в сообществе',
|
|
2374
|
+
message: 'Ключ API не активен',
|
|
2411
2375
|
httpCode: 403,
|
|
2412
2376
|
},
|
|
2413
|
-
|
|
2414
|
-
code: '
|
|
2415
|
-
message: '
|
|
2416
|
-
httpCode:
|
|
2417
|
-
},
|
|
2418
|
-
COMMUNITY_TOOL_TYPE_REQUIRED: {
|
|
2419
|
-
code: 'A492',
|
|
2420
|
-
message: 'Тип инструмента обязателен',
|
|
2421
|
-
httpCode: 400,
|
|
2422
|
-
},
|
|
2423
|
-
COMMUNITY_TOOL_TYPE_NOT_SUPPORTED: {
|
|
2424
|
-
code: 'A493',
|
|
2425
|
-
message: 'Неподдерживаемый тип инструмента',
|
|
2426
|
-
httpCode: 400,
|
|
2427
|
-
},
|
|
2428
|
-
VIDEO_MODEL_FIND_ERROR: {
|
|
2429
|
-
code: 'A494',
|
|
2430
|
-
message: 'Произошла ошибка при получении модели для генерации видео',
|
|
2431
|
-
httpCode: 500,
|
|
2432
|
-
},
|
|
2433
|
-
VIDEO_EDITOR_MODEL_FIND_ERROR: {
|
|
2434
|
-
code: 'A495',
|
|
2435
|
-
message: 'Произошла ошибка при получении модели для редактирования видео',
|
|
2436
|
-
httpCode: 500,
|
|
2437
|
-
},
|
|
2438
|
-
IMAGE_EDITOR_MODEL_FIND_ERROR: {
|
|
2439
|
-
code: 'A496',
|
|
2440
|
-
message: 'Произошла ошибка при получении модели для редактирования изображения',
|
|
2441
|
-
httpCode: 500,
|
|
2442
|
-
},
|
|
2443
|
-
MUSIC_MODEL_FIND_ERROR: {
|
|
2444
|
-
code: 'A497',
|
|
2445
|
-
message: 'Произошла ошибка при получении модели для генерации музыки',
|
|
2446
|
-
httpCode: 500,
|
|
2447
|
-
},
|
|
2448
|
-
COMMUNITY_POST_NOT_AVAILABLE: {
|
|
2449
|
-
code: 'A498',
|
|
2450
|
-
message: 'Пост в сообществе недоступен',
|
|
2451
|
-
httpCode: 400,
|
|
2452
|
-
},
|
|
2453
|
-
COMMUNITY_POST_NOT_FOUND: {
|
|
2454
|
-
code: 'A499',
|
|
2455
|
-
message: 'Пост в сообществе не найден',
|
|
2456
|
-
httpCode: 404,
|
|
2457
|
-
},
|
|
2458
|
-
COMMUNITY_POST_JOB_NOT_READY: {
|
|
2459
|
-
code: 'A500',
|
|
2460
|
-
message: 'Работа не готова к публикации',
|
|
2461
|
-
httpCode: 404,
|
|
2462
|
-
},
|
|
2463
|
-
MESSAGE_STATUS_ERROR: {
|
|
2464
|
-
code: 'A501',
|
|
2465
|
-
message: 'Статус неудовлетворительный',
|
|
2466
|
-
httpCode: 400,
|
|
2467
|
-
},
|
|
2468
|
-
MESSAGE_ROLE_ERROR: {
|
|
2469
|
-
code: 'A502',
|
|
2470
|
-
message: 'Статус не удовлетворительный',
|
|
2471
|
-
httpCode: 400,
|
|
2472
|
-
},
|
|
2473
|
-
PARAPHRASE_JOB_DELETE_ERROR: {
|
|
2474
|
-
code: 'A503',
|
|
2475
|
-
message: 'Произошла ошибка при удалении задачи перефразирования',
|
|
2476
|
-
httpCode: 500,
|
|
2477
|
-
},
|
|
2478
|
-
PARAPHRASE_SET_REACTION_ERROR: {
|
|
2479
|
-
code: 'A504',
|
|
2480
|
-
message: 'Произошла ошибка при установке оценки задачи перефразирования',
|
|
2481
|
-
httpCode: 500,
|
|
2482
|
-
},
|
|
2483
|
-
PARAPHRASE_UPDATE_TITLE_ERROR: {
|
|
2484
|
-
code: 'A505',
|
|
2485
|
-
message: 'Произошла ошибка при обновлении названия задачи перефразирования',
|
|
2486
|
-
httpCode: 500,
|
|
2487
|
-
},
|
|
2488
|
-
PARAPHRASE_RETRY_REQUEST_ERROR: {
|
|
2489
|
-
code: 'A506',
|
|
2490
|
-
message: 'Произошла ошибка при повторном запросе перефразирования',
|
|
2491
|
-
httpCode: 500,
|
|
2492
|
-
},
|
|
2493
|
-
MODERATION_ERROR: {
|
|
2494
|
-
code: 'A507',
|
|
2495
|
-
message: 'Произошла ошибка при попытке модерации',
|
|
2496
|
-
httpCode: 500,
|
|
2497
|
-
},
|
|
2498
|
-
MODERATION_SAVE_ERROR: {
|
|
2499
|
-
code: 'A508',
|
|
2500
|
-
message: 'Ошибка при сохранении лога модерации',
|
|
2501
|
-
httpCode: 500,
|
|
2502
|
-
},
|
|
2503
|
-
COMMUNITY_POST_REPORT_SEND_ERROR: {
|
|
2504
|
-
code: 'A509',
|
|
2505
|
-
message: 'Произошла ошибка при отправке жалобы на пост в сообществе',
|
|
2506
|
-
httpCode: 500,
|
|
2507
|
-
},
|
|
2508
|
-
COMMUNITY_POST_REPORT_FIND_INTERNAL_ERROR: {
|
|
2509
|
-
code: 'A510',
|
|
2510
|
-
message: 'Произошла ошибка при поиске жалобы на пост в сообществе',
|
|
2511
|
-
httpCode: 500,
|
|
2512
|
-
},
|
|
2513
|
-
COMMUNITY_POST_REPORT_ALREADY_SENT: {
|
|
2514
|
-
code: 'A511',
|
|
2515
|
-
message: 'Жалоба на пост в сообществе уже отправлена',
|
|
2516
|
-
httpCode: 400,
|
|
2517
|
-
},
|
|
2518
|
-
FILES_SAVE_ERROR: {
|
|
2519
|
-
code: 'A512',
|
|
2520
|
-
message: 'Произошла ошибка при сохранении файлов',
|
|
2521
|
-
httpCode: 500,
|
|
2522
|
-
},
|
|
2523
|
-
IMAGE_GENERATION_CONFIG_ERROR: {
|
|
2524
|
-
code: 'A513',
|
|
2525
|
-
message:
|
|
2526
|
-
'Произошла ошибка при получении конфигурации инструмента для генерации изображений',
|
|
2527
|
-
httpCode: 500,
|
|
2528
|
-
},
|
|
2529
|
-
IMAGE_GENERATION_SEND_REQUEST_ERROR: {
|
|
2530
|
-
code: 'A514',
|
|
2531
|
-
message: 'Произошла ошибка при отправке запроса на генерацию изображения',
|
|
2532
|
-
httpCode: 500,
|
|
2533
|
-
},
|
|
2534
|
-
IMAGE_GENERATION_FIND_JOBS_ERROR: {
|
|
2535
|
-
code: 'A515',
|
|
2536
|
-
message: 'Произошла ошибка при получении списка заданий на генерацию изображений',
|
|
2537
|
-
httpCode: 500,
|
|
2538
|
-
},
|
|
2539
|
-
IMAGE_GENERATION_FIND_JOB_ERROR: {
|
|
2540
|
-
code: 'A516',
|
|
2541
|
-
message: 'Произошла ошибка при получении задания на генерацию изображения',
|
|
2542
|
-
httpCode: 500,
|
|
2543
|
-
},
|
|
2544
|
-
IMAGE_GENERATION_RETRY_JOB_ERROR: {
|
|
2545
|
-
code: 'A517',
|
|
2546
|
-
message: 'Произошла ошибка при повторном запросе на генерацию изображения',
|
|
2547
|
-
httpCode: 500,
|
|
2548
|
-
},
|
|
2549
|
-
IMAGE_GENERATION_SET_REACTION_ERROR: {
|
|
2550
|
-
code: 'A518',
|
|
2551
|
-
message: 'Произошла ошибка при установке оценки задания на генерацию изображения',
|
|
2552
|
-
httpCode: 500,
|
|
2553
|
-
},
|
|
2554
|
-
IMAGE_GENERATION_UPDATE_TITLE_ERROR: {
|
|
2555
|
-
code: 'A519',
|
|
2556
|
-
message: 'Произошла ошибка при обновлении названия задания на генерацию изображения',
|
|
2557
|
-
httpCode: 500,
|
|
2558
|
-
},
|
|
2559
|
-
IMAGE_GENERATION_DELETE_JOB_ERROR: {
|
|
2560
|
-
code: 'A520',
|
|
2561
|
-
message: 'Произошла ошибка при удалении задания на генерацию изображения',
|
|
2562
|
-
httpCode: 500,
|
|
2563
|
-
},
|
|
2564
|
-
IMAGE_GENERATION_DELETE_ALL_JOBS_ERROR: {
|
|
2565
|
-
code: 'A521',
|
|
2566
|
-
message: 'Произошла ошибка при удалении всех заданий на генерацию изображений',
|
|
2567
|
-
httpCode: 500,
|
|
2568
|
-
},
|
|
2569
|
-
IMAGE_GENERATION_MODEL_NOT_FOUND: {
|
|
2570
|
-
code: 'A522',
|
|
2571
|
-
message: 'Не удалось найти указанную модель для генерации изображений',
|
|
2572
|
-
httpCode: 400,
|
|
2573
|
-
},
|
|
2574
|
-
IMAGE_GENERATION_MODEL_INACTIVE: {
|
|
2575
|
-
code: 'A523',
|
|
2576
|
-
message: 'Модель для генерации изображений неактивна',
|
|
2577
|
-
httpCode: 400,
|
|
2578
|
-
},
|
|
2579
|
-
IMAGE_GENERATION_MODEL_NOT_AVAILABLE: {
|
|
2580
|
-
code: 'A524',
|
|
2581
|
-
message: 'Модель для генерации изображений недоступна для данного пользователя',
|
|
2582
|
-
httpCode: 403,
|
|
2583
|
-
},
|
|
2584
|
-
IMAGE_GENERATION_MAX_SYMBOLS_EXCEEDED: {
|
|
2585
|
-
code: 'A525',
|
|
2586
|
-
message: 'Превышена максимальная количество символов',
|
|
2587
|
-
httpCode: 400,
|
|
2588
|
-
},
|
|
2589
|
-
MODERATION_NOT_COMPLIANT: {
|
|
2590
|
-
code: 'A526',
|
|
2591
|
-
message: 'Публикация не соответствует внутренним правилам сервиса.',
|
|
2592
|
-
httpCode: 400,
|
|
2593
|
-
},
|
|
2594
|
-
REVIEW_COUNT_ERROR: {
|
|
2595
|
-
code: 'A527',
|
|
2596
|
-
message: 'Ошибка при подсчёте количества отзывов',
|
|
2597
|
-
httpCode: 500,
|
|
2598
|
-
},
|
|
2599
|
-
PAYMENT_REFUND_ERROR: {
|
|
2600
|
-
code: 'A528',
|
|
2601
|
-
message: 'Ошибка при возврате платежа',
|
|
2602
|
-
httpCode: 500,
|
|
2603
|
-
},
|
|
2604
|
-
PAYMENT_REFUND_FOR_PRODUCT_FORBIDDEN: {
|
|
2605
|
-
code: 'A529',
|
|
2606
|
-
message: 'Нельзя провести возврат платежа за покупку пакета',
|
|
2607
|
-
httpCode: 400,
|
|
2608
|
-
},
|
|
2609
|
-
COMMUNITY_POST_LIKES_COUNT_ERROR: {
|
|
2610
|
-
code: 'A530',
|
|
2611
|
-
message: 'Произошла ошибка при получении количества лайков на моих постах в сообществе',
|
|
2612
|
-
httpCode: 500,
|
|
2613
|
-
},
|
|
2614
|
-
PRESENTATION_SET_REACTION_ERROR: {
|
|
2615
|
-
code: 'A531',
|
|
2616
|
-
message: 'Произошла ошибка при установке оценки презентации',
|
|
2617
|
-
httpCode: 500,
|
|
2377
|
+
API_KEY_ALREADY_EXISTS: {
|
|
2378
|
+
code: 'A484',
|
|
2379
|
+
message: 'Ключ API уже существует, если потеряли ключ воспользуйтесь GET token/refresh',
|
|
2380
|
+
httpCode: 409,
|
|
2618
2381
|
},
|
|
2619
2382
|
};
|
package/constants/index.ts
CHANGED
|
@@ -34,13 +34,9 @@ export * from './tool-video';
|
|
|
34
34
|
export * from './tool-video-editor';
|
|
35
35
|
export * from './writer';
|
|
36
36
|
export * from './tool-image-editor';
|
|
37
|
-
export * from './tool-image-generation';
|
|
38
37
|
export * from './feedback';
|
|
39
38
|
export * from './daily-streak';
|
|
40
39
|
export * from './cabinet';
|
|
41
40
|
export * from './webmaster';
|
|
42
41
|
export * from './webmaster-balance';
|
|
43
42
|
export * from './tool-music';
|
|
44
|
-
export * from './community';
|
|
45
|
-
export * from './user-profile';
|
|
46
|
-
export * from './model';
|
|
@@ -11,5 +11,4 @@ export const SLIDE_LAYOUT_MAP = new Map<SLIDE_CONTENT_TYPE, SLIDE_LAYOUT[]>([
|
|
|
11
11
|
[SLIDE_CONTENT_TYPE.THANK_YOU, [SLIDE_LAYOUT.TYPE_1]],
|
|
12
12
|
[SLIDE_CONTENT_TYPE.TABLE, [SLIDE_LAYOUT.TYPE_1]],
|
|
13
13
|
[SLIDE_CONTENT_TYPE.CHART, [SLIDE_LAYOUT.TYPE_1]],
|
|
14
|
-
[SLIDE_CONTENT_TYPE.TIMELINE, [SLIDE_LAYOUT.TYPE_1]],
|
|
15
14
|
]);
|
|
@@ -18,10 +18,6 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
|
|
|
18
18
|
CARRYOVER_BALANCE = 'carryover_balance',
|
|
19
19
|
MUSIC_MODEL_ACCESS = 'music_model_access',
|
|
20
20
|
MUSIC_QUOTA = 'music_quota',
|
|
21
|
-
WRITER_QUOTA = 'writer_quota',
|
|
22
|
-
WRITER_MODEL_ACCESS = 'writer_model_access',
|
|
23
|
-
IMAGE_EDITOR_QUOTA = 'image_editor_quota',
|
|
24
|
-
IMAGE_EDITOR_MODEL_ACCESS = 'image_editor_model_access',
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
export enum SUBSCRIPTION_FEATURE_KIND {
|
|
@@ -35,6 +31,4 @@ export enum SUBSCRIPTION_FEATURE_KIND {
|
|
|
35
31
|
PRESENTATION = 'presentation',
|
|
36
32
|
BASE = 'base',
|
|
37
33
|
MUSIC = 'music',
|
|
38
|
-
WRITER = 'writer',
|
|
39
|
-
IMAGE_EDITOR = 'image_editor',
|
|
40
34
|
}
|
|
@@ -8,6 +8,6 @@ export enum SUBSCRIPTION_STATUS {
|
|
|
8
8
|
downgraded = 'downgraded',
|
|
9
9
|
awaiting_activation = 'awaiting_activation',
|
|
10
10
|
awaiting_downgrade = 'awaiting_downgrade',
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
downgraded_sub_was_cancelled = 'downgraded_sub_was_cancelled',
|
|
12
|
+
downgrade_cancelled = 'downgrade_cancelled',
|
|
13
13
|
}
|
package/helpers/index.ts
CHANGED
|
@@ -36,13 +36,7 @@ export function calculateVideoGenerationPrice({
|
|
|
36
36
|
params: VideoGenerationRequestParams;
|
|
37
37
|
rules: VideoModelPricingRules;
|
|
38
38
|
}) {
|
|
39
|
-
const
|
|
40
|
-
.filter((r) => r.type === VIDEO_PRICING_RULE_TYPE.PER_SECOND)
|
|
41
|
-
.find((r) => matchesCondition(r.condition, params));
|
|
42
|
-
|
|
43
|
-
const effectivePricePerSecond = perSecondRule ? perSecondRule.value : pricePerSecond;
|
|
44
|
-
|
|
45
|
-
const base = effectivePricePerSecond * params.duration;
|
|
39
|
+
const base = pricePerSecond * params.duration;
|
|
46
40
|
|
|
47
41
|
const flatMarkup = rules.reduce((sum, r) => {
|
|
48
42
|
if (r.type !== VIDEO_PRICING_RULE_TYPE.FLAT) {
|
package/models/index.ts
CHANGED
|
@@ -54,5 +54,4 @@ export * from './webmaster.schema';
|
|
|
54
54
|
export * from './webmaster-balance.schema';
|
|
55
55
|
export * from './user-referrals.schema';
|
|
56
56
|
export * from './webmaster-click.schema';
|
|
57
|
-
export * from './
|
|
58
|
-
export * from './user-profile.schema';
|
|
57
|
+
export * from './api-key.schema';
|
package/models/order.schema.ts
CHANGED
package/models/page.schema.ts
CHANGED
|
@@ -13,8 +13,7 @@ export const PageSchema = z.object({
|
|
|
13
13
|
aIModelId: z.string().uuid().nullable().optional(),
|
|
14
14
|
toolId: z.string().uuid().nullable().optional(),
|
|
15
15
|
toolOptionId: z.string().uuid().nullable().optional(),
|
|
16
|
-
|
|
17
|
-
toolTitle: z.string().optional().nullable(),
|
|
16
|
+
toolTitle: z.string().nullable(),
|
|
18
17
|
type: z.nativeEnum(PageType),
|
|
19
18
|
|
|
20
19
|
createdAt: z.date(),
|
package/models/payment.schema.ts
CHANGED
|
@@ -3,14 +3,10 @@ import { z } from 'zod';
|
|
|
3
3
|
export const PaymentSchema = z.object({
|
|
4
4
|
uuid: z.string().uuid(),
|
|
5
5
|
link: z.nullable(z.string()),
|
|
6
|
-
status: z.
|
|
6
|
+
status: z.boolean(),
|
|
7
7
|
sum: z.number(),
|
|
8
8
|
orderId: z.string().uuid(),
|
|
9
9
|
|
|
10
10
|
createdAt: z.date(),
|
|
11
11
|
updatedAt: z.date(),
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
export const PaymentWithDescriptionSchema = PaymentSchema.extend({
|
|
15
|
-
description: z.string(),
|
|
16
|
-
});
|
package/models/review.schema.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { REVIEW_STATUS } from '../constants';
|
|
3
2
|
|
|
4
3
|
export const ReviewSchema = z.object({
|
|
5
4
|
uuid: z.string().uuid(),
|
|
@@ -7,7 +6,6 @@ export const ReviewSchema = z.object({
|
|
|
7
6
|
name: z.string(),
|
|
8
7
|
text: z.string(),
|
|
9
8
|
rating: z.number().int().step(1).min(0).max(5),
|
|
10
|
-
status: z.nativeEnum(REVIEW_STATUS),
|
|
11
9
|
|
|
12
10
|
createdAt: z.date(),
|
|
13
11
|
updatedAt: z.date(),
|
|
@@ -162,36 +162,6 @@ export const MusicModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.exten
|
|
|
162
162
|
});
|
|
163
163
|
export type MusicModelAccessFeature = z.infer<typeof MusicModelAccessFeatureSchema>;
|
|
164
164
|
|
|
165
|
-
export const WriterQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
166
|
-
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.WRITER),
|
|
167
|
-
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.WRITER_QUOTA),
|
|
168
|
-
value: z.number(),
|
|
169
|
-
});
|
|
170
|
-
export type WriterQuotaFeature = z.infer<typeof WriterQuotaFeatureSchema>;
|
|
171
|
-
|
|
172
|
-
export const WriterModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
173
|
-
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.WRITER),
|
|
174
|
-
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.WRITER_MODEL_ACCESS),
|
|
175
|
-
isAvailable: z.boolean(),
|
|
176
|
-
modelId: z.string(),
|
|
177
|
-
});
|
|
178
|
-
export type WriterModelAccessFeature = z.infer<typeof WriterModelAccessFeatureSchema>;
|
|
179
|
-
|
|
180
|
-
export const ImageEditorQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
181
|
-
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_EDITOR),
|
|
182
|
-
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_EDITOR_QUOTA),
|
|
183
|
-
value: z.number(),
|
|
184
|
-
});
|
|
185
|
-
export type ImageEditorQuotaFeature = z.infer<typeof ImageEditorQuotaFeatureSchema>;
|
|
186
|
-
|
|
187
|
-
export const ImageEditorModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
188
|
-
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_EDITOR),
|
|
189
|
-
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_EDITOR_MODEL_ACCESS),
|
|
190
|
-
isAvailable: z.boolean(),
|
|
191
|
-
modelId: z.string(),
|
|
192
|
-
});
|
|
193
|
-
export type ImageEditorModelAccessFeature = z.infer<typeof ImageEditorModelAccessFeatureSchema>;
|
|
194
|
-
|
|
195
165
|
export const SubscriptionFeatureSchema = z.union([
|
|
196
166
|
AiModelAccessFeatureSchema,
|
|
197
167
|
RequestsQuotaFeatureSchema,
|
|
@@ -211,10 +181,6 @@ export const SubscriptionFeatureSchema = z.union([
|
|
|
211
181
|
CarryoverBalanceFeatureSchema,
|
|
212
182
|
MusicQuotaFeatureSchema,
|
|
213
183
|
MusicModelAccessFeatureSchema,
|
|
214
|
-
WriterQuotaFeatureSchema,
|
|
215
|
-
WriterModelAccessFeatureSchema,
|
|
216
|
-
ImageEditorQuotaFeatureSchema,
|
|
217
|
-
ImageEditorModelAccessFeatureSchema,
|
|
218
184
|
]);
|
|
219
185
|
|
|
220
186
|
export type SubscriptionFeature = z.infer<typeof SubscriptionFeatureSchema>;
|
package/models/tool.schema.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { USER_REACTION } from '../../../constants';
|
|
3
3
|
import { ToolJobSchema } from '../../tool-job.schema';
|
|
4
|
-
import { FileSchema } from '../../file.schema';
|
|
5
|
-
import { AttachedToolFileSchema } from '../common';
|
|
6
4
|
|
|
7
5
|
export const ImageEditorJobParamsSchema = z.object({
|
|
8
|
-
|
|
6
|
+
imageUrls: z.array(z.string()).optional(),
|
|
9
7
|
systemPromptId: z.string().optional(),
|
|
10
|
-
imageUrls: z.string().array().optional(),
|
|
11
8
|
});
|
|
12
9
|
|
|
13
10
|
export type ImageEditorJobParams = z.infer<typeof ImageEditorJobParamsSchema>;
|
|
@@ -16,15 +13,7 @@ export const ImageEditorJobSchema = ToolJobSchema.extend({
|
|
|
16
13
|
title: z.string(),
|
|
17
14
|
prompt: z.string(),
|
|
18
15
|
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
19
|
-
imageUrls: z.string().
|
|
20
|
-
images: z
|
|
21
|
-
.array(
|
|
22
|
-
FileSchema.pick({
|
|
23
|
-
uuid: true,
|
|
24
|
-
url: true,
|
|
25
|
-
}),
|
|
26
|
-
)
|
|
27
|
-
.nullable(),
|
|
16
|
+
imageUrls: z.array(z.string()).nullable(),
|
|
28
17
|
params: ImageEditorJobParamsSchema,
|
|
29
18
|
modelId: z.string(),
|
|
30
19
|
});
|
|
@@ -12,21 +12,6 @@ export const ImageEditorModelParamsSchema = z.object({
|
|
|
12
12
|
|
|
13
13
|
export type ImageEditorModelParams = z.infer<typeof ImageEditorModelParamsSchema>;
|
|
14
14
|
|
|
15
|
-
export const ImageEditorModelPricingRuleConditionSchema = z.object({
|
|
16
|
-
withoutSub: z.boolean().optional(),
|
|
17
|
-
});
|
|
18
|
-
export type ImageEditorModelPricingRuleCondition = z.infer<
|
|
19
|
-
typeof ImageEditorModelPricingRuleConditionSchema
|
|
20
|
-
>;
|
|
21
|
-
|
|
22
|
-
export const ImageEditorModelPricingRulesSchema = z.array(
|
|
23
|
-
z.object({
|
|
24
|
-
condition: ImageEditorModelPricingRuleConditionSchema,
|
|
25
|
-
value: z.number(),
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
28
|
-
export type ImageEditorModelPricingRules = z.infer<typeof ImageEditorModelPricingRulesSchema>;
|
|
29
|
-
|
|
30
15
|
export const ImageEditorModelSchema = z.object({
|
|
31
16
|
uuid: z.string(),
|
|
32
17
|
title: z.string(),
|
|
@@ -36,7 +21,6 @@ export const ImageEditorModelSchema = z.object({
|
|
|
36
21
|
icons: IconVariantsSchema,
|
|
37
22
|
maxInputLength: z.number(),
|
|
38
23
|
params: ImageEditorModelParamsSchema,
|
|
39
|
-
pricingRules: ImageEditorModelPricingRulesSchema,
|
|
40
24
|
unlockedBy: UnlockedBySchema.nullable(),
|
|
41
25
|
canUse: z.boolean(),
|
|
42
26
|
});
|