@things-factory/board-service 9.0.0-beta.80 → 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/service/board/board-history.js +26 -16
- package/dist-server/service/board/board-history.js.map +1 -1
- package/dist-server/service/board/board-mutation.js +11 -7
- package/dist-server/service/board/board-mutation.js.map +1 -1
- package/dist-server/service/board/board-query.js +13 -11
- package/dist-server/service/board/board-query.js.map +1 -1
- package/dist-server/service/board/board-subscription.js +1 -0
- package/dist-server/service/board/board-subscription.js.map +1 -1
- package/dist-server/service/board/board-type.js +20 -20
- package/dist-server/service/board/board-type.js.map +1 -1
- package/dist-server/service/board/board.js +17 -17
- package/dist-server/service/board/board.js.map +1 -1
- package/dist-server/service/board-favorite/board-favorite-type.js +5 -5
- package/dist-server/service/board-favorite/board-favorite-type.js.map +1 -1
- package/dist-server/service/board-template/board-template-type.js +20 -17
- 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/group/group-mutation.js +4 -4
- package/dist-server/service/group/group-mutation.js.map +1 -1
- package/dist-server/service/group/group-query.js +6 -6
- package/dist-server/service/group/group-query.js.map +1 -1
- package/dist-server/service/group/group-type.js +9 -9
- package/dist-server/service/group/group-type.js.map +1 -1
- package/dist-server/service/group/group.js +10 -10
- package/dist-server/service/group/group.js.map +1 -1
- package/dist-server/service/play-group/play-group-mutation.js +6 -6
- package/dist-server/service/play-group/play-group-mutation.js.map +1 -1
- package/dist-server/service/play-group/play-group-query.js +9 -7
- package/dist-server/service/play-group/play-group-query.js.map +1 -1
- package/dist-server/service/play-group/play-group-subscription.js +1 -0
- package/dist-server/service/play-group/play-group-subscription.js.map +1 -1
- package/dist-server/service/play-group/play-group-type.js +9 -9
- package/dist-server/service/play-group/play-group-type.js.map +1 -1
- package/dist-server/service/play-group/play-group.d.ts +1 -1
- package/dist-server/service/play-group/play-group.js +15 -11
- package/dist-server/service/play-group/play-group.js.map +1 -1
- package/dist-server/service/theme/theme-mutation.js +8 -6
- package/dist-server/service/theme/theme-mutation.js.map +1 -1
- package/dist-server/service/theme/theme-query.js +5 -5
- package/dist-server/service/theme/theme-query.js.map +1 -1
- package/dist-server/service/theme/theme-type.js +17 -17
- 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 +7 -7
|
@@ -12,12 +12,12 @@ let PlayGroup = class PlayGroup {
|
|
|
12
12
|
exports.PlayGroup = PlayGroup;
|
|
13
13
|
tslib_1.__decorate([
|
|
14
14
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
15
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
15
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the play group.' }),
|
|
16
16
|
tslib_1.__metadata("design:type", String)
|
|
17
17
|
], PlayGroup.prototype, "id", void 0);
|
|
18
18
|
tslib_1.__decorate([
|
|
19
19
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
20
|
-
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
|
20
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain to which this play group belongs.' }),
|
|
21
21
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
22
22
|
], PlayGroup.prototype, "domain", void 0);
|
|
23
23
|
tslib_1.__decorate([
|
|
@@ -26,39 +26,43 @@ tslib_1.__decorate([
|
|
|
26
26
|
], PlayGroup.prototype, "domainId", void 0);
|
|
27
27
|
tslib_1.__decorate([
|
|
28
28
|
(0, typeorm_1.Column)(),
|
|
29
|
-
(0, type_graphql_1.Field)(),
|
|
29
|
+
(0, type_graphql_1.Field)({ description: 'The name of the play group.' }),
|
|
30
30
|
tslib_1.__metadata("design:type", String)
|
|
31
31
|
], PlayGroup.prototype, "name", void 0);
|
|
32
32
|
tslib_1.__decorate([
|
|
33
33
|
(0, typeorm_1.Column)({
|
|
34
34
|
nullable: true
|
|
35
35
|
}),
|
|
36
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
36
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description of the play group.' }),
|
|
37
37
|
tslib_1.__metadata("design:type", String)
|
|
38
38
|
], PlayGroup.prototype, "description", void 0);
|
|
39
39
|
tslib_1.__decorate([
|
|
40
40
|
(0, typeorm_1.ManyToMany)(type => board_js_1.Board, board => board.playGroups),
|
|
41
41
|
(0, typeorm_1.JoinTable)({ name: 'play_groups_boards' }),
|
|
42
|
-
(0, type_graphql_1.Field)(type => [board_js_1.Board], { nullable: true }),
|
|
42
|
+
(0, type_graphql_1.Field)(type => [board_js_1.Board], { nullable: true, description: 'The list of boards included in this play group.' }),
|
|
43
43
|
tslib_1.__metadata("design:type", Array)
|
|
44
44
|
], PlayGroup.prototype, "boards", void 0);
|
|
45
45
|
tslib_1.__decorate([
|
|
46
46
|
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
47
|
-
|
|
47
|
+
(0, type_graphql_1.Field)(type => [String], {
|
|
48
|
+
nullable: true,
|
|
49
|
+
description: 'An array of board IDs, defining the specific playback order of boards within the group.'
|
|
50
|
+
}),
|
|
51
|
+
tslib_1.__metadata("design:type", Array)
|
|
48
52
|
], PlayGroup.prototype, "order", void 0);
|
|
49
53
|
tslib_1.__decorate([
|
|
50
54
|
(0, typeorm_1.CreateDateColumn)(),
|
|
51
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the play group was created.' }),
|
|
52
56
|
tslib_1.__metadata("design:type", Date)
|
|
53
57
|
], PlayGroup.prototype, "createdAt", void 0);
|
|
54
58
|
tslib_1.__decorate([
|
|
55
59
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
56
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
60
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the play group was last updated.' }),
|
|
57
61
|
tslib_1.__metadata("design:type", Date)
|
|
58
62
|
], PlayGroup.prototype, "updatedAt", void 0);
|
|
59
63
|
tslib_1.__decorate([
|
|
60
64
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
61
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created the play group.' }),
|
|
62
66
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
63
67
|
], PlayGroup.prototype, "creator", void 0);
|
|
64
68
|
tslib_1.__decorate([
|
|
@@ -67,7 +71,7 @@ tslib_1.__decorate([
|
|
|
67
71
|
], PlayGroup.prototype, "creatorId", void 0);
|
|
68
72
|
tslib_1.__decorate([
|
|
69
73
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
70
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
74
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated the play group.' }),
|
|
71
75
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
72
76
|
], PlayGroup.prototype, "updater", void 0);
|
|
73
77
|
tslib_1.__decorate([
|
|
@@ -77,6 +81,6 @@ tslib_1.__decorate([
|
|
|
77
81
|
exports.PlayGroup = PlayGroup = tslib_1.__decorate([
|
|
78
82
|
(0, typeorm_1.Entity)(),
|
|
79
83
|
(0, typeorm_1.Index)('ix_play_group_0', (playGroup) => [playGroup.domain, playGroup.name], { unique: true }),
|
|
80
|
-
(0, type_graphql_1.ObjectType)({ description: '
|
|
84
|
+
(0, type_graphql_1.ObjectType)({ description: 'A group of boards that can be played in a sequence or collection.' })
|
|
81
85
|
], PlayGroup);
|
|
82
86
|
//# sourceMappingURL=play-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAWgB;AAEhB,yDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAWgB;AAEhB,yDAAgD;AAChD,iDAA4D;AAE5D,gDAAyC;AAKlC,IAAM,SAAS,GAAf,MAAM,SAAS;CAuDrB,CAAA;AAvDY,8BAAS;AAGX;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;;qCACzD;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;sCAC9F,cAAM;yCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;;2CACtC;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;uCAC1C;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;8CAChE;AAKpB;IAHC,IAAA,oBAAU,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAK,EAAE,KAAK,C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,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;sCACxF,gBAAI;0CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;oBAtDP,SAAS;IAHrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACxG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mEAAmE,EAAE,CAAC;GACpF,SAAS,CAuDrB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n JoinTable,\n ManyToMany,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, ScalarObject } from '@things-factory/shell'\n\nimport { Board } from '../board/board.js'\n\n@Entity()\n@Index('ix_play_group_0', (playGroup: PlayGroup) => [playGroup.domain, playGroup.name], { unique: true })\n@ObjectType({ description: 'A group of boards that can be played in a sequence or collection.' })\nexport class PlayGroup {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the play group.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain to which this play group belongs.' })\n domain?: Domain\n\n @RelationId((playGroup: PlayGroup) => playGroup.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'The name of the play group.' })\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true, description: 'A detailed description of the play group.' })\n description?: string\n\n @ManyToMany(type => Board, board => board.playGroups)\n @JoinTable({ name: 'play_groups_boards' })\n @Field(type => [Board], { nullable: true, description: 'The list of boards included in this play group.' })\n boards: Board[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [String], {\n nullable: true,\n description: 'An array of board IDs, defining the specific playback order of boards within the group.'\n })\n order?: string[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the play group was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the play group 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 play group.' })\n creator?: User\n\n @RelationId((playGroup: PlayGroup) => playGroup.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the play group.' })\n updater?: User\n\n @RelationId((playGroup: PlayGroup) => playGroup.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -84,7 +84,7 @@ let ThemeMutation = class ThemeMutation {
|
|
|
84
84
|
exports.ThemeMutation = ThemeMutation;
|
|
85
85
|
tslib_1.__decorate([
|
|
86
86
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
87
|
-
(0, type_graphql_1.Mutation)(returns => theme_js_1.Theme, { description: '
|
|
87
|
+
(0, type_graphql_1.Mutation)(returns => theme_js_1.Theme, { description: 'Creates a new theme.' }),
|
|
88
88
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('theme')),
|
|
89
89
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
90
90
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -93,7 +93,7 @@ tslib_1.__decorate([
|
|
|
93
93
|
], ThemeMutation.prototype, "createTheme", null);
|
|
94
94
|
tslib_1.__decorate([
|
|
95
95
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
96
|
-
(0, type_graphql_1.Mutation)(returns => theme_js_1.Theme, { description: '
|
|
96
|
+
(0, type_graphql_1.Mutation)(returns => theme_js_1.Theme, { description: 'Updates an existing theme.' }),
|
|
97
97
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
98
98
|
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
99
99
|
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
@@ -103,7 +103,9 @@ tslib_1.__decorate([
|
|
|
103
103
|
], ThemeMutation.prototype, "updateTheme", null);
|
|
104
104
|
tslib_1.__decorate([
|
|
105
105
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
106
|
-
(0, type_graphql_1.Mutation)(returns => [theme_js_1.Theme], {
|
|
106
|
+
(0, type_graphql_1.Mutation)(returns => [theme_js_1.Theme], {
|
|
107
|
+
description: 'Updates multiple themes at once. Can create or update themes based on the cuFlag.'
|
|
108
|
+
}),
|
|
107
109
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [theme_type_js_1.ThemePatch])),
|
|
108
110
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
109
111
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -112,7 +114,7 @@ tslib_1.__decorate([
|
|
|
112
114
|
], ThemeMutation.prototype, "updateMultipleTheme", null);
|
|
113
115
|
tslib_1.__decorate([
|
|
114
116
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
115
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: '
|
|
117
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Deletes a single theme by its ID.' }),
|
|
116
118
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
117
119
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
118
120
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -121,7 +123,7 @@ tslib_1.__decorate([
|
|
|
121
123
|
], ThemeMutation.prototype, "deleteTheme", null);
|
|
122
124
|
tslib_1.__decorate([
|
|
123
125
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
124
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: '
|
|
126
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Deletes multiple themes by their IDs.' }),
|
|
125
127
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
126
128
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
127
129
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -130,7 +132,7 @@ tslib_1.__decorate([
|
|
|
130
132
|
], ThemeMutation.prototype, "deleteThemes", null);
|
|
131
133
|
tslib_1.__decorate([
|
|
132
134
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
133
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: '
|
|
135
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Imports multiple themes.' }),
|
|
134
136
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('themes', type => [theme_type_js_1.ThemePatch])),
|
|
135
137
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
136
138
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-mutation.js","sourceRoot":"","sources":["../../../server/service/theme/theme-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yCAAkC;AAClC,mDAAsD;AAG/C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,WAAW,CAAe,KAAe,EAAS,OAAwB;QAC9E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,gBAAK,CAAC,CAAC,IAAI,CAAC;YACxC,GAAG,KAAK;YACR,MAAM;YACN,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,WAAW,CACJ,EAAU,EACP,KAAiB,EACxB,OAAwB;QAE/B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,EAAE,mFAAmF;KACjG,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAU,CAAC,CAAC,CAAA;IACpC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IAChE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDAM9C;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;IACnE,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDASrE;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAEvE,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAU,CAAC,CAAC,CAAA;IACnC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAWP;wBAzHU,aAAa;IADzB,IAAA,uBAAQ,EAAC,gBAAK,CAAC;GACH,aAAa,CA0HzB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Theme } from './theme.js'\nimport { NewTheme, ThemePatch } from './theme-type.js'\n\n@Resolver(Theme)\nexport class ThemeMutation {\n @Directive('@transaction')\n @Mutation(returns => Theme, { description: 'Creates a new theme.' })\n async createTheme(@Arg('theme') theme: NewTheme, @Ctx() context: ResolverContext): Promise<Theme> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(Theme).save({\n ...theme,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Theme, { description: 'Updates an existing theme.' })\n async updateTheme(\n @Arg('id') id: string,\n @Arg('patch') patch: ThemePatch,\n @Ctx() context: ResolverContext\n ): Promise<Theme> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Theme)\n const theme = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n return await repository.save({\n ...theme,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [Theme], {\n description: 'Updates multiple themes at once. Can create or update themes based on the cuFlag.'\n })\n async updateMultipleTheme(\n @Arg('patches', type => [ThemePatch]) patches: ThemePatch[],\n @Ctx() context: ResolverContext\n ): Promise<Theme[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const themeRepo = tx.getRepository(Theme)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await themeRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const theme = await themeRepo.findOneBy({ id: updateRecord.id })\n\n const result = await themeRepo.save({\n ...theme,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'Deletes a single theme by its ID.' })\n async deleteTheme(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Theme).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'Deletes multiple themes by their IDs.' })\n async deleteThemes(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Theme).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'Imports multiple themes.' })\n async importThemes(\n @Arg('themes', type => [ThemePatch]) themes: ThemePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n themes.map(async (theme: ThemePatch) => {\n const createdTheme: Theme = await tx.getRepository(Theme).save({ domain, ...theme })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -37,7 +37,7 @@ let ThemeQuery = class ThemeQuery {
|
|
|
37
37
|
};
|
|
38
38
|
exports.ThemeQuery = ThemeQuery;
|
|
39
39
|
tslib_1.__decorate([
|
|
40
|
-
(0, type_graphql_1.Query)(returns => theme_js_1.Theme, { nullable: true, description: '
|
|
40
|
+
(0, type_graphql_1.Query)(returns => theme_js_1.Theme, { nullable: true, description: 'Finds a single theme by its ID.' }),
|
|
41
41
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
42
42
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
43
43
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -45,7 +45,7 @@ tslib_1.__decorate([
|
|
|
45
45
|
tslib_1.__metadata("design:returntype", Promise)
|
|
46
46
|
], ThemeQuery.prototype, "theme", null);
|
|
47
47
|
tslib_1.__decorate([
|
|
48
|
-
(0, type_graphql_1.Query)(returns => theme_type_js_1.ThemeList, { description: '
|
|
48
|
+
(0, type_graphql_1.Query)(returns => theme_type_js_1.ThemeList, { description: 'Retrieves a paginated list of themes.' }),
|
|
49
49
|
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
50
50
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
51
51
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -53,21 +53,21 @@ tslib_1.__decorate([
|
|
|
53
53
|
tslib_1.__metadata("design:returntype", Promise)
|
|
54
54
|
], ThemeQuery.prototype, "themes", null);
|
|
55
55
|
tslib_1.__decorate([
|
|
56
|
-
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
56
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain, { description: 'Resolves the domain associated with the theme.' }),
|
|
57
57
|
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
58
58
|
tslib_1.__metadata("design:type", Function),
|
|
59
59
|
tslib_1.__metadata("design:paramtypes", [theme_js_1.Theme]),
|
|
60
60
|
tslib_1.__metadata("design:returntype", Promise)
|
|
61
61
|
], ThemeQuery.prototype, "domain", null);
|
|
62
62
|
tslib_1.__decorate([
|
|
63
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
63
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Resolves the user who last updated the theme.' }),
|
|
64
64
|
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
65
65
|
tslib_1.__metadata("design:type", Function),
|
|
66
66
|
tslib_1.__metadata("design:paramtypes", [theme_js_1.Theme]),
|
|
67
67
|
tslib_1.__metadata("design:returntype", Promise)
|
|
68
68
|
], ThemeQuery.prototype, "updater", null);
|
|
69
69
|
tslib_1.__decorate([
|
|
70
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
70
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Resolves the user who created the theme.' }),
|
|
71
71
|
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
72
72
|
tslib_1.__metadata("design:type", Function),
|
|
73
73
|
tslib_1.__metadata("design:paramtypes", [theme_js_1.Theme]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-query.js","sourceRoot":"","sources":["../../../server/service/theme/theme-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yCAAkC;AAClC,mDAA2C;AAGpC,IAAM,UAAU,GAAhB,MAAM,UAAU;IAEf,AAAN,KAAK,CAAC,KAAK,CAAY,EAAU,EAAS,OAAwB;QAChE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,gBAAK,CAAC,CAAC,OAAO,CAAC;YACxC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAA0B,MAAiB,EAAS,OAAwB;QACtF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,gBAAK,CAAC;YACtC,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,KAAY;QAC/B,OAAO,KAAK,CAAC,QAAQ,IAAI,CAAC,MAAM,IAAA,qBAAa,EAAC,cAAM,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,QAAQ,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AAC,yBAAS,EAAE,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;IACxE,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;wCAatD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;IACnF,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,gBAAK;;wCAEhC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;IAC/E,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,gBAAK;;yCAEjC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IAC1E,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,gBAAK;;yCAEjC;qBAvCU,UAAU;IADtB,IAAA,uBAAQ,EAAC,gBAAK,CAAC;GACH,UAAU,CAwCtB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Theme } from './theme.js'\nimport { ThemeList } from './theme-type.js'\n\n@Resolver(Theme)\nexport class ThemeQuery {\n @Query(returns => Theme, { nullable: true, description: 'Finds a single theme by its ID.' })\n async theme(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Theme> {\n const { domain } = context.state\n\n return await getRepository(Theme).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => ThemeList, { description: 'Retrieves a paginated list of themes.' })\n async themes(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<ThemeList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Theme),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain, { description: 'Resolves the domain associated with the theme.' })\n async domain(@Root() theme: Theme): Promise<Domain> {\n return theme.domainId && (await getRepository(Domain).findOneBy({ id: theme.domainId }))\n }\n\n @FieldResolver(type => User, { description: 'Resolves the user who last updated the theme.' })\n async updater(@Root() theme: Theme): Promise<User> {\n return theme.updaterId && (await getRepository(User).findOneBy({ id: theme.updaterId }))\n }\n\n @FieldResolver(type => User, { description: 'Resolves the user who created the theme.' })\n async creator(@Root() theme: Theme): Promise<User> {\n return theme.creatorId && (await getRepository(User).findOneBy({ id: theme.creatorId }))\n }\n}\n"]}
|
|
@@ -9,74 +9,74 @@ let NewTheme = class NewTheme {
|
|
|
9
9
|
};
|
|
10
10
|
exports.NewTheme = NewTheme;
|
|
11
11
|
tslib_1.__decorate([
|
|
12
|
-
(0, type_graphql_1.Field)(),
|
|
12
|
+
(0, type_graphql_1.Field)({ description: 'The name for the new theme.' }),
|
|
13
13
|
tslib_1.__metadata("design:type", String)
|
|
14
14
|
], NewTheme.prototype, "name", void 0);
|
|
15
15
|
tslib_1.__decorate([
|
|
16
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
16
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description for the new theme.' }),
|
|
17
17
|
tslib_1.__metadata("design:type", String)
|
|
18
18
|
], NewTheme.prototype, "description", void 0);
|
|
19
19
|
tslib_1.__decorate([
|
|
20
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Whether the new theme should be active upon creation.' }),
|
|
21
21
|
tslib_1.__metadata("design:type", Boolean)
|
|
22
22
|
], NewTheme.prototype, "active", void 0);
|
|
23
23
|
tslib_1.__decorate([
|
|
24
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
24
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The type of the new theme.' }),
|
|
25
25
|
tslib_1.__metadata("design:type", String)
|
|
26
26
|
], NewTheme.prototype, "type", void 0);
|
|
27
27
|
tslib_1.__decorate([
|
|
28
|
-
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
28
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'A JSON object of style values for the new theme.' }),
|
|
29
29
|
tslib_1.__metadata("design:type", Object)
|
|
30
30
|
], NewTheme.prototype, "value", void 0);
|
|
31
31
|
exports.NewTheme = NewTheme = tslib_1.__decorate([
|
|
32
|
-
(0, type_graphql_1.InputType)()
|
|
32
|
+
(0, type_graphql_1.InputType)({ description: 'Input for creating a new theme.' })
|
|
33
33
|
], NewTheme);
|
|
34
34
|
let ThemePatch = class ThemePatch {
|
|
35
35
|
};
|
|
36
36
|
exports.ThemePatch = ThemePatch;
|
|
37
37
|
tslib_1.__decorate([
|
|
38
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
38
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'The unique identifier of the theme to update.' }),
|
|
39
39
|
tslib_1.__metadata("design:type", String)
|
|
40
40
|
], ThemePatch.prototype, "id", void 0);
|
|
41
41
|
tslib_1.__decorate([
|
|
42
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new name for the theme.' }),
|
|
43
43
|
tslib_1.__metadata("design:type", String)
|
|
44
44
|
], ThemePatch.prototype, "name", void 0);
|
|
45
45
|
tslib_1.__decorate([
|
|
46
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new description for the theme.' }),
|
|
47
47
|
tslib_1.__metadata("design:type", String)
|
|
48
48
|
], ThemePatch.prototype, "description", void 0);
|
|
49
49
|
tslib_1.__decorate([
|
|
50
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
50
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new active status for the theme.' }),
|
|
51
51
|
tslib_1.__metadata("design:type", Boolean)
|
|
52
52
|
], ThemePatch.prototype, "active", void 0);
|
|
53
53
|
tslib_1.__decorate([
|
|
54
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new type for the theme.' }),
|
|
55
55
|
tslib_1.__metadata("design:type", String)
|
|
56
56
|
], ThemePatch.prototype, "type", void 0);
|
|
57
57
|
tslib_1.__decorate([
|
|
58
|
-
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
58
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'The new JSON object of style values for the theme.' }),
|
|
59
59
|
tslib_1.__metadata("design:type", Object)
|
|
60
60
|
], ThemePatch.prototype, "value", void 0);
|
|
61
61
|
tslib_1.__decorate([
|
|
62
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A flag indicating whether the theme is being created, updated, or deleted.' }),
|
|
63
63
|
tslib_1.__metadata("design:type", String)
|
|
64
64
|
], ThemePatch.prototype, "cuFlag", void 0);
|
|
65
65
|
exports.ThemePatch = ThemePatch = tslib_1.__decorate([
|
|
66
|
-
(0, type_graphql_1.InputType)()
|
|
66
|
+
(0, type_graphql_1.InputType)({ description: 'Input for updating (patching) an existing theme.' })
|
|
67
67
|
], ThemePatch);
|
|
68
68
|
let ThemeList = class ThemeList {
|
|
69
69
|
};
|
|
70
70
|
exports.ThemeList = ThemeList;
|
|
71
71
|
tslib_1.__decorate([
|
|
72
|
-
(0, type_graphql_1.Field)(type => [theme_js_1.Theme]),
|
|
72
|
+
(0, type_graphql_1.Field)(type => [theme_js_1.Theme], { description: 'The list of theme items.' }),
|
|
73
73
|
tslib_1.__metadata("design:type", Array)
|
|
74
74
|
], ThemeList.prototype, "items", void 0);
|
|
75
75
|
tslib_1.__decorate([
|
|
76
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
76
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The total number of themes.' }),
|
|
77
77
|
tslib_1.__metadata("design:type", Number)
|
|
78
78
|
], ThemeList.prototype, "total", void 0);
|
|
79
79
|
exports.ThemeList = ThemeList = tslib_1.__decorate([
|
|
80
|
-
(0, type_graphql_1.ObjectType)()
|
|
80
|
+
(0, type_graphql_1.ObjectType)({ description: 'A paginated list of themes.' })
|
|
81
81
|
], ThemeList);
|
|
82
82
|
//# sourceMappingURL=theme-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-type.js","sourceRoot":"","sources":["../../../server/service/theme/theme-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iDAAoD;AACpD,yCAAkC;AAG3B,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAepB,CAAA;AAfY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,
|
|
1
|
+
{"version":3,"file":"theme-type.js","sourceRoot":"","sources":["../../../server/service/theme/theme-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iDAAoD;AACpD,yCAAkC;AAG3B,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAepB,CAAA;AAfY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;sCAC1C;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;6CAChE;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uDAAuD,EAAE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tB,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;GAClE,UAAU,CAqBtB;AAGM,IAAM,SAAS,GAAf,MAAM,SAAS;CAMrB,CAAA;AANY,8BAAS;AAEpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,gBAAK,CAAC,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;wCACtD;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;wCACtD;oBALF,SAAS;IADrB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GAC9C,SAAS,CAMrB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\nimport { Theme } from './theme.js'\n\n@InputType({ description: 'Input for creating a new theme.' })\nexport class NewTheme {\n @Field({ description: 'The name for the new theme.' })\n name: string\n\n @Field({ nullable: true, description: 'A detailed description for the new theme.' })\n description?: string\n\n @Field({ nullable: true, description: 'Whether the new theme should be active upon creation.' })\n active?: boolean\n\n @Field({ nullable: true, description: 'The type of the new theme.' })\n type?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'A JSON object of style values for the new theme.' })\n value?: any\n}\n\n@InputType({ description: 'Input for updating (patching) an existing theme.' })\nexport class ThemePatch {\n @Field(type => ID, { nullable: true, description: 'The unique identifier of the theme to update.' })\n id?: string\n\n @Field({ nullable: true, description: 'The new name for the theme.' })\n name?: string\n\n @Field({ nullable: true, description: 'The new description for the theme.' })\n description?: string\n\n @Field({ nullable: true, description: 'The new active status for the theme.' })\n active?: boolean\n\n @Field({ nullable: true, description: 'The new type for the theme.' })\n type?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'The new JSON object of style values for the theme.' })\n value?: any\n\n @Field({ nullable: true, description: 'A flag indicating whether the theme is being created, updated, or deleted.' })\n cuFlag?: string\n}\n\n@ObjectType({ description: 'A paginated list of themes.' })\nexport class ThemeList {\n @Field(type => [Theme], { description: 'The list of theme items.' })\n items: Theme[]\n\n @Field(type => Int, { description: 'The total number of themes.' })\n total: number\n}\n"]}
|
|
@@ -23,12 +23,12 @@ let Theme = class Theme {
|
|
|
23
23
|
exports.Theme = Theme;
|
|
24
24
|
tslib_1.__decorate([
|
|
25
25
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
26
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
26
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the theme.' }),
|
|
27
27
|
tslib_1.__metadata("design:type", String)
|
|
28
28
|
], Theme.prototype, "id", void 0);
|
|
29
29
|
tslib_1.__decorate([
|
|
30
30
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
31
|
-
(0, type_graphql_1.Field)(type => shell_1.Domain),
|
|
31
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { description: 'The domain to which this theme belongs.' }),
|
|
32
32
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
33
33
|
], Theme.prototype, "domain", void 0);
|
|
34
34
|
tslib_1.__decorate([
|
|
@@ -37,47 +37,50 @@ tslib_1.__decorate([
|
|
|
37
37
|
], Theme.prototype, "domainId", void 0);
|
|
38
38
|
tslib_1.__decorate([
|
|
39
39
|
(0, typeorm_1.Column)(),
|
|
40
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
40
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The name of the theme.' }),
|
|
41
41
|
tslib_1.__metadata("design:type", String)
|
|
42
42
|
], Theme.prototype, "name", void 0);
|
|
43
43
|
tslib_1.__decorate([
|
|
44
44
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
45
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description of the theme.' }),
|
|
46
46
|
tslib_1.__metadata("design:type", String)
|
|
47
47
|
], Theme.prototype, "description", void 0);
|
|
48
48
|
tslib_1.__decorate([
|
|
49
49
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
50
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
50
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether the theme is currently active and available for use.' }),
|
|
51
51
|
tslib_1.__metadata("design:type", Boolean)
|
|
52
52
|
], Theme.prototype, "active", void 0);
|
|
53
53
|
tslib_1.__decorate([
|
|
54
54
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
55
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The type of the theme (e.g., Legend).' }),
|
|
56
56
|
tslib_1.__metadata("design:type", String)
|
|
57
57
|
], Theme.prototype, "type", void 0);
|
|
58
58
|
tslib_1.__decorate([
|
|
59
59
|
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
60
|
-
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
|
|
60
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
|
|
61
|
+
nullable: true,
|
|
62
|
+
description: 'A JSON object containing the theme-specific style values.'
|
|
63
|
+
}),
|
|
61
64
|
tslib_1.__metadata("design:type", Object)
|
|
62
65
|
], Theme.prototype, "value", void 0);
|
|
63
66
|
tslib_1.__decorate([
|
|
64
67
|
(0, typeorm_1.CreateDateColumn)(),
|
|
65
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
68
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the theme was created.' }),
|
|
66
69
|
tslib_1.__metadata("design:type", Date)
|
|
67
70
|
], Theme.prototype, "createdAt", void 0);
|
|
68
71
|
tslib_1.__decorate([
|
|
69
72
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
70
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the theme was last updated.' }),
|
|
71
74
|
tslib_1.__metadata("design:type", Date)
|
|
72
75
|
], Theme.prototype, "updatedAt", void 0);
|
|
73
76
|
tslib_1.__decorate([
|
|
74
77
|
(0, typeorm_1.DeleteDateColumn)(),
|
|
75
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the theme was soft-deleted.' }),
|
|
76
79
|
tslib_1.__metadata("design:type", Date)
|
|
77
80
|
], Theme.prototype, "deletedAt", void 0);
|
|
78
81
|
tslib_1.__decorate([
|
|
79
82
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
80
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
83
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created the theme.' }),
|
|
81
84
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
82
85
|
], Theme.prototype, "creator", void 0);
|
|
83
86
|
tslib_1.__decorate([
|
|
@@ -86,7 +89,7 @@ tslib_1.__decorate([
|
|
|
86
89
|
], Theme.prototype, "creatorId", void 0);
|
|
87
90
|
tslib_1.__decorate([
|
|
88
91
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
89
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
92
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated the theme.' }),
|
|
90
93
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
91
94
|
], Theme.prototype, "updater", void 0);
|
|
92
95
|
tslib_1.__decorate([
|
|
@@ -96,6 +99,6 @@ tslib_1.__decorate([
|
|
|
96
99
|
exports.Theme = Theme = tslib_1.__decorate([
|
|
97
100
|
(0, typeorm_1.Entity)(),
|
|
98
101
|
(0, typeorm_1.Index)('ix_theme_0', (theme) => [theme.domain, theme.name, theme.deletedAt], { unique: true }),
|
|
99
|
-
(0, type_graphql_1.ObjectType)({ description: '
|
|
102
|
+
(0, type_graphql_1.ObjectType)({ description: 'Represents a visual theme or style that can be applied to dashboard components.' })
|
|
100
103
|
], Theme);
|
|
101
104
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../server/service/theme/theme.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAoD;AAEpD,iDAA4D;AAC5D,yDAAgD;AAOhD,IAAI,UAAU,GAAkC;IAC9C,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAA;AAKM,IAAM,KAAK,GAAX,MAAM,KAAK;IAChB,MAAM,CAAC,iBAAiB,CAAC,SAAoB;QAC3C,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;IACxC,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,IAAY;QAC9B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../server/service/theme/theme.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAoD;AAEpD,iDAA4D;AAC5D,yDAAgD;AAOhD,IAAI,UAAU,GAAkC;IAC9C,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAA;AAKM,IAAM,KAAK,GAAX,MAAM,KAAK;IAChB,MAAM,CAAC,iBAAiB,CAAC,SAAoB;QAC3C,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;IACxC,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,IAAY;QAC9B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;CA6DF,CAAA;AAp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E;IACR,IAAA,eAAK,EAAC,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACpG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iFAAiF,EAAE,CAAC;GAClG,KAAK,CAoEjB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain, ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport interface ThemeType {\n name: string\n propType: string\n}\n\nvar ThemeTypes: { [name: string]: ThemeType } = {\n Legend: {\n name: 'Legend',\n propType: 'legend'\n }\n}\n\n@Entity()\n@Index('ix_theme_0', (theme: Theme) => [theme.domain, theme.name, theme.deletedAt], { unique: true })\n@ObjectType({ description: 'Represents a visual theme or style that can be applied to dashboard components.' })\nexport class Theme {\n static registerThemeType(themeType: ThemeType) {\n ThemeTypes[themeType.name] = themeType\n }\n\n static getThemeType(name: string) {\n return ThemeTypes[name]\n }\n\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the theme.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { description: 'The domain to which this theme belongs.' })\n domain?: Domain\n\n @RelationId((theme: Theme) => theme.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true, description: 'The name of the theme.' })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'A detailed description of the theme.' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates whether the theme is currently active and available for use.' })\n active: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The type of the theme (e.g., Legend).' })\n type?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'A JSON object containing the theme-specific style values.'\n })\n value?: any\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the theme was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the theme was last updated.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the theme was soft-deleted.' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created the theme.' })\n creator?: User\n\n @RelationId((theme: Theme) => theme.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the theme.' })\n updater?: User\n\n @RelationId((theme: Theme) => theme.updater)\n updaterId?: string\n}\n"]}
|