@purpleschool/gptbot 0.15.86 → 0.15.88-stage-2
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/build/api/controllers/http/user.d.ts +2 -0
- package/build/api/controllers/http/user.js +2 -0
- package/build/api/routes.d.ts +2 -0
- package/build/api/routes.js +2 -0
- package/build/commands/user/adjust-user-bonus-balance.command.d.ts +17 -0
- package/build/commands/user/adjust-user-bonus-balance.command.js +25 -0
- package/build/commands/user/grant-user-product.command.d.ts +24 -0
- package/build/commands/user/grant-user-product.command.js +20 -0
- package/build/commands/user/index.d.ts +2 -0
- package/build/commands/user/index.js +2 -0
- package/package.json +1 -1
|
@@ -9,11 +9,13 @@ export declare const USER_ROUTES: {
|
|
|
9
9
|
readonly FIND_BY_CRITERIA: 'criteria';
|
|
10
10
|
readonly FIND_BY_UUID: (uuid: string) => string;
|
|
11
11
|
readonly GET_BALANCE: (uuid: string) => string;
|
|
12
|
+
readonly ADJUST_BONUS_BALANCE: (uuid: string) => string;
|
|
12
13
|
readonly GET_ORDERS: (uuid: string) => string;
|
|
13
14
|
readonly GET_SUBSCRIPTIONS: (uuid: string) => string;
|
|
14
15
|
readonly CANCEL_SUBSCRIPTION: (uuid: string) => string;
|
|
15
16
|
readonly GET_PRODUCTS: (uuid: string) => string;
|
|
16
17
|
readonly CANCEL_PRODUCT: (uuid: string) => string;
|
|
18
|
+
readonly GRANT_PRODUCT: (uuid: string) => string;
|
|
17
19
|
readonly GET_PAYMENTS: (uuid: string) => string;
|
|
18
20
|
readonly GET_COUNT_NOTIFICATION: 'broadcast/count';
|
|
19
21
|
readonly SEND_NOTIFICATION: 'broadcast';
|
|
@@ -12,11 +12,13 @@ exports.USER_ROUTES = {
|
|
|
12
12
|
FIND_BY_CRITERIA: 'criteria',
|
|
13
13
|
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
14
14
|
GET_BALANCE: (uuid) => `balance/${uuid}`,
|
|
15
|
+
ADJUST_BONUS_BALANCE: (uuid) => `balance/${uuid}/bonus`,
|
|
15
16
|
GET_ORDERS: (uuid) => `orders/${uuid}`,
|
|
16
17
|
GET_SUBSCRIPTIONS: (uuid) => `subscriptions/${uuid}`,
|
|
17
18
|
CANCEL_SUBSCRIPTION: (uuid) => `subscriptions/${uuid}/cancel`,
|
|
18
19
|
GET_PRODUCTS: (uuid) => `products/${uuid}`,
|
|
19
20
|
CANCEL_PRODUCT: (uuid) => `products/${uuid}/cancel`,
|
|
21
|
+
GRANT_PRODUCT: (uuid) => `products/${uuid}/grant`,
|
|
20
22
|
GET_PAYMENTS: (uuid) => `payments/${uuid}`,
|
|
21
23
|
GET_COUNT_NOTIFICATION: 'broadcast/count',
|
|
22
24
|
SEND_NOTIFICATION: 'broadcast',
|
package/build/api/routes.d.ts
CHANGED
|
@@ -22,12 +22,14 @@ export declare const REST_API: {
|
|
|
22
22
|
readonly FIND_BY_CRITERIA: "/api/users/criteria";
|
|
23
23
|
readonly FIND_BY_UUID: (uuid: string) => string;
|
|
24
24
|
readonly GET_BALANCE: (uuid: string) => string;
|
|
25
|
+
readonly ADJUST_BONUS_BALANCE: (uuid: string) => string;
|
|
25
26
|
readonly GET_ORDERS: (uuid: string) => string;
|
|
26
27
|
readonly GET_PAYMENTS: (uuid: string) => string;
|
|
27
28
|
readonly GET_SUBSCRIPTIONS: (uuid: string) => string;
|
|
28
29
|
readonly CANCEL_SUBSCRIPTION: (uuid: string) => string;
|
|
29
30
|
readonly GET_PRODUCTS: (uuid: string) => string;
|
|
30
31
|
readonly CANCEL_PRODUCT: (uuid: string) => string;
|
|
32
|
+
readonly GRANT_PRODUCT: (uuid: string) => string;
|
|
31
33
|
readonly GET_COUNT_NOTIFICATION: "/api/users/broadcast/count";
|
|
32
34
|
readonly SEND_NOTIFICATION: "/api/users/broadcast";
|
|
33
35
|
readonly DELETE_ACCOUNT: "/api/users/delete-account";
|
package/build/api/routes.js
CHANGED
|
@@ -60,12 +60,14 @@ exports.REST_API = {
|
|
|
60
60
|
FIND_BY_CRITERIA: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_CRITERIA}`,
|
|
61
61
|
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
62
62
|
GET_BALANCE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_BALANCE(uuid)}`,
|
|
63
|
+
ADJUST_BONUS_BALANCE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.ADJUST_BONUS_BALANCE(uuid)}`,
|
|
63
64
|
GET_ORDERS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_ORDERS(uuid)}`,
|
|
64
65
|
GET_PAYMENTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PAYMENTS(uuid)}`,
|
|
65
66
|
GET_SUBSCRIPTIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_SUBSCRIPTIONS(uuid)}`,
|
|
66
67
|
CANCEL_SUBSCRIPTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CANCEL_SUBSCRIPTION(uuid)}`,
|
|
67
68
|
GET_PRODUCTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
68
69
|
CANCEL_PRODUCT: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CANCEL_PRODUCT(uuid)}`,
|
|
70
|
+
GRANT_PRODUCT: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GRANT_PRODUCT(uuid)}`,
|
|
69
71
|
GET_COUNT_NOTIFICATION: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_COUNT_NOTIFICATION}`,
|
|
70
72
|
SEND_NOTIFICATION: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.SEND_NOTIFICATION}`,
|
|
71
73
|
DELETE_ACCOUNT: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.DELETE_ACCOUNT}`,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare namespace AdjustUserBonusBalanceCommand {
|
|
3
|
+
const RequestParamSchema: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodUUID;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
7
|
+
const RequestSchema: z.ZodObject<{
|
|
8
|
+
amount: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
const ResponseSchema: z.ZodObject<{
|
|
12
|
+
data: z.ZodObject<{
|
|
13
|
+
tokenBonusBalance: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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.AdjustUserBonusBalanceCommand = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
var AdjustUserBonusBalanceCommand;
|
|
9
|
+
(function (AdjustUserBonusBalanceCommand) {
|
|
10
|
+
AdjustUserBonusBalanceCommand.RequestParamSchema = zod_1.default.object({
|
|
11
|
+
uuid: zod_1.default.uuid(),
|
|
12
|
+
});
|
|
13
|
+
AdjustUserBonusBalanceCommand.RequestSchema = zod_1.default.object({
|
|
14
|
+
amount: zod_1.default
|
|
15
|
+
.number()
|
|
16
|
+
.finite()
|
|
17
|
+
.multipleOf(0.01)
|
|
18
|
+
.refine((v) => v !== 0),
|
|
19
|
+
});
|
|
20
|
+
AdjustUserBonusBalanceCommand.ResponseSchema = zod_1.default.object({
|
|
21
|
+
data: zod_1.default.object({
|
|
22
|
+
tokenBonusBalance: zod_1.default.number(),
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
})(AdjustUserBonusBalanceCommand || (exports.AdjustUserBonusBalanceCommand = AdjustUserBonusBalanceCommand = {}));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare namespace GrantUserProductCommand {
|
|
3
|
+
const RequestParamSchema: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodUUID;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
7
|
+
const RequestSchema: z.ZodObject<{
|
|
8
|
+
productId: z.ZodUUID;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
const ResponseSchema: z.ZodObject<{
|
|
12
|
+
data: z.ZodObject<{
|
|
13
|
+
uuid: z.ZodUUID;
|
|
14
|
+
userId: z.ZodUUID;
|
|
15
|
+
productId: z.ZodUUID;
|
|
16
|
+
initTokenBalance: z.ZodNumber;
|
|
17
|
+
tokenBalance: z.ZodNumber;
|
|
18
|
+
status: z.ZodEnum<typeof import("../..").PRODUCT_STATUS>;
|
|
19
|
+
createdAt: z.ZodDate;
|
|
20
|
+
updatedAt: z.ZodDate;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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.GrantUserProductCommand = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const models_1 = require("../../models");
|
|
9
|
+
var GrantUserProductCommand;
|
|
10
|
+
(function (GrantUserProductCommand) {
|
|
11
|
+
GrantUserProductCommand.RequestParamSchema = zod_1.default.object({
|
|
12
|
+
uuid: zod_1.default.uuid(),
|
|
13
|
+
});
|
|
14
|
+
GrantUserProductCommand.RequestSchema = zod_1.default.object({
|
|
15
|
+
productId: zod_1.default.uuid(),
|
|
16
|
+
});
|
|
17
|
+
GrantUserProductCommand.ResponseSchema = zod_1.default.object({
|
|
18
|
+
data: models_1.UserToProductSchema,
|
|
19
|
+
});
|
|
20
|
+
})(GrantUserProductCommand || (exports.GrantUserProductCommand = GrantUserProductCommand = {}));
|
|
@@ -17,3 +17,5 @@ export * from './get-aggregated-user-data.command';
|
|
|
17
17
|
export * from './get-user-payments.command';
|
|
18
18
|
export * from './cancel-user-subscription.command';
|
|
19
19
|
export * from './cancel-user-product.command';
|
|
20
|
+
export * from './adjust-user-bonus-balance.command';
|
|
21
|
+
export * from './grant-user-product.command';
|
|
@@ -33,3 +33,5 @@ __exportStar(require("./get-aggregated-user-data.command"), exports);
|
|
|
33
33
|
__exportStar(require("./get-user-payments.command"), exports);
|
|
34
34
|
__exportStar(require("./cancel-user-subscription.command"), exports);
|
|
35
35
|
__exportStar(require("./cancel-user-product.command"), exports);
|
|
36
|
+
__exportStar(require("./adjust-user-bonus-balance.command"), exports);
|
|
37
|
+
__exportStar(require("./grant-user-product.command"), exports);
|