@raclettejs/core 0.1.23 → 0.1.25

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 (102) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/bin/cli.js +2 -2
  3. package/dist/cli.js +136 -155
  4. package/dist/cli.js.map +4 -4
  5. package/dist/index.js +15 -16
  6. package/dist/index.js.map +4 -4
  7. package/package.json +24 -22
  8. package/services/backend/.yarn/install-state.gz +0 -0
  9. package/services/backend/dist/core/eventBus/index.js +7 -0
  10. package/services/backend/dist/core/pluginSystem/configGenerator/index.js +346 -0
  11. package/services/backend/dist/core/sockets/index.js +95 -0
  12. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/events/index.js +31 -0
  13. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/index.js +48 -0
  14. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/routes/index.js +15 -0
  15. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/events/index.js +22 -0
  16. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/index.js +51 -0
  17. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/routes/index.js +19 -0
  18. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/events/index.js +22 -0
  19. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/index.js +48 -0
  20. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/index.js +19 -0
  21. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/events/index.js +31 -0
  22. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/index.js +49 -0
  23. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/routes/index.js +16 -0
  24. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/events/index.js +39 -0
  25. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/index.js +50 -0
  26. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/routes/index.js +19 -0
  27. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/events/index.js +31 -0
  28. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/index.js +51 -0
  29. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/routes/index.js +21 -0
  30. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/events/index.js +31 -0
  31. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/index.js +48 -0
  32. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/routes/index.js +15 -0
  33. package/services/backend/dist/corePlugins/raclette__core/backend/index.js +34 -0
  34. package/services/backend/dist/domains/index.js +11 -0
  35. package/services/backend/dist/domains/system/index.js +11 -0
  36. package/services/backend/dist/domains/system/routes/index.js +17 -0
  37. package/services/backend/dist/helpers/index.js +14 -0
  38. package/services/backend/dist/index.js +3 -0
  39. package/services/backend/dist/modules/authentication/index.js +253 -0
  40. package/services/backend/dist/shared/types/core/index.js +8 -0
  41. package/services/backend/dist/shared/types/dataTypes/index.js +6 -0
  42. package/services/backend/dist/shared/types/index.js +8 -0
  43. package/services/backend/dist/shared/types/plugins/index.js +8 -0
  44. package/services/backend/dist/types/index.js +12 -0
  45. package/services/backend/dist/utils/index.js +2 -0
  46. package/services/backend/package.json +20 -18
  47. package/services/backend/src/core/contracting/contractRegistrar.ts +1 -1
  48. package/services/backend/src/core/pluginSystem/configGenerator/generatorTypes.ts +1 -0
  49. package/services/backend/src/core/pluginSystem/configGenerator/index.ts +2 -2
  50. package/services/backend/src/core/pluginSystem/pluginLoader.ts +99 -44
  51. package/services/backend/src/core/pluginSystem/pluginTypes.ts +1 -0
  52. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/index.ts +2 -0
  53. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.patchOwn.ts +68 -0
  54. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/user.model.ts +1 -1
  55. package/services/backend/src/corePlugins/raclette__core/frontend/generated-config.ts +12 -0
  56. package/services/backend/src/shared/schemas/core/Account.schema.ts +10 -10
  57. package/services/backend/src/shared/schemas/core/Composition.schema.ts +25 -22
  58. package/services/backend/src/shared/schemas/core/CompositionCreate.schema.ts +19 -16
  59. package/services/backend/src/shared/schemas/core/CompositionUpdate.schema.ts +19 -16
  60. package/services/backend/src/shared/schemas/core/InteractionLink.schema.ts +15 -15
  61. package/services/backend/src/shared/schemas/core/InteractionLinkCreate.schema.ts +9 -9
  62. package/services/backend/src/shared/schemas/core/InteractionLinkUpdate.schema.ts +9 -9
  63. package/services/backend/src/shared/schemas/core/Project.schema.ts +28 -6
  64. package/services/backend/src/shared/schemas/core/ProjectCreate.schema.ts +22 -0
  65. package/services/backend/src/shared/schemas/core/ProjectUpdate.schema.ts +25 -0
  66. package/services/backend/src/shared/schemas/core/Tag.schema.ts +11 -9
  67. package/services/backend/src/shared/schemas/core/TagCreate.schema.ts +1 -3
  68. package/services/backend/src/shared/schemas/core/TagUpdate.schema.ts +1 -0
  69. package/services/backend/src/shared/schemas/core/Trigger.schema.ts +3 -3
  70. package/services/backend/src/shared/schemas/core/User.schema.ts +18 -18
  71. package/services/backend/src/shared/schemas/core/UserCreate.schema.ts +9 -9
  72. package/services/backend/src/shared/schemas/core/Widget.schema.ts +5 -5
  73. package/services/backend/src/shared/schemas/core/WidgetLayout.schema.ts +9 -9
  74. package/services/backend/src/shared/types/core/Composition.types.ts +1 -0
  75. package/services/backend/src/shared/types/core/CompositionCreate.types.ts +1 -0
  76. package/services/backend/src/shared/types/core/CompositionUpdate.types.ts +1 -0
  77. package/services/backend/src/shared/types/core/Project.types.ts +4 -0
  78. package/services/backend/src/shared/types/core/ProjectCreate.types.ts +4 -0
  79. package/services/backend/src/shared/types/core/ProjectUpdate.types.ts +4 -1
  80. package/services/backend/src/shared/types/core/Tag.types.ts +1 -1
  81. package/services/backend/src/shared/types/core/TagCreate.types.ts +0 -1
  82. package/services/backend/src/shared/types/core/index.ts +4 -0
  83. package/services/backend/src/shared/types/plugins/index.ts +1 -1
  84. package/services/backend/tsconfig.json +1 -0
  85. package/services/backend/yarn.lock +797 -935
  86. package/services/frontend/.yarn/install-state.gz +0 -0
  87. package/services/frontend/eslint.config.js +9 -0
  88. package/services/frontend/index.html +3 -3
  89. package/services/frontend/package.json +30 -28
  90. package/services/frontend/src/core/setup/plugin-system/discovery/app-plugins.ts +43 -4
  91. package/services/frontend/src/orchestrator/ProductOrchestrator.vue +10 -11
  92. package/services/frontend/src/orchestrator/assets/styles/layers.css +11 -0
  93. package/services/frontend/src/orchestrator/assets/styles/tailwindStyles.css +5 -11
  94. package/services/frontend/src/orchestrator/assets/styles/vuetifyStyles.scss +0 -4
  95. package/services/frontend/src/orchestrator/components/composition/WidgetsLayoutLoader.vue +5 -18
  96. package/services/frontend/src/orchestrator/composables/useWidgets/helperFunctions.ts +54 -5
  97. package/services/frontend/src/orchestrator/helpers/index.ts +1 -0
  98. package/services/frontend/src/orchestrator/helpers/widgetVisuals.ts +71 -0
  99. package/services/frontend/src/orchestrator/setup/vuetify.ts +2 -0
  100. package/services/frontend/src/orchestrator/types/Widgets.ts +5 -1
  101. package/services/frontend/vite.config.ts +24 -10
  102. package/services/frontend/yarn.lock +0 -5224
