@purpleschool/multisite 0.0.17 → 0.0.19

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 (61) hide show
  1. package/api/controller/http/subscription.ts +1 -0
  2. package/api/controller/http/user.ts +7 -0
  3. package/api/routes.ts +14 -0
  4. package/build/api/controller/http/subscription.d.ts +1 -0
  5. package/build/api/controller/http/subscription.d.ts.map +1 -1
  6. package/build/api/controller/http/subscription.js +1 -0
  7. package/build/api/controller/http/user.d.ts +7 -0
  8. package/build/api/controller/http/user.d.ts.map +1 -1
  9. package/build/api/controller/http/user.js +7 -0
  10. package/build/api/routes.d.ts +8 -0
  11. package/build/api/routes.d.ts.map +1 -1
  12. package/build/api/routes.js +8 -0
  13. package/build/commands/page/create-page.command.d.ts +0 -100
  14. package/build/commands/page/create-page.command.d.ts.map +1 -1
  15. package/build/commands/page/find-page-by-alias.command.d.ts +0 -200
  16. package/build/commands/page/find-page-by-alias.command.d.ts.map +1 -1
  17. package/build/commands/page/find-page-by-criteria.command.d.ts +0 -63
  18. package/build/commands/page/find-page-by-criteria.command.d.ts.map +1 -1
  19. package/build/commands/page/find-page-by-criteria.command.js +0 -2
  20. package/build/commands/page/find-page.command.d.ts +0 -141
  21. package/build/commands/page/find-page.command.d.ts.map +1 -1
  22. package/build/commands/page/update-page.command.d.ts +0 -100
  23. package/build/commands/page/update-page.command.d.ts.map +1 -1
  24. package/build/commands/subscription/index.d.ts +1 -0
  25. package/build/commands/subscription/index.d.ts.map +1 -1
  26. package/build/commands/subscription/index.js +1 -0
  27. package/build/commands/subscription/recover-subscription.command.d.ts +14 -0
  28. package/build/commands/subscription/recover-subscription.command.d.ts.map +1 -0
  29. package/build/commands/subscription/recover-subscription.command.js +11 -0
  30. package/build/constants/errors/errors.d.ts +5 -0
  31. package/build/constants/errors/errors.d.ts.map +1 -1
  32. package/build/constants/errors/errors.js +5 -0
  33. package/build/constants/page/index.d.ts +1 -1
  34. package/build/constants/page/index.d.ts.map +1 -1
  35. package/build/constants/page/index.js +0 -15
  36. package/build/models/page.schema.d.ts +0 -129
  37. package/build/models/page.schema.d.ts.map +1 -1
  38. package/build/models/page.schema.js +1 -19
  39. package/build/queries/user/find-users.command.d.ts +83 -0
  40. package/build/queries/user/find-users.command.d.ts.map +1 -0
  41. package/build/queries/user/find-users.command.js +27 -0
  42. package/build/queries/user/get-all-users.command.d.ts +38 -0
  43. package/build/queries/user/get-all-users.command.d.ts.map +1 -0
  44. package/build/queries/user/get-all-users.command.js +16 -0
  45. package/build/queries/user/index.d.ts +2 -0
  46. package/build/queries/user/index.d.ts.map +1 -1
  47. package/build/queries/user/index.js +2 -0
  48. package/commands/page/find-page-by-criteria.command.ts +0 -2
  49. package/commands/subscription/index.ts +1 -0
  50. package/commands/subscription/recover-subscription.command.ts +11 -0
  51. package/constants/errors/errors.ts +5 -0
  52. package/constants/page/index.ts +1 -1
  53. package/models/page.schema.ts +0 -22
  54. package/package.json +1 -1
  55. package/queries/user/find-users.command.ts +29 -0
  56. package/queries/user/get-all-users.command.ts +17 -0
  57. package/queries/user/index.ts +2 -0
  58. package/build/constants/page/enums/page-type.enum.d.ts +0 -6
  59. package/build/constants/page/enums/page-type.enum.d.ts.map +0 -1
  60. package/build/constants/page/enums/page-type.enum.js +0 -9
  61. package/constants/page/enums/page-type.enum.ts +0 -5
@@ -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
  });
