@aristid/leav-types 1.12.0-f8d42691 → 1.13.0-059eaf22

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 (307) hide show
  1. package/apps/core/config/default.d.ts +9 -2
  2. package/apps/core/src/_types/automation.d.ts +17 -6
  3. package/apps/core/src/_types/config.d.ts +9 -0
  4. package/apps/core/src/_types/errors.d.ts +8 -0
  5. package/apps/core/src/_types/events.d.ts +3 -0
  6. package/apps/core/src/_types/eventsManager.d.ts +8 -0
  7. package/apps/core/src/_types/extensionPoints.d.ts +2 -0
  8. package/apps/core/src/_types/record.d.ts +1 -0
  9. package/apps/core/src/app/core/automationApp.d.ts +5 -3
  10. package/apps/core/src/app/trpc/index.d.ts +1 -0
  11. package/apps/core/src/app/trpc/trpcApp.d.ts +30 -0
  12. package/apps/core/src/domain/actions/index.d.ts +1 -0
  13. package/apps/core/src/domain/actions/jexlCalculationAction.d.ts +14 -0
  14. package/apps/core/src/domain/automation/actions/_types.d.ts +35 -0
  15. package/apps/core/src/domain/automation/actions/conditionAction.d.ts +14 -0
  16. package/apps/core/src/domain/automation/actions/errorAction.d.ts +8 -0
  17. package/apps/core/src/domain/automation/actions/index.d.ts +6 -0
  18. package/apps/core/src/domain/automation/actions/jexlCalculationAutomationAction.d.ts +16 -0
  19. package/apps/core/src/domain/automation/actions/logAction.d.ts +16 -0
  20. package/apps/core/src/domain/automation/actions/modifyAttributeAction.d.ts +20 -0
  21. package/apps/core/src/domain/automation/actions/notificationAction.d.ts +19 -0
  22. package/apps/core/src/domain/automation/automationActionsRegistry.d.ts +10 -0
  23. package/apps/core/src/domain/automation/automationDomain.d.ts +39 -8
  24. package/apps/core/src/domain/automation/fakeRulesToTrigger.d.ts +7 -0
  25. package/apps/core/src/domain/automation/form/automationJsonSchemaForm.d.ts +19 -0
  26. package/apps/core/src/domain/automation/form/automationUiJsonSchemaForm.d.ts +15 -0
  27. package/apps/core/src/domain/automation/form/index.d.ts +2 -0
  28. package/apps/core/src/domain/automation/index.d.ts +4 -0
  29. package/apps/core/src/domain/automation/pipeline/_types.d.ts +37 -0
  30. package/apps/core/src/domain/automation/pipeline/buildAutomationJexlContext.d.ts +9 -0
  31. package/apps/core/src/domain/automation/pipeline/index.d.ts +2 -0
  32. package/apps/core/src/domain/automation/pipeline/pipeline.d.ts +13 -0
  33. package/apps/core/src/domain/automation/pipeline/stepValidation.d.ts +3 -0
  34. package/apps/core/src/domain/automation/triggers/_types.d.ts +15 -0
  35. package/apps/core/src/domain/automation/triggers/automationTriggers.d.ts +14 -0
  36. package/apps/core/src/domain/automation/triggers/automationTriggersRegistry.d.ts +19 -0
  37. package/apps/core/src/domain/automation/triggers/automationTriggersTopics.d.ts +18 -0
  38. package/apps/core/src/domain/automation/triggers/index.d.ts +3 -0
  39. package/apps/core/src/domain/discussion/discussionDomain.d.ts +3 -1
  40. package/apps/core/src/domain/jexl/index.d.ts +1 -0
  41. package/apps/core/src/domain/jexl/jexlDomain.d.ts +19 -0
  42. package/apps/core/src/domain/jexl/jexlExtended.d.ts +2 -0
  43. package/apps/core/src/domain/jexl/types.d.ts +37 -0
  44. package/apps/core/src/domain/permission/attributeDependentValuesPermissionDomain.d.ts +5 -1
  45. package/apps/core/src/infra/automation/automationRuleRepo.d.ts +2 -0
  46. package/apps/core/src/infra/db/dbUtils.d.ts +1 -1
  47. package/apps/core/src/interface/server.d.ts +3 -1
  48. package/apps/core/src/pluginsLoader.d.ts +1 -0
  49. package/apps/core/tsconfig.types.tsbuildinfo +1 -1
  50. package/apps/core/vitest.e2e-api.config.d.ts +2 -0
  51. package/apps/core/vitest.e2e-fileManager.config.d.ts +2 -0
  52. package/apps/core/vitest.e2e-indexationManager.config.d.ts +2 -0
  53. package/apps/core/vitest.integration.config.d.ts +2 -0
  54. package/apps/core/vitest.unit.config.d.ts +2 -0
  55. package/libs/utils/src/types/events.d.ts +3 -0
  56. package/libs/utils/src/types/helpers.d.ts +0 -3
  57. package/libs/utils/src/utils.d.ts +3 -1
  58. package/package.json +3 -5
  59. package/apps/core/scripts/build.d.ts +0 -2
  60. package/apps/core/scripts/utils.d.ts +0 -3
  61. package/apps/core/src/__tests__/e2e/_gqlTypes/index.d.ts +0 -1405
  62. package/apps/core/src/__tests__/e2e/api/_fixtures/applications/login/index-hashed.d.ts +0 -0
  63. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/_types/_types.d.ts +0 -3
  64. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/domain/fakeDomain.d.ts +0 -17
  65. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/domain/index.d.ts +0 -1
  66. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/index.d.ts +0 -21
  67. package/apps/core/src/__tests__/e2e/api/actionLists/actionLists.test.d.ts +0 -1
  68. package/apps/core/src/__tests__/e2e/api/actionLists/actions/inheritanceCalculationAction.test.d.ts +0 -1
  69. package/apps/core/src/__tests__/e2e/api/actionLists/actions/replaceAnotherAttributeAction.test.d.ts +0 -1
  70. package/apps/core/src/__tests__/e2e/api/apiKey/apiKey.test.d.ts +0 -1
  71. package/apps/core/src/__tests__/e2e/api/applications/applications.test.d.ts +0 -1
  72. package/apps/core/src/__tests__/e2e/api/attributes/attributes.test.d.ts +0 -1
  73. package/apps/core/src/__tests__/e2e/api/auth/auth.test.d.ts +0 -1
  74. package/apps/core/src/__tests__/e2e/api/automation/automation.test.d.ts +0 -1
  75. package/apps/core/src/__tests__/e2e/api/constants.d.ts +0 -2
  76. package/apps/core/src/__tests__/e2e/api/discussions/discussions.test.d.ts +0 -1
  77. package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +0 -155
  78. package/apps/core/src/__tests__/e2e/api/export/export.test.d.ts +0 -1
  79. package/apps/core/src/__tests__/e2e/api/export/exportNestedAttributes.test.d.ts +0 -1
  80. package/apps/core/src/__tests__/e2e/api/files/files.test.d.ts +0 -1
  81. package/apps/core/src/__tests__/e2e/api/forms/forms.test.d.ts +0 -1
  82. package/apps/core/src/__tests__/e2e/api/getConditionPart/getConditionPart.test.d.ts +0 -1
  83. package/apps/core/src/__tests__/e2e/api/globalSettings/globalSettings.test.d.ts +0 -1
  84. package/apps/core/src/__tests__/e2e/api/globalSetup.d.ts +0 -8
  85. package/apps/core/src/__tests__/e2e/api/globalSetupHook.d.ts +0 -1
  86. package/apps/core/src/__tests__/e2e/api/graphql/graphql.test.d.ts +0 -1
  87. package/apps/core/src/__tests__/e2e/api/import/import.test.d.ts +0 -1
  88. package/apps/core/src/__tests__/e2e/api/joinLibraries/joinLibraries.test.d.ts +0 -1
  89. package/apps/core/src/__tests__/e2e/api/joinLibraries/nestedJoinLibraries.test.d.ts +0 -1
  90. package/apps/core/src/__tests__/e2e/api/libraries/libraries.test.d.ts +0 -1
  91. package/apps/core/src/__tests__/e2e/api/mailpitUtils.d.ts +0 -37
  92. package/apps/core/src/__tests__/e2e/api/notificationUtils.d.ts +0 -7
  93. package/apps/core/src/__tests__/e2e/api/notifications/notifications.test.d.ts +0 -1
  94. package/apps/core/src/__tests__/e2e/api/permissions/admin/apiKeyAdminPermissions.test.d.ts +0 -1
  95. package/apps/core/src/__tests__/e2e/api/permissions/admin/applicationsAdminPermissions.test.d.ts +0 -1
  96. package/apps/core/src/__tests__/e2e/api/permissions/admin/attributesAdminPermissions.test.d.ts +0 -1
  97. package/apps/core/src/__tests__/e2e/api/permissions/admin/formsAdminPermissions.test.d.ts +0 -1
  98. package/apps/core/src/__tests__/e2e/api/permissions/admin/globalSettingsAdminPermissions.test.d.ts +0 -1
  99. package/apps/core/src/__tests__/e2e/api/permissions/admin/librariesAdminPermissions.test.d.ts +0 -1
  100. package/apps/core/src/__tests__/e2e/api/permissions/admin/permissionsAdminPermissions.test.d.ts +0 -1
  101. package/apps/core/src/__tests__/e2e/api/permissions/admin/treesAdminPermissions.test.d.ts +0 -1
  102. package/apps/core/src/__tests__/e2e/api/permissions/admin/versionProfilesAdminPermissions.test.d.ts +0 -1
  103. package/apps/core/src/__tests__/e2e/api/permissions/applicationsPermissions.test.d.ts +0 -1
  104. package/apps/core/src/__tests__/e2e/api/permissions/attributePermissions.test.d.ts +0 -1
  105. package/apps/core/src/__tests__/e2e/api/permissions/dependentValuesTreeAttributePermissions.test.d.ts +0 -1
  106. package/apps/core/src/__tests__/e2e/api/permissions/extendedLibraryPermissions.test.d.ts +0 -1
  107. package/apps/core/src/__tests__/e2e/api/permissions/permissions.test.d.ts +0 -1
  108. package/apps/core/src/__tests__/e2e/api/permissions/recordAttributePermissions.test.d.ts +0 -1
  109. package/apps/core/src/__tests__/e2e/api/permissions/recordPermissions.test.d.ts +0 -1
  110. package/apps/core/src/__tests__/e2e/api/permissions/treeLibraryPermissions.test.d.ts +0 -1
  111. package/apps/core/src/__tests__/e2e/api/permissions/treeNodePermissions.test.d.ts +0 -1
  112. package/apps/core/src/__tests__/e2e/api/permissions/treePermissions.test.d.ts +0 -1
  113. package/apps/core/src/__tests__/e2e/api/plugins/plugins.test.d.ts +0 -1
  114. package/apps/core/src/__tests__/e2e/api/records/recordIdentity.test.d.ts +0 -1
  115. package/apps/core/src/__tests__/e2e/api/records/records.test.d.ts +0 -1
  116. package/apps/core/src/__tests__/e2e/api/records/recordsDeletion.test.d.ts +0 -1
  117. package/apps/core/src/__tests__/e2e/api/records/searchFilters.test.d.ts +0 -1
  118. package/apps/core/src/__tests__/e2e/api/task/taskSubscription.test.d.ts +0 -1
  119. package/apps/core/src/__tests__/e2e/api/task/tasksAdminPermissions.test.d.ts +0 -1
  120. package/apps/core/src/__tests__/e2e/api/taskUtils.d.ts +0 -4
  121. package/apps/core/src/__tests__/e2e/api/teardown.d.ts +0 -2
  122. package/apps/core/src/__tests__/e2e/api/trees/treeNodeChildrenAndContentQuery.test.d.ts +0 -1
  123. package/apps/core/src/__tests__/e2e/api/trees/trees.test.d.ts +0 -1
  124. package/apps/core/src/__tests__/e2e/api/userData/maskUserPassword.test.d.ts +0 -1
  125. package/apps/core/src/__tests__/e2e/api/userData/userData.test.d.ts +0 -1
  126. package/apps/core/src/__tests__/e2e/api/values/listDistinctValues.test.d.ts +0 -1
  127. package/apps/core/src/__tests__/e2e/api/values/metadata.test.d.ts +0 -1
  128. package/apps/core/src/__tests__/e2e/api/values/purgeMultipleValues.test.d.ts +0 -1
  129. package/apps/core/src/__tests__/e2e/api/values/saveValueBulk.test.d.ts +0 -1
  130. package/apps/core/src/__tests__/e2e/api/values/values.test.d.ts +0 -1
  131. package/apps/core/src/__tests__/e2e/api/values/versions.test.d.ts +0 -1
  132. package/apps/core/src/__tests__/e2e/api/versionProfile/versionProfile.test.d.ts +0 -1
  133. package/apps/core/src/__tests__/e2e/api/views/views.test.d.ts +0 -1
  134. package/apps/core/src/__tests__/e2e/filesManager/filesManager/filesManager.test.d.ts +0 -1
  135. package/apps/core/src/__tests__/e2e/filesManager/globalSetup.d.ts +0 -1
  136. package/apps/core/src/__tests__/e2e/filesManager/globalSetupHook.d.ts +0 -1
  137. package/apps/core/src/__tests__/e2e/indexationManager/globalSetup.d.ts +0 -1
  138. package/apps/core/src/__tests__/e2e/indexationManager/globalSetupHook.d.ts +0 -1
  139. package/apps/core/src/__tests__/e2e/indexationManager/indexation.test.d.ts +0 -1
  140. package/apps/core/src/__tests__/global-setup.d.ts +0 -0
  141. package/apps/core/src/__tests__/integration/domain/tasksManagerDomain.test.d.ts +0 -1
  142. package/apps/core/src/__tests__/integration/globalSetup.d.ts +0 -1
  143. package/apps/core/src/__tests__/integration/globalSetupHook.d.ts +0 -1
  144. package/apps/core/src/__tests__/integration/infra/attributeAdvancedLinkRepo.test.d.ts +0 -1
  145. package/apps/core/src/__tests__/integration/infra/attributeAdvancedRepo.test.d.ts +0 -1
  146. package/apps/core/src/__tests__/integration/infra/attributeSimpleLinkRepo.test.d.ts +0 -1
  147. package/apps/core/src/__tests__/integration/infra/attributeSimpleRepo.test.d.ts +0 -1
  148. package/apps/core/src/__tests__/integration/infra/attributeTreeRepo.test.d.ts +0 -1
  149. package/apps/core/src/__tests__/integration/infra/automationRuleRepo.test.d.ts +0 -1
  150. package/apps/core/src/__tests__/integration/infra/integrationTestRepoUtils.d.ts +0 -14
  151. package/apps/core/src/__tests__/integration/infra/notificationRepo.test.d.ts +0 -1
  152. package/apps/core/src/__tests__/integration/infra/permissionRepo.test.d.ts +0 -1
  153. package/apps/core/src/__tests__/integration/infra/ramService.test.d.ts +0 -1
  154. package/apps/core/src/__tests__/integration/infra/recordRepo.test.d.ts +0 -1
  155. package/apps/core/src/__tests__/integration/infra/treeRepo.test.d.ts +0 -1
  156. package/apps/core/src/__tests__/integration/integrationTestUtils.d.ts +0 -7
  157. package/apps/core/src/__tests__/integration/teardown.d.ts +0 -1
  158. package/apps/core/src/__tests__/jestUtils.d.ts +0 -12
  159. package/apps/core/src/__tests__/mockers/amqp.d.ts +0 -8
  160. package/apps/core/src/__tests__/mockers/logger.d.ts +0 -7
  161. package/apps/core/src/__tests__/mocks/actionsList.d.ts +0 -73
  162. package/apps/core/src/__tests__/mocks/apiKey.d.ts +0 -11
  163. package/apps/core/src/__tests__/mocks/application.d.ts +0 -3
  164. package/apps/core/src/__tests__/mocks/attribute.d.ts +0 -45
  165. package/apps/core/src/__tests__/mocks/cache.d.ts +0 -4
  166. package/apps/core/src/__tests__/mocks/file.d.ts +0 -29
  167. package/apps/core/src/__tests__/mocks/forms.d.ts +0 -4
  168. package/apps/core/src/__tests__/mocks/globalSettings.d.ts +0 -2
  169. package/apps/core/src/__tests__/mocks/graphql-upload.d.ts +0 -3
  170. package/apps/core/src/__tests__/mocks/library.d.ts +0 -4
  171. package/apps/core/src/__tests__/mocks/log.d.ts +0 -2
  172. package/apps/core/src/__tests__/mocks/plugins.d.ts +0 -2
  173. package/apps/core/src/__tests__/mocks/record.d.ts +0 -3
  174. package/apps/core/src/__tests__/mocks/shared.d.ts +0 -3
  175. package/apps/core/src/__tests__/mocks/task.d.ts +0 -2
  176. package/apps/core/src/__tests__/mocks/translator.d.ts +0 -3
  177. package/apps/core/src/__tests__/mocks/tree.d.ts +0 -3
  178. package/apps/core/src/__tests__/mocks/value.d.ts +0 -2
  179. package/apps/core/src/__tests__/mocks/versionProfile.d.ts +0 -2
  180. package/apps/core/src/__tests__/mocks/view.d.ts +0 -3
  181. package/apps/core/src/__tests__/setup.d.ts +0 -1
  182. package/apps/core/src/app/application/__tests__/applicationApp.spec.d.ts +0 -1
  183. package/apps/core/src/app/auth/__tests__/authApp.spec.d.ts +0 -1
  184. package/apps/core/src/app/core/coreApp.spec.d.ts +0 -1
  185. package/apps/core/src/app/endpoint/endpointApp.spec.d.ts +0 -1
  186. package/apps/core/src/app/graphql/customScalars/any/any.spec.d.ts +0 -1
  187. package/apps/core/src/app/graphql/customScalars/dateTime/dateTime.spec.d.ts +0 -1
  188. package/apps/core/src/app/graphql/customScalars/systemTranslation/systemTranslation.spec.d.ts +0 -1
  189. package/apps/core/src/app/graphql/graphqlApp.spec.d.ts +0 -1
  190. package/apps/core/src/app/helpers/convertOIDCIdentifier.spec.d.ts +0 -1
  191. package/apps/core/src/app/helpers/convertVersionFromGqlFormat.spec.d.ts +0 -1
  192. package/apps/core/src/app/helpers/validateRequestToken.spec.d.ts +0 -1
  193. package/apps/core/src/domain/actions/dateRangeToNumberAction.spec.d.ts +0 -1
  194. package/apps/core/src/domain/actions/encryptAction.spec.d.ts +0 -1
  195. package/apps/core/src/domain/actions/excelCalculationAction.spec.d.ts +0 -1
  196. package/apps/core/src/domain/actions/formatDateAction.spec.d.ts +0 -1
  197. package/apps/core/src/domain/actions/formatDateRangeAction.spec.d.ts +0 -1
  198. package/apps/core/src/domain/actions/formatNumberAction.spec.d.ts +0 -1
  199. package/apps/core/src/domain/actions/inheritanceCalculationAction.spec.d.ts +0 -1
  200. package/apps/core/src/domain/actions/maskValueAction.spec.d.ts +0 -1
  201. package/apps/core/src/domain/actions/parseJSONAction.spec.d.ts +0 -1
  202. package/apps/core/src/domain/actions/toBooleanAction.spec.d.ts +0 -1
  203. package/apps/core/src/domain/actions/toJSONAction.spec.d.ts +0 -1
  204. package/apps/core/src/domain/actions/toLowercaseAction.spec.d.ts +0 -1
  205. package/apps/core/src/domain/actions/toNumberAction.spec.d.ts +0 -1
  206. package/apps/core/src/domain/actions/toStringAction.spec.d.ts +0 -1
  207. package/apps/core/src/domain/actions/toUppercaseAction.spec.d.ts +0 -1
  208. package/apps/core/src/domain/actions/validateEmailAction.spec.d.ts +0 -1
  209. package/apps/core/src/domain/actions/validateFormatAction.spec.d.ts +0 -1
  210. package/apps/core/src/domain/actions/validateRegexAction.spec.d.ts +0 -1
  211. package/apps/core/src/domain/actions/validateURLAction.spec.d.ts +0 -1
  212. package/apps/core/src/domain/actionsList/actionsListDomain.spec.d.ts +0 -1
  213. package/apps/core/src/domain/apiKey/apiKeyDomain.spec.d.ts +0 -1
  214. package/apps/core/src/domain/application/applicationDomain.spec.d.ts +0 -1
  215. package/apps/core/src/domain/attribute/attributeDomain.spec.d.ts +0 -1
  216. package/apps/core/src/domain/attribute/helpers/ifLibraryJoinLinkAttribute.spec.d.ts +0 -1
  217. package/apps/core/src/domain/core/coreDomain.spec.d.ts +0 -1
  218. package/apps/core/src/domain/eventsManager/eventsManagerDomain.spec.d.ts +0 -1
  219. package/apps/core/src/domain/export/exportDomain.spec.d.ts +0 -1
  220. package/apps/core/src/domain/export/exportProfileDomain.spec.d.ts +0 -1
  221. package/apps/core/src/domain/filesManager/filesManagerDomain.spec.d.ts +0 -1
  222. package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/handleFileSystemEvent.spec.d.ts +0 -1
  223. package/apps/core/src/domain/filesManager/helpers/messagesHandler/messagesHandler.spec.d.ts +0 -1
  224. package/apps/core/src/domain/form/formDomain.spec.d.ts +0 -1
  225. package/apps/core/src/domain/globalSettings/globalSettingsDomain.spec.d.ts +0 -1
  226. package/apps/core/src/domain/helpers/calculations/calculationVariable.spec.d.ts +0 -1
  227. package/apps/core/src/domain/helpers/calculations/calculationsVariableFunctions.spec.d.ts +0 -1
  228. package/apps/core/src/domain/import/importDomain.spec.d.ts +0 -1
  229. package/apps/core/src/domain/indexationManager/indexationManagerDomain.spec.d.ts +0 -1
  230. package/apps/core/src/domain/library/helpers/runPreDelete.spec.d.ts +0 -1
  231. package/apps/core/src/domain/library/libraryDomain.spec.d.ts +0 -1
  232. package/apps/core/src/domain/log/logDomain.spec.d.ts +0 -1
  233. package/apps/core/src/domain/permission/adminPermissionDomain.spec.d.ts +0 -1
  234. package/apps/core/src/domain/permission/applicationPermissionDomain.spec.d.ts +0 -1
  235. package/apps/core/src/domain/permission/attributePermissionDomain.spec.d.ts +0 -1
  236. package/apps/core/src/domain/permission/helpers/defaultPermission.spec.d.ts +0 -1
  237. package/apps/core/src/domain/permission/helpers/getPermissionCacheKey.spec.d.ts +0 -1
  238. package/apps/core/src/domain/permission/helpers/getPermissionCachePatternKey.spec.d.ts +0 -1
  239. package/apps/core/src/domain/permission/helpers/globalPermission.spec.d.ts +0 -1
  240. package/apps/core/src/domain/permission/helpers/permissionByUserGroups.spec.d.ts +0 -1
  241. package/apps/core/src/domain/permission/helpers/permissionsByActions.spec.d.ts +0 -1
  242. package/apps/core/src/domain/permission/helpers/reducePermissionsArray.spec.d.ts +0 -1
  243. package/apps/core/src/domain/permission/helpers/simplePermission.spec.d.ts +0 -1
  244. package/apps/core/src/domain/permission/helpers/treeBasedPermissions.spec.d.ts +0 -1
  245. package/apps/core/src/domain/permission/libraryPermissionDomain.spec.d.ts +0 -1
  246. package/apps/core/src/domain/permission/permissionDomain.spec.d.ts +0 -1
  247. package/apps/core/src/domain/permission/recordAttributePermissionDomain.spec.d.ts +0 -1
  248. package/apps/core/src/domain/permission/recordPermissionDomain.spec.d.ts +0 -1
  249. package/apps/core/src/domain/permission/treeLibraryPermissionDomain.spec.d.ts +0 -1
  250. package/apps/core/src/domain/permission/treeNodePermissionDomain.spec.d.ts +0 -1
  251. package/apps/core/src/domain/permission/treePermissionDomain.spec.d.ts +0 -1
  252. package/apps/core/src/domain/plugins/pluginsDomain.spec.d.ts +0 -1
  253. package/apps/core/src/domain/record/helpers/findRecords.spec.d.ts +0 -1
  254. package/apps/core/src/domain/record/helpers/getRecordIdentity.spec.d.ts +0 -1
  255. package/apps/core/src/domain/record/recordDomain.spec.d.ts +0 -1
  256. package/apps/core/src/domain/tasksManager/cronTasksManagerDomain.spec.d.ts +0 -1
  257. package/apps/core/src/domain/tasksManager/tasksManagerDomain.spec.d.ts +0 -1
  258. package/apps/core/src/domain/tree/helpers/getDefaultElement.spec.d.ts +0 -1
  259. package/apps/core/src/domain/tree/helpers/handleRemovedLibraries.spec.d.ts +0 -1
  260. package/apps/core/src/domain/tree/helpers/treeDataValidation.spec.d.ts +0 -1
  261. package/apps/core/src/domain/tree/treeDomain.spec.d.ts +0 -1
  262. package/apps/core/src/domain/user/userDomain.spec.d.ts +0 -1
  263. package/apps/core/src/domain/value/helpers/areValuesIdentical.spec.d.ts +0 -1
  264. package/apps/core/src/domain/value/helpers/formatLogValue.spec.d.ts +0 -1
  265. package/apps/core/src/domain/value/helpers/getRecordFieldValue.spec.d.ts +0 -1
  266. package/apps/core/src/domain/value/helpers/getValues.spec.d.ts +0 -1
  267. package/apps/core/src/domain/value/valueDomain.spec.d.ts +0 -1
  268. package/apps/core/src/domain/versionProfile/versionProfileDomain.spec.d.ts +0 -1
  269. package/apps/core/src/domain/view/viewDomain.spec.d.ts +0 -1
  270. package/apps/core/src/infra/apiKey/apiKeyRepo.spec.d.ts +0 -1
  271. package/apps/core/src/infra/application/applicationRepo.spec.d.ts +0 -1
  272. package/apps/core/src/infra/attribute/attributeRepo.spec.d.ts +0 -1
  273. package/apps/core/src/infra/attributeTypes/attributeAdvancedLinkRepo.spec.d.ts +0 -1
  274. package/apps/core/src/infra/attributeTypes/attributeAdvancedRepo.spec.d.ts +0 -1
  275. package/apps/core/src/infra/attributeTypes/attributeSimpleLinkRepo.spec.d.ts +0 -1
  276. package/apps/core/src/infra/attributeTypes/attributeSimpleRepo.spec.d.ts +0 -1
  277. package/apps/core/src/infra/attributeTypes/attributeTreeRepo.spec.d.ts +0 -1
  278. package/apps/core/src/infra/attributeTypes/attributeTypesRepo.spec.d.ts +0 -1
  279. package/apps/core/src/infra/db/dbService.spec.d.ts +0 -1
  280. package/apps/core/src/infra/db/dbUtils.spec.d.ts +0 -1
  281. package/apps/core/src/infra/filesManager/filesManagerRepo.spec.d.ts +0 -1
  282. package/apps/core/src/infra/form/formRepo.spec.d.ts +0 -1
  283. package/apps/core/src/infra/globalSettings/globalSettingsRepo.spec.d.ts +0 -1
  284. package/apps/core/src/infra/indexation/helpers/getSearchQuery.spec.d.ts +0 -1
  285. package/apps/core/src/infra/library/libraryRepo.spec.d.ts +0 -1
  286. package/apps/core/src/infra/log/logRepo.spec.d.ts +0 -1
  287. package/apps/core/src/infra/oidc/__tests__/oidcClient.spec.d.ts +0 -1
  288. package/apps/core/src/infra/oidc/__tests__/oidcClientService.spec.d.ts +0 -1
  289. package/apps/core/src/infra/permission/permissionRepo.spec.d.ts +0 -1
  290. package/apps/core/src/infra/plugins/pluginsRepo.spec.d.ts +0 -1
  291. package/apps/core/src/infra/record/helpers/filterTypes.spec.d.ts +0 -1
  292. package/apps/core/src/infra/record/helpers/getClassifyingFiltersVariableQueryPart.spec.d.ts +0 -1
  293. package/apps/core/src/infra/record/helpers/getSearchVariableName.spec.d.ts +0 -1
  294. package/apps/core/src/infra/record/helpers/getSearchVariablesQueryPart.spec.d.ts +0 -1
  295. package/apps/core/src/infra/record/recordRepo.spec.d.ts +0 -1
  296. package/apps/core/src/infra/task/taskRepo.spec.d.ts +0 -1
  297. package/apps/core/src/infra/tree/treeRepo.spec.d.ts +0 -1
  298. package/apps/core/src/infra/userData/userDataRepo.spec.d.ts +0 -1
  299. package/apps/core/src/infra/value/valueRepo.spec.d.ts +0 -1
  300. package/apps/core/src/infra/versionProfile/versionProfileRepo.spec.d.ts +0 -1
  301. package/apps/core/src/infra/view/viewRepo.spec.d.ts +0 -1
  302. package/apps/core/src/interface/helpers/handleGraphqlError.spec.d.ts +0 -1
  303. package/apps/core/src/utils/dataloader.spec.d.ts +0 -1
  304. package/apps/core/src/utils/helpers/getValuesToDisplay.spec.d.ts +0 -1
  305. package/apps/core/src/utils/typeGuards/typeGuards.spec.d.ts +0 -1
  306. package/apps/core/src/utils/utils.spec.d.ts +0 -1
  307. /package/apps/core/{scripts/preload.d.ts → src/pluginsModuleResolver.d.ts} +0 -0
