@purpleschool/gptbot 0.15.74 → 0.15.75-paraphrase-special

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.
Files changed (37) hide show
  1. package/build/api/controllers/http/paraphrase.d.ts +1 -0
  2. package/build/api/controllers/http/paraphrase.js +1 -0
  3. package/build/api/routes.d.ts +2 -0
  4. package/build/api/routes.js +2 -0
  5. package/build/commands/tools/paraphrase/find-paraphrase-job-by-uuid.command.d.ts +20 -0
  6. package/build/commands/tools/paraphrase/find-paraphrase-jobs.command.d.ts +20 -0
  7. package/build/commands/tools/paraphrase/get-paraphrase-price.command.d.ts +31 -0
  8. package/build/commands/tools/paraphrase/get-paraphrase-price.command.js +30 -0
  9. package/build/commands/tools/paraphrase/get-paraphrase-tool-config.command.d.ts +3 -0
  10. package/build/commands/tools/paraphrase/index.d.ts +1 -0
  11. package/build/commands/tools/paraphrase/index.js +1 -0
  12. package/build/commands/tools/paraphrase/paraphrase.command.d.ts +36 -1
  13. package/build/commands/tools/paraphrase/paraphrase.command.js +16 -3
  14. package/build/commands/tools/paraphrase/retry-paraphrase-job.command.d.ts +20 -0
  15. package/build/commands/tools/paraphrase/set-reaction-to-paraphrase-job.command.d.ts +20 -0
  16. package/build/commands/tools/paraphrase/update-paraphrase-job-favorite.command.d.ts +20 -0
  17. package/build/commands/tools/paraphrase/update-paraphrase-job-title.command.d.ts +20 -0
  18. package/build/commands/user-profile/update-profile.command.js +9 -1
  19. package/build/constants/tool-paraphrase/enums/index.d.ts +1 -0
  20. package/build/constants/tool-paraphrase/enums/index.js +1 -0
  21. package/build/constants/tool-paraphrase/enums/paraphrase-input-kind.enum.d.ts +4 -0
  22. package/build/constants/tool-paraphrase/enums/paraphrase-input-kind.enum.js +8 -0
  23. package/build/helpers/contains-link.helper.d.ts +1 -0
  24. package/build/helpers/contains-link.helper.js +6 -0
  25. package/build/helpers/index.d.ts +1 -0
  26. package/build/helpers/index.js +1 -0
  27. package/build/models/tools/paraphrase/index.d.ts +1 -0
  28. package/build/models/tools/paraphrase/index.js +1 -0
  29. package/build/models/tools/paraphrase/paraphrase-config.schema.d.ts +3 -0
  30. package/build/models/tools/paraphrase/paraphrase-config.schema.js +1 -0
  31. package/build/models/tools/paraphrase/paraphrase-document.schema.d.ts +10 -0
  32. package/build/models/tools/paraphrase/paraphrase-document.schema.js +13 -0
  33. package/build/models/tools/paraphrase/paraphrase-job.schema.d.ts +21 -1
  34. package/build/models/tools/paraphrase/paraphrase-job.schema.js +5 -0
  35. package/build/models/tools/paraphrase/paraphrase-model.schema.d.ts +2 -0
  36. package/build/models/tools/paraphrase/paraphrase-model.schema.js +2 -0
  37. package/package.json +1 -1
@@ -2,6 +2,7 @@ export declare const PARAPHRASE_CONTROLLER_PRIVATE: 'private/tools/paraphrase';
2
2
  export declare const PARAPHRASE_CONTROLLER_PUBLIC: 'public/tools/paraphrase';
