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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +2 -2
  2. package/es/bc/{zdata-broker → zdata-source}/Actions.js +6 -6
  3. package/es/bc/{zdata-broker → zdata-source}/Constants.js +6 -5
  4. package/es/bc/zdata-source/EventHandlers.js +2 -0
  5. package/es/bc/zdata-source/Symbols.js +5 -0
  6. package/es/bc/zfield/ActionHandlers.js +1 -1
  7. package/es/bc/zlist/EventHandlers.js +1 -1
  8. package/es/bc/zlist/Properties.js +16 -32
  9. package/es/cc/action-icon/Properties.js +31 -0
  10. package/es/cc/action-location/Properties.js +9 -24
  11. package/es/cc/table-connected/Constants.js +4 -0
  12. package/es/cc/table-connected/Properties.js +11 -57
  13. package/es/cc/table-list/Properties.js +2 -2
  14. package/es/cc/table-list/data-types/Header.js +6 -0
  15. package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +88 -1
  16. package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +22 -8
  17. package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +5 -2
  18. package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +4 -2
  19. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +1 -0
  20. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +16 -3
  21. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +6 -4
  22. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +16 -3
  23. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon.js +18 -2
  24. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +75 -1
  25. package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +7 -6
  26. package/es/platform/client-actions/Readme.md +31 -0
  27. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/Readme.md +14 -21
  28. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/ExecuteActionBehaviourUseCase.js +1 -1
  29. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/InitializeUseCase.js +2 -2
  30. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientAction.js +12 -4
  31. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActionManager.js +9 -9
  32. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActions.js +0 -4
  33. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMapping.js +5 -1
  34. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/UIComponentMapping.js +7 -3
  35. package/es/platform/{zclient-actions/frameworks/ClientActionBehaviourFactory.js → client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory.js} +1 -1
  36. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +34 -0
  37. package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +51 -0
  38. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/MountController.js +18 -0
  39. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/PropertiesChangeController.js +26 -0
  40. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/UnmountController.js +18 -0
  41. package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +36 -0
  42. package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +22 -0
  43. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/AbstractUseCase.js +15 -0
  44. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/DestroyUseCase.js +13 -0
  45. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/InitializeUseCase.js +13 -0
  46. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +17 -0
  47. package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +108 -0
  48. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator.js +13 -0
  49. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +19 -0
  50. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +30 -0
  51. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponent.js +9 -0
  52. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +34 -0
  53. package/es/platform/client-actions/components/interfaces/ActionViewModel.js +7 -0
  54. package/es/platform/client-actions/components/interfaces/EventMappingViewModel.js +0 -0
  55. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.js +12 -0
  56. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +17 -0
  57. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +30 -0
  58. package/es/platform/client-actions/template-resolver/index.js +44 -0
  59. package/es/platform/client-actions/template-resolver/interfaces/ITemplate.js +1 -0
  60. package/es/platform/client-actions/translators/client-actions-translator/index.js +29 -0
  61. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEmptyString.js +4 -0
  62. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEndsWith.js +4 -0
  63. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEquals.js +4 -0
  64. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThan.js +4 -0
  65. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThanOrEquals.js +4 -0
  66. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIn.js +4 -0
  67. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsEmpty.js +4 -0
  68. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsNotEmpty.js +4 -0
  69. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThan.js +4 -0
  70. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThanOrEquals.js +4 -0
  71. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLike.js +4 -0
  72. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotEquals.js +4 -0
  73. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotLike.js +4 -0
  74. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalStartsWith.js +4 -0
  75. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/GetResolvedContextFieldValue.js +8 -0
  76. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/index.js +58 -0
  77. package/es/platform/client-actions/translators/condition-resolver/index.js +33 -0
  78. package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/PatternValidator.js +86 -0
  79. package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/index.js +96 -0
  80. package/es/platform/client-actions/translators/context-resolver/index.js +54 -0
  81. package/es/platform/client-actions/translators/interfaces/IContext.js +1 -0
  82. package/es/platform/client-actions/translators/interfaces/IState.js +1 -0
  83. package/es/platform/data-source/dbc/index.js +1 -0
  84. package/es/platform/{data-broker → data-source}/http-template/getAvailableFields.js +5 -5
  85. package/es/platform/{data-broker → data-source}/http-template/getClientActions.js +4 -4
  86. package/es/platform/{data-broker → data-source}/http-template/getSelectedFields.js +5 -5
  87. package/es/platform/{data-broker → data-source}/index.js +2 -2
  88. package/es/platform/{data-broker → data-source}/utils/transformer/CreateCf.js +1 -1
  89. package/es/platform/{zdata-broker/adapters/controllers/DataBrokerExecutorController.js → zdata-source/adapters/controllers/DataSourceExecutorController.js} +1 -1
  90. package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Repository.js +5 -5
  91. package/es/platform/{zdata-broker → zdata-source}/adapters/presenters/Presenter.js +4 -4
  92. package/es/platform/{zdata-broker/applications/entities-factory/DataBrokerFactory.js → zdata-source/applications/entities-factory/DataSourceFactory.js} +3 -4
  93. package/es/platform/zdata-source/applications/interfaces/InputDependencies.js +1 -0
  94. package/es/platform/zdata-source/applications/interfaces/gateways/IRepository.js +1 -0
  95. package/es/platform/zdata-source/applications/interfaces/gateways/IService.js +0 -0
  96. package/es/platform/zdata-source/applications/interfaces/gateways/State.js +1 -0
  97. package/es/platform/zdata-source/applications/interfaces/input/ExecuteActionInputModel.js +1 -0
  98. package/es/platform/zdata-source/applications/interfaces/input/FailureInputModel.js +1 -0
  99. package/es/platform/zdata-source/applications/interfaces/input/NoContentInputModel.js +1 -0
  100. package/es/platform/zdata-source/applications/interfaces/input/RegisterInputModel.js +1 -0
  101. package/es/platform/zdata-source/applications/interfaces/input/SuccessInputModel.js +1 -0
  102. package/es/platform/zdata-source/applications/interfaces/output/IPresenter.js +1 -0
  103. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js +3 -3
  104. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/FailureUseCase.js +3 -3
  105. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/NoContentUseCase.js +3 -3
  106. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/SuccessUseCase.js +4 -4
  107. package/es/platform/{zdata-broker/domain/entities/DataBroker.js → zdata-source/domain/entities/DataSource.js} +12 -12
  108. package/es/platform/zdata-source/domain/entities/interfaces/APIDetailsModel.js +1 -0
  109. package/es/platform/zdata-source/domain/entities/interfaces/APITemplateModel.js +1 -0
  110. package/es/platform/zdata-source/domain/entities/interfaces/APITemplatesModel.js +1 -0
  111. package/es/platform/zdata-source/domain/entities/interfaces/BehaviourState.js +1 -0
  112. package/es/platform/zdata-source/domain/entities/interfaces/EventModel.js +1 -0
  113. package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplate.js +1 -0
  114. package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplates.js +1 -0
  115. package/es/platform/zdata-source/domain/entities/interfaces/IDataSource.js +0 -0
  116. package/es/platform/zdata-source/domain/entities/interfaces/ITemplateHelpers.js +1 -0
  117. package/es/platform/zdata-source/domain/entities/interfaces/MetaData.js +1 -0
  118. package/es/platform/{zdata-broker → zdata-source}/frameworks/DataBrokerBehaviourFactory.js +2 -2
  119. package/es/platform/{zdata-broker → zdata-source}/frameworks/EventHandlersFactory.js +7 -12
  120. package/es/platform/zfield/applications/usecases/ExecuteActionUseCase.js +1 -1
  121. package/es/platform/zfield/applications/usecases/InitializeUseCase.js +2 -2
  122. package/es/platform/zfield/applications/usecases/RefetchUseCase.js +1 -1
  123. package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -5
  124. package/es/platform/zfield/frameworks/ActionHandlerFactory.js +4 -4
  125. package/es/platform/zlist/adapters/controllers/DeleteSuccessController.js +25 -0
  126. package/es/platform/zlist/adapters/controllers/UpdateSuccessController.js +25 -0
  127. package/es/platform/zlist/adapters/gateways/Repository.js +8 -9
  128. package/es/platform/zlist/adapters/gateways/Service.js +8 -0
  129. package/es/platform/zlist/adapters/presenters/TableTranslator.js +46 -34
  130. package/es/platform/zlist/adapters/presenters/translators/ColumnSizeTranslator.js +2 -2
  131. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +16 -8
  132. package/es/platform/zlist/adapters/presenters/translators/Header.js +7 -2
  133. package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
  134. package/es/platform/zlist/adapters/presenters/translators/Row.js +10 -6
  135. package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +6 -6
  136. package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +7 -5
  137. package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +89 -0
  138. package/es/platform/zlist/adapters/presenters/translators/interfaces/Context.js +1 -0
  139. package/es/platform/zlist/adapters/presenters/translators/interfaces/FieldComponentMapping.js +1 -0
  140. package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
  141. package/es/platform/zlist/applications/usecases/DeleteSuccessUseCase.js +19 -0
  142. package/es/platform/zlist/applications/usecases/UpdateSuccessUseCase.js +19 -0
  143. package/es/platform/zlist/domain/entities/List.js +51 -11
  144. package/es/platform/zlist/frameworks/EventHandlersFactory.js +17 -23
  145. package/es/platform/zrecord/applications/usecases/ExecuteActionUseCase.js +1 -1
  146. package/es/platform/zrecord/applications/usecases/FetchMoreUseCase.js +1 -1
  147. package/es/platform/zrecord/applications/usecases/InitializeUseCase.js +2 -2
  148. package/es/platform/zrecord/applications/usecases/RefetchUseCase.js +1 -1
  149. package/es/platform/zrecord/domain/entities/RecordsManager.js +10 -10
  150. package/package.json +4 -3
  151. package/es/bc/zdata-broker/EventHandlers.js +0 -2
  152. package/es/bc/zdata-broker/Symbols.js +0 -5
  153. package/es/desk-frameworks/table-connected/frameworks/__tests__/TableConnectedFactory.spec.js +0 -453
  154. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getAvailableFields.js +0 -86
  155. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getRecords.js +0 -81
  156. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getSelectedFields.js +0 -32
  157. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/index.js +0 -11
  158. package/es/platform/zdata-broker/domain/entities/interfaces/MetaData.js +0 -1
  159. /package/es/bc/{zdata-broker → zdata-source}/Properties.js +0 -0
  160. /package/es/{bc → platform/client-actions/bc}/zclient-actions/Constants.js +0 -0
  161. /package/es/{bc → platform/client-actions/bc}/zclient-actions/EventHandlers.js +0 -0
  162. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/AbstractController.js +0 -0
  163. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/ClientActionBehaviourExecutorController.js +0 -0
  164. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FailureController.js +0 -0
  165. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FetchStateStopController.js +0 -0
  166. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/MountController.js +0 -0
  167. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/NoContentController.js +0 -0
  168. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SetClientActionsController.js +0 -0
  169. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SuccessController.js +0 -0
  170. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Repository.js +0 -0
  171. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Service.js +0 -0
  172. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/presenters/Presenter.js +0 -0
  173. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionFactory.js +0 -0
  174. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionManagerFactory.js +0 -0
  175. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ClientActionModel.js +0 -0
  176. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ComponentPropertiesModel.js +0 -0
  177. /package/es/platform/{data-broker/dbc/index.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionFieldModel.js} +0 -0
  178. /package/es/platform/{zclient-actions/applications/interfaces/InputDependencies.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionModel.js} +0 -0
  179. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/EventMappingModel.js +0 -0
  180. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/IError.js +0 -0
  181. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/InputDependencies.js +0 -0
  182. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PayloadValueMappingModel.js +0 -0
  183. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PropsMeta.js +0 -0
  184. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/StrategyMeta.js +0 -0
  185. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UIComponentMappingModel.js +0 -0
  186. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UserDetailsModel.js +0 -0
  187. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IRepository.js +0 -0
  188. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IService.js +0 -0
  189. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/State.js +0 -0
  190. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/ExecuteActionBehaviourInputModel.js +0 -0
  191. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FailureInputModel.js +0 -0
  192. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FetchStateStopInputModel.js +0 -0
  193. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/InitializeInputModel.js +0 -0
  194. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/NoContentInputModel.js +0 -0
  195. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SetClientActionsInputModel.js +0 -0
  196. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SuccessInputModel.js +0 -0
  197. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/output/IPresenter.js +0 -0
  198. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/AbstractUseCase.js +0 -0
  199. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FailureUseCase.js +0 -0
  200. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FetchStateStopUseCase.js +0 -0
  201. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/NoContentUseCase.js +0 -0
  202. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SetClientActionsUseCase.js +0 -0
  203. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SuccessUseCase.js +0 -0
  204. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMappings.js +0 -0
  205. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/GetClientActionsStrategy.js +0 -0
  206. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/BehaviourState.js +0 -0
  207. /package/es/platform/{zclient-actions/domain/entities/interfaces/ClientActionsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionModel.js} +0 -0
  208. /package/es/platform/{zclient-actions/domain/entities/interfaces/EventModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionsModel.js} +0 -0
  209. /package/es/platform/{zclient-actions/domain/entities/interfaces/IAction.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ComponentPropertiesModel.js} +0 -0
  210. /package/es/platform/{zclient-actions/domain/entities/interfaces/IEvent.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionFieldModel.js} +0 -0
  211. /package/es/platform/{zclient-actions/domain/entities/interfaces/SubMeta.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionModel.js} +0 -0
  212. /package/es/platform/{zdata-broker/applications/interfaces/gateways/IRepository.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/EventMappingModel.js} +0 -0
  213. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/EventModel.js +0 -0
  214. /package/es/platform/{zdata-broker/applications/interfaces/gateways/State.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IAction.js} +0 -0
  215. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientAction.js +0 -0
  216. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionExecuteStrategy.js +0 -0
  217. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionManager.js +0 -0
  218. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActions.js +0 -0
  219. /package/es/platform/{zdata-broker/applications/interfaces/input/ExecuteActionInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IError.js} +0 -0
  220. /package/es/platform/{zdata-broker/applications/interfaces/input/FailureInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IEvent.js} +0 -0
  221. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMapping.js +0 -0
  222. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMappings.js +0 -0
  223. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IPayload.js +0 -0
  224. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IUIComponentMapping.js +0 -0
  225. /package/es/platform/{zdata-broker/applications/interfaces/input/NoContentInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PayloadValueMappingModel.js} +0 -0
  226. /package/es/platform/{zdata-broker/applications/interfaces/input/RegisterInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PropsMeta.js} +0 -0
  227. /package/es/platform/{zdata-broker/applications/interfaces/input/SuccessInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/State.js} +0 -0
  228. /package/es/platform/{zdata-broker/applications/interfaces/output/IPresenter.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/StrategyMeta.js} +0 -0
  229. /package/es/platform/{zdata-broker/domain/entities/interfaces/APIDetailsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/SubMeta.js} +0 -0
  230. /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplateModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UIComponentMappingModel.js} +0 -0
  231. /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplatesModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UserDetailsModel.js} +0 -0
  232. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/frameworks/ActionsHandlersFactory.js +0 -0
  233. /package/es/platform/{zdata-broker/domain/entities/interfaces/BehaviourState.js → client-actions/components/action-event-mediator/applications/interfaces/UseCaseDependencies.js} +0 -0
  234. /package/es/platform/{zdata-broker/applications/interfaces/gateways/IService.js → client-actions/components/action-event-mediator/applications/interfaces/gateways/IRepository.js} +0 -0
  235. /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplate.js → client-actions/components/action-event-mediator/applications/interfaces/input/PropertiesChangeUseCaseInputModel.js} +0 -0
  236. /package/es/platform/{zdata-broker/domain/entities/interfaces/IDataBroker.js → client-actions/components/action-event-mediator/applications/interfaces/output/IPresenter.js} +0 -0
  237. /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplates.js → client-actions/components/action-event-mediator/domain/entities/interfaces/IActionLocation.js} +0 -0
  238. /package/es/platform/{zdata-broker/domain/entities/interfaces/ITemplateHelpers.js → client-actions/components/action-event-mediator/domain/entities/interfaces/IState.js} +0 -0
  239. /package/es/platform/{zlist/adapters/presenters/translators/interfaces/FieldUiMapping.js → client-actions/components/dynamic-component/domain/entities/interfaces/IState.js} +0 -0
  240. /package/es/platform/{zlist/adapters/presenters/translators/interfaces/PageContext.js → client-actions/components/row-actions-renderer/domain/entities/interfaces/IState.js} +0 -0
  241. /package/es/platform/{data-broker → data-source}/http-template/deleteRecord.js +0 -0
  242. /package/es/platform/{data-broker → data-source}/http-template/deleteRecords.js +0 -0
  243. /package/es/platform/{data-broker → data-source}/http-template/getRecords.js +0 -0
  244. /package/es/platform/{data-broker → data-source}/http-template/updateRecord.js +0 -0
  245. /package/es/platform/{data-broker → data-source}/utils/transformer/Transformer.js +0 -0
  246. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/AbstractController.js +0 -0
  247. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/FailureController.js +0 -0
  248. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/NoContentController.js +0 -0
  249. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/RegisterController.js +0 -0
  250. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/SuccessController.js +0 -0
  251. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Service.js +0 -0
  252. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/TemplateHelpers.js +0 -0
  253. /package/es/platform/{zdata-broker → zdata-source}/applications/entities-factory/APITemplatesFactory.js +0 -0
  254. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/ITemplateHelpers.js +0 -0
  255. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/AbstractUseCase.js +0 -0
  256. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/RegisterUseCase.js +0 -0
  257. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplate.js +0 -0
  258. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplates.js +0 -0
  259. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/ApiEnum.js +0 -0
