@purpleschool/multisite 0.0.34 → 0.0.41

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 (184) hide show
  1. package/api/controller/http/auth.ts +1 -0
  2. package/api/controller/http/catalog.ts +6 -0
  3. package/api/controller/http/file.ts +1 -0
  4. package/api/controller/http/index.ts +2 -0
  5. package/api/controller/http/text-chat.ts +18 -0
  6. package/api/routes.ts +1 -0
  7. package/build/api/controller/http/auth.d.ts +1 -0
  8. package/build/api/controller/http/auth.d.ts.map +1 -1
  9. package/build/api/controller/http/auth.js +1 -0
  10. package/build/api/controller/http/catalog.d.ts +7 -0
  11. package/build/api/controller/http/catalog.d.ts.map +1 -0
  12. package/build/api/controller/http/catalog.js +9 -0
  13. package/build/api/controller/http/file.d.ts +1 -0
  14. package/build/api/controller/http/file.d.ts.map +1 -1
  15. package/build/api/controller/http/file.js +1 -0
  16. package/build/api/controller/http/index.d.ts +2 -0
  17. package/build/api/controller/http/index.d.ts.map +1 -1
  18. package/build/api/controller/http/index.js +2 -0
  19. package/build/api/controller/http/text-chat.d.ts +18 -0
  20. package/build/api/controller/http/text-chat.d.ts.map +1 -0
  21. package/build/api/controller/http/text-chat.js +20 -0
  22. package/build/api/routes.d.ts +1 -0
  23. package/build/api/routes.d.ts.map +1 -1
  24. package/build/api/routes.js +1 -0
  25. package/build/commands/auth/change-password.command.d.ts +5 -0
  26. package/build/commands/auth/change-password.command.d.ts.map +1 -1
  27. package/build/commands/auth/change-password.command.js +1 -0
  28. package/build/commands/auth/index.d.ts +1 -0
  29. package/build/commands/auth/index.d.ts.map +1 -1
  30. package/build/commands/auth/index.js +1 -0
  31. package/build/commands/auth/login.command.d.ts +5 -0
  32. package/build/commands/auth/login.command.d.ts.map +1 -1
  33. package/build/commands/auth/login.command.js +1 -0
  34. package/build/commands/auth/refresh.command.d.ts +30 -0
  35. package/build/commands/auth/refresh.command.d.ts.map +1 -0
  36. package/build/commands/auth/refresh.command.js +15 -0
  37. package/build/commands/auth/register.command.d.ts +5 -0
  38. package/build/commands/auth/register.command.d.ts.map +1 -1
  39. package/build/commands/auth/register.command.js +1 -0
  40. package/build/commands/auth/reset-password.command.d.ts +5 -0
  41. package/build/commands/auth/reset-password.command.d.ts.map +1 -1
  42. package/build/commands/auth/reset-password.command.js +1 -0
  43. package/build/commands/auth/verify-email.command.d.ts.map +1 -1
  44. package/build/commands/auth/verify-email.command.js +2 -1
  45. package/build/commands/auth/vk-login.command.d.ts +5 -0
  46. package/build/commands/auth/vk-login.command.d.ts.map +1 -1
  47. package/build/commands/auth/vk-login.command.js +1 -0
  48. package/build/commands/auth/yandex-login.command.d.ts +5 -0
  49. package/build/commands/auth/yandex-login.command.d.ts.map +1 -1
  50. package/build/commands/auth/yandex-login.command.js +1 -0
  51. package/build/commands/catalog/index.d.ts +156 -0
  52. package/build/commands/catalog/index.d.ts.map +1 -0
  53. package/build/commands/catalog/index.js +23 -0
  54. package/build/commands/index.d.ts +2 -0
  55. package/build/commands/index.d.ts.map +1 -1
  56. package/build/commands/index.js +2 -0
  57. package/build/commands/page/create-page.command.d.ts +8 -0
  58. package/build/commands/page/create-page.command.d.ts.map +1 -1
  59. package/build/commands/page/find-page-by-alias.command.d.ts +16 -0
  60. package/build/commands/page/find-page-by-alias.command.d.ts.map +1 -1
  61. package/build/commands/page/find-page-by-criteria.command.d.ts +5 -0
  62. package/build/commands/page/find-page-by-criteria.command.d.ts.map +1 -1
  63. package/build/commands/page/find-page.command.d.ts +11 -0
  64. package/build/commands/page/find-page.command.d.ts.map +1 -1
  65. package/build/commands/page/update-page.command.d.ts +8 -0
  66. package/build/commands/page/update-page.command.d.ts.map +1 -1
  67. package/build/commands/product/fast-buy-product.command.d.ts.map +1 -1
  68. package/build/commands/product/fast-buy-product.command.js +2 -1
  69. package/build/commands/subscription/fast-buy-subscription.command.d.ts.map +1 -1
  70. package/build/commands/subscription/fast-buy-subscription.command.js +2 -1
  71. package/build/commands/text-chat/category.d.ts +321 -0
  72. package/build/commands/text-chat/category.d.ts.map +1 -0
  73. package/build/commands/text-chat/category.js +29 -0
  74. package/build/commands/text-chat/index.d.ts +292 -0
  75. package/build/commands/text-chat/index.d.ts.map +1 -0
  76. package/build/commands/text-chat/index.js +73 -0
  77. package/build/constants/catalog.d.ts +5 -0
  78. package/build/constants/catalog.d.ts.map +1 -0
  79. package/build/constants/catalog.js +8 -0
  80. package/build/constants/errors/errors.d.ts +77 -0
  81. package/build/constants/errors/errors.d.ts.map +1 -1
  82. package/build/constants/errors/errors.js +77 -0
  83. package/build/constants/files/enums/file-type.enum.d.ts +3 -1
  84. package/build/constants/files/enums/file-type.enum.d.ts.map +1 -1
  85. package/build/constants/files/enums/file-type.enum.js +2 -0
  86. package/build/constants/index.d.ts +3 -0
  87. package/build/constants/index.d.ts.map +1 -1
  88. package/build/constants/index.js +3 -0
  89. package/build/constants/text-chat/attachments.d.ts +12 -0
  90. package/build/constants/text-chat/attachments.d.ts.map +1 -0
  91. package/build/constants/text-chat/attachments.js +52 -0
  92. package/build/constants/text-chat/index.d.ts +38 -0
  93. package/build/constants/text-chat/index.d.ts.map +1 -0
  94. package/build/constants/text-chat/index.js +59 -0
  95. package/build/constants/text-provider/index.d.ts +37 -0
  96. package/build/constants/text-provider/index.d.ts.map +1 -0
  97. package/build/constants/text-provider/index.js +46 -0
  98. package/build/constants/tools/enums/tool-type.enum.d.ts +1 -0
  99. package/build/constants/tools/enums/tool-type.enum.d.ts.map +1 -1
  100. package/build/constants/tools/enums/tool-type.enum.js +1 -0
  101. package/build/helpers/index.d.ts +1 -0
  102. package/build/helpers/index.d.ts.map +1 -1
  103. package/build/helpers/index.js +1 -0
  104. package/build/helpers/text-chat/index.d.ts +23 -0
  105. package/build/helpers/text-chat/index.d.ts.map +1 -0
  106. package/build/helpers/text-chat/index.js +91 -0
  107. package/build/models/catalog/index.d.ts +181 -0
  108. package/build/models/catalog/index.d.ts.map +1 -0
  109. package/build/models/catalog/index.js +36 -0
  110. package/build/models/index.d.ts +2 -0
  111. package/build/models/index.d.ts.map +1 -1
  112. package/build/models/index.js +2 -0
  113. package/build/models/page.schema.d.ts +6 -0
  114. package/build/models/page.schema.d.ts.map +1 -1
  115. package/build/models/page.schema.js +1 -0
  116. package/build/models/text-chat/category.schema.d.ts +79 -0
  117. package/build/models/text-chat/category.schema.d.ts.map +1 -0
  118. package/build/models/text-chat/category.schema.js +38 -0
  119. package/build/models/text-chat/index.d.ts +319 -0
  120. package/build/models/text-chat/index.d.ts.map +1 -0
  121. package/build/models/text-chat/index.js +79 -0
  122. package/build/models/text-chat/provider-config.schema.d.ts +92 -0
  123. package/build/models/text-chat/provider-config.schema.d.ts.map +1 -0
  124. package/build/models/text-chat/provider-config.schema.js +42 -0
  125. package/build/models/text-chat/stream.schema.d.ts +83 -0
  126. package/build/models/text-chat/stream.schema.d.ts.map +1 -0
  127. package/build/models/text-chat/stream.schema.js +24 -0
  128. package/build/models/user.schema.d.ts +1 -0
  129. package/build/models/user.schema.d.ts.map +1 -1
  130. package/build/models/user.schema.js +3 -2
  131. package/build/queries/catalog/index.d.ts +259 -0
  132. package/build/queries/catalog/index.d.ts.map +1 -0
  133. package/build/queries/catalog/index.js +31 -0
  134. package/build/queries/index.d.ts +2 -0
  135. package/build/queries/index.d.ts.map +1 -1
  136. package/build/queries/index.js +2 -0
  137. package/build/queries/subscription/get-subscriptions-summary.command.d.ts +5 -0
  138. package/build/queries/subscription/get-subscriptions-summary.command.d.ts.map +1 -1
  139. package/build/queries/subscription/get-subscriptions-summary.command.js +1 -0
  140. package/build/queries/text-chat/category.d.ts +297 -0
  141. package/build/queries/text-chat/category.d.ts.map +1 -0
  142. package/build/queries/text-chat/category.js +45 -0
  143. package/build/queries/text-chat/index.d.ts +472 -0
  144. package/build/queries/text-chat/index.d.ts.map +1 -0
  145. package/build/queries/text-chat/index.js +61 -0
  146. package/commands/auth/change-password.command.ts +1 -0
  147. package/commands/auth/index.ts +1 -0
  148. package/commands/auth/login.command.ts +1 -0
  149. package/commands/auth/refresh.command.ts +15 -0
  150. package/commands/auth/register.command.ts +1 -0
  151. package/commands/auth/reset-password.command.ts +1 -0
  152. package/commands/auth/verify-email.command.ts +2 -1
  153. package/commands/auth/vk-login.command.ts +1 -0
  154. package/commands/auth/yandex-login.command.ts +1 -0
  155. package/commands/catalog/index.ts +26 -0
  156. package/commands/index.ts +2 -0
  157. package/commands/product/fast-buy-product.command.ts +2 -1
  158. package/commands/subscription/fast-buy-subscription.command.ts +2 -1
  159. package/commands/text-chat/category.ts +42 -0
  160. package/commands/text-chat/index.ts +71 -0
  161. package/constants/catalog.ts +4 -0
  162. package/constants/errors/errors.ts +78 -0
  163. package/constants/files/enums/file-type.enum.ts +2 -0
  164. package/constants/index.ts +3 -0
  165. package/constants/text-chat/attachments.ts +55 -0
  166. package/constants/text-chat/index.ts +43 -0
  167. package/constants/text-provider/index.ts +42 -0
  168. package/constants/tools/enums/tool-type.enum.ts +1 -0
  169. package/helpers/index.ts +1 -0
  170. package/helpers/text-chat/index.ts +91 -0
  171. package/models/catalog/index.ts +35 -0
  172. package/models/index.ts +2 -0
  173. package/models/page.schema.ts +1 -0
  174. package/models/text-chat/category.schema.ts +40 -0
  175. package/models/text-chat/index.ts +82 -0
  176. package/models/text-chat/provider-config.schema.ts +47 -0
  177. package/models/text-chat/stream.schema.ts +43 -0
  178. package/models/user.schema.ts +3 -1
  179. package/package.json +1 -1
  180. package/queries/catalog/index.ts +29 -0
  181. package/queries/index.ts +2 -0
  182. package/queries/subscription/get-subscriptions-summary.command.ts +1 -0
  183. package/queries/text-chat/category.ts +51 -0
  184. package/queries/text-chat/index.ts +56 -0