@@ -25,6 +25,7 @@ export type PluginOptions = {
25
25
  pluginName: string
26
26
  author: string
27
27
  absolutePath: string
28
+ frontendAbsolutePath: string
28
29
  type: PluginType
29
30
  collectionPrefix: string
30
31
  routePrefix: string
@@ -2,6 +2,7 @@ import { PluginFastifyInstance } from "types"
2
2
  import get from "./route.user.get"
3
3
  import getAll from "./route.user.getAll"
4
4
  import patch from "./route.user.patch"
5
+ import patchOwn from "./route.user.patchOwn"
5
6
  import patchLastProject from "./route.user.patchLastProject"
6
7
  import post from "./route.user.post"
7
8
  import remove from "./route.user.remove"
@@ -12,6 +13,7 @@ const registerRoutes = async (fastify: PluginFastifyInstance) => {
12
13
  await fastify.get("/user/all", getAll(fastify))
13
14
  await fastify.get("/user/:_id", get(fastify))
14
15
  await fastify.patch("/user/:_id", patch(fastify))
16
+ await fastify.patch("/user/self", patchOwn(fastify))
15
17
  await fastify.patch("/user/:_id/restore", restore(fastify))
16
18
  await fastify.post("/user", post(fastify))
17
19
  await fastify.delete("/user/:_id", remove(fastify))
@@ -0,0 +1,68 @@
1
+ import type { Static } from "@sinclair/typebox"
2
+ import type { FastifyReply, FastifyRequest } from "fastify"
3
+ import type { PluginFastifyInstance } from "types"
4
+ import { Type } from "@sinclair/typebox"
5
+ import { UnauthorizedError } from "@/utils/errors"
6
+ import { userUpdateSchema } from "../user.schema"
7
+
8
+ type UserBody = Static<typeof userUpdateSchema>
9
+
10
+ export default (fastify: PluginFastifyInstance) => {
11
+ const userService = fastify.custom.userService
12
+
13
+ const handler = async (
14
+ req: FastifyRequest<{
15
+ Params: {}
16
+ Body: UserBody
17
+ }>,
18
+ reply: FastifyReply,
19
+ ) => {
20
+ try {
21
+ if (req.user._id !== req.body._id) {
22
+ throw new UnauthorizedError("not your user")
23
+ }
24
+ // only let the user update non vital fields
25
+ const updateObject = {}
26
+ if (req.body?.email?.length) {
27
+ updateObject.email = req.body.email
28
+ // TODO Creation of the field should be happening in the user.model pre save hook
29
+ updateObject.email_verified = false
30
+ }
31
+ if (req.body?.firstname?.length) {
32
+ updateObject.firstname = req.body.firstname
33
+ }
34
+ if (req.body?.lastname?.length) {
35
+ updateObject.lastname = req.body.lastname
36
+ }
37
+ if (req.body?.password?.length) {
38
+ updateObject.password = req.body.password
39
+ }
40
+ const payloadWithUser = await userService.updateUser(
41
+ fastify,
42
+ req.requestParams,
43
+ req.user._id,
44
+ updateObject,
45
+ )
46
+
47
+ return payloadWithUser
48
+ } catch (error: any) {
49
+ fastify.log.error(error.message)
50
+ return reply.internalServerError(error.message)
51
+ }
52
+ }
53
+
54
+ return {
55
+ handler,
56
+ onRequest: [fastify.authenticate],
57
+ config: {
58
+ type: "dataUpdate",
59
+ broadcastChannels: ["userUpdated"],
60
+ },
61
+ schema: {
62
+ summary: "Update a user",
63
+ description: "Update specific fields of a user profile",
64
+ tags: ["core/user"],
65
+ body: userUpdateSchema,
66
+ },
67
+ }
68
+ }
@@ -2,7 +2,7 @@ import type { IUserMethods, UserDoc } from "./user.schema"
2
2
  import bcrypt from "bcrypt"
3
3
  import { v4 as uuidv4 } from "uuid"
4
4
  import { randomIdGenerator } from "@/helpers"
5
- import { PluginFastifyInstance } from "types"
5
+ import type { PluginFastifyInstance } from "types"
6
6
  import mongoose from "mongoose"
7
7
 
8
8
  export const MODEL_BASENAME = "user"
@@ -315,6 +315,18 @@ export default {
315
315
  }
316
316
  ]
317
317
  },
