@purpleschool/gptbot 0.6.18 → 0.6.19

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.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GetUserToProductByUuidCommand = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const models_1 = require("../../models");
9
+ var GetUserToProductByUuidCommand;
10
+ (function (GetUserToProductByUuidCommand) {
11
+ GetUserToProductByUuidCommand.RequestSchema = models_1.UserToProductSchema.pick({
12
+ uuid: true,
13
+ });
14
+ GetUserToProductByUuidCommand.ResponseSchema = zod_1.default.object({
15
+ data: models_1.UserToProductSchema,
16
+ });
17
+ })(GetUserToProductByUuidCommand || (exports.GetUserToProductByUuidCommand = GetUserToProductByUuidCommand = {}));
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./update-user-to-product.command"), exports);
18
+ __exportStar(require("./get-user-to-product-by-uuid.command"), exports);
@@ -14,6 +14,6 @@ var UpdateUserToProductCommand;
14
14
  status: true,
15
15
  }).partial();
16
16
  UpdateUserToProductCommand.ResponseSchema = zod_1.z.object({
17
- data: UpdateUserToProductCommand.RequestParamSchema,
17
+ data: models_1.UserToProductSchema,
18
18
  });
19
19
  })(UpdateUserToProductCommand || (exports.UpdateUserToProductCommand = UpdateUserToProductCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GetUserToSubscriptionByUuidCommand = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const models_1 = require("../../models");
9
+ var GetUserToSubscriptionByUuidCommand;
10
+ (function (GetUserToSubscriptionByUuidCommand) {
11
+ GetUserToSubscriptionByUuidCommand.RequestSchema = models_1.UserToSubscriptionSchema.pick({
12
+ uuid: true,
13
+ });
14
+ GetUserToSubscriptionByUuidCommand.ResponseSchema = zod_1.default.object({
15
+ data: models_1.UserToSubscriptionSchema,
16
+ });
17
+ })(GetUserToSubscriptionByUuidCommand || (exports.GetUserToSubscriptionByUuidCommand = GetUserToSubscriptionByUuidCommand = {}));
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-user-to-subscriptions.command"), exports);
18
18
  __exportStar(require("./update-user-to-subscription.command"), exports);
19
+ __exportStar(require("./get-user-to-subscription-by-uuid.command"), exports);
@@ -1498,4 +1498,9 @@ exports.ERRORS = {
1498
1498
  message: 'Подписка не требует повторной оплаты',
1499
1499
  httpCode: 400,
1500
1500
  },
1501
+ USER_TO_PRODUCT_NOT_FOUND: {
1502
+ code: 'A321',
1503
+ message: 'Не удалось найти продукт у пользователя',
1504
+ httpCode: 404,
1505
+ },
1501
1506
  };
@@ -0,0 +1,16 @@
1
+ import z from 'zod';
2
+ import { UserToProductSchema } from '../../models';
3
+
4
+ export namespace GetUserToProductByUuidCommand {
5
+ export const RequestSchema = UserToProductSchema.pick({
6
+ uuid: true,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: UserToProductSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -1 +1,2 @@
1
1
  export * from './update-user-to-product.command';
2
+ export * from './get-user-to-product-by-uuid.command';
@@ -14,8 +14,10 @@ export namespace UpdateUserToProductCommand {
14
14
  status: true,
15
15
  }).partial();
16
16
 
17
+ export type Request = z.infer<typeof RequestSchema>;
18
+
17
19
  export const ResponseSchema = z.object({
18
- data: RequestParamSchema,
20
+ data: UserToProductSchema,
19
21
  });
20
22
 
21
23
  export type Response = z.infer<typeof ResponseSchema>;
@@ -0,0 +1,16 @@
1
+ import z from 'zod';
2
+ import { UserToSubscriptionSchema } from '../../models';
3
+
4
+ export namespace GetUserToSubscriptionByUuidCommand {
5
+ export const RequestSchema = UserToSubscriptionSchema.pick({
6
+ uuid: true,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: UserToSubscriptionSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './get-user-to-subscriptions.command';
2
2
  export * from './update-user-to-subscription.command';
3
+ export * from './get-user-to-subscription-by-uuid.command';
@@ -22,6 +22,8 @@ export namespace UpdateUserToSubscriptionCommand {
22
22
  })
23
23
  .partial();
24
24
 
25
+ export type Request = z.infer<typeof RequestSchema>;
26
+
25
27
  export const ResponseSchema = z.object({
26
28
  data: UserToSubscriptionSchema,
27
29
  });
@@ -1505,4 +1505,9 @@ export const ERRORS = {
1505
1505
  message: 'Подписка не требует повторной оплаты',
1506
1506
  httpCode: 400,
1507
1507
  },
1508
+ USER_TO_PRODUCT_NOT_FOUND: {
1509
+ code: 'A321',
1510
+ message: 'Не удалось найти продукт у пользователя',
1511
+ httpCode: 404,
1512
+ },
1508
1513
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.6.18",
3
+ "version": "0.6.19",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",