@purpleschool/gptbot 0.7.35-texteditor → 0.7.36

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 (91) hide show
  1. package/api/controllers/http/index.ts +1 -1
  2. package/api/controllers/http/user-private.ts +5 -0
  3. package/api/routes.ts +3 -1
  4. package/build/api/controllers/http/index.js +1 -1
  5. package/build/api/controllers/http/user-private.js +7 -0
  6. package/build/api/routes.js +3 -0
  7. package/build/commands/tools/index.js +0 -1
  8. package/build/commands/user/get-aggregated-user-data.command.js +24 -0
  9. package/build/constants/email/subjects.js +1 -0
  10. package/build/constants/errors/errors.js +30 -85
  11. package/build/constants/index.js +0 -1
  12. package/build/constants/subscription/enums/user-to-subscription-marks.enum.js +1 -0
  13. package/build/helpers/index.js +0 -1
  14. package/build/models/tools/image-editor/image-editor-config.schema.js +10 -2
  15. package/build/models/tools/image-editor/image-editor-job.schema.js +2 -1
  16. package/build/models/tools/index.js +0 -1
  17. package/commands/tools/index.ts +0 -1
  18. package/commands/user/get-aggregated-user-data.command.ts +29 -0
  19. package/constants/email/subjects.ts +1 -0
  20. package/constants/errors/errors.ts +30 -85
  21. package/constants/index.ts +0 -1
  22. package/constants/subscription/enums/user-to-subscription-marks.enum.ts +1 -0
  23. package/helpers/index.ts +0 -1
  24. package/models/tools/image-editor/image-editor-config.schema.ts +12 -1
  25. package/models/tools/image-editor/image-editor-job.schema.ts +2 -1
  26. package/models/tools/index.ts +0 -1
  27. package/package.json +1 -1
  28. package/api/controllers/http/writer.ts +0 -20
  29. package/build/api/controllers/http/writer.js +0 -22
  30. package/build/commands/tools/writer/create-writer-document.command.js +0 -16
  31. package/build/commands/tools/writer/delete-all-writer-documents.command.js +0 -8
  32. package/build/commands/tools/writer/delete-writer-document-by-uuid.command.js +0 -11
  33. package/build/commands/tools/writer/export-writer-document-as-docx.command.js +0 -15
  34. package/build/commands/tools/writer/find-writer-document-by-uuid.command.js +0 -14
  35. package/build/commands/tools/writer/find-writer-documents.command.js +0 -18
  36. package/build/commands/tools/writer/generate-writer-document-contents.command.js +0 -14
  37. package/build/commands/tools/writer/get-writer-tool-config.command.js +0 -11
  38. package/build/commands/tools/writer/index.js +0 -31
  39. package/build/commands/tools/writer/update-writer-document-contents.command.js +0 -18
  40. package/build/commands/tools/writer/update-writer-document-outline.command.js +0 -17
  41. package/build/commands/tools/writer/writer-extend-text.command.js +0 -18
  42. package/build/commands/tools/writer/writer-fix-errors.command.js +0 -18
  43. package/build/commands/tools/writer/writer-generate-text.command.js +0 -21
  44. package/build/commands/tools/writer/writer-paraphrase.command.js +0 -18
  45. package/build/commands/tools/writer/writer-shorten-text.command.js +0 -18
  46. package/build/constants/writer/enums/index.js +0 -20
  47. package/build/constants/writer/enums/writer-ai-action-pricing-type.enum.js +0 -8
  48. package/build/constants/writer/enums/writer-ai-action-type.enum.js +0 -11
  49. package/build/constants/writer/enums/writer-document-section-type.enum.js +0 -9
  50. package/build/constants/writer/enums/writer-document-stage.enum.js +0 -14
  51. package/build/constants/writer/index.js +0 -17
  52. package/build/helpers/writer/calculate-writer-ai-action-price.util.js +0 -16
  53. package/build/helpers/writer/calculate-writer-content-generation-price.util.js +0 -6
  54. package/build/helpers/writer/index.js +0 -18
  55. package/build/models/tools/writer/index.js +0 -21
  56. package/build/models/tools/writer/writer-ai-action.schema.js +0 -26
  57. package/build/models/tools/writer/writer-config.schema.js +0 -13
  58. package/build/models/tools/writer/writer-document-outline.schema.js +0 -21
  59. package/build/models/tools/writer/writer-document-type.schema.js +0 -13
  60. package/build/models/tools/writer/writer-document.schema.js +0 -22
  61. package/commands/tools/writer/create-writer-document.command.ts +0 -16
  62. package/commands/tools/writer/delete-all-writer-documents.command.ts +0 -6
  63. package/commands/tools/writer/delete-writer-document-by-uuid.command.ts +0 -11
  64. package/commands/tools/writer/export-writer-document-as-docx.command.ts +0 -15
  65. package/commands/tools/writer/find-writer-document-by-uuid.command.ts +0 -14
  66. package/commands/tools/writer/find-writer-documents.command.ts +0 -18
  67. package/commands/tools/writer/generate-writer-document-contents.command.ts +0 -14
  68. package/commands/tools/writer/get-writer-tool-config.command.ts +0 -10
  69. package/commands/tools/writer/index.ts +0 -15
  70. package/commands/tools/writer/update-writer-document-contents.command.ts +0 -20
  71. package/commands/tools/writer/update-writer-document-outline.command.ts +0 -19
  72. package/commands/tools/writer/writer-extend-text.command.ts +0 -20
  73. package/commands/tools/writer/writer-fix-errors.command.ts +0 -20
  74. package/commands/tools/writer/writer-generate-text.command.ts +0 -23
  75. package/commands/tools/writer/writer-paraphrase.command.ts +0 -20
  76. package/commands/tools/writer/writer-shorten-text.command.ts +0 -20
  77. package/constants/writer/enums/index.ts +0 -4
  78. package/constants/writer/enums/writer-ai-action-pricing-type.enum.ts +0 -4
  79. package/constants/writer/enums/writer-ai-action-type.enum.ts +0 -7
  80. package/constants/writer/enums/writer-document-section-type.enum.ts +0 -5
  81. package/constants/writer/enums/writer-document-stage.enum.ts +0 -13
  82. package/constants/writer/index.ts +0 -1
  83. package/helpers/writer/calculate-writer-ai-action-price.util.ts +0 -20
  84. package/helpers/writer/calculate-writer-content-generation-price.util.ts +0 -3
  85. package/helpers/writer/index.ts +0 -2
  86. package/models/tools/writer/index.ts +0 -5
  87. package/models/tools/writer/writer-ai-action.schema.ts +0 -27
  88. package/models/tools/writer/writer-config.schema.ts +0 -12
  89. package/models/tools/writer/writer-document-outline.schema.ts +0 -28
  90. package/models/tools/writer/writer-document-type.schema.ts +0 -12
  91. package/models/tools/writer/writer-document.schema.ts +0 -21