3
3
  export declare const PARAPHRASE_ROUTES: {
4
4
  readonly CONFIG: 'config';
5
+ readonly PRICE: 'price';
5
6
  readonly EXECUTE: 'execute';
6
7
  readonly GET_JOBS: 'jobs';
7
8
  readonly GET_JOB: (uuid: string) => string;
@@ -5,6 +5,7 @@ exports.PARAPHRASE_CONTROLLER_PRIVATE = 'private/tools/paraphrase';
5
5
  exports.PARAPHRASE_CONTROLLER_PUBLIC = 'public/tools/paraphrase';
6
6
  exports.PARAPHRASE_ROUTES = {
7
7
  CONFIG: 'config',
8
+ PRICE: 'price',
8
9
  EXECUTE: 'execute',
9
10
  GET_JOBS: 'jobs',
10
11
  GET_JOB: (uuid) => `jobs/${uuid}`,
@@ -687,6 +687,7 @@ export declare const REST_API: {
687
687
  };
688
688
  readonly PARAPHRASE_PUBLIC: {
689
689
  readonly CONFIG: "/api/public/tools/paraphrase/config";
690
+ readonly PRICE: "/api/public/tools/paraphrase/price";
690
691
  readonly EXECUTE: "/api/public/tools/paraphrase/execute";
691
692
  readonly GET_JOBS: "/api/public/tools/paraphrase/jobs";
692
693
  readonly GET_JOB: (uuid: string) => string;
@@ -699,6 +700,7 @@ export declare const REST_API: {
699
700
  };
700
701
  readonly PARAPHRASE_PRIVATE: {
701
702
  readonly CONFIG: "/api/private/tools/paraphrase/config";
703
+ readonly PRICE: "/api/private/tools/paraphrase/price";
702
704
  readonly EXECUTE: "/api/private/tools/paraphrase/execute";
703
705
  readonly GET_JOBS: "/api/private/tools/paraphrase/jobs";
704
706
  readonly GET_JOB: (uuid: string) => string;
@@ -725,6 +725,7 @@ exports.REST_API = {
725
725
  },
726
726
  PARAPHRASE_PUBLIC: {
727
727
  CONFIG: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.CONFIG}`,
728
+ PRICE: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.PRICE}`,
728
729
  EXECUTE: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.EXECUTE}`,
729
730
  GET_JOBS: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOBS}`,
730
731
  GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOB(uuid)}`,
@@ -737,6 +738,7 @@ exports.REST_API = {
737
738
  },
738
739
  PARAPHRASE_PRIVATE: {
739
740
  CONFIG: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.CONFIG}`,
741
+ PRICE: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.PRICE}`,
740
742
  EXECUTE: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.EXECUTE}`,
741
743
  GET_JOBS: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOBS}`,
742
744
  GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOB(uuid)}`,
@@ -20,6 +20,26 @@ export declare namespace FindParaphraseJobByUUIDCommand {
20
20
  intensity: z.ZodEnum<typeof import("../../..").PARAPHRASING_INTENSITY>;
21
21
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
22
22
  aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof import("../../..").PARAPHRASE_INPUT_KIND>>>;
24
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
25
+ uuid: z.ZodString;
26
+ url: z.ZodString;
27
+ name: z.ZodString;
28
+ mimeType: z.ZodString;
29
+ type: z.ZodString;
30
+ size: z.ZodNumber;
31
+ extension: z.ZodString;
32
+ }, z.core.$strip>>>;
33
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
34
+ uuid: z.ZodString;
35
+ url: z.ZodString;
36
+ name: z.ZodString;
37
+ mimeType: z.ZodString;
38
+ type: z.ZodString;
39
+ size: z.ZodNumber;
40
+ extension: z.ZodString;
41
+ }, z.core.$strip>>>;
42
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
23
43
  }, z.core.$strip>;
24
44
  }, z.core.$strip>;
25
45
  type Response = z.infer<typeof ResponseSchema>;
@@ -26,6 +26,26 @@ export declare namespace FindParaphraseJobsCommand {
26
26
  intensity: z.ZodEnum<typeof import("../../..").PARAPHRASING_INTENSITY>;
27
27
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
28
28
  aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof import("../../..").PARAPHRASE_INPUT_KIND>>>;
30
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
31
+ uuid: z.ZodString;
32
+ url: z.ZodString;
33
+ name: z.ZodString;
34
+ mimeType: z.ZodString;
35
+ type: z.ZodString;
36
+ size: z.ZodNumber;
37
+ extension: z.ZodString;
38
+ }, z.core.$strip>>>;
39
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
40
+ uuid: z.ZodString;
41
+ url: z.ZodString;
42
+ name: z.ZodString;
43
+ mimeType: z.ZodString;
44
+ type: z.ZodString;
45
+ size: z.ZodNumber;
46
+ extension: z.ZodString;
47
+ }, z.core.$strip>>>;
48
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
29
49
  }, z.core.$strip>>;
