@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.
Files changed (47) hide show
  1. package/dist-server/service/board/board-history.js +26 -16
  2. package/dist-server/service/board/board-history.js.map +1 -1
  3. package/dist-server/service/board/board-mutation.js +11 -7
  4. package/dist-server/service/board/board-mutation.js.map +1 -1
  5. package/dist-server/service/board/board-query.js +13 -11
  6. package/dist-server/service/board/board-query.js.map +1 -1
  7. package/dist-server/service/board/board-subscription.js +1 -0
  8. package/dist-server/service/board/board-subscription.js.map +1 -1
  9. package/dist-server/service/board/board-type.js +20 -20
  10. package/dist-server/service/board/board-type.js.map +1 -1
  11. package/dist-server/service/board/board.js +17 -17
  12. package/dist-server/service/board/board.js.map +1 -1
  13. package/dist-server/service/board-favorite/board-favorite-type.js +5 -5
  14. package/dist-server/service/board-favorite/board-favorite-type.js.map +1 -1
  15. package/dist-server/service/board-template/board-template-type.js +20 -17
  16. package/dist-server/service/board-template/board-template-type.js.map +1 -1
  17. package/dist-server/service/board-template/board-template.js +14 -14
  18. package/dist-server/service/board-template/board-template.js.map +1 -1
  19. package/dist-server/service/group/group-mutation.js +4 -4
  20. package/dist-server/service/group/group-mutation.js.map +1 -1
  21. package/dist-server/service/group/group-query.js +6 -6
  22. package/dist-server/service/group/group-query.js.map +1 -1
  23. package/dist-server/service/group/group-type.js +9 -9
  24. package/dist-server/service/group/group-type.js.map +1 -1
  25. package/dist-server/service/group/group.js +10 -10
  26. package/dist-server/service/group/group.js.map +1 -1
  27. package/dist-server/service/play-group/play-group-mutation.js +6 -6
  28. package/dist-server/service/play-group/play-group-mutation.js.map +1 -1
  29. package/dist-server/service/play-group/play-group-query.js +9 -7
  30. package/dist-server/service/play-group/play-group-query.js.map +1 -1
  31. package/dist-server/service/play-group/play-group-subscription.js +1 -0
  32. package/dist-server/service/play-group/play-group-subscription.js.map +1 -1
  33. package/dist-server/service/play-group/play-group-type.js +9 -9
  34. package/dist-server/service/play-group/play-group-type.js.map +1 -1
  35. package/dist-server/service/play-group/play-group.d.ts +1 -1
  36. package/dist-server/service/play-group/play-group.js +15 -11
  37. package/dist-server/service/play-group/play-group.js.map +1 -1
  38. package/dist-server/service/theme/theme-mutation.js +8 -6
  39. package/dist-server/service/theme/theme-mutation.js.map +1 -1
  40. package/dist-server/service/theme/theme-query.js +5 -5
  41. package/dist-server/service/theme/theme-query.js.map +1 -1
  42. package/dist-server/service/theme/theme-type.js +17 -17
  43. package/dist-server/service/theme/theme-type.js.map +1 -1
  44. package/dist-server/service/theme/theme.js +16 -13
  45. package/dist-server/service/theme/theme.js.map +1 -1
  46. package/dist-server/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +7 -7