318
+ updateSelf: {
319
+ target: "/raclette__core/user/self",
320
+ method: "patch",
321
+ storeActionType: "dataUpdate",
322
+ channels: [
323
+ {
324
+ channel: "raclette__core--userUpdated",
325
+ channelKey: "userUpdated",
326
+ prefix: "raclette__core"
327
+ }
328
+ ]
329
+ },
318
330
  updateRestore: {
319
331
  target: (payload) => `/raclette__core/user/${payload._id}/restore`,
320
332
  method: "patch",
@@ -12,6 +12,16 @@ export const AccountSchema = {
12
12
  $id: "#account/base",
13
13
  title: "core/account",
14
14
  type: "object",
15
+ required: [
16
+ "_id",
17
+ "name",
18
+ "active",
19
+ "blocked",
20
+ "tags",
21
+ "isDeleted",
22
+ "createdAt",
23
+ "updatedAt",
24
+ ],
15
25
  properties: {
16
26
  _id: {
17
27
  type: "string",
@@ -63,16 +73,6 @@ export const AccountSchema = {
63
73
  type: "string",
64
74
  },
65
75
  },
66
- required: [
67
- "_id",
68
- "name",
69
- "active",
70
- "blocked",
71
- "tags",
72
- "isDeleted",
73
- "createdAt",
74
- "updatedAt",
75
- ],
76
76
  }
77
77
 
78
78
 
@@ -12,6 +12,19 @@ export const CompositionSchema = {
12
12
  $id: "#composition/base",
13
13
  title: "core/composition",
14
14
  type: "object",
15
+ required: [
16
+ "_id",
17
+ "title",
18
+ "tags",
19
+ "pathname",
20
+ "status",
21
+ "widgetsLayout",
22
+ "author",
23
+ "lastEditor",
24
+ "createdAt",
25
+ "updatedAt",
26
+ "isDeleted",
27
+ ],
15
28
  properties: {
16
29
  _id: {
17
30
  type: "string",
@@ -43,6 +56,9 @@ export const CompositionSchema = {
43
56
  },
44
57
  },
45
58
  },
59
+ slotLayout: {
60
+ type: "string",
61
+ },
46
62
  status: {
47
63
  default: "inProgress",
48
64
  anyOf: [
@@ -67,12 +83,21 @@ export const CompositionSchema = {
67
83
  type: "array",
68
84
  items: {
69
85
  type: "object",
86
+ required: [
87
+ "column",
88
+ "widget",
89
+ ],
70
90
  properties: {
71
91
  column: {
72
92
  type: "number",
73
93
  },
74
94
  widget: {
75
95
  type: "object",
96
+ required: [
97
+ "uuid",
98
+ "name",
99
+ "pluginKey",
100
+ ],
76
101
  properties: {
77
102
  uuid: {
78
103
  type: "string",
@@ -86,17 +111,8 @@ export const CompositionSchema = {
86
111
  config: {},
87
112
  public: {},
88
113
  },
89
- required: [
90
- "uuid",
91
- "name",
92
- "pluginKey",
93
- ],
94
114
  },
95
115
  },
96
- required: [
97
- "column",
98
- "widget",
99
- ],
100
116
  },
101
117
  },
102
118
  },
@@ -119,19 +135,6 @@ export const CompositionSchema = {
119
135
  type: "boolean",
120
136
  },
121
137
  },
122
- required: [
123
- "_id",
124
- "title",
125
- "tags",
126
- "pathname",
127
- "status",
128
- "widgetsLayout",
129
- "author",
130
- "lastEditor",
131
- "createdAt",
132
- "updatedAt",
133
- "isDeleted",
134
- ],
135
138
  }
136
139
 
137
140
 
@@ -12,6 +12,13 @@ export const CompositionCreateSchema = {
12
12
  $id: "#composition/create",
13
13
  title: "core/composition-create",
14
14
  type: "object",
15
+ required: [
16
+ "title",
17
+ "tags",
18
+ "pathname",
19
+ "status",
20
+ "widgetsLayout",
21
+ ],
15
22
  properties: {
16
23
  title: {
17
24
  minLength: 1,
@@ -40,6 +47,9 @@ export const CompositionCreateSchema = {
40
47
  },
41
48
  },
42
49
  },
50
+ slotLayout: {
51
+ type: "string",
52
+ },
43
53
  status: {
44
54
  default: "inProgress",
45
55
  anyOf: [
@@ -64,12 +74,21 @@ export const CompositionCreateSchema = {
64
74
  type: "array",
65
75
  items: {
66
76
  type: "object",
77
+ required: [
78
+ "column",
79
+ "widget",
80
+ ],
67
81
  properties: {
68
82
  column: {
69
83
  type: "number",
70
84
  },
71
85
  widget: {
72
86
  type: "object",
87
+ required: [
88
+ "uuid",
89
+ "name",
90
+ "pluginKey",
91
+ ],
73
92
  properties: {
74
93
  uuid: {
75
94
  type: "string",
@@ -83,28 +102,12 @@ export const CompositionCreateSchema = {
83
102
  config: {},
84
103
  public: {},
85
104
  },
86
- required: [
87
- "uuid",
88
- "name",
89
- "pluginKey",
90
- ],
91
105
  },
92
106
  },
93
- required: [
94
- "column",
95
- "widget",
96
- ],
97
107
  },
98
108
  },
99
109
  },
100
110
  },
101
- required: [
102
- "title",
103
- "tags",
104
- "pathname",
105
- "status",
106
- "widgetsLayout",
107
- ],
108
111
  }
109
112
 
110
113
 
@@ -12,6 +12,13 @@ export const CompositionUpdateSchema = {
12
12
  $id: "#composition/update",
13
13
  title: "core/composition-update",
14
14
  type: "object",
15
+ required: [
16
+ "title",
17
+ "tags",
18
+ "pathname",
19
+ "status",
20
+ "widgetsLayout",
21
+ ],
15
22
  properties: {
16
23
  title: {
17
24
  minLength: 1,
@@ -40,6 +47,9 @@ export const CompositionUpdateSchema = {
40
47
  },
41
48
  },
42
49
  },
50
+ slotLayout: {
51
+ type: "string",
52
+ },
43
53
  status: {
44
54
  default: "inProgress",
45
55
  anyOf: [
@@ -64,12 +74,21 @@ export const CompositionUpdateSchema = {
64
74
  type: "array",
65
75
  items: {
66
76
  type: "object",
77
+ required: [
78
+ "column",
79
+ "widget",
80
+ ],
67
81
  properties: {
68
82
  column: {
69
83
  type: "number",
70
84
  },
71
85
  widget: {
72
86
  type: "object",
87
+ required: [
88
+ "uuid",
89
+ "name",
90
+ "pluginKey",
91
+ ],
73
92
  properties: {
74
93
  uuid: {
75
94
  type: "string",
@@ -83,28 +102,12 @@ export const CompositionUpdateSchema = {
83
102
  config: {},
84
103
  public: {},
85
104
  },
86
- required: [
87
- "uuid",
88
- "name",
89
- "pluginKey",
90
- ],
91
105
  },
92
106
  },
93
- required: [
94
- "column",
95
- "widget",
96
- ],
97
107
  },
98
108
  },
99
109
  },
100
110
  },
101
- required: [
102
- "title",
103
- "tags",
104
- "pathname",
105
- "status",
106
- "widgetsLayout",
107
- ],
108
111
  }
109
112
 
110
113
 
@@ -12,6 +12,18 @@ export const InteractionLinkSchema = {
12
12
  $id: "#interactionLink/base",
13
13
  title: "core/interactionLink",
14
14
  type: "object",
15
+ required: [
16
+ "_id",
17
+ "composition",
18
+ "slotType",
19
+ "triggers",
20
+ "tags",
21
+ "author",
22
+ "lastEditor",
23
+ "createdAt",
24
+ "updatedAt",
25
+ "isDeleted",
26
+ ],
15
27
  properties: {
16
28
  _id: {
17
29
  type: "string",
@@ -29,6 +41,9 @@ export const InteractionLinkSchema = {
29
41
  $id: "#trigger/base",
30
42
  title: "core/trigger",
31
43
  type: "object",
44
+ required: [
45
+ "type",
46
+ ],
32
47
  properties: {
33
48
  type: {
34
49
  type: "string",
@@ -40,9 +55,6 @@ export const InteractionLinkSchema = {
40
55
  },
41
56
  },
42
57
  },
43
- required: [
44
- "type",
45
- ],
46
58
  },
47
59
  },
48
60
  queryParameters: {
@@ -84,18 +96,6 @@ export const InteractionLinkSchema = {
84
96
  type: "boolean",
85
97
  },
86
98
  },
87
- required: [
88
- "_id",
89
- "composition",
90
- "slotType",
91
- "triggers",
92
- "tags",
93
- "author",
94
- "lastEditor",
95
- "createdAt",
96
- "updatedAt",
97
- "isDeleted",
98
- ],
99
99
  }
100
100
 
101
101
 
@@ -12,6 +12,12 @@ export const InteractionLinkCreateSchema = {
12
12
  $id: "#interactionLink/create",
13
13
  title: "core/interactionLink-create",
14
14
  type: "object",
15
+ required: [
16
+ "composition",
17
+ "slotType",
18
+ "triggers",
19
+ "tags",
20
+ ],
15
21
  properties: {
16
22
  composition: {
17
23
  type: "string",
@@ -26,6 +32,9 @@ export const InteractionLinkCreateSchema = {
26
32
  $id: "#trigger/base",
27
33
  title: "core/trigger",
28
34
  type: "object",
35
+ required: [
36
+ "type",
37
+ ],
29
38
  properties: {
30
39
  type: {
31
40
  type: "string",
@@ -37,9 +46,6 @@ export const InteractionLinkCreateSchema = {
37
46
  },
38
47
  },
39
48
  },
40
- required: [
41
- "type",
42
- ],
43
49
  },
44
50
  },
45
51
  queryParameters: {
@@ -63,12 +69,6 @@ export const InteractionLinkCreateSchema = {
63
69
  type: "boolean",
64
70
  },
65
71
  },
66
- required: [
67
- "composition",
68
- "slotType",
69
- "triggers",
70
- "tags",
71
- ],
72
72
  }
73
73
 
74
74
 
@@ -12,6 +12,12 @@ export const InteractionLinkUpdateSchema = {
12
12
  $id: "#interactionLink/update",
13
13
  title: "core/interactionLink-update",
14
14
  type: "object",
15
+ required: [
16
+ "composition",
17
+ "slotType",
18
+ "triggers",
19
+ "tags",
20
+ ],
15
21
  properties: {
16
22
  composition: {
17
23
  type: "string",
@@ -26,6 +32,9 @@ export const InteractionLinkUpdateSchema = {
26
32
  $id: "#trigger/base",
27
33
  title: "core/trigger",
28
34
  type: "object",
35
+ required: [
36
+ "type",
37
+ ],
29
38
  properties: {
30
39
  type: {
31
40
  type: "string",
@@ -37,9 +46,6 @@ export const InteractionLinkUpdateSchema = {
37
46
  },
38
47
  },
39
48
  },
40
- required: [
41
- "type",
42
- ],
43
49
  },
44
50
  },
45
51
  queryParameters: {
@@ -63,12 +69,6 @@ export const InteractionLinkUpdateSchema = {
63
69
  type: "boolean",
64
70
  },
65
71
  },
66
- required: [
67
- "composition",
68
- "slotType",
69
- "triggers",
70
- "tags",
71
- ],
72
72
  }
73
73
 
74
74
 
@@ -12,6 +12,12 @@ export const ProjectSchema = {
12
12
  $id: "#project/base",
13
13
  title: "core/project",
14
14
  type: "object",
15
+ required: [
16
+ "_id",
17
+ "isDeleted",
18
+ "createdAt",
19
+ "updatedAt",
20
+ ],
15
21
  properties: {
16
22
  _id: {
17
23
  type: "string",
@@ -38,6 +44,28 @@ export const ProjectSchema = {
38
44
  default: false,
39
45
  type: "boolean",
40
46
  },
47
+ config: {
48
+ $id: "#project/config",
49
+ title: "core/project-config",
50
+ type: "object",
51
+ required: [
52
+ "tags",
53
+ "railPageNavigation",
54
+ ],
55
+ properties: {
56
+ tags: {
57
+ default: [],
58
+ type: "array",
59
+ items: {
60
+ type: "string",
61
+ },
62
+ },
63
+ railPageNavigation: {
64
+ default: false,
65
+ type: "boolean",
66
+ },
67
+ },
68
+ },
41
69
  isDeleted: {
42
70
  default: false,
43
71
  type: "boolean",
@@ -51,12 +79,6 @@ export const ProjectSchema = {
51
79
  type: "string",
52
80
  },
53
81
  },
54
- required: [
55
- "_id",
56
- "isDeleted",
57
- "createdAt",
58
- "updatedAt",
59
- ],
60
82
  }
61
83
 
62
84
 
@@ -38,6 +38,28 @@ export const ProjectCreateSchema = {
38
38
  default: false,
39
39
  type: "boolean",
40
40
  },
41
+ config: {
42
+ $id: "#project/config",
43
+ title: "core/project-config",
44
+ type: "object",
45
+ required: [
46
+ "tags",
47
+ "railPageNavigation",
48
+ ],
49
+ properties: {
50
+ tags: {
51
+ default: [],
52
+ type: "array",
53
+ items: {
54
+ type: "string",
55
+ },
56
+ },
57
+ railPageNavigation: {
58
+ default: false,
59
+ type: "boolean",
60
+ },
61
+ },
62
+ },
41
63
  },
42
64
  required: [],
43
65
  }
@@ -21,9 +21,11 @@ export const ProjectUpdateSchema = {
21
21
  type: "string",
22
22
  },
23
23
  account: {
24
+ default: null,
24
25
  type: "string",
25
26
  },
26
27
  tags: {
28
+ default: [],
27
29
  type: "array",
28
30
  items: {
29
31
  type: "string",
@@ -33,8 +35,31 @@ export const ProjectUpdateSchema = {
33
35
  type: "string",
34
36
  },
35
37
  isDefault: {
38
+ default: false,
36
39
  type: "boolean",
37
40
  },
41
+ config: {
42
+ $id: "#project/config",
43
+ title: "core/project-config",
44
+ type: "object",
45
+ required: [
46
+ "tags",
47
+ "railPageNavigation",
48
+ ],
49
+ properties: {
50
+ tags: {
51
+ default: [],
52
+ type: "array",
53
+ items: {
54
+ type: "string",
55
+ },
56
+ },
57
+ railPageNavigation: {
58
+ default: false,
59
+ type: "boolean",
60
+ },
61
+ },
62
+ },
38
63
  },
39
64
  required: [],
40
65
  }