30
50
  totalPages: z.ZodNumber;
31
51
  total: z.ZodNumber;
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { PARAPHRASING_INTENSITY } from '../../../constants';
3
+ export declare namespace GetParaphrasePriceCommand {
4
+ const PrivateRequestSchema: z.ZodObject<{
5
+ typeId: z.ZodString;
6
+ styleId: z.ZodString;
7
+ intensity: z.ZodEnum<typeof PARAPHRASING_INTENSITY>;
8
+ prompt: z.ZodOptional<z.ZodString>;
9
+ fileId: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ const PublicRequestSchema: z.ZodObject<{
12
+ typeId: z.ZodString;
13
+ styleId: z.ZodString;
14
+ intensity: z.ZodEnum<typeof PARAPHRASING_INTENSITY>;
15
+ prompt: z.ZodString;
16
+ }, z.core.$strict>;
17
+ const RequestSchema: z.ZodObject<{
18
+ typeId: z.ZodString;
19
+ styleId: z.ZodString;
20
+ intensity: z.ZodEnum<typeof PARAPHRASING_INTENSITY>;
21
+ prompt: z.ZodOptional<z.ZodString>;
22
+ fileId: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ type Request = z.infer<typeof RequestSchema>;
25
+ const ResponseSchema: z.ZodObject<{
26
+ price: z.ZodNumber;
27
+ charsUntilNextPriceIncrease: z.ZodNullable<z.ZodNumber>;
28
+ charsUntilNextPriceDecrease: z.ZodNullable<z.ZodNumber>;
29
+ }, z.core.$strip>;
30
+ type Response = z.infer<typeof ResponseSchema>;
31
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetParaphrasePriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ const chat_1 = require("../../chat");
7
+ var GetParaphrasePriceCommand;
8
+ (function (GetParaphrasePriceCommand) {
9
+ GetParaphrasePriceCommand.PrivateRequestSchema = zod_1.z
10
+ .object({
11
+ typeId: zod_1.z.string().uuid(),
12
+ styleId: zod_1.z.string().uuid(),
13
+ intensity: zod_1.z.nativeEnum(constants_1.PARAPHRASING_INTENSITY),
14
+ prompt: zod_1.z.string().min(1).max(100000).optional(),
15
+ fileId: zod_1.z.string().uuid().optional(),
16
+ })
17
+ .refine((request) => (request.prompt !== undefined) !== (request.fileId !== undefined), {
18
+ message: 'Требуется ровно один из prompt или fileId',
19
+ });
20
+ GetParaphrasePriceCommand.PublicRequestSchema = zod_1.z
21
+ .object({
22
+ typeId: zod_1.z.string().uuid(),
23
+ styleId: zod_1.z.string().uuid(),
24
+ intensity: zod_1.z.nativeEnum(constants_1.PARAPHRASING_INTENSITY),
25
+ prompt: zod_1.z.string().min(1).max(100000),
26
+ })
27
+ .strict();
28
+ GetParaphrasePriceCommand.RequestSchema = GetParaphrasePriceCommand.PrivateRequestSchema;
29
+ GetParaphrasePriceCommand.ResponseSchema = chat_1.CalculateChatPriceCommand.ResponseSchema;
30
+ })(GetParaphrasePriceCommand || (exports.GetParaphrasePriceCommand = GetParaphrasePriceCommand = {}));
@@ -3,6 +3,7 @@ export declare namespace GetParaphraseToolConfigCommand {
3
3
  const ResponseSchema: z.ZodObject<{
4
4
  data: z.ZodObject<{
5
5
  maxSymbols: z.ZodNumber;
6
+ freeMaxSymbols: z.ZodNumber;
6
7
  styles: z.ZodArray<z.ZodObject<{
7
8
  uuid: z.ZodString;
8
9
  title: z.ZodString;
@@ -19,6 +20,8 @@ export declare namespace GetParaphraseToolConfigCommand {
19
20
  title: z.ZodString;
20
21
  icon: z.ZodString;
21
22
  price: z.ZodNumber;
23
+ freeMaxPromptLength: z.ZodNumber;
24
+ maxPromptLength: z.ZodNumber;
22
25
  order: z.ZodNumber;
23
26
  status: z.ZodEnum<typeof import("../../..").TOOL_MODEL_STATUS>;
24
27
  canUse: z.ZodBoolean;
@@ -8,3 +8,4 @@ export * from './find-paraphrase-job-by-uuid.command';
8
8
  export * from './find-paraphrase-jobs.command';
9
9
  export * from './get-paraphrase-tool-config.command';
10
10
  export * from './update-paraphrase-job-favorite.command';
11
+ export * from './get-paraphrase-price.command';
@@ -24,3 +24,4 @@ __exportStar(require("./find-paraphrase-job-by-uuid.command"), exports);
24
24
  __exportStar(require("./find-paraphrase-jobs.command"), exports);
25
25
  __exportStar(require("./get-paraphrase-tool-config.command"), exports);
26
26
  __exportStar(require("./update-paraphrase-job-favorite.command"), exports);
27
+ __exportStar(require("./get-paraphrase-price.command"), exports);
@@ -4,9 +4,16 @@ export declare namespace ParaphraseCommand {
4
4
  const RequestSchema: z.ZodObject<{
5
5
  styleId: z.ZodString;
6
6
  typeId: z.ZodString;
7
- prompt: z.ZodString;
7
+ prompt: z.ZodOptional<z.ZodString>;
8
+ fileId: z.ZodOptional<z.ZodString>;
8
9
  intensity: z.ZodEnum<typeof PARAPHRASING_INTENSITY>;
9
10
  }, z.core.$strip>;
11
+ const PublicRequestSchema: z.ZodObject<{
12
+ styleId: z.ZodString;
13
+ typeId: z.ZodString;
14
+ prompt: z.ZodString;
15
+ intensity: z.ZodEnum<typeof PARAPHRASING_INTENSITY>;
16
+ }, z.core.$strict>;
10
17
  type Request = z.infer<typeof RequestSchema>;
11
18
  const ResponseSchema: z.ZodObject<{
12
19
  data: z.ZodObject<{
@@ -16,6 +23,34 @@ export declare namespace ParaphraseCommand {
16
23
  isFavorite: z.ZodBoolean;
17
24
  createdAt: z.ZodDate;
18
25
  updatedAt: z.ZodDate;
26
+ styleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ userInput: z.ZodString;
29
+ title: z.ZodString;
30
+ typeId: z.ZodString;
31
+ intensity: z.ZodEnum<typeof PARAPHRASING_INTENSITY>;
32
+ reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
33
+ aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof import("../../..").PARAPHRASE_INPUT_KIND>>>;
35
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
36
+ uuid: z.ZodString;
37
+ url: z.ZodString;
38
+ name: z.ZodString;
39
+ mimeType: z.ZodString;
40
+ type: z.ZodString;
41
+ size: z.ZodNumber;
42
+ extension: z.ZodString;
43
+ }, z.core.$strip>>>;
44
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
45
+ uuid: z.ZodString;
46
+ url: z.ZodString;
47
+ name: z.ZodString;
48
+ mimeType: z.ZodString;
49
+ type: z.ZodString;
50
+ size: z.ZodNumber;
51
+ extension: z.ZodString;
52
+ }, z.core.$strip>>>;
53
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
19
54
  }, z.core.$strip>;
20
55
  }, z.core.$strip>;
21
56
  type Response = z.infer<typeof ResponseSchema>;
@@ -6,13 +6,26 @@ const constants_1 = require("../../../constants");
6
6
  const models_1 = require("../../../models");
7
7
  var ParaphraseCommand;
8
8
  (function (ParaphraseCommand) {
9
- ParaphraseCommand.RequestSchema = zod_1.z.object({
9
+ ParaphraseCommand.RequestSchema = zod_1.z
10
+ .object({
10
11
  styleId: zod_1.z.string().uuid(),
11
12
  typeId: zod_1.z.string().uuid(),
12
- prompt: zod_1.z.string().min(1).max(100000),
13
+ prompt: zod_1.z.string().min(1).max(100000).optional(),
14
+ fileId: zod_1.z.string().uuid().optional(),
13
15
  intensity: zod_1.z.nativeEnum(constants_1.PARAPHRASING_INTENSITY),
16
+ })
17
+ .refine((request) => (request.prompt !== undefined) !== (request.fileId !== undefined), {
18
+ message: 'Требуется ровно один из prompt или fileId',
14
19
  });
20
+ ParaphraseCommand.PublicRequestSchema = zod_1.z
21
+ .object({
22
+ styleId: zod_1.z.string().uuid(),
23
+ typeId: zod_1.z.string().uuid(),
24
+ prompt: zod_1.z.string().min(1).max(100000),
25
+ intensity: zod_1.z.nativeEnum(constants_1.PARAPHRASING_INTENSITY),
26
+ })
27
+ .strict();
15
28
  ParaphraseCommand.ResponseSchema = zod_1.z.object({
16
- data: models_1.ToolJobSchema,
29
+ data: models_1.ParaphraseToolJobSchema,
17
30
  });
18
31
  })(ParaphraseCommand || (exports.ParaphraseCommand = ParaphraseCommand = {}));
@@ -20,6 +20,26 @@ export declare namespace RetryParaphraseJobCommand {
20
20
  intensity: z.ZodEnum<typeof import("../../..").PARAPHRASING_INTENSITY>;
21
21
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
22
22
  aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof import("../../..").PARAPHRASE_INPUT_KIND>>>;
24
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
25
+ uuid: z.ZodString;
26
+ url: z.ZodString;
27
+ name: z.ZodString;
28
+ mimeType: z.ZodString;
29
+ type: z.ZodString;
30
+ size: z.ZodNumber;
31
+ extension: z.ZodString;
32
+ }, z.core.$strip>>>;
33
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
34
+ uuid: z.ZodString;
35
+ url: z.ZodString;
36
+ name: z.ZodString;
37
+ mimeType: z.ZodString;
38
+ type: z.ZodString;
39
+ size: z.ZodNumber;
40
+ extension: z.ZodString;
41
+ }, z.core.$strip>>>;
42
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
23
43
  }, z.core.$strip>;
24
44
  }, z.core.$strip>;
25
45
  type Response = z.infer<typeof ResponseSchema>;
@@ -26,6 +26,26 @@ export declare namespace SetReactionToParaphraseJobCommand {
26
26
  intensity: z.ZodEnum<typeof import("../../..").PARAPHRASING_INTENSITY>;
27
27
  reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
28
28
  aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof import("../../..").PARAPHRASE_INPUT_KIND>>>;
30
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
31
+ uuid: z.ZodString;
32
+ url: z.ZodString;
33
+ name: z.ZodString;
34
+ mimeType: z.ZodString;
35
+ type: z.ZodString;
36
+ size: z.ZodNumber;
37
+ extension: z.ZodString;
38
+ }, z.core.$strip>>>;
39
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
40
+ uuid: z.ZodString;
41
+ url: z.ZodString;
42
+ name: z.ZodString;
43
+ mimeType: z.ZodString;
44
+ type: z.ZodString;
45
+ size: z.ZodNumber;
46
+ extension: z.ZodString;
47
+ }, z.core.$strip>>>;
48
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
29
49
  }, z.core.$strip>;
30
50
  }, z.core.$strip>;
31
51
  type Response = z.infer<typeof ResponseSchema>;
@@ -24,6 +24,26 @@ export declare namespace UpdateParaphraseJobFavoriteCommand {
24
24
  intensity: z.ZodEnum<typeof import("../../..").PARAPHRASING_INTENSITY>;
25
25
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
26
26
  aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof import("../../..").PARAPHRASE_INPUT_KIND>>>;
28
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
29
+ uuid: z.ZodString;
30
+ url: z.ZodString;
31
+ name: z.ZodString;
32
+ mimeType: z.ZodString;
33
+ type: z.ZodString;
34
+ size: z.ZodNumber;
35
+ extension: z.ZodString;
36
+ }, z.core.$strip>>>;
37
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
38
+ uuid: z.ZodString;
39
+ url: z.ZodString;
40
+ name: z.ZodString;
41
+ mimeType: z.ZodString;
42
+ type: z.ZodString;
43
+ size: z.ZodNumber;
44
+ extension: z.ZodString;
45
+ }, z.core.$strip>>>;
46
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
27
47
  }, z.core.$strip>;
28
48
  }, z.core.$strip>;
29
49
  type Response = z.infer<typeof ResponseSchema>;
@@ -24,6 +24,26 @@ export declare namespace UpdateParaphraseJobTitleCommand {
24
24
  intensity: z.ZodEnum<typeof import("../../..").PARAPHRASING_INTENSITY>;
25
25
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
26
26
  aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof import("../../..").PARAPHRASE_INPUT_KIND>>>;
28
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
29
+ uuid: z.ZodString;
30
+ url: z.ZodString;
31
+ name: z.ZodString;
32
+ mimeType: z.ZodString;
33
+ type: z.ZodString;
34
+ size: z.ZodNumber;
35
+ extension: z.ZodString;
36
+ }, z.core.$strip>>>;
37
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
38
+ uuid: z.ZodString;
39
+ url: z.ZodString;
40
+ name: z.ZodString;
41
+ mimeType: z.ZodString;
42
+ type: z.ZodString;
43
+ size: z.ZodNumber;
44
+ extension: z.ZodString;
45
+ }, z.core.$strip>>>;
46
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
27
47
  }, z.core.$strip>;
