@purpleschool/gptbot-tools 0.0.53 → 0.0.55
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.
- package/build/writer/commands/index.js +1 -0
- package/build/writer/commands/set-reaction-writer-document.command.js +16 -0
- package/build/writer/models/writer-document.schema.js +2 -0
- package/build/writer/routes/writer.routes.js +1 -0
- package/package.json +1 -1
- package/writer/commands/index.ts +1 -0
- package/writer/commands/set-reaction-writer-document.command.ts +16 -0
- package/writer/models/writer-document.schema.ts +2 -0
- package/writer/routes/writer.routes.ts +1 -0
|
@@ -26,3 +26,4 @@ __exportStar(require("./writer-shorten-text.command"), exports);
|
|
|
26
26
|
__exportStar(require("./writer-fix-errors.command"), exports);
|
|
27
27
|
__exportStar(require("./writer-generate-text.command"), exports);
|
|
28
28
|
__exportStar(require("./update-writer-document-contents.command"), exports);
|
|
29
|
+
__exportStar(require("./set-reaction-writer-document.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetReactionToWriterDocumentCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
const models_1 = require("../models");
|
|
7
|
+
var SetReactionToWriterDocumentCommand;
|
|
8
|
+
(function (SetReactionToWriterDocumentCommand) {
|
|
9
|
+
SetReactionToWriterDocumentCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
11
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
|
+
documentId: zod_1.z.string().uuid(),
|
|
13
|
+
reaction: zod_1.z.nativeEnum(common_1.USER_REACTION),
|
|
14
|
+
});
|
|
15
|
+
SetReactionToWriterDocumentCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.WriterDocumentSchema);
|
|
16
|
+
})(SetReactionToWriterDocumentCommand || (exports.SetReactionToWriterDocumentCommand = SetReactionToWriterDocumentCommand = {}));
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WriterDocumentSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const writer_document_outline_schema_1 = require("./writer-document-outline.schema");
|
|
6
|
+
const common_1 = require("../../common");
|
|
6
7
|
const enums_1 = require("../enums");
|
|
7
8
|
exports.WriterDocumentSchema = zod_1.z.object({
|
|
8
9
|
uuid: zod_1.z.string().uuid(),
|
|
@@ -15,6 +16,7 @@ exports.WriterDocumentSchema = zod_1.z.object({
|
|
|
15
16
|
finalMd: zod_1.z.string().nullable(),
|
|
16
17
|
userId: zod_1.z.string().nullable(),
|
|
17
18
|
unregisteredUserId: zod_1.z.string().nullable(),
|
|
19
|
+
reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
|
|
18
20
|
pages: zod_1.z.number(),
|
|
19
21
|
isDeleted: zod_1.z.boolean(),
|
|
20
22
|
createdAt: zod_1.z.date(),
|
package/package.json
CHANGED
package/writer/commands/index.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema, USER_REACTION } from '../../common';
|
|
3
|
+
import { WriterDocumentSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToWriterDocumentCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
userId: z.string().uuid().nullable().optional(),
|
|
8
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
9
|
+
documentId: z.string().uuid(),
|
|
10
|
+
reaction: z.nativeEnum(USER_REACTION),
|
|
11
|
+
});
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const ResponseSchema = ICommandResponseSchema(WriterDocumentSchema);
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { WriterDocumentOutlineSchema } from './writer-document-outline.schema';
|
|
3
|
+
import { USER_REACTION } from '../../common';
|
|
3
4
|
import { WRITER_DOCUMENT_STAGE } from '../enums';
|
|
4
5
|
|
|
5
6
|
export const WriterDocumentSchema = z.object({
|
|
@@ -13,6 +14,7 @@ export const WriterDocumentSchema = z.object({
|
|
|
13
14
|
finalMd: z.string().nullable(),
|
|
14
15
|
userId: z.string().nullable(),
|
|
15
16
|
unregisteredUserId: z.string().nullable(),
|
|
17
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
16
18
|
pages: z.number(),
|
|
17
19
|
isDeleted: z.boolean(),
|
|
18
20
|
createdAt: z.date(),
|