@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.
@@ -3,4 +3,5 @@ export const PRODUCT_CONTROLLER = 'product' as const;
3
3
  export const PRODUCT_ROUTES = {
4
4
  FIND_BY_UUID: 'by/uuid',
5
5
  GET_ALL: 'all',
6
+ BUY: `buy`,
6
7
  } as const;
@@ -3,4 +3,5 @@ export const SUBSCRIPTION_CONTROLLER = 'subscription' as const;
3
3
  export const SUBSCRIPTION_ROUTES = {
4
4
  FIND_BY_UUID: 'by/uuid',
5
5
  GET_ALL: 'all',
6
+ BUY: 'buy',
6
7
  } as const;
@@ -5,4 +5,5 @@ exports.PRODUCT_CONTROLLER = 'product';
5
5
  exports.PRODUCT_ROUTES = {
6
6
  FIND_BY_UUID: 'by/uuid',
7
7
  GET_ALL: 'all',
8
+ BUY: `buy`,
8
9
  };
@@ -5,4 +5,5 @@ exports.SUBSCRIPTION_CONTROLLER = 'subscription';
5
5
  exports.SUBSCRIPTION_ROUTES = {
6
6
  FIND_BY_UUID: 'by/uuid',
7
7
  GET_ALL: 'all',
8
+ BUY: 'buy',
8
9
  };
@@ -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 = {}));
@@ -390,4 +390,9 @@ 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
+ },
393
398
  };
@@ -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 RequestByFormattedSchema>;
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
+ }
@@ -2,3 +2,4 @@ export * from './update-product.command';
2
2
  export * from './delete-product.command';
3
3
  export * from './create-product.command';
4
4
  export * from './find-product.command';
5
+ export * from './buy-product.command';
@@ -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
+ }
@@ -389,4 +389,9 @@ 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
+ },
392
397
  };
package/models/index.ts CHANGED
@@ -9,4 +9,5 @@ export * from './ai-model.schema';
9
9
  export * from './product.schema';
10
10
  export * from './subscription.schema';
11
11
  export * from './order.schema';
12
+ export * from './payload-order.schema';
12
13
  export * from './post.schema';
@@ -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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {