@purpleschool/gptbot 0.8.58 → 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/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/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
|
@@ -6,18 +6,16 @@ export const ERRORS = {
|
|
|
6
6
|
message: 'Произошла ошибка при создании пользователя',
|
|
7
7
|
httpCode: 500,
|
|
8
8
|
},
|
|
9
|
-
LOGIN_ERROR: { code: 'U02', message: 'Неверный логин или пароль', httpCode: 401 },
|
|
10
9
|
RESTORE_PASSWORD: {
|
|
11
10
|
code: 'U03',
|
|
12
11
|
message: 'Возникла ошибка при восстановлении пароля',
|
|
13
12
|
httpCode: 401,
|
|
14
13
|
},
|
|
15
|
-
|
|
14
|
+
AUTH_ERROR: {
|
|
16
15
|
code: 'U02',
|
|
17
|
-
message: 'Неверный пароль',
|
|
16
|
+
message: 'Неверный логин или пароль',
|
|
18
17
|
httpCode: 401,
|
|
19
18
|
},
|
|
20
|
-
REGISTER_ERROR: { code: 'U01', message: 'Произошла ошибка при регистрации', httpCode: 500 },
|
|
21
19
|
REGISTER_CONFLICT: { code: 'U04', message: 'Пользователь уже зарегистрирован', httpCode: 409 },
|
|
22
20
|
USER_NOT_FOUND: { code: 'A002', message: 'Пользователь не найден', httpCode: 404 },
|
|
23
21
|
USER_CONFLICT: {
|
|
@@ -1226,6 +1224,7 @@ export const ERRORS = {
|
|
|
1226
1224
|
TTS_MAX_SYMBOLS_EXCEEDED: {
|
|
1227
1225
|
code: 'A259',
|
|
1228
1226
|
message: 'Превышена максимальная количество символов',
|
|
1227
|
+
httpCode: 400,
|
|
1229
1228
|
},
|
|
1230
1229
|
TTS_SET_REACTION_ERROR: {
|
|
1231
1230
|
code: 'A260',
|
|
@@ -1536,6 +1535,7 @@ export const ERRORS = {
|
|
|
1536
1535
|
VIDEO_MAX_SYMBOLS_EXCEEDED: {
|
|
1537
1536
|
code: 'A319',
|
|
1538
1537
|
message: 'Превышена максимальная количество символов',
|
|
1538
|
+
httpCode: 400,
|
|
1539
1539
|
},
|
|
1540
1540
|
VIDEO_SET_REACTION_ERROR: {
|
|
1541
1541
|
code: 'A320',
|
|
@@ -1681,6 +1681,7 @@ export const ERRORS = {
|
|
|
1681
1681
|
IMAGE_EDITOR_MAX_SYMBOLS_EXCEEDED: {
|
|
1682
1682
|
code: 'A348',
|
|
1683
1683
|
message: 'Превышена максимальная количество символов',
|
|
1684
|
+
httpCode: 400,
|
|
1684
1685
|
},
|
|
1685
1686
|
IMAGE_EDITOR_SET_REACTION_ERROR: {
|
|
1686
1687
|
code: 'A349',
|
|
@@ -2344,38 +2345,299 @@ export const ERRORS = {
|
|
|
2344
2345
|
message: 'Ошибка при получении записей о переходе по ссылке вебмастера',
|
|
2345
2346
|
httpCode: 500,
|
|
2346
2347
|
},
|
|
2347
|
-
|
|
2348
|
+
WEBMASTER_CLICK_GET_OVERVIEW_ERROR: {
|
|
2348
2349
|
code: 'A478',
|
|
2349
|
-
message: '
|
|
2350
|
+
message: 'Ошибка при получении сводки записей о переходе по ссылке вебмастера',
|
|
2350
2351
|
httpCode: 409,
|
|
2351
2352
|
},
|
|
2352
|
-
|
|
2353
|
+
TOOL_GET_GLOBAL_CONFIG_ERROR: {
|
|
2353
2354
|
code: 'A479',
|
|
2354
|
-
message: 'Ошибка при получении
|
|
2355
|
-
httpCode:
|
|
2355
|
+
message: 'Ошибка при получении глобальной конфигурации инструментов',
|
|
2356
|
+
httpCode: 500,
|
|
2356
2357
|
},
|
|
2357
|
-
|
|
2358
|
+
TOOL_GET_TOOLS_WITH_CONFIGS_ERROR: {
|
|
2358
2359
|
code: 'A480',
|
|
2360
|
+
message: 'Ошибка при получении инструментов с конфигурациями',
|
|
2361
|
+
httpCode: 500,
|
|
2362
|
+
},
|
|
2363
|
+
WEBMASTER_CLICK_UPDATE_ERROR: {
|
|
2364
|
+
code: 'A481',
|
|
2365
|
+
message: 'Ошибка при обновлении записи о переходе по ссылке вебмастера',
|
|
2366
|
+
httpCode: 500,
|
|
2367
|
+
},
|
|
2368
|
+
USER_PROFILE_NOT_FOUND: {
|
|
2369
|
+
code: 'A482',
|
|
2370
|
+
message: 'Профиль пользователя не найден или пуст',
|
|
2371
|
+
httpCode: 404,
|
|
2372
|
+
},
|
|
2373
|
+
USER_PROFILE_UPSERT_ERROR: {
|
|
2374
|
+
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: 'У вас нет доступа к этому посту в сообществе',
|
|
2411
|
+
httpCode: 403,
|
|
2412
|
+
},
|
|
2413
|
+
COMMUNITY_POST_DELETE_ERROR: {
|
|
2414
|
+
code: 'A491',
|
|
2415
|
+
message: 'Произошла ошибка при удалении поста в сообществе',
|
|
2416
|
+
httpCode: 500,
|
|
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,
|
|
2618
|
+
},
|
|
2619
|
+
FAILED_TO_GENERATE_API_KEY: {
|
|
2620
|
+
code: 'A532',
|
|
2359
2621
|
message: 'Не удалось сгенерировать ключ API',
|
|
2360
2622
|
httpCode: 500,
|
|
2361
2623
|
},
|
|
2362
2624
|
FAILED_TO_REFRESH_API_KEY: {
|
|
2363
|
-
code: '
|
|
2625
|
+
code: 'A533',
|
|
2364
2626
|
message: 'Не удалось обновить ключ API',
|
|
2365
2627
|
httpCode: 500,
|
|
2366
2628
|
},
|
|
2367
2629
|
API_KEY_NOT_FOUND: {
|
|
2368
|
-
code: '
|
|
2630
|
+
code: 'A534',
|
|
2369
2631
|
message: 'Ключ API не найден',
|
|
2370
2632
|
httpCode: 404,
|
|
2371
2633
|
},
|
|
2372
2634
|
API_KEY_IS_INACTIVE: {
|
|
2373
|
-
code: '
|
|
2635
|
+
code: 'A535',
|
|
2374
2636
|
message: 'Ключ API не активен',
|
|
2375
2637
|
httpCode: 403,
|
|
2376
2638
|
},
|
|
2377
2639
|
API_KEY_ALREADY_EXISTS: {
|
|
2378
|
-
code: '
|
|
2640
|
+
code: 'A536',
|
|
2379
2641
|
message: 'Ключ API уже существует, если потеряли ключ воспользуйтесь GET token/refresh',
|
|
2380
2642
|
httpCode: 409,
|
|
2381
2643
|
},
|
package/constants/index.ts
CHANGED
|
@@ -34,9 +34,13 @@ 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';
|
|
37
38
|
export * from './feedback';
|
|
38
39
|
export * from './daily-streak';
|
|
39
40
|
export * from './cabinet';
|
|
40
41
|
export * from './webmaster';
|
|
41
42
|
export * from './webmaster-balance';
|
|
42
43
|
export * from './tool-music';
|
|
44
|
+
export * from './community';
|
|
45
|
+
export * from './user-profile';
|
|
46
|
+
export * from './model';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './unified-model-content-type.enum';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export enum UNIFIED_MODEL_CONTENT_TYPE {
|
|
2
|
+
// AI Model types
|
|
3
|
+
TEXT = 'TEXT',
|
|
4
|
+
IMAGE = 'IMAGE',
|
|
5
|
+
// Tool types
|
|
6
|
+
IMAGE_EDITOR = 'IMAGE_EDITOR',
|
|
7
|
+
TEXT_TO_SPEECH = 'TEXT_TO_SPEECH',
|
|
8
|
+
SPEECH_TO_TEXT = 'SPEECH_TO_TEXT',
|
|
9
|
+
REPHRASE = 'REPHRASE',
|
|
10
|
+
VIDEO = 'VIDEO',
|
|
11
|
+
PRESENTATION = 'PRESENTATION',
|
|
12
|
+
WRITER = 'WRITER',
|
|
13
|
+
VIDEO_EDITOR = 'VIDEO_EDITOR',
|
|
14
|
+
MUSIC = 'MUSIC',
|
|
15
|
+
NONE = 'NONE',
|
|
16
|
+
IMAGE_GENERATION = 'IMAGE_GENERATION',
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -11,4 +11,5 @@ 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]],
|
|
14
15
|
]);
|
|
@@ -18,6 +18,10 @@ 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',
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export enum SUBSCRIPTION_FEATURE_KIND {
|
|
@@ -31,4 +35,6 @@ export enum SUBSCRIPTION_FEATURE_KIND {
|
|
|
31
35
|
PRESENTATION = 'presentation',
|
|
32
36
|
BASE = 'base',
|
|
33
37
|
MUSIC = 'music',
|
|
38
|
+
WRITER = 'writer',
|
|
39
|
+
IMAGE_EDITOR = 'image_editor',
|
|
34
40
|
}
|
|
@@ -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
|
+
downgrade_canceled = 'downgrade_canceled',
|
|
12
|
+
deleted = 'deleted',
|
|
13
13
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export enum TOOL_CONTENT_TYPE {
|
|
2
|
+
IMAGE_EDITOR = 'IMAGE_EDITOR',
|
|
3
|
+
TEXT_TO_SPEECH = 'TEXT_TO_SPEECH',
|
|
4
|
+
SPEECH_TO_TEXT = 'SPEECH_TO_TEXT',
|
|
5
|
+
REPHRASE = 'REPHRASE',
|
|
6
|
+
VIDEO = 'VIDEO',
|
|
7
|
+
PRESENTATION = 'PRESENTATION',
|
|
8
|
+
WRITER = 'WRITER',
|
|
9
|
+
VIDEO_EDITOR = 'VIDEO_EDITOR',
|
|
10
|
+
MUSIC = 'MUSIC',
|
|
11
|
+
NONE = 'NONE',
|
|
12
|
+
IMAGE_GENERATION = 'IMAGE_GENERATION',
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './image-generation-resolution.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user-profile.constant';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MAX_IMAGE_UPLOAD_SIZE } from '../file';
|
|
2
|
+
import { FILE_TYPE } from '../file/enums';
|
|
3
|
+
|
|
4
|
+
export const SUPPORTED_AVATAR_FILES = new Map<
|
|
5
|
+
string,
|
|
6
|
+
{
|
|
7
|
+
type: FILE_TYPE;
|
|
8
|
+
size: number;
|
|
9
|
+
}
|
|
10
|
+
>([
|
|
11
|
+
['image/jpeg', { type: FILE_TYPE.IMAGE, size: MAX_IMAGE_UPLOAD_SIZE }],
|
|
12
|
+
['image/png', { type: FILE_TYPE.IMAGE, size: MAX_IMAGE_UPLOAD_SIZE }],
|
|
13
|
+
['image/webp', { type: FILE_TYPE.IMAGE, size: MAX_IMAGE_UPLOAD_SIZE }],
|
|
14
|
+
]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ImageEditorModelPricingRules } from '../../models';
|
|
2
|
+
|
|
3
|
+
export function calculateImageEditorPrice({
|
|
4
|
+
basePrice,
|
|
5
|
+
userHasActiveSubscriptionOrProduct,
|
|
6
|
+
rules,
|
|
7
|
+
}: {
|
|
8
|
+
basePrice: number;
|
|
9
|
+
userHasActiveSubscriptionOrProduct: boolean;
|
|
10
|
+
rules: ImageEditorModelPricingRules;
|
|
11
|
+
}): number {
|
|
12
|
+
let extra = 0;
|
|
13
|
+
|
|
14
|
+
for (const rule of rules ?? []) {
|
|
15
|
+
const condition = rule.condition;
|
|
16
|
+
|
|
17
|
+
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
18
|
+
extra += rule.value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return basePrice + extra;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calculate-image-editor-price.helper';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ImageGenerationJobParams, ImageModelPricingRules } from '../../models';
|
|
2
|
+
|
|
3
|
+
export function calculateImageGenerationPrice({
|
|
4
|
+
basePrice,
|
|
5
|
+
params,
|
|
6
|
+
userHasActiveSubscriptionOrProduct,
|
|
7
|
+
rules,
|
|
8
|
+
}: {
|
|
9
|
+
basePrice: number;
|
|
10
|
+
params: Pick<ImageGenerationJobParams, 'resolution'>;
|
|
11
|
+
userHasActiveSubscriptionOrProduct: boolean;
|
|
12
|
+
rules: ImageModelPricingRules;
|
|
13
|
+
}): number {
|
|
14
|
+
let extra = 0;
|
|
15
|
+
|
|
16
|
+
for (const rule of rules ?? []) {
|
|
17
|
+
const condition = rule.condition;
|
|
18
|
+
|
|
19
|
+
if (condition.resolution && condition.resolution === params.resolution) {
|
|
20
|
+
extra += rule.value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
24
|
+
extra += rule.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return basePrice + extra;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calculate-image-generation-price.helper';
|
package/helpers/index.ts
CHANGED
|
@@ -36,7 +36,13 @@ export function calculateVideoGenerationPrice({
|
|
|
36
36
|
params: VideoGenerationRequestParams;
|
|
37
37
|
rules: VideoModelPricingRules;
|
|
38
38
|
}) {
|
|
39
|
-
const
|
|
39
|
+
const perSecondRule = rules
|
|
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;
|
|
40
46
|
|
|
41
47
|
const flatMarkup = rules.reduce((sum, r) => {
|
|
42
48
|
if (r.type !== VIDEO_PRICING_RULE_TYPE.FLAT) {
|