@purpleschool/gptbot 0.3.6 → 0.3.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,6 +3,7 @@ export const BLOG_CONTROLLER = 'blog' as const;
3
3
  export const BLOG_ROUTES = {
4
4
  CREATE: 'create',
5
5
  FIND: 'find',
6
+ FIND_ALL: 'find/all',
6
7
  FIND_BY_UUID: 'by/uuid',
7
8
  FIND_BY_ALIAS: 'by/alias',
8
9
  } as const;
@@ -1 +1 @@
1
- export const UNREGISTERED_USER_CONTROLLER = 'unregistered-user' as const;
1
+ export const UNREGISTERED_USER_CONTROLLER = 'unregistered-user' as const;
package/api/routes.ts CHANGED
@@ -127,5 +127,6 @@ export const REST_API = {
127
127
  GET_BY_ALIAS: (alias: string) =>
128
128
  `${ROOT}/${CONTROLLERS.BLOG_CONTROLLER}/${CONTROLLERS.BLOG_ROUTES.FIND_BY_ALIAS}/${alias}`,
129
129
  GET: `${ROOT}/${CONTROLLERS.BLOG_CONTROLLER}/${CONTROLLERS.BLOG_ROUTES.FIND}`,
130
+ GET_ALL: `${ROOT}/${CONTROLLERS.BLOG_CONTROLLER}/${CONTROLLERS.BLOG_ROUTES.FIND_ALL}`,
130
131
  },
131
132
  } as const;
@@ -5,6 +5,7 @@ exports.BLOG_CONTROLLER = 'blog';
5
5
  exports.BLOG_ROUTES = {
6
6
  CREATE: 'create',
7
7
  FIND: 'find',
8
+ FIND_ALL: 'find/all',
8
9
  FIND_BY_UUID: 'by/uuid',
9
10
  FIND_BY_ALIAS: 'by/alias',
10
11
  };
@@ -130,5 +130,6 @@ exports.REST_API = {
130
130
  GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.BLOG_CONTROLLER}/${CONTROLLERS.BLOG_ROUTES.FIND_BY_UUID}/${uuid}`,
131
131
  GET_BY_ALIAS: (alias) => `${exports.ROOT}/${CONTROLLERS.BLOG_CONTROLLER}/${CONTROLLERS.BLOG_ROUTES.FIND_BY_ALIAS}/${alias}`,
132
132
  GET: `${exports.ROOT}/${CONTROLLERS.BLOG_CONTROLLER}/${CONTROLLERS.BLOG_ROUTES.FIND}`,
133
+ GET_ALL: `${exports.ROOT}/${CONTROLLERS.BLOG_CONTROLLER}/${CONTROLLERS.BLOG_ROUTES.FIND_ALL}`,
133
134
  },
134
135
  };
@@ -12,8 +12,12 @@ const FindPostResponseSchema = zod_1.z.object({
12
12
  totalPage: zod_1.z.number(),
13
13
  page: zod_1.z.number(),
14
14
  });
15
+ const FindAllPostResponseSchema = zod_1.z.object({
16
+ data: zod_1.z.array(models_1.PostSchema),
17
+ });
15
18
  var FindPostCommand;
16
19
  (function (FindPostCommand) {
17
20
  FindPostCommand.RequestSchema = FindPostRequestSchema;
18
21
  FindPostCommand.ResponseSchema = FindPostResponseSchema;
22
+ FindPostCommand.ResponseAllSchema = FindAllPostResponseSchema;
19
23
  })(FindPostCommand || (exports.FindPostCommand = FindPostCommand = {}));
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailEndpoint = void 0;
4
+ exports.EmailEndpoint = 'https://api.beta.rusender.ru/api/v1/external-mails/send';
@@ -11,4 +11,6 @@ export namespace FindPostByUUIDCommand {
11
11
  export const ResponseByUUIDSchema = z.object({
12
12
  data: PostSchema,
13
13
  });
14
+
15
+ export type Response = z.infer<typeof ResponseByUUIDSchema>;
14
16
  }
@@ -12,10 +12,17 @@ const FindPostResponseSchema = z.object({
12
12
  page: z.number(),
13
13
  });
14
14
 
15
+ const FindAllPostResponseSchema = z.object({
16
+ data: z.array(PostSchema),
17
+ });
18
+
15
19
  export namespace FindPostCommand {
16
20
  export const RequestSchema = FindPostRequestSchema;
17
21
  export type Request = z.infer<typeof RequestSchema>;
18
22
 
19
23
  export const ResponseSchema = FindPostResponseSchema;
20
24
  export type Response = z.infer<typeof ResponseSchema>;
25
+
26
+ export const ResponseAllSchema = FindAllPostResponseSchema;
27
+ export type ResponseAll = z.infer<typeof ResponseAllSchema>;
21
28
  }
@@ -8,10 +8,9 @@ export namespace CreateChatCommand {
8
8
 
9
9
  export type RequestByParam = z.infer<typeof RequestSchemaByParam>;
10
10
 
11
-
12
11
  export const RequestSchema = z.object({
13
12
  aiModelUUID: z.string(),
14
- })
13
+ });
15
14
  export const ResponseSchema = z.object({
16
15
  data: ChatSchema.extend({
17
16
  messages: z.array(MessageSchema),
@@ -8,7 +8,7 @@ export namespace BuySubscriptionCommand {
8
8
 
9
9
  export const RequestSchema = z.object({
10
10
  useDiscount: z.boolean(),
11
- })
11
+ });
12
12
 
13
13
  export type Request = z.infer<typeof RequestSchema>;
14
14
  export const RequestFastSchema = z.object({
@@ -67,5 +67,4 @@ export namespace BuySubscriptionCommand {
67
67
  });
68
68
 
69
69
  export type ResponseFast = z.infer<typeof ResponseFastSchema>;
70
-
71
70
  }
@@ -3,5 +3,5 @@ import { z } from 'zod';
3
3
  export namespace CheckEmailCommand {
4
4
  export const RequestSchema = z.object({
5
5
  email: z.string().email(),
6
- })
7
- }
6
+ });
7
+ }
@@ -0,0 +1 @@
1
+ export const EmailEndpoint = 'https://api.beta.rusender.ru/api/v1/external-mails/send';
@@ -229,9 +229,9 @@ export const ERRORS = {
229
229
  httpCode: 404,
230
230
  },
231
231
  SUBSCRIPTION_BUY_ERROR: {
232
- code: 'A097',
233
- message: 'Подписка не была куплена',
234
- httpCode: 500,
232
+ code: 'A097',
233
+ message: 'Подписка не была куплена',
234
+ httpCode: 500,
235
235
  },
236
236
  SUBSCRIPTION_UPDATE_ERROR: {
237
237
  code: 'A055',
@@ -1 +1 @@
1
- export const USER_PUBLIC = 'public'
1
+ export const USER_PUBLIC = 'public';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {