@things-factory/notification 6.2.177 → 6.2.178
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.
- package/client/actions/notification-fcm.ts +3 -3
- package/dist-client/actions/notification-fcm.js.map +1 -1
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/pages/notification/notification-list-page.js.map +1 -1
- package/dist-client/pages/notification-rule/notification-rule-importer.js.map +1 -1
- package/dist-client/pages/notification-rule/notification-rule-list-page.js.map +1 -1
- package/dist-client/reducers/notification.js.map +1 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/notification-badge.js.map +1 -1
- package/dist-client/viewparts/notification-item.js.map +1 -1
- package/dist-client/viewparts/notification-list.js.map +1 -1
- package/dist-client/viewparts/notification-sender.js.map +1 -1
- package/dist-client/viewparts/notification-setting-let.js.map +1 -1
- package/dist-server/controllers/fcm.d.ts +34 -0
- package/dist-server/controllers/fcm.js +5 -6
- package/dist-server/controllers/fcm.js.map +1 -1
- package/dist-server/controllers/index.d.ts +1 -0
- package/dist-server/index.d.ts +4 -0
- package/dist-server/middlewares/index.d.ts +1 -0
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/middlewares/notification-middleware.d.ts +1 -0
- package/dist-server/middlewares/notification-middleware.js +1 -2
- package/dist-server/middlewares/notification-middleware.js.map +1 -1
- package/dist-server/routers/notification-router.d.ts +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/service/index.d.ts +13 -0
- package/dist-server/service/notification/directive-notification.d.ts +3 -0
- package/dist-server/service/notification/directive-notification.js.map +1 -1
- package/dist-server/service/notification/index.d.ts +12 -0
- package/dist-server/service/notification/notification-mutation.d.ts +9 -0
- package/dist-server/service/notification/notification-mutation.js +2 -2
- package/dist-server/service/notification/notification-mutation.js.map +1 -1
- package/dist-server/service/notification/notification-query.d.ts +13 -0
- package/dist-server/service/notification/notification-query.js +2 -2
- package/dist-server/service/notification/notification-query.js.map +1 -1
- package/dist-server/service/notification/notification-subscription.d.ts +6 -0
- package/dist-server/service/notification/notification-subscription.js +2 -2
- package/dist-server/service/notification/notification-subscription.js.map +1 -1
- package/dist-server/service/notification/notification-type.d.ts +21 -0
- package/dist-server/service/notification/notification-type.js +6 -6
- package/dist-server/service/notification/notification-type.js.map +1 -1
- package/dist-server/service/notification/notification.d.ts +28 -0
- package/dist-server/service/notification/notification.js +3 -3
- package/dist-server/service/notification/notification.js.map +1 -1
- package/dist-server/service/notification-rule/event-subscriber.d.ts +7 -0
- package/dist-server/service/notification-rule/event-subscriber.js +2 -2
- package/dist-server/service/notification-rule/event-subscriber.js.map +1 -1
- package/dist-server/service/notification-rule/index.d.ts +7 -0
- package/dist-server/service/notification-rule/notification-rule-history.d.ts +28 -0
- package/dist-server/service/notification-rule/notification-rule-history.js +2 -2
- package/dist-server/service/notification-rule/notification-rule-history.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule-mutation.d.ts +10 -0
- package/dist-server/service/notification-rule/notification-rule-mutation.js +2 -2
- package/dist-server/service/notification-rule/notification-rule-mutation.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule-query.d.ts +12 -0
- package/dist-server/service/notification-rule/notification-rule-query.js +2 -2
- package/dist-server/service/notification-rule/notification-rule-query.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule-type.d.ts +27 -0
- package/dist-server/service/notification-rule/notification-rule-type.js +6 -6
- package/dist-server/service/notification-rule/notification-rule-type.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule.d.ts +34 -0
- package/dist-server/service/notification-rule/notification-rule.js +7 -8
- package/dist-server/service/notification-rule/notification-rule.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -11,6 +11,7 @@ let NotificationSubscription = class NotificationSubscription {
|
|
|
11
11
|
return payload.notification;
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
+
exports.NotificationSubscription = NotificationSubscription;
|
|
14
15
|
tslib_1.__decorate([
|
|
15
16
|
(0, type_graphql_1.Subscription)({
|
|
16
17
|
subscribe: (0, graphql_subscriptions_1.withFilter)(() => shell_1.pubsub.asyncIterator('notification'), (payload, variables, context, info) => {
|
|
@@ -38,8 +39,7 @@ tslib_1.__decorate([
|
|
|
38
39
|
tslib_1.__metadata("design:paramtypes", [Object, Array]),
|
|
39
40
|
tslib_1.__metadata("design:returntype", notification_1.Notification)
|
|
40
41
|
], NotificationSubscription.prototype, "notification", null);
|
|
41
|
-
NotificationSubscription = tslib_1.__decorate([
|
|
42
|
+
exports.NotificationSubscription = NotificationSubscription = tslib_1.__decorate([
|
|
42
43
|
(0, type_graphql_1.Resolver)(notification_1.Notification)
|
|
43
44
|
], NotificationSubscription);
|
|
44
|
-
exports.NotificationSubscription = NotificationSubscription;
|
|
45
45
|
//# sourceMappingURL=notification-subscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-subscription.js","sourceRoot":"","sources":["../../../server/service/notification/notification-subscription.ts"],"names":[],"mappings":";;;;AAAA,iEAAkD;AAClD,+CAA+E;AAE/E,iDAA0D;AAE1D,iDAA6C;AAGtC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IA6BnC,YAAY,CACF,OAAuC,EACQ,QAAkB;QAEzE,OAAO,OAAO,CAAC,YAAY,CAAA;IAC7B,CAAC;CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"notification-subscription.js","sourceRoot":"","sources":["../../../server/service/notification/notification-subscription.ts"],"names":[],"mappings":";;;;AAAA,iEAAkD;AAClD,+CAA+E;AAE/E,iDAA0D;AAE1D,iDAA6C;AAGtC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IA6BnC,YAAY,CACF,OAAuC,EACQ,QAAkB;QAEzE,OAAO,OAAO,CAAC,YAAY,CAAA;IAC7B,CAAC;CACF,CAAA;AAnCY,4DAAwB;AA6BnC;IA5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,EAAC,2BAAY,CAAC;GACV,wBAAwB,CAmCpC","sourcesContent":["import { withFilter } from 'graphql-subscriptions'\nimport { Arg, Resolver, FieldResolver, Root, Subscription } from 'type-graphql'\n\nimport { pubsub, ScalarDate } from '@things-factory/shell'\n\nimport { Notification } from './notification'\n\n@Resolver(Notification)\nexport class NotificationSubscription {\n @Subscription({\n subscribe: withFilter(\n () => pubsub.asyncIterator('notification'),\n (payload, variables, context, info) => {\n /* normally, subscription context doesn't have domain */\n const { domain, user } = context.state\n\n const { subjects = [] } = variables\n const {\n notification: { subject, domain: pdomain }\n } = payload\n\n const subdomain = pdomain?.subdomain\n\n if (subdomain) {\n if (domain?.subdomain) {\n if (subdomain !== domain.subdomain) {\n return false\n }\n } else if (!user.domains.find(d => d.subdomain === subdomain)) {\n return false\n }\n }\n\n return !subject || subjects.indexOf(subject) !== -1\n }\n )\n })\n notification(\n @Root() payload: { notification: Notification },\n @Arg('subjects', type => [String], { nullable: true }) subjects: string[]\n ): Notification {\n return payload.notification\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Notification, NotificationStatus } from './notification';
|
|
2
|
+
export declare class NewNotification {
|
|
3
|
+
ownerId?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
subject?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
body?: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
property?: any;
|
|
11
|
+
timestamp?: Date;
|
|
12
|
+
}
|
|
13
|
+
export declare class NotificationPatch {
|
|
14
|
+
id?: string;
|
|
15
|
+
state?: NotificationStatus;
|
|
16
|
+
cuFlag?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class NotificationList {
|
|
19
|
+
items: Notification[];
|
|
20
|
+
total: number;
|
|
21
|
+
}
|
|
@@ -7,6 +7,7 @@ const shell_1 = require("@things-factory/shell");
|
|
|
7
7
|
const notification_1 = require("./notification");
|
|
8
8
|
let NewNotification = class NewNotification {
|
|
9
9
|
};
|
|
10
|
+
exports.NewNotification = NewNotification;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
12
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
12
13
|
tslib_1.__metadata("design:type", String)
|
|
@@ -43,12 +44,12 @@ tslib_1.__decorate([
|
|
|
43
44
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
44
45
|
tslib_1.__metadata("design:type", Date)
|
|
45
46
|
], NewNotification.prototype, "timestamp", void 0);
|
|
46
|
-
NewNotification = tslib_1.__decorate([
|
|
47
|
+
exports.NewNotification = NewNotification = tslib_1.__decorate([
|
|
47
48
|
(0, type_graphql_1.InputType)()
|
|
48
49
|
], NewNotification);
|
|
49
|
-
exports.NewNotification = NewNotification;
|
|
50
50
|
let NotificationPatch = class NotificationPatch {
|
|
51
51
|
};
|
|
52
|
+
exports.NotificationPatch = NotificationPatch;
|
|
52
53
|
tslib_1.__decorate([
|
|
53
54
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
54
55
|
tslib_1.__metadata("design:type", String)
|
|
@@ -61,12 +62,12 @@ tslib_1.__decorate([
|
|
|
61
62
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
63
|
tslib_1.__metadata("design:type", String)
|
|
63
64
|
], NotificationPatch.prototype, "cuFlag", void 0);
|
|
64
|
-
NotificationPatch = tslib_1.__decorate([
|
|
65
|
+
exports.NotificationPatch = NotificationPatch = tslib_1.__decorate([
|
|
65
66
|
(0, type_graphql_1.InputType)()
|
|
66
67
|
], NotificationPatch);
|
|
67
|
-
exports.NotificationPatch = NotificationPatch;
|
|
68
68
|
let NotificationList = class NotificationList {
|
|
69
69
|
};
|
|
70
|
+
exports.NotificationList = NotificationList;
|
|
70
71
|
tslib_1.__decorate([
|
|
71
72
|
(0, type_graphql_1.Field)(type => [notification_1.Notification]),
|
|
72
73
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -75,8 +76,7 @@ tslib_1.__decorate([
|
|
|
75
76
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
76
77
|
tslib_1.__metadata("design:type", Number)
|
|
77
78
|
], NotificationList.prototype, "total", void 0);
|
|
78
|
-
NotificationList = tslib_1.__decorate([
|
|
79
|
+
exports.NotificationList = NotificationList = tslib_1.__decorate([
|
|
79
80
|
(0, type_graphql_1.ObjectType)()
|
|
80
81
|
], NotificationList);
|
|
81
|
-
exports.NotificationList = NotificationList;
|
|
82
82
|
//# sourceMappingURL=notification-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-type.js","sourceRoot":"","sources":["../../../server/service/notification/notification-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,iDAAoD;AAEpD,iDAAiE;AAG1D,IAAM,eAAe,GAArB,MAAM,eAAe;CA2B3B,CAAA;
|
|
1
|
+
{"version":3,"file":"notification-type.js","sourceRoot":"","sources":["../../../server/service/notification/notification-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,iDAAoD;AAEpD,iDAAiE;AAG1D,IAAM,eAAe,GAArB,MAAM,eAAe;CA2B3B,CAAA;AA3BY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACZ;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACd;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACZ;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAClC;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;kDAAA;0BA1BL,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CA2B3B;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAS7B,CAAA;AATY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iCAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC5B;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;4BARJ,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAS7B;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AANY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAY,CAAC,CAAC;;+CACT;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;2BALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { ScalarObject } from '@things-factory/shell'\n\nimport { Notification, NotificationStatus } from './notification'\n\n@InputType()\nexport class NewNotification {\n @Field({ nullable: true })\n ownerId?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n subject?: 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 @Field(type => ScalarObject, { nullable: true })\n property?: any\n\n @Field({ nullable: true })\n timestamp?: Date\n}\n\n@InputType()\nexport class NotificationPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field(type => NotificationStatus, { nullable: true })\n state?: NotificationStatus\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class NotificationList {\n @Field(type => [Notification])\n items: Notification[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
export declare enum NotificationStatus {
|
|
4
|
+
NOTREAD = "UNREAD",
|
|
5
|
+
READ = "READ"
|
|
6
|
+
}
|
|
7
|
+
export declare class Notification {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
domain?: Domain;
|
|
10
|
+
domainId?: string;
|
|
11
|
+
owner?: User;
|
|
12
|
+
ownerId?: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
subject?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
body?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
image?: string;
|
|
19
|
+
state?: NotificationStatus;
|
|
20
|
+
property?: any;
|
|
21
|
+
timestamp?: Date;
|
|
22
|
+
createdAt?: Date;
|
|
23
|
+
updatedAt?: Date;
|
|
24
|
+
creator?: User;
|
|
25
|
+
creatorId?: string;
|
|
26
|
+
updater?: User;
|
|
27
|
+
updaterId?: string;
|
|
28
|
+
}
|
|
@@ -10,13 +10,14 @@ var NotificationStatus;
|
|
|
10
10
|
(function (NotificationStatus) {
|
|
11
11
|
NotificationStatus["NOTREAD"] = "UNREAD";
|
|
12
12
|
NotificationStatus["READ"] = "READ";
|
|
13
|
-
})(NotificationStatus
|
|
13
|
+
})(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
|
|
14
14
|
(0, type_graphql_1.registerEnumType)(NotificationStatus, {
|
|
15
15
|
name: 'NotificationStatus',
|
|
16
16
|
description: 'state enumeration of a notification'
|
|
17
17
|
});
|
|
18
18
|
let Notification = class Notification {
|
|
19
19
|
};
|
|
20
|
+
exports.Notification = Notification;
|
|
20
21
|
tslib_1.__decorate([
|
|
21
22
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
23
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -113,10 +114,9 @@ tslib_1.__decorate([
|
|
|
113
114
|
(0, typeorm_1.RelationId)((notification) => notification.updater),
|
|
114
115
|
tslib_1.__metadata("design:type", String)
|
|
115
116
|
], Notification.prototype, "updaterId", void 0);
|
|
116
|
-
Notification = tslib_1.__decorate([
|
|
117
|
+
exports.Notification = Notification = tslib_1.__decorate([
|
|
117
118
|
(0, typeorm_1.Entity)(),
|
|
118
119
|
(0, typeorm_1.Index)('ix_notification_0', (notification) => [notification.domain, notification.type], { unique: false }),
|
|
119
120
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for Notification' })
|
|
120
121
|
], Notification);
|
|
121
|
-
exports.Notification = Notification;
|
|
122
122
|
//# sourceMappingURL=notification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../server/service/notification/notification.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,iDAAwE;AACxE,yDAAgD;AAEhD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,wCAAkB,CAAA;IAClB,mCAAa,CAAA;AACf,CAAC,EAHW,kBAAkB,
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../server/service/notification/notification.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,iDAAwE;AACxE,yDAAgD;AAEhD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IA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B,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;+CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;6CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC;;+CAC/C;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;6CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC;;+CAC/C;uBA3EP,YAAY;IAHxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,YAA0B,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACvH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;GAC1C,YAAY,CA4ExB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain, ScalarObject, ScalarDate } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum NotificationStatus {\n NOTREAD = 'UNREAD',\n READ = 'READ'\n}\n\nregisterEnumType(NotificationStatus, {\n name: 'NotificationStatus',\n description: 'state enumeration of a notification'\n})\n\n@Entity()\n@Index('ix_notification_0', (notification: Notification) => [notification.domain, notification.type], { unique: false })\n@ObjectType({ description: 'Entity for Notification' })\nexport class Notification {\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((notification: Notification) => notification.domain)\n domainId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n owner?: User\n\n @RelationId((notification: Notification) => notification.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 subject?: 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?: NotificationStatus\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true })\n property?: any\n\n @Column('date', { nullable: true })\n @Field(type => ScalarDate, { nullable: true })\n timestamp?: Date\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((notification: Notification) => notification.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((notification: Notification) => notification.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HistoryEntitySubscriber } from '@operato/typeorm-history';
|
|
2
|
+
import { NotificationRule } from './notification-rule';
|
|
3
|
+
import { NotificationRuleHistory } from './notification-rule-history';
|
|
4
|
+
export declare class NotificationRuleHistoryEntitySubscriber extends HistoryEntitySubscriber<NotificationRule, NotificationRuleHistory> {
|
|
5
|
+
get entity(): typeof NotificationRule;
|
|
6
|
+
get historyEntity(): typeof NotificationRuleHistory;
|
|
7
|
+
}
|
|
@@ -14,8 +14,8 @@ let NotificationRuleHistoryEntitySubscriber = class NotificationRuleHistoryEntit
|
|
|
14
14
|
return notification_rule_history_1.NotificationRuleHistory;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
NotificationRuleHistoryEntitySubscriber =
|
|
17
|
+
exports.NotificationRuleHistoryEntitySubscriber = NotificationRuleHistoryEntitySubscriber;
|
|
18
|
+
exports.NotificationRuleHistoryEntitySubscriber = NotificationRuleHistoryEntitySubscriber = tslib_1.__decorate([
|
|
18
19
|
(0, typeorm_1.EventSubscriber)()
|
|
19
20
|
], NotificationRuleHistoryEntitySubscriber);
|
|
20
|
-
exports.NotificationRuleHistoryEntitySubscriber = NotificationRuleHistoryEntitySubscriber;
|
|
21
21
|
//# sourceMappingURL=event-subscriber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/notification-rule/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,2DAAsD;AACtD,2EAAqE;AAG9D,IAAM,uCAAuC,GAA7C,MAAM,uCAAwC,SAAQ,yCAG5D;IACC,IAAW,MAAM;QACf,OAAO,oCAAgB,CAAA;IACzB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,mDAAuB,CAAA;IAChC,CAAC;CACF,CAAA;AAXY,uCAAuC;IADnD,IAAA,yBAAe,GAAE;GACL,uCAAuC,CAWnD
|
|
1
|
+
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/notification-rule/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,2DAAsD;AACtD,2EAAqE;AAG9D,IAAM,uCAAuC,GAA7C,MAAM,uCAAwC,SAAQ,yCAG5D;IACC,IAAW,MAAM;QACf,OAAO,oCAAgB,CAAA;IACzB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,mDAAuB,CAAA;IAChC,CAAC;CACF,CAAA;AAXY,0FAAuC;kDAAvC,uCAAuC;IADnD,IAAA,yBAAe,GAAE;GACL,uCAAuC,CAWnD","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { NotificationRule } from './notification-rule'\nimport { NotificationRuleHistory } from './notification-rule-history'\n\n@EventSubscriber()\nexport class NotificationRuleHistoryEntitySubscriber extends HistoryEntitySubscriber<\n NotificationRule,\n NotificationRuleHistory\n> {\n public get entity() {\n return NotificationRule\n }\n\n public get historyEntity() {\n return NotificationRuleHistory\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NotificationRule } from './notification-rule';
|
|
2
|
+
import { NotificationRuleQuery } from './notification-rule-query';
|
|
3
|
+
import { NotificationRuleMutation } from './notification-rule-mutation';
|
|
4
|
+
import { NotificationRuleHistoryEntitySubscriber } from './event-subscriber';
|
|
5
|
+
export declare const entities: (typeof NotificationRule)[];
|
|
6
|
+
export declare const resolvers: (typeof NotificationRuleQuery | typeof NotificationRuleMutation)[];
|
|
7
|
+
export declare const subscribers: (typeof NotificationRuleHistoryEntitySubscriber)[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { Domain } from '@things-factory/shell';
|
|
4
|
+
import { NotificationRule, NotificationRuleStatus } from './notification-rule';
|
|
5
|
+
export declare class NotificationRuleHistory implements HistoryEntityInterface<NotificationRule> {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
version?: number;
|
|
8
|
+
domain?: Domain;
|
|
9
|
+
domainId?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
state?: NotificationRuleStatus;
|
|
13
|
+
title: string;
|
|
14
|
+
body: string;
|
|
15
|
+
url: string;
|
|
16
|
+
thumbnail: string;
|
|
17
|
+
channels: string;
|
|
18
|
+
recipients: string;
|
|
19
|
+
createdAt?: Date;
|
|
20
|
+
updatedAt?: Date;
|
|
21
|
+
deletedAt?: Date;
|
|
22
|
+
creator?: User;
|
|
23
|
+
creatorId?: string;
|
|
24
|
+
updater?: User;
|
|
25
|
+
updaterId?: string;
|
|
26
|
+
originalId: string;
|
|
27
|
+
action: HistoryActionType;
|
|
28
|
+
}
|
|
@@ -16,6 +16,7 @@ let NotificationRuleHistory = class NotificationRuleHistory {
|
|
|
16
16
|
this.version = 1;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
+
exports.NotificationRuleHistory = NotificationRuleHistory;
|
|
19
20
|
tslib_1.__decorate([
|
|
20
21
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
22
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -129,7 +130,7 @@ tslib_1.__decorate([
|
|
|
129
130
|
}),
|
|
130
131
|
tslib_1.__metadata("design:type", String)
|
|
131
132
|
], NotificationRuleHistory.prototype, "action", void 0);
|
|
132
|
-
NotificationRuleHistory = tslib_1.__decorate([
|
|
133
|
+
exports.NotificationRuleHistory = NotificationRuleHistory = tslib_1.__decorate([
|
|
133
134
|
(0, typeorm_1.Entity)(),
|
|
134
135
|
(0, typeorm_1.Index)('ix_notification-rule_history_0', (notificationRuleHistory) => [
|
|
135
136
|
notificationRuleHistory.originalId,
|
|
@@ -142,5 +143,4 @@ NotificationRuleHistory = tslib_1.__decorate([
|
|
|
142
143
|
], { unique: true }),
|
|
143
144
|
(0, type_graphql_1.ObjectType)({ description: 'History Entity of NotificationRule' })
|
|
144
145
|
], NotificationRuleHistory);
|
|
145
|
-
exports.NotificationRuleHistory = NotificationRuleHistory;
|
|
146
146
|
//# sourceMappingURL=notification-rule-history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-rule-history.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,2DAA6F;AAE7F,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAqB7B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QAOL,YAAO,GAAY,CAAC,CAAA;IAqFtB,CAAC;CAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"notification-rule-history.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,2DAA6F;AAE7F,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAqB7B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QAOL,YAAO,GAAY,CAAC,CAAA;IAqFtB,CAAC;CAAA,CAAA;AA5FY,0DAAuB;AAGzB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mDACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI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,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;wDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,gBAAkC,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;;0DAC3D;AAGX;IADN,IAAA,yCAAuB,GAAE;;2DACA;AAYnB;IAVN,IAAA,qCAAmB,EAAC;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBAC3B,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAChB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;uDAC+B;kCA3FtB,uBAAuB;IAnBnC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,gCAAgC,EAChC,CAAC,uBAAgD,EAAE,EAAE,CAAC;QACpD,uBAAuB,CAAC,UAAU;QAClC,uBAAuB,CAAC,OAAO;KAChC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,gCAAgC,EAChC,CAAC,uBAAgD,EAAE,EAAE,CAAC;QACpD,uBAAuB,CAAC,MAAM;QAC9B,uBAAuB,CAAC,UAAU;QAClC,uBAAuB,CAAC,OAAO;KAChC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;GACrD,uBAAuB,CA4FnC","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { NotificationRule, NotificationRuleStatus, RecipientItem } from './notification-rule'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_notification-rule_history_0',\n (notificationRuleHistory: NotificationRuleHistory) => [\n notificationRuleHistory.originalId,\n notificationRuleHistory.version\n ],\n { unique: true }\n)\n@Index(\n 'ix_notification-rule_history_1',\n (notificationRuleHistory: NotificationRuleHistory) => [\n notificationRuleHistory.domain,\n notificationRuleHistory.originalId,\n notificationRuleHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of NotificationRule' })\nexport class NotificationRuleHistory implements HistoryEntityInterface<NotificationRule> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((notificationRule: NotificationRule) => notificationRule.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: NotificationRuleStatus\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 thumbnail: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n channels: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => [RecipientItem], { nullable: true, description: 'notification recipients.' })\n recipients: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((notificationRule: NotificationRule) => notificationRule.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((notificationRule: NotificationRule) => notificationRule.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NotificationRule } from './notification-rule';
|
|
2
|
+
import { NewNotificationRule, NotificationRulePatch } from './notification-rule-type';
|
|
3
|
+
export declare class NotificationRuleMutation {
|
|
4
|
+
createNotificationRule(notificationRule: NewNotificationRule, context: ResolverContext): Promise<NotificationRule>;
|
|
5
|
+
updateNotificationRule(id: string, patch: NotificationRulePatch, context: ResolverContext): Promise<NotificationRule>;
|
|
6
|
+
updateMultipleNotificationRule(patches: NotificationRulePatch[], context: ResolverContext): Promise<NotificationRule[]>;
|
|
7
|
+
deleteNotificationRule(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteNotificationRules(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
importNotificationRules(notificationRules: NotificationRulePatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -108,6 +108,7 @@ let NotificationRuleMutation = class NotificationRuleMutation {
|
|
|
108
108
|
return true;
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
+
exports.NotificationRuleMutation = NotificationRuleMutation;
|
|
111
112
|
tslib_1.__decorate([
|
|
112
113
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
113
114
|
(0, type_graphql_1.Mutation)(returns => notification_rule_1.NotificationRule, { description: 'To create new NotificationRule' }),
|
|
@@ -163,8 +164,7 @@ tslib_1.__decorate([
|
|
|
163
164
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
164
165
|
tslib_1.__metadata("design:returntype", Promise)
|
|
165
166
|
], NotificationRuleMutation.prototype, "importNotificationRules", null);
|
|
166
|
-
NotificationRuleMutation = tslib_1.__decorate([
|
|
167
|
+
exports.NotificationRuleMutation = NotificationRuleMutation = tslib_1.__decorate([
|
|
167
168
|
(0, type_graphql_1.Resolver)(notification_rule_1.NotificationRule)
|
|
168
169
|
], NotificationRuleMutation);
|
|
169
|
-
exports.NotificationRuleMutation = NotificationRuleMutation;
|
|
170
170
|
//# sourceMappingURL=notification-rule-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-rule-mutation.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,2DAAsD;AACtD,qEAAqF;AAG9E,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAG7B,AAAN,KAAK,CAAC,sBAAsB,CACD,gBAAqC,EACvD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAC,IAAI,iCACvD,gBAAgB,KACnB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,MAAM,IAAA,kCAAgB,EACpB,IAAI,EACJ;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,gBAAgB,CAAC,SAAS;oBAChC,OAAO,EAAE,oCAAgB,CAAC,IAAI;oBAC9B,KAAK,EAAE,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zD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAaP;AAhMU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,wBAAwB,CAiMpC;AAjMY,4DAAwB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { NotificationRule } from './notification-rule'\nimport { NewNotificationRule, NotificationRulePatch } from './notification-rule-type'\n\n@Resolver(NotificationRule)\nexport class NotificationRuleMutation {\n @Directive('@transaction')\n @Mutation(returns => NotificationRule, { description: 'To create new NotificationRule' })\n async createNotificationRule(\n @Arg('notificationRule') notificationRule: NewNotificationRule,\n @Ctx() context: ResolverContext\n ): Promise<NotificationRule> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(NotificationRule).save({\n ...notificationRule,\n domain,\n creator: user,\n updater: user\n })\n\n if (notificationRule.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: notificationRule.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => NotificationRule, { description: 'To modify NotificationRule information' })\n async updateNotificationRule(\n @Arg('id') id: string,\n @Arg('patch') patch: NotificationRulePatch,\n @Ctx() context: ResolverContext\n ): Promise<NotificationRule> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(NotificationRule)\n const notificationRule = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...notificationRule,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [NotificationRule], { description: \"To modify multiple NotificationRules' information\" })\n async updateMultipleNotificationRule(\n @Arg('patches', type => [NotificationRulePatch]) patches: NotificationRulePatch[],\n @Ctx() context: ResolverContext\n ): Promise<NotificationRule[]> {\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 notificationRuleRepo = tx.getRepository(NotificationRule)\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 notificationRuleRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\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 notificationRule = await notificationRuleRepo.findOneBy({ id: updateRecord.id })\n\n const result = await notificationRuleRepo.save({\n ...notificationRule,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\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 NotificationRule' })\n async deleteNotificationRule(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(NotificationRule).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple NotificationRules' })\n async deleteNotificationRules(\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(NotificationRule).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple NotificationRules' })\n async importNotificationRules(\n @Arg('notificationRules', type => [NotificationRulePatch]) notificationRules: NotificationRulePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n notificationRules.map(async (notificationRule: NotificationRulePatch) => {\n const createdNotificationRule: NotificationRule = await tx\n .getRepository(NotificationRule)\n .save({ domain, ...notificationRule })\n })\n )\n\n return true\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"notification-rule-mutation.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,2DAAsD;AACtD,qEAAqF;AAG9E,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAG7B,AAAN,KAAK,CAAC,sBAAsB,CACD,gBAAqC,EACvD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,oCAAgB,CAAC,CAAC,IAAI,iCACvD,gBAAgB,KACnB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,IAAI,gBAAgB,CAAC,SAAS,EAAE,CAAC;YAC/B,MAAM,IAAA,kCAAgB,EACpB,IAAI,EACJ;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,gBAAgB,CAAC,SAAS;oBAChC,OAAO,EAAE,oCAAgB,CAAC,IAAI;oBAC9B,KAA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AE,CAAC;IAEnF,mBAAA,IAAA,kBAAG,EAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,8CAAqB,CAAC,CAAC,CAAA;IACzD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAaP;mCAhMU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,wBAAwB,CAiMpC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { NotificationRule } from './notification-rule'\nimport { NewNotificationRule, NotificationRulePatch } from './notification-rule-type'\n\n@Resolver(NotificationRule)\nexport class NotificationRuleMutation {\n @Directive('@transaction')\n @Mutation(returns => NotificationRule, { description: 'To create new NotificationRule' })\n async createNotificationRule(\n @Arg('notificationRule') notificationRule: NewNotificationRule,\n @Ctx() context: ResolverContext\n ): Promise<NotificationRule> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(NotificationRule).save({\n ...notificationRule,\n domain,\n creator: user,\n updater: user\n })\n\n if (notificationRule.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: notificationRule.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => NotificationRule, { description: 'To modify NotificationRule information' })\n async updateNotificationRule(\n @Arg('id') id: string,\n @Arg('patch') patch: NotificationRulePatch,\n @Ctx() context: ResolverContext\n ): Promise<NotificationRule> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(NotificationRule)\n const notificationRule = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...notificationRule,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [NotificationRule], { description: \"To modify multiple NotificationRules' information\" })\n async updateMultipleNotificationRule(\n @Arg('patches', type => [NotificationRulePatch]) patches: NotificationRulePatch[],\n @Ctx() context: ResolverContext\n ): Promise<NotificationRule[]> {\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 notificationRuleRepo = tx.getRepository(NotificationRule)\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 notificationRuleRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\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 notificationRule = await notificationRuleRepo.findOneBy({ id: updateRecord.id })\n\n const result = await notificationRuleRepo.save({\n ...notificationRule,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: NotificationRule.name,\n refBy: result.id\n }\n },\n context\n )\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 NotificationRule' })\n async deleteNotificationRule(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(NotificationRule).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple NotificationRules' })\n async deleteNotificationRules(\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(NotificationRule).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple NotificationRules' })\n async importNotificationRules(\n @Arg('notificationRules', type => [NotificationRulePatch]) notificationRules: NotificationRulePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n notificationRules.map(async (notificationRule: NotificationRulePatch) => {\n const createdNotificationRule: NotificationRule = await tx\n .getRepository(NotificationRule)\n .save({ domain, ...notificationRule })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Domain, ListParam } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { NotificationRule } from './notification-rule';
|
|
4
|
+
import { NotificationRuleList } from './notification-rule-type';
|
|
5
|
+
export declare class NotificationRuleQuery {
|
|
6
|
+
notificationRule(id: string, context: ResolverContext): Promise<NotificationRule>;
|
|
7
|
+
notificationRules(params: ListParam, context: ResolverContext): Promise<NotificationRuleList>;
|
|
8
|
+
thumbnail(notificationRule: NotificationRule): Promise<string | undefined>;
|
|
9
|
+
domain(notificationRule: NotificationRule): Promise<Domain>;
|
|
10
|
+
updater(notificationRule: NotificationRule): Promise<User>;
|
|
11
|
+
creator(notificationRule: NotificationRule): Promise<User>;
|
|
12
|
+
}
|
|
@@ -46,6 +46,7 @@ let NotificationRuleQuery = class NotificationRuleQuery {
|
|
|
46
46
|
return notificationRule.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: notificationRule.creatorId }));
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
exports.NotificationRuleQuery = NotificationRuleQuery;
|
|
49
50
|
tslib_1.__decorate([
|
|
50
51
|
(0, type_graphql_1.Query)(returns => notification_rule_1.NotificationRule, { nullable: true, description: 'To fetch a NotificationRule' }),
|
|
51
52
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
@@ -90,8 +91,7 @@ tslib_1.__decorate([
|
|
|
90
91
|
tslib_1.__metadata("design:paramtypes", [notification_rule_1.NotificationRule]),
|
|
91
92
|
tslib_1.__metadata("design:returntype", Promise)
|
|
92
93
|
], NotificationRuleQuery.prototype, "creator", null);
|
|
93
|
-
NotificationRuleQuery = tslib_1.__decorate([
|
|
94
|
+
exports.NotificationRuleQuery = NotificationRuleQuery = tslib_1.__decorate([
|
|
94
95
|
(0, type_graphql_1.Resolver)(notification_rule_1.NotificationRule)
|
|
95
96
|
], NotificationRuleQuery);
|
|
96
|
-
exports.NotificationRuleQuery = NotificationRuleQuery;
|
|
97
97
|
//# sourceMappingURL=notification-rule-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-rule-query.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,2DAAsD;AACtD,qEAA+D;AAGxD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAE1B,AAAN,KAAK,CAAC,gBAAgB,CAAY,EAAU,EAAS,OAAwB;QAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,oCAAgB,CAAC,CAAC,OAAO,CAAC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;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E,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;IAChH,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,gBAAkC;QACtD,OAAO,gBAAgB,CAAC,SAAS,IAAI,CAAC,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;IAChH,CAAC;CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"notification-rule-query.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,2DAAsD;AACtD,qEAA+D;AAGxD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAE1B,AAAN,KAAK,CAAC,gBAAgB,CAAY,EAAU,EAAS,OAAwB;QAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,oCAAgB,CAAC,CAAC,OAAO,CAAC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,iBAAiB,CAAS,MAAiB,EAAS,OAAwB;QAChF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,oCAAgB,CAAC;YACjD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE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IAAI,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC5E,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6DAMnD;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6CAAoB,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IACtE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;8DAahD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;sDAUzD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;mDAEtD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;oDAEvD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;oDAEvD;gCApDU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,qBAAqB,CAqDjC","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { NotificationRule } from './notification-rule'\nimport { NotificationRuleList } from './notification-rule-type'\n\n@Resolver(NotificationRule)\nexport class NotificationRuleQuery {\n @Query(returns => NotificationRule!, { nullable: true, description: 'To fetch a NotificationRule' })\n async notificationRule(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<NotificationRule> {\n const { domain } = context.state\n\n return await getRepository(NotificationRule).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => NotificationRuleList, { description: 'To fetch multiple NotificationRules' })\n async notificationRules(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<NotificationRuleList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(NotificationRule),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() notificationRule: NotificationRule): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: notificationRule.domainId },\n refType: NotificationRule.name,\n refBy: notificationRule.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() notificationRule: NotificationRule): Promise<Domain> {\n return notificationRule.domainId && (await getRepository(Domain).findOneBy({ id: notificationRule.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() notificationRule: NotificationRule): Promise<User> {\n return notificationRule.updaterId && (await getRepository(User).findOneBy({ id: notificationRule.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() notificationRule: NotificationRule): Promise<User> {\n return notificationRule.creatorId && (await getRepository(User).findOneBy({ id: notificationRule.creatorId }))\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FileUpload } from 'graphql-upload/GraphQLUpload.js';
|
|
2
|
+
import { NotificationRule, NotificationRuleStatus } from './notification-rule';
|
|
3
|
+
export declare class NewNotificationRule {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
state?: NotificationRuleStatus;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
title: string;
|
|
9
|
+
body: string;
|
|
10
|
+
url: string;
|
|
11
|
+
thumbnail?: FileUpload;
|
|
12
|
+
}
|
|
13
|
+
export declare class NotificationRulePatch {
|
|
14
|
+
id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
state?: NotificationRuleStatus;
|
|
18
|
+
title: string;
|
|
19
|
+
body: string;
|
|
20
|
+
url: string;
|
|
21
|
+
thumbnail?: FileUpload;
|
|
22
|
+
cuFlag?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class NotificationRuleList {
|
|
25
|
+
items: NotificationRule[];
|
|
26
|
+
total: number;
|
|
27
|
+
}
|
|
@@ -7,6 +7,7 @@ const type_graphql_1 = require("type-graphql");
|
|
|
7
7
|
const notification_rule_1 = require("./notification-rule");
|
|
8
8
|
let NewNotificationRule = class NewNotificationRule {
|
|
9
9
|
};
|
|
10
|
+
exports.NewNotificationRule = NewNotificationRule;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
12
|
(0, type_graphql_1.Field)(),
|
|
12
13
|
tslib_1.__metadata("design:type", String)
|
|
@@ -39,12 +40,12 @@ tslib_1.__decorate([
|
|
|
39
40
|
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
40
41
|
tslib_1.__metadata("design:type", Object)
|
|
41
42
|
], NewNotificationRule.prototype, "thumbnail", void 0);
|
|
42
|
-
NewNotificationRule = tslib_1.__decorate([
|
|
43
|
+
exports.NewNotificationRule = NewNotificationRule = tslib_1.__decorate([
|
|
43
44
|
(0, type_graphql_1.InputType)()
|
|
44
45
|
], NewNotificationRule);
|
|
45
|
-
exports.NewNotificationRule = NewNotificationRule;
|
|
46
46
|
let NotificationRulePatch = class NotificationRulePatch {
|
|
47
47
|
};
|
|
48
|
+
exports.NotificationRulePatch = NotificationRulePatch;
|
|
48
49
|
tslib_1.__decorate([
|
|
49
50
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
50
51
|
tslib_1.__metadata("design:type", String)
|
|
@@ -81,12 +82,12 @@ tslib_1.__decorate([
|
|
|
81
82
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
82
83
|
tslib_1.__metadata("design:type", String)
|
|
83
84
|
], NotificationRulePatch.prototype, "cuFlag", void 0);
|
|
84
|
-
NotificationRulePatch = tslib_1.__decorate([
|
|
85
|
+
exports.NotificationRulePatch = NotificationRulePatch = tslib_1.__decorate([
|
|
85
86
|
(0, type_graphql_1.InputType)()
|
|
86
87
|
], NotificationRulePatch);
|
|
87
|
-
exports.NotificationRulePatch = NotificationRulePatch;
|
|
88
88
|
let NotificationRuleList = class NotificationRuleList {
|
|
89
89
|
};
|
|
90
|
+
exports.NotificationRuleList = NotificationRuleList;
|
|
90
91
|
tslib_1.__decorate([
|
|
91
92
|
(0, type_graphql_1.Field)(type => [notification_rule_1.NotificationRule]),
|
|
92
93
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -95,8 +96,7 @@ tslib_1.__decorate([
|
|
|
95
96
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
96
97
|
tslib_1.__metadata("design:type", Number)
|
|
97
98
|
], NotificationRuleList.prototype, "total", void 0);
|
|
98
|
-
NotificationRuleList = tslib_1.__decorate([
|
|
99
|
+
exports.NotificationRuleList = NotificationRuleList = tslib_1.__decorate([
|
|
99
100
|
(0, type_graphql_1.ObjectType)()
|
|
100
101
|
], NotificationRuleList);
|
|
101
|
-
exports.NotificationRuleList = NotificationRuleList;
|
|
102
102
|
//# sourceMappingURL=notification-rule-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-rule-type.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAoE;AAEpE,2DAA8E;AAGvE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAwB/B,CAAA;
|
|
1
|
+
{"version":3,"file":"notification-rule-type.js","sourceRoot":"","sources":["../../../server/service/notification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C,IAAI,CAAC,EAAE,CAAC,0CAAsB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAC5B;AAG9B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACd;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACf;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAC3B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACX;gCA1BJ,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CA2BjC;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAMhC,CAAA;AANY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oCAAgB,CAAC,CAAC;;mDACT;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;mDACN;+BALF,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAMhC","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { NotificationRule, NotificationRuleStatus } from './notification-rule'\n\n@InputType()\nexport class NewNotificationRule {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => NotificationRuleStatus, { nullable: true })\n state?: NotificationRuleStatus\n\n @Field({ nullable: true })\n active?: boolean\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(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class NotificationRulePatch {\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 => NotificationRuleStatus, { nullable: true })\n state?: NotificationRuleStatus\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(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class NotificationRuleList {\n @Field(type => [NotificationRule])\n items: NotificationRule[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|