@purpleschool/gptbot 0.1.6 → 0.1.8
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/product.ts +1 -0
- package/api/controllers/subscription.ts +1 -0
- package/build/api/controllers/product.js +1 -0
- package/build/api/controllers/subscription.js +1 -0
- package/build/commands/product/buy-product.command.js +15 -0
- package/build/commands/product/index.js +1 -0
- package/build/commands/subscription/buy-subscription.command.js +15 -0
- package/build/constants/errors/errors.js +5 -0
- package/build/models/index.js +1 -0
- package/build/models/payload-order.schema.js +15 -0
- package/commands/category/find-category.command.ts +1 -1
- package/commands/product/buy-product.command.ts +17 -0
- package/commands/product/index.ts +1 -0
- package/commands/subscription/buy-subscription.command.ts +17 -0
- package/constants/errors/errors.ts +5 -0
- package/models/index.ts +1 -0
- package/models/payload-order.schema.ts +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
const models_2 = require("../../models");
|
|
7
|
+
var BuyProductCommand;
|
|
8
|
+
(function (BuyProductCommand) {
|
|
9
|
+
BuyProductCommand.RequestSchema = models_1.ProductSchema.pick({
|
|
10
|
+
uuid: true,
|
|
11
|
+
});
|
|
12
|
+
BuyProductCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: models_2.PayloadOrderSchema,
|
|
14
|
+
});
|
|
15
|
+
})(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,15 @@
|
|
|
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
|
+
const models_2 = require("../../models");
|
|
7
|
+
var BuySubscriptionCommand;
|
|
8
|
+
(function (BuySubscriptionCommand) {
|
|
9
|
+
BuySubscriptionCommand.RequestSchema = models_1.SubscriptionSchema.pick({
|
|
10
|
+
uuid: true,
|
|
11
|
+
});
|
|
12
|
+
BuySubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: models_2.PayloadOrderSchema,
|
|
14
|
+
});
|
|
15
|
+
})(BuySubscriptionCommand || (exports.BuySubscriptionCommand = BuySubscriptionCommand = {}));
|
package/build/models/index.js
CHANGED
|
@@ -25,4 +25,5 @@ __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);
|
|
28
29
|
__exportStar(require("./post.schema"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
});
|
|
@@ -37,7 +37,7 @@ export namespace FindCategoryCommand {
|
|
|
37
37
|
),
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
export type ResponseByFormatted = z.infer<typeof
|
|
40
|
+
export type ResponseByFormatted = z.infer<typeof ResponseByFormattedSchema>;
|
|
41
41
|
|
|
42
42
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
43
43
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ProductSchema } from '../../models';
|
|
3
|
+
import { PayloadOrderSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace BuyProductCommand {
|
|
6
|
+
export const RequestSchema = ProductSchema.pick({
|
|
7
|
+
uuid: true,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: PayloadOrderSchema,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SubscriptionSchema } from '../../models';
|
|
3
|
+
import { PayloadOrderSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace BuySubscriptionCommand {
|
|
6
|
+
export const RequestSchema = SubscriptionSchema.pick({
|
|
7
|
+
uuid: true,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: PayloadOrderSchema,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
package/models/index.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
});
|