@@ -0,0 +1,319 @@
1
+ import { z } from 'zod';
2
+ import { FILE_TYPE, TEXT_CHAT_ERROR_CODE, TEXT_CHAT_MESSAGE_ROLE, TEXT_CHAT_MESSAGE_STATUS, TOOL_MODEL_STATUS } from '../../constants';
3
+ export * from './stream.schema';
4
+ export * from './provider-config.schema';
5
+ export * from './category.schema';
6
+ export declare const TextChatFileSchema: z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ name: z.ZodString;
9
+ key: z.ZodString;
10
+ url: z.ZodString;
11
+ mimeType: z.ZodString;
12
+ size: z.ZodNumber;
13
+ createdAt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
14
+ } & {
15
+ type: z.ZodEnum<[FILE_TYPE.IMAGE, FILE_TYPE.TEXT, FILE_TYPE.DOCUMENT]>;
16
+ contentLength: z.ZodNullable<z.ZodNumber>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ uuid: string;
19
+ name: string;
20
+ key: string;
21
+ url: string;
22
+ mimeType: string;
23
+ size: number;
24
+ createdAt?: string | Date | undefined;
25
+ type: FILE_TYPE.IMAGE | FILE_TYPE.TEXT | FILE_TYPE.DOCUMENT;
26
+ contentLength: number | null;
27
+ }, {
28
+ uuid: string;
29
+ name: string;
30
+ key: string;
31
+ url: string;
32
+ mimeType: string;
33
+ size: number;
34
+ createdAt?: string | Date | undefined;
35
+ type: FILE_TYPE.IMAGE | FILE_TYPE.TEXT | FILE_TYPE.DOCUMENT;
36
+ contentLength: number | null;
37
+ }>;
38
+ export type TextChatFile = z.infer<typeof TextChatFileSchema>;
39
+ export declare const TextChatModelSchema: z.ZodObject<{
40
+ uuid: z.ZodString;
41
+ title: z.ZodString;
42
+ model: z.ZodString;
43
+ description: z.ZodString;
44
+ status: z.ZodNativeEnum<typeof TOOL_MODEL_STATUS>;
45
+ canUse: z.ZodBoolean;
46
+ unlockedBy: z.ZodNullable<z.ZodObject<{
47
+ uuid: z.ZodString;
48
+ name: z.ZodString;
49
+ }, "strip", z.ZodTypeAny, {
50
+ uuid: string;
51
+ name: string;
52
+ }, {
53
+ uuid: string;
54
+ name: string;
55
+ }>>;
56
+ supportsImageAttachment: z.ZodBoolean;
57
+ maxPromptLength: z.ZodNumber;
58
+ maxContextCharacters: z.ZodNumber;
59
+ order: z.ZodNumber;
60
+ }, "strip", z.ZodTypeAny, {
61
+ uuid: string;
62
+ title: string;
63
+ model: string;
64
+ description: string;
65
+ status: TOOL_MODEL_STATUS;
66
+ canUse: boolean;
67
+ unlockedBy: {
68
+ uuid: string;
69
+ name: string;
70
+ } | null;
71
+ supportsImageAttachment: boolean;
72
+ maxPromptLength: number;
73
+ maxContextCharacters: number;
74
+ order: number;
75
+ }, {
76
+ uuid: string;
77
+ title: string;
78
+ model: string;
79
+ description: string;
80
+ status: TOOL_MODEL_STATUS;
81
+ canUse: boolean;
82
+ unlockedBy: {
83
+ uuid: string;
84
+ name: string;
85
+ } | null;
86
+ supportsImageAttachment: boolean;
87
+ maxPromptLength: number;
88
+ maxContextCharacters: number;
89
+ order: number;
90
+ }>;
91
+ export type TextChatModel = z.infer<typeof TextChatModelSchema>;
92
+ export declare const TextChatConfigSchema: z.ZodObject<{
93
+ models: z.ZodArray<z.ZodObject<{
94
+ uuid: z.ZodString;
95
+ title: z.ZodString;
96
+ model: z.ZodString;
97
+ description: z.ZodString;
98
+ status: z.ZodNativeEnum<typeof TOOL_MODEL_STATUS>;
99
+ canUse: z.ZodBoolean;
100
+ unlockedBy: z.ZodNullable<z.ZodObject<{
101
+ uuid: z.ZodString;
102
+ name: z.ZodString;
103
+ }, "strip", z.ZodTypeAny, {
104
+ uuid: string;
105
+ name: string;
106
+ }, {
107
+ uuid: string;
108
+ name: string;
109
+ }>>;
110
+ supportsImageAttachment: z.ZodBoolean;
111
+ maxPromptLength: z.ZodNumber;
112
+ maxContextCharacters: z.ZodNumber;
113
+ order: z.ZodNumber;
114
+ }, "strip", z.ZodTypeAny, {
115
+ uuid: string;
116
+ title: string;
117
+ model: string;
118
+ description: string;
119
+ status: TOOL_MODEL_STATUS;
120
+ canUse: boolean;
121
+ unlockedBy: {
122
+ uuid: string;
123
+ name: string;
124
+ } | null;
125
+ supportsImageAttachment: boolean;
126
+ maxPromptLength: number;
127
+ maxContextCharacters: number;
128
+ order: number;
129
+ }, {
130
+ uuid: string;
131
+ title: string;
132
+ model: string;
133
+ description: string;
134
+ status: TOOL_MODEL_STATUS;
135
+ canUse: boolean;
136
+ unlockedBy: {
137
+ uuid: string;
138
+ name: string;
139
+ } | null;
140
+ supportsImageAttachment: boolean;
141
+ maxPromptLength: number;
142
+ maxContextCharacters: number;
143
+ order: number;
144
+ }>, "many">;
145
+ maxFileAttachments: z.ZodNumber;
146
+ maxImageUploadSize: z.ZodNumber;
147
+ maxDocumentUploadSize: z.ZodNumber;
148
+ maxTextUploadSize: z.ZodNumber;
149
+ isAttachmentAvailable: z.ZodLiteral<true>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ models: {
152
+ uuid: string;
153
+ title: string;
154
+ model: string;
155
+ description: string;
156
+ status: TOOL_MODEL_STATUS;
157
+ canUse: boolean;
158
+ unlockedBy: {
159
+ uuid: string;
160
+ name: string;
161
+ } | null;
162
+ supportsImageAttachment: boolean;
163
+ maxPromptLength: number;
164
+ maxContextCharacters: number;
165
+ order: number;
166
+ }[];
167
+ maxFileAttachments: number;
168
+ maxImageUploadSize: number;
169
+ maxDocumentUploadSize: number;
170
+ maxTextUploadSize: number;
171
+ isAttachmentAvailable: true;
172
+ }, {
173
+ models: {
174
+ uuid: string;
175
+ title: string;
176
+ model: string;
177
+ description: string;
178
+ status: TOOL_MODEL_STATUS;
179
+ canUse: boolean;
180
+ unlockedBy: {
181
+ uuid: string;
182
+ name: string;
183
+ } | null;
184
+ supportsImageAttachment: boolean;
185
+ maxPromptLength: number;
186
+ maxContextCharacters: number;
187
+ order: number;
188
+ }[];
189
+ maxFileAttachments: number;
190
+ maxImageUploadSize: number;
191
+ maxDocumentUploadSize: number;
192
+ maxTextUploadSize: number;
193
+ isAttachmentAvailable: true;
194
+ }>;
195
+ export type TextChatConfig = z.infer<typeof TextChatConfigSchema>;
196
+ export declare const TextChatSchema: z.ZodObject<{
197
+ uuid: z.ZodString;
198
+ title: z.ZodString;
199
+ categoryId: z.ZodNullable<z.ZodString>;
200
+ lastUsedAiModelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
201
+ createdAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
202
+ updatedAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ uuid: string;
205
+ title: string;
206
+ categoryId: string | null;
207
+ lastUsedAiModelId?: string | null | undefined;
208
+ createdAt: string | Date;
209
+ updatedAt: string | Date;
210
+ }, {
211
+ uuid: string;
212
+ title: string;
213
+ categoryId: string | null;
214
+ lastUsedAiModelId?: string | null | undefined;
215
+ createdAt: string | Date;
216
+ updatedAt: string | Date;
217
+ }>;
218
+ export type TextChat = z.infer<typeof TextChatSchema>;
219
+ export declare const TextChatMessageSchema: z.ZodObject<{
220
+ uuid: z.ZodString;
221
+ chatId: z.ZodString;
222
+ role: z.ZodNativeEnum<typeof TEXT_CHAT_MESSAGE_ROLE>;
223
+ status: z.ZodNativeEnum<typeof TEXT_CHAT_MESSAGE_STATUS>;
224
+ text: z.ZodString;
225
+ modelId: z.ZodNullable<z.ZodString>;
226
+ files: z.ZodArray<z.ZodObject<{
227
+ uuid: z.ZodString;
228
+ name: z.ZodString;
229
+ key: z.ZodString;
230
+ url: z.ZodString;
231
+ mimeType: z.ZodString;
232
+ size: z.ZodNumber;
233
+ createdAt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
234
+ } & {
235
+ type: z.ZodEnum<[FILE_TYPE.IMAGE, FILE_TYPE.TEXT, FILE_TYPE.DOCUMENT]>;
236
+ contentLength: z.ZodNullable<z.ZodNumber>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ uuid: string;
239
+ name: string;
240
+ key: string;
241
+ url: string;
242
+ mimeType: string;
243
+ size: number;
244
+ createdAt?: string | Date | undefined;
245
+ type: FILE_TYPE.IMAGE | FILE_TYPE.TEXT | FILE_TYPE.DOCUMENT;
246
+ contentLength: number | null;
247
+ }, {
248
+ uuid: string;
249
+ name: string;
250
+ key: string;
251
+ url: string;
252
+ mimeType: string;
253
+ size: number;
254
+ createdAt?: string | Date | undefined;
255
+ type: FILE_TYPE.IMAGE | FILE_TYPE.TEXT | FILE_TYPE.DOCUMENT;
256
+ contentLength: number | null;
257
+ }>, "many">;
258
+ errorCode: z.ZodNullable<z.ZodNativeEnum<typeof TEXT_CHAT_ERROR_CODE>>;
259
+ price: z.ZodNullable<z.ZodNumber>;
260
+ createdAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
261
+ }, "strip", z.ZodTypeAny, {
262
+ uuid: string;
263
+ chatId: string;
264
+ role: TEXT_CHAT_MESSAGE_ROLE;
265
+ status: TEXT_CHAT_MESSAGE_STATUS;
266
+ text: string;
267
+ modelId: string | null;
268
+ files: {
269
+ uuid: string;
270
+ name: string;
271
+ key: string;
272
+ url: string;
273
+ mimeType: string;
274
+ size: number;
275
+ createdAt?: string | Date | undefined;
276
+ type: FILE_TYPE.IMAGE | FILE_TYPE.TEXT | FILE_TYPE.DOCUMENT;
277
+ contentLength: number | null;
278
+ }[];
279
+ errorCode: TEXT_CHAT_ERROR_CODE | null;
280
+ price: number | null;
281
+ createdAt: string | Date;
282
+ }, {
283
+ uuid: string;
284
+ chatId: string;
285
+ role: TEXT_CHAT_MESSAGE_ROLE;
286
+ status: TEXT_CHAT_MESSAGE_STATUS;
287
+ text: string;
288
+ modelId: string | null;
289
+ files: {
290
+ uuid: string;
291
+ name: string;
292
+ key: string;
293
+ url: string;
294
+ mimeType: string;
295
+ size: number;
296
+ createdAt?: string | Date | undefined;
297
+ type: FILE_TYPE.IMAGE | FILE_TYPE.TEXT | FILE_TYPE.DOCUMENT;
298
+ contentLength: number | null;
299
+ }[];
300
+ errorCode: TEXT_CHAT_ERROR_CODE | null;
301
+ price: number | null;
302
+ createdAt: string | Date;
303
+ }>;
304
+ export type TextChatMessage = z.infer<typeof TextChatMessageSchema>;
305
+ export declare const TextChatPriceSchema: z.ZodObject<{
306
+ price: z.ZodNumber;
307
+ charsUntilNextPriceIncrease: z.ZodNullable<z.ZodNumber>;
308
+ charsUntilNextPriceDecrease: z.ZodNullable<z.ZodNumber>;
309
+ }, "strip", z.ZodTypeAny, {
310
+ price: number;
311
+ charsUntilNextPriceIncrease: number | null;
312
+ charsUntilNextPriceDecrease: number | null;
313
+ }, {
314
+ price: number;
315
+ charsUntilNextPriceIncrease: number | null;
316
+ charsUntilNextPriceDecrease: number | null;
317
+ }>;
318
+ export type TextChatPrice = z.infer<typeof TextChatPriceSchema>;
319
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../models/text-chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACpB,MAAM,iBAAiB,CAAC;AAIzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAKlC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EASzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAK9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.TextChatPriceSchema = exports.TextChatMessageSchema = exports.TextChatSchema = exports.TextChatConfigSchema = exports.TextChatModelSchema = exports.TextChatFileSchema = void 0;
18
+ const zod_1 = require("zod");
19
+ const constants_1 = require("../../constants");
20
+ const file_schema_1 = require("../file.schema");
21
+ const unlocked_by_subscription_schema_1 = require("../unlocked-by-subscription.schema");
22
+ __exportStar(require("./stream.schema"), exports);
23
+ __exportStar(require("./provider-config.schema"), exports);
24
+ __exportStar(require("./category.schema"), exports);
25
+ const CountSchema = zod_1.z.number().int().safe().nonnegative();
26
+ const TimestampSchema = zod_1.z.string().datetime().or(zod_1.z.date());
27
+ exports.TextChatFileSchema = file_schema_1.FileSchema.extend({
28
+ type: zod_1.z.enum([constants_1.FILE_TYPE.IMAGE, constants_1.FILE_TYPE.TEXT, constants_1.FILE_TYPE.DOCUMENT]),
29
+ contentLength: CountSchema.nullable(),
30
+ });
31
+ exports.TextChatModelSchema = zod_1.z.object({
32
+ uuid: zod_1.z.string().uuid(),
33
+ title: zod_1.z.string(),
34
+ model: zod_1.z.string(),
35
+ description: zod_1.z.string(),
36
+ status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
37
+ canUse: zod_1.z.boolean(),
38
+ unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
39
+ supportsImageAttachment: zod_1.z.boolean(),
40
+ maxPromptLength: CountSchema.positive(),
41
+ maxContextCharacters: CountSchema.positive(),
42
+ order: zod_1.z.number().int(),
43
+ });
44
+ exports.TextChatConfigSchema = zod_1.z.object({
45
+ models: zod_1.z.array(exports.TextChatModelSchema),
46
+ maxFileAttachments: CountSchema.positive(),
47
+ maxImageUploadSize: CountSchema.positive(),
48
+ maxDocumentUploadSize: CountSchema.positive(),
49
+ maxTextUploadSize: CountSchema.positive(),
50
+ isAttachmentAvailable: zod_1.z.literal(true),
51
+ });
52
+ exports.TextChatSchema = zod_1.z.object({
53
+ uuid: zod_1.z.string().uuid(),
54
+ title: zod_1.z.string(),
55
+ // Independent Page.categoryId; immutable after creation.
56
+ categoryId: zod_1.z.string().uuid().nullable(),
57
+ // Optional for legacy servers; only successful assistant messages determine this value.
58
+ lastUsedAiModelId: zod_1.z.string().uuid().nullable().optional(),
59
+ createdAt: TimestampSchema,
60
+ updatedAt: TimestampSchema,
61
+ });
62
+ exports.TextChatMessageSchema = zod_1.z.object({
63
+ uuid: zod_1.z.string().uuid(),
64
+ chatId: zod_1.z.string().uuid(),
65
+ role: zod_1.z.nativeEnum(constants_1.TEXT_CHAT_MESSAGE_ROLE),
66
+ status: zod_1.z.nativeEnum(constants_1.TEXT_CHAT_MESSAGE_STATUS),
67
+ text: zod_1.z.string(),
68
+ modelId: zod_1.z.string().uuid().nullable(),
69
+ files: zod_1.z.array(exports.TextChatFileSchema),
70
+ errorCode: zod_1.z.nativeEnum(constants_1.TEXT_CHAT_ERROR_CODE).nullable(),
71
+ price: CountSchema.nullable(),
72
+ createdAt: TimestampSchema,
73
+ });
74
+ exports.TextChatPriceSchema = zod_1.z.object({
75
+ price: CountSchema.positive(),
76
+ // Distances from the requested draft inputLength; null means no boundary in that direction.
77
+ charsUntilNextPriceIncrease: CountSchema.positive().nullable(),
78
+ charsUntilNextPriceDecrease: CountSchema.positive().nullable(),
79
+ });
@@ -0,0 +1,92 @@
1
+ import { z } from 'zod';
2
+ import { TEXT_PROVIDER_CODE } from '../../constants/text-provider';
3
+ import { TOOL_MODEL_STATUS } from '../../constants/tools';
4
+ /** Deployment configuration only. Never accepted as a chat request or exposed by public config. */
5
+ export declare const TextProviderSeedSchema: z.ZodEffects<z.ZodObject<{
6
+ providers: z.ZodArray<z.ZodObject<{
7
+ code: z.ZodNativeEnum<typeof TEXT_PROVIDER_CODE>;
8
+ title: z.ZodString;
9
+ status: z.ZodNativeEnum<typeof TOOL_MODEL_STATUS>;
10
+ }, "strict", z.ZodTypeAny, {
11
+ code: TEXT_PROVIDER_CODE;
12
+ title: string;
13
+ status: TOOL_MODEL_STATUS;
14
+ }, {
15
+ code: TEXT_PROVIDER_CODE;
16
+ title: string;
17
+ status: TOOL_MODEL_STATUS;
18
+ }>, "many">;
19
+ links: z.ZodArray<z.ZodObject<{
20
+ modelId: z.ZodString;
21
+ providerCode: z.ZodNativeEnum<typeof TEXT_PROVIDER_CODE>;
22
+ providerModel: z.ZodString;
23
+ priority: z.ZodNumber;
24
+ trafficPercent: z.ZodNumber;
25
+ }, "strict", z.ZodTypeAny, {
26
+ modelId: string;
27
+ providerCode: TEXT_PROVIDER_CODE;
28
+ providerModel: string;
29
+ priority: number;
30
+ trafficPercent: number;
31
+ }, {
32
+ modelId: string;
33
+ providerCode: TEXT_PROVIDER_CODE;
34
+ providerModel: string;
35
+ priority: number;
36
+ trafficPercent: number;
37
+ }>, "many">;
38
+ }, "strict", z.ZodTypeAny, {
39
+ providers: {
40
+ code: TEXT_PROVIDER_CODE;
41
+ title: string;
42
+ status: TOOL_MODEL_STATUS;
43
+ }[];
44
+ links: {
45
+ modelId: string;
46
+ providerCode: TEXT_PROVIDER_CODE;
47
+ providerModel: string;
48
+ priority: number;
49
+ trafficPercent: number;
50
+ }[];
51
+ }, {
52
+ providers: {
53
+ code: TEXT_PROVIDER_CODE;
54
+ title: string;
55
+ status: TOOL_MODEL_STATUS;
56
+ }[];
57
+ links: {
58
+ modelId: string;
59
+ providerCode: TEXT_PROVIDER_CODE;
60
+ providerModel: string;
61
+ priority: number;
62
+ trafficPercent: number;
63
+ }[];
64
+ }>, {
65
+ providers: {
66
+ code: TEXT_PROVIDER_CODE;
67
+ title: string;
68
+ status: TOOL_MODEL_STATUS;
69
+ }[];
70
+ links: {
71
+ modelId: string;
72
+ providerCode: TEXT_PROVIDER_CODE;
73
+ providerModel: string;
74
+ priority: number;
75
+ trafficPercent: number;
76
+ }[];
77
+ }, {
78
+ providers: {
79
+ code: TEXT_PROVIDER_CODE;
80
+ title: string;
81
+ status: TOOL_MODEL_STATUS;
82
+ }[];
83
+ links: {
84
+ modelId: string;
85
+ providerCode: TEXT_PROVIDER_CODE;
86
+ providerModel: string;
87
+ priority: number;
88
+ trafficPercent: number;
89
+ }[];
90
+ }>;
91
+ export type TextProviderSeed = z.infer<typeof TextProviderSeedSchema>;
92
+ //# sourceMappingURL=provider-config.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-config.schema.d.ts","sourceRoot":"","sources":["../../../models/text-chat/provider-config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,mGAAmG;AACnG,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC7B,CAAC;AACP,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextProviderSeedSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const text_provider_1 = require("../../constants/text-provider");
6
+ const tools_1 = require("../../constants/tools");
7
+ /** Deployment configuration only. Never accepted as a chat request or exposed by public config. */
8
+ exports.TextProviderSeedSchema = zod_1.z
9
+ .object({
10
+ providers: zod_1.z
11
+ .array(zod_1.z
12
+ .object({
13
+ code: zod_1.z.nativeEnum(text_provider_1.TEXT_PROVIDER_CODE),
14
+ title: zod_1.z.string().trim().min(1),
15
+ status: zod_1.z.nativeEnum(tools_1.TOOL_MODEL_STATUS),
16
+ })
17
+ .strict())
18
+ .max(3),
19
+ links: zod_1.z.array(zod_1.z
20
+ .object({
21
+ modelId: zod_1.z.string().uuid(),
22
+ providerCode: zod_1.z.nativeEnum(text_provider_1.TEXT_PROVIDER_CODE),
23
+ providerModel: zod_1.z.string().trim().min(1),
24
+ priority: zod_1.z.number().int().safe(),
25
+ trafficPercent: zod_1.z.number().int().min(0).max(100),
26
+ })
27
+ .strict()),
28
+ })
29
+ .strict()
30
+ .superRefine((config, context) => {
31
+ if (new Set(config.providers.map((provider) => provider.code)).size !==
32
+ config.providers.length) {
33
+ context.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: 'Duplicate provider' });
34
+ }
35
+ const pairs = config.links.map((link) => `${link.modelId}:${link.providerCode}`);
36
+ if (new Set(pairs).size !== pairs.length) {
37
+ context.addIssue({
38
+ code: zod_1.z.ZodIssueCode.custom,
39
+ message: 'Duplicate model/provider link',
40
+ });
41
+ }
42
+ });
@@ -0,0 +1,83 @@
1
+ import { z } from 'zod';
2
+ import { TEXT_CHAT_ERROR_CODE, TEXT_CHAT_STREAM_EVENT } from '../../constants/text-chat';
3
+ export declare const TextChatStreamFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4
+ chatId: z.ZodString;
5
+ messageId: z.ZodString;
6
+ sequence: z.ZodNumber;
7
+ type: z.ZodLiteral<TEXT_CHAT_STREAM_EVENT.START>;
8
+ userMessageId: z.ZodString;
9
+ modelId: z.ZodString;
10
+ }, "strict", z.ZodTypeAny, {
11
+ chatId: string;
12
+ messageId: string;
13
+ sequence: number;
14
+ type: TEXT_CHAT_STREAM_EVENT.START;
15
+ userMessageId: string;
16
+ modelId: string;
17
+ }, {
18
+ chatId: string;
19
+ messageId: string;
20
+ sequence: number;
21
+ type: TEXT_CHAT_STREAM_EVENT.START;
22
+ userMessageId: string;
23
+ modelId: string;
24
+ }>, z.ZodObject<{
25
+ chatId: z.ZodString;
26
+ messageId: z.ZodString;
27
+ sequence: z.ZodNumber;
28
+ type: z.ZodLiteral<TEXT_CHAT_STREAM_EVENT.DELTA>;
29
+ delta: z.ZodString;
30
+ }, "strict", z.ZodTypeAny, {
31
+ chatId: string;
32
+ messageId: string;
33
+ sequence: number;
34
+ type: TEXT_CHAT_STREAM_EVENT.DELTA;
35
+ delta: string;
36
+ }, {
37
+ chatId: string;
38
+ messageId: string;
39
+ sequence: number;
40
+ type: TEXT_CHAT_STREAM_EVENT.DELTA;
41
+ delta: string;
42
+ }>, z.ZodObject<{
43
+ chatId: z.ZodString;
44
+ messageId: z.ZodString;
45
+ sequence: z.ZodNumber;
46
+ type: z.ZodLiteral<TEXT_CHAT_STREAM_EVENT.FINISH>;
47
+ price: z.ZodNumber;
48
+ }, "strict", z.ZodTypeAny, {
49
+ chatId: string;
50
+ messageId: string;
51
+ sequence: number;
52
+ type: TEXT_CHAT_STREAM_EVENT.FINISH;
53
+ price: number;
54
+ }, {
55
+ chatId: string;
56
+ messageId: string;
57
+ sequence: number;
58
+ type: TEXT_CHAT_STREAM_EVENT.FINISH;
59
+ price: number;
60
+ }>, z.ZodObject<{
61
+ chatId: z.ZodString;
62
+ messageId: z.ZodString;
63
+ sequence: z.ZodNumber;
64
+ type: z.ZodLiteral<TEXT_CHAT_STREAM_EVENT.ERROR>;
65
+ code: z.ZodNativeEnum<typeof TEXT_CHAT_ERROR_CODE>;
66
+ message: z.ZodOptional<z.ZodString>;
67
+ }, "strict", z.ZodTypeAny, {
68
+ chatId: string;
69
+ messageId: string;
70
+ sequence: number;
71
+ type: TEXT_CHAT_STREAM_EVENT.ERROR;
72
+ code: TEXT_CHAT_ERROR_CODE;
73
+ message?: string | undefined;
74
+ }, {
75
+ chatId: string;
76
+ messageId: string;
77
+ sequence: number;
78
+ type: TEXT_CHAT_STREAM_EVENT.ERROR;
79
+ code: TEXT_CHAT_ERROR_CODE;
80
+ message?: string | undefined;
81
+ }>]>;
82
+ export type TextChatStreamFrame = z.infer<typeof TextChatStreamFrameSchema>;
83
+ //# sourceMappingURL=stream.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.schema.d.ts","sourceRoot":"","sources":["../../../models/text-chat/stream.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAQzF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextChatStreamFrameSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const text_chat_1 = require("../../constants/text-chat");
6
+ const correlation = {
7
+ chatId: zod_1.z.string().uuid(),
8
+ messageId: zod_1.z.string().uuid(),
9
+ sequence: zod_1.z.number().int().safe().nonnegative(),
10
+ };
11
+ exports.TextChatStreamFrameSchema = zod_1.z.discriminatedUnion('type', [
12
+ zod_1.z
13
+ .object(Object.assign(Object.assign({}, correlation), { type: zod_1.z.literal(text_chat_1.TEXT_CHAT_STREAM_EVENT.START), userMessageId: zod_1.z.string().uuid(), modelId: zod_1.z.string().uuid() }))
14
+ .strict(),
15
+ zod_1.z
16
+ .object(Object.assign(Object.assign({}, correlation), { type: zod_1.z.literal(text_chat_1.TEXT_CHAT_STREAM_EVENT.DELTA), delta: zod_1.z.string().min(1) }))
17
+ .strict(),
18
+ zod_1.z
19
+ .object(Object.assign(Object.assign({}, correlation), { type: zod_1.z.literal(text_chat_1.TEXT_CHAT_STREAM_EVENT.FINISH), price: zod_1.z.number().int().safe().positive() }))
20
+ .strict(),
21
+ zod_1.z
22
+ .object(Object.assign(Object.assign({}, correlation), { type: zod_1.z.literal(text_chat_1.TEXT_CHAT_STREAM_EVENT.ERROR), code: zod_1.z.nativeEnum(text_chat_1.TEXT_CHAT_ERROR_CODE), message: zod_1.z.string().min(1).optional() }))
23
+ .strict(),
24
+ ]);
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { USER_ROLE, USER_STATUS } from '../constants';
3
+ export declare const EmailInputSchema: z.ZodString;
3
4
  export declare const UserSchema: z.ZodObject<{
4
5
  uuid: z.ZodOptional<z.ZodString>;
5
6
  siteId: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"user.schema.d.ts","sourceRoot":"","sources":["../../models/user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;EAOrB,CAAC"}
1
+ {"version":3,"file":"user.schema.d.ts","sourceRoot":"","sources":["../../models/user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,eAAO,MAAM,gBAAgB,aAA0C,CAAC;AAExE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;EAOrB,CAAC"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserSchema = void 0;
3
+ exports.UserSchema = exports.EmailInputSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
+ exports.EmailInputSchema = zod_1.z.string().trim().toLowerCase().email();
6
7
  exports.UserSchema = zod_1.z.object({
7
8
  uuid: zod_1.z.string().uuid().optional(),
8
9
  siteId: zod_1.z.string().uuid().optional(),
9
- email: zod_1.z.string().email(),
10
+ email: exports.EmailInputSchema,
10
11
  password: zod_1.z.string().min(6).max(128),
11
12
  role: zod_1.z.nativeEnum(constants_1.USER_ROLE).optional(),
12
13
  status: zod_1.z.nativeEnum(constants_1.USER_STATUS).optional(),