@@ -56,7 +56,7 @@ let GroupMutation = class GroupMutation {
56
56
  exports.GroupMutation = GroupMutation;
57
57
  tslib_1.__decorate([
58
58
  (0, type_graphql_1.Directive)('@transaction'),
59
- (0, type_graphql_1.Mutation)(returns => group_js_1.Group, { nullable: true, description: 'To create new Group' }),
59
+ (0, type_graphql_1.Mutation)(returns => group_js_1.Group, { nullable: true, description: 'Creates a new board group.' }),
60
60
  tslib_1.__param(0, (0, type_graphql_1.Arg)('group')),
61
61
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
62
62
  tslib_1.__metadata("design:type", Function),
@@ -65,7 +65,7 @@ tslib_1.__decorate([
65
65
  ], GroupMutation.prototype, "createGroup", null);
66
66
  tslib_1.__decorate([
67
67
  (0, type_graphql_1.Directive)('@transaction'),
68
- (0, type_graphql_1.Mutation)(returns => group_js_1.Group, { description: 'To modify Group information' }),
68
+ (0, type_graphql_1.Mutation)(returns => group_js_1.Group, { description: 'Updates an existing board group.' }),
69
69
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
70
70
  tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
71
71
  tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
@@ -75,7 +75,7 @@ tslib_1.__decorate([
75
75
  ], GroupMutation.prototype, "updateGroup", null);
76
76
  tslib_1.__decorate([
77
77
  (0, type_graphql_1.Directive)('@transaction'),
78
- (0, type_graphql_1.Mutation)(returns => group_js_1.Group, { description: 'To make the board to join the group' }),
78
+ (0, type_graphql_1.Mutation)(returns => group_js_1.Group, { description: 'Assigns one or more boards to a group.' }),
79
79
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
80
80
  tslib_1.__param(1, (0, type_graphql_1.Arg)('boardIds', type => [String])),
81
81
  tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
@@ -85,7 +85,7 @@ tslib_1.__decorate([
85
85
  ], GroupMutation.prototype, "joinGroup", null);
86
86
  tslib_1.__decorate([
87
87
  (0, type_graphql_1.Directive)('@transaction'),
88
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Group' }),
88
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Deletes a board group.' }),
89
89
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
90
90
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
91
91
  tslib_1.__metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"group-mutation.js","sourceRoot":"","sources":["../../../server/service/group/group-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,gDAAyC;AACzC,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,MAAM;YACN,GAAG,KAAK;YACR,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAA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IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,0BAAU;;gDAahC;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,gBAAK,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAEhF,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8CAkBP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDAa9C;wBAzEU,aAAa;IADzB,IAAA,uBAAQ,EAAC,gBAAK,CAAC;GACH,aAAa,CA0EzB","sourcesContent":["import { Arg, Ctx, Mutation, Resolver, Directive } from 'type-graphql'\n\nimport { Board } from '../board/board.js'\nimport { Group } from './group.js'\nimport { GroupPatch, NewGroup } from './group-type.js'\n\n@Resolver(Group)\nexport class GroupMutation {\n @Directive('@transaction')\n @Mutation(returns => Group, { nullable: true, description: 'To create new Group' })\n async createGroup(@Arg('group') group: NewGroup, @Ctx() context: ResolverContext): Promise<Group> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(Group).save({\n domain,\n ...group,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Group, { description: 'To modify Group information' })\n async updateGroup(\n @Arg('id') id: string,\n @Arg('patch') patch: GroupPatch,\n @Ctx() context: ResolverContext\n ): Promise<Group> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(Group)\n\n const group = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n return await repository.save({\n ...group,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Group, { description: 'To make the board to join the group' })\n async joinGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ) {\n const { domain, tx } = context.state\n const repository = tx.getRepository(Group)\n const group = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n const boardRepository = tx.getRepository(Board)\n\n await boardIds.forEach(async boardId => {\n let board = await boardRepository.findOneBy({ domain: { id: domain.id }, id: boardId })\n board.group = group\n await boardRepository.save(board)\n })\n\n return await repository.findOne({\n where: { domain: { id: domain.id }, id },\n relations: ['boards']\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Group' })\n async deleteGroup(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n const repository = tx.getRepository(Group)\n\n /* TODO - 그룹에 소속된 보드가 있는 경우에는 그룹을 지워서는 안된다. */\n const group = await repository.findOneBy({\n domain: { id: domain.id },\n id\n })\n\n await repository.delete(id)\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"group-mutation.js","sourceRoot":"","sources":["../../../server/service/group/group-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,gDAAyC;AACzC,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,MAAM;YACN,GAAG,KAAK;YACR,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAA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IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,0BAAU;;gDAahC;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,gBAAK,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAEnF,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8CAkBP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IACrD,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDAa9C;wBAzEU,aAAa;IADzB,IAAA,uBAAQ,EAAC,gBAAK,CAAC;GACH,aAAa,CA0EzB","sourcesContent":["import { Arg, Ctx, Mutation, Resolver, Directive } from 'type-graphql'\n\nimport { Board } from '../board/board.js'\nimport { Group } from './group.js'\nimport { GroupPatch, NewGroup } from './group-type.js'\n\n@Resolver(Group)\nexport class GroupMutation {\n @Directive('@transaction')\n @Mutation(returns => Group, { nullable: true, description: 'Creates a new board group.' })\n async createGroup(@Arg('group') group: NewGroup, @Ctx() context: ResolverContext): Promise<Group> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(Group).save({\n domain,\n ...group,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Group, { description: 'Updates an existing board group.' })\n async updateGroup(\n @Arg('id') id: string,\n @Arg('patch') patch: GroupPatch,\n @Ctx() context: ResolverContext\n ): Promise<Group> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(Group)\n\n const group = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n return await repository.save({\n ...group,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Group, { description: 'Assigns one or more boards to a group.' })\n async joinGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ) {\n const { domain, tx } = context.state\n const repository = tx.getRepository(Group)\n const group = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n const boardRepository = tx.getRepository(Board)\n\n await boardIds.forEach(async boardId => {\n let board = await boardRepository.findOneBy({ domain: { id: domain.id }, id: boardId })\n board.group = group\n await boardRepository.save(board)\n })\n\n return await repository.findOne({\n where: { domain: { id: domain.id }, id },\n relations: ['boards']\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'Deletes a board group.' })\n async deleteGroup(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n const repository = tx.getRepository(Group)\n\n /* TODO - 그룹에 소속된 보드가 있는 경우에는 그룹을 지워서는 안된다. */\n const group = await repository.findOneBy({\n domain: { id: domain.id },\n id\n })\n\n await repository.delete(id)\n return true\n }\n}\n"]}
@@ -43,7 +43,7 @@ let GroupQuery = class GroupQuery {
43
43
  };
44
44
  exports.GroupQuery = GroupQuery;
45
45
  tslib_1.__decorate([
46
- (0, type_graphql_1.Query)(returns => group_js_1.Group, { nullable: true, description: 'To fetch a Group' }),
46
+ (0, type_graphql_1.Query)(returns => group_js_1.Group, { nullable: true, description: 'Finds a single board group by its ID.' }),
47
47
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
48
48
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
49
49
  tslib_1.__metadata("design:type", Function),
@@ -51,7 +51,7 @@ tslib_1.__decorate([
51
51
  tslib_1.__metadata("design:returntype", Promise)
52
52
  ], GroupQuery.prototype, "group", null);
53
53
  tslib_1.__decorate([
54
- (0, type_graphql_1.Query)(returns => group_type_js_1.GroupList, { description: 'To fetch multiple Groups' }),
54
+ (0, type_graphql_1.Query)(returns => group_type_js_1.GroupList, { description: 'Retrieves a paginated list of board groups.' }),
55
55
  tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
56
56
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
57
57
  tslib_1.__metadata("design:type", Function),
@@ -59,28 +59,28 @@ tslib_1.__decorate([
59
59
  tslib_1.__metadata("design:returntype", Promise)
60
60
  ], GroupQuery.prototype, "groups", null);
61
61
  tslib_1.__decorate([
62
- (0, type_graphql_1.FieldResolver)(type => [board_js_1.Board]),
62
+ (0, type_graphql_1.FieldResolver)(type => [board_js_1.Board], { description: 'Resolves the list of boards belonging to the group.' }),
63
63
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
64
64
  tslib_1.__metadata("design:type", Function),
65
65
  tslib_1.__metadata("design:paramtypes", [group_js_1.Group]),
66
66
  tslib_1.__metadata("design:returntype", Promise)
67
67
  ], GroupQuery.prototype, "boards", null);
68
68
  tslib_1.__decorate([
69
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
69
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain, { description: 'Resolves the domain associated with the group.' }),
70
70
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
71
71
  tslib_1.__metadata("design:type", Function),
72
72
  tslib_1.__metadata("design:paramtypes", [group_js_1.Group]),
73
73
  tslib_1.__metadata("design:returntype", Promise)
74
74
  ], GroupQuery.prototype, "domain", null);
75
75
  tslib_1.__decorate([
76
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
76
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Resolves the user who last updated the group.' }),
77
77
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
78
78
  tslib_1.__metadata("design:type", Function),
79
79
  tslib_1.__metadata("design:paramtypes", [group_js_1.Group]),
80
80
  tslib_1.__metadata("design:returntype", Promise)
81
81
  ], GroupQuery.prototype, "updater", null);
82
82
  tslib_1.__decorate([
83
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
83
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Resolves the user who created the group.' }),
84
84
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
85
85
  tslib_1.__metadata("design:type", Function),
86
86
  tslib_1.__metadata("design:paramtypes", [group_js_1.Group]),
@@ -1 +1 @@
1
- {"version":3,"file":"group-query.js","sourceRoot":"","sources":["../../../server/service/group/group-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,gDAAyC;AACzC,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,UAAU,EAAE,IAAA,qBAAa,EAAC,gBAAK,CAAC;YAChC,MAAM;YACN,MAAM;YACN,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3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AAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;wCAatD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,gBAAK,CAAC,CAAC;IACjB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,gBAAK;;wCAIhC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;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;qBA9CU,UAAU;IADtB,IAAA,uBAAQ,EAAC,gBAAK,CAAC;GACH,UAAU,CA+CtB","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Board } from '../board/board.js'\nimport { Group } from './group.js'\nimport { GroupList } from './group-type.js'\n\n@Resolver(Group)\nexport class GroupQuery {\n @Query(returns => Group, { nullable: true, description: 'To fetch a Group' })\n async group(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Group> {\n const { domain } = context.state\n\n return await getRepository(Group).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => GroupList, { description: 'To fetch multiple Groups' })\n async groups(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<GroupList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(Group),\n params,\n domain,\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => [Board])\n async boards(@Root() group: Group) {\n return await getRepository(Board).findBy({\n group: { id: group.id }\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() group: Group) {\n return await getRepository(Domain).findOneBy({ id: group.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() group: Group): Promise<User> {\n return await getRepository(User).findOneBy({ id: group.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() group: Group): Promise<User> {\n return await getRepository(User).findOneBy({ id: group.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"group-query.js","sourceRoot":"","sources":["../../../server/service/group/group-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,gDAAyC;AACzC,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,UAAU,EAAE,IAAA,qBAAa,EAAC,gBAAK,CAAC;YAChC,MAAM;YACN,MAAM;YACN,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,K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BAAA,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,CAAC,gBAAK,CAAC,EAAE,EAAE,WAAW,EAAE,qDAAqD,EAAE,CAAC;IACzF,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,gBAAK;;wCAIhC;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;qBA9CU,UAAU;IADtB,IAAA,uBAAQ,EAAC,gBAAK,CAAC;GACH,UAAU,CA+CtB","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Board } from '../board/board.js'\nimport { Group } from './group.js'\nimport { GroupList } from './group-type.js'\n\n@Resolver(Group)\nexport class GroupQuery {\n @Query(returns => Group, { nullable: true, description: 'Finds a single board group by its ID.' })\n async group(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Group> {\n const { domain } = context.state\n\n return await getRepository(Group).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => GroupList, { description: 'Retrieves a paginated list of board groups.' })\n async groups(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<GroupList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(Group),\n params,\n domain,\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => [Board], { description: 'Resolves the list of boards belonging to the group.' })\n async boards(@Root() group: Group) {\n return await getRepository(Board).findBy({\n group: { id: group.id }\n })\n }\n\n @FieldResolver(type => Domain, { description: 'Resolves the domain associated with the group.' })\n async domain(@Root() group: Group) {\n return await getRepository(Domain).findOneBy({ id: group.domainId })\n }\n\n @FieldResolver(type => User, { description: 'Resolves the user who last updated the group.' })\n async updater(@Root() group: Group): Promise<User> {\n return await getRepository(User).findOneBy({ id: group.updaterId })\n }\n\n @FieldResolver(type => User, { description: 'Resolves the user who created the group.' })\n async creator(@Root() group: Group): Promise<User> {\n return await getRepository(User).findOneBy({ id: group.creatorId })\n }\n}\n"]}
@@ -8,42 +8,42 @@ let NewGroup = class NewGroup {
8
8
  };
9
9
  exports.NewGroup = NewGroup;
10
10
  tslib_1.__decorate([
11
- (0, type_graphql_1.Field)(),
11
+ (0, type_graphql_1.Field)({ description: 'The name of the new group.' }),
12
12
  tslib_1.__metadata("design:type", String)
13
13
  ], NewGroup.prototype, "name", void 0);
14
14
  tslib_1.__decorate([
15
- (0, type_graphql_1.Field)({ nullable: true }),
15
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description for the new group.' }),
16
16
  tslib_1.__metadata("design:type", String)
17
17
  ], NewGroup.prototype, "description", void 0);
18
18
  exports.NewGroup = NewGroup = tslib_1.__decorate([
19
- (0, type_graphql_1.InputType)()
19
+ (0, type_graphql_1.InputType)({ description: 'Input for creating a new board group.' })
20
20
  ], NewGroup);
21
21
  let GroupPatch = class GroupPatch {
22
22
  };
23
23
  exports.GroupPatch = GroupPatch;
24
24
  tslib_1.__decorate([
25
- (0, type_graphql_1.Field)({ nullable: true }),
25
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new name for the group.' }),
26
26
  tslib_1.__metadata("design:type", String)
27
27
  ], GroupPatch.prototype, "name", void 0);
28
28
  tslib_1.__decorate([
29
- (0, type_graphql_1.Field)({ nullable: true }),
29
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new description for the group.' }),
30
30
  tslib_1.__metadata("design:type", String)
31
31
  ], GroupPatch.prototype, "description", void 0);
32
32
  exports.GroupPatch = GroupPatch = tslib_1.__decorate([
33
- (0, type_graphql_1.InputType)()
33
+ (0, type_graphql_1.InputType)({ description: 'Input for updating (patching) an existing board group.' })
34
34
  ], GroupPatch);
35
35
  let GroupList = class GroupList {
36
36
  };
37
37
  exports.GroupList = GroupList;
38
38
  tslib_1.__decorate([
39
- (0, type_graphql_1.Field)(type => [group_js_1.Group]),
39
+ (0, type_graphql_1.Field)(type => [group_js_1.Group], { description: 'The list of group items.' }),
40
40
  tslib_1.__metadata("design:type", Array)
41
41
  ], GroupList.prototype, "items", void 0);
42
42
  tslib_1.__decorate([
43
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
43
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The total number of groups.' }),
44
44
  tslib_1.__metadata("design:type", Number)
45
45
  ], GroupList.prototype, "total", void 0);
46
46
  exports.GroupList = GroupList = tslib_1.__decorate([
47
- (0, type_graphql_1.ObjectType)()
47
+ (0, type_graphql_1.ObjectType)({ description: 'A paginated list of board groups.' })
48
48
  ], GroupList);
49
49
  //# sourceMappingURL=group-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group-type.js","sourceRoot":"","sources":["../../../server/service/group/group-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,yCAAkC;AAG3B,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAMpB,CAAA;AANY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,GAAE;;sCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACN;mBALT,QAAQ;IADpB,IAAA,wBAAS,GAAE;GACC,QAAQ,CAMpB;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACd;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;qBALT,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAMtB;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, registerEnumType } from 'type-graphql'\n\nimport { Group } from './group.js'\n\n@InputType()\nexport class NewGroup {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class GroupPatch {\n @Field({ nullable: true })\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@ObjectType()\nexport class GroupList {\n @Field(type => [Group])\n items: Group[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"group-type.js","sourceRoot":"","sources":["../../../server/service/group/group-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,yCAAkC;AAG3B,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAMpB,CAAA;AANY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;sCACzC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;6CAChE;mBALT,QAAQ;IADpB,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;GACvD,QAAQ,CAMpB;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;wCAC1D;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;;+CACzD;qBALT,UAAU;IADtB,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;GACxE,UAAU,CAMtB;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,mCAAmC,EAAE,CAAC;GACpD,SAAS,CAMrB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Group } from './group.js'\n\n@InputType({ description: 'Input for creating a new board group.' })\nexport class NewGroup {\n @Field({ description: 'The name of the new group.' })\n name: string\n\n @Field({ nullable: true, description: 'A detailed description for the new group.' })\n description?: string\n}\n\n@InputType({ description: 'Input for updating (patching) an existing board group.' })\nexport class GroupPatch {\n @Field({ nullable: true, description: 'The new name for the group.' })\n name: string\n\n @Field({ nullable: true, description: 'The new description for the group.' })\n description?: string\n}\n\n@ObjectType({ description: 'A paginated list of board groups.' })\nexport class GroupList {\n @Field(type => [Group], { description: 'The list of group items.' })\n items: Group[]\n\n @Field(type => Int, { description: 'The total number of groups.' })\n total: number\n}\n"]}
@@ -12,12 +12,12 @@ let Group = class Group {
12
12
  exports.Group = Group;
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 group.' }),
16
16
  tslib_1.__metadata("design:type", String)
17
17
  ], Group.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 group belongs.' }),
21
21
  tslib_1.__metadata("design:type", shell_1.Domain)
22
22
  ], Group.prototype, "domain", void 0);
23
23
  tslib_1.__decorate([
@@ -26,34 +26,34 @@ tslib_1.__decorate([
26
26
  ], Group.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 group.' }),
30
30
  tslib_1.__metadata("design:type", String)
31
31
  ], Group.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 group.' }),
37
37
  tslib_1.__metadata("design:type", String)
38
38
  ], Group.prototype, "description", void 0);
39
39
  tslib_1.__decorate([
40
40
  (0, typeorm_1.OneToMany)(type => board_js_1.Board, board => board.group),
41
- (0, type_graphql_1.Field)(type => [board_js_1.Board], { nullable: true }),
41
+ (0, type_graphql_1.Field)(type => [board_js_1.Board], { nullable: true, description: 'The list of boards belonging to this group.' }),
42
42
  tslib_1.__metadata("design:type", Array)
43
43
  ], Group.prototype, "boards", void 0);
44
44
  tslib_1.__decorate([
45
45
  (0, typeorm_1.CreateDateColumn)(),
46
- (0, type_graphql_1.Field)({ nullable: true }),
46
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the group was created.' }),
47
47
  tslib_1.__metadata("design:type", Date)
48
48
  ], Group.prototype, "createdAt", void 0);
49
49
  tslib_1.__decorate([
50
50
  (0, typeorm_1.UpdateDateColumn)(),
51
- (0, type_graphql_1.Field)({ nullable: true }),
51
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the group was last updated.' }),
52
52
  tslib_1.__metadata("design:type", Date)
53
53
  ], Group.prototype, "updatedAt", void 0);
54
54
  tslib_1.__decorate([
55
55
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
56
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
56
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created the group.' }),
57
57
  tslib_1.__metadata("design:type", auth_base_1.User)
58
58
  ], Group.prototype, "creator", void 0);
59
59
  tslib_1.__decorate([
@@ -62,7 +62,7 @@ tslib_1.__decorate([
62
62
  ], Group.prototype, "creatorId", void 0);
63
63
  tslib_1.__decorate([
64
64
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
65
- (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 last updated the group.' }),
66
66
  tslib_1.__metadata("design:type", auth_base_1.User)
67
67
  ], Group.prototype, "updater", void 0);
68
68
  tslib_1.__decorate([
@@ -72,6 +72,6 @@ tslib_1.__decorate([
72
72
  exports.Group = Group = tslib_1.__decorate([
73
73
  (0, typeorm_1.Entity)(),
74
74
  (0, typeorm_1.Index)('ix_group_0', (group) => [group.domain, group.name], { unique: true }),
75
- (0, type_graphql_1.ObjectType)({ description: 'Entity for Board Management Group' })
75
+ (0, type_graphql_1.ObjectType)({ description: 'A group used to organize and manage boards.' })
76
76
  ], Group);
77
77
  //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.js","sourceRoot":"","sources":["../../../server/service/group/group.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAChD,gDAAyC;AAKlC,IAAM,KAAK,GAAX,MAAM,KAAK;CA+CjB,CAAA;AA/CY,sBAAK;AAGP;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,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,cAAM;qCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;;uCAC1B;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;mCACI;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACN;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAK,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;IAC9C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AW,EAAE,mCAAmC,EAAE,CAAC;GACpD,KAAK,CA+CjB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Board } from '../board/board.js'\n\n@Entity()\n@Index('ix_group_0', (group: Group) => [group.domain, group.name], { unique: true })\n@ObjectType({ description: 'Entity for Board Management Group' })\nexport class Group {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @RelationId((group: Group) => group.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 @OneToMany(type => Board, board => board.group)\n @Field(type => [Board], { nullable: true })\n boards: Board[]\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, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((group: Group) => group.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((group: Group) => group.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../../server/service/group/group.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAChD,gDAAyC;AAKlC,IAAM,KAAK,GAAX,MAAM,KAAK;CA+CjB,CAAA;AA/CY,sBAAK;AAGP;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAA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I,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,WAAW,EAAE,iCAAiC,EAAE,CAAC;sCAC9E,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,WAAW,EAAE,sCAAsC,EAAE,CAAC;sCACnF,gBAAI;sCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;;wCAC1B;gBA9CP,KAAK;IAHjB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACnF,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;GAC9D,KAAK,CA+CjB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Board } from '../board/board.js'\n\n@Entity()\n@Index('ix_group_0', (group: Group) => [group.domain, group.name], { unique: true })\n@ObjectType({ description: 'A group used to organize and manage boards.' })\nexport class Group {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the group.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain to which this group belongs.' })\n domain?: Domain\n\n @RelationId((group: Group) => group.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'The name of the group.' })\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true, description: 'A detailed description of the group.' })\n description?: string\n\n @OneToMany(type => Board, board => board.group)\n @Field(type => [Board], { nullable: true, description: 'The list of boards belonging to this group.' })\n boards: Board[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the group was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the 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 group.' })\n creator?: User\n\n @RelationId((group: Group) => group.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the group.' })\n updater?: User\n\n @RelationId((group: Group) => group.updater)\n updaterId?: string\n}\n"]}
@@ -96,7 +96,7 @@ let PlayGroupMutation = class PlayGroupMutation {
96
96
  };
97
97
  exports.PlayGroupMutation = PlayGroupMutation;
98
98
  tslib_1.__decorate([
99
- (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'To create new PlayGroup' }),
99
+ (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'Creates a new play group.' }),
100
100
  (0, type_graphql_1.Directive)('@transaction'),
101
101
  tslib_1.__param(0, (0, type_graphql_1.Arg)('playGroup')),
102
102
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -105,7 +105,7 @@ tslib_1.__decorate([
105
105
  tslib_1.__metadata("design:returntype", Promise)
106
106
  ], PlayGroupMutation.prototype, "createPlayGroup", null);
107
107
  tslib_1.__decorate([
108
- (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'To modify PlayGroup information' }),
108
+ (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'Updates an existing play group.' }),
109
109
  (0, type_graphql_1.Directive)('@transaction'),
110
110
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
111
111
  tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
@@ -115,7 +115,7 @@ tslib_1.__decorate([
115
115
  tslib_1.__metadata("design:returntype", Promise)
116
116
  ], PlayGroupMutation.prototype, "updatePlayGroup", null);
117
117
  tslib_1.__decorate([
118
- (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'To modify board order of a PlayGroup' }),
118
+ (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'Sets the custom playback order for boards in a play group.' }),
119
119
  (0, type_graphql_1.Directive)('@transaction'),
120
120
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
121
121
  tslib_1.__param(1, (0, type_graphql_1.Arg)('boardIds', type => [String])),
@@ -125,7 +125,7 @@ tslib_1.__decorate([
125
125
  tslib_1.__metadata("design:returntype", Promise)
126
126
  ], PlayGroupMutation.prototype, "reorderPlayGroup", null);
127
127
  tslib_1.__decorate([
128
- (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'To make the board to join the play group' }),
128
+ (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'Adds one or more boards to a play group.' }),
129
129
  (0, type_graphql_1.Directive)('@transaction'),
130
130
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
131
131
  tslib_1.__param(1, (0, type_graphql_1.Arg)('boardIds', type => [String])),
@@ -135,7 +135,7 @@ tslib_1.__decorate([
135
135
  tslib_1.__metadata("design:returntype", Promise)
136
136
  ], PlayGroupMutation.prototype, "joinPlayGroup", null);
137
137
  tslib_1.__decorate([
138
- (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'To make the board to leave from the play group' }),
138
+ (0, type_graphql_1.Mutation)(returns => play_group_js_1.PlayGroup, { description: 'Removes one or more boards from a play group.' }),
139
139
  (0, type_graphql_1.Directive)('@transaction'),
140
140
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
141
141
  tslib_1.__param(1, (0, type_graphql_1.Arg)('boardIds', type => [String])),
@@ -145,7 +145,7 @@ tslib_1.__decorate([
145
145
  tslib_1.__metadata("design:returntype", Promise)
146
146
  ], PlayGroupMutation.prototype, "leavePlayGroup", null);
147
147
  tslib_1.__decorate([
148
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete PlayGroup' }),
148
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Deletes a play group.' }),
149
149
  (0, type_graphql_1.Directive)('@transaction'),
150
150
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
151
151
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -1 +1 @@
1
- {"version":3,"file":"play-group-mutation.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-mutation.ts"],"names":[],"mappings":";;;;AACA,+CAAsE;AACtE,qCAA4B;AAE5B,gDAAyC;AACzC,mDAA2C;AAC3C,6DAAmE;AAG5D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAGtB,AAAN,KAAK,CAAC,eAAe,CACD,SAAuB,EAClC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,yBAAS,CAAC,CAAC,IAAI,CAAC;YAC5C,MAAM;YACN,GAAG,SAAS;YACZ,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,eAAe,CACR,EAAU,EACP,KAAqB,EAC5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AAC,OAAO,CAAC,EAAE,CAAC,yBAAS,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IAC3F,IAAA,wBAAS,EAAC,cAAc,CAAC;IAEvB,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDA2BP;AAIK;IAFL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,yBAAS,EAAE,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;IACjG,IAAA,wBAAS,EAAC,cAAc,CAAC;IAEvB,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDA8BP;AAIK;IAFL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACpE,IAAA,wBAAS,EAAC,cAAc,CAAC;IACH,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDASlD;4BAzIU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,yBAAS,CAAC;GACP,iBAAiB,CA0I7B","sourcesContent":["import { Data } from '@things-factory/shell'\nimport { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Board } from '../board/board.js'\nimport { PlayGroup } from './play-group.js'\nimport { NewPlayGroup, PlayGroupPatch } from './play-group-type.js'\n\n@Resolver(PlayGroup)\nexport class PlayGroupMutation {\n @Mutation(returns => PlayGroup, { description: 'To create new PlayGroup' })\n @Directive('@transaction')\n async createPlayGroup(\n @Arg('playGroup') playGroup: NewPlayGroup,\n @Ctx() context: ResolverContext\n ): Promise<PlayGroup> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(PlayGroup).save({\n domain,\n ...playGroup,\n creator: user,\n updater: user\n })\n }\n\n @Mutation(returns => PlayGroup, { description: 'To modify PlayGroup information' })\n @Directive('@transaction')\n async updatePlayGroup(\n @Arg('id') id: string,\n @Arg('patch') patch: PlayGroupPatch,\n @Ctx() context: ResolverContext\n ): Promise<PlayGroup> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(PlayGroup)\n\n const playGroup = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n return await repository.save({\n ...playGroup,\n ...patch,\n updater: user\n })\n }\n\n @Mutation(returns => PlayGroup, { description: 'To modify board order of a PlayGroup' })\n @Directive('@transaction')\n async reorderPlayGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ): Promise<PlayGroup> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(PlayGroup)\n\n const playGroup = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n return await repository.save({\n ...playGroup,\n order: boardIds,\n updater: user\n })\n }\n\n @Mutation(returns => PlayGroup, { description: 'To make the board to join the play group' })\n @Directive('@transaction')\n async joinPlayGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ) {\n const { tx } = context.state\n\n const repository = tx.getRepository(PlayGroup)\n const playGroup = await repository.findOne({\n where: { id },\n relations: ['boards']\n })\n const order = playGroup.order || []\n\n const boardIdList = playGroup.boards.map(board => board.id)\n boardIds.forEach(boardId => {\n if (boardIdList.indexOf(boardId) == -1) {\n boardIdList.push(boardId)\n }\n if (order.indexOf(boardId) == -1) {\n order.push(boardId)\n }\n })\n\n const boardRepository = tx.getRepository(Board)\n playGroup.boards = await boardRepository.findBy({ id: In(boardIdList) })\n playGroup.updatedAt = new Date()\n playGroup.order = order\n\n return await repository.save(playGroup)\n }\n\n @Mutation(returns => PlayGroup, { description: 'To make the board to leave from the play group' })\n @Directive('@transaction')\n async leavePlayGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ) {\n const { tx } = context.state\n\n const repository = tx.getRepository(PlayGroup)\n const playGroup = await repository.findOne({\n where: { id },\n relations: ['boards']\n })\n const order = playGroup.order || []\n\n const boardIdList = playGroup.boards.map(board => board.id)\n boardIds.forEach(boardId => {\n let index = boardIdList.indexOf(boardId)\n if (index !== -1) {\n boardIdList.splice(index, 1)\n }\n\n index = order.indexOf(boardId)\n if (index !== -1) {\n order.splice(index, 1)\n }\n })\n\n const boardRepository = tx.getRepository(Board)\n playGroup.boards = await boardRepository.findBy({ id: In(boardIdList) })\n playGroup.updatedAt = new Date()\n playGroup.order = order\n\n return await repository.save(playGroup)\n }\n\n @Mutation(returns => Boolean, { description: 'To delete PlayGroup' })\n @Directive('@transaction')\n async deletePlayGroup(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n const repository = tx.getRepository(PlayGroup)\n\n /* TODO - 플레이 그룹은 소속된 보드-플레이그룹 관계들도 제거되어야 한다. */\n const playGroup = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n await repository.delete(id)\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"play-group-mutation.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-mutation.ts"],"names":[],"mappings":";;;;AACA,+CAAsE;AACtE,qCAA4B;AAE5B,gDAAyC;AACzC,mDAA2C;AAC3C,6DAAmE;AAG5D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAGtB,AAAN,KAAK,CAAC,eAAe,CACD,SAAuB,EAClC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAA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esContent":["import { Data } from '@things-factory/shell'\nimport { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Board } from '../board/board.js'\nimport { PlayGroup } from './play-group.js'\nimport { NewPlayGroup, PlayGroupPatch } from './play-group-type.js'\n\n@Resolver(PlayGroup)\nexport class PlayGroupMutation {\n @Mutation(returns => PlayGroup, { description: 'Creates a new play group.' })\n @Directive('@transaction')\n async createPlayGroup(\n @Arg('playGroup') playGroup: NewPlayGroup,\n @Ctx() context: ResolverContext\n ): Promise<PlayGroup> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(PlayGroup).save({\n domain,\n ...playGroup,\n creator: user,\n updater: user\n })\n }\n\n @Mutation(returns => PlayGroup, { description: 'Updates an existing play group.' })\n @Directive('@transaction')\n async updatePlayGroup(\n @Arg('id') id: string,\n @Arg('patch') patch: PlayGroupPatch,\n @Ctx() context: ResolverContext\n ): Promise<PlayGroup> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(PlayGroup)\n\n const playGroup = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n return await repository.save({\n ...playGroup,\n ...patch,\n updater: user\n })\n }\n\n @Mutation(returns => PlayGroup, { description: 'Sets the custom playback order for boards in a play group.' })\n @Directive('@transaction')\n async reorderPlayGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ): Promise<PlayGroup> {\n const { domain, user, tx } = context.state\n const repository = tx.getRepository(PlayGroup)\n\n const playGroup = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n return await repository.save({\n ...playGroup,\n order: boardIds,\n updater: user\n })\n }\n\n @Mutation(returns => PlayGroup, { description: 'Adds one or more boards to a play group.' })\n @Directive('@transaction')\n async joinPlayGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ) {\n const { tx } = context.state\n\n const repository = tx.getRepository(PlayGroup)\n const playGroup = await repository.findOne({\n where: { id },\n relations: ['boards']\n })\n const order = playGroup.order || []\n\n const boardIdList = playGroup.boards.map(board => board.id)\n boardIds.forEach(boardId => {\n if (boardIdList.indexOf(boardId) == -1) {\n boardIdList.push(boardId)\n }\n if (order.indexOf(boardId) == -1) {\n order.push(boardId)\n }\n })\n\n const boardRepository = tx.getRepository(Board)\n playGroup.boards = await boardRepository.findBy({ id: In(boardIdList) })\n playGroup.updatedAt = new Date()\n playGroup.order = order\n\n return await repository.save(playGroup)\n }\n\n @Mutation(returns => PlayGroup, { description: 'Removes one or more boards from a play group.' })\n @Directive('@transaction')\n async leavePlayGroup(\n @Arg('id') id: string,\n @Arg('boardIds', type => [String]) boardIds: string[],\n @Ctx() context: ResolverContext\n ) {\n const { tx } = context.state\n\n const repository = tx.getRepository(PlayGroup)\n const playGroup = await repository.findOne({\n where: { id },\n relations: ['boards']\n })\n const order = playGroup.order || []\n\n const boardIdList = playGroup.boards.map(board => board.id)\n boardIds.forEach(boardId => {\n let index = boardIdList.indexOf(boardId)\n if (index !== -1) {\n boardIdList.splice(index, 1)\n }\n\n index = order.indexOf(boardId)\n if (index !== -1) {\n order.splice(index, 1)\n }\n })\n\n const boardRepository = tx.getRepository(Board)\n playGroup.boards = await boardRepository.findBy({ id: In(boardIdList) })\n playGroup.updatedAt = new Date()\n playGroup.order = order\n\n return await repository.save(playGroup)\n }\n\n @Mutation(returns => Boolean, { description: 'Deletes a play group.' })\n @Directive('@transaction')\n async deletePlayGroup(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n const repository = tx.getRepository(PlayGroup)\n\n /* TODO - 플레이 그룹은 소속된 보드-플레이그룹 관계들도 제거되어야 한다. */\n const playGroup = await repository.findOneBy({ domain: { id: domain.id }, id })\n\n await repository.delete(id)\n return true\n }\n}\n"]}
@@ -72,7 +72,7 @@ let PlayGroupQuery = class PlayGroupQuery {
72
72
  };
73
73
  exports.PlayGroupQuery = PlayGroupQuery;
74
74
  tslib_1.__decorate([
75
- (0, type_graphql_1.Query)(returns => play_group_js_1.PlayGroup, { nullable: true, description: 'To fetch a PlayGroup' }),
75
+ (0, type_graphql_1.Query)(returns => play_group_js_1.PlayGroup, { nullable: true, description: 'Finds a single play group by its ID.' }),
76
76
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
77
77
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
78
78
  tslib_1.__metadata("design:type", Function),
@@ -80,7 +80,7 @@ tslib_1.__decorate([
80
80
  tslib_1.__metadata("design:returntype", Promise)
81
81
  ], PlayGroupQuery.prototype, "playGroup", null);
82
82
  tslib_1.__decorate([
83
- (0, type_graphql_1.Query)(returns => play_group_js_1.PlayGroup, { nullable: true, description: 'To fetch a PlayGroup by name' }),
83
+ (0, type_graphql_1.Query)(returns => play_group_js_1.PlayGroup, { nullable: true, description: 'Finds a single play group by its name.' }),
84
84
  tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
85
85
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
86
86
  tslib_1.__metadata("design:type", Function),
@@ -88,7 +88,7 @@ tslib_1.__decorate([
88
88
  tslib_1.__metadata("design:returntype", Promise)
89
89
  ], PlayGroupQuery.prototype, "playGroupByName", null);
90
90
  tslib_1.__decorate([
91
- (0, type_graphql_1.Query)(returns => play_group_type_js_1.PlayGroupList, { description: 'To fetch multiple PlayGroups' }),
91
+ (0, type_graphql_1.Query)(returns => play_group_type_js_1.PlayGroupList, { description: 'Retrieves a paginated list of play groups.' }),
92
92
  tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
93
93
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
94
94
  tslib_1.__metadata("design:type", Function),
@@ -96,28 +96,30 @@ tslib_1.__decorate([
96
96
  tslib_1.__metadata("design:returntype", Promise)
97
97
  ], PlayGroupQuery.prototype, "playGroups", null);
98
98
  tslib_1.__decorate([
99
- (0, type_graphql_1.FieldResolver)(type => [board_js_1.Board]),
99
+ (0, type_graphql_1.FieldResolver)(type => [board_js_1.Board], {
100
+ description: 'Resolves the ordered list of boards for a play group, sorted by the custom order array.'
101
+ }),
100
102
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
101
103
  tslib_1.__metadata("design:type", Function),
102
104
  tslib_1.__metadata("design:paramtypes", [Object]),
103
105
  tslib_1.__metadata("design:returntype", Promise)
104
106
  ], PlayGroupQuery.prototype, "boards", null);
105
107
  tslib_1.__decorate([
106
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
108
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain, { description: 'Resolves the domain associated with the play group.' }),
107
109
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
108
110
  tslib_1.__metadata("design:type", Function),
109
111
  tslib_1.__metadata("design:paramtypes", [play_group_js_1.PlayGroup]),
110
112
  tslib_1.__metadata("design:returntype", Promise)
111
113
  ], PlayGroupQuery.prototype, "domain", null);
112
114
  tslib_1.__decorate([
113
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
115
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Resolves the user who last updated the play group.' }),
114
116
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
115
117
  tslib_1.__metadata("design:type", Function),
116
118
  tslib_1.__metadata("design:paramtypes", [play_group_js_1.PlayGroup]),
117
119
  tslib_1.__metadata("design:returntype", Promise)
118
120
  ], PlayGroupQuery.prototype, "updater", null);
119
121
  tslib_1.__decorate([
120
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
122
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Resolves the user who created the play group.' }),
121
123
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
122
124
  tslib_1.__metadata("design:type", Function),
123
125
  tslib_1.__metadata("design:paramtypes", [play_group_js_1.PlayGroup]),
@@ -1 +1 @@
1
- {"version":3,"file":"play-group-query.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-query.ts"],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AAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,yBAAS;;4CAExC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,yBAAS;;6CAEzC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,yBAAS;;6CAEzC;yBAhFU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,yBAAS,CAAC;GACP,cAAc,CAiF1B","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Board } from '../board/board.js'\nimport { PlayGroup } from './play-group.js'\nimport { PlayGroupList } from './play-group-type.js'\n\n@Resolver(PlayGroup)\nexport class PlayGroupQuery {\n @Query(returns => PlayGroup, { nullable: true, description: 'To fetch a PlayGroup' })\n async playGroup(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PlayGroup> {\n const { domain } = context.state\n\n return await getRepository(PlayGroup).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => PlayGroup, { nullable: true, description: 'To fetch a PlayGroup by name' })\n async playGroupByName(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<PlayGroup> {\n const { domain } = context.state\n\n return await getRepository(PlayGroup).findOne({\n where: { domain: { id: domain.id }, name }\n })\n }\n\n @Query(returns => PlayGroupList, { description: 'To fetch multiple PlayGroups' })\n async playGroups(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<PlayGroupList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(PlayGroup),\n params,\n domain,\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => [Board])\n async boards(@Root() playGroup) {\n const { order = [], boards = [] } = await getRepository(PlayGroup).findOne({\n where: { id: playGroup.id },\n relations: ['boards']\n })\n\n return boards.sort((a, b) => {\n // 배열 A에 포함된 아이디의 순서를 가져옵니다.\n const indexOfOrder = (order || []).indexOf(a.id)\n const indexOfBoards = (order || []).indexOf(b.id)\n\n // 두 아이디의 순서를 비교하여 정렬합니다.\n if (indexOfOrder === -1 && indexOfBoards === -1) {\n // 두 아이디 모두 배열 A에 없는 경우, 그대로 유지합니다.\n return 0\n } else if (indexOfOrder === -1) {\n // 아이디 A만 배열 A에 없는 경우, 아이디 B를 먼저 정렬합니다.\n return 1\n } else if (indexOfBoards === -1) {\n // 아이디 B만 배열 A에 없는 경우, 아이디 A를 먼저 정렬합니다.\n return -1\n } else {\n // 두 아이디 모두 배열 A에 있는 경우, 배열 A의 아이디 순서대로 정렬합니다.\n return indexOfOrder - indexOfBoards\n }\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() playGroup: PlayGroup) {\n return await getRepository(Domain).findOneBy({ id: playGroup.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() playGroup: PlayGroup): Promise<User> {\n return await getRepository(User).findOneBy({ id: playGroup.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() playGroup: PlayGroup): Promise<User> {\n return await getRepository(User).findOneBy({ id: playGroup.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"play-group-query.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,gDAAyC;AACzC,mDAA2C;AAC3C,6DAAoD;AAG7C,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,SAAS,CAAY,EAAU,EAAS,O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ADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;IACpF,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,yBAAS;;6CAEzC;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;;6CAAY,yBAAS;;6CAEzC;yBAlFU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,yBAAS,CAAC;GACP,cAAc,CAmF1B","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Board } from '../board/board.js'\nimport { PlayGroup } from './play-group.js'\nimport { PlayGroupList } from './play-group-type.js'\n\n@Resolver(PlayGroup)\nexport class PlayGroupQuery {\n @Query(returns => PlayGroup, { nullable: true, description: 'Finds a single play group by its ID.' })\n async playGroup(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PlayGroup> {\n const { domain } = context.state\n\n return await getRepository(PlayGroup).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => PlayGroup, { nullable: true, description: 'Finds a single play group by its name.' })\n async playGroupByName(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<PlayGroup> {\n const { domain } = context.state\n\n return await getRepository(PlayGroup).findOne({\n where: { domain: { id: domain.id }, name }\n })\n }\n\n @Query(returns => PlayGroupList, { description: 'Retrieves a paginated list of play groups.' })\n async playGroups(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<PlayGroupList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(PlayGroup),\n params,\n domain,\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => [Board], {\n description: 'Resolves the ordered list of boards for a play group, sorted by the custom order array.'\n })\n async boards(@Root() playGroup) {\n const { order = [], boards = [] } = await getRepository(PlayGroup).findOne({\n where: { id: playGroup.id },\n relations: ['boards']\n })\n\n return boards.sort((a, b) => {\n // 배열 A에 포함된 아이디의 순서를 가져옵니다.\n const indexOfOrder = (order || []).indexOf(a.id)\n const indexOfBoards = (order || []).indexOf(b.id)\n\n // 두 아이디의 순서를 비교하여 정렬합니다.\n if (indexOfOrder === -1 && indexOfBoards === -1) {\n // 두 아이디 모두 배열 A에 없는 경우, 그대로 유지합니다.\n return 0\n } else if (indexOfOrder === -1) {\n // 아이디 A만 배열 A에 없는 경우, 아이디 B를 먼저 정렬합니다.\n return 1\n } else if (indexOfBoards === -1) {\n // 아이디 B만 배열 A에 없는 경우, 아이디 A를 먼저 정렬합니다.\n return -1\n } else {\n // 두 아이디 모두 배열 A에 있는 경우, 배열 A의 아이디 순서대로 정렬합니다.\n return indexOfOrder - indexOfBoards\n }\n })\n }\n\n @FieldResolver(type => Domain, { description: 'Resolves the domain associated with the play group.' })\n async domain(@Root() playGroup: PlayGroup) {\n return await getRepository(Domain).findOneBy({ id: playGroup.domainId })\n }\n\n @FieldResolver(type => User, { description: 'Resolves the user who last updated the play group.' })\n async updater(@Root() playGroup: PlayGroup): Promise<User> {\n return await getRepository(User).findOneBy({ id: playGroup.updaterId })\n }\n\n @FieldResolver(type => User, { description: 'Resolves the user who created the play group.' })\n async creator(@Root() playGroup: PlayGroup): Promise<User> {\n return await getRepository(User).findOneBy({ id: playGroup.creatorId })\n }\n}\n"]}
@@ -14,6 +14,7 @@ let PlayGroupSubscription = class PlayGroupSubscription {
14
14
  exports.PlayGroupSubscription = PlayGroupSubscription;
15
15
  tslib_1.__decorate([
16
16
  (0, type_graphql_1.Subscription)({
17
+ description: 'Subscribes to real-time updates for a specific play group.',
17
18
  subscribe: ({ args, context, info }) => {
18
19
  const { domain, user } = context.state;
19
20
  const { id } = args;
@@ -1 +1 @@
1
- {"version":3,"file":"play-group-subscription.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-subscription.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,+CAA2C;AAC3C,iDAA8C;AAC9C,mDAA2C;AAGpC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAiChC,SAAS,CAAS,OAAiC,EAAa,EAAU;QACxE,OAAO,OAAO,CAAC,SAAS,CAAA;IAC1B,CAAC;CACF,CAAA;AApCY,sDAAqB;AAiChC;IAhCC,IAAA,2BAAY,EAAC;QACZ,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACrC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;YACtC,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAA;YACnB,MAAM,SAAS,GAAG,MAAM,EAAE,SAAS,CAAA;YAEnC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;YACpC,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;gBACnG,MAAM,IAAI,KAAK,CAAC,UAAU,SAAS,6BAA6B,IAAI,CAAC,KAAK,IAAI,CAAC,CAAA;YACjF,CAAC;YAED,OAAO,IAAA,mBAAI,EACT,cAAM,CAAC,SAAS,CAAC,YAAY,CAAC,EAC9B,IAAA,qBAAM,EAAC,CAAC,OAAiC,EAAE,EAAE;gBAC3C,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,SAAS,CAAA;gBAEvD,IAAI,QAAQ,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC;oBAC3B,OAAO,KAAK,CAAA;gBACd,CAAC;gBAED,IAAI,EAAE,KAAK,WAAW,EAAE,CAAC;oBACvB,OAAO,KAAK,CAAA;gBACd,CAAC;gBAED,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAC;IACS,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqC,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;;;4CAAc,yBAAS;sDAErF;gCAnCU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,yBAAS,CAAC;GACP,qBAAqB,CAoCjC","sourcesContent":["import { Resolver, Subscription, Root, Arg } from 'type-graphql'\nimport { filter, pipe } from 'graphql-yoga'\nimport { pubsub } from '@things-factory/shell'\nimport { PlayGroup } from './play-group.js'\n\n@Resolver(PlayGroup)\nexport class PlayGroupSubscription {\n @Subscription({\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const { id } = args\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n return pipe(\n pubsub.subscribe('play-group'),\n filter((payload: { playGroup: PlayGroup }) => {\n const { id: playGroupId, domainId } = payload.playGroup\n\n if (domainId !== domain.id) {\n return false\n }\n\n if (id !== playGroupId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n playGroup(@Root() payload: { playGroup: PlayGroup }, @Arg('id') id: string): PlayGroup {\n return payload.playGroup\n }\n}\n"]}
1
+ {"version":3,"file":"play-group-subscription.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-subscription.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,+CAA2C;AAC3C,iDAA8C;AAC9C,mDAA2C;AAGpC,IA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O,IAAI,CAAA;YACb,CAAC,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAC;IACS,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqC,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;;;4CAAc,yBAAS;sDAErF;gCApCU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,yBAAS,CAAC;GACP,qBAAqB,CAqCjC","sourcesContent":["import { Resolver, Subscription, Root, Arg } from 'type-graphql'\nimport { filter, pipe } from 'graphql-yoga'\nimport { pubsub } from '@things-factory/shell'\nimport { PlayGroup } from './play-group.js'\n\n@Resolver(PlayGroup)\nexport class PlayGroupSubscription {\n @Subscription({\n description: 'Subscribes to real-time updates for a specific play group.',\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const { id } = args\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n return pipe(\n pubsub.subscribe('play-group'),\n filter((payload: { playGroup: PlayGroup }) => {\n const { id: playGroupId, domainId } = payload.playGroup\n\n if (domainId !== domain.id) {\n return false\n }\n\n if (id !== playGroupId) {\n return false\n }\n\n return true\n })\n )\n }\n })\n playGroup(@Root() payload: { playGroup: PlayGroup }, @Arg('id') id: string): PlayGroup {\n return payload.playGroup\n }\n}\n"]}
@@ -8,42 +8,42 @@ let NewPlayGroup = class NewPlayGroup {
8
8
  };
9
9
  exports.NewPlayGroup = NewPlayGroup;
10
10
  tslib_1.__decorate([
11
- (0, type_graphql_1.Field)(),
11
+ (0, type_graphql_1.Field)({ description: 'The name of the new play group.' }),
12
12
  tslib_1.__metadata("design:type", String)
13
13
  ], NewPlayGroup.prototype, "name", void 0);
14
14
  tslib_1.__decorate([
15
- (0, type_graphql_1.Field)({ nullable: true }),
15
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description for the new play group.' }),
16
16
  tslib_1.__metadata("design:type", String)
17
17
  ], NewPlayGroup.prototype, "description", void 0);
18
18
  exports.NewPlayGroup = NewPlayGroup = tslib_1.__decorate([
19
- (0, type_graphql_1.InputType)()
19
+ (0, type_graphql_1.InputType)({ description: 'Input for creating a new play group.' })
20
20
  ], NewPlayGroup);
21
21
  let PlayGroupPatch = class PlayGroupPatch {
22
22
  };
23
23
  exports.PlayGroupPatch = PlayGroupPatch;
24
24
  tslib_1.__decorate([
25
- (0, type_graphql_1.Field)({ nullable: true }),
25
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new name for the play group.' }),
26
26
  tslib_1.__metadata("design:type", String)
27
27
  ], PlayGroupPatch.prototype, "name", void 0);
28
28
  tslib_1.__decorate([
29
- (0, type_graphql_1.Field)({ nullable: true }),
29
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new description for the play group.' }),
30
30
  tslib_1.__metadata("design:type", String)
31
31
  ], PlayGroupPatch.prototype, "description", void 0);
32
32
  exports.PlayGroupPatch = PlayGroupPatch = tslib_1.__decorate([
33
- (0, type_graphql_1.InputType)()
33
+ (0, type_graphql_1.InputType)({ description: 'Input for updating (patching) an existing play group.' })
34
34
  ], PlayGroupPatch);
35
35
  let PlayGroupList = class PlayGroupList {
36
36
  };
37
37
  exports.PlayGroupList = PlayGroupList;
38
38
  tslib_1.__decorate([
39
- (0, type_graphql_1.Field)(type => [play_group_js_1.PlayGroup]),
39
+ (0, type_graphql_1.Field)(type => [play_group_js_1.PlayGroup], { description: 'The list of play group items.' }),
40
40
  tslib_1.__metadata("design:type", Array)
41
41
  ], PlayGroupList.prototype, "items", void 0);
42
42
  tslib_1.__decorate([
43
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
43
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The total number of play groups.' }),
44
44
  tslib_1.__metadata("design:type", Number)
45
45
  ], PlayGroupList.prototype, "total", void 0);
46
46
  exports.PlayGroupList = PlayGroupList = tslib_1.__decorate([
47
- (0, type_graphql_1.ObjectType)()
47
+ (0, type_graphql_1.ObjectType)({ description: 'A paginated list of play groups.' })
48
48
  ], PlayGroupList);
49
49
  //# sourceMappingURL=play-group-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"play-group-type.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,mDAA2C;AAGpC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,GAAE;;0CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;uBALT,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAMxB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACd;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;yBALT,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAM1B;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,yBAAS,CAAC,CAAC;;4CACT;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;wBALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { PlayGroup } from './play-group.js'\n\n@InputType()\nexport class NewPlayGroup {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class PlayGroupPatch {\n @Field({ nullable: true })\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@ObjectType()\nexport class PlayGroupList {\n @Field(type => [PlayGroup])\n items: PlayGroup[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"play-group-type.js","sourceRoot":"","sources":["../../../server/service/play-group/play-group-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,mDAA2C;AAGpC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;;0CAC9C;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;;iDACrE;uBALT,YAAY;IADxB,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;GACtD,YAAY,CAMxB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;4CAC/D;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;;mDAC9D;yBALT,cAAc;IAD1B,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;GACvE,cAAc,CAM1B;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,yBAAS,CAAC,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;;4CAC3D;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;4CAC3D;wBALF,aAAa;IADzB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;GACnD,aAAa,CAMzB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { PlayGroup } from './play-group.js'\n\n@InputType({ description: 'Input for creating a new play group.' })\nexport class NewPlayGroup {\n @Field({ description: 'The name of the new play group.' })\n name: string\n\n @Field({ nullable: true, description: 'A detailed description for the new play group.' })\n description?: string\n}\n\n@InputType({ description: 'Input for updating (patching) an existing play group.' })\nexport class PlayGroupPatch {\n @Field({ nullable: true, description: 'The new name for the play group.' })\n name: string\n\n @Field({ nullable: true, description: 'The new description for the play group.' })\n description?: string\n}\n\n@ObjectType({ description: 'A paginated list of play groups.' })\nexport class PlayGroupList {\n @Field(type => [PlayGroup], { description: 'The list of play group items.' })\n items: PlayGroup[]\n\n @Field(type => Int, { description: 'The total number of play groups.' })\n total: number\n}\n"]}