@things-factory/board-service 9.0.0-beta.24 → 9.0.0-beta.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/package.json +6 -6
  2. package/dist-server/constants/error-code.d.ts +0 -2
  3. package/dist-server/constants/error-code.js +0 -6
  4. package/dist-server/constants/error-code.js.map +0 -1
  5. package/dist-server/controllers/analyzer/analyze-integration.d.ts +0 -5
  6. package/dist-server/controllers/analyzer/analyze-integration.js +0 -117
  7. package/dist-server/controllers/analyzer/analyze-integration.js.map +0 -1
  8. package/dist-server/controllers/fonts.d.ts +0 -9
  9. package/dist-server/controllers/fonts.js +0 -76
  10. package/dist-server/controllers/fonts.js.map +0 -1
  11. package/dist-server/controllers/headless-model.d.ts +0 -6
  12. package/dist-server/controllers/headless-model.js +0 -55
  13. package/dist-server/controllers/headless-model.js.map +0 -1
  14. package/dist-server/controllers/headless-pdf-to-image.d.ts +0 -12
  15. package/dist-server/controllers/headless-pdf-to-image.js +0 -106
  16. package/dist-server/controllers/headless-pdf-to-image.js.map +0 -1
  17. package/dist-server/controllers/headless-playlist.d.ts +0 -5
  18. package/dist-server/controllers/headless-playlist.js +0 -71
  19. package/dist-server/controllers/headless-playlist.js.map +0 -1
  20. package/dist-server/controllers/headless-pool-for-board.d.ts +0 -1
  21. package/dist-server/controllers/headless-pool-for-board.js +0 -64
  22. package/dist-server/controllers/headless-pool-for-board.js.map +0 -1
  23. package/dist-server/controllers/headless-pool-for-label.d.ts +0 -1
  24. package/dist-server/controllers/headless-pool-for-label.js +0 -133
  25. package/dist-server/controllers/headless-pool-for-label.js.map +0 -1
  26. package/dist-server/controllers/index.d.ts +0 -34
  27. package/dist-server/controllers/index.js +0 -14
  28. package/dist-server/controllers/index.js.map +0 -1
  29. package/dist-server/controllers/label-command.d.ts +0 -19
  30. package/dist-server/controllers/label-command.js +0 -52
  31. package/dist-server/controllers/label-command.js.map +0 -1
  32. package/dist-server/controllers/pdf.d.ts +0 -9
  33. package/dist-server/controllers/pdf.js +0 -102
  34. package/dist-server/controllers/pdf.js.map +0 -1
  35. package/dist-server/controllers/screenshot.d.ts +0 -11
  36. package/dist-server/controllers/screenshot.js +0 -101
  37. package/dist-server/controllers/screenshot.js.map +0 -1
  38. package/dist-server/controllers/thumbnail.d.ts +0 -7
  39. package/dist-server/controllers/thumbnail.js +0 -16
  40. package/dist-server/controllers/thumbnail.js.map +0 -1
  41. package/dist-server/errors/index.d.ts +0 -1
  42. package/dist-server/errors/index.js +0 -5
  43. package/dist-server/errors/index.js.map +0 -1
  44. package/dist-server/errors/license-error.d.ts +0 -11
  45. package/dist-server/errors/license-error.js +0 -18
  46. package/dist-server/errors/license-error.js.map +0 -1
  47. package/dist-server/index.d.ts +0 -5
  48. package/dist-server/index.js +0 -35
  49. package/dist-server/index.js.map +0 -1
  50. package/dist-server/migrations/1556862253000-SeedGroup.d.ts +0 -5
  51. package/dist-server/migrations/1556862253000-SeedGroup.js +0 -43
  52. package/dist-server/migrations/1556862253000-SeedGroup.js.map +0 -1
  53. package/dist-server/migrations/index.d.ts +0 -1
  54. package/dist-server/migrations/index.js +0 -12
  55. package/dist-server/migrations/index.js.map +0 -1
  56. package/dist-server/routers/internal-board-view-router.d.ts +0 -1
  57. package/dist-server/routers/internal-board-view-router.js +0 -32
  58. package/dist-server/routers/internal-board-view-router.js.map +0 -1
  59. package/dist-server/routers/standalone-board-service-router.d.ts +0 -1
  60. package/dist-server/routers/standalone-board-service-router.js +0 -250
  61. package/dist-server/routers/standalone-board-service-router.js.map +0 -1
  62. package/dist-server/routes.d.ts +0 -1
  63. package/dist-server/routes.js +0 -23
  64. package/dist-server/routes.js.map +0 -1
  65. package/dist-server/service/analysis/analysis-query.d.ts +0 -3
  66. package/dist-server/service/analysis/analysis-query.js +0 -25
  67. package/dist-server/service/analysis/analysis-query.js.map +0 -1
  68. package/dist-server/service/analysis/index.d.ts +0 -2
  69. package/dist-server/service/analysis/index.js +0 -6
  70. package/dist-server/service/analysis/index.js.map +0 -1
  71. package/dist-server/service/board/board-history.d.ts +0 -28
  72. package/dist-server/service/board/board-history.js +0 -155
  73. package/dist-server/service/board/board-history.js.map +0 -1
  74. package/dist-server/service/board/board-mutation.d.ts +0 -12
  75. package/dist-server/service/board/board-mutation.js +0 -377
  76. package/dist-server/service/board/board-mutation.js.map +0 -1
  77. package/dist-server/service/board/board-query.d.ts +0 -20
  78. package/dist-server/service/board/board-query.js +0 -220
  79. package/dist-server/service/board/board-query.js.map +0 -1
  80. package/dist-server/service/board/board-subscription.d.ts +0 -6
  81. package/dist-server/service/board/board-subscription.js +0 -49
  82. package/dist-server/service/board/board-subscription.js.map +0 -1
  83. package/dist-server/service/board/board-type.d.ts +0 -24
  84. package/dist-server/service/board/board-type.js +0 -88
  85. package/dist-server/service/board/board-type.js.map +0 -1
  86. package/dist-server/service/board/board.d.ts +0 -25
  87. package/dist-server/service/board/board.js +0 -140
  88. package/dist-server/service/board/board.js.map +0 -1
  89. package/dist-server/service/board/event-subscriber.d.ts +0 -15
  90. package/dist-server/service/board/event-subscriber.js +0 -63
  91. package/dist-server/service/board/event-subscriber.js.map +0 -1
  92. package/dist-server/service/board/index.d.ts +0 -9
  93. package/dist-server/service/board/index.js +0 -13
  94. package/dist-server/service/board/index.js.map +0 -1
  95. package/dist-server/service/board-favorite/board-favorite-query.d.ts +0 -5
  96. package/dist-server/service/board-favorite/board-favorite-query.js +0 -56
  97. package/dist-server/service/board-favorite/board-favorite-query.js.map +0 -1
  98. package/dist-server/service/board-favorite/board-favorite-type.d.ts +0 -8
  99. package/dist-server/service/board-favorite/board-favorite-type.js +0 -31
  100. package/dist-server/service/board-favorite/board-favorite-type.js.map +0 -1
  101. package/dist-server/service/board-favorite/index.d.ts +0 -3
  102. package/dist-server/service/board-favorite/index.js +0 -7
  103. package/dist-server/service/board-favorite/index.js.map +0 -1
  104. package/dist-server/service/board-template/board-template-mutation.d.ts +0 -8
  105. package/dist-server/service/board-template/board-template-mutation.js +0 -146
  106. package/dist-server/service/board-template/board-template-mutation.js.map +0 -1
  107. package/dist-server/service/board-template/board-template-query.d.ts +0 -13
  108. package/dist-server/service/board-template/board-template-query.js +0 -147
  109. package/dist-server/service/board-template/board-template-query.js.map +0 -1
  110. package/dist-server/service/board-template/board-template-type.d.ts +0 -21
  111. package/dist-server/service/board-template/board-template-type.js +0 -81
  112. package/dist-server/service/board-template/board-template-type.js.map +0 -1
  113. package/dist-server/service/board-template/board-template.d.ts +0 -23
  114. package/dist-server/service/board-template/board-template.js +0 -123
  115. package/dist-server/service/board-template/board-template.js.map +0 -1
  116. package/dist-server/service/board-template/index.d.ts +0 -6
  117. package/dist-server/service/board-template/index.js +0 -10
  118. package/dist-server/service/board-template/index.js.map +0 -1
  119. package/dist-server/service/group/group-mutation.d.ts +0 -8
  120. package/dist-server/service/group/group-mutation.js +0 -89
  121. package/dist-server/service/group/group-mutation.js.map +0 -1
  122. package/dist-server/service/group/group-query.d.ts +0 -13
  123. package/dist-server/service/group/group-query.js +0 -92
  124. package/dist-server/service/group/group-query.js.map +0 -1
  125. package/dist-server/service/group/group-type.d.ts +0 -13
  126. package/dist-server/service/group/group-type.js +0 -49
  127. package/dist-server/service/group/group-type.js.map +0 -1
  128. package/dist-server/service/group/group.d.ts +0 -17
  129. package/dist-server/service/group/group.js +0 -77
  130. package/dist-server/service/group/group.js.map +0 -1
  131. package/dist-server/service/group/index.d.ts +0 -5
  132. package/dist-server/service/group/index.js +0 -9
  133. package/dist-server/service/group/index.js.map +0 -1
  134. package/dist-server/service/index.d.ts +0 -10
  135. package/dist-server/service/index.js +0 -49
  136. package/dist-server/service/index.js.map +0 -1
  137. package/dist-server/service/permission/domain-permission-subscriber.d.ts +0 -9
  138. package/dist-server/service/permission/domain-permission-subscriber.js +0 -30
  139. package/dist-server/service/permission/domain-permission-subscriber.js.map +0 -1
  140. package/dist-server/service/permission/index.d.ts +0 -2
  141. package/dist-server/service/permission/index.js +0 -6
  142. package/dist-server/service/permission/index.js.map +0 -1
  143. package/dist-server/service/play-group/event-subscriber.d.ts +0 -6
  144. package/dist-server/service/play-group/event-subscriber.js +0 -58
  145. package/dist-server/service/play-group/event-subscriber.js.map +0 -1
  146. package/dist-server/service/play-group/index.d.ts +0 -8
  147. package/dist-server/service/play-group/index.js +0 -12
  148. package/dist-server/service/play-group/index.js.map +0 -1
  149. package/dist-server/service/play-group/play-group-mutation.d.ts +0 -10
  150. package/dist-server/service/play-group/play-group-mutation.js +0 -146
  151. package/dist-server/service/play-group/play-group-mutation.js.map +0 -1
  152. package/dist-server/service/play-group/play-group-query.d.ts +0 -14
  153. package/dist-server/service/play-group/play-group-query.js +0 -129
  154. package/dist-server/service/play-group/play-group-query.js.map +0 -1
  155. package/dist-server/service/play-group/play-group-subscription.d.ts +0 -6
  156. package/dist-server/service/play-group/play-group-subscription.js +0 -49
  157. package/dist-server/service/play-group/play-group-subscription.js.map +0 -1
  158. package/dist-server/service/play-group/play-group-type.d.ts +0 -13
  159. package/dist-server/service/play-group/play-group-type.js +0 -49
  160. package/dist-server/service/play-group/play-group-type.js.map +0 -1
  161. package/dist-server/service/play-group/play-group.d.ts +0 -18
  162. package/dist-server/service/play-group/play-group.js +0 -82
  163. package/dist-server/service/play-group/play-group.js.map +0 -1
  164. package/dist-server/service/theme/index.d.ts +0 -6
  165. package/dist-server/service/theme/index.js +0 -10
  166. package/dist-server/service/theme/index.js.map +0 -1
  167. package/dist-server/service/theme/theme-mutation.d.ts +0 -10
  168. package/dist-server/service/theme/theme-mutation.js +0 -125
  169. package/dist-server/service/theme/theme-mutation.js.map +0 -1
  170. package/dist-server/service/theme/theme-query.d.ts +0 -11
  171. package/dist-server/service/theme/theme-query.js +0 -79
  172. package/dist-server/service/theme/theme-query.js.map +0 -1
  173. package/dist-server/service/theme/theme-type.d.ts +0 -21
  174. package/dist-server/service/theme/theme-type.js +0 -82
  175. package/dist-server/service/theme/theme-type.js.map +0 -1
  176. package/dist-server/service/theme/theme.d.ts +0 -25
  177. package/dist-server/service/theme/theme.js +0 -101
  178. package/dist-server/service/theme/theme.js.map +0 -1
  179. package/dist-server/tsconfig.tsbuildinfo +0 -1
