@purpleschool/gptbot 0.12.40-stage-2 → 0.12.41-stage-2

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.
@@ -2,11 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateAdminBroadcastUiNotificationCommand = void 0;
4
4
  const zod_1 = require("zod");
5
+ const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
5
6
  var CreateAdminBroadcastUiNotificationCommand;
6
7
  (function (CreateAdminBroadcastUiNotificationCommand) {
7
8
  CreateAdminBroadcastUiNotificationCommand.RequestBodySchema = zod_1.z.object({
8
- title: zod_1.z.string().trim().min(1),
9
- message: zod_1.z.string().trim().min(1),
9
+ title: zod_1.z.object({
10
+ [rugpt_lib_common_1.LOCALE.RU]: zod_1.z.string().trim().min(1),
11
+ [rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string().trim().min(1),
12
+ }),
13
+ message: zod_1.z.object({
14
+ [rugpt_lib_common_1.LOCALE.RU]: zod_1.z.string().trim().min(1),
15
+ [rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string().trim().min(1),
16
+ }),
10
17
  onlyRegistered: zod_1.z.boolean().optional(),
11
18
  });
12
19
  CreateAdminBroadcastUiNotificationCommand.ResponseSchema = zod_1.z.object({
@@ -1,7 +1,8 @@
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.UiNotificationBaseSchema = void 0;
3
+ exports.UiNotificationSchema = 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
+ const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
5
6
  const constants_1 = require("../constants");
6
7
  exports.UiNotificationBaseSchema = zod_1.z.object({
7
8
  uuid: zod_1.z.string().uuid(),
@@ -14,6 +15,10 @@ exports.UiNotificationBaseSchema = zod_1.z.object({
14
15
  endDate: zod_1.z.date().nullable(),
15
16
  serverTime: zod_1.z.date().optional(),
16
17
  });
18
+ exports.LocalizedUiNotificationTextSchema = zod_1.z.object({
19
+ [rugpt_lib_common_1.LOCALE.RU]: zod_1.z.string(),
20
+ [rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string(),
21
+ });
17
22
  exports.ConnectTelegramBonusUiContentSchema = zod_1.z.object({
18
23
  promocode: zod_1.z.string(),
19
24
  bonusPercent: zod_1.z.number(),
@@ -24,23 +29,23 @@ exports.SubscriptionPastDueUiContentSchema = zod_1.z.object({
24
29
  endDate: zod_1.z.string().datetime(),
25
30
  });
26
31
  exports.FraudDetectedUiContentSchema = zod_1.z.object({
27
- message: zod_1.z.string(),
32
+ message: exports.LocalizedUiNotificationTextSchema,
28
33
  endDate: zod_1.z.string().datetime(),
29
34
  });
30
35
  exports.PromocodeOfferUiContentSchema = zod_1.z.object({
31
- title: zod_1.z.string(),
32
- message: zod_1.z.string(),
36
+ title: exports.LocalizedUiNotificationTextSchema,
37
+ message: exports.LocalizedUiNotificationTextSchema,
33
38
  promocode: zod_1.z.string(),
34
39
  bonusPercent: zod_1.z.number(),
35
40
  validTill: zod_1.z.string().datetime().nullable(),
36
41
  });
37
42
  exports.GenericUiContentSchema = zod_1.z.object({
38
- title: zod_1.z.string(),
39
- message: zod_1.z.string(),
43
+ title: exports.LocalizedUiNotificationTextSchema,
44
+ message: exports.LocalizedUiNotificationTextSchema,
40
45
  });
41
46
  exports.EmailNotVerifiedUiContentSchema = zod_1.z.object({
42
- title: zod_1.z.string(),
43
- message: zod_1.z.string(),
47
+ title: exports.LocalizedUiNotificationTextSchema,
48
+ message: exports.LocalizedUiNotificationTextSchema,
44
49
  });
45
50
  exports.UiNotificationSchema = zod_1.z.discriminatedUnion('type', [
46
51
  exports.UiNotificationBaseSchema.extend({
@@ -1,9 +1,16 @@
1
1
  import { z } from 'zod';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
2
3
 
3
4
  export namespace CreateAdminBroadcastUiNotificationCommand {
4
5
  export const RequestBodySchema = z.object({
5
- title: z.string().trim().min(1),
6
- message: z.string().trim().min(1),
6
+ title: z.object({
7
+ [LOCALE.RU]: z.string().trim().min(1),
8
+ [LOCALE.EN]: z.string().trim().min(1),
9
+ }),
10
+ message: z.object({
11
+ [LOCALE.RU]: z.string().trim().min(1),
12
+ [LOCALE.EN]: z.string().trim().min(1),
13
+ }),
7
14
  onlyRegistered: z.boolean().optional(),
8
15
  });
9
16
 
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
2
3
  import {
3
4
  UI_NOTIFICATION_CONDITION_OF_EXECUTION,
4
5
  UI_NOTIFICATION_STATUS,
@@ -18,6 +19,12 @@ export const UiNotificationBaseSchema = z.object({
18
19
  });
19
20
  export type UiNotificationBase = z.infer<typeof UiNotificationBaseSchema>;
20
21
 
22
+ export const LocalizedUiNotificationTextSchema = z.object({
23
+ [LOCALE.RU]: z.string(),
24
+ [LOCALE.EN]: z.string(),
25
+ });
26
+ export type LocalizedUiNotificationText = z.infer<typeof LocalizedUiNotificationTextSchema>;
27
+
21
28
  export const ConnectTelegramBonusUiContentSchema = z.object({
22
29
  promocode: z.string(),
23
30
  bonusPercent: z.number(),
@@ -32,14 +39,14 @@ export const SubscriptionPastDueUiContentSchema = z.object({
32
39
  export type SubscriptionPastDueUiContent = z.infer<typeof SubscriptionPastDueUiContentSchema>;
33
40
 
34
41
  export const FraudDetectedUiContentSchema = z.object({
35
- message: z.string(),
42
+ message: LocalizedUiNotificationTextSchema,
36
43
  endDate: z.string().datetime(),
37
44
  });
38
45
  export type FraudDetectedUiContent = z.infer<typeof FraudDetectedUiContentSchema>;
39
46
 
40
47
  export const PromocodeOfferUiContentSchema = z.object({
41
- title: z.string(),
42
- message: z.string(),
48
+ title: LocalizedUiNotificationTextSchema,
49
+ message: LocalizedUiNotificationTextSchema,
43
50
  promocode: z.string(),
44
51
  bonusPercent: z.number(),
45
52
  validTill: z.string().datetime().nullable(),
@@ -47,14 +54,14 @@ export const PromocodeOfferUiContentSchema = z.object({
47
54
  export type PromocodeOfferUiContent = z.infer<typeof PromocodeOfferUiContentSchema>;
48
55
 
49
56
  export const GenericUiContentSchema = z.object({
50
- title: z.string(),
51
- message: z.string(),
57
+ title: LocalizedUiNotificationTextSchema,
58
+ message: LocalizedUiNotificationTextSchema,
52
59
  });
53
60
  export type GenericUiContentType = z.infer<typeof GenericUiContentSchema>;
54
61
 
55
62
  export const EmailNotVerifiedUiContentSchema = z.object({
56
- title: z.string(),
57
- message: z.string(),
63
+ title: LocalizedUiNotificationTextSchema,
64
+ message: LocalizedUiNotificationTextSchema,
58
65
  });
59
66
  export type EmailNotVerifiedUiContent = z.infer<typeof EmailNotVerifiedUiContentSchema>;
60
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.12.40-stage-2",
3
+ "version": "0.12.41-stage-2",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",