@rytass/bpm-core-nestjs-module 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (612) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +21 -0
  3. package/README.md +143 -0
  4. package/package.json +3 -3
  5. package/src/index.js +18 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/attachment/attachment-options.d.ts +44 -0
  8. package/src/lib/attachment/attachment-options.js +62 -0
  9. package/src/lib/attachment/attachment-options.js.map +1 -0
  10. package/src/lib/attachment/attachment-storage.provider.d.ts +4 -0
  11. package/src/lib/attachment/attachment-storage.provider.js +35 -0
  12. package/src/lib/attachment/attachment-storage.provider.js.map +1 -0
  13. package/src/lib/attachment/{attachment-storage.token.ts → attachment-storage.token.d.ts} +1 -3
  14. package/src/lib/attachment/attachment-storage.token.js +5 -0
  15. package/src/lib/attachment/attachment-storage.token.js.map +1 -0
  16. package/src/lib/attachment/attachment.controller.d.ts +8 -0
  17. package/src/lib/attachment/attachment.controller.js +38 -0
  18. package/src/lib/attachment/attachment.controller.js.map +1 -0
  19. package/src/lib/attachment/attachment.entity.d.ts +14 -0
  20. package/src/lib/attachment/attachment.entity.js +74 -0
  21. package/src/lib/attachment/attachment.entity.js.map +1 -0
  22. package/src/lib/attachment/attachment.module.d.ts +27 -0
  23. package/src/lib/attachment/attachment.module.js +103 -0
  24. package/src/lib/attachment/attachment.module.js.map +1 -0
  25. package/src/lib/attachment/attachment.mutations.d.ts +8 -0
  26. package/src/lib/attachment/attachment.mutations.js +35 -0
  27. package/src/lib/attachment/attachment.mutations.js.map +1 -0
  28. package/src/lib/attachment/attachment.queries.d.ts +9 -0
  29. package/src/lib/attachment/attachment.queries.js +78 -0
  30. package/src/lib/attachment/attachment.queries.js.map +1 -0
  31. package/src/lib/attachment/attachment.service.d.ts +49 -0
  32. package/src/lib/attachment/attachment.service.js +276 -0
  33. package/src/lib/attachment/attachment.service.js.map +1 -0
  34. package/src/lib/attachment/dto/upload-attachment.input.d.ts +11 -0
  35. package/src/lib/attachment/dto/upload-attachment.input.js +68 -0
  36. package/src/lib/attachment/dto/upload-attachment.input.js.map +1 -0
  37. package/src/lib/attachment/index.js +9 -0
  38. package/src/lib/attachment/index.js.map +1 -0
  39. package/src/lib/bpm/bpm-root.module.d.ts +155 -0
  40. package/src/lib/bpm/bpm-root.module.js +170 -0
  41. package/src/lib/bpm/bpm-root.module.js.map +1 -0
  42. package/src/lib/bpm/index.js +5 -0
  43. package/src/lib/bpm/index.js.map +1 -0
  44. package/src/lib/bpm-auth/bpm-auth-context.d.ts +24 -0
  45. package/src/lib/bpm-auth/bpm-auth-context.extractor.d.ts +4 -0
  46. package/src/lib/bpm-auth/bpm-auth-context.extractor.js +69 -0
  47. package/src/lib/bpm-auth/bpm-auth-context.extractor.js.map +1 -0
  48. package/src/lib/bpm-auth/bpm-auth-context.js +15 -0
  49. package/src/lib/bpm-auth/bpm-auth-context.js.map +1 -0
  50. package/src/lib/bpm-auth/bpm-auth.authorization.d.ts +12 -0
  51. package/src/lib/bpm-auth/bpm-auth.authorization.js +67 -0
  52. package/src/lib/bpm-auth/bpm-auth.authorization.js.map +1 -0
  53. package/src/lib/bpm-auth/bpm-auth.decorators.d.ts +3 -0
  54. package/src/lib/bpm-auth/bpm-auth.decorators.js +11 -0
  55. package/src/lib/bpm-auth/bpm-auth.decorators.js.map +1 -0
  56. package/src/lib/bpm-auth/bpm-auth.guard.d.ts +7 -0
  57. package/src/lib/bpm-auth/bpm-auth.guard.js +24 -0
  58. package/src/lib/bpm-auth/bpm-auth.guard.js.map +1 -0
  59. package/src/lib/bpm-auth/bpm-auth.module.d.ts +6 -0
  60. package/src/lib/bpm-auth/bpm-auth.module.js +69 -0
  61. package/src/lib/bpm-auth/bpm-auth.module.js.map +1 -0
  62. package/src/lib/bpm-auth/bpm-auth.options.d.ts +11 -0
  63. package/src/lib/bpm-auth/bpm-auth.options.js +3 -0
  64. package/src/lib/bpm-auth/bpm-auth.options.js.map +1 -0
  65. package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.d.ts +10 -0
  66. package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.js +40 -0
  67. package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.js.map +1 -0
  68. package/src/lib/bpm-auth/index.js +10 -0
  69. package/src/lib/bpm-auth/index.js.map +1 -0
  70. package/src/lib/common/filters/all-exceptions.filter.d.ts +25 -0
  71. package/src/lib/common/filters/all-exceptions.filter.js +93 -0
  72. package/src/lib/common/filters/all-exceptions.filter.js.map +1 -0
  73. package/src/lib/common/index.js +5 -0
  74. package/src/lib/common/index.js.map +1 -0
  75. package/src/lib/common/iso-duration.d.ts +1 -0
  76. package/src/lib/common/iso-duration.js +27 -0
  77. package/src/lib/common/iso-duration.js.map +1 -0
  78. package/src/lib/condition/condition.module.d.ts +2 -0
  79. package/src/lib/condition/condition.module.js +16 -0
  80. package/src/lib/condition/condition.module.js.map +1 -0
  81. package/src/lib/condition/condition.service.d.ts +16 -0
  82. package/src/lib/condition/condition.service.js +82 -0
  83. package/src/lib/condition/condition.service.js.map +1 -0
  84. package/src/lib/condition/index.js +6 -0
  85. package/src/lib/condition/index.js.map +1 -0
  86. package/src/lib/database/data-source.d.ts +4 -0
  87. package/src/lib/database/data-source.js +7 -0
  88. package/src/lib/database/data-source.js.map +1 -0
  89. package/src/lib/database/index.js +6 -0
  90. package/src/lib/database/index.js.map +1 -0
  91. package/src/lib/database/migration-runner.d.ts +1 -0
  92. package/src/lib/database/migration-runner.js +23 -0
  93. package/src/lib/database/migration-runner.js.map +1 -0
  94. package/src/lib/database/typeorm.config.d.ts +14 -0
  95. package/src/lib/database/typeorm.config.js +135 -0
  96. package/src/lib/database/typeorm.config.js.map +1 -0
  97. package/src/lib/delegation/delegation-rule.entity.d.ts +19 -0
  98. package/src/lib/delegation/delegation-rule.entity.js +99 -0
  99. package/src/lib/delegation/delegation-rule.entity.js.map +1 -0
  100. package/src/lib/delegation/delegation.enums.d.ts +10 -0
  101. package/src/lib/delegation/delegation.enums.js +23 -0
  102. package/src/lib/delegation/delegation.enums.js.map +1 -0
  103. package/src/lib/delegation/delegation.module.d.ts +2 -0
  104. package/src/lib/delegation/delegation.module.js +22 -0
  105. package/src/lib/delegation/delegation.module.js.map +1 -0
  106. package/src/lib/delegation/delegation.mutations.d.ts +11 -0
  107. package/src/lib/delegation/delegation.mutations.js +87 -0
  108. package/src/lib/delegation/delegation.mutations.js.map +1 -0
  109. package/src/lib/delegation/delegation.queries.d.ts +10 -0
  110. package/src/lib/delegation/delegation.queries.js +91 -0
  111. package/src/lib/delegation/delegation.queries.js.map +1 -0
  112. package/src/lib/delegation/delegation.service.d.ts +56 -0
  113. package/src/lib/delegation/delegation.service.js +268 -0
  114. package/src/lib/delegation/delegation.service.js.map +1 -0
  115. package/src/lib/delegation/dto/delegation-rule.input.d.ts +24 -0
  116. package/src/lib/delegation/dto/delegation-rule.input.js +143 -0
  117. package/src/lib/delegation/dto/delegation-rule.input.js.map +1 -0
  118. package/src/lib/delegation/index.js +9 -0
  119. package/src/lib/delegation/index.js.map +1 -0
  120. package/src/lib/form/dto/form-definition.input.d.ts +21 -0
  121. package/src/lib/form/dto/form-definition.input.js +103 -0
  122. package/src/lib/form/dto/form-definition.input.js.map +1 -0
  123. package/src/lib/form/form-definition-version.entity.d.ts +17 -0
  124. package/src/lib/form/form-definition-version.entity.js +84 -0
  125. package/src/lib/form/form-definition-version.entity.js.map +1 -0
  126. package/src/lib/form/form-definition.entity.d.ts +13 -0
  127. package/src/lib/form/form-definition.entity.js +66 -0
  128. package/src/lib/form/form-definition.entity.js.map +1 -0
  129. package/src/lib/form/form-schema-lint.object.d.ts +4 -0
  130. package/src/lib/form/form-schema-lint.object.js +20 -0
  131. package/src/lib/form/form-schema-lint.object.js.map +1 -0
  132. package/src/lib/form/form-schema.validator.d.ts +13 -0
  133. package/src/lib/form/form-schema.validator.js +354 -0
  134. package/src/lib/form/form-schema.validator.js.map +1 -0
  135. package/src/lib/form/form.enums.d.ts +9 -0
  136. package/src/lib/form/form.enums.js +22 -0
  137. package/src/lib/form/form.enums.js.map +1 -0
  138. package/src/lib/form/form.module.d.ts +2 -0
  139. package/src/lib/form/form.module.js +27 -0
  140. package/src/lib/form/form.module.js.map +1 -0
  141. package/src/lib/form/form.mutations.d.ts +14 -0
  142. package/src/lib/form/form.mutations.js +88 -0
  143. package/src/lib/form/form.mutations.js.map +1 -0
  144. package/src/lib/form/form.queries.d.ts +16 -0
  145. package/src/lib/form/form.queries.js +96 -0
  146. package/src/lib/form/form.queries.js.map +1 -0
  147. package/src/lib/form/form.service.d.ts +35 -0
  148. package/src/lib/form/form.service.js +297 -0
  149. package/src/lib/form/form.service.js.map +1 -0
  150. package/src/lib/form/index.js +12 -0
  151. package/src/lib/form/index.js.map +1 -0
  152. package/src/lib/identity/identity-options.d.ts +13 -0
  153. package/src/lib/identity/identity-options.js +20 -0
  154. package/src/lib/identity/identity-options.js.map +1 -0
  155. package/src/lib/identity/identity.module.d.ts +17 -0
  156. package/src/lib/identity/identity.module.js +65 -0
  157. package/src/lib/identity/identity.module.js.map +1 -0
  158. package/src/lib/identity/identity.queries.d.ts +12 -0
  159. package/src/lib/identity/identity.queries.js +79 -0
  160. package/src/lib/identity/identity.queries.js.map +1 -0
  161. package/src/lib/identity/identity.service.d.ts +22 -0
  162. package/src/lib/identity/identity.service.js +141 -0
  163. package/src/lib/identity/identity.service.js.map +1 -0
  164. package/src/lib/identity/index.js +7 -0
  165. package/src/lib/identity/index.js.map +1 -0
  166. package/src/lib/identity/member-base.adapter.d.ts +95 -0
  167. package/src/lib/identity/member-base.adapter.js +137 -0
  168. package/src/lib/identity/member-base.adapter.js.map +1 -0
  169. package/src/lib/identity/member-metadata-cache.entity.d.ts +8 -0
  170. package/src/lib/identity/member-metadata-cache.entity.js +39 -0
  171. package/src/lib/identity/member-metadata-cache.entity.js.map +1 -0
  172. package/src/lib/identity/member-profile.object.d.ts +8 -0
  173. package/src/lib/identity/member-profile.object.js +37 -0
  174. package/src/lib/identity/member-profile.object.js.map +1 -0
  175. package/src/lib/identity/member-resolver.interface.d.ts +79 -0
  176. package/src/lib/identity/member-resolver.interface.js +19 -0
  177. package/src/lib/identity/member-resolver.interface.js.map +1 -0
  178. package/src/lib/migrations/0000000000001-enable-postgres-extensions.d.ts +6 -0
  179. package/src/lib/migrations/0000000000001-enable-postgres-extensions.js +17 -0
  180. package/src/lib/migrations/0000000000001-enable-postgres-extensions.js.map +1 -0
  181. package/src/lib/migrations/0000000001000-identity-organization-foundation.d.ts +6 -0
  182. package/src/lib/migrations/{0000000001000-identity-organization-foundation.ts → 0000000001000-identity-organization-foundation.js} +29 -38
  183. package/src/lib/migrations/0000000001000-identity-organization-foundation.js.map +1 -0
  184. package/src/lib/migrations/0000000002000-form-builder-foundation.d.ts +6 -0
  185. package/src/lib/migrations/{0000000002000-form-builder-foundation.ts → 0000000002000-form-builder-foundation.js} +21 -22
  186. package/src/lib/migrations/0000000002000-form-builder-foundation.js.map +1 -0
  187. package/src/lib/migrations/0000000003000-approval-template-foundation.d.ts +6 -0
  188. package/src/lib/migrations/{0000000003000-approval-template-foundation.ts → 0000000003000-approval-template-foundation.js} +21 -24
  189. package/src/lib/migrations/0000000003000-approval-template-foundation.js.map +1 -0
  190. package/src/lib/migrations/0000000004000-workflow-engine-foundation.d.ts +6 -0
  191. package/src/lib/migrations/{0000000004000-workflow-engine-foundation.ts → 0000000004000-workflow-engine-foundation.js} +34 -46
  192. package/src/lib/migrations/0000000004000-workflow-engine-foundation.js.map +1 -0
  193. package/src/lib/migrations/0000000005000-delegation-rules.d.ts +6 -0
  194. package/src/lib/migrations/{0000000005000-delegation-rules.ts → 0000000005000-delegation-rules.js} +19 -20
  195. package/src/lib/migrations/0000000005000-delegation-rules.js.map +1 -0
  196. package/src/lib/migrations/0000000006000-notifications-sla.d.ts +6 -0
  197. package/src/lib/migrations/{0000000006000-notifications-sla.ts → 0000000006000-notifications-sla.js} +23 -26
  198. package/src/lib/migrations/0000000006000-notifications-sla.js.map +1 -0
  199. package/src/lib/migrations/0000000007000-signatures-attachments.d.ts +6 -0
  200. package/src/lib/migrations/{0000000007000-signatures-attachments.ts → 0000000007000-signatures-attachments.js} +27 -28
  201. package/src/lib/migrations/0000000007000-signatures-attachments.js.map +1 -0
  202. package/src/lib/migrations/0000000008000-approval-template-categories.d.ts +6 -0
  203. package/src/lib/migrations/{0000000008000-approval-template-categories.ts → 0000000008000-approval-template-categories.js} +25 -28
  204. package/src/lib/migrations/0000000008000-approval-template-categories.js.map +1 -0
  205. package/src/lib/migrations/0000000009000-task-candidates.d.ts +6 -0
  206. package/src/lib/migrations/{0000000009000-task-candidates.ts → 0000000009000-task-candidates.js} +23 -26
  207. package/src/lib/migrations/0000000009000-task-candidates.js.map +1 -0
  208. package/src/lib/migrations/0000000010000-notification-delivery-state.d.ts +6 -0
  209. package/src/lib/migrations/{0000000010000-notification-delivery-state.ts → 0000000010000-notification-delivery-state.js} +17 -16
  210. package/src/lib/migrations/0000000010000-notification-delivery-state.js.map +1 -0
  211. package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.d.ts +6 -0
  212. package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.js +22 -0
  213. package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.js.map +1 -0
  214. package/src/lib/migrations/0000000012000-notification-sla-idempotency.d.ts +6 -0
  215. package/src/lib/migrations/0000000012000-notification-sla-idempotency.js +21 -0
  216. package/src/lib/migrations/0000000012000-notification-sla-idempotency.js.map +1 -0
  217. package/src/lib/migrations/0000000013000-workflow-query-indexes.d.ts +6 -0
  218. package/src/lib/migrations/0000000013000-workflow-query-indexes.js +80 -0
  219. package/src/lib/migrations/0000000013000-workflow-query-indexes.js.map +1 -0
  220. package/src/lib/migrations/index.d.ts +16 -0
  221. package/src/lib/migrations/index.js +49 -0
  222. package/src/lib/migrations/index.js.map +1 -0
  223. package/src/lib/notification/dto/notification-preference.input.d.ts +9 -0
  224. package/src/lib/notification/dto/notification-preference.input.js +53 -0
  225. package/src/lib/notification/dto/notification-preference.input.js.map +1 -0
  226. package/src/lib/notification/index.js +11 -0
  227. package/src/lib/notification/index.js.map +1 -0
  228. package/src/lib/notification/notification-delivery-scheduler.service.d.ts +13 -0
  229. package/src/lib/notification/notification-delivery-scheduler.service.js +53 -0
  230. package/src/lib/notification/notification-delivery-scheduler.service.js.map +1 -0
  231. package/src/lib/notification/notification-delivery.service.d.ts +23 -0
  232. package/src/lib/notification/notification-delivery.service.js +245 -0
  233. package/src/lib/notification/notification-delivery.service.js.map +1 -0
  234. package/src/lib/notification/notification-dispatcher.token.d.ts +7 -0
  235. package/src/lib/notification/notification-dispatcher.token.js +5 -0
  236. package/src/lib/notification/notification-dispatcher.token.js.map +1 -0
  237. package/src/lib/notification/notification-options.d.ts +215 -0
  238. package/src/lib/notification/notification-options.js +128 -0
  239. package/src/lib/notification/notification-options.js.map +1 -0
  240. package/src/lib/notification/notification-options.module.d.ts +23 -0
  241. package/src/lib/notification/notification-options.module.js +41 -0
  242. package/src/lib/notification/notification-options.module.js.map +1 -0
  243. package/src/lib/notification/notification-preference.entity.d.ts +10 -0
  244. package/src/lib/notification/notification-preference.entity.js +50 -0
  245. package/src/lib/notification/notification-preference.entity.js.map +1 -0
  246. package/src/lib/notification/notification-sla-scheduler.service.d.ts +13 -0
  247. package/src/lib/notification/notification-sla-scheduler.service.js +51 -0
  248. package/src/lib/notification/notification-sla-scheduler.service.js.map +1 -0
  249. package/src/lib/notification/notification-template.d.ts +13 -0
  250. package/src/lib/notification/notification-template.js +61 -0
  251. package/src/lib/notification/notification-template.js.map +1 -0
  252. package/src/lib/notification/notification.entity.d.ts +23 -0
  253. package/src/lib/notification/notification.entity.js +122 -0
  254. package/src/lib/notification/notification.entity.js.map +1 -0
  255. package/src/lib/notification/notification.enums.d.ts +24 -0
  256. package/src/lib/notification/notification.enums.js +45 -0
  257. package/src/lib/notification/notification.enums.js.map +1 -0
  258. package/src/lib/notification/notification.module.d.ts +2 -0
  259. package/src/lib/notification/notification.module.js +45 -0
  260. package/src/lib/notification/notification.module.js.map +1 -0
  261. package/src/lib/notification/notification.mutations.d.ts +11 -0
  262. package/src/lib/notification/notification.mutations.js +64 -0
  263. package/src/lib/notification/notification.mutations.js.map +1 -0
  264. package/src/lib/notification/notification.queries.d.ts +11 -0
  265. package/src/lib/notification/notification.queries.js +77 -0
  266. package/src/lib/notification/notification.queries.js.map +1 -0
  267. package/src/lib/notification/notification.service.d.ts +81 -0
  268. package/src/lib/notification/notification.service.js +621 -0
  269. package/src/lib/notification/notification.service.js.map +1 -0
  270. package/src/lib/organization/dto/manager-resolution.input.d.ts +18 -0
  271. package/src/lib/organization/dto/manager-resolution.input.js +107 -0
  272. package/src/lib/organization/dto/manager-resolution.input.js.map +1 -0
  273. package/src/lib/organization/dto/membership.input.d.ts +16 -0
  274. package/src/lib/organization/dto/membership.input.js +99 -0
  275. package/src/lib/organization/dto/membership.input.js.map +1 -0
  276. package/src/lib/organization/dto/org-unit.input.d.ts +24 -0
  277. package/src/lib/organization/dto/org-unit.input.js +119 -0
  278. package/src/lib/organization/dto/org-unit.input.js.map +1 -0
  279. package/src/lib/organization/dto/position.input.d.ts +13 -0
  280. package/src/lib/organization/dto/position.input.js +70 -0
  281. package/src/lib/organization/dto/position.input.js.map +1 -0
  282. package/src/lib/organization/index.js +16 -0
  283. package/src/lib/organization/index.js.map +1 -0
  284. package/src/lib/organization/json-metadata.d.ts +1 -0
  285. package/src/lib/organization/json-metadata.js +14 -0
  286. package/src/lib/organization/json-metadata.js.map +1 -0
  287. package/src/lib/organization/manager-resolution.entity.d.ts +11 -0
  288. package/src/lib/organization/manager-resolution.entity.js +55 -0
  289. package/src/lib/organization/manager-resolution.entity.js.map +1 -0
  290. package/src/lib/organization/membership.entity.d.ts +11 -0
  291. package/src/lib/organization/membership.entity.js +60 -0
  292. package/src/lib/organization/membership.entity.js.map +1 -0
  293. package/src/lib/organization/org-unit-tree-commit-result.object.d.ts +4 -0
  294. package/src/lib/organization/org-unit-tree-commit-result.object.js +17 -0
  295. package/src/lib/organization/org-unit-tree-commit-result.object.js.map +1 -0
  296. package/src/lib/organization/org-unit.entity.d.ts +13 -0
  297. package/src/lib/organization/org-unit.entity.js +64 -0
  298. package/src/lib/organization/org-unit.entity.js.map +1 -0
  299. package/src/lib/organization/organization-summary.object.d.ts +6 -0
  300. package/src/lib/organization/organization-summary.object.js +28 -0
  301. package/src/lib/organization/organization-summary.object.js.map +1 -0
  302. package/src/lib/organization/organization.enums.d.ts +11 -0
  303. package/src/lib/organization/organization.enums.js +22 -0
  304. package/src/lib/organization/organization.enums.js.map +1 -0
  305. package/src/lib/organization/organization.module.d.ts +2 -0
  306. package/src/lib/organization/organization.module.js +35 -0
  307. package/src/lib/organization/organization.module.js.map +1 -0
  308. package/src/lib/organization/organization.mutations.d.ts +26 -0
  309. package/src/lib/organization/organization.mutations.js +148 -0
  310. package/src/lib/organization/organization.mutations.js.map +1 -0
  311. package/src/lib/organization/organization.queries.d.ts +23 -0
  312. package/src/lib/organization/organization.queries.js +202 -0
  313. package/src/lib/organization/organization.queries.js.map +1 -0
  314. package/src/lib/organization/organization.service.d.ts +102 -0
  315. package/src/lib/organization/organization.service.js +751 -0
  316. package/src/lib/organization/organization.service.js.map +1 -0
  317. package/src/lib/organization/position.entity.d.ts +9 -0
  318. package/src/lib/organization/position.entity.js +48 -0
  319. package/src/lib/organization/position.entity.js.map +1 -0
  320. package/src/lib/organization/resolved-manager.object.d.ts +4 -0
  321. package/src/lib/organization/resolved-manager.object.js +20 -0
  322. package/src/lib/organization/resolved-manager.object.js.map +1 -0
  323. package/src/lib/signature/index.js +8 -0
  324. package/src/lib/signature/index.js.map +1 -0
  325. package/src/lib/signature/signature-options.d.ts +33 -0
  326. package/src/lib/signature/signature-options.js +51 -0
  327. package/src/lib/signature/signature-options.js.map +1 -0
  328. package/src/lib/signature/signature-verification.object.d.ts +6 -0
  329. package/src/lib/signature/signature-verification.object.js +28 -0
  330. package/src/lib/signature/signature-verification.object.js.map +1 -0
  331. package/src/lib/signature/signature.entity.d.ts +16 -0
  332. package/src/lib/signature/signature.entity.js +88 -0
  333. package/src/lib/signature/signature.entity.js.map +1 -0
  334. package/src/lib/signature/signature.module.d.ts +11 -0
  335. package/src/lib/signature/signature.module.js +60 -0
  336. package/src/lib/signature/signature.module.js.map +1 -0
  337. package/src/lib/signature/signature.queries.d.ts +11 -0
  338. package/src/lib/signature/signature.queries.js +46 -0
  339. package/src/lib/signature/signature.queries.js.map +1 -0
  340. package/src/lib/signature/signature.service.d.ts +25 -0
  341. package/src/lib/signature/signature.service.js +124 -0
  342. package/src/lib/signature/signature.service.js.map +1 -0
  343. package/src/lib/template/approval-template-category.entity.d.ts +9 -0
  344. package/src/lib/template/approval-template-category.entity.js +49 -0
  345. package/src/lib/template/approval-template-category.entity.js.map +1 -0
  346. package/src/lib/template/approval-template-version.entity.d.ts +21 -0
  347. package/src/lib/template/approval-template-version.entity.js +106 -0
  348. package/src/lib/template/approval-template-version.entity.js.map +1 -0
  349. package/src/lib/template/approval-template.entity.d.ts +14 -0
  350. package/src/lib/template/approval-template.entity.js +74 -0
  351. package/src/lib/template/approval-template.entity.js.map +1 -0
  352. package/src/lib/template/dto/approval-template.input.d.ts +36 -0
  353. package/src/lib/template/dto/approval-template.input.js +187 -0
  354. package/src/lib/template/dto/approval-template.input.js.map +1 -0
  355. package/src/lib/template/index.js +12 -0
  356. package/src/lib/template/index.js.map +1 -0
  357. package/src/lib/template/template.enums.d.ts +14 -0
  358. package/src/lib/template/template.enums.js +31 -0
  359. package/src/lib/template/template.enums.js.map +1 -0
  360. package/src/lib/template/template.module.d.ts +2 -0
  361. package/src/lib/template/template.module.js +33 -0
  362. package/src/lib/template/template.module.js.map +1 -0
  363. package/src/lib/template/template.mutations.d.ts +20 -0
  364. package/src/lib/template/template.mutations.js +139 -0
  365. package/src/lib/template/template.mutations.js.map +1 -0
  366. package/src/lib/template/template.queries.d.ts +16 -0
  367. package/src/lib/template/template.queries.js +133 -0
  368. package/src/lib/template/template.queries.js.map +1 -0
  369. package/src/lib/template/template.service.d.ts +64 -0
  370. package/src/lib/template/template.service.js +521 -0
  371. package/src/lib/template/template.service.js.map +1 -0
  372. package/src/lib/template/workflow-definition.validator.d.ts +9 -0
  373. package/src/lib/template/workflow-definition.validator.js +362 -0
  374. package/src/lib/template/workflow-definition.validator.js.map +1 -0
  375. package/src/lib/testing/cel-js.jest.d.ts +15 -0
  376. package/src/lib/testing/cel-js.jest.js +27 -0
  377. package/src/lib/testing/cel-js.jest.js.map +1 -0
  378. package/src/lib/workflow-engine/activity-log.entity.d.ts +12 -0
  379. package/src/lib/workflow-engine/activity-log.entity.js +62 -0
  380. package/src/lib/workflow-engine/activity-log.entity.js.map +1 -0
  381. package/src/lib/workflow-engine/approval-instance-page-info.object.d.ts +8 -0
  382. package/src/lib/workflow-engine/approval-instance-page-info.object.js +36 -0
  383. package/src/lib/workflow-engine/approval-instance-page-info.object.js.map +1 -0
  384. package/src/lib/workflow-engine/approval-instance.entity.d.ts +22 -0
  385. package/src/lib/workflow-engine/approval-instance.entity.js +113 -0
  386. package/src/lib/workflow-engine/approval-instance.entity.js.map +1 -0
  387. package/src/lib/workflow-engine/dto/cancel-approval-instance.input.d.ts +5 -0
  388. package/src/lib/workflow-engine/dto/cancel-approval-instance.input.js +29 -0
  389. package/src/lib/workflow-engine/dto/cancel-approval-instance.input.js.map +1 -0
  390. package/src/lib/workflow-engine/dto/decide-task.input.d.ts +9 -0
  391. package/src/lib/workflow-engine/dto/decide-task.input.js +47 -0
  392. package/src/lib/workflow-engine/dto/decide-task.input.js.map +1 -0
  393. package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.d.ts +6 -0
  394. package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.js +34 -0
  395. package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.js.map +1 -0
  396. package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.d.ts +6 -0
  397. package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js +34 -0
  398. package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js.map +1 -0
  399. package/src/lib/workflow-engine/dto/submit-approval-instance.input.d.ts +7 -0
  400. package/src/lib/workflow-engine/dto/submit-approval-instance.input.js +40 -0
  401. package/src/lib/workflow-engine/dto/submit-approval-instance.input.js.map +1 -0
  402. package/src/lib/workflow-engine/index.js +24 -0
  403. package/src/lib/workflow-engine/index.js.map +1 -0
  404. package/src/lib/workflow-engine/task-candidate.entity.d.ts +14 -0
  405. package/src/lib/workflow-engine/task-candidate.entity.js +72 -0
  406. package/src/lib/workflow-engine/task-candidate.entity.js.map +1 -0
  407. package/src/lib/workflow-engine/task-decision.entity.d.ts +12 -0
  408. package/src/lib/workflow-engine/task-decision.entity.js +60 -0
  409. package/src/lib/workflow-engine/task-decision.entity.js.map +1 -0
  410. package/src/lib/workflow-engine/task.entity.d.ts +20 -0
  411. package/src/lib/workflow-engine/task.entity.js +109 -0
  412. package/src/lib/workflow-engine/task.entity.js.map +1 -0
  413. package/src/lib/workflow-engine/workflow-condition-evaluator.d.ts +5 -0
  414. package/src/lib/workflow-engine/workflow-condition-evaluator.js +107 -0
  415. package/src/lib/workflow-engine/workflow-condition-evaluator.js.map +1 -0
  416. package/src/lib/workflow-engine/workflow-dashboard-summary.object.d.ts +8 -0
  417. package/src/lib/workflow-engine/workflow-dashboard-summary.object.js +36 -0
  418. package/src/lib/workflow-engine/workflow-dashboard-summary.object.js.map +1 -0
  419. package/src/lib/workflow-engine/workflow-dry-run.object.d.ts +21 -0
  420. package/src/lib/workflow-engine/workflow-dry-run.object.js +86 -0
  421. package/src/lib/workflow-engine/workflow-dry-run.object.js.map +1 -0
  422. package/src/lib/workflow-engine/workflow-engine.enums.d.ts +58 -0
  423. package/src/lib/workflow-engine/workflow-engine.enums.js +95 -0
  424. package/src/lib/workflow-engine/workflow-engine.enums.js.map +1 -0
  425. package/src/lib/workflow-engine/workflow-engine.module.d.ts +9 -0
  426. package/src/lib/workflow-engine/workflow-engine.module.js +76 -0
  427. package/src/lib/workflow-engine/workflow-engine.module.js.map +1 -0
  428. package/src/lib/workflow-engine/workflow-engine.mutations.d.ts +19 -0
  429. package/src/lib/workflow-engine/workflow-engine.mutations.js +106 -0
  430. package/src/lib/workflow-engine/workflow-engine.mutations.js.map +1 -0
  431. package/src/lib/workflow-engine/workflow-engine.queries.d.ts +29 -0
  432. package/src/lib/workflow-engine/workflow-engine.queries.js +225 -0
  433. package/src/lib/workflow-engine/workflow-engine.queries.js.map +1 -0
  434. package/src/lib/workflow-engine/workflow-engine.service.d.ts +145 -0
  435. package/src/lib/workflow-engine/workflow-engine.service.js +2785 -0
  436. package/src/lib/workflow-engine/workflow-engine.service.js.map +1 -0
  437. package/src/lib/workflow-engine/{workflow-engine.tokens.ts → workflow-engine.tokens.d.ts} +3 -9
  438. package/src/lib/workflow-engine/workflow-engine.tokens.js +5 -0
  439. package/src/lib/workflow-engine/workflow-engine.tokens.js.map +1 -0
  440. package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.d.ts +18 -0
  441. package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.js +39 -0
  442. package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.js.map +1 -0
  443. package/src/lib/workflow-engine/workflow-token.entity.d.ts +10 -0
  444. package/src/lib/workflow-engine/workflow-token.entity.js +50 -0
  445. package/src/lib/workflow-engine/workflow-token.entity.js.map +1 -0
  446. package/eslint.config.mjs +0 -20
  447. package/jest.config.cts +0 -15
  448. package/project.json +0 -58
  449. package/src/lib/attachment/attachment-options.spec.ts +0 -45
  450. package/src/lib/attachment/attachment-options.ts +0 -130
  451. package/src/lib/attachment/attachment-storage.provider.spec.ts +0 -79
  452. package/src/lib/attachment/attachment-storage.provider.ts +0 -60
  453. package/src/lib/attachment/attachment.controller.ts +0 -39
  454. package/src/lib/attachment/attachment.entity.ts +0 -59
  455. package/src/lib/attachment/attachment.module.ts +0 -149
  456. package/src/lib/attachment/attachment.mutations.ts +0 -22
  457. package/src/lib/attachment/attachment.queries.ts +0 -65
  458. package/src/lib/attachment/attachment.service.spec.ts +0 -319
  459. package/src/lib/attachment/attachment.service.ts +0 -477
  460. package/src/lib/attachment/dto/upload-attachment.input.ts +0 -60
  461. package/src/lib/bpm/bpm-root.module.spec.ts +0 -138
  462. package/src/lib/bpm/bpm-root.module.ts +0 -320
  463. package/src/lib/bpm-auth/bpm-auth-context.extractor.ts +0 -106
  464. package/src/lib/bpm-auth/bpm-auth-context.ts +0 -40
  465. package/src/lib/bpm-auth/bpm-auth.authorization.ts +0 -80
  466. package/src/lib/bpm-auth/bpm-auth.decorators.ts +0 -19
  467. package/src/lib/bpm-auth/bpm-auth.guard.ts +0 -31
  468. package/src/lib/bpm-auth/bpm-auth.module.spec.ts +0 -106
  469. package/src/lib/bpm-auth/bpm-auth.module.ts +0 -69
  470. package/src/lib/bpm-auth/bpm-auth.options.ts +0 -21
  471. package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.ts +0 -55
  472. package/src/lib/common/filters/all-exceptions.filter.ts +0 -138
  473. package/src/lib/common/iso-duration.ts +0 -31
  474. package/src/lib/condition/condition.module.ts +0 -8
  475. package/src/lib/condition/condition.service.spec.ts +0 -50
  476. package/src/lib/condition/condition.service.ts +0 -141
  477. package/src/lib/database/data-source.ts +0 -7
  478. package/src/lib/database/migration-runner.ts +0 -24
  479. package/src/lib/database/typeorm.config.ts +0 -217
  480. package/src/lib/delegation/delegation-rule.entity.ts +0 -84
  481. package/src/lib/delegation/delegation.enums.ts +0 -21
  482. package/src/lib/delegation/delegation.module.ts +0 -14
  483. package/src/lib/delegation/delegation.mutations.ts +0 -92
  484. package/src/lib/delegation/delegation.queries.ts +0 -111
  485. package/src/lib/delegation/delegation.service.spec.ts +0 -295
  486. package/src/lib/delegation/delegation.service.ts +0 -482
  487. package/src/lib/delegation/dto/delegation-rule.input.ts +0 -125
  488. package/src/lib/form/dto/form-definition.input.ts +0 -73
  489. package/src/lib/form/form-definition-version.entity.ts +0 -66
  490. package/src/lib/form/form-definition.entity.ts +0 -54
  491. package/src/lib/form/form-schema-lint.object.ts +0 -10
  492. package/src/lib/form/form-schema.validator.spec.ts +0 -180
  493. package/src/lib/form/form-schema.validator.ts +0 -538
  494. package/src/lib/form/form.enums.ts +0 -20
  495. package/src/lib/form/form.module.ts +0 -19
  496. package/src/lib/form/form.mutations.ts +0 -68
  497. package/src/lib/form/form.queries.ts +0 -72
  498. package/src/lib/form/form.service.spec.ts +0 -144
  499. package/src/lib/form/form.service.ts +0 -490
  500. package/src/lib/identity/identity-options.ts +0 -41
  501. package/src/lib/identity/identity.module.ts +0 -96
  502. package/src/lib/identity/identity.queries.ts +0 -61
  503. package/src/lib/identity/identity.service.spec.ts +0 -105
  504. package/src/lib/identity/identity.service.ts +0 -200
  505. package/src/lib/identity/member-base.adapter.spec.ts +0 -77
  506. package/src/lib/identity/member-base.adapter.ts +0 -244
  507. package/src/lib/identity/member-metadata-cache.entity.ts +0 -27
  508. package/src/lib/identity/member-profile.object.ts +0 -28
  509. package/src/lib/identity/member-resolver.interface.ts +0 -47
  510. package/src/lib/migrations/0000000000001-enable-postgres-extensions.ts +0 -14
  511. package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.ts +0 -19
  512. package/src/lib/migrations/0000000012000-notification-sla-idempotency.ts +0 -22
  513. package/src/lib/migrations/0000000013000-workflow-query-indexes.ts +0 -113
  514. package/src/lib/migrations/index.ts +0 -47
  515. package/src/lib/notification/dto/notification-preference.input.ts +0 -46
  516. package/src/lib/notification/notification-delivery-scheduler.service.ts +0 -69
  517. package/src/lib/notification/notification-delivery.service.spec.ts +0 -315
  518. package/src/lib/notification/notification-delivery.service.ts +0 -339
  519. package/src/lib/notification/notification-dispatcher.token.ts +0 -13
  520. package/src/lib/notification/notification-options.module.ts +0 -67
  521. package/src/lib/notification/notification-options.spec.ts +0 -93
  522. package/src/lib/notification/notification-options.ts +0 -452
  523. package/src/lib/notification/notification-preference.entity.ts +0 -35
  524. package/src/lib/notification/notification-sla-scheduler.service.ts +0 -66
  525. package/src/lib/notification/notification-template.spec.ts +0 -33
  526. package/src/lib/notification/notification-template.ts +0 -97
  527. package/src/lib/notification/notification.entity.ts +0 -102
  528. package/src/lib/notification/notification.enums.ts +0 -45
  529. package/src/lib/notification/notification.module.ts +0 -37
  530. package/src/lib/notification/notification.mutations.ts +0 -47
  531. package/src/lib/notification/notification.queries.ts +0 -64
  532. package/src/lib/notification/notification.service.spec.ts +0 -412
  533. package/src/lib/notification/notification.service.ts +0 -974
  534. package/src/lib/organization/dto/manager-resolution.input.ts +0 -91
  535. package/src/lib/organization/dto/membership.input.ts +0 -77
  536. package/src/lib/organization/dto/org-unit.input.ts +0 -96
  537. package/src/lib/organization/dto/position.input.ts +0 -50
  538. package/src/lib/organization/json-metadata.ts +0 -15
  539. package/src/lib/organization/manager-resolution.entity.ts +0 -44
  540. package/src/lib/organization/membership.entity.ts +0 -50
  541. package/src/lib/organization/org-unit-tree-commit-result.object.ts +0 -8
  542. package/src/lib/organization/org-unit.entity.ts +0 -53
  543. package/src/lib/organization/organization-summary.object.ts +0 -16
  544. package/src/lib/organization/organization.enums.ts +0 -19
  545. package/src/lib/organization/organization.module.ts +0 -27
  546. package/src/lib/organization/organization.mutations.ts +0 -115
  547. package/src/lib/organization/organization.queries.ts +0 -188
  548. package/src/lib/organization/organization.service.spec.ts +0 -760
  549. package/src/lib/organization/organization.service.ts +0 -1216
  550. package/src/lib/organization/position.entity.ts +0 -39
  551. package/src/lib/organization/resolved-manager.object.ts +0 -10
  552. package/src/lib/signature/signature-options.spec.ts +0 -60
  553. package/src/lib/signature/signature-options.ts +0 -120
  554. package/src/lib/signature/signature-verification.object.ts +0 -16
  555. package/src/lib/signature/signature.entity.ts +0 -62
  556. package/src/lib/signature/signature.module.ts +0 -80
  557. package/src/lib/signature/signature.queries.ts +0 -37
  558. package/src/lib/signature/signature.service.spec.ts +0 -134
  559. package/src/lib/signature/signature.service.ts +0 -205
  560. package/src/lib/template/approval-template-category.entity.ts +0 -40
  561. package/src/lib/template/approval-template-version.entity.ts +0 -82
  562. package/src/lib/template/approval-template.entity.ts +0 -64
  563. package/src/lib/template/dto/approval-template.input.ts +0 -147
  564. package/src/lib/template/template.enums.ts +0 -30
  565. package/src/lib/template/template.module.ts +0 -25
  566. package/src/lib/template/template.mutations.ts +0 -106
  567. package/src/lib/template/template.queries.ts +0 -119
  568. package/src/lib/template/template.service.spec.ts +0 -476
  569. package/src/lib/template/template.service.ts +0 -820
  570. package/src/lib/template/workflow-definition.validator.spec.ts +0 -595
  571. package/src/lib/template/workflow-definition.validator.ts +0 -539
  572. package/src/lib/testing/cel-js.jest.ts +0 -46
  573. package/src/lib/workflow-engine/activity-log.entity.ts +0 -48
  574. package/src/lib/workflow-engine/approval-instance-page-info.object.ts +0 -22
  575. package/src/lib/workflow-engine/approval-instance.entity.ts +0 -86
  576. package/src/lib/workflow-engine/dto/cancel-approval-instance.input.ts +0 -18
  577. package/src/lib/workflow-engine/dto/decide-task.input.ts +0 -33
  578. package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.ts +0 -22
  579. package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.ts +0 -22
  580. package/src/lib/workflow-engine/dto/submit-approval-instance.input.ts +0 -27
  581. package/src/lib/workflow-engine/task-candidate.entity.ts +0 -56
  582. package/src/lib/workflow-engine/task-decision.entity.ts +0 -43
  583. package/src/lib/workflow-engine/task.entity.ts +0 -85
  584. package/src/lib/workflow-engine/workflow-condition-evaluator.ts +0 -168
  585. package/src/lib/workflow-engine/workflow-dashboard-summary.object.ts +0 -22
  586. package/src/lib/workflow-engine/workflow-dry-run.object.ts +0 -58
  587. package/src/lib/workflow-engine/workflow-engine.enums.ts +0 -99
  588. package/src/lib/workflow-engine/workflow-engine.module.ts +0 -75
  589. package/src/lib/workflow-engine/workflow-engine.mutations.ts +0 -85
  590. package/src/lib/workflow-engine/workflow-engine.queries.ts +0 -229
  591. package/src/lib/workflow-engine/workflow-engine.service.spec.ts +0 -2689
  592. package/src/lib/workflow-engine/workflow-engine.service.ts +0 -4707
  593. package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.ts +0 -69
  594. package/src/lib/workflow-engine/workflow-token.entity.ts +0 -40
  595. package/tsconfig.json +0 -24
  596. package/tsconfig.lib.json +0 -16
  597. package/tsconfig.spec.json +0 -16
  598. /package/src/{index.ts → index.d.ts} +0 -0
  599. /package/src/lib/attachment/{index.ts → index.d.ts} +0 -0
  600. /package/src/lib/bpm/{index.ts → index.d.ts} +0 -0
  601. /package/src/lib/bpm-auth/{index.ts → index.d.ts} +0 -0
  602. /package/src/lib/common/{index.ts → index.d.ts} +0 -0
  603. /package/src/lib/condition/{index.ts → index.d.ts} +0 -0
  604. /package/src/lib/database/{index.ts → index.d.ts} +0 -0
  605. /package/src/lib/delegation/{index.ts → index.d.ts} +0 -0
  606. /package/src/lib/form/{index.ts → index.d.ts} +0 -0
  607. /package/src/lib/identity/{index.ts → index.d.ts} +0 -0
  608. /package/src/lib/notification/{index.ts → index.d.ts} +0 -0
  609. /package/src/lib/organization/{index.ts → index.d.ts} +0 -0
  610. /package/src/lib/signature/{index.ts → index.d.ts} +0 -0
  611. /package/src/lib/template/{index.ts → index.d.ts} +0 -0
  612. /package/src/lib/workflow-engine/{index.ts → index.d.ts} +0 -0
