@things-factory/lite-menu 6.2.101 → 6.2.102

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 (56) hide show
  1. package/package.json +3 -3
  2. package/dist-client/actions/lite-menu.d.ts +0 -7
  3. package/dist-client/actions/lite-menu.js +0 -114
  4. package/dist-client/actions/lite-menu.js.map +0 -1
  5. package/dist-client/bootstrap.d.ts +0 -4
  6. package/dist-client/bootstrap.js +0 -14
  7. package/dist-client/bootstrap.js.map +0 -1
  8. package/dist-client/index.d.ts +0 -4
  9. package/dist-client/index.js +0 -5
  10. package/dist-client/index.js.map +0 -1
  11. package/dist-client/lite-menu-setting-let.d.ts +0 -13
  12. package/dist-client/lite-menu-setting-let.js +0 -83
  13. package/dist-client/lite-menu-setting-let.js.map +0 -1
  14. package/dist-client/pages/addon-menu-setting.d.ts +0 -7
  15. package/dist-client/pages/addon-menu-setting.js +0 -480
  16. package/dist-client/pages/addon-menu-setting.js.map +0 -1
  17. package/dist-client/reducers/lite-menu.d.ts +0 -14
  18. package/dist-client/reducers/lite-menu.js +0 -60
  19. package/dist-client/reducers/lite-menu.js.map +0 -1
  20. package/dist-client/route.d.ts +0 -1
  21. package/dist-client/route.js +0 -8
  22. package/dist-client/route.js.map +0 -1
  23. package/dist-client/tsconfig.tsbuildinfo +0 -1
  24. package/dist-client/viewparts/lite-menu-landscape-styles.d.ts +0 -1
  25. package/dist-client/viewparts/lite-menu-landscape-styles.js +0 -149
  26. package/dist-client/viewparts/lite-menu-landscape-styles.js.map +0 -1
  27. package/dist-client/viewparts/lite-menu-landscape.d.ts +0 -20
  28. package/dist-client/viewparts/lite-menu-landscape.js +0 -103
  29. package/dist-client/viewparts/lite-menu-landscape.js.map +0 -1
  30. package/dist-client/viewparts/lite-menu-part.d.ts +0 -28
  31. package/dist-client/viewparts/lite-menu-part.js +0 -143
  32. package/dist-client/viewparts/lite-menu-part.js.map +0 -1
  33. package/dist-client/viewparts/lite-menu-portrait-styles.d.ts +0 -1
  34. package/dist-client/viewparts/lite-menu-portrait-styles.js +0 -147
  35. package/dist-client/viewparts/lite-menu-portrait-styles.js.map +0 -1
  36. package/dist-client/viewparts/lite-menu-portrait.d.ts +0 -12
  37. package/dist-client/viewparts/lite-menu-portrait.js +0 -89
  38. package/dist-client/viewparts/lite-menu-portrait.js.map +0 -1
  39. package/dist-client/viewparts/top-menu-bar.d.ts +0 -22
  40. package/dist-client/viewparts/top-menu-bar.js +0 -150
  41. package/dist-client/viewparts/top-menu-bar.js.map +0 -1
  42. package/dist-server/index.js +0 -5
  43. package/dist-server/index.js.map +0 -1
  44. package/dist-server/service/index.js +0 -19
  45. package/dist-server/service/index.js.map +0 -1
  46. package/dist-server/service/lite-menu/index.js +0 -9
  47. package/dist-server/service/lite-menu/index.js.map +0 -1
  48. package/dist-server/service/lite-menu/lite-menu-mutation.js +0 -60
  49. package/dist-server/service/lite-menu/lite-menu-mutation.js.map +0 -1
  50. package/dist-server/service/lite-menu/lite-menu-query.js +0 -121
  51. package/dist-server/service/lite-menu/lite-menu-query.js.map +0 -1
  52. package/dist-server/service/lite-menu/lite-menu-type.js +0 -114
  53. package/dist-server/service/lite-menu/lite-menu-type.js.map +0 -1
  54. package/dist-server/service/lite-menu/lite-menu.js +0 -140
  55. package/dist-server/service/lite-menu/lite-menu.js.map +0 -1
  56. package/dist-server/tsconfig.tsbuildinfo +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/lite-menu/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AACtC,uDAAiD;AACjD,6DAAuD;AAE1C,QAAA,QAAQ,GAAG,CAAC,oBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,+BAAa,EAAE,qCAAgB,CAAC,CAAA","sourcesContent":["import { LiteMenu } from './lite-menu'\nimport { LiteMenuQuery } from './lite-menu-query'\nimport { LiteMenuMutation } from './lite-menu-mutation'\n\nexport const entities = [LiteMenu]\nexport const resolvers = [LiteMenuQuery, LiteMenuMutation]\n"]}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LiteMenuMutation = 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 lite_menu_1 = require("./lite-menu");
