@purpleschool/multisite 0.0.17 → 0.0.18

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.
@@ -1,51 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { PageType } from '../constants';
3
- export declare const WriterToolPageMetadataSchema: z.ZodObject<{
4
- type: z.ZodLiteral<PageType.WRITER_TOOL>;
5
- }, "strip", z.ZodTypeAny, {
6
- type: PageType.WRITER_TOOL;
7
- }, {
8
- type: PageType.WRITER_TOOL;
9
- }>;
10
- export declare const EduTaskSolvingToolPageMetadataSchema: z.ZodObject<{
11
- type: z.ZodLiteral<PageType.EDU_TASK_SOLVING_TOOL>;
12
- }, "strip", z.ZodTypeAny, {
13
- type: PageType.EDU_TASK_SOLVING_TOOL;
14
- }, {
15
- type: PageType.EDU_TASK_SOLVING_TOOL;
16
- }>;
17
- export declare const WriterDocumentTypePageMetadataSchema: z.ZodObject<{
18
- type: z.ZodLiteral<PageType.WRITER_DOCUMENT_TYPE>;
19
- writerDocumentTypeId: z.ZodString;
20
- }, "strip", z.ZodTypeAny, {
21
- type: PageType.WRITER_DOCUMENT_TYPE;
22
- writerDocumentTypeId: string;
23
- }, {
24
- type: PageType.WRITER_DOCUMENT_TYPE;
25
- writerDocumentTypeId: string;
26
- }>;
27
- export declare const PageMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
28
- type: z.ZodLiteral<PageType.WRITER_TOOL>;
29
- }, "strip", z.ZodTypeAny, {
30
- type: PageType.WRITER_TOOL;
31
- }, {
32
- type: PageType.WRITER_TOOL;
33
- }>, z.ZodObject<{
34
- type: z.ZodLiteral<PageType.EDU_TASK_SOLVING_TOOL>;
35
- }, "strip", z.ZodTypeAny, {
36
- type: PageType.EDU_TASK_SOLVING_TOOL;
37
- }, {
38
- type: PageType.EDU_TASK_SOLVING_TOOL;
39
- }>, z.ZodObject<{
40
- type: z.ZodLiteral<PageType.WRITER_DOCUMENT_TYPE>;
41
- writerDocumentTypeId: z.ZodString;
42
- }, "strip", z.ZodTypeAny, {
43
- type: PageType.WRITER_DOCUMENT_TYPE;
44
- writerDocumentTypeId: string;
45
- }, {
46
- type: PageType.WRITER_DOCUMENT_TYPE;
47
- writerDocumentTypeId: string;
48
- }>]>;
49
2
  export declare const PageSchema: z.ZodObject<{
50
3
  uuid: z.ZodString;
51
4
  metaTitle: z.ZodString;
@@ -54,34 +7,10 @@ export declare const PageSchema: z.ZodObject<{
54
7
  subTitle: z.ZodString;
55
8
  seoTextMd: z.ZodString;
56
9
  alias: z.ZodString;
57
- type: z.ZodNativeEnum<typeof PageType>;
58
- metadata: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
59
- type: z.ZodLiteral<PageType.WRITER_TOOL>;
60
- }, "strip", z.ZodTypeAny, {
61
- type: PageType.WRITER_TOOL;
62
- }, {
63
- type: PageType.WRITER_TOOL;
64
- }>, z.ZodObject<{
65
- type: z.ZodLiteral<PageType.EDU_TASK_SOLVING_TOOL>;
66
- }, "strip", z.ZodTypeAny, {
67
- type: PageType.EDU_TASK_SOLVING_TOOL;
68
- }, {
69
- type: PageType.EDU_TASK_SOLVING_TOOL;
70
- }>, z.ZodObject<{
71
- type: z.ZodLiteral<PageType.WRITER_DOCUMENT_TYPE>;
72
- writerDocumentTypeId: z.ZodString;
73
- }, "strip", z.ZodTypeAny, {
74
- type: PageType.WRITER_DOCUMENT_TYPE;
75
- writerDocumentTypeId: string;
76
- }, {
77
- type: PageType.WRITER_DOCUMENT_TYPE;
78
- writerDocumentTypeId: string;
79
- }>]>;
80
10
  createdAt: z.ZodDate;
81
11
  updatedAt: z.ZodDate;
