@purpleschool/gptbot 0.5.34 → 0.5.36

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 (95) hide show
  1. package/api/controllers/http/chat-private.ts +9 -7
  2. package/api/controllers/http/chat-public.ts +7 -4
  3. package/api/controllers/http/files.ts +1 -0
  4. package/api/controllers/http/index.ts +1 -0
  5. package/api/controllers/http/message.ts +10 -0
  6. package/api/controllers/http/midjourney.ts +5 -0
  7. package/api/routes.ts +20 -15
  8. package/build/api/controllers/http/chat-private.js +9 -7
  9. package/build/api/controllers/http/chat-public.js +7 -5
  10. package/build/api/controllers/http/files.js +1 -0
  11. package/build/api/controllers/http/index.js +1 -0
  12. package/build/api/controllers/http/message.js +9 -1
  13. package/build/api/controllers/http/midjourney.js +7 -0
  14. package/build/api/routes.js +14 -8
  15. package/build/commands/chat/check-limit.command.js +3 -1
  16. package/build/commands/chat/create-chat.command.js +2 -4
  17. package/build/commands/chat/delete-chat.command.js +1 -2
  18. package/build/commands/chat/find-chat-by-uuid.command.js +1 -1
  19. package/build/commands/chat/find-chats.command.js +1 -1
  20. package/build/commands/chat/get-chats-config.command.js +14 -0
  21. package/build/commands/chat/{get-my-last-active-chat.command.js → get-last-active-chat-command.js} +2 -1
  22. package/build/commands/chat/index.js +2 -7
  23. package/build/commands/file/index.js +17 -0
  24. package/build/commands/file/upload.command.js +11 -0
  25. package/build/commands/index.js +2 -0
  26. package/build/commands/message/create-text-message.command.js +3 -2
  27. package/build/commands/message/find-message-by-uuid.command.js +14 -0
  28. package/build/commands/message/index.js +1 -1
  29. package/build/commands/midjourney/index.js +17 -0
  30. package/build/commands/midjourney/midjourney-callback.command.js +10 -0
  31. package/build/constants/ai-model/enums/ai-model-feature.enum.js +7 -0
  32. package/build/constants/ai-model/enums/ai-model-strategy.enum.js +11 -0
  33. package/build/constants/ai-model/enums/index.js +2 -0
  34. package/build/constants/errors/errors.js +35 -0
  35. package/build/constants/file/enums/file-type.enum.js +8 -0
  36. package/build/constants/file/enums/index.js +17 -0
  37. package/build/constants/file/index.js +17 -0
  38. package/build/constants/index.js +2 -0
  39. package/build/constants/message/enums/index.js +1 -0
  40. package/build/constants/message/enums/message-status.enum.js +9 -0
  41. package/build/constants/midjourney/enums/index.js +17 -0
  42. package/build/constants/midjourney/enums/midjournet-job-status.enum.js +10 -0
  43. package/build/constants/midjourney/index.js +17 -0
  44. package/build/models/ai-model.schema.js +1 -0
  45. package/build/models/file.schema.js +16 -0
  46. package/build/models/index.js +2 -0
  47. package/build/models/message.schema.js +3 -0
  48. package/build/models/midjourney-job.schema.js +23 -0
  49. package/commands/chat/check-limit.command.ts +3 -1
  50. package/commands/chat/create-chat.command.ts +3 -6
  51. package/commands/chat/delete-chat.command.ts +2 -4
  52. package/commands/chat/find-chat-by-uuid.command.ts +2 -2
  53. package/commands/chat/find-chats.command.ts +2 -2
  54. package/commands/chat/get-chats-config.command.ts +13 -0
  55. package/commands/chat/{get-my-last-active-chat-command.v2.ts → get-last-active-chat-command.ts} +1 -1
  56. package/commands/chat/index.ts +2 -7
  57. package/commands/file/index.ts +1 -0
  58. package/commands/{chat/check-limit.command.v2.ts → file/upload.command.ts} +4 -4
  59. package/commands/index.ts +2 -0
  60. package/commands/message/create-text-message.command.ts +3 -2
  61. package/commands/message/find-message-by-uuid.command.ts +16 -0
  62. package/commands/message/index.ts +1 -1
  63. package/commands/midjourney/index.ts +1 -0
  64. package/commands/{chat/delete-chat.command.v2.ts → midjourney/midjourney-callback.command.ts} +3 -6
  65. package/constants/ai-model/enums/ai-model-feature.enum.ts +3 -0
  66. package/constants/ai-model/enums/ai-model-strategy.enum.ts +7 -0
  67. package/constants/ai-model/enums/index.ts +2 -0
  68. package/constants/errors/errors.ts +35 -0
  69. package/constants/file/enums/file-type.enum.ts +4 -0
  70. package/constants/file/enums/index.ts +1 -0
  71. package/constants/file/index.ts +1 -0
  72. package/constants/index.ts +2 -0
  73. package/constants/message/enums/index.ts +1 -0
  74. package/constants/message/enums/message-status.enum.ts +5 -0
  75. package/constants/midjourney/enums/index.ts +1 -0
  76. package/constants/midjourney/enums/midjournet-job-status.enum.ts +6 -0
  77. package/constants/midjourney/index.ts +1 -0
  78. package/models/ai-model.schema.ts +2 -1
  79. package/models/file.schema.ts +14 -0
  80. package/models/index.ts +2 -0
  81. package/models/message.schema.ts +4 -0
  82. package/models/midjourney-job.schema.ts +24 -0
  83. package/package.json +1 -1
  84. package/build/commands/chat/check-limit.command.v2.js +0 -12
  85. package/build/commands/chat/create-chat.command.v2.js +0 -17
  86. package/build/commands/chat/delete-chat.command.v2.js +0 -12
  87. package/build/commands/chat/find-chat.command.js +0 -30
  88. package/build/commands/chat/get-my-last-active-chat-command.v2.js +0 -17
  89. package/build/commands/chat/update-chat.command.js +0 -22
  90. package/build/commands/message/create-message.command.js +0 -18
  91. package/commands/chat/create-chat.command.v2.ts +0 -19
  92. package/commands/chat/find-chat.command.ts +0 -39
  93. package/commands/chat/get-my-last-active-chat.command.ts +0 -18
  94. package/commands/chat/update-chat.command.ts +0 -27
  95. package/commands/message/create-message.command.ts +0 -21
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateChatCommand = void 0;
4
- const models_1 = require("../../models");
5
- const zod_1 = require("zod");
6
- var UpdateChatCommand;
7
- (function (UpdateChatCommand) {
8
- UpdateChatCommand.RequestSchema = models_1.ChatSchema.omit({
9
- createdAt: true,
10
- updatedAt: true,
11
- uuid: true,
12
- aIModelId: true,
13
- }).partial();
14
- UpdateChatCommand.RequestParamSchema = zod_1.z.object({
15
- uuid: zod_1.z.string().uuid(),
16
- });
17
- UpdateChatCommand.ResponseSchema = zod_1.z.object({
18
- data: models_1.ChatSchema.extend({
19
- messages: zod_1.z.array(models_1.MessageSchema),
20
- }),
21
- });
22
- })(UpdateChatCommand || (exports.UpdateChatCommand = UpdateChatCommand = {}));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateMessageCommand = void 0;
4
- const models_1 = require("../../models");
5
- const zod_1 = require("zod");
6
- var CreateMessageCommand;
7
- (function (CreateMessageCommand) {
8
- CreateMessageCommand.RequestSchema = models_1.MessageSchema.pick({
9
- text: true,
10
- });
11
- CreateMessageCommand.RequestParamSchema = zod_1.z.object({
12
- uuid: zod_1.z.string().uuid(),
13
- categoryId: zod_1.z.string().uuid(),
14
- });
15
- CreateMessageCommand.ResponseSchema = zod_1.z.object({
16
- data: models_1.MessageSchema,
17
- });
18
- })(CreateMessageCommand || (exports.CreateMessageCommand = CreateMessageCommand = {}));
@@ -1,19 +0,0 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
2
- import { z } from 'zod';
3
-
4
- export namespace CreateChatV2Command {
5
- export const RequestSchema = ChatSchema.pick({
6
- aIModelId: true,
7
- categoryId: true,
8
- });
9
-
10
- export type RequestSchema = z.infer<typeof RequestSchema>;
11
-
12
- export const ResponseSchema = z.object({
13
- data: ChatSchema.extend({
14
- messages: z.array(MessageSchema),
15
- }),
16
- });
17
-
18
- export type Response = z.infer<typeof ResponseSchema>;
19
- }
@@ -1,39 +0,0 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
2
- import { z } from 'zod';
3
-
4
- export namespace FindChatCommand {
5
- export const RequestSchema = ChatSchema.pick({
6
- uuid: true,
7
- });
8
-
9
- export const RequestSchemaByParam = ChatSchema.pick({
10
- categoryId: true,
11
- });
12
-
13
- export type Request = z.infer<typeof RequestSchema>;
14
-
15
- export const RequestSchemaByQuery = z.object({
16
- limit: z.string().regex(/^\d+$/, { message: 'Limit должен быть числом' }).transform(Number),
17
- offset: z
18
- .string()
19
- .regex(/^\d+$/, { message: 'Offset должен быть числом' })
20
- .transform(Number),
21
- });
22
-
23
- export const ResponseSchema = z.object({
24
- data: z.array(
25
- ChatSchema.extend({
26
- messages: z.array(MessageSchema),
27
- }),
28
- ),
29
- count: z.number(),
30
- });
31
-
32
- export type Response = z.infer<typeof ResponseSchema>;
33
-
34
- export const ResponseByUUIDSchema = z.object({
35
- data: ChatSchema,
36
- });
37
-
38
- export type ResponseByUUID = z.infer<typeof ResponseByUUIDSchema>;
39
- }
@@ -1,18 +0,0 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
2
- import { z } from 'zod';
3
-
4
- export namespace GetLastActiveChatCommand {
5
- export const RequestByParamSchema = ChatSchema.pick({
6
- categoryId: true,
7
- });
8
-
9
- export type RequestByQuery = z.infer<typeof RequestByParamSchema>;
10
-
11
- export const Response = z.object({
12
- data: ChatSchema.extend({
13
- messages: z.array(MessageSchema),
14
- }),
15
- });
16
-
17
- export type Response = z.infer<typeof Response>;
18
- }
@@ -1,27 +0,0 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
2
- import { z } from 'zod';
3
-
4
- export namespace UpdateChatCommand {
5
- export const RequestSchema = ChatSchema.omit({
6
- createdAt: true,
7
- updatedAt: true,
8
- uuid: true,
9
- aIModelId: true,
10
- }).partial();
11
-
12
- export type Request = z.infer<typeof RequestSchema>;
13
-
14
- export const RequestParamSchema = z.object({
15
- uuid: z.string().uuid(),
16
- });
17
-
18
- export type RequestParam = z.infer<typeof RequestParamSchema>;
19
-
20
- export const ResponseSchema = z.object({
21
- data: ChatSchema.extend({
22
- messages: z.array(MessageSchema),
23
- }),
24
- });
25
-
26
- export type Response = z.infer<typeof ResponseSchema>;
27
- }
@@ -1,21 +0,0 @@
1
- import { MessageSchema } from '../../models';
2
- import { z } from 'zod';
3
-
4
- export namespace CreateMessageCommand {
5
- export const RequestSchema = MessageSchema.pick({
6
- text: true,
7
- });
8
-
9
- export const RequestParamSchema = z.object({
10
- uuid: z.string().uuid(),
11
- categoryId: z.string().uuid(),
12
- });
13
-
14
- export type Request = z.infer<typeof RequestSchema>;
15
-
16
- export const ResponseSchema = z.object({
17
- data: MessageSchema,
18
- });
19
-
20
- export type Response = z.infer<typeof ResponseSchema>;
21
- }