28
48
  }, z.core.$strip>;
29
49
  type Response = z.infer<typeof ResponseSchema>;
@@ -3,10 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateProfileCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const models_1 = require("../../models");
6
+ const helpers_1 = require("../../helpers");
6
7
  var UpdateProfileCommand;
7
8
  (function (UpdateProfileCommand) {
8
9
  UpdateProfileCommand.RequestSchema = zod_1.z.object({
9
- name: zod_1.z.string().min(1).max(100).optional(),
10
+ name: zod_1.z
11
+ .string()
12
+ .min(1)
13
+ .max(100)
14
+ .refine((value) => !(0, helpers_1.containsLink)(value), {
15
+ message: 'Nickname cannot contain links',
16
+ })
17
+ .optional(),
10
18
  });
11
19
  UpdateProfileCommand.ResponseSchema = zod_1.z.object({
12
20
  data: models_1.UserProfileResponseSchema,
@@ -1 +1,2 @@
1
1
  export * from './paraphrasing-intesity.enum';
2
+ export * from './paraphrase-input-kind.enum';
@@ -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("./paraphrasing-intesity.enum"), exports);
18
+ __exportStar(require("./paraphrase-input-kind.enum"), exports);
@@ -0,0 +1,4 @@
1
+ export declare enum PARAPHRASE_INPUT_KIND {
2
+ TEXT = "text",
3
+ DOCUMENT = "document"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PARAPHRASE_INPUT_KIND = void 0;
4
+ var PARAPHRASE_INPUT_KIND;
5
+ (function (PARAPHRASE_INPUT_KIND) {
6
+ PARAPHRASE_INPUT_KIND["TEXT"] = "text";
7
+ PARAPHRASE_INPUT_KIND["DOCUMENT"] = "document";
8
+ })(PARAPHRASE_INPUT_KIND || (exports.PARAPHRASE_INPUT_KIND = PARAPHRASE_INPUT_KIND = {}));
@@ -0,0 +1 @@
1
+ export declare const containsLink: (value: string) => boolean;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.containsLink = void 0;
4
+ const LINK_PATTERN = /(?:https?:\/\/|ftp:\/\/|www\.)[^\s]+|(?:^|[\s(])(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?::\d+)?(?:[/?#][^\s]*)?/iu;
5
+ const containsLink = (value) => LINK_PATTERN.test(value);
6
+ exports.containsLink = containsLink;
@@ -13,3 +13,4 @@ export * from './music';
13
13
  export * from './interior-design';
14
14
  export * from './query-boolean.schema';
15
15
  export * from './localized-text.schema';
16
+ export * from './contains-link.helper';
@@ -29,3 +29,4 @@ __exportStar(require("./music"), exports);
29
29
  __exportStar(require("./interior-design"), exports);
30
30
  __exportStar(require("./query-boolean.schema"), exports);
31
31
  __exportStar(require("./localized-text.schema"), exports);
32
+ __exportStar(require("./contains-link.helper"), exports);
@@ -2,3 +2,4 @@ export * from './paraphrase-config.schema';
2
2
  export * from './paraphrase-job.schema';
3
3
  export * from './paraphrase-model.schema';
4
4
  export * from './paraphrase-style.schema';
5
+ export * from './paraphrase-document.schema';
@@ -18,3 +18,4 @@ __exportStar(require("./paraphrase-config.schema"), exports);
18
18
  __exportStar(require("./paraphrase-job.schema"), exports);
19
19
  __exportStar(require("./paraphrase-model.schema"), exports);
20
20
  __exportStar(require("./paraphrase-style.schema"), exports);
21
+ __exportStar(require("./paraphrase-document.schema"), exports);
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const ParaphraseToolConfigSchema: z.ZodObject<{
3
3
  maxSymbols: z.ZodNumber;
4
+ freeMaxSymbols: z.ZodNumber;
4
5
  styles: z.ZodArray<z.ZodObject<{
5
6
  uuid: z.ZodString;
6
7
  title: z.ZodString;
@@ -17,6 +18,8 @@ export declare const ParaphraseToolConfigSchema: z.ZodObject<{
17
18
  title: z.ZodString;
18
19
  icon: z.ZodString;
19
20
  price: z.ZodNumber;
21
+ freeMaxPromptLength: z.ZodNumber;
22
+ maxPromptLength: z.ZodNumber;
20
23
  order: z.ZodNumber;
21
24
  status: z.ZodEnum<typeof import("../../..").TOOL_MODEL_STATUS>;
22
25
  canUse: z.ZodBoolean;
@@ -6,6 +6,7 @@ const paraphrase_style_schema_1 = require("./paraphrase-style.schema");
6
6
  const paraphrase_model_schema_1 = require("./paraphrase-model.schema");
7
7
  exports.ParaphraseToolConfigSchema = zod_1.z.object({
8
8
  maxSymbols: zod_1.z.number(),
9
+ freeMaxSymbols: zod_1.z.number(),
9
10
  styles: zod_1.z.array(paraphrase_style_schema_1.ParaphraseStyleSchema),
10
11
  types: zod_1.z.array(paraphrase_model_schema_1.ParaphraseModelSchema),
11
12
  });
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export declare const ParaphraseDocumentMetadataSchema: z.ZodObject<{
3
+ uuid: z.ZodString;
4
+ url: z.ZodString;
5
+ name: z.ZodString;
6
+ mimeType: z.ZodString;
7
+ type: z.ZodString;
8
+ size: z.ZodNumber;
9
+ extension: z.ZodString;
10
+ }, z.core.$strip>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParaphraseDocumentMetadataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ParaphraseDocumentMetadataSchema = zod_1.z.object({
6
+ uuid: zod_1.z.string().uuid(),
7
+ url: zod_1.z.string(),
8
+ name: zod_1.z.string(),
9
+ mimeType: zod_1.z.string(),
10
+ type: zod_1.z.string(),
11
+ size: zod_1.z.number().nonnegative(),
12
+ extension: zod_1.z.string(),
13
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { PARAPHRASING_INTENSITY, USER_REACTION } from '../../../constants';
2
+ import { PARAPHRASE_INPUT_KIND, PARAPHRASING_INTENSITY, USER_REACTION } from '../../../constants';
3
3
  export declare const ParaphraseToolJobSchema: z.ZodObject<{
4
4
  uuid: z.ZodString;
5
5
  status: z.ZodEnum<typeof import("../../..").TOOL_JOB_STATUS>;
@@ -15,4 +15,24 @@ export declare const ParaphraseToolJobSchema: z.ZodObject<{
15
15
  intensity: z.ZodEnum<typeof PARAPHRASING_INTENSITY>;
16
16
  reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
17
17
  aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ inputKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof PARAPHRASE_INPUT_KIND>>>;
19
+ sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
20
+ uuid: z.ZodString;
21
+ url: z.ZodString;
22
+ name: z.ZodString;
23
+ mimeType: z.ZodString;
24
+ type: z.ZodString;
25
+ size: z.ZodNumber;
26
+ extension: z.ZodString;
27
+ }, z.core.$strip>>>;
28
+ outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
29
+ uuid: z.ZodString;
30
+ url: z.ZodString;
31
+ name: z.ZodString;
32
+ mimeType: z.ZodString;
33
+ type: z.ZodString;
34
+ size: z.ZodNumber;
35
+ extension: z.ZodString;
36
+ }, z.core.$strip>>>;
37
+ uniquenessPercentage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
18
38
  }, z.core.$strip>;
@@ -4,6 +4,7 @@ exports.ParaphraseToolJobSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const tool_job_schema_1 = require("../../tool-job.schema");
6
6
  const constants_1 = require("../../../constants");
7
+ const paraphrase_document_schema_1 = require("./paraphrase-document.schema");
7
8
  exports.ParaphraseToolJobSchema = tool_job_schema_1.ToolJobSchema.extend({
8
9
  styleId: zod_1.z.string().uuid().nullable().optional(),
9
10
  modelId: zod_1.z.string().uuid().nullable().optional(),
@@ -13,4 +14,8 @@ exports.ParaphraseToolJobSchema = tool_job_schema_1.ToolJobSchema.extend({
13
14
  intensity: zod_1.z.nativeEnum(constants_1.PARAPHRASING_INTENSITY),
14
15
  reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
15
16
  aiOutput: zod_1.z.string().nullable().optional(),
17
+ inputKind: zod_1.z.nativeEnum(constants_1.PARAPHRASE_INPUT_KIND).nullable().default(null),
18
+ sourceDocument: paraphrase_document_schema_1.ParaphraseDocumentMetadataSchema.nullable().default(null),
19
+ outputDocument: paraphrase_document_schema_1.ParaphraseDocumentMetadataSchema.nullable().default(null),
20
+ uniquenessPercentage: zod_1.z.number().int().min(0).max(100).nullable().default(null),
16
21
  });
@@ -5,6 +5,8 @@ export declare const ParaphraseModelSchema: z.ZodObject<{
5
5
  title: z.ZodString;
6
6
  icon: z.ZodString;
7
7
  price: z.ZodNumber;
8
+ freeMaxPromptLength: z.ZodNumber;
9
+ maxPromptLength: z.ZodNumber;
8
10
  order: z.ZodNumber;
9
11
  status: z.ZodEnum<typeof TOOL_MODEL_STATUS>;
10
12
  canUse: z.ZodBoolean;
@@ -9,6 +9,8 @@ exports.ParaphraseModelSchema = zod_1.z.object({
9
9
  title: zod_1.z.string(),
10
10
  icon: zod_1.z.string(),
11
11
  price: zod_1.z.number(),
12
+ freeMaxPromptLength: zod_1.z.number(),
13
+ maxPromptLength: zod_1.z.number(),
12
14
  order: zod_1.z.number(),
13
15
  status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
14
16
  canUse: zod_1.z.boolean(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.15.74",
3
+ "version": "0.15.75-paraphrase-special",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",