@purpleschool/multisite 0.0.35 → 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 (140) hide show
  1. package/api/controller/http/catalog.ts +6 -0
  2. package/api/controller/http/file.ts +1 -0
  3. package/api/controller/http/index.ts +2 -0
  4. package/api/controller/http/text-chat.ts +18 -0
  5. package/build/api/controller/http/catalog.d.ts +7 -0
  6. package/build/api/controller/http/catalog.d.ts.map +1 -0
  7. package/build/api/controller/http/catalog.js +9 -0
  8. package/build/api/controller/http/file.d.ts +1 -0
  9. package/build/api/controller/http/file.d.ts.map +1 -1
  10. package/build/api/controller/http/file.js +1 -0
  11. package/build/api/controller/http/index.d.ts +2 -0
  12. package/build/api/controller/http/index.d.ts.map +1 -1
  13. package/build/api/controller/http/index.js +2 -0
  14. package/build/api/controller/http/text-chat.d.ts +18 -0
  15. package/build/api/controller/http/text-chat.d.ts.map +1 -0
  16. package/build/api/controller/http/text-chat.js +20 -0
  17. package/build/commands/auth/verify-email.command.d.ts.map +1 -1
  18. package/build/commands/auth/verify-email.command.js +2 -1
  19. package/build/commands/catalog/index.d.ts +156 -0
  20. package/build/commands/catalog/index.d.ts.map +1 -0
  21. package/build/commands/catalog/index.js +23 -0
  22. package/build/commands/index.d.ts +2 -0
  23. package/build/commands/index.d.ts.map +1 -1
  24. package/build/commands/index.js +2 -0
  25. package/build/commands/page/create-page.command.d.ts +8 -0
  26. package/build/commands/page/create-page.command.d.ts.map +1 -1
  27. package/build/commands/page/find-page-by-alias.command.d.ts +16 -0
  28. package/build/commands/page/find-page-by-alias.command.d.ts.map +1 -1
  29. package/build/commands/page/find-page-by-criteria.command.d.ts +5 -0
  30. package/build/commands/page/find-page-by-criteria.command.d.ts.map +1 -1
  31. package/build/commands/page/find-page.command.d.ts +11 -0
  32. package/build/commands/page/find-page.command.d.ts.map +1 -1
  33. package/build/commands/page/update-page.command.d.ts +8 -0
  34. package/build/commands/page/update-page.command.d.ts.map +1 -1
  35. package/build/commands/product/fast-buy-product.command.d.ts.map +1 -1
  36. package/build/commands/product/fast-buy-product.command.js +2 -1
  37. package/build/commands/subscription/fast-buy-subscription.command.d.ts.map +1 -1
  38. package/build/commands/subscription/fast-buy-subscription.command.js +2 -1
  39. package/build/commands/text-chat/category.d.ts +321 -0
  40. package/build/commands/text-chat/category.d.ts.map +1 -0
  41. package/build/commands/text-chat/category.js +29 -0
  42. package/build/commands/text-chat/index.d.ts +292 -0
  43. package/build/commands/text-chat/index.d.ts.map +1 -0
  44. package/build/commands/text-chat/index.js +73 -0
  45. package/build/constants/catalog.d.ts +5 -0
  46. package/build/constants/catalog.d.ts.map +1 -0
  47. package/build/constants/catalog.js +8 -0
  48. package/build/constants/errors/errors.d.ts +72 -0
  49. package/build/constants/errors/errors.d.ts.map +1 -1
  50. package/build/constants/errors/errors.js +72 -0
  51. package/build/constants/files/enums/file-type.enum.d.ts +3 -1
  52. package/build/constants/files/enums/file-type.enum.d.ts.map +1 -1
  53. package/build/constants/files/enums/file-type.enum.js +2 -0
  54. package/build/constants/index.d.ts +3 -0
  55. package/build/constants/index.d.ts.map +1 -1
  56. package/build/constants/index.js +3 -0
  57. package/build/constants/text-chat/attachments.d.ts +12 -0
  58. package/build/constants/text-chat/attachments.d.ts.map +1 -0
  59. package/build/constants/text-chat/attachments.js +52 -0
  60. package/build/constants/text-chat/index.d.ts +38 -0
  61. package/build/constants/text-chat/index.d.ts.map +1 -0
  62. package/build/constants/text-chat/index.js +59 -0
  63. package/build/constants/text-provider/index.d.ts +37 -0
  64. package/build/constants/text-provider/index.d.ts.map +1 -0
  65. package/build/constants/text-provider/index.js +46 -0
  66. package/build/constants/tools/enums/tool-type.enum.d.ts +1 -0
  67. package/build/constants/tools/enums/tool-type.enum.d.ts.map +1 -1
  68. package/build/constants/tools/enums/tool-type.enum.js +1 -0
  69. package/build/helpers/index.d.ts +1 -0
  70. package/build/helpers/index.d.ts.map +1 -1
  71. package/build/helpers/index.js +1 -0
  72. package/build/helpers/text-chat/index.d.ts +23 -0
  73. package/build/helpers/text-chat/index.d.ts.map +1 -0
  74. package/build/helpers/text-chat/index.js +91 -0
  75. package/build/models/catalog/index.d.ts +181 -0
  76. package/build/models/catalog/index.d.ts.map +1 -0
  77. package/build/models/catalog/index.js +36 -0
  78. package/build/models/index.d.ts +2 -0
  79. package/build/models/index.d.ts.map +1 -1
  80. package/build/models/index.js +2 -0
  81. package/build/models/page.schema.d.ts +6 -0
  82. package/build/models/page.schema.d.ts.map +1 -1
  83. package/build/models/page.schema.js +1 -0
  84. package/build/models/text-chat/category.schema.d.ts +79 -0
  85. package/build/models/text-chat/category.schema.d.ts.map +1 -0
  86. package/build/models/text-chat/category.schema.js +38 -0
  87. package/build/models/text-chat/index.d.ts +319 -0
  88. package/build/models/text-chat/index.d.ts.map +1 -0
  89. package/build/models/text-chat/index.js +79 -0
  90. package/build/models/text-chat/provider-config.schema.d.ts +92 -0
  91. package/build/models/text-chat/provider-config.schema.d.ts.map +1 -0
  92. package/build/models/text-chat/provider-config.schema.js +42 -0
  93. package/build/models/text-chat/stream.schema.d.ts +83 -0
  94. package/build/models/text-chat/stream.schema.d.ts.map +1 -0
  95. package/build/models/text-chat/stream.schema.js +24 -0
  96. package/build/models/user.schema.d.ts +1 -0
  97. package/build/models/user.schema.d.ts.map +1 -1
  98. package/build/models/user.schema.js +3 -2
  99. package/build/queries/catalog/index.d.ts +259 -0
  100. package/build/queries/catalog/index.d.ts.map +1 -0
  101. package/build/queries/catalog/index.js +31 -0
  102. package/build/queries/index.d.ts +2 -0
  103. package/build/queries/index.d.ts.map +1 -1
  104. package/build/queries/index.js +2 -0
  105. package/build/queries/text-chat/category.d.ts +297 -0
  106. package/build/queries/text-chat/category.d.ts.map +1 -0
  107. package/build/queries/text-chat/category.js +45 -0
  108. package/build/queries/text-chat/index.d.ts +472 -0
  109. package/build/queries/text-chat/index.d.ts.map +1 -0
  110. package/build/queries/text-chat/index.js +61 -0
  111. package/commands/auth/verify-email.command.ts +2 -1
  112. package/commands/catalog/index.ts +26 -0
  113. package/commands/index.ts +2 -0
  114. package/commands/product/fast-buy-product.command.ts +2 -1
  115. package/commands/subscription/fast-buy-subscription.command.ts +2 -1
  116. package/commands/text-chat/category.ts +42 -0
  117. package/commands/text-chat/index.ts +71 -0
  118. package/constants/catalog.ts +4 -0
  119. package/constants/errors/errors.ts +73 -0
  120. package/constants/files/enums/file-type.enum.ts +2 -0
  121. package/constants/index.ts +3 -0
  122. package/constants/text-chat/attachments.ts +55 -0
  123. package/constants/text-chat/index.ts +43 -0
  124. package/constants/text-provider/index.ts +42 -0
  125. package/constants/tools/enums/tool-type.enum.ts +1 -0
  126. package/helpers/index.ts +1 -0
  127. package/helpers/text-chat/index.ts +91 -0
  128. package/models/catalog/index.ts +35 -0
  129. package/models/index.ts +2 -0
  130. package/models/page.schema.ts +1 -0
  131. package/models/text-chat/category.schema.ts +40 -0
  132. package/models/text-chat/index.ts +82 -0
  133. package/models/text-chat/provider-config.schema.ts +47 -0
  134. package/models/text-chat/stream.schema.ts +43 -0
  135. package/models/user.schema.ts +3 -1
  136. package/package.json +1 -1
  137. package/queries/catalog/index.ts +29 -0
  138. package/queries/index.ts +2 -0
  139. package/queries/text-chat/category.ts +51 -0
  140. package/queries/text-chat/index.ts +56 -0
