@purpleschool/gptbot 0.9.97 → 0.10.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 (334) 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 +23 -0
  149. package/build/models/team-account/team-account-invite.schema.js +20 -0
  150. package/build/models/team-account/team-account-member-list-item.schema.js +17 -0
  151. package/build/models/team-account/team-account-member.schema.js +17 -0
  152. package/build/models/team-account/team-account-operation.schema.js +12 -0
  153. package/build/models/team-account/team-account.schema.js +14 -0
  154. package/build/models/team-account/team-to-product.schema.js +21 -0
  155. package/build/models/team-account/team-to-subscription.schema.js +31 -0
  156. package/build/models/tools/image-editor/image-editor-job.schema.js +1 -0
  157. package/build/models/tools/image-editor/image-editor-model.schema.js +6 -0
  158. package/build/models/tools/image-generation/image-generation-model.schema.js +8 -5
  159. package/build/models/tools/index.js +3 -0
  160. package/build/models/tools/interior-design/index.js +19 -0
  161. package/build/models/tools/interior-design/interior-design-config.schema.js +23 -0
  162. package/build/models/tools/interior-design/interior-design-job.schema.js +27 -0
  163. package/build/models/tools/interior-design/interior-design-model.schema.js +34 -0
  164. package/build/models/tools/marketplace-card/index.js +18 -0
  165. package/build/models/tools/marketplace-card/marketplace-card-config.schema.js +30 -0
  166. package/build/models/tools/marketplace-card/marketplace-card-job.schema.js +24 -0
  167. package/build/models/tools/solving-edu-task/index.js +19 -0
  168. package/build/models/tools/solving-edu-task/solving-edu-task-config.schema.js +8 -0
  169. package/build/models/tools/solving-edu-task/solving-edu-task-job.schema.js +25 -0
  170. package/build/models/tools/solving-edu-task/solving-edu-task-model.schema.js +22 -0
  171. package/build/models/tools/video-editor/video-editor-job.schema.js +14 -1
  172. package/build/models/user-profile.schema.js +1 -0
  173. package/commands/b2b/get-b2b-documentation.command.ts +121 -0
  174. package/commands/b2b/index.ts +2 -0
  175. package/commands/b2b/send-text-request.command.ts +2 -5
  176. package/commands/b2b/upload-b2b-file.command.ts +14 -0
  177. package/commands/cabinet/get-user-statistics-by-month.command.ts +5 -1
  178. package/commands/chat/archive-all.command.ts +2 -4
  179. package/commands/chat/check-limit.command.ts +7 -0
  180. package/commands/chat/create-chat.command.ts +0 -1
  181. package/commands/chat/find-chats.command.ts +2 -5
  182. package/commands/chat/get-last-active-chat-command.ts +0 -1
  183. package/commands/index.ts +3 -0
  184. package/commands/message/create-text-message.command.ts +1 -0
  185. package/commands/page/find-pages-by-criteria.command.ts +50 -0
  186. package/commands/page/index.ts +1 -0
  187. package/commands/payment/find-payments-by-criteria.command.ts +63 -0
  188. package/commands/payment/index.ts +1 -0
  189. package/commands/product/buy-product.command.ts +27 -1
  190. package/commands/subscription/buy-subscription.command.ts +26 -1
  191. package/commands/subscription/index.ts +0 -1
  192. package/commands/subscription/upgrade-subscription.command.ts +27 -1
  193. package/commands/team-account/accept-team-account-invite.command.ts +16 -0
  194. package/commands/team-account/create-manual-team-product.command.ts +17 -0
  195. package/commands/team-account/create-manual-team-subscription.command.ts +18 -0
  196. package/commands/team-account/create-team-account.command.ts +18 -0
  197. package/commands/team-account/find-current-team-account-products.command.ts +10 -0
  198. package/commands/team-account/find-current-team-account-subscriptions.command.ts +10 -0
  199. package/commands/team-account/find-team-account-members.command.ts +10 -0
  200. package/commands/team-account/find-team-account-operations.command.ts +17 -0
  201. package/commands/team-account/find-team-account-products.command.ts +10 -0
  202. package/commands/team-account/find-team-account-subscriptions.command.ts +10 -0
  203. package/commands/team-account/find-team-accounts-by-name.command.ts +20 -0
  204. package/commands/team-account/get-my-team-account.command.ts +10 -0
  205. package/commands/team-account/get-team-account-balance.command.ts +14 -0
  206. package/commands/team-account/index.ts +17 -0
  207. package/commands/team-account/invite-team-account-member.command.ts +19 -0
  208. package/commands/team-account/refund-team-account-balance.command.ts +16 -0
  209. package/commands/team-account/remove-team-account-member.command.ts +17 -0
  210. package/commands/team-account/update-team-account-member.command.ts +25 -0
  211. package/commands/team-account/update-team-account.command.ts +24 -0
  212. package/commands/team-to-product/add-team-to-product.command.ts +18 -0
  213. package/commands/team-to-product/get-team-to-product-by-uuid.command.ts +16 -0
  214. package/commands/team-to-product/get-team-to-products.command.ts +16 -0
  215. package/commands/team-to-product/index.ts +4 -0
  216. package/commands/team-to-product/update-team-to-product.command.ts +26 -0
  217. package/commands/team-to-subscription/add-team-to-subscription.command.ts +22 -0
  218. package/commands/team-to-subscription/get-team-to-subscription-by-uuid.command.ts +16 -0
  219. package/commands/team-to-subscription/get-team-to-subscriptions.command.ts +16 -0
  220. package/commands/team-to-subscription/index.ts +4 -0
  221. package/commands/team-to-subscription/update-team-to-subscription.command.ts +36 -0
  222. package/commands/tools/image-editor/image-editor.command.ts +1 -0
  223. package/commands/tools/image-editor/retry-image-editor-job.command.ts +1 -0
  224. package/commands/tools/index.ts +3 -0
  225. package/commands/tools/interior-design/delete-all-interior-design-jobs.command.ts +6 -0
  226. package/commands/tools/interior-design/delete-interior-design-job-by-uuid.command.ts +11 -0
  227. package/commands/tools/interior-design/find-interior-design-job-by-uuid.command.ts +16 -0
  228. package/commands/tools/interior-design/find-interior-design-jobs.command.ts +18 -0
  229. package/commands/tools/interior-design/get-interior-design-tool-config.command.ts +10 -0
  230. package/commands/tools/interior-design/index.ts +9 -0
  231. package/commands/tools/interior-design/interior-design.command.ts +21 -0
  232. package/commands/tools/interior-design/retry-interior-design-job.command.ts +27 -0
  233. package/commands/tools/interior-design/set-reaction-to-interior-design-job.command.ts +33 -0
  234. package/commands/tools/interior-design/update-interior-design-job-title.command.ts +19 -0
  235. package/commands/tools/marketplace-card/delete-all-marketplace-card-jobs.command.ts +8 -0
  236. package/commands/tools/marketplace-card/delete-marketplace-card-by-uuid.command.ts +13 -0
  237. package/commands/tools/marketplace-card/execute-marketplace-card.command.ts +53 -0
  238. package/commands/tools/marketplace-card/find-marketplace-card-job-by-uuid.command.ts +16 -0
  239. package/commands/tools/marketplace-card/find-marketplace-card-jobs.command.ts +18 -0
  240. package/commands/tools/marketplace-card/get-marketplace-card-config.command.ts +9 -0
  241. package/commands/tools/marketplace-card/index.ts +9 -0
  242. package/commands/tools/marketplace-card/retry-marketplace-card-job.command.ts +57 -0
  243. package/commands/tools/marketplace-card/set-reaction-to-marketplace-card.command.ts +33 -0
  244. package/commands/tools/marketplace-card/update-marketplace-card-job-title.command.ts +19 -0
  245. package/commands/tools/solving-edu-task/delete-all-solving-edu-task-jobs.command.ts +8 -0
  246. package/commands/tools/solving-edu-task/delete-solving-edu-task-job-by-uuid.command.ts +13 -0
  247. package/commands/tools/solving-edu-task/find-solving-edu-task-job-by-uuid.command.ts +16 -0
  248. package/commands/tools/solving-edu-task/find-solving-edu-task-jobs.command.ts +18 -0
  249. package/commands/tools/solving-edu-task/get-solving-edu-task-tool-config.command.ts +9 -0
  250. package/commands/tools/solving-edu-task/index.ts +9 -0
  251. package/commands/tools/solving-edu-task/retry-solving-edu-task-job.command.ts +25 -0
  252. package/commands/tools/solving-edu-task/set-reaction-to-solving-edu-task-job.command.ts +33 -0
  253. package/commands/tools/solving-edu-task/solving-edu-task.command.ts +31 -0
  254. package/commands/tools/solving-edu-task/update-solving-edu-task-job-title.command.ts +19 -0
  255. package/commands/user/get-me.command.ts +2 -1
  256. package/commands/user/get-user-payments.command.ts +4 -2
  257. package/constants/ai-model/enums/index.ts +0 -1
  258. package/constants/billing/enums/billing-scope.enum.ts +4 -0
  259. package/constants/billing/enums/index.ts +1 -0
  260. package/constants/billing/index.ts +1 -0
  261. package/constants/cabinet/enums/index.ts +1 -0
  262. package/constants/cabinet/enums/statistics-metric-type.enum.ts +4 -0
  263. package/constants/index.ts +2 -1
  264. package/constants/model/enums/unified-model-content-type.enum.ts +2 -1
  265. package/constants/page/enums/index.ts +1 -0
  266. package/constants/page/enums/page-sort-by.enum.ts +4 -0
  267. package/constants/payment/enums/index.ts +1 -0
  268. package/constants/payment/enums/payment-provider.enum.ts +4 -0
  269. package/constants/subscription/enums/subscription-feature-type.enum.ts +5 -1
  270. package/constants/subscription/enums/user-to-subscription-marks.enum.ts +1 -0
  271. package/constants/team-account/enums/index.ts +4 -0
  272. package/constants/team-account/enums/team-account-invite-status.enum.ts +6 -0
  273. package/constants/team-account/enums/team-account-member-role.enum.ts +5 -0
  274. package/constants/team-account/enums/team-account-member-status.enum.ts +7 -0
  275. package/constants/team-account/enums/team-account-operation-type.enum.ts +6 -0
  276. package/constants/team-account/index.ts +1 -0
  277. package/constants/tool/enums/index.ts +0 -1
  278. package/constants/transaction/enums/user-balance-status.enum.ts +3 -0
  279. package/constants/ui-notification/enums/ui-notification-type.enum.ts +1 -0
  280. package/constants/user/enums/user-status.ts +1 -0
  281. package/helpers/index.ts +1 -0
  282. package/helpers/interior-design/calculate-interior-design-price.helper.ts +23 -0
  283. package/helpers/interior-design/index.ts +1 -0
  284. package/models/ai-model.schema.ts +3 -7
  285. package/models/b2b/b2b-completions-stream-chunk.schema.ts +10 -0
  286. package/models/b2b/b2b-file-upload-response.schema.ts +14 -0
  287. package/models/b2b/index.ts +2 -0
  288. package/models/chat.schema.ts +1 -1
  289. package/models/community/community-post-media-data.schema.ts +1 -0
  290. package/models/index.ts +3 -0
  291. package/models/json-value.schema.ts +23 -0
  292. package/models/message.schema.ts +1 -0
  293. package/models/payment.schema.ts +7 -2
  294. package/models/product.schema.ts +2 -0
  295. package/models/prompt.schema.ts +0 -2
  296. package/models/subscription-feature.schema.ts +32 -7
  297. package/models/subscription.schema.ts +7 -1
  298. package/models/team-account/index.ts +7 -0
  299. package/models/team-account/team-account-invite.schema.ts +18 -0
  300. package/models/team-account/team-account-member-list-item.schema.ts +15 -0
  301. package/models/team-account/team-account-member.schema.ts +15 -0
  302. package/models/team-account/team-account-operation.schema.ts +10 -0
  303. package/models/team-account/team-account.schema.ts +12 -0
  304. package/models/team-account/team-to-product.schema.ts +20 -0
  305. package/models/team-account/team-to-subscription.schema.ts +33 -0
  306. package/models/tools/image-editor/image-editor-job.schema.ts +1 -0
  307. package/models/tools/image-editor/image-editor-model.schema.ts +9 -0
  308. package/models/tools/image-generation/image-generation-model.schema.ts +8 -5
  309. package/models/tools/index.ts +3 -0
  310. package/models/tools/interior-design/index.ts +3 -0
  311. package/models/tools/interior-design/interior-design-config.schema.ts +29 -0
  312. package/models/tools/interior-design/interior-design-job.schema.ts +32 -0
  313. package/models/tools/interior-design/interior-design-model.schema.ts +45 -0
  314. package/models/tools/marketplace-card/index.ts +2 -0
  315. package/models/tools/marketplace-card/marketplace-card-config.schema.ts +33 -0
  316. package/models/tools/marketplace-card/marketplace-card-job.schema.ts +25 -0
  317. package/models/tools/solving-edu-task/index.ts +3 -0
  318. package/models/tools/solving-edu-task/solving-edu-task-config.schema.ts +8 -0
  319. package/models/tools/solving-edu-task/solving-edu-task-job.schema.ts +28 -0
  320. package/models/tools/solving-edu-task/solving-edu-task-model.schema.ts +25 -0
  321. package/models/tools/video-editor/video-editor-job.schema.ts +14 -1
  322. package/models/user-profile.schema.ts +1 -0
  323. package/package.json +1 -1
  324. package/build/commands/subscription/create-custom-subscription-plan.command.js +0 -24
  325. package/build/constants/ai-model/enums/ai-model-content-type.enum.js +0 -7
  326. package/build/constants/errors/errors.js +0 -4376
  327. package/build/constants/errors/verbose.js +0 -9
  328. package/build/constants/tool/enums/tool-type.enum.js +0 -12
  329. package/commands/subscription/create-custom-subscription-plan.command.ts +0 -26
  330. package/constants/ai-model/enums/ai-model-content-type.enum.ts +0 -7
  331. package/constants/errors/errors.ts +0 -4416
  332. package/constants/errors/index.ts +0 -2
  333. package/constants/errors/verbose.ts +0 -7
  334. package/constants/tool/enums/tool-type.enum.ts +0 -8