@@ -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
  }
@@ -12,9 +12,9 @@ class ExecuteActionUseCase extends AbstractUseCase {
12
12
  metaData,
13
13
  actionName
14
14
  } = input;
15
- const dataBroker = repository.getDataBrokerEntity(templateHelpers);
16
- const apiDetails = dataBroker.getApiDetails(actionName, props);
17
- dispatch(dataBroker.createFetchEvent(apiDetails, metaData));
15
+ const dataSource = repository.getDataSourceEntity(templateHelpers);
16
+ const apiDetails = dataSource.getApiDetails(actionName, props);
17
+ dispatch(dataSource.createFetchEvent(apiDetails, metaData));
18
18
  }
19
19
 
20
20
  }
@@ -11,10 +11,10 @@ class FailureUseCase extends AbstractUseCase {
11
11
  metaData,
12
12
  error
13
13
  } = input;
14
- const dataBroker = repository.getDataBrokerEntity(templateHelpers);
14
+ const dataSource = repository.getDataSourceEntity(templateHelpers);
15
15
 
16
- if (dataBroker.isMetaHasDataBrokerSignature(metaData)) {
17
- const events = dataBroker.createFailureEvents(error, metaData);
16
+ if (dataSource.isMetaHasDataSourceSignature(metaData)) {
17
+ const events = dataSource.createFailureEvents(error, metaData);
18
18
  events.forEach(action => {
19
19
  dispatch(action);
20
20
  });
@@ -10,10 +10,10 @@ class NoContentUseCase extends AbstractUseCase {
10
10
  dispatch,
11
11
  metaData
12
12
  } = input;
13
- const dataBroker = repository.getDataBrokerEntity(templateHelpers);
13
+ const dataSource = repository.getDataSourceEntity(templateHelpers);
14
14
 
15
- if (dataBroker.isMetaHasDataBrokerSignature(metaData)) {
16
- const events = dataBroker.createNoContentEvents(metaData);
15
+ if (dataSource.isMetaHasDataSourceSignature(metaData)) {
16
+ const events = dataSource.createNoContentEvents(metaData);
17
17
  events.forEach(action => {
18
18
  dispatch(action);
19
19
  });
@@ -14,12 +14,12 @@ class SuccessUseCase extends AbstractUseCase {
14
14
  const {
15
15
  actionName
16
16
  } = metaData;
17
- const dataBroker = repository.getDataBrokerEntity(templateHelpers);
17
+ const dataSource = repository.getDataSourceEntity(templateHelpers);
18
18
 
19
- if (dataBroker.isMetaHasDataBrokerSignature(metaData)) {
20
- const transformer = dataBroker.getTransformer(actionName);
19
+ if (dataSource.isMetaHasDataSourceSignature(metaData)) {
20
+ const transformer = dataSource.getTransformer(actionName);
21
21
  const transformedResponse = transformer(response);
22
- const events = dataBroker.createSuccessEvents(transformedResponse, metaData);
22
+ const events = dataSource.createSuccessEvents(transformedResponse, metaData);
23
23
  events.forEach(action => {
24
24
  dispatch(action);
25
25
  });
@@ -1,7 +1,7 @@
1
1
  import { FETCH } from "../../../../bc/zhttp/Constants";
2
- import { DATA_BROKER_EXECUTE_FAILED, DATA_BROKER_EXECUTE_NO_CONTENT_SUCCEEDED, DATA_BROKER_EXECUTE_SUCCEEDED } from "../../../../bc/zdata-broker/Constants";
3
- import { DATA_BROKER_FAILURE, DATA_BROKER_NO_CONTENT, DATA_BROKER_SIGNATURE, DATA_BROKER_SUCCESS } from "../../../../bc/zdata-broker/Symbols";
4
- export default class DataBroker {
2
+ import { DATA_SOURCE_EXECUTE_FAILED, DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED, DATA_SOURCE_EXECUTE_SUCCEEDED } from "../../../../bc/zdata-source/Constants";
3
+ import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SIGNATURE, DATA_SOURCE_SUCCESS } from "../../../../bc/zdata-source/Symbols";
4
+ export default class DataSource {
5
5
  constructor(apiTemplates) {
6
6
  this.apiTemplates = apiTemplates;
7
7
  }
@@ -11,14 +11,14 @@ export default class DataBroker {
11
11
  type: FETCH,
12
12
  payload: apiDetails,
13
13
  metaData: {
14
- signature: DATA_BROKER_SIGNATURE,
14
+ signature: DATA_SOURCE_SIGNATURE,
15
15
  ...metaData
16
16
  }
17
17
  };
18
18
  }
19
19
 
20
- isMetaHasDataBrokerSignature(metaData) {
21
- return metaData.signature === DATA_BROKER_SIGNATURE;
20
+ isMetaHasDataSourceSignature(metaData) {
21
+ return metaData.signature === DATA_SOURCE_SIGNATURE;
22
22
  }
23
23
 
24
24
  createSuccessEvents(transformedResponse, fullMetaData) {
@@ -28,7 +28,7 @@ export default class DataBroker {
28
28
  const {
29
29
  type,
30
30
  metaData
31
- } = fullMetaData[DATA_BROKER_SUCCESS];
31
+ } = fullMetaData[DATA_SOURCE_SUCCESS];
32
32
  const actions = [];
33
33
  type && actions.push({
34
34
  type,
@@ -38,7 +38,7 @@ export default class DataBroker {
38
38
  }
39
39
  });
40
40
  actions.push({
41
- type: DATA_BROKER_EXECUTE_SUCCEEDED,
41
+ type: DATA_SOURCE_EXECUTE_SUCCEEDED,
42
42
  metaData,
43
43
  payload: {
44
44
  actionName,
@@ -55,7 +55,7 @@ export default class DataBroker {
55
55
  const {
56
56
  type,
57
57
  metaData
58
- } = fullMetaData[DATA_BROKER_NO_CONTENT];
58
+ } = fullMetaData[DATA_SOURCE_NO_CONTENT];
59
59
  const actions = [];
60
60
  type && actions.push({
61
61
  type,
@@ -63,7 +63,7 @@ export default class DataBroker {
63
63
  payload: {}
64
64
  });
65
65
  actions.push({
66
- type: DATA_BROKER_EXECUTE_NO_CONTENT_SUCCEEDED,
66
+ type: DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED,
67
67
  metaData,
68
68
  payload: {
69
69
  actionName
@@ -79,7 +79,7 @@ export default class DataBroker {
79
79
  const {
80
80
  type,
81
81
  metaData
82
- } = fullMetaData[DATA_BROKER_FAILURE];
82
+ } = fullMetaData[DATA_SOURCE_FAILURE];
83
83
  const actions = [];
84
84
  type && actions.push({
85
85
  type,
@@ -89,7 +89,7 @@ export default class DataBroker {
89
89
  }
90
90
  });
91
91
  actions.push({
92
- type: DATA_BROKER_EXECUTE_FAILED,
92
+ type: DATA_SOURCE_EXECUTE_FAILED,
93
93
  metaData,
94
94
  payload: {
95
95
  actionName,