import * as util from './actions-utils'; import { ActionsObservable as rActionsObservable } from 'redux-observable'; import { Observable } from 'rxjs/Observable'; import { Store } from 'redux'; import { LoginResponse, SessionScreen } from '../interfaces/session'; import { Action as HistoryAction } from 'history'; import { DrillDownType, Route } from '../interfaces/router'; import { ViewMetaResponse, ApplicationError } from '../interfaces/view'; import { DataItem, MultivalueSingleValue, PendingDataItem, PickMap } from '../interfaces/data'; import { Store as CoreStore } from '../interfaces/store'; import { RowMeta } from '../interfaces/rowMeta'; import { ObjectMap, AppNotificationType } from '../interfaces/objectMap'; import { OperationPostInvokeAny, OperationTypeCrud, AssociatedItem, OperationErrorEntity, OperationPostInvokeConfirm, OperationPreInvoke } from '../interfaces/operation'; import { BcFilter, BcSorter } from '../interfaces/filters'; /** * ActionName: PayloadType = z * @param ActionName Name for an action (redux action "type") and corresponding action creater action * @param PayloadType Typescript description for payload * @property z Mandatory to prevent typescript from erasing unused class fields (@see https://github.com/microsoft/TypeScript/issues/12437) */ export declare class ActionPayloadTypes { /** * Browser location change occured (either through history listener or manually) * * @param rawLocation Change was requested to browser url * @param location Change was requested to precalculated application route * @param action History API type, usually 'PUSH' */ changeLocation: { rawLocation?: string; location?: Route; action: HistoryAction; }; /** * Authentication request * * @param login User-provided login * @param password User-provided password * @param role Optionally user can choose a role to authentificate with */ login: { login: string; password: string; role?: string; }; /** * Login was successful */ loginDone: LoginResponse; /** * Login was unsuccesful * * @param errorMsg Reason could be provided */ loginFail: { errorMsg: string; }; /** * Logout was requested, manually or through stale session */ logout: null; /** * User succesfully was logged out */ logoutDone: null; /** * Request to change active screen was initiated * * TODO: 2.0.0 Should be string (just the screen name) instead; * Initially this was due to `screen` reducer did not having access to `session` part of redux store * @param screen Request initiated with all the meta from login response */ selectScreen: { screen: SessionScreen; }; /** * Request to change active screen was unsuccesful (incorrect path, unknown screen, etc.) * * @param screenName Which screen was requested originally */ selectScreenFail: { screenName: string; }; /** * Request to change active view was initiated * * TODO: 2.0.0 Should be string (just the view name) instead; * Initially this was due to `screen` and `view` reducers did not having access to `session` part of redux store */ selectView: ViewMetaResponse; /** * Request to change active view was unsuccesful (incorrect path, unknown screen, etc.) * * @param selectViewFail Which view was requested originally */ selectViewFail: { viewName: string; }; /** * Fetch data request for business component was initiated * * @param widgetName What widget requires data (widget can only request its own data here) * * @deprecated TODO: 2.0.0 Should be removed in favor of widgetName * @param bcName The business component to fetch data for * * @deprecated TODO: 2.0.0 Should be all moved to separate hierarchy-specific action * @param depth The level of hierarchy to fetch data for * @param ignorePageLimit Page size should be ignored * @param keepDelta Pending changes should not be dropped when performing this request (due to * hierarchy expanging through cursor change, for same BC hierarchy this leads to data loss) */ bcFetchDataRequest: { bcName: string; depth?: number; widgetName: string; ignorePageLimit?: boolean; keepDelta?: boolean; }; /** * Fetch data request request for specific pages range */ bcFetchDataPages: { /** * The business component to fetch data for * @deprecated TODO: 2.0.0 Should be removed in favor of widgetName */ bcName: string; /** * Fisrt page to fetch (default is 1) */ widgetName: string; /** * What widget requires data (widget can only request its own data here) */ from?: number; /** * Last page to fetch (default is current page) */ to?: number; }; /** * Fetch data request for searchable fields * * @param bcName The business component to fetch data for * @param searchSpec Search expression // TODO: Check format * @param searchString Value to search for */ inlinePickListFetchDataRequest: { bcName: string; searchSpec: string; searchString: string; }; /** * Fetch data request was succesful * * @param data Data records from response for this business component * @param bcUrl BC url with respect of parents cursors * @param hasNext If there are more data to fetch (other pages etc.) * * @deprecated TODO: 2.0.0 Remove in favor of widgetName * @param bcName Business component that requested data * * @deprecated TODO: 2.0.0 Should be all moved to separate hierarchy-specific action * @param depth For same BC hierarchies, the level which was requested */ bcFetchDataSuccess: { bcName: string; data: DataItem[]; depth?: number; bcUrl: string; hasNext?: boolean; }; /** * Fetch data request wac unsuccesful * * @param bcName Business component that initiated data fetch * @param bcUrl BC url with respect of parents cursors * * @deprecated TODO: 2.0.0 Should be all moved to separate hierarchy-specific action * @param depth For same BC hierarchies, the level which was requested */ bcFetchDataFail: { bcName: string; bcUrl: string; depth?: number; }; /** * Fetch next chunk of data for table widgets with infinite scroll * * @param bcName Business component that initiated data fetch * @param widgetName Widget that initiated row meta fetch */ bcLoadMore: { bcName: string; widgetName?: string; }; /** * Fetch meta information for active record of business component * * @param widgetName Widget that initiated row meta fetch * * @deprecated TODO: 2.0.0 Remove in favor of widgetName * @param bcName Business component that initiated row meta fetch */ bcFetchRowMeta: { bcName: string; widgetName: string; }; /** * TODO * * @param bcName * @param bcUrl * @param rowMeta * @param cursor */ bcFetchRowMetaSuccess: { bcName: string; bcUrl: string; rowMeta: RowMeta; cursor?: string; }; /** * TODO * * @param bcName */ bcFetchRowMetaFail: { bcName: string; }; /** * TODO * * @param bcName */ bcNewData: { bcName: string; }; /** * TODO * * @param bcName * @param dataItem * @param bcUrl */ bcNewDataSuccess: { bcName: string; dataItem: DataItem; bcUrl: string; }; /** * TODO * * @param bName */ /** * TODO * * @param bcName */ bcNewDataFail: { bcName: string; }; /** * TODO * * @param bcName */ bcDeleteDataFail: { bcName: string; }; /** * Request to change Force active field was unsuccesful * * @param bcName * @param bcUrl * @param viewError * @param entityError */ forceActiveChangeFail: { bcName: string; bcUrl: string; viewError: string; entityError: OperationErrorEntity; }; /** * Perform CustomAction * * @param bcName The business component to fetch data for * @param operationType Type of operation to be performed * @param widgetName What widget requires data * @param onSuccessAction Any other action * @param confirm params for confirm modal * @param bcKey key called bk */ sendOperation: { bcName: string; operationType: OperationTypeCrud | string; widgetName: string; onSuccessAction?: AnyAction; confirm?: string; bcKey?: string; /** * @deprecated TODO: Remove in 2.0.0 in favor of sendOperationWithConfirm */ confirmOperation?: OperationPreInvoke; }; /** * TODO * * @param bcName * @param bcUrl * @param viewError * @param entityError */ sendOperationFail: { bcName: string; bcUrl: string; viewError: string; entityError: OperationErrorEntity; }; /** * TODO * * @param bcName * @param cursor */ sendOperationSuccess: { bcName: string; cursor: string; }; /** * TODO * * @param postInvoke * @param cursor * @param widgetName What widget initiated original operation, TODO: mandatory in 2.0.0 * * @deprecated TODO: Prefer widgetName instead (2.0.0) * @param bcName */ processPostInvoke: { bcName: string; postInvoke: OperationPostInvokeAny; cursor?: string; widgetName?: string; }; /** * Operation to perform preInvoke actions * * @param bcName The business component to fetch data for * @param operationType Type of operation to be performed * @param widgetName What widget requires data * @param preInvoke the action that will be performed before the main operation */ processPreInvoke: { bcName: string; operationType: string; widgetName: string; preInvoke: OperationPreInvoke; }; /** * Operation to perform postInvokeConfirm actions * * @param bcName The business component to fetch data for * @param operationType Type of operation to be performed * @param widgetName What widget requires data * @param postInvokeConfirm the action that will be performed after the main operation and confirmation */ processPostInvokeConfirm: { bcName: string; operationType: string; widgetName: string; postInvokeConfirm: OperationPostInvokeConfirm; }; /** * TODO * * @param widgetName * @param bcName * @param cursor * @param fieldKey */ userDrillDown: { widgetName: string; bcName: string; cursor: string; fieldKey: string; }; /** * TODO * * @param bcUrl * @param bcName * @param cursor */ userDrillDownSuccess: { bcUrl: string; bcName: string; cursor: string; }; /** * TODO * * @param url * @param drillDownType * @param urlName * @param route */ drillDown: { url: string; drillDownType?: DrillDownType; urlName?: string; route: Route; widgetName?: string; }; /** * TODO * * @param cursorsMap * @param keepDelta */ bcChangeCursors: { cursorsMap: ObjectMap; keepDelta?: boolean; }; /** * TODO * * @param bcName * @param depth * @param cursor */ bcChangeDepthCursor: { bcName: string; depth: number; cursor: string; }; /** * TODO * * @param bcName * @param cursors * @param dataItems * @param disableRetry */ changeDataItem: { bcName: string; cursor: string; dataItem: PendingDataItem; disableRetry?: boolean; }; /** * TODO * * @param bcName * @param cursors * @param dataItems */ changeDataItems: { bcName: string; cursors: string[]; dataItems: PendingDataItem[]; }; /** * TODO * * @param currentRecordData * @param rowMeta * @param bcName * @param bcUrl * @param cursor */ forceActiveRmUpdate: { currentRecordData: DataItem; rowMeta: RowMeta; bcName: string; bcUrl: string; cursor: string; }; /** * TODO * * @param bcName * @param calleeBCName * @param associateFieldKey * @param assocValueKey * @param active * @param isFilter */ showViewPopup: { bcName: string; calleeBCName?: string; associateFieldKey?: string; assocValueKey?: string; active?: boolean; isFilter?: boolean; }; /** * TODO * * @param bcName */ closeViewPopup: { bcName: string; }; /** * TODO * * @param map * @param bcName */ viewPutPickMap: { map: PickMap; bcName: string; }; /** * TODO */ viewClearPickMap: null; /** * TODO * * @param bcNames * @param calleeBCName * @param associateFieldKey */ saveAssociations: { bcNames: string[]; calleeBcName?: string; associateFieldKey?: string; }; /** * TODO * * @param bcName * @param records */ changeAssociations: { bcName: string; records?: DataItem[]; }; /** * TODO * * @param bcName * @param popupBcName * @param cursor * @param associateFieldKey * @param dataItem * @param removedItem */ removeMultivalueTag: { bcName: string; popupBcName: string; cursor: string; associateFieldKey: string; dataItem: MultivalueSingleValue[]; removedItem: MultivalueSingleValue; }; /** * TODO * * @param bcName * @param cursor * @param dataItem */ bcSaveDataSuccess: { bcName: string; cursor: string; dataItem: DataItem; }; /** * TODO * * @param bcName * @param bcUrl * @param entityError * @param viewError */ bcSaveDataFail: { bcName: string; bcUrl: string; entityError?: OperationErrorEntity; viewError?: string; }; /** * Save info about current operation for confirm modal * * @param operation Current operation * @param confirmOperation Text for confirm modal */ operationConfirmation: { operation: { bcName: string; operationType: OperationTypeCrud | string; widgetName: string; }; confirmOperation: OperationPostInvokeConfirm; }; /** * TODO * * @param bcName * @param widgetName What widget requires data (widget can only request its own data here) */ bcForceUpdate: { bcName: string; widgetName?: string; }; /** * TODO */ uploadFile: null; /** * TODO */ uploadFileDone: null; /** * TODO */ uploadFileFailed: null; /** * TODO * * @param bcNames */ bcCancelPendingChanges: { bcNames: string[]; }; /** * TODO * * @param bcName * @param cursor * @param ignoreChildrenPageLimit * @param keepDelta */ bcSelectRecord: { bcName: string; cursor: string; ignoreChildrenPageLimit?: boolean; keepDelta?: boolean; }; /** * TODO * * @param bcName * @param depth * @param cursor */ bcSelectDepthRecord: { bcName: string; depth: number; cursor: string; }; /** * TODO * * @param bcName * @param widgetName * @param dataItem * @param assocValueKey */ changeAssociation: { bcName: string; widgetName: string; dataItem: AssociatedItem; assocValueKey: string; }; /** * TODO * * @param bcName * @param depth * @param widgetName * @param dataItem * @param assocValueKey */ changeAssociationSameBc: { bcName: string; depth: number; widgetName: string; dataItem: AssociatedItem; assocValueKey: string; }; /** * TODO * * @param bcName * @param depth * @param widgetName * @param dataItem * @param assocValueKey */ changeAssociationFull: { bcName: string; depth: number; widgetName: string; dataItem: AssociatedItem; assocValueKey: string; }; /** * TODO * * @param bcName * @param assocValueKey * @param selected */ changeChildrenAssociations: { bcName: string; assocValueKey: string; selected: boolean; }; /** * TODO * * @param bcName * @param depth * @param assocValueKey * @param selected */ changeChildrenAssociationsSameBc: { bcName: string; depth: number; assocValueKey: string; selected: boolean; }; /** * TODO * * @param bcName * @param parentId * @param depth * @param assocValueKey * @param selected */ changeDescendantsAssociationsFull: { bcName: string; parentId: string; depth: number; assocValueKey: string; selected: boolean; }; /** * TODO * * @param bcNames */ dropAllAssociations: { bcNames: string[]; }; /** * TODO * * @param bcName * @param depthFrom */ dropAllAssociationsSameBc: { bcName: string; depthFrom: number; }; /** * TODO * * @param bcName * @param depth * @param dropDescendants */ dropAllAssociationsFull: { bcName: string; depth: number; dropDescendants?: boolean; }; /** * TODO * * @param path * @param params */ handleRouter: { path: string; params: object; }; /** * TODO * * @param widgetName * @param rowId * @param fieldKey */ selectTableCellInit: { widgetName: string; rowId: string; fieldKey: string; }; /** * TODO * * @param widgetName * @param rowId * @param fieldKey */ selectTableCell: { widgetName: string; rowId: string; fieldKey: string; }; /** * TODO * * @param bcName * @param cursor * @param router */ showAllTableRecordsInit: { bcName: string; cursor: string; /** * @deprecated Remove in 2.0 (accessible from the store) */ route?: Route; }; /** * TODO * * @param type * @param message */ showNotification: { type: AppNotificationType; message: string; }; /** * TODO * * @param id */ closeNotification: { id: number; }; /** * TODO * * @param bcName * @param filter */ bcAddFilter: { bcName: string; filter: BcFilter; }; /** * TODO * * @param bcName * @param filter */ bcRemoveFilter: { bcName: string; filter: BcFilter; }; /** * Remove all filters at once * * @param bcName */ bcRemoveAllFilters: { bcName: string; }; /** * TODO * * @param bcName * @param sorter */ bcAddSorter: { bcName: string; sorter: BcSorter | BcSorter[]; }; /** * TODO * * @param bcName * @param sorter */ bcRemoveSorter: { bcName: string; sorter: BcSorter; }; /** * TODO * * @param bcName * @param page */ bcChangePage: { bcName: string; page: number; }; /** * TODO * * @param error */ showViewError: { error: ApplicationError; }; /** * TODO */ closeViewError: null; /** * Close confirm modal window */ closeConfirmModal: null; /** * TODO */ clearValidationFails: null; /** * TODO * * @param fileId */ downloadFile: { fileId: string; }; /** * TODO * * @param url */ downloadFileByUrl: { url: string; }; /** * TODO */ emptyAction: null; } export declare const types: util.uActionTypesMap; export declare const needSaveAction: (action: string) => boolean; export declare const $do: util.uActionCreators; export declare type ActionsMap = util.uActionsMap; export declare type AnyAction = util.AnyOfMap | { type: ' UNKNOWN ACTION '; }; export interface ActionsObservable extends rActionsObservable { /** * TODO * * @param key */ ofType(...key: K[]): ActionsObservable; } export declare type Epic = (action$: ActionsObservable, store: Store) => Observable;