@purpleschool/gptbot 0.1.8 → 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/build/api/controllers/chat-private.js +1 -0
- package/build/commands/chat/check-limit.command.js +10 -0
- package/build/commands/product/buy-product.command.js +28 -2
- package/build/commands/subscription/buy-subscription.command.js +33 -2
- package/build/constants/errors/errors.js +5 -0
- package/build/models/index.js +0 -1
- package/commands/chat/check-limit.command.ts +8 -0
- package/commands/product/buy-product.command.ts +31 -2
- package/commands/subscription/buy-subscription.command.ts +36 -2
- package/constants/errors/errors.ts +5 -0
- package/models/index.ts +0 -1
- package/package.json +1 -1
- package/build/models/payload-order.schema.js +0 -15
- package/models/payload-order.schema.ts +0 -13
|
@@ -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 = {}));
|
|
@@ -3,13 +3,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BuyProductCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
|
-
const models_2 = require("../../models");
|
|
7
6
|
var BuyProductCommand;
|
|
8
7
|
(function (BuyProductCommand) {
|
|
9
8
|
BuyProductCommand.RequestSchema = models_1.ProductSchema.pick({
|
|
10
9
|
uuid: true,
|
|
11
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
|
+
});
|
|
12
25
|
BuyProductCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
-
|
|
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
|
+
}),
|
|
14
40
|
});
|
|
15
41
|
})(BuyProductCommand || (exports.BuyProductCommand = BuyProductCommand = {}));
|
|
@@ -3,13 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BuySubscriptionCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
|
-
const models_2 = require("../../models");
|
|
7
6
|
var BuySubscriptionCommand;
|
|
8
7
|
(function (BuySubscriptionCommand) {
|
|
9
8
|
BuySubscriptionCommand.RequestSchema = models_1.SubscriptionSchema.pick({
|
|
10
9
|
uuid: true,
|
|
11
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
|
+
});
|
|
12
25
|
BuySubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
-
|
|
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
|
+
}),
|
|
14
45
|
});
|
|
15
46
|
})(BuySubscriptionCommand || (exports.BuySubscriptionCommand = BuySubscriptionCommand = {}));
|
package/build/models/index.js
CHANGED
|
@@ -25,5 +25,4 @@ __exportStar(require("./ai-model.schema"), exports);
|
|
|
25
25
|
__exportStar(require("./product.schema"), exports);
|
|
26
26
|
__exportStar(require("./subscription.schema"), exports);
|
|
27
27
|
__exportStar(require("./order.schema"), exports);
|
|
28
|
-
__exportStar(require("./payload-order.schema"), exports);
|
|
29
28
|
__exportStar(require("./post.schema"), exports);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ProductSchema } from '../../models';
|
|
3
|
-
import { PayloadOrderSchema } from '../../models';
|
|
4
3
|
|
|
5
4
|
export namespace BuyProductCommand {
|
|
6
5
|
export const RequestSchema = ProductSchema.pick({
|
|
@@ -9,8 +8,38 @@ export namespace BuyProductCommand {
|
|
|
9
8
|
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
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
|
+
|
|
12
28
|
export const ResponseSchema = z.object({
|
|
13
|
-
|
|
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
|
+
}),
|
|
14
43
|
});
|
|
15
44
|
|
|
16
45
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { SubscriptionSchema } from '../../models';
|
|
3
|
-
import { PayloadOrderSchema } from '../../models';
|
|
4
3
|
|
|
5
4
|
export namespace BuySubscriptionCommand {
|
|
6
5
|
export const RequestSchema = SubscriptionSchema.pick({
|
|
@@ -9,8 +8,43 @@ export namespace BuySubscriptionCommand {
|
|
|
9
8
|
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
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
|
+
|
|
12
28
|
export const ResponseSchema = z.object({
|
|
13
|
-
|
|
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
|
+
}),
|
|
14
48
|
});
|
|
15
49
|
|
|
16
50
|
export type Response = z.infer<typeof ResponseSchema>;
|
package/models/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayloadOrderSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.PayloadOrderSchema = zod_1.z.object({
|
|
6
|
-
publicId: zod_1.z.string(),
|
|
7
|
-
amount: zod_1.z.number(),
|
|
8
|
-
currency: zod_1.z.string(),
|
|
9
|
-
accountId: zod_1.z.string(),
|
|
10
|
-
description: zod_1.z.string(),
|
|
11
|
-
invoiceId: zod_1.z.string(),
|
|
12
|
-
email: zod_1.z.string(),
|
|
13
|
-
interval: zod_1.z.string().nullable(),
|
|
14
|
-
period: zod_1.z.number().nullable(),
|
|
15
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const PayloadOrderSchema = z.object({
|
|
4
|
-
publicId: z.string(),
|
|
5
|
-
amount: z.number(),
|
|
6
|
-
currency: z.string(),
|
|
7
|
-
accountId: z.string(),
|
|
8
|
-
description: z.string(),
|
|
9
|
-
invoiceId: z.string(),
|
|
10
|
-
email: z.string(),
|
|
11
|
-
interval: z.string().nullable(),
|
|
12
|
-
period: z.number().nullable(),
|
|
13
|
-
});
|