@@ -1,5 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { SUBSCRIPTION_ACTION, SUBSCRIPTION_PLAN, SUBSCRIPTION_TYPE } from '../constants';
2
+ import {
3
+ BILLING_SCOPE,
4
+ SUBSCRIPTION_ACTION,
5
+ SUBSCRIPTION_PLAN,
6
+ SUBSCRIPTION_TYPE,
7
+ } from '../constants';
3
8
  import { SubscriptionFeatureSchema } from './subscription-feature.schema';
4
9
 
5
10
  export const SubscriptionSchema = z.object({
@@ -8,6 +13,7 @@ export const SubscriptionSchema = z.object({
8
13
  name: z.string().min(3).max(16384),
9
14
  requests: z.number(),
10
15
  price: z.number(),
16
+ billingScope: z.nativeEnum(BILLING_SCOPE),
11
17
  plan: z.nativeEnum(SUBSCRIPTION_PLAN),
12
18
  type: z.nativeEnum(SUBSCRIPTION_TYPE),
13
19
  discount: z.number(),
@@ -0,0 +1,7 @@
1
+ export * from './team-account.schema';
2
+ export * from './team-account-member.schema';
3
+ export * from './team-account-member-list-item.schema';
4
+ export * from './team-account-invite.schema';
5
+ export * from './team-account-operation.schema';
6
+ export * from './team-to-subscription.schema';
7
+ export * from './team-to-product.schema';
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+
3
+ export const TeamAccountInviteSchema = z.object({
4
+ uuid: z.string().uuid(),
5
+ teamAccountId: z.string().uuid(),
6
+ email: z.string().email(),
7
+ invitedByUserId: z.string().uuid(),
8
+ acceptedByUserId: z.string().uuid().nullable(),
9
+ tokenHash: z.string(),
10
+ role: z.string(),
11
+ tokenLimit: z.number().int().nullable(),
12
+ status: z.string(),
13
+ expiresAt: z.date(),
14
+ acceptedAt: z.date().nullable(),
15
+ revokedAt: z.date().nullable(),
16
+ createdAt: z.date(),
17
+ updatedAt: z.date(),
18
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { TEAM_ACCOUNT_INVITE_STATUS, TEAM_ACCOUNT_MEMBER_ROLE } from '../../constants';
3
+
4
+ export const TeamAccountMemberListItemSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ userId: z.string().uuid().nullable(),
7
+ name: z.string().nullable(),
8
+ email: z.string().email(),
9
+ role: z.nativeEnum(TEAM_ACCOUNT_MEMBER_ROLE),
10
+ inviteStatus: z.nativeEnum(TEAM_ACCOUNT_INVITE_STATUS).nullable(),
11
+ balance: z.object({
12
+ remaining: z.number().int().nullable(),
13
+ limit: z.number().int().nullable(),
14
+ }),
15
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+
3
+ export const TeamAccountMemberSchema = z.object({
4
+ uuid: z.string().uuid(),
5
+ teamAccountId: z.string().uuid(),
6
+ userId: z.string().uuid(),
7
+ role: z.string(),
8
+ status: z.string(),
9
+ tokenLimit: z.number().int().nullable(),
10
+ spentTokens: z.number().int(),
11
+ joinedAt: z.date(),
12
+ leftAt: z.date().nullable(),
13
+ createdAt: z.date(),
14
+ updatedAt: z.date(),
15
+ });
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+
3
+ export const TeamAccountOperationSchema = z.object({
4
+ uuid: z.string().uuid(),
5
+ teamAccountId: z.string().uuid(),
6
+ initiatorUserId: z.string().uuid().nullable(),
7
+ type: z.string(),
8
+ amount: z.number().int(),
9
+ createdAt: z.date(),
10
+ });
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ export const TeamAccountSchema = z.object({
4
+ uuid: z.string().uuid(),
5
+ ownerUserId: z.string().uuid(),
6
+ name: z.string(),
7
+ email: z.string().email(),
8
+ logoUrl: z.string().nullable(),
9
+ isActive: z.boolean(),
10
+ createdAt: z.date(),
11
+ updatedAt: z.date(),
12
+ });
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { PRODUCT_STATUS } from '../../constants';
3
+ import { ProductSchema } from '../product.schema';
4
+
5
+ export const TeamToProductSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ teamAccountId: z.string().uuid(),
8
+ productId: z.string().uuid(),
9
+ initTokenBalance: z.number(),
10
+ tokenBalance: z.number(),
11
+ status: z.nativeEnum(PRODUCT_STATUS),
12
+ expiresAt: z.date().nullable(),
13
+ orderId: z.string().uuid().nullable(),
14
+ createdAt: z.date(),
15
+ updatedAt: z.date(),
16
+ });
17
+
18
+ export const TeamToProductWithProductSchema = TeamToProductSchema.extend({
19
+ product: ProductSchema,
20
+ });
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { SUBSCRIPTION_STATUS, USER_TO_SUBSCRIPTION_TYPE } from '../../constants';
3
+ import { SubscriptionSchema } from '../subscription.schema';
4
+
5
+ export const TeamToSubscriptionSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ teamAccountId: z.string().uuid(),
8
+ subscriptionId: z.string().uuid(),
9
+ cloudPaymentsSubscriptionId: z.string().nullable(),
10
+ zenpaymentsInvoiceNumber: z.string().nullable(),
11
+ initTokenBalance: z.number(),
12
+ tokenBalance: z.number(),
13
+ initCarriedOverTokenBalance: z.number(),
14
+ carriedOverTokenBalance: z.number(),
15
+ startDate: z.date().nullable(),
16
+ endDate: z.date().nullable(),
17
+ status: z.nativeEnum(SUBSCRIPTION_STATUS),
18
+ active: z.boolean(),
19
+ type: z.nativeEnum(USER_TO_SUBSCRIPTION_TYPE),
20
+ intervalEndDate: z.date().nullable(),
21
+ marks: z.array(z.string()),
22
+ downgradedFromTeamSubscriptionId: z.string().uuid().nullable(),
23
+ orderId: z.string().uuid().nullable(),
24
+ createdAt: z.date(),
25
+ updatedAt: z.date(),
26
+ });
27
+
28
+ export const TeamToSubscriptionWithSubscriptionSchema = z.intersection(
29
+ TeamToSubscriptionSchema,
30
+ z.object({
31
+ subscription: SubscriptionSchema,
32
+ }),
33
+ );
@@ -8,6 +8,7 @@ export const ImageEditorJobParamsSchema = z.object({
8
8
  attachedFiles: z.array(AttachedToolFileSchema),
9
9
  systemPromptId: z.string().optional(),
10
10
  imageUrls: z.string().array().optional(),
11
+ aspectRatio: z.string().optional(),
11
12
  });
12
13
 
13
14
  export type ImageEditorJobParams = z.infer<typeof ImageEditorJobParamsSchema>;
@@ -8,6 +8,15 @@ export const ImageEditorModelParamsSchema = z.object({
8
8
  maxImages: z.number(),
9
9
  acceptedTypes: z.array(z.string()),
10
10
  }),
11
+ aspectRatio: z
12
+ .record(
13
+ z.string(),
14
+ z.object({
15
+ width: z.number(),
16
+ height: z.number(),
17
+ }),
18
+ )
19
+ .optional(),
11
20
  });
