@purpleschool/student-works 0.0.1
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/controller/http/auth.ts +13 -0
- package/api/controller/http/cloud-payments.ts +4 -0
- package/api/controller/http/files.ts +7 -0
- package/api/controller/http/index.ts +14 -0
- package/api/controller/http/page.ts +8 -0
- package/api/controller/http/payment.ts +5 -0
- package/api/controller/http/product.ts +11 -0
- package/api/controller/http/promocode.ts +9 -0
- package/api/controller/http/referral.ts +7 -0
- package/api/controller/http/subscription.ts +21 -0
- package/api/controller/http/unregistered-user.ts +1 -0
- package/api/controller/http/user-to-product.ts +6 -0
- package/api/controller/http/user-to-subscription.ts +6 -0
- package/api/controller/http/user.ts +14 -0
- package/api/controller/http/writer.ts +26 -0
- package/api/controller/index.ts +1 -0
- package/api/index.ts +2 -0
- package/api/routes.ts +147 -0
- package/build/api/controller/http/auth.js +15 -0
- package/build/api/controller/http/cloud-payments.js +7 -0
- package/build/api/controller/http/files.js +9 -0
- package/build/api/controller/http/index.js +30 -0
- package/build/api/controller/http/page.js +10 -0
- package/build/api/controller/http/payment.js +7 -0
- package/build/api/controller/http/product.js +12 -0
- package/build/api/controller/http/promocode.js +11 -0
- package/build/api/controller/http/referral.js +9 -0
- package/build/api/controller/http/subscription.js +22 -0
- package/build/api/controller/http/unregistered-user.js +4 -0
- package/build/api/controller/http/user-to-product.js +8 -0
- package/build/api/controller/http/user-to-subscription.js +8 -0
- package/build/api/controller/http/user.js +16 -0
- package/build/api/controller/http/writer.js +28 -0
- package/build/api/controller/index.js +17 -0
- package/build/api/index.js +18 -0
- package/build/api/routes.js +147 -0
- package/build/commands/account-merge/index.js +17 -0
- package/build/commands/account-merge/merge-account.command.js +16 -0
- package/build/commands/auth/create-user.command.js +16 -0
- package/build/commands/auth/index.js +25 -0
- package/build/commands/auth/login.command.js +17 -0
- package/build/commands/auth/register-user.command.js +18 -0
- package/build/commands/auth/reset-password.command.js +17 -0
- package/build/commands/auth/restore-password.command.js +16 -0
- package/build/commands/auth/verify-email-retry.command.js +9 -0
- package/build/commands/auth/verify-email.command.js +13 -0
- package/build/commands/auth/vk-login.command.js +22 -0
- package/build/commands/auth/yandex-login.command.js +20 -0
- package/build/commands/files/delete-user-file.command.js +12 -0
- package/build/commands/files/index.js +18 -0
- package/build/commands/files/upload.command.js +12 -0
- package/build/commands/index.js +30 -0
- package/build/commands/page/create-page.command.js +16 -0
- package/build/commands/page/delete-page.command.js +12 -0
- package/build/commands/page/find-page-by-alias.command.js +20 -0
- package/build/commands/page/find-page.command.js +17 -0
- package/build/commands/page/index.js +21 -0
- package/build/commands/page/update-page.command.js +19 -0
- package/build/commands/payment/check.command.js +50 -0
- package/build/commands/payment/get-payment-history.command.js +11 -0
- package/build/commands/payment/index.js +21 -0
- package/build/commands/payment/pay.command.js +47 -0
- package/build/commands/payment/receipt.command.js +67 -0
- package/build/commands/payment/recurrent.command.js +47 -0
- package/build/commands/product/buy-product.command.js +55 -0
- package/build/commands/product/create-product.command.js +16 -0
- package/build/commands/product/delete-product.command.js +12 -0
- package/build/commands/product/find-product.command.js +17 -0
- package/build/commands/product/get-my-products.command.js +11 -0
- package/build/commands/product/index.js +22 -0
- package/build/commands/product/update-product.command.js +19 -0
- package/build/commands/promocode/create-promocode.command.js +18 -0
- package/build/commands/promocode/delete-promocode.command.js +16 -0
- package/build/commands/promocode/find-promocode.command.js +17 -0
- package/build/commands/promocode/index.js +21 -0
- package/build/commands/promocode/update-promocode.command.js +19 -0
- package/build/commands/promocode/validate-promocode.command.js +17 -0
- package/build/commands/referral/get-by-bonuses.command.js +15 -0
- package/build/commands/referral/index.js +18 -0
- package/build/commands/referral/validate-referral.command.js +15 -0
- package/build/commands/subscription/buy-subscription.command.js +61 -0
- package/build/commands/subscription/cancel-subscription.command.js +14 -0
- package/build/commands/subscription/create-custom-subscription-plan.command.js +24 -0
- package/build/commands/subscription/create-subscription.command.js +16 -0
- package/build/commands/subscription/delete-subscription.command.js +14 -0
- package/build/commands/subscription/downgrade-subscription.command.js +44 -0
- package/build/commands/subscription/find-subscription.command.js +17 -0
- package/build/commands/subscription/get-available-upgrades.command.js +12 -0
- package/build/commands/subscription/get-free-subscription.command.js +11 -0
- package/build/commands/subscription/get-subscriptions-summary.command.js +12 -0
- package/build/commands/subscription/index.js +30 -0
- package/build/commands/subscription/recover-past-due-subscription.command.js +13 -0
- package/build/commands/subscription/recover-subscription.command.js +11 -0
- package/build/commands/subscription/update-subscription.command.js +19 -0
- package/build/commands/subscription/upgrade-subscription.command.js +45 -0
- package/build/commands/unregistered-user/create-unregistered-user.command.js +12 -0
- package/build/commands/unregistered-user/index.js +17 -0
- package/build/commands/user/check-email.command.js +10 -0
- package/build/commands/user/delete-account.command.js +12 -0
- package/build/commands/user/find-user-by-uuid.command.js +19 -0
- package/build/commands/user/find-users-by-criteria.command.js +60 -0
- package/build/commands/user/get-aggregated-user-data.command.js +24 -0
- package/build/commands/user/get-me.command.js +20 -0
- package/build/commands/user/get-user-balance.command.js +15 -0
- package/build/commands/user/get-user-orders.command.js +27 -0
- package/build/commands/user/get-user-products.command.js +25 -0
- package/build/commands/user/get-user-subscriptions.command.js +25 -0
- package/build/commands/user/index.js +27 -0
- package/build/commands/user/up-token-bonus-balance.command.js +18 -0
- package/build/commands/user-to-product/get-user-to-product-by-uuid.command.js +17 -0
- package/build/commands/user-to-product/index.js +18 -0
- package/build/commands/user-to-product/update-user-to-product.command.js +19 -0
- package/build/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.js +17 -0
- package/build/commands/user-to-subscription/get-user-to-subscriptions.command.js +11 -0
- package/build/commands/user-to-subscription/index.js +19 -0
- package/build/commands/user-to-subscription/update-user-to-subscription.command.js +27 -0
- package/build/commands/writer/collect-writer-document-sources.command.js +15 -0
- package/build/commands/writer/create-writer-document.command.js +15 -0
- package/build/commands/writer/delete-all-writer-documents.command.js +8 -0
- package/build/commands/writer/delete-writer-document-by-uuid.command.js +11 -0
- package/build/commands/writer/discard-writer-source.command.js +16 -0
- package/build/commands/writer/export-writer-document-as-docx.command.js +15 -0
- package/build/commands/writer/find-writer-document-by-uuid.command.js +14 -0
- package/build/commands/writer/find-writer-documents.command.js +18 -0
- package/build/commands/writer/generate-writer-document-contents.command.js +17 -0
- package/build/commands/writer/generate-writer-document-outline.command.js +21 -0
- package/build/commands/writer/get-writer-document-sources.command.js +14 -0
- package/build/commands/writer/get-writer-tool-config.command.js +11 -0
- package/build/commands/writer/index.js +37 -0
- package/build/commands/writer/set-reaction.writer-document.command.js +18 -0
- package/build/commands/writer/update-writer-document-contents.command.js +18 -0
- package/build/commands/writer/update-writer-document-outline.command.js +18 -0
- package/build/commands/writer/upload-writer-source.command.js +18 -0
- package/build/commands/writer/writer-extend-text.command.js +18 -0
- package/build/commands/writer/writer-fix-errors.command.js +18 -0
- package/build/commands/writer/writer-generate-text.command.js +21 -0
- package/build/commands/writer/writer-paraphrase.command.js +18 -0
- package/build/commands/writer/writer-shorten-text.command.js +18 -0
- package/build/common/index.js +17 -0
- package/build/common/models/command-response.schema.js +17 -0
- package/build/common/models/index.js +17 -0
- package/build/constants/cloud-payments/index.js +11 -0
- package/build/constants/domains/index.js +17 -0
- package/build/constants/domains/white-list.js +56 -0
- package/build/constants/email/email-endpoint.js +4 -0
- package/build/constants/email/index.js +18 -0
- package/build/constants/email/subjects.js +15 -0
- package/build/constants/errors/errors.js +1052 -0
- package/build/constants/errors/index.js +18 -0
- package/build/constants/errors/verbose.js +9 -0
- package/build/constants/files/enums/file-type.enum.js +8 -0
- package/build/constants/files/enums/index.js +17 -0
- package/build/constants/files/file.constants.js +6 -0
- package/build/constants/files/index.js +18 -0
- package/build/constants/index.js +31 -0
- package/build/constants/order/enums/index.js +18 -0
- package/build/constants/order/enums/order-sort-by.enum.js +11 -0
- package/build/constants/order/enums/order-status.enum.js +16 -0
- package/build/constants/order/enums/order-type.enum.js +9 -0
- package/build/constants/order/index.js +17 -0
- package/build/constants/page/enums/index.js +17 -0
- package/build/constants/page/enums/page-type.enum.js +9 -0
- package/build/constants/page/index.js +17 -0
- package/build/constants/payment/enums/index.js +18 -0
- package/build/constants/payment/enums/payment-history-item-type.enum.js +8 -0
- package/build/constants/payment/enums/payment-status.enum.js +11 -0
- package/build/constants/payment/index.js +17 -0
- package/build/constants/product/enums/index.js +18 -0
- package/build/constants/product/enums/product-sort-by.enum.js +9 -0
- package/build/constants/product/enums/product-status.enum.js +9 -0
- package/build/constants/product/index.js +17 -0
- package/build/constants/promocode/enums/index.js +18 -0
- package/build/constants/promocode/enums/promocode-promotion.enum.js +9 -0
- package/build/constants/promocode/enums/promocode-status.enum.js +8 -0
- package/build/constants/promocode/index.js +17 -0
- package/build/constants/referral/enums/index.js +17 -0
- package/build/constants/referral/enums/referral-bonus-type.enum.js +8 -0
- package/build/constants/referral/index.js +17 -0
- package/build/constants/subscription/enums/index.js +24 -0
- package/build/constants/subscription/enums/subscription-action.enum.js +11 -0
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +35 -0
- package/build/constants/subscription/enums/subscription-plan.enum.js +9 -0
- package/build/constants/subscription/enums/subscription-sort-by.enum.js +9 -0
- package/build/constants/subscription/enums/subscription-status.enum.js +15 -0
- package/build/constants/subscription/enums/subscription-type.enum.js +8 -0
- package/build/constants/subscription/enums/user-to-subscription-marks.enum.js +11 -0
- package/build/constants/subscription/enums/user-to-subscription-type.enum.js +8 -0
- package/build/constants/subscription/free-subscription.constant.js +43 -0
- package/build/constants/subscription/index.js +17 -0
- package/build/constants/transaction/enums/index.js +18 -0
- package/build/constants/transaction/enums/transaction-status.enum.js +11 -0
- package/build/constants/transaction/enums/user-balance-status.enum.js +11 -0
- package/build/constants/transaction/index.js +17 -0
- package/build/constants/unregistered-user/enums/index.js +17 -0
- package/build/constants/unregistered-user/enums/unregistered-user-status.enum.js +9 -0
- package/build/constants/unregistered-user/index.js +17 -0
- package/build/constants/user/enums/index.js +22 -0
- package/build/constants/user/enums/singup-method.enum.js +10 -0
- package/build/constants/user/enums/sort-order.enum.js +8 -0
- package/build/constants/user/enums/user-reaction.enum.js +8 -0
- package/build/constants/user/enums/user-role.enum.js +8 -0
- package/build/constants/user/enums/user-sort-by.enum.js +9 -0
- package/build/constants/user/enums/user-status.js +10 -0
- package/build/constants/user/index.js +17 -0
- package/build/constants/writer/enums/index.js +22 -0
- package/build/constants/writer/enums/source-origin.enum.js +8 -0
- package/build/constants/writer/enums/writer-ai-action-pricing-type.enum.js +8 -0
- package/build/constants/writer/enums/writer-ai-action-type.enum.js +11 -0
- package/build/constants/writer/enums/writer-document-section-type.enum.js +9 -0
- package/build/constants/writer/enums/writer-document-stage.enum.js +19 -0
- package/build/constants/writer/enums/writer-model-status.enum.js +8 -0
- package/build/constants/writer/index.js +17 -0
- package/build/helpers/index.js +18 -0
- package/build/helpers/subscription/calc-custom-subscription-price.helper.js +19 -0
- package/build/helpers/subscription/index.js +17 -0
- package/build/helpers/writer/calculate-page-count.util.js +37 -0
- package/build/helpers/writer/calculate-writer-ai-action-price.util.js +16 -0
- package/build/helpers/writer/calculate-writer-content-generation-price.util.js +6 -0
- package/build/helpers/writer/index.js +19 -0
- package/build/index.js +21 -0
- package/build/models/cloud-payments-receipt.schema.js +118 -0
- package/build/models/file.schema.js +16 -0
- package/build/models/filters.schema.js +16 -0
- package/build/models/icon-variants.schema.js +17 -0
- package/build/models/index.js +39 -0
- package/build/models/order.schema.js +17 -0
- package/build/models/page.schema.js +17 -0
- package/build/models/payment-history-item.schema.js +14 -0
- package/build/models/payment.schema.js +13 -0
- package/build/models/product.schema.js +25 -0
- package/build/models/promocode.schema.js +20 -0
- package/build/models/referral-bonus.schema.js +19 -0
- package/build/models/subscription-feature.schema.js +120 -0
- package/build/models/subscription-upgrade-schema.js +8 -0
- package/build/models/subscription.schema.js +43 -0
- package/build/models/tool.schema.js +16 -0
- package/build/models/unlocked-by-subscription.schema.js +13 -0
- package/build/models/unregistered-user.schema.js +10 -0
- package/build/models/user-referrals.schema.js +10 -0
- package/build/models/user-to-product.schema.js +19 -0
- package/build/models/user-to-subscription.schema.js +24 -0
- package/build/models/user.schema.js +26 -0
- package/build/models/writer/index.js +22 -0
- package/build/models/writer/writer-ai-action.schema.js +24 -0
- package/build/models/writer/writer-config.schema.js +13 -0
- package/build/models/writer/writer-document-outline.schema.js +21 -0
- package/build/models/writer/writer-document-title-page.schema.js +15 -0
- package/build/models/writer/writer-document-type.schema.js +13 -0
- package/build/models/writer/writer-document.schema.js +26 -0
- package/build/models/writer/writer-model.schema.js +8 -0
- package/build/models/writer-source.schema.js +13 -0
- package/commands/account-merge/index.ts +1 -0
- package/commands/account-merge/merge-account.command.ts +18 -0
- package/commands/auth/create-user.command.ts +17 -0
- package/commands/auth/index.ts +9 -0
- package/commands/auth/login.command.ts +18 -0
- package/commands/auth/register-user.command.ts +19 -0
- package/commands/auth/reset-password.command.ts +19 -0
- package/commands/auth/restore-password.command.ts +16 -0
- package/commands/auth/verify-email-retry.command.ts +10 -0
- package/commands/auth/verify-email.command.ts +14 -0
- package/commands/auth/vk-login.command.ts +23 -0
- package/commands/auth/yandex-login.command.ts +21 -0
- package/commands/files/delete-user-file.command.ts +12 -0
- package/commands/files/index.ts +2 -0
- package/commands/files/upload.command.ts +14 -0
- package/commands/index.ts +14 -0
- package/commands/page/create-page.command.ts +18 -0
- package/commands/page/delete-page.command.ts +13 -0
- package/commands/page/find-page-by-alias.command.ts +28 -0
- package/commands/page/find-page.command.ts +22 -0
- package/commands/page/index.ts +5 -0
- package/commands/page/update-page.command.ts +24 -0
- package/commands/payment/check.command.ts +52 -0
- package/commands/payment/get-payment-history.command.ts +10 -0
- package/commands/payment/index.ts +5 -0
- package/commands/payment/pay.command.ts +49 -0
- package/commands/payment/receipt.command.ts +68 -0
- package/commands/payment/recurrent.command.ts +48 -0
- package/commands/product/buy-product.command.ts +68 -0
- package/commands/product/create-product.command.ts +18 -0
- package/commands/product/delete-product.command.ts +13 -0
- package/commands/product/find-product.command.ts +22 -0
- package/commands/product/get-my-products.command.ts +10 -0
- package/commands/product/index.ts +6 -0
- package/commands/product/update-product.command.ts +24 -0
- package/commands/promocode/create-promocode.command.ts +20 -0
- package/commands/promocode/delete-promocode.command.ts +18 -0
- package/commands/promocode/find-promocode.command.ts +22 -0
- package/commands/promocode/index.ts +5 -0
- package/commands/promocode/update-promocode.command.ts +24 -0
- package/commands/promocode/validate-promocode.command.ts +19 -0
- package/commands/referral/get-by-bonuses.command.ts +14 -0
- package/commands/referral/index.ts +2 -0
- package/commands/referral/validate-referral.command.ts +17 -0
- package/commands/subscription/buy-subscription.command.ts +73 -0
- package/commands/subscription/cancel-subscription.command.ts +19 -0
- package/commands/subscription/create-custom-subscription-plan.command.ts +26 -0
- package/commands/subscription/create-subscription.command.ts +18 -0
- package/commands/subscription/delete-subscription.command.ts +15 -0
- package/commands/subscription/downgrade-subscription.command.ts +50 -0
- package/commands/subscription/find-subscription.command.ts +22 -0
- package/commands/subscription/get-available-upgrades.command.ts +14 -0
- package/commands/subscription/get-free-subscription.command.ts +10 -0
- package/commands/subscription/get-subscriptions-summary.command.ts +14 -0
- package/commands/subscription/index.ts +14 -0
- package/commands/subscription/recover-past-due-subscription.command.ts +15 -0
- package/commands/subscription/recover-subscription.command.ts +13 -0
- package/commands/subscription/update-subscription.command.ts +24 -0
- package/commands/subscription/upgrade-subscription.command.ts +51 -0
- package/commands/unregistered-user/create-unregistered-user.command.ts +10 -0
- package/commands/unregistered-user/index.ts +1 -0
- package/commands/user/check-email.command.ts +7 -0
- package/commands/user/delete-account.command.ts +13 -0
- package/commands/user/find-user-by-uuid.command.ts +21 -0
- package/commands/user/find-users-by-criteria.command.ts +70 -0
- package/commands/user/get-aggregated-user-data.command.ts +29 -0
- package/commands/user/get-me.command.ts +22 -0
- package/commands/user/get-user-balance.command.ts +17 -0
- package/commands/user/get-user-orders.command.ts +28 -0
- package/commands/user/get-user-products.command.ts +26 -0
- package/commands/user/get-user-subscriptions.command.ts +26 -0
- package/commands/user/index.ts +11 -0
- package/commands/user/up-token-bonus-balance.command.ts +23 -0
- package/commands/user-to-product/get-user-to-product-by-uuid.command.ts +16 -0
- package/commands/user-to-product/index.ts +2 -0
- package/commands/user-to-product/update-user-to-product.command.ts +24 -0
- package/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.ts +16 -0
- package/commands/user-to-subscription/get-user-to-subscriptions.command.ts +10 -0
- package/commands/user-to-subscription/index.ts +3 -0
- package/commands/user-to-subscription/update-user-to-subscription.command.ts +32 -0
- package/commands/writer/collect-writer-document-sources.command.ts +17 -0
- package/commands/writer/create-writer-document.command.ts +15 -0
- package/commands/writer/delete-all-writer-documents.command.ts +6 -0
- package/commands/writer/delete-writer-document-by-uuid.command.ts +11 -0
- package/commands/writer/discard-writer-source.command.ts +18 -0
- package/commands/writer/export-writer-document-as-docx.command.ts +15 -0
- package/commands/writer/find-writer-document-by-uuid.command.ts +14 -0
- package/commands/writer/find-writer-documents.command.ts +18 -0
- package/commands/writer/generate-writer-document-contents.command.ts +19 -0
- package/commands/writer/generate-writer-document-outline.command.ts +25 -0
- package/commands/writer/get-writer-document-sources.command.ts +14 -0
- package/commands/writer/get-writer-tool-config.command.ts +10 -0
- package/commands/writer/index.ts +21 -0
- package/commands/writer/set-reaction.writer-document.command.ts +21 -0
- package/commands/writer/update-writer-document-contents.command.ts +20 -0
- package/commands/writer/update-writer-document-outline.command.ts +24 -0
- package/commands/writer/upload-writer-source.command.ts +20 -0
- package/commands/writer/writer-extend-text.command.ts +20 -0
- package/commands/writer/writer-fix-errors.command.ts +20 -0
- package/commands/writer/writer-generate-text.command.ts +23 -0
- package/commands/writer/writer-paraphrase.command.ts +20 -0
- package/commands/writer/writer-shorten-text.command.ts +20 -0
- package/common/index.ts +1 -0
- package/common/models/command-response.schema.ts +18 -0
- package/common/models/index.ts +1 -0
- package/constants/cloud-payments/index.ts +11 -0
- package/constants/domains/index.ts +1 -0
- package/constants/domains/white-list.ts +54 -0
- package/constants/email/email-endpoint.ts +1 -0
- package/constants/email/index.ts +2 -0
- package/constants/email/subjects.ts +12 -0
- package/constants/errors/errors.ts +1056 -0
- package/constants/errors/index.ts +2 -0
- package/constants/errors/verbose.ts +7 -0
- package/constants/files/enums/file-type.enum.ts +4 -0
- package/constants/files/enums/index.ts +1 -0
- package/constants/files/file.constants.ts +11 -0
- package/constants/files/index.ts +2 -0
- package/constants/index.ts +15 -0
- package/constants/order/enums/index.ts +2 -0
- package/constants/order/enums/order-sort-by.enum.ts +7 -0
- package/constants/order/enums/order-status.enum.ts +12 -0
- package/constants/order/enums/order-type.enum.ts +5 -0
- package/constants/order/index.ts +1 -0
- package/constants/page/enums/index.ts +1 -0
- package/constants/page/enums/page-type.enum.ts +5 -0
- package/constants/page/index.ts +1 -0
- package/constants/payment/enums/index.ts +2 -0
- package/constants/payment/enums/payment-history-item-type.enum.ts +4 -0
- package/constants/payment/enums/payment-status.enum.ts +7 -0
- package/constants/payment/index.ts +1 -0
- package/constants/product/enums/index.ts +2 -0
- package/constants/product/enums/product-sort-by.enum.ts +5 -0
- package/constants/product/enums/product-status.enum.ts +5 -0
- package/constants/product/index.ts +1 -0
- package/constants/promocode/enums/index.ts +2 -0
- package/constants/promocode/enums/promocode-promotion.enum.ts +5 -0
- package/constants/promocode/enums/promocode-status.enum.ts +4 -0
- package/constants/promocode/index.ts +1 -0
- package/constants/referral/enums/index.ts +1 -0
- package/constants/referral/enums/referral-bonus-type.enum.ts +4 -0
- package/constants/referral/index.ts +1 -0
- package/constants/subscription/enums/index.ts +8 -0
- package/constants/subscription/enums/subscription-action.enum.ts +7 -0
- package/constants/subscription/enums/subscription-feature-type.enum.ts +31 -0
- package/constants/subscription/enums/subscription-plan.enum.ts +5 -0
- package/constants/subscription/enums/subscription-sort-by.enum.ts +5 -0
- package/constants/subscription/enums/subscription-status.enum.ts +11 -0
- package/constants/subscription/enums/subscription-type.enum.ts +4 -0
- package/constants/subscription/enums/user-to-subscription-marks.enum.ts +7 -0
- package/constants/subscription/enums/user-to-subscription-type.enum.ts +4 -0
- package/constants/subscription/free-subscription.constant.ts +47 -0
- package/constants/subscription/index.ts +1 -0
- package/constants/transaction/enums/index.ts +2 -0
- package/constants/transaction/enums/transaction-status.enum.ts +7 -0
- package/constants/transaction/enums/user-balance-status.enum.ts +7 -0
- package/constants/transaction/index.ts +1 -0
- package/constants/unregistered-user/enums/index.ts +1 -0
- package/constants/unregistered-user/enums/unregistered-user-status.enum.ts +5 -0
- package/constants/unregistered-user/index.ts +1 -0
- package/constants/user/enums/index.ts +6 -0
- package/constants/user/enums/singup-method.enum.ts +6 -0
- package/constants/user/enums/sort-order.enum.ts +4 -0
- package/constants/user/enums/user-reaction.enum.ts +4 -0
- package/constants/user/enums/user-role.enum.ts +8 -0
- package/constants/user/enums/user-sort-by.enum.ts +5 -0
- package/constants/user/enums/user-status.ts +6 -0
- package/constants/user/index.ts +1 -0
- package/constants/writer/enums/index.ts +6 -0
- package/constants/writer/enums/source-origin.enum.ts +4 -0
- package/constants/writer/enums/writer-ai-action-pricing-type.enum.ts +4 -0
- package/constants/writer/enums/writer-ai-action-type.enum.ts +7 -0
- package/constants/writer/enums/writer-document-section-type.enum.ts +5 -0
- package/constants/writer/enums/writer-document-stage.enum.ts +19 -0
- package/constants/writer/enums/writer-model-status.enum.ts +4 -0
- package/constants/writer/index.ts +1 -0
- package/helpers/index.ts +2 -0
- package/helpers/subscription/calc-custom-subscription-price.helper.ts +19 -0
- package/helpers/subscription/index.ts +1 -0
- package/helpers/writer/calculate-page-count.util.ts +46 -0
- package/helpers/writer/calculate-writer-ai-action-price.util.ts +20 -0
- package/helpers/writer/calculate-writer-content-generation-price.util.ts +3 -0
- package/helpers/writer/index.ts +3 -0
- package/index.ts +5 -0
- package/models/cloud-payments-receipt.schema.ts +119 -0
- package/models/file.schema.ts +14 -0
- package/models/filters.schema.ts +17 -0
- package/models/icon-variants.schema.ts +12 -0
- package/models/index.ts +23 -0
- package/models/order.schema.ts +16 -0
- package/models/page.schema.ts +16 -0
- package/models/payment-history-item.schema.ts +12 -0
- package/models/payment.schema.ts +12 -0
- package/models/product.schema.ts +23 -0
- package/models/promocode.schema.ts +19 -0
- package/models/referral-bonus.schema.ts +18 -0
- package/models/subscription-feature.schema.ts +153 -0
- package/models/subscription-upgrade-schema.ts +9 -0
- package/models/subscription.schema.ts +50 -0
- package/models/tool.schema.ts +20 -0
- package/models/unlocked-by-subscription.schema.ts +14 -0
- package/models/unregistered-user.schema.ts +9 -0
- package/models/user-referrals.schema.ts +5 -0
- package/models/user-to-product.schema.ts +18 -0
- package/models/user-to-subscription.schema.ts +26 -0
- package/models/user.schema.ts +26 -0
- package/models/writer/index.ts +6 -0
- package/models/writer/writer-ai-action.schema.ts +25 -0
- package/models/writer/writer-config.schema.ts +12 -0
- package/models/writer/writer-document-outline.schema.ts +28 -0
- package/models/writer/writer-document-title-page.schema.ts +15 -0
- package/models/writer/writer-document-type.schema.ts +12 -0
- package/models/writer/writer-document.schema.ts +25 -0
- package/models/writer/writer-model.schema.ts +8 -0
- package/models/writer-source.schema.ts +13 -0
- package/package.json +17 -0
- package/tsconfig.json +104 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FREE_USER_TO_SUBSCRIPTION_DATA = exports.FREE_SUBSCRIPTION_DATA = void 0;
|
|
4
|
+
const enums_1 = require("./enums");
|
|
5
|
+
exports.FREE_SUBSCRIPTION_DATA = {
|
|
6
|
+
uuid: '00000000-0000-0000-0000-000000000000',
|
|
7
|
+
mainSubscriptionId: null,
|
|
8
|
+
name: 'Бесплатный',
|
|
9
|
+
requests: 0,
|
|
10
|
+
price: 0,
|
|
11
|
+
tokens: 0,
|
|
12
|
+
type: enums_1.SUBSCRIPTION_TYPE.main,
|
|
13
|
+
discount: 0,
|
|
14
|
+
period: 1,
|
|
15
|
+
plan: enums_1.SUBSCRIPTION_PLAN.mock,
|
|
16
|
+
icons: {
|
|
17
|
+
light: {
|
|
18
|
+
svg: 'https://rugpt.hb.bizmrg.com/images/images/81b60ce5-b687-43ff-85dd-e4e47c8e81e9.svg',
|
|
19
|
+
png: 'https://rugpt.hb.bizmrg.com/images/images/e1bb1acd-a387-4596-8fd5-0159f692ff11.png',
|
|
20
|
+
},
|
|
21
|
+
dark: {
|
|
22
|
+
svg: 'https://rugpt.hb.bizmrg.com/images/images/ac095d48-a66b-4862-82c7-eb120b5bd467.svg',
|
|
23
|
+
png: 'https://rugpt.hb.bizmrg.com/images/images/e2208949-a73a-4137-b5bd-760599a70691.png',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
interval: '',
|
|
27
|
+
createdAt: new Date(),
|
|
28
|
+
updatedAt: new Date(),
|
|
29
|
+
};
|
|
30
|
+
exports.FREE_USER_TO_SUBSCRIPTION_DATA = {
|
|
31
|
+
uuid: '00000000-0000-0000-0000-000000000000',
|
|
32
|
+
userId: '00000000-0000-0000-0000-000000000000',
|
|
33
|
+
subscriptionId: '00000000-0000-0000-0000-000000000000',
|
|
34
|
+
initTokenBalance: 0,
|
|
35
|
+
active: true,
|
|
36
|
+
tokenBalance: 0,
|
|
37
|
+
status: enums_1.SUBSCRIPTION_STATUS.active,
|
|
38
|
+
endDate: null,
|
|
39
|
+
marks: [enums_1.USER_TO_SUBSCRIPTION_MARKS.MOCK],
|
|
40
|
+
intervalEndDate: null,
|
|
41
|
+
createdAt: new Date(),
|
|
42
|
+
updatedAt: new Date(),
|
|
43
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./transaction-status.enum"), exports);
|
|
18
|
+
__exportStar(require("./user-balance-status.enum"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TRANSACTION_STATUS = void 0;
|
|
4
|
+
var TRANSACTION_STATUS;
|
|
5
|
+
(function (TRANSACTION_STATUS) {
|
|
6
|
+
TRANSACTION_STATUS["success"] = "success";
|
|
7
|
+
TRANSACTION_STATUS["processing"] = "processing";
|
|
8
|
+
TRANSACTION_STATUS["new"] = "new";
|
|
9
|
+
TRANSACTION_STATUS["error"] = "error";
|
|
10
|
+
TRANSACTION_STATUS["waiting_for_payment"] = "waiting_for_payment";
|
|
11
|
+
})(TRANSACTION_STATUS || (exports.TRANSACTION_STATUS = TRANSACTION_STATUS = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_BALANCE_STATUS = void 0;
|
|
4
|
+
var USER_BALANCE_STATUS;
|
|
5
|
+
(function (USER_BALANCE_STATUS) {
|
|
6
|
+
USER_BALANCE_STATUS["bonus_balance"] = "bonus_balance";
|
|
7
|
+
USER_BALANCE_STATUS["subscription_balance"] = "subscription_balance";
|
|
8
|
+
USER_BALANCE_STATUS["carried_over_balance"] = "carried_over_balance";
|
|
9
|
+
USER_BALANCE_STATUS["product_balance"] = "product_balance";
|
|
10
|
+
USER_BALANCE_STATUS["referral_bonus_balance"] = "referral_bonus_balance";
|
|
11
|
+
})(USER_BALANCE_STATUS || (exports.USER_BALANCE_STATUS = USER_BALANCE_STATUS = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./unregistered-user-status.enum"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNREGISTERED_USER_STATUS = void 0;
|
|
4
|
+
var UNREGISTERED_USER_STATUS;
|
|
5
|
+
(function (UNREGISTERED_USER_STATUS) {
|
|
6
|
+
UNREGISTERED_USER_STATUS["ACTIVE"] = "active";
|
|
7
|
+
UNREGISTERED_USER_STATUS["FRAUD"] = "fraud";
|
|
8
|
+
UNREGISTERED_USER_STATUS["TRANSFERRED"] = "transferred";
|
|
9
|
+
})(UNREGISTERED_USER_STATUS || (exports.UNREGISTERED_USER_STATUS = UNREGISTERED_USER_STATUS = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./singup-method.enum"), exports);
|
|
18
|
+
__exportStar(require("./user-status"), exports);
|
|
19
|
+
__exportStar(require("./user-sort-by.enum"), exports);
|
|
20
|
+
__exportStar(require("./sort-order.enum"), exports);
|
|
21
|
+
__exportStar(require("./user-role.enum"), exports);
|
|
22
|
+
__exportStar(require("./user-reaction.enum"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SIGNUP_METHOD = void 0;
|
|
4
|
+
var SIGNUP_METHOD;
|
|
5
|
+
(function (SIGNUP_METHOD) {
|
|
6
|
+
SIGNUP_METHOD["EMAIl"] = "email";
|
|
7
|
+
SIGNUP_METHOD["VK"] = "vk";
|
|
8
|
+
SIGNUP_METHOD["YANDEX"] = "yandex";
|
|
9
|
+
SIGNUP_METHOD["TELEGRAM"] = "telegram";
|
|
10
|
+
})(SIGNUP_METHOD || (exports.SIGNUP_METHOD = SIGNUP_METHOD = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SORT_ORDER = void 0;
|
|
4
|
+
var SORT_ORDER;
|
|
5
|
+
(function (SORT_ORDER) {
|
|
6
|
+
SORT_ORDER["ASC"] = "asc";
|
|
7
|
+
SORT_ORDER["DESC"] = "desc";
|
|
8
|
+
})(SORT_ORDER || (exports.SORT_ORDER = SORT_ORDER = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_REACTION = void 0;
|
|
4
|
+
var USER_REACTION;
|
|
5
|
+
(function (USER_REACTION) {
|
|
6
|
+
USER_REACTION["LIKED"] = "LIKED";
|
|
7
|
+
USER_REACTION["DISLIKED"] = "DISLIKED";
|
|
8
|
+
})(USER_REACTION || (exports.USER_REACTION = USER_REACTION = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_SORT_BY = void 0;
|
|
4
|
+
var USER_SORT_BY;
|
|
5
|
+
(function (USER_SORT_BY) {
|
|
6
|
+
USER_SORT_BY["EMAIL"] = "email";
|
|
7
|
+
USER_SORT_BY["CREATED_AT"] = "createdAt";
|
|
8
|
+
USER_SORT_BY["UPDATED_AT"] = "updatedAt";
|
|
9
|
+
})(USER_SORT_BY || (exports.USER_SORT_BY = USER_SORT_BY = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_STATUS = void 0;
|
|
4
|
+
var USER_STATUS;
|
|
5
|
+
(function (USER_STATUS) {
|
|
6
|
+
USER_STATUS["ACTIVE"] = "active";
|
|
7
|
+
USER_STATUS["INACTIVE"] = "inactive";
|
|
8
|
+
USER_STATUS["MERGED"] = "merged";
|
|
9
|
+
USER_STATUS["DELETED"] = "deleted";
|
|
10
|
+
})(USER_STATUS || (exports.USER_STATUS = USER_STATUS = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./source-origin.enum"), exports);
|
|
18
|
+
__exportStar(require("./writer-document-section-type.enum"), exports);
|
|
19
|
+
__exportStar(require("./writer-document-stage.enum"), exports);
|
|
20
|
+
__exportStar(require("./writer-ai-action-pricing-type.enum"), exports);
|
|
21
|
+
__exportStar(require("./writer-ai-action-type.enum"), exports);
|
|
22
|
+
__exportStar(require("./writer-model-status.enum"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SOURCE_ORIGIN = void 0;
|
|
4
|
+
var SOURCE_ORIGIN;
|
|
5
|
+
(function (SOURCE_ORIGIN) {
|
|
6
|
+
SOURCE_ORIGIN["WEB_SEARCH"] = "WEB_SEARCH";
|
|
7
|
+
SOURCE_ORIGIN["USER_UPLOAD"] = "USER_UPLOAD";
|
|
8
|
+
})(SOURCE_ORIGIN || (exports.SOURCE_ORIGIN = SOURCE_ORIGIN = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITER_AI_ACTION_PRICING_TYPE = void 0;
|
|
4
|
+
var WRITER_AI_ACTION_PRICING_TYPE;
|
|
5
|
+
(function (WRITER_AI_ACTION_PRICING_TYPE) {
|
|
6
|
+
WRITER_AI_ACTION_PRICING_TYPE["PER_CHARACTER"] = "PER_CHARACTER";
|
|
7
|
+
WRITER_AI_ACTION_PRICING_TYPE["FLAT"] = "FLAT";
|
|
8
|
+
})(WRITER_AI_ACTION_PRICING_TYPE || (exports.WRITER_AI_ACTION_PRICING_TYPE = WRITER_AI_ACTION_PRICING_TYPE = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITER_AI_ACTION_TYPE = void 0;
|
|
4
|
+
var WRITER_AI_ACTION_TYPE;
|
|
5
|
+
(function (WRITER_AI_ACTION_TYPE) {
|
|
6
|
+
WRITER_AI_ACTION_TYPE["PARAPHRASE"] = "PARAPHRASE";
|
|
7
|
+
WRITER_AI_ACTION_TYPE["EXTEND_TEXT"] = "EXTEND_TEXT";
|
|
8
|
+
WRITER_AI_ACTION_TYPE["SHORTEN_TEXT"] = "SHORTEN_TEXT";
|
|
9
|
+
WRITER_AI_ACTION_TYPE["GENERATE_TEXT"] = "GENERATE_TEXT";
|
|
10
|
+
WRITER_AI_ACTION_TYPE["FIX_ERRORS"] = "FIX_ERRORS";
|
|
11
|
+
})(WRITER_AI_ACTION_TYPE || (exports.WRITER_AI_ACTION_TYPE = WRITER_AI_ACTION_TYPE = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITER_DOCUMENT_SECTION_TYPE = void 0;
|
|
4
|
+
var WRITER_DOCUMENT_SECTION_TYPE;
|
|
5
|
+
(function (WRITER_DOCUMENT_SECTION_TYPE) {
|
|
6
|
+
WRITER_DOCUMENT_SECTION_TYPE["INTRODUCTION"] = "introduction";
|
|
7
|
+
WRITER_DOCUMENT_SECTION_TYPE["CONCLUSION"] = "conclusion";
|
|
8
|
+
WRITER_DOCUMENT_SECTION_TYPE["SECTION"] = "section";
|
|
9
|
+
})(WRITER_DOCUMENT_SECTION_TYPE || (exports.WRITER_DOCUMENT_SECTION_TYPE = WRITER_DOCUMENT_SECTION_TYPE = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITER_DOCUMENT_STAGE = void 0;
|
|
4
|
+
var WRITER_DOCUMENT_STAGE;
|
|
5
|
+
(function (WRITER_DOCUMENT_STAGE) {
|
|
6
|
+
WRITER_DOCUMENT_STAGE["ANALYZING_TOPIC"] = "ANALYZING_TOPIC";
|
|
7
|
+
WRITER_DOCUMENT_STAGE["TOPIC_ANALYZED"] = "TOPIC_ANALYZED";
|
|
8
|
+
WRITER_DOCUMENT_STAGE["TOPIC_ANALYSIS_FAILED"] = "TOPIC_ANALYSIS_FAILED";
|
|
9
|
+
WRITER_DOCUMENT_STAGE["GENERATING_OUTLINE"] = "GENERATING_OUTLINE";
|
|
10
|
+
WRITER_DOCUMENT_STAGE["OUTLINE_GENERATED"] = "OUTLINE_GENERATED";
|
|
11
|
+
WRITER_DOCUMENT_STAGE["OUTLINE_GENERATION_FAILED"] = "OUTLINE_GENERATION_FAILED";
|
|
12
|
+
WRITER_DOCUMENT_STAGE["COLLECTING_SOURCES"] = "COLLECTING_SOURCES";
|
|
13
|
+
WRITER_DOCUMENT_STAGE["SOURCES_COLLECTED"] = "SOURCES_COLLECTED";
|
|
14
|
+
WRITER_DOCUMENT_STAGE["SOURCES_COLLECTION_FAILED"] = "SOURCES_COLLECTION_FAILED";
|
|
15
|
+
WRITER_DOCUMENT_STAGE["GENERATING_CONTENT"] = "GENERATING_CONTENT";
|
|
16
|
+
WRITER_DOCUMENT_STAGE["CONTENT_GENERATED"] = "CONTENT_GENERATED";
|
|
17
|
+
WRITER_DOCUMENT_STAGE["CONTENT_GENERATION_FAILED"] = "CONTENT_GENERATION_FAILED";
|
|
18
|
+
WRITER_DOCUMENT_STAGE["DELETED"] = "DELETED";
|
|
19
|
+
})(WRITER_DOCUMENT_STAGE || (exports.WRITER_DOCUMENT_STAGE = WRITER_DOCUMENT_STAGE = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITER_MODEL_STATUS = void 0;
|
|
4
|
+
var WRITER_MODEL_STATUS;
|
|
5
|
+
(function (WRITER_MODEL_STATUS) {
|
|
6
|
+
WRITER_MODEL_STATUS["ACTIVE"] = "active";
|
|
7
|
+
WRITER_MODEL_STATUS["INACTIVE"] = "inactive";
|
|
8
|
+
})(WRITER_MODEL_STATUS || (exports.WRITER_MODEL_STATUS = WRITER_MODEL_STATUS = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./subscription"), exports);
|
|
18
|
+
__exportStar(require("./writer"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calcCustomSubscriptionPrice = calcCustomSubscriptionPrice;
|
|
4
|
+
function calcCustomSubscriptionPrice(tokenCount, period) {
|
|
5
|
+
const MIN_TOKEN_COUNT = 1000;
|
|
6
|
+
const MAX_DISCOUNT = 0.85;
|
|
7
|
+
const DISCOUNT_PER_STEP = 0.005;
|
|
8
|
+
const STEP = 500;
|
|
9
|
+
const BASE_PRICE = 0.95;
|
|
10
|
+
if (tokenCount < 0) {
|
|
11
|
+
throw new Error('Token count must be a non-negative integer');
|
|
12
|
+
}
|
|
13
|
+
if (tokenCount < MIN_TOKEN_COUNT) {
|
|
14
|
+
throw new Error(`Token count must be at least ${MIN_TOKEN_COUNT}`);
|
|
15
|
+
}
|
|
16
|
+
const discount = Math.max(0, (tokenCount - MIN_TOKEN_COUNT) / STEP) * DISCOUNT_PER_STEP;
|
|
17
|
+
const priceMultiplier = Math.max(BASE_PRICE - discount, MAX_DISCOUNT);
|
|
18
|
+
return Math.round(tokenCount * priceMultiplier * period);
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./calc-custom-subscription-price.helper"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHARACTERS_PER_PAGE = void 0;
|
|
4
|
+
exports.pagesToCharacters = pagesToCharacters;
|
|
5
|
+
exports.charactersToPages = charactersToPages;
|
|
6
|
+
const WORD_FONT_SIZE_PT = 14;
|
|
7
|
+
const WORD_LINE_SPACING = 1.5;
|
|
8
|
+
const A4_WIDTH_MM = 210;
|
|
9
|
+
const A4_HEIGHT_MM = 297;
|
|
10
|
+
const MARGIN_TOP_MM = 20;
|
|
11
|
+
const MARGIN_BOTTOM_MM = 20;
|
|
12
|
+
const MARGIN_LEFT_MM = 30;
|
|
13
|
+
const MARGIN_RIGHT_MM = 10;
|
|
14
|
+
const FIRST_LINE_INDENT_MM = 12.5;
|
|
15
|
+
const MM_PER_POINT = 0.3527777778;
|
|
16
|
+
const TEXT_WIDTH_MM = A4_WIDTH_MM - MARGIN_LEFT_MM - MARGIN_RIGHT_MM;
|
|
17
|
+
const TEXT_HEIGHT_MM = A4_HEIGHT_MM - MARGIN_TOP_MM - MARGIN_BOTTOM_MM;
|
|
18
|
+
const LINE_HEIGHT_MM = WORD_FONT_SIZE_PT * WORD_LINE_SPACING * MM_PER_POINT;
|
|
19
|
+
const LINES_PER_PAGE = Math.floor(TEXT_HEIGHT_MM / LINE_HEIGHT_MM);
|
|
20
|
+
const AVG_CHAR_WIDTH_EM = 0.58;
|
|
21
|
+
const AVG_CHAR_WIDTH_MM = WORD_FONT_SIZE_PT * AVG_CHAR_WIDTH_EM * MM_PER_POINT;
|
|
22
|
+
const CHARS_PER_LINE = Math.floor(TEXT_WIDTH_MM / AVG_CHAR_WIDTH_MM);
|
|
23
|
+
const AVG_PARAGRAPHS_PER_PAGE = 4; // average paragraph count across typical student papers
|
|
24
|
+
const INDENT_CHARS_LOSS = Math.round((FIRST_LINE_INDENT_MM / AVG_CHAR_WIDTH_MM) * AVG_PARAGRAPHS_PER_PAGE);
|
|
25
|
+
const LAYOUT_FUDGE_FACTOR = 0.96;
|
|
26
|
+
exports.CHARACTERS_PER_PAGE = Math.round((LINES_PER_PAGE * CHARS_PER_LINE - INDENT_CHARS_LOSS) * LAYOUT_FUDGE_FACTOR);
|
|
27
|
+
function pagesToCharacters(pages) {
|
|
28
|
+
if (!Number.isFinite(pages) || pages <= 0)
|
|
29
|
+
return 0;
|
|
30
|
+
return Math.max(0, Math.round(pages * exports.CHARACTERS_PER_PAGE));
|
|
31
|
+
}
|
|
32
|
+
function charactersToPages(characters) {
|
|
33
|
+
if (!Number.isFinite(characters) || characters <= 0)
|
|
34
|
+
return 0;
|
|
35
|
+
const raw = characters / exports.CHARACTERS_PER_PAGE;
|
|
36
|
+
return Math.max(0, Math.ceil(raw));
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateWriterAiActionPrice = calculateWriterAiActionPrice;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
function calculateWriterAiActionPrice(pricingRules, selectionText) {
|
|
6
|
+
switch (pricingRules.type) {
|
|
7
|
+
case constants_1.WRITER_AI_ACTION_PRICING_TYPE.PER_CHARACTER:
|
|
8
|
+
const characterCount = selectionText.length;
|
|
9
|
+
const price = characterCount * pricingRules.price;
|
|
10
|
+
return Math.max(1, Math.ceil(price));
|
|
11
|
+
case constants_1.WRITER_AI_ACTION_PRICING_TYPE.FLAT:
|
|
12
|
+
return Math.max(1, Math.ceil(pricingRules.price));
|
|
13
|
+
default:
|
|
14
|
+
throw new Error(`Unknown pricing type`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateWriterContentGenerationPrice = calculateWriterContentGenerationPrice;
|
|
4
|
+
function calculateWriterContentGenerationPrice(pages, pricePerPage) {
|
|
5
|
+
return Math.max(1, pages * pricePerPage);
|
|
6
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./calculate-writer-ai-action-price.util"), exports);
|
|
18
|
+
__exportStar(require("./calculate-writer-content-generation-price.util"), exports);
|
|
19
|
+
__exportStar(require("./calculate-page-count.util"), exports);
|
package/build/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./api"), exports);
|
|
19
|
+
__exportStar(require("./constants"), exports);
|
|
20
|
+
__exportStar(require("./commands"), exports);
|
|
21
|
+
__exportStar(require("./common"), exports);
|