@things-factory/board-service 9.0.0-beta.8 → 9.0.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.
- package/dist-server/controllers/analyzer/analyze-integration.js +4 -4
- package/dist-server/controllers/analyzer/analyze-integration.js.map +1 -1
- package/dist-server/controllers/fonts.js +12 -9
- package/dist-server/controllers/fonts.js.map +1 -1
- package/dist-server/controllers/headless-model.d.ts +1 -1
- package/dist-server/controllers/headless-model.js +6 -6
- package/dist-server/controllers/headless-model.js.map +1 -1
- package/dist-server/controllers/headless-playlist.d.ts +1 -1
- package/dist-server/controllers/headless-playlist.js +5 -5
- package/dist-server/controllers/headless-playlist.js.map +1 -1
- package/dist-server/controllers/headless-pool-for-label.js +4 -17
- package/dist-server/controllers/headless-pool-for-label.js.map +1 -1
- package/dist-server/controllers/index.d.ts +1 -1
- package/dist-server/controllers/index.js +8 -8
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/label-command.js +5 -5
- package/dist-server/controllers/label-command.js.map +1 -1
- package/dist-server/controllers/pdf.d.ts +9 -1
- package/dist-server/controllers/pdf.js +18 -11
- package/dist-server/controllers/pdf.js.map +1 -1
- package/dist-server/controllers/screenshot.js +14 -10
- package/dist-server/controllers/screenshot.js.map +1 -1
- package/dist-server/controllers/thumbnail.js +2 -2
- package/dist-server/controllers/thumbnail.js.map +1 -1
- package/dist-server/errors/index.d.ts +1 -1
- package/dist-server/errors/index.js +1 -1
- package/dist-server/errors/index.js.map +1 -1
- package/dist-server/errors/license-error.js +4 -2
- package/dist-server/errors/license-error.js.map +1 -1
- package/dist-server/index.d.ts +4 -4
- package/dist-server/index.js +4 -4
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1556862253000-SeedGroup.js +7 -4
- package/dist-server/migrations/1556862253000-SeedGroup.js.map +1 -1
- package/dist-server/routers/internal-board-view-router.js +1 -1
- package/dist-server/routers/internal-board-view-router.js.map +1 -1
- package/dist-server/routers/standalone-board-service-router.js +41 -41
- package/dist-server/routers/standalone-board-service-router.js.map +1 -1
- package/dist-server/routes.js +12 -10
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/analysis/analysis-query.js +2 -2
- package/dist-server/service/analysis/analysis-query.js.map +1 -1
- package/dist-server/service/analysis/index.d.ts +1 -1
- package/dist-server/service/analysis/index.js +2 -2
- package/dist-server/service/analysis/index.js.map +1 -1
- package/dist-server/service/board/board-history.d.ts +4 -3
- package/dist-server/service/board/board-history.js +35 -20
- package/dist-server/service/board/board-history.js.map +1 -1
- package/dist-server/service/board/board-mutation.d.ts +2 -2
- package/dist-server/service/board/board-mutation.js +112 -53
- package/dist-server/service/board/board-mutation.js.map +1 -1
- package/dist-server/service/board/board-query.d.ts +5 -5
- package/dist-server/service/board/board-query.js +40 -39
- package/dist-server/service/board/board-query.js.map +1 -1
- package/dist-server/service/board/board-subscription.d.ts +1 -1
- package/dist-server/service/board/board-subscription.js +6 -6
- package/dist-server/service/board/board-subscription.js.map +1 -1
- package/dist-server/service/board/board-type.d.ts +4 -2
- package/dist-server/service/board/board-type.js +28 -20
- package/dist-server/service/board/board-type.js.map +1 -1
- package/dist-server/service/board/board.d.ts +3 -2
- package/dist-server/service/board/board.js +26 -21
- package/dist-server/service/board/board.js.map +1 -1
- package/dist-server/service/board/event-subscriber.d.ts +5 -5
- package/dist-server/service/board/event-subscriber.js +8 -8
- package/dist-server/service/board/event-subscriber.js.map +1 -1
- package/dist-server/service/board/index.d.ts +6 -6
- package/dist-server/service/board/index.js +9 -9
- package/dist-server/service/board/index.js.map +1 -1
- package/dist-server/service/board-favorite/board-favorite-query.d.ts +1 -1
- package/dist-server/service/board-favorite/board-favorite-query.js +5 -5
- package/dist-server/service/board-favorite/board-favorite-query.js.map +1 -1
- package/dist-server/service/board-favorite/board-favorite-type.d.ts +1 -1
- package/dist-server/service/board-favorite/board-favorite-type.js +7 -7
- package/dist-server/service/board-favorite/board-favorite-type.js.map +1 -1
- package/dist-server/service/board-favorite/index.d.ts +1 -1
- package/dist-server/service/board-favorite/index.js +2 -2
- package/dist-server/service/board-favorite/index.js.map +1 -1
- package/dist-server/service/board-template/board-template-mutation.d.ts +2 -2
- package/dist-server/service/board-template/board-template-mutation.js +43 -25
- package/dist-server/service/board-template/board-template-mutation.js.map +1 -1
- package/dist-server/service/board-template/board-template-query.d.ts +2 -2
- package/dist-server/service/board-template/board-template-query.js +13 -13
- package/dist-server/service/board-template/board-template-query.js.map +1 -1
- package/dist-server/service/board-template/board-template-type.d.ts +1 -1
- package/dist-server/service/board-template/board-template-type.js +21 -18
- package/dist-server/service/board-template/board-template-type.js.map +1 -1
- package/dist-server/service/board-template/board-template.js +14 -14
- package/dist-server/service/board-template/board-template.js.map +1 -1
- package/dist-server/service/board-template/index.d.ts +3 -3
- package/dist-server/service/board-template/index.js +5 -5
- package/dist-server/service/board-template/index.js.map +1 -1
- package/dist-server/service/group/group-mutation.d.ts +2 -2
- package/dist-server/service/group/group-mutation.js +25 -16
- package/dist-server/service/group/group-mutation.js.map +1 -1
- package/dist-server/service/group/group-query.d.ts +3 -3
- package/dist-server/service/group/group-query.js +17 -17
- package/dist-server/service/group/group-query.js.map +1 -1
- package/dist-server/service/group/group-type.d.ts +1 -1
- package/dist-server/service/group/group-type.js +10 -10
- package/dist-server/service/group/group-type.js.map +1 -1
- package/dist-server/service/group/group.d.ts +1 -1
- package/dist-server/service/group/group.js +12 -12
- package/dist-server/service/group/group.js.map +1 -1
- package/dist-server/service/group/index.d.ts +3 -3
- package/dist-server/service/group/index.js +5 -5
- package/dist-server/service/group/index.js.map +1 -1
- package/dist-server/service/index.d.ts +6 -6
- package/dist-server/service/index.js +31 -31
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/permission/domain-permission-subscriber.js +3 -3
- package/dist-server/service/permission/domain-permission-subscriber.js.map +1 -1
- package/dist-server/service/permission/index.d.ts +1 -1
- package/dist-server/service/permission/index.js +2 -2
- package/dist-server/service/permission/index.js.map +1 -1
- package/dist-server/service/play-group/event-subscriber.d.ts +1 -1
- package/dist-server/service/play-group/event-subscriber.js +3 -3
- package/dist-server/service/play-group/event-subscriber.js.map +1 -1
- package/dist-server/service/play-group/index.d.ts +5 -5
- package/dist-server/service/play-group/index.js +8 -8
- package/dist-server/service/play-group/index.js.map +1 -1
- package/dist-server/service/play-group/play-group-mutation.d.ts +2 -2
- package/dist-server/service/play-group/play-group-mutation.js +35 -22
- package/dist-server/service/play-group/play-group-mutation.js.map +1 -1
- package/dist-server/service/play-group/play-group-query.d.ts +3 -3
- package/dist-server/service/play-group/play-group-query.js +20 -18
- package/dist-server/service/play-group/play-group-query.js.map +1 -1
- package/dist-server/service/play-group/play-group-subscription.d.ts +1 -1
- package/dist-server/service/play-group/play-group-subscription.js +6 -6
- package/dist-server/service/play-group/play-group-subscription.js.map +1 -1
- package/dist-server/service/play-group/play-group-type.d.ts +1 -1
- package/dist-server/service/play-group/play-group-type.js +10 -10
- package/dist-server/service/play-group/play-group-type.js.map +1 -1
- package/dist-server/service/play-group/play-group.d.ts +2 -2
- package/dist-server/service/play-group/play-group.js +17 -13
- package/dist-server/service/play-group/play-group.js.map +1 -1
- package/dist-server/service/theme/index.d.ts +3 -3
- package/dist-server/service/theme/index.js +5 -5
- package/dist-server/service/theme/index.js.map +1 -1
- package/dist-server/service/theme/theme-mutation.d.ts +2 -2
- package/dist-server/service/theme/theme-mutation.js +44 -24
- package/dist-server/service/theme/theme-mutation.js.map +1 -1
- package/dist-server/service/theme/theme-query.d.ts +2 -2
- package/dist-server/service/theme/theme-query.js +13 -13
- package/dist-server/service/theme/theme-query.js.map +1 -1
- package/dist-server/service/theme/theme-type.d.ts +1 -1
- package/dist-server/service/theme/theme-type.js +18 -18
- package/dist-server/service/theme/theme-type.js.map +1 -1
- package/dist-server/service/theme/theme.js +16 -13
- package/dist-server/service/theme/theme.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/views/internal-board-full-feature-view.html +0 -1
- package/views/internal-board-player-view.html +0 -1
- package/views/internal-board-service-view.html +0 -1
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const group_js_1 = require("../group/group.js");
|
|
9
|
+
const play_group_js_1 = require("../play-group/play-group.js");
|
|
10
10
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
11
11
|
const env_1 = require("@things-factory/env");
|
|
12
12
|
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
@@ -19,17 +19,17 @@ let Board = class Board {
|
|
|
19
19
|
exports.Board = Board;
|
|
20
20
|
tslib_1.__decorate([
|
|
21
21
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
22
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'Unique identifier for the board.' }),
|
|
23
23
|
tslib_1.__metadata("design:type", String)
|
|
24
24
|
], Board.prototype, "id", void 0);
|
|
25
25
|
tslib_1.__decorate([
|
|
26
26
|
(0, typeorm_1.Column)({ nullable: true, default: 1 }),
|
|
27
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The version of the board model.' }),
|
|
28
28
|
tslib_1.__metadata("design:type", Number)
|
|
29
29
|
], Board.prototype, "version", void 0);
|
|
30
30
|
tslib_1.__decorate([
|
|
31
31
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
32
|
-
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
|
32
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain to which this board belongs.' }),
|
|
33
33
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
34
34
|
], Board.prototype, "domain", void 0);
|
|
35
35
|
tslib_1.__decorate([
|
|
@@ -38,17 +38,22 @@ tslib_1.__decorate([
|
|
|
38
38
|
], Board.prototype, "domainId", void 0);
|
|
39
39
|
tslib_1.__decorate([
|
|
40
40
|
(0, typeorm_1.Column)(),
|
|
41
|
-
(0, type_graphql_1.Field)(),
|
|
41
|
+
(0, type_graphql_1.Field)({ description: 'The name of the board.' }),
|
|
42
42
|
tslib_1.__metadata("design:type", String)
|
|
43
43
|
], Board.prototype, "name", void 0);
|
|
44
44
|
tslib_1.__decorate([
|
|
45
45
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description of the board.' }),
|
|
47
47
|
tslib_1.__metadata("design:type", String)
|
|
48
48
|
], Board.prototype, "description", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true, default: 'main' }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true, description: "The type of the board, can be 'main', 'sub', or 'popup'." }),
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
53
|
+
], Board.prototype, "type", void 0);
|
|
49
54
|
tslib_1.__decorate([
|
|
50
55
|
(0, typeorm_1.Column)({ nullable: true, default: 'draft' }),
|
|
51
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true, description: "The state of the board, can be 'draft' or 'released'." }),
|
|
52
57
|
tslib_1.__metadata("design:type", String)
|
|
53
58
|
], Board.prototype, "state", void 0);
|
|
54
59
|
tslib_1.__decorate([
|
|
@@ -63,7 +68,7 @@ tslib_1.__decorate([
|
|
|
63
68
|
: 'varchar',
|
|
64
69
|
length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
|
|
65
70
|
}),
|
|
66
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
71
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The JSON model defining the layout and components of the board.' }),
|
|
67
72
|
tslib_1.__metadata("design:type", String)
|
|
68
73
|
], Board.prototype, "model", void 0);
|
|
69
74
|
tslib_1.__decorate([
|
|
@@ -78,36 +83,36 @@ tslib_1.__decorate([
|
|
|
78
83
|
: 'varchar',
|
|
79
84
|
length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
|
|
80
85
|
}),
|
|
81
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
86
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A base64 encoded thumbnail image of the board.' }),
|
|
82
87
|
tslib_1.__metadata("design:type", String)
|
|
83
88
|
], Board.prototype, "thumbnail", void 0);
|
|
84
89
|
tslib_1.__decorate([
|
|
85
|
-
(0, typeorm_1.ManyToOne)(type =>
|
|
86
|
-
(0, type_graphql_1.Field)(type =>
|
|
87
|
-
tslib_1.__metadata("design:type",
|
|
90
|
+
(0, typeorm_1.ManyToOne)(type => group_js_1.Group, group => group.boards),
|
|
91
|
+
(0, type_graphql_1.Field)(type => group_js_1.Group, { nullable: true, description: 'The group to which this board belongs.' }),
|
|
92
|
+
tslib_1.__metadata("design:type", group_js_1.Group)
|
|
88
93
|
], Board.prototype, "group", void 0);
|
|
89
94
|
tslib_1.__decorate([
|
|
90
95
|
(0, typeorm_1.RelationId)((board) => board.group),
|
|
91
96
|
tslib_1.__metadata("design:type", String)
|
|
92
97
|
], Board.prototype, "groupId", void 0);
|
|
93
98
|
tslib_1.__decorate([
|
|
94
|
-
(0, typeorm_1.ManyToMany)(type =>
|
|
95
|
-
(0, type_graphql_1.Field)(type => [
|
|
99
|
+
(0, typeorm_1.ManyToMany)(type => play_group_js_1.PlayGroup, playGroup => playGroup.boards),
|
|
100
|
+
(0, type_graphql_1.Field)(type => [play_group_js_1.PlayGroup], { nullable: true, description: 'A list of play groups that this board is a part of.' }),
|
|
96
101
|
tslib_1.__metadata("design:type", Array)
|
|
97
102
|
], Board.prototype, "playGroups", void 0);
|
|
98
103
|
tslib_1.__decorate([
|
|
99
104
|
(0, typeorm_1.CreateDateColumn)(),
|
|
100
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
105
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the board was created.' }),
|
|
101
106
|
tslib_1.__metadata("design:type", Date)
|
|
102
107
|
], Board.prototype, "createdAt", void 0);
|
|
103
108
|
tslib_1.__decorate([
|
|
104
109
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
105
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
110
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the board was last updated.' }),
|
|
106
111
|
tslib_1.__metadata("design:type", Date)
|
|
107
112
|
], Board.prototype, "updatedAt", void 0);
|
|
108
113
|
tslib_1.__decorate([
|
|
109
114
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
110
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
115
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created the board.' }),
|
|
111
116
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
112
117
|
], Board.prototype, "creator", void 0);
|
|
113
118
|
tslib_1.__decorate([
|
|
@@ -116,7 +121,7 @@ tslib_1.__decorate([
|
|
|
116
121
|
], Board.prototype, "creatorId", void 0);
|
|
117
122
|
tslib_1.__decorate([
|
|
118
123
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
119
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
124
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated the board.' }),
|
|
120
125
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
121
126
|
], Board.prototype, "updater", void 0);
|
|
122
127
|
tslib_1.__decorate([
|
|
@@ -125,7 +130,7 @@ tslib_1.__decorate([
|
|
|
125
130
|
], Board.prototype, "updaterId", void 0);
|
|
126
131
|
tslib_1.__decorate([
|
|
127
132
|
(0, typeorm_1.DeleteDateColumn)(),
|
|
128
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
133
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the board was soft-deleted.' }),
|
|
129
134
|
tslib_1.__metadata("design:type", Date)
|
|
130
135
|
], Board.prototype, "deletedAt", void 0);
|
|
131
136
|
exports.Board = Board = tslib_1.__decorate([
|
|
@@ -135,6 +140,6 @@ exports.Board = Board = tslib_1.__decorate([
|
|
|
135
140
|
where: '"deleted_at" IS NULL'
|
|
136
141
|
}),
|
|
137
142
|
(0, typeorm_1.Index)('ix_board_3', (board) => [board.domain, board.group]),
|
|
138
|
-
(0, type_graphql_1.ObjectType)({ description: '
|
|
143
|
+
(0, type_graphql_1.ObjectType)({ description: 'Represents a visual dashboard or display board.' })
|
|
139
144
|
], Board);
|
|
140
145
|
//# sourceMappingURL=board.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.js","sourceRoot":"","sources":["../../../server/service/board/board.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAoD;AAEpD,iDAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"board.js","sourceRoot":"","sources":["../../../server/service/board/board.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAoD;AAEpD,iDAA8C;AAC9C,gDAAyC;AACzC,+DAAuD;AACvD,yDAAgD;AAChD,6CAA4C;AAE5C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAS7B,IAAM,KAAK,GAAX,MAAM,KAAK;IAAX;QAOL,YAAO,GAAY,CAAC,CAAA;IA2FtB,CAAC;CAAA,CAAA;AAlGY,sBAAK;AAGP;IAFR,IAAA,g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AAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;sCACnF,gBAAI;sCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;;wCAC1B;AAIlB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;sCAC7E,IAAI;wCAAA;gBAjGL,KAAK;IAPjB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE;QACjE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EAAC,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAClE,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;GAClE,KAAK,CAkGjB","sourcesContent":["import {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToMany,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n DeleteDateColumn,\n UpdateDateColumn\n} from 'typeorm'\nimport { Field, ID, ObjectType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { Group } from '../group/group.js'\nimport { PlayGroup } from '../play-group/play-group.js'\nimport { User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index('ix_board_1', (board: Board) => [board.domain, board.name], {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n})\n@Index('ix_board_3', (board: Board) => [board.domain, board.group])\n@ObjectType({ description: 'Represents a visual dashboard or display board.' })\nexport class Board {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { nullable: true, description: 'Unique identifier for the board.' })\n readonly id?: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true, description: 'The version of the board model.' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain to which this board belongs.' })\n domain?: Domain\n\n @RelationId((board: Board) => board.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'The name of the board.' })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'A detailed description of the board.' })\n description?: string\n\n @Column({ nullable: true, default: 'main' })\n @Field({ nullable: true, description: \"The type of the board, can be 'main', 'sub', or 'popup'.\" })\n type?: 'main' | 'sub' | 'popup'\n\n @Column({ nullable: true, default: 'draft' })\n @Field({ nullable: true, description: \"The state of the board, can be 'draft' or 'released'.\" })\n state?: 'draft' | 'released'\n\n @Column({\n nullable: true,\n type:\n DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'longtext'\n : DATABASE_TYPE == 'oracle'\n ? 'clob'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined\n })\n @Field({ nullable: true, description: 'The JSON model defining the layout and components of the board.' })\n model?: string\n\n @Column({\n nullable: true,\n type:\n DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'longtext'\n : DATABASE_TYPE == 'oracle'\n ? 'clob'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined\n })\n @Field({ nullable: true, description: 'A base64 encoded thumbnail image of the board.' })\n thumbnail?: string\n\n @ManyToOne(type => Group, group => group.boards)\n @Field(type => Group, { nullable: true, description: 'The group to which this board belongs.' })\n group?: Group\n\n @RelationId((board: Board) => board.group)\n groupId?: string\n\n @ManyToMany(type => PlayGroup, playGroup => playGroup.boards)\n @Field(type => [PlayGroup], { nullable: true, description: 'A list of play groups that this board is a part of.' })\n playGroups?: PlayGroup[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the board was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the board was last updated.' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created the board.' })\n creator?: User\n\n @RelationId((board: Board) => board.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the board.' })\n updater?: User\n\n @RelationId((board: Board) => board.updater)\n updaterId?: string\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the board was soft-deleted.' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EntitySubscriberInterface,
|
|
1
|
+
import { EntitySubscriberInterface, UpdateEvent } from 'typeorm';
|
|
2
2
|
import { HistoryEntitySubscriber } from '@operato/typeorm-history';
|
|
3
|
-
import { Board } from './board';
|
|
4
|
-
import { BoardHistory } from './board-history';
|
|
3
|
+
import { Board } from './board.js';
|
|
4
|
+
import { BoardHistory } from './board-history.js';
|
|
5
5
|
export declare class BoardSubscriber implements EntitySubscriberInterface<Board> {
|
|
6
6
|
listenTo(): typeof Board;
|
|
7
7
|
beforeUpdate(event: UpdateEvent<Board>): Promise<any>;
|
|
@@ -10,6 +10,6 @@ export declare class BoardSubscriber implements EntitySubscriberInterface<Board>
|
|
|
10
10
|
export declare class BoardHistoryEntitySubscriber extends HistoryEntitySubscriber<Board, BoardHistory> {
|
|
11
11
|
get entity(): typeof Board;
|
|
12
12
|
get historyEntity(): typeof BoardHistory;
|
|
13
|
-
afterInsert(event:
|
|
14
|
-
afterUpdate(event:
|
|
13
|
+
afterInsert(event: any): Promise<void>;
|
|
14
|
+
afterUpdate(event: any): Promise<void>;
|
|
15
15
|
}
|
|
@@ -5,11 +5,11 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const typeorm_history_1 = require("@operato/typeorm-history");
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const board_js_1 = require("./board.js");
|
|
9
|
+
const board_history_js_1 = require("./board-history.js");
|
|
10
10
|
let BoardSubscriber = class BoardSubscriber {
|
|
11
11
|
listenTo() {
|
|
12
|
-
return
|
|
12
|
+
return board_js_1.Board;
|
|
13
13
|
}
|
|
14
14
|
async beforeUpdate(event) {
|
|
15
15
|
var board = event.entity;
|
|
@@ -19,7 +19,7 @@ let BoardSubscriber = class BoardSubscriber {
|
|
|
19
19
|
}
|
|
20
20
|
async afterUpdate(event) {
|
|
21
21
|
var board = event.entity;
|
|
22
|
-
board = await event.manager.findOne(
|
|
22
|
+
board = await event.manager.findOne(board_js_1.Board, {
|
|
23
23
|
where: { domain: { id: board.domainId }, id: board.id },
|
|
24
24
|
relations: ['playGroups']
|
|
25
25
|
});
|
|
@@ -40,19 +40,19 @@ exports.BoardSubscriber = BoardSubscriber = tslib_1.__decorate([
|
|
|
40
40
|
], BoardSubscriber);
|
|
41
41
|
let BoardHistoryEntitySubscriber = class BoardHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
|
|
42
42
|
get entity() {
|
|
43
|
-
return
|
|
43
|
+
return board_js_1.Board;
|
|
44
44
|
}
|
|
45
45
|
get historyEntity() {
|
|
46
|
-
return
|
|
46
|
+
return board_history_js_1.BoardHistory;
|
|
47
47
|
}
|
|
48
48
|
async afterInsert(event) {
|
|
49
49
|
if (event.entity.state == 'released') {
|
|
50
|
-
super.afterInsert(event);
|
|
50
|
+
await super.afterInsert(event);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
async afterUpdate(event) {
|
|
54
54
|
if (event.entity.state == 'released') {
|
|
55
|
-
super.afterUpdate(event);
|
|
55
|
+
await super.afterUpdate(event);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/board/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAA8F;AAE9F,8DAAkE;AAClE,iDAA6D;AAE7D,
|
|
1
|
+
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/board/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAA8F;AAE9F,8DAAkE;AAClE,iDAA6D;AAE7D,yCAAkC;AAClC,yDAAiD;AAG1C,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,QAAQ;QACN,OAAO,gBAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAyB;QAC1C,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAA;QAExB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,KAAK,CAAC,OAAO,GAAG,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAyB;QACzC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAA;QAExB,KAAK,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAK,EAAE;YACzC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE;YACvD,SAAS,EAAE,CAAC,YAAY,CAAC;SAC1B,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,UAAU,EAAE,CAAC;YACxC,OAAM;QACR,CAAC;QAED,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CACnC,cAAM,CAAC,OAAO,CAAC,YAAY,EAAE;YAC3B,SAAS;SACV,CAAC,CACH,CAAA;QAED,cAAM,CAAC,OAAO,CAAC,OAAO,EAAE;YACtB,KAAK;SACN,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAnCY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,yBAAe,GAAE;GACL,eAAe,CAmC3B;AAGM,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,yCAA4C;IAC5F,IAAW,MAAM;QACf,OAAO,gBAAK,CAAA;IACd,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,+BAAY,CAAA;IACrB,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,KAAK;QAC5B,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,UAAU,EAAE,CAAC;YACrC,MAAM,KAAK,CAAC,WAAW,CAAC,KAAY,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,KAAK;QAC5B,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,UAAU,EAAE,CAAC;YACrC,MAAM,KAAK,CAAC,WAAW,CAAC,KAAY,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;CACF,CAAA;AApBY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,yBAAe,GAAE;GACL,4BAA4B,CAoBxC","sourcesContent":["import { EventSubscriber, EntitySubscriberInterface, InsertEvent, UpdateEvent } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\nimport { pubsub, getRepository } from '@things-factory/shell'\n\nimport { Board } from './board.js'\nimport { BoardHistory } from './board-history.js'\n\n@EventSubscriber()\nexport class BoardSubscriber implements EntitySubscriberInterface<Board> {\n listenTo() {\n return Board\n }\n\n async beforeUpdate(event: UpdateEvent<Board>): Promise<any> {\n var board = event.entity\n\n if (!board.version) {\n board.version = 0\n }\n }\n\n async afterUpdate(event: UpdateEvent<Board>): Promise<any> {\n var board = event.entity\n\n board = await event.manager.findOne(Board, {\n where: { domain: { id: board.domainId }, id: board.id },\n relations: ['playGroups']\n })\n\n if (!board || board.state != 'released') {\n return\n }\n\n board.playGroups.forEach(playGroup =>\n pubsub.publish('play-group', {\n playGroup\n })\n )\n\n pubsub.publish('board', {\n board\n })\n }\n}\n\n@EventSubscriber()\nexport class BoardHistoryEntitySubscriber extends HistoryEntitySubscriber<Board, BoardHistory> {\n public get entity() {\n return Board\n }\n\n public get historyEntity() {\n return BoardHistory\n }\n\n public async afterInsert(event): Promise<void> {\n if (event.entity.state == 'released') {\n await super.afterInsert(event as any)\n }\n }\n\n public async afterUpdate(event): Promise<void> {\n if (event.entity.state == 'released') {\n await super.afterUpdate(event as any)\n }\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Board } from './board';
|
|
2
|
-
import { BoardHistory } from './board-history';
|
|
3
|
-
import { BoardQuery } from './board-query';
|
|
4
|
-
import { BoardMutation } from './board-mutation';
|
|
5
|
-
import { BoardSubscription } from './board-subscription';
|
|
6
|
-
import { BoardSubscriber, BoardHistoryEntitySubscriber } from './event-subscriber';
|
|
1
|
+
import { Board } from './board.js';
|
|
2
|
+
import { BoardHistory } from './board-history.js';
|
|
3
|
+
import { BoardQuery } from './board-query.js';
|
|
4
|
+
import { BoardMutation } from './board-mutation.js';
|
|
5
|
+
import { BoardSubscription } from './board-subscription.js';
|
|
6
|
+
import { BoardSubscriber, BoardHistoryEntitySubscriber } from './event-subscriber.js';
|
|
7
7
|
export declare const entities: (typeof Board | typeof BoardHistory)[];
|
|
8
8
|
export declare const resolvers: (typeof BoardQuery | typeof BoardMutation | typeof BoardSubscription)[];
|
|
9
9
|
export declare const subscribers: (typeof BoardSubscriber | typeof BoardHistoryEntitySubscriber)[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
exports.entities = [
|
|
11
|
-
exports.resolvers = [
|
|
12
|
-
exports.subscribers = [
|
|
4
|
+
const board_js_1 = require("./board.js");
|
|
5
|
+
const board_history_js_1 = require("./board-history.js");
|
|
6
|
+
const board_query_js_1 = require("./board-query.js");
|
|
7
|
+
const board_mutation_js_1 = require("./board-mutation.js");
|
|
8
|
+
const board_subscription_js_1 = require("./board-subscription.js");
|
|
9
|
+
const event_subscriber_js_1 = require("./event-subscriber.js");
|
|
10
|
+
exports.entities = [board_js_1.Board, board_history_js_1.BoardHistory];
|
|
11
|
+
exports.resolvers = [board_query_js_1.BoardQuery, board_mutation_js_1.BoardMutation, board_subscription_js_1.BoardSubscription];
|
|
12
|
+
exports.subscribers = [event_subscriber_js_1.BoardSubscriber, event_subscriber_js_1.BoardHistoryEntitySubscriber];
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/board/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/board/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,yDAAiD;AACjD,qDAA6C;AAC7C,2DAAmD;AACnD,mEAA2D;AAC3D,+DAAqF;AAExE,QAAA,QAAQ,GAAG,CAAC,gBAAK,EAAE,+BAAY,CAAC,CAAA;AAChC,QAAA,SAAS,GAAG,CAAC,2BAAU,EAAE,iCAAa,EAAE,yCAAiB,CAAC,CAAA;AAC1D,QAAA,WAAW,GAAG,CAAC,qCAAe,EAAE,kDAA4B,CAAC,CAAA","sourcesContent":["import { Board } from './board.js'\nimport { BoardHistory } from './board-history.js'\nimport { BoardQuery } from './board-query.js'\nimport { BoardMutation } from './board-mutation.js'\nimport { BoardSubscription } from './board-subscription.js'\nimport { BoardSubscriber, BoardHistoryEntitySubscriber } from './event-subscriber.js'\n\nexport const entities = [Board, BoardHistory]\nexport const resolvers = [BoardQuery, BoardMutation, BoardSubscription]\nexport const subscribers = [BoardSubscriber, BoardHistoryEntitySubscriber]\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ListParam } from '@things-factory/shell';
|
|
2
|
-
import { BoardFavoriteList } from './board-favorite-type';
|
|
2
|
+
import { BoardFavoriteList } from './board-favorite-type.js';
|
|
3
3
|
export declare class BoardFavoriteQuery {
|
|
4
4
|
favoriteBoards(params: ListParam, context: ResolverContext): Promise<BoardFavoriteList>;
|
|
5
5
|
}
|
|
@@ -6,14 +6,14 @@ const type_graphql_1 = require("type-graphql");
|
|
|
6
6
|
const env_1 = require("@things-factory/env");
|
|
7
7
|
const fav_base_1 = require("@things-factory/fav-base");
|
|
8
8
|
const shell_1 = require("@things-factory/shell");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const board_js_1 = require("../board/board.js");
|
|
10
|
+
const board_favorite_type_js_1 = require("./board-favorite-type.js");
|
|
11
11
|
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
12
12
|
const DATABASE_TYPE = ORMCONFIG.type;
|
|
13
13
|
let BoardFavoriteQuery = class BoardFavoriteQuery {
|
|
14
14
|
async favoriteBoards(params, context) {
|
|
15
15
|
const { user } = context.state;
|
|
16
|
-
const queryBuilder = (0, shell_1.getRepository)(
|
|
16
|
+
const queryBuilder = (0, shell_1.getRepository)(board_js_1.Board).createQueryBuilder();
|
|
17
17
|
(0, shell_1.buildQuery)(queryBuilder, params, context);
|
|
18
18
|
var joinStatement = '';
|
|
19
19
|
switch (DATABASE_TYPE) {
|
|
@@ -43,7 +43,7 @@ let BoardFavoriteQuery = class BoardFavoriteQuery {
|
|
|
43
43
|
};
|
|
44
44
|
exports.BoardFavoriteQuery = BoardFavoriteQuery;
|
|
45
45
|
tslib_1.__decorate([
|
|
46
|
-
(0, type_graphql_1.Query)(returns =>
|
|
46
|
+
(0, type_graphql_1.Query)(returns => board_favorite_type_js_1.BoardFavoriteList, { description: 'To fetch multiple BoardFavorites' }),
|
|
47
47
|
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
48
48
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
49
49
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -51,6 +51,6 @@ tslib_1.__decorate([
|
|
|
51
51
|
tslib_1.__metadata("design:returntype", Promise)
|
|
52
52
|
], BoardFavoriteQuery.prototype, "favoriteBoards", null);
|
|
53
53
|
exports.BoardFavoriteQuery = BoardFavoriteQuery = tslib_1.__decorate([
|
|
54
|
-
(0, type_graphql_1.Resolver)(
|
|
54
|
+
(0, type_graphql_1.Resolver)(board_favorite_type_js_1.BoardFavorite)
|
|
55
55
|
], BoardFavoriteQuery);
|
|
56
56
|
//# sourceMappingURL=board-favorite-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-favorite-query.js","sourceRoot":"","sources":["../../../server/service/board-favorite/board-favorite-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAyD;AAEzD,6CAA4C;AAC5C,uDAAmD;AACnD,iDAA4E;AAE5E,
|
|
1
|
+
{"version":3,"file":"board-favorite-query.js","sourceRoot":"","sources":["../../../server/service/board-favorite/board-favorite-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAyD;AAEzD,6CAA4C;AAC5C,uDAAmD;AACnD,iDAA4E;AAE5E,gDAAyC;AACzC,qEAA2E;AAE3E,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAG7B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEvB,AAAN,KAAK,CAAC,cAAc,CACO,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,IAAI,EA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, Query, Resolver } from 'type-graphql'\n\nimport { config } from '@things-factory/env'\nimport { Favorite } from '@things-factory/fav-base'\nimport { buildQuery, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Board } from '../board/board.js'\nimport { BoardFavorite, BoardFavoriteList } from './board-favorite-type.js'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Resolver(BoardFavorite)\nexport class BoardFavoriteQuery {\n @Query(returns => BoardFavoriteList, { description: 'To fetch multiple BoardFavorites' })\n async favoriteBoards(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<BoardFavoriteList> {\n const { user } = context.state\n\n const queryBuilder = getRepository(Board).createQueryBuilder()\n buildQuery(queryBuilder, params, context)\n\n var joinStatement = ''\n switch (DATABASE_TYPE) {\n case 'postgres':\n joinStatement = 'CAST(Board.id as VARCHAR) = Favorite.routing'\n break\n case 'sqlite':\n default:\n joinStatement = 'Board.id = Favorite.routing'\n }\n\n var qb = queryBuilder\n .innerJoin(Favorite, 'Favorite', joinStatement)\n .select([\n 'Board.id as id',\n 'Board.name as name',\n 'Board.description as description',\n 'Board.thumbnail as thumbnail',\n 'Favorite.id as favoriteId'\n ])\n .andWhere('Favorite.user = :userId', {\n userId: user.id\n })\n\n const items = await qb.getRawMany()\n const total = await qb.getCount()\n\n return { items, total }\n }\n}\n"]}
|
|
@@ -3,29 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BoardFavoriteList = exports.BoardFavorite = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const
|
|
7
|
-
let BoardFavorite = class BoardFavorite extends
|
|
6
|
+
const board_js_1 = require("../board/board.js");
|
|
7
|
+
let BoardFavorite = class BoardFavorite extends board_js_1.Board {
|
|
8
8
|
};
|
|
9
9
|
exports.BoardFavorite = BoardFavorite;
|
|
10
10
|
tslib_1.__decorate([
|
|
11
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
11
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The unique identifier for the favorite marking itself.' }),
|
|
12
12
|
tslib_1.__metadata("design:type", String)
|
|
13
13
|
], BoardFavorite.prototype, "favoriteId", void 0);
|
|
14
14
|
exports.BoardFavorite = BoardFavorite = tslib_1.__decorate([
|
|
15
|
-
(0, type_graphql_1.ObjectType)()
|
|
15
|
+
(0, type_graphql_1.ObjectType)({ description: 'Represents a board that a user has marked as a favorite.' })
|
|
16
16
|
], BoardFavorite);
|
|
17
17
|
let BoardFavoriteList = class BoardFavoriteList {
|
|
18
18
|
};
|
|
19
19
|
exports.BoardFavoriteList = BoardFavoriteList;
|
|
20
20
|
tslib_1.__decorate([
|
|
21
|
-
(0, type_graphql_1.Field)(type => [BoardFavorite]),
|
|
21
|
+
(0, type_graphql_1.Field)(type => [BoardFavorite], { description: 'The list of favorite board items.' }),
|
|
22
22
|
tslib_1.__metadata("design:type", Array)
|
|
23
23
|
], BoardFavoriteList.prototype, "items", void 0);
|
|
24
24
|
tslib_1.__decorate([
|
|
25
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
25
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The total number of favorite boards.' }),
|
|
26
26
|
tslib_1.__metadata("design:type", Number)
|
|
27
27
|
], BoardFavoriteList.prototype, "total", void 0);
|
|
28
28
|
exports.BoardFavoriteList = BoardFavoriteList = tslib_1.__decorate([
|
|
29
|
-
(0, type_graphql_1.ObjectType)()
|
|
29
|
+
(0, type_graphql_1.ObjectType)({ description: 'A paginated list of favorite boards.' })
|
|
30
30
|
], BoardFavoriteList);
|
|
31
31
|
//# sourceMappingURL=board-favorite-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-favorite-type.js","sourceRoot":"","sources":["../../../server/service/board-favorite/board-favorite-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AAErD,
|
|
1
|
+
{"version":3,"file":"board-favorite-type.js","sourceRoot":"","sources":["../../../server/service/board-favorite/board-favorite-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AAErD,gDAAyC;AAGlC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,gBAAK;CAGvC,CAAA;AAHY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;;iDAC9E;wBAFR,aAAa;IADzB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0DAA0D,EAAE,CAAC;GAC3E,aAAa,CAGzB;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAM7B,CAAA;AANY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;gDAC/D;AAGtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;gDAC/D;4BALF,iBAAiB;IAD7B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;GACvD,iBAAiB,CAM7B","sourcesContent":["import { ObjectType, Field, Int } from 'type-graphql'\n\nimport { Board } from '../board/board.js'\n\n@ObjectType({ description: 'Represents a board that a user has marked as a favorite.' })\nexport class BoardFavorite extends Board {\n @Field({ nullable: true, description: 'The unique identifier for the favorite marking itself.' })\n favoriteId?: string\n}\n\n@ObjectType({ description: 'A paginated list of favorite boards.' })\nexport class BoardFavoriteList {\n @Field(type => [BoardFavorite], { description: 'The list of favorite board items.' })\n items: BoardFavorite[]\n\n @Field(type => Int, { description: 'The total number of favorite boards.' })\n total: number\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const
|
|
4
|
+
const board_favorite_query_js_1 = require("./board-favorite-query.js");
|
|
5
5
|
exports.entities = [];
|
|
6
|
-
exports.resolvers = [
|
|
6
|
+
exports.resolvers = [board_favorite_query_js_1.BoardFavoriteQuery];
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/board-favorite/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/board-favorite/index.ts"],"names":[],"mappings":";;;AAAA,uEAA8D;AAEjD,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,4CAAkB,CAAC,CAAA","sourcesContent":["import { BoardFavoriteQuery } from './board-favorite-query.js'\n\nexport const entities = []\nexport const resolvers = [BoardFavoriteQuery]\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BoardTemplate } from './board-template';
|
|
2
|
-
import { NewBoardTemplate, BoardTemplatePatch } from './board-template-type';
|
|
1
|
+
import { BoardTemplate } from './board-template.js';
|
|
2
|
+
import { NewBoardTemplate, BoardTemplatePatch } from './board-template-type.js';
|
|
3
3
|
export declare class BoardTemplateMutation {
|
|
4
4
|
createBoardTemplate(boardTemplate: NewBoardTemplate, context: ResolverContext): Promise<BoardTemplate>;
|
|
5
5
|
updateBoardTemplate(id: string, patch: BoardTemplatePatch, context: ResolverContext): Promise<BoardTemplate>;
|