@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.
Files changed (468) hide show
  1. package/api/controller/http/auth.ts +13 -0
  2. package/api/controller/http/cloud-payments.ts +4 -0
  3. package/api/controller/http/files.ts +7 -0
  4. package/api/controller/http/index.ts +14 -0
  5. package/api/controller/http/page.ts +8 -0
  6. package/api/controller/http/payment.ts +5 -0
  7. package/api/controller/http/product.ts +11 -0
  8. package/api/controller/http/promocode.ts +9 -0
  9. package/api/controller/http/referral.ts +7 -0
  10. package/api/controller/http/subscription.ts +21 -0
  11. package/api/controller/http/unregistered-user.ts +1 -0
  12. package/api/controller/http/user-to-product.ts +6 -0
  13. package/api/controller/http/user-to-subscription.ts +6 -0
  14. package/api/controller/http/user.ts +14 -0
  15. package/api/controller/http/writer.ts +26 -0
  16. package/api/controller/index.ts +1 -0
  17. package/api/index.ts +2 -0
  18. package/api/routes.ts +147 -0
  19. package/build/api/controller/http/auth.js +15 -0
  20. package/build/api/controller/http/cloud-payments.js +7 -0
  21. package/build/api/controller/http/files.js +9 -0
  22. package/build/api/controller/http/index.js +30 -0
  23. package/build/api/controller/http/page.js +10 -0
  24. package/build/api/controller/http/payment.js +7 -0
  25. package/build/api/controller/http/product.js +12 -0
  26. package/build/api/controller/http/promocode.js +11 -0
  27. package/build/api/controller/http/referral.js +9 -0
  28. package/build/api/controller/http/subscription.js +22 -0
  29. package/build/api/controller/http/unregistered-user.js +4 -0
  30. package/build/api/controller/http/user-to-product.js +8 -0
  31. package/build/api/controller/http/user-to-subscription.js +8 -0
  32. package/build/api/controller/http/user.js +16 -0
  33. package/build/api/controller/http/writer.js +28 -0
  34. package/build/api/controller/index.js +17 -0
  35. package/build/api/index.js +18 -0
  36. package/build/api/routes.js +147 -0
  37. package/build/commands/account-merge/index.js +17 -0
  38. package/build/commands/account-merge/merge-account.command.js +16 -0
  39. package/build/commands/auth/create-user.command.js +16 -0
  40. package/build/commands/auth/index.js +25 -0
  41. package/build/commands/auth/login.command.js +17 -0
  42. package/build/commands/auth/register-user.command.js +18 -0
  43. package/build/commands/auth/reset-password.command.js +17 -0
  44. package/build/commands/auth/restore-password.command.js +16 -0
  45. package/build/commands/auth/verify-email-retry.command.js +9 -0
  46. package/build/commands/auth/verify-email.command.js +13 -0
  47. package/build/commands/auth/vk-login.command.js +22 -0
  48. package/build/commands/auth/yandex-login.command.js +20 -0
  49. package/build/commands/files/delete-user-file.command.js +12 -0
  50. package/build/commands/files/index.js +18 -0
  51. package/build/commands/files/upload.command.js +12 -0
  52. package/build/commands/index.js +30 -0
  53. package/build/commands/page/create-page.command.js +16 -0
  54. package/build/commands/page/delete-page.command.js +12 -0
  55. package/build/commands/page/find-page-by-alias.command.js +20 -0
  56. package/build/commands/page/find-page.command.js +17 -0
  57. package/build/commands/page/index.js +21 -0
  58. package/build/commands/page/update-page.command.js +19 -0
  59. package/build/commands/payment/check.command.js +50 -0
  60. package/build/commands/payment/get-payment-history.command.js +11 -0
  61. package/build/commands/payment/index.js +21 -0
  62. package/build/commands/payment/pay.command.js +47 -0
  63. package/build/commands/payment/receipt.command.js +67 -0
  64. package/build/commands/payment/recurrent.command.js +47 -0
  65. package/build/commands/product/buy-product.command.js +55 -0
  66. package/build/commands/product/create-product.command.js +16 -0
  67. package/build/commands/product/delete-product.command.js +12 -0
  68. package/build/commands/product/find-product.command.js +17 -0
  69. package/build/commands/product/get-my-products.command.js +11 -0
  70. package/build/commands/product/index.js +22 -0
  71. package/build/commands/product/update-product.command.js +19 -0
  72. package/build/commands/promocode/create-promocode.command.js +18 -0
  73. package/build/commands/promocode/delete-promocode.command.js +16 -0
  74. package/build/commands/promocode/find-promocode.command.js +17 -0
  75. package/build/commands/promocode/index.js +21 -0
  76. package/build/commands/promocode/update-promocode.command.js +19 -0
  77. package/build/commands/promocode/validate-promocode.command.js +17 -0
  78. package/build/commands/referral/get-by-bonuses.command.js +15 -0
  79. package/build/commands/referral/index.js +18 -0
  80. package/build/commands/referral/validate-referral.command.js +15 -0
  81. package/build/commands/subscription/buy-subscription.command.js +61 -0
  82. package/build/commands/subscription/cancel-subscription.command.js +14 -0
  83. package/build/commands/subscription/create-custom-subscription-plan.command.js +24 -0
  84. package/build/commands/subscription/create-subscription.command.js +16 -0
  85. package/build/commands/subscription/delete-subscription.command.js +14 -0
  86. package/build/commands/subscription/downgrade-subscription.command.js +44 -0
  87. package/build/commands/subscription/find-subscription.command.js +17 -0
  88. package/build/commands/subscription/get-available-upgrades.command.js +12 -0
  89. package/build/commands/subscription/get-free-subscription.command.js +11 -0
  90. package/build/commands/subscription/get-subscriptions-summary.command.js +12 -0
  91. package/build/commands/subscription/index.js +30 -0
  92. package/build/commands/subscription/recover-past-due-subscription.command.js +13 -0
  93. package/build/commands/subscription/recover-subscription.command.js +11 -0
  94. package/build/commands/subscription/update-subscription.command.js +19 -0
  95. package/build/commands/subscription/upgrade-subscription.command.js +45 -0
  96. package/build/commands/unregistered-user/create-unregistered-user.command.js +12 -0
  97. package/build/commands/unregistered-user/index.js +17 -0
  98. package/build/commands/user/check-email.command.js +10 -0
  99. package/build/commands/user/delete-account.command.js +12 -0
  100. package/build/commands/user/find-user-by-uuid.command.js +19 -0
  101. package/build/commands/user/find-users-by-criteria.command.js +60 -0
  102. package/build/commands/user/get-aggregated-user-data.command.js +24 -0
  103. package/build/commands/user/get-me.command.js +20 -0
  104. package/build/commands/user/get-user-balance.command.js +15 -0
  105. package/build/commands/user/get-user-orders.command.js +27 -0
  106. package/build/commands/user/get-user-products.command.js +25 -0
  107. package/build/commands/user/get-user-subscriptions.command.js +25 -0
  108. package/build/commands/user/index.js +27 -0
  109. package/build/commands/user/up-token-bonus-balance.command.js +18 -0
  110. package/build/commands/user-to-product/get-user-to-product-by-uuid.command.js +17 -0
  111. package/build/commands/user-to-product/index.js +18 -0
  112. package/build/commands/user-to-product/update-user-to-product.command.js +19 -0
  113. package/build/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.js +17 -0
  114. package/build/commands/user-to-subscription/get-user-to-subscriptions.command.js +11 -0
  115. package/build/commands/user-to-subscription/index.js +19 -0
  116. package/build/commands/user-to-subscription/update-user-to-subscription.command.js +27 -0
  117. package/build/commands/writer/collect-writer-document-sources.command.js +15 -0
  118. package/build/commands/writer/create-writer-document.command.js +15 -0
  119. package/build/commands/writer/delete-all-writer-documents.command.js +8 -0
  120. package/build/commands/writer/delete-writer-document-by-uuid.command.js +11 -0
  121. package/build/commands/writer/discard-writer-source.command.js +16 -0
  122. package/build/commands/writer/export-writer-document-as-docx.command.js +15 -0
  123. package/build/commands/writer/find-writer-document-by-uuid.command.js +14 -0
  124. package/build/commands/writer/find-writer-documents.command.js +18 -0
  125. package/build/commands/writer/generate-writer-document-contents.command.js +17 -0
  126. package/build/commands/writer/generate-writer-document-outline.command.js +21 -0
  127. package/build/commands/writer/get-writer-document-sources.command.js +14 -0
  128. package/build/commands/writer/get-writer-tool-config.command.js +11 -0
  129. package/build/commands/writer/index.js +37 -0
  130. package/build/commands/writer/set-reaction.writer-document.command.js +18 -0
  131. package/build/commands/writer/update-writer-document-contents.command.js +18 -0
  132. package/build/commands/writer/update-writer-document-outline.command.js +18 -0
  133. package/build/commands/writer/upload-writer-source.command.js +18 -0
  134. package/build/commands/writer/writer-extend-text.command.js +18 -0
  135. package/build/commands/writer/writer-fix-errors.command.js +18 -0
  136. package/build/commands/writer/writer-generate-text.command.js +21 -0
  137. package/build/commands/writer/writer-paraphrase.command.js +18 -0
  138. package/build/commands/writer/writer-shorten-text.command.js +18 -0
  139. package/build/common/index.js +17 -0
  140. package/build/common/models/command-response.schema.js +17 -0
  141. package/build/common/models/index.js +17 -0
  142. package/build/constants/cloud-payments/index.js +11 -0
  143. package/build/constants/domains/index.js +17 -0
  144. package/build/constants/domains/white-list.js +56 -0
  145. package/build/constants/email/email-endpoint.js +4 -0
  146. package/build/constants/email/index.js +18 -0
  147. package/build/constants/email/subjects.js +15 -0
  148. package/build/constants/errors/errors.js +1052 -0
  149. package/build/constants/errors/index.js +18 -0
  150. package/build/constants/errors/verbose.js +9 -0
  151. package/build/constants/files/enums/file-type.enum.js +8 -0
  152. package/build/constants/files/enums/index.js +17 -0
  153. package/build/constants/files/file.constants.js +6 -0
  154. package/build/constants/files/index.js +18 -0
  155. package/build/constants/index.js +31 -0
  156. package/build/constants/order/enums/index.js +18 -0
  157. package/build/constants/order/enums/order-sort-by.enum.js +11 -0
  158. package/build/constants/order/enums/order-status.enum.js +16 -0
  159. package/build/constants/order/enums/order-type.enum.js +9 -0
  160. package/build/constants/order/index.js +17 -0
  161. package/build/constants/page/enums/index.js +17 -0
  162. package/build/constants/page/enums/page-type.enum.js +9 -0
  163. package/build/constants/page/index.js +17 -0
  164. package/build/constants/payment/enums/index.js +18 -0
  165. package/build/constants/payment/enums/payment-history-item-type.enum.js +8 -0
  166. package/build/constants/payment/enums/payment-status.enum.js +11 -0
  167. package/build/constants/payment/index.js +17 -0
  168. package/build/constants/product/enums/index.js +18 -0
  169. package/build/constants/product/enums/product-sort-by.enum.js +9 -0
  170. package/build/constants/product/enums/product-status.enum.js +9 -0
  171. package/build/constants/product/index.js +17 -0
  172. package/build/constants/promocode/enums/index.js +18 -0
  173. package/build/constants/promocode/enums/promocode-promotion.enum.js +9 -0
  174. package/build/constants/promocode/enums/promocode-status.enum.js +8 -0
  175. package/build/constants/promocode/index.js +17 -0
  176. package/build/constants/referral/enums/index.js +17 -0
  177. package/build/constants/referral/enums/referral-bonus-type.enum.js +8 -0
  178. package/build/constants/referral/index.js +17 -0
  179. package/build/constants/subscription/enums/index.js +24 -0
  180. package/build/constants/subscription/enums/subscription-action.enum.js +11 -0
  181. package/build/constants/subscription/enums/subscription-feature-type.enum.js +35 -0
  182. package/build/constants/subscription/enums/subscription-plan.enum.js +9 -0
  183. package/build/constants/subscription/enums/subscription-sort-by.enum.js +9 -0
  184. package/build/constants/subscription/enums/subscription-status.enum.js +15 -0
  185. package/build/constants/subscription/enums/subscription-type.enum.js +8 -0
  186. package/build/constants/subscription/enums/user-to-subscription-marks.enum.js +11 -0
  187. package/build/constants/subscription/enums/user-to-subscription-type.enum.js +8 -0
  188. package/build/constants/subscription/free-subscription.constant.js +43 -0
  189. package/build/constants/subscription/index.js +17 -0
  190. package/build/constants/transaction/enums/index.js +18 -0
  191. package/build/constants/transaction/enums/transaction-status.enum.js +11 -0
  192. package/build/constants/transaction/enums/user-balance-status.enum.js +11 -0
  193. package/build/constants/transaction/index.js +17 -0
  194. package/build/constants/unregistered-user/enums/index.js +17 -0
  195. package/build/constants/unregistered-user/enums/unregistered-user-status.enum.js +9 -0
  196. package/build/constants/unregistered-user/index.js +17 -0
  197. package/build/constants/user/enums/index.js +22 -0
  198. package/build/constants/user/enums/singup-method.enum.js +10 -0
  199. package/build/constants/user/enums/sort-order.enum.js +8 -0
  200. package/build/constants/user/enums/user-reaction.enum.js +8 -0
  201. package/build/constants/user/enums/user-role.enum.js +8 -0
  202. package/build/constants/user/enums/user-sort-by.enum.js +9 -0
  203. package/build/constants/user/enums/user-status.js +10 -0
  204. package/build/constants/user/index.js +17 -0
  205. package/build/constants/writer/enums/index.js +22 -0
  206. package/build/constants/writer/enums/source-origin.enum.js +8 -0
  207. package/build/constants/writer/enums/writer-ai-action-pricing-type.enum.js +8 -0
  208. package/build/constants/writer/enums/writer-ai-action-type.enum.js +11 -0
  209. package/build/constants/writer/enums/writer-document-section-type.enum.js +9 -0
  210. package/build/constants/writer/enums/writer-document-stage.enum.js +19 -0
  211. package/build/constants/writer/enums/writer-model-status.enum.js +8 -0
  212. package/build/constants/writer/index.js +17 -0
  213. package/build/helpers/index.js +18 -0
  214. package/build/helpers/subscription/calc-custom-subscription-price.helper.js +19 -0
  215. package/build/helpers/subscription/index.js +17 -0
  216. package/build/helpers/writer/calculate-page-count.util.js +37 -0
  217. package/build/helpers/writer/calculate-writer-ai-action-price.util.js +16 -0
  218. package/build/helpers/writer/calculate-writer-content-generation-price.util.js +6 -0
  219. package/build/helpers/writer/index.js +19 -0
  220. package/build/index.js +21 -0
  221. package/build/models/cloud-payments-receipt.schema.js +118 -0
  222. package/build/models/file.schema.js +16 -0
  223. package/build/models/filters.schema.js +16 -0
  224. package/build/models/icon-variants.schema.js +17 -0
  225. package/build/models/index.js +39 -0
  226. package/build/models/order.schema.js +17 -0
  227. package/build/models/page.schema.js +17 -0
  228. package/build/models/payment-history-item.schema.js +14 -0
  229. package/build/models/payment.schema.js +13 -0
  230. package/build/models/product.schema.js +25 -0
  231. package/build/models/promocode.schema.js +20 -0
  232. package/build/models/referral-bonus.schema.js +19 -0
  233. package/build/models/subscription-feature.schema.js +120 -0
  234. package/build/models/subscription-upgrade-schema.js +8 -0
  235. package/build/models/subscription.schema.js +43 -0
  236. package/build/models/tool.schema.js +16 -0
  237. package/build/models/unlocked-by-subscription.schema.js +13 -0
  238. package/build/models/unregistered-user.schema.js +10 -0
  239. package/build/models/user-referrals.schema.js +10 -0
  240. package/build/models/user-to-product.schema.js +19 -0
  241. package/build/models/user-to-subscription.schema.js +24 -0
  242. package/build/models/user.schema.js +26 -0
  243. package/build/models/writer/index.js +22 -0
  244. package/build/models/writer/writer-ai-action.schema.js +24 -0
  245. package/build/models/writer/writer-config.schema.js +13 -0
  246. package/build/models/writer/writer-document-outline.schema.js +21 -0
  247. package/build/models/writer/writer-document-title-page.schema.js +15 -0
  248. package/build/models/writer/writer-document-type.schema.js +13 -0
  249. package/build/models/writer/writer-document.schema.js +26 -0
  250. package/build/models/writer/writer-model.schema.js +8 -0
  251. package/build/models/writer-source.schema.js +13 -0
  252. package/commands/account-merge/index.ts +1 -0
  253. package/commands/account-merge/merge-account.command.ts +18 -0
  254. package/commands/auth/create-user.command.ts +17 -0
  255. package/commands/auth/index.ts +9 -0
  256. package/commands/auth/login.command.ts +18 -0
  257. package/commands/auth/register-user.command.ts +19 -0
  258. package/commands/auth/reset-password.command.ts +19 -0
  259. package/commands/auth/restore-password.command.ts +16 -0
  260. package/commands/auth/verify-email-retry.command.ts +10 -0
  261. package/commands/auth/verify-email.command.ts +14 -0
  262. package/commands/auth/vk-login.command.ts +23 -0
  263. package/commands/auth/yandex-login.command.ts +21 -0
  264. package/commands/files/delete-user-file.command.ts +12 -0
  265. package/commands/files/index.ts +2 -0
  266. package/commands/files/upload.command.ts +14 -0
  267. package/commands/index.ts +14 -0
  268. package/commands/page/create-page.command.ts +18 -0
  269. package/commands/page/delete-page.command.ts +13 -0
  270. package/commands/page/find-page-by-alias.command.ts +28 -0
  271. package/commands/page/find-page.command.ts +22 -0
  272. package/commands/page/index.ts +5 -0
  273. package/commands/page/update-page.command.ts +24 -0
  274. package/commands/payment/check.command.ts +52 -0
  275. package/commands/payment/get-payment-history.command.ts +10 -0
  276. package/commands/payment/index.ts +5 -0
  277. package/commands/payment/pay.command.ts +49 -0
  278. package/commands/payment/receipt.command.ts +68 -0
  279. package/commands/payment/recurrent.command.ts +48 -0
  280. package/commands/product/buy-product.command.ts +68 -0
  281. package/commands/product/create-product.command.ts +18 -0
  282. package/commands/product/delete-product.command.ts +13 -0
  283. package/commands/product/find-product.command.ts +22 -0
  284. package/commands/product/get-my-products.command.ts +10 -0
  285. package/commands/product/index.ts +6 -0
  286. package/commands/product/update-product.command.ts +24 -0
  287. package/commands/promocode/create-promocode.command.ts +20 -0
  288. package/commands/promocode/delete-promocode.command.ts +18 -0
  289. package/commands/promocode/find-promocode.command.ts +22 -0
  290. package/commands/promocode/index.ts +5 -0
  291. package/commands/promocode/update-promocode.command.ts +24 -0
  292. package/commands/promocode/validate-promocode.command.ts +19 -0
  293. package/commands/referral/get-by-bonuses.command.ts +14 -0
  294. package/commands/referral/index.ts +2 -0
  295. package/commands/referral/validate-referral.command.ts +17 -0
  296. package/commands/subscription/buy-subscription.command.ts +73 -0
  297. package/commands/subscription/cancel-subscription.command.ts +19 -0
  298. package/commands/subscription/create-custom-subscription-plan.command.ts +26 -0
  299. package/commands/subscription/create-subscription.command.ts +18 -0
  300. package/commands/subscription/delete-subscription.command.ts +15 -0
  301. package/commands/subscription/downgrade-subscription.command.ts +50 -0
  302. package/commands/subscription/find-subscription.command.ts +22 -0
  303. package/commands/subscription/get-available-upgrades.command.ts +14 -0
  304. package/commands/subscription/get-free-subscription.command.ts +10 -0
  305. package/commands/subscription/get-subscriptions-summary.command.ts +14 -0
  306. package/commands/subscription/index.ts +14 -0
  307. package/commands/subscription/recover-past-due-subscription.command.ts +15 -0
  308. package/commands/subscription/recover-subscription.command.ts +13 -0
  309. package/commands/subscription/update-subscription.command.ts +24 -0
  310. package/commands/subscription/upgrade-subscription.command.ts +51 -0
  311. package/commands/unregistered-user/create-unregistered-user.command.ts +10 -0
  312. package/commands/unregistered-user/index.ts +1 -0
  313. package/commands/user/check-email.command.ts +7 -0
  314. package/commands/user/delete-account.command.ts +13 -0
  315. package/commands/user/find-user-by-uuid.command.ts +21 -0
  316. package/commands/user/find-users-by-criteria.command.ts +70 -0
  317. package/commands/user/get-aggregated-user-data.command.ts +29 -0
  318. package/commands/user/get-me.command.ts +22 -0
  319. package/commands/user/get-user-balance.command.ts +17 -0
  320. package/commands/user/get-user-orders.command.ts +28 -0
  321. package/commands/user/get-user-products.command.ts +26 -0
  322. package/commands/user/get-user-subscriptions.command.ts +26 -0
  323. package/commands/user/index.ts +11 -0
  324. package/commands/user/up-token-bonus-balance.command.ts +23 -0
  325. package/commands/user-to-product/get-user-to-product-by-uuid.command.ts +16 -0
  326. package/commands/user-to-product/index.ts +2 -0
  327. package/commands/user-to-product/update-user-to-product.command.ts +24 -0
  328. package/commands/user-to-subscription/get-user-to-subscription-by-uuid.command.ts +16 -0
  329. package/commands/user-to-subscription/get-user-to-subscriptions.command.ts +10 -0
  330. package/commands/user-to-subscription/index.ts +3 -0
  331. package/commands/user-to-subscription/update-user-to-subscription.command.ts +32 -0
  332. package/commands/writer/collect-writer-document-sources.command.ts +17 -0
  333. package/commands/writer/create-writer-document.command.ts +15 -0
  334. package/commands/writer/delete-all-writer-documents.command.ts +6 -0
  335. package/commands/writer/delete-writer-document-by-uuid.command.ts +11 -0
  336. package/commands/writer/discard-writer-source.command.ts +18 -0
  337. package/commands/writer/export-writer-document-as-docx.command.ts +15 -0
  338. package/commands/writer/find-writer-document-by-uuid.command.ts +14 -0
  339. package/commands/writer/find-writer-documents.command.ts +18 -0
  340. package/commands/writer/generate-writer-document-contents.command.ts +19 -0
  341. package/commands/writer/generate-writer-document-outline.command.ts +25 -0
  342. package/commands/writer/get-writer-document-sources.command.ts +14 -0
  343. package/commands/writer/get-writer-tool-config.command.ts +10 -0
  344. package/commands/writer/index.ts +21 -0
  345. package/commands/writer/set-reaction.writer-document.command.ts +21 -0
  346. package/commands/writer/update-writer-document-contents.command.ts +20 -0
  347. package/commands/writer/update-writer-document-outline.command.ts +24 -0
  348. package/commands/writer/upload-writer-source.command.ts +20 -0
  349. package/commands/writer/writer-extend-text.command.ts +20 -0
  350. package/commands/writer/writer-fix-errors.command.ts +20 -0
  351. package/commands/writer/writer-generate-text.command.ts +23 -0
  352. package/commands/writer/writer-paraphrase.command.ts +20 -0
  353. package/commands/writer/writer-shorten-text.command.ts +20 -0
  354. package/common/index.ts +1 -0
  355. package/common/models/command-response.schema.ts +18 -0
  356. package/common/models/index.ts +1 -0
  357. package/constants/cloud-payments/index.ts +11 -0
  358. package/constants/domains/index.ts +1 -0
  359. package/constants/domains/white-list.ts +54 -0
  360. package/constants/email/email-endpoint.ts +1 -0
  361. package/constants/email/index.ts +2 -0
  362. package/constants/email/subjects.ts +12 -0
  363. package/constants/errors/errors.ts +1056 -0
  364. package/constants/errors/index.ts +2 -0
  365. package/constants/errors/verbose.ts +7 -0
  366. package/constants/files/enums/file-type.enum.ts +4 -0
  367. package/constants/files/enums/index.ts +1 -0
  368. package/constants/files/file.constants.ts +11 -0
  369. package/constants/files/index.ts +2 -0
  370. package/constants/index.ts +15 -0
  371. package/constants/order/enums/index.ts +2 -0
  372. package/constants/order/enums/order-sort-by.enum.ts +7 -0
  373. package/constants/order/enums/order-status.enum.ts +12 -0
  374. package/constants/order/enums/order-type.enum.ts +5 -0
  375. package/constants/order/index.ts +1 -0
  376. package/constants/page/enums/index.ts +1 -0
  377. package/constants/page/enums/page-type.enum.ts +5 -0
  378. package/constants/page/index.ts +1 -0
  379. package/constants/payment/enums/index.ts +2 -0
  380. package/constants/payment/enums/payment-history-item-type.enum.ts +4 -0
  381. package/constants/payment/enums/payment-status.enum.ts +7 -0
  382. package/constants/payment/index.ts +1 -0
  383. package/constants/product/enums/index.ts +2 -0
  384. package/constants/product/enums/product-sort-by.enum.ts +5 -0
  385. package/constants/product/enums/product-status.enum.ts +5 -0
  386. package/constants/product/index.ts +1 -0
  387. package/constants/promocode/enums/index.ts +2 -0
  388. package/constants/promocode/enums/promocode-promotion.enum.ts +5 -0
  389. package/constants/promocode/enums/promocode-status.enum.ts +4 -0
  390. package/constants/promocode/index.ts +1 -0
  391. package/constants/referral/enums/index.ts +1 -0
  392. package/constants/referral/enums/referral-bonus-type.enum.ts +4 -0
  393. package/constants/referral/index.ts +1 -0
  394. package/constants/subscription/enums/index.ts +8 -0
  395. package/constants/subscription/enums/subscription-action.enum.ts +7 -0
  396. package/constants/subscription/enums/subscription-feature-type.enum.ts +31 -0
  397. package/constants/subscription/enums/subscription-plan.enum.ts +5 -0
  398. package/constants/subscription/enums/subscription-sort-by.enum.ts +5 -0
  399. package/constants/subscription/enums/subscription-status.enum.ts +11 -0
  400. package/constants/subscription/enums/subscription-type.enum.ts +4 -0
  401. package/constants/subscription/enums/user-to-subscription-marks.enum.ts +7 -0
  402. package/constants/subscription/enums/user-to-subscription-type.enum.ts +4 -0
  403. package/constants/subscription/free-subscription.constant.ts +47 -0
  404. package/constants/subscription/index.ts +1 -0
  405. package/constants/transaction/enums/index.ts +2 -0
  406. package/constants/transaction/enums/transaction-status.enum.ts +7 -0
  407. package/constants/transaction/enums/user-balance-status.enum.ts +7 -0
  408. package/constants/transaction/index.ts +1 -0
  409. package/constants/unregistered-user/enums/index.ts +1 -0
  410. package/constants/unregistered-user/enums/unregistered-user-status.enum.ts +5 -0
  411. package/constants/unregistered-user/index.ts +1 -0
  412. package/constants/user/enums/index.ts +6 -0
  413. package/constants/user/enums/singup-method.enum.ts +6 -0
  414. package/constants/user/enums/sort-order.enum.ts +4 -0
  415. package/constants/user/enums/user-reaction.enum.ts +4 -0
  416. package/constants/user/enums/user-role.enum.ts +8 -0
  417. package/constants/user/enums/user-sort-by.enum.ts +5 -0
  418. package/constants/user/enums/user-status.ts +6 -0
  419. package/constants/user/index.ts +1 -0
  420. package/constants/writer/enums/index.ts +6 -0
  421. package/constants/writer/enums/source-origin.enum.ts +4 -0
  422. package/constants/writer/enums/writer-ai-action-pricing-type.enum.ts +4 -0
  423. package/constants/writer/enums/writer-ai-action-type.enum.ts +7 -0
  424. package/constants/writer/enums/writer-document-section-type.enum.ts +5 -0
  425. package/constants/writer/enums/writer-document-stage.enum.ts +19 -0
  426. package/constants/writer/enums/writer-model-status.enum.ts +4 -0
  427. package/constants/writer/index.ts +1 -0
  428. package/helpers/index.ts +2 -0
  429. package/helpers/subscription/calc-custom-subscription-price.helper.ts +19 -0
  430. package/helpers/subscription/index.ts +1 -0
  431. package/helpers/writer/calculate-page-count.util.ts +46 -0
  432. package/helpers/writer/calculate-writer-ai-action-price.util.ts +20 -0
  433. package/helpers/writer/calculate-writer-content-generation-price.util.ts +3 -0
  434. package/helpers/writer/index.ts +3 -0
  435. package/index.ts +5 -0
  436. package/models/cloud-payments-receipt.schema.ts +119 -0
  437. package/models/file.schema.ts +14 -0
  438. package/models/filters.schema.ts +17 -0
  439. package/models/icon-variants.schema.ts +12 -0
  440. package/models/index.ts +23 -0
  441. package/models/order.schema.ts +16 -0
  442. package/models/page.schema.ts +16 -0
  443. package/models/payment-history-item.schema.ts +12 -0
  444. package/models/payment.schema.ts +12 -0
  445. package/models/product.schema.ts +23 -0
  446. package/models/promocode.schema.ts +19 -0
  447. package/models/referral-bonus.schema.ts +18 -0
  448. package/models/subscription-feature.schema.ts +153 -0
  449. package/models/subscription-upgrade-schema.ts +9 -0
  450. package/models/subscription.schema.ts +50 -0
  451. package/models/tool.schema.ts +20 -0
  452. package/models/unlocked-by-subscription.schema.ts +14 -0
  453. package/models/unregistered-user.schema.ts +9 -0
  454. package/models/user-referrals.schema.ts +5 -0
  455. package/models/user-to-product.schema.ts +18 -0
  456. package/models/user-to-subscription.schema.ts +26 -0
  457. package/models/user.schema.ts +26 -0
  458. package/models/writer/index.ts +6 -0
  459. package/models/writer/writer-ai-action.schema.ts +25 -0
  460. package/models/writer/writer-config.schema.ts +12 -0
  461. package/models/writer/writer-document-outline.schema.ts +28 -0
  462. package/models/writer/writer-document-title-page.schema.ts +15 -0
  463. package/models/writer/writer-document-type.schema.ts +12 -0
  464. package/models/writer/writer-document.schema.ts +25 -0
  465. package/models/writer/writer-model.schema.ts +8 -0
  466. package/models/writer-source.schema.ts +13 -0
  467. package/package.json +17 -0
  468. package/tsconfig.json +104 -0