@@ -0,0 +1,472 @@
1
+ import { z } from 'zod';
2
+ export * from './category';
3
+ export declare namespace GetTextChatConfigCommand {
4
+ const ResponseSchema: z.ZodObject<{
5
+ data: z.ZodObject<{
6
+ models: z.ZodArray<z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ title: z.ZodString;
9
+ model: z.ZodString;
10
+ description: z.ZodString;
11
+ status: z.ZodNativeEnum<typeof import("../..").TOOL_MODEL_STATUS>;
12
+ canUse: z.ZodBoolean;
13
+ unlockedBy: z.ZodNullable<z.ZodObject<{
14
+ uuid: z.ZodString;
15
+ name: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ uuid: string;
18
+ name: string;
19
+ }, {
20
+ uuid: string;
21
+ name: string;
22
+ }>>;
23
+ supportsImageAttachment: z.ZodBoolean;
24
+ maxPromptLength: z.ZodNumber;
25
+ maxContextCharacters: z.ZodNumber;
26
+ order: z.ZodNumber;
27
+ }, "strip", z.ZodTypeAny, {
28
+ uuid: string;
29
+ title: string;
30
+ model: string;
31
+ description: string;
32
+ status: import("../..").TOOL_MODEL_STATUS;
33
+ canUse: boolean;
34
+ unlockedBy: {
35
+ uuid: string;
36
+ name: string;
37
+ } | null;
38
+ supportsImageAttachment: boolean;
39
+ maxPromptLength: number;
40
+ maxContextCharacters: number;
41
+ order: number;
42
+ }, {
43
+ uuid: string;
44
+ title: string;
45
+ model: string;
46
+ description: string;
47
+ status: import("../..").TOOL_MODEL_STATUS;
48
+ canUse: boolean;
49
+ unlockedBy: {
50
+ uuid: string;
51
+ name: string;
52
+ } | null;
53
+ supportsImageAttachment: boolean;
54
+ maxPromptLength: number;
55
+ maxContextCharacters: number;
56
+ order: number;
57
+ }>, "many">;
58
+ maxFileAttachments: z.ZodNumber;
59
+ maxImageUploadSize: z.ZodNumber;
60
+ maxDocumentUploadSize: z.ZodNumber;
61
+ maxTextUploadSize: z.ZodNumber;
62
+ isAttachmentAvailable: z.ZodLiteral<true>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ models: {
65
+ uuid: string;
66
+ title: string;
67
+ model: string;
68
+ description: string;
69
+ status: import("../..").TOOL_MODEL_STATUS;
70
+ canUse: boolean;
71
+ unlockedBy: {
72
+ uuid: string;
73
+ name: string;
74
+ } | null;
75
+ supportsImageAttachment: boolean;
76
+ maxPromptLength: number;
77
+ maxContextCharacters: number;
78
+ order: number;
79
+ }[];
80
+ maxFileAttachments: number;
81
+ maxImageUploadSize: number;
82
+ maxDocumentUploadSize: number;
83
+ maxTextUploadSize: number;
84
+ isAttachmentAvailable: true;
85
+ }, {
86
+ models: {
87
+ uuid: string;
88
+ title: string;
89
+ model: string;
90
+ description: string;
91
+ status: import("../..").TOOL_MODEL_STATUS;
92
+ canUse: boolean;
93
+ unlockedBy: {
94
+ uuid: string;
95
+ name: string;
96
+ } | null;
97
+ supportsImageAttachment: boolean;
98
+ maxPromptLength: number;
99
+ maxContextCharacters: number;
100
+ order: number;
101
+ }[];
102
+ maxFileAttachments: number;
103
+ maxImageUploadSize: number;
104
+ maxDocumentUploadSize: number;
105
+ maxTextUploadSize: number;
106
+ isAttachmentAvailable: true;
107
+ }>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ data: {
110
+ models: {
111
+ uuid: string;
112
+ title: string;
113
+ model: string;
114
+ description: string;
115
+ status: import("../..").TOOL_MODEL_STATUS;
116
+ canUse: boolean;
117
+ unlockedBy: {
118
+ uuid: string;
119
+ name: string;
120
+ } | null;
121
+ supportsImageAttachment: boolean;
122
+ maxPromptLength: number;
123
+ maxContextCharacters: number;
124
+ order: number;
125
+ }[];
126
+ maxFileAttachments: number;
127
+ maxImageUploadSize: number;
128
+ maxDocumentUploadSize: number;
129
+ maxTextUploadSize: number;
130
+ isAttachmentAvailable: true;
131
+ };
132
+ }, {
133
+ data: {
134
+ models: {
135
+ uuid: string;
136
+ title: string;
137
+ model: string;
138
+ description: string;
139
+ status: import("../..").TOOL_MODEL_STATUS;
140
+ canUse: boolean;
141
+ unlockedBy: {
142
+ uuid: string;
143
+ name: string;
144
+ } | null;
145
+ supportsImageAttachment: boolean;
146
+ maxPromptLength: number;
147
+ maxContextCharacters: number;
148
+ order: number;
149
+ }[];
150
+ maxFileAttachments: number;
151
+ maxImageUploadSize: number;
152
+ maxDocumentUploadSize: number;
153
+ maxTextUploadSize: number;
154
+ isAttachmentAvailable: true;
155
+ };
156
+ }>;
157
+ type Response = z.infer<typeof ResponseSchema>;
158
+ }
159
+ export declare namespace FindTextChatsCommand {
160
+ const RequestQuerySchema: z.ZodObject<{
161
+ limit: z.ZodDefault<z.ZodNumber>;
162
+ offset: z.ZodDefault<z.ZodNumber>;
163
+ search: z.ZodOptional<z.ZodString>;
164
+ }, "strip", z.ZodTypeAny, {
165
+ limit: number;
166
+ offset: number;
167
+ search?: string | undefined;
168
+ }, {
169
+ limit?: number | undefined;
170
+ offset?: number | undefined;
171
+ search?: string | undefined;
172
+ }>;
173
+ type RequestQuery = z.infer<typeof RequestQuerySchema>;
174
+ const ResponseSchema: z.ZodObject<{
175
+ data: z.ZodArray<z.ZodObject<{
176
+ uuid: z.ZodString;
177
+ title: z.ZodString;
178
+ categoryId: z.ZodNullable<z.ZodString>;
179
+ lastUsedAiModelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
+ createdAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
181
+ updatedAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ uuid: string;
184
+ title: string;
185
+ categoryId: string | null;
186
+ lastUsedAiModelId?: string | null | undefined;
187
+ createdAt: string | Date;
188
+ updatedAt: string | Date;
189
+ }, {
190
+ uuid: string;
191
+ title: string;
192
+ categoryId: string | null;
193
+ lastUsedAiModelId?: string | null | undefined;
194
+ createdAt: string | Date;
195
+ updatedAt: string | Date;
196
+ }>, "many">;
197
+ meta: z.ZodObject<{
198
+ limit: z.ZodNumber;
199
+ offset: z.ZodNumber;
200
+ total: z.ZodNumber;
201
+ }, "strip", z.ZodTypeAny, {
202
+ limit: number;
203
+ offset: number;
204
+ total: number;
205
+ }, {
206
+ limit: number;
207
+ offset: number;
208
+ total: number;
209
+ }>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ data: {
212
+ uuid: string;
213
+ title: string;
214
+ categoryId: string | null;
215
+ lastUsedAiModelId?: string | null | undefined;
216
+ createdAt: string | Date;
217
+ updatedAt: string | Date;
218
+ }[];
219
+ meta: {
220
+ limit: number;
221
+ offset: number;
222
+ total: number;
223
+ };
224
+ }, {
225
+ data: {
226
+ uuid: string;
227
+ title: string;
228
+ categoryId: string | null;
229
+ lastUsedAiModelId?: string | null | undefined;
230
+ createdAt: string | Date;
231
+ updatedAt: string | Date;
232
+ }[];
233
+ meta: {
234
+ limit: number;
235
+ offset: number;
236
+ total: number;
237
+ };
238
+ }>;
239
+ type Response = z.infer<typeof ResponseSchema>;
240
+ }
241
+ export declare namespace GetTextChatCommand {
242
+ const RequestParamsSchema: z.ZodObject<{
243
+ uuid: z.ZodString;
244
+ }, "strip", z.ZodTypeAny, {
245
+ uuid: string;
246
+ }, {
247
+ uuid: string;
248
+ }>;
249
+ type RequestParams = z.infer<typeof RequestParamsSchema>;
250
+ const ResponseSchema: z.ZodObject<{
251
+ data: z.ZodObject<{
252
+ uuid: z.ZodString;
253
+ title: z.ZodString;
254
+ categoryId: z.ZodNullable<z.ZodString>;
255
+ lastUsedAiModelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
+ createdAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
257
+ updatedAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ uuid: string;
260
+ title: string;
261
+ categoryId: string | null;
262
+ lastUsedAiModelId?: string | null | undefined;
263
+ createdAt: string | Date;
264
+ updatedAt: string | Date;
265
+ }, {
266
+ uuid: string;
267
+ title: string;
268
+ categoryId: string | null;
269
+ lastUsedAiModelId?: string | null | undefined;
270
+ createdAt: string | Date;
271
+ updatedAt: string | Date;
272
+ }>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ data: {
275
+ uuid: string;
276
+ title: string;
277
+ categoryId: string | null;
278
+ lastUsedAiModelId?: string | null | undefined;
279
+ createdAt: string | Date;
280
+ updatedAt: string | Date;
281
+ };
282
+ }, {
283
+ data: {
284
+ uuid: string;
285
+ title: string;
286
+ categoryId: string | null;
287
+ lastUsedAiModelId?: string | null | undefined;
288
+ createdAt: string | Date;
289
+ updatedAt: string | Date;
290
+ };
291
+ }>;
292
+ type Response = z.infer<typeof ResponseSchema>;
293
+ }
294
+ export declare namespace FindTextChatMessagesCommand {
295
+ const RequestParamsSchema: z.ZodObject<{
296
+ uuid: z.ZodString;
297
+ }, "strip", z.ZodTypeAny, {
298
+ uuid: string;
299
+ }, {
300
+ uuid: string;
301
+ }>;
302
+ type RequestParams = z.infer<typeof RequestParamsSchema>;
303
+ const RequestQuerySchema: z.ZodObject<{
304
+ limit: z.ZodDefault<z.ZodNumber>;
305
+ offset: z.ZodDefault<z.ZodNumber>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ limit: number;
308
+ offset: number;
309
+ }, {
310
+ limit?: number | undefined;
311
+ offset?: number | undefined;
312
+ }>;
313
+ type RequestQuery = z.infer<typeof RequestQuerySchema>;
314
+ const ResponseSchema: z.ZodObject<{
315
+ data: z.ZodArray<z.ZodObject<{
316
+ uuid: z.ZodString;
317
+ chatId: z.ZodString;
318
+ role: z.ZodNativeEnum<typeof import("../..").TEXT_CHAT_MESSAGE_ROLE>;
319
+ status: z.ZodNativeEnum<typeof import("../..").TEXT_CHAT_MESSAGE_STATUS>;
320
+ text: z.ZodString;
321
+ modelId: z.ZodNullable<z.ZodString>;
322
+ files: z.ZodArray<z.ZodObject<{
323
+ uuid: z.ZodString;
324
+ name: z.ZodString;
325
+ key: z.ZodString;
326
+ url: z.ZodString;
327
+ mimeType: z.ZodString;
328
+ size: z.ZodNumber;
329
+ createdAt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
330
+ } & {
331
+ type: z.ZodEnum<[import("../..").FILE_TYPE.IMAGE, import("../..").FILE_TYPE.TEXT, import("../..").FILE_TYPE.DOCUMENT]>;
332
+ contentLength: z.ZodNullable<z.ZodNumber>;
333
+ }, "strip", z.ZodTypeAny, {
334
+ uuid: string;
335
+ name: string;
336
+ key: string;
337
+ url: string;
338
+ mimeType: string;
339
+ size: number;
340
+ createdAt?: string | Date | undefined;
341
+ type: import("../..").FILE_TYPE.IMAGE | import("../..").FILE_TYPE.TEXT | import("../..").FILE_TYPE.DOCUMENT;
342
+ contentLength: number | null;
343
+ }, {
344
+ uuid: string;
345
+ name: string;
346
+ key: string;
347
+ url: string;
348
+ mimeType: string;
349
+ size: number;
350
+ createdAt?: string | Date | undefined;
351
+ type: import("../..").FILE_TYPE.IMAGE | import("../..").FILE_TYPE.TEXT | import("../..").FILE_TYPE.DOCUMENT;
352
+ contentLength: number | null;
353
+ }>, "many">;
354
+ errorCode: z.ZodNullable<z.ZodNativeEnum<typeof import("../..").TEXT_CHAT_ERROR_CODE>>;
355
+ price: z.ZodNullable<z.ZodNumber>;
356
+ createdAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
357
+ }, "strip", z.ZodTypeAny, {
358
+ uuid: string;
359
+ chatId: string;
360
+ role: import("../..").TEXT_CHAT_MESSAGE_ROLE;
361
+ status: import("../..").TEXT_CHAT_MESSAGE_STATUS;
362
+ text: string;
363
+ modelId: string | null;
364
+ files: {
365
+ uuid: string;
366
+ name: string;
367
+ key: string;
368
+ url: string;
369
+ mimeType: string;
370
+ size: number;
371
+ createdAt?: string | Date | undefined;
372
+ type: import("../..").FILE_TYPE.IMAGE | import("../..").FILE_TYPE.TEXT | import("../..").FILE_TYPE.DOCUMENT;
373
+ contentLength: number | null;
374
+ }[];
375
+ errorCode: import("../..").TEXT_CHAT_ERROR_CODE | null;
376
+ price: number | null;
377
+ createdAt: string | Date;
378
+ }, {
379
+ uuid: string;
380
+ chatId: string;
381
+ role: import("../..").TEXT_CHAT_MESSAGE_ROLE;
382
+ status: import("../..").TEXT_CHAT_MESSAGE_STATUS;
383
+ text: string;
384
+ modelId: string | null;
385
+ files: {
386
+ uuid: string;
387
+ name: string;
388
+ key: string;
389
+ url: string;
390
+ mimeType: string;
391
+ size: number;
392
+ createdAt?: string | Date | undefined;
393
+ type: import("../..").FILE_TYPE.IMAGE | import("../..").FILE_TYPE.TEXT | import("../..").FILE_TYPE.DOCUMENT;
394
+ contentLength: number | null;
395
+ }[];
396
+ errorCode: import("../..").TEXT_CHAT_ERROR_CODE | null;
397
+ price: number | null;
398
+ createdAt: string | Date;
399
+ }>, "many">;
400
+ meta: z.ZodObject<{
401
+ limit: z.ZodNumber;
402
+ offset: z.ZodNumber;
403
+ total: z.ZodNumber;
404
+ }, "strip", z.ZodTypeAny, {
405
+ limit: number;
406
+ offset: number;
407
+ total: number;
408
+ }, {
409
+ limit: number;
410
+ offset: number;
411
+ total: number;
412
+ }>;
413
+ }, "strip", z.ZodTypeAny, {
414
+ data: {
415
+ uuid: string;
416
+ chatId: string;
417
+ role: import("../..").TEXT_CHAT_MESSAGE_ROLE;
418
+ status: import("../..").TEXT_CHAT_MESSAGE_STATUS;
419
+ text: string;
420
+ modelId: string | null;
421
+ files: {
422
+ uuid: string;
423
+ name: string;
424
+ key: string;
425
+ url: string;
426
+ mimeType: string;
427
+ size: number;
428
+ createdAt?: string | Date | undefined;
429
+ type: import("../..").FILE_TYPE.IMAGE | import("../..").FILE_TYPE.TEXT | import("../..").FILE_TYPE.DOCUMENT;
430
+ contentLength: number | null;
431
+ }[];
432
+ errorCode: import("../..").TEXT_CHAT_ERROR_CODE | null;
433
+ price: number | null;
434
+ createdAt: string | Date;
435
+ }[];
436
+ meta: {
437
+ limit: number;
438
+ offset: number;
439
+ total: number;
440
+ };
441
+ }, {
442
+ data: {
443
+ uuid: string;
444
+ chatId: string;
445
+ role: import("../..").TEXT_CHAT_MESSAGE_ROLE;
446
+ status: import("../..").TEXT_CHAT_MESSAGE_STATUS;
447
+ text: string;
448
+ modelId: string | null;
449
+ files: {
450
+ uuid: string;
451
+ name: string;
452
+ key: string;
453
+ url: string;
454
+ mimeType: string;
455
+ size: number;
456
+ createdAt?: string | Date | undefined;
457
+ type: import("../..").FILE_TYPE.IMAGE | import("../..").FILE_TYPE.TEXT | import("../..").FILE_TYPE.DOCUMENT;
458
+ contentLength: number | null;
459
+ }[];
460
+ errorCode: import("../..").TEXT_CHAT_ERROR_CODE | null;
461
+ price: number | null;
462
+ createdAt: string | Date;
463
+ }[];
464
+ meta: {
465
+ limit: number;
466
+ offset: number;
467
+ total: number;
468
+ };
469
+ }>;
470
+ type Response = z.infer<typeof ResponseSchema>;
471
+ }
472
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../queries/text-chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,cAAc,YAAY,CAAC;AAO3B,yBAAiB,wBAAwB,CAAC;IAC/B,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA2C,CAAC;IACvE,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD;AAED,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,kBAAkB;;;;;;;;;;;;MAI7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IACvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAOzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD;AAED,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,mBAAmB;;;;;;MAAwC,CAAC;IACzE,KAAY,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;IACzD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAqC,CAAC;IACjE,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD;AAED,yBAAiB,2BAA2B,CAAC;IAClC,MAAM,mBAAmB;;;;;;MAAwC,CAAC;IACzE,KAAY,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;IACzD,MAAM,kBAAkB;;;;;;;;;MAG7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IACvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAOzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,61 @@
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.FindTextChatMessagesCommand = exports.GetTextChatCommand = exports.FindTextChatsCommand = exports.GetTextChatConfigCommand = void 0;
18
+ const zod_1 = require("zod");
19
+ __exportStar(require("./category"), exports);
20
+ const text_chat_1 = require("../../models/text-chat");
21
+ var GetTextChatConfigCommand;
22
+ (function (GetTextChatConfigCommand) {
23
+ GetTextChatConfigCommand.ResponseSchema = zod_1.z.object({ data: text_chat_1.TextChatConfigSchema });
24
+ })(GetTextChatConfigCommand || (exports.GetTextChatConfigCommand = GetTextChatConfigCommand = {}));
25
+ var FindTextChatsCommand;
26
+ (function (FindTextChatsCommand) {
27
+ FindTextChatsCommand.RequestQuerySchema = zod_1.z.object({
28
+ limit: zod_1.z.coerce.number().int().min(1).max(100).default(20),
29
+ offset: zod_1.z.coerce.number().int().min(0).default(0),
30
+ search: zod_1.z.string().trim().max(200).optional(),
31
+ });
32
+ FindTextChatsCommand.ResponseSchema = zod_1.z.object({
33
+ data: zod_1.z.array(text_chat_1.TextChatSchema),
34
+ meta: zod_1.z.object({
35
+ limit: zod_1.z.number().int().positive(),
36
+ offset: zod_1.z.number().int().nonnegative(),
37
+ total: zod_1.z.number().int().nonnegative(),
38
+ }),
39
+ });
40
+ })(FindTextChatsCommand || (exports.FindTextChatsCommand = FindTextChatsCommand = {}));
41
+ var GetTextChatCommand;
42
+ (function (GetTextChatCommand) {
43
+ GetTextChatCommand.RequestParamsSchema = zod_1.z.object({ uuid: zod_1.z.string().uuid() });
44
+ GetTextChatCommand.ResponseSchema = zod_1.z.object({ data: text_chat_1.TextChatSchema });
45
+ })(GetTextChatCommand || (exports.GetTextChatCommand = GetTextChatCommand = {}));
46
+ var FindTextChatMessagesCommand;
47
+ (function (FindTextChatMessagesCommand) {
48
+ FindTextChatMessagesCommand.RequestParamsSchema = zod_1.z.object({ uuid: zod_1.z.string().uuid() });
49
+ FindTextChatMessagesCommand.RequestQuerySchema = zod_1.z.object({
50
+ limit: zod_1.z.coerce.number().int().min(1).max(100).default(50),
51
+ offset: zod_1.z.coerce.number().int().min(0).default(0),
52
+ });
53
+ FindTextChatMessagesCommand.ResponseSchema = zod_1.z.object({
54
+ data: zod_1.z.array(text_chat_1.TextChatMessageSchema),
55
+ meta: zod_1.z.object({
56
+ limit: zod_1.z.number().int().positive(),
57
+ offset: zod_1.z.number().int().nonnegative(),
58
+ total: zod_1.z.number().int().nonnegative(),
59
+ }),
60
+ });
61
+ })(FindTextChatMessagesCommand || (exports.FindTextChatMessagesCommand = FindTextChatMessagesCommand = {}));
@@ -1,9 +1,10 @@
1
1
  import { z } from 'zod';