12
21
 
13
22
  export type ImageEditorModelParams = z.infer<typeof ImageEditorModelParamsSchema>;
@@ -5,12 +5,15 @@ import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
5
5
  export const ImageGenerationModelParamsSchema = z.object({
6
6
  aspectRatio: z.record(
7
7
  z.string(),
8
- z.object({
9
- width: z.number(),
10
- height: z.number(),
11
- }),
8
+ z.union([
9
+ z.object({
10
+ width: z.number(),
11
+ height: z.number(),
12
+ }),
13
+ z.string(),
14
+ ]),
12
15
  ),
13
- quality: z.string().optional(),
16
+ quality: z.union([z.string(), z.record(z.string())]).optional(),
14
17
  resolution: z
15
18
  .object({
16
19
  options: z.array(z.nativeEnum(IMAGE_GENERATION_RESOLUTION)),
@@ -10,3 +10,6 @@ export * from './image-editor';
10
10
  export * from './video-editor';
11
11
  export * from './music';
12
12
  export * from './image-generation';
13
+ export * from './marketplace-card';
14
+ export * from './interior-design';
15
+ export * from './solving-edu-task';
@@ -0,0 +1,3 @@
1
+ export * from './interior-design-config.schema';
2
+ export * from './interior-design-job.schema';
3
+ export * from './interior-design-model.schema';
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { InteriorDesignModelSchema } from './interior-design-model.schema';
3
+
4
+ export const InteriorDesignStylesSchema = z.object({
5
+ uuid: z.string(),
6
+ title: z.string(),
7
+ prompt: z.string(),
8
+ sample: z.string(),
9
+ order: z.number(),
10
+ });
11
+
12
+ export type InteriorDesignStyles = z.infer<typeof InteriorDesignStylesSchema>;
13
+
14
+ export const InteriorDesignRoomTypesSchema = z.object({
15
+ uuid: z.string(),
16
+ title: z.string(),
17
+ prompt: z.string(),
18
+ order: z.number(),
19
+ });
20
+
21
+ export type InteriorDesignRoomTypes = z.infer<typeof InteriorDesignRoomTypesSchema>;
22
+
23
+ export const InteriorDesignConfigSchema = z.object({
24
+ models: z.array(InteriorDesignModelSchema),
25
+ styles: z.array(InteriorDesignStylesSchema),
26
+ roomTypes: z.array(InteriorDesignRoomTypesSchema),
27
+ });
28
+
29
+ export type InteriorDesignConfig = z.infer<typeof InteriorDesignConfigSchema>;
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { USER_REACTION } from '../../../constants';
3
+ import { ToolJobSchema } from '../../tool-job.schema';
4
+ import { FileSchema } from '../../file.schema';
5
+ import { AttachedToolFileSchema } from '../common';
6
+
7
+ export const InteriorDesignJobParamsSchema = z.object({
8
+ attachedFiles: z.array(AttachedToolFileSchema),
9
+ styleId: z.string().optional(),
10
+ roomTypeId: z.string().optional(),
11
+ });
12
+
13
+ export type InteriorDesignJobParams = z.infer<typeof InteriorDesignJobParamsSchema>;
14
+
15
+ export const InteriorDesignJobSchema = ToolJobSchema.extend({
16
+ title: z.string(),
17
+ prompt: z.string(),
18
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
19
+ imageUrls: z.string().array(),
20
+ images: z
21
+ .array(
22
+ FileSchema.pick({
23
+ uuid: true,
24
+ url: true,
25
+ }),
26
+ )
27
+ .nullable(),
28
+ params: InteriorDesignJobParamsSchema,
29
+ modelId: z.string(),
30
+ });
31
+
32
+ export type InteriorDesignJob = z.infer<typeof InteriorDesignJobSchema>;
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema } from '../../icon-variants.schema';
3
+ import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
4
+
5
+ export const InteriorDesignModelParamsSchema = z.object({
6
+ imageAttachment: z.object({
7
+ supported: z.boolean(),
8
+ maxImages: z.number(),
9
+ acceptedTypes: z.array(z.string()),
10
+ }),
11
+ });
12
+
13
+ export type InteriorDesignModelParams = z.infer<typeof InteriorDesignModelParamsSchema>;
14
+
15
+ export const InteriorDesignModelPricingRuleConditionSchema = z.object({
16
+ withoutSub: z.boolean().optional(),
17
+ });
18
+ export type InteriorDesignModelPricingRuleCondition = z.infer<
19
+ typeof InteriorDesignModelPricingRuleConditionSchema
20
+ >;
21
+
22
+ export const InteriorDesignModelPricingRulesSchema = z.array(
23
+ z.object({
24
+ condition: InteriorDesignModelPricingRuleConditionSchema,
25
+ value: z.number(),
26
+ }),
27
+ );
28
+ export type InteriorDesignModelPricingRules = z.infer<typeof InteriorDesignModelPricingRulesSchema>;
29
+
30
+ export const InteriorDesignModelSchema = z.object({
31
+ uuid: z.string(),
32
+ title: z.string(),
33
+ description: z.string(),
34
+ price: z.number(),
35
+ status: z.string(),
36
+ order: z.number(),
37
+ icons: IconVariantsSchema,
38
+ maxPromptLength: z.number(),
39
+ params: InteriorDesignModelParamsSchema,
40
+ pricingRules: InteriorDesignModelPricingRulesSchema,
41
+ unlockedBy: UnlockedBySchema.nullable(),
42
+ canUse: z.boolean(),
43
+ });
44
+
45
+ export type InteriorDesignModel = z.infer<typeof InteriorDesignModelSchema>;
@@ -0,0 +1,2 @@
1
+ export * from './marketplace-card-config.schema';
2
+ export * from './marketplace-card-job.schema';
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema } from '../../icon-variants.schema';
3
+
4
+ export const MarketplaceCardStylePresetSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ previewImageUrl: z.string(),
7
+ order: z.number(),
8
+ isActive: z.boolean(),
9
+ });
10
+ export type MarketplaceCardStylePreset = z.infer<typeof MarketplaceCardStylePresetSchema>;
11
+
12
+ export const MarketplaceCardModelSchema = z.object({
13
+ uuid: z.string().uuid(),
14
+ price: z.number(),
15
+ params: z.object({
16
+ imageAttachment: z.object({
17
+ supported: z.boolean(),
18
+ maxImages: z.number(),
19
+ acceptedTypes: z.array(z.string()),
20
+ }),
21
+ }),
22
+ iconVariants: IconVariantsSchema,
23
+ maxPromptLength: z.number(),
24
+ supportsImageAttachment: z.boolean(),
25
+ maxAttachedImages: z.number(),
26
+ });
27
+ export type MarketplaceCardModel = z.infer<typeof MarketplaceCardModelSchema>;
28
+
29
+ export const MarketplaceCardConfigSchema = z.object({
30
+ styles: z.array(MarketplaceCardStylePresetSchema),
31
+ models: z.array(MarketplaceCardModelSchema),
32
+ });
33
+ export type MarketplaceCardConfigModel = z.infer<typeof MarketplaceCardConfigSchema>;
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { USER_REACTION } from '../../../constants';
3
+ import { ToolJobSchema } from '../../tool-job.schema';
4
+
5
+ export const MarketplaceCardJobSchema = ToolJobSchema.extend({
6
+ uuid: z.string().uuid(),
7
+ title: z.string(),
8
+ subtitle: z.string().nullable(),
9
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
10
+ stylePresetId: z.string().uuid().nullable(),
11
+ advantages: z.array(z.string()),
12
+ tags: z.array(z.string()),
13
+ isCustom: z.boolean(),
14
+ customStylePrompt: z.string().nullable(),
15
+ inputImages: z.array(
16
+ z.object({
17
+ uuid: z.string().uuid(),
18
+ url: z.string(),
19
+ }),
20
+ ),
21
+ resultImages: z.array(z.string()).nullable(),
22
+ backgroundDescription: z.string().nullable(),
23
+ price: z.number(),
24
+ });
25
+ export type MarketplaceCardJob = z.infer<typeof MarketplaceCardJobSchema>;
@@ -0,0 +1,3 @@
1
+ export * from './solving-edu-task-config.schema';
2
+ export * from './solving-edu-task-job.schema';
3
+ export * from './solving-edu-task-model.schema';
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { SolvingEduTaskModelSchema } from './solving-edu-task-model.schema';
3
+
4
+ export const SolvingEduTaskConfigSchema = z.object({
5
+ models: z.array(SolvingEduTaskModelSchema),
6
+ });
7
+
8
+ export type SolvingEduTaskConfig = z.infer<typeof SolvingEduTaskConfigSchema>;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { USER_REACTION } from '../../../constants';
3
+ import { AttachedToolFileSchema } from '../common';
4
+ import { TOOL_JOB_STATUS } from '../../../constants';
5
+
6
+ export const SolvingEduTaskJobParamsSchema = z.object({
7
+ attachedFiles: z.array(AttachedToolFileSchema),
8
+ });
9
+
10
+ export type SolvingEduTaskJobParams = z.infer<typeof SolvingEduTaskJobParamsSchema>;
11
+
12
+ export const SolvingEduTaskJobSchema = z.object({
13
+ uuid: z.string().uuid(),
14
+ prompt: z.string(),
15
+ aiOutput: z.string().nullable().optional(),
16
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
17
+ title: z.string(),
18
+ status: z.nativeEnum(TOOL_JOB_STATUS),
19
+ modelId: z.string(),
20
+ price: z.number(),
21
+ params: SolvingEduTaskJobParamsSchema,
22
+ error: z.string().nullable(),
23
+ userId: z.string().nullable().optional(),
24
+ createdAt: z.date(),
25
+ updatedAt: z.date(),
26
+ });
27
+
28
+ export type SolvingEduTaskJob = z.infer<typeof SolvingEduTaskJobSchema>;
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_MODEL_STATUS } from '../../../constants';
3
+
4
+ export const SolvingEduTaskModelParamsSchema = z.object({
5
+ imageAttachment: z.object({
6
+ supported: z.boolean(),
7
+ maxImages: z.number(),
8
+ acceptedTypes: z.array(z.string()),
9
+ }),
10
+ });
11
+
12
+ export type SolvingEduTaskModelParams = z.infer<typeof SolvingEduTaskModelParamsSchema>;
13
+
14
+ export const SolvingEduTaskModelSchema = z.object({
15
+ uuid: z.string(),
16
+ title: z.string(),
17
+ description: z.string(),
18
+ price: z.number(),
19
+ order: z.number(),
20
+ status: z.nativeEnum(TOOL_MODEL_STATUS),
21
+ maxPromptLength: z.number(),
22
+ params: SolvingEduTaskModelParamsSchema,
23
+ });
24
+
25
+ export type SolvingEduTaskModel = z.infer<typeof SolvingEduTaskModelSchema>;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { ToolJobSchema } from '../../tool-job.schema';
3
2
  import { USER_REACTION } from '../../../constants';
