@purpleschool/multisite 0.0.2 → 0.0.4

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 (295) hide show
  1. package/api/controller/http/ai-proxy.ts +6 -0
  2. package/api/controller/http/auth.ts +14 -0
  3. package/api/controller/http/cloud-payments.ts +5 -0
  4. package/api/controller/http/file.ts +6 -0
  5. package/api/controller/http/health.ts +3 -0
  6. package/api/controller/http/image-editor.ts +15 -0
  7. package/api/controller/http/image-generation.ts +15 -0
  8. package/api/controller/http/index.ts +16 -0
  9. package/api/controller/http/marketplace-card.ts +15 -0
  10. package/api/controller/http/page-question.ts +9 -0
  11. package/api/controller/http/page.ts +12 -0
  12. package/api/controller/http/payment.ts +5 -0
  13. package/api/controller/http/product.ts +7 -0
  14. package/api/controller/http/subscription.ts +7 -0
  15. package/api/controller/http/transaction.ts +5 -0
  16. package/api/controller/http/unregistered-user.ts +1 -0
  17. package/api/controller/http/user.ts +5 -0
  18. package/api/controller/index.ts +1 -0
  19. package/api/index.ts +2 -0
  20. package/api/routes.ts +109 -0
  21. package/build/api/controller/http/index.d.ts +1 -0
  22. package/build/api/controller/http/index.d.ts.map +1 -1
  23. package/build/api/controller/http/index.js +1 -0
  24. package/build/api/controller/http/marketplace-card.d.ts +15 -0
  25. package/build/api/controller/http/marketplace-card.d.ts.map +1 -0
  26. package/build/api/controller/http/marketplace-card.js +17 -0
  27. package/build/api/routes.d.ts +23 -0
  28. package/build/api/routes.d.ts.map +1 -1
  29. package/build/api/routes.js +23 -0
  30. package/build/commands/index.d.ts +1 -0
  31. package/build/commands/index.d.ts.map +1 -1
  32. package/build/commands/index.js +1 -0
  33. package/build/commands/marketplace-card/execute-marketplace-card.command.d.ts +155 -0
  34. package/build/commands/marketplace-card/execute-marketplace-card.command.d.ts.map +1 -0
  35. package/build/commands/marketplace-card/execute-marketplace-card.command.js +12 -0
  36. package/build/commands/marketplace-card/index.d.ts +7 -0
  37. package/build/commands/marketplace-card/index.d.ts.map +1 -0
  38. package/build/commands/marketplace-card/index.js +22 -0
  39. package/build/commands/marketplace-card/retry-marketplace-card-job.command.d.ts +163 -0
  40. package/build/commands/marketplace-card/retry-marketplace-card-job.command.d.ts.map +1 -0
  41. package/build/commands/marketplace-card/retry-marketplace-card-job.command.js +25 -0
  42. package/build/commands/marketplace-card/set-reaction-to-marketplace-card-job.command.d.ts +143 -0
  43. package/build/commands/marketplace-card/set-reaction-to-marketplace-card-job.command.d.ts.map +1 -0
  44. package/build/commands/marketplace-card/set-reaction-to-marketplace-card-job.command.js +19 -0
  45. package/build/commands/marketplace-card/soft-delete-marketplace-card-job-by-uuid.command.d.ts +20 -0
  46. package/build/commands/marketplace-card/soft-delete-marketplace-card-job-by-uuid.command.d.ts.map +1 -0
  47. package/build/commands/marketplace-card/soft-delete-marketplace-card-job-by-uuid.command.js +13 -0
  48. package/build/commands/marketplace-card/soft-delete-marketplace-card-jobs-by-criteria.command.d.ts +12 -0
  49. package/build/commands/marketplace-card/soft-delete-marketplace-card-jobs-by-criteria.command.d.ts.map +1 -0
  50. package/build/commands/marketplace-card/soft-delete-marketplace-card-jobs-by-criteria.command.js +10 -0
  51. package/build/commands/marketplace-card/update-marketplace-card-job-title.command.d.ts +139 -0
  52. package/build/commands/marketplace-card/update-marketplace-card-job-title.command.d.ts.map +1 -0
  53. package/build/commands/marketplace-card/update-marketplace-card-job-title.command.js +17 -0
  54. package/build/constants/errors/errors.d.ts +90 -0
  55. package/build/constants/errors/errors.d.ts.map +1 -1
  56. package/build/constants/errors/errors.js +91 -0
  57. package/build/constants/tools/enums/index.d.ts +1 -0
  58. package/build/constants/tools/enums/index.d.ts.map +1 -1
  59. package/build/constants/tools/enums/index.js +1 -0
  60. package/build/constants/tools/enums/marketplace-card-strategy.enum.d.ts +7 -0
  61. package/build/constants/tools/enums/marketplace-card-strategy.enum.d.ts.map +1 -0
  62. package/build/constants/tools/enums/marketplace-card-strategy.enum.js +10 -0
  63. package/build/constants/tools/enums/tool-type.enum.d.ts +2 -1
  64. package/build/constants/tools/enums/tool-type.enum.d.ts.map +1 -1
  65. package/build/constants/tools/enums/tool-type.enum.js +1 -0
  66. package/build/models/index.d.ts +1 -0
  67. package/build/models/index.d.ts.map +1 -1
  68. package/build/models/index.js +1 -0
  69. package/build/models/marketplace-card/index.d.ts +7 -0
  70. package/build/models/marketplace-card/index.d.ts.map +1 -0
  71. package/build/models/marketplace-card/index.js +22 -0
  72. package/build/models/marketplace-card/marketplace-card-config.schema.d.ts +203 -0
  73. package/build/models/marketplace-card/marketplace-card-config.schema.d.ts.map +1 -0
  74. package/build/models/marketplace-card/marketplace-card-config.schema.js +10 -0
  75. package/build/models/marketplace-card/marketplace-card-job-request-params.schema.d.ts +34 -0
  76. package/build/models/marketplace-card/marketplace-card-job-request-params.schema.d.ts.map +1 -0
  77. package/build/models/marketplace-card/marketplace-card-job-request-params.schema.js +15 -0
  78. package/build/models/marketplace-card/marketplace-card-job.schema.d.ts +74 -0
  79. package/build/models/marketplace-card/marketplace-card-job.schema.d.ts.map +1 -0
  80. package/build/models/marketplace-card/marketplace-card-job.schema.js +28 -0
  81. package/build/models/marketplace-card/marketplace-card-model-params.schema.d.ts +30 -0
  82. package/build/models/marketplace-card/marketplace-card-model-params.schema.d.ts.map +1 -0
  83. package/build/models/marketplace-card/marketplace-card-model-params.schema.js +11 -0
  84. package/build/models/marketplace-card/marketplace-card-model.schema.d.ts +123 -0
  85. package/build/models/marketplace-card/marketplace-card-model.schema.d.ts.map +1 -0
  86. package/build/models/marketplace-card/marketplace-card-model.schema.js +15 -0
  87. package/build/models/marketplace-card/marketplace-card-style-preset.schema.d.ts +19 -0
  88. package/build/models/marketplace-card/marketplace-card-style-preset.schema.d.ts.map +1 -0
  89. package/build/models/marketplace-card/marketplace-card-style-preset.schema.js +10 -0
  90. package/build/queries/index.d.ts +1 -0
  91. package/build/queries/index.d.ts.map +1 -1
  92. package/build/queries/index.js +1 -0
  93. package/build/queries/marketplace-card/find-marketplace-card-jobs.command.d.ts +160 -0
  94. package/build/queries/marketplace-card/find-marketplace-card-jobs.command.d.ts.map +1 -0
  95. package/build/queries/marketplace-card/find-marketplace-card-jobs.command.js +21 -0
  96. package/build/queries/marketplace-card/get-marketplace-card-config.command.d.ts +273 -0
  97. package/build/queries/marketplace-card/get-marketplace-card-config.command.d.ts.map +1 -0
  98. package/build/queries/marketplace-card/get-marketplace-card-config.command.js +11 -0
  99. package/build/queries/marketplace-card/get-marketplace-card-job.command.d.ts +131 -0
  100. package/build/queries/marketplace-card/get-marketplace-card-job.command.d.ts.map +1 -0
  101. package/build/queries/marketplace-card/get-marketplace-card-job.command.js +14 -0
  102. package/build/queries/marketplace-card/get-marketplace-card-price.command.d.ts +30 -0
  103. package/build/queries/marketplace-card/get-marketplace-card-price.command.d.ts.map +1 -0
  104. package/build/queries/marketplace-card/get-marketplace-card-price.command.js +15 -0
  105. package/build/queries/marketplace-card/index.d.ts +5 -0
  106. package/build/queries/marketplace-card/index.d.ts.map +1 -0
  107. package/build/queries/marketplace-card/index.js +20 -0
  108. package/commands/auth/create-user.command.ts +18 -0
  109. package/commands/auth/index.ts +9 -0
  110. package/commands/auth/login.command.ts +17 -0
  111. package/commands/auth/register.command.ts +20 -0
  112. package/commands/auth/reset-password.command.ts +19 -0
  113. package/commands/auth/restore-password.command.ts +16 -0
  114. package/commands/auth/verify-email-retry.command.ts +17 -0
  115. package/commands/auth/verify-email.command.ts +18 -0
  116. package/commands/auth/vk-login.command.ts +21 -0
  117. package/commands/auth/yandex-login.command.ts +19 -0
  118. package/commands/file/index.ts +1 -0
  119. package/commands/file/upload-file.command.ts +9 -0
  120. package/commands/image-editor/execute-image-editor.command.ts +18 -0
  121. package/commands/image-editor/index.ts +7 -0
  122. package/commands/image-editor/proxy-image-editor-callback.command.ts +15 -0
  123. package/commands/image-editor/retry-image-editor-job.command.ts +17 -0
  124. package/commands/image-editor/set-reaction-to-image-editor-job.command.ts +18 -0
  125. package/commands/image-editor/soft-delete-image-editor-job-by-uuid.command.ts +8 -0
  126. package/commands/image-editor/soft-delete-image-editor-jobs-by-criteria.command.ts +8 -0
  127. package/commands/image-editor/update-image-editor-job-title.command.ts +16 -0
  128. package/commands/image-generation/execute-image-generation.command.ts +19 -0
  129. package/commands/image-generation/index.ts +7 -0
  130. package/commands/image-generation/proxy-image-generation-callback.command.ts +21 -0
  131. package/commands/image-generation/retry-image-generation-job.command.ts +19 -0
  132. package/commands/image-generation/set-reaction-to-image-generation-job.command.ts +28 -0
  133. package/commands/image-generation/soft-delete-image-generation-job-by-uuid.command.ts +9 -0
  134. package/commands/image-generation/soft-delete-image-generation-jobs-by-criteria.command.ts +9 -0
  135. package/commands/image-generation/update-image-generation-job-title.command.ts +16 -0
  136. package/commands/index.ts +11 -0
  137. package/commands/marketplace-card/execute-marketplace-card.command.ts +12 -0
  138. package/commands/marketplace-card/index.ts +6 -0
  139. package/commands/marketplace-card/retry-marketplace-card-job.command.ts +27 -0
  140. package/commands/marketplace-card/set-reaction-to-marketplace-card-job.command.ts +21 -0
  141. package/commands/marketplace-card/soft-delete-marketplace-card-job-by-uuid.command.ts +13 -0
  142. package/commands/marketplace-card/soft-delete-marketplace-card-jobs-by-criteria.command.ts +8 -0
  143. package/commands/marketplace-card/update-marketplace-card-job-title.command.ts +19 -0
  144. package/commands/page/create-page-question.command.ts +18 -0
  145. package/commands/page/create-page.command.ts +18 -0
  146. package/commands/page/delete-page-question.command.ts +14 -0
  147. package/commands/page/delete-page.command.ts +12 -0
  148. package/commands/page/find-page-by-alias.command.ts +28 -0
  149. package/commands/page/find-page-by-criteria.command.ts +24 -0
  150. package/commands/page/find-page.command.ts +22 -0
  151. package/commands/page/index.ts +9 -0
  152. package/commands/page/update-page-question.command.ts +24 -0
  153. package/commands/page/update-page.command.ts +24 -0
  154. package/commands/payment/cloud-payments.command.ts +53 -0
  155. package/commands/payment/index.ts +1 -0
  156. package/commands/product/buy-product.command.ts +19 -0
  157. package/commands/product/index.ts +1 -0
  158. package/commands/subscription/buy-subscription.command.ts +19 -0
  159. package/commands/subscription/index.ts +1 -0
  160. package/commands/transaction/index.ts +1 -0
  161. package/commands/transaction/write-off.command.ts +19 -0
  162. package/commands/unregistered-user/index.ts +1 -0
  163. package/commands/unregistered-user/upsert-unregistered-user.command.ts +16 -0
  164. package/constants/common/enums/index.ts +1 -0
  165. package/constants/common/enums/user-reaction.enum.ts +4 -0
  166. package/constants/common/index.ts +1 -0
  167. package/constants/email/email-endpoint.ts +1 -0
  168. package/constants/email/index.ts +2 -0
  169. package/constants/email/subjects.ts +12 -0
  170. package/constants/errors/errors.ts +682 -0
  171. package/constants/errors/index.ts +1 -0
  172. package/constants/files/enums/file-type.enum.ts +3 -0
  173. package/constants/files/enums/index.ts +1 -0
  174. package/constants/files/index.ts +1 -0
  175. package/constants/image-editor/enums/image-editing-strategy.enum.ts +9 -0
  176. package/constants/image-editor/enums/image-editor-model-type.enum.ts +5 -0
  177. package/constants/image-editor/enums/index.ts +2 -0
  178. package/constants/image-editor/index.ts +1 -0
  179. package/constants/image-generation/enums/image-generation-model-strategy.enum.ts +15 -0
  180. package/constants/image-generation/enums/image-generation-resolution.enum.ts +5 -0
  181. package/constants/image-generation/enums/index.ts +2 -0
  182. package/constants/image-generation/index.ts +1 -0
  183. package/constants/index.ts +15 -0
  184. package/constants/order/enums/index.ts +2 -0
  185. package/constants/order/enums/order-status.enum.ts +5 -0
  186. package/constants/order/enums/order-type.enum.ts +3 -0
  187. package/constants/order/index.ts +1 -0
  188. package/constants/page/enums/page-type.enum.ts +5 -0
  189. package/constants/page/index.ts +1 -0
  190. package/constants/payment/enums/index.ts +1 -0
  191. package/constants/payment/enums/payment-status.enum.ts +3 -0
  192. package/constants/payment/index.ts +1 -0
  193. package/constants/subscription/free-subscription-id.constant.ts +1 -0
  194. package/constants/subscription/index.ts +1 -0
  195. package/constants/tools/enums/index.ts +5 -0
  196. package/constants/tools/enums/job-request-origin.enum.ts +3 -0
  197. package/constants/tools/enums/job-status.enum.ts +5 -0
  198. package/constants/tools/enums/marketplace-card-strategy.enum.ts +6 -0
  199. package/constants/tools/enums/tool-model-status.enum.ts +4 -0
  200. package/constants/tools/enums/tool-type.enum.ts +5 -0
  201. package/constants/tools/index.ts +1 -0
  202. package/constants/transaction/enums/index.ts +1 -0
  203. package/constants/transaction/enums/transaction-status.enum.ts +5 -0
  204. package/constants/transaction/index.ts +1 -0
  205. package/constants/user/enums/index.ts +3 -0
  206. package/constants/user/enums/signup-method.enum.ts +6 -0
  207. package/constants/user/enums/user-role.enum.ts +5 -0
  208. package/constants/user/enums/user-status.enum.ts +5 -0
  209. package/constants/user/index.ts +1 -0
  210. package/constants/user-to-product/enums/index.ts +1 -0
  211. package/constants/user-to-product/enums/user-to-product-status.enum.ts +3 -0
  212. package/constants/user-to-product/index.ts +1 -0
  213. package/constants/user-to-subscription/enums/index.ts +1 -0
  214. package/constants/user-to-subscription/enums/user-to-subscription-status.enum.ts +3 -0
  215. package/constants/user-to-subscription/index.ts +1 -0
  216. package/index.ts +5 -0
  217. package/models/cloud-payments-widget-data.schema.ts +18 -0
  218. package/models/cloud-payments-widget.schema.ts +15 -0
  219. package/models/common/attached-file.schema.ts +13 -0
  220. package/models/common/icon-variants.schema.ts +12 -0
  221. package/models/common/index.ts +4 -0
  222. package/models/common/json-value.schema.ts +10 -0
  223. package/models/common/receipt.schema.ts +19 -0
  224. package/models/file.schema.ts +13 -0
  225. package/models/image-editor/image-editor-config.schema.ts +10 -0
  226. package/models/image-editor/image-editor-job-params.schema.ts +12 -0
  227. package/models/image-editor/image-editor-job-request-params.schema.ts +9 -0
  228. package/models/image-editor/image-editor-job.schema.ts +30 -0
  229. package/models/image-editor/image-editor-model-params.schema.ts +18 -0
  230. package/models/image-editor/image-editor-model.schema.ts +28 -0
  231. package/models/image-editor/image-editor-pricing-rule.schema.ts +14 -0
  232. package/models/image-editor/image-editor-prompt-group.schema.ts +13 -0
  233. package/models/image-editor/image-editor-system-prompt.schema.ts +20 -0
  234. package/models/image-editor/index.ts +9 -0
  235. package/models/image-generation/image-generation-config.schema.ts +10 -0
  236. package/models/image-generation/image-generation-job-attempt.schema.ts +11 -0
  237. package/models/image-generation/image-generation-job-params.schema.ts +11 -0
  238. package/models/image-generation/image-generation-job-request-params.schema.ts +10 -0
  239. package/models/image-generation/image-generation-job.schema.ts +30 -0
  240. package/models/image-generation/image-generation-model-params.schema.ts +22 -0
  241. package/models/image-generation/image-generation-model.schema.ts +28 -0
  242. package/models/image-generation/image-generation-preset.schema.ts +10 -0
  243. package/models/image-generation/image-generation-pricing-rule.schema.ts +19 -0
  244. package/models/image-generation/image-generation-vendor.schema.ts +9 -0
  245. package/models/image-generation/index.ts +10 -0
  246. package/models/index.ts +13 -0
  247. package/models/marketplace-card/index.ts +6 -0
  248. package/models/marketplace-card/marketplace-card-config.schema.ts +10 -0
  249. package/models/marketplace-card/marketplace-card-job-request-params.schema.ts +15 -0
  250. package/models/marketplace-card/marketplace-card-job.schema.ts +28 -0
  251. package/models/marketplace-card/marketplace-card-model-params.schema.ts +11 -0
  252. package/models/marketplace-card/marketplace-card-model.schema.ts +16 -0
  253. package/models/marketplace-card/marketplace-card-style-preset.schema.ts +10 -0
  254. package/models/page-question.schema.ts +10 -0
  255. package/models/page.schema.ts +40 -0
  256. package/models/product.schema.ts +10 -0
  257. package/models/subscription.schema.ts +12 -0
  258. package/models/tools/index.ts +1 -0
  259. package/models/tools/vendor.schema.ts +11 -0
  260. package/models/user.schema.ts +11 -0
  261. package/package.json +1 -7
  262. package/queries/file/find-files.command.ts +20 -0
  263. package/queries/file/get-file.command.ts +14 -0
  264. package/queries/file/index.ts +2 -0
  265. package/queries/image-editor/find-image-editor-jobs.command.ts +20 -0
  266. package/queries/image-editor/get-image-editor-config.command.ts +9 -0
  267. package/queries/image-editor/get-image-editor-job.command.ts +14 -0
  268. package/queries/image-editor/get-image-editor-price.command.ts +17 -0
  269. package/queries/image-editor/index.ts +4 -0
  270. package/queries/image-generation/find-image-generation-jobs.command.ts +20 -0
  271. package/queries/image-generation/get-image-generation-config.command.ts +9 -0
  272. package/queries/image-generation/get-image-generation-job.command.ts +14 -0
  273. package/queries/image-generation/get-image-generation-price.command.ts +19 -0
  274. package/queries/image-generation/index.ts +4 -0
  275. package/queries/index.ts +9 -0
  276. package/queries/marketplace-card/find-marketplace-card-jobs.command.ts +21 -0
  277. package/queries/marketplace-card/get-marketplace-card-config.command.ts +9 -0
  278. package/queries/marketplace-card/get-marketplace-card-job.command.ts +14 -0
  279. package/queries/marketplace-card/get-marketplace-card-price.command.ts +15 -0
  280. package/queries/marketplace-card/index.ts +4 -0
  281. package/queries/page/find-all-page-questions.query.ts +14 -0
  282. package/queries/page/find-page-question-by-uuid.query.ts +16 -0
  283. package/queries/page/find-page-questions-by-page-id.query.ts +16 -0
  284. package/queries/page/index.ts +3 -0
  285. package/queries/payment/get-payment-history.command.ts +17 -0
  286. package/queries/payment/index.ts +1 -0
  287. package/queries/product/find-products.command.ts +9 -0
  288. package/queries/product/index.ts +1 -0
  289. package/queries/subscription/find-subscriptions.command.ts +9 -0
  290. package/queries/subscription/index.ts +1 -0
  291. package/queries/user/get-my-products.command.ts +19 -0
  292. package/queries/user/get-my-subscriptions.command.ts +21 -0
  293. package/queries/user/get-user.command.ts +14 -0
  294. package/queries/user/index.ts +3 -0
  295. package/tsconfig.json +104 -0
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { JsonValueSchema } from '../../models';
3
+
4
+ export namespace CloudPaymentsCheckCommand {
5
+ export const RequestSchema = z.object({
6
+ transactionId: z.union([z.string(), z.number()]).optional(),
7
+ amount: z.union([z.string(), z.number()]),
8
+ paymentAmount: z.union([z.string(), z.number()]),
9
+ currency: z.string(),
10
+ paymentCurrency: z.string(),
11
+ invoiceId: z.string().optional(),
12
+ accountId: z.string().optional(),
13
+ data: z.string().optional(),
14
+ });
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
17
+ export const ResponseSchema = z.object({
18
+ code: z.number(),
19
+ });
20
+ export type Response = z.infer<typeof ResponseSchema>;
21
+ }
22
+
23
+ export namespace CloudPaymentsPayCommand {
24
+ export const RequestSchema = z.object({
25
+ transactionId: z.number().optional(),
26
+ amount: z.number(),
27
+ currency: z.string().optional().default('RUB'),
28
+ paymentAmount: z.union([z.string(), z.number()]).optional(),
29
+ paymentCurrency: z.string().optional(),
30
+ invoiceId: z.string().optional(),
31
+ accountId: z.string(),
32
+ subscriptionId: z.string().optional(),
33
+ data: JsonValueSchema.optional(),
34
+ });
35
+ export type Request = z.infer<typeof RequestSchema>;
36
+
37
+ export const ResponseSchema = z.object({ code: z.number() });
38
+ export type Response = z.infer<typeof ResponseSchema>;
39
+ }
40
+
41
+ export namespace CloudPaymentsRecurrentCommand {
42
+ export const RequestSchema = z.object({
43
+ id: z.string(),
44
+ accountId: z.string(),
45
+ status: z.string(),
46
+ failedTransactionsNumber: z.number().optional(),
47
+ lastTransactionDate: z.string().optional(),
48
+ });
49
+ export type Request = z.infer<typeof RequestSchema>;
50
+
51
+ export const ResponseSchema = z.object({ code: z.number() });
52
+ export type Response = z.infer<typeof ResponseSchema>;
53
+ }
@@ -0,0 +1 @@
1
+ export * from './cloud-payments.command';
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { CloudPaymentsWidgetSchema } from '../../models';
3
+
4
+ export namespace BuyProductCommand {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
9
+
10
+ export const RequestSchema = z.object({
11
+ promocode: z.string().min(1).max(64).optional(),
12
+ });
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: CloudPaymentsWidgetSchema,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1 @@
1
+ export * from './buy-product.command';
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { CloudPaymentsWidgetSchema } from '../../models';
3
+
4
+ export namespace BuySubscriptionCommand {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
9
+
10
+ export const RequestSchema = z.object({
11
+ promocode: z.string().min(1).max(64).optional(),
12
+ });
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: CloudPaymentsWidgetSchema,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1 @@
1
+ export * from './buy-subscription.command';
@@ -0,0 +1 @@
1
+ export * from './write-off.command';
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { TRANSACTION_STATUS } from '../../constants';
3
+
4
+ export namespace WriteOffCommand {
5
+ export const RequestSchema = z.object({
6
+ sum: z.number().int().positive(),
7
+ description: z.string().min(1).max(500).default('Использование токенов'),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.object({
13
+ transactionId: z.string().uuid(),
14
+ status: z.nativeEnum(TRANSACTION_STATUS),
15
+ remainingSum: z.number().int(),
16
+ }),
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1 @@
1
+ export * from './upsert-unregistered-user.command';
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace UpsertUnregisteredUserCommand {
4
+ export const RequestSchema = z.object({});
5
+ export type Request = z.infer<typeof RequestSchema>;
6
+
7
+ export const ResponseSchema = z.object({
8
+ data: z.object({
9
+ unregisteredUserId: z.string().uuid(),
10
+ accessToken: z.string(),
11
+ tokenBalance: z.number().int(),
12
+ expiresAt: z.coerce.date(),
13
+ }),
14
+ });
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1 @@
1
+ export * from './user-reaction.enum';
@@ -0,0 +1,4 @@
1
+ export enum USER_REACTION {
2
+ LIKE = 'like',
3
+ DISLIKE = 'dislike',
4
+ }
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -0,0 +1 @@
1
+ export const EmailEndpoint = 'https://api.rusender.ru/v1/email/send';
@@ -0,0 +1,2 @@
1
+ export * from './subjects';
2
+ export * from './email-endpoint';
@@ -0,0 +1,12 @@
1
+ export const EMAIL_SUBJECTS = {
2
+ EMAIL_VERIFICATION: 'Подтверждение email',
3
+ WELCOME: 'Добро пожаловать',
4
+ RESTORE_PASSWORD: 'Восстановление пароля',
5
+ FAST_REGISTRATION: 'Быстрая регистрация',
6
+ PRODUCT_PURCHASE: 'Покупка продукта',
7
+ RECURRENT_PAYMENT_FAILED: 'Ошибка повторного платежа',
8
+ SUBSCRIPTION_PURCHASE: 'Оформление подписки',
9
+ SUBSCRIPTION_BEFORE_CANCEL: 'Подписка будет отменена',
10
+ SUBSCRIPTION_RENEWAL_REMINDER: 'Напоминание о продлении подписки',
11
+ SUBSCRIPTION_CANCEL: 'Подписка отменена',
12
+ } as const;