@purpleschool/gptbot 0.12.17 → 0.12.18

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 (25) hide show
  1. package/api/controllers/http/ui-notification.ts +9 -2
  2. package/api/routes.ts +18 -0
  3. package/build/api/controllers/http/ui-notification.js +9 -2
  4. package/build/api/routes.js +14 -0
  5. package/build/commands/ui-notification/delete-all-ui-notifications.command.js +12 -0
  6. package/build/commands/ui-notification/delete-many-ui-notifications.command.js +15 -0
  7. package/build/commands/ui-notification/delete-ui-notification.command.js +15 -0
  8. package/build/commands/ui-notification/find-ui-notifications.command.js +15 -0
  9. package/build/commands/ui-notification/index.js +7 -0
  10. package/build/commands/ui-notification/read-all-ui-notifications.command.js +12 -0
  11. package/build/commands/ui-notification/read-many-ui-notifications.command.js +15 -0
  12. package/build/commands/ui-notification/read-ui-notification.command.js +15 -0
  13. package/build/constants/ui-notification/enums/ui-notification-type.enum.js +1 -0
  14. package/build/models/ui-notification.schema.js +3 -0
  15. package/commands/ui-notification/delete-all-ui-notifications.command.ts +11 -0
  16. package/commands/ui-notification/delete-many-ui-notifications.command.ts +17 -0
  17. package/commands/ui-notification/delete-ui-notification.command.ts +17 -0
  18. package/commands/ui-notification/find-ui-notifications.command.ts +17 -0
  19. package/commands/ui-notification/index.ts +7 -0
  20. package/commands/ui-notification/read-all-ui-notifications.command.ts +10 -0
  21. package/commands/ui-notification/read-many-ui-notifications.command.ts +16 -0
  22. package/commands/ui-notification/read-ui-notification.command.ts +16 -0
  23. package/constants/ui-notification/enums/ui-notification-type.enum.ts +1 -0
  24. package/models/ui-notification.schema.ts +3 -0
  25. package/package.json +1 -1
@@ -2,7 +2,14 @@ export const UI_NOTIFICATION_PRIVATE_CONTROLLER = 'private/ui-notification' as c
2
2
  export const UI_NOTIFICATION_PUBLIC_CONTROLLER = 'public/ui-notification' as const;
3
3
 
4
4
  export const UI_NOTIFICATION_ROUTES = {
5
+ GET_ALL: 'all',
6
+ READ_ALL: 'all/read',
7
+ DELETE_ALL: 'all/delete',
5
8
  GET_BY_PAGE: 'by/page',
6
- COMPLETE: (uuid: string) => `complete/${uuid}`,
7
- CANCEL: (uuid: string) => `cancel/${uuid}`,
9
+ DELETE: (uuid: string) => `${uuid}`,
10
+ READ: (uuid: string) => `${uuid}/read`,
11
+ COMPLETE: (uuid: string) => `${uuid}/complete`,
12
+ CANCEL: (uuid: string) => `${uuid}/cancel`,
13
+ READ_MANY: 'read-many',
14
+ DELETE_MANY: 'delete-many',
8
15
  } as const;
package/api/routes.ts CHANGED
@@ -889,14 +889,32 @@ export const REST_API = {
889
889
  `${ROOT}/${CONTROLLERS.MESSAGE_CONTROLLER_PRIVATE}/${CONTROLLERS.MESSAGE_PRIVATE_ROUTES.RATE(uuid)}`,
890
890
  },
891
891
  UI_NOTIFICATION_PUBLIC: {
892
+ GET_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
892
893
  GET_BY_PAGE: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
894
+ READ: (uuid: string) =>
895
+ `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
896
+ READ_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
897
+ READ_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
898
+ DELETE: (uuid: string) =>
899
+ `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
900
+ DELETE_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
901
+ DELETE_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
893
902
  COMPLETE: (uuid: string) =>
894
903
  `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
895
904
  CANCEL: (uuid: string) =>
896
905
  `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
897
906
  },
