@purpleschool/gptbot 0.1.7 → 0.2.0
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/chat-private.ts +1 -0
- package/api/controllers/product.ts +1 -0
- package/api/controllers/subscription.ts +1 -0
- package/build/api/controllers/chat-private.js +1 -0
- package/build/api/controllers/product.js +1 -0
- package/build/api/controllers/subscription.js +1 -0
- package/build/commands/chat/check-limit.command.js +10 -0
- package/build/commands/product/buy-product.command.js +41 -0
- package/build/commands/product/index.js +1 -0
- package/build/commands/subscription/buy-subscription.command.js +46 -0
- package/build/constants/errors/errors.js +10 -0
- package/commands/chat/check-limit.command.ts +8 -0
- package/commands/product/buy-product.command.ts +46 -0
- package/commands/product/index.ts +1 -0
- package/commands/subscription/buy-subscription.command.ts +51 -0
- package/constants/errors/errors.ts +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckLimitCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var CheckLimitCommand;
|
|
6
|
+
(function (CheckLimitCommand) {
|
|
7
|
+
CheckLimitCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
totalTokenBalance: zod_1.z.number(),
|
|
9
|
+
});
|
|
10
|
+
})(CheckLimitCommand || (exports.CheckLimitCommand = CheckLimitCommand = {}));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuyProductCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var BuyProductCommand;
|
|
7
|
+
(function (BuyProductCommand) {
|
|
8
|
+
BuyProductCommand.RequestSchema = models_1.ProductSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
const IReceiptOrderSchema = zod_1.z.object({
|
|
12
|
+
items: zod_1.z.array(zod_1.z.object({
|
|
13
|
+
label: zod_1.z.string(),
|
|
14
|
+
price: zod_1.z.number(),
|
|
15
|
+
quantity: zod_1.z.number(),
|
|
16
|
+
amount: zod_1.z.number(),
|
|
17
|
+
vat: zod_1.z.number(),
|
|
18
|
+
})),
|
|
19
|
+
email: zod_1.z.string(),
|
|
20
|
+
isBso: zod_1.z.boolean(),
|
|
21
|
+
amounts: zod_1.z.object({
|
|
22
|
+
electronic: zod_1.z.number(),
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
BuyProductCommand.ResponseSchema = zod_1.z.object({
|
|
26
|
+
publicId: zod_1.z.string(),
|
|
27
|
+
amount: zod_1.z.number(),
|
|
28
|
+
currency: zod_1.z.string(),
|
|
29
|
+
accountId: zod_1.z.string(),
|
|
30
|
+
description: zod_1.z.string(),
|
|
31
|
+
invoiceId: zod_1.z.string(),
|
|
32
|
+
email: zod_1.z.string(),
|
|
33
|
+
skin: zod_1.z.string(),
|
|
34
|
+
autoClose: zod_1.z.number(),
|
|
35
|
+
data: zod_1.z.object({
|
|
36
|
+
CloudPayments: zod_1.z.object({
|
|
37
|
+
CustomerReceipt: IReceiptOrderSchema,
|
|
38
|
+
}),
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
})(BuyProductCommand || (exports.BuyProductCommand = BuyProductCommand = {}));
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./update-product.command"), exports);
|
|
|
18
18
|
__exportStar(require("./delete-product.command"), exports);
|
|
19
19
|
__exportStar(require("./create-product.command"), exports);
|
|
20
20
|
__exportStar(require("./find-product.command"), exports);
|
|
21
|
+
__exportStar(require("./buy-product.command"), exports);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuySubscriptionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var BuySubscriptionCommand;
|
|
7
|
+
(function (BuySubscriptionCommand) {
|
|
8
|
+
BuySubscriptionCommand.RequestSchema = models_1.SubscriptionSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
const IReceiptOrderSchema = zod_1.z.object({
|
|
12
|
+
items: zod_1.z.array(zod_1.z.object({
|
|
13
|
+
label: zod_1.z.string(),
|
|
14
|
+
price: zod_1.z.number(),
|
|
15
|
+
quantity: zod_1.z.number(),
|
|
16
|
+
amount: zod_1.z.number(),
|
|
17
|
+
vat: zod_1.z.number(),
|
|
18
|
+
})),
|
|
19
|
+
email: zod_1.z.string(),
|
|
20
|
+
isBso: zod_1.z.boolean(),
|
|
21
|
+
amounts: zod_1.z.object({
|
|
22
|
+
electronic: zod_1.z.number(),
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
BuySubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
26
|
+
publicId: zod_1.z.string(),
|
|
27
|
+
amount: zod_1.z.number(),
|
|
28
|
+
currency: zod_1.z.string(),
|
|
29
|
+
accountId: zod_1.z.string(),
|
|
30
|
+
description: zod_1.z.string(),
|
|
31
|
+
invoiceId: zod_1.z.string(),
|
|
32
|
+
email: zod_1.z.string(),
|
|
33
|
+
skin: zod_1.z.string(),
|
|
34
|
+
autoClose: zod_1.z.number(),
|
|
35
|
+
data: zod_1.z.object({
|
|
36
|
+
CloudPayments: zod_1.z.object({
|
|
37
|
+
CustomerReceipt: IReceiptOrderSchema,
|
|
38
|
+
recurrent: zod_1.z.object({
|
|
39
|
+
period: zod_1.z.number(),
|
|
40
|
+
interval: zod_1.z.string(),
|
|
41
|
+
customerReceipt: IReceiptOrderSchema,
|
|
42
|
+
}),
|
|
43
|
+
}),
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
})(BuySubscriptionCommand || (exports.BuySubscriptionCommand = BuySubscriptionCommand = {}));
|
|
@@ -390,4 +390,14 @@ exports.ERRORS = {
|
|
|
390
390
|
message: 'Пользователь не был обновлен',
|
|
391
391
|
httpCode: 500,
|
|
392
392
|
},
|
|
393
|
+
ORDER_PAYLOAD_CREATE_ERROR: {
|
|
394
|
+
code: 'A095',
|
|
395
|
+
message: 'Ордер payload не был создан',
|
|
396
|
+
httpCode: 500,
|
|
397
|
+
},
|
|
398
|
+
MESSAGE_GET_COUNT_ERROR: {
|
|
399
|
+
code: 'A096',
|
|
400
|
+
message: 'Не удалось получить количество сообщений',
|
|
401
|
+
httpCode: 500,
|
|
402
|
+
},
|
|
393
403
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ProductSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace BuyProductCommand {
|
|
5
|
+
export const RequestSchema = ProductSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
const IReceiptOrderSchema = z.object({
|
|
12
|
+
items: z.array(
|
|
13
|
+
z.object({
|
|
14
|
+
label: z.string(),
|
|
15
|
+
price: z.number(),
|
|
16
|
+
quantity: z.number(),
|
|
17
|
+
amount: z.number(),
|
|
18
|
+
vat: z.number(),
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
email: z.string(),
|
|
22
|
+
isBso: z.boolean(),
|
|
23
|
+
amounts: z.object({
|
|
24
|
+
electronic: z.number(),
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const ResponseSchema = z.object({
|
|
29
|
+
publicId: z.string(),
|
|
30
|
+
amount: z.number(),
|
|
31
|
+
currency: z.string(),
|
|
32
|
+
accountId: z.string(),
|
|
33
|
+
description: z.string(),
|
|
34
|
+
invoiceId: z.string(),
|
|
35
|
+
email: z.string(),
|
|
36
|
+
skin: z.string(),
|
|
37
|
+
autoClose: z.number(),
|
|
38
|
+
data: z.object({
|
|
39
|
+
CloudPayments: z.object({
|
|
40
|
+
CustomerReceipt: IReceiptOrderSchema,
|
|
41
|
+
}),
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SubscriptionSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace BuySubscriptionCommand {
|
|
5
|
+
export const RequestSchema = SubscriptionSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
const IReceiptOrderSchema = z.object({
|
|
12
|
+
items: z.array(
|
|
13
|
+
z.object({
|
|
14
|
+
label: z.string(),
|
|
15
|
+
price: z.number(),
|
|
16
|
+
quantity: z.number(),
|
|
17
|
+
amount: z.number(),
|
|
18
|
+
vat: z.number(),
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
email: z.string(),
|
|
22
|
+
isBso: z.boolean(),
|
|
23
|
+
amounts: z.object({
|
|
24
|
+
electronic: z.number(),
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const ResponseSchema = z.object({
|
|
29
|
+
publicId: z.string(),
|
|
30
|
+
amount: z.number(),
|
|
31
|
+
currency: z.string(),
|
|
32
|
+
accountId: z.string(),
|
|
33
|
+
description: z.string(),
|
|
34
|
+
invoiceId: z.string(),
|
|
35
|
+
email: z.string(),
|
|
36
|
+
skin: z.string(),
|
|
37
|
+
autoClose: z.number(),
|
|
38
|
+
data: z.object({
|
|
39
|
+
CloudPayments: z.object({
|
|
40
|
+
CustomerReceipt: IReceiptOrderSchema,
|
|
41
|
+
recurrent: z.object({
|
|
42
|
+
period: z.number(),
|
|
43
|
+
interval: z.string(),
|
|
44
|
+
customerReceipt: IReceiptOrderSchema,
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
51
|
+
}
|
|
@@ -389,4 +389,14 @@ export const ERRORS = {
|
|
|
389
389
|
message: 'Пользователь не был обновлен',
|
|
390
390
|
httpCode: 500,
|
|
391
391
|
},
|
|
392
|
+
ORDER_PAYLOAD_CREATE_ERROR: {
|
|
393
|
+
code: 'A095',
|
|
394
|
+
message: 'Ордер payload не был создан',
|
|
395
|
+
httpCode: 500,
|
|
396
|
+
},
|
|
397
|
+
MESSAGE_GET_COUNT_ERROR: {
|
|
398
|
+
code: 'A096',
|
|
399
|
+
message: 'Не удалось получить количество сообщений',
|
|
400
|
+
httpCode: 500,
|
|
401
|
+
},
|
|
392
402
|
};
|