@@ -0,0 +1,13 @@
1
+ export const AUTH_CONTROLLER = 'auth' as const;
2
+
3
+ export const AUTH_ROUTES = {
4
+ REGISTER: 'register',
5
+ LOGIN: 'login',
6
+ VK_LOGIN: 'vk/login',
7
+ YANDEX_LOGIN: 'yandex/login',
8
+ CREATE_USER: 'create-user',
9
+ RESTORE_PASSWORD: 'restore-password',
10
+ RESET_PASSWORD: 'reset-password',
11
+ VERIFY_EMAIL: 'verify-email',
12
+ VERIFY_EMAIL_RETRY: 'verify-email-retry',
13
+ } as const;
@@ -0,0 +1,4 @@
1
+ export const CLOUD_PAYMENTS_CONTROLLER = 'cloud-payments' as const;
2
+ export const CLOUD_PAYMENTS_ROUTES = {
3
+ CALLBACK: 'callback',
4
+ } as const;
@@ -0,0 +1,7 @@
1
+ export const FILE_CONTROLLER = 'private/file' as const;
2
+ export const FILE_PUBLIC_CONTROLLER = 'public/file' as const;
3
+
4
+ export const FILE_ROUTES = {
5
+ DELETE: (uuid: string) => `${uuid}`,
6
+ UPLOAD: 'upload',
7
+ } as const;
@@ -0,0 +1,14 @@
1
+ export * from './auth';
2
+ export * from './unregistered-user';
3
+ export * from './user';
4
+ export * from './cloud-payments';
5
+ export * from './payment';
6
+ export * from './subscription';
7
+ export * from './product';
8
+ export * from './user-to-product';
9
+ export * from './user-to-subscription';
10
+ export * from './referral';
11
+ export * from './promocode';
12
+ export * from './page';
13
+ export * from './writer';
14
+ export * from './files';
@@ -0,0 +1,8 @@
1
+ export const PAGE_CONTROLLER = 'page' as const;
2
+
3
+ export const PAGE_ROUTES = {
4
+ FIND_BY_UUID: 'by/uuid',
5
+ GET_ALL: 'all',
6
+ FIND_BY_ALIAS: 'by/alias',
7
+ GET_ALL_WITH_RELATIONS: 'by/all',
8
+ } as const;
@@ -0,0 +1,5 @@
1
+ export const PAYMENT_CONTROLLER = 'payment' as const;
2
+
3
+ export const PAYMENT_ROUTES = {
4
+ HISTORY: 'history',
5
+ } as const;
@@ -0,0 +1,11 @@
1
+ export const PRODUCT_PRIVATE_CONTROLLER = 'product/private' as const;
2
+
3
+ export const PRODUCT_PUBLIC_CONTROLLER = 'product/public' as const;
4
+
5
+ export const PRODUCT_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_ALL: 'all',
8
+ BUY: `buy`,
9
+ FAST_BUY: `fast/buy`,
10
+ MY: 'my',
11
+ } as const;
@@ -0,0 +1,9 @@
1
+ export const PROMOCODE_PRIVATE_CONTROLLER = 'private/promocode' as const;
2
+ export const PROMOCODE_PUBLIC_CONTROLLER = 'public/promocode' as const;
3
+
4
+ export const PROMOCODE_ROUTES = {
5
+ FIND_ALL: 'all',
6
+ VALIDATE: 'validate',
7
+ FIND_BY_UUID: 'by/uuid',
8
+ UPSELL: 'upsell',
9
+ } as const;
@@ -0,0 +1,7 @@
1
+ export const REFERRAL_PRIVATE_CONTROLLER = 'private/referral' as const;
2
+ export const REFERRAL_PUBLIC_CONTROLLER = 'public/referral' as const;
3
+
4
+ export const REFERRAL_ROUTES = {
5
+ GET_MY_BONUSES: 'bonuses/my',
6
+ VALIDATE: 'validate/users',
7
+ } as const;
@@ -0,0 +1,21 @@
1
+ export const SUBSCRIPTION_PRIVATE_CONTROLLER = 'subscription/private' as const;
2
+
3
+ export const SUBSCRIPTION_PUBLIC_CONTROLLER = 'subscription/public' as const;
4
+
5
+ export const SUBSCRIPTION_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_ALL: 'all',
8
+ BUY: 'buy',
9
+ FAST_BUY: 'fast/buy',
10
+ GET_MY: 'my',
11
+ CANCEL: 'cancel',
12
+ RECOVER: 'recover',
13
+ GET_AVAILABLE_UPGRADES: 'available-upgrades',
14
+ GET_AVAILABLE_DOWNGRADES: 'available-downgrades',
15
+ UPGRADE: 'upgrade',
16
+ DOWNGRADE: 'downgrade',
17
+ CREATE_CUSTOM: 'custom',
18
+ FREE: 'free',
19
+ SUMMARY: 'summary',
20
+ RECOVER_PAST_DUE: (uuid: string) => `${uuid}/recover-past-due`,
21
+ } as const;
@@ -0,0 +1 @@
1
+ export const UNREGISTERED_USER_CONTROLLER = 'unregistered-user' as const;
@@ -0,0 +1,6 @@
1
+ export const USER_TO_PRODUCT_CONTROLLER = 'user-to-product' as const;
2
+
3
+ export const USER_TO_PRODUCT_ROUTES = {
4
+ FIND_BY_UUID: (uuid: string) => `${uuid}`,
5
+ UPDATE: (uuid: string) => `${uuid}`,
6
+ } as const;
@@ -0,0 +1,6 @@
1
+ export const USER_TO_SUBSCRIPTION_CONTROLLER = 'user-to-subscription' as const;
2
+
3
+ export const USER_TO_SUBSCRIPTION_ROUTES = {
4
+ FIND_BY_UUID: (uuid: string) => `${uuid}`,
5
+ UPDATE: (uuid: string) => `${uuid}`,
6
+ } as const;
@@ -0,0 +1,14 @@
1
+ export const USER_CONTROLLER = 'users' as const;
2
+
3
+ export const USER_ROUTES = {
4
+ GET: 'me',
5
+ POST: 'up-balance',
6
+ CHECK_EMAIL: 'check-email',
7
+ FIND_BY_CRITERIA: 'criteria',
8
+ FIND_BY_UUID: (uuid: string) => `${uuid}`,
9
+ GET_BALANCE: (uuid: string) => `balance/${uuid}`,
10
+ GET_ORDERS: (uuid: string) => `orders/${uuid}`,
11
+ GET_SUBSCRIPTIONS: (uuid: string) => `subscriptions/${uuid}`,
12
+ GET_PRODUCTS: (uuid: string) => `products/${uuid}`,
13
+ DELETE_ACCOUNT: 'delete-account',
14
+ } as const;
@@ -0,0 +1,26 @@
1
+ export const WRITER_CONTROLLER_PRIVATE = 'private/writer' as const;
2
+ export const WRITER_CONTROLLER_PUBLIC = 'public/writer' as const;
3
+
4
+ export const WRITER_ROUTES = {
5
+ CONFIG: 'config',
6
+ CREATE: 'documents',
7
+ GET_DOCUMENTS: 'documents',
8
+ GET_DOCUMENT: (uuid: string) => `documents/${uuid}`,
9
+ GET_DOCUMENT_SOURCES: (uuid: string) => `documents/${uuid}/sources`,
10
+ GENERATE_OUTLINE: (uuid: string) => `documents/${uuid}/outline/generate`,
11
+ COLLECT_SOURCES: (uuid: string) => `documents/${uuid}/sources/collect`,
12
+ UPLOAD_SOURCE: (uuid: string) => `documents/${uuid}/sources/upload`,
13
+ GENERATE_CONTENTS: (uuid: string) => `documents/${uuid}/generate`,
14
+ UPDATE_OUTLINE: (uuid: string) => `documents/${uuid}/outline`,
15
+ DELETE_DOCUMENT: (uuid: string) => `documents/${uuid}`,
16
+ UPDATE_CONTENTS: (uuid: string) => `documents/${uuid}/contents`,
17
+ DELETE_ALL_DOCUMENTS: 'documents',
18
+ PARAPHRASE: (uuid: string) => `documents/${uuid}/actions/paraphrase`,
19
+ EXTEND_TEXT: (uuid: string) => `documents/${uuid}/actions/extend-text`,
20
+ SHORTEN_TEXT: (uuid: string) => `documents/${uuid}/actions/shorten-text`,
21
+ FIX_ERRORS: (uuid: string) => `documents/${uuid}/actions/fix-errors`,
22
+ GENERATE_TEXT: (uuid: string) => `documents/${uuid}/actions/generate-text`,
23
+ EXPORT_AS_DOCX: (uuid: string) => `documents/${uuid}/export/docx`,
24
+ SET_REACTION: (uuid: string) => `documents/${uuid}/reaction`,
25
+ DISCARD_SOURCE: (uuid: string) => `sources/${uuid}/discard`,
26
+ } as const;
@@ -0,0 +1 @@
1
+ export * from './http';
package/api/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './controller';
2
+ export * from './routes';
package/api/routes.ts ADDED
@@ -0,0 +1,147 @@
1
+ import * as CONTROLLERS from './controller';
2
+ export const ROOT = '/api' as const;
3
+
4
+ export const REST_API = {
5
+ AUTH: {
6
+ REGISTER: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.REGISTER}`,
7
+ LOGIN: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.LOGIN}`,
8
+ CREATE_USER: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.CREATE_USER}`,
9
+ RESTORE_PASSWORD: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESTORE_PASSWORD}`,
10
+ RESET_PASSWORD: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESET_PASSWORD}`,
11
+ VERIFY_EMAIL: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.VERIFY_EMAIL}`,
12
+ VERIFY_EMAIL_RETRY: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.VERIFY_EMAIL_RETRY}`,
13
+ },
14
+ UNREGISTERED_USERS: {},
15
+ USERS: {
16
+ GET: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
17
+ POST: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.POST}`,
18
+ CHECK_EMAIL: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CHECK_EMAIL}`,
19
+ FIND_BY_CRITERIA: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_CRITERIA}`,
20
+ FIND_BY_UUID: (uuid: string) =>
21
+ `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_UUID(uuid)}`,
22
+ GET_BALANCE: (uuid: string) =>
23
+ `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_BALANCE(uuid)}`,
24
+ GET_ORDERS: (uuid: string) =>
25
+ `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_ORDERS(uuid)}`,
26
+ DELETE_ACCOUNT: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.DELETE_ACCOUNT}`,
27
+ },
28
+ CLOUD_PAYMENTS: {},
29
+ PAYMENT: {},
30
+ SUBSCRIPTION_PUBLIC: {
31
+ GET: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PUBLIC_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_ALL}`,
32
+ GET_BY_UUID: (uuid: string): string =>
33
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PUBLIC_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.FIND_BY_UUID}/${uuid}`,
34
+ FAST_BUY: (uuid: string) =>
35
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PUBLIC_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.FAST_BUY}/${uuid}`,
36
+ },
37
+ SUBSCRIPTION_PRIVATE: {
38
+ GET: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_ALL}`,
39
+ BUY: (uuid: string) =>
40
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.BUY}/${uuid}`,
41
+ GET_MY: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_MY}`,
42
+ CANCEL: (uuid: string) =>
43
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CANCEL}`,
44
+ RECOVER: (uuid: string) =>
45
+ `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER}`,
46
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}`,
47
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}`,
48
+ CREATE: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}`,
49
+ CREATE_CUSTOM: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CREATE_CUSTOM}`,
50
+ SUMMARY: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.SUMMARY}`,
51
+ },
52
+ PRODUCT_PUBLIC: {
53
+ GET: `${ROOT}/${CONTROLLERS.PRODUCT_PUBLIC_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.GET_ALL}`,
54
+ GET_BY_UUID: (uuid: string): string =>
55
+ `${ROOT}/${CONTROLLERS.PRODUCT_PUBLIC_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.FIND_BY_UUID}/${uuid}`,
56
+ FAST_BUY: (uuid: string) =>
57
+ `${ROOT}/${CONTROLLERS.PRODUCT_PUBLIC_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.FAST_BUY}/${uuid}`,
58
+ },
59
+ PRODUCT_PRIVATE: {
60
+ GET: `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.GET_ALL}`,
61
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${uuid}`,
62
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${uuid}`,
63
+ CREATE: `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}`,
64
+ BUY: (uuid: string) =>
65
+ `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.BUY}/${uuid}`,
66
+ MY: `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.MY}`,
67
+ },
68
+ PROMOCODE: {
69
+ CREATE: `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}`,
70
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}/${uuid}`,
71
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}/${uuid}`,
72
+ GET_BY_UUID: (uuid: string) =>
73
+ `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}/${CONTROLLERS.PROMOCODE_ROUTES.FIND_BY_UUID}/${uuid}`,
74
+ GET_ALL: `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}/${CONTROLLERS.PROMOCODE_ROUTES.FIND_ALL}`,
75
+ VALIDATE_PRIVATE: (code: string) =>
76
+ `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}/${CONTROLLERS.PROMOCODE_ROUTES.VALIDATE}/${code}`,
77
+ VALIDATE_PUBLIC: (code: string) =>
78
+ `${ROOT}/${CONTROLLERS.PROMOCODE_PUBLIC_CONTROLLER}/${CONTROLLERS.PROMOCODE_ROUTES.VALIDATE}/${code}`,
79
+ },
80
+ PAGE: {
81
+ GET: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL}`,
82
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${uuid}`,
83
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${uuid}`,
84
+ CREATE: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}`,
85
+ GET_BY_UUID: (uuid: string): string =>
86
+ `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_UUID}/${uuid}`,
87
+ GET_BY_ALIAS: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_ALIAS}`,
88
+ GET_BY_ALL_WITH_RELATIONS: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL_WITH_RELATIONS}`,
89
+ },
90
+ WRITER_PRIVATE: {
91
+ CONFIG: `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.CONFIG}`,
92
+ CREATE: `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.CREATE}`,
93
+ GET_DOCUMENTS: `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.GET_DOCUMENTS}`,
94
+ GET_DOCUMENT: (uuid: string) =>
95
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.GET_DOCUMENT(uuid)}`,
96
+ GET_DOCUMENT_SOURCES: (uuid: string) =>
97
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.GET_DOCUMENT_SOURCES(uuid)}`,
98
+ GENERATE_OUTLINE: (uuid: string) =>
99
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.GENERATE_OUTLINE(uuid)}`,
100
+ COLLECT_SOURCES: (uuid: string) =>
101
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.COLLECT_SOURCES(uuid)}`,
102
+ UPLOAD_SOURCE: (uuid: string) =>
103
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.UPLOAD_SOURCE(uuid)}`,
104
+ GENERATE_CONTENTS: (uuid: string) =>
105
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.GENERATE_CONTENTS(uuid)}`,
106
+ UPDATE_OUTLINE: (uuid: string) =>
107
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.UPDATE_OUTLINE(uuid)}`,
108
+ DELETE_DOCUMENT: (uuid: string) =>
109
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.DELETE_DOCUMENT(uuid)}`,
110
+ UPDATE_CONTENTS: (uuid: string) =>
111
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.UPDATE_CONTENTS(uuid)}`,
112
+ DELETE_ALL_DOCUMENTS: `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.DELETE_ALL_DOCUMENTS}`,
113
+ PARAPHRASE: (uuid: string) =>
114
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.PARAPHRASE(uuid)}`,
115
+ EXTEND_TEXT: (uuid: string) =>
116
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.EXTEND_TEXT(uuid)}`,
117
+ SHORTEN_TEXT: (uuid: string) =>
118
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.SHORTEN_TEXT(uuid)}`,
119
+ FIX_ERRORS: (uuid: string) =>
120
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.FIX_ERRORS(uuid)}`,
121
+ GENERATE_TEXT: (uuid: string) =>
122
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.GENERATE_TEXT(uuid)}`,
123
+ EXPORT_AS_DOCX: (uuid: string) =>
124
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.EXPORT_AS_DOCX(uuid)}`,
125
+ SET_REACTION: (uuid: string) =>
126
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.SET_REACTION(uuid)}`,
127
+ DISCARD_SOURCE: (uuid: string) =>
128
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PRIVATE}/${CONTROLLERS.WRITER_ROUTES.DISCARD_SOURCE(uuid)}`,
129
+ },
130
+ WRITER_PUBLIC: {
131
+ CONFIG: `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PUBLIC}/${CONTROLLERS.WRITER_ROUTES.CONFIG}`,
132
+ CREATE: `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PUBLIC}/${CONTROLLERS.WRITER_ROUTES.CREATE}`,
133
+ GET_DOCUMENT: (uuid: string) =>
134
+ `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PUBLIC}/${CONTROLLERS.WRITER_ROUTES.GET_DOCUMENT(uuid)}`,
135
+ GET_DOCUMENTS: `${ROOT}/${CONTROLLERS.WRITER_CONTROLLER_PUBLIC}/${CONTROLLERS.WRITER_ROUTES.GET_DOCUMENTS}`,
136
+ },
137
+ FILE_PRIVATE: {
138
+ UPLOAD: `${ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD}`,
139
+ DELETE: (uuid: string) =>
140
+ `${ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.DELETE(uuid)}`,
141
+ },
142
+ FILE_PUBLIC: {
143
+ UPLOAD: `${ROOT}/${CONTROLLERS.FILE_PUBLIC_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD}`,
144
+ DELETE: (uuid: string) =>
145
+ `${ROOT}/${CONTROLLERS.FILE_PUBLIC_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.DELETE(uuid)}`,
146
+ },
147
+ } as const;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTH_ROUTES = exports.AUTH_CONTROLLER = void 0;
4
+ exports.AUTH_CONTROLLER = 'auth';
5
+ exports.AUTH_ROUTES = {
6
+ REGISTER: 'register',
7
+ LOGIN: 'login',
8
+ VK_LOGIN: 'vk/login',
9
+ YANDEX_LOGIN: 'yandex/login',
10
+ CREATE_USER: 'create-user',
11
+ RESTORE_PASSWORD: 'restore-password',
12
+ RESET_PASSWORD: 'reset-password',
13
+ VERIFY_EMAIL: 'verify-email',
14
+ VERIFY_EMAIL_RETRY: 'verify-email-retry',
15
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CLOUD_PAYMENTS_ROUTES = exports.CLOUD_PAYMENTS_CONTROLLER = void 0;
4
+ exports.CLOUD_PAYMENTS_CONTROLLER = 'cloud-payments';
5
+ exports.CLOUD_PAYMENTS_ROUTES = {
6
+ CALLBACK: 'callback',
7
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FILE_ROUTES = exports.FILE_PUBLIC_CONTROLLER = exports.FILE_CONTROLLER = void 0;
4
+ exports.FILE_CONTROLLER = 'private/file';
5
+ exports.FILE_PUBLIC_CONTROLLER = 'public/file';
6
+ exports.FILE_ROUTES = {
7
+ DELETE: (uuid) => `${uuid}`,
8
+ UPLOAD: 'upload',
9
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __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("./auth"), exports);
18
+ __exportStar(require("./unregistered-user"), exports);
19
+ __exportStar(require("./user"), exports);
20
+ __exportStar(require("./cloud-payments"), exports);
21
+ __exportStar(require("./payment"), exports);
22
+ __exportStar(require("./subscription"), exports);
23
+ __exportStar(require("./product"), exports);
24
+ __exportStar(require("./user-to-product"), exports);
25
+ __exportStar(require("./user-to-subscription"), exports);
26
+ __exportStar(require("./referral"), exports);
27
+ __exportStar(require("./promocode"), exports);
28
+ __exportStar(require("./page"), exports);
29
+ __exportStar(require("./writer"), exports);
30
+ __exportStar(require("./files"), exports);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAGE_ROUTES = exports.PAGE_CONTROLLER = void 0;
4
+ exports.PAGE_CONTROLLER = 'page';
5
+ exports.PAGE_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_ALL: 'all',
8
+ FIND_BY_ALIAS: 'by/alias',
9
+ GET_ALL_WITH_RELATIONS: 'by/all',
10
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAYMENT_ROUTES = exports.PAYMENT_CONTROLLER = void 0;
4
+ exports.PAYMENT_CONTROLLER = 'payment';
5
+ exports.PAYMENT_ROUTES = {
6
+ HISTORY: 'history',
7
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRODUCT_ROUTES = exports.PRODUCT_PUBLIC_CONTROLLER = exports.PRODUCT_PRIVATE_CONTROLLER = void 0;
4
+ exports.PRODUCT_PRIVATE_CONTROLLER = 'product/private';
5
+ exports.PRODUCT_PUBLIC_CONTROLLER = 'product/public';
6
+ exports.PRODUCT_ROUTES = {
7
+ FIND_BY_UUID: 'by/uuid',
8
+ GET_ALL: 'all',
9
+ BUY: `buy`,
10
+ FAST_BUY: `fast/buy`,
11
+ MY: 'my',
12
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROMOCODE_ROUTES = exports.PROMOCODE_PUBLIC_CONTROLLER = exports.PROMOCODE_PRIVATE_CONTROLLER = void 0;
4
+ exports.PROMOCODE_PRIVATE_CONTROLLER = 'private/promocode';
5
+ exports.PROMOCODE_PUBLIC_CONTROLLER = 'public/promocode';
6
+ exports.PROMOCODE_ROUTES = {
7
+ FIND_ALL: 'all',
8
+ VALIDATE: 'validate',
9
+ FIND_BY_UUID: 'by/uuid',
10
+ UPSELL: 'upsell',
11
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REFERRAL_ROUTES = exports.REFERRAL_PUBLIC_CONTROLLER = exports.REFERRAL_PRIVATE_CONTROLLER = void 0;
4
+ exports.REFERRAL_PRIVATE_CONTROLLER = 'private/referral';
5
+ exports.REFERRAL_PUBLIC_CONTROLLER = 'public/referral';
6
+ exports.REFERRAL_ROUTES = {
7
+ GET_MY_BONUSES: 'bonuses/my',
8
+ VALIDATE: 'validate/users',
9
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_ROUTES = exports.SUBSCRIPTION_PUBLIC_CONTROLLER = exports.SUBSCRIPTION_PRIVATE_CONTROLLER = void 0;
4
+ exports.SUBSCRIPTION_PRIVATE_CONTROLLER = 'subscription/private';
5
+ exports.SUBSCRIPTION_PUBLIC_CONTROLLER = 'subscription/public';
6
+ exports.SUBSCRIPTION_ROUTES = {
7
+ FIND_BY_UUID: 'by/uuid',
8
+ GET_ALL: 'all',
9
+ BUY: 'buy',
10
+ FAST_BUY: 'fast/buy',
11
+ GET_MY: 'my',
12
+ CANCEL: 'cancel',
13
+ RECOVER: 'recover',
14
+ GET_AVAILABLE_UPGRADES: 'available-upgrades',
15
+ GET_AVAILABLE_DOWNGRADES: 'available-downgrades',
16
+ UPGRADE: 'upgrade',
17
+ DOWNGRADE: 'downgrade',
18
+ CREATE_CUSTOM: 'custom',
19
+ FREE: 'free',
20
+ SUMMARY: 'summary',
21
+ RECOVER_PAST_DUE: (uuid) => `${uuid}/recover-past-due`,
22
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNREGISTERED_USER_CONTROLLER = void 0;
4
+ exports.UNREGISTERED_USER_CONTROLLER = 'unregistered-user';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_TO_PRODUCT_ROUTES = exports.USER_TO_PRODUCT_CONTROLLER = void 0;
4
+ exports.USER_TO_PRODUCT_CONTROLLER = 'user-to-product';
5
+ exports.USER_TO_PRODUCT_ROUTES = {
6
+ FIND_BY_UUID: (uuid) => `${uuid}`,
7
+ UPDATE: (uuid) => `${uuid}`,
8
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_TO_SUBSCRIPTION_ROUTES = exports.USER_TO_SUBSCRIPTION_CONTROLLER = void 0;
4
+ exports.USER_TO_SUBSCRIPTION_CONTROLLER = 'user-to-subscription';
5
+ exports.USER_TO_SUBSCRIPTION_ROUTES = {
6
+ FIND_BY_UUID: (uuid) => `${uuid}`,
7
+ UPDATE: (uuid) => `${uuid}`,
8
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_ROUTES = exports.USER_CONTROLLER = void 0;
4
+ exports.USER_CONTROLLER = 'users';
5
+ exports.USER_ROUTES = {
6
+ GET: 'me',
7
+ POST: 'up-balance',
8
+ CHECK_EMAIL: 'check-email',
9
+ FIND_BY_CRITERIA: 'criteria',
10
+ FIND_BY_UUID: (uuid) => `${uuid}`,
11
+ GET_BALANCE: (uuid) => `balance/${uuid}`,
12
+ GET_ORDERS: (uuid) => `orders/${uuid}`,
13
+ GET_SUBSCRIPTIONS: (uuid) => `subscriptions/${uuid}`,
14
+ GET_PRODUCTS: (uuid) => `products/${uuid}`,
15
+ DELETE_ACCOUNT: 'delete-account',
16
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WRITER_ROUTES = exports.WRITER_CONTROLLER_PUBLIC = exports.WRITER_CONTROLLER_PRIVATE = void 0;
4
+ exports.WRITER_CONTROLLER_PRIVATE = 'private/writer';
5
+ exports.WRITER_CONTROLLER_PUBLIC = 'public/writer';
6
+ exports.WRITER_ROUTES = {
7
+ CONFIG: 'config',
8
+ CREATE: 'documents',
9
+ GET_DOCUMENTS: 'documents',
10
+ GET_DOCUMENT: (uuid) => `documents/${uuid}`,
11
+ GET_DOCUMENT_SOURCES: (uuid) => `documents/${uuid}/sources`,
12
+ GENERATE_OUTLINE: (uuid) => `documents/${uuid}/outline/generate`,
13
+ COLLECT_SOURCES: (uuid) => `documents/${uuid}/sources/collect`,
14
+ UPLOAD_SOURCE: (uuid) => `documents/${uuid}/sources/upload`,
15
+ GENERATE_CONTENTS: (uuid) => `documents/${uuid}/generate`,
16
+ UPDATE_OUTLINE: (uuid) => `documents/${uuid}/outline`,
17
+ DELETE_DOCUMENT: (uuid) => `documents/${uuid}`,
18
+ UPDATE_CONTENTS: (uuid) => `documents/${uuid}/contents`,
19
+ DELETE_ALL_DOCUMENTS: 'documents',
20
+ PARAPHRASE: (uuid) => `documents/${uuid}/actions/paraphrase`,
21
+ EXTEND_TEXT: (uuid) => `documents/${uuid}/actions/extend-text`,
22
+ SHORTEN_TEXT: (uuid) => `documents/${uuid}/actions/shorten-text`,
23
+ FIX_ERRORS: (uuid) => `documents/${uuid}/actions/fix-errors`,
24
+ GENERATE_TEXT: (uuid) => `documents/${uuid}/actions/generate-text`,
25
+ EXPORT_AS_DOCX: (uuid) => `documents/${uuid}/export/docx`,
26
+ SET_REACTION: (uuid) => `documents/${uuid}/reaction`,
27
+ DISCARD_SOURCE: (uuid) => `sources/${uuid}/discard`,
28
+ };
@@ -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("./http"), 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("./controller"), exports);
18
+ __exportStar(require("./routes"), exports);