@purpleschool/gptbot 0.1.8 → 0.2.1

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.
@@ -5,5 +5,6 @@ export const CHAT_PRIVATE_ROUTES = {
5
5
  GET_BY_UUID: 'by/uuid',
6
6
  GET_MY: 'get/my',
7
7
  GET_LAST_ACTIVE_CHAT: `last-active-chat`,
8
+ GET_LIMIT: 'limits',
8
9
  CREATE_MESSAGE: (uuid: string) => `my/${uuid}/send`,
9
10
  } as const;
@@ -7,5 +7,6 @@ exports.CHAT_PRIVATE_ROUTES = {
7
7
  GET_BY_UUID: 'by/uuid',
8
8
  GET_MY: 'get/my',
9
9
  GET_LAST_ACTIVE_CHAT: `last-active-chat`,
10
+ GET_LIMIT: 'limits',
10
11
  CREATE_MESSAGE: (uuid) => `my/${uuid}/send`,
11
12
  };
@@ -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
- data: models_2.PayloadOrderSchema,
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
- data: models_2.PayloadOrderSchema,
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 = {}));
@@ -395,4 +395,9 @@ exports.ERRORS = {
395
395
  message: 'Ордер payload не был создан',
396
396
  httpCode: 500,
397
397
  },
398
+ MESSAGE_GET_COUNT_ERROR: {
399
+ code: 'A096',
400
+ message: 'Не удалось получить количество сообщений',
401
+ httpCode: 500,
402
+ },
398
403
  };
@@ -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);
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace CheckLimitCommand {
4
+ export const ResponseSchema = z.object({
5
+ totalTokenBalance: z.number(),
6
+ });
7
+ export type Response = z.infer<typeof ResponseSchema>;
8
+ }
@@ -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
- data: PayloadOrderSchema,
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
- data: PayloadOrderSchema,
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>;
@@ -394,4 +394,9 @@ export const ERRORS = {
394
394
  message: 'Ордер payload не был создан',
395
395
  httpCode: 500,
396
396
  },
397
+ MESSAGE_GET_COUNT_ERROR: {
398
+ code: 'A096',
399
+ message: 'Не удалось получить количество сообщений',
400
+ httpCode: 500,
401
+ },
397
402
  };
package/models/index.ts CHANGED
@@ -9,5 +9,4 @@ 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';
13
12
  export * from './post.schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.1.8",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
- });