@activepieces/shared
Advanced tools
Comparing version 0.3.25 to 0.3.26
{ | ||
"name": "@activepieces/shared", | ||
"version": "0.3.25", | ||
"version": "0.3.26", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -12,2 +12,3 @@ export * from "./lib/flows/actions/action"; | ||
export * from "./lib/flow-run/execution/execution-output"; | ||
export * from "./lib/flow-run/execution/execution-type"; | ||
export * from "./lib/flow-run/execution/step-output"; | ||
@@ -14,0 +15,0 @@ export * from "./lib/flows/flow-operations"; |
@@ -16,2 +16,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./lib/flow-run/execution/execution-output"), exports); | ||
tslib_1.__exportStar(require("./lib/flow-run/execution/execution-type"), exports); | ||
tslib_1.__exportStar(require("./lib/flow-run/execution/step-output"), exports); | ||
@@ -18,0 +19,0 @@ tslib_1.__exportStar(require("./lib/flows/flow-operations"), exports); |
@@ -57,4 +57,4 @@ import { AppConnectionId } from "../app-connection/app-connection"; | ||
export declare type StepNotFoundErrorParams = BaseErrorParams<ErrorCode.STEP_NOT_FOUND, { | ||
pieceName: string; | ||
pieceVersion: string; | ||
pieceName?: string; | ||
pieceVersion?: string; | ||
stepName: string; | ||
@@ -119,3 +119,3 @@ }>; | ||
FLOW_NOT_FOUND = "FLOW_NOT_FOUND", | ||
FLOW_RUN_NOT_FOUND = "INSTANCE_NOT_FOUND", | ||
FLOW_RUN_NOT_FOUND = "FLOW_RUN_NOT_FOUND", | ||
FLOW_VERSION_NOT_FOUND = "FLOW_VERSION_NOT_FOUND", | ||
@@ -122,0 +122,0 @@ FLOW_INSTANCE_NOT_FOUND = "INSTANCE_NOT_FOUND", |
@@ -18,3 +18,3 @@ "use strict"; | ||
ErrorCode["FLOW_NOT_FOUND"] = "FLOW_NOT_FOUND"; | ||
ErrorCode["FLOW_RUN_NOT_FOUND"] = "INSTANCE_NOT_FOUND"; | ||
ErrorCode["FLOW_RUN_NOT_FOUND"] = "FLOW_RUN_NOT_FOUND"; | ||
ErrorCode["FLOW_VERSION_NOT_FOUND"] = "FLOW_VERSION_NOT_FOUND"; | ||
@@ -21,0 +21,0 @@ ErrorCode["FLOW_INSTANCE_NOT_FOUND"] = "INSTANCE_NOT_FOUND"; |
@@ -0,1 +1,3 @@ | ||
import { ExecutionState } from "../flow-run/execution/execution-state"; | ||
import { ExecutionType } from "../flow-run/execution/execution-type"; | ||
import { FlowVersion, FlowVersionId } from "../flows/flow-version"; | ||
@@ -36,9 +38,16 @@ import { ProjectId } from "../project/project"; | ||
} | ||
export interface ExecuteFlowOperation { | ||
declare type BaseExecuteFlowOperation<T extends ExecutionType> = { | ||
flowVersionId: FlowVersionId; | ||
projectId: ProjectId; | ||
triggerPayload: unknown; | ||
executionType: T; | ||
workerToken?: string; | ||
apiUrl?: string; | ||
} | ||
}; | ||
export declare type BeginExecuteFlowOperation = BaseExecuteFlowOperation<ExecutionType.BEGIN>; | ||
export declare type ResumeExecuteFlowOperation = BaseExecuteFlowOperation<ExecutionType.RESUME> & { | ||
executionState: ExecutionState; | ||
resumeStepName: string; | ||
}; | ||
export declare type ExecuteFlowOperation = BeginExecuteFlowOperation | ResumeExecuteFlowOperation; | ||
export interface ExecuteTriggerOperation<HT extends TriggerHookType> { | ||
@@ -45,0 +54,0 @@ hookType: HT; |
import { ExecutionState } from './execution-state'; | ||
export declare enum ExecutionOutputStatus { | ||
SUCCEEDED = "SUCCEEDED", | ||
FAILED = "FAILED", | ||
INTERNAL_ERROR = "INTERNAL_ERROR", | ||
RUNNING = "RUNNING", | ||
TIMEOUT = "TIMEOUT", | ||
INTERNAL_ERROR = "INTERNAL_ERROR" | ||
SUCCEEDED = "SUCCEEDED", | ||
PAUSED = "PAUSED", | ||
TIMEOUT = "TIMEOUT" | ||
} | ||
export interface ExecutionOutput { | ||
status: ExecutionOutputStatus; | ||
export declare type ExecutionError = { | ||
stepName: string; | ||
errorMessage: string; | ||
}; | ||
declare type BaseExecutionOutput<T extends ExecutionOutputStatus> = { | ||
status: T; | ||
executionState: ExecutionState; | ||
@@ -15,6 +20,20 @@ duration: number; | ||
errorMessage?: ExecutionError; | ||
}; | ||
export declare enum PauseType { | ||
DELAY = "DELAY" | ||
} | ||
export interface ExecutionError { | ||
stepName: string; | ||
errorMessage: string; | ||
} | ||
declare type BasePauseMetadata<T extends PauseType> = { | ||
type: T; | ||
resumeStepName: string; | ||
executionState: ExecutionState; | ||
}; | ||
export declare type DelayPauseMetadata = BasePauseMetadata<PauseType.DELAY> & { | ||
resumeDateTime: string; | ||
}; | ||
export declare type PauseMetadata = DelayPauseMetadata; | ||
export declare type PauseExecutionOutput = BaseExecutionOutput<ExecutionOutputStatus.PAUSED> & { | ||
pauseMetadata: PauseMetadata; | ||
}; | ||
export declare type FinishExecutionOutput = BaseExecutionOutput<Exclude<ExecutionOutputStatus, ExecutionOutputStatus.PAUSED>>; | ||
export declare type ExecutionOutput = FinishExecutionOutput | PauseExecutionOutput; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ExecutionOutputStatus = void 0; | ||
exports.PauseType = exports.ExecutionOutputStatus = void 0; | ||
var ExecutionOutputStatus; | ||
(function (ExecutionOutputStatus) { | ||
ExecutionOutputStatus["SUCCEEDED"] = "SUCCEEDED"; | ||
ExecutionOutputStatus["FAILED"] = "FAILED"; | ||
ExecutionOutputStatus["INTERNAL_ERROR"] = "INTERNAL_ERROR"; | ||
ExecutionOutputStatus["RUNNING"] = "RUNNING"; | ||
ExecutionOutputStatus["SUCCEEDED"] = "SUCCEEDED"; | ||
ExecutionOutputStatus["PAUSED"] = "PAUSED"; | ||
ExecutionOutputStatus["TIMEOUT"] = "TIMEOUT"; | ||
ExecutionOutputStatus["INTERNAL_ERROR"] = "INTERNAL_ERROR"; | ||
})(ExecutionOutputStatus = exports.ExecutionOutputStatus || (exports.ExecutionOutputStatus = {})); | ||
var PauseType; | ||
(function (PauseType) { | ||
PauseType["DELAY"] = "DELAY"; | ||
})(PauseType = exports.PauseType || (exports.PauseType = {})); | ||
//# sourceMappingURL=execution-output.js.map |
@@ -5,3 +5,3 @@ import { StepOutput } from './step-output'; | ||
lastStepState: Record<string, unknown>; | ||
constructor(); | ||
constructor(executionState?: ExecutionState); | ||
insertStep(stepOutput: StepOutput, actionName: string, ancestors: [string, number][]): void; | ||
@@ -8,0 +8,0 @@ updateLastStep(outputOnly: unknown, actionName: string): void; |
@@ -6,5 +6,9 @@ "use strict"; | ||
class ExecutionState { | ||
constructor() { | ||
constructor(executionState) { | ||
this.steps = {}; | ||
this.lastStepState = {}; | ||
if (executionState) { | ||
this.steps = executionState.steps; | ||
this.lastStepState = executionState.lastStepState; | ||
} | ||
} | ||
@@ -11,0 +15,0 @@ insertStep(stepOutput, actionName, ancestors) { |
@@ -6,6 +6,6 @@ import { BaseModel } from '../common/base-model'; | ||
import { ApId } from '../common/id-generator'; | ||
import { ExecutionOutput, ExecutionOutputStatus } from './execution/execution-output'; | ||
import { ExecutionOutput, ExecutionOutputStatus, PauseMetadata } from './execution/execution-output'; | ||
import { FlowId } from '../flows/flow'; | ||
export declare type FlowRunId = ApId; | ||
export interface FlowRun extends BaseModel<FlowRunId> { | ||
export declare type FlowRun = BaseModel<FlowRunId> & { | ||
id: FlowRunId; | ||
@@ -21,4 +21,5 @@ projectId: ProjectId; | ||
environment: RunEnvironment; | ||
pauseMetadata?: PauseMetadata; | ||
executionOutput?: ExecutionOutput; | ||
} | ||
}; | ||
export declare enum RunEnvironment { | ||
@@ -25,0 +26,0 @@ PRODUCTION = "PRODUCTION", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FlowOperationRequest = exports.UpdateTriggerRequest = exports.AddActionRequest = exports.UpdateActionRequest = exports.DeleteActionRequest = exports.ChangeNameRequest = exports.GenerateFlowRequest = exports.ChangeFolderRequest = exports.ImportFlowRequest = exports.StepLocationRelativeToParent = exports.FlowOperationType = void 0; | ||
exports.FlowOperationRequest = exports.UpdateTriggerRequest = exports.AddActionRequest = exports.UpdateActionRequest = exports.DeleteActionRequest = exports.ChangeNameRequest = exports.ChangeFolderRequest = exports.ImportFlowRequest = exports.StepLocationRelativeToParent = exports.FlowOperationType = void 0; | ||
const action_1 = require("./actions/action"); | ||
@@ -12,3 +12,2 @@ const trigger_1 = require("./triggers/trigger"); | ||
FlowOperationType["CHANGE_NAME"] = "CHANGE_NAME"; | ||
FlowOperationType["GENERATE_FLOW"] = "GENERATE_FLOW"; | ||
FlowOperationType["UPDATE_TRIGGER"] = "UPDATE_TRIGGER"; | ||
@@ -34,5 +33,2 @@ FlowOperationType["ADD_ACTION"] = "ADD_ACTION"; | ||
}); | ||
exports.GenerateFlowRequest = typebox_1.Type.Object({ | ||
prompt: typebox_1.Type.String({}), | ||
}); | ||
exports.ChangeNameRequest = typebox_1.Type.Object({ | ||
@@ -53,6 +49,2 @@ displayName: typebox_1.Type.String({}), | ||
typebox_1.Type.Object({ | ||
type: typebox_1.Type.Literal(FlowOperationType.GENERATE_FLOW), | ||
request: exports.GenerateFlowRequest | ||
}), | ||
typebox_1.Type.Object({ | ||
type: typebox_1.Type.Literal(FlowOperationType.IMPORT_FLOW), | ||
@@ -59,0 +51,0 @@ request: exports.ImportFlowRequest |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
260435
209
3670