@@ -1,125 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ThemeMutation = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const typeorm_1 = require("typeorm");
7
- const theme_js_1 = require("./theme.js");
8
- const theme_type_js_1 = require("./theme-type.js");
9
- let ThemeMutation = class ThemeMutation {
10
- async createTheme(theme, context) {
11
- const { domain, user, tx } = context.state;
12
- return await tx.getRepository(theme_js_1.Theme).save(Object.assign(Object.assign({}, theme), { domain, creator: user, updater: user }));
13
- }
14
- async updateTheme(id, patch, context) {
15
- const { domain, user, tx } = context.state;
16
- const repository = tx.getRepository(theme_js_1.Theme);
17
- const theme = await repository.findOne({
18
- where: { domain: { id: domain.id }, id }
19
- });
20
- return await repository.save(Object.assign(Object.assign(Object.assign({}, theme), patch), { updater: user }));
21
- }
22
- async updateMultipleTheme(patches, context) {
23
- const { domain, user, tx } = context.state;
24
- let results = [];
25
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
26
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
27
- const themeRepo = tx.getRepository(theme_js_1.Theme);
28
- if (_createRecords.length > 0) {
29
- for (let i = 0; i < _createRecords.length; i++) {
30
- const newRecord = _createRecords[i];
31
- const result = await themeRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
32
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
33
- }
34
- }
35
- if (_updateRecords.length > 0) {
36
- for (let i = 0; i < _updateRecords.length; i++) {
37
- const updateRecord = _updateRecords[i];
38
- const theme = await themeRepo.findOneBy({ id: updateRecord.id });
39
- const result = await themeRepo.save(Object.assign(Object.assign(Object.assign({}, theme), updateRecord), { updater: user }));
40
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
41
- }
42
- }
43
- return results;
44
- }
45
- async deleteTheme(id, context) {
46
- const { domain, tx } = context.state;
47
- await tx.getRepository(theme_js_1.Theme).delete({ domain: { id: domain.id }, id });
48
- return true;
49
- }
50
- async deleteThemes(ids, context) {
51
- const { domain, tx } = context.state;
52
- await tx.getRepository(theme_js_1.Theme).delete({
53
- domain: { id: domain.id },
54
- id: (0, typeorm_1.In)(ids)
55
- });
56
- return true;
57
- }
58
- async importThemes(themes, context) {
59
- const { domain, tx } = context.state;
60
- await Promise.all(themes.map(async (theme) => {
61
- const createdTheme = await tx.getRepository(theme_js_1.Theme).save(Object.assign({ domain }, theme));
62
- }));
63
- return true;
64
- }
65
- };
66
- exports.ThemeMutation = ThemeMutation;
67
- tslib_1.__decorate([
68
- (0, type_graphql_1.Directive)('@transaction'),
69
- (0, type_graphql_1.Mutation)(returns => theme_js_1.Theme, { description: 'To create new Theme' }),
70
- tslib_1.__param(0, (0, type_graphql_1.Arg)('theme')),
71
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
72
- tslib_1.__metadata("design:type", Function),
73
- tslib_1.__metadata("design:paramtypes", [theme_type_js_1.NewTheme, Object]),
74
- tslib_1.__metadata("design:returntype", Promise)
75
- ], ThemeMutation.prototype, "createTheme", null);
76
- tslib_1.__decorate([
77
- (0, type_graphql_1.Directive)('@transaction'),
78
- (0, type_graphql_1.Mutation)(returns => theme_js_1.Theme, { description: 'To modify Theme information' }),
79
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
80
- tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
81
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
82
- tslib_1.__metadata("design:type", Function),
83
- tslib_1.__metadata("design:paramtypes", [String, theme_type_js_1.ThemePatch, Object]),
84
- tslib_1.__metadata("design:returntype", Promise)
85
- ], ThemeMutation.prototype, "updateTheme", null);
86
- tslib_1.__decorate([
87
- (0, type_graphql_1.Directive)('@transaction'),
88
- (0, type_graphql_1.Mutation)(returns => [theme_js_1.Theme], { description: "To modify multiple Themes' information" }),
89
- tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [theme_type_js_1.ThemePatch])),
90
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
91
- tslib_1.__metadata("design:type", Function),
92
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
93
- tslib_1.__metadata("design:returntype", Promise)
94
- ], ThemeMutation.prototype, "updateMultipleTheme", null);
95
- tslib_1.__decorate([
96
- (0, type_graphql_1.Directive)('@transaction'),
97
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Theme' }),
98
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
99
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
100
- tslib_1.__metadata("design:type", Function),
101
- tslib_1.__metadata("design:paramtypes", [String, Object]),
102
- tslib_1.__metadata("design:returntype", Promise)
103
- ], ThemeMutation.prototype, "deleteTheme", null);
104
- tslib_1.__decorate([
105
- (0, type_graphql_1.Directive)('@transaction'),
106
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Themes' }),
107
- tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
108
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
109
- tslib_1.__metadata("design:type", Function),
110
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
111
- tslib_1.__metadata("design:returntype", Promise)
112
- ], ThemeMutation.prototype, "deleteThemes", null);
113
- tslib_1.__decorate([
114
- (0, type_graphql_1.Directive)('@transaction'),
115
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Themes' }),
116
- tslib_1.__param(0, (0, type_graphql_1.Arg)('themes', type => [theme_type_js_1.ThemePatch])),
117
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
118
- tslib_1.__metadata("design:type", Function),
119
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
120
- tslib_1.__metadata("design:returntype", Promise)
121
- ], ThemeMutation.prototype, "importThemes", null);
122
- exports.ThemeMutation = ThemeMutation = tslib_1.__decorate([
123
- (0, type_graphql_1.Resolver)(theme_js_1.Theme)
124
- ], ThemeMutation);
125
- //# sourceMappingURL=theme-mutation.js.map
@@ -1 +0,0 @@
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,iCACpC,KAAK,KACR,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,WAAW,CACJ,EAAU,EACP,KAAiB,EACxB,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,gBAAK,CAAC,CAAA;QAC1C,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,KAAK,GACL,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CACe,OAAqB,EACpD,OAAwB;QAE/B,MAAM,EAAE,M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IK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IACvD,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,2BAA2B,EAAE,CAAC;IAExE,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAU,CAAC,CAAC,CAAA;IACnC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAWP;wBAvHU,aAAa;IADzB,IAAA,uBAAQ,EAAC,gBAAK,CAAC;GACH,aAAa,CAwHzB","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: 'To create 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: 'To modify Theme information' })\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], { description: \"To modify multiple Themes' information\" })\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: 'To delete Theme' })\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: 'To delete multiple Themes' })\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: 'To import 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"]}
@@ -1,11 +0,0 @@
1
- import { Domain, ListParam } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- import { Theme } from './theme.js';
4
- import { ThemeList } from './theme-type.js';
5
- export declare class ThemeQuery {
6
- theme(id: string, context: ResolverContext): Promise<Theme>;
7
- themes(params: ListParam, context: ResolverContext): Promise<ThemeList>;
8
- domain(theme: Theme): Promise<Domain>;
9
- updater(theme: Theme): Promise<User>;
10
- creator(theme: Theme): Promise<User>;
11
- }
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ThemeQuery = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const shell_1 = require("@things-factory/shell");
7
- const auth_base_1 = require("@things-factory/auth-base");
8
- const theme_js_1 = require("./theme.js");
9
- const theme_type_js_1 = require("./theme-type.js");
10
- let ThemeQuery = class ThemeQuery {
11
- async theme(id, context) {
12
- const { domain } = context.state;
13
- return await (0, shell_1.getRepository)(theme_js_1.Theme).findOne({
14
- where: { domain: { id: domain.id }, id }
15
- });
16
- }
17
- async themes(params, context) {
18
- const { domain } = context.state;
19
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
- domain,
21
- params,
22
- repository: await (0, shell_1.getRepository)(theme_js_1.Theme),
23
- searchables: ['name', 'description']
24
- });
25
- const [items, total] = await queryBuilder.getManyAndCount();
26
- return { items, total };
27
- }
28
- async domain(theme) {
29
- return theme.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: theme.domainId }));
30
- }
31
- async updater(theme) {
32
- return theme.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: theme.updaterId }));
33
- }
34
- async creator(theme) {
35
- return theme.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: theme.creatorId }));
36
- }
37
- };
38
- exports.ThemeQuery = ThemeQuery;
39
- tslib_1.__decorate([
40
- (0, type_graphql_1.Query)(returns => theme_js_1.Theme, { nullable: true, description: 'To fetch a Theme' }),
41
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
42
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
43
- tslib_1.__metadata("design:type", Function),
44
- tslib_1.__metadata("design:paramtypes", [String, Object]),
45
- tslib_1.__metadata("design:returntype", Promise)
46
- ], ThemeQuery.prototype, "theme", null);
47
- tslib_1.__decorate([
48
- (0, type_graphql_1.Query)(returns => theme_type_js_1.ThemeList, { description: 'To fetch multiple Themes' }),
49
- tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
50
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
51
- tslib_1.__metadata("design:type", Function),
52
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
53
- tslib_1.__metadata("design:returntype", Promise)
54
- ], ThemeQuery.prototype, "themes", null);
55
- tslib_1.__decorate([
56
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
57
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
58
- tslib_1.__metadata("design:type", Function),
59
- tslib_1.__metadata("design:paramtypes", [theme_js_1.Theme]),
60
- tslib_1.__metadata("design:returntype", Promise)
61
- ], ThemeQuery.prototype, "domain", null);
62
- tslib_1.__decorate([
63
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
64
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
65
- tslib_1.__metadata("design:type", Function),
66
- tslib_1.__metadata("design:paramtypes", [theme_js_1.Theme]),
67
- tslib_1.__metadata("design:returntype", Promise)
68
- ], ThemeQuery.prototype, "updater", null);
69
- tslib_1.__decorate([
70
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
71
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
72
- tslib_1.__metadata("design:type", Function),
73
- tslib_1.__metadata("design:paramtypes", [theme_js_1.Theme]),
74
- tslib_1.__metadata("design:returntype", Promise)
75
- ], ThemeQuery.prototype, "creator", null);
76
- exports.ThemeQuery = ThemeQuery = tslib_1.__decorate([
77
- (0, type_graphql_1.Resolver)(theme_js_1.Theme)
78
- ], ThemeQuery);
79
- //# sourceMappingURL=theme-query.js.map
@@ -1 +0,0 @@
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,CA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A;;6CAAQ,gBAAK;;wCAEhC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,gBAAK;;yCAEjC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,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: 'To fetch a Theme' })\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: 'To fetch multiple 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)\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)\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)\n async creator(@Root() theme: Theme): Promise<User> {\n return theme.creatorId && (await getRepository(User).findOneBy({ id: theme.creatorId }))\n }\n}\n"]}
@@ -1,21 +0,0 @@
1
- import { Theme } from './theme.js';
2
- export declare class NewTheme {
3
- name: string;
4
- description?: string;
5
- active?: boolean;
6
- type?: string;
7
- value?: any;
8
- }
9
- export declare class ThemePatch {
10
- id?: string;
11
- name?: string;
12
- description?: string;
13
- active?: boolean;
14
- type?: string;
15
- value?: any;
16
- cuFlag?: string;
17
- }
18
- export declare class ThemeList {
19
- items: Theme[];
20
- total: number;
21
- }
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ThemeList = exports.ThemePatch = exports.NewTheme = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const shell_1 = require("@things-factory/shell");
7
- const theme_js_1 = require("./theme.js");
8
- let NewTheme = class NewTheme {
9
- };
10
- exports.NewTheme = NewTheme;
11
- tslib_1.__decorate([
12
- (0, type_graphql_1.Field)(),
13
- tslib_1.__metadata("design:type", String)
14
- ], NewTheme.prototype, "name", void 0);
15
- tslib_1.__decorate([
16
- (0, type_graphql_1.Field)({ nullable: true }),
17
- tslib_1.__metadata("design:type", String)
18
- ], NewTheme.prototype, "description", void 0);
19
- tslib_1.__decorate([
20
- (0, type_graphql_1.Field)({ nullable: true }),
21
- tslib_1.__metadata("design:type", Boolean)
22
- ], NewTheme.prototype, "active", void 0);
23
- tslib_1.__decorate([
24
- (0, type_graphql_1.Field)({ nullable: true }),
25
- tslib_1.__metadata("design:type", String)
26
- ], NewTheme.prototype, "type", void 0);
27
- tslib_1.__decorate([
28
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
29
- tslib_1.__metadata("design:type", Object)
30
- ], NewTheme.prototype, "value", void 0);
31
- exports.NewTheme = NewTheme = tslib_1.__decorate([
32
- (0, type_graphql_1.InputType)()
33
- ], NewTheme);
34
- let ThemePatch = class ThemePatch {
35
- };
36
- exports.ThemePatch = ThemePatch;
37
- tslib_1.__decorate([
38
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
39
- tslib_1.__metadata("design:type", String)
40
- ], ThemePatch.prototype, "id", void 0);
41
- tslib_1.__decorate([
42
- (0, type_graphql_1.Field)({ nullable: true }),
43
- tslib_1.__metadata("design:type", String)
44
- ], ThemePatch.prototype, "name", void 0);
45
- tslib_1.__decorate([
46
- (0, type_graphql_1.Field)({ nullable: true }),
47
- tslib_1.__metadata("design:type", String)
48
- ], ThemePatch.prototype, "description", void 0);
49
- tslib_1.__decorate([
50
- (0, type_graphql_1.Field)({ nullable: true }),
51
- tslib_1.__metadata("design:type", Boolean)
52
- ], ThemePatch.prototype, "active", void 0);
53
- tslib_1.__decorate([
54
- (0, type_graphql_1.Field)({ nullable: true }),
55
- tslib_1.__metadata("design:type", String)
56
- ], ThemePatch.prototype, "type", void 0);
57
- tslib_1.__decorate([
58
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
59
- tslib_1.__metadata("design:type", Object)
60
- ], ThemePatch.prototype, "value", void 0);
61
- tslib_1.__decorate([
62
- (0, type_graphql_1.Field)({ nullable: true }),
63
- tslib_1.__metadata("design:type", String)
64
- ], ThemePatch.prototype, "cuFlag", void 0);
65
- exports.ThemePatch = ThemePatch = tslib_1.__decorate([
66
- (0, type_graphql_1.InputType)()
67
- ], ThemePatch);
68
- let ThemeList = class ThemeList {
69
- };
70
- exports.ThemeList = ThemeList;
71
- tslib_1.__decorate([
72
- (0, type_graphql_1.Field)(type => [theme_js_1.Theme]),
73
- tslib_1.__metadata("design:type", Array)
74
- ], ThemeList.prototype, "items", void 0);
75
- tslib_1.__decorate([
76
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
77
- tslib_1.__metadata("design:type", Number)
78
- ], ThemeList.prototype, "total", void 0);
79
- exports.ThemeList = ThemeList = tslib_1.__decorate([
80
- (0, type_graphql_1.ObjectType)()
81
- ], ThemeList);
82
- //# sourceMappingUR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AE,CAAC;;yCACrC;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACX;qBApBJ,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAqBtB;AAGM,IAAM,SAAS,GAAf,MAAM,SAAS;CAMrB,CAAA;AANY,8BAAS;AAEpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,gBAAK,CAAC,CAAC;;wCACT;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;wCACN;oBALF,SAAS;IADrB,IAAA,yBAAU,GAAE;GACA,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()\nexport class NewTheme {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ScalarObject, { nullable: true })\n value?: any\n}\n\n@InputType()\nexport class ThemePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ScalarObject, { nullable: true })\n value?: any\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ThemeList {\n @Field(type => [Theme])\n items: Theme[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,25 +0,0 @@
1
- import { Domain } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
- export interface ThemeType {
4
- name: string;
5
- propType: string;
6
- }
7
- export declare class Theme {
8
- static registerThemeType(themeType: ThemeType): void;
9
- static getThemeType(name: string): ThemeType;
10
- readonly id: string;
11
- domain?: Domain;
12
- domainId?: string;
13
- name?: string;
14
- description?: string;
15
- active: boolean;
16
- type?: string;
17
- value?: any;
18
- createdAt?: Date;
19
- updatedAt?: Date;
20
- deletedAt?: Date;
21
- creator?: User;
22
- creatorId?: string;
23
- updater?: User;
24
- updaterId?: string;
25
- }
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Theme = void 0;
4
- const tslib_1 = require("tslib");
5
- const typeorm_1 = require("typeorm");
6
- const type_graphql_1 = require("type-graphql");
7
- const shell_1 = require("@things-factory/shell");
8
- const auth_base_1 = require("@things-factory/auth-base");
9
- var ThemeTypes = {
10
- Legend: {
11
- name: 'Legend',
12
- propType: 'legend'
13
- }
14
- };
15
- let Theme = class Theme {
16
- static registerThemeType(themeType) {
17
- ThemeTypes[themeType.name] = themeType;
18
- }
19
- static getThemeType(name) {
20
- return ThemeTypes[name];
21
- }
22
- };
23
- exports.Theme = Theme;
24
- tslib_1.__decorate([
25
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
26
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
27
- tslib_1.__metadata("design:type", String)
28
- ], Theme.prototype, "id", void 0);
29
- tslib_1.__decorate([
30
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
31
- (0, type_graphql_1.Field)(type => shell_1.Domain),
32
- tslib_1.__metadata("design:type", shell_1.Domain)
33
- ], Theme.prototype, "domain", void 0);
34
- tslib_1.__decorate([
35
- (0, typeorm_1.RelationId)((theme) => theme.domain),
36
- tslib_1.__metadata("design:type", String)
37
- ], Theme.prototype, "domainId", void 0);
38
- tslib_1.__decorate([
39
- (0, typeorm_1.Column)(),
40
- (0, type_graphql_1.Field)({ nullable: true }),
41
- tslib_1.__metadata("design:type", String)
42
- ], Theme.prototype, "name", void 0);
43
- tslib_1.__decorate([
44
- (0, typeorm_1.Column)({ nullable: true }),
45
- (0, type_graphql_1.Field)({ nullable: true }),
46
- tslib_1.__metadata("design:type", String)
47
- ], Theme.prototype, "description", void 0);
48
- tslib_1.__decorate([
49
- (0, typeorm_1.Column)({ nullable: true }),
50
- (0, type_graphql_1.Field)({ nullable: true }),
51
- tslib_1.__metadata("design:type", Boolean)
52
- ], Theme.prototype, "active", void 0);
53
- tslib_1.__decorate([
54
- (0, typeorm_1.Column)({ nullable: true }),
55
- (0, type_graphql_1.Field)({ nullable: true }),
56
- tslib_1.__metadata("design:type", String)
57
- ], Theme.prototype, "type", void 0);
58
- tslib_1.__decorate([
59
- (0, typeorm_1.Column)('simple-json', { nullable: true }),
60
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
61
- tslib_1.__metadata("design:type", Object)
62
- ], Theme.prototype, "value", void 0);
63
- tslib_1.__decorate([
64
- (0, typeorm_1.CreateDateColumn)(),
65
- (0, type_graphql_1.Field)({ nullable: true }),
66
- tslib_1.__metadata("design:type", Date)
67
- ], Theme.prototype, "createdAt", void 0);
68
- tslib_1.__decorate([
69
- (0, typeorm_1.UpdateDateColumn)(),
70
- (0, type_graphql_1.Field)({ nullable: true }),
71
- tslib_1.__metadata("design:type", Date)
72
- ], Theme.prototype, "updatedAt", void 0);
73
- tslib_1.__decorate([
74
- (0, typeorm_1.DeleteDateColumn)(),
75
- (0, type_graphql_1.Field)({ nullable: true }),
76
- tslib_1.__metadata("design:type", Date)
77
- ], Theme.prototype, "deletedAt", void 0);
78
- tslib_1.__decorate([
79
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
80
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
81
- tslib_1.__metadata("design:type", auth_base_1.User)
82
- ], Theme.prototype, "creator", void 0);
83
- tslib_1.__decorate([
84
- (0, typeorm_1.RelationId)((theme) => theme.creator),
85
- tslib_1.__metadata("design:type", String)
86
- ], Theme.prototype, "creatorId", void 0);
87
- tslib_1.__decorate([
88
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
89
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
90
- tslib_1.__metadata("design:type", auth_base_1.User)
91
- ], Theme.prototype, "updater", void 0);
92
- tslib_1.__decorate([
93
- (0, typeorm_1.RelationId)((theme) => theme.updater),
94
- tslib_1.__metadata("design:type", String)
95
- ], Theme.prototype, "updaterId", void 0);
96
- exports.Theme = Theme = tslib_1.__decorate([
97
- (0, typeorm_1.Entity)(),
98
- (0, typeorm_1.Index)('ix_theme_0', (theme) => [theme.domain, theme.name, theme.deletedAt], { unique: true }),
99
- (0, type_graphql_1.ObjectType)({ description: 'Entity for Theme' })
100
- ], Theme);
101
- //# sourceMappingURL=theme.js.map
@@ -1 +0,0 @@
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;CA0DF,CAAA;AAjEY,sBAAK;AAWP;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;iCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;qCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,C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,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;sCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;;wCAC1B;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;sCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;;wCAC1B;gBAhEP,KAAK;IAHjB,IAAA,gBAAM,GAAE;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,kBAAkB,EAAE,CAAC;GACnC,KAAK,CAiEjB","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: 'Entity for Theme' })\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)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((theme: Theme) => theme.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true })\n value?: any\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\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 })\n updater?: User\n\n @RelationId((theme: Theme) => theme.updater)\n updaterId?: string\n}\n"]}