898
907
  UI_NOTIFICATION_PRIVATE: {
908
+ GET_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
899
909
  GET_BY_PAGE: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
910
+ READ: (uuid: string) =>
911
+ `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
912
+ READ_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
913
+ READ_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
914
+ DELETE: (uuid: string) =>
915
+ `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
916
+ DELETE_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
917
+ DELETE_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
900
918
  COMPLETE: (uuid: string) =>
901
919
  `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
902
920
  CANCEL: (uuid: string) =>
@@ -4,7 +4,14 @@ exports.UI_NOTIFICATION_ROUTES = exports.UI_NOTIFICATION_PUBLIC_CONTROLLER = exp
4
4
  exports.UI_NOTIFICATION_PRIVATE_CONTROLLER = 'private/ui-notification';
5
5
  exports.UI_NOTIFICATION_PUBLIC_CONTROLLER = 'public/ui-notification';
6
6
  exports.UI_NOTIFICATION_ROUTES = {
7
+ GET_ALL: 'all',
8
+ READ_ALL: 'all/read',
9
+ DELETE_ALL: 'all/delete',
7
10
  GET_BY_PAGE: 'by/page',
8
- COMPLETE: (uuid) => `complete/${uuid}`,
9
- CANCEL: (uuid) => `cancel/${uuid}`,
11
+ DELETE: (uuid) => `${uuid}`,
12
+ READ: (uuid) => `${uuid}/read`,
13
+ COMPLETE: (uuid) => `${uuid}/complete`,
14
+ CANCEL: (uuid) => `${uuid}/cancel`,
15
+ READ_MANY: 'read-many',
16
+ DELETE_MANY: 'delete-many',
10
17
  };
@@ -670,12 +670,26 @@ exports.REST_API = {
670
670
  RATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.MESSAGE_CONTROLLER_PRIVATE}/${CONTROLLERS.MESSAGE_PRIVATE_ROUTES.RATE(uuid)}`,
671
671
  },
672
672
  UI_NOTIFICATION_PUBLIC: {
673
+ GET_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
673
674
  GET_BY_PAGE: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
675
+ READ: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
676
+ READ_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
677
+ READ_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
678
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
679
+ DELETE_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
680
+ DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
674
681
  COMPLETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
675
682
  CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
676
683
  },
