@zohodesk/library-platform 1.1.0-exp.2 → 1.1.1

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 (287) hide show
  1. package/README.md +2 -2
  2. package/es/bc/list-selection/Constants.js +8 -1
  3. package/es/bc/list-selection/Properties.js +6 -2
  4. package/es/bc/{zdata-broker → zdata-source}/Actions.js +6 -6
  5. package/es/bc/{zdata-broker → zdata-source}/Constants.js +6 -5
  6. package/es/bc/zdata-source/EventHandlers.js +2 -0
  7. package/es/bc/zdata-source/Symbols.js +5 -0
  8. package/es/bc/zfield/ActionHandlers.js +1 -1
  9. package/es/bc/zlist/EventHandlers.js +1 -1
  10. package/es/bc/zlist/Properties.js +25 -32
  11. package/es/cc/action-icon/Properties.js +31 -0
  12. package/es/cc/action-location/Properties.js +9 -24
  13. package/es/cc/table-connected/Properties.js +11 -57
  14. package/es/cc/table-connected/constants/Events.js +7 -0
  15. package/es/cc/table-connected/constants/index.js +1 -0
  16. package/es/cc/table-connected/index.js +4 -0
  17. package/es/cc/table-list/Properties.js +44 -2
  18. package/es/cc/table-list/data-types/Header.js +6 -0
  19. package/es/desk-frameworks/table-connected/frameworks/EventHandlersFactory.js +33 -1
  20. package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +118 -2
  21. package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +24 -9
  22. package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +7 -2
  23. package/es/library/behaviours/list-selection/adapters/controllers/AllSelectionController.js +5 -2
  24. package/es/library/behaviours/list-selection/adapters/controllers/DeselectController.js +26 -0
  25. package/es/library/behaviours/list-selection/adapters/controllers/RangeSelectionController.js +4 -2
  26. package/es/library/behaviours/list-selection/adapters/controllers/SelectController.js +26 -0
  27. package/es/library/behaviours/list-selection/adapters/controllers/SelectionController.js +4 -2
  28. package/es/library/behaviours/list-selection/adapters/gateways/Repository.js +3 -3
  29. package/es/library/behaviours/list-selection/adapters/gateways/Service.js +8 -0
  30. package/es/library/behaviours/list-selection/applications/usecases/AllItemSelection.js +5 -1
  31. package/es/library/behaviours/list-selection/applications/usecases/Deselect.js +21 -0
  32. package/es/library/behaviours/list-selection/applications/usecases/ItemsSelection.js +3 -1
  33. package/es/library/behaviours/list-selection/applications/usecases/RangeSelection.js +3 -1
  34. package/es/library/behaviours/list-selection/applications/usecases/Select.js +21 -0
  35. package/es/library/behaviours/list-selection/domain/entities/ListItemSelection.js +86 -28
  36. package/es/library/behaviours/list-selection/frameworks/ActionHandlerFactory.js +5 -1
  37. package/es/library/custom-component/domain/entities/{Events.js → Event.js} +12 -3
  38. package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +4 -2
  39. package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +9 -4
  40. package/es/library/dot/components/table-list/frameworks/ui/TableList.js +1 -2
  41. package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +3 -2
  42. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +5 -2
  43. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +16 -3
  44. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/SelectAll.js +2 -1
  45. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +6 -4
  46. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +16 -3
  47. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +1 -2
  48. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon.js +18 -2
  49. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +75 -1
  50. package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +7 -6
  51. package/es/platform/client-actions/Readme.md +31 -0
  52. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/Readme.md +14 -21
  53. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/ExecuteActionBehaviourUseCase.js +1 -1
  54. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/InitializeUseCase.js +2 -2
  55. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientAction.js +12 -4
  56. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActionManager.js +9 -9
  57. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActions.js +0 -4
  58. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMapping.js +5 -1
  59. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/UIComponentMapping.js +7 -3
  60. package/es/platform/{zclient-actions/frameworks/ClientActionBehaviourFactory.js → client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory.js} +1 -1
  61. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +34 -0
  62. package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +51 -0
  63. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/MountController.js +18 -0
  64. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/PropertiesChangeController.js +26 -0
  65. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/UnmountController.js +18 -0
  66. package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +36 -0
  67. package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +22 -0
  68. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/AbstractUseCase.js +15 -0
  69. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/DestroyUseCase.js +13 -0
  70. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/InitializeUseCase.js +13 -0
  71. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +17 -0
  72. package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +108 -0
  73. package/es/platform/client-actions/components/action-event-mediator/domain/entities/interfaces/IState.js +1 -0
  74. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator.js +13 -0
  75. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +19 -0
  76. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +30 -0
  77. package/es/platform/client-actions/components/dynamic-component/domain/entities/interfaces/IState.js +1 -0
  78. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponent.js +9 -0
  79. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +34 -0
  80. package/es/platform/client-actions/components/interfaces/ActionViewModel.js +7 -0
  81. package/es/platform/client-actions/components/interfaces/EventMappingViewModel.js +0 -0
  82. package/es/platform/client-actions/components/row-actions-renderer/domain/entities/interfaces/IState.js +1 -0
  83. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.js +12 -0
  84. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +17 -0
  85. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +30 -0
  86. package/es/platform/client-actions/template-resolver/index.js +44 -0
  87. package/es/platform/client-actions/template-resolver/interfaces/ITemplate.js +1 -0
  88. package/es/platform/client-actions/translators/client-actions-translator/index.js +29 -0
  89. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEmptyString.js +4 -0
  90. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEndsWith.js +4 -0
  91. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEquals.js +4 -0
  92. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThan.js +4 -0
  93. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThanOrEquals.js +4 -0
  94. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIn.js +4 -0
  95. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsEmpty.js +4 -0
  96. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsNotEmpty.js +4 -0
  97. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThan.js +4 -0
  98. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThanOrEquals.js +4 -0
  99. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLike.js +4 -0
  100. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotEquals.js +4 -0
  101. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotLike.js +4 -0
  102. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalStartsWith.js +4 -0
  103. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/GetResolvedContextFieldValue.js +8 -0
  104. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/index.js +58 -0
  105. package/es/platform/client-actions/translators/condition-resolver/index.js +33 -0
  106. package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/PatternValidator.js +86 -0
  107. package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/index.js +96 -0
  108. package/es/platform/client-actions/translators/context-resolver/index.js +54 -0
  109. package/es/platform/client-actions/translators/interfaces/IContext.js +1 -0
  110. package/es/platform/client-actions/translators/interfaces/IState.js +1 -0
  111. package/es/platform/data-source/dbc/index.js +1 -0
  112. package/es/platform/{data-broker → data-source}/http-template/getAvailableFields.js +5 -5
  113. package/es/platform/{data-broker → data-source}/http-template/getClientActions.js +4 -4
  114. package/es/platform/{data-broker → data-source}/http-template/getSelectedFields.js +5 -5
  115. package/es/platform/{data-broker → data-source}/index.js +2 -2
  116. package/es/platform/{data-broker → data-source}/utils/transformer/CreateCf.js +1 -1
  117. package/es/platform/{zdata-broker/adapters/controllers/DataBrokerExecutorController.js → zdata-source/adapters/controllers/DataSourceExecutorController.js} +1 -1
  118. package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Repository.js +5 -5
  119. package/es/platform/{zdata-broker → zdata-source}/adapters/presenters/Presenter.js +4 -4
  120. package/es/platform/{zdata-broker/applications/entities-factory/DataBrokerFactory.js → zdata-source/applications/entities-factory/DataSourceFactory.js} +3 -4
  121. package/es/platform/zdata-source/applications/interfaces/InputDependencies.js +1 -0
  122. package/es/platform/zdata-source/applications/interfaces/gateways/IRepository.js +1 -0
  123. package/es/platform/zdata-source/applications/interfaces/gateways/IService.js +0 -0
  124. package/es/platform/zdata-source/applications/interfaces/gateways/State.js +1 -0
  125. package/es/platform/zdata-source/applications/interfaces/input/ExecuteActionInputModel.js +1 -0
  126. package/es/platform/zdata-source/applications/interfaces/input/FailureInputModel.js +1 -0
  127. package/es/platform/zdata-source/applications/interfaces/input/NoContentInputModel.js +1 -0
  128. package/es/platform/zdata-source/applications/interfaces/input/RegisterInputModel.js +1 -0
  129. package/es/platform/zdata-source/applications/interfaces/input/SuccessInputModel.js +1 -0
  130. package/es/platform/zdata-source/applications/interfaces/output/IPresenter.js +1 -0
  131. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js +3 -3
  132. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/FailureUseCase.js +3 -3
  133. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/NoContentUseCase.js +3 -3
  134. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/SuccessUseCase.js +4 -4
  135. package/es/platform/{zdata-broker/domain/entities/DataBroker.js → zdata-source/domain/entities/DataSource.js} +12 -12
  136. package/es/platform/zdata-source/domain/entities/interfaces/APIDetailsModel.js +1 -0
  137. package/es/platform/zdata-source/domain/entities/interfaces/APITemplateModel.js +1 -0
  138. package/es/platform/zdata-source/domain/entities/interfaces/APITemplatesModel.js +1 -0
  139. package/es/platform/zdata-source/domain/entities/interfaces/BehaviourState.js +1 -0
  140. package/es/platform/zdata-source/domain/entities/interfaces/EventModel.js +1 -0
  141. package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplate.js +1 -0
  142. package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplates.js +1 -0
  143. package/es/platform/zdata-source/domain/entities/interfaces/IDataSource.js +0 -0
  144. package/es/platform/zdata-source/domain/entities/interfaces/ITemplateHelpers.js +1 -0
  145. package/es/platform/zdata-source/domain/entities/interfaces/MetaData.js +1 -0
  146. package/es/platform/{zdata-broker → zdata-source}/frameworks/DataBrokerBehaviourFactory.js +2 -2
  147. package/es/platform/{zdata-broker → zdata-source}/frameworks/EventHandlersFactory.js +7 -12
  148. package/es/platform/zfield/applications/usecases/ExecuteActionUseCase.js +1 -1
  149. package/es/platform/zfield/applications/usecases/InitializeUseCase.js +2 -2
  150. package/es/platform/zfield/applications/usecases/RefetchUseCase.js +1 -1
  151. package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -5
  152. package/es/platform/zfield/frameworks/ActionHandlerFactory.js +4 -4
  153. package/es/platform/zlist/adapters/controllers/DeleteSuccessController.js +25 -0
  154. package/es/platform/zlist/adapters/controllers/UpdateSuccessController.js +25 -0
  155. package/es/platform/zlist/adapters/gateways/Repository.js +11 -10
  156. package/es/platform/zlist/adapters/gateways/Service.js +8 -0
  157. package/es/platform/zlist/adapters/presenters/TableTranslator.js +47 -34
  158. package/es/platform/zlist/adapters/presenters/translators/ColumnSizeTranslator.js +2 -2
  159. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +16 -8
  160. package/es/platform/zlist/adapters/presenters/translators/Header.js +7 -2
  161. package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
  162. package/es/platform/zlist/adapters/presenters/translators/Row.js +10 -6
  163. package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +6 -6
  164. package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +7 -5
  165. package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +89 -0
  166. package/es/platform/zlist/adapters/presenters/translators/interfaces/Context.js +1 -0
  167. package/es/platform/zlist/adapters/presenters/translators/interfaces/FieldComponentMapping.js +1 -0
  168. package/es/platform/zlist/applications/entities-factory/ListFactory.js +3 -3
  169. package/es/platform/zlist/applications/usecases/DeleteSuccessUseCase.js +19 -0
  170. package/es/platform/zlist/applications/usecases/UpdateSuccessUseCase.js +19 -0
  171. package/es/platform/zlist/domain/entities/List.js +50 -11
  172. package/es/platform/zlist/frameworks/EventHandlersFactory.js +17 -23
  173. package/es/platform/zrecord/applications/usecases/ExecuteActionUseCase.js +1 -1
  174. package/es/platform/zrecord/applications/usecases/FetchMoreUseCase.js +1 -1
  175. package/es/platform/zrecord/applications/usecases/InitializeUseCase.js +2 -2
  176. package/es/platform/zrecord/applications/usecases/RefetchUseCase.js +1 -1
  177. package/es/platform/zrecord/domain/entities/RecordsManager.js +10 -10
  178. package/package.json +4 -3
  179. package/es/bc/zdata-broker/EventHandlers.js +0 -2
  180. package/es/bc/zdata-broker/Symbols.js +0 -5
  181. package/es/desk-frameworks/table-connected/frameworks/__tests__/TableConnectedFactory.spec.js +0 -453
  182. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getAvailableFields.js +0 -86
  183. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getRecords.js +0 -81
  184. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getSelectedFields.js +0 -32
  185. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/index.js +0 -11
  186. package/es/platform/zdata-broker/domain/entities/interfaces/MetaData.js +0 -1
  187. /package/es/bc/{zdata-broker → zdata-source}/Properties.js +0 -0
  188. /package/es/{platform/data-broker/dbc/index.js → library/behaviours/list-selection/applications/interfaces/input/DeselectInputModel.js} +0 -0
  189. /package/es/{platform/zclient-actions/applications/interfaces/InputDependencies.js → library/behaviours/list-selection/applications/interfaces/input/SelectInputModel.js} +0 -0
  190. /package/es/{platform/zclient-actions → library/custom-component}/domain/entities/interfaces/EventModel.js +0 -0
  191. /package/es/{bc → platform/client-actions/bc}/zclient-actions/Constants.js +0 -0
  192. /package/es/{bc → platform/client-actions/bc}/zclient-actions/EventHandlers.js +0 -0
  193. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/AbstractController.js +0 -0
  194. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/ClientActionBehaviourExecutorController.js +0 -0
  195. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FailureController.js +0 -0
  196. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FetchStateStopController.js +0 -0
  197. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/MountController.js +0 -0
  198. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/NoContentController.js +0 -0
  199. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SetClientActionsController.js +0 -0
  200. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SuccessController.js +0 -0
  201. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Repository.js +0 -0
  202. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Service.js +0 -0
  203. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/presenters/Presenter.js +0 -0
  204. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionFactory.js +0 -0
  205. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionManagerFactory.js +0 -0
  206. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ClientActionModel.js +0 -0
  207. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ComponentPropertiesModel.js +0 -0
  208. /package/es/platform/{zclient-actions/applications/interfaces/gateways/IRepository.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionFieldModel.js} +0 -0
  209. /package/es/platform/{zclient-actions/applications/interfaces/gateways/State.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionModel.js} +0 -0
  210. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/EventMappingModel.js +0 -0
  211. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/IError.js +0 -0
  212. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/InputDependencies.js +0 -0
  213. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PayloadValueMappingModel.js +0 -0
  214. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PropsMeta.js +0 -0
  215. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/StrategyMeta.js +0 -0
  216. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UIComponentMappingModel.js +0 -0
  217. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UserDetailsModel.js +0 -0
  218. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IRepository.js +0 -0
  219. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IService.js +0 -0
  220. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/State.js +0 -0
  221. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/ExecuteActionBehaviourInputModel.js +0 -0
  222. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FailureInputModel.js +0 -0
  223. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FetchStateStopInputModel.js +0 -0
  224. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/InitializeInputModel.js +0 -0
  225. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/NoContentInputModel.js +0 -0
  226. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SetClientActionsInputModel.js +0 -0
  227. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SuccessInputModel.js +0 -0
  228. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/output/IPresenter.js +0 -0
  229. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/AbstractUseCase.js +0 -0
  230. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FailureUseCase.js +0 -0
  231. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FetchStateStopUseCase.js +0 -0
  232. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/NoContentUseCase.js +0 -0
  233. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SetClientActionsUseCase.js +0 -0
  234. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SuccessUseCase.js +0 -0
  235. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMappings.js +0 -0
  236. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/GetClientActionsStrategy.js +0 -0
  237. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/BehaviourState.js +0 -0
  238. /package/es/platform/{zclient-actions/domain/entities/interfaces/ClientActionsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionModel.js} +0 -0
  239. /package/es/platform/{zclient-actions/domain/entities/interfaces/IAction.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionsModel.js} +0 -0
  240. /package/es/platform/{zclient-actions/domain/entities/interfaces/IEvent.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ComponentPropertiesModel.js} +0 -0
  241. /package/es/platform/{zclient-actions/domain/entities/interfaces/SubMeta.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionFieldModel.js} +0 -0
  242. /package/es/platform/{zdata-broker/applications/interfaces/input/ExecuteActionInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionModel.js} +0 -0
  243. /package/es/platform/{zdata-broker/applications/interfaces/input/FailureInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/EventMappingModel.js} +0 -0
  244. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/EventModel.js +0 -0
  245. /package/es/platform/{zdata-broker/applications/interfaces/input/NoContentInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IAction.js} +0 -0
  246. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientAction.js +0 -0
  247. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionExecuteStrategy.js +0 -0
  248. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionManager.js +0 -0
  249. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActions.js +0 -0
  250. /package/es/platform/{zdata-broker/applications/interfaces/input/RegisterInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IError.js} +0 -0
  251. /package/es/platform/{zdata-broker/applications/interfaces/input/SuccessInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IEvent.js} +0 -0
  252. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMapping.js +0 -0
  253. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMappings.js +0 -0
  254. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IPayload.js +0 -0
  255. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IUIComponentMapping.js +0 -0
  256. /package/es/platform/{zdata-broker/applications/interfaces/output/IPresenter.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PayloadValueMappingModel.js} +0 -0
  257. /package/es/platform/{zdata-broker/domain/entities/interfaces/APIDetailsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PropsMeta.js} +0 -0
  258. /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplateModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/State.js} +0 -0
  259. /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplatesModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/StrategyMeta.js} +0 -0
  260. /package/es/platform/{zdata-broker/domain/entities/interfaces/BehaviourState.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/SubMeta.js} +0 -0
  261. /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplate.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UIComponentMappingModel.js} +0 -0
  262. /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplates.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UserDetailsModel.js} +0 -0
  263. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/frameworks/ActionsHandlersFactory.js +0 -0
  264. /package/es/platform/{zdata-broker/domain/entities/interfaces/ITemplateHelpers.js → client-actions/components/action-event-mediator/applications/interfaces/UseCaseDependencies.js} +0 -0
  265. /package/es/platform/{zdata-broker/applications/interfaces/gateways/IService.js → client-actions/components/action-event-mediator/applications/interfaces/gateways/IRepository.js} +0 -0
  266. /package/es/platform/{zlist/adapters/presenters/translators/interfaces/FieldUiMapping.js → client-actions/components/action-event-mediator/applications/interfaces/input/PropertiesChangeUseCaseInputModel.js} +0 -0
  267. /package/es/platform/{zdata-broker/domain/entities/interfaces/IDataBroker.js → client-actions/components/action-event-mediator/applications/interfaces/output/IPresenter.js} +0 -0
  268. /package/es/platform/{zlist/adapters/presenters/translators/interfaces/PageContext.js → client-actions/components/action-event-mediator/domain/entities/interfaces/IActionLocation.js} +0 -0
  269. /package/es/platform/{data-broker → data-source}/http-template/deleteRecord.js +0 -0
  270. /package/es/platform/{data-broker → data-source}/http-template/deleteRecords.js +0 -0
  271. /package/es/platform/{data-broker → data-source}/http-template/getRecords.js +0 -0
  272. /package/es/platform/{data-broker → data-source}/http-template/updateRecord.js +0 -0
  273. /package/es/platform/{data-broker → data-source}/utils/transformer/Transformer.js +0 -0
  274. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/AbstractController.js +0 -0
  275. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/FailureController.js +0 -0
  276. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/NoContentController.js +0 -0
  277. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/RegisterController.js +0 -0
  278. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/SuccessController.js +0 -0
  279. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Service.js +0 -0
  280. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/TemplateHelpers.js +0 -0
  281. /package/es/platform/{zdata-broker → zdata-source}/applications/entities-factory/APITemplatesFactory.js +0 -0
  282. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/ITemplateHelpers.js +0 -0
  283. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/AbstractUseCase.js +0 -0
  284. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/RegisterUseCase.js +0 -0
  285. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplate.js +0 -0
  286. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplates.js +0 -0
  287. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/ApiEnum.js +0 -0