@@ -9,6 +9,9 @@ export declare namespace server {
9
9
  let allowIntrospection: boolean;
10
10
  let uploadLimit: string;
11
11
  let supportEmail: string;
12
+ namespace trpc {
13
+ let ssePingIntervalMs: string | number;
14
+ }
12
15
  namespace admin {
13
16
  let login: string;
14
17
  let password: string;
@@ -105,6 +108,10 @@ export declare namespace actions {
105
108
  namespace excel {
106
109
  let debug: boolean;
107
110
  }
111
+ namespace jexl {
112
+ let debug_1: boolean;
113
+ export { debug_1 as debug };
114
+ }
108
115
  }
109
116
  export declare namespace bugsnag {
110
117
  let enable_1: boolean;
@@ -230,7 +237,7 @@ export declare namespace indexationManager {
230
237
  }
231
238
  export { queues_3 as queues };
232
239
  }
233
- declare let debug_1: boolean;
240
+ declare let debug_2: boolean;
234
241
  export declare let defaultUserId: string;
235
242
  export declare namespace _export {
236
243
  let directory_1: string;
@@ -291,4 +298,4 @@ export declare namespace automation {
291
298
  let enable_7: boolean;
292
299
  export { enable_7 as enable };
293
300
  }
294
- export { debug_1 as debug, _export as export, _import as import };
301
+ export { debug_2 as debug, _export as export, _import as import };
@@ -1,4 +1,5 @@
1
1
  import { type EventAction, type IDbPayload } from '@leav/utils';
2
+ import { type AutomationRulePipeline } from '../domain/automation/pipeline/_types';
2
3
  export type IAutomationRule = ICoreEntity & {
3
4
  createdAt: number;
4
5
  createdBy: string;
@@ -9,24 +10,34 @@ export type IAutomationRule = ICoreEntity & {
9
10
  description?: string;
10
11
  active: boolean;
11
12
  trigger: AutomationRuleTrigger;
13
+ pipeline: AutomationRulePipeline;
12
14
  };
13
15
  export type ICreateAutomationRule = {
14
16
  label: string;
15
17
  description?: string;
16
18
  trigger: AutomationRuleTrigger;
19
+ pipeline: AutomationRulePipeline;
20
+ active: boolean;
17
21
  };
18
22
  export type IUpdateAutomationRule = {
19
23
  id: string;
20
24
  label?: string;
21
25
  description?: string;
22
26
  active?: boolean;
23
- trigger?: Partial<AutomationRuleTrigger>;
24
- };
25
- export type AutomationRuleTrigger = {
26
- synchronous: boolean;
27
- eventAction: EventAction | SyncAutomationRuleEventAction;
28
- eventTopic?: IDbPayload['topic'];
27
+ trigger?: AutomationRuleTrigger;
28
+ pipeline?: AutomationRulePipeline;
29
29
  };
30
+ export declare enum AutomationRuleJsonSchemaFormType {
31
+ CREATION = "creation",
32
+ EDITION = "edition"
33
+ }
30
34
  export declare enum SyncAutomationRuleEventAction {
31
35
  RECORD_INIT = "RECORD_INIT"
32
36
  }
37
+ export type AutomationRuleEventAction = EventAction | SyncAutomationRuleEventAction;
38
+ export type AutomationRulesEventTopic = IDbPayload['topic'];
39
+ export type AutomationRuleTrigger = {
40
+ synchronous: boolean;
41
+ eventAction: AutomationRuleEventAction;
42
+ eventTopic?: AutomationRulesEventTopic;
43
+ };
@@ -60,6 +60,9 @@ export interface IServer {
60
60
  allowIntrospection: boolean;
61
61
  uploadLimit: number | string;
62
62
  supportEmail: string;
63
+ trpc: {
64
+ ssePingIntervalMs: number;
65
+ };
63
66
  admin: {
64
67
  login: string;
65
68
  password: string;
@@ -77,6 +80,12 @@ export interface IActions {
77
80
  */
78
81
  debug: boolean;
79
82
  };
83
+ jexl: {
84
+ /**
85
+ * Add debug log for each calculation with formula and result or error
86
+ */
87
+ debug: boolean;
88
+ };
80
89
  }
81
90
  export interface IDb {
82
91
  url: string;
@@ -7,6 +7,11 @@ export declare enum ErrorTypes {
7
7
  export declare enum Errors {
8
8
  APP_STUDIO_WORKSPACE_LIBRARY_ID_REQUIRED = "APP_STUDIO_WORKSPACE_LIBRARY_ID_REQUIRED",
9
9
  APP_STUDIO_WORKSPACE_RECORD_ID_REQUIRED = "APP_STUDIO_WORKSPACE_RECORD_ID_REQUIRED",
10
+ AUTOMATION_UNKNOWN_TRIGGER_EVENT_ACTION = "AUTOMATION_UNKNOWN_TRIGGER_EVENT_ACTION",
11
+ AUTOMATION_INVALID_TRIGGER_EVENT_TOPIC = "AUTOMATION_INVALID_TRIGGER_EVENT_TOPIC",
12
+ AUTOMATION_INVALID_TRIGGER_ONLY_SYNC = "AUTOMATION_INVALID_TRIGGER_ONLY_SYNC",
13
+ AUTOMATION_INVALID_TRIGGER_ONLY_ASYNC = "AUTOMATION_INVALID_TRIGGER_ONLY_ASYNC",
14
+ AUTOMATION_RULE_PIPELINE_EMPTY = "AUTOMATION_RULE_PIPELINE_EMPTY",
10
15
  ATTRIBUTE_USED_BY_LIBRARY = "ATTRIBUTE_USED_BY_LIBRARY",
11
16
  ATTRIBUTE_USED_IN_METADATA = "ATTRIBUTE_USED_IN_METADATA",
12
17
  CANNOT_SAVE_METADATA = "CANNOT_SAVE_METADATA",
@@ -28,6 +33,8 @@ export declare enum Errors {
28
33
  FORMAT_ERROR = "FORMAT_ERROR",
29
34
  IMMUTABLE_CORE_SYSTEM_ATTRIBUTE = "IMMUTABLE_CORE_SYSTEM_ATTRIBUTE",
30
35
  INVALID_ACTION_TYPE = "INVALID_ACTION_TYPE",
36
+ INVALID_AUTOMATION_ACTION_PARAMS = "INVALID_AUTOMATION_ACTION_PARAMS",
37
+ INVALID_AUTOMATION_ACTION_TYPE = "INVALID_AUTOMATION_ACTION_TYPE",
31
38
  INVALID_ATTRIBUTE_TYPE = "INVALID_ATTRIBUTE_TYPE",
32
39
  INVALID_ATTRIBUTE_FILTER_FORMAT = "INVALID_ATTRIBUTE_FILTER_FORMAT",
33
40
  INVALID_ATTRIBUTE_FOR_LIBRARY = "INVALID_ATTRIBUTE_FOR_LIBRARY",
@@ -45,6 +52,7 @@ export declare enum Errors {
45
52
  INVALID_MAPPING = "INVALID_MAPPING",
46
53
  INVALID_PERMISSIONS_CONF_LIBRARIES = "INVALID_PERMISSIONS_CONF_LIBRARIES",
47
54
  INVALID_REGEXP = "INVALID_REGEXP",
55
+ INVALID_JEXL_EXPRESSION = "INVALID_JEXL_EXPRESSION",
48
56
  INVALID_SORT_FIELDS = "INVALID_SORT_FIELDS",
49
57
  INVALID_TREE_FILTER_FORMAT = "INVALID_TREE_FILTER_FORMAT",
50
58
  INVALID_URL = "INVALID_URL",
@@ -10,6 +10,7 @@ import { type IVersionProfile } from './versionProfile';
10
10
  import { type IPermission } from './permissions';
11
11
  import { type ITreeDbEvent, type ITree } from './tree';
12
12
  import { type IAutomationRule } from './automation';
13
+ import { type IAutomationPipelineFailure, type IAutomationPipelineSuccess } from '../domain/automation/pipeline/_types';
13
14
  type OnlyObject<T> = T extends object ? T : never;
14
15
  /**
15
16
  * Maybe move all DBPayloadData types in @leav/utils type to allow event consumers outside core to use them
@@ -33,6 +34,8 @@ interface IDBPayloadDataMap {
33
34
  [EventAction.APP_DELETE]: IApplication;
34
35
  [EventAction.AUTOMATION_RULE_CREATE]: IAutomationRule;
35
36
  [EventAction.AUTOMATION_RULE_UPDATE]: IAutomationRule;
37
+ [EventAction.AUTOMATION_PIPELINE_SUCCESS]: IAutomationPipelineSuccess;
38
+ [EventAction.AUTOMATION_PIPELINE_FAILURE]: IAutomationPipelineFailure;
36
39
  [EventAction.GLOBAL_SETTINGS_SAVE]: IGlobalSettings;
37
40
  [EventAction.LIBRARY_SAVE]: ILibraryDbEvent;
38
41
  [EventAction.LIBRARY_DELETE]: ILibraryDbEvent;
@@ -1,4 +1,5 @@
1
1
  import { type INotification } from './notification';
2
+ import { type IRecord } from './record';
2
3
  import { type ITask } from './tasksManager';
3
4
  export declare enum TriggerNames {
4
5
  APPLICATION_EVENT = "APPLICATION_EVENT",
@@ -7,6 +8,7 @@ export declare enum TriggerNames {
7
8
  TASK = "TASK",
8
9
  TREE_EVENT = "TREE_EVENT",
9
10
  RECORD_UPDATE = "RECORD_UPDATE",
11
+ RECORD_NEW_COMMENT = "RECORD_NEW_COMMENT",
10
12
  NOTIFICATION = "NOTIFICATION"
11
13
  }
12
14
  export interface IPubSubNotificationData {
@@ -16,3 +18,9 @@ export interface IPubSubNotificationData {
16
18
  export interface IPubSubTaskData {
17
19
  task: ITask;
18
20
  }
21
+ export interface IPubSubRecordNewCommentData {
22
+ recordNewComment: {
23
+ record: IRecord;
24
+ comment: IRecord;
25
+ };
26
+ }
@@ -4,6 +4,7 @@ import { type PermissionTypes } from './permissions';
4
4
  import { type PluginRegisterRoute } from './endpoint';
5
5
  import { type AuthPostOidcLoginCallback } from './auth';
6
6
  import { type RegisterCronTask } from './cronTask';
7
+ import { type ITRPCRouterFactory } from '../app/trpc/trpcApp';
7
8
  export interface IExtensionPoints {
8
9
  [name: string]: (...args: any[]) => void;
9
10
  }
@@ -16,6 +17,7 @@ export interface IExtensionPointsFunctions extends IExtensionPoints {
16
17
  * @param {IAppGraphQLSchema} schemaPart
17
18
  */
18
19
  registerGraphQLSchema: (schemaPart: IAppGraphQLSchema) => void;
20
+ registerTRPCRouter: (initRouter: ITRPCRouterFactory) => void;
19
21
  registerTranslations: (path: string) => Promise<void>;
20
22
  registerPermissionActions: (type: PermissionTypes, actions: string[], applyOn?: string[]) => void;
21
23
  registerEventActions: (actions: string[], prefix: string) => void;
@@ -102,6 +102,7 @@ export interface IRecordUpdateEventFilters {
102
102
  libraries?: string[];
103
103
  records?: string[];
104
104
  }
105
+ export type IRecordCommentEventFilters = IRecordUpdateEventFilters;
105
106
  export interface IRecordFilterLight {
106
107
  field?: string;
107
108
  value?: string;
@@ -2,11 +2,13 @@ import { type IGraphqlAppModule } from '../graphql/graphqlApp';
2
2
  import { type IAutomationDomain } from '../../domain/automation/automationDomain';
3
3
  import { type IAutomationRule } from '../../_types/automation';
4
4
  import { type IPaginationParams, type ISortParams } from '../../_types/list';
5
- import { type IEventsManagerDomain } from '../../domain/eventsManager/eventsManagerDomain';
5
+ import { type IAutomationTriggers } from '../../domain/automation/triggers/automationTriggers';
6
+ import { type IAutomationTriggersRegistry } from '../..//domain/automation/triggers/automationTriggersRegistry';
6
7
  export type ICoreImportApp = IGraphqlAppModule;
7
8
  interface IAutomationAppDeps {
8
9
  'core.domain.automation': IAutomationDomain;
9
- 'core.domain.eventsManager': IEventsManagerDomain;
10
+ 'core.domain.automation.triggers': IAutomationTriggers;
11
+ 'core.domain.automation.triggers.registry': IAutomationTriggersRegistry;
10
12
  }
11
13
  export interface IGetAutomationRulesArgs {
12
14
  filters?: ICoreEntityFilterOptions & {
@@ -18,5 +20,5 @@ export interface IGetAutomationRulesArgs {
18
20
  pagination?: IPaginationParams;
19
21
  sort?: ISortParams;
20
22
  }
21
- export default function ({ 'core.domain.automation': automationDomain, 'core.domain.eventsManager': eventsManagerDomain, }: IAutomationAppDeps): ICoreImportApp;
23
+ export default function ({ 'core.domain.automation': automationDomain, 'core.domain.automation.triggers': automationTriggers, 'core.domain.automation.triggers.registry': automationTriggersRegistry, }: IAutomationAppDeps): ICoreImportApp;
22
24
  export {};
@@ -0,0 +1 @@
1
+ export { default } from './trpcApp';
@@ -0,0 +1,30 @@
1
+ import { type IAppModule } from '../../_types/shared';
2
+ import { type IQueryInfos } from '../../_types/queryInfos';
3
+ import { type CreateExpressContextOptions } from '@trpc/server/adapters/express';
4
+ import { type Handler } from 'express';
5
+ import { type IConfig } from '../../_types/config';
6
+ import { type ILogger } from '@leav/logger';
7
+ export interface ITRPCApp extends IAppModule {
8
+ createExpressHandler: (initContext: (opts: CreateExpressContextOptions) => Promise<IQueryInfos>) => Handler;
9
+ }
10
+ declare const createTrpc: (config: IConfig) => import("@trpc/server").TRPCRootObject<IQueryInfos, object, {
11
+ sse: {
12
+ ping: {
13
+ enabled: true;
14
+ intervalMs: number;
15
+ };
16
+ };
17
+ }, {
18
+ ctx: IQueryInfos;
19
+ meta: object;
20
+ errorShape: import("@trpc/server").TRPCDefaultErrorShape;
21
+ transformer: false;
22
+ }>;
23
+ export type TTrpc = ReturnType<typeof createTrpc>;
24
+ export type ITRPCRouterFactory = (trpc: TTrpc) => ReturnType<TTrpc['router']>;
25
+ interface IDeps {
26
+ config: IConfig;
27
+ 'core.utils.logger'?: ILogger;
28
+ }
29
+ export default function ({ config, 'core.utils.logger': logger }: IDeps): ITRPCApp;
30
+ export {};
@@ -1,6 +1,7 @@
1
1
  export { default as dateRangeToNumberAction } from './dateRangeToNumberAction';
2
2
  export { default as encryptAction } from './encryptAction';
3
3
  export { default as excelAction } from './excelCalculationAction';
4
+ export { default as jexlCalculationAction } from './jexlCalculationAction';
4
5
  export { default as formatDateAction } from './formatDateAction';
5
6
  export { default as formatDateRangeAction } from './formatDateRangeAction';
6
7
  export { default as formatNumberAction } from './formatNumberAction';
@@ -0,0 +1,14 @@
1
+ import { type IJexlDomain } from '../jexl/jexlDomain';
2
+ import { type IActionsListFunction } from '../../_types/actionsList';
3
+ import { type IConfig } from '../../_types/config';
4
+ interface IDeps {
5
+ 'core.domain.jexl': IJexlDomain;
6
+ config: IConfig;
7
+ }
8
+ type ActionParams = {
9
+ Formula: true;
10
+ Description: true;
11
+ ['Return only calculated value']: false;
12
+ };
13
+ export default function ({ 'core.domain.jexl': jexlDomain, config }: IDeps): IActionsListFunction<ActionParams>;
14
+ export {};
@@ -0,0 +1,35 @@
1
+ import { type ZodObject } from 'zod';
2
+ import { type AutomationRulePipelineStep, type IAutomationPipelineExecutionState } from '../pipeline/_types';
3
+ import { type IQueryInfos } from '../../../_types/queryInfos';
4
+ import { type AutomationRuleTrigger } from '../../../_types/automation';
5
+ export declare enum AutomationRuleActions {
6
+ LOG = "log",
7
+ CONDITION = "condition",
8
+ ERROR = "error",
9
+ JEXL_CALCULATION = "jexlCalculation",
10
+ MODIFY_ATTRIBUTE = "modifyAttribute",
11
+ NOTIFICATION = "notification"
12
+ }
13
+ export type AutomationPipelineStepValidation<Params = unknown> = {
14
+ readonly step: AutomationRulePipelineStep<Params>;
15
+ readonly stepIndex: number;
16
+ readonly trigger: AutomationRuleTrigger;
17
+ readonly precedingStepsByExecOrder: AutomationRulePipelineStep[];
18
+ };
19
+ export interface IAutomationAction<Params = unknown> {
20
+ readonly type: AutomationRuleActions | string;
21
+ readonly paramsSchema: ZodObject<any>;
22
+ validateStep?: (params: AutomationPipelineStepValidation<Params>, ctx: IQueryInfos) => Promise<void>;
23
+ execute(params: Params, state: IAutomationPipelineExecutionState, ctx: IQueryInfos): Promise<IActionExecutionResult | void>;
24
+ }
25
+ export declare enum ActionExecutionResultStatus {
26
+ CONTINUE = "continue",
27
+ STOP = "stop"
28
+ }
29
+ export type IActionExecutionResult = {
30
+ status: ActionExecutionResultStatus.CONTINUE;
31
+ result?: unknown;
32
+ } | {
33
+ status: ActionExecutionResultStatus.STOP;
34
+ reason?: string;
35
+ };
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { type IAutomationAction } from './_types';
3
+ import { type BuildAutomationJexlContext } from '../pipeline/buildAutomationJexlContext';
4
+ import { type IJexlDomain } from '../../jexl/jexlDomain';
5
+ declare const conditionActionParamsSchema: z.ZodObject<{
6
+ expression: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type ConditionActionParams = z.infer<typeof conditionActionParamsSchema>;
9
+ interface IConditionActionDeps {
10
+ 'core.domain.jexl': IJexlDomain;
11
+ 'core.domain.automation.pipeline.buildAutomationJexlContext': BuildAutomationJexlContext;
12
+ }
13
+ export default function ({ 'core.domain.jexl': jexl, 'core.domain.automation.pipeline.buildAutomationJexlContext': buildAutomationJexlContext, }: IConditionActionDeps): IAutomationAction<ConditionActionParams>;
14
+ export {};
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { type IAutomationAction } from './_types';
3
+ declare const errorActionParamsSchema: z.ZodObject<{
4
+ message: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type ErrorActionParams = z.infer<typeof errorActionParamsSchema>;
7
+ export default function (): IAutomationAction<ErrorActionParams>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ export { default as condition } from './conditionAction';
2
+ export { default as error } from './errorAction';
3
+ export { default as log } from './logAction';
4
+ export { default as jexlCalculation } from './jexlCalculationAutomationAction';
5
+ export { default as modifyAttribute } from './modifyAttributeAction';
6
+ export { default as notification } from './notificationAction';
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { type IJexlDomain } from '../../jexl/jexlDomain';
3
+ import { type IConfig } from '../../../_types/config';
4
+ import { type IAutomationAction } from './_types';
5
+ import { type BuildAutomationJexlContext } from '../pipeline/buildAutomationJexlContext';
6
+ declare const jexlCalculationActionParamsSchema: z.ZodObject<{
7
+ formula: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export type JexlCalculationActionParams = z.infer<typeof jexlCalculationActionParamsSchema>;
10
+ interface IDeps {
11
+ 'core.domain.jexl': IJexlDomain;
12
+ config: IConfig;
13
+ 'core.domain.automation.pipeline.buildAutomationJexlContext': BuildAutomationJexlContext;
14
+ }
15
+ export default function ({ 'core.domain.jexl': jexlDomain, config, 'core.domain.automation.pipeline.buildAutomationJexlContext': buildAutomationJexlContext, }: IDeps): IAutomationAction<JexlCalculationActionParams>;
16
+ export {};
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { type IAutomationAction } from './_types';
3
+ declare const logActionParamsSchema: z.ZodObject<{
4
+ message: z.ZodString;
5
+ level: z.ZodOptional<z.ZodEnum<{
6
+ info: "info";
7
+ error: "error";
8
+ debug: "debug";
9
+ silly: "silly";
10
+ verbose: "verbose";
11
+ warn: "warn";
12
+ }>>;
13
+ }, z.core.$strip>;
14
+ export type LogActionParams = z.infer<typeof logActionParamsSchema>;
15
+ export default function (): IAutomationAction<LogActionParams>;
16
+ export {};
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { type IAutomationAction } from './_types';
3
+ import { type IValueDomain } from '../../value/valueDomain';
4
+ import { type IAttributeDomain } from '../../attribute/attributeDomain';
5
+ import { type IValidateHelper } from '../../helpers/validate';
6
+ declare const modifyAttributeActionParamsSchema: z.ZodObject<{
7
+ attributePath: z.ZodString;
8
+ mode: z.ZodEnum<{
9
+ replace: "replace";
10
+ add: "add";
11
+ }>;
12
+ }, z.core.$strip>;
13
+ export type ModifyAttributeActionParams = z.infer<typeof modifyAttributeActionParamsSchema>;
14
+ interface IDeps {
15
+ 'core.domain.value': IValueDomain;
16
+ 'core.domain.attribute': IAttributeDomain;
17
+ 'core.domain.helpers.validate': IValidateHelper;
18
+ }
19
+ export default function ({ 'core.domain.value': valueDomain, 'core.domain.attribute': attributeDomain, 'core.domain.helpers.validate': validateHelper, }: IDeps): IAutomationAction<ModifyAttributeActionParams>;
20
+ export {};
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { type IAutomationAction } from './_types';
3
+ import { type IJexlDomain } from '../../jexl/jexlDomain';
4
+ import { type INotificationDomain } from '../../notification/notificationDomain';
5
+ import { type BuildAutomationJexlContext } from '../pipeline/buildAutomationJexlContext';
6
+ declare const notificationActionParamsSchema: z.ZodObject<{
7
+ title: z.ZodString;
8
+ recipients: z.ZodString;
9
+ message: z.ZodString;
10
+ mail: z.ZodOptional<z.ZodBoolean>;
11
+ }, z.core.$strip>;
12
+ export type NotificationActionParams = z.infer<typeof notificationActionParamsSchema>;
13
+ interface INotificationActionDeps {
14
+ 'core.domain.jexl': IJexlDomain;
15
+ 'core.domain.notification': INotificationDomain;
16
+ 'core.domain.automation.pipeline.buildAutomationJexlContext': BuildAutomationJexlContext;
17
+ }
18
+ export default function ({ 'core.domain.jexl': jexl, 'core.domain.notification': notification, 'core.domain.automation.pipeline.buildAutomationJexlContext': buildAutomationJexlContext, }: INotificationActionDeps): IAutomationAction<NotificationActionParams>;
19
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type AwilixContainer } from 'awilix';
2
+ import { type IAutomationAction, type AutomationRuleActions } from './actions/_types';
3
+ export interface IAutomationActionsRegistry {
4
+ getAction(type: AutomationRuleActions | string): IAutomationAction | undefined;
5
+ listAvailableActions(): IAutomationAction[];
6
+ }
7
+ export interface IAutomationActionsRegistryDeps {
8
+ 'core.depsManager': AwilixContainer;
9
+ }
10
+ export default function ({ 'core.depsManager': depsManager, }: IAutomationActionsRegistryDeps): IAutomationActionsRegistry;
@@ -1,4 +1,4 @@
1
- import { type ICreateAutomationRule, type IAutomationRule, type IUpdateAutomationRule } from '../../_types/automation';
1
+ import { type ICreateAutomationRule, type IAutomationRule, type IUpdateAutomationRule, type AutomationRulesEventTopic, type AutomationRuleEventAction, type AutomationRuleJsonSchemaFormType } from '../../_types/automation';
2
2
  import { type IList } from '../../_types/list';
3
3
  import { type IQueryInfos } from '../../_types/queryInfos';
4
4
  import { type IGetCoreEntitiesParams } from '../../_types/shared';
@@ -6,19 +6,41 @@ import { type IAutomationRuleRepo } from '../../infra/automation/automationRuleR
6
6
  import { type IAdminPermissionDomain } from '../permission/adminPermissionDomain';
7
7
  import { type IEventsManagerDomain } from '../eventsManager/eventsManagerDomain';
8
8
  import { type IConfig } from '../../_types/config';
9
+ import { type IAutomationPipelineDomain } from './pipeline/pipeline';
10
+ import { type IAutomationTriggers } from './triggers/automationTriggers';
11
+ import { type AutomationTriggerDef } from './triggers/_types';
12
+ import { type IAutomationJsonSchemaFormDomain } from './form/automationJsonSchemaForm';
13
+ import { type IAutomationUiJsonSchemaFormDomain } from './form/automationUiJsonSchemaForm';
14
+ import { type UiSchema, type RJSFSchema } from '@rjsf/utils';
9
15
  export interface IGetAutomationRulesParams extends IGetCoreEntitiesParams {
10
16
  filters?: ICoreEntityFilterOptions & {
11
17
  active?: boolean;
12
18
  synchronous?: boolean;
13
- eventAction?: IAutomationRule['trigger']['eventAction'];
14
- eventTopic?: IAutomationRule['trigger']['eventTopic'];
19
+ eventAction?: AutomationRuleEventAction;
20
+ eventTopic?: AutomationRulesEventTopic;
15
21
  };
16
22
  }
23
+ interface ITriggerRulesParams {
24
+ event: {
25
+ action: IAutomationRule['trigger']['eventAction'];
26
+ topic?: IAutomationRule['trigger']['eventTopic'];
27
+ };
28
+ synchronous: boolean;
29
+ ctx: IQueryInfos;
30
+ }
17
31
  export interface IAutomationDomain {
18
32
  getAutomationRules({ params, ctx, }: {
19
33
  params: IGetAutomationRulesParams;
20
34
  ctx: IQueryInfos;
21
35
  }): Promise<IList<IAutomationRule>>;
36
+ getAutomationRuleJsonSchemaForm({ formType, ctx, }: {
37
+ formType: AutomationRuleJsonSchemaFormType;
38
+ ctx: IQueryInfos;
39
+ }): Promise<RJSFSchema>;
40
+ getAutomationRuleUiJsonSchemaForm({ formType, ctx, }: {
41
+ formType: AutomationRuleJsonSchemaFormType;
42
+ ctx: IQueryInfos;
43
+ }): Promise<UiSchema>;
22
44
  createAutomationRule({ rule, ctx }: {
23
45
  rule: ICreateAutomationRule;
24
46
  ctx: IQueryInfos;
@@ -27,15 +49,24 @@ export interface IAutomationDomain {
27
49
  rule: IUpdateAutomationRule;
28
50
  ctx: IQueryInfos;
29
51
  }): Promise<IAutomationRule>;
30
- triggerRules(event: {
31
- action: IAutomationRule['trigger']['eventAction'];
32
- topic?: IAutomationRule['trigger']['eventTopic'];
33
- }, synchronous: boolean, ctx: IQueryInfos): Promise<void>;
52
+ deleteAutomationRule({ ruleId, ctx }: {
53
+ ruleId: string;
54
+ ctx: IQueryInfos;
55
+ }): Promise<IAutomationRule>;
56
+ triggerRules(params: ITriggerRulesParams): Promise<void>;
57
+ listAutomationTriggersDef({ ctx }: {
58
+ ctx: IQueryInfos;
59
+ }): Promise<AutomationTriggerDef[]>;
34
60
  }
35
61
  export interface IAutomationDomainDeps {
62
+ 'core.domain.automation.triggers': IAutomationTriggers;
63
+ 'core.domain.automation.form': IAutomationJsonSchemaFormDomain;
64
+ 'core.domain.automation.form.uiJsonSchemaForm': IAutomationUiJsonSchemaFormDomain;
36
65
  'core.domain.permission.admin': IAdminPermissionDomain;
37
66
  'core.domain.eventsManager': IEventsManagerDomain;
67
+ 'core.domain.automation.pipeline': IAutomationPipelineDomain;
38
68
  'core.infra.automation.rule': IAutomationRuleRepo;
39
69
  config: IConfig;
40
70
  }
41
- export default function ({ 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.automation.rule': automationRuleRepo, config, }: IAutomationDomainDeps): IAutomationDomain;
71
+ export default function ({ 'core.domain.automation.triggers': automationTriggers, 'core.domain.automation.form': automationJsonSchemaFormDomain, 'core.domain.automation.form.uiJsonSchemaForm': automationUiJsonSchemaFormDomain, 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.automation.pipeline': pipelineDomain, 'core.infra.automation.rule': automationRuleRepo, config, }: IAutomationDomainDeps): IAutomationDomain;
72
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type AutomationRuleEventAction, type AutomationRulesEventTopic, type IAutomationRule } from '../../_types/automation';
2
+ import { type IQueryInfos } from '../../_types/queryInfos';
3
+ export declare const TRIGGER_FAKER_RULES_FOR_DEV = false;
4
+ export declare const buildFakeRulesToTrigger: (event: {
5
+ action: AutomationRuleEventAction;
6
+ topic?: AutomationRulesEventTopic;
7
+ }, synchronous: boolean, ctx: IQueryInfos) => Promise<IAutomationRule[]>;
@@ -0,0 +1,19 @@
1
+ import { AutomationRuleJsonSchemaFormType } from '../../../_types/automation';
2
+ import { type IQueryInfos } from '../../../_types/queryInfos';
3
+ import { type IAutomationTriggersRegistry } from '../triggers/automationTriggersRegistry';
4
+ import { type RJSFSchema } from '@rjsf/utils';
5
+ export interface IAutomationJsonSchemaFormDomain {
6
+ getAutomationRuleJsonSchemaForm({ formType, ctx, }: {
7
+ formType: AutomationRuleJsonSchemaFormType;
8
+ ctx: IQueryInfos;
9
+ }): Promise<RJSFSchema>;
10
+ }
11
+ interface IAutomationJsonSchemaFormDomainDeps {
12
+ 'core.domain.automation.triggers.registry': IAutomationTriggersRegistry;
13
+ }
14
+ export declare const extractAndLiftDefs: (jsonSchema: RJSFSchema) => {
15
+ schema: RJSFSchema;
16
+ defs: Record<string, RJSFSchema>;
17
+ };
18
+ export default function ({ 'core.domain.automation.triggers.registry': automationTriggersRegistry, }: IAutomationJsonSchemaFormDomainDeps): IAutomationJsonSchemaFormDomain;
19
+ export {};
@@ -0,0 +1,15 @@
1
+ import { type i18n } from 'i18next';
2
+ import { type UiSchema } from '@rjsf/utils';
3
+ import { AutomationRuleJsonSchemaFormType } from '../../../_types/automation';
4
+ import { type IQueryInfos } from '../../../_types/queryInfos';
5
+ export interface IAutomationUiJsonSchemaFormDomain {
6
+ getAutomationRuleUiJsonSchemaForm({ formType, ctx, }: {
7
+ formType: AutomationRuleJsonSchemaFormType;
8
+ ctx: IQueryInfos;
9
+ }): Promise<UiSchema>;
10
+ }
11
+ interface IAutomationUiJsonSchemaFormDomainDeps {
12
+ translator: i18n;
13
+ }
14
+ export default function ({ translator }: IAutomationUiJsonSchemaFormDomainDeps): IAutomationUiJsonSchemaFormDomain;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './automationJsonSchemaForm';
2
+ export { default as uiJsonSchemaForm } from './automationUiJsonSchemaForm';
@@ -1 +1,5 @@
1
1
  export { default } from './automationDomain';
2
+ export { default as actionsRegistry } from './automationActionsRegistry';
3
+ export { default as form } from './form';
4
+ export { default as pipeline } from './pipeline';
5
+ export { default as triggers } from './triggers';
@@ -0,0 +1,37 @@
1
+ import { type AutomationRuleTrigger } from '../../../_types/automation';
2
+ import { type AutomationRuleActions } from '../actions/_types';
3
+ export type AutomationRulePipeline = {
4
+ steps: AutomationRulePipelineStep[];
5
+ };
6
+ export type AutomationRulePipelineStep<Params = unknown> = {
7
+ type: AutomationRuleActions | string;
8
+ name?: string;
9
+ params: Params;
10
+ };
11
+ export type IAutomationPipelineFailure = {
12
+ readonly results: Record<string, unknown | {
13
+ stack?: string;
14
+ message: string;
15
+ name: string;
16
+ [k: string]: unknown;
17
+ }>;
18
+ };
19
+ export type IAutomationPipelineSuccess = {
20
+ readonly results: Record<string, unknown>;
21
+ };
22
+ export type IAutomationPipelineExecutionState = {
23
+ readonly trigger: AutomationRuleTrigger;
24
+ readonly results: IAutomationPipelineExecutionResults;
25
+ readonly lastResult?: unknown;
26
+ readonly startDateMs: number;
27
+ stepIndex: number;
28
+ };
29
+ export type IAutomationPipelineExecutionResults = Record<string, unknown>;
30
+ export type AutomationPipeline = AutomationRulePipeline;
31
+ export type AutomationPipelineExecution = AutomationPipeline & {
32
+ trigger: AutomationRuleTrigger;
33
+ ruleId: string;
34
+ };
35
+ export type AutomationPipelineValidation = AutomationPipeline & {
36
+ trigger: AutomationRuleTrigger;
37
+ };
@@ -0,0 +1,9 @@
1
+ import { type IQueryInfos } from '../../../_types/queryInfos';
2
+ import { type IJexlDomain } from '../../jexl/jexlDomain';
3
+ import { type JexlRootContext } from '../../jexl/types';
4
+ import { type IAutomationPipelineExecutionState } from './_types';
5
+ export type BuildAutomationJexlContext = (executionState: IAutomationPipelineExecutionState, ctx: IQueryInfos) => JexlRootContext;
6
+ export interface IBuildAutomationJexlContextDeps {
7
+ 'core.domain.jexl': IJexlDomain;
8
+ }
9
+ export default function ({ 'core.domain.jexl': jexlDomain, }: IBuildAutomationJexlContextDeps): BuildAutomationJexlContext;
@@ -0,0 +1,2 @@
1
+ export { default } from './pipeline';
2
+ export { default as buildAutomationJexlContext } from './buildAutomationJexlContext';