@purpleschool/gptbot 0.12.24 → 0.12.26
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/ui-notification.ts +1 -0
- package/api/routes.ts +1 -0
- package/build/api/controllers/http/ui-notification.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/ui-notification/create-admin-broadcast-ui-notification.command.js +17 -0
- package/build/commands/ui-notification/index.js +1 -0
- package/build/constants/ui-notification/enums/ui-notification-type.enum.js +1 -0
- package/build/models/product.schema.js +2 -0
- package/build/models/subscription.schema.js +1 -0
- package/commands/ui-notification/create-admin-broadcast-ui-notification.command.ts +19 -0
- package/commands/ui-notification/index.ts +1 -0
- package/constants/ui-notification/enums/ui-notification-type.enum.ts +1 -0
- package/models/product.schema.ts +2 -0
- package/models/subscription.schema.ts +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ 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
|
+
ADMIN_BROADCAST: 'admin/broadcast',
|
|
5
6
|
GET_ALL: 'all',
|
|
6
7
|
READ_ALL: 'all/read',
|
|
7
8
|
DELETE_ALL: 'all/delete',
|
package/api/routes.ts
CHANGED
|
@@ -905,6 +905,7 @@ export const REST_API = {
|
|
|
905
905
|
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
|
|
906
906
|
},
|
|
907
907
|
UI_NOTIFICATION_PRIVATE: {
|
|
908
|
+
ADMIN_BROADCAST: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.ADMIN_BROADCAST}`,
|
|
908
909
|
GET_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
|
|
909
910
|
GET_BY_PAGE: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
|
|
910
911
|
READ: (uuid: string) =>
|
|
@@ -4,6 +4,7 @@ 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
|
+
ADMIN_BROADCAST: 'admin/broadcast',
|
|
7
8
|
GET_ALL: 'all',
|
|
8
9
|
READ_ALL: 'all/read',
|
|
9
10
|
DELETE_ALL: 'all/delete',
|
package/build/api/routes.js
CHANGED
|
@@ -682,6 +682,7 @@ exports.REST_API = {
|
|
|
682
682
|
CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
|
|
683
683
|
},
|
|
684
684
|
UI_NOTIFICATION_PRIVATE: {
|
|
685
|
+
ADMIN_BROADCAST: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.ADMIN_BROADCAST}`,
|
|
685
686
|
GET_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
|
|
686
687
|
GET_BY_PAGE: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
|
|
687
688
|
READ: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateAdminBroadcastUiNotificationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var CreateAdminBroadcastUiNotificationCommand;
|
|
6
|
+
(function (CreateAdminBroadcastUiNotificationCommand) {
|
|
7
|
+
CreateAdminBroadcastUiNotificationCommand.RequestBodySchema = zod_1.z.object({
|
|
8
|
+
title: zod_1.z.string().trim().min(1),
|
|
9
|
+
message: zod_1.z.string().trim().min(1),
|
|
10
|
+
onlyRegistered: zod_1.z.boolean().optional(),
|
|
11
|
+
});
|
|
12
|
+
CreateAdminBroadcastUiNotificationCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: zod_1.z.object({
|
|
14
|
+
insertedCount: zod_1.z.number().int().min(0),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
})(CreateAdminBroadcastUiNotificationCommand || (exports.CreateAdminBroadcastUiNotificationCommand = CreateAdminBroadcastUiNotificationCommand = {}));
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./find-active-ui-notifications-by-page-and-user.command"), exports);
|
|
18
18
|
__exportStar(require("./find-ui-notifications.command"), exports);
|
|
19
|
+
__exportStar(require("./create-admin-broadcast-ui-notification.command"), exports);
|
|
19
20
|
__exportStar(require("./delete-ui-notification.command"), exports);
|
|
20
21
|
__exportStar(require("./delete-many-ui-notifications.command"), exports);
|
|
21
22
|
__exportStar(require("./delete-all-ui-notifications.command"), exports);
|
|
@@ -7,4 +7,5 @@ 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["GENERIC"] = "GENERIC";
|
|
10
11
|
})(UI_NOTIFICATION_TYPE || (exports.UI_NOTIFICATION_TYPE = UI_NOTIFICATION_TYPE = {}));
|
|
@@ -13,6 +13,8 @@ exports.ProductSchema = zod_1.z.object({
|
|
|
13
13
|
name: zod_1.z.string().min(3).max(16384),
|
|
14
14
|
requests: zod_1.z.number(),
|
|
15
15
|
price: zod_1.z.number(),
|
|
16
|
+
discountedPrice: zod_1.z.number().optional(),
|
|
17
|
+
discountPercent: zod_1.z.number().optional(),
|
|
16
18
|
billingScope: zod_1.z.nativeEnum(constants_1.BILLING_SCOPE),
|
|
17
19
|
icon: zod_1.z.string(),
|
|
18
20
|
icons: zod_1.z.object({
|
|
@@ -11,6 +11,7 @@ exports.SubscriptionSchema = zod_1.z.object({
|
|
|
11
11
|
name: zod_1.z.string().min(3).max(16384),
|
|
12
12
|
requests: zod_1.z.number(),
|
|
13
13
|
price: zod_1.z.number(),
|
|
14
|
+
productDiscountPercent: zod_1.z.number().optional(),
|
|
14
15
|
billingScope: zod_1.z.nativeEnum(constants_1.BILLING_SCOPE),
|
|
15
16
|
plan: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_PLAN),
|
|
16
17
|
type: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_TYPE),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace CreateAdminBroadcastUiNotificationCommand {
|
|
4
|
+
export const RequestBodySchema = z.object({
|
|
5
|
+
title: z.string().trim().min(1),
|
|
6
|
+
message: z.string().trim().min(1),
|
|
7
|
+
onlyRegistered: z.boolean().optional(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestBodySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.object({
|
|
14
|
+
insertedCount: z.number().int().min(0),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './find-active-ui-notifications-by-page-and-user.command';
|
|
2
2
|
export * from './find-ui-notifications.command';
|
|
3
|
+
export * from './create-admin-broadcast-ui-notification.command';
|
|
3
4
|
export * from './delete-ui-notification.command';
|
|
4
5
|
export * from './delete-many-ui-notifications.command';
|
|
5
6
|
export * from './delete-all-ui-notifications.command';
|
package/models/product.schema.ts
CHANGED
|
@@ -12,6 +12,8 @@ export const ProductSchema = z.object({
|
|
|
12
12
|
name: z.string().min(3).max(16384),
|
|
13
13
|
requests: z.number(),
|
|
14
14
|
price: z.number(),
|
|
15
|
+
discountedPrice: z.number().optional(),
|
|
16
|
+
discountPercent: z.number().optional(),
|
|
15
17
|
billingScope: z.nativeEnum(BILLING_SCOPE),
|
|
16
18
|
icon: z.string(),
|
|
17
19
|
icons: z.object({
|
|
@@ -14,6 +14,7 @@ export const SubscriptionSchema = z.object({
|
|
|
14
14
|
name: z.string().min(3).max(16384),
|
|
15
15
|
requests: z.number(),
|
|
16
16
|
price: z.number(),
|
|
17
|
+
productDiscountPercent: z.number().optional(),
|
|
17
18
|
billingScope: z.nativeEnum(BILLING_SCOPE),
|
|
18
19
|
plan: z.nativeEnum(SUBSCRIPTION_PLAN),
|
|
19
20
|
type: z.nativeEnum(SUBSCRIPTION_TYPE),
|