677
684
  UI_NOTIFICATION_PRIVATE: {
685
+ GET_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
678
686
  GET_BY_PAGE: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
687
+ READ: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
688
+ READ_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
689
+ READ_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
690
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
691
+ DELETE_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
692
+ DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
679
693
  COMPLETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
680
694
  CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
681
695
  },
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteAllUiNotificationsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteAllUiNotificationsCommand;
6
+ (function (DeleteAllUiNotificationsCommand) {
7
+ DeleteAllUiNotificationsCommand.ResponseSchema = zod_1.z.object({
8
+ data: zod_1.z.object({
9
+ updatedCount: zod_1.z.number().int().min(0),
10
+ }),
11
+ });
12
+ })(DeleteAllUiNotificationsCommand || (exports.DeleteAllUiNotificationsCommand = DeleteAllUiNotificationsCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteManyUiNotificationsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteManyUiNotificationsCommand;
6
+ (function (DeleteManyUiNotificationsCommand) {
7
+ DeleteManyUiNotificationsCommand.RequestBodySchema = zod_1.z.object({
8
+ uuids: zod_1.z.array(zod_1.z.string().uuid()).min(1),
9
+ });
10
+ DeleteManyUiNotificationsCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.object({
12
+ updatedCount: zod_1.z.number().int().min(0),
13
+ }),
14
+ });
15
+ })(DeleteManyUiNotificationsCommand || (exports.DeleteManyUiNotificationsCommand = DeleteManyUiNotificationsCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteUiNotificationCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteUiNotificationCommand;
6
+ (function (DeleteUiNotificationCommand) {
7
+ DeleteUiNotificationCommand.RequestParamsSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ DeleteUiNotificationCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.object({
12
+ isDeleted: zod_1.z.boolean(),
13
+ }),
14
+ });
15
+ })(DeleteUiNotificationCommand || (exports.DeleteUiNotificationCommand = DeleteUiNotificationCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindUiNotificationsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var FindUiNotificationsCommand;
7
+ (function (FindUiNotificationsCommand) {
8
+ FindUiNotificationsCommand.RequestQuerySchema = zod_1.z.object({
9
+ limit: zod_1.z.coerce.number().int().min(1).optional(),
10
+ offset: zod_1.z.coerce.number().int().min(0).optional(),
11
+ });
12
+ FindUiNotificationsCommand.ResponseSchema = zod_1.z.object({
13
+ data: zod_1.z.array(models_1.uiNotificationSchema),
14
+ });
15
+ })(FindUiNotificationsCommand || (exports.FindUiNotificationsCommand = FindUiNotificationsCommand = {}));
@@ -15,5 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./find-active-ui-notifications-by-page-and-user.command"), exports);
18
+ __exportStar(require("./find-ui-notifications.command"), exports);
19
+ __exportStar(require("./delete-ui-notification.command"), exports);
20
+ __exportStar(require("./delete-many-ui-notifications.command"), exports);
21
+ __exportStar(require("./delete-all-ui-notifications.command"), exports);
22
+ __exportStar(require("./read-ui-notification.command"), exports);
23
+ __exportStar(require("./read-many-ui-notifications.command"), exports);
24
+ __exportStar(require("./read-all-ui-notifications.command"), exports);
18
25
  __exportStar(require("./complete-ui-notification.command"), exports);
19
26
  __exportStar(require("./cancel-ui-notification.command"), exports);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReadAllUiNotificationsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var ReadAllUiNotificationsCommand;
6
+ (function (ReadAllUiNotificationsCommand) {
7
+ ReadAllUiNotificationsCommand.ResponseSchema = zod_1.z.object({
8
+ data: zod_1.z.object({
9
+ updatedCount: zod_1.z.number().int().min(0),
10
+ }),
11
+ });
12
+ })(ReadAllUiNotificationsCommand || (exports.ReadAllUiNotificationsCommand = ReadAllUiNotificationsCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReadManyUiNotificationsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var ReadManyUiNotificationsCommand;
6
+ (function (ReadManyUiNotificationsCommand) {
7
+ ReadManyUiNotificationsCommand.RequestBodySchema = zod_1.z.object({
8
+ uuids: zod_1.z.array(zod_1.z.string().uuid()).min(1),
9
+ });
10
+ ReadManyUiNotificationsCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.object({
12
+ updatedCount: zod_1.z.number().int().min(0),
13
+ }),
14
+ });
15
+ })(ReadManyUiNotificationsCommand || (exports.ReadManyUiNotificationsCommand = ReadManyUiNotificationsCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReadUiNotificationCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var ReadUiNotificationCommand;
6
+ (function (ReadUiNotificationCommand) {
7
+ ReadUiNotificationCommand.RequestParamsSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ ReadUiNotificationCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.object({
12
+ isRead: zod_1.z.boolean(),
13
+ }),
14
+ });
15
+ })(ReadUiNotificationCommand || (exports.ReadUiNotificationCommand = ReadUiNotificationCommand = {}));
@@ -6,4 +6,5 @@ var UI_NOTIFICATION_TYPE;
6
6
  UI_NOTIFICATION_TYPE["CONNECT_TELEGRAM_BONUS"] = "CONNECT_TELEGRAM_BONUS";
7
7
  UI_NOTIFICATION_TYPE["SUBSCRIPTION_PAST_DUE"] = "SUBSCRIPTION_PAST_DUE";
8
8
  UI_NOTIFICATION_TYPE["FRAUD_DETECTED"] = "FRAUD_DETECTED";
9
+ UI_NOTIFICATION_TYPE["PROMOCODE_OFFER"] = "PROMOCODE_OFFER";
9
10
  })(UI_NOTIFICATION_TYPE || (exports.UI_NOTIFICATION_TYPE = UI_NOTIFICATION_TYPE = {}));