8
- const lite_menu_type_1 = require("./lite-menu-type");
9
- let LiteMenuMutation = class LiteMenuMutation {
10
- async createLiteMenu(liteMenu, context) {
11
- const { domain, user } = context.state;
12
- return await (0, shell_1.getRepository)(lite_menu_1.LiteMenu).save(Object.assign({ domain, creator: user, updater: user }, liteMenu));
13
- }
14
- async updateLiteMenu(id, patch, context) {
15
- const { domain, user } = context.state;
16
- const repository = (0, shell_1.getRepository)(lite_menu_1.LiteMenu);
17
- const liteMenu = await repository.findOne({
18
- where: { domain: { id: domain.id }, id }
19
- });
20
- return await repository.save(Object.assign(Object.assign(Object.assign({ domain, creater: user }, liteMenu), patch), { updater: user }));
21
- }
22
- async deleteLiteMenu(id, context) {
23
- const { domain } = context.state;
24
- await (0, shell_1.getRepository)(lite_menu_1.LiteMenu).delete({ domain: { id: domain.id }, id });
25
- return true;
26
- }
27
- };
28
- tslib_1.__decorate([
29
- (0, type_graphql_1.Directive)('@privilege(category: "menu", privilege: "mutation", domainOwnerGranted: true)'),
30
- (0, type_graphql_1.Mutation)(returns => lite_menu_1.LiteMenu, { description: 'To create new LiteMenu' }),
31
- tslib_1.__param(0, (0, type_graphql_1.Arg)('liteMenu')),
32
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
33
- tslib_1.__metadata("design:type", Function),
34
- tslib_1.__metadata("design:paramtypes", [lite_menu_type_1.NewLiteMenu, Object]),
35
- tslib_1.__metadata("design:returntype", Promise)
36
- ], LiteMenuMutation.prototype, "createLiteMenu", null);
37
- tslib_1.__decorate([
38
- (0, type_graphql_1.Directive)('@privilege(category: "menu", privilege: "mutation", domainOwnerGranted: true)'),
39
- (0, type_graphql_1.Mutation)(returns => lite_menu_1.LiteMenu, { description: 'To modify LiteMenu information' }),
40
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
41
- tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
42
- tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
43
- tslib_1.__metadata("design:type", Function),
44
- tslib_1.__metadata("design:paramtypes", [String, lite_menu_type_1.LiteMenuPatch, Object]),
45
- tslib_1.__metadata("design:returntype", Promise)
46
- ], LiteMenuMutation.prototype, "updateLiteMenu", null);
47
- tslib_1.__decorate([
48
- (0, type_graphql_1.Directive)('@privilege(category: "menu", privilege: "mutation", domainOwnerGranted: true)'),
49
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete LiteMenu' }),
50
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
51
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
52
- tslib_1.__metadata("design:type", Function),
53
- tslib_1.__metadata("design:paramtypes", [String, Object]),
54
- tslib_1.__metadata("design:returntype", Promise)
55
- ], LiteMenuMutation.prototype, "deleteLiteMenu", null);
56
- LiteMenuMutation = tslib_1.__decorate([
57
- (0, type_graphql_1.Resolver)(lite_menu_1.LiteMenu)
58
- ], LiteMenuMutation);
59
- exports.LiteMenuMutation = LiteMenuMutation;
60
- //# sourceMappingURL=lite-menu-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lite-menu-mutation.js","sourceRoot":"","sources":["../../../server/service/lite-menu/lite-menu-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,iDAAqD;AAErD,2CAAsC;AACtC,qDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAwB;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEtC,OAAO,M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BAAW;;sDAS1D;AAIK;IAFL,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,oBAAQ,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE9E,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,8BAAa;;sDAiBnC;AAIK;IAFL,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDAKjD;AA5CU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,gBAAgB,CA6C5B;AA7CY,4CAAgB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { LiteMenu } from './lite-menu'\nimport { LiteMenuPatch, NewLiteMenu } from './lite-menu-type'\n\n@Resolver(LiteMenu)\nexport class LiteMenuMutation {\n @Directive('@privilege(category: \"menu\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => LiteMenu, { description: 'To create new LiteMenu' })\n async createLiteMenu(@Arg('liteMenu') liteMenu: NewLiteMenu, @Ctx() context: ResolverContext): Promise<LiteMenu> {\n const { domain, user } = context.state\n\n return await getRepository(LiteMenu).save({\n domain,\n creator: user,\n updater: user,\n ...liteMenu\n })\n }\n\n @Directive('@privilege(category: \"menu\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => LiteMenu, { description: 'To modify LiteMenu information' })\n async updateLiteMenu(\n @Arg('id') id: string,\n @Arg('patch') patch: LiteMenuPatch,\n @Ctx() context: ResolverContext\n ): Promise<LiteMenu> {\n const { domain, user } = context.state\n\n const repository = getRepository(LiteMenu)\n const liteMenu = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n return await repository.save({\n domain,\n creater: user,\n ...liteMenu,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"menu\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete LiteMenu' })\n async deleteLiteMenu(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain } = context.state\n\n await getRepository(LiteMenu).delete({ domain: { id: domain.id }, id })\n return true\n }\n}\n"]}
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LiteMenuQuery = 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
- const board_service_1 = require("@things-factory/board-service");
10
- const lite_menu_1 = require("./lite-menu");
11
- const lite_menu_type_1 = require("./lite-menu-type");
12
- let LiteMenuQuery = class LiteMenuQuery {
13
- async liteMenu(id, context) {
14
- const { domain } = context.state;
15
- const repository = (0, shell_1.getRepository)(lite_menu_1.LiteMenu);
16
- var liteMenu = repository.findOne({
17
- where: { domain: { id: (0, typeorm_1.In)([domain.id, domain.parentId].filter(Boolean)) }, id },
18
- relations: ['domain', 'creator', 'updater']
19
- });
20
- return liteMenu;
21
- }
22
- async liteMenus(params, context) {
23
- const { domain } = context.state;
24
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
25
- repository: (0, shell_1.getRepository)(lite_menu_1.LiteMenu),
26
- params,
27
- domain,
28
- searchables: ['name', 'description']
29
- });
30
- var [items, total] = await queryBuilder.getManyAndCount();
31
- return { items, total };
32
- }
33
- async myLiteMenus(params, context) {
34
- const { domain, user, unsafeIP, prohibitedPrivileges } = context.state;
35
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
36
- repository: (0, shell_1.getRepository)(lite_menu_1.LiteMenu),
37
- params,
38
- domain,
39
- searchables: ['name', 'description']
40
- });
41
- var [items, total] = await queryBuilder.getManyAndCount();
42
- const filtered = [];
43
- for (let item of items) {
44
- if (await (0, auth_base_1.checkPermission)(item.privilege, user, domain, unsafeIP, prohibitedPrivileges)) {
45
- filtered.push(item);
46
- }
47
- }
48
- return { items: filtered, total: filtered.length };
49
- }
50
- async board(liteMenu) {
51
- if ((liteMenu.type === 'board' || liteMenu.type === 'interactive-board') && liteMenu.value) {
52
- return await (0, shell_1.getRepository)(board_service_1.Board).findOneBy({ id: liteMenu.value });
53
- }
54
- }
55
- async domain(liteMenu) {
56
- return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: liteMenu.domainId });
57
- }
58
- async updater(liteMenu) {
59
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: liteMenu.updaterId });
60
- }
61
- async creator(liteMenu) {
62
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: liteMenu.creatorId });
63
- }
64
- };
65
- tslib_1.__decorate([
66
- (0, type_graphql_1.Query)(returns => lite_menu_1.LiteMenu, { description: 'To fetch a LiteMenu' }),
67
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
68
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
69
- tslib_1.__metadata("design:type", Function),
70
- tslib_1.__metadata("design:paramtypes", [String, Object]),
71
- tslib_1.__metadata("design:returntype", Promise)
72
- ], LiteMenuQuery.prototype, "liteMenu", null);
73
- tslib_1.__decorate([
74
- (0, type_graphql_1.Query)(returns => lite_menu_type_1.LiteMenuList, { description: 'To fetch multiple LiteMenus' }),
75
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
76
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
77
- tslib_1.__metadata("design:type", Function),
78
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
79
- tslib_1.__metadata("design:returntype", Promise)
80
- ], LiteMenuQuery.prototype, "liteMenus", null);
81
- tslib_1.__decorate([
82
- (0, type_graphql_1.Query)(returns => lite_menu_type_1.LiteMenuList, { description: 'To fetch my own LiteMenus' }),
83
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
84
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
85
- tslib_1.__metadata("design:type", Function),
86
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
87
- tslib_1.__metadata("design:returntype", Promise)
88
- ], LiteMenuQuery.prototype, "myLiteMenus", null);
89
- tslib_1.__decorate([
90
- (0, type_graphql_1.FieldResolver)(type => board_service_1.Board),
91
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
92
- tslib_1.__metadata("design:type", Function),
93
- tslib_1.__metadata("design:paramtypes", [lite_menu_1.LiteMenu]),
94
- tslib_1.__metadata("design:returntype", Promise)
95
- ], LiteMenuQuery.prototype, "board", null);
96
- tslib_1.__decorate([
97
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
98
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
99
- tslib_1.__metadata("design:type", Function),
100
- tslib_1.__metadata("design:paramtypes", [lite_menu_1.LiteMenu]),
101
- tslib_1.__metadata("design:returntype", Promise)
102
- ], LiteMenuQuery.prototype, "domain", null);
103
- tslib_1.__decorate([
104
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
105
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
106
- tslib_1.__metadata("design:type", Function),
107
- tslib_1.__metadata("design:paramtypes", [lite_menu_1.LiteMenu]),
108
- tslib_1.__metadata("design:returntype", Promise)
109
- ], LiteMenuQuery.prototype, "updater", null);
110
- tslib_1.__decorate([
111
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
112
- tslib_1.__param(0, (0, type_graphql_1.Root)()),
113
- tslib_1.__metadata("design:type", Function),
114
- tslib_1.__metadata("design:paramtypes", [lite_menu_1.LiteMenu]),
115
- tslib_1.__metadata("design:returntype", Promise)
116
- ], LiteMenuQuery.prototype, "creator", null);
117
- LiteMenuQuery = tslib_1.__decorate([
118
- (0, type_graphql_1.Resolver)(lite_menu_1.LiteMenu)
119
- ], LiteMenuQuery);
120
- exports.LiteMenuQuery = LiteMenuQuery;
121
- //# sourceMappingURL=lite-menu-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lite-menu-query.js","sourceRoot":"","sources":["../../../server/service/lite-menu/lite-menu-query.ts"],"names":[],"mappings":";;;;AAAA,qCAA4B;AAC5B,+CAAmF;AAEnF,iDAAuG;AACvG,yDAAkF;AAClF,iEAAqD;AAErD,2CAAsC;AACtC,qDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAElB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU,EAAS,OAAwB;QACnE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,oBAAQ,CAAC,CAAA;QAE1C,IAAI,QAAQ,GAAQ,UAAU,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;YAC/E,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAA;IACjB,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAwB;QACxE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,U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IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;gDAoB1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAK,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;0CAIrC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;4CAEvC;AAxEU,aAAa;IADzB,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,aAAa,CAyEzB;AAzEY,sCAAa","sourcesContent":["import { In } from 'typeorm'\nimport { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { PrivilegeObject, User, checkPermission } from '@things-factory/auth-base'\nimport { Board } from '@things-factory/board-service'\n\nimport { LiteMenu } from './lite-menu'\nimport { LiteMenuList } from './lite-menu-type'\n\n@Resolver(LiteMenu)\nexport class LiteMenuQuery {\n @Query(returns => LiteMenu, { description: 'To fetch a LiteMenu' })\n async liteMenu(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<LiteMenu> {\n const { domain } = context.state\n const repository = getRepository(LiteMenu)\n\n var liteMenu: any = repository.findOne({\n where: { domain: { id: In([domain.id, domain.parentId].filter(Boolean)) }, id },\n relations: ['domain', 'creator', 'updater']\n })\n\n return liteMenu\n }\n\n @Query(returns => LiteMenuList, { description: 'To fetch multiple LiteMenus' })\n async liteMenus(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<LiteMenuList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(LiteMenu),\n params,\n domain,\n searchables: ['name', 'description']\n })\n var [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Query(returns => LiteMenuList, { description: 'To fetch my own LiteMenus' })\n async myLiteMenus(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<LiteMenuList> {\n const { domain, user, unsafeIP, prohibitedPrivileges } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(LiteMenu),\n params,\n domain,\n searchables: ['name', 'description']\n })\n var [items, total] = await queryBuilder.getManyAndCount()\n\n const filtered = []\n\n for (let item of items) {\n if (await checkPermission(item.privilege, user, domain, unsafeIP, prohibitedPrivileges)) {\n filtered.push(item)\n }\n }\n\n return { items: filtered, total: filtered.length }\n }\n\n @FieldResolver(type => Board)\n async board(@Root() liteMenu: LiteMenu) {\n if ((liteMenu.type === 'board' || liteMenu.type === 'interactive-board') && liteMenu.value) {\n return await getRepository(Board).findOneBy({ id: liteMenu.value })\n }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() liteMenu: LiteMenu) {\n return await getRepository(Domain).findOneBy({ id: liteMenu.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() liteMenu: LiteMenu): Promise<User> {\n return await getRepository(User).findOneBy({ id: liteMenu.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() liteMenu: LiteMenu): Promise<User> {\n return await getRepository(User).findOneBy({ id: liteMenu.creatorId })\n }\n}\n"]}
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LiteMenuList = exports.LiteMenuPatch = exports.NewLiteMenu = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const auth_base_1 = require("@things-factory/auth-base");
7
- const lite_menu_1 = require("./lite-menu");
8
- let NewLiteMenu = class NewLiteMenu {
9
- };
10
- tslib_1.__decorate([
11
- (0, type_graphql_1.Field)(),
12
- tslib_1.__metadata("design:type", String)
13
- ], NewLiteMenu.prototype, "name", void 0);
14
- tslib_1.__decorate([
15
- (0, type_graphql_1.Field)({ nullable: true }),
16
- tslib_1.__metadata("design:type", String)
17
- ], NewLiteMenu.prototype, "description", void 0);
18
- tslib_1.__decorate([
19
- (0, type_graphql_1.Field)({ nullable: true }),
20
- tslib_1.__metadata("design:type", String)
21
- ], NewLiteMenu.prototype, "appName", void 0);
22
- tslib_1.__decorate([
23
- (0, type_graphql_1.Field)({ nullable: true }),
24
- tslib_1.__metadata("design:type", String)
25
- ], NewLiteMenu.prototype, "parent", void 0);
26
- tslib_1.__decorate([
27
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
28
- tslib_1.__metadata("design:type", Number)
29
- ], NewLiteMenu.prototype, "rank", void 0);
30
- tslib_1.__decorate([
31
- (0, type_graphql_1.Field)({ nullable: true }),
32
- tslib_1.__metadata("design:type", String)
33
- ], NewLiteMenu.prototype, "type", void 0);
34
- tslib_1.__decorate([
35
- (0, type_graphql_1.Field)({ nullable: true }),
36
- tslib_1.__metadata("design:type", String)
37
- ], NewLiteMenu.prototype, "icon", void 0);
38
- tslib_1.__decorate([
39
- (0, type_graphql_1.Field)({ nullable: true }),
40
- tslib_1.__metadata("design:type", String)
41
- ], NewLiteMenu.prototype, "value", void 0);
42
- tslib_1.__decorate([
43
- (0, type_graphql_1.Field)({ nullable: true }),
44
- tslib_1.__metadata("design:type", Boolean)
45
- ], NewLiteMenu.prototype, "active", void 0);
46
- tslib_1.__decorate([
47
- (0, type_graphql_1.Field)({ nullable: true }),
48
- tslib_1.__metadata("design:type", auth_base_1.PrivilegeInput)
49
- ], NewLiteMenu.prototype, "privilege", void 0);
50
- NewLiteMenu = tslib_1.__decorate([
51
- (0, type_graphql_1.InputType)()
52
- ], NewLiteMenu);
53
- exports.NewLiteMenu = NewLiteMenu;
54
- let LiteMenuPatch = class LiteMenuPatch {
55
- };
56
- tslib_1.__decorate([
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- tslib_1.__metadata("design:type", String)
59
- ], LiteMenuPatch.prototype, "name", void 0);
60
- tslib_1.__decorate([
61
- (0, type_graphql_1.Field)({ nullable: true }),
62
- tslib_1.__metadata("design:type", String)
63
- ], LiteMenuPatch.prototype, "description", void 0);
64
- tslib_1.__decorate([
65
- (0, type_graphql_1.Field)({ nullable: true }),
66
- tslib_1.__metadata("design:type", String)
67
- ], LiteMenuPatch.prototype, "appName", void 0);
68
- tslib_1.__decorate([
69
- (0, type_graphql_1.Field)({ nullable: true }),
70
- tslib_1.__metadata("design:type", String)
71
- ], LiteMenuPatch.prototype, "parent", void 0);
72
- tslib_1.__decorate([
73
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
74
- tslib_1.__metadata("design:type", Number)
75
- ], LiteMenuPatch.prototype, "rank", void 0);
76
- tslib_1.__decorate([
77
- (0, type_graphql_1.Field)({ nullable: true }),
78
- tslib_1.__metadata("design:type", String)
79
- ], LiteMenuPatch.prototype, "type", void 0);
80
- tslib_1.__decorate([
81
- (0, type_graphql_1.Field)({ nullable: true }),
82
- tslib_1.__metadata("design:type", String)
83
- ], LiteMenuPatch.prototype, "icon", void 0);
84
- tslib_1.__decorate([
85
- (0, type_graphql_1.Field)({ nullable: true }),
86
- tslib_1.__metadata("design:type", String)
87
- ], LiteMenuPatch.prototype, "value", void 0);
88
- tslib_1.__decorate([
89
- (0, type_graphql_1.Field)({ nullable: true }),
90
- tslib_1.__metadata("design:type", Boolean)
91
- ], LiteMenuPatch.prototype, "active", void 0);
92
- tslib_1.__decorate([
93
- (0, type_graphql_1.Field)({ nullable: true }),
94
- tslib_1.__metadata("design:type", auth_base_1.PrivilegeInput)
95
- ], LiteMenuPatch.prototype, "privilege", void 0);
96
- LiteMenuPatch = tslib_1.__decorate([
97
- (0, type_graphql_1.InputType)()
98
- ], LiteMenuPatch);
99
- exports.LiteMenuPatch = LiteMenuPatch;
100
- let LiteMenuList = class LiteMenuList {
101
- };
102
- tslib_1.__decorate([
103
- (0, type_graphql_1.Field)(type => [lite_menu_1.LiteMenu]),
104
- tslib_1.__metadata("design:type", Array)
105
- ], LiteMenuList.prototype, "items", void 0);
106
- tslib_1.__decorate([
107
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
108
- tslib_1.__metadata("design:type", Number)
109
- ], LiteMenuList.prototype, "total", void 0);
110
- LiteMenuList = tslib_1.__decorate([
111
- (0, type_graphql_1.ObjectType)()
112
- ], LiteMenuList);
113
- exports.LiteMenuList = LiteMenuList;
114
- //# sourceMappingURL=lite-menu-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lite-menu-type.js","sourceRoot":"","sources":["../../../server/service/lite-menu/lite-menu-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,yDAA0D;AAE1D,2CAAsC;AAG/B,IAAM,WAAW,GAAjB,MAAM,WAAW;CA8BvB,CAAA;AA7BC;IAAC,IAAA,oBAAK,GAAE;;yCACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACX;AAEf;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC1B;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IA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IAAA,wBAAS,GAAE;GACC,aAAa,CA8BzB;AA9BY,sCAAa;AAiCnB,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oBAAQ,CAAC,CAAC;;2CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;AALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB;AANY,oCAAY","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\nimport { PrivilegeInput } from '@things-factory/auth-base'\n\nimport { LiteMenu } from './lite-menu'\n\n@InputType()\nexport class NewLiteMenu {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n appName?: string\n\n @Field({ nullable: true })\n parent?: string\n\n @Field(type => Int, { nullable: true })\n rank?: number\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n icon?: string\n\n @Field({ nullable: true })\n value?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n privilege?: PrivilegeInput\n}\n\n@InputType()\nexport class LiteMenuPatch {\n @Field({ nullable: true })\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n appName?: string\n\n @Field({ nullable: true })\n parent?: string\n\n @Field(type => Int, { nullable: true })\n rank?: number\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n icon?: string\n\n @Field({ nullable: true })\n value?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n privilege?: PrivilegeInput\n}\n\n@ObjectType()\nexport class LiteMenuList {\n @Field(type => [LiteMenu])\n items: LiteMenu[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,140 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.LiteMenu = void 0;
5
- const tslib_1 = require("tslib");
6
- const type_graphql_1 = require("type-graphql");
7
- const typeorm_1 = require("typeorm");
8
- const auth_base_1 = require("@things-factory/auth-base");
9
- const board_service_1 = require("@things-factory/board-service");
10
- const shell_1 = require("@things-factory/shell");
11
- let LiteMenu = class LiteMenu {
12
- };
13
- tslib_1.__decorate([
14
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
15
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
16
- tslib_1.__metadata("design:type", String)
17
- ], LiteMenu.prototype, "id", void 0);
18
- tslib_1.__decorate([
19
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
20
- (0, type_graphql_1.Field)({ nullable: true }),
21
- tslib_1.__metadata("design:type", shell_1.Domain)
22
- ], LiteMenu.prototype, "domain", void 0);
23
- tslib_1.__decorate([
24
- (0, typeorm_1.RelationId)((liteMenu) => liteMenu.domain),
25
- tslib_1.__metadata("design:type", String)
26
- ], LiteMenu.prototype, "domainId", void 0);
27
- tslib_1.__decorate([
28
- (0, typeorm_1.Column)(),
29
- (0, type_graphql_1.Field)(),
30
- tslib_1.__metadata("design:type", String)
31
- ], LiteMenu.prototype, "name", void 0);
32
- tslib_1.__decorate([
33
- (0, typeorm_1.Column)({
34
- nullable: true
35
- }),
36
- (0, type_graphql_1.Field)({ nullable: true }),
37
- tslib_1.__metadata("design:type", String)
38
- ], LiteMenu.prototype, "description", void 0);
39
- tslib_1.__decorate([
40
- (0, typeorm_1.Column)({
41
- nullable: true,
42
- default: ''
43
- }),
44
- (0, type_graphql_1.Field)({ nullable: true }),
45
- tslib_1.__metadata("design:type", String)
46
- ], LiteMenu.prototype, "appName", void 0);
47
- tslib_1.__decorate([
48
- (0, typeorm_1.Column)({
49
- nullable: true,
50
- default: ''
51
- }),
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- tslib_1.__metadata("design:type", String)
54
- ], LiteMenu.prototype, "parent", void 0);
55
- tslib_1.__decorate([
56
- (0, typeorm_1.Column)({
57
- nullable: true
58
- }),
59
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
60
- tslib_1.__metadata("design:type", Number)
61
- ], LiteMenu.prototype, "rank", void 0);
62
- tslib_1.__decorate([
63
- (0, typeorm_1.Column)({
64
- nullable: true
65
- }),
66
- (0, type_graphql_1.Field)({ nullable: true }),
67
- tslib_1.__metadata("design:type", String)
68
- ], LiteMenu.prototype, "type", void 0);
69
- tslib_1.__decorate([
70
- (0, typeorm_1.Column)({
71
- nullable: true
72
- }),
73
- (0, type_graphql_1.Field)({ nullable: true }),
74
- tslib_1.__metadata("design:type", String)
75
- ], LiteMenu.prototype, "value", void 0);
76
- tslib_1.__decorate([
77
- (0, typeorm_1.Column)({
78
- nullable: true
79
- }),
80
- (0, type_graphql_1.Field)({ nullable: true }),
81
- tslib_1.__metadata("design:type", String)
82
- ], LiteMenu.prototype, "icon", void 0);
83
- tslib_1.__decorate([
84
- (0, typeorm_1.Column)({
85
- nullable: true
86
- }),
87
- (0, type_graphql_1.Field)({ nullable: true }),
88
- tslib_1.__metadata("design:type", Boolean)
89
- ], LiteMenu.prototype, "active", void 0);
90
- tslib_1.__decorate([
91
- (0, type_graphql_1.Field)(type => board_service_1.Board, { nullable: true }),
92
- tslib_1.__metadata("design:type", typeof (_a = typeof board_service_1.Board !== "undefined" && board_service_1.Board) === "function" ? _a : Object)
93
- ], LiteMenu.prototype, "board", void 0);
94
- tslib_1.__decorate([
95
- (0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
96
- (0, type_graphql_1.Field)(type => auth_base_1.PrivilegeObject, { nullable: true }),
97
- tslib_1.__metadata("design:type", auth_base_1.PrivilegeObject)
98
- ], LiteMenu.prototype, "privilege", void 0);
99
- tslib_1.__decorate([
100
- (0, typeorm_1.CreateDateColumn)(),
101
- (0, type_graphql_1.Field)({ nullable: true }),
102
- tslib_1.__metadata("design:type", Date)
103
- ], LiteMenu.prototype, "createdAt", void 0);
104
- tslib_1.__decorate([
105
- (0, typeorm_1.UpdateDateColumn)(),
106
- (0, type_graphql_1.Field)({ nullable: true }),
107
- tslib_1.__metadata("design:type", Date)
108
- ], LiteMenu.prototype, "updatedAt", void 0);
109
- tslib_1.__decorate([
110
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
111
- nullable: true
112
- }),
113
- (0, type_graphql_1.Field)({ nullable: true }),
114
- tslib_1.__metadata("design:type", auth_base_1.User)
115
- ], LiteMenu.prototype, "creator", void 0);
116
- tslib_1.__decorate([
117
- (0, typeorm_1.RelationId)((liteMenu) => liteMenu.creator),
118
- tslib_1.__metadata("design:type", String)
119
- ], LiteMenu.prototype, "creatorId", void 0);
120
- tslib_1.__decorate([
121
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
122
- nullable: true
123
- }),
124
- (0, type_graphql_1.Field)({ nullable: true }),
125
- tslib_1.__metadata("design:type", auth_base_1.User)
126
- ], LiteMenu.prototype, "updater", void 0);
127
- tslib_1.__decorate([
128
- (0, typeorm_1.RelationId)((liteMenu) => liteMenu.updater),
129
- tslib_1.__metadata("design:type", String)
130
- ], LiteMenu.prototype, "updaterId", void 0);
131
- LiteMenu = tslib_1.__decorate([
132
- (0, typeorm_1.Entity)(),
133
- (0, typeorm_1.Index)('ix_lite_menus_0', (liteMenu) => [liteMenu.domain, liteMenu.name, liteMenu.appName], { unique: true }),
134
- (0, typeorm_1.Index)('ix_lite_menus_1', (liteMenu) => [liteMenu.domain, liteMenu.appName, liteMenu.parent, liteMenu.rank], {
135
- unique: true
136
- }),
137
- (0, type_graphql_1.ObjectType)({ description: 'Entity for LiteMenu' })
138
- ], LiteMenu);
139
- exports.LiteMenu = LiteMenu;
140
- //# sourceMappingURL=lite-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lite-menu.js","sourceRoot":"","sources":["../../../server/service/lite-menu/lite-menu.ts"],"names":[],"mappings":";;;;;AAAA,+CAAyD;AACzD,qCASgB;AAEhB,yDAAiE;AACjE,iEAAqD;AACrD,iDAA8C;AAQv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QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;yCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;AAjGP,QAAQ;IANpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACtH,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE;QACrH,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAkGpB;AAlGY,4BAAQ","sourcesContent":["import { Field, ID, Int, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { PrivilegeObject, User } from '@things-factory/auth-base'\nimport { Board } from '@things-factory/board-service'\nimport { Domain } from '@things-factory/shell'\n\n@Entity()\n@Index('ix_lite_menus_0', (liteMenu: LiteMenu) => [liteMenu.domain, liteMenu.name, liteMenu.appName], { unique: true })\n@Index('ix_lite_menus_1', (liteMenu: LiteMenu) => [liteMenu.domain, liteMenu.appName, liteMenu.parent, liteMenu.rank], {\n unique: true\n})\n@ObjectType({ description: 'Entity for LiteMenu' })\nexport class LiteMenu {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((liteMenu: LiteMenu) => liteMenu.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({\n nullable: true,\n default: ''\n })\n @Field({ nullable: true })\n appName?: string\n\n @Column({\n nullable: true,\n default: ''\n })\n @Field({ nullable: true })\n parent?: string\n\n @Column({\n nullable: true\n })\n @Field(type => Int, { nullable: true })\n rank?: number\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n type?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n value?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n icon?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => Board, { nullable: true })\n board?: Board\n\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => PrivilegeObject, { nullable: true })\n privilege?: PrivilegeObject\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((liteMenu: LiteMenu) => liteMenu.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((liteMenu: LiteMenu) => liteMenu.updater)\n updaterId?: string\n}\n"]}