@@ -3,5 +3,4 @@ export * from './paraphrase';
3
3
  export * from './stt';
4
4
  export * from './tts';
5
5
  export * from './video';
6
- export * from './writer';
7
6
  export * from './image-editor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.7.35-texteditor",
3
+ "version": "0.7.36",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,20 +0,0 @@
1
- export const WRITER_CONTROLLER_PRIVATE = 'private/tools/writer' as const;
2
- export const WRITER_CONTROLLER_PUBLIC = 'public/tools/writer' as const;
3
-
4
- export const WRITER_ROUTES = {
5
- CONFIG: 'config',
6
- CREATE: 'documents',
7
- GET_DOCUMENTS: 'documents',
8
- GET_DOCUMENT: (uuid: string) => `documents/${uuid}`,
9
- GENERATE_CONTENTS: (uuid: string) => `documents/${uuid}/generate`,
10
- UPDATE_OUTLINE: (uuid: string) => `documents/${uuid}/outline`,
11
- DELETE_DOCUMENT: (uuid: string) => `documents/${uuid}`,
12
- UPDATE_CONTENTS: (uuid: string) => `documents/${uuid}/contents`,
13
- DELETE_ALL_DOCUMENTS: 'documents',
14
- PARAPHRASE: (uuid: string) => `documents/${uuid}/actions/paraphrase`,
15
- EXTEND_TEXT: (uuid: string) => `documents/${uuid}/actions/extend-text`,
16
- SHORTEN_TEXT: (uuid: string) => `documents/${uuid}/actions/shorten-text`,
17
- FIX_ERRORS: (uuid: string) => `documents/${uuid}/actions/fix-errors`,
18
- GENERATE_TEXT: (uuid: string) => `documents/${uuid}/actions/generate-text`,
19
- EXPORT_AS_DOCX: (uuid: string) => `documents/${uuid}/export/docx`,
20
- } as const;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WRITER_ROUTES = exports.WRITER_CONTROLLER_PUBLIC = exports.WRITER_CONTROLLER_PRIVATE = void 0;
4
- exports.WRITER_CONTROLLER_PRIVATE = 'private/tools/writer';
5
- exports.WRITER_CONTROLLER_PUBLIC = 'public/tools/writer';
6
- exports.WRITER_ROUTES = {
7
- CONFIG: 'config',
8
- CREATE: 'documents',
9
- GET_DOCUMENTS: 'documents',
10
- GET_DOCUMENT: (uuid) => `documents/${uuid}`,
11
- GENERATE_CONTENTS: (uuid) => `documents/${uuid}/generate`,
12
- UPDATE_OUTLINE: (uuid) => `documents/${uuid}/outline`,
13
- DELETE_DOCUMENT: (uuid) => `documents/${uuid}`,
14
- UPDATE_CONTENTS: (uuid) => `documents/${uuid}/contents`,
15
- DELETE_ALL_DOCUMENTS: 'documents',
16
- PARAPHRASE: (uuid) => `documents/${uuid}/actions/paraphrase`,
17
- EXTEND_TEXT: (uuid) => `documents/${uuid}/actions/extend-text`,
18
- SHORTEN_TEXT: (uuid) => `documents/${uuid}/actions/shorten-text`,
19
- FIX_ERRORS: (uuid) => `documents/${uuid}/actions/fix-errors`,
20
- GENERATE_TEXT: (uuid) => `documents/${uuid}/actions/generate-text`,
21
- EXPORT_AS_DOCX: (uuid) => `documents/${uuid}/export/docx`,
22
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateWriterDocumentCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../../models");
6
- var CreateWriterDocumentCommand;
7
- (function (CreateWriterDocumentCommand) {
8
- CreateWriterDocumentCommand.RequestSchema = zod_1.z.object({
9
- prompt: zod_1.z.string(),
10
- numPages: zod_1.z.number(),
11
- documentTypeId: zod_1.z.string(),
12
- });
13
- CreateWriterDocumentCommand.ResponseSchema = zod_1.z.object({
14
- data: models_1.WriterDocumentSchema,
15
- });
16
- })(CreateWriterDocumentCommand || (exports.CreateWriterDocumentCommand = CreateWriterDocumentCommand = {}));
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteAllWriterDocumentsCommand = void 0;
4
- const zod_1 = require("zod");
5
- var DeleteAllWriterDocumentsCommand;
6
- (function (DeleteAllWriterDocumentsCommand) {
7
- DeleteAllWriterDocumentsCommand.ResponseSchema = zod_1.z.void();
8
- })(DeleteAllWriterDocumentsCommand || (exports.DeleteAllWriterDocumentsCommand = DeleteAllWriterDocumentsCommand = {}));
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteWriterDocumentByUUIDCommand = void 0;
4
- const zod_1 = require("zod");
5
- var DeleteWriterDocumentByUUIDCommand;
6
- (function (DeleteWriterDocumentByUUIDCommand) {
7
- DeleteWriterDocumentByUUIDCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- DeleteWriterDocumentByUUIDCommand.ResponseSchema = zod_1.z.void();
11
- })(DeleteWriterDocumentByUUIDCommand || (exports.DeleteWriterDocumentByUUIDCommand = DeleteWriterDocumentByUUIDCommand = {}));
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExportWriterDocumentAsDocxCommand = void 0;
4
- const zod_1 = require("zod");
5
- var ExportWriterDocumentAsDocxCommand;
6
- (function (ExportWriterDocumentAsDocxCommand) {
7
- ExportWriterDocumentAsDocxCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- ExportWriterDocumentAsDocxCommand.ResponseSchema = zod_1.z.object({
11
- data: zod_1.z.object({
12
- url: zod_1.z.string(),
13
- }),
14
- });
15
- })(ExportWriterDocumentAsDocxCommand || (exports.ExportWriterDocumentAsDocxCommand = ExportWriterDocumentAsDocxCommand = {}));
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FindWriterDocumentByUUIDCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../../models");
6
- var FindWriterDocumentByUUIDCommand;
7
- (function (FindWriterDocumentByUUIDCommand) {
8
- FindWriterDocumentByUUIDCommand.RequestParamsSchema = zod_1.z.object({
9
- uuid: zod_1.z.string().uuid(),
10
- });
11
- FindWriterDocumentByUUIDCommand.ResponseSchema = zod_1.z.object({
12
- data: models_1.WriterDocumentSchema,
13
- });
14
- })(FindWriterDocumentByUUIDCommand || (exports.FindWriterDocumentByUUIDCommand = FindWriterDocumentByUUIDCommand = {}));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FindWriterDocumentsCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../../models");
6
- var FindWriterDocumentsCommand;
7
- (function (FindWriterDocumentsCommand) {
8
- FindWriterDocumentsCommand.RequestQuerySchema = zod_1.z.object({
9
- limit: zod_1.z.coerce.number().min(1).optional(),
10
- offset: zod_1.z.coerce.number().min(0).default(0).optional(),
11
- title: zod_1.z.string().optional(),
12
- });
13
- FindWriterDocumentsCommand.ResponseSchema = zod_1.z.object({
14
- data: zod_1.z.array(models_1.WriterDocumentSchema),
15
- totalPages: zod_1.z.number(),
16
- page: zod_1.z.number(),
17
- });
18
- })(FindWriterDocumentsCommand || (exports.FindWriterDocumentsCommand = FindWriterDocumentsCommand = {}));
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GenerateWriterDocumentContentsCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../../models");
6
- var GenerateWriterDocumentContentsCommand;
7
- (function (GenerateWriterDocumentContentsCommand) {
8
- GenerateWriterDocumentContentsCommand.RequestParamsSchema = zod_1.z.object({
9
- uuid: zod_1.z.string().uuid(),
10
- });
11
- GenerateWriterDocumentContentsCommand.ResponseSchema = zod_1.z.object({
12
- data: models_1.WriterDocumentSchema,
13
- });
14
- })(GenerateWriterDocumentContentsCommand || (exports.GenerateWriterDocumentContentsCommand = GenerateWriterDocumentContentsCommand = {}));
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetWriterToolConfigCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../../models");
6
- var GetWriterToolConfigCommand;
7
- (function (GetWriterToolConfigCommand) {
8
- GetWriterToolConfigCommand.ResponseSchema = zod_1.z.object({
9
- data: models_1.WriterConfigSchema,
10
- });
11
- })(GetWriterToolConfigCommand || (exports.GetWriterToolConfigCommand = GetWriterToolConfigCommand = {}));
@@ -1,31 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-writer-tool-config.command"), exports);
18
- __exportStar(require("./create-writer-document.command"), exports);
19
- __exportStar(require("./find-writer-document-by-uuid.command"), exports);
20
- __exportStar(require("./find-writer-documents.command"), exports);
21
- __exportStar(require("./generate-writer-document-contents.command"), exports);
22
- __exportStar(require("./update-writer-document-outline.command"), exports);
23
- __exportStar(require("./update-writer-document-contents.command"), exports);
24
- __exportStar(require("./delete-writer-document-by-uuid.command"), exports);
25
- __exportStar(require("./delete-all-writer-documents.command"), exports);
26
- __exportStar(require("./writer-paraphrase.command"), exports);
27
- __exportStar(require("./writer-extend-text.command"), exports);
28
- __exportStar(require("./writer-shorten-text.command"), exports);
29
- __exportStar(require("./writer-fix-errors.command"), exports);
30
- __exportStar(require("./writer-generate-text.command"), exports);
31
- __exportStar(require("./export-writer-document-as-docx.command"), exports);
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateWriterDocumentContentsCommand = void 0;
4
- const zod_1 = require("zod");
5
- var UpdateWriterDocumentContentsCommand;
6
- (function (UpdateWriterDocumentContentsCommand) {
7
- UpdateWriterDocumentContentsCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- UpdateWriterDocumentContentsCommand.RequestBodySchema = zod_1.z.object({
11
- contents: zod_1.z.string(),
12
- });
13
- UpdateWriterDocumentContentsCommand.ResponseSchema = zod_1.z.object({
14
- data: zod_1.z.object({
15
- success: zod_1.z.boolean(),
16
- }),
17
- });
18
- })(UpdateWriterDocumentContentsCommand || (exports.UpdateWriterDocumentContentsCommand = UpdateWriterDocumentContentsCommand = {}));
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateWriterDocumentOutlineCommand = void 0;
4
- const zod_1 = require("zod");
5
- const models_1 = require("../../../models");
6
- var UpdateWriterDocumentOutlineCommand;
7
- (function (UpdateWriterDocumentOutlineCommand) {
8
- UpdateWriterDocumentOutlineCommand.RequestBodySchema = zod_1.z.object({
9
- data: models_1.WriterDocumentOutlineSchema,
10
- });
11
- UpdateWriterDocumentOutlineCommand.RequestParamsSchema = zod_1.z.object({
12
- uuid: zod_1.z.string().uuid(),
13
- });
14
- UpdateWriterDocumentOutlineCommand.ResponseSchema = zod_1.z.object({
15
- data: zod_1.z.array(models_1.WriterDocumentOutlineSectionSchema),
16
- });
17
- })(UpdateWriterDocumentOutlineCommand || (exports.UpdateWriterDocumentOutlineCommand = UpdateWriterDocumentOutlineCommand = {}));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterExtendTextCommand = void 0;
4
- const zod_1 = require("zod");
5
- var WriterExtendTextCommand;
6
- (function (WriterExtendTextCommand) {
7
- WriterExtendTextCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- WriterExtendTextCommand.RequestBodySchema = zod_1.z.object({
11
- selectionText: zod_1.z.string(),
12
- });
13
- WriterExtendTextCommand.ResponseSchema = zod_1.z.object({
14
- data: zod_1.z.object({
15
- output: zod_1.z.string(),
16
- }),
17
- });
18
- })(WriterExtendTextCommand || (exports.WriterExtendTextCommand = WriterExtendTextCommand = {}));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterFixErrorsCommand = void 0;
4
- const zod_1 = require("zod");
5
- var WriterFixErrorsCommand;
6
- (function (WriterFixErrorsCommand) {
7
- WriterFixErrorsCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- WriterFixErrorsCommand.RequestBodySchema = zod_1.z.object({
11
- selectionText: zod_1.z.string(),
12
- });
13
- WriterFixErrorsCommand.ResponseSchema = zod_1.z.object({
14
- data: zod_1.z.object({
15
- output: zod_1.z.string(),
16
- }),
17
- });
18
- })(WriterFixErrorsCommand || (exports.WriterFixErrorsCommand = WriterFixErrorsCommand = {}));
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterGenerateTextCommand = void 0;
4
- const zod_1 = require("zod");
5
- var WriterGenerateTextCommand;
6
- (function (WriterGenerateTextCommand) {
7
- WriterGenerateTextCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- WriterGenerateTextCommand.RequestBodySchema = zod_1.z.object({
11
- prompt: zod_1.z.string(),
12
- selectionText: zod_1.z.string(),
13
- contextBefore: zod_1.z.string().max(2000).optional(),
14
- contextAfter: zod_1.z.string().max(2000).optional(),
15
- });
16
- WriterGenerateTextCommand.ResponseSchema = zod_1.z.object({
17
- data: zod_1.z.object({
18
- output: zod_1.z.string(),
19
- }),
20
- });
21
- })(WriterGenerateTextCommand || (exports.WriterGenerateTextCommand = WriterGenerateTextCommand = {}));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterParaphraseCommand = void 0;
4
- const zod_1 = require("zod");
5
- var WriterParaphraseCommand;
6
- (function (WriterParaphraseCommand) {
7
- WriterParaphraseCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- WriterParaphraseCommand.RequestBodySchema = zod_1.z.object({
11
- selectionText: zod_1.z.string(),
12
- });
13
- WriterParaphraseCommand.ResponseSchema = zod_1.z.object({
14
- data: zod_1.z.object({
15
- output: zod_1.z.string(),
16
- }),
17
- });
18
- })(WriterParaphraseCommand || (exports.WriterParaphraseCommand = WriterParaphraseCommand = {}));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterShortenTextCommand = void 0;
4
- const zod_1 = require("zod");
5
- var WriterShortenTextCommand;
6
- (function (WriterShortenTextCommand) {
7
- WriterShortenTextCommand.RequestParamsSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- WriterShortenTextCommand.RequestBodySchema = zod_1.z.object({
11
- selectionText: zod_1.z.string(),
12
- });
13
- WriterShortenTextCommand.ResponseSchema = zod_1.z.object({
14
- data: zod_1.z.object({
15
- output: zod_1.z.string(),
16
- }),
17
- });
18
- })(WriterShortenTextCommand || (exports.WriterShortenTextCommand = WriterShortenTextCommand = {}));
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./writer-document-section-type.enum"), exports);
18
- __exportStar(require("./writer-document-stage.enum"), exports);
19
- __exportStar(require("./writer-ai-action-pricing-type.enum"), exports);
20
- __exportStar(require("./writer-ai-action-type.enum"), exports);
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WRITER_AI_ACTION_PRICING_TYPE = void 0;
4
- var WRITER_AI_ACTION_PRICING_TYPE;
5
- (function (WRITER_AI_ACTION_PRICING_TYPE) {
6
- WRITER_AI_ACTION_PRICING_TYPE["PER_CHARACTER"] = "PER_CHARACTER";
7
- WRITER_AI_ACTION_PRICING_TYPE["FLAT"] = "FLAT";
8
- })(WRITER_AI_ACTION_PRICING_TYPE || (exports.WRITER_AI_ACTION_PRICING_TYPE = WRITER_AI_ACTION_PRICING_TYPE = {}));
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WRITER_AI_ACTION_TYPE = void 0;
4
- var WRITER_AI_ACTION_TYPE;
5
- (function (WRITER_AI_ACTION_TYPE) {
6
- WRITER_AI_ACTION_TYPE["PARAPHRASE"] = "PARAPHRASE";
7
- WRITER_AI_ACTION_TYPE["EXTEND_TEXT"] = "EXTEND_TEXT";
8
- WRITER_AI_ACTION_TYPE["SHORTEN_TEXT"] = "SHORTEN_TEXT";
9
- WRITER_AI_ACTION_TYPE["GENERATE_TEXT"] = "GENERATE_TEXT";
10
- WRITER_AI_ACTION_TYPE["FIX_ERRORS"] = "FIX_ERRORS";
11
- })(WRITER_AI_ACTION_TYPE || (exports.WRITER_AI_ACTION_TYPE = WRITER_AI_ACTION_TYPE = {}));
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WRITER_DOCUMENT_SECTION_TYPE = void 0;
4
- var WRITER_DOCUMENT_SECTION_TYPE;
5
- (function (WRITER_DOCUMENT_SECTION_TYPE) {
6
- WRITER_DOCUMENT_SECTION_TYPE["INTRODUCTION"] = "introduction";
7
- WRITER_DOCUMENT_SECTION_TYPE["CONCLUSION"] = "conclusion";
8
- WRITER_DOCUMENT_SECTION_TYPE["SECTION"] = "section";
9
- })(WRITER_DOCUMENT_SECTION_TYPE || (exports.WRITER_DOCUMENT_SECTION_TYPE = WRITER_DOCUMENT_SECTION_TYPE = {}));
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WRITER_DOCUMENT_STAGE = void 0;
4
- var WRITER_DOCUMENT_STAGE;
5
- (function (WRITER_DOCUMENT_STAGE) {
6
- WRITER_DOCUMENT_STAGE["CREATED"] = "CREATED";
7
- WRITER_DOCUMENT_STAGE["GENERATING_OUTLINE"] = "GENERATING_OUTLINE";
8
- WRITER_DOCUMENT_STAGE["OUTLINE_GENERATED"] = "OUTLINE_GENERATED";
9
- WRITER_DOCUMENT_STAGE["OUTLINE_GENERATION_FAILED"] = "OUTLINE_GENERATION_FAILED";
10
- WRITER_DOCUMENT_STAGE["GENERATING_CONTENT"] = "GENERATING_CONTENT";
11
- WRITER_DOCUMENT_STAGE["CONTENT_GENERATED"] = "CONTENT_GENERATED";
12
- WRITER_DOCUMENT_STAGE["CONTENT_GENERATION_FAILED"] = "CONTENT_GENERATION_FAILED";
13
- WRITER_DOCUMENT_STAGE["DELETED"] = "DELETED";
14
- })(WRITER_DOCUMENT_STAGE || (exports.WRITER_DOCUMENT_STAGE = WRITER_DOCUMENT_STAGE = {}));
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./enums"), exports);
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.calculateWriterAiActionPrice = calculateWriterAiActionPrice;
4
- const constants_1 = require("../../constants");
5
- function calculateWriterAiActionPrice(pricingRules, selectionText) {
6
- switch (pricingRules.type) {
7
- case constants_1.WRITER_AI_ACTION_PRICING_TYPE.PER_CHARACTER:
8
- const characterCount = selectionText.length;
9
- const price = characterCount * pricingRules.price;
10
- return Math.max(1, Math.ceil(price));
11
- case constants_1.WRITER_AI_ACTION_PRICING_TYPE.FLAT:
12
- return Math.max(1, Math.ceil(pricingRules.price));
13
- default:
14
- throw new Error(`Unknown pricing type`);
15
- }
16
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.calculateWriterContentGenerationPrice = calculateWriterContentGenerationPrice;
4
- function calculateWriterContentGenerationPrice(pages) {
5
- return Math.max(1, pages);
6
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./calculate-writer-ai-action-price.util"), exports);
18
- __exportStar(require("./calculate-writer-content-generation-price.util"), exports);
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./writer-config.schema"), exports);
18
- __exportStar(require("./writer-ai-action.schema"), exports);
19
- __exportStar(require("./writer-document-outline.schema"), exports);
20
- __exportStar(require("./writer-document.schema"), exports);
21
- __exportStar(require("./writer-document-type.schema"), exports);
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterAiActionSchema = exports.WriterAiActionPricingRulesSchema = void 0;
4
- const zod_1 = require("zod");
5
- const constants_1 = require("../../../constants");
6
- exports.WriterAiActionPricingRulesSchema = zod_1.z.discriminatedUnion('type', [
7
- zod_1.z.object({
8
- type: zod_1.z.literal(constants_1.WRITER_AI_ACTION_PRICING_TYPE.PER_CHARACTER),
9
- price: zod_1.z.number(),
10
- }),
11
- zod_1.z.object({
12
- type: zod_1.z.literal(constants_1.WRITER_AI_ACTION_PRICING_TYPE.FLAT),
13
- price: zod_1.z.number(),
14
- }),
15
- ]);
16
- exports.WriterAiActionSchema = zod_1.z.object({
17
- uuid: zod_1.z.string(),
18
- type: zod_1.z.nativeEnum(constants_1.WRITER_AI_ACTION_TYPE),
19
- pricingRules: exports.WriterAiActionPricingRulesSchema,
20
- maxPromptLength: zod_1.z.number(),
21
- title: zod_1.z.string(),
22
- icon: zod_1.z.string(),
23
- order: zod_1.z.number(),
24
- createdAt: zod_1.z.date(),
25
- updatedAt: zod_1.z.date(),
26
- });
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterConfigSchema = void 0;
4
- const zod_1 = require("zod");
5
- const writer_document_type_schema_1 = require("./writer-document-type.schema");
6
- const writer_ai_action_schema_1 = require("./writer-ai-action.schema");
7
- exports.WriterConfigSchema = zod_1.z.object({
8
- minPages: zod_1.z.number(),
9
- maxPages: zod_1.z.number(),
10
- maxPromptLength: zod_1.z.number(),
11
- documentTypes: zod_1.z.array(writer_document_type_schema_1.WriterDocumentTypeSchema),
12
- aiActions: zod_1.z.array(writer_ai_action_schema_1.WriterAiActionSchema),
13
- });
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterDocumentOutlineSchema = exports.WriterDocumentOutlineSectionSchema = exports.WriterDocumentOutlineSubsectionSchema = void 0;
4
- const zod_1 = require("zod");
5
- const constants_1 = require("../../../constants");
6
- exports.WriterDocumentOutlineSubsectionSchema = zod_1.z.object({
7
- title: zod_1.z
8
- .string()
9
- .min(3)
10
- .max(120)
11
- .describe(`Concise title of the subsection. Meant to elaborate on its parent section's title.`),
12
- });
13
- exports.WriterDocumentOutlineSectionSchema = zod_1.z.object({
14
- title: zod_1.z.string().min(3).max(120).describe(`Concise title of the paper section.`),
15
- type: zod_1.z.nativeEnum(constants_1.WRITER_DOCUMENT_SECTION_TYPE),
16
- subsections: zod_1.z
17
- .array(exports.WriterDocumentOutlineSubsectionSchema)
18
- .optional()
19
- .describe(`Subsections of the paper section. Each subsection is a single idea that is a part of the parent section.`),
20
- });
21
- exports.WriterDocumentOutlineSchema = zod_1.z.array(exports.WriterDocumentOutlineSectionSchema);
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterDocumentTypeSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.WriterDocumentTypeSchema = zod_1.z.object({
6
- uuid: zod_1.z.string().uuid(),
7
- title: zod_1.z.string(),
8
- icon: zod_1.z.string(),
9
- order: zod_1.z.number(),
10
- promptInstructions: zod_1.z.string().nullable(),
11
- createdAt: zod_1.z.date(),
12
- updatedAt: zod_1.z.date(),
13
- });
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WriterDocumentSchema = void 0;
4
- const zod_1 = require("zod");
5
- const writer_document_outline_schema_1 = require("./writer-document-outline.schema");
6
- const constants_1 = require("../../../constants");
7
- exports.WriterDocumentSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- prompt: zod_1.z.string(),
10
- topic: zod_1.z.string(),
11
- typeId: zod_1.z.string(),
12
- stage: zod_1.z.nativeEnum(constants_1.WRITER_DOCUMENT_STAGE),
13
- outline: writer_document_outline_schema_1.WriterDocumentOutlineSchema,
14
- sourceMd: zod_1.z.string().nullable(),
15
- finalMd: zod_1.z.string().nullable(),
16
- userId: zod_1.z.string().nullable(),
17
- unregisteredUserId: zod_1.z.string().nullable(),
18
- pages: zod_1.z.number(),
19
- createdAt: zod_1.z.date(),
20
- updatedAt: zod_1.z.date(),
21
- completedAt: zod_1.z.date().nullable(),
22
- });
@@ -1,16 +0,0 @@
1
- import { z } from 'zod';
2
- import { WriterDocumentSchema } from '../../../models';
3
-
4
- export namespace CreateWriterDocumentCommand {
5
- export const RequestSchema = z.object({
6
- prompt: z.string(),
7
- numPages: z.number(),
8
- documentTypeId: z.string(),
9
- });
10
- export type Request = z.infer<typeof RequestSchema>;
11
-
12
- export const ResponseSchema = z.object({
13
- data: WriterDocumentSchema,
14
- });
15
- export type Response = z.infer<typeof ResponseSchema>;
16
- }
@@ -1,6 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- export namespace DeleteAllWriterDocumentsCommand {
4
- export const ResponseSchema = z.void();
5
- export type Response = z.infer<typeof ResponseSchema>;
6
- }