3
+ import { ToolJobSchema } from '../../tool-job.schema';
4
4
 
5
5
  export const VideoEditorJobSchema = ToolJobSchema.extend({
6
6
  title: z.string(),
@@ -9,9 +9,22 @@ export const VideoEditorJobSchema = ToolJobSchema.extend({
9
9
  inputVideoId: z.string().nullable(),
10
10
  inputVideoUrl: z.string(),
11
11
  outputVideoUrl: z.string().nullable(),
12
+ video: z
13
+ .object({
14
+ uuid: z.string(),
15
+ url: z.string(),
16
+ })
17
+ .nullable(),
18
+ preview: z
19
+ .object({
20
+ uuid: z.string(),
21
+ url: z.string(),
22
+ })
23
+ .nullable(),
12
24
  modelId: z.string(),
13
25
  isPublished: z.boolean(),
14
26
  postId: z.string().nullable(),
27
+ thumbnail: z.string().nullable(),
15
28
  });
16
29
 
17
30
  export type VideoEditorJob = z.infer<typeof VideoEditorJobSchema>;
@@ -5,6 +5,7 @@ export const UserProfileSchema = z.object({
5
5
  name: z.string().nullable(),
6
6
  avatarUrl: z.string().url().nullable(),
7
7
  avatarKey: z.string().nullable(),
8
+ isPremium: z.boolean(),
8
9
  createdAt: z.date(),
9
10
  updatedAt: z.date(),
10
11
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.9.97",
3
+ "version": "0.10.1",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateCustomSubscriptionPlanCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../models");
6
- var CreateCustomSubscriptionPlanCommand;
7
- (function (CreateCustomSubscriptionPlanCommand) {
8
- CreateCustomSubscriptionPlanCommand.RequestSchema = zod_1.z.object({
9
- tokens: zod_1.z
10
- .number()
11
- .refine((val) => val % 500 === 0, {
12
- message: 'tokens must be a multiple of 500',
13
- })
14
- .refine((val) => val > 1000, {
15
- message: 'tokens must be greater than 1000',
16
- })
17
- .refine((val) => val <= 10000, {
18
- message: 'tokens must be equal or less than 10000',
19
- }),
20
- });
21
- CreateCustomSubscriptionPlanCommand.ResponseSchema = zod_1.z.object({
22
- data: zod_1.z.array(models_1.SubscriptionSchema),
23
- });
24
- })(CreateCustomSubscriptionPlanCommand || (exports.CreateCustomSubscriptionPlanCommand = CreateCustomSubscriptionPlanCommand = {}));
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AI_MODEL_CONTENT_TYPE = void 0;
4
- exports.AI_MODEL_CONTENT_TYPE = {
5
- TEXT: 'TEXT',
6
- IMAGE: 'IMAGE',
7
- };