@things-factory/notification 6.1.23 → 6.1.28

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-client/pages/noti-box/noti-box-list-page.d.ts +49 -0
  2. package/dist-client/pages/noti-box/noti-box-list-page.js +262 -0
  3. package/dist-client/pages/noti-box/noti-box-list-page.js.map +1 -0
  4. package/dist-client/pages/noti-rule/noti-rule-importer.d.ts +22 -0
  5. package/dist-client/pages/noti-rule/noti-rule-importer.js +100 -0
  6. package/dist-client/pages/noti-rule/noti-rule-importer.js.map +1 -0
  7. package/dist-client/pages/noti-rule/noti-rule-list-page.d.ts +62 -0
  8. package/dist-client/pages/noti-rule/noti-rule-list-page.js +380 -0
  9. package/dist-client/pages/noti-rule/noti-rule-list-page.js.map +1 -0
  10. package/dist-client/tsconfig.tsbuildinfo +1 -1
  11. package/dist-server/service/noti-box/index.js +9 -0
  12. package/dist-server/service/noti-box/index.js.map +1 -0
  13. package/dist-server/service/noti-box/noti-box-mutation.js +110 -0
  14. package/dist-server/service/noti-box/noti-box-mutation.js.map +1 -0
  15. package/dist-server/service/noti-box/noti-box-query.js +109 -0
  16. package/dist-server/service/noti-box/noti-box-query.js.map +1 -0
  17. package/dist-server/service/noti-box/noti-box-type.js +69 -0
  18. package/dist-server/service/noti-box/noti-box-type.js.map +1 -0
  19. package/dist-server/service/noti-box/noti-box.js +107 -0
  20. package/dist-server/service/noti-box/noti-box.js.map +1 -0
  21. package/dist-server/service/noti-rule/event-subscriber.js +21 -0
  22. package/dist-server/service/noti-rule/event-subscriber.js.map +1 -0
  23. package/dist-server/service/noti-rule/index.js +12 -0
  24. package/dist-server/service/noti-rule/index.js.map +1 -0
  25. package/dist-server/service/noti-rule/noti-rule-history.js +139 -0
  26. package/dist-server/service/noti-rule/noti-rule-history.js.map +1 -0
  27. package/dist-server/service/noti-rule/noti-rule-mutation.js +168 -0
  28. package/dist-server/service/noti-rule/noti-rule-mutation.js.map +1 -0
  29. package/dist-server/service/noti-rule/noti-rule-query.js +97 -0
  30. package/dist-server/service/noti-rule/noti-rule-query.js.map +1 -0
  31. package/dist-server/service/noti-rule/noti-rule-type.js +102 -0
  32. package/dist-server/service/noti-rule/noti-rule-type.js.map +1 -0
  33. package/dist-server/service/noti-rule/noti-rule.js +146 -0
  34. package/dist-server/service/noti-rule/noti-rule.js.map +1 -0
  35. package/dist-server/service/notification-old/directive-notification.js +59 -0
  36. package/dist-server/service/notification-old/directive-notification.js.map +1 -0
  37. package/dist-server/service/notification-old/index.js +14 -0
  38. package/dist-server/service/notification-old/index.js.map +1 -0
  39. package/dist-server/service/notification-old/notification-resolver.js +45 -0
  40. package/dist-server/service/notification-old/notification-resolver.js.map +1 -0
  41. package/dist-server/service/notification-old/notification.js +49 -0
  42. package/dist-server/service/notification-old/notification.js.map +1 -0
  43. package/dist-server/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +8 -8
  45. package/server/dist-server/tsconfig.tsbuildinfo +1 -0
  46. package/dist-server/migrations/index.js +0 -12
  47. package/dist-server/migrations/index.js.map +0 -1
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotiBoxMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
7
+ const noti_box_1 = require("./noti-box");
8
+ const noti_box_type_1 = require("./noti-box-type");
9
+ let NotiBoxMutation = class NotiBoxMutation {
10
+ async createNotiBox(notiBox, context) {
11
+ const { domain, user, tx } = context.state;
12
+ return await tx.getRepository(noti_box_1.NotiBox).save(Object.assign(Object.assign({}, notiBox), { domain, creator: user, updater: user }));
13
+ }
14
+ async updateNotiBox(id, patch, context) {
15
+ const { domain, user, tx } = context.state;
16
+ const repository = tx.getRepository(noti_box_1.NotiBox);
17
+ const notiBox = await repository.findOne({
18
+ where: { domain: { id: domain.id }, id }
19
+ });
20
+ const result = await repository.save(Object.assign(Object.assign(Object.assign({}, notiBox), patch), { updater: user }));
21
+ return result;
22
+ }
23
+ async updateMultipleNotiBox(patches, context) {
24
+ const { domain, user, tx } = context.state;
25
+ let results = [];
26
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
27
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
28
+ const notiBoxRepo = tx.getRepository(noti_box_1.NotiBox);
29
+ if (_createRecords.length > 0) {
30
+ for (let i = 0; i < _createRecords.length; i++) {
31
+ const newRecord = _createRecords[i];
32
+ const result = await notiBoxRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
33
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
34
+ }
35
+ }
36
+ if (_updateRecords.length > 0) {
37
+ for (let i = 0; i < _updateRecords.length; i++) {
38
+ const updateRecord = _updateRecords[i];
39
+ const notiBox = await notiBoxRepo.findOneBy({ id: updateRecord.id });
40
+ const result = await notiBoxRepo.save(Object.assign(Object.assign(Object.assign({}, notiBox), updateRecord), { updater: user }));
41
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
42
+ }
43
+ }
44
+ return results;
45
+ }
46
+ async deleteNotiBox(id, context) {
47
+ const { domain, tx } = context.state;
48
+ await tx.getRepository(noti_box_1.NotiBox).delete({ domain: { id: domain.id }, id });
49
+ return true;
50
+ }
51
+ async deleteNotiBoxes(ids, context) {
52
+ const { domain, tx } = context.state;
53
+ await tx.getRepository(noti_box_1.NotiBox).delete({
54
+ domain: { id: domain.id },
55
+ id: (0, typeorm_1.In)(ids)
56
+ });
57
+ return true;
58
+ }
59
+ };
60
+ tslib_1.__decorate([
61
+ (0, type_graphql_1.Directive)('@transaction'),
62
+ (0, type_graphql_1.Mutation)(returns => noti_box_1.NotiBox, { description: 'To create new NotiBox' }),
63
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('notiBox')),
64
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [noti_box_type_1.NewNotiBox, Object]),
67
+ tslib_1.__metadata("design:returntype", Promise)
68
+ ], NotiBoxMutation.prototype, "createNotiBox", null);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.Directive)('@transaction'),
71
+ (0, type_graphql_1.Mutation)(returns => noti_box_1.NotiBox, { description: 'To modify NotiBox information' }),
72
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
73
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
74
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
75
+ tslib_1.__metadata("design:type", Function),
76
+ tslib_1.__metadata("design:paramtypes", [String, noti_box_type_1.NotiBoxPatch, Object]),
77
+ tslib_1.__metadata("design:returntype", Promise)
78
+ ], NotiBoxMutation.prototype, "updateNotiBox", null);
79
+ tslib_1.__decorate([
80
+ (0, type_graphql_1.Directive)('@transaction'),
81
+ (0, type_graphql_1.Mutation)(returns => [noti_box_1.NotiBox], { description: "To modify multiple NotiBoxes' information" }),
82
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [noti_box_type_1.NotiBoxPatch])),
83
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
84
+ tslib_1.__metadata("design:type", Function),
85
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
86
+ tslib_1.__metadata("design:returntype", Promise)
87
+ ], NotiBoxMutation.prototype, "updateMultipleNotiBox", null);
88
+ tslib_1.__decorate([
89
+ (0, type_graphql_1.Directive)('@transaction'),
90
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete NotiBox' }),
91
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
92
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
93
+ tslib_1.__metadata("design:type", Function),
94
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
95
+ tslib_1.__metadata("design:returntype", Promise)
96
+ ], NotiBoxMutation.prototype, "deleteNotiBox", null);
97
+ tslib_1.__decorate([
98
+ (0, type_graphql_1.Directive)('@transaction'),
99
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple NotiBoxes' }),
100
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
101
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
102
+ tslib_1.__metadata("design:type", Function),
103
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
104
+ tslib_1.__metadata("design:returntype", Promise)
105
+ ], NotiBoxMutation.prototype, "deleteNotiBoxes", null);
106
+ NotiBoxMutation = tslib_1.__decorate([
107
+ (0, type_graphql_1.Resolver)(noti_box_1.NotiBox)
108
+ ], NotiBoxMutation);
109
+ exports.NotiBoxMutation = NotiBoxMutation;
110
+ //# sourceMappingURL=noti-box-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noti-box-mutation.js","sourceRoot":"","sources":["../../../server/service/noti-box/noti-box-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yCAAoC;AACpC,mDAA0D;AAGnD,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,IAAI,iCACtC,OAAO,KACV,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,aAAa,CACN,EAAU,EACP,KAAmB,EAC1B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAA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B,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDAUP;AA3GU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CA4G3B;AA5GY,0CAAe","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { NotiBox } from './noti-box'\nimport { NewNotiBox, NotiBoxPatch } from './noti-box-type'\n\n@Resolver(NotiBox)\nexport class NotiBoxMutation {\n @Directive('@transaction')\n @Mutation(returns => NotiBox, { description: 'To create new NotiBox' })\n async createNotiBox(@Arg('notiBox') notiBox: NewNotiBox, @Ctx() context: ResolverContext): Promise<NotiBox> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(NotiBox).save({\n ...notiBox,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => NotiBox, { description: 'To modify NotiBox information' })\n async updateNotiBox(\n @Arg('id') id: string,\n @Arg('patch') patch: NotiBoxPatch,\n @Ctx() context: ResolverContext\n ): Promise<NotiBox> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(NotiBox)\n const notiBox = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...notiBox,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [NotiBox], { description: \"To modify multiple NotiBoxes' information\" })\n async updateMultipleNotiBox(\n @Arg('patches', type => [NotiBoxPatch]) patches: NotiBoxPatch[],\n @Ctx() context: ResolverContext\n ): Promise<NotiBox[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const notiBoxRepo = tx.getRepository(NotiBox)\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 notiBoxRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const notiBox = await notiBoxRepo.findOneBy({ id: updateRecord.id })\n\n const result = await notiBoxRepo.save({\n ...notiBox,\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 NotiBox' })\n async deleteNotiBox(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(NotiBox).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple NotiBoxes' })\n async deleteNotiBoxes(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(NotiBox).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotiBoxQuery = 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 noti_box_1 = require("./noti-box");
9
+ const noti_box_type_1 = require("./noti-box-type");
10
+ let NotiBoxQuery = class NotiBoxQuery {
11
+ async notiBox(id, context) {
12
+ const { domain } = context.state;
13
+ return await (0, shell_1.getRepository)(noti_box_1.NotiBox).findOne({
14
+ where: { domain: { id: domain.id }, id }
15
+ });
16
+ }
17
+ async notiBoxes(params, context) {
18
+ const { domain } = context.state;
19
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
+ domain,
21
+ params,
22
+ repository: await (0, shell_1.getRepository)(noti_box_1.NotiBox),
23
+ searchables: ['title', 'body']
24
+ });
25
+ const [items, total] = await queryBuilder.getManyAndCount();
26
+ return { items, total };
27
+ }
28
+ async myNotifications(params, context) {
29
+ const { domain, user } = context.state;
30
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
31
+ domain,
32
+ params,
33
+ alias: 'nb',
34
+ repository: await (0, shell_1.getRepository)(noti_box_1.NotiBox),
35
+ searchables: ['title', 'body']
36
+ }).andWhere('nb.owner = :user', { user: user.id });
37
+ const [items, total] = await queryBuilder.getManyAndCount();
38
+ return { items, total };
39
+ }
40
+ async owner(notiBox) {
41
+ return notiBox.ownerId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: notiBox.ownerId }));
42
+ }
43
+ async domain(notiBox) {
44
+ return notiBox.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: notiBox.domainId }));
45
+ }
46
+ async updater(notiBox) {
47
+ return notiBox.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: notiBox.updaterId }));
48
+ }
49
+ async creator(notiBox) {
50
+ return notiBox.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: notiBox.creatorId }));
51
+ }
52
+ };
53
+ tslib_1.__decorate([
54
+ (0, type_graphql_1.Query)(returns => noti_box_1.NotiBox, { nullable: true, description: 'To fetch a NotiBox' }),
55
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
56
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
57
+ tslib_1.__metadata("design:type", Function),
58
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
59
+ tslib_1.__metadata("design:returntype", Promise)
60
+ ], NotiBoxQuery.prototype, "notiBox", null);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Query)(returns => noti_box_type_1.NotiBoxList, { description: 'To fetch multiple NotiBoxes' }),
63
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
64
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
67
+ tslib_1.__metadata("design:returntype", Promise)
68
+ ], NotiBoxQuery.prototype, "notiBoxes", null);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.Query)(returns => noti_box_type_1.NotiBoxList, { description: 'To fetch my notifications' }),
71
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
72
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
73
+ tslib_1.__metadata("design:type", Function),
74
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
75
+ tslib_1.__metadata("design:returntype", Promise)
76
+ ], NotiBoxQuery.prototype, "myNotifications", null);
77
+ tslib_1.__decorate([
78
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
79
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
80
+ tslib_1.__metadata("design:type", Function),
81
+ tslib_1.__metadata("design:paramtypes", [noti_box_1.NotiBox]),
82
+ tslib_1.__metadata("design:returntype", Promise)
83
+ ], NotiBoxQuery.prototype, "owner", null);
84
+ tslib_1.__decorate([
85
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
86
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
87
+ tslib_1.__metadata("design:type", Function),
88
+ tslib_1.__metadata("design:paramtypes", [noti_box_1.NotiBox]),
89
+ tslib_1.__metadata("design:returntype", Promise)
90
+ ], NotiBoxQuery.prototype, "domain", null);
91
+ tslib_1.__decorate([
92
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
93
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
94
+ tslib_1.__metadata("design:type", Function),
95
+ tslib_1.__metadata("design:paramtypes", [noti_box_1.NotiBox]),
96
+ tslib_1.__metadata("design:returntype", Promise)
97
+ ], NotiBoxQuery.prototype, "updater", null);
98
+ tslib_1.__decorate([
99
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
100
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
101
+ tslib_1.__metadata("design:type", Function),
102
+ tslib_1.__metadata("design:paramtypes", [noti_box_1.NotiBox]),
103
+ tslib_1.__metadata("design:returntype", Promise)
104
+ ], NotiBoxQuery.prototype, "creator", null);
105
+ NotiBoxQuery = tslib_1.__decorate([
106
+ (0, type_graphql_1.Resolver)(noti_box_1.NotiBox)
107
+ ], NotiBoxQuery);
108
+ exports.NotiBoxQuery = NotiBoxQuery;
109
+ //# sourceMappingURL=noti-box-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noti-box-query.js","sourceRoot":"","sources":["../../../server/service/noti-box/noti-box-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yCAAoC;AACpC,mDAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAwB;QACxE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAA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EAAE,CAAC,gBAAI,CAAC;IACf,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;yCAEnC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;0CAEpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AA7DU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CA8DxB;AA9DY,oCAAY","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { NotiBox } from './noti-box'\nimport { NotiBoxList } from './noti-box-type'\n\n@Resolver(NotiBox)\nexport class NotiBoxQuery {\n @Query(returns => NotiBox!, { nullable: true, description: 'To fetch a NotiBox' })\n async notiBox(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<NotiBox> {\n const { domain } = context.state\n\n return await getRepository(NotiBox).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => NotiBoxList, { description: 'To fetch multiple NotiBoxes' })\n async notiBoxes(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<NotiBoxList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(NotiBox),\n searchables: ['title', 'body']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Query(returns => NotiBoxList, { description: 'To fetch my notifications' })\n async myNotifications(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<NotiBoxList> {\n const { domain, user } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n alias: 'nb',\n repository: await getRepository(NotiBox),\n searchables: ['title', 'body']\n }).andWhere('nb.owner = :user', { user: user.id })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => User)\n async owner(@Root() notiBox: NotiBox): Promise<User> {\n return notiBox.ownerId && (await getRepository(User).findOneBy({ id: notiBox.ownerId }))\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() notiBox: NotiBox): Promise<Domain> {\n return notiBox.domainId && (await getRepository(Domain).findOneBy({ id: notiBox.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() notiBox: NotiBox): Promise<User> {\n return notiBox.updaterId && (await getRepository(User).findOneBy({ id: notiBox.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() notiBox: NotiBox): Promise<User> {\n return notiBox.creatorId && (await getRepository(User).findOneBy({ id: notiBox.creatorId }))\n }\n}\n"]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotiBoxList = exports.NotiBoxPatch = exports.NewNotiBox = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const noti_box_1 = require("./noti-box");
7
+ let NewNotiBox = class NewNotiBox {
8
+ };
9
+ tslib_1.__decorate([
10
+ (0, type_graphql_1.Field)({ nullable: true }),
11
+ tslib_1.__metadata("design:type", String)
12
+ ], NewNotiBox.prototype, "ownerId", void 0);
13
+ tslib_1.__decorate([
14
+ (0, type_graphql_1.Field)({ nullable: true }),
15
+ tslib_1.__metadata("design:type", String)
16
+ ], NewNotiBox.prototype, "type", void 0);
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)({ nullable: true }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], NewNotiBox.prototype, "title", void 0);
21
+ tslib_1.__decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], NewNotiBox.prototype, "body", void 0);
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)({ nullable: true }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], NewNotiBox.prototype, "url", void 0);
29
+ tslib_1.__decorate([
30
+ (0, type_graphql_1.Field)({ nullable: true }),
31
+ tslib_1.__metadata("design:type", String)
32
+ ], NewNotiBox.prototype, "image", void 0);
33
+ NewNotiBox = tslib_1.__decorate([
34
+ (0, type_graphql_1.InputType)()
35
+ ], NewNotiBox);
36
+ exports.NewNotiBox = NewNotiBox;
37
+ let NotiBoxPatch = class NotiBoxPatch {
38
+ };
39
+ tslib_1.__decorate([
40
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], NotiBoxPatch.prototype, "id", void 0);
43
+ tslib_1.__decorate([
44
+ (0, type_graphql_1.Field)(type => noti_box_1.NotiBoxStatus, { nullable: true }),
45
+ tslib_1.__metadata("design:type", String)
46
+ ], NotiBoxPatch.prototype, "state", void 0);
47
+ tslib_1.__decorate([
48
+ (0, type_graphql_1.Field)({ nullable: true }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], NotiBoxPatch.prototype, "cuFlag", void 0);
51
+ NotiBoxPatch = tslib_1.__decorate([
52
+ (0, type_graphql_1.InputType)()
53
+ ], NotiBoxPatch);
54
+ exports.NotiBoxPatch = NotiBoxPatch;
55
+ let NotiBoxList = class NotiBoxList {
56
+ };
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.Field)(type => [noti_box_1.NotiBox]),
59
+ tslib_1.__metadata("design:type", Array)
60
+ ], NotiBoxList.prototype, "items", void 0);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
63
+ tslib_1.__metadata("design:type", Number)
64
+ ], NotiBoxList.prototype, "total", void 0);
65
+ NotiBoxList = tslib_1.__decorate([
66
+ (0, type_graphql_1.ObjectType)()
67
+ ], NotiBoxList);
68
+ exports.NotiBoxList = NotiBoxList;
69
+ //# sourceMappingURL=noti-box-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noti-box-type.js","sourceRoot":"","sources":["../../../server/service/noti-box/noti-box-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,yCAAmD;AAG5C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAkBtB,CAAA;AAjBC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACd;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACf;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACb;AAjBF,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAkBtB;AAlBY,gCAAU;AAqBhB,IAAM,YAAY,GAAlB,MAAM,YAAY;CASxB,CAAA;AARC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,wBAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC5B;AAErB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;AARJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CASxB;AATY,oCAAY;AAYlB,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,CAAC;;0CACT;AAEhB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;AALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB;AANY,kCAAW","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { NotiBox, NotiBoxStatus } from './noti-box'\n\n@InputType()\nexport class NewNotiBox {\n @Field({ nullable: true })\n ownerId?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n title: string\n\n @Field({ nullable: true })\n body: string\n\n @Field({ nullable: true })\n url: string\n\n @Field({ nullable: true })\n image: string\n}\n\n@InputType()\nexport class NotiBoxPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field(type => NotiBoxStatus, { nullable: true })\n state?: NotiBoxStatus\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class NotiBoxList {\n @Field(type => [NotiBox])\n items: NotiBox[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotiBox = exports.NotiBoxStatus = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ var NotiBoxStatus;
10
+ (function (NotiBoxStatus) {
11
+ NotiBoxStatus["NOTREAD"] = "UNREAD";
12
+ NotiBoxStatus["READ"] = "READ";
13
+ })(NotiBoxStatus = exports.NotiBoxStatus || (exports.NotiBoxStatus = {}));
14
+ (0, type_graphql_1.registerEnumType)(NotiBoxStatus, {
15
+ name: 'NotiBoxStatus',
16
+ description: 'state enumeration of a notiBox'
17
+ });
18
+ let NotiBox = class NotiBox {
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
+ ], NotiBox.prototype, "id", void 0);
25
+ tslib_1.__decorate([
26
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
27
+ (0, type_graphql_1.Field)({ nullable: true }),
28
+ tslib_1.__metadata("design:type", shell_1.Domain)
29
+ ], NotiBox.prototype, "domain", void 0);
30
+ tslib_1.__decorate([
31
+ (0, typeorm_1.RelationId)((notiBox) => notiBox.domain),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], NotiBox.prototype, "domainId", void 0);
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
36
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
37
+ tslib_1.__metadata("design:type", auth_base_1.User)
38
+ ], NotiBox.prototype, "owner", void 0);
39
+ tslib_1.__decorate([
40
+ (0, typeorm_1.RelationId)((notiBox) => notiBox.owner),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], NotiBox.prototype, "ownerId", void 0);
43
+ tslib_1.__decorate([
44
+ (0, typeorm_1.Column)({ nullable: true }),
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], NotiBox.prototype, "type", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)({ nullable: true }),
50
+ (0, type_graphql_1.Field)({ nullable: true }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], NotiBox.prototype, "title", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: true }),
55
+ (0, type_graphql_1.Field)({ nullable: true }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], NotiBox.prototype, "body", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true }),
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], NotiBox.prototype, "url", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)({ nullable: true }),
65
+ (0, type_graphql_1.Field)({ nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], NotiBox.prototype, "image", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)({ nullable: true }),
70
+ (0, type_graphql_1.Field)({ nullable: true }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], NotiBox.prototype, "state", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.CreateDateColumn)(),
75
+ (0, type_graphql_1.Field)({ nullable: true }),
76
+ tslib_1.__metadata("design:type", Date)
77
+ ], NotiBox.prototype, "createdAt", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.UpdateDateColumn)(),
80
+ (0, type_graphql_1.Field)({ nullable: true }),
81
+ tslib_1.__metadata("design:type", Date)
82
+ ], NotiBox.prototype, "updatedAt", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
85
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
86
+ tslib_1.__metadata("design:type", auth_base_1.User)
87
+ ], NotiBox.prototype, "creator", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.RelationId)((notiBox) => notiBox.creator),
90
+ tslib_1.__metadata("design:type", String)
91
+ ], NotiBox.prototype, "creatorId", void 0);
92
+ tslib_1.__decorate([
93
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
94
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
95
+ tslib_1.__metadata("design:type", auth_base_1.User)
96
+ ], NotiBox.prototype, "updater", void 0);
97
+ tslib_1.__decorate([
98
+ (0, typeorm_1.RelationId)((notiBox) => notiBox.updater),
99
+ tslib_1.__metadata("design:type", String)
100
+ ], NotiBox.prototype, "updaterId", void 0);
101
+ NotiBox = tslib_1.__decorate([
102
+ (0, typeorm_1.Entity)(),
103
+ (0, typeorm_1.Index)('ix_noti_box_0', (notiBox) => [notiBox.domain, notiBox.type], { unique: false }),
104
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for NotiBox' })
105
+ ], NotiBox);
106
+ exports.NotiBox = NotiBox;
107
+ //# sourceMappingURL=noti-box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noti-box.js","sourceRoot":"","sources":["../../../server/service/noti-box/noti-box.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,8BAAa,CAAA;AACf,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAA,+BAAgB,EAAC,aAAa,EAAE;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gCAAgC;CAC9C,CAAC,CAAA;AAKK,IAAM,OAAO,GAAb,MAAM,OAAO;CAgEnB,CAAA;AA/DC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;uCAAA;AAEf;IAAC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;;yCAChC;A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ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum NotiBoxStatus {\n NOTREAD = 'UNREAD',\n READ = 'READ'\n}\n\nregisterEnumType(NotiBoxStatus, {\n name: 'NotiBoxStatus',\n description: 'state enumeration of a notiBox'\n})\n\n@Entity()\n@Index('ix_noti_box_0', (notiBox: NotiBox) => [notiBox.domain, notiBox.type], { unique: false })\n@ObjectType({ description: 'Entity for NotiBox' })\nexport class NotiBox {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((notiBox: NotiBox) => notiBox.domain)\n domainId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n owner?: User\n\n @RelationId((notiBox: NotiBox) => notiBox.owner)\n ownerId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n title: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n body: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n url: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n image: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: NotiBoxStatus\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((notiBox: NotiBox) => notiBox.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((notiBox: NotiBox) => notiBox.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotiRuleHistoryEntitySubscriber = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const typeorm_history_1 = require("@operato/typeorm-history");
7
+ const noti_rule_1 = require("./noti-rule");
8
+ const noti_rule_history_1 = require("./noti-rule-history");
9
+ let NotiRuleHistoryEntitySubscriber = class NotiRuleHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
10
+ get entity() {
11
+ return noti_rule_1.NotiRule;
12
+ }
13
+ get historyEntity() {
14
+ return noti_rule_history_1.NotiRuleHistory;
15
+ }
16
+ };
17
+ NotiRuleHistoryEntitySubscriber = tslib_1.__decorate([
18
+ (0, typeorm_1.EventSubscriber)()
19
+ ], NotiRuleHistoryEntitySubscriber);
20
+ exports.NotiRuleHistoryEntitySubscriber = NotiRuleHistoryEntitySubscriber;
21
+ //# sourceMappingURL=event-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/noti-rule/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,2CAAsC;AACtC,2DAAqD;AAG9C,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,yCAAkD;IACrG,IAAW,MAAM;QACf,OAAO,oBAAQ,CAAA;IACjB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,mCAAe,CAAA;IACxB,CAAC;CACF,CAAA;AARY,+BAA+B;IAD3C,IAAA,yBAAe,GAAE;GACL,+BAA+B,CAQ3C;AARY,0EAA+B","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { NotiRule } from './noti-rule'\nimport { NotiRuleHistory } from './noti-rule-history'\n\n@EventSubscriber()\nexport class NotiRuleHistoryEntitySubscriber extends HistoryEntitySubscriber<NotiRule, NotiRuleHistory> {\n public get entity() {\n return NotiRule\n }\n\n public get historyEntity() {\n return NotiRuleHistory\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const noti_rule_1 = require("./noti-rule");
5
+ const noti_rule_history_1 = require("./noti-rule-history");
6
+ const noti_rule_query_1 = require("./noti-rule-query");
7
+ const noti_rule_mutation_1 = require("./noti-rule-mutation");
8
+ const event_subscriber_1 = require("./event-subscriber");
9
+ exports.entities = [noti_rule_1.NotiRule, noti_rule_history_1.NotiRuleHistory];
10
+ exports.resolvers = [noti_rule_query_1.NotiRuleQuery, noti_rule_mutation_1.NotiRuleMutation];
11
+ exports.subscribers = [event_subscriber_1.NotiRuleHistoryEntitySubscriber];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/noti-rule/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AACtC,2DAAqD;AACrD,uDAAiD;AACjD,6DAAuD;AACvD,yDAAoE;AAEvD,QAAA,QAAQ,GAAG,CAAC,oBAAQ,EAAE,mCAAe,CAAC,CAAA;AACtC,QAAA,SAAS,GAAG,CAAC,+BAAa,EAAE,qCAAgB,CAAC,CAAA;AAC7C,QAAA,WAAW,GAAG,CAAC,kDAA+B,CAAC,CAAA","sourcesContent":["import { NotiRule } from './noti-rule'\nimport { NotiRuleHistory } from './noti-rule-history'\nimport { NotiRuleQuery } from './noti-rule-query'\nimport { NotiRuleMutation } from './noti-rule-mutation'\nimport { NotiRuleHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [NotiRule, NotiRuleHistory]\nexport const resolvers = [NotiRuleQuery, NotiRuleMutation]\nexport const subscribers = [NotiRuleHistoryEntitySubscriber]\n"]}
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotiRuleHistory = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
7
+ const typeorm_history_1 = require("@operato/typeorm-history");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ const env_1 = require("@things-factory/env");
10
+ const shell_1 = require("@things-factory/shell");
11
+ const noti_rule_1 = require("./noti-rule");
12
+ const ORMCONFIG = env_1.config.get('ormconfig', {});
13
+ const DATABASE_TYPE = ORMCONFIG.type;
14
+ let NotiRuleHistory = class NotiRuleHistory {
15
+ constructor() {
16
+ this.version = 1;
17
+ }
18
+ };
19
+ tslib_1.__decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
22
+ tslib_1.__metadata("design:type", String)
23
+ ], NotiRuleHistory.prototype, "id", void 0);
24
+ tslib_1.__decorate([
25
+ (0, typeorm_1.Column)({ nullable: true, default: 1 }),
26
+ (0, type_graphql_1.Field)({ nullable: true }),
27
+ tslib_1.__metadata("design:type", Number)
28
+ ], NotiRuleHistory.prototype, "version", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
31
+ (0, type_graphql_1.Field)({ nullable: true }),
32
+ tslib_1.__metadata("design:type", shell_1.Domain)
33
+ ], NotiRuleHistory.prototype, "domain", void 0);
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.RelationId)((notiRule) => notiRule.domain),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], NotiRuleHistory.prototype, "domainId", void 0);
38
+ tslib_1.__decorate([
39
+ (0, typeorm_1.Column)(),
40
+ (0, type_graphql_1.Field)(),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], NotiRuleHistory.prototype, "name", void 0);
43
+ tslib_1.__decorate([
44
+ (0, typeorm_1.Column)({ nullable: true }),
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], NotiRuleHistory.prototype, "description", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)({ nullable: true }),
50
+ (0, type_graphql_1.Field)({ nullable: true }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], NotiRuleHistory.prototype, "state", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: true }),
55
+ (0, type_graphql_1.Field)({ nullable: true }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], NotiRuleHistory.prototype, "title", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true }),
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], NotiRuleHistory.prototype, "body", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)({ nullable: true }),
65
+ (0, type_graphql_1.Field)({ nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], NotiRuleHistory.prototype, "url", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)({ nullable: true }),
70
+ (0, type_graphql_1.Field)({ nullable: true }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], NotiRuleHistory.prototype, "thumbnail", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.Column)({ nullable: true }),
75
+ (0, type_graphql_1.Field)({ nullable: true }),
76
+ tslib_1.__metadata("design:type", String)
77
+ ], NotiRuleHistory.prototype, "channels", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.Column)('simple-json', { nullable: true }),
80
+ (0, type_graphql_1.Field)(type => [noti_rule_1.RecipientItem], { nullable: true, description: 'notification recipients.' }),
81
+ tslib_1.__metadata("design:type", String)
82
+ ], NotiRuleHistory.prototype, "recipients", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.Column)({ nullable: true }),
85
+ (0, type_graphql_1.Field)({ nullable: true }),
86
+ tslib_1.__metadata("design:type", Date)
87
+ ], NotiRuleHistory.prototype, "createdAt", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.Column)({ nullable: true }),
90
+ (0, type_graphql_1.Field)({ nullable: true }),
91
+ tslib_1.__metadata("design:type", Date)
92
+ ], NotiRuleHistory.prototype, "updatedAt", void 0);
93
+ tslib_1.__decorate([
94
+ (0, typeorm_1.Column)({ nullable: true }),
95
+ (0, type_graphql_1.Field)({ nullable: true }),
96
+ tslib_1.__metadata("design:type", Date)
97
+ ], NotiRuleHistory.prototype, "deletedAt", void 0);
98
+ tslib_1.__decorate([
99
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
100
+ (0, type_graphql_1.Field)({ nullable: true }),
101
+ tslib_1.__metadata("design:type", auth_base_1.User)
102
+ ], NotiRuleHistory.prototype, "creator", void 0);
103
+ tslib_1.__decorate([
104
+ (0, typeorm_1.RelationId)((notiRule) => notiRule.creator),
105
+ tslib_1.__metadata("design:type", String)
106
+ ], NotiRuleHistory.prototype, "creatorId", void 0);
107
+ tslib_1.__decorate([
108
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
109
+ (0, type_graphql_1.Field)({ nullable: true }),
110
+ tslib_1.__metadata("design:type", auth_base_1.User)
111
+ ], NotiRuleHistory.prototype, "updater", void 0);
112
+ tslib_1.__decorate([
113
+ (0, typeorm_1.RelationId)((notiRule) => notiRule.updater),
114
+ tslib_1.__metadata("design:type", String)
115
+ ], NotiRuleHistory.prototype, "updaterId", void 0);
116
+ tslib_1.__decorate([
117
+ (0, typeorm_history_1.HistoryOriginalIdColumn)(),
118
+ tslib_1.__metadata("design:type", String)
119
+ ], NotiRuleHistory.prototype, "originalId", void 0);
120
+ tslib_1.__decorate([
121
+ (0, typeorm_history_1.HistoryActionColumn)({
122
+ nullable: false,
123
+ type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
124
+ ? 'enum'
125
+ : DATABASE_TYPE == 'oracle'
126
+ ? 'varchar2'
127
+ : 'smallint',
128
+ enum: typeorm_history_1.HistoryActionType
129
+ }),
130
+ tslib_1.__metadata("design:type", String)
131
+ ], NotiRuleHistory.prototype, "action", void 0);
132
+ NotiRuleHistory = tslib_1.__decorate([
133
+ (0, typeorm_1.Entity)(),
134
+ (0, typeorm_1.Index)('ix_noti-rule_history_0', (notiRuleHistory) => [notiRuleHistory.originalId, notiRuleHistory.version], { unique: true }),
135
+ (0, typeorm_1.Index)('ix_noti-rule_history_1', (notiRuleHistory) => [notiRuleHistory.domain, notiRuleHistory.originalId, notiRuleHistory.version], { unique: true }),
136
+ (0, type_graphql_1.ObjectType)({ description: 'History Entity of NotiRule' })
137
+ ], NotiRuleHistory);
138
+ exports.NotiRuleHistory = NotiRuleHistory;
139
+ //# sourceMappingURL=noti-rule-history.js.map