@@ -0,0 +1,83 @@
1
+ import { z } from 'zod';
2
+ import { USER_ROLE, USER_STATUS } from '../../constants';
3
+ export declare namespace FindUsersCommand {
4
+ const RequestQuerySchema: z.ZodObject<{
5
+ uuid: z.ZodOptional<z.ZodString>;
6
+ email: z.ZodOptional<z.ZodString>;
7
+ role: z.ZodOptional<z.ZodNativeEnum<typeof USER_ROLE>>;
8
+ status: z.ZodOptional<z.ZodNativeEnum<typeof USER_STATUS>>;
9
+ limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
10
+ offset: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ email?: string | undefined;
13
+ uuid?: string | undefined;
14
+ role?: USER_ROLE | undefined;
15
+ status?: USER_STATUS | undefined;
16
+ limit?: number | undefined;
17
+ offset?: number | undefined;
18
+ }, {
19
+ email?: string | undefined;
20
+ uuid?: string | undefined;
21
+ role?: USER_ROLE | undefined;
22
+ status?: USER_STATUS | undefined;
23
+ limit?: number | undefined;
24
+ offset?: number | undefined;
25
+ }>;
26
+ type RequestQuery = z.infer<typeof RequestQuerySchema>;
27
+ const ResponseItemSchema: z.ZodObject<{
28
+ uuid: z.ZodString;
29
+ email: z.ZodString;
30
+ role: z.ZodNativeEnum<typeof USER_ROLE>;
31
+ siteId: z.ZodString;
32
+ }, "strip", z.ZodTypeAny, {
33
+ email: string;
34
+ uuid: string;
35
+ siteId: string;
36
+ role: USER_ROLE;
37
+ }, {
38
+ email: string;
39
+ uuid: string;
40
+ siteId: string;
41
+ role: USER_ROLE;
42
+ }>;
43
+ const ResponseSchema: z.ZodObject<{
44
+ data: z.ZodArray<z.ZodObject<{
45
+ uuid: z.ZodString;
46
+ email: z.ZodString;
47
+ role: z.ZodNativeEnum<typeof USER_ROLE>;
48
+ siteId: z.ZodString;
49
+ }, "strip", z.ZodTypeAny, {
50
+ email: string;
51
+ uuid: string;
52
+ siteId: string;
53
+ role: USER_ROLE;
54
+ }, {
55
+ email: string;
56
+ uuid: string;
57
+ siteId: string;
58
+ role: USER_ROLE;
59
+ }>, "many">;
60
+ totalPages: z.ZodNumber;
61
+ page: z.ZodNumber;
62
+ }, "strip", z.ZodTypeAny, {
63
+ page: number;
64
+ data: {
65
+ email: string;
66
+ uuid: string;
67
+ siteId: string;
68
+ role: USER_ROLE;
69
+ }[];
70
+ totalPages: number;
71
+ }, {
72
+ page: number;
73
+ data: {
74
+ email: string;
75
+ uuid: string;
76
+ siteId: string;
77
+ role: USER_ROLE;
78
+ }[];
79
+ totalPages: number;
80
+ }>;
81
+ type Response = z.infer<typeof ResponseSchema>;
82
+ }
83
+ //# sourceMappingURL=find-users.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/find-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,yBAAiB,gBAAgB,CAAC;IACvB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;MAO7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,kBAAkB;;;;;;;;;;;;;;;MAK7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindUsersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ var FindUsersCommand;
7
+ (function (FindUsersCommand) {
8
+ FindUsersCommand.RequestQuerySchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid().optional(),
10
+ email: zod_1.z.string().email().optional(),
11
+ role: zod_1.z.nativeEnum(constants_1.USER_ROLE).optional(),
12
+ status: zod_1.z.nativeEnum(constants_1.USER_STATUS).optional(),
13
+ limit: zod_1.z.coerce.number().int().min(1).default(20).optional(),
14
+ offset: zod_1.z.coerce.number().int().min(0).default(0).optional(),
15
+ });
16
+ FindUsersCommand.ResponseItemSchema = zod_1.z.object({
17
+ uuid: zod_1.z.string().uuid(),
18
+ email: zod_1.z.string().email(),
19
+ role: zod_1.z.nativeEnum(constants_1.USER_ROLE),
20
+ siteId: zod_1.z.string().uuid(),
21
+ });
22
+ FindUsersCommand.ResponseSchema = zod_1.z.object({
23
+ data: zod_1.z.array(FindUsersCommand.ResponseItemSchema),
24
+ totalPages: zod_1.z.number().int(),
25
+ page: zod_1.z.number().int(),
26
+ });
27
+ })(FindUsersCommand || (exports.FindUsersCommand = FindUsersCommand = {}));
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import { USER_ROLE } from '../../constants';
3
+ export declare namespace GetAllUsersCommand {
4
+ const ResponseSchema: z.ZodObject<{
5
+ data: z.ZodArray<z.ZodObject<{
6
+ uuid: z.ZodString;
7
+ email: z.ZodString;
8
+ role: z.ZodNativeEnum<typeof USER_ROLE>;
9
+ siteId: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ email: string;
12
+ uuid: string;
13
+ siteId: string;
14
+ role: USER_ROLE;
15
+ }, {
16
+ email: string;
17
+ uuid: string;
18
+ siteId: string;
19
+ role: USER_ROLE;
20
+ }>, "many">;
21
+ }, "strip", z.ZodTypeAny, {
22
+ data: {
23
+ email: string;
24
+ uuid: string;
25
+ siteId: string;
26
+ role: USER_ROLE;
27
+ }[];
28
+ }, {
29
+ data: {
30
+ email: string;
31
+ uuid: string;
32
+ siteId: string;
33
+ role: USER_ROLE;
34
+ }[];
35
+ }>;
36
+ type Response = z.infer<typeof ResponseSchema>;
37
+ }
38
+ //# sourceMappingURL=get-all-users.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-all-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-all-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetAllUsersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ var GetAllUsersCommand;
7
+ (function (GetAllUsersCommand) {
8
+ GetAllUsersCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(zod_1.z.object({
10
+ uuid: zod_1.z.string().uuid(),
11
+ email: zod_1.z.string().email(),
12
+ role: zod_1.z.nativeEnum(constants_1.USER_ROLE),
13
+ siteId: zod_1.z.string().uuid(),
14
+ })),
15
+ });
16
+ })(GetAllUsersCommand || (exports.GetAllUsersCommand = GetAllUsersCommand = {}));
@@ -1,5 +1,7 @@
1
1
  export * from './get-user.command';
