@rytass/bpm-core-shared 0.18.0 → 0.19.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.
@@ -93,6 +93,26 @@ export type ApproverResolver = {
93
93
  } | {
94
94
  readonly expression: string;
95
95
  readonly type: 'EXPRESSION';
96
+ } | {
97
+ readonly fallback?: ApproverResolverFallback;
98
+ readonly formPath: string;
99
+ readonly levelsUp: number;
100
+ readonly preferClosestOrgUnit?: boolean;
101
+ readonly type: 'FORM_MEMBER_MANAGER';
102
+ } | {
103
+ readonly fallback?: ApproverResolverFallback;
104
+ readonly formPath: string;
105
+ readonly preferClosestOrgUnit?: boolean;
106
+ readonly type: 'FORM_ORG_UNIT_MANAGER';
107
+ } | {
108
+ readonly nodeIds: readonly string[];
109
+ readonly type: 'NODE_ACTOR';
110
+ } | {
111
+ readonly fallback?: ApproverResolverFallback;
112
+ readonly levelsUp: number;
113
+ readonly nodeIds: readonly string[];
114
+ readonly preferClosestOrgUnit?: boolean;
115
+ readonly type: 'NODE_ACTOR_MANAGER';
96
116
  };
97
117
  export type ApproverResolverFallback = {
98
118
  readonly type: 'NONE';
@@ -103,8 +123,10 @@ export type ApproverResolverFallback = {
103
123
  } | {
104
124
  /**
105
125
  * Members of this position, resolved the way a POSITION node resolves
106
- * them at the moment the node starts. Only ORG_MANAGER, ORG_UNIT_MANAGER
107
- * and ORG_MANAGER_CHAIN take it. Older engines reject it at run time.
126
+ * them at the moment the node starts. Only the manager resolvers take
127
+ * it: ORG_MANAGER, ORG_UNIT_MANAGER, ORG_MANAGER_CHAIN,
128
+ * FORM_MEMBER_MANAGER, FORM_ORG_UNIT_MANAGER and NODE_ACTOR_MANAGER.
129
+ * Older engines reject it at run time.
108
130
  */
109
131
  readonly allowInitiatorSelfApproval?: boolean;
110
132
  readonly positionId: string;
@@ -120,6 +142,20 @@ export type ApproverResolverFallback = {
120
142
  export declare function readUnsupportedApproverFallbackType(fallback: {
121
143
  readonly type: string;
122
144
  }): string | null;
145
+ /**
146
+ * The resolver's type when this build does not know it (a definition saved by
147
+ * a newer version), or `null` when it does. Takes a bare `type` so a newer
148
+ * definition can be checked without the compiler having narrowed it away.
149
+ * The engine refuses such a resolver at run time instead of guessing; the
150
+ * designer keeps it untouched and shows it read-only.
151
+ */
152
+ export declare function readUnsupportedApproverResolverType(resolver: {
153
+ readonly type: string;
154
+ }): string | null;
155
+ /** Whether a notify node may use this resolver type for its recipients. */
156
+ export declare function isNotifyRecipientResolverType(type: string): boolean;
157
+ /** Whether a resolver of this type may carry a "no manager" fallback. */
158
+ export declare function isFallbackCapableApproverResolverType(type: string): boolean;
123
159
  export type DecisionPolicy = {
124
160
  readonly type: 'SINGLE';
125
161
  } | {
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readUnsupportedApproverFallbackType = readUnsupportedApproverFallbackType;
4
+ exports.readUnsupportedApproverResolverType = readUnsupportedApproverResolverType;
5
+ exports.isNotifyRecipientResolverType = isNotifyRecipientResolverType;
6
+ exports.isFallbackCapableApproverResolverType = isFallbackCapableApproverResolverType;
4
7
  // Keyed by the union so that adding a fallback type fails to compile until it
5
8
  // is listed here: the engine and the designer both read this one table.
6
9
  const KNOWN_APPROVER_FALLBACK_TYPES = {
@@ -20,4 +23,66 @@ function readUnsupportedApproverFallbackType(fallback) {
20
23
  ? null
21
24
  : fallback.type;
22
25
  }
26
+ // Keyed by the union so that adding a resolver type fails to compile until it
27
+ // is listed here: the engine and the designer both read this one table.
28
+ const KNOWN_APPROVER_RESOLVER_TYPES = {
29
+ DIRECT: true,
30
+ DYNAMIC_FORM: true,
31
+ EXPRESSION: true,
32
+ FORM_MEMBER_MANAGER: true,
33
+ FORM_ORG_UNIT_MANAGER: true,
34
+ NODE_ACTOR: true,
35
+ NODE_ACTOR_MANAGER: true,
36
+ ORG_MANAGER: true,
37
+ ORG_MANAGER_CHAIN: true,
38
+ ORG_UNIT_MANAGER: true,
39
+ ORG_UNIT_MEMBER: true,
40
+ ORG_UNIT_POSITION: true,
41
+ POSITION: true,
42
+ };
43
+ // A notify node's recipients are resolved without a running approval path, so
44
+ // the sources that need a form pick or earlier signers are not offered there.
45
+ const NOTIFY_RECIPIENT_RESOLVER_TYPES = {
46
+ DIRECT: true,
47
+ DYNAMIC_FORM: true,
48
+ EXPRESSION: true,
49
+ ORG_MANAGER: true,
50
+ ORG_MANAGER_CHAIN: true,
51
+ ORG_UNIT_MANAGER: true,
52
+ ORG_UNIT_MEMBER: true,
53
+ ORG_UNIT_POSITION: true,
54
+ POSITION: true,
55
+ };
56
+ // Resolvers that look a manager up, so "no manager" is a state they can reach.
57
+ const FALLBACK_CAPABLE_RESOLVER_TYPES = {
58
+ FORM_MEMBER_MANAGER: true,
59
+ FORM_ORG_UNIT_MANAGER: true,
60
+ NODE_ACTOR_MANAGER: true,
61
+ ORG_MANAGER: true,
62
+ ORG_MANAGER_CHAIN: true,
63
+ ORG_UNIT_MANAGER: true,
64
+ };
65
+ function hasOwnKey(table, key) {
66
+ return Object.prototype.hasOwnProperty.call(table, key);
67
+ }
68
+ /**
69
+ * The resolver's type when this build does not know it (a definition saved by
70
+ * a newer version), or `null` when it does. Takes a bare `type` so a newer
71
+ * definition can be checked without the compiler having narrowed it away.
72
+ * The engine refuses such a resolver at run time instead of guessing; the
73
+ * designer keeps it untouched and shows it read-only.
74
+ */
75
+ function readUnsupportedApproverResolverType(resolver) {
76
+ return hasOwnKey(KNOWN_APPROVER_RESOLVER_TYPES, resolver.type)
77
+ ? null
78
+ : resolver.type;
79
+ }
80
+ /** Whether a notify node may use this resolver type for its recipients. */
81
+ function isNotifyRecipientResolverType(type) {
82
+ return hasOwnKey(NOTIFY_RECIPIENT_RESOLVER_TYPES, type);
83
+ }
84
+ /** Whether a resolver of this type may carry a "no manager" fallback. */
85
+ function isFallbackCapableApproverResolverType(type) {
86
+ return hasOwnKey(FALLBACK_CAPABLE_RESOLVER_TYPES, type);
87
+ }
23
88
  //# sourceMappingURL=workflow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../../../libs/shared/src/lib/workflow.ts"],"names":[],"mappings":";;AA6JA,kFASC;AA1BD,8EAA8E;AAC9E,wEAAwE;AACxE,MAAM,6BAA6B,GAE/B;IACF,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,mCAAmC,CAAC,QAEnD;IACC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CACzC,6BAA6B,EAC7B,QAAQ,CAAC,IAAI,CACd;QACC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;AACpB,CAAC"}
1
+ {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../../../libs/shared/src/lib/workflow.ts"],"names":[],"mappings":";;AAoLA,kFASC;AAyED,kFAMC;AAGD,sEAEC;AAGD,sFAEC;AAnHD,8EAA8E;AAC9E,wEAAwE;AACxE,MAAM,6BAA6B,GAE/B;IACF,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,mCAAmC,CAAC,QAEnD;IACC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CACzC,6BAA6B,EAC7B,QAAQ,CAAC,IAAI,CACd;QACC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,8EAA8E;AAC9E,wEAAwE;AACxE,MAAM,6BAA6B,GAE/B;IACF,MAAM,EAAE,IAAI;IACZ,YAAY,EAAE,IAAI;IAClB,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,qBAAqB,EAAE,IAAI;IAC3B,UAAU,EAAE,IAAI;IAChB,k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