2
+ import { EmailInputSchema } from '../../models/user.schema';
2
3
 
3
4
  export namespace VerifyEmailCommand {
4
5
  export const RequestSchema = z.object({
5
6
  verifyTokenHash: z.string().min(6),
6
- email: z.string().email(),
7
+ email: EmailInputSchema,
7
8
  });
8
9
 
9
10
  export type Request = z.infer<typeof RequestSchema>;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { CatalogGroupAdminSchema, CatalogGroupFieldsSchema } from '../../models/catalog';
3
+
4
+ export namespace CreateCatalogGroupCommand {
5
+ export const RequestSchema = CatalogGroupFieldsSchema.strict();
6
+ export type Request = z.infer<typeof RequestSchema>;
7
+ export const ResponseSchema = z.object({ data: CatalogGroupAdminSchema });
8
+ export type Response = z.infer<typeof ResponseSchema>;
9
+ }
10
+ export namespace UpdateCatalogGroupCommand {
11
+ export const RequestParamsSchema = z.object({ uuid: z.string().uuid() }).strict();
12
+ export const RequestSchema = CatalogGroupFieldsSchema.partial()
13
+ .strict()
14
+ .refine(
15
+ (input) => Object.values(input).some((value) => value !== undefined),
16
+ 'At least one field is required',
17
+ );
18
+ export type Request = z.infer<typeof RequestSchema>;
19
+ export const ResponseSchema = CreateCatalogGroupCommand.ResponseSchema;
20
+ export type Response = z.infer<typeof ResponseSchema>;
21
+ }
22
+ export namespace DeleteCatalogGroupCommand {
23
+ export const RequestParamsSchema = UpdateCatalogGroupCommand.RequestParamsSchema;
24
+ export const ResponseSchema = z.object({ data: z.object({ deleted: z.literal(true) }) });
25
+ export type Response = z.infer<typeof ResponseSchema>;
26
+ }
package/commands/index.ts CHANGED
@@ -13,3 +13,5 @@ export * from './unregistered-user';
13
13
  export * from './page';
14
14
  export * from './stt';
15
15
  export * from './tts';
16
+ export * from './text-chat';
17
+ export * from './catalog';
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { CloudPaymentsWidgetSchema } from '../../models';
3
+ import { EmailInputSchema } from '../../models/user.schema';
3
4
 
4
5
  export namespace FastBuyProductCommand {
5
6
  export const RequestParamSchema = z.object({
@@ -8,7 +9,7 @@ export namespace FastBuyProductCommand {
8
9
  export type RequestParam = z.infer<typeof RequestParamSchema>;
9
10
 
10
11
  export const RequestSchema = z.object({
11
- email: z.string().email(),
12
+ email: EmailInputSchema,
12
13
  partnerId: z.string().uuid().optional(),
13
14
  marketingConsent: z.boolean().optional().default(false),
14
15
  });
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { CloudPaymentsWidgetSchema } from '../../models';
3
+ import { EmailInputSchema } from '../../models/user.schema';
3
4
 
4
5
  export namespace FastBuySubscriptionCommand {
5
6
  export const RequestParamSchema = z.object({
@@ -8,7 +9,7 @@ export namespace FastBuySubscriptionCommand {
8
9
  export type RequestParam = z.infer<typeof RequestParamSchema>;
9
10
 
10
11
  export const RequestSchema = z.object({
11
- email: z.string().email(),
12
+ email: EmailInputSchema,
12
13
  partnerId: z.string().uuid().optional(),
13
14
  marketingConsent: z.boolean().optional().default(false),
14
15
  });
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ import {
3
+ TextChatCategoryAdminSchema,
4
+ TextChatCategoryFieldsSchema,
5
+ } from '../../models/text-chat/category.schema';
6
+
7
+ export namespace CreateTextChatCategoryCommand {
8
+ export const RequestSchema = TextChatCategoryFieldsSchema.strict();
9
+ export type Request = z.input<typeof RequestSchema>;
10
+ export const ResponseSchema = z.object({ data: TextChatCategoryAdminSchema });
11
+ export type Response = z.infer<typeof ResponseSchema>;
12
+ }
13
+
14
+ export namespace UpdateTextChatCategoryCommand {
15
+ export const RequestParamsSchema = z.object({ uuid: z.string().uuid() }).strict();
16
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
17
+ export const RequestSchema = TextChatCategoryFieldsSchema.partial()
18
+ .strict()
19
+ .refine(
20
+ (input) => Object.values(input).some((value) => value !== undefined),
21
+ 'At least one field is required',
22
+ );
23
+ export type Request = z.infer<typeof RequestSchema>;
24
+ export const ResponseSchema = CreateTextChatCategoryCommand.ResponseSchema;
25
+ export type Response = z.infer<typeof ResponseSchema>;
26
+ }
27
+
28
+ export namespace ArchiveTextChatCategoryCommand {
29
+ export const RequestParamsSchema = UpdateTextChatCategoryCommand.RequestParamsSchema;
30
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
31
+ export const RequestSchema = z.object({}).strict();
32
+ export type Request = z.infer<typeof RequestSchema>;
33
+ export const ResponseSchema = CreateTextChatCategoryCommand.ResponseSchema;
34
+ export type Response = z.infer<typeof ResponseSchema>;
35
+ }
36
+
37
+ export namespace DeleteTextChatCategoryCommand {
38
+ export const RequestParamsSchema = UpdateTextChatCategoryCommand.RequestParamsSchema;
39
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
40
+ export const ResponseSchema = z.object({ data: z.object({ deleted: z.literal(true) }) });
41
+ export type Response = z.infer<typeof ResponseSchema>;
42
+ }