@@ -1,820 +0,0 @@
1
- import {
2
- BadRequestException,
3
- ConflictException,
4
- Injectable,
5
- NotFoundException,
6
- } from '@nestjs/common';
7
- import { InjectRepository } from '@nestjs/typeorm';
8
- import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
9
- import { FindOptionsWhere, ILike, IsNull, Not, Repository } from 'typeorm';
10
- import { ConditionService } from '../condition/condition.service';
11
- import { FormDefinitionVersionEntity } from '../form/form-definition-version.entity';
12
- import { FormDefinitionVersionStatusEnum } from '../form/form.enums';
13
- import { ApprovalTemplateCategoryEntity } from './approval-template-category.entity';
14
- import { ApprovalTemplateEntity } from './approval-template.entity';
15
- import { ApprovalTemplateVersionEntity } from './approval-template-version.entity';
16
- import {
17
- CreateApprovalTemplateCategoryInput,
18
- CreateApprovalTemplateInput,
19
- UpdateApprovalTemplateCategoryInput,
20
- UpdateApprovalTemplateDraftInput,
21
- UpdateApprovalTemplateInput,
22
- } from './dto/approval-template.input';
23
- import {
24
- ApprovalTemplateCategoryStatusEnum,
25
- ApprovalTemplateListStatusEnum,
26
- ApprovalTemplateVersionStatusEnum,
27
- } from './template.enums';
28
- import {
29
- EMPTY_WORKFLOW_DEFINITION,
30
- lintWorkflowDefinition,
31
- parseWorkflowDefinitionJson,
32
- } from './workflow-definition.validator';
33
-
34
- interface MaxVersionRow {
35
- readonly maxVersion?: number | string | null;
36
- }
37
-
38
- interface ListApprovalTemplatesOptions {
39
- readonly page?: number;
40
- readonly pageSize?: number;
41
- readonly categoryId?: string;
42
- readonly searchText?: string;
43
- readonly status?: ApprovalTemplateListStatusEnum;
44
- }
45
-
46
- interface ListApprovalTemplateCategoriesOptions {
47
- readonly page?: number;
48
- readonly pageSize?: number;
49
- readonly searchText?: string;
50
- readonly status?: ApprovalTemplateCategoryStatusEnum;
51
- }
52
-
53
- @Injectable()
54
- export class TemplateService {
55
- constructor(
56
- @InjectRepository(ApprovalTemplateEntity)
57
- private readonly templateRepository: Repository<ApprovalTemplateEntity>,
58
- @InjectRepository(ApprovalTemplateCategoryEntity)
59
- private readonly templateCategoryRepository: Repository<ApprovalTemplateCategoryEntity>,
60
- @InjectRepository(ApprovalTemplateVersionEntity)
61
- private readonly templateVersionRepository: Repository<ApprovalTemplateVersionEntity>,
62
- @InjectRepository(FormDefinitionVersionEntity)
63
- private readonly formDefinitionVersionRepository: Repository<FormDefinitionVersionEntity>,
64
- private readonly conditionService: ConditionService,
65
- ) {}
66
-
67
- async createApprovalTemplate(
68
- input: CreateApprovalTemplateInput,
69
- ): Promise<ApprovalTemplateEntity> {
70
- await this.validateOptionalFormDefinitionVersion(
71
- input.formDefinitionVersionId,
72
- );
73
- const category = await this.validateOptionalTemplateCategory(
74
- input.categoryId,
75
- );
76
-
77
- return this.templateRepository.manager.transaction(
78
- async (manager): Promise<ApprovalTemplateEntity> => {
79
- const templateRepository = manager.getRepository(
80
- ApprovalTemplateEntity,
81
- );
82
- const versionRepository = manager.getRepository(
83
- ApprovalTemplateVersionEntity,
84
- );
85
- const template = await templateRepository.save(
86
- templateRepository.create({
87
- category: input.category ?? category?.name ?? null,
88
- categoryId: category?.id ?? null,
89
- createdByMemberId: input.createdByMemberId,
90
- currentVersionId: null,
91
- description: input.description,
92
- name: input.name,
93
- }),
94
- );
95
-
96
- await versionRepository.save(
97
- versionRepository.create({
98
- archivedAt: null,
99
- formDefinitionVersionId: input.formDefinitionVersionId,
100
- initiatorPolicyCel: null,
101
- notificationConfig: null,
102
- publishedAt: null,
103
- publishedByMemberId: null,
104
- slaDefaults: null,
105
- status: ApprovalTemplateVersionStatusEnum.DRAFT,
106
- templateId: template.id,
107
- version: 1,
108
- workflowDefinition: EMPTY_WORKFLOW_DEFINITION,
109
- }),
110
- );
111
-
112
- return template;
113
- },
114
- );
115
- }
116
-
117
- async updateApprovalTemplate(
118
- input: UpdateApprovalTemplateInput,
119
- ): Promise<ApprovalTemplateEntity> {
120
- const existing = await this.getTemplateOrThrow(input.id);
121
- const category =
122
- input.categoryId === undefined
123
- ? undefined
124
- : await this.validateOptionalTemplateCategory(input.categoryId);
125
- const next = this.templateRepository.merge(existing, {
126
- category:
127
- input.category !== undefined
128
- ? input.category
129
- : category !== undefined
130
- ? (category?.name ?? null)
131
- : existing.category,
132
- categoryId:
133
- input.categoryId === undefined
134
- ? existing.categoryId
135
- : (category?.id ?? null),
136
- description: input.description ?? existing.description,
137
- name: input.name ?? existing.name,
138
- });
139
-
140
- return this.templateRepository.save(next);
141
- }
142
-
143
- async listApprovalTemplates(
144
- options: ListApprovalTemplatesOptions = {},
145
- ): Promise<readonly ApprovalTemplateEntity[]> {
146
- const isPaginated =
147
- typeof options.page === 'number' || typeof options.pageSize === 'number';
148
- const normalizedPageSize = isPaginated
149
- ? normalizePageSize(options.pageSize ?? 10)
150
- : undefined;
151
-
152
- return this.templateRepository.find({
153
- order: { updatedAt: 'DESC', createdAt: 'DESC' },
154
- relations: { categoryDetail: true },
155
- ...(normalizedPageSize
156
- ? {
157
- skip: (normalizePage(options.page ?? 1) - 1) * normalizedPageSize,
158
- take: normalizedPageSize,
159
- }
160
- : {}),
161
- where: createApprovalTemplateWhere({
162
- categoryId: options.categoryId,
163
- searchText: options.searchText,
164
- status: options.status,
165
- }),
166
- });
167
- }
168
-
169
- async countApprovalTemplates({
170
- categoryId,
171
- searchText,
172
- status,
173
- }: {
174
- readonly categoryId?: string;
175
- readonly searchText?: string;
176
- readonly status?: ApprovalTemplateListStatusEnum;
177
- } = {}): Promise<number> {
178
- return this.templateRepository.count({
179
- where: createApprovalTemplateWhere({ categoryId, searchText, status }),
180
- });
181
- }
182
-
183
- async getApprovalTemplate(id: string): Promise<ApprovalTemplateEntity> {
184
- return this.getTemplateOrThrow(id);
185
- }
186
-
187
- async listApprovalTemplateCategories(
188
- options: ListApprovalTemplateCategoriesOptions = {},
189
- ): Promise<readonly ApprovalTemplateCategoryEntity[]> {
190
- const isPaginated =
191
- typeof options.page === 'number' || typeof options.pageSize === 'number';
192
- const normalizedPageSize = isPaginated
193
- ? normalizePageSize(options.pageSize ?? 10)
194
- : undefined;
195
-
196
- return this.templateCategoryRepository.find({
197
- order: { sortOrder: 'ASC', name: 'ASC', createdAt: 'ASC' },
198
- ...(normalizedPageSize
199
- ? {
200
- skip: (normalizePage(options.page ?? 1) - 1) * normalizedPageSize,
201
- take: normalizedPageSize,
202
- }
203
- : {}),
204
- where: createApprovalTemplateCategoryWhere({
205
- searchText: options.searchText,
206
- status: options.status,
207
- }),
208
- });
209
- }
210
-
211
- async countApprovalTemplateCategories({
212
- searchText,
213
- status,
214
- }: {
215
- readonly searchText?: string;
216
- readonly status?: ApprovalTemplateCategoryStatusEnum;
217
- } = {}): Promise<number> {
218
- return this.templateCategoryRepository.count({
219
- where: createApprovalTemplateCategoryWhere({ searchText, status }),
220
- });
221
- }
222
-
223
- async createApprovalTemplateCategory(
224
- input: CreateApprovalTemplateCategoryInput,
225
- ): Promise<ApprovalTemplateCategoryEntity> {
226
- return this.templateCategoryRepository.save(
227
- this.templateCategoryRepository.create({
228
- description: input.description,
229
- isActive: input.isActive ?? true,
230
- name: input.name,
231
- sortOrder: input.sortOrder ?? 0,
232
- }),
233
- );
234
- }
235
-
236
- async updateApprovalTemplateCategory(
237
- input: UpdateApprovalTemplateCategoryInput,
238
- ): Promise<ApprovalTemplateCategoryEntity> {
239
- const existing = await this.getTemplateCategoryOrThrow(input.id);
240
-
241
- return this.templateCategoryRepository.save(
242
- this.templateCategoryRepository.merge(existing, {
243
- description: input.description ?? existing.description,
244
- isActive: input.isActive ?? existing.isActive,
245
- name: input.name ?? existing.name,
246
- sortOrder: input.sortOrder ?? existing.sortOrder,
247
- }),
248
- );
249
- }
250
-
251
- async activateApprovalTemplateCategory(
252
- id: string,
253
- ): Promise<ApprovalTemplateCategoryEntity> {
254
- return this.setApprovalTemplateCategoryActive(id, true);
255
- }
256
-
257
- async deactivateApprovalTemplateCategory(
258
- id: string,
259
- ): Promise<ApprovalTemplateCategoryEntity> {
260
- return this.setApprovalTemplateCategoryActive(id, false);
261
- }
262
-
263
- async deleteApprovalTemplateCategory(
264
- id: string,
265
- ): Promise<ApprovalTemplateCategoryEntity> {
266
- const category = await this.getTemplateCategoryOrThrow(id);
267
- const templateCount = await this.templateRepository.count({
268
- where: { categoryId: id, deletedAt: IsNull() },
269
- });
270
-
271
- if (templateCount > 0) {
272
- return this.templateCategoryRepository.save(
273
- this.templateCategoryRepository.merge(category, {
274
- isActive: false,
275
- }),
276
- );
277
- }
278
-
279
- await this.templateCategoryRepository.remove(category);
280
-
281
- return category;
282
- }
283
-
284
- async listApprovalTemplateVersions(
285
- templateId: string,
286
- ): Promise<readonly ApprovalTemplateVersionEntity[]> {
287
- await this.getTemplateOrThrow(templateId);
288
-
289
- return this.templateVersionRepository.find({
290
- order: { version: 'DESC' },
291
- where: { templateId },
292
- });
293
- }
294
-
295
- async getApprovalTemplateVersion(
296
- id: string,
297
- ): Promise<ApprovalTemplateVersionEntity> {
298
- return this.getTemplateVersionOrThrow(id);
299
- }
300
-
301
- async updateApprovalTemplateDraft(
302
- input: UpdateApprovalTemplateDraftInput,
303
- ): Promise<ApprovalTemplateVersionEntity> {
304
- const existing = await this.getTemplateVersionOrThrow(input.versionId);
305
-
306
- if (existing.status !== ApprovalTemplateVersionStatusEnum.DRAFT) {
307
- throw new ConflictException(
308
- 'Only draft approval template versions can be updated',
309
- );
310
- }
311
-
312
- await this.validateOptionalFormDefinitionVersion(
313
- input.formDefinitionVersionId,
314
- );
315
- const workflowDefinition = this.parseWorkflowDefinitionOrThrow(
316
- input.workflowDefinitionJson,
317
- );
318
- const next = this.templateVersionRepository.merge(existing, {
319
- formDefinitionVersionId: input.formDefinitionVersionId,
320
- initiatorPolicyCel: input.initiatorPolicyCel,
321
- notificationConfig: parseOptionalJsonObject(input.notificationConfigJson),
322
- slaDefaults: parseOptionalJsonObject(input.slaDefaultsJson),
323
- workflowDefinition,
324
- });
325
-
326
- return this.templateVersionRepository.save(next);
327
- }
328
-
329
- async forkApprovalTemplate(
330
- templateId: string,
331
- ): Promise<ApprovalTemplateVersionEntity> {
332
- const template = await this.getTemplateOrThrow(templateId);
333
- const existingDraft = await this.templateVersionRepository.findOne({
334
- where: {
335
- status: ApprovalTemplateVersionStatusEnum.DRAFT,
336
- templateId: template.id,
337
- },
338
- });
339
-
340
- if (existingDraft) {
341
- throw new ConflictException(
342
- 'A draft approval template version already exists',
343
- );
344
- }
345
-
346
- const source = template.currentVersionId
347
- ? await this.getTemplateVersionOrThrow(template.currentVersionId)
348
- : null;
349
- const nextVersion = await this.readNextVersionNumber(template.id);
350
-
351
- return this.templateVersionRepository.save(
352
- this.templateVersionRepository.create({
353
- archivedAt: null,
354
- formDefinitionVersionId: source?.formDefinitionVersionId ?? null,
355
- initiatorPolicyCel: source?.initiatorPolicyCel ?? null,
356
- notificationConfig: source?.notificationConfig ?? null,
357
- publishedAt: null,
358
- publishedByMemberId: null,
359
- slaDefaults: source?.slaDefaults ?? null,
360
- status: ApprovalTemplateVersionStatusEnum.DRAFT,
361
- templateId: template.id,
362
- version: nextVersion,
363
- workflowDefinition:
364
- source?.workflowDefinition ?? EMPTY_WORKFLOW_DEFINITION,
365
- }),
366
- );
367
- }
368
-
369
- async publishApprovalTemplateVersion(
370
- versionId: string,
371
- publishedByMemberId?: string,
372
- ): Promise<ApprovalTemplateVersionEntity> {
373
- const version = await this.getTemplateVersionOrThrow(versionId);
374
-
375
- if (version.status !== ApprovalTemplateVersionStatusEnum.DRAFT) {
376
- throw new ConflictException(
377
- 'Only draft approval template versions can be published',
378
- );
379
- }
380
-
381
- await this.validatePublishableVersion(version);
382
-
383
- return this.templateRepository.manager.transaction(
384
- async (manager): Promise<ApprovalTemplateVersionEntity> => {
385
- const templateRepository = manager.getRepository(
386
- ApprovalTemplateEntity,
387
- );
388
- const versionRepository = manager.getRepository(
389
- ApprovalTemplateVersionEntity,
390
- );
391
- const template = await templateRepository.findOne({
392
- where: { deletedAt: IsNull(), id: version.templateId },
393
- });
394
-
395
- if (!template) {
396
- throw new NotFoundException(
397
- `Approval template ${version.templateId} was not found`,
398
- );
399
- }
400
-
401
- if (template.currentVersionId) {
402
- await versionRepository.update(
403
- { id: template.currentVersionId },
404
- {
405
- archivedAt: new Date(),
406
- status: ApprovalTemplateVersionStatusEnum.ARCHIVED,
407
- },
408
- );
409
- }
410
-
411
- const published = versionRepository.merge(version, {
412
- archivedAt: null,
413
- publishedAt: new Date(),
414
- publishedByMemberId: publishedByMemberId ?? null,
415
- status: ApprovalTemplateVersionStatusEnum.PUBLISHED,
416
- });
417
- const saved = await versionRepository.save(published);
418
- await templateRepository.save(
419
- templateRepository.merge(template, {
420
- currentVersionId: saved.id,
421
- }),
422
- );
423
-
424
- return saved;
425
- },
426
- );
427
- }
428
-
429
- async rollbackApprovalTemplateVersion(
430
- versionId: string,
431
- ): Promise<ApprovalTemplateVersionEntity> {
432
- const target = await this.getTemplateVersionOrThrow(versionId);
433
-
434
- if (target.status === ApprovalTemplateVersionStatusEnum.DRAFT) {
435
- throw new ConflictException(
436
- 'Draft approval template versions cannot be rollback targets',
437
- );
438
- }
439
-
440
- return this.templateRepository.manager.transaction(
441
- async (manager): Promise<ApprovalTemplateVersionEntity> => {
442
- const templateRepository = manager.getRepository(
443
- ApprovalTemplateEntity,
444
- );
445
- const versionRepository = manager.getRepository(
446
- ApprovalTemplateVersionEntity,
447
- );
448
- const template = await templateRepository.findOne({
449
- where: { deletedAt: IsNull(), id: target.templateId },
450
- });
451
-
452
- if (!template) {
453
- throw new NotFoundException(
454
- `Approval template ${target.templateId} was not found`,
455
- );
456
- }
457
-
458
- if (
459
- template.currentVersionId &&
460
- template.currentVersionId !== target.id
461
- ) {
462
- await versionRepository.update(
463
- { id: template.currentVersionId },
464
- {
465
- archivedAt: new Date(),
466
- status: ApprovalTemplateVersionStatusEnum.ARCHIVED,
467
- },
468
- );
469
- }
470
-
471
- const restored = versionRepository.merge(target, {
472
- archivedAt: null,
473
- status: ApprovalTemplateVersionStatusEnum.PUBLISHED,
474
- });
475
- const saved = await versionRepository.save(restored);
476
- await templateRepository.save(
477
- templateRepository.merge(template, {
478
- currentVersionId: saved.id,
479
- }),
480
- );
481
-
482
- return saved;
483
- },
484
- );
485
- }
486
-
487
- private async validatePublishableVersion(
488
- version: ApprovalTemplateVersionEntity,
489
- ): Promise<void> {
490
- if (!version.formDefinitionVersionId) {
491
- throw new BadRequestException(
492
- 'Approval template version must bind a form definition version before publishing',
493
- );
494
- }
495
-
496
- const formVersion = await this.formDefinitionVersionRepository.findOne({
497
- where: { id: version.formDefinitionVersionId },
498
- });
499
-
500
- if (!formVersion) {
501
- throw new NotFoundException(
502
- `Form definition version ${version.formDefinitionVersionId} was not found`,
503
- );
504
- }
505
-
506
- if (formVersion.status !== FormDefinitionVersionStatusEnum.PUBLISHED) {
507
- throw new BadRequestException(
508
- 'Approval template can only bind a published form definition version',
509
- );
510
- }
511
-
512
- const workflowResult = lintWorkflowDefinition(version.workflowDefinition);
513
- const conditionErrors = this.conditionService.lintExpressions(
514
- readConditionExpressions(
515
- version.workflowDefinition,
516
- version.initiatorPolicyCel,
517
- ),
518
- {
519
- allowedRootIdentifiers: [
520
- 'env',
521
- 'form',
522
- 'formData',
523
- 'initiator',
524
- 'instance',
525
- 'subject',
526
- ],
527
- },
528
- );
529
- const errors = [...workflowResult.errors, ...conditionErrors];
530
-
531
- if (errors.length) {
532
- throw new BadRequestException(errors.join('; '));
533
- }
534
- }
535
-
536
- private async validateOptionalFormDefinitionVersion(
537
- formDefinitionVersionId: string | null | undefined,
538
- ): Promise<void> {
539
- if (!formDefinitionVersionId) {
540
- return;
541
- }
542
-
543
- const formVersion = await this.formDefinitionVersionRepository.findOne({
544
- where: { id: formDefinitionVersionId },
545
- });
546
-
547
- if (!formVersion) {
548
- throw new NotFoundException(
549
- `Form definition version ${formDefinitionVersionId} was not found`,
550
- );
551
- }
552
- }
553
-
554
- private async validateOptionalTemplateCategory(
555
- categoryId: string | null | undefined,
556
- ): Promise<ApprovalTemplateCategoryEntity | null> {
557
- if (!categoryId) {
558
- return null;
559
- }
560
-
561
- return this.getTemplateCategoryOrThrow(categoryId);
562
- }
563
-
564
- private async getTemplateOrThrow(
565
- id: string,
566
- ): Promise<ApprovalTemplateEntity> {
567
- const entity = await this.templateRepository.findOne({
568
- relations: { categoryDetail: true },
569
- where: { deletedAt: IsNull(), id },
570
- });
571
-
572
- if (!entity) {
573
- throw new NotFoundException(`Approval template ${id} was not found`);
574
- }
575
-
576
- return entity;
577
- }
578
-
579
- private async getTemplateCategoryOrThrow(
580
- id: string,
581
- ): Promise<ApprovalTemplateCategoryEntity> {
582
- const entity = await this.templateCategoryRepository.findOne({
583
- where: { id },
584
- });
585
-
586
- if (!entity) {
587
- throw new NotFoundException(
588
- `Approval template category ${id} was not found`,
589
- );
590
- }
591
-
592
- return entity;
593
- }
594
-
595
- private async setApprovalTemplateCategoryActive(
596
- id: string,
597
- isActive: boolean,
598
- ): Promise<ApprovalTemplateCategoryEntity> {
599
- const category = await this.getTemplateCategoryOrThrow(id);
600
-
601
- return this.templateCategoryRepository.save(
602
- this.templateCategoryRepository.merge(category, {
603
- isActive,
604
- }),
605
- );
606
- }
607
-
608
- private async getTemplateVersionOrThrow(
609
- id: string,
610
- ): Promise<ApprovalTemplateVersionEntity> {
611
- const entity = await this.templateVersionRepository.findOne({
612
- where: { id },
613
- });
614
-
615
- if (!entity) {
616
- throw new NotFoundException(
617
- `Approval template version ${id} was not found`,
618
- );
619
- }
620
-
621
- return entity;
622
- }
623
-
624
- private async readNextVersionNumber(templateId: string): Promise<number> {
625
- const row = await this.templateVersionRepository
626
- .createQueryBuilder('version')
627
- .select('MAX(version.version)', 'maxVersion')
628
- .where('version.template_id = :templateId', { templateId })
629
- .getRawOne<MaxVersionRow>();
630
- const maxVersion =
631
- typeof row?.maxVersion === 'number'
632
- ? row.maxVersion
633
- : Number(row?.maxVersion ?? 0);
634
-
635
- return maxVersion + 1;
636
- }
637
-
638
- private parseWorkflowDefinitionOrThrow(value: string): WorkflowDefinition {
639
- try {
640
- return parseWorkflowDefinitionJson(value);
641
- } catch (error: unknown) {
642
- throw new BadRequestException(
643
- error instanceof Error ? error.message : 'Invalid workflow definition',
644
- );
645
- }
646
- }
647
- }
648
-
649
- function parseOptionalJsonObject(
650
- value: string | null | undefined,
651
- ): Readonly<Record<string, unknown>> | null {
652
- if (!value) {
653
- return null;
654
- }
655
-
656
- const parsedValue = parseJson(value);
657
-
658
- if (!isRecord(parsedValue)) {
659
- throw new BadRequestException('JSON value must be an object');
660
- }
661
-
662
- return parsedValue;
663
- }
664
-
665
- function parseJson(value: string): unknown {
666
- try {
667
- return JSON.parse(value) as unknown;
668
- } catch (error: unknown) {
669
- throw new BadRequestException(
670
- error instanceof Error ? error.message : 'Invalid JSON value',
671
- );
672
- }
673
- }
674
-
675
- function normalizePage(page: number): number {
676
- return Number.isInteger(page) && page > 0 ? page : 1;
677
- }
678
-
679
- function normalizePageSize(pageSize: number): number {
680
- if (!Number.isInteger(pageSize) || pageSize <= 0) {
681
- return 10;
682
- }
683
-
684
- return Math.min(pageSize, 100);
685
- }
686
-
687
- function createApprovalTemplateWhere(
688
- options: Readonly<{
689
- readonly categoryId?: string;
690
- readonly searchText?: string;
691
- readonly status?: ApprovalTemplateListStatusEnum;
692
- }>,
693
- ):
694
- | FindOptionsWhere<ApprovalTemplateEntity>
695
- | FindOptionsWhere<ApprovalTemplateEntity>[] {
696
- const activeTemplateWhere: FindOptionsWhere<ApprovalTemplateEntity> = {
697
- deletedAt: IsNull(),
698
- };
699
- const statusWhere: FindOptionsWhere<ApprovalTemplateEntity> =
700
- options.status === ApprovalTemplateListStatusEnum.DRAFT
701
- ? { currentVersionId: IsNull() }
702
- : {};
703
- const publicationWhere: FindOptionsWhere<ApprovalTemplateEntity> =
704
- options.status === ApprovalTemplateListStatusEnum.PUBLISHED
705
- ? { currentVersionId: Not(IsNull()) }
706
- : {};
707
- const baseWhere: FindOptionsWhere<ApprovalTemplateEntity> = {
708
- ...activeTemplateWhere,
709
- ...(options.categoryId ? { categoryId: options.categoryId } : {}),
710
- ...statusWhere,
711
- ...publicationWhere,
712
- };
713
-
714
- const trimmedSearchText = options.searchText?.trim();
715
-
716
- if (!trimmedSearchText) {
717
- return baseWhere;
718
- }
719
-
720
- const searchPattern = `%${trimmedSearchText}%`;
721
-
722
- return [
723
- { ...baseWhere, name: ILike(searchPattern) },
724
- { ...baseWhere, category: ILike(searchPattern) },
725
- { ...baseWhere, description: ILike(searchPattern) },
726
- ];
727
- }
728
-
729
- function createApprovalTemplateCategoryWhere(
730
- options: Readonly<{
731
- readonly searchText?: string;
732
- readonly status?: ApprovalTemplateCategoryStatusEnum;
733
- }>,
734
- ):
735
- | FindOptionsWhere<ApprovalTemplateCategoryEntity>
736
- | FindOptionsWhere<ApprovalTemplateCategoryEntity>[] {
737
- const statusWhere: FindOptionsWhere<ApprovalTemplateCategoryEntity> =
738
- options.status === ApprovalTemplateCategoryStatusEnum.ALL
739
- ? {}
740
- : options.status === ApprovalTemplateCategoryStatusEnum.INACTIVE
741
- ? { isActive: false }
742
- : { isActive: true };
743
- const trimmedSearchText = options.searchText?.trim();
744
-
745
- if (!trimmedSearchText) {
746
- return statusWhere;
747
- }
748
-
749
- const searchPattern = `%${trimmedSearchText}%`;
750
-
751
- return [
752
- { ...statusWhere, name: ILike(searchPattern) },
753
- { ...statusWhere, description: ILike(searchPattern) },
754
- ];
755
- }
756
-
757
- function readConditionExpressions(
758
- definition: WorkflowDefinition,
759
- initiatorPolicyCel: string | null,
760
- ): readonly {
761
- readonly expression: string | null | undefined;
762
- readonly label: string;
763
- }[] {
764
- return [
765
- { expression: initiatorPolicyCel, label: 'initiatorPolicyCel' },
766
- ...definition.edges.map((edge) => ({
767
- expression: edge.data.condition,
768
- label: `workflow.edges.${edge.id}.data.condition`,
769
- })),
770
- ...definition.nodes.flatMap((node) => {
771
- if (node.type === 'userTask') {
772
- return [
773
- {
774
- expression: node.data.entryCondition,
775
- label: `workflow.nodes.${node.id}.data.entryCondition`,
776
- },
777
- ...(node.data.approverResolver.type === 'EXPRESSION'
778
- ? [
779
- {
780
- expression: node.data.approverResolver.expression,
781
- label: `workflow.nodes.${node.id}.data.approverResolver.expression`,
782
- },
783
- ]
784
- : []),
785
- ];
786
- }
787
-
788
- if (node.type === 'serviceTask') {
789
- return [
790
- {
791
- expression: node.data.entryCondition,
792
- label: `workflow.nodes.${node.id}.data.entryCondition`,
793
- },
794
- ...(node.data.action.type === 'WEBHOOK'
795
- ? [
796
- {
797
- expression: node.data.action.payload,
798
- label: `workflow.nodes.${node.id}.data.action.payload`,
799
- },
800
- ]
801
- : []),
802
- ...(node.data.action.type === 'SET_FORM_FIELD'
803
- ? [
804
- {
805
- expression: node.data.action.value,
806
- label: `workflow.nodes.${node.id}.data.action.value`,
807
- },
808
- ]
809
- : []),
810
- ];
811
- }
812
-
813
- return [];
814
- }),
815
- ];
816
- }
817
-
818
- function isRecord(value: unknown): value is Readonly<Record<string, unknown>> {
819
- return typeof value === 'object' && value !== null && !Array.isArray(value);
820
- }