@purpleschool/gptbot 0.8.51 → 0.8.53
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/user.ts +1 -0
- package/api/routes.ts +2 -0
- package/build/api/controllers/http/user.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/user/cancel-user-subscription.command.js +21 -0
- package/build/commands/user/get-me.command.js +2 -0
- package/build/commands/user/index.js +1 -0
- package/commands/user/cancel-user-subscription.command.ts +21 -0
- package/commands/user/get-me.command.ts +2 -0
- package/commands/user/index.ts +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export const USER_ROUTES = {
|
|
|
9
9
|
GET_BALANCE: (uuid: string) => `balance/${uuid}`,
|
|
10
10
|
GET_ORDERS: (uuid: string) => `orders/${uuid}`,
|
|
11
11
|
GET_SUBSCRIPTIONS: (uuid: string) => `subscriptions/${uuid}`,
|
|
12
|
+
CANCEL_SUBSCRIPTION: (uuid: string) => `subscriptions/${uuid}/cancel`,
|
|
12
13
|
GET_PRODUCTS: (uuid: string) => `products/${uuid}`,
|
|
13
14
|
GET_PAYMENTS: (uuid: string) => `payments/${uuid}`,
|
|
14
15
|
GET_COUNT_NOTIFICATION: 'broadcast/count',
|
package/api/routes.ts
CHANGED
|
@@ -29,6 +29,8 @@ export const REST_API = {
|
|
|
29
29
|
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PAYMENTS(uuid)}`,
|
|
30
30
|
GET_SUBSCRIPTIONS: (uuid: string) =>
|
|
31
31
|
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_SUBSCRIPTIONS(uuid)}`,
|
|
32
|
+
CANCEL_SUBSCRIPTION: (uuid: string) =>
|
|
33
|
+
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CANCEL_SUBSCRIPTION(uuid)}`,
|
|
32
34
|
GET_PRODUCTS: (uuid: string) =>
|
|
33
35
|
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
34
36
|
GET_COUNT_NOTIFICATION: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_COUNT_NOTIFICATION}`,
|
|
@@ -11,6 +11,7 @@ exports.USER_ROUTES = {
|
|
|
11
11
|
GET_BALANCE: (uuid) => `balance/${uuid}`,
|
|
12
12
|
GET_ORDERS: (uuid) => `orders/${uuid}`,
|
|
13
13
|
GET_SUBSCRIPTIONS: (uuid) => `subscriptions/${uuid}`,
|
|
14
|
+
CANCEL_SUBSCRIPTION: (uuid) => `subscriptions/${uuid}/cancel`,
|
|
14
15
|
GET_PRODUCTS: (uuid) => `products/${uuid}`,
|
|
15
16
|
GET_PAYMENTS: (uuid) => `payments/${uuid}`,
|
|
16
17
|
GET_COUNT_NOTIFICATION: 'broadcast/count',
|
package/build/api/routes.js
CHANGED
|
@@ -59,6 +59,7 @@ exports.REST_API = {
|
|
|
59
59
|
GET_ORDERS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_ORDERS(uuid)}`,
|
|
60
60
|
GET_PAYMENTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PAYMENTS(uuid)}`,
|
|
61
61
|
GET_SUBSCRIPTIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_SUBSCRIPTIONS(uuid)}`,
|
|
62
|
+
CANCEL_SUBSCRIPTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CANCEL_SUBSCRIPTION(uuid)}`,
|
|
62
63
|
GET_PRODUCTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
63
64
|
GET_COUNT_NOTIFICATION: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_COUNT_NOTIFICATION}`,
|
|
64
65
|
SEND_NOTIFICATION: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.SEND_NOTIFICATION}`,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CancelUserSubscriptionCommand = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
var CancelUserSubscriptionCommand;
|
|
9
|
+
(function (CancelUserSubscriptionCommand) {
|
|
10
|
+
CancelUserSubscriptionCommand.RequestParamSchema = zod_1.default.object({
|
|
11
|
+
uuid: zod_1.default.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
CancelUserSubscriptionCommand.RequestSchema = zod_1.default.object({
|
|
14
|
+
subscriptionId: zod_1.default.string().uuid(),
|
|
15
|
+
});
|
|
16
|
+
CancelUserSubscriptionCommand.ResponseSchema = zod_1.default.object({
|
|
17
|
+
data: zod_1.default.object({
|
|
18
|
+
isCancelled: zod_1.default.boolean(),
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
})(CancelUserSubscriptionCommand || (exports.CancelUserSubscriptionCommand = CancelUserSubscriptionCommand = {}));
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GetMeCommand = void 0;
|
|
4
4
|
const constants_1 = require("../../constants");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
+
const models_1 = require("../../models");
|
|
6
7
|
var GetMeCommand;
|
|
7
8
|
(function (GetMeCommand) {
|
|
8
9
|
GetMeCommand.RequestSchema = zod_1.z.object({});
|
|
@@ -15,6 +16,7 @@ var GetMeCommand;
|
|
|
15
16
|
signupMethod: zod_1.z.nativeEnum(constants_1.SIGNUP_METHOD),
|
|
16
17
|
telegramId: zod_1.z.number().nullable(),
|
|
17
18
|
webmasterId: zod_1.z.string().uuid().nullable(),
|
|
19
|
+
profile: models_1.UserProfileResponseSchema,
|
|
18
20
|
}),
|
|
19
21
|
});
|
|
20
22
|
})(GetMeCommand || (exports.GetMeCommand = GetMeCommand = {}));
|
|
@@ -26,3 +26,4 @@ __exportStar(require("./get-user-products.command"), exports);
|
|
|
26
26
|
__exportStar(require("./delete-account.command"), exports);
|
|
27
27
|
__exportStar(require("./get-aggregated-user-data.command"), exports);
|
|
28
28
|
__exportStar(require("./get-user-payments.command"), exports);
|
|
29
|
+
__exportStar(require("./cancel-user-subscription.command"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace CancelUserSubscriptionCommand {
|
|
4
|
+
export const RequestParamSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestSchema = z.object({
|
|
11
|
+
subscriptionId: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const ResponseSchema = z.object({
|
|
15
|
+
data: z.object({
|
|
16
|
+
isCancelled: z.boolean(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { UserProfileResponseSchema } from '../../models';
|
|
3
4
|
|
|
4
5
|
export namespace GetMeCommand {
|
|
5
6
|
export const RequestSchema = z.object({});
|
|
@@ -15,6 +16,7 @@ export namespace GetMeCommand {
|
|
|
15
16
|
signupMethod: z.nativeEnum(SIGNUP_METHOD),
|
|
16
17
|
telegramId: z.number().nullable(),
|
|
17
18
|
webmasterId: z.string().uuid().nullable(),
|
|
19
|
+
profile: UserProfileResponseSchema,
|
|
18
20
|
}),
|
|
19
21
|
});
|
|
20
22
|
|
package/commands/user/index.ts
CHANGED