@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.
- package/README.md +2 -2
- package/es/bc/{zdata-broker → zdata-source}/Actions.js +6 -6
- package/es/bc/{zdata-broker → zdata-source}/Constants.js +6 -5
- package/es/bc/zdata-source/EventHandlers.js +2 -0
- package/es/bc/zdata-source/Symbols.js +5 -0
- package/es/bc/zfield/ActionHandlers.js +1 -1
- package/es/bc/zlist/EventHandlers.js +1 -1
- package/es/bc/zlist/Properties.js +16 -32
- package/es/cc/action-icon/Properties.js +31 -0
- package/es/cc/action-location/Properties.js +9 -24
- package/es/cc/table-connected/Constants.js +4 -0
- package/es/cc/table-connected/Properties.js +11 -57
- package/es/cc/table-list/Properties.js +2 -2
- package/es/cc/table-list/data-types/Header.js +6 -0
- package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +88 -1
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +22 -8
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +5 -2
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +4 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +1 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +16 -3
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +6 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +16 -3
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon.js +18 -2
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +75 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +7 -6
- package/es/platform/client-actions/Readme.md +31 -0
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/Readme.md +14 -21
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/ExecuteActionBehaviourUseCase.js +1 -1
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/InitializeUseCase.js +2 -2
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientAction.js +12 -4
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActionManager.js +9 -9
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActions.js +0 -4
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMapping.js +5 -1
- package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/UIComponentMapping.js +7 -3
- package/es/platform/{zclient-actions/frameworks/ClientActionBehaviourFactory.js → client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory.js} +1 -1
- package/es/platform/client-actions/cc/action-event-mediator/Properties.js +34 -0
- package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +51 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/MountController.js +18 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/PropertiesChangeController.js +26 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/UnmountController.js +18 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +36 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +22 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/AbstractUseCase.js +15 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/DestroyUseCase.js +13 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/InitializeUseCase.js +13 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +17 -0
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +108 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator.js +13 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +19 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +30 -0
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponent.js +9 -0
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +34 -0
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +7 -0
- package/es/platform/client-actions/components/interfaces/EventMappingViewModel.js +0 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.js +12 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +17 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +30 -0
- package/es/platform/client-actions/template-resolver/index.js +44 -0
- package/es/platform/client-actions/template-resolver/interfaces/ITemplate.js +1 -0
- package/es/platform/client-actions/translators/client-actions-translator/index.js +29 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEmptyString.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEndsWith.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThan.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThanOrEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIn.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsEmpty.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsNotEmpty.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThan.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThanOrEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLike.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotLike.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalStartsWith.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/GetResolvedContextFieldValue.js +8 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/index.js +58 -0
- package/es/platform/client-actions/translators/condition-resolver/index.js +33 -0
- package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/PatternValidator.js +86 -0
- package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/index.js +96 -0
- package/es/platform/client-actions/translators/context-resolver/index.js +54 -0
- package/es/platform/client-actions/translators/interfaces/IContext.js +1 -0
- package/es/platform/client-actions/translators/interfaces/IState.js +1 -0
- package/es/platform/data-source/dbc/index.js +1 -0
- package/es/platform/{data-broker → data-source}/http-template/getAvailableFields.js +5 -5
- package/es/platform/{data-broker → data-source}/http-template/getClientActions.js +4 -4
- package/es/platform/{data-broker → data-source}/http-template/getSelectedFields.js +5 -5
- package/es/platform/{data-broker → data-source}/index.js +2 -2
- package/es/platform/{data-broker → data-source}/utils/transformer/CreateCf.js +1 -1
- package/es/platform/{zdata-broker/adapters/controllers/DataBrokerExecutorController.js → zdata-source/adapters/controllers/DataSourceExecutorController.js} +1 -1
- package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Repository.js +5 -5
- package/es/platform/{zdata-broker → zdata-source}/adapters/presenters/Presenter.js +4 -4
- package/es/platform/{zdata-broker/applications/entities-factory/DataBrokerFactory.js → zdata-source/applications/entities-factory/DataSourceFactory.js} +3 -4
- package/es/platform/zdata-source/applications/interfaces/InputDependencies.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/gateways/IService.js +0 -0
- package/es/platform/zdata-source/applications/interfaces/gateways/State.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/ExecuteActionInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/FailureInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/NoContentInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/RegisterInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/SuccessInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js +3 -3
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/FailureUseCase.js +3 -3
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/NoContentUseCase.js +3 -3
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/SuccessUseCase.js +4 -4
- package/es/platform/{zdata-broker/domain/entities/DataBroker.js → zdata-source/domain/entities/DataSource.js} +12 -12
- package/es/platform/zdata-source/domain/entities/interfaces/APIDetailsModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/APITemplateModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/APITemplatesModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/BehaviourState.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/EventModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplate.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplates.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/IDataSource.js +0 -0
- package/es/platform/zdata-source/domain/entities/interfaces/ITemplateHelpers.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/MetaData.js +1 -0
- package/es/platform/{zdata-broker → zdata-source}/frameworks/DataBrokerBehaviourFactory.js +2 -2
- package/es/platform/{zdata-broker → zdata-source}/frameworks/EventHandlersFactory.js +7 -12
- package/es/platform/zfield/applications/usecases/ExecuteActionUseCase.js +1 -1
- package/es/platform/zfield/applications/usecases/InitializeUseCase.js +2 -2
- package/es/platform/zfield/applications/usecases/RefetchUseCase.js +1 -1
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -5
- package/es/platform/zfield/frameworks/ActionHandlerFactory.js +4 -4
- package/es/platform/zlist/adapters/controllers/DeleteSuccessController.js +25 -0
- package/es/platform/zlist/adapters/controllers/UpdateSuccessController.js +25 -0
- package/es/platform/zlist/adapters/gateways/Repository.js +8 -9
- package/es/platform/zlist/adapters/gateways/Service.js +8 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +46 -34
- package/es/platform/zlist/adapters/presenters/translators/ColumnSizeTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +16 -8
- package/es/platform/zlist/adapters/presenters/translators/Header.js +7 -2
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
- package/es/platform/zlist/adapters/presenters/translators/Row.js +10 -6
- package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +6 -6
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +7 -5
- package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +89 -0
- package/es/platform/zlist/adapters/presenters/translators/interfaces/Context.js +1 -0
- package/es/platform/zlist/adapters/presenters/translators/interfaces/FieldComponentMapping.js +1 -0
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
- package/es/platform/zlist/applications/usecases/DeleteSuccessUseCase.js +19 -0
- package/es/platform/zlist/applications/usecases/UpdateSuccessUseCase.js +19 -0
- package/es/platform/zlist/domain/entities/List.js +51 -11
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +17 -23
- package/es/platform/zrecord/applications/usecases/ExecuteActionUseCase.js +1 -1
- package/es/platform/zrecord/applications/usecases/FetchMoreUseCase.js +1 -1
- package/es/platform/zrecord/applications/usecases/InitializeUseCase.js +2 -2
- package/es/platform/zrecord/applications/usecases/RefetchUseCase.js +1 -1
- package/es/platform/zrecord/domain/entities/RecordsManager.js +10 -10
- package/package.json +4 -3
- package/es/bc/zdata-broker/EventHandlers.js +0 -2
- package/es/bc/zdata-broker/Symbols.js +0 -5
- package/es/desk-frameworks/table-connected/frameworks/__tests__/TableConnectedFactory.spec.js +0 -453
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getAvailableFields.js +0 -86
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getRecords.js +0 -81
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getSelectedFields.js +0 -32
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/index.js +0 -11
- package/es/platform/zdata-broker/domain/entities/interfaces/MetaData.js +0 -1
- /package/es/bc/{zdata-broker → zdata-source}/Properties.js +0 -0
- /package/es/{bc → platform/client-actions/bc}/zclient-actions/Constants.js +0 -0
- /package/es/{bc → platform/client-actions/bc}/zclient-actions/EventHandlers.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/AbstractController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/ClientActionBehaviourExecutorController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FailureController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FetchStateStopController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/MountController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/NoContentController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SetClientActionsController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SuccessController.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Repository.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Service.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/presenters/Presenter.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionFactory.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionManagerFactory.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ClientActionModel.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ComponentPropertiesModel.js +0 -0
- /package/es/platform/{data-broker/dbc/index.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionFieldModel.js} +0 -0
- /package/es/platform/{zclient-actions/applications/interfaces/InputDependencies.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionModel.js} +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/EventMappingModel.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/IError.js +0 -0
- /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/InputDependencies.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PayloadValueMappingModel.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PropsMeta.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/StrategyMeta.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UIComponentMappingModel.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UserDetailsModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IService.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/State.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/ExecuteActionBehaviourInputModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FailureInputModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FetchStateStopInputModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/InitializeInputModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/NoContentInputModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SetClientActionsInputModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SuccessInputModel.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/output/IPresenter.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/AbstractUseCase.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FailureUseCase.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FetchStateStopUseCase.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/NoContentUseCase.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SetClientActionsUseCase.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SuccessUseCase.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMappings.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/GetClientActionsStrategy.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/BehaviourState.js +0 -0
- /package/es/platform/{zclient-actions/domain/entities/interfaces/ClientActionsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionModel.js} +0 -0
- /package/es/platform/{zclient-actions/domain/entities/interfaces/EventModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionsModel.js} +0 -0
- /package/es/platform/{zclient-actions/domain/entities/interfaces/IAction.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ComponentPropertiesModel.js} +0 -0
- /package/es/platform/{zclient-actions/domain/entities/interfaces/IEvent.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionFieldModel.js} +0 -0
- /package/es/platform/{zclient-actions/domain/entities/interfaces/SubMeta.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/gateways/IRepository.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/EventMappingModel.js} +0 -0
- /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/EventModel.js +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/gateways/State.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IAction.js} +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientAction.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionExecuteStrategy.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionManager.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActions.js +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/ExecuteActionInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IError.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/FailureInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IEvent.js} +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMapping.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMappings.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IPayload.js +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IUIComponentMapping.js +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/NoContentInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PayloadValueMappingModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/RegisterInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PropsMeta.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/SuccessInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/State.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/output/IPresenter.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/StrategyMeta.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/APIDetailsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/SubMeta.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplateModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UIComponentMappingModel.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplatesModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UserDetailsModel.js} +0 -0
- /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/frameworks/ActionsHandlersFactory.js +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/BehaviourState.js → client-actions/components/action-event-mediator/applications/interfaces/UseCaseDependencies.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/gateways/IService.js → client-actions/components/action-event-mediator/applications/interfaces/gateways/IRepository.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplate.js → client-actions/components/action-event-mediator/applications/interfaces/input/PropertiesChangeUseCaseInputModel.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/IDataBroker.js → client-actions/components/action-event-mediator/applications/interfaces/output/IPresenter.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplates.js → client-actions/components/action-event-mediator/domain/entities/interfaces/IActionLocation.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/ITemplateHelpers.js → client-actions/components/action-event-mediator/domain/entities/interfaces/IState.js} +0 -0
- /package/es/platform/{zlist/adapters/presenters/translators/interfaces/FieldUiMapping.js → client-actions/components/dynamic-component/domain/entities/interfaces/IState.js} +0 -0
- /package/es/platform/{zlist/adapters/presenters/translators/interfaces/PageContext.js → client-actions/components/row-actions-renderer/domain/entities/interfaces/IState.js} +0 -0
- /package/es/platform/{data-broker → data-source}/http-template/deleteRecord.js +0 -0
- /package/es/platform/{data-broker → data-source}/http-template/deleteRecords.js +0 -0
- /package/es/platform/{data-broker → data-source}/http-template/getRecords.js +0 -0
- /package/es/platform/{data-broker → data-source}/http-template/updateRecord.js +0 -0
- /package/es/platform/{data-broker → data-source}/utils/transformer/Transformer.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/AbstractController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/FailureController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/NoContentController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/RegisterController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/SuccessController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Service.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/TemplateHelpers.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/applications/entities-factory/APITemplatesFactory.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/ITemplateHelpers.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/AbstractUseCase.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/RegisterUseCase.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplate.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplates.js +0 -0
- /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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
let getAvailableFields = {
|
|
2
|
-
name:
|
|
3
|
-
api:
|
|
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:
|
|
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:
|
|
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:
|
|
23
|
+
type: 'string'
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
let getClientActions = {
|
|
2
|
-
name:
|
|
3
|
-
api:
|
|
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:
|
|
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:
|
|
17
|
+
type: 'string'
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
let getSelectedFields = {
|
|
2
|
-
name:
|
|
3
|
-
api:
|
|
2
|
+
name: 'selectedFields',
|
|
3
|
+
api: '/{{servicePrefix}}/{{orgName}}/api/v1/views/{{viewId}}/selectedFields',
|
|
4
4
|
parameters: `{
|
|
5
5
|
"departmentId":"{{departmentId}}"
|
|
6
6
|
}`,
|
|
7
|
-
type:
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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,
|
|
4
|
+
if ([key, 'id', 'createdTime'].includes(next)) {
|
|
5
5
|
return res;
|
|
6
6
|
} else {
|
|
7
7
|
res[next] = item[next];
|
|
@@ -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
|
|
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
|
-
|
|
13
|
+
getDataSourceEntity(templateHelpers) {
|
|
14
14
|
const {
|
|
15
|
-
|
|
15
|
+
dataSource
|
|
16
16
|
} = this.state.behaviours;
|
|
17
17
|
const {
|
|
18
18
|
apiTemplates
|
|
19
|
-
} =
|
|
20
|
-
const recordManager =
|
|
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(
|
|
15
|
+
updateBehaviourState(dataSourceBehaviourState) {
|
|
16
16
|
this.state = { ...this.state,
|
|
17
17
|
behaviours: { ...this.state.behaviours,
|
|
18
|
-
|
|
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
|
-
|
|
26
|
+
dataSource
|
|
27
27
|
} = this.state.behaviours;
|
|
28
28
|
this.updateBehaviourState({
|
|
29
|
-
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
|
|
3
|
-
export default class
|
|
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
|
-
|
|
7
|
-
return dataBroker;
|
|
6
|
+
return new DataSource(apiTemplates);
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js
RENAMED
|
@@ -12,9 +12,9 @@ class ExecuteActionUseCase extends AbstractUseCase {
|
|
|
12
12
|
metaData,
|
|
13
13
|
actionName
|
|
14
14
|
} = input;
|
|
15
|
-
const
|
|
16
|
-
const apiDetails =
|
|
17
|
-
dispatch(
|
|
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
|
|
14
|
+
const dataSource = repository.getDataSourceEntity(templateHelpers);
|
|
15
15
|
|
|
16
|
-
if (
|
|
17
|
-
const events =
|
|
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
|
|
13
|
+
const dataSource = repository.getDataSourceEntity(templateHelpers);
|
|
14
14
|
|
|
15
|
-
if (
|
|
16
|
-
const events =
|
|
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
|
|
17
|
+
const dataSource = repository.getDataSourceEntity(templateHelpers);
|
|
18
18
|
|
|
19
|
-
if (
|
|
20
|
-
const transformer =
|
|
19
|
+
if (dataSource.isMetaHasDataSourceSignature(metaData)) {
|
|
20
|
+
const transformer = dataSource.getTransformer(actionName);
|
|
21
21
|
const transformedResponse = transformer(response);
|
|
22
|
-
const events =
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
export default class
|
|
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:
|
|
14
|
+
signature: DATA_SOURCE_SIGNATURE,
|
|
15
15
|
...metaData
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
return metaData.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[
|
|
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:
|
|
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[
|
|
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:
|
|
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[
|
|
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:
|
|
92
|
+
type: DATA_SOURCE_EXECUTE_FAILED,
|
|
93
93
|
metaData,
|
|
94
94
|
payload: {
|
|
95
95
|
actionName,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|