@purpleschool/gptbot 0.9.97 → 0.10.0

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 (332) hide show
  1. package/api/controllers/http/auth.ts +1 -0
  2. package/api/controllers/http/b2b.ts +1 -0
  3. package/api/controllers/http/index.ts +4 -0
  4. package/api/controllers/http/interior-design.ts +14 -0
  5. package/api/controllers/http/marketplace-card.ts +14 -0
  6. package/api/controllers/http/page.ts +2 -0
  7. package/api/controllers/http/payment.ts +1 -0
  8. package/api/controllers/http/solving-edu-task.ts +14 -0
  9. package/api/controllers/http/subscription.ts +1 -1
  10. package/api/controllers/http/team-account.ts +21 -0
  11. package/api/routes.ts +121 -2
  12. package/build/api/controllers/http/auth.js +1 -0
  13. package/build/api/controllers/http/b2b.js +1 -0
  14. package/build/api/controllers/http/index.js +4 -0
  15. package/build/api/controllers/http/interior-design.js +16 -0
  16. package/build/api/controllers/http/marketplace-card.js +16 -0
  17. package/build/api/controllers/http/page.js +2 -0
  18. package/build/api/controllers/http/payment.js +1 -0
  19. package/build/api/controllers/http/solving-edu-task.js +16 -0
  20. package/build/api/controllers/http/subscription.js +1 -1
  21. package/build/api/controllers/http/team-account.js +23 -0
  22. package/build/api/routes.js +91 -2
  23. package/build/commands/b2b/get-b2b-documentation.command.js +99 -0
  24. package/build/commands/b2b/index.js +2 -0
  25. package/build/commands/b2b/send-text-request.command.js +2 -5
  26. package/build/commands/b2b/upload-b2b-file.command.js +12 -0
  27. package/build/commands/cabinet/get-user-statistics-by-month.command.js +4 -0
  28. package/build/commands/chat/archive-all.command.js +1 -4
  29. package/build/commands/chat/check-limit.command.js +7 -0
  30. package/build/commands/chat/create-chat.command.js +0 -1
  31. package/build/commands/chat/find-chats.command.js +1 -1
  32. package/build/commands/chat/get-last-active-chat-command.js +0 -1
  33. package/build/commands/index.js +3 -0
  34. package/build/commands/message/create-text-message.command.js +1 -0
  35. package/build/commands/page/find-pages-by-criteria.command.js +36 -0
  36. package/build/commands/page/index.js +1 -0
  37. package/build/commands/payment/find-payments-by-criteria.command.js +53 -0
  38. package/build/commands/payment/index.js +1 -0
  39. package/build/commands/product/buy-product.command.js +25 -1
  40. package/build/commands/subscription/buy-subscription.command.js +24 -1
  41. package/build/commands/subscription/index.js +0 -1
  42. package/build/commands/subscription/upgrade-subscription.command.js +25 -1
  43. package/build/commands/team-account/accept-team-account-invite.command.js +14 -0
  44. package/build/commands/team-account/create-manual-team-product.command.js +15 -0
  45. package/build/commands/team-account/create-manual-team-subscription.command.js +16 -0
  46. package/build/commands/team-account/create-team-account.command.js +16 -0
  47. package/build/commands/team-account/find-current-team-account-products.command.js +11 -0
  48. package/build/commands/team-account/find-current-team-account-subscriptions.command.js +11 -0
  49. package/build/commands/team-account/find-team-account-members.command.js +11 -0
  50. package/build/commands/team-account/find-team-account-operations.command.js +15 -0
  51. package/build/commands/team-account/find-team-account-products.command.js +11 -0
  52. package/build/commands/team-account/find-team-account-subscriptions.command.js +11 -0
  53. package/build/commands/team-account/find-team-accounts-by-name.command.js +18 -0
  54. package/build/commands/team-account/get-my-team-account.command.js +11 -0
  55. package/build/commands/team-account/get-team-account-balance.command.js +15 -0
  56. package/build/commands/team-account/index.js +33 -0
  57. package/build/commands/team-account/invite-team-account-member.command.js +17 -0
  58. package/build/commands/team-account/refund-team-account-balance.command.js +14 -0
  59. package/build/commands/team-account/remove-team-account-member.command.js +15 -0
  60. package/build/commands/team-account/update-team-account-member.command.js +23 -0
  61. package/build/commands/team-account/update-team-account.command.js +18 -0
  62. package/build/commands/team-to-product/add-team-to-product.command.js +16 -0
  63. package/build/commands/team-to-product/get-team-to-product-by-uuid.command.js +14 -0
  64. package/build/commands/team-to-product/get-team-to-products.command.js +14 -0
  65. package/build/commands/team-to-product/index.js +20 -0
  66. package/build/commands/team-to-product/update-team-to-product.command.js +21 -0
  67. package/build/commands/team-to-subscription/add-team-to-subscription.command.js +20 -0
  68. package/build/commands/team-to-subscription/get-team-to-subscription-by-uuid.command.js +14 -0
  69. package/build/commands/team-to-subscription/get-team-to-subscriptions.command.js +14 -0
  70. package/build/commands/team-to-subscription/index.js +20 -0
  71. package/build/commands/team-to-subscription/update-team-to-subscription.command.js +31 -0
  72. package/build/commands/tools/image-editor/image-editor.command.js +1 -0
  73. package/build/commands/tools/image-editor/retry-image-editor-job.command.js +1 -0
  74. package/build/commands/tools/index.js +3 -0
  75. package/build/commands/tools/interior-design/delete-all-interior-design-jobs.command.js +8 -0
  76. package/build/commands/tools/interior-design/delete-interior-design-job-by-uuid.command.js +11 -0
  77. package/build/commands/tools/interior-design/find-interior-design-job-by-uuid.command.js +14 -0
  78. package/build/commands/tools/interior-design/find-interior-design-jobs.command.js +18 -0
  79. package/build/commands/tools/interior-design/get-interior-design-tool-config.command.js +11 -0
  80. package/build/commands/tools/interior-design/index.js +25 -0
  81. package/build/commands/tools/interior-design/interior-design.command.js +20 -0
  82. package/build/commands/tools/interior-design/retry-interior-design-job.command.js +25 -0
  83. package/build/commands/tools/interior-design/set-reaction-to-interior-design-job.command.js +28 -0
  84. package/build/commands/tools/interior-design/update-interior-design-job-title.command.js +17 -0
  85. package/build/commands/tools/marketplace-card/delete-all-marketplace-card-jobs.command.js +10 -0
  86. package/build/commands/tools/marketplace-card/delete-marketplace-card-by-uuid.command.js +13 -0
  87. package/build/commands/tools/marketplace-card/execute-marketplace-card.command.js +48 -0
  88. package/build/commands/tools/marketplace-card/find-marketplace-card-job-by-uuid.command.js +14 -0
  89. package/build/commands/tools/marketplace-card/find-marketplace-card-jobs.command.js +18 -0
  90. package/build/commands/tools/marketplace-card/get-marketplace-card-config.command.js +11 -0
  91. package/build/commands/tools/marketplace-card/index.js +25 -0
  92. package/build/commands/tools/marketplace-card/retry-marketplace-card-job.command.js +51 -0
  93. package/build/commands/tools/marketplace-card/set-reaction-to-marketplace-card.command.js +28 -0
  94. package/build/commands/tools/marketplace-card/update-marketplace-card-job-title.command.js +17 -0
  95. package/build/commands/tools/solving-edu-task/delete-all-solving-edu-task-jobs.command.js +10 -0
  96. package/build/commands/tools/solving-edu-task/delete-solving-edu-task-job-by-uuid.command.js +13 -0
  97. package/build/commands/tools/solving-edu-task/find-solving-edu-task-job-by-uuid.command.js +14 -0
  98. package/build/commands/tools/solving-edu-task/find-solving-edu-task-jobs.command.js +18 -0
  99. package/build/commands/tools/solving-edu-task/get-solving-edu-task-tool-config.command.js +11 -0
  100. package/build/commands/tools/solving-edu-task/index.js +25 -0
  101. package/build/commands/tools/solving-edu-task/retry-solving-edu-task-job.command.js +23 -0
  102. package/build/commands/tools/solving-edu-task/set-reaction-to-solving-edu-task-job.command.js +28 -0
  103. package/build/commands/tools/solving-edu-task/solving-edu-task.command.js +30 -0
  104. package/build/commands/tools/solving-edu-task/update-solving-edu-task-job-title.command.js +17 -0
  105. package/build/commands/user/get-me.command.js +2 -1
  106. package/build/commands/user/get-user-payments.command.js +3 -1
  107. package/build/constants/ai-model/enums/index.js +0 -1
  108. package/build/constants/billing/enums/billing-scope.enum.js +8 -0
  109. package/build/constants/{errors → billing/enums}/index.js +1 -2
  110. package/build/constants/billing/index.js +17 -0
  111. package/build/constants/cabinet/enums/index.js +1 -0
  112. package/build/constants/cabinet/enums/statistics-metric-type.enum.js +8 -0
  113. package/build/constants/index.js +2 -1
  114. package/build/constants/model/enums/unified-model-content-type.enum.js +2 -1
  115. package/build/constants/page/enums/index.js +1 -0
  116. package/build/constants/page/enums/page-sort-by.enum.js +8 -0
  117. package/build/constants/payment/enums/index.js +1 -0
  118. package/build/constants/payment/enums/payment-provider.enum.js +8 -0
  119. package/build/constants/subscription/enums/subscription-feature-type.enum.js +5 -1
  120. package/build/constants/subscription/enums/user-to-subscription-marks.enum.js +1 -0
  121. package/build/constants/team-account/enums/index.js +20 -0
  122. package/build/constants/team-account/enums/team-account-invite-status.enum.js +10 -0
  123. package/build/constants/team-account/enums/team-account-member-role.enum.js +9 -0
  124. package/build/constants/team-account/enums/team-account-member-status.enum.js +11 -0
  125. package/build/constants/team-account/enums/team-account-operation-type.enum.js +10 -0
  126. package/build/constants/team-account/index.js +17 -0
  127. package/build/constants/tool/enums/index.js +0 -1
  128. package/build/constants/transaction/enums/user-balance-status.enum.js +3 -0
  129. package/build/constants/ui-notification/enums/ui-notification-type.enum.js +1 -0
  130. package/build/constants/user/enums/user-status.js +1 -0
  131. package/build/helpers/index.js +1 -0
  132. package/build/helpers/interior-design/calculate-interior-design-price.helper.js +13 -0
  133. package/build/helpers/interior-design/index.js +17 -0
  134. package/build/models/ai-model.schema.js +0 -1
  135. package/build/models/b2b/b2b-completions-stream-chunk.schema.js +10 -0
  136. package/build/models/b2b/b2b-file-upload-response.schema.js +11 -0
  137. package/build/models/b2b/index.js +18 -0
  138. package/build/models/chat.schema.js +1 -1
  139. package/build/models/community/community-post-media-data.schema.js +1 -0
  140. package/build/models/index.js +3 -0
  141. package/build/models/json-value.schema.js +13 -0
  142. package/build/models/message.schema.js +1 -0
  143. package/build/models/payment.schema.js +8 -3
  144. package/build/models/product.schema.js +2 -0
  145. package/build/models/prompt.schema.js +0 -2
  146. package/build/models/subscription-feature.schema.js +24 -3
  147. package/build/models/subscription.schema.js +1 -0
  148. package/build/models/team-account/index.js +22 -0
  149. package/build/models/team-account/team-account-invite.schema.js +20 -0
  150. package/build/models/team-account/team-account-member.schema.js +17 -0
  151. package/build/models/team-account/team-account-operation.schema.js +12 -0
  152. package/build/models/team-account/team-account.schema.js +14 -0
  153. package/build/models/team-account/team-to-product.schema.js +21 -0
  154. package/build/models/team-account/team-to-subscription.schema.js +31 -0
  155. package/build/models/tools/image-editor/image-editor-job.schema.js +1 -0
  156. package/build/models/tools/image-editor/image-editor-model.schema.js +6 -0
  157. package/build/models/tools/image-generation/image-generation-model.schema.js +8 -5
  158. package/build/models/tools/index.js +3 -0
  159. package/build/models/tools/interior-design/index.js +19 -0
  160. package/build/models/tools/interior-design/interior-design-config.schema.js +23 -0
  161. package/build/models/tools/interior-design/interior-design-job.schema.js +27 -0
  162. package/build/models/tools/interior-design/interior-design-model.schema.js +34 -0
  163. package/build/models/tools/marketplace-card/index.js +18 -0
  164. package/build/models/tools/marketplace-card/marketplace-card-config.schema.js +30 -0
  165. package/build/models/tools/marketplace-card/marketplace-card-job.schema.js +24 -0
  166. package/build/models/tools/solving-edu-task/index.js +19 -0
  167. package/build/models/tools/solving-edu-task/solving-edu-task-config.schema.js +8 -0
  168. package/build/models/tools/solving-edu-task/solving-edu-task-job.schema.js +25 -0
  169. package/build/models/tools/solving-edu-task/solving-edu-task-model.schema.js +22 -0
  170. package/build/models/tools/video-editor/video-editor-job.schema.js +14 -1
  171. package/build/models/user-profile.schema.js +1 -0
  172. package/commands/b2b/get-b2b-documentation.command.ts +121 -0
  173. package/commands/b2b/index.ts +2 -0
  174. package/commands/b2b/send-text-request.command.ts +2 -5
  175. package/commands/b2b/upload-b2b-file.command.ts +14 -0
  176. package/commands/cabinet/get-user-statistics-by-month.command.ts +5 -1
  177. package/commands/chat/archive-all.command.ts +2 -4
  178. package/commands/chat/check-limit.command.ts +7 -0
  179. package/commands/chat/create-chat.command.ts +0 -1
  180. package/commands/chat/find-chats.command.ts +2 -5
  181. package/commands/chat/get-last-active-chat-command.ts +0 -1
  182. package/commands/index.ts +3 -0
  183. package/commands/message/create-text-message.command.ts +1 -0
  184. package/commands/page/find-pages-by-criteria.command.ts +50 -0
  185. package/commands/page/index.ts +1 -0
  186. package/commands/payment/find-payments-by-criteria.command.ts +63 -0
  187. package/commands/payment/index.ts +1 -0
  188. package/commands/product/buy-product.command.ts +27 -1
  189. package/commands/subscription/buy-subscription.command.ts +26 -1
  190. package/commands/subscription/index.ts +0 -1
  191. package/commands/subscription/upgrade-subscription.command.ts +27 -1
  192. package/commands/team-account/accept-team-account-invite.command.ts +16 -0
  193. package/commands/team-account/create-manual-team-product.command.ts +17 -0
  194. package/commands/team-account/create-manual-team-subscription.command.ts +18 -0
  195. package/commands/team-account/create-team-account.command.ts +18 -0
  196. package/commands/team-account/find-current-team-account-products.command.ts +10 -0
  197. package/commands/team-account/find-current-team-account-subscriptions.command.ts +10 -0
  198. package/commands/team-account/find-team-account-members.command.ts +10 -0
  199. package/commands/team-account/find-team-account-operations.command.ts +17 -0
  200. package/commands/team-account/find-team-account-products.command.ts +10 -0
  201. package/commands/team-account/find-team-account-subscriptions.command.ts +10 -0
  202. package/commands/team-account/find-team-accounts-by-name.command.ts +20 -0
  203. package/commands/team-account/get-my-team-account.command.ts +10 -0
  204. package/commands/team-account/get-team-account-balance.command.ts +14 -0
  205. package/commands/team-account/index.ts +17 -0
  206. package/commands/team-account/invite-team-account-member.command.ts +19 -0
  207. package/commands/team-account/refund-team-account-balance.command.ts +16 -0
  208. package/commands/team-account/remove-team-account-member.command.ts +17 -0
  209. package/commands/team-account/update-team-account-member.command.ts +25 -0
  210. package/commands/team-account/update-team-account.command.ts +24 -0
  211. package/commands/team-to-product/add-team-to-product.command.ts +18 -0
  212. package/commands/team-to-product/get-team-to-product-by-uuid.command.ts +16 -0
  213. package/commands/team-to-product/get-team-to-products.command.ts +16 -0
  214. package/commands/team-to-product/index.ts +4 -0
  215. package/commands/team-to-product/update-team-to-product.command.ts +26 -0
  216. package/commands/team-to-subscription/add-team-to-subscription.command.ts +22 -0
  217. package/commands/team-to-subscription/get-team-to-subscription-by-uuid.command.ts +16 -0
  218. package/commands/team-to-subscription/get-team-to-subscriptions.command.ts +16 -0
  219. package/commands/team-to-subscription/index.ts +4 -0
  220. package/commands/team-to-subscription/update-team-to-subscription.command.ts +36 -0
  221. package/commands/tools/image-editor/image-editor.command.ts +1 -0
  222. package/commands/tools/image-editor/retry-image-editor-job.command.ts +1 -0
  223. package/commands/tools/index.ts +3 -0
  224. package/commands/tools/interior-design/delete-all-interior-design-jobs.command.ts +6 -0
  225. package/commands/tools/interior-design/delete-interior-design-job-by-uuid.command.ts +11 -0
  226. package/commands/tools/interior-design/find-interior-design-job-by-uuid.command.ts +16 -0
  227. package/commands/tools/interior-design/find-interior-design-jobs.command.ts +18 -0
  228. package/commands/tools/interior-design/get-interior-design-tool-config.command.ts +10 -0
  229. package/commands/tools/interior-design/index.ts +9 -0
  230. package/commands/tools/interior-design/interior-design.command.ts +21 -0
  231. package/commands/tools/interior-design/retry-interior-design-job.command.ts +27 -0
  232. package/commands/tools/interior-design/set-reaction-to-interior-design-job.command.ts +33 -0
  233. package/commands/tools/interior-design/update-interior-design-job-title.command.ts +19 -0
  234. package/commands/tools/marketplace-card/delete-all-marketplace-card-jobs.command.ts +8 -0
  235. package/commands/tools/marketplace-card/delete-marketplace-card-by-uuid.command.ts +13 -0
  236. package/commands/tools/marketplace-card/execute-marketplace-card.command.ts +53 -0
  237. package/commands/tools/marketplace-card/find-marketplace-card-job-by-uuid.command.ts +16 -0
  238. package/commands/tools/marketplace-card/find-marketplace-card-jobs.command.ts +18 -0
  239. package/commands/tools/marketplace-card/get-marketplace-card-config.command.ts +9 -0
  240. package/commands/tools/marketplace-card/index.ts +9 -0
  241. package/commands/tools/marketplace-card/retry-marketplace-card-job.command.ts +57 -0
  242. package/commands/tools/marketplace-card/set-reaction-to-marketplace-card.command.ts +33 -0
  243. package/commands/tools/marketplace-card/update-marketplace-card-job-title.command.ts +19 -0
  244. package/commands/tools/solving-edu-task/delete-all-solving-edu-task-jobs.command.ts +8 -0
  245. package/commands/tools/solving-edu-task/delete-solving-edu-task-job-by-uuid.command.ts +13 -0
  246. package/commands/tools/solving-edu-task/find-solving-edu-task-job-by-uuid.command.ts +16 -0
  247. package/commands/tools/solving-edu-task/find-solving-edu-task-jobs.command.ts +18 -0
  248. package/commands/tools/solving-edu-task/get-solving-edu-task-tool-config.command.ts +9 -0
  249. package/commands/tools/solving-edu-task/index.ts +9 -0
  250. package/commands/tools/solving-edu-task/retry-solving-edu-task-job.command.ts +25 -0
  251. package/commands/tools/solving-edu-task/set-reaction-to-solving-edu-task-job.command.ts +33 -0
  252. package/commands/tools/solving-edu-task/solving-edu-task.command.ts +31 -0
  253. package/commands/tools/solving-edu-task/update-solving-edu-task-job-title.command.ts +19 -0
  254. package/commands/user/get-me.command.ts +2 -1
  255. package/commands/user/get-user-payments.command.ts +4 -2
  256. package/constants/ai-model/enums/index.ts +0 -1
  257. package/constants/billing/enums/billing-scope.enum.ts +4 -0
  258. package/constants/billing/enums/index.ts +1 -0
  259. package/constants/billing/index.ts +1 -0
  260. package/constants/cabinet/enums/index.ts +1 -0
  261. package/constants/cabinet/enums/statistics-metric-type.enum.ts +4 -0
  262. package/constants/index.ts +2 -1
  263. package/constants/model/enums/unified-model-content-type.enum.ts +2 -1
  264. package/constants/page/enums/index.ts +1 -0
  265. package/constants/page/enums/page-sort-by.enum.ts +4 -0
  266. package/constants/payment/enums/index.ts +1 -0
  267. package/constants/payment/enums/payment-provider.enum.ts +4 -0
  268. package/constants/subscription/enums/subscription-feature-type.enum.ts +5 -1
  269. package/constants/subscription/enums/user-to-subscription-marks.enum.ts +1 -0
  270. package/constants/team-account/enums/index.ts +4 -0
  271. package/constants/team-account/enums/team-account-invite-status.enum.ts +6 -0
  272. package/constants/team-account/enums/team-account-member-role.enum.ts +5 -0
  273. package/constants/team-account/enums/team-account-member-status.enum.ts +7 -0
  274. package/constants/team-account/enums/team-account-operation-type.enum.ts +6 -0
  275. package/constants/team-account/index.ts +1 -0
  276. package/constants/tool/enums/index.ts +0 -1
  277. package/constants/transaction/enums/user-balance-status.enum.ts +3 -0
  278. package/constants/ui-notification/enums/ui-notification-type.enum.ts +1 -0
  279. package/constants/user/enums/user-status.ts +1 -0
  280. package/helpers/index.ts +1 -0
  281. package/helpers/interior-design/calculate-interior-design-price.helper.ts +23 -0
  282. package/helpers/interior-design/index.ts +1 -0
  283. package/models/ai-model.schema.ts +3 -7
  284. package/models/b2b/b2b-completions-stream-chunk.schema.ts +10 -0
  285. package/models/b2b/b2b-file-upload-response.schema.ts +14 -0
  286. package/models/b2b/index.ts +2 -0
  287. package/models/chat.schema.ts +1 -1
  288. package/models/community/community-post-media-data.schema.ts +1 -0
  289. package/models/index.ts +3 -0
  290. package/models/json-value.schema.ts +23 -0
  291. package/models/message.schema.ts +1 -0
  292. package/models/payment.schema.ts +7 -2
  293. package/models/product.schema.ts +2 -0
  294. package/models/prompt.schema.ts +0 -2
  295. package/models/subscription-feature.schema.ts +32 -7
  296. package/models/subscription.schema.ts +7 -1
  297. package/models/team-account/index.ts +6 -0
  298. package/models/team-account/team-account-invite.schema.ts +18 -0
  299. package/models/team-account/team-account-member.schema.ts +15 -0
  300. package/models/team-account/team-account-operation.schema.ts +10 -0
  301. package/models/team-account/team-account.schema.ts +12 -0
  302. package/models/team-account/team-to-product.schema.ts +20 -0
  303. package/models/team-account/team-to-subscription.schema.ts +33 -0
  304. package/models/tools/image-editor/image-editor-job.schema.ts +1 -0
  305. package/models/tools/image-editor/image-editor-model.schema.ts +9 -0
  306. package/models/tools/image-generation/image-generation-model.schema.ts +8 -5
  307. package/models/tools/index.ts +3 -0
  308. package/models/tools/interior-design/index.ts +3 -0
  309. package/models/tools/interior-design/interior-design-config.schema.ts +29 -0
  310. package/models/tools/interior-design/interior-design-job.schema.ts +32 -0
  311. package/models/tools/interior-design/interior-design-model.schema.ts +45 -0
  312. package/models/tools/marketplace-card/index.ts +2 -0
  313. package/models/tools/marketplace-card/marketplace-card-config.schema.ts +33 -0
  314. package/models/tools/marketplace-card/marketplace-card-job.schema.ts +25 -0
  315. package/models/tools/solving-edu-task/index.ts +3 -0
  316. package/models/tools/solving-edu-task/solving-edu-task-config.schema.ts +8 -0
  317. package/models/tools/solving-edu-task/solving-edu-task-job.schema.ts +28 -0
  318. package/models/tools/solving-edu-task/solving-edu-task-model.schema.ts +25 -0
  319. package/models/tools/video-editor/video-editor-job.schema.ts +14 -1
  320. package/models/user-profile.schema.ts +1 -0
  321. package/package.json +1 -1
  322. package/build/commands/subscription/create-custom-subscription-plan.command.js +0 -24
  323. package/build/constants/ai-model/enums/ai-model-content-type.enum.js +0 -7
  324. package/build/constants/errors/errors.js +0 -4376
  325. package/build/constants/errors/verbose.js +0 -9
  326. package/build/constants/tool/enums/tool-type.enum.js +0 -12
  327. package/commands/subscription/create-custom-subscription-plan.command.ts +0 -26
  328. package/constants/ai-model/enums/ai-model-content-type.enum.ts +0 -7
  329. package/constants/errors/errors.ts +0 -4416
  330. package/constants/errors/index.ts +0 -2
  331. package/constants/errors/verbose.ts +0 -7
  332. package/constants/tool/enums/tool-type.enum.ts +0 -8
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetB2bDocumentationCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const models_1 = require("../../models");
7
+ var GetB2bDocumentationCommand;
8
+ (function (GetB2bDocumentationCommand) {
9
+ GetB2bDocumentationCommand.HttpMethodSchema = zod_1.z.enum(['GET', 'POST', 'PATCH', 'DELETE']);
10
+ GetB2bDocumentationCommand.AuthTypeSchema = zod_1.z.enum(['jwt', 'apiKey', 'none']);
11
+ GetB2bDocumentationCommand.HeaderSchema = zod_1.z.object({
12
+ name: zod_1.z.string(),
13
+ required: zod_1.z.boolean(),
14
+ description: zod_1.z.string().optional(),
15
+ });
16
+ GetB2bDocumentationCommand.EndpointParamSchema = zod_1.z.object({
17
+ name: zod_1.z.string(),
18
+ required: zod_1.z.boolean(),
19
+ schemaRef: zod_1.z.string(),
20
+ });
21
+ GetB2bDocumentationCommand.EndpointBodySchema = zod_1.z.object({
22
+ schemaRef: zod_1.z.string(),
23
+ contentType: zod_1.z.string().optional(),
24
+ });
25
+ GetB2bDocumentationCommand.EndpointExampleSchema = zod_1.z.object({
26
+ title: zod_1.z.string(),
27
+ curl: zod_1.z.string().optional(),
28
+ curlTemplate: zod_1.z.string().optional(),
29
+ variables: zod_1.z
30
+ .array(zod_1.z.object({
31
+ name: zod_1.z.string(),
32
+ description: zod_1.z.string().optional(),
33
+ }))
34
+ .optional(),
35
+ request: models_1.JsonValueSchema.optional(),
36
+ response: models_1.JsonValueSchema.optional(),
37
+ });
38
+ GetB2bDocumentationCommand.EndpointSchema = zod_1.z.object({
39
+ id: zod_1.z.string(),
40
+ title: zod_1.z.string(),
41
+ description: zod_1.z.string().optional(),
42
+ method: GetB2bDocumentationCommand.HttpMethodSchema,
43
+ path: zod_1.z.string(),
44
+ auth: GetB2bDocumentationCommand.AuthTypeSchema,
45
+ headers: zod_1.z.array(GetB2bDocumentationCommand.HeaderSchema).optional(),
46
+ pathParams: zod_1.z.array(GetB2bDocumentationCommand.EndpointParamSchema).optional(),
47
+ requestBody: GetB2bDocumentationCommand.EndpointBodySchema.optional(),
48
+ responseBody: GetB2bDocumentationCommand.EndpointBodySchema.optional(),
49
+ notes: zod_1.z.array(zod_1.z.string()).optional(),
50
+ examples: zod_1.z.array(GetB2bDocumentationCommand.EndpointExampleSchema).optional(),
51
+ });
52
+ GetB2bDocumentationCommand.ErrorSchema = zod_1.z.object({
53
+ id: zod_1.z.string(),
54
+ httpStatus: zod_1.z.number().int().optional(),
55
+ message: zod_1.z.string(),
56
+ description: zod_1.z.string().optional(),
57
+ relatedEndpoints: zod_1.z.array(zod_1.z.string()).optional(),
58
+ });
59
+ GetB2bDocumentationCommand.JsonSchemaSchema = zod_1.z.object({
60
+ id: zod_1.z.string(),
61
+ title: zod_1.z.string().optional(),
62
+ jsonSchema: models_1.JsonObjectSchema,
63
+ });
64
+ GetB2bDocumentationCommand.SectionSchema = zod_1.z.object({
65
+ id: zod_1.z.string(),
66
+ title: zod_1.z.string(),
67
+ body: zod_1.z.string(),
68
+ });
69
+ const B2bDocTextModelSchema = models_1.AiModelSchema.omit({
70
+ createdAt: true,
71
+ updatedAt: true,
72
+ }).extend({
73
+ createdAt: zod_1.z.string(),
74
+ updatedAt: zod_1.z.string(),
75
+ aiModel: zod_1.z.string(),
76
+ });
77
+ const B2bDocImageModelSchema = models_1.ImageGenerationModelSchema.extend({
78
+ aiModel: zod_1.z.string(),
79
+ iconVariants: models_1.IconVariantsSchema,
80
+ });
81
+ GetB2bDocumentationCommand.ReferencesSchema = zod_1.z
82
+ .object({
83
+ textModels: zod_1.z.array(B2bDocTextModelSchema).optional(),
84
+ imageModels: zod_1.z.array(B2bDocImageModelSchema).optional(),
85
+ features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional(),
86
+ supportedFileMimeTypes: zod_1.z.array(zod_1.z.string()).optional(),
87
+ })
88
+ .partial()
89
+ .optional();
90
+ GetB2bDocumentationCommand.ResponseSchema = zod_1.z.object({
91
+ data: zod_1.z.object({
92
+ endpoints: zod_1.z.array(GetB2bDocumentationCommand.EndpointSchema),
93
+ errors: zod_1.z.array(GetB2bDocumentationCommand.ErrorSchema),
94
+ schemas: zod_1.z.array(GetB2bDocumentationCommand.JsonSchemaSchema),
95
+ extraSections: zod_1.z.array(GetB2bDocumentationCommand.SectionSchema),
96
+ references: GetB2bDocumentationCommand.ReferencesSchema,
97
+ }),
98
+ });
99
+ })(GetB2bDocumentationCommand || (exports.GetB2bDocumentationCommand = GetB2bDocumentationCommand = {}));
@@ -20,3 +20,5 @@ __exportStar(require("./send-text-request.command"), exports);
20
20
  __exportStar(require("./send-image-request.command"), exports);
