@purpleschool/gptbot 0.5.68 → 0.5.70
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/build/api/controllers/http/ui-notification.js +1 -0
- package/build/commands/ui-notification/cancel-ui-notification.command.js +15 -0
- package/build/commands/ui-notification/index.js +1 -0
- package/build/constants/ui-notification/enums/ui-notification-status.enum.js +1 -0
- package/build/models/ui-notification.schema.js +4 -3
- package/commands/ui-notification/cancel-ui-notification.command.ts +16 -0
- package/commands/ui-notification/index.ts +1 -0
- package/constants/ui-notification/enums/ui-notification-status.enum.ts +1 -0
- package/models/ui-notification.schema.ts +8 -4
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelUiNotificationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var CancelUiNotificationCommand;
|
|
6
|
+
(function (CancelUiNotificationCommand) {
|
|
7
|
+
CancelUiNotificationCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
CancelUiNotificationCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
isCancelled: zod_1.z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(CancelUiNotificationCommand || (exports.CancelUiNotificationCommand = CancelUiNotificationCommand = {}));
|
|
@@ -16,3 +16,4 @@ 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("./complete-ui-notification.command"), exports);
|
|
19
|
+
__exportStar(require("./cancel-ui-notification.command"), exports);
|
|
@@ -6,4 +6,5 @@ var UI_NOTIFICATION_STATUS;
|
|
|
6
6
|
UI_NOTIFICATION_STATUS["ACTIVE"] = "ACTIVE";
|
|
7
7
|
UI_NOTIFICATION_STATUS["EXPIRED"] = "EXPIRED";
|
|
8
8
|
UI_NOTIFICATION_STATUS["CLAIMED"] = "CLAIMED";
|
|
9
|
+
UI_NOTIFICATION_STATUS["CANCELLED"] = "CANCELLED";
|
|
9
10
|
})(UI_NOTIFICATION_STATUS || (exports.UI_NOTIFICATION_STATUS = UI_NOTIFICATION_STATUS = {}));
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uiNotificationSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
5
6
|
exports.uiNotificationSchema = zod_1.z.object({
|
|
6
7
|
uuid: zod_1.z.string().uuid(),
|
|
7
|
-
type: zod_1.z.
|
|
8
|
+
type: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_TYPE),
|
|
8
9
|
dynamicUiContent: zod_1.z.record(zod_1.z.unknown()),
|
|
9
10
|
userId: zod_1.z.string().nullable(),
|
|
10
|
-
status: zod_1.z.
|
|
11
|
-
conditionOfExecution: zod_1.z.
|
|
11
|
+
status: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_STATUS),
|
|
12
|
+
conditionOfExecution: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_CONDITION_OF_EXECUTION),
|
|
12
13
|
endDate: zod_1.z.date().nullable(),
|
|
13
14
|
serverTime: zod_1.z.date().optional(),
|
|
14
15
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace CancelUiNotificationCommand {
|
|
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
|
+
isCancelled: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
import {
|
|
3
|
+
UI_NOTIFICATION_CONDITION_OF_EXECUTION,
|
|
4
|
+
UI_NOTIFICATION_STATUS,
|
|
5
|
+
UI_NOTIFICATION_TYPE,
|
|
6
|
+
} from '../constants';
|
|
3
7
|
export const uiNotificationSchema = z.object({
|
|
4
8
|
uuid: z.string().uuid(),
|
|
5
|
-
type: z.
|
|
9
|
+
type: z.nativeEnum(UI_NOTIFICATION_TYPE),
|
|
6
10
|
dynamicUiContent: z.record(z.unknown()),
|
|
7
11
|
userId: z.string().nullable(),
|
|
8
|
-
status: z.
|
|
9
|
-
conditionOfExecution: z.
|
|
12
|
+
status: z.nativeEnum(UI_NOTIFICATION_STATUS),
|
|
13
|
+
conditionOfExecution: z.nativeEnum(UI_NOTIFICATION_CONDITION_OF_EXECUTION),
|
|
10
14
|
endDate: z.date().nullable(),
|
|
11
15
|
serverTime: z.date().optional(),
|
|
12
16
|
});
|