82
12
  }, "strip", z.ZodTypeAny, {
83
13
  uuid: string;
84
- type: PageType;
85
14
  title: string;
86
15
  createdAt: Date;
87
16
  updatedAt: Date;
@@ -90,17 +19,8 @@ export declare const PageSchema: z.ZodObject<{
90
19
  subTitle: string;
91
20
  seoTextMd: string;
92
21
  alias: string;
93
- metadata: {
94
- type: PageType.WRITER_TOOL;
95
- } | {
96
- type: PageType.EDU_TASK_SOLVING_TOOL;
97
- } | {
98
- type: PageType.WRITER_DOCUMENT_TYPE;
99
- writerDocumentTypeId: string;
100
- };
101
22
  }, {
102
23
  uuid: string;
103
- type: PageType;
104
24
  title: string;
105
25
  createdAt: Date;
106
26
  updatedAt: Date;
@@ -109,14 +29,6 @@ export declare const PageSchema: z.ZodObject<{
109
29
  subTitle: string;
110
30
  seoTextMd: string;
111
31
  alias: string;
112
- metadata: {
113
- type: PageType.WRITER_TOOL;
114
- } | {
115
- type: PageType.EDU_TASK_SOLVING_TOOL;
116
- } | {
117
- type: PageType.WRITER_DOCUMENT_TYPE;
118
- writerDocumentTypeId: string;
119
- };
120
32
  }>;
121
33
  export declare const PageWithQuestionsSchema: z.ZodObject<{
122
34
  uuid: z.ZodString;
@@ -126,29 +38,6 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
126
38
  subTitle: z.ZodString;
127
39
  seoTextMd: z.ZodString;
128
40
  alias: z.ZodString;
129
- type: z.ZodNativeEnum<typeof PageType>;
130
- metadata: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
131
- type: z.ZodLiteral<PageType.WRITER_TOOL>;
132
- }, "strip", z.ZodTypeAny, {
133
- type: PageType.WRITER_TOOL;
134
- }, {
135
- type: PageType.WRITER_TOOL;
136
- }>, z.ZodObject<{
137
- type: z.ZodLiteral<PageType.EDU_TASK_SOLVING_TOOL>;
138
- }, "strip", z.ZodTypeAny, {
139
- type: PageType.EDU_TASK_SOLVING_TOOL;
140
- }, {
141
- type: PageType.EDU_TASK_SOLVING_TOOL;
142
- }>, z.ZodObject<{
143
- type: z.ZodLiteral<PageType.WRITER_DOCUMENT_TYPE>;
144
- writerDocumentTypeId: z.ZodString;
145
- }, "strip", z.ZodTypeAny, {
146
- type: PageType.WRITER_DOCUMENT_TYPE;
147
- writerDocumentTypeId: string;
148
- }, {
149
- type: PageType.WRITER_DOCUMENT_TYPE;
150
- writerDocumentTypeId: string;
151
- }>]>;
152
41
  createdAt: z.ZodDate;
153
42
  updatedAt: z.ZodDate;
154
43
  } & {
@@ -176,7 +65,6 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
176
65
  }>, "many">;