21
21
  __exportStar(require("./submit-balance-top-up-form.command"), exports);
22
22
  __exportStar(require("./find-b2b-image-generation-job-by-uuid.command"), exports);
23
+ __exportStar(require("./get-b2b-documentation.command"), exports);
24
+ __exportStar(require("./upload-b2b-file.command"), exports);
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SendTextRequestCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../../constants");
6
+ const models_1 = require("../../models");
6
7
  var SendTextRequestCommand;
7
8
  (function (SendTextRequestCommand) {
8
9
  SendTextRequestCommand.BodySchema = zod_1.z.object({
@@ -14,9 +15,5 @@ var SendTextRequestCommand;
14
15
  SendTextRequestCommand.HeadersSchema = zod_1.z.object({
15
16
  'x-rugpt-key': zod_1.z.string(),
16
17
  });
17
- SendTextRequestCommand.ResponseSchema = zod_1.z.object({
18
- data: zod_1.z.object({
19
- text: zod_1.z.string(),
20
- }),
21
- });
18
+ SendTextRequestCommand.ResponseSchema = models_1.B2bCompletionsStreamChunkSchema;
22
19
  })(SendTextRequestCommand || (exports.SendTextRequestCommand = SendTextRequestCommand = {}));
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UploadB2bFileCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const b2b_file_upload_response_schema_1 = require("../../models/b2b/b2b-file-upload-response.schema");
6
+ var UploadB2bFileCommand;
7
+ (function (UploadB2bFileCommand) {
8
+ UploadB2bFileCommand.HeadersSchema = zod_1.z.object({
9
+ 'x-rugpt-key': zod_1.z.string(),
10
+ });
11
+ UploadB2bFileCommand.ResponseSchema = b2b_file_upload_response_schema_1.B2bFileUploadResponseSchema;
12
+ })(UploadB2bFileCommand || (exports.UploadB2bFileCommand = UploadB2bFileCommand = {}));
@@ -7,6 +7,10 @@ var GetUserStatisticsByMonthCommand;
7
7
  (function (GetUserStatisticsByMonthCommand) {
8
8
  GetUserStatisticsByMonthCommand.RequestSchema = zod_1.z.object({
9
9
  origin: zod_1.z.nativeEnum(constants_1.JOB_REQUEST_ORIGIN).default(constants_1.JOB_REQUEST_ORIGIN.API).optional(),
10
+ metric: zod_1.z
11
+ .nativeEnum(constants_1.STATISTICS_METRIC_TYPE)
12
+ .default(constants_1.STATISTICS_METRIC_TYPE.REQUESTS)
13
+ .optional(),
10
14
  });
11
15
  GetUserStatisticsByMonthCommand.UserStatisticsByMonthResponseSchema = zod_1.z.object({
12
16
  month: zod_1.z.string(),
@@ -2,11 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ArchiveAllCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../../constants");
6
5
  var ArchiveAllCommand;
7
6
  (function (ArchiveAllCommand) {
8
- ArchiveAllCommand.RequestSchema = zod_1.z.object({
9
- type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
10
- });
7
+ ArchiveAllCommand.RequestSchema = zod_1.z.void();
11
8
  ArchiveAllCommand.ResponseSchema = zod_1.z.void();
12
9
  })(ArchiveAllCommand || (exports.ArchiveAllCommand = ArchiveAllCommand = {}));
@@ -12,6 +12,13 @@ var CheckLimitCommand;
12
12
  productBalance: zod_1.z.number(),
13
13
  referralBonusBalance: zod_1.z.number(),
14
14
  carriedOverBalance: zod_1.z.number(),
15
+ teamAvailableBalance: zod_1.z
16
+ .object({
17
+ balance: zod_1.z.number(),
18
+ limit: zod_1.z.number().nullable(),
19
+ })
20
+ .optional(),
21
+ reservedTokenBalance: zod_1.z.number().optional(),
15
22
  }),
16
23
  });
17
24
  })(CheckLimitCommand || (exports.CheckLimitCommand = CheckLimitCommand = {}));
