@things-factory/calendar 6.0.45

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 (120) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/images/hatiolab-logo.png +0 -0
  3. package/client/bootstrap.ts +1 -0
  4. package/client/index.ts +0 -0
  5. package/client/pages/attendee/attendee-importer.ts +97 -0
  6. package/client/pages/attendee/attendee-list-page.ts +348 -0
  7. package/client/pages/calendar/calendar-importer.ts +97 -0
  8. package/client/pages/calendar/calendar-list-page.ts +348 -0
  9. package/client/pages/calendar/calendar-page.ts +128 -0
  10. package/client/pages/event/event-importer.ts +97 -0
  11. package/client/pages/event/event-list-page.ts +348 -0
  12. package/client/route.ts +19 -0
  13. package/client/themes/calendar-theme.css +54 -0
  14. package/client/tsconfig.json +11 -0
  15. package/concept.md +31 -0
  16. package/dist-client/bootstrap.d.ts +1 -0
  17. package/dist-client/bootstrap.js +2 -0
  18. package/dist-client/bootstrap.js.map +1 -0
  19. package/dist-client/index.d.ts +0 -0
  20. package/dist-client/index.js +2 -0
  21. package/dist-client/index.js.map +1 -0
  22. package/dist-client/pages/attendee/attendee-importer.d.ts +22 -0
  23. package/dist-client/pages/attendee/attendee-importer.js +100 -0
  24. package/dist-client/pages/attendee/attendee-importer.js.map +1 -0
  25. package/dist-client/pages/attendee/attendee-list-page.d.ts +62 -0
  26. package/dist-client/pages/attendee/attendee-list-page.js +326 -0
  27. package/dist-client/pages/attendee/attendee-list-page.js.map +1 -0
  28. package/dist-client/pages/calendar/calendar-importer.d.ts +22 -0
  29. package/dist-client/pages/calendar/calendar-importer.js +100 -0
  30. package/dist-client/pages/calendar/calendar-importer.js.map +1 -0
  31. package/dist-client/pages/calendar/calendar-list-page.d.ts +62 -0
  32. package/dist-client/pages/calendar/calendar-list-page.js +326 -0
  33. package/dist-client/pages/calendar/calendar-list-page.js.map +1 -0
  34. package/dist-client/pages/calendar/calendar-page.d.ts +26 -0
  35. package/dist-client/pages/calendar/calendar-page.js +128 -0
  36. package/dist-client/pages/calendar/calendar-page.js.map +1 -0
  37. package/dist-client/pages/event/event-importer.d.ts +22 -0
  38. package/dist-client/pages/event/event-importer.js +100 -0
  39. package/dist-client/pages/event/event-importer.js.map +1 -0
  40. package/dist-client/pages/event/event-list-page.d.ts +62 -0
  41. package/dist-client/pages/event/event-list-page.js +326 -0
  42. package/dist-client/pages/event/event-list-page.js.map +1 -0
  43. package/dist-client/route.d.ts +1 -0
  44. package/dist-client/route.js +17 -0
  45. package/dist-client/route.js.map +1 -0
  46. package/dist-client/tsconfig.tsbuildinfo +1 -0
  47. package/dist-server/controllers/index.js +1 -0
  48. package/dist-server/controllers/index.js.map +1 -0
  49. package/dist-server/index.js +7 -0
  50. package/dist-server/index.js.map +1 -0
  51. package/dist-server/middlewares/index.js +8 -0
  52. package/dist-server/middlewares/index.js.map +1 -0
  53. package/dist-server/migrations/index.js +12 -0
  54. package/dist-server/migrations/index.js.map +1 -0
  55. package/dist-server/routes.js +25 -0
  56. package/dist-server/routes.js.map +1 -0
  57. package/dist-server/service/attendee/attendee-mutation.js +124 -0
  58. package/dist-server/service/attendee/attendee-mutation.js.map +1 -0
  59. package/dist-server/service/attendee/attendee-query.js +47 -0
  60. package/dist-server/service/attendee/attendee-query.js.map +1 -0
  61. package/dist-server/service/attendee/attendee-type.js +65 -0
  62. package/dist-server/service/attendee/attendee-type.js.map +1 -0
  63. package/dist-server/service/attendee/attendee.js +46 -0
  64. package/dist-server/service/attendee/attendee.js.map +1 -0
  65. package/dist-server/service/attendee/index.js +10 -0
  66. package/dist-server/service/attendee/index.js.map +1 -0
  67. package/dist-server/service/calendar/calendar-mutation.js +168 -0
  68. package/dist-server/service/calendar/calendar-mutation.js.map +1 -0
  69. package/dist-server/service/calendar/calendar-query.js +97 -0
  70. package/dist-server/service/calendar/calendar-query.js.map +1 -0
  71. package/dist-server/service/calendar/calendar-type.js +86 -0
  72. package/dist-server/service/calendar/calendar-type.js.map +1 -0
  73. package/dist-server/service/calendar/calendar.js +93 -0
  74. package/dist-server/service/calendar/calendar.js.map +1 -0
  75. package/dist-server/service/calendar/index.js +10 -0
  76. package/dist-server/service/calendar/index.js.map +1 -0
  77. package/dist-server/service/event/event-mutation.js +124 -0
  78. package/dist-server/service/event/event-mutation.js.map +1 -0
  79. package/dist-server/service/event/event-query.js +66 -0
  80. package/dist-server/service/event/event-query.js.map +1 -0
  81. package/dist-server/service/event/event-type.js +86 -0
  82. package/dist-server/service/event/event-type.js.map +1 -0
  83. package/dist-server/service/event/event.js +94 -0
  84. package/dist-server/service/event/event.js.map +1 -0
  85. package/dist-server/service/event/index.js +10 -0
  86. package/dist-server/service/event/index.js.map +1 -0
  87. package/dist-server/service/index.js +33 -0
  88. package/dist-server/service/index.js.map +1 -0
  89. package/dist-server/tsconfig.tsbuildinfo +1 -0
  90. package/helps/calendar/attendee.md +160 -0
  91. package/helps/calendar/calendar.md +160 -0
  92. package/helps/calendar/event.md +160 -0
  93. package/package.json +36 -0
  94. package/server/controllers/index.ts +0 -0
  95. package/server/index.ts +4 -0
  96. package/server/middlewares/index.ts +3 -0
  97. package/server/migrations/index.ts +9 -0
  98. package/server/routes.ts +28 -0
  99. package/server/service/attendee/attendee-mutation.ts +122 -0
  100. package/server/service/attendee/attendee-query.ts +31 -0
  101. package/server/service/attendee/attendee-type.ts +44 -0
  102. package/server/service/attendee/attendee.ts +36 -0
  103. package/server/service/attendee/index.ts +7 -0
  104. package/server/service/calendar/calendar-mutation.ts +198 -0
  105. package/server/service/calendar/calendar-query.ts +62 -0
  106. package/server/service/calendar/calendar-type.ts +61 -0
  107. package/server/service/calendar/calendar.ts +82 -0
  108. package/server/service/calendar/index.ts +7 -0
  109. package/server/service/event/event-mutation.ts +125 -0
  110. package/server/service/event/event-query.ts +38 -0
  111. package/server/service/event/event-type.ts +61 -0
  112. package/server/service/event/event.ts +85 -0
  113. package/server/service/event/index.ts +7 -0
  114. package/server/service/index.ts +32 -0
  115. package/server/tsconfig.json +10 -0
  116. package/things-factory.config.js +25 -0
  117. package/translations/en.json +1 -0
  118. package/translations/ko.json +1 -0
  119. package/translations/ms.json +1 -0
  120. package/translations/zh.json +1 -0
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const calendar_1 = require("./calendar");
5
+ const calendar_query_1 = require("./calendar-query");
6
+ const calendar_mutation_1 = require("./calendar-mutation");
7
+ exports.entities = [calendar_1.Calendar];
8
+ exports.resolvers = [calendar_query_1.CalendarQuery, calendar_mutation_1.CalendarMutation];
9
+ exports.subscribers = [];
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/calendar/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qDAAgD;AAChD,2DAAsD;AAEzC,QAAA,QAAQ,GAAG,CAAC,mBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,8BAAa,EAAE,oCAAgB,CAAC,CAAA;AAC7C,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { Calendar } from './calendar'\nimport { CalendarQuery } from './calendar-query'\nimport { CalendarMutation } from './calendar-mutation'\n\nexport const entities = [Calendar]\nexport const resolvers = [CalendarQuery, CalendarMutation]\nexport const subscribers = []\n"]}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
7
+ const event_1 = require("./event");
8
+ const event_type_1 = require("./event-type");
9
+ let EventMutation = class EventMutation {
10
+ async createEvent(event, context) {
11
+ const { user, tx } = context.state;
12
+ return await tx.getRepository(event_1.Event).save(Object.assign(Object.assign({}, event), { creator: user, updater: user }));
13
+ }
14
+ async updateEvent(id, patch, context) {
15
+ const { user, tx } = context.state;
16
+ const repository = tx.getRepository(event_1.Event);
17
+ const event = await repository.findOne({
18
+ where: { id }
19
+ });
20
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, event), patch), { updater: user }));
21
+ }
22
+ async updateMultipleEvent(patches, context) {
23
+ const { user, tx } = context.state;
24
+ let results = [];
25
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
26
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
27
+ const eventRepo = tx.getRepository(event_1.Event);
28
+ if (_createRecords.length > 0) {
29
+ for (let i = 0; i < _createRecords.length; i++) {
30
+ const newRecord = _createRecords[i];
31
+ const result = await eventRepo.save(Object.assign(Object.assign({}, newRecord), { creator: user, updater: user }));
32
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
33
+ }
34
+ }
35
+ if (_updateRecords.length > 0) {
36
+ for (let i = 0; i < _updateRecords.length; i++) {
37
+ const updateRecord = _updateRecords[i];
38
+ const event = await eventRepo.findOneBy({ id: updateRecord.id });
39
+ const result = await eventRepo.save(Object.assign(Object.assign(Object.assign({}, event), updateRecord), { updater: user }));
40
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
41
+ }
42
+ }
43
+ return results;
44
+ }
45
+ async deleteEvent(id, context) {
46
+ const { tx } = context.state;
47
+ await tx.getRepository(event_1.Event).delete({ id });
48
+ return true;
49
+ }
50
+ async deleteEvents(ids, context) {
51
+ const { tx } = context.state;
52
+ await tx.getRepository(event_1.Event).delete({
53
+ id: (0, typeorm_1.In)(ids)
54
+ });
55
+ return true;
56
+ }
57
+ async importEvents(events, context) {
58
+ const { tx } = context.state;
59
+ await Promise.all(events.map(async (event) => {
60
+ const createdEvent = await tx.getRepository(event_1.Event).save(Object.assign({}, event));
61
+ }));
62
+ return true;
63
+ }
64
+ };
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.Directive)('@transaction'),
67
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To create new Event' }),
68
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('event')),
69
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
70
+ tslib_1.__metadata("design:type", Function),
71
+ tslib_1.__metadata("design:paramtypes", [event_type_1.NewEvent, Object]),
72
+ tslib_1.__metadata("design:returntype", Promise)
73
+ ], EventMutation.prototype, "createEvent", null);
74
+ tslib_1.__decorate([
75
+ (0, type_graphql_1.Directive)('@transaction'),
76
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To modify Event information' }),
77
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
78
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
79
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
80
+ tslib_1.__metadata("design:type", Function),
81
+ tslib_1.__metadata("design:paramtypes", [String, event_type_1.EventPatch, Object]),
82
+ tslib_1.__metadata("design:returntype", Promise)
83
+ ], EventMutation.prototype, "updateEvent", null);
84
+ tslib_1.__decorate([
85
+ (0, type_graphql_1.Directive)('@transaction'),
86
+ (0, type_graphql_1.Mutation)(returns => [event_1.Event], { description: "To modify multiple Events' information" }),
87
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [event_type_1.EventPatch])),
88
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
89
+ tslib_1.__metadata("design:type", Function),
90
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
91
+ tslib_1.__metadata("design:returntype", Promise)
92
+ ], EventMutation.prototype, "updateMultipleEvent", null);
93
+ tslib_1.__decorate([
94
+ (0, type_graphql_1.Directive)('@transaction'),
95
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Event' }),
96
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
97
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
98
+ tslib_1.__metadata("design:type", Function),
99
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
100
+ tslib_1.__metadata("design:returntype", Promise)
101
+ ], EventMutation.prototype, "deleteEvent", null);
102
+ tslib_1.__decorate([
103
+ (0, type_graphql_1.Directive)('@transaction'),
104
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Events' }),
105
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
106
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
107
+ tslib_1.__metadata("design:type", Function),
108
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
109
+ tslib_1.__metadata("design:returntype", Promise)
110
+ ], EventMutation.prototype, "deleteEvents", null);
111
+ tslib_1.__decorate([
112
+ (0, type_graphql_1.Directive)('@transaction'),
113
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Events' }),
114
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('events', type => [event_type_1.EventPatch])),
115
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
116
+ tslib_1.__metadata("design:type", Function),
117
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
118
+ tslib_1.__metadata("design:returntype", Promise)
119
+ ], EventMutation.prototype, "importEvents", null);
120
+ EventMutation = tslib_1.__decorate([
121
+ (0, type_graphql_1.Resolver)(event_1.Event)
122
+ ], EventMutation);
123
+ exports.EventMutation = EventMutation;
124
+ //# sourceMappingURL=event-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-mutation.js","sourceRoot":"","sources":["../../../server/service/event/event-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mCAA+B;AAC/B,6CAAmD;AAG5C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,WAAW,CAAe,KAAe,EAAS,OAAwB;QAC9E,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,aAAK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CAAC,CAAC,uBAAU,CAAC,CAAC,CAAA;IACpC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAuCP;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;;;;gDAM9C;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAQrE;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IAExE,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,uBAAU,CAAC,CAAC,CAAA;IACnC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAWP;AApHU,aAAa;IADzB,IAAA,uBAAQ,EAAC,aAAK,CAAC;GACH,aAAa,CAqHzB;AArHY,sCAAa","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Event } from './event'\nimport { NewEvent, EventPatch } from './event-type'\n\n@Resolver(Event)\nexport class EventMutation {\n @Directive('@transaction')\n @Mutation(returns => Event, { description: 'To create new Event' })\n async createEvent(@Arg('event') event: NewEvent, @Ctx() context: ResolverContext): Promise<Event> {\n const { user, tx } = context.state\n\n return await tx.getRepository(Event).save({\n ...event,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Event, { description: 'To modify Event information' })\n async updateEvent(\n @Arg('id') id: string,\n @Arg('patch') patch: EventPatch,\n @Ctx() context: ResolverContext\n ): Promise<Event> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(Event)\n const event = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...event,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [Event], { description: \"To modify multiple Events' information\" })\n async updateMultipleEvent(\n @Arg('patches', type => [EventPatch]) patches: EventPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Event[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const eventRepo = tx.getRepository(Event)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await eventRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const event = await eventRepo.findOneBy({ id: updateRecord.id })\n\n const result = await eventRepo.save({\n ...event,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Event' })\n async deleteEvent(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Event).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Events' })\n async deleteEvents(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Event).delete({\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple Events' })\n async importEvents(\n @Arg('events', type => [EventPatch]) events: EventPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await Promise.all(\n events.map(async (event: EventPatch) => {\n const createdEvent: Event = await tx.getRepository(Event).save({ ...event })\n })\n )\n\n return true\n }\n}\n"]}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const event_1 = require("./event");
9
+ const event_type_1 = require("./event-type");
10
+ let EventQuery = class EventQuery {
11
+ async event(id, context) {
12
+ return await (0, shell_1.getRepository)(event_1.Event).findOne({
13
+ where: { id }
14
+ });
15
+ }
16
+ async events(params, context) {
17
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
18
+ params,
19
+ repository: await (0, shell_1.getRepository)(event_1.Event),
20
+ searchables: ['name', 'description']
21
+ });
22
+ const [items, total] = await queryBuilder.getManyAndCount();
23
+ return { items, total };
24
+ }
25
+ async updater(event) {
26
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: event.updaterId });
27
+ }
28
+ async creator(event) {
29
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: event.creatorId });
30
+ }
31
+ };
32
+ tslib_1.__decorate([
33
+ (0, type_graphql_1.Query)(returns => event_1.Event, { nullable: true, description: 'To fetch a Event' }),
34
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
35
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
36
+ tslib_1.__metadata("design:type", Function),
37
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
38
+ tslib_1.__metadata("design:returntype", Promise)
39
+ ], EventQuery.prototype, "event", null);
40
+ tslib_1.__decorate([
41
+ (0, type_graphql_1.Query)(returns => event_type_1.EventList, { description: 'To fetch multiple Events' }),
42
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
43
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
44
+ tslib_1.__metadata("design:type", Function),
45
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
46
+ tslib_1.__metadata("design:returntype", Promise)
47
+ ], EventQuery.prototype, "events", null);
48
+ tslib_1.__decorate([
49
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
50
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
51
+ tslib_1.__metadata("design:type", Function),
52
+ tslib_1.__metadata("design:paramtypes", [event_1.Event]),
53
+ tslib_1.__metadata("design:returntype", Promise)
54
+ ], EventQuery.prototype, "updater", null);
55
+ tslib_1.__decorate([
56
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
57
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
58
+ tslib_1.__metadata("design:type", Function),
59
+ tslib_1.__metadata("design:paramtypes", [event_1.Event]),
60
+ tslib_1.__metadata("design:returntype", Promise)
61
+ ], EventQuery.prototype, "creator", null);
62
+ EventQuery = tslib_1.__decorate([
63
+ (0, type_graphql_1.Resolver)(event_1.Event)
64
+ ], EventQuery);
65
+ exports.EventQuery = EventQuery;
66
+ //# sourceMappingURL=event-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-query.js","sourceRoot":"","sources":["../../../server/service/event/event-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAA+F;AAC/F,yDAAgD;AAChD,mCAA+B;AAC/B,6CAAwC;AAGjC,IAAM,UAAU,GAAhB,MAAM,UAAU;IAEf,AAAN,KAAK,CAAC,KAAK,CAAY,EAAU,EAAS,OAAwB;QAChE,OAAO,MAAM,I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A;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;wCAUrC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,aAAK;;yCAEjC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAQ,aAAK;;yCAEjC;AA7BU,UAAU;IADtB,IAAA,uBAAQ,EAAC,aAAK,CAAC;GACH,UAAU,CA8BtB;AA9BY,gCAAU","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Event } from './event'\nimport { EventList } from './event-type'\n\n@Resolver(Event)\nexport class EventQuery {\n @Query(returns => Event!, { nullable: true, description: 'To fetch a Event' })\n async event(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Event> {\n return await getRepository(Event).findOne({\n where: { id }\n })\n }\n\n @Query(returns => EventList, { description: 'To fetch multiple Events' })\n async events(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<EventList> {\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(Event),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => User)\n async updater(@Root() event: Event): Promise<User> {\n return await getRepository(User).findOneBy({ id: event.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() event: Event): Promise<User> {\n return await getRepository(User).findOneBy({ id: event.creatorId })\n }\n}\n"]}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventList = exports.EventPatch = exports.NewEvent = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const GraphQLUpload_js_1 = tslib_1.__importDefault(require("graphql-upload/GraphQLUpload.js"));
6
+ const type_graphql_1 = require("type-graphql");
7
+ const event_1 = require("./event");
8
+ let NewEvent = class NewEvent {
9
+ };
10
+ tslib_1.__decorate([
11
+ (0, type_graphql_1.Field)(),
12
+ tslib_1.__metadata("design:type", String)
13
+ ], NewEvent.prototype, "name", void 0);
14
+ tslib_1.__decorate([
15
+ (0, type_graphql_1.Field)({ nullable: true }),
16
+ tslib_1.__metadata("design:type", String)
17
+ ], NewEvent.prototype, "description", void 0);
18
+ tslib_1.__decorate([
19
+ (0, type_graphql_1.Field)(type => event_1.EventStatus, { nullable: true }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], NewEvent.prototype, "state", void 0);
22
+ tslib_1.__decorate([
23
+ (0, type_graphql_1.Field)({ nullable: true }),
24
+ tslib_1.__metadata("design:type", Boolean)
25
+ ], NewEvent.prototype, "active", void 0);
26
+ tslib_1.__decorate([
27
+ (0, type_graphql_1.Field)({ nullable: true }),
28
+ tslib_1.__metadata("design:type", String)
29
+ ], NewEvent.prototype, "params", void 0);
30
+ tslib_1.__decorate([
31
+ (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
32
+ tslib_1.__metadata("design:type", Object)
33
+ ], NewEvent.prototype, "thumbnail", void 0);
34
+ NewEvent = tslib_1.__decorate([
35
+ (0, type_graphql_1.InputType)()
36
+ ], NewEvent);
37
+ exports.NewEvent = NewEvent;
38
+ let EventPatch = class EventPatch {
39
+ };
40
+ tslib_1.__decorate([
41
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
42
+ tslib_1.__metadata("design:type", String)
43
+ ], EventPatch.prototype, "id", void 0);
44
+ tslib_1.__decorate([
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], EventPatch.prototype, "name", void 0);
48
+ tslib_1.__decorate([
49
+ (0, type_graphql_1.Field)({ nullable: true }),
50
+ tslib_1.__metadata("design:type", String)
51
+ ], EventPatch.prototype, "description", void 0);
52
+ tslib_1.__decorate([
53
+ (0, type_graphql_1.Field)(type => event_1.EventStatus, { nullable: true }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], EventPatch.prototype, "state", void 0);
56
+ tslib_1.__decorate([
57
+ (0, type_graphql_1.Field)({ nullable: true }),
58
+ tslib_1.__metadata("design:type", Boolean)
59
+ ], EventPatch.prototype, "active", void 0);
60
+ tslib_1.__decorate([
61
+ (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
62
+ tslib_1.__metadata("design:type", Object)
63
+ ], EventPatch.prototype, "thumbnail", void 0);
64
+ tslib_1.__decorate([
65
+ (0, type_graphql_1.Field)({ nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], EventPatch.prototype, "cuFlag", void 0);
68
+ EventPatch = tslib_1.__decorate([
69
+ (0, type_graphql_1.InputType)()
70
+ ], EventPatch);
71
+ exports.EventPatch = EventPatch;
72
+ let EventList = class EventList {
73
+ };
74
+ tslib_1.__decorate([
75
+ (0, type_graphql_1.Field)(type => [event_1.Event]),
76
+ tslib_1.__metadata("design:type", Array)
77
+ ], EventList.prototype, "items", void 0);
78
+ tslib_1.__decorate([
79
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
80
+ tslib_1.__metadata("design:type", Number)
81
+ ], EventList.prototype, "total", void 0);
82
+ EventList = tslib_1.__decorate([
83
+ (0, type_graphql_1.ObjectType)()
84
+ ], EventList);
85
+ exports.EventList = EventList;
86
+ //# sourceMappingURL=event-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-type.js","sourceRoot":"","sources":["../../../server/service/event/event-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAsF;AAItF,mCAA4C;AAGrC,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAkBpB,CAAA;AAjBC;IAAC,IAAA,oBAAK,GAAE;;sCACI;A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CAAC;;0CACX;AApBJ,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAqBtB;AArBY,gCAAU;AAwBhB,IAAM,SAAS,GAAf,MAAM,SAAS;CAMrB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAK,CAAC,CAAC;;wCACT;AAEd;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;wCACN;AALF,SAAS;IADrB,IAAA,yBAAU,GAAE;GACA,SAAS,CAMrB;AANY,8BAAS","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Event, EventStatus } from './event'\n\n@InputType()\nexport class NewEvent {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => EventStatus, { nullable: true })\n state?: EventStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class EventPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => EventStatus, { nullable: true })\n state?: EventStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class EventList {\n @Field(type => [Event])\n items: Event[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Event = exports.EventStatus = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const attendee_1 = require("../attendee/attendee");
9
+ var EventStatus;
10
+ (function (EventStatus) {
11
+ EventStatus["STATUS_A"] = "STATUS_A";
12
+ EventStatus["STATUS_B"] = "STATUS_B";
13
+ })(EventStatus = exports.EventStatus || (exports.EventStatus = {}));
14
+ (0, type_graphql_1.registerEnumType)(EventStatus, {
15
+ name: 'EventStatus',
16
+ description: 'state enumeration of a event'
17
+ });
18
+ let Event = class Event {
19
+ };
20
+ tslib_1.__decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
22
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], Event.prototype, "id", void 0);
25
+ tslib_1.__decorate([
26
+ (0, typeorm_1.Column)(),
27
+ (0, type_graphql_1.Field)({ nullable: true }),
28
+ tslib_1.__metadata("design:type", String)
29
+ ], Event.prototype, "name", void 0);
30
+ tslib_1.__decorate([
31
+ (0, typeorm_1.Column)({ nullable: true }),
32
+ (0, type_graphql_1.Field)({ nullable: true }),
33
+ tslib_1.__metadata("design:type", String)
34
+ ], Event.prototype, "description", void 0);
35
+ tslib_1.__decorate([
36
+ (0, typeorm_1.Column)({ type: 'datetime' }),
37
+ (0, type_graphql_1.Field)({ nullable: true }),
38
+ tslib_1.__metadata("design:type", Date)
39
+ ], Event.prototype, "startDateTime", void 0);
40
+ tslib_1.__decorate([
41
+ (0, typeorm_1.Column)({ type: 'datetime' }),
42
+ (0, type_graphql_1.Field)({ nullable: true }),
43
+ tslib_1.__metadata("design:type", Date)
44
+ ], Event.prototype, "endDateTime", void 0);
45
+ tslib_1.__decorate([
46
+ (0, typeorm_1.Column)({ nullable: true }),
47
+ (0, type_graphql_1.Field)({ nullable: true }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], Event.prototype, "location", void 0);
50
+ tslib_1.__decorate([
51
+ (0, typeorm_1.ManyToMany)(() => attendee_1.Attendee),
52
+ (0, typeorm_1.JoinTable)(),
53
+ (0, type_graphql_1.Field)(type => [attendee_1.Attendee], { nullable: true }),
54
+ tslib_1.__metadata("design:type", Array)
55
+ ], Event.prototype, "attendees", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.Column)({ nullable: true }),
58
+ (0, type_graphql_1.Field)({ nullable: true }),
59
+ tslib_1.__metadata("design:type", String)
60
+ ], Event.prototype, "state", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.CreateDateColumn)(),
63
+ (0, type_graphql_1.Field)({ nullable: true }),
64
+ tslib_1.__metadata("design:type", Date)
65
+ ], Event.prototype, "createdAt", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.UpdateDateColumn)(),
68
+ (0, type_graphql_1.Field)({ nullable: true }),
69
+ tslib_1.__metadata("design:type", Date)
70
+ ], Event.prototype, "updatedAt", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
73
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
74
+ tslib_1.__metadata("design:type", auth_base_1.User)
75
+ ], Event.prototype, "creator", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.RelationId)((event) => event.creator),
78
+ tslib_1.__metadata("design:type", String)
79
+ ], Event.prototype, "creatorId", void 0);
80
+ tslib_1.__decorate([
81
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
82
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
83
+ tslib_1.__metadata("design:type", auth_base_1.User)
84
+ ], Event.prototype, "updater", void 0);
85
+ tslib_1.__decorate([
86
+ (0, typeorm_1.RelationId)((event) => event.updater),
87
+ tslib_1.__metadata("design:type", String)
88
+ ], Event.prototype, "updaterId", void 0);
89
+ Event = tslib_1.__decorate([
90
+ (0, typeorm_1.Entity)(),
91
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for Event' })
92
+ ], Event);
93
+ exports.Event = Event;
94
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../../server/service/event/event.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,yDAAgD;AAChD,mDAA+C;AAE/C,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAED,IAAA,+BAAgB,EAAC,WAAW,EAAE;IAC5B,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,8BAA8B;CAC5C,CAAC,CAAA;AAIK,IAAM,KAAK,GAAX,MAAM,KAAK;CAuDjB,CAAA;AAtDC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;iCACC;AAEnB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mCACb;AAEb;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACN;AAEpB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACX,IAAI;4CAAA;AAEnB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACb,IAAI;0CAAA;AAEjB;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,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,IAAA,oBAAU,EAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;;wCAC1B;AAtDP,KAAK;IAFjB,IAAA,gBAAM,GAAE;IACR,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;GACnC,KAAK,CAuDjB;AAvDY,sBAAK","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n ManyToMany,\n JoinTable,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Attendee } from '../attendee/attendee'\n\nexport enum EventStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(EventStatus, {\n name: 'EventStatus',\n description: 'state enumeration of a event'\n})\n\n@Entity()\n@ObjectType({ description: 'Entity for Event' })\nexport class Event {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ type: 'datetime' })\n @Field({ nullable: true })\n startDateTime: Date\n\n @Column({ type: 'datetime' })\n @Field({ nullable: true })\n endDateTime: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n location: string\n\n @ManyToMany(() => Attendee)\n @JoinTable()\n @Field(type => [Attendee], { nullable: true })\n attendees: Attendee[]\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: EventStatus\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((event: Event) => event.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((event: Event) => event.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const event_1 = require("./event");
5
+ const event_query_1 = require("./event-query");
6
+ const event_mutation_1 = require("./event-mutation");
7
+ exports.entities = [event_1.Event];
8
+ exports.resolvers = [event_query_1.EventQuery, event_mutation_1.EventMutation];
9
+ exports.subscribers = [];
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/event/index.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAC/B,+CAA0C;AAC1C,qDAAgD;AAEnC,QAAA,QAAQ,GAAG,CAAC,aAAK,CAAC,CAAA;AAClB,QAAA,SAAS,GAAG,CAAC,wBAAU,EAAE,8BAAa,CAAC,CAAA;AACvC,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { Event } from './event'\nimport { EventQuery } from './event-query'\nimport { EventMutation } from './event-mutation'\n\nexport const entities = [Event]\nexport const resolvers = [EventQuery, EventMutation]\nexport const subscribers = []\n"]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schema = exports.subscribers = exports.entities = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* EXPORT ENTITY TYPES */
6
+ tslib_1.__exportStar(require("./attendee/attendee"), exports);
7
+ tslib_1.__exportStar(require("./event/event"), exports);
8
+ tslib_1.__exportStar(require("./calendar/calendar"), exports);
9
+ /* IMPORT ENTITIES AND RESOLVERS */
10
+ const attendee_1 = require("./attendee");
11
+ const event_1 = require("./event");
12
+ const calendar_1 = require("./calendar");
13
+ exports.entities = [
14
+ /* ENTITIES */
15
+ ...attendee_1.entities,
16
+ ...event_1.entities,
17
+ ...calendar_1.entities,
18
+ ];
19
+ exports.subscribers = [
20
+ /* SUBSCRIBERS */
21
+ ...attendee_1.subscribers,
22
+ ...event_1.subscribers,
23
+ ...calendar_1.subscribers,
24
+ ];
25
+ exports.schema = {
26
+ resolverClasses: [
27
+ /* RESOLVER CLASSES */
28
+ ...attendee_1.resolvers,
29
+ ...event_1.resolvers,
30
+ ...calendar_1.resolvers,
31
+ ]
32
+ };
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8DAAmC;AACnC,wDAA6B;AAC7B,8DAAmC;AAEnC,mCAAmC;AACnC,yCAA6H;AAC7H,mCAAiH;AACjH,yCAA6H;AAEhH,QAAA,QAAQ,GAAG;IACtB,cAAc;IACf,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;CACnB,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,iBAAiB;IAClB,GAAG,sBAAmB;IACtB,GAAG,mBAAgB;IACnB,GAAG,sBAAmB;CACtB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACxB,GAAG,oBAAiB;QACpB,GAAG,iBAAc;QACjB,GAAG,oBAAiB;KACnB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './attendee/attendee'\nexport * from './event/event'\nexport * from './calendar/calendar'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as AttendeeEntities, resolvers as AttendeeResolvers, subscribers as AttendeeSubscribers } from './attendee'\nimport { entities as EventEntities, resolvers as EventResolvers, subscribers as EventSubscribers } from './event'\nimport { entities as CalendarEntities, resolvers as CalendarResolvers, subscribers as CalendarSubscribers } from './calendar'\n\nexport const entities = [ \n /* ENTITIES */\n\t...AttendeeEntities,\n\t...EventEntities,\n\t...CalendarEntities,\n] \n\nexport const subscribers = [\n /* SUBSCRIBERS */\n\t...AttendeeSubscribers,\n\t...EventSubscribers,\n\t...CalendarSubscribers,\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n\t\t...AttendeeResolvers,\n\t\t...EventResolvers,\n\t\t...CalendarResolvers,\n ] \n}\n"]}