@purpleschool/gptbot 0.14.51 → 0.14.53
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/build/commands/ui-notification/create-admin-broadcast-ui-notification.command.d.ts +10 -2
- package/build/commands/ui-notification/create-admin-broadcast-ui-notification.command.js +2 -2
- package/build/commands/ui-notification/find-active-ui-notifications-by-page-and-user.command.d.ts +19 -0
- package/build/commands/ui-notification/find-ui-notifications.command.d.ts +19 -0
- package/build/constants/ui-notification/enums/ui-notification-type.enum.d.ts +2 -1
- package/build/constants/ui-notification/enums/ui-notification-type.enum.js +1 -0
- package/build/helpers/localized-text.schema.d.ts +5 -0
- package/build/helpers/localized-text.schema.js +8 -0
- package/build/models/ui-notification.schema.d.ts +28 -0
- package/build/models/ui-notification.schema.js +13 -1
- package/package.json +1 -1
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare namespace CreateAdminBroadcastUiNotificationCommand {
|
|
3
3
|
const RequestBodySchema: z.ZodObject<{
|
|
4
|
-
title: z.ZodObject<
|
|
5
|
-
|
|
4
|
+
title: z.ZodObject<{
|
|
5
|
+
en: z.ZodOptional<z.ZodString>;
|
|
6
|
+
es: z.ZodOptional<z.ZodString>;
|
|
7
|
+
ru: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
message: z.ZodObject<{
|
|
10
|
+
en: z.ZodOptional<z.ZodString>;
|
|
11
|
+
es: z.ZodOptional<z.ZodString>;
|
|
12
|
+
ru: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
6
14
|
onlyRegistered: z.ZodOptional<z.ZodBoolean>;
|
|
7
15
|
}, z.core.$strip>;
|
|
8
16
|
type Request = z.infer<typeof RequestBodySchema>;
|
|
@@ -6,8 +6,8 @@ const localized_text_schema_1 = require("../../helpers/localized-text.schema");
|
|
|
6
6
|
var CreateAdminBroadcastUiNotificationCommand;
|
|
7
7
|
(function (CreateAdminBroadcastUiNotificationCommand) {
|
|
8
8
|
CreateAdminBroadcastUiNotificationCommand.RequestBodySchema = zod_1.z.object({
|
|
9
|
-
title: (0, localized_text_schema_1.
|
|
10
|
-
message: (0, localized_text_schema_1.
|
|
9
|
+
title: (0, localized_text_schema_1.buildPartialLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
|
|
10
|
+
message: (0, localized_text_schema_1.buildPartialLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
|
|
11
11
|
onlyRegistered: zod_1.z.boolean().optional(),
|
|
12
12
|
});
|
|
13
13
|
CreateAdminBroadcastUiNotificationCommand.ResponseSchema = zod_1.z.object({
|
package/build/commands/ui-notification/find-active-ui-notifications-by-page-and-user.command.d.ts
CHANGED
|
@@ -99,6 +99,25 @@ export declare namespace FindActiveUiNotificationsByPageAndUserCommand {
|
|
|
99
99
|
title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
100
100
|
message: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
101
101
|
}, z.core.$strip>;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
uuid: z.ZodString;
|
|
104
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
105
|
+
priority: z.ZodNumber;
|
|
106
|
+
isRead: z.ZodBoolean;
|
|
107
|
+
readAt: z.ZodNullable<z.ZodDate>;
|
|
108
|
+
status: z.ZodEnum<typeof import("../..").UI_NOTIFICATION_STATUS>;
|
|
109
|
+
conditionOfExecution: z.ZodEnum<typeof import("../..").UI_NOTIFICATION_CONDITION_OF_EXECUTION>;
|
|
110
|
+
endDate: z.ZodNullable<z.ZodDate>;
|
|
111
|
+
serverTime: z.ZodOptional<z.ZodDate>;
|
|
112
|
+
type: z.ZodLiteral<import("../..").UI_NOTIFICATION_TYPE.BLOG_UPDATE>;
|
|
113
|
+
dynamicUiContent: z.ZodObject<{
|
|
114
|
+
title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
115
|
+
preview: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
116
|
+
action: z.ZodObject<{
|
|
117
|
+
label: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
118
|
+
url: z.ZodString;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
}, z.core.$strip>;
|
|
102
121
|
}, z.core.$strip>], "type">>;
|
|
103
122
|
}, z.core.$strip>;
|
|
104
123
|
type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -100,6 +100,25 @@ export declare namespace FindUiNotificationsCommand {
|
|
|
100
100
|
title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
101
101
|
message: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
102
102
|
}, z.core.$strip>;
|
|
103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
+
uuid: z.ZodString;
|
|
105
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
106
|
+
priority: z.ZodNumber;
|
|
107
|
+
isRead: z.ZodBoolean;
|
|
108
|
+
readAt: z.ZodNullable<z.ZodDate>;
|
|
109
|
+
status: z.ZodEnum<typeof import("../..").UI_NOTIFICATION_STATUS>;
|
|
110
|
+
conditionOfExecution: z.ZodEnum<typeof import("../..").UI_NOTIFICATION_CONDITION_OF_EXECUTION>;
|
|
111
|
+
endDate: z.ZodNullable<z.ZodDate>;
|
|
112
|
+
serverTime: z.ZodOptional<z.ZodDate>;
|
|
113
|
+
type: z.ZodLiteral<import("../..").UI_NOTIFICATION_TYPE.BLOG_UPDATE>;
|
|
114
|
+
dynamicUiContent: z.ZodObject<{
|
|
115
|
+
title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
116
|
+
preview: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
117
|
+
action: z.ZodObject<{
|
|
118
|
+
label: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
119
|
+
url: z.ZodString;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
}, z.core.$strip>;
|
|
103
122
|
}, z.core.$strip>], "type">>;
|
|
104
123
|
}, z.core.$strip>;
|
|
105
124
|
type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -9,4 +9,5 @@ var UI_NOTIFICATION_TYPE;
|
|
|
9
9
|
UI_NOTIFICATION_TYPE["PROMOCODE_OFFER"] = "PROMOCODE_OFFER";
|
|
10
10
|
UI_NOTIFICATION_TYPE["EMAIL_NOT_VERIFIED"] = "EMAIL_NOT_VERIFIED";
|
|
11
11
|
UI_NOTIFICATION_TYPE["GENERIC"] = "GENERIC";
|
|
12
|
+
UI_NOTIFICATION_TYPE["BLOG_UPDATE"] = "BLOG_UPDATE";
|
|
12
13
|
})(UI_NOTIFICATION_TYPE || (exports.UI_NOTIFICATION_TYPE = UI_NOTIFICATION_TYPE = {}));
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export declare function buildLocalizedTextSchema<T extends z.ZodTypeAny>(value: T): z.ZodObject<Record<LOCALE, T>>;
|
|
4
|
+
export declare function buildPartialLocalizedTextSchema<T extends z.ZodTypeAny>(value: T): z.ZodObject<{
|
|
5
|
+
en: z.ZodOptional<T>;
|
|
6
|
+
es: z.ZodOptional<T>;
|
|
7
|
+
ru: z.ZodOptional<T>;
|
|
8
|
+
}, z.core.$strip>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildLocalizedTextSchema = buildLocalizedTextSchema;
|
|
4
|
+
exports.buildPartialLocalizedTextSchema = buildPartialLocalizedTextSchema;
|
|
4
5
|
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
function buildLocalizedTextSchema(value) {
|
|
@@ -10,3 +11,10 @@ function buildLocalizedTextSchema(value) {
|
|
|
10
11
|
}, {});
|
|
11
12
|
return zod_1.z.object(shape);
|
|
12
13
|
}
|
|
14
|
+
function buildPartialLocalizedTextSchema(value) {
|
|
15
|
+
return buildLocalizedTextSchema(value)
|
|
16
|
+
.partial()
|
|
17
|
+
.refine((localizedText) => Object.keys(localizedText).length > 0, {
|
|
18
|
+
message: 'At least one localized value is required',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -48,6 +48,15 @@ export declare const EmailNotVerifiedUiContentSchema: z.ZodObject<{
|
|
|
48
48
|
message: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
49
49
|
}, z.core.$strip>;
|
|
50
50
|
export type EmailNotVerifiedUiContent = z.infer<typeof EmailNotVerifiedUiContentSchema>;
|
|
51
|
+
export declare const BlogUpdateUiContentSchema: z.ZodObject<{
|
|
52
|
+
title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
53
|
+
preview: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
54
|
+
action: z.ZodObject<{
|
|
55
|
+
label: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
56
|
+
url: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type BlogUpdateUiContent = z.infer<typeof BlogUpdateUiContentSchema>;
|
|
51
60
|
export declare const UiNotificationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
61
|
uuid: z.ZodString;
|
|
53
62
|
userId: z.ZodNullable<z.ZodString>;
|
|
@@ -142,5 +151,24 @@ export declare const UiNotificationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
142
151
|
title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
143
152
|
message: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
144
153
|
}, z.core.$strip>;
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
uuid: z.ZodString;
|
|
156
|
+
userId: z.ZodNullable<z.ZodString>;
|
|
157
|
+
priority: z.ZodNumber;
|
|
158
|
+
isRead: z.ZodBoolean;
|
|
159
|
+
readAt: z.ZodNullable<z.ZodDate>;
|
|
160
|
+
status: z.ZodEnum<typeof UI_NOTIFICATION_STATUS>;
|
|
161
|
+
conditionOfExecution: z.ZodEnum<typeof UI_NOTIFICATION_CONDITION_OF_EXECUTION>;
|
|
162
|
+
endDate: z.ZodNullable<z.ZodDate>;
|
|
163
|
+
serverTime: z.ZodOptional<z.ZodDate>;
|
|
164
|
+
type: z.ZodLiteral<UI_NOTIFICATION_TYPE.BLOG_UPDATE>;
|
|
165
|
+
dynamicUiContent: z.ZodObject<{
|
|
166
|
+
title: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
167
|
+
preview: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
168
|
+
action: z.ZodObject<{
|
|
169
|
+
label: z.ZodObject<Record<import("@purpleschool/rugpt-lib-common").LOCALE, z.ZodString>, z.core.$strip>;
|
|
170
|
+
url: z.ZodString;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
}, z.core.$strip>;
|
|
145
173
|
}, z.core.$strip>], "type">;
|
|
146
174
|
export type UiNotification = z.infer<typeof UiNotificationSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UiNotificationSchema = exports.EmailNotVerifiedUiContentSchema = exports.GenericUiContentSchema = exports.PromocodeOfferUiContentSchema = exports.FraudDetectedUiContentSchema = exports.SubscriptionPastDueUiContentSchema = exports.ConnectTelegramBonusUiContentSchema = exports.LocalizedUiNotificationTextSchema = exports.UiNotificationBaseSchema = void 0;
|
|
3
|
+
exports.UiNotificationSchema = exports.BlogUpdateUiContentSchema = exports.EmailNotVerifiedUiContentSchema = exports.GenericUiContentSchema = exports.PromocodeOfferUiContentSchema = exports.FraudDetectedUiContentSchema = exports.SubscriptionPastDueUiContentSchema = exports.ConnectTelegramBonusUiContentSchema = exports.LocalizedUiNotificationTextSchema = exports.UiNotificationBaseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const localized_text_schema_1 = require("../helpers/localized-text.schema");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
@@ -44,6 +44,14 @@ exports.EmailNotVerifiedUiContentSchema = zod_1.z.object({
|
|
|
44
44
|
title: exports.LocalizedUiNotificationTextSchema,
|
|
45
45
|
message: exports.LocalizedUiNotificationTextSchema,
|
|
46
46
|
});
|
|
47
|
+
exports.BlogUpdateUiContentSchema = zod_1.z.object({
|
|
48
|
+
title: exports.LocalizedUiNotificationTextSchema,
|
|
49
|
+
preview: exports.LocalizedUiNotificationTextSchema,
|
|
50
|
+
action: zod_1.z.object({
|
|
51
|
+
label: exports.LocalizedUiNotificationTextSchema,
|
|
52
|
+
url: zod_1.z.string(),
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
47
55
|
exports.UiNotificationSchema = zod_1.z.discriminatedUnion('type', [
|
|
48
56
|
exports.UiNotificationBaseSchema.extend({
|
|
49
57
|
type: zod_1.z.literal(constants_1.UI_NOTIFICATION_TYPE.CONNECT_TELEGRAM_BONUS),
|
|
@@ -69,4 +77,8 @@ exports.UiNotificationSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
69
77
|
type: zod_1.z.literal(constants_1.UI_NOTIFICATION_TYPE.GENERIC),
|
|
70
78
|
dynamicUiContent: exports.GenericUiContentSchema,
|
|
71
79
|
}),
|
|
80
|
+
exports.UiNotificationBaseSchema.extend({
|
|
81
|
+
type: zod_1.z.literal(constants_1.UI_NOTIFICATION_TYPE.BLOG_UPDATE),
|
|
82
|
+
dynamicUiContent: exports.BlogUpdateUiContentSchema,
|
|
83
|
+
}),
|
|
72
84
|
]);
|