{"version":3,"sources":["../../../packages/core/workflow/persistent-workflow-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,8BAA8B,CAAC,YAAY,EAAE,eAAe;IACzE;;;;;OAKG;IACH,IAAI,CACA,QAAQ,EAAE,kBAAkB,CAAC,yBAAyB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,EACtF,OAAO,EAAE,yBAAyB,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;CAC5F;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB,CAAC,YAAY,EAAE,eAAe;IACpE;;OAEG;IACH,WAAW,EAAE,YAAY,CAAC;IAE1B;;OAEG;IACH,cAAc,EAAE,eAAe,CAAC;IAEhC;;OAEG;IACH,KAAK,EAAE,8BAA8B,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IAErE;;OAEG;IACH,UAAU,EAAE,4BAA4B,CAAC;IAEzC;;OAEG;IACH,IAAI,EAAE,qBAAqB,EAAE,CAAC;IAE9B;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB","file":"persistent-workflow-context.d.ts","sourcesContent":["import { Observable } from 'rxjs';\r\nimport { PersistentWorkItem } from './persistent-work-item';\r\nimport { PersistentWorkItemApplyState } from './persistent-work-item-apply-state';\r\nimport { PersistentWorkflow } from './persistent-workflow';\r\n\r\n/**\r\n * Store the custom checkpoint data if necessary.\r\n */\r\nexport interface PersistentWorkflowContextStore<TTransitData, TPersistentData> {\r\n    /**\r\n     * Store current context to allow restore.\r\n     *\r\n     * @param workItem the work item.\r\n     * @param context the context of workflow.\r\n     */\r\n    save(\r\n        workItem: PersistentWorkItem<PersistentWorkflowContext<TTransitData, TPersistentData>>,\r\n        context: PersistentWorkflowContext<TTransitData, TPersistentData>): Observable<void>;\r\n}\r\n\r\n/**\r\n * The logging record.\r\n */\r\nexport interface PersistentWorkflowLog {\r\n    /**\r\n     * The timestamp.\r\n     */\r\n    time: number;\r\n\r\n    /**\r\n     * The name of work item.\r\n     */\r\n    name: string;\r\n\r\n    /**\r\n     * The state of work item.\r\n     */\r\n    state: string; // of PersistentWorkItemState;\r\n}\r\n\r\n/**\r\n * The context of workflow.\r\n */\r\nexport interface PersistentWorkflowContext<TTransitData, TPersistentData> {\r\n    /**\r\n     * The transit data which wouldn't be stored into persistent store, but can pass around within a workflow cycle.\r\n     */\r\n    transitData: TTransitData;\r\n\r\n    /**\r\n     * The persistent data which would be saved and would be restored when browser was closed/reopened.\r\n     */\r\n    persistentData: TPersistentData;\r\n\r\n    /**\r\n     * The store interface to take a snapshot at during a call.\r\n     */\r\n    store: PersistentWorkflowContextStore<TTransitData, TPersistentData>;\r\n\r\n    /**\r\n     * The state of applying condition after preValidate() call.\r\n     */\r\n    applyState: PersistentWorkItemApplyState;\r\n\r\n    /**\r\n     * The logging of state change.\r\n     */\r\n    logs: PersistentWorkflowLog[];\r\n\r\n    /**\r\n     * The workflow instance.\r\n     */\r\n    workflow: PersistentWorkflow;\r\n\r\n    /**\r\n     * The version of restored workflow.\r\n     */\r\n    restoreVersion?: number;\r\n\r\n    /**\r\n     * The error object.\r\n     */\r\n    error?: any;\r\n\r\n    /**\r\n     * The instance ID.\r\n     */\r\n    instanceId?: number;\r\n}\r\n"]}