@rytass/bpm-core-nestjs-module 0.6.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +133 -0
- package/README.md +60 -1
- package/package.json +17 -3
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/bpm/bpm-root.module.d.ts +33 -0
- package/src/lib/bpm/bpm-root.module.js +20 -0
- package/src/lib/bpm/bpm-root.module.js.map +1 -1
- package/src/lib/calendar/business-calendar.provider.d.ts +11 -0
- package/src/lib/calendar/business-calendar.provider.js +20 -0
- package/src/lib/calendar/business-calendar.provider.js.map +1 -0
- package/src/lib/calendar/business-calendar.token.d.ts +38 -0
- package/src/lib/calendar/business-calendar.token.js +5 -0
- package/src/lib/calendar/business-calendar.token.js.map +1 -0
- package/src/lib/calendar/calendar.module.d.ts +22 -0
- package/src/lib/calendar/calendar.module.js +33 -0
- package/src/lib/calendar/calendar.module.js.map +1 -0
- package/src/lib/calendar/index.d.ts +5 -0
- package/src/lib/calendar/index.js +9 -0
- package/src/lib/calendar/index.js.map +1 -0
- package/src/lib/calendar/sla-schedule.service.d.ts +33 -0
- package/src/lib/calendar/sla-schedule.service.js +94 -0
- package/src/lib/calendar/sla-schedule.service.js.map +1 -0
- package/src/lib/calendar/weekday-business-calendar.d.ts +15 -0
- package/src/lib/calendar/weekday-business-calendar.js +28 -0
- package/src/lib/calendar/weekday-business-calendar.js.map +1 -0
- package/src/lib/common/iso-duration.d.ts +11 -0
- package/src/lib/common/iso-duration.js +13 -4
- package/src/lib/common/iso-duration.js.map +1 -1
- package/src/lib/form/form-schema.validator.js +177 -10
- package/src/lib/form/form-schema.validator.js.map +1 -1
- package/src/lib/form/form.service.d.ts +19 -1
- package/src/lib/form/form.service.js +56 -6
- package/src/lib/form/form.service.js.map +1 -1
- package/src/lib/form-data-source/form-data-source-value-resolver.service.d.ts +16 -0
- package/src/lib/form-data-source/form-data-source-value-resolver.service.js +401 -0
- package/src/lib/form-data-source/form-data-source-value-resolver.service.js.map +1 -0
- package/src/lib/form-data-source/form-data-source.errors.d.ts +34 -0
- package/src/lib/form-data-source/form-data-source.errors.js +43 -0
- package/src/lib/form-data-source/form-data-source.errors.js.map +1 -0
- package/src/lib/form-data-source/form-data-source.module.d.ts +9 -0
- package/src/lib/form-data-source/form-data-source.module.js +55 -0
- package/src/lib/form-data-source/form-data-source.module.js.map +1 -0
- package/src/lib/form-data-source/form-data-source.queries.d.ts +57 -0
- package/src/lib/form-data-source/form-data-source.queries.js +293 -0
- package/src/lib/form-data-source/form-data-source.queries.js.map +1 -0
- package/src/lib/form-data-source/form-data-source.service.d.ts +72 -0
- package/src/lib/form-data-source/form-data-source.service.js +646 -0
- package/src/lib/form-data-source/form-data-source.service.js.map +1 -0
- package/src/lib/form-data-source/form-data-source.types.d.ts +88 -0
- package/src/lib/form-data-source/form-data-source.types.js +29 -0
- package/src/lib/form-data-source/form-data-source.types.js.map +1 -0
- package/src/lib/form-data-source/index.d.ts +5 -0
- package/src/lib/form-data-source/index.js +9 -0
- package/src/lib/form-data-source/index.js.map +1 -0
- package/src/lib/migrations/0000000018000-notification-archive.d.ts +6 -0
- package/src/lib/migrations/0000000018000-notification-archive.js +28 -0
- package/src/lib/migrations/0000000018000-notification-archive.js.map +1 -0
- package/src/lib/migrations/0000000019000-approval-template-activation.d.ts +6 -0
- package/src/lib/migrations/0000000019000-approval-template-activation.js +29 -0
- package/src/lib/migrations/0000000019000-approval-template-activation.js.map +1 -0
- package/src/lib/migrations/0000000020000-form-data-option-snapshots.d.ts +6 -0
- package/src/lib/migrations/0000000020000-form-data-option-snapshots.js +22 -0
- package/src/lib/migrations/0000000020000-form-data-option-snapshots.js.map +1 -0
- package/src/lib/migrations/index.d.ts +3 -0
- package/src/lib/migrations/index.js +9 -0
- package/src/lib/migrations/index.js.map +1 -1
- package/src/lib/notification/index.d.ts +3 -0
- package/src/lib/notification/index.js +3 -0
- package/src/lib/notification/index.js.map +1 -1
- package/src/lib/notification/notification-observer.token.d.ts +52 -0
- package/src/lib/notification/notification-observer.token.js +5 -0
- package/src/lib/notification/notification-observer.token.js.map +1 -0
- package/src/lib/notification/notification-options.d.ts +10 -0
- package/src/lib/notification/notification-options.js +19 -0
- package/src/lib/notification/notification-options.js.map +1 -1
- package/src/lib/notification/notification.entity.d.ts +11 -0
- package/src/lib/notification/notification.entity.js +17 -0
- package/src/lib/notification/notification.entity.js.map +1 -1
- package/src/lib/notification/notification.enums.d.ts +13 -0
- package/src/lib/notification/notification.enums.js +14 -1
- package/src/lib/notification/notification.enums.js.map +1 -1
- package/src/lib/notification/notification.mutations.d.ts +2 -0
- package/src/lib/notification/notification.mutations.js +28 -0
- package/src/lib/notification/notification.mutations.js.map +1 -1
- package/src/lib/notification/notification.queries.d.ts +2 -2
- package/src/lib/notification/notification.queries.js +12 -8
- package/src/lib/notification/notification.queries.js.map +1 -1
- package/src/lib/notification/notification.service.d.ts +42 -2
- package/src/lib/notification/notification.service.js +135 -4
- package/src/lib/notification/notification.service.js.map +1 -1
- package/src/lib/template/approval-template.entity.d.ts +13 -0
- package/src/lib/template/approval-template.entity.js +12 -1
- package/src/lib/template/approval-template.entity.js.map +1 -1
- package/src/lib/template/template.enums.d.ts +5 -0
- package/src/lib/template/template.enums.js +10 -1
- package/src/lib/template/template.enums.js.map +1 -1
- package/src/lib/template/template.mutations.d.ts +2 -0
- package/src/lib/template/template.mutations.js +20 -0
- package/src/lib/template/template.mutations.js.map +1 -1
- package/src/lib/template/template.queries.d.ts +3 -3
- package/src/lib/template/template.queries.js +14 -4
- package/src/lib/template/template.queries.js.map +1 -1
- package/src/lib/template/template.service.d.ts +7 -2
- package/src/lib/template/template.service.js +56 -11
- package/src/lib/template/template.service.js.map +1 -1
- package/src/lib/template/workflow-definition.validator.js +86 -1
- package/src/lib/template/workflow-definition.validator.js.map +1 -1
- package/src/lib/workflow-engine/approval-instance.entity.d.ts +3 -0
- package/src/lib/workflow-engine/approval-instance.entity.js +15 -0
- package/src/lib/workflow-engine/approval-instance.entity.js.map +1 -1
- package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.d.ts +5 -1
- package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js +6 -2
- package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js.map +1 -1
- package/src/lib/workflow-engine/dto/submit-approval-instance.input.d.ts +5 -1
- package/src/lib/workflow-engine/dto/submit-approval-instance.input.js +6 -2
- package/src/lib/workflow-engine/dto/submit-approval-instance.input.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.mutations.d.ts +3 -2
- package/src/lib/workflow-engine/workflow-engine.mutations.js +8 -6
- package/src/lib/workflow-engine/workflow-engine.mutations.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.service.d.ts +37 -4
- package/src/lib/workflow-engine/workflow-engine.service.js +245 -15
- package/src/lib/workflow-engine/workflow-engine.service.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.tokens.d.ts +2 -1
- package/src/lib/workflow-engine/workflow-engine.tokens.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.entity.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/notification/notification.entity.ts"],"names":[],"mappings":";;;;AAAA,6CAAwD;AACxD,qCAMiB;AACjB,6DAK8B;AAE9B,MAAM,6BAA6B,GACjC,IAAI,GAAG,CAAC;IACN,yCAAoB,CAAC,aAAa;IAClC,yCAAoB,CAAC,gBAAgB;CACtC,CAAC,CAAC;AASE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;
|
|
1
|
+
{"version":3,"file":"notification.entity.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/notification/notification.entity.ts"],"names":[],"mappings":";;;;AAAA,6CAAwD;AACxD,qCAMiB;AACjB,6DAK8B;AAE9B,MAAM,6BAA6B,GACjC,IAAI,GAAG,CAAC;IACN,yCAAoB,CAAC,aAAa;IACl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B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3D,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACT;AAI/B;IAFC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC7D,IAAA,eAAK,GAAE;sCACI,IAAI;qDAAC;AAEjB;IAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;;qDAGnB;AAQD;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;AAOnC;IAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;;;oDAKpB;6BAnHU,kBAAkB;IAP9B,IAAA,gBAAM,EAAC,eAAe,CAAC;IACvB,IAAA,eAAK,EAAC,oCAAoC,EAAE;QAC3C,QAAQ;QACR,aAAa;QACb,WAAW;KACZ,CAAC;IACD,IAAA,oBAAU,EAAC,cAAc,CAAC;GACd,kBAAkB,CAoH9B"}
|
|
@@ -36,3 +36,16 @@ export declare enum NotificationTypeEnum {
|
|
|
36
36
|
TASK_TRANSFERRED = "TASK_TRANSFERRED",
|
|
37
37
|
WORKFLOW_NOTIFICATION = "WORKFLOW_NOTIFICATION"
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Delegation-chain reason stamped on the transfer that an SLA `ESCALATE`
|
|
41
|
+
* timeout performs.
|
|
42
|
+
*
|
|
43
|
+
* Escalation transfers the task to a new `TaskEntity` that inherits the
|
|
44
|
+
* delegation chain, so this marker is what makes the timeout action idempotent:
|
|
45
|
+
* without it every SLA scan would find the (still overdue) escalated task,
|
|
46
|
+
* see no prior notification for its new assignee, and escalate again — walking
|
|
47
|
+
* the whole management chain one level per scan. A task created for a fresh
|
|
48
|
+
* token (for example after a return and resubmit) starts with an empty chain
|
|
49
|
+
* and can escalate again, which is the intended behaviour.
|
|
50
|
+
*/
|
|
51
|
+
export declare const SLA_ESCALATION_DELEGATION_REASON = "SLA_ESCALATION";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationTypeEnum = exports.NotificationResolutionEnum = exports.NotificationStatusEnum = exports.NotificationDigestModeEnum = exports.NotificationChannelEnum = void 0;
|
|
3
|
+
exports.SLA_ESCALATION_DELEGATION_REASON = exports.NotificationTypeEnum = exports.NotificationResolutionEnum = exports.NotificationStatusEnum = exports.NotificationDigestModeEnum = exports.NotificationChannelEnum = void 0;
|
|
4
4
|
const graphql_1 = require("@nestjs/graphql");
|
|
5
5
|
var NotificationChannelEnum;
|
|
6
6
|
(function (NotificationChannelEnum) {
|
|
@@ -60,4 +60,17 @@ var NotificationTypeEnum;
|
|
|
60
60
|
(0, graphql_1.registerEnumType)(NotificationTypeEnum, {
|
|
61
61
|
name: 'NotificationType',
|
|
62
62
|
});
|
|
63
|
+
/**
|
|
64
|
+
* Delegation-chain reason stamped on the transfer that an SLA `ESCALATE`
|
|
65
|
+
* timeout performs.
|
|
66
|
+
*
|
|
67
|
+
* Escalation transfers the task to a new `TaskEntity` that inherits the
|
|
68
|
+
* delegation chain, so this marker is what makes the timeout action idempotent:
|
|
69
|
+
* without it every SLA scan would find the (still overdue) escalated task,
|
|
70
|
+
* see no prior notification for its new assignee, and escalate again — walking
|
|
71
|
+
* the whole management chain one level per scan. A task created for a fresh
|
|
72
|
+
* token (for example after a return and resubmit) starts with an empty chain
|
|
73
|
+
* and can escalate again, which is the intended behaviour.
|
|
74
|
+
*/
|
|
75
|
+
exports.SLA_ESCALATION_DELEGATION_REASON = 'SLA_ESCALATION';
|
|
63
76
|
//# sourceMappingURL=notification.enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.enums.js","sourceRoot":"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A,0BAAgB,EAAC,0BAA0B,EAAE;IAC3C,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC;AAEH,IAAA,0BAAgB,EAAC,oBAAoB,EAAE;IACrC,IAAI,EAAE,kBAAkB;CACzB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"notification.enums.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/notification/notification.enums.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;AAEnD,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,0CAAe,CAAA;IACf,4CAAiB,CAAA;IACjB,8CAAmB,CAAA;AACrB,CAAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC;AAED,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,6CAAe,CAAA;IACf,iDAAmB,CAAA;AACrB,CAAC,EAHW,0BAA0B,0CAA1B,0BAA0B,QAGrC;AAED,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,uEAA6C,CAAA;IAC7C,2CAAiB,CAAA;IACjB,6CAAmB,CAAA;IACnB,uCAAa,CAAA;IACb,uCAAa,CAAA;AACf,CAAC,EANW,sBAAsB,sCAAtB,sBAAsB,QAMjC;AAED;;;;;;GAMG;AACH,IAAY,0BAMX;AAND,WAAY,0BAA0B;IACpC,mDAAqB,CAAA;IACrB,mDAAqB,CAAA;IACrB,mDAAqB,CAAA;IACrB,yDAA2B,CAAA;IAC3B,uDAAyB,CAAA;AAC3B,CAAC,EANW,0BAA0B,0CAA1B,0BAA0B,QAMrC;AAED,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,iEAAyC,CAAA;IACzC,mDAA2B,CAAA;IAC3B,mDAA2B,CAAA;IAC3B,uDAA+B,CAAA;IAC/B,6DAAqC,CAAA;IACrC,uEAA+C,CAAA;AACjD,CAAC,EAPW,oBAAoB,oCAApB,oBAAoB,QAO/B;AAED,IAAA,0BAAgB,EAAC,uBAAuB,EAAE;IACxC,IAAI,EAAE,qBAAqB;CAC5B,CAAC,CAAC;AAEH,IAAA,0BAAgB,EAAC,0BAA0B,EAAE;IAC3C,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC;AAEH,IAAA,0BAAgB,EAAC,sBAAsB,EAAE;IACvC,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEH,IAAA,0BAAgB,EAAC,0BAA0B,EAAE;IAC3C,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC;AAEH,IAAA,0BAAgB,EAAC,oBAAoB,EAAE;IACrC,IAAI,EAAE,kBAAkB;CACzB,CAAC,CAAC;AAEH;;;;;;;;;;;GAWG;AACU,QAAA,gCAAgC,GAAG,gBAAgB,CAAC"}
|
|
@@ -7,5 +7,7 @@ export declare class NotificationMutations {
|
|
|
7
7
|
constructor(notificationService: NotificationService);
|
|
8
8
|
markNotificationRead(id: string, readerMemberId?: string | null, currentMemberId?: string): Promise<NotificationEntity>;
|
|
9
9
|
markAllNotificationsRead(currentMemberId: string, recipientMemberId?: string | null): Promise<number>;
|
|
10
|
+
archiveNotifications(ids: readonly string[], currentMemberId: string): Promise<number>;
|
|
11
|
+
unarchiveNotifications(ids: readonly string[], currentMemberId: string): Promise<number>;
|
|
10
12
|
updateNotificationPreference(input: UpdateNotificationPreferenceInput, currentMemberId: string): Promise<NotificationPreferenceEntity>;
|
|
11
13
|
}
|
|
@@ -23,6 +23,18 @@ let NotificationMutations = class NotificationMutations {
|
|
|
23
23
|
recipientMemberId: currentMemberId ?? recipientMemberId ?? '',
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
async archiveNotifications(ids, currentMemberId) {
|
|
27
|
+
return this.notificationService.archiveNotifications({
|
|
28
|
+
ids,
|
|
29
|
+
memberId: currentMemberId,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async unarchiveNotifications(ids, currentMemberId) {
|
|
33
|
+
return this.notificationService.unarchiveNotifications({
|
|
34
|
+
ids,
|
|
35
|
+
memberId: currentMemberId,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
26
38
|
async updateNotificationPreference(input, currentMemberId) {
|
|
27
39
|
return this.notificationService.updatePreference({
|
|
28
40
|
...input,
|
|
@@ -48,6 +60,22 @@ tslib_1.__decorate([
|
|
|
48
60
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
49
61
|
tslib_1.__metadata("design:returntype", Promise)
|
|
50
62
|
], NotificationMutations.prototype, "markAllNotificationsRead", null);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, graphql_1.Mutation)(() => graphql_1.Int),
|
|
65
|
+
tslib_1.__param(0, (0, graphql_1.Args)('ids', { type: () => [String] })),
|
|
66
|
+
tslib_1.__param(1, (0, bpm_auth_1.BPMCurrentMemberId)()),
|
|
67
|
+
tslib_1.__metadata("design:type", Function),
|
|
68
|
+
tslib_1.__metadata("design:paramtypes", [Array, String]),
|
|
69
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
70
|
+
], NotificationMutations.prototype, "archiveNotifications", null);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, graphql_1.Mutation)(() => graphql_1.Int),
|
|
73
|
+
tslib_1.__param(0, (0, graphql_1.Args)('ids', { type: () => [String] })),
|
|
74
|
+
tslib_1.__param(1, (0, bpm_auth_1.BPMCurrentMemberId)()),
|
|
75
|
+
tslib_1.__metadata("design:type", Function),
|
|
76
|
+
tslib_1.__metadata("design:paramtypes", [Array, String]),
|
|
77
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
78
|
+
], NotificationMutations.prototype, "unarchiveNotifications", null);
|
|
51
79
|
tslib_1.__decorate([
|
|
52
80
|
(0, graphql_1.Mutation)(() => notification_preference_entity_1.NotificationPreferenceEntity),
|
|
53
81
|
tslib_1.__param(0, (0, graphql_1.Args)('input')),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.mutations.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/notification/notification.mutations.ts"],"names":[],"mappings":";;;;AAAA,6CAAgE;AAChE,0CAAmE;AACnE,uFAAwF;AACxF,qFAAgF;AAChF,+DAA2D;AAC3D,iEAA6D;AAItD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAGnE,AAAN,KAAK,CAAC,oBAAoB,CACY,EAAU,EAE9C,cAA8B,EACR,eAAwB;QAE9C,OAAO,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC;YACnD,EAAE;YACF,cAAc,EAAE,eAAe,IAAI,cAAc,IAAI,IAAI;SAC1D,CAAC,CAAC;IACL,CAAC;IAGK,AAAN,KAAK,CAAC,wBAAwB,CACN,eAAuB,EAE7C,iBAAiC;QAEjC,OAAO,IAAI,CAAC,mBAAmB,CAAC,wBAAwB,CAAC;YACvD,iBAAiB,EAAE,eAAe,IAAI,iBAAiB,IAAI,EAAE;SAC9D,CAAC,CAAC;IACL,CAAC;IAGK,AAAN,KAAK,CAAC,4BAA4B,CACjB,KAAwC,EACjC,eAAuB;QAE7C,OAAO,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;YAC/C,GAAG,KAAK;YACR,QAAQ,EAAE,eAAe;SAC1B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"notification.mutations.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/notification/notification.mutations.ts"],"names":[],"mappings":";;;;AAAA,6CAAgE;AAChE,0CAAmE;AACnE,uFAAwF;AACxF,qFAAgF;AAChF,+DAA2D;AAC3D,iEAA6D;AAItD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAGnE,AAAN,KAAK,CAAC,oBAAoB,CACY,EAAU,EAE9C,cAA8B,EACR,eAAwB;QAE9C,OAAO,IAAI,CAAC,m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MtB;AAGK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,aAAG,CAAC;IAEjB,mBAAA,IAAA,6BAAkB,GAAE,CAAA;IACpB,mBAAA,IAAA,cAAI,EAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAA;;;;qEAMnE;AAGK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,aAAG,CAAC;IAEjB,mBAAA,IAAA,cAAI,EAAC,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACrC,mBAAA,IAAA,6BAAkB,GAAE,CAAA;;;;iEAMtB;AAGK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,aAAG,CAAC;IAEjB,mBAAA,IAAA,cAAI,EAAC,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACrC,mBAAA,IAAA,6BAAkB,GAAE,CAAA;;;;mEAMtB;AAGK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,6DAA4B,CAAC;IAE1C,mBAAA,IAAA,cAAI,EAAC,OAAO,CAAC,CAAA;IACb,mBAAA,IAAA,6BAAkB,GAAE,CAAA;;6CADC,iEAAiC;;yEAOxD;gCA1DU,qBAAqB;IAFjC,IAAA,kBAAQ,GAAE;IACV,IAAA,2BAAgB,GAAE;6CAEiC,0CAAmB;GAD1D,qBAAqB,CA2DjC"}
|
|
@@ -4,8 +4,8 @@ import { NotificationService } from './notification.service';
|
|
|
4
4
|
export declare class NotificationQueries {
|
|
5
5
|
private readonly notificationService;
|
|
6
6
|
constructor(notificationService: NotificationService);
|
|
7
|
-
notifications(recipientMemberId: string, includeRead?: boolean | null, page?: number | null, pageSize?: number | null, currentMemberId?: string): Promise<readonly NotificationEntity[]>;
|
|
8
|
-
notificationCount(recipientMemberId: string, includeRead?: boolean | null, currentMemberId?: string): Promise<number>;
|
|
7
|
+
notifications(recipientMemberId: string, includeRead?: boolean | null, includeArchived?: boolean | null, page?: number | null, pageSize?: number | null, currentMemberId?: string): Promise<readonly NotificationEntity[]>;
|
|
8
|
+
notificationCount(recipientMemberId: string, includeRead?: boolean | null, includeArchived?: boolean | null, currentMemberId?: string): Promise<number>;
|
|
9
9
|
unreadNotificationCount(recipientMemberId: string, currentMemberId?: string): Promise<number>;
|
|
10
10
|
notificationPreference(memberId: string, currentMemberId?: string): Promise<NotificationPreferenceEntity>;
|
|
11
11
|
}
|
|
@@ -11,16 +11,18 @@ let NotificationQueries = class NotificationQueries {
|
|
|
11
11
|
constructor(notificationService) {
|
|
12
12
|
this.notificationService = notificationService;
|
|
13
13
|
}
|
|
14
|
-
async notifications(recipientMemberId, includeRead, page, pageSize, currentMemberId) {
|
|
14
|
+
async notifications(recipientMemberId, includeRead, includeArchived, page, pageSize, currentMemberId) {
|
|
15
15
|
return this.notificationService.listNotifications({
|
|
16
|
+
includeArchived: includeArchived ?? false,
|
|
16
17
|
includeRead: includeRead ?? false,
|
|
17
18
|
page: page ?? 1,
|
|
18
19
|
pageSize: pageSize ?? 10,
|
|
19
20
|
recipientMemberId: currentMemberId ?? recipientMemberId,
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
|
-
async notificationCount(recipientMemberId, includeRead, currentMemberId) {
|
|
23
|
+
async notificationCount(recipientMemberId, includeRead, includeArchived, currentMemberId) {
|
|
23
24
|
return this.notificationService.countNotifications({
|
|
25
|
+
includeArchived: includeArchived ?? false,
|
|
24
26
|
includeRead: includeRead ?? false,
|
|
25
27
|
recipientMemberId: currentMemberId ?? recipientMemberId,
|
|
26
28
|
});
|
|
@@ -37,20 +39,22 @@ tslib_1.__decorate([
|
|
|
37
39
|
(0, graphql_1.Query)(() => [notification_entity_1.NotificationEntity]),
|
|
38
40
|
tslib_1.__param(0, (0, graphql_1.Args)('recipientMemberId', { type: () => String })),
|
|
39
41
|
tslib_1.__param(1, (0, graphql_1.Args)('includeRead', { nullable: true, type: () => Boolean })),
|
|
40
|
-
tslib_1.__param(2, (0, graphql_1.Args)('
|
|
41
|
-
tslib_1.__param(3, (0, graphql_1.Args)('
|
|
42
|
-
tslib_1.__param(4, (0,
|
|
42
|
+
tslib_1.__param(2, (0, graphql_1.Args)('includeArchived', { nullable: true, type: () => Boolean })),
|
|
43
|
+
tslib_1.__param(3, (0, graphql_1.Args)('page', { nullable: true, type: () => graphql_1.Int })),
|
|
44
|
+
tslib_1.__param(4, (0, graphql_1.Args)('pageSize', { nullable: true, type: () => graphql_1.Int })),
|
|
45
|
+
tslib_1.__param(5, (0, bpm_auth_1.BPMCurrentMemberId)()),
|
|
43
46
|
tslib_1.__metadata("design:type", Function),
|
|
44
|
-
tslib_1.__metadata("design:paramtypes", [String, Object, Object, Object, String]),
|
|
47
|
+
tslib_1.__metadata("design:paramtypes", [String, Object, Object, Object, Object, String]),
|
|
45
48
|
tslib_1.__metadata("design:returntype", Promise)
|
|
46
49
|
], NotificationQueries.prototype, "notifications", null);
|
|
47
50
|
tslib_1.__decorate([
|
|
48
51
|
(0, graphql_1.Query)(() => graphql_1.Int),
|
|
49
52
|
tslib_1.__param(0, (0, graphql_1.Args)('recipientMemberId', { type: () => String })),
|
|
50
53
|
tslib_1.__param(1, (0, graphql_1.Args)('includeRead', { nullable: true, type: () => Boolean })),
|
|
51
|
-
tslib_1.__param(2, (0,
|
|
54
|
+
tslib_1.__param(2, (0, graphql_1.Args)('includeArchived', { nullable: true, type: () => Boolean })),
|
|
55
|
+
tslib_1.__param(3, (0, bpm_auth_1.BPMCurrentMemberId)()),
|
|
52
56
|
tslib_1.__metadata("design:type", Function),
|
|
53
|
-
tslib_1.__metadata("design:paramtypes", [String, Object, String]),
|
|
57
|
+
tslib_1.__metadata("design:paramtypes", [String, Object, Object, String]),
|
|
54
58
|
tslib_1.__metadata("design:returntype", Promise)
|
|
55
59
|
], NotificationQueries.prototype, "notificationCount", null);
|
|
56
60
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.queries.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/notification/notification.queries.ts"],"names":[],"mappings":";;;;AAAA,6CAA6D;AAC7D,0CAAmE;AACnE,qFAAgF;AAChF,+DAA2D;AAC3D,iEAA6D;AAItD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAGnE,AAAN,KAAK,CAAC,aAAa,CAEjB,iBAAyB,EAEzB,WAA4B,EAE5B,IAAoB,EAEpB,QAAwB,EACF,eAAwB;QAE9C,OAAO,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC;YAChD,WAAW,EAAE,WAAW,IAAI,KAAK;YACjC,IAAI,EAAE,IAAI,IAAI,CAAC;YACf,QAAQ,EAAE,QAAQ,IAAI,EAAE;YACxB,iBAAiB,EAAE,eAAe,IAAI,iBAAiB;SACxD,CAAC,CAAC;IACL,CAAC;IAGK,AAAN,KAAK,CAAC,iBAAiB,CAErB,iBAAyB,EAEzB,WAA4B,
|
|
1
|
+
{"version":3,"file":"notification.queries.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/notification/notification.queries.ts"],"names":[],"mappings":";;;;AAAA,6CAA6D;AAC7D,0CAAmE;AACnE,qFAAgF;AAChF,+DAA2D;AAC3D,iEAA6D;AAItD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAGnE,AAAN,KAAK,CAAC,aAAa,CAEjB,iBAAyB,EAEzB,WAA4B,EAE5B,eAAgC,EAEhC,IAAoB,EAEpB,QAAwB,EACF,eAAwB;QAE9C,OAAO,IAAI,CAAC,mBAAmB,CAAC,iBAAi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A;IACxC,mBAAA,IAAA,6BAAkB,GAAE,CAAA;;;;iEAGtB;8BA5DU,mBAAmB;IAF/B,IAAA,kBAAQ,GAAE;IACV,IAAA,2BAAgB,GAAE;6CAEiC,0CAAmB;GAD1D,mBAAmB,CA6D/B"}
|
|
@@ -27,16 +27,23 @@ export declare class NotificationService {
|
|
|
27
27
|
private readonly notificationOptions;
|
|
28
28
|
private readonly logger;
|
|
29
29
|
constructor(notificationRepository: Repository<NotificationEntity>, notificationPreferenceRepository: Repository<NotificationPreferenceEntity>, taskRepository: Repository<TaskEntity>, taskCandidateRepository: Repository<TaskCandidateEntity>, approvalInstanceRepository: Repository<ApprovalInstanceEntity>, activityLogRepository: Repository<ActivityLogEntity>, deliveryService: NotificationDeliveryService, moduleRef: ModuleRef, notificationOptions?: BPMResolvedNotificationOptions);
|
|
30
|
-
listNotifications({ includeRead, page, pageSize, recipientMemberId, }: {
|
|
30
|
+
listNotifications({ includeArchived, includeRead, page, pageSize, recipientMemberId, }: {
|
|
31
|
+
readonly includeArchived?: boolean;
|
|
31
32
|
readonly includeRead?: boolean;
|
|
32
33
|
readonly page?: number;
|
|
33
34
|
readonly pageSize?: number;
|
|
34
35
|
readonly recipientMemberId: string;
|
|
35
36
|
}): Promise<readonly NotificationEntity[]>;
|
|
36
|
-
|
|
37
|
+
private attachLegacyTaskPolicies;
|
|
38
|
+
countNotifications({ includeArchived, includeRead, recipientMemberId, }: {
|
|
39
|
+
readonly includeArchived?: boolean;
|
|
37
40
|
readonly includeRead?: boolean;
|
|
38
41
|
readonly recipientMemberId: string;
|
|
39
42
|
}): Promise<number>;
|
|
43
|
+
/**
|
|
44
|
+
* Drives the bell badge. Archived notifications are excluded even when still
|
|
45
|
+
* unread, otherwise archiving would leave the badge lit forever.
|
|
46
|
+
*/
|
|
40
47
|
countUnreadNotifications(recipientMemberId: string): Promise<number>;
|
|
41
48
|
markAllNotificationsRead({ recipientMemberId, }: {
|
|
42
49
|
readonly recipientMemberId: string;
|
|
@@ -45,6 +52,20 @@ export declare class NotificationService {
|
|
|
45
52
|
readonly id: string;
|
|
46
53
|
readonly readerMemberId: string | null;
|
|
47
54
|
}): Promise<NotificationEntity>;
|
|
55
|
+
/**
|
|
56
|
+
* Archiving is an independent dimension from read state: it removes the
|
|
57
|
+
* notification from the member's default list while keeping the row for
|
|
58
|
+
* statistics and audits.
|
|
59
|
+
*/
|
|
60
|
+
archiveNotifications({ ids, memberId, }: {
|
|
61
|
+
readonly ids: readonly string[];
|
|
62
|
+
readonly memberId: string;
|
|
63
|
+
}): Promise<number>;
|
|
64
|
+
unarchiveNotifications({ ids, memberId, }: {
|
|
65
|
+
readonly ids: readonly string[];
|
|
66
|
+
readonly memberId: string;
|
|
67
|
+
}): Promise<number>;
|
|
68
|
+
private updateArchivedAt;
|
|
48
69
|
getPreference(memberId: string): Promise<NotificationPreferenceEntity>;
|
|
49
70
|
updatePreference(input: UpdateNotificationPreferenceInput): Promise<NotificationPreferenceEntity>;
|
|
50
71
|
createTaskAssignedNotification({ instance, manager, node, task, transferred, }: {
|
|
@@ -107,6 +128,17 @@ export declare class NotificationService {
|
|
|
107
128
|
private tryClaimSlaTask;
|
|
108
129
|
private createSlaNotificationOnce;
|
|
109
130
|
private createNotifications;
|
|
131
|
+
/**
|
|
132
|
+
* Tells a host-provided observer about rows that were just written, for
|
|
133
|
+
* every channel — `IN_APP` included, which the delivery path skips because
|
|
134
|
+
* it has nothing to deliver.
|
|
135
|
+
*
|
|
136
|
+
* Errors are logged and dropped: this runs inside whatever transaction the
|
|
137
|
+
* engine is in, and a host's realtime push must not be able to roll back an
|
|
138
|
+
* approval.
|
|
139
|
+
*/
|
|
140
|
+
private notifyObserver;
|
|
141
|
+
private readHostObserver;
|
|
110
142
|
private recordSlaActivity;
|
|
111
143
|
private runSlaTimeoutHook;
|
|
112
144
|
private executeSlaTimeoutAction;
|
|
@@ -114,6 +146,14 @@ export declare class NotificationService {
|
|
|
114
146
|
private resolveTaskRecipientMemberIds;
|
|
115
147
|
private resolveEscalationTargetMemberId;
|
|
116
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Adds a node's SLA duration to `now` as plain elapsed time.
|
|
151
|
+
*
|
|
152
|
+
* @deprecated Since 0.7.0 the engine schedules through
|
|
153
|
+
* `BPMSlaScheduleService.resolveTaskSlaDueAt`, which additionally honours
|
|
154
|
+
* `SlaConfig.calendar: 'BUSINESS_DAY'`. This function is kept for hosts that
|
|
155
|
+
* called it directly and always behaves as `CALENDAR` mode.
|
|
156
|
+
*/
|
|
117
157
|
export declare function calculateTaskSlaDueAt({ node, now, }: {
|
|
118
158
|
readonly node: UserTaskNode;
|
|
119
159
|
readonly now: Date;
|
|
@@ -25,6 +25,7 @@ const ACTIONABLE_NOTIFICATION_TYPES = [
|
|
|
25
25
|
notification_enums_1.NotificationTypeEnum.TASK_TRANSFERRED,
|
|
26
26
|
];
|
|
27
27
|
const notification_options_1 = require("./notification-options");
|
|
28
|
+
const notification_observer_token_1 = require("./notification-observer.token");
|
|
28
29
|
const notification_template_1 = require("./notification-template");
|
|
29
30
|
let NotificationService = NotificationService_1 = class NotificationService {
|
|
30
31
|
constructor(notificationRepository, notificationPreferenceRepository, taskRepository, taskCandidateRepository, approvalInstanceRepository, activityLogRepository, deliveryService, moduleRef, notificationOptions = notification_options_1.DEFAULT_BPM_NOTIFICATION_OPTIONS) {
|
|
@@ -39,9 +40,9 @@ let NotificationService = NotificationService_1 = class NotificationService {
|
|
|
39
40
|
this.notificationOptions = notificationOptions;
|
|
40
41
|
this.logger = new common_1.Logger(NotificationService_1.name);
|
|
41
42
|
}
|
|
42
|
-
async listNotifications({ includeRead = false, page = 1, pageSize = 10, recipientMemberId, }) {
|
|
43
|
+
async listNotifications({ includeArchived = false, includeRead = false, page = 1, pageSize = 10, recipientMemberId, }) {
|
|
43
44
|
const normalizedPageSize = normalizePageSize(pageSize);
|
|
44
|
-
|
|
45
|
+
const notifications = await this.notificationRepository.find({
|
|
45
46
|
order: { createdAt: 'DESC' },
|
|
46
47
|
skip: (normalizePage(page) - 1) * normalizedPageSize,
|
|
47
48
|
take: normalizedPageSize,
|
|
@@ -49,21 +50,69 @@ let NotificationService = NotificationService_1 = class NotificationService {
|
|
|
49
50
|
channel: notification_enums_1.NotificationChannelEnum.IN_APP,
|
|
50
51
|
recipientMemberId,
|
|
51
52
|
...(includeRead ? {} : { status: (0, typeorm_2.Not)(notification_enums_1.NotificationStatusEnum.READ) }),
|
|
53
|
+
...(includeArchived ? {} : { archivedAt: (0, typeorm_2.IsNull)() }),
|
|
52
54
|
},
|
|
53
55
|
});
|
|
56
|
+
return this.attachLegacyTaskPolicies(notifications);
|
|
54
57
|
}
|
|
55
|
-
async
|
|
58
|
+
async attachLegacyTaskPolicies(notifications) {
|
|
59
|
+
const legacyNotifications = notifications.filter((notification) => notification.actionable &&
|
|
60
|
+
notification.taskId !== null &&
|
|
61
|
+
typeof notification.payload?.allowReject !== 'boolean');
|
|
62
|
+
if (legacyNotifications.length === 0) {
|
|
63
|
+
return notifications;
|
|
64
|
+
}
|
|
65
|
+
const tasks = await this.taskRepository.find({
|
|
66
|
+
where: {
|
|
67
|
+
id: (0, typeorm_2.In)(legacyNotifications.flatMap((notification) => notification.taskId === null ? [] : [notification.taskId])),
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
if (tasks.length === 0) {
|
|
71
|
+
return notifications;
|
|
72
|
+
}
|
|
73
|
+
const instances = await this.approvalInstanceRepository.find({
|
|
74
|
+
where: {
|
|
75
|
+
id: (0, typeorm_2.In)([...new Set(tasks.map((task) => task.instanceId))]),
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const tasksById = new Map(tasks.map((task) => [task.id, task]));
|
|
79
|
+
const instancesById = new Map(instances.map((instance) => [instance.id, instance]));
|
|
80
|
+
return notifications.map((notification) => {
|
|
81
|
+
if (notification.taskId === null) {
|
|
82
|
+
return notification;
|
|
83
|
+
}
|
|
84
|
+
const task = tasksById.get(notification.taskId);
|
|
85
|
+
if (!task) {
|
|
86
|
+
return notification;
|
|
87
|
+
}
|
|
88
|
+
const instance = instancesById.get(task.instanceId);
|
|
89
|
+
const node = instance ? readUserTaskNode(instance, task.nodeId) : null;
|
|
90
|
+
if (!node) {
|
|
91
|
+
return notification;
|
|
92
|
+
}
|
|
93
|
+
return Object.assign(new notification_entity_1.NotificationEntity(), notification, {
|
|
94
|
+
allowReject: node.data.allowReject !== false,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async countNotifications({ includeArchived = false, includeRead = false, recipientMemberId, }) {
|
|
56
99
|
return this.notificationRepository.count({
|
|
57
100
|
where: {
|
|
58
101
|
channel: notification_enums_1.NotificationChannelEnum.IN_APP,
|
|
59
102
|
recipientMemberId,
|
|
60
103
|
...(includeRead ? {} : { status: (0, typeorm_2.Not)(notification_enums_1.NotificationStatusEnum.READ) }),
|
|
104
|
+
...(includeArchived ? {} : { archivedAt: (0, typeorm_2.IsNull)() }),
|
|
61
105
|
},
|
|
62
106
|
});
|
|
63
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Drives the bell badge. Archived notifications are excluded even when still
|
|
110
|
+
* unread, otherwise archiving would leave the badge lit forever.
|
|
111
|
+
*/
|
|
64
112
|
async countUnreadNotifications(recipientMemberId) {
|
|
65
113
|
return this.notificationRepository.count({
|
|
66
114
|
where: {
|
|
115
|
+
archivedAt: (0, typeorm_2.IsNull)(),
|
|
67
116
|
channel: notification_enums_1.NotificationChannelEnum.IN_APP,
|
|
68
117
|
recipientMemberId,
|
|
69
118
|
status: (0, typeorm_2.Not)(notification_enums_1.NotificationStatusEnum.READ),
|
|
@@ -102,6 +151,30 @@ let NotificationService = NotificationService_1 = class NotificationService {
|
|
|
102
151
|
status: notification_enums_1.NotificationStatusEnum.READ,
|
|
103
152
|
}));
|
|
104
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Archiving is an independent dimension from read state: it removes the
|
|
156
|
+
* notification from the member's default list while keeping the row for
|
|
157
|
+
* statistics and audits.
|
|
158
|
+
*/
|
|
159
|
+
async archiveNotifications({ ids, memberId, }) {
|
|
160
|
+
return this.updateArchivedAt({ archivedAt: new Date(), ids, memberId });
|
|
161
|
+
}
|
|
162
|
+
async unarchiveNotifications({ ids, memberId, }) {
|
|
163
|
+
return this.updateArchivedAt({ archivedAt: null, ids, memberId });
|
|
164
|
+
}
|
|
165
|
+
async updateArchivedAt({ archivedAt, ids, memberId, }) {
|
|
166
|
+
const trimmedMemberId = memberId.trim();
|
|
167
|
+
const targetIds = [...new Set(ids.filter((id) => id.trim().length > 0))];
|
|
168
|
+
if (!trimmedMemberId || targetIds.length === 0) {
|
|
169
|
+
return 0;
|
|
170
|
+
}
|
|
171
|
+
const result = await this.notificationRepository.update({
|
|
172
|
+
archivedAt: archivedAt === null ? (0, typeorm_2.Not)((0, typeorm_2.IsNull)()) : (0, typeorm_2.IsNull)(),
|
|
173
|
+
id: (0, typeorm_2.In)(targetIds),
|
|
174
|
+
recipientMemberId: trimmedMemberId,
|
|
175
|
+
}, { archivedAt });
|
|
176
|
+
return result.affected ?? 0;
|
|
177
|
+
}
|
|
105
178
|
async getPreference(memberId) {
|
|
106
179
|
const existingPreference = await this.notificationPreferenceRepository.findOne({
|
|
107
180
|
where: { memberId },
|
|
@@ -131,6 +204,7 @@ let NotificationService = NotificationService_1 = class NotificationService {
|
|
|
131
204
|
instanceId: instance.id,
|
|
132
205
|
payload: {
|
|
133
206
|
assigneeMemberId: task.assigneeMemberId,
|
|
207
|
+
allowReject: node.data.allowReject !== false,
|
|
134
208
|
instanceId: instance.id,
|
|
135
209
|
instanceTitle: instance.title,
|
|
136
210
|
nodeId: node.id,
|
|
@@ -457,8 +531,44 @@ let NotificationService = NotificationService_1 = class NotificationService {
|
|
|
457
531
|
.map((notification) => manager
|
|
458
532
|
? Promise.resolve(false)
|
|
459
533
|
: this.deliveryService.deliverNotification(notification, this.notificationOptions)));
|
|
534
|
+
await this.notifyObserver(input, savedNotifications, manager);
|
|
460
535
|
return savedNotifications;
|
|
461
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* Tells a host-provided observer about rows that were just written, for
|
|
539
|
+
* every channel — `IN_APP` included, which the delivery path skips because
|
|
540
|
+
* it has nothing to deliver.
|
|
541
|
+
*
|
|
542
|
+
* Errors are logged and dropped: this runs inside whatever transaction the
|
|
543
|
+
* engine is in, and a host's realtime push must not be able to roll back an
|
|
544
|
+
* approval.
|
|
545
|
+
*/
|
|
546
|
+
async notifyObserver(input, notifications, manager) {
|
|
547
|
+
const observer = this.readHostObserver();
|
|
548
|
+
if (!observer) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
try {
|
|
552
|
+
await observer.onNotificationsCreated({
|
|
553
|
+
instanceId: input.instanceId,
|
|
554
|
+
notifications,
|
|
555
|
+
taskId: input.taskId,
|
|
556
|
+
type: input.type,
|
|
557
|
+
...(manager ? { manager } : {}),
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
catch (error) {
|
|
561
|
+
this.logger.error(`BPM_NOTIFICATION_OBSERVER failed for ${notifications.length} notification(s)`, error instanceof Error ? error.stack : String(error));
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
readHostObserver() {
|
|
565
|
+
try {
|
|
566
|
+
return this.moduleRef.get(notification_observer_token_1.BPM_NOTIFICATION_OBSERVER, { strict: false });
|
|
567
|
+
}
|
|
568
|
+
catch {
|
|
569
|
+
return null;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
462
572
|
async recordSlaActivity({ instance, node, task, trigger, }) {
|
|
463
573
|
await this.activityLogRepository.save(this.activityLogRepository.create({
|
|
464
574
|
actorMemberId: null,
|
|
@@ -504,6 +614,13 @@ let NotificationService = NotificationService_1 = class NotificationService {
|
|
|
504
614
|
return;
|
|
505
615
|
}
|
|
506
616
|
if (timeoutAction === 'ESCALATE') {
|
|
617
|
+
// Escalation moves the work onto a new task that keeps the (already
|
|
618
|
+
// elapsed) due date, so without this guard the next scan would escalate
|
|
619
|
+
// it again, one management level per scan.
|
|
620
|
+
if (hasSlaEscalationStep(task)) {
|
|
621
|
+
this.logger.log(`SLA escalation already applied for task ${task.id}; skipping.`);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
507
624
|
const actorMemberId = await this.resolveTaskActorMemberId(task);
|
|
508
625
|
const targetMemberId = await this.resolveEscalationTargetMemberId({
|
|
509
626
|
actorMemberId,
|
|
@@ -519,7 +636,7 @@ let NotificationService = NotificationService_1 = class NotificationService {
|
|
|
519
636
|
decidedByMemberId: actorMemberId,
|
|
520
637
|
taskId: task.id,
|
|
521
638
|
transferToMemberId: targetMemberId,
|
|
522
|
-
});
|
|
639
|
+
}, { transferReason: notification_enums_1.SLA_ESCALATION_DELEGATION_REASON });
|
|
523
640
|
return;
|
|
524
641
|
}
|
|
525
642
|
await workflowEngine.cancelApprovalInstance({
|
|
@@ -587,6 +704,14 @@ exports.NotificationService = NotificationService = NotificationService_1 = tsli
|
|
|
587
704
|
notification_delivery_service_1.NotificationDeliveryService,
|
|
588
705
|
core_1.ModuleRef, Object])
|
|
589
706
|
], NotificationService);
|
|
707
|
+
/**
|
|
708
|
+
* Adds a node's SLA duration to `now` as plain elapsed time.
|
|
709
|
+
*
|
|
710
|
+
* @deprecated Since 0.7.0 the engine schedules through
|
|
711
|
+
* `BPMSlaScheduleService.resolveTaskSlaDueAt`, which additionally honours
|
|
712
|
+
* `SlaConfig.calendar: 'BUSINESS_DAY'`. This function is kept for hosts that
|
|
713
|
+
* called it directly and always behaves as `CALENDAR` mode.
|
|
714
|
+
*/
|
|
590
715
|
function calculateTaskSlaDueAt({ node, now, }) {
|
|
591
716
|
const duration = node.data.sla?.duration;
|
|
592
717
|
if (!duration) {
|
|
@@ -653,6 +778,9 @@ function isChannelEnabled(channel, preference, options) {
|
|
|
653
778
|
}
|
|
654
779
|
return options.webhookEnabled;
|
|
655
780
|
}
|
|
781
|
+
function hasSlaEscalationStep(task) {
|
|
782
|
+
return task.delegationChain.some((step) => step['reason'] === notification_enums_1.SLA_ESCALATION_DELEGATION_REASON);
|
|
783
|
+
}
|
|
656
784
|
function isSlaTimeoutActionEnabled(action, options) {
|
|
657
785
|
if (action === 'AUTO_APPROVE') {
|
|
658
786
|
return options.slaTimeoutAutoApproveEnabled;
|
|
@@ -674,6 +802,9 @@ function createNotificationEntity({ channel, input, options, repository, }) {
|
|
|
674
802
|
});
|
|
675
803
|
const isInApp = channel === notification_enums_1.NotificationChannelEnum.IN_APP;
|
|
676
804
|
return repository.create({
|
|
805
|
+
allowReject: typeof input.payload.allowReject === 'boolean'
|
|
806
|
+
? input.payload.allowReject
|
|
807
|
+
: null,
|
|
677
808
|
attemptCount: 0,
|
|
678
809
|
body: renderedTemplate.body,
|
|
679
810
|
channel,
|