@purpleschool/gptbot 0.12.31 → 0.12.33
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.
- package/api/controllers/http/chat-private.ts +1 -0
- package/api/controllers/http/chat-public.ts +1 -0
- package/api/routes.ts +4 -0
- package/build/api/controllers/http/chat-private.js +1 -0
- package/build/api/controllers/http/chat-public.js +1 -0
- package/build/api/routes.js +2 -0
- package/build/commands/message/index.js +1 -0
- package/build/commands/message/stop-stream.command.js +13 -0
- package/build/constants/message/enums/message-status.enum.js +1 -0
- package/build/constants/ui-notification/enums/ui-notification-type.enum.js +1 -0
- package/build/models/ui-notification.schema.js +9 -1
- package/commands/message/index.ts +1 -0
- package/commands/message/stop-stream.command.ts +16 -0
- package/constants/message/enums/message-status.enum.ts +1 -0
- package/constants/ui-notification/enums/ui-notification-type.enum.ts +1 -0
- package/models/ui-notification.schema.ts +10 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export const CHAT_PRIVATE_ROUTES = {
|
|
|
9
9
|
FIND_MANY: '',
|
|
10
10
|
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
11
11
|
SEND_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/text`,
|
|
12
|
+
STOP_STREAM: (uuid: string, messageId: string) => `${uuid}/messages/${messageId}/stop`,
|
|
12
13
|
ARCHIVE: 'archive',
|
|
13
14
|
DELETE: (uuid: string) => `${uuid}`,
|
|
14
15
|
UPDATE: (uuid: string) => `${uuid}`,
|
|
@@ -8,6 +8,7 @@ export const CHAT_PUBLIC_ROUTES = {
|
|
|
8
8
|
FIND_MANY: 'find',
|
|
9
9
|
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
10
10
|
SEND_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/text`,
|
|
11
|
+
STOP_STREAM: (uuid: string, messageId: string) => `${uuid}/messages/${messageId}/stop`,
|
|
11
12
|
SEND_IMAGE_MESSAGE: (uuid: string) => `${uuid}/messages/image`,
|
|
12
13
|
INPUT_LIMITS: 'input-limits',
|
|
13
14
|
CREATE_SUGGESTIONS: (uuid: string) => `${uuid}/suggestions`,
|
package/api/routes.ts
CHANGED
|
@@ -110,6 +110,8 @@ export const REST_API = {
|
|
|
110
110
|
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
111
111
|
SEND_TEXT_MESSAGE: (uuid: string) =>
|
|
112
112
|
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.SEND_TEXT_MESSAGE(uuid)}`,
|
|
113
|
+
STOP_STREAM: (uuid: string, messageId: string) =>
|
|
114
|
+
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.STOP_STREAM(uuid, messageId)}`,
|
|
113
115
|
CREATE_SUGGESTIONS: (uuid: string) =>
|
|
114
116
|
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.CREATE_SUGGESTIONS(uuid)}`,
|
|
115
117
|
ARCHIVE: `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.ARCHIVE}`,
|
|
@@ -131,6 +133,8 @@ export const REST_API = {
|
|
|
131
133
|
`${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.CREATE_SUGGESTIONS(uuid)}`,
|
|
132
134
|
SEND_TEXT_MESSAGE: (uuid: string) =>
|
|
133
135
|
`${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.SEND_TEXT_MESSAGE(uuid)}`,
|
|
136
|
+
STOP_STREAM: (uuid: string, messageId: string) =>
|
|
137
|
+
`${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.STOP_STREAM(uuid, messageId)}`,
|
|
134
138
|
SEND_IMAGE_MESSAGE: (uuid: string) =>
|
|
135
139
|
`${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.SEND_IMAGE_MESSAGE(uuid)}`,
|
|
136
140
|
INPUT_LIMITS: `${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.INPUT_LIMITS}`,
|
|
@@ -11,6 +11,7 @@ exports.CHAT_PRIVATE_ROUTES = {
|
|
|
11
11
|
FIND_MANY: '',
|
|
12
12
|
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
13
13
|
SEND_TEXT_MESSAGE: (uuid) => `${uuid}/messages/text`,
|
|
14
|
+
STOP_STREAM: (uuid, messageId) => `${uuid}/messages/${messageId}/stop`,
|
|
14
15
|
ARCHIVE: 'archive',
|
|
15
16
|
DELETE: (uuid) => `${uuid}`,
|
|
16
17
|
UPDATE: (uuid) => `${uuid}`,
|
|
@@ -10,6 +10,7 @@ exports.CHAT_PUBLIC_ROUTES = {
|
|
|
10
10
|
FIND_MANY: 'find',
|
|
11
11
|
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
12
12
|
SEND_TEXT_MESSAGE: (uuid) => `${uuid}/messages/text`,
|
|
13
|
+
STOP_STREAM: (uuid, messageId) => `${uuid}/messages/${messageId}/stop`,
|
|
13
14
|
SEND_IMAGE_MESSAGE: (uuid) => `${uuid}/messages/image`,
|
|
14
15
|
INPUT_LIMITS: 'input-limits',
|
|
15
16
|
CREATE_SUGGESTIONS: (uuid) => `${uuid}/suggestions`,
|
package/build/api/routes.js
CHANGED
|
@@ -129,6 +129,7 @@ exports.REST_API = {
|
|
|
129
129
|
FIND_MANY: `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.FIND_MANY}`,
|
|
130
130
|
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
131
131
|
SEND_TEXT_MESSAGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.SEND_TEXT_MESSAGE(uuid)}`,
|
|
132
|
+
STOP_STREAM: (uuid, messageId) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.STOP_STREAM(uuid, messageId)}`,
|
|
132
133
|
CREATE_SUGGESTIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.CREATE_SUGGESTIONS(uuid)}`,
|
|
133
134
|
ARCHIVE: `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.ARCHIVE}`,
|
|
134
135
|
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.DELETE(uuid)}`,
|
|
@@ -144,6 +145,7 @@ exports.REST_API = {
|
|
|
144
145
|
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
145
146
|
CREATE_SUGGESTIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.CREATE_SUGGESTIONS(uuid)}`,
|
|
146
147
|
SEND_TEXT_MESSAGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.SEND_TEXT_MESSAGE(uuid)}`,
|
|
148
|
+
STOP_STREAM: (uuid, messageId) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.STOP_STREAM(uuid, messageId)}`,
|
|
147
149
|
SEND_IMAGE_MESSAGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.SEND_IMAGE_MESSAGE(uuid)}`,
|
|
148
150
|
INPUT_LIMITS: `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.INPUT_LIMITS}`,
|
|
149
151
|
},
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./create-text-message.command"), exports);
|
|
|
18
18
|
__exportStar(require("./find-message-by-uuid.command"), exports);
|
|
19
19
|
__exportStar(require("./rate-message.command"), exports);
|
|
20
20
|
__exportStar(require("./create-suggestions.command"), exports);
|
|
21
|
+
__exportStar(require("./stop-stream.command"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StopStreamCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var StopStreamCommand;
|
|
6
|
+
(function (StopStreamCommand) {
|
|
7
|
+
StopStreamCommand.RequestSchema = zod_1.z.object({});
|
|
8
|
+
StopStreamCommand.RequestParamSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
messageId: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
StopStreamCommand.ResponseSchema = zod_1.z.void();
|
|
13
|
+
})(StopStreamCommand || (exports.StopStreamCommand = StopStreamCommand = {}));
|
|
@@ -7,5 +7,6 @@ var UI_NOTIFICATION_TYPE;
|
|
|
7
7
|
UI_NOTIFICATION_TYPE["SUBSCRIPTION_PAST_DUE"] = "SUBSCRIPTION_PAST_DUE";
|
|
8
8
|
UI_NOTIFICATION_TYPE["FRAUD_DETECTED"] = "FRAUD_DETECTED";
|
|
9
9
|
UI_NOTIFICATION_TYPE["PROMOCODE_OFFER"] = "PROMOCODE_OFFER";
|
|
10
|
+
UI_NOTIFICATION_TYPE["EMAIL_NOT_VERIFIED"] = "EMAIL_NOT_VERIFIED";
|
|
10
11
|
UI_NOTIFICATION_TYPE["GENERIC"] = "GENERIC";
|
|
11
12
|
})(UI_NOTIFICATION_TYPE || (exports.UI_NOTIFICATION_TYPE = UI_NOTIFICATION_TYPE = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UiNotificationSchema = exports.GenericUiContentSchema = exports.PromocodeOfferUiContentSchema = exports.FraudDetectedUiContentSchema = exports.SubscriptionPastDueUiContentSchema = exports.ConnectTelegramBonusUiContentSchema = exports.UiNotificationBaseSchema = void 0;
|
|
3
|
+
exports.UiNotificationSchema = exports.EmailNotVerifiedUiContentSchema = exports.GenericUiContentSchema = exports.PromocodeOfferUiContentSchema = exports.FraudDetectedUiContentSchema = exports.SubscriptionPastDueUiContentSchema = exports.ConnectTelegramBonusUiContentSchema = exports.UiNotificationBaseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
exports.UiNotificationBaseSchema = zod_1.z.object({
|
|
@@ -38,6 +38,10 @@ exports.GenericUiContentSchema = zod_1.z.object({
|
|
|
38
38
|
title: zod_1.z.string(),
|
|
39
39
|
message: zod_1.z.string(),
|
|
40
40
|
});
|
|
41
|
+
exports.EmailNotVerifiedUiContentSchema = zod_1.z.object({
|
|
42
|
+
title: zod_1.z.string(),
|
|
43
|
+
message: zod_1.z.string(),
|
|
44
|
+
});
|
|
41
45
|
exports.UiNotificationSchema = zod_1.z.discriminatedUnion('type', [
|
|
42
46
|
exports.UiNotificationBaseSchema.extend({
|
|
43
47
|
type: zod_1.z.literal(constants_1.UI_NOTIFICATION_TYPE.CONNECT_TELEGRAM_BONUS),
|
|
@@ -55,6 +59,10 @@ exports.UiNotificationSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
55
59
|
type: zod_1.z.literal(constants_1.UI_NOTIFICATION_TYPE.PROMOCODE_OFFER),
|
|
56
60
|
dynamicUiContent: exports.PromocodeOfferUiContentSchema,
|
|
57
61
|
}),
|
|
62
|
+
exports.UiNotificationBaseSchema.extend({
|
|
63
|
+
type: zod_1.z.literal(constants_1.UI_NOTIFICATION_TYPE.EMAIL_NOT_VERIFIED),
|
|
64
|
+
dynamicUiContent: exports.EmailNotVerifiedUiContentSchema,
|
|
65
|
+
}),
|
|
58
66
|
exports.UiNotificationBaseSchema.extend({
|
|
59
67
|
type: zod_1.z.literal(constants_1.UI_NOTIFICATION_TYPE.GENERIC),
|
|
60
68
|
dynamicUiContent: exports.GenericUiContentSchema,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace StopStreamCommand {
|
|
4
|
+
export const RequestSchema = z.object({});
|
|
5
|
+
|
|
6
|
+
export const RequestParamSchema = z.object({
|
|
7
|
+
uuid: z.string().uuid(),
|
|
8
|
+
messageId: z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const ResponseSchema = z.void();
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -52,6 +52,12 @@ export const GenericUiContentSchema = z.object({
|
|
|
52
52
|
});
|
|
53
53
|
export type GenericUiContentType = z.infer<typeof GenericUiContentSchema>;
|
|
54
54
|
|
|
55
|
+
export const EmailNotVerifiedUiContentSchema = z.object({
|
|
56
|
+
title: z.string(),
|
|
57
|
+
message: z.string(),
|
|
58
|
+
});
|
|
59
|
+
export type EmailNotVerifiedUiContent = z.infer<typeof EmailNotVerifiedUiContentSchema>;
|
|
60
|
+
|
|
55
61
|
export const UiNotificationSchema = z.discriminatedUnion('type', [
|
|
56
62
|
UiNotificationBaseSchema.extend({
|
|
57
63
|
type: z.literal(UI_NOTIFICATION_TYPE.CONNECT_TELEGRAM_BONUS),
|
|
@@ -69,6 +75,10 @@ export const UiNotificationSchema = z.discriminatedUnion('type', [
|
|
|
69
75
|
type: z.literal(UI_NOTIFICATION_TYPE.PROMOCODE_OFFER),
|
|
70
76
|
dynamicUiContent: PromocodeOfferUiContentSchema,
|
|
71
77
|
}),
|
|
78
|
+
UiNotificationBaseSchema.extend({
|
|
79
|
+
type: z.literal(UI_NOTIFICATION_TYPE.EMAIL_NOT_VERIFIED),
|
|
80
|
+
dynamicUiContent: EmailNotVerifiedUiContentSchema,
|
|
81
|
+
}),
|
|
72
82
|
UiNotificationBaseSchema.extend({
|
|
73
83
|
type: z.literal(UI_NOTIFICATION_TYPE.GENERIC),
|
|
74
84
|
dynamicUiContent: GenericUiContentSchema,
|