@purpleschool/gptbot 0.5.55 → 0.5.56
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/index.ts +1 -0
- package/api/controllers/http/ui-notification.ts +7 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/ui-notification.js +9 -0
- package/build/commands/index.js +1 -0
- package/build/commands/promocode/create-promocode.command.js +2 -0
- package/build/commands/ui-notification/complete-ui-notification.command.js +15 -0
- package/build/commands/ui-notification/find-active-ui-notifications-by-page-and-user.command.js +18 -0
- package/build/commands/ui-notification/index.js +18 -0
- package/build/constants/errors/errors.js +30 -0
- package/build/constants/index.js +1 -0
- package/build/constants/promocode/enums/promocode-promotion.enum.js +1 -1
- package/build/constants/promocode/enums/promocode-status.enum.js +2 -2
- package/build/constants/ui-notification/enums/index.js +19 -0
- package/build/constants/ui-notification/enums/ui-notification-condition-of-execution.enum.js +8 -0
- package/build/constants/ui-notification/enums/ui-notification-status.enum.js +9 -0
- package/build/constants/ui-notification/enums/ui-notification-type.enum.js +7 -0
- package/build/constants/ui-notification/index.js +17 -0
- package/build/models/index.js +1 -0
- package/build/models/ui-notification.schema.js +10 -0
- package/commands/index.ts +1 -0
- package/commands/promocode/create-promocode.command.ts +2 -0
- package/commands/ui-notification/complete-ui-notification.command.ts +16 -0
- package/commands/ui-notification/find-active-ui-notifications-by-page-and-user.command.ts +21 -0
- package/commands/ui-notification/index.ts +2 -0
- package/constants/errors/errors.ts +30 -0
- package/constants/index.ts +1 -0
- package/constants/promocode/enums/promocode-promotion.enum.ts +1 -1
- package/constants/promocode/enums/promocode-status.enum.ts +2 -2
- package/constants/ui-notification/enums/index.ts +3 -0
- package/constants/ui-notification/enums/ui-notification-condition-of-execution.enum.ts +4 -0
- package/constants/ui-notification/enums/ui-notification-status.enum.ts +5 -0
- package/constants/ui-notification/enums/ui-notification-type.enum.ts +3 -0
- package/constants/ui-notification/index.ts +1 -0
- package/models/index.ts +1 -0
- package/models/ui-notification.schema.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const UI_NOTIFICATION_PRIVATE_CONTROLLER = 'private/ui-notification' as const;
|
|
2
|
+
export const UI_NOTIFICATION_PUBLIC_CONTROLLER = 'public/ui-notification' as const;
|
|
3
|
+
|
|
4
|
+
export const UI_NOTIFICATION_ROUTES = {
|
|
5
|
+
GET_BY_PAGE: 'by/page',
|
|
6
|
+
COMPLETE: 'complete/:uuid',
|
|
7
|
+
} as const;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UI_NOTIFICATION_ROUTES = exports.UI_NOTIFICATION_PUBLIC_CONTROLLER = exports.UI_NOTIFICATION_PRIVATE_CONTROLLER = void 0;
|
|
4
|
+
exports.UI_NOTIFICATION_PRIVATE_CONTROLLER = 'private/ui-notification';
|
|
5
|
+
exports.UI_NOTIFICATION_PUBLIC_CONTROLLER = 'public/ui-notification';
|
|
6
|
+
exports.UI_NOTIFICATION_ROUTES = {
|
|
7
|
+
GET_BY_PAGE: 'by/page',
|
|
8
|
+
COMPLETE: 'complete/:uuid',
|
|
9
|
+
};
|
package/build/commands/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompelteUiNotificationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var CompelteUiNotificationCommand;
|
|
6
|
+
(function (CompelteUiNotificationCommand) {
|
|
7
|
+
CompelteUiNotificationCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
CompelteUiNotificationCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
isCompleted: zod_1.z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(CompelteUiNotificationCommand || (exports.CompelteUiNotificationCommand = CompelteUiNotificationCommand = {}));
|
package/build/commands/ui-notification/find-active-ui-notifications-by-page-and-user.command.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindActiveUiNotificationsByPageAndUserCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var FindActiveUiNotificationsByPageAndUserCommand;
|
|
6
|
+
(function (FindActiveUiNotificationsByPageAndUserCommand) {
|
|
7
|
+
FindActiveUiNotificationsByPageAndUserCommand.RequestQuerySchema = zod_1.z.object({
|
|
8
|
+
page: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
FindActiveUiNotificationsByPageAndUserCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
dynamicUiContent: zod_1.z.record(zod_1.z.unknown()),
|
|
14
|
+
endDate: zod_1.z.date().nullable(),
|
|
15
|
+
serverTime: zod_1.z.date().optional(),
|
|
16
|
+
})),
|
|
17
|
+
});
|
|
18
|
+
})(FindActiveUiNotificationsByPageAndUserCommand || (exports.FindActiveUiNotificationsByPageAndUserCommand = FindActiveUiNotificationsByPageAndUserCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./find-active-ui-notifications-by-page-and-user.command"), exports);
|
|
18
|
+
__exportStar(require("./complete-ui-notification.command"), exports);
|
|
@@ -965,4 +965,34 @@ exports.ERRORS = {
|
|
|
965
965
|
message: 'Произошла ошибка при сохранении UTM',
|
|
966
966
|
httpCode: 500,
|
|
967
967
|
},
|
|
968
|
+
UI_NOTIFICATIONS_FIND_ERROR: {
|
|
969
|
+
code: 'A219',
|
|
970
|
+
message: 'Прозошла ошибка при поиске UI уведомлений',
|
|
971
|
+
httpCode: 500,
|
|
972
|
+
},
|
|
973
|
+
UI_NOTIFICATION_CREATE_ERROR: {
|
|
974
|
+
code: 'A220',
|
|
975
|
+
message: 'Прозошла ошибка при создании UI уведомления',
|
|
976
|
+
httpCode: 500,
|
|
977
|
+
},
|
|
978
|
+
UI_NOTIFICATION_DELETE_ERROR: {
|
|
979
|
+
code: 'A221',
|
|
980
|
+
message: 'Прозошла ошибка при удалении UI уведомления',
|
|
981
|
+
httpCode: 500,
|
|
982
|
+
},
|
|
983
|
+
UI_NOTIFICATION_COMPLETE_ERROR: {
|
|
984
|
+
code: 'A222',
|
|
985
|
+
message: 'Прозошла ошибка при завершении UI уведомления',
|
|
986
|
+
httpCode: 500,
|
|
987
|
+
},
|
|
988
|
+
UI_NOTIFICATION_FIND_ERROR: {
|
|
989
|
+
code: 'A223',
|
|
990
|
+
message: 'UI уведомление не найдено',
|
|
991
|
+
httpCode: 404,
|
|
992
|
+
},
|
|
993
|
+
PROMOCODE_GENERATE_ERROR: {
|
|
994
|
+
code: 'A224',
|
|
995
|
+
message: 'Промокод не сгенерирован',
|
|
996
|
+
httpCode: 500,
|
|
997
|
+
},
|
|
968
998
|
};
|
package/build/constants/index.js
CHANGED
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PROMOCODE_PROMOTION = void 0;
|
|
4
4
|
var PROMOCODE_PROMOTION;
|
|
5
5
|
(function (PROMOCODE_PROMOTION) {
|
|
6
|
-
PROMOCODE_PROMOTION["
|
|
6
|
+
PROMOCODE_PROMOTION["BONUS"] = "bonus";
|
|
7
7
|
})(PROMOCODE_PROMOTION || (exports.PROMOCODE_PROMOTION = PROMOCODE_PROMOTION = {}));
|
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PROMOCODE_STATUS = void 0;
|
|
4
4
|
var PROMOCODE_STATUS;
|
|
5
5
|
(function (PROMOCODE_STATUS) {
|
|
6
|
-
PROMOCODE_STATUS["
|
|
7
|
-
PROMOCODE_STATUS["
|
|
6
|
+
PROMOCODE_STATUS["ACTIVE"] = "active";
|
|
7
|
+
PROMOCODE_STATUS["INACTIVE"] = "inactive";
|
|
8
8
|
})(PROMOCODE_STATUS || (exports.PROMOCODE_STATUS = PROMOCODE_STATUS = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ui-notification-condition-of-execution.enum"), exports);
|
|
18
|
+
__exportStar(require("./ui-notification-status.enum"), exports);
|
|
19
|
+
__exportStar(require("./ui-notification-type.enum"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UI_NOTIFICATION_CONDITION_OF_EXECUTION = void 0;
|
|
4
|
+
var UI_NOTIFICATION_CONDITION_OF_EXECUTION;
|
|
5
|
+
(function (UI_NOTIFICATION_CONDITION_OF_EXECUTION) {
|
|
6
|
+
UI_NOTIFICATION_CONDITION_OF_EXECUTION["EVENT"] = "EVENT";
|
|
7
|
+
UI_NOTIFICATION_CONDITION_OF_EXECUTION["USER_ACTION"] = "USER_ACTION";
|
|
8
|
+
})(UI_NOTIFICATION_CONDITION_OF_EXECUTION || (exports.UI_NOTIFICATION_CONDITION_OF_EXECUTION = UI_NOTIFICATION_CONDITION_OF_EXECUTION = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UI_NOTIFICATION_STATUS = void 0;
|
|
4
|
+
var UI_NOTIFICATION_STATUS;
|
|
5
|
+
(function (UI_NOTIFICATION_STATUS) {
|
|
6
|
+
UI_NOTIFICATION_STATUS["ACTIVE"] = "ACTIVE";
|
|
7
|
+
UI_NOTIFICATION_STATUS["EXPIRED"] = "EXPIRED";
|
|
8
|
+
UI_NOTIFICATION_STATUS["CLAIMED"] = "CLAIMED";
|
|
9
|
+
})(UI_NOTIFICATION_STATUS || (exports.UI_NOTIFICATION_STATUS = UI_NOTIFICATION_STATUS = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UI_NOTIFICATION_TYPE = void 0;
|
|
4
|
+
var UI_NOTIFICATION_TYPE;
|
|
5
|
+
(function (UI_NOTIFICATION_TYPE) {
|
|
6
|
+
UI_NOTIFICATION_TYPE["CONNECT_TELEGRAM_BONUS"] = "CONNECT_TELEGRAM_BONUS";
|
|
7
|
+
})(UI_NOTIFICATION_TYPE || (exports.UI_NOTIFICATION_TYPE = UI_NOTIFICATION_TYPE = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
package/build/models/index.js
CHANGED
|
@@ -47,3 +47,4 @@ __exportStar(require("./user-to-product.schema"), exports);
|
|
|
47
47
|
__exportStar(require("./user-to-subscription.schema"), exports);
|
|
48
48
|
__exportStar(require("./user.schema"), exports);
|
|
49
49
|
__exportStar(require("./utm.schema"), exports);
|
|
50
|
+
__exportStar(require("./ui-notification.schema"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiNotificationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.uiNotificationSchema = zod_1.z.object({
|
|
6
|
+
promocode: zod_1.z.string(),
|
|
7
|
+
text: zod_1.z.string().optional(),
|
|
8
|
+
endDate: zod_1.z.date().nullable(),
|
|
9
|
+
serverTime: zod_1.z.date().optional(),
|
|
10
|
+
});
|
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace CompelteUiNotificationCommand {
|
|
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
|
+
isCompleted: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace FindActiveUiNotificationsByPageAndUserCommand {
|
|
4
|
+
export const RequestQuerySchema = z.object({
|
|
5
|
+
page: z.string(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestQuerySchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.array(
|
|
12
|
+
z.object({
|
|
13
|
+
uuid: z.string().uuid(),
|
|
14
|
+
dynamicUiContent: z.record(z.unknown()),
|
|
15
|
+
endDate: z.date().nullable(),
|
|
16
|
+
serverTime: z.date().optional(),
|
|
17
|
+
}),
|
|
18
|
+
),
|
|
19
|
+
});
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
|
@@ -968,4 +968,34 @@ export const ERRORS = {
|
|
|
968
968
|
message: 'Произошла ошибка при сохранении UTM',
|
|
969
969
|
httpCode: 500,
|
|
970
970
|
},
|
|
971
|
+
UI_NOTIFICATIONS_FIND_ERROR: {
|
|
972
|
+
code: 'A219',
|
|
973
|
+
message: 'Прозошла ошибка при поиске UI уведомлений',
|
|
974
|
+
httpCode: 500,
|
|
975
|
+
},
|
|
976
|
+
UI_NOTIFICATION_CREATE_ERROR: {
|
|
977
|
+
code: 'A220',
|
|
978
|
+
message: 'Прозошла ошибка при создании UI уведомления',
|
|
979
|
+
httpCode: 500,
|
|
980
|
+
},
|
|
981
|
+
UI_NOTIFICATION_DELETE_ERROR: {
|
|
982
|
+
code: 'A221',
|
|
983
|
+
message: 'Прозошла ошибка при удалении UI уведомления',
|
|
984
|
+
httpCode: 500,
|
|
985
|
+
},
|
|
986
|
+
UI_NOTIFICATION_COMPLETE_ERROR: {
|
|
987
|
+
code: 'A222',
|
|
988
|
+
message: 'Прозошла ошибка при завершении UI уведомления',
|
|
989
|
+
httpCode: 500,
|
|
990
|
+
},
|
|
991
|
+
UI_NOTIFICATION_FIND_ERROR: {
|
|
992
|
+
code: 'A223',
|
|
993
|
+
message: 'UI уведомление не найдено',
|
|
994
|
+
httpCode: 404,
|
|
995
|
+
},
|
|
996
|
+
PROMOCODE_GENERATE_ERROR: {
|
|
997
|
+
code: 'A224',
|
|
998
|
+
message: 'Промокод не сгенерирован',
|
|
999
|
+
httpCode: 500,
|
|
1000
|
+
},
|
|
971
1001
|
};
|
package/constants/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
package/models/index.ts
CHANGED