@@ -0,0 +1,29 @@
1
+ import { ActionContextResolver } from "../context-resolver";
2
+ import { ConditionResolver } from "../condition-resolver";
3
+ export default class ClientActionsTranslator {
4
+ constructor() {}
5
+
6
+ static transformToActionViewModel(action) {
7
+ return {
8
+ id: action.id,
9
+ component: action.uiComponentMapping.component,
10
+ properties: action.uiComponentMapping.propertiesValueMapping,
11
+ eventMappings: action.uiComponentMapping.eventMappings.map(eventMapping => {
12
+ return {
13
+ sourceEvent: eventMapping.sourceEvent,
14
+ id: eventMapping.id,
15
+ targetEvent: eventMapping.targetEvent,
16
+ payload: eventMapping.payloadValueMapping
17
+ };
18
+ })
19
+ };
20
+ }
21
+
22
+ static transform(actions, context) {
23
+ const resolvedActions = ActionContextResolver.resolveActions(actions, context);
24
+ const evaluatedActions = resolvedActions.filter(action => ConditionResolver.evaluateCondition(action.conditions, context, action.id));
25
+ const finalTransformedActions = evaluatedActions.map(action => this.transformToActionViewModel(action));
26
+ return finalTransformedActions;
27
+ }
28
+
29
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalEmptyString(field, value, context) {
3
+ return getResolvedContextFieldValue(context, field) === '' || getResolvedContextFieldValue(context, field) === null;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalEndsWith(field, value, context) {
3
+ return String(getResolvedContextFieldValue(context, field)).endsWith(String(value));
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalEquals(field, value, context) {
3
+ return String(getResolvedContextFieldValue(context, field)) === String(value);
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalGreaterThan(field, value, context) {
3
+ return getResolvedContextFieldValue(context, field) > value;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalGreaterThanOrEquals(field, value, context) {
3
+ return getResolvedContextFieldValue(context, field) >= value;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { evalEquals } from "./EvalEquals";
2
+ export function evalIn(field, value, context) {
3
+ return String(value).split(',').some(val => evalEquals(field, val, context));
4
+ }
@@ -0,0 +1,4 @@
1
+ import { evalEmptyString } from "./EvalEmptyString";
2
+ export function evalIsEmpty(field, value, context) {
3
+ return evalEmptyString(field, value, context);
4
+ }
@@ -0,0 +1,4 @@
1
+ import { evalIsEmpty } from "./EvalIsEmpty";
2
+ export function EvalIsNotEmpty(field, value, context) {
3
+ return !evalIsEmpty(field, value, context);
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalLessThan(field, value, context) {
3
+ return getResolvedContextFieldValue(context, field) < value;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalLessThanOrEquals(field, value, context) {
3
+ return getResolvedContextFieldValue(context, field) <= value;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalLike(field, value, context) {
3
+ return String(getResolvedContextFieldValue(context, field)).includes(String(value));
4
+ }
@@ -0,0 +1,4 @@
1
+ import { evalEquals } from "./EvalEquals";
2
+ export function evalNotEquals(field, value, context) {
3
+ return !evalEquals(field, value, context);
4
+ }
@@ -0,0 +1,4 @@
1
+ import { evalLike } from "./EvalLike";
2
+ export function evalNotLike(field, value, context) {
3
+ return !evalLike(field, value, context);
4
+ }
@@ -0,0 +1,4 @@
1
+ import { getResolvedContextFieldValue } from "./GetResolvedContextFieldValue";
2
+ export function evalStartsWith(field, value, context) {
3
+ return String(getResolvedContextFieldValue(context, field)).startsWith(String(value));
4
+ }
@@ -0,0 +1,8 @@
1
+ export function getResolvedContextFieldValue(context, field) {
2
+ if (field.includes(".")) {
3
+ let value = field.split(".").reduce((obj, key) => obj && obj[key], context);
4
+ return value;
5
+ }
6
+
7
+ return context[field];
8
+ }
@@ -0,0 +1,58 @@
1
+ import { evalIsEmpty } from "./EvalIsEmpty";
2
+ import { evalEmptyString } from "./EvalEmptyString";
3
+ import { evalEndsWith } from "./EvalEndsWith";
4
+ import { evalEquals } from "./EvalEquals";
5
+ import { evalGreaterThan } from "./EvalGreaterThan";
6
+ import { evalGreaterThanOrEquals } from "./EvalGreaterThanOrEquals";
7
+ import { evalIn } from "./EvalIn";
8
+ import { evalLike } from "./EvalLike";
9
+ import { evalLessThan } from "./EvalLessThan";
10
+ import { evalLessThanOrEquals } from "./EvalLessThanOrEquals";
11
+ import { EvalIsNotEmpty } from "./EvalIsNotEmpty";
12
+ import { evalNotEquals } from "./EvalNotEquals";
13
+ import { evalNotLike } from "./EvalNotLike";
14
+ import { evalStartsWith } from "./EvalStartsWith";
15
+ const opers = {
16
+ 'ISEMPTY': evalIsEmpty,
17
+ 'EMPTYSTRING': evalEmptyString,
18
+ 'ENDSWITH': evalEndsWith,
19
+ '=': evalEquals,
20
+ '>': evalGreaterThan,
21
+ '>=': evalGreaterThanOrEquals,
22
+ 'IN': evalIn,
23
+ 'LIKE': evalLike,
24
+ '<': evalLessThan,
25
+ '<=': evalLessThanOrEquals,
26
+ 'ISNOTEMPTY': EvalIsNotEmpty,
27
+ '!=': evalNotEquals,
28
+ 'NOT LIKE': evalNotLike,
29
+ 'STARTSWITH': evalStartsWith
30
+ };
31
+ const platformOpers = {
32
+ '=': opers['='],
33
+ 'is': opers['='],
34
+ 'starts with': opers['STARTSWITH'],
35
+ 'ends with': opers['ENDSWITH'],
36
+ 'contains': opers['LIKE'],
37
+ "doesn't contain": opers['NOT LIKE'],
38
+ "is empty": opers["ISEMPTY"],
39
+ "is not empty": opers["ISNOTEMPTY"],
40
+ '<': opers['<'],
41
+ '>': opers['>'],
42
+ '<=': opers['<='],
43
+ '>=': opers['>='],
44
+ '<>': opers['!='],
45
+ 'in': opers["IN"]
46
+ };
47
+ export function evaluateConditionsFields(conditions, context) {
48
+ return conditions.map(_ref => {
49
+ let {
50
+ fieldName,
51
+ condition,
52
+ value
53
+ } = _ref;
54
+ const resolvedValue = value.join(',');
55
+ if (fieldName == null && value == null || value.length == 0) return true;
56
+ return platformOpers[condition](fieldName, resolvedValue, context);
57
+ });
58
+ }
@@ -0,0 +1,33 @@
1
+ import { patternValidate } from "./pattern-evaluator/PatternValidator";
2
+ import { evaluateConditionsFields } from "./field-evaluators";
3
+ import { evaluateExpression, parse } from "./pattern-evaluator";
4
+ export class ConditionResolver {
5
+ static evaluateCondition(condition, context, id) {
6
+ const {
7
+ fields = [],
8
+ pattern = ''
9
+ } = condition;
10
+
11
+ if (fields.length > 0 && pattern.length > 0) {
12
+ const {
13
+ isValid,
14
+ errorMessage,
15
+ pattern: validatedPattern
16
+ } = patternValidate(pattern, fields.length);
17
+
18
+ if (!isValid) {
19
+ console.error(`Error in client action id ${id} - condition pattern`, errorMessage);
20
+ return false;
21
+ }
22
+
23
+ const resolvedFields = evaluateConditionsFields(fields, context);
24
+ const transformedPattern = validatedPattern.replace(/and/g, '&&').replace(/or/g, '||');
25
+ const ast = parse(transformedPattern);
26
+ const isValidCondition = evaluateExpression(ast, resolvedFields);
27
+ return isValidCondition;
28
+ }
29
+
30
+ return true;
31
+ }
32
+
33
+ }
@@ -0,0 +1,86 @@
1
+ /* eslint-disable max-lines-per-function */
2
+ export function patternValidate() {
3
+ let patternString = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4
+ let conditionsLength = arguments.length > 1 ? arguments[1] : undefined;
5
+
6
+ if (!patternString.trim()) {
7
+ return {
8
+ errorMessage: 'Pattern cannot be empty',
9
+ isValid: false
10
+ };
11
+ }
12
+
13
+ const isValid = true;
14
+ const patternStr = patternString.replace(/\s+/g, '');
15
+ const openBracketsLen = (patternStr.match(/\(/gi) || []).length;
16
+ const closeBractsLen = (patternStr.match(/\)/gi) || []).length;
17
+
18
+ if (openBracketsLen !== closeBractsLen) {
19
+ return {
20
+ errorMessage: 'Pattern brackets do not match',
21
+ isValid: false
22
+ };
23
+ }
24
+
25
+ let brackStr = patternStr.replace(/#/g, '~');
26
+ brackStr = patternStr.replace(/(and|or)/g, '#');
27
+
28
+ if (brackStr.indexOf('(#') !== -1 || brackStr.indexOf('#)') !== -1) {
29
+ return {
30
+ errorMessage: 'Invalid brackets surrounding condition operator(s).',
31
+ isValid: false
32
+ };
33
+ }
34
+
35
+ if (brackStr.indexOf('()') !== -1) {
36
+ return {
37
+ errorMessage: 'Pattern brackets do not match',
38
+ isValid: false
39
+ };
40
+ }
41
+
42
+ const matchedNumbers = patternStr.match(/[0-9]+/g);
43
+ const patternNumbers = matchedNumbers ? matchedNumbers : [];
44
+ const patternNumbersLen = patternNumbers.length;
45
+
46
+ for (let i = 0; i < patternNumbersLen; i++) {
47
+ const currentNumber = parseInt(patternNumbers[i]);
48
+
49
+ if (currentNumber !== i + 1) {
50
+ return {
51
+ errorMessage: 'Please check the conditions number in the pattern.',
52
+ isValid: false
53
+ };
54
+ }
55
+ }
56
+
57
+ const patternEmpty = brackStr.replace(/[()]/g, '#').replace(/[0-9]+/g, '#').replace(/#/g, '');
58
+
59
+ if (patternEmpty && patternEmpty.length >= 1) {
60
+ return {
61
+ errorMessage: 'Invalid content in this pattern',
62
+ isValid: false
63
+ };
64
+ }
65
+
66
+ const andOrCount = (patternStr.match(/(and|or)/gi) || []).length;
67
+
68
+ if (conditionsLength - 1 !== andOrCount) {
69
+ return {
70
+ errorMessage: 'Number of conditions in this pattern do not match with the conditions entered',
71
+ isValid: false
72
+ };
73
+ }
74
+
75
+ if (patternNumbersLen !== conditionsLength) {
76
+ return {
77
+ errorMessage: 'Number of conditions in this pattern do not match with the conditions given.',
78
+ isValid: false
79
+ };
80
+ }
81
+
82
+ return {
83
+ isValid,
84
+ pattern: patternStr
85
+ };
86
+ }
@@ -0,0 +1,96 @@
1
+ /* eslint-disable max-lines-per-function */
2
+ import jsep from 'jsep';
3
+ const binops = {
4
+ '||': function (a, b) {
5
+ return a || b;
6
+ },
7
+ '&&': function (a, b) {
8
+ return a && b;
9
+ }
10
+ };
11
+ const unops = {
12
+ '-': function (a) {
13
+ return -a;
14
+ },
15
+ '+': function (a) {
16
+ return +a;
17
+ },
18
+ '~': function (a) {
19
+ return ~a;
20
+ },
21
+ '!': function (a) {
22
+ return !a;
23
+ }
24
+ };
25
+
26
+ function evaluateArray(list, context) {
27
+ return list.map(function (v) {
28
+ return evaluate(v, context);
29
+ });
30
+ }
31
+
32
+ function evaluateMember(node, context) {
33
+ const object = evaluate(node.object, context);
34
+
35
+ if (node.computed) {
36
+ return [object, object[evaluate(node.property, context)]];
37
+ } else {
38
+ return [object, object[node.property.name]];
39
+ }
40
+ }
41
+
42
+ function evaluate(node, context) {
43
+ switch (node.type) {
44
+ case 'ArrayExpression':
45
+ return evaluateArray(node.elements, context);
46
+
47
+ case 'BinaryExpression':
48
+ return binops[node.operator](evaluate(node.left, context), evaluate(node.right, context));
49
+
50
+ case 'CallExpression':
51
+ let caller, fn, assign;
52
+
53
+ if (node.callee.type === 'MemberExpression') {
54
+ assign = evaluateMember(node.callee, context);
55
+ caller = assign[0];
56
+ fn = assign[1];
57
+ } else {
58
+ fn = evaluate(node.callee, context);
59
+ }
60
+
61
+ if (typeof fn !== 'function') {
62
+ return undefined;
63
+ }
64
+
65
+ return fn.apply(caller, evaluateArray(node.arguments, context));
66
+
67
+ case 'ConditionalExpression':
68
+ return evaluate(node.test, context) ? evaluate(node.consequent, context) : evaluate(node.alternate, context);
69
+
70
+ case 'Literal':
71
+ return context[node.value - 1];
72
+
73
+ case 'LogicalExpression':
74
+ if (node.operator === '||') {
75
+ return evaluate(node.left, context) || evaluate(node.right, context);
76
+ } else if (node.operator === '&&') {
77
+ return evaluate(node.left, context) && evaluate(node.right, context);
78
+ }
79
+
80
+ return binops[node.operator](evaluate(node.left, context), evaluate(node.right, context));
81
+
82
+ case 'MemberExpression':
83
+ return evaluateMember(node, context)[1];
84
+
85
+ case 'ThisExpression':
86
+ return context;
87
+
88
+ case 'UnaryExpression':
89
+ return unops[node.operator](evaluate(node.argument, context));
90
+
91
+ default:
92
+ return undefined;
93
+ }
94
+ }
95
+
96
+ export { jsep as parse, evaluate as evaluateExpression };
@@ -0,0 +1,54 @@
1
+ import TemplateResolver from "../../template-resolver";
2
+ export class ActionContextResolver {
3
+ constructor() {}
4
+
5
+ static resolveContextInEventMappingPayload(eventMapping, context) {
6
+ return { ...eventMapping,
7
+ payloadValueMapping: TemplateResolver.replaceContextVariablesInObject(eventMapping.payloadValueMappingMeta, context)
8
+ };
9
+ }
10
+
11
+ static resolveConditionValueContext(condition, templateContext) {
12
+ const {
13
+ fields = [],
14
+ pattern
15
+ } = condition;
16
+ const resolvedFields = fields.map(field => {
17
+ const resolvedValue = TemplateResolver.replaceContextVariables(field.value.join(","), templateContext);
18
+ return { ...field,
19
+ value: resolvedValue.split(",")
20
+ };
21
+ });
22
+ return { ...condition,
23
+ pattern,
24
+ fields: resolvedFields
25
+ };
26
+ }
27
+
28
+ static resolveContextInProperties(properties, templateContext) {
29
+ return TemplateResolver.replaceContextVariablesInObject(properties, templateContext);
30
+ }
31
+
32
+ static resolveAction(action, context) {
33
+ const eventMappings = action.uiComponentMapping.eventMappings;
34
+ const conditions = action.conditionsMeta;
35
+ const resolvedEventMappings = eventMappings.map(eventMapping => this.resolveContextInEventMappingPayload(eventMapping, context));
36
+ const resolvedProperty = this.resolveContextInProperties(action.uiComponentMapping.propertiesValueMappingMeta, context);
37
+ const resolveConditionValues = this.resolveConditionValueContext(conditions, context);
38
+ return { ...action,
39
+ conditions: resolveConditionValues,
40
+ uiComponentMapping: { ...action.uiComponentMapping,
41
+ propertiesValueMapping: resolvedProperty,
42
+ eventMappings: resolvedEventMappings
43
+ }
44
+ };
45
+ }
46
+
47
+ static resolveActions(actions, context) {
48
+ const replacementContext = {
49
+ "@context": context
50
+ };
51
+ return actions ? actions.map(action => this.resolveAction(action, replacementContext)) : [];
52
+ }
53
+
54
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,18 +1,18 @@
1
1
  let getAvailableFields = {
2
- name: "availableFields",
3
- api: "/{{servicePrefix}}/{{orgName}}/api/v1/views/availableFields",
2
+ name: 'availableFields',
3
+ api: '/{{servicePrefix}}/{{orgName}}/api/v1/views/availableFields',
4
4
  parameters: `{
5
5
  "departmentId":"{{departmentId}}",
6
6
  "module":"{{moduleName}}"
7
7
  }`,
8
- type: "GET",
8
+ type: 'GET',
9
9
  transformer: res => res.fields,
10
10
  properties: {
11
11
  moduleName: {
12
12
  required: true,
13
13
  typeMetadata: {
14
14
  schema: {
15
- type: "string"
15
+ type: 'string'
16
16
  }
17
17
  }
18
18
  },
@@ -20,7 +20,7 @@ let getAvailableFields = {
20
20
  required: true,
21
21
  typeMetadata: {
22
22
  schema: {
23
- type: "string"
23
+ type: 'string'
24
24
  }
25
25
  }
26
26
  }
@@ -1,20 +1,20 @@
1
1
  let getClientActions = {
2
- name: "uiActions",
3
- api: "/{{servicePrefix}}/{{orgName}}/api/v1/clientActions",
2
+ name: 'uiActions',
3
+ api: '/{{servicePrefix}}/{{orgName}}/api/v1/clientActions',
4
4
  parameters: `{
5
5
  "from":{{from}},
6
6
  "limit":{{limit}},
7
7
  "library": "{{library}}",
8
8
  "module": "{{moduleName}}"
9
9
  }`,
10
- type: "GET",
10
+ type: 'GET',
11
11
  transformer: data => data,
12
12
  properties: {
13
13
  modelName: {
14
14
  required: true,
15
15
  typeMetadata: {
16
16
  schema: {
17
- type: "string"
17
+ type: 'string'
18
18
  }
19
19
  }
20
20
  }
@@ -1,17 +1,17 @@
1
1
  let getSelectedFields = {
2
- name: "selectedFields",
3
- api: "/{{servicePrefix}}/{{orgName}}/api/v1/views/{{viewId}}/selectedFields",
2
+ name: 'selectedFields',
3
+ api: '/{{servicePrefix}}/{{orgName}}/api/v1/views/{{viewId}}/selectedFields',
4
4
  parameters: `{
5
5
  "departmentId":"{{departmentId}}"
6
6
  }`,
7
- type: "GET",
7
+ type: 'GET',
8
8
  transformer: res => res.fields,
9
9
  properties: {
10
10
  viewId: {
11
11
  required: true,
12
12
  typeMetadata: {
13
13
  schema: {
14
- type: "string"
14
+ type: 'string'
15
15
  }
16
16
  }
17
17
  },
@@ -20,7 +20,7 @@ let getSelectedFields = {
20
20
  defaultValue: 1,
21
21
  typeMetadata: {
22
22
  schema: {
23
- type: "number"
23
+ type: 'number'
24
24
  }
25
25
  }
26
26
  }
@@ -7,7 +7,7 @@ import getSelectedFields from "./http-template/getSelectedFields";
7
7
  import getClientActions from "./http-template/getClientActions";
8
8
  import { RecordApiActionName } from "../../bc/zrecord/Constants";
9
9
  import deleteRecord from "./http-template/deleteRecord";
10
- let record = {
10
+ let dataSource = {
11
11
  httpTemplates: {
12
12
  [RecordApiActionName.GET_RECORDS]: getRecords,
13
13
  [RecordApiActionName.UPDATE_RECORD]: updateRecord,
@@ -18,5 +18,5 @@ let record = {
18
18
  getSelectedFields
19
19
  }
20
20
  };
21
- export default record; // let ticketsRecordSerice = createRecord(tickets, () => {});
21
+ export default dataSource; // let ticketsRecordSerice = createRecord(tickets, () => {});
22
22
  // export default ticketsRecordSerice;
@@ -1,7 +1,7 @@
1
1
  // REVIEW: Function never used
2
2
  function createCf(item, key) {
3
3
  return Object.keys(item).reduce((res, next) => {
4
- if ([key, "id", "createdTime"].includes(next)) {
4
+ if ([key, 'id', 'createdTime'].includes(next)) {
5
5
  return res;
6
6
  } else {
7
7
  res[next] = item[next];
@@ -1,5 +1,5 @@
1
1
  import AbstractController from "./AbstractController";
2
- export default class DataBrokerExecutorController extends AbstractController {
2
+ export default class DataSourceExecutorController extends AbstractController {
3
3
  handle(event) {
4
4
  const {
5
5
  state,
@@ -1,6 +1,6 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
- import DataBrokerFactory from "../../applications/entities-factory/DataBrokerFactory";
3
+ import DataSourceFactory from "../../applications/entities-factory/DataSourceFactory";
4
4
  export default class Repository {
5
5
  constructor() {
6
6
  _defineProperty(this, "state", void 0);
@@ -10,14 +10,14 @@ export default class Repository {
10
10
  this.state = state;
11
11
  }
12
12
 
13
- getDataBrokerEntity(templateHelpers) {
13
+ getDataSourceEntity(templateHelpers) {
14
14
  const {
15
- dataBroker
15
+ dataSource
16
16
  } = this.state.behaviours;
17
17
  const {
18
18
  apiTemplates
19
- } = dataBroker;
20
- const recordManager = DataBrokerFactory.create(apiTemplates, templateHelpers);
19
+ } = dataSource;
20
+ const recordManager = DataSourceFactory.create(apiTemplates, templateHelpers);
21
21
  return recordManager;
22
22
  }
23
23
 
@@ -12,10 +12,10 @@ export default class Presenter {
12
12
  this.state = state;
13
13
  }
14
14
 
15
- updateBehaviourState(dataBrokerBehaviourState) {
15
+ updateBehaviourState(dataSourceBehaviourState) {
16
16
  this.state = { ...this.state,
17
17
  behaviours: { ...this.state.behaviours,
18
- dataBroker: dataBrokerBehaviourState
18
+ dataSource: dataSourceBehaviourState
19
19
  }
20
20
  };
21
21
  this.updateState(this.state);
@@ -23,10 +23,10 @@ export default class Presenter {
23
23
 
24
24
  updateAPITemplates(apiTemplates) {
25
25
  const {
26
- dataBroker
26
+ dataSource
27
27
  } = this.state.behaviours;
28
28
  this.updateBehaviourState({
29
- apiTemplates: { ...(dataBroker === null || dataBroker === void 0 ? void 0 : dataBroker.apiTemplates),
29
+ apiTemplates: { ...(dataSource === null || dataSource === void 0 ? void 0 : dataSource.apiTemplates),
30
30
  ...apiTemplates
31
31
  }
32
32
  });
@@ -1,10 +1,9 @@
1
1
  import APITemplatesFactory from "./APITemplatesFactory";
2
- import DataBroker from "../../domain/entities/DataBroker";
3
- export default class DataBrokerFactory {
2
+ import DataSource from "../../domain/entities/DataSource";
3
+ export default class DataSourceFactory {
4
4
  static create(httpTemplates, templateHelpers) {
5
5
  const apiTemplates = APITemplatesFactory.create(httpTemplates, templateHelpers);
6
- const dataBroker = new DataBroker(apiTemplates);
7
- return dataBroker;
6
+ return new DataSource(apiTemplates);
8
7
  }
9
8
 
10
9
  }