@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
@@ -32,3 +32,5 @@ __exportStar(require("./page.schema"), exports);
32
32
  __exportStar(require("./page-question.schema"), exports);
33
33
  __exportStar(require("./stt"), exports);
34
34
  __exportStar(require("./tts"), exports);
35
+ __exportStar(require("./text-chat"), exports);
36
+ __exportStar(require("./catalog"), exports);
@@ -10,6 +10,7 @@ export declare const PageSchema: z.ZodObject<{
10
10
  alias: z.ZodString;
11
11
  toolType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof TOOL_TYPE>>>;
12
12
  toolOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ categoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
14
  createdAt: z.ZodDate;
14
15
  updatedAt: z.ZodDate;
15
16
  }, "strip", z.ZodTypeAny, {
@@ -22,6 +23,7 @@ export declare const PageSchema: z.ZodObject<{
22
23
  alias: string;
23
24
  toolType?: TOOL_TYPE | null | undefined;
24
25
  toolOptionId?: string | null | undefined;
26
+ categoryId?: string | null | undefined;
25
27
  createdAt: Date;
26
28
  updatedAt: Date;
27
29
  }, {
@@ -34,6 +36,7 @@ export declare const PageSchema: z.ZodObject<{
34
36
  alias: string;
35
37
  toolType?: TOOL_TYPE | null | undefined;
36
38
  toolOptionId?: string | null | undefined;
39
+ categoryId?: string | null | undefined;
37
40
  createdAt: Date;
38
41
  updatedAt: Date;
39
42
  }>;
@@ -47,6 +50,7 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
47
50
  alias: z.ZodString;
48
51
  toolType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof TOOL_TYPE>>>;
49
52
  toolOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ categoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
54
  createdAt: z.ZodDate;
51
55
  updatedAt: z.ZodDate;
52
56
  } & {
@@ -82,6 +86,7 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
82
86
  alias: string;
83
87
  toolType?: TOOL_TYPE | null | undefined;
84
88
  toolOptionId?: string | null | undefined;
89
+ categoryId?: string | null | undefined;
85
90
  createdAt: Date;
86
91
  updatedAt: Date;
87
92
  questions: {
@@ -102,6 +107,7 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
102
107
  alias: string;
103
108
  toolType?: TOOL_TYPE | null | undefined;
104
109
  toolOptionId?: string | null | undefined;
110
+ categoryId?: string | null | undefined;
105
111
  createdAt: Date;
106
112
  updatedAt: Date;
107
113
  questions: {
@@ -1 +1 @@
1
- {"version":3,"file":"page.schema.d.ts","sourceRoot":"","sources":["../../models/page.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYrB,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAC"}
1
+ {"version":3,"file":"page.schema.d.ts","sourceRoot":"","sources":["../../models/page.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarB,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAC"}
@@ -14,6 +14,7 @@ exports.PageSchema = zod_1.z.object({
14
14
  alias: zod_1.z.string().min(3).max(16384),
15
15
  toolType: zod_1.z.nativeEnum(constants_1.TOOL_TYPE).nullable().optional(),
16
16
  toolOptionId: zod_1.z.string().uuid().nullable().optional(),
17
+ categoryId: zod_1.z.string().uuid().nullable().optional(),
17
18
  createdAt: zod_1.z.date(),
18
19
  updatedAt: zod_1.z.date(),
19
20
  });
@@ -0,0 +1,79 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_TYPE } from '../../constants/tools';
3
+ export declare const TextChatCategoryFieldsSchema: z.ZodObject<{
4
+ title: z.ZodString;
5
+ toolType: z.ZodDefault<z.ZodEnum<[TOOL_TYPE.TEXT, TOOL_TYPE.IMAGE_GENERATION, TOOL_TYPE.IMAGE_EDITOR]>>;
6
+ placeholder: z.ZodDefault<z.ZodString>;
7
+ groupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ order: z.ZodOptional<z.ZodNumber>;
9
+ prompt: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null | undefined, string | null | undefined>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ title: string;
12
+ toolType: TOOL_TYPE.TEXT | TOOL_TYPE.IMAGE_GENERATION | TOOL_TYPE.IMAGE_EDITOR;
13
+ placeholder: string;
14
+ groupId?: string | null | undefined;
15
+ order?: number | undefined;
16
+ prompt?: string | null | undefined;
17
+ }, {
18
+ title: string;
19
+ toolType?: TOOL_TYPE.TEXT | TOOL_TYPE.IMAGE_GENERATION | TOOL_TYPE.IMAGE_EDITOR | undefined;
20
+ placeholder?: string | undefined;
21
+ groupId?: string | null | undefined;
22
+ order?: number | undefined;
23
+ prompt?: string | null | undefined;
24
+ }>;
25
+ /** Explicit allowlist. Never extend the administrative schema for public responses. */
26
+ export declare const TextChatCategoryPublicSchema: z.ZodObject<{
27
+ uuid: z.ZodString;
28
+ title: z.ZodString;
29
+ placeholder: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ uuid: string;
32
+ title: string;
33
+ placeholder: string;
34
+ }, {
35
+ uuid: string;
36
+ title: string;
37
+ placeholder: string;
38
+ }>;
39
+ export type TextChatCategoryPublic = z.infer<typeof TextChatCategoryPublicSchema>;
40
+ export declare const TextChatCategoryAdminSchema: z.ZodObject<{
41
+ uuid: z.ZodString;
42
+ title: z.ZodString;
43
+ placeholder: z.ZodString;
44
+ } & {
45
+ siteId: z.ZodString;
46
+ toolType: z.ZodDefault<z.ZodEnum<[TOOL_TYPE.TEXT, TOOL_TYPE.IMAGE_GENERATION, TOOL_TYPE.IMAGE_EDITOR]>>;
47
+ groupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
48
+ order: z.ZodDefault<z.ZodNumber>;
49
+ prompt: z.ZodNullable<z.ZodString>;
50
+ archivedAt: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
51
+ createdAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
52
+ updatedAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ uuid: string;
55
+ title: string;
56
+ placeholder: string;
57
+ siteId: string;
58
+ toolType: TOOL_TYPE.TEXT | TOOL_TYPE.IMAGE_GENERATION | TOOL_TYPE.IMAGE_EDITOR;
59
+ groupId: string | null;
60
+ order: number;
61
+ prompt: string | null;
62
+ archivedAt: string | Date | null;
63
+ createdAt: string | Date;
64
+ updatedAt: string | Date;
65
+ }, {
66
+ uuid: string;
67
+ title: string;
68
+ placeholder: string;
69
+ siteId: string;
70
+ toolType?: TOOL_TYPE.TEXT | TOOL_TYPE.IMAGE_GENERATION | TOOL_TYPE.IMAGE_EDITOR | undefined;
71
+ groupId?: string | null | undefined;
72
+ order?: number | undefined;
73
+ prompt: string | null;
74
+ archivedAt: string | Date | null;
75
+ createdAt: string | Date;
76
+ updatedAt: string | Date;
77
+ }>;
78
+ export type TextChatCategoryAdmin = z.infer<typeof TextChatCategoryAdminSchema>;
79
+ //# sourceMappingURL=category.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category.schema.d.ts","sourceRoot":"","sources":["../../../models/text-chat/category.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;EAcvC,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;EAIvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAGlF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAStC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextChatCategoryAdminSchema = exports.TextChatCategoryPublicSchema = exports.TextChatCategoryFieldsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const tools_1 = require("../../constants/tools");
6
+ const catalog_1 = require("../catalog");
7
+ exports.TextChatCategoryFieldsSchema = zod_1.z.object({
8
+ title: zod_1.z.string().trim().min(1).max(200),
9
+ toolType: zod_1.z
10
+ .enum([tools_1.TOOL_TYPE.TEXT, tools_1.TOOL_TYPE.IMAGE_GENERATION, tools_1.TOOL_TYPE.IMAGE_EDITOR])
11
+ .default(tools_1.TOOL_TYPE.TEXT),
12
+ placeholder: zod_1.z.string().trim().max(1000).default(''),
13
+ groupId: zod_1.z.string().uuid().nullable().optional(),
14
+ order: catalog_1.CatalogOrderSchema.optional(),
15
+ prompt: zod_1.z
16
+ .string()
17
+ .max(100000)
18
+ .nullable()
19
+ .optional()
20
+ .transform((value) => (typeof value === 'string' && !value.trim() ? null : value)),
21
+ });
22
+ /** Explicit allowlist. Never extend the administrative schema for public responses. */
23
+ exports.TextChatCategoryPublicSchema = zod_1.z.object({
24
+ uuid: zod_1.z.string().uuid(),
25
+ title: zod_1.z.string(),
26
+ placeholder: zod_1.z.string(),
27
+ });
28
+ const TimestampSchema = zod_1.z.string().datetime().or(zod_1.z.date());
29
+ exports.TextChatCategoryAdminSchema = exports.TextChatCategoryPublicSchema.extend({
30
+ siteId: zod_1.z.string().uuid(),
31
+ toolType: exports.TextChatCategoryFieldsSchema.shape.toolType,
32
+ groupId: zod_1.z.string().uuid().nullable().default(null),
33
+ order: catalog_1.CatalogOrderSchema.default(0),
34
+ prompt: zod_1.z.string().nullable(),
35
+ archivedAt: TimestampSchema.nullable(),
36
+ createdAt: TimestampSchema,
37
+ updatedAt: TimestampSchema,
38
+ });
@@ -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"}