@purpleschool/student-works 1.0.0 → 1.1.0

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 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PageType = void 0;
4
4
  var PageType;
5
5
  (function (PageType) {
6
- PageType["TOOL"] = "TOOL";
6
+ PageType["WRITER_TOOL"] = "WRITER_TOOL";
7
+ PageType["EDU_TASK_SOLVING_TOOL"] = "EDU_TASK_SOLVING_TOOL";
7
8
  PageType["WRITER_DOCUMENT_TYPE"] = "WRITER_DOCUMENT_TYPE";
8
9
  })(PageType || (exports.PageType = PageType = {}));
@@ -1,19 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageWithQuestionsSchema = exports.PageSchema = exports.PageMetadataSchema = exports.WriterDocumentTypePageMetadataSchema = exports.ToolPageMetadataSchema = void 0;
3
+ exports.PageWithQuestionsSchema = exports.PageSchema = exports.PageMetadataSchema = exports.WriterDocumentTypePageMetadataSchema = exports.EduTaskSolvingToolPageMetadataSchema = exports.WriterToolPageMetadataSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
6
  const page_question_schema_1 = require("./page-question.schema");
7
- exports.ToolPageMetadataSchema = zod_1.z.object({
8
- type: zod_1.z.literal(constants_1.PageType.TOOL),
9
- toolType: zod_1.z.string().min(3).max(16384),
7
+ exports.WriterToolPageMetadataSchema = zod_1.z.object({
8
+ type: zod_1.z.literal(constants_1.PageType.WRITER_TOOL),
9
+ });
10
+ exports.EduTaskSolvingToolPageMetadataSchema = zod_1.z.object({
11
+ type: zod_1.z.literal(constants_1.PageType.EDU_TASK_SOLVING_TOOL),
10
12
  });
11
13
  exports.WriterDocumentTypePageMetadataSchema = zod_1.z.object({
12
14
  type: zod_1.z.literal(constants_1.PageType.WRITER_DOCUMENT_TYPE),
13
15
  writerDocumentTypeId: zod_1.z.string().uuid(),
14
16
  });
15
17
  exports.PageMetadataSchema = zod_1.z.discriminatedUnion('type', [
16
- exports.ToolPageMetadataSchema,
18
+ exports.WriterToolPageMetadataSchema,
19
+ exports.EduTaskSolvingToolPageMetadataSchema,
17
20
  exports.WriterDocumentTypePageMetadataSchema,
18
21
  ]);
19
22
  exports.PageSchema = zod_1.z.object({
@@ -1,4 +1,5 @@
1
1
  export enum PageType {
2
- TOOL = 'TOOL',
2
+ WRITER_TOOL = 'WRITER_TOOL',
3
+ EDU_TASK_SOLVING_TOOL = 'EDU_TASK_SOLVING_TOOL',
3
4
  WRITER_DOCUMENT_TYPE = 'WRITER_DOCUMENT_TYPE',
4
5
  }
@@ -2,9 +2,12 @@ import { z } from 'zod';
2
2
  import { PageType } from '../constants';
3
3
  import { PageQuestionSchema } from './page-question.schema';
4
4
 
5
- export const ToolPageMetadataSchema = z.object({
6
- type: z.literal(PageType.TOOL),
7
- toolType: z.string().min(3).max(16384),
5
+ export const WriterToolPageMetadataSchema = z.object({
6
+ type: z.literal(PageType.WRITER_TOOL),
7
+ });
8
+
9
+ export const EduTaskSolvingToolPageMetadataSchema = z.object({
10
+ type: z.literal(PageType.EDU_TASK_SOLVING_TOOL),
8
11
  });
9
12
 
10
13
  export const WriterDocumentTypePageMetadataSchema = z.object({
@@ -13,7 +16,8 @@ export const WriterDocumentTypePageMetadataSchema = z.object({
13
16
  });
14
17
 
15
18
  export const PageMetadataSchema = z.discriminatedUnion('type', [
16
- ToolPageMetadataSchema,
19
+ WriterToolPageMetadataSchema,
20
+ EduTaskSolvingToolPageMetadataSchema,
17
21
  WriterDocumentTypePageMetadataSchema,
18
22
  ]);
19
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/student-works",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",