@things-factory/board-service 8.0.0 → 9.0.0-beta.3
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/dist-server/controllers/headless-pdf-to-image.js +7 -2
- package/dist-server/controllers/headless-pdf-to-image.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/views/internal-board-full-feature-view.html +1 -1
- package/server/constants/error-code.ts +0 -2
- package/server/controllers/analyzer/analyze-integration.ts +0 -142
- package/server/controllers/fonts.ts +0 -83
- package/server/controllers/headless-model.ts +0 -53
- package/server/controllers/headless-pdf-to-image.ts +0 -103
- package/server/controllers/headless-playlist.ts +0 -71
- package/server/controllers/headless-pool-for-board.ts +0 -71
- package/server/controllers/headless-pool-for-label.ts +0 -141
- package/server/controllers/index.ts +0 -11
- package/server/controllers/label-command.ts +0 -62
- package/server/controllers/pdf.ts +0 -132
- package/server/controllers/screenshot.ts +0 -127
- package/server/controllers/thumbnail.ts +0 -18
- package/server/errors/index.ts +0 -1
- package/server/errors/license-error.ts +0 -21
- package/server/index.ts +0 -36
- package/server/migrations/1556862253000-SeedGroup.ts +0 -51
- package/server/migrations/index.ts +0 -9
- package/server/routers/internal-board-view-router.ts +0 -33
- package/server/routers/standalone-board-service-router.ts +0 -326
- package/server/routes.ts +0 -25
- package/server/service/analysis/analysis-query.ts +0 -13
- package/server/service/analysis/index.ts +0 -3
- package/server/service/board/board-history.ts +0 -137
- package/server/service/board/board-mutation.ts +0 -446
- package/server/service/board/board-query.ts +0 -180
- package/server/service/board/board-subscription.ts +0 -43
- package/server/service/board/board-type.ts +0 -58
- package/server/service/board/board.ts +0 -125
- package/server/service/board/event-subscriber.ts +0 -68
- package/server/service/board/index.ts +0 -10
- package/server/service/board-favorite/board-favorite-query.ts +0 -53
- package/server/service/board-favorite/board-favorite-type.ts +0 -18
- package/server/service/board-favorite/index.ts +0 -4
- package/server/service/board-template/board-template-mutation.ts +0 -161
- package/server/service/board-template/board-template-query.ts +0 -121
- package/server/service/board-template/board-template-type.ts +0 -53
- package/server/service/board-template/board-template.ts +0 -114
- package/server/service/board-template/index.ts +0 -7
- package/server/service/group/group-mutation.ts +0 -82
- package/server/service/group/group-query.ts +0 -58
- package/server/service/group/group-type.ts +0 -30
- package/server/service/group/group.ts +0 -69
- package/server/service/group/index.ts +0 -6
- package/server/service/index.ts +0 -56
- package/server/service/permission/domain-permission-subscriber.ts +0 -27
- package/server/service/permission/index.ts +0 -3
- package/server/service/play-group/event-subscriber.ts +0 -58
- package/server/service/play-group/index.ts +0 -9
- package/server/service/play-group/play-group-mutation.ts +0 -148
- package/server/service/play-group/play-group-query.ts +0 -92
- package/server/service/play-group/play-group-subscription.ts +0 -43
- package/server/service/play-group/play-group-type.ts +0 -30
- package/server/service/play-group/play-group.ts +0 -74
- package/server/service/theme/index.ts +0 -7
- package/server/service/theme/theme-mutation.ts +0 -128
- package/server/service/theme/theme-query.ts +0 -48
- package/server/service/theme/theme-type.ts +0 -55
- package/server/service/theme/theme.ts +0 -97
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import contentDisposition from 'content-disposition'
|
|
2
|
-
import Router from 'koa-router'
|
|
3
|
-
|
|
4
|
-
import { User, setAccessTokenCookie } from '@things-factory/auth-base'
|
|
5
|
-
import { getRepository } from '@things-factory/shell'
|
|
6
|
-
|
|
7
|
-
import { fonts } from '../controllers/fonts'
|
|
8
|
-
import { headlessModel } from '../controllers/headless-model'
|
|
9
|
-
import { headlessPlaylist } from '../controllers/headless-playlist'
|
|
10
|
-
import { labelcommand } from '../controllers/label-command'
|
|
11
|
-
import { pdf } from '../controllers/pdf'
|
|
12
|
-
import { screenshot } from '../controllers/screenshot'
|
|
13
|
-
import { Board } from '../service/board/board'
|
|
14
|
-
import { BoardTemplate } from '../service/board-template/board-template'
|
|
15
|
-
|
|
16
|
-
export const standaloneBoardServiceRouter = new Router()
|
|
17
|
-
|
|
18
|
-
function parseQuery(query) {
|
|
19
|
-
for (const key in query) {
|
|
20
|
-
if (query.hasOwnProperty(key)) {
|
|
21
|
-
try {
|
|
22
|
-
query[key] = JSON.parse(query[key])
|
|
23
|
-
} catch (error) {
|
|
24
|
-
// do nothing
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return query
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// for board headless-full
|
|
33
|
-
standaloneBoardServiceRouter.get('/headless-full/:id', async (context, next) => {
|
|
34
|
-
const { domain, user } = context.state
|
|
35
|
-
|
|
36
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
37
|
-
context.status = 403
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const { id } = context.params
|
|
42
|
-
|
|
43
|
-
const { model, base } = await headlessModel({ domain, id })
|
|
44
|
-
const [fontsToUse, fontStyles] = await fonts(domain)
|
|
45
|
-
|
|
46
|
-
model.fonts = fontsToUse
|
|
47
|
-
model.fontStyles = fontStyles
|
|
48
|
-
|
|
49
|
-
setAccessTokenCookie(context, await user.sign({ domain }))
|
|
50
|
-
|
|
51
|
-
const data = parseQuery({ ...context.query })
|
|
52
|
-
delete data.access_token
|
|
53
|
-
|
|
54
|
-
await context.render('internal-board-full-feature-view', { id, model, data, base })
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
// for board headless-full-by-name
|
|
58
|
-
standaloneBoardServiceRouter.get('/headless-full-by-name/:name', async (context, next) => {
|
|
59
|
-
const { domain, user } = context.state
|
|
60
|
-
|
|
61
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
62
|
-
context.status = 403
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const { name } = context.params
|
|
67
|
-
|
|
68
|
-
const { model, base, board } = await headlessModel({ domain, name })
|
|
69
|
-
const [fontsToUse, fontStyles] = await fonts(domain)
|
|
70
|
-
|
|
71
|
-
model.fonts = fontsToUse
|
|
72
|
-
model.fontStyles = fontStyles
|
|
73
|
-
|
|
74
|
-
setAccessTokenCookie(context, await user.sign({ domain }))
|
|
75
|
-
|
|
76
|
-
const data = parseQuery({ ...context.query })
|
|
77
|
-
delete data.access_token
|
|
78
|
-
|
|
79
|
-
await context.render('internal-board-full-feature-view', { id: board?.id, model, data, base })
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
// for board headless
|
|
83
|
-
standaloneBoardServiceRouter.get('/headless/:id', async (context, next) => {
|
|
84
|
-
const { domain, user } = context.state
|
|
85
|
-
|
|
86
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
87
|
-
context.status = 403
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const { id } = context.params
|
|
92
|
-
|
|
93
|
-
const { model, base } = await headlessModel({ domain, id })
|
|
94
|
-
const [fontsToUse, fontStyles] = await fonts(domain)
|
|
95
|
-
|
|
96
|
-
model.fonts = fontsToUse
|
|
97
|
-
model.fontStyles = fontStyles
|
|
98
|
-
|
|
99
|
-
setAccessTokenCookie(context, await user.sign({ domain }))
|
|
100
|
-
|
|
101
|
-
const data = parseQuery({ ...context.query })
|
|
102
|
-
delete data.access_token
|
|
103
|
-
|
|
104
|
-
await context.render('internal-board-service-view', { id, model, data, base })
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
// for board headless by name
|
|
108
|
-
standaloneBoardServiceRouter.get('/headless-by-name/:name', async (context, next) => {
|
|
109
|
-
const { domain, user } = context.state
|
|
110
|
-
|
|
111
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
112
|
-
context.status = 403
|
|
113
|
-
return
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const { name } = context.params
|
|
117
|
-
|
|
118
|
-
const { model, base, board } = await headlessModel({ domain, name })
|
|
119
|
-
const [fontsToUse, fontStyles] = await fonts(domain)
|
|
120
|
-
|
|
121
|
-
model.fonts = fontsToUse
|
|
122
|
-
model.fontStyles = fontStyles
|
|
123
|
-
|
|
124
|
-
setAccessTokenCookie(context, await user.sign({ domain }))
|
|
125
|
-
|
|
126
|
-
const data = parseQuery({ ...context.query })
|
|
127
|
-
delete data.access_token
|
|
128
|
-
|
|
129
|
-
await context.render('internal-board-service-view', { id: board?.id, model, data, base })
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
// for board player
|
|
133
|
-
standaloneBoardServiceRouter.get('/headless-player/:id', async (context, next) => {
|
|
134
|
-
const { domain, user } = context.state
|
|
135
|
-
|
|
136
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
137
|
-
context.status = 403
|
|
138
|
-
return
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const { id } = context.params
|
|
142
|
-
|
|
143
|
-
const { playGroup, base } = await headlessPlaylist({ domain, id })
|
|
144
|
-
const [fontsToUse, fontStyles] = await fonts(domain)
|
|
145
|
-
|
|
146
|
-
setAccessTokenCookie(context, await user.sign({ domain }))
|
|
147
|
-
|
|
148
|
-
const data = parseQuery({ ...context.query })
|
|
149
|
-
delete data.access_token
|
|
150
|
-
|
|
151
|
-
await context.render('internal-board-player-view', {
|
|
152
|
-
id,
|
|
153
|
-
model: {
|
|
154
|
-
boards: playGroup?.boards,
|
|
155
|
-
fonts: fontsToUse,
|
|
156
|
-
fontStyles: fontStyles
|
|
157
|
-
},
|
|
158
|
-
data,
|
|
159
|
-
base
|
|
160
|
-
})
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
// for board player by name
|
|
164
|
-
standaloneBoardServiceRouter.get('/headless-player-by-name/:name', async (context, next) => {
|
|
165
|
-
const { domain, user } = context.state
|
|
166
|
-
|
|
167
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
168
|
-
context.status = 403
|
|
169
|
-
return
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const { name } = context.params
|
|
173
|
-
|
|
174
|
-
const { playGroup, base } = await headlessPlaylist({ domain, name })
|
|
175
|
-
const [fontsToUse, fontStyles] = await fonts(domain)
|
|
176
|
-
|
|
177
|
-
setAccessTokenCookie(context, await user.sign({ domain }))
|
|
178
|
-
|
|
179
|
-
const data = parseQuery({ ...context.query })
|
|
180
|
-
delete data.access_token
|
|
181
|
-
|
|
182
|
-
await context.render('internal-board-player-view', {
|
|
183
|
-
id: playGroup?.id,
|
|
184
|
-
model: {
|
|
185
|
-
boards: playGroup?.boards,
|
|
186
|
-
fonts: fontsToUse,
|
|
187
|
-
fontStyles: fontStyles
|
|
188
|
-
},
|
|
189
|
-
data,
|
|
190
|
-
base
|
|
191
|
-
})
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
// for board thumbnail
|
|
195
|
-
standaloneBoardServiceRouter.get('/thumbnail/:id', async (context, next) => {
|
|
196
|
-
const { domain, user } = context.state
|
|
197
|
-
|
|
198
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
199
|
-
context.status = 403
|
|
200
|
-
return
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const { id } = context.params
|
|
204
|
-
|
|
205
|
-
const { name, thumbnail } = (await getRepository(Board).findOneBy({ domain: { id: domain.id }, id })) || {}
|
|
206
|
-
|
|
207
|
-
if (thumbnail) {
|
|
208
|
-
const index = thumbnail.indexOf(';base64,')
|
|
209
|
-
const base64 = thumbnail.substring(index + 8)
|
|
210
|
-
const buffer = Buffer.from(base64, 'base64')
|
|
211
|
-
|
|
212
|
-
context.type = 'image/png'
|
|
213
|
-
context.set('Content-Disposition', contentDisposition(`thumbnail-${name}.png`))
|
|
214
|
-
context.body = buffer
|
|
215
|
-
} else {
|
|
216
|
-
context.throw(404, 'thumbnail not found')
|
|
217
|
-
}
|
|
218
|
-
})
|
|
219
|
-
|
|
220
|
-
// for board-template thumbnail
|
|
221
|
-
standaloneBoardServiceRouter.get('/board-template-thumbnail/:id', async (context, next) => {
|
|
222
|
-
const { domain, user } = context.state
|
|
223
|
-
|
|
224
|
-
if (!(await User.hasPrivilege('query', 'board-template', domain, user))) {
|
|
225
|
-
context.status = 403
|
|
226
|
-
return
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const { id } = context.params
|
|
230
|
-
|
|
231
|
-
const { name, thumbnail } = (await getRepository(BoardTemplate).findOneBy({ domain: { id: domain.id }, id })) || {}
|
|
232
|
-
|
|
233
|
-
if (thumbnail) {
|
|
234
|
-
const index = thumbnail.indexOf(';base64,')
|
|
235
|
-
const base64 = thumbnail.substring(index + 8)
|
|
236
|
-
const buffer = Buffer.from(base64, 'base64')
|
|
237
|
-
|
|
238
|
-
context.type = 'image/png'
|
|
239
|
-
context.set('Content-Disposition', contentDisposition(`thumbnail-${name}.png`))
|
|
240
|
-
context.body = buffer
|
|
241
|
-
} else {
|
|
242
|
-
context.throw(404, 'thumbnail not found')
|
|
243
|
-
}
|
|
244
|
-
})
|
|
245
|
-
|
|
246
|
-
// for webpage scrap
|
|
247
|
-
standaloneBoardServiceRouter.get('/screenshot/:id', async (context, next) => {
|
|
248
|
-
const { domain, user } = context.state
|
|
249
|
-
|
|
250
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
251
|
-
context.status = 403
|
|
252
|
-
return
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
const { id } = context.params
|
|
256
|
-
|
|
257
|
-
const { model, board } = await headlessModel({ domain, id })
|
|
258
|
-
|
|
259
|
-
const data = parseQuery({ ...context.query })
|
|
260
|
-
delete data.access_token
|
|
261
|
-
|
|
262
|
-
context.type = 'image/png'
|
|
263
|
-
context.set('Content-Disposition', contentDisposition(`${board.name}.png`))
|
|
264
|
-
context.body = await screenshot({ id, model, data, options: { encoding: 'binary', type: 'png' }, context })
|
|
265
|
-
})
|
|
266
|
-
|
|
267
|
-
// for webpage scrap
|
|
268
|
-
standaloneBoardServiceRouter.get('/board/pdf/:id', async (context, next) => {
|
|
269
|
-
const { domain, user } = context.state
|
|
270
|
-
|
|
271
|
-
if (!(await User.hasPrivilege('query', 'board', domain, user))) {
|
|
272
|
-
context.status = 403
|
|
273
|
-
return
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
const { id } = context.params
|
|
277
|
-
|
|
278
|
-
const { model, board } = await headlessModel({ domain, id })
|
|
279
|
-
|
|
280
|
-
const data = parseQuery({ ...context.query })
|
|
281
|
-
delete data.access_token
|
|
282
|
-
|
|
283
|
-
const result = await pdf({
|
|
284
|
-
id,
|
|
285
|
-
model,
|
|
286
|
-
data,
|
|
287
|
-
options: {
|
|
288
|
-
format: 'A4'
|
|
289
|
-
},
|
|
290
|
-
context
|
|
291
|
-
})
|
|
292
|
-
|
|
293
|
-
context.type = 'application/pdf'
|
|
294
|
-
context.set('Content-Disposition', contentDisposition(`${board.name}.pdf`))
|
|
295
|
-
context.body = result
|
|
296
|
-
})
|
|
297
|
-
|
|
298
|
-
// for webpage scrap => zpl image print(grf format) command for released version board
|
|
299
|
-
standaloneBoardServiceRouter.get('/label-command/:id', async (context, next) => {
|
|
300
|
-
const { id } = context.params
|
|
301
|
-
|
|
302
|
-
const data = context.query
|
|
303
|
-
delete data.access_token
|
|
304
|
-
|
|
305
|
-
const orientation = data && data.orientation
|
|
306
|
-
const mirror = data && data.mirror
|
|
307
|
-
const upsideDown = data && data.upsideDown
|
|
308
|
-
|
|
309
|
-
context.type = 'text/plain'
|
|
310
|
-
context.body = await labelcommand({ id, data, orientation, mirror, upsideDown, context } as any)
|
|
311
|
-
})
|
|
312
|
-
|
|
313
|
-
// for webpage scrap => zpl image print(grf format) command for draft version board
|
|
314
|
-
standaloneBoardServiceRouter.get('/label-command-draft/:id', async (context, next) => {
|
|
315
|
-
const { id } = context.params
|
|
316
|
-
|
|
317
|
-
const data = context.query
|
|
318
|
-
delete data.access_token
|
|
319
|
-
|
|
320
|
-
const orientation = data && data.orientation
|
|
321
|
-
const mirror = data && data.mirror
|
|
322
|
-
const upsideDown = data && data.upsideDown
|
|
323
|
-
|
|
324
|
-
context.type = 'text/plain'
|
|
325
|
-
context.body = await labelcommand({ id, data, orientation, mirror, upsideDown, context, draft: true } as any)
|
|
326
|
-
})
|
package/server/routes.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { config } from '@things-factory/env'
|
|
2
|
-
import { getHeadlessPool as getHeadlessPoolForBoard } from './controllers/headless-pool-for-board'
|
|
3
|
-
import { getHeadlessPool as getHeadlessPoolForLabel } from './controllers/headless-pool-for-label'
|
|
4
|
-
import { internalBoardViewRouter } from './routers/internal-board-view-router'
|
|
5
|
-
import { standaloneBoardServiceRouter } from './routers/standalone-board-service-router'
|
|
6
|
-
|
|
7
|
-
const isPathBaseDomain = !config.get('subdomain') && !config.get('useVirtualHostBasedDomain')
|
|
8
|
-
|
|
9
|
-
process.on('bootstrap-module-global-public-route' as any, (app, domainGlobalPublicRouter) => {
|
|
10
|
-
getHeadlessPoolForLabel()
|
|
11
|
-
getHeadlessPoolForBoard()
|
|
12
|
-
domainGlobalPublicRouter.use('', internalBoardViewRouter.routes(), internalBoardViewRouter.allowedMethods())
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
process.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {
|
|
16
|
-
if (isPathBaseDomain) {
|
|
17
|
-
domainPrivateRouter.use(
|
|
18
|
-
'/domain/:domain',
|
|
19
|
-
standaloneBoardServiceRouter.routes(),
|
|
20
|
-
standaloneBoardServiceRouter.allowedMethods()
|
|
21
|
-
)
|
|
22
|
-
} else {
|
|
23
|
-
domainPrivateRouter.use('', standaloneBoardServiceRouter.routes(), standaloneBoardServiceRouter.allowedMethods())
|
|
24
|
-
}
|
|
25
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Resolver, Query, Ctx } from 'type-graphql'
|
|
2
|
-
import { ScalarObject } from '@things-factory/shell'
|
|
3
|
-
import { analyzeBoardIntegration } from '../../controllers/analyzer/analyze-integration'
|
|
4
|
-
|
|
5
|
-
@Resolver()
|
|
6
|
-
export class IntegrationAnalysisQuery {
|
|
7
|
-
@Query(returns => ScalarObject, { description: 'To fetch integration Analyses' })
|
|
8
|
-
async integrationAnalysis(@Ctx() context: ResolverContext): Promise<any> {
|
|
9
|
-
const { domain } = context.state
|
|
10
|
-
|
|
11
|
-
return await analyzeBoardIntegration(domain)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { Field, ID, ObjectType } from 'type-graphql'
|
|
2
|
-
import { Column, Entity, Index, ManyToOne, ManyToMany, PrimaryGeneratedColumn, RelationId } from 'typeorm'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
HistoryActionColumn,
|
|
6
|
-
HistoryActionType,
|
|
7
|
-
HistoryEntityInterface,
|
|
8
|
-
HistoryOriginalIdColumn
|
|
9
|
-
} from '@operato/typeorm-history'
|
|
10
|
-
import { User } from '@things-factory/auth-base'
|
|
11
|
-
import { Domain } from '@things-factory/shell'
|
|
12
|
-
import { config } from '@things-factory/env'
|
|
13
|
-
|
|
14
|
-
import { Board } from './board'
|
|
15
|
-
import { Group } from '../group/group'
|
|
16
|
-
import { PlayGroup } from '../play-group/play-group'
|
|
17
|
-
|
|
18
|
-
const ORMCONFIG = config.get('ormconfig', {})
|
|
19
|
-
const DATABASE_TYPE = ORMCONFIG.type
|
|
20
|
-
|
|
21
|
-
@Entity()
|
|
22
|
-
@Index('ix_board_history_0', (boardHistory: BoardHistory) => [boardHistory.originalId, boardHistory.version], {
|
|
23
|
-
unique: true
|
|
24
|
-
})
|
|
25
|
-
@ObjectType({ description: 'History Entity of Board' })
|
|
26
|
-
export class BoardHistory implements HistoryEntityInterface<Board> {
|
|
27
|
-
@PrimaryGeneratedColumn('uuid')
|
|
28
|
-
@Field(type => ID)
|
|
29
|
-
readonly id: string
|
|
30
|
-
|
|
31
|
-
@Column({ nullable: true, default: 1 })
|
|
32
|
-
@Field({ nullable: true })
|
|
33
|
-
version?: number = 1
|
|
34
|
-
|
|
35
|
-
@ManyToOne(type => Domain)
|
|
36
|
-
@Field(type => Domain, { nullable: true })
|
|
37
|
-
domain?: Domain
|
|
38
|
-
|
|
39
|
-
@RelationId((board: Board) => board.domain)
|
|
40
|
-
domainId?: string
|
|
41
|
-
|
|
42
|
-
@Column()
|
|
43
|
-
@Field()
|
|
44
|
-
name?: string
|
|
45
|
-
|
|
46
|
-
@Column({ nullable: true })
|
|
47
|
-
@Field({ nullable: true })
|
|
48
|
-
description?: string
|
|
49
|
-
|
|
50
|
-
@Column({
|
|
51
|
-
nullable: true,
|
|
52
|
-
type:
|
|
53
|
-
DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
54
|
-
? 'longtext'
|
|
55
|
-
: DATABASE_TYPE == 'oracle'
|
|
56
|
-
? 'clob'
|
|
57
|
-
: DATABASE_TYPE == 'mssql'
|
|
58
|
-
? 'nvarchar'
|
|
59
|
-
: 'varchar',
|
|
60
|
-
length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
|
|
61
|
-
})
|
|
62
|
-
@Field({ nullable: true })
|
|
63
|
-
model?: string
|
|
64
|
-
|
|
65
|
-
@Column({
|
|
66
|
-
nullable: true,
|
|
67
|
-
type:
|
|
68
|
-
DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
69
|
-
? 'longtext'
|
|
70
|
-
: DATABASE_TYPE == 'oracle'
|
|
71
|
-
? 'clob'
|
|
72
|
-
: DATABASE_TYPE == 'mssql'
|
|
73
|
-
? 'nvarchar'
|
|
74
|
-
: 'varchar',
|
|
75
|
-
length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
|
|
76
|
-
})
|
|
77
|
-
@Field({ nullable: true })
|
|
78
|
-
thumbnail?: string
|
|
79
|
-
|
|
80
|
-
@ManyToOne(type => Group, group => group.boards)
|
|
81
|
-
@Field(type => Group, { nullable: true })
|
|
82
|
-
group?: Group
|
|
83
|
-
|
|
84
|
-
@RelationId((board: Board) => board.group)
|
|
85
|
-
groupId?: string
|
|
86
|
-
|
|
87
|
-
@ManyToMany(type => PlayGroup, playGroup => playGroup.boards)
|
|
88
|
-
@Field(type => [PlayGroup], { nullable: true })
|
|
89
|
-
playGroups?: PlayGroup[]
|
|
90
|
-
|
|
91
|
-
@Column({ nullable: true })
|
|
92
|
-
@Field({ nullable: true })
|
|
93
|
-
createdAt?: Date
|
|
94
|
-
|
|
95
|
-
@Column({ nullable: true })
|
|
96
|
-
@Field({ nullable: true })
|
|
97
|
-
updatedAt?: Date
|
|
98
|
-
|
|
99
|
-
@ManyToOne(type => User, { nullable: true })
|
|
100
|
-
@Field(type => User, { nullable: true })
|
|
101
|
-
creator?: User
|
|
102
|
-
|
|
103
|
-
@RelationId((board: Board) => board.creator)
|
|
104
|
-
creatorId?: string
|
|
105
|
-
|
|
106
|
-
@ManyToOne(type => User, { nullable: true })
|
|
107
|
-
@Field(type => User, { nullable: true })
|
|
108
|
-
updater?: User
|
|
109
|
-
|
|
110
|
-
@RelationId((board: Board) => board.updater)
|
|
111
|
-
updaterId?: string
|
|
112
|
-
|
|
113
|
-
@Column({ nullable: true })
|
|
114
|
-
@Field({ nullable: true })
|
|
115
|
-
deletedAt?: Date
|
|
116
|
-
|
|
117
|
-
@HistoryOriginalIdColumn()
|
|
118
|
-
public originalId!: string
|
|
119
|
-
|
|
120
|
-
@HistoryActionColumn({
|
|
121
|
-
nullable: false,
|
|
122
|
-
type:
|
|
123
|
-
DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
124
|
-
? 'enum'
|
|
125
|
-
: DATABASE_TYPE == 'oracle'
|
|
126
|
-
? 'varchar2'
|
|
127
|
-
: DATABASE_TYPE == 'mssql'
|
|
128
|
-
? 'nvarchar'
|
|
129
|
-
: 'varchar',
|
|
130
|
-
enum:
|
|
131
|
-
DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
132
|
-
? HistoryActionType
|
|
133
|
-
: undefined,
|
|
134
|
-
length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 10
|
|
135
|
-
})
|
|
136
|
-
public action!: HistoryActionType
|
|
137
|
-
}
|