177
66
  }, "strip", z.ZodTypeAny, {
178
67
  uuid: string;
179
- type: PageType;
180
68
  title: string;
181
69
  createdAt: Date;
182
70
  updatedAt: Date;
@@ -185,14 +73,6 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
185
73
  subTitle: string;
186
74
  seoTextMd: string;
187
75
  alias: string;
188
- metadata: {
189
- type: PageType.WRITER_TOOL;
190
- } | {
191
- type: PageType.EDU_TASK_SOLVING_TOOL;
192
- } | {
193
- type: PageType.WRITER_DOCUMENT_TYPE;
194
- writerDocumentTypeId: string;
195
- };
196
76
  questions: {
197
77
  uuid: string;
198
78
  createdAt: Date;
@@ -203,7 +83,6 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
203
83
  }[];
204
84
  }, {
205
85
  uuid: string;
206
- type: PageType;
207
86
  title: string;
208
87
  createdAt: Date;
209
88
  updatedAt: Date;
@@ -212,14 +91,6 @@ export declare const PageWithQuestionsSchema: z.ZodObject<{
212
91
  subTitle: string;
213
92
  seoTextMd: string;
214
93
  alias: string;
215
- metadata: {
216
- type: PageType.WRITER_TOOL;
217
- } | {
218
- type: PageType.EDU_TASK_SOLVING_TOOL;
219
- } | {
220
- type: PageType.WRITER_DOCUMENT_TYPE;
221
- writerDocumentTypeId: string;
222
- };
223
94
  questions: {
224
95
  uuid: string;
225
96
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"page.schema.d.ts","sourceRoot":"","sources":["../../models/page.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;EAE/C,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;EAG/C,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;IAI7B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYrB,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAC"}
1
+ {"version":3,"file":"page.schema.d.ts","sourceRoot":"","sources":["../../models/page.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAC"}
@@ -1,24 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageWithQuestionsSchema = exports.PageSchema = exports.PageMetadataSchema = exports.WriterDocumentTypePageMetadataSchema = exports.EduTaskSolvingToolPageMetadataSchema = exports.WriterToolPageMetadataSchema = void 0;
3
+ exports.PageWithQuestionsSchema = exports.PageSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../constants");
6
5
  const page_question_schema_1 = require("./page-question.schema");
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),
12
- });
13
- exports.WriterDocumentTypePageMetadataSchema = zod_1.z.object({
14
- type: zod_1.z.literal(constants_1.PageType.WRITER_DOCUMENT_TYPE),
15
- writerDocumentTypeId: zod_1.z.string().uuid(),
16
- });
17
- exports.PageMetadataSchema = zod_1.z.discriminatedUnion('type', [
18
- exports.WriterToolPageMetadataSchema,
19
- exports.EduTaskSolvingToolPageMetadataSchema,
20
- exports.WriterDocumentTypePageMetadataSchema,
21
- ]);
22
6
  exports.PageSchema = zod_1.z.object({
23
7
  uuid: zod_1.z.string().uuid(),
24
8
  metaTitle: zod_1.z.string().min(3).max(16384),
@@ -27,8 +11,6 @@ exports.PageSchema = zod_1.z.object({
27
11
  subTitle: zod_1.z.string().min(3).max(16384),
28
12
  seoTextMd: zod_1.z.string().min(3).max(16384),
29
13
  alias: zod_1.z.string().min(3).max(16384),
30
- type: zod_1.z.nativeEnum(constants_1.PageType),
31
- metadata: exports.PageMetadataSchema,
32
14
  createdAt: zod_1.z.date(),
33
15
  updatedAt: zod_1.z.date(),
34
16
  });
@@ -1,12 +1,10 @@
1
1
  import { PageWithQuestionsSchema } from '../../models';
2
2
  import { z } from 'zod';
3
- import { PageType } from '../../constants/page';
4
3
 
5
4
  export namespace FindPageByCriteriaCommand {
6
5
  export const RequestQuerySchema = z.object({
7
6
  title: z.string().optional(),
8
7
  alias: z.string().optional(),
9
- type: z.nativeEnum(PageType).optional(),
10
8
  uuid: z.string().uuid().optional(),
11
9
  limit: z.coerce.number().min(1).optional(),
12
10
  offset: z.coerce.number().min(0).default(0).optional(),
@@ -1 +1 @@
1
- export * from './enums/page-type.enum';
1
+ export {};
@@ -1,26 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { PageType } from '../constants';
3
2
  import { PageQuestionSchema } from './page-question.schema';
4
3
 
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),
11
- });
12
-
13
- export const WriterDocumentTypePageMetadataSchema = z.object({
14
- type: z.literal(PageType.WRITER_DOCUMENT_TYPE),
15
- writerDocumentTypeId: z.string().uuid(),
16
- });
17
-
18
- export const PageMetadataSchema = z.discriminatedUnion('type', [
19
- WriterToolPageMetadataSchema,
20
- EduTaskSolvingToolPageMetadataSchema,
21
- WriterDocumentTypePageMetadataSchema,
22
- ]);
23
-
24
4
  export const PageSchema = z.object({
25
5
  uuid: z.string().uuid(),
26
6
  metaTitle: z.string().min(3).max(16384),
@@ -29,8 +9,6 @@ export const PageSchema = z.object({
29
9
  subTitle: z.string().min(3).max(16384),
30
10
  seoTextMd: z.string().min(3).max(16384),
31
11
  alias: z.string().min(3).max(16384),
32
- type: z.nativeEnum(PageType),
33
- metadata: PageMetadataSchema,
34
12
  createdAt: z.date(),
35
13
  updatedAt: z.date(),
36
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/multisite",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Multisite API contracts (DTO schemas, routes, constants)",
5
5
  "type": "commonjs",
6
6
  "main": "build/index.js",
@@ -1,6 +0,0 @@
1
- export declare enum PageType {
2
- WRITER_TOOL = "WRITER_TOOL",
3
- EDU_TASK_SOLVING_TOOL = "EDU_TASK_SOLVING_TOOL",
4
- WRITER_DOCUMENT_TYPE = "WRITER_DOCUMENT_TYPE"
5
- }
6
- //# sourceMappingURL=page-type.enum.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-type.enum.d.ts","sourceRoot":"","sources":["../../../../constants/page/enums/page-type.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAChB,WAAW,gBAAgB;IAC3B,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;CAChD"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageType = void 0;
4
- var PageType;
5
- (function (PageType) {
6
- PageType["WRITER_TOOL"] = "WRITER_TOOL";
7
- PageType["EDU_TASK_SOLVING_TOOL"] = "EDU_TASK_SOLVING_TOOL";
8
- PageType["WRITER_DOCUMENT_TYPE"] = "WRITER_DOCUMENT_TYPE";
9
- })(PageType || (exports.PageType = PageType = {}));
@@ -1,5 +0,0 @@
1
- export enum PageType {
2
- WRITER_TOOL = 'WRITER_TOOL',
3
- EDU_TASK_SOLVING_TOOL = 'EDU_TASK_SOLVING_TOOL',
4
- WRITER_DOCUMENT_TYPE = 'WRITER_DOCUMENT_TYPE',
5
- }