2
+ export * from './get-all-users.command';
2
3
  export * from './get-user-balance.command';
3
4
  export * from './get-my-products.command';
4
5
  export * from './get-my-subscriptions.command';
6
+ export * from './find-users.command';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../queries/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../queries/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC"}
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-user.command"), exports);
18
+ __exportStar(require("./get-all-users.command"), exports);
18
19
  __exportStar(require("./get-user-balance.command"), exports);
19
20
  __exportStar(require("./get-my-products.command"), exports);
20
21
  __exportStar(require("./get-my-subscriptions.command"), exports);
22
+ __exportStar(require("./find-users.command"), exports);
@@ -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,3 +1,4 @@
1
1
  export * from './buy-subscription.command';
2
2
  export * from './fast-buy-subscription.command';
3
3
  export * from './cancel-subscription.command';
4
+ export * from './recover-subscription.command';
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace RecoverSubscriptionCommand {
4
+ export const RequestParamSchema = z.object({
5
+ uuidSiteUserToSubscription: z.string().uuid(),
6
+ });
7
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
8
+
9
+ export const ResponseSchema = z.void();
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -216,6 +216,11 @@ export const ERRORS = {
216
216
  code: 'SUBSCRIPTION_006',
217
217
  httpCode: 500,
218
218
  },
219
+ SUBSCRIPTION_RECOVER_ERROR: {
220
+ message: 'Ошибка при восстановлении подписки',
221
+ code: 'SUBSCRIPTION_007',
222
+ httpCode: 500,
223
+ },
219
224
 
220
225
  // ORDER
221
226
  ORDER_NOT_FOUND: {
@@ -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.19",
4
4
  "description": "Multisite API contracts (DTO schemas, routes, constants)",
5
5
  "type": "commonjs",
6
6
  "main": "build/index.js",
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { USER_ROLE, USER_STATUS } from '../../constants';
3
+
4
+ export namespace FindUsersCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ uuid: z.string().uuid().optional(),
7
+ email: z.string().email().optional(),
8
+ role: z.nativeEnum(USER_ROLE).optional(),
9
+ status: z.nativeEnum(USER_STATUS).optional(),
10
+ limit: z.coerce.number().int().min(1).default(20).optional(),
11
+ offset: z.coerce.number().int().min(0).default(0).optional(),
12
+ });
13
+
14
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
15
+
16
+ export const ResponseItemSchema = z.object({
17
+ uuid: z.string().uuid(),
18
+ email: z.string().email(),
19
+ role: z.nativeEnum(USER_ROLE),
20
+ siteId: z.string().uuid(),
21
+ });
22
+
23
+ export const ResponseSchema = z.object({
24
+ data: z.array(ResponseItemSchema),
25
+ totalPages: z.number().int(),
26
+ page: z.number().int(),
27
+ });
28
+ export type Response = z.infer<typeof ResponseSchema>;
29
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { USER_ROLE } from '../../constants';
3
+
4
+ export namespace GetAllUsersCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: z.array(
7
+ z.object({
8
+ uuid: z.string().uuid(),
9
+ email: z.string().email(),
10
+ role: z.nativeEnum(USER_ROLE),
11
+ siteId: z.string().uuid(),
12
+ }),
13
+ ),
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -1,4 +1,6 @@
1
1
  export * from './get-user.command';
2
+ export * from './get-all-users.command';
2
3
  export * from './get-user-balance.command';
3
4
  export * from './get-my-products.command';
4
5
  export * from './get-my-subscriptions.command';
6
+ export * from './find-users.command';
@@ -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
- }