@@ -8,6 +8,9 @@ exports.uiNotificationSchema = zod_1.z.object({
8
8
  type: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_TYPE),
9
9
  dynamicUiContent: zod_1.z.record(zod_1.z.unknown()),
10
10
  userId: zod_1.z.string().nullable(),
11
+ priority: zod_1.z.number().int(),
12
+ isRead: zod_1.z.boolean(),
13
+ readAt: zod_1.z.date().nullable(),
11
14
  status: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_STATUS),
12
15
  conditionOfExecution: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_CONDITION_OF_EXECUTION),
13
16
  endDate: zod_1.z.date().nullable(),
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllUiNotificationsCommand {
4
+ export const ResponseSchema = z.object({
5
+ data: z.object({
6
+ updatedCount: z.number().int().min(0),
7
+ }),
8
+ });
9
+
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteManyUiNotificationsCommand {
4
+ export const RequestBodySchema = z.object({
5
+ uuids: z.array(z.string().uuid()).min(1),
6
+ });
7
+
8
+ export type Request = z.infer<typeof RequestBodySchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.object({
12
+ updatedCount: z.number().int().min(0),
13
+ }),
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteUiNotificationCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+
8
+ export type Request = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.object({
12
+ isDeleted: z.boolean(),
13
+ }),
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { uiNotificationSchema } from '../../models';
3
+
4
+ export namespace FindUiNotificationsCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ limit: z.coerce.number().int().min(1).optional(),
7
+ offset: z.coerce.number().int().min(0).optional(),
8
+ });
9
+
10
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: z.array(uiNotificationSchema),
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -1,3 +1,10 @@
1
1
  export * from './find-active-ui-notifications-by-page-and-user.command';
2
+ export * from './find-ui-notifications.command';
3
+ export * from './delete-ui-notification.command';
4
+ export * from './delete-many-ui-notifications.command';
5
+ export * from './delete-all-ui-notifications.command';
6
+ export * from './read-ui-notification.command';
7
+ export * from './read-many-ui-notifications.command';
8
+ export * from './read-all-ui-notifications.command';
2
9
  export * from './complete-ui-notification.command';
3
10
  export * from './cancel-ui-notification.command';
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace ReadAllUiNotificationsCommand {
4
+ export const ResponseSchema = z.object({
5
+ data: z.object({
6
+ updatedCount: z.number().int().min(0),
7
+ }),
8
+ });
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace ReadManyUiNotificationsCommand {
4
+ export const RequestBodySchema = z.object({
5
+ uuids: z.array(z.string().uuid()).min(1),
6
+ });
7
+
8
+ export type Request = z.infer<typeof RequestBodySchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.object({
12
+ updatedCount: z.number().int().min(0),
13
+ }),
14
+ });
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace ReadUiNotificationCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+
8
+ export type Request = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.object({
12
+ isRead: z.boolean(),
13
+ }),
14
+ });
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -2,4 +2,5 @@ export enum UI_NOTIFICATION_TYPE {
2
2
  CONNECT_TELEGRAM_BONUS = 'CONNECT_TELEGRAM_BONUS',
3
3
  SUBSCRIPTION_PAST_DUE = 'SUBSCRIPTION_PAST_DUE',
4
4
  FRAUD_DETECTED = 'FRAUD_DETECTED',
5
+ PROMOCODE_OFFER = 'PROMOCODE_OFFER',
5
6
  }
@@ -9,6 +9,9 @@ export const uiNotificationSchema = z.object({
9
9
  type: z.nativeEnum(UI_NOTIFICATION_TYPE),
10
10
  dynamicUiContent: z.record(z.unknown()),
11
11
  userId: z.string().nullable(),
12
+ priority: z.number().int(),
13
+ isRead: z.boolean(),
14
+ readAt: z.date().nullable(),
12
15
  status: z.nativeEnum(UI_NOTIFICATION_STATUS),
13
16
  conditionOfExecution: z.nativeEnum(UI_NOTIFICATION_CONDITION_OF_EXECUTION),
14
17
  endDate: z.date().nullable(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.12.17",
3
+ "version": "0.12.18",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",