@@ -6,7 +6,6 @@ const zod_1 = require("zod");
6
6
  var CreateChatCommand;
7
7
  (function (CreateChatCommand) {
8
8
  CreateChatCommand.RequestSchema = models_1.ChatSchema.pick({
9
- aIModelId: true,
10
9
  categoryId: true,
11
10
  }).extend({
12
11
  folderId: zod_1.z.string().uuid().optional(),
@@ -10,7 +10,7 @@ var FindChatsCommand;
10
10
  offset: zod_1.z.coerce.number().min(0).default(0),
11
11
  title: zod_1.z.string().optional(),
12
12
  });
13
- const QuerySchema = zod_1.z.intersection(models_1.ChatSchema.pick({ categoryId: true, aIModelId: true }).partial(), models_1.AiModelSchema.pick({ contentType: true }).partial());
13
+ const QuerySchema = models_1.ChatSchema.pick({ categoryId: true, lastUsedAiModelId: true }).partial();
14
14
  FindChatsCommand.RequestQuerySchema = zod_1.z.intersection(QuerySchema, PaginationQuerySchema);
15
15
  FindChatsCommand.ResponseSchema = zod_1.z.object({
16
16
  data: zod_1.z.array(models_1.ChatSchema),
@@ -7,7 +7,6 @@ var GetLastActiveChatCommand;
7
7
  (function (GetLastActiveChatCommand) {
8
8
  GetLastActiveChatCommand.RequestQuerySchema = models_1.ChatSchema.pick({
9
9
  categoryId: true,
10
- aIModelId: true,
11
10
  });
12
11
  GetLastActiveChatCommand.Response = zod_1.z.object({
13
12
  data: models_1.ChatWithMessagesSchema,
@@ -58,3 +58,6 @@ __exportStar(require("./webmaster-click"), exports);
58
58
  __exportStar(require("./b2b"), exports);
59
59
  __exportStar(require("./community"), exports);
60
60
  __exportStar(require("./user-profile"), exports);
61
+ __exportStar(require("./team-account"), exports);
62
+ __exportStar(require("./team-to-subscription"), exports);
63
+ __exportStar(require("./team-to-product"), exports);
@@ -10,6 +10,7 @@ var CreateTextMessageCommand;
10
10
  text: zod_1.z.string(),
11
11
  files: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
12
12
  features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
13
+ aiModelId: zod_1.z.string().uuid(),
13
14
  });
14
15
  CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
15
16
  uuid: true,
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindPagesByCriteriaCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const constants_1 = require("../../constants");
6
+ const zod_1 = require("zod");
7
+ var FindPagesByCriteriaCommand;
8
+ (function (FindPagesByCriteriaCommand) {
9
+ FindPagesByCriteriaCommand.RequestSchema = zod_1.z.object({
10
+ title: zod_1.z.string().optional(),
11
+ type: zod_1.z.nativeEnum(constants_1.PageType).optional(),
12
+ toolId: zod_1.z.string().uuid().optional(),
13
+ toolModelId: zod_1.z.string().uuid().optional(),
14
+ toolTitle: zod_1.z.string().optional(),
15
+ sortBy: zod_1.z.nativeEnum(constants_1.PAGE_SORT_BY).optional(),
16
+ sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).default(constants_1.SORT_ORDER.DESC).optional(),
17
+ limit: zod_1.z.coerce.number().min(1),
18
+ offset: zod_1.z.coerce.number().min(0).default(0),
19
+ });
20
+ FindPagesByCriteriaCommand.ResponseSchema = zod_1.z.object({
21
+ data: zod_1.z.array(models_1.PageSchema),
22
+ page: zod_1.z.number(),
23
+ totalPages: zod_1.z.number(),
24
+ });
25
+ FindPagesByCriteriaCommand.PageWithRelationsSchema = models_1.PageSchema.extend({
26
+ category: zod_1.z.union([models_1.CategorySchema, zod_1.z.null()]),
27
+ aIModel: zod_1.z.union([models_1.AiModelSchema, zod_1.z.null()]),
28
+ tool: models_1.ToolSchema.nullable(),
29
+ questions: zod_1.z.array(models_1.QuestionSchema),
30
+ });
31
+ FindPagesByCriteriaCommand.ResponseWithRelationsSchema = zod_1.z.object({
32
+ data: zod_1.z.array(FindPagesByCriteriaCommand.PageWithRelationsSchema),
33
+ page: zod_1.z.number(),
34
+ totalPages: zod_1.z.number(),
35
+ });
36
+ })(FindPagesByCriteriaCommand || (exports.FindPagesByCriteriaCommand = FindPagesByCriteriaCommand = {}));
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./create-page.command"), exports);
18
18
  __exportStar(require("./delete-page.command"), exports);
19
19
  __exportStar(require("./find-page-by-alias.command"), exports);
20
+ __exportStar(require("./find-pages-by-criteria.command"), exports);
20
21
  __exportStar(require("./find-page.command"), exports);
21
22
  __exportStar(require("./update-page.command"), exports);
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindPaymentsByCriteriaCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const constants_1 = require("../../constants");
7
+ var FindPaymentsByCriteriaCommand;
8
+ (function (FindPaymentsByCriteriaCommand) {
9
+ FindPaymentsByCriteriaCommand.RequestSchema = zod_1.z.preprocess((input) => {
10
+ if (input && typeof input === 'object' && !Array.isArray(input)) {
11
+ const obj = Object.assign({}, input);
12
+ const onlyNormalize = ['createdAt', 'sum'];
13
+ const relevantBracketed = Object.keys(obj).some((key) => {
14
+ const match = key.match(/^(\w+)\[(\w+)\]$/);
15
+ return match && onlyNormalize.includes(match[1]);
16
+ });
17
+ if (!relevantBracketed) {
18
+ return obj;
19
+ }
20
+ const result = Object.assign({}, obj);
21
+ for (const key of Object.keys(obj)) {
22
+ const match = key.match(/^(\w+)\[(\w+)\]$/);
23
+ if (match && onlyNormalize.includes(match[1])) {
24
+ const [, outer, inner] = match;
25
+ result[outer] = result[outer] || {};
26
+ result[outer][inner] = obj[key];
27
+ delete result[key];
28
+ }
29
+ }
30
+ return result;
31
+ }
32
+ return input;
33
+ }, zod_1.z.object({
34
+ status: zod_1.z.nativeEnum(constants_1.PAYMENT_STATUS).optional(),
35
+ orderId: zod_1.z.string().optional(),
36
+ sum: models_1.NumberFilter.optional(),
37
+ userEmail: zod_1.z.string().optional(),
38
+ createdAt: models_1.DateFilter.optional(),
39
+ userId: zod_1.z.string().optional(),
40
+ signupMethod: zod_1.z.nativeEnum(constants_1.SIGNUP_METHOD).optional(),
41
+ vkId: zod_1.z.string().optional(),
42
+ yandexId: zod_1.z.string().optional(),
43
+ sortBy: zod_1.z.nativeEnum(constants_1.PAYMENT_SORT_BY).optional(),
44
+ sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).default(constants_1.SORT_ORDER.DESC).optional(),
45
+ limit: zod_1.z.coerce.number().min(1),
46
+ offset: zod_1.z.coerce.number().min(0).default(0),
47
+ }));
48
+ FindPaymentsByCriteriaCommand.ResponseSchema = zod_1.z.object({
49
+ data: zod_1.z.array(models_1.PaymentWithUserDataSchema),
50
+ page: zod_1.z.number(),
51
+ totalPages: zod_1.z.number(),
52
+ });
53
+ })(FindPaymentsByCriteriaCommand || (exports.FindPaymentsByCriteriaCommand = FindPaymentsByCriteriaCommand = {}));
@@ -20,3 +20,4 @@ __exportStar(require("./pay.command"), exports);
20
20
  __exportStar(require("./receipt.command"), exports);
21
21
  __exportStar(require("./recurrent.command"), exports);
22
22
  __exportStar(require("./refund-payment.command"), exports);
23
+ __exportStar(require("./find-payments-by-criteria.command"), exports);
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BuyProductCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const models_1 = require("../../models");
6
+ const constants_1 = require("../../constants");
6
7
  var BuyProductCommand;
7
8
  (function (BuyProductCommand) {
8
9
  BuyProductCommand.RequestParamSchema = models_1.ProductSchema.pick({
@@ -11,6 +12,8 @@ var BuyProductCommand;
11
12
  BuyProductCommand.RequestSchema = zod_1.z.object({
12
13
  useDiscount: zod_1.z.boolean(),
13
14
  promocode: zod_1.z.string().optional(),
15
+ provider: zod_1.z.nativeEnum(constants_1.PAYMENT_PROVIDER).optional().default(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
16
+ teamAccountPurchase: zod_1.z.boolean().optional().default(false),
14
17
  });
15
18
  const IReceiptOrderSchema = zod_1.z.object({
16
19
  items: zod_1.z.array(zod_1.z.object({
@@ -25,6 +28,7 @@ var BuyProductCommand;
25
28
  amounts: zod_1.z.object({
26
29
  electronic: zod_1.z.number(),
27
30
  }),
31
+ taxationSystem: zod_1.z.number().optional(),
28
32
  });
29
33
  BuyProductCommand.RequestFastSchema = zod_1.z
30
34
  .object({
@@ -42,6 +46,10 @@ var BuyProductCommand;
42
46
  .transform((date) => new Date(date))
43
47
  .optional(),
44
48
  marketingConsent: zod_1.z.boolean().default(false),
49
+ provider: zod_1.z
50
+ .nativeEnum(constants_1.PAYMENT_PROVIDER)
51
+ .optional()
52
+ .default(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
45
53
  })
46
54
  .refine((data) => {
47
55
  const hasAdmitadUid = !!data.admitadUid;
@@ -59,7 +67,7 @@ var BuyProductCommand;
59
67
  message: 'admitadClickDate cannot be in the future',
60
68
  path: ['admitadClickDate'],
61
69
  });
62
- BuyProductCommand.ResponseSchema = zod_1.z.object({
70
+ BuyProductCommand.CloudPaymentsResponseSchema = zod_1.z.object({
63
71
  publicId: zod_1.z.string(),
64
72
  amount: zod_1.z.number(),
65
73
  currency: zod_1.z.string(),
@@ -74,7 +82,23 @@ var BuyProductCommand;
74
82
  CustomerReceipt: IReceiptOrderSchema,
75
83
  }),
76
84
  }),
85
+ provider: zod_1.z.literal(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
77
86
  });
87
+ BuyProductCommand.ZenpaymentsResponseSchema = zod_1.z.object({
88
+ provider: zod_1.z.literal(constants_1.PAYMENT_PROVIDER.ZENPAYMENTS),
89
+ checkoutUrl: zod_1.z.string(),
90
+ orderNumber: zod_1.z.string(),
91
+ orderIdClient: zod_1.z.string().nullable(),
92
+ paymentAmount: zod_1.z.number(),
93
+ currencyCode: zod_1.z.string(),
94
+ customerEmail: zod_1.z.string(),
95
+ isSubscription: zod_1.z.boolean(),
96
+ createdAt: zod_1.z.string(),
97
+ });
98
+ BuyProductCommand.ResponseSchema = zod_1.z.discriminatedUnion('provider', [
99
+ BuyProductCommand.CloudPaymentsResponseSchema,
100
+ BuyProductCommand.ZenpaymentsResponseSchema,
101
+ ]);
78
102
  BuyProductCommand.ResponseFastSchema = zod_1.z.object({
79
103
  data: BuyProductCommand.ResponseSchema,
80
104
  restoreToken: zod_1.z.string(),
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BuySubscriptionCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const models_1 = require("../../models");
6
+ const constants_1 = require("../../constants");
6
7
  var BuySubscriptionCommand;
7
8
  (function (BuySubscriptionCommand) {
8
9
  BuySubscriptionCommand.RequestParamSchema = models_1.SubscriptionSchema.pick({
@@ -11,6 +12,8 @@ var BuySubscriptionCommand;
11
12
  BuySubscriptionCommand.RequestSchema = zod_1.z.object({
12
13
  useDiscount: zod_1.z.boolean(),
13
14
  promocode: zod_1.z.string().optional(),
15
+ provider: zod_1.z.nativeEnum(constants_1.PAYMENT_PROVIDER).optional().default(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
16
+ teamAccountPurchase: zod_1.z.boolean().optional().default(false),
14
17
  });
15
18
  BuySubscriptionCommand.RequestFastSchema = zod_1.z
16
19
  .object({
@@ -28,6 +31,10 @@ var BuySubscriptionCommand;
28
31
  .transform((date) => new Date(date))
29
32
  .optional(),
30
33
  marketingConsent: zod_1.z.boolean().default(false),
34
+ provider: zod_1.z
35
+ .nativeEnum(constants_1.PAYMENT_PROVIDER)
36
+ .optional()
37
+ .default(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
31
38
  })
32
39
  .refine((data) => {
33
40
  const hasAdmitadUid = !!data.admitadUid;
@@ -59,7 +66,7 @@ var BuySubscriptionCommand;
59
66
  electronic: zod_1.z.number(),
60
67
  }),
61
68
  });
62
- BuySubscriptionCommand.ResponseSchema = zod_1.z.object({
69
+ BuySubscriptionCommand.CloudPaymentsResponseSchema = zod_1.z.object({
63
70
  publicId: zod_1.z.string(),
64
71
  amount: zod_1.z.number(),
65
72
  currency: zod_1.z.string(),
@@ -80,7 +87,23 @@ var BuySubscriptionCommand;
80
87
  }),
81
88
  }),
82
89
  }),
90
+ provider: zod_1.z.literal(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
83
91
  });
92
+ BuySubscriptionCommand.ZenpaymentsResponseSchema = zod_1.z.object({
93
+ provider: zod_1.z.literal(constants_1.PAYMENT_PROVIDER.ZENPAYMENTS),
94
+ checkoutUrl: zod_1.z.string(),
95
+ orderNumber: zod_1.z.string(),
96
+ orderIdClient: zod_1.z.string().nullable(),
97
+ paymentAmount: zod_1.z.number(),
98
+ currencyCode: zod_1.z.string(),
99
+ customerEmail: zod_1.z.string(),
100
+ isSubscription: zod_1.z.boolean(),
101
+ createdAt: zod_1.z.string(),
102
+ });
103
+ BuySubscriptionCommand.ResponseSchema = zod_1.z.discriminatedUnion('provider', [
104
+ BuySubscriptionCommand.CloudPaymentsResponseSchema,
105
+ BuySubscriptionCommand.ZenpaymentsResponseSchema,
106
+ ]);
84
107
  BuySubscriptionCommand.ResponseFastSchema = zod_1.z.object({
85
108
  data: BuySubscriptionCommand.ResponseSchema,
86
109
  restoreToken: zod_1.z.string(),
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./buy-subscription.command"), exports);
18
18
  __exportStar(require("./cancel-subscription.command"), exports);
19
- __exportStar(require("./create-custom-subscription-plan.command"), exports);
20
19
  __exportStar(require("./create-subscription.command"), exports);
21
20
  __exportStar(require("./delete-subscription.command"), exports);
22
21
  __exportStar(require("./find-subscription.command"), exports);
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpgradeSubscriptionCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const models_1 = require("../../models");
6
+ const constants_1 = require("../../constants");
6
7
  var UpgradeSubscriptionCommand;
7
8
  (function (UpgradeSubscriptionCommand) {
8
9
  UpgradeSubscriptionCommand.RequestSchema = zod_1.z.object({
9
10
  upgradeSubscriptionId: zod_1.z.string().uuid(),
10
11
  promocode: zod_1.z.string().optional(),
12
+ provider: zod_1.z.nativeEnum(constants_1.PAYMENT_PROVIDER).optional().default(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
11
13
  });
12
14
  UpgradeSubscriptionCommand.RequestParamSchema = models_1.UserToSubscriptionSchema.pick({
13
15
  uuid: true,
@@ -26,7 +28,7 @@ var UpgradeSubscriptionCommand;
26
28
  electronic: zod_1.z.number(),
27
29
  }),
28
30
  });
29
- UpgradeSubscriptionCommand.ResponseSchema = zod_1.z.object({
31
+ UpgradeSubscriptionCommand.CloudPaymentsResponseSchema = zod_1.z.object({
30
32
  publicId: zod_1.z.string(),
31
33
  amount: zod_1.z.number(),
32
34
  currency: zod_1.z.string(),
@@ -39,7 +41,29 @@ var UpgradeSubscriptionCommand;
39
41
  data: zod_1.z.object({
40
42
  CloudPayments: zod_1.z.object({
41
43
  CustomerReceipt: IReceiptOrderSchema,
44
+ recurrent: zod_1.z.object({
45
+ period: zod_1.z.number(),
46
+ interval: zod_1.z.string(),
47
+ amount: zod_1.z.number(),
48
+ customerReceipt: IReceiptOrderSchema,
49
+ }),
42
50
  }),
43
51
  }),
52
+ provider: zod_1.z.literal(constants_1.PAYMENT_PROVIDER.CLOUDPAYMENTS),
44
53
  });
54
+ UpgradeSubscriptionCommand.ZenpaymentsResponseSchema = zod_1.z.object({
55
+ provider: zod_1.z.literal(constants_1.PAYMENT_PROVIDER.ZENPAYMENTS),
56
+ checkoutUrl: zod_1.z.string(),
57
+ orderNumber: zod_1.z.string(),
58
+ orderIdClient: zod_1.z.string().nullable(),
59
+ paymentAmount: zod_1.z.number(),
60
+ currencyCode: zod_1.z.string(),
61
+ customerEmail: zod_1.z.string(),
62
+ isSubscription: zod_1.z.boolean(),
63
+ createdAt: zod_1.z.string(),
64
+ });
65
+ UpgradeSubscriptionCommand.ResponseSchema = zod_1.z.discriminatedUnion('provider', [
66
+ UpgradeSubscriptionCommand.CloudPaymentsResponseSchema,
67
+ UpgradeSubscriptionCommand.ZenpaymentsResponseSchema,
68
+ ]);
45
69
  })(UpgradeSubscriptionCommand || (exports.UpgradeSubscriptionCommand = UpgradeSubscriptionCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AcceptTeamAccountInviteCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var AcceptTeamAccountInviteCommand;
7
+ (function (AcceptTeamAccountInviteCommand) {
8
+ AcceptTeamAccountInviteCommand.RequestSchema = zod_1.z.object({
9
+ token: zod_1.z.string().min(1),
10
+ });
11
+ AcceptTeamAccountInviteCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.TeamAccountMemberSchema,
13
+ });
14
+ })(AcceptTeamAccountInviteCommand || (exports.AcceptTeamAccountInviteCommand = AcceptTeamAccountInviteCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateManualTeamProductCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var CreateManualTeamProductCommand;
7
+ (function (CreateManualTeamProductCommand) {
8
+ CreateManualTeamProductCommand.RequestSchema = zod_1.z.object({
9
+ teamAccountId: zod_1.z.string().uuid(),
10
+ productId: zod_1.z.string().uuid(),
11
+ });
12
+ CreateManualTeamProductCommand.ResponseSchema = zod_1.z.object({
13
+ data: models_1.TeamToProductSchema,
14
+ });
15
+ })(CreateManualTeamProductCommand || (exports.CreateManualTeamProductCommand = CreateManualTeamProductCommand = {}));
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateManualTeamSubscriptionCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var CreateManualTeamSubscriptionCommand;
7
+ (function (CreateManualTeamSubscriptionCommand) {
8
+ CreateManualTeamSubscriptionCommand.RequestSchema = zod_1.z.object({
9
+ teamAccountId: zod_1.z.string().uuid(),
10
+ subscriptionId: zod_1.z.string().uuid(),
11
+ durationMonths: zod_1.z.number().int().min(1).max(36).optional(),
12
+ });
13
+ CreateManualTeamSubscriptionCommand.ResponseSchema = zod_1.z.object({
14
+ data: models_1.TeamToSubscriptionSchema,
15
+ });
16
+ })(CreateManualTeamSubscriptionCommand || (exports.CreateManualTeamSubscriptionCommand = CreateManualTeamSubscriptionCommand = {}));
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateTeamAccountCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var CreateTeamAccountCommand;
7
+ (function (CreateTeamAccountCommand) {
8
+ CreateTeamAccountCommand.RequestSchema = zod_1.z.object({
9
+ name: zod_1.z.string().trim().min(1).max(255),
10
+ email: zod_1.z.string().email().optional(),
11
+ logoUUID: zod_1.z.string().uuid().optional(),
12
+ });
13
+ CreateTeamAccountCommand.ResponseSchema = zod_1.z.object({
14
+ data: models_1.TeamAccountSchema,
15
+ });
16
+ })(CreateTeamAccountCommand || (exports.CreateTeamAccountCommand = CreateTeamAccountCommand = {}));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindCurrentTeamAccountProductsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var FindCurrentTeamAccountProductsCommand;
7
+ (function (FindCurrentTeamAccountProductsCommand) {
8
+ FindCurrentTeamAccountProductsCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(models_1.TeamToProductWithProductSchema),
10
+ });
11
+ })(FindCurrentTeamAccountProductsCommand || (exports.FindCurrentTeamAccountProductsCommand = FindCurrentTeamAccountProductsCommand = {}));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindCurrentTeamAccountSubscriptionsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var FindCurrentTeamAccountSubscriptionsCommand;
7
+ (function (FindCurrentTeamAccountSubscriptionsCommand) {
8
+ FindCurrentTeamAccountSubscriptionsCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(models_1.TeamToSubscriptionWithSubscriptionSchema),
10
+ });
11
+ })(FindCurrentTeamAccountSubscriptionsCommand || (exports.FindCurrentTeamAccountSubscriptionsCommand = FindCurrentTeamAccountSubscriptionsCommand = {}));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindTeamAccountMembersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var FindTeamAccountMembersCommand;
7
+ (function (FindTeamAccountMembersCommand) {
8
+ FindTeamAccountMembersCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(models_1.TeamAccountMemberSchema),
10
+ });
11
+ })(FindTeamAccountMembersCommand || (exports.FindTeamAccountMembersCommand = FindTeamAccountMembersCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindTeamAccountOperationsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var FindTeamAccountOperationsCommand;
7
+ (function (FindTeamAccountOperationsCommand) {
8
+ FindTeamAccountOperationsCommand.RequestSchema = zod_1.z.object({
9
+ limit: zod_1.z.number().int().min(1).max(200).optional(),
10
+ offset: zod_1.z.number().int().min(0).optional(),
11
+ });
12
+ FindTeamAccountOperationsCommand.ResponseSchema = zod_1.z.object({
13
+ data: zod_1.z.array(models_1.TeamAccountOperationSchema),
14
+ });
15
+ })(FindTeamAccountOperationsCommand || (exports.FindTeamAccountOperationsCommand = FindTeamAccountOperationsCommand = {}));