@purpleschool/gptbot 0.7.68 → 0.7.70

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.
@@ -9,7 +9,6 @@ var CreateWriterDocumentCommand;
9
9
  prompt: zod_1.z.string(),
10
10
  numPages: zod_1.z.number(),
11
11
  documentTypeId: zod_1.z.string(),
12
- modelId: zod_1.z.string(),
13
12
  });
14
13
  CreateWriterDocumentCommand.ResponseSchema = zod_1.z.object({
15
14
  data: models_1.WriterDocumentSchema,
@@ -8,6 +8,9 @@ var GenerateWriterDocumentContentsCommand;
8
8
  GenerateWriterDocumentContentsCommand.RequestParamsSchema = zod_1.z.object({
9
9
  uuid: zod_1.z.string().uuid(),
10
10
  });
11
+ GenerateWriterDocumentContentsCommand.RequestBodySchema = zod_1.z.object({
12
+ modelId: zod_1.z.string().uuid(),
13
+ });
11
14
  GenerateWriterDocumentContentsCommand.ResponseSchema = zod_1.z.object({
12
15
  data: models_1.WriterDocumentSchema,
13
16
  });
@@ -2176,4 +2176,19 @@ exports.ERRORS = {
2176
2176
  message: 'Произошла ошибка при установке реакции на документ',
2177
2177
  httpCode: 500,
2178
2178
  },
2179
+ WRITER_MODEL_NOT_FOUND: {
2180
+ code: 'A446',
2181
+ message: 'Не удалось найти указанную модель для Writer',
2182
+ httpCode: 400,
2183
+ },
2184
+ WRITER_MODEL_INACTIVE: {
2185
+ code: 'A447',
2186
+ message: 'Модель Writer архивирована и недоступна для пользования',
2187
+ httpCode: 403,
2188
+ },
2189
+ WRITER_MODEL_ACCESS_DENIED: {
2190
+ code: 'A448',
2191
+ message: 'У вас нет доступа к этой модели Writer',
2192
+ httpCode: 403,
2193
+ },
2179
2194
  };
@@ -15,7 +15,7 @@ exports.WriterDocumentSchema = zod_1.z.object({
15
15
  finalMd: zod_1.z.string().nullable(),
16
16
  userId: zod_1.z.string().nullable(),
17
17
  unregisteredUserId: zod_1.z.string().nullable(),
18
- modelId: zod_1.z.string(),
18
+ modelId: zod_1.z.string().nullable(),
19
19
  reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
20
20
  pages: zod_1.z.number(),
21
21
  createdAt: zod_1.z.date(),
@@ -4,6 +4,7 @@ exports.WriterModelSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const icon_variants_schema_1 = require("../../icon-variants.schema");
6
6
  const constants_1 = require("../../../constants");
7
+ const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
7
8
  exports.WriterModelSchema = zod_1.z.object({
8
9
  uuid: zod_1.z.string(),
9
10
  title: zod_1.z.string(),
@@ -15,4 +16,6 @@ exports.WriterModelSchema = zod_1.z.object({
15
16
  status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
16
17
  createdAt: zod_1.z.date(),
17
18
  updatedAt: zod_1.z.date(),
19
+ unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
20
+ canUse: zod_1.z.boolean(),
18
21
  });
@@ -6,7 +6,6 @@ export namespace CreateWriterDocumentCommand {
6
6
  prompt: z.string(),
7
7
  numPages: z.number(),
8
8
  documentTypeId: z.string(),
9
- modelId: z.string(),
10
9
  });
11
10
  export type Request = z.infer<typeof RequestSchema>;
12
11
 
@@ -7,6 +7,11 @@ export namespace GenerateWriterDocumentContentsCommand {
7
7
  });
8
8
  export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
9
 
10
+ export const RequestBodySchema = z.object({
11
+ modelId: z.string().uuid(),
12
+ });
13
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
14
+
10
15
  export const ResponseSchema = z.object({
11
16
  data: WriterDocumentSchema,
12
17
  });
@@ -2184,4 +2184,19 @@ export const ERRORS = {
2184
2184
  message: 'Произошла ошибка при установке реакции на документ',
2185
2185
  httpCode: 500,
2186
2186
  },
2187
+ WRITER_MODEL_NOT_FOUND: {
2188
+ code: 'A446',
2189
+ message: 'Не удалось найти указанную модель для Writer',
2190
+ httpCode: 400,
2191
+ },
2192
+ WRITER_MODEL_INACTIVE: {
2193
+ code: 'A447',
2194
+ message: 'Модель Writer архивирована и недоступна для пользования',
2195
+ httpCode: 403,
2196
+ },
2197
+ WRITER_MODEL_ACCESS_DENIED: {
2198
+ code: 'A448',
2199
+ message: 'У вас нет доступа к этой модели Writer',
2200
+ httpCode: 403,
2201
+ },
2187
2202
  };
@@ -13,7 +13,7 @@ export const WriterDocumentSchema = z.object({
13
13
  finalMd: z.string().nullable(),
14
14
  userId: z.string().nullable(),
15
15
  unregisteredUserId: z.string().nullable(),
16
- modelId: z.string(),
16
+ modelId: z.string().nullable(),
17
17
  reaction: z.nativeEnum(USER_REACTION).nullable(),
18
18
  pages: z.number(),
19
19
  createdAt: z.date(),
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { IconVariantsSchema } from '../../icon-variants.schema';
3
3
  import { TOOL_MODEL_STATUS } from '../../../constants';
4
+ import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
4
5
 
5
6
  export const WriterModelSchema = z.object({
6
7
  uuid: z.string(),
@@ -13,6 +14,8 @@ export const WriterModelSchema = z.object({
13
14
  status: z.nativeEnum(TOOL_MODEL_STATUS),
14
15
  createdAt: z.date(),
15
16
  updatedAt: z.date(),
17
+ unlockedBy: UnlockedBySchema.nullable(),
18
+ canUse: z.boolean(),
16
19
  });
17
20
 
18
21
  export type WriterModel = z.infer<typeof WriterModelSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.7.68",
3
+ "version": "0.7.70",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",