@purpleschool/gptbot 0.12.16 → 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 (31) hide show
  1. package/api/controllers/http/team-account.ts +1 -0
  2. package/api/controllers/http/ui-notification.ts +9 -2
  3. package/api/routes.ts +20 -0
  4. package/build/api/controllers/http/team-account.js +1 -0
  5. package/build/api/controllers/http/ui-notification.js +9 -2
  6. package/build/api/routes.js +15 -0
  7. package/build/commands/team-account/find-team-account-by-uuid.command.js +14 -0
  8. package/build/commands/team-account/index.js +1 -0
  9. package/build/commands/ui-notification/delete-all-ui-notifications.command.js +12 -0
  10. package/build/commands/ui-notification/delete-many-ui-notifications.command.js +15 -0
  11. package/build/commands/ui-notification/delete-ui-notification.command.js +15 -0
  12. package/build/commands/ui-notification/find-ui-notifications.command.js +15 -0
  13. package/build/commands/ui-notification/index.js +7 -0
  14. package/build/commands/ui-notification/read-all-ui-notifications.command.js +12 -0
  15. package/build/commands/ui-notification/read-many-ui-notifications.command.js +15 -0
  16. package/build/commands/ui-notification/read-ui-notification.command.js +15 -0
  17. package/build/constants/ui-notification/enums/ui-notification-type.enum.js +1 -0
  18. package/build/models/ui-notification.schema.js +3 -0
  19. package/commands/team-account/find-team-account-by-uuid.command.ts +16 -0
  20. package/commands/team-account/index.ts +1 -0
  21. package/commands/ui-notification/delete-all-ui-notifications.command.ts +11 -0
  22. package/commands/ui-notification/delete-many-ui-notifications.command.ts +17 -0
  23. package/commands/ui-notification/delete-ui-notification.command.ts +17 -0
  24. package/commands/ui-notification/find-ui-notifications.command.ts +17 -0
  25. package/commands/ui-notification/index.ts +7 -0
  26. package/commands/ui-notification/read-all-ui-notifications.command.ts +10 -0
  27. package/commands/ui-notification/read-many-ui-notifications.command.ts +16 -0
  28. package/commands/ui-notification/read-ui-notification.command.ts +16 -0
  29. package/constants/ui-notification/enums/ui-notification-type.enum.ts +1 -0
  30. package/models/ui-notification.schema.ts +3 -0
  31. package/package.json +1 -1
@@ -26,4 +26,5 @@ export const TEAM_ACCOUNT_ROUTES = {
26
26
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId: string) =>
27
27
  `admin/subscriptions/current/${teamAccountId}`,
28
28
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId: string) => `admin/payments/history/${teamAccountId}`,
29
+ ADMIN_FIND_BY_UUID: (uuid: string) => `admin/find/${uuid}`,
29
30
  } as const;
@@ -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
@@ -211,6 +211,8 @@ export const REST_API = {
211
211
  `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_CURRENT_SUBSCRIPTIONS(teamAccountId)}`,
212
212
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId: string) =>
213
213
  `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_PAYMENT_HISTORY(teamAccountId)}`,
214
+ ADMIN_FIND_BY_UUID: (teamAccountId: string) =>
215
+ `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_FIND_BY_UUID(teamAccountId)}`,
214
216
  },
215
217
  FILES: {
216
218
  UPLOAD_FILE: `${ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD_FILE}`,
@@ -887,14 +889,32 @@ export const REST_API = {
887
889
  `${ROOT}/${CONTROLLERS.MESSAGE_CONTROLLER_PRIVATE}/${CONTROLLERS.MESSAGE_PRIVATE_ROUTES.RATE(uuid)}`,
888
890
  },
889
891
  UI_NOTIFICATION_PUBLIC: {
892
+ GET_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
890
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}`,
891
902
  COMPLETE: (uuid: string) =>
892
903
  `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
893
904
  CANCEL: (uuid: string) =>
894
905
  `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
895
906
  },
896
907
  UI_NOTIFICATION_PRIVATE: {
908
+ GET_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
897
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}`,
898
918
  COMPLETE: (uuid: string) =>
899
919
  `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
900
920
  CANCEL: (uuid: string) =>
@@ -27,4 +27,5 @@ exports.TEAM_ACCOUNT_ROUTES = {
27
27
  ADMIN_GET_INVOICES: 'admin/invoices',
28
28
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId) => `admin/subscriptions/current/${teamAccountId}`,
29
29
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId) => `admin/payments/history/${teamAccountId}`,
30
+ ADMIN_FIND_BY_UUID: (uuid) => `admin/find/${uuid}`,
30
31
  };
@@ -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
  };
@@ -208,6 +208,7 @@ exports.REST_API = {
208
208
  ADMIN_GET_INVOICES: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_INVOICES}`,
209
209
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId) => `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_CURRENT_SUBSCRIPTIONS(teamAccountId)}`,
210
210
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId) => `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_PAYMENT_HISTORY(teamAccountId)}`,
211
+ ADMIN_FIND_BY_UUID: (teamAccountId) => `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_FIND_BY_UUID(teamAccountId)}`,
211
212
  },
212
213
  FILES: {
213
214
  UPLOAD_FILE: `${exports.ROOT}/${CONTROLLERS.FILE_CONTROLLER}/${CONTROLLERS.FILE_ROUTES.UPLOAD_FILE}`,
@@ -669,12 +670,26 @@ exports.REST_API = {
669
670
  RATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.MESSAGE_CONTROLLER_PRIVATE}/${CONTROLLERS.MESSAGE_PRIVATE_ROUTES.RATE(uuid)}`,
670
671
  },
671
672
  UI_NOTIFICATION_PUBLIC: {
673
+ GET_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
672
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}`,
673
681
  COMPLETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
674
682
  CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
675
683
  },
676
684
  UI_NOTIFICATION_PRIVATE: {
685
+ GET_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
677
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}`,
678
693
  COMPLETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
679
694
  CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
680
695
  },
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindTeamAccountByUuidCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var FindTeamAccountByUuidCommand;
7
+ (function (FindTeamAccountByUuidCommand) {
8
+ FindTeamAccountByUuidCommand.RequestParamSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ FindTeamAccountByUuidCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.TeamAccountWithBalanceSchema,
13
+ });
14
+ })(FindTeamAccountByUuidCommand || (exports.FindTeamAccountByUuidCommand = FindTeamAccountByUuidCommand = {}));
@@ -37,6 +37,7 @@ __exportStar(require("./get-team-account-balance.command"), exports);
37
37
  __exportStar(require("./create-manual-team-subscription.command"), exports);
38
38
  __exportStar(require("./create-manual-team-product.command"), exports);
39
39
  __exportStar(require("./find-team-accounts-by-name.command"), exports);
40
+ __exportStar(require("./find-team-account-by-uuid.command"), exports);
40
41
  __exportStar(require("./create-team-account-invoice-payment.command"), exports);
41
42
  __exportStar(require("./get-invoice-for-payment.command"), exports);
42
43
  __exportStar(require("./get-team-account-payment-history.command"), exports);
@@ -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,16 @@
1
+ import { z } from 'zod';
2
+ import { TeamAccountWithBalanceSchema } from '../../models';
3
+
4
+ export namespace FindTeamAccountByUuidCommand {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: TeamAccountWithBalanceSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -21,6 +21,7 @@ export * from './get-team-account-balance.command';
21
21
  export * from './create-manual-team-subscription.command';
22
22
  export * from './create-manual-team-product.command';
23
23
  export * from './find-team-accounts-by-name.command';
24
+ export * from './find-team-account-by-uuid.command';
24
25
  export * from './create-team-account-invoice-payment.command';
25
26
  export * from './get-invoice-for-payment.command';
26
27
  export * from './get-team-account-payment-history.command';
@@ -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.16",
3
+ "version": "0.12.18",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",