Socket
Socket
Sign inDemoInstall

@activepieces/shared

Package Overview
Dependencies
Maintainers
3
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@activepieces/shared - npm Package Compare versions

Comparing version 0.3.31 to 0.3.32

2

package.json
{
"name": "@activepieces/shared",
"version": "0.3.31",
"version": "0.3.32",
"type": "commonjs",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -12,3 +12,3 @@ import { AppConnectionId } from "../app-connection/app-connection";

}
declare type ErrorParams = ConfigNotFoundErrorParams | ExistingUserErrorParams | FileNotFoundErrorParams | FlowNotFoundErrorParams | FlowRunNotFoundErrorParams | ProjectNotFoundErrorParams | FlowVersionNotFoundErrorParams | FlowInstanceNotFoundErrorParams | InvalidBearerTokenParams | InvalidCredentialsErrorParams | JobRemovalFailureErrorParams | PieceNotFoundErrorParams | PieceTriggerNotFoundErrorParams | StepNotFoundErrorParams | AppConnectionNotFoundErrorParams | InvalidClaimParams | InvalidCloudClaimParams | InvalidJwtTokenErrorParams | TaskQuotaExceededErrorParams | TriggerFailedErrorParams | SystemInvalidErrorParams | SystemPropNotDefinedErrorParams | OpenAiFailedErrorParams | TestTriggerFailedErrorParams | FlowOperationErrorParams | EntityNotFoundErrorParams | ValidationErrorParams | ExecutionTimeoutErrorParams | TriggerEnableErrorParams | TriggerDisableErrorParams;
declare type ErrorParams = AppConnectionNotFoundErrorParams | ConfigNotFoundErrorParams | EntityNotFoundErrorParams | ExecutionTimeoutErrorParams | ExistingUserErrorParams | FileNotFoundErrorParams | FlowInstanceNotFoundErrorParams | FlowNotFoundErrorParams | FlowOperationErrorParams | FlowRunNotFoundErrorParams | FlowVersionNotFoundErrorParams | InvalidBearerTokenParams | InvalidClaimParams | InvalidCloudClaimParams | InvalidCredentialsErrorParams | InvalidJwtTokenErrorParams | JobRemovalFailureErrorParams | OpenAiFailedErrorParams | PauseMetadataMissingErrorParams | PieceNotFoundErrorParams | PieceTriggerNotFoundErrorParams | ProjectNotFoundErrorParams | StepNotFoundErrorParams | SystemInvalidErrorParams | SystemPropNotDefinedErrorParams | TaskQuotaExceededErrorParams | TestTriggerFailedErrorParams | TriggerDisableErrorParams | TriggerEnableErrorParams | TriggerFailedErrorParams | ValidationErrorParams;
export interface BaseErrorParams<T, V> {

@@ -113,2 +113,3 @@ code: T;

}>;
export declare type PauseMetadataMissingErrorParams = BaseErrorParams<ErrorCode.PAUSE_METADATA_MISSING, Record<string, never>>;
export declare enum ErrorCode {

@@ -144,4 +145,5 @@ CONFIG_NOT_FOUND = "CONFIG_NOT_FOUND",

TRIGGER_ENABLE = "TRIGGER_ENABLE",
TRIGGER_DISABLE = "TRIGGER_DISABLE"
TRIGGER_DISABLE = "TRIGGER_DISABLE",
PAUSE_METADATA_MISSING = "PAUSE_METADATA_MISSING"
}
export {};

@@ -43,3 +43,4 @@ "use strict";

ErrorCode["TRIGGER_DISABLE"] = "TRIGGER_DISABLE";
ErrorCode["PAUSE_METADATA_MISSING"] = "PAUSE_METADATA_MISSING";
})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
//# sourceMappingURL=activepieces-error.js.map

@@ -0,1 +1,2 @@

import { ResumeStepMetadata } from "../flow-run/execution/execution-output";
import { ExecutionState } from "../flow-run/execution/execution-state";

@@ -49,3 +50,3 @@ import { ExecutionType } from "../flow-run/execution/execution-type";

executionState: ExecutionState;
resumeStepName: string;
resumeStepMetadata: ResumeStepMetadata;
};

@@ -52,0 +53,0 @@ export declare type ExecuteFlowOperation = BeginExecuteFlowOperation | ResumeExecuteFlowOperation;

@@ -0,1 +1,2 @@

import { ActionType } from '../../flows/actions/action';
import { ExecutionState } from './execution-state';

@@ -21,2 +22,16 @@ export declare enum ExecutionOutputStatus {

};
declare type BaseResumeStepMetadata<T extends ActionType> = {
type: T;
name: string;
};
export declare type LoopResumeStepMetadata = BaseResumeStepMetadata<ActionType.LOOP_ON_ITEMS> & {
iteration: number;
childResumeStepMetadata: ResumeStepMetadata;
};
export declare type BranchResumeStepMetadata = BaseResumeStepMetadata<ActionType.BRANCH> & {
conditionEvaluation: boolean;
childResumeStepMetadata: ResumeStepMetadata;
};
declare type NormalResumeStepMetadata = BaseResumeStepMetadata<Exclude<ActionType, ActionType.BRANCH | ActionType.LOOP_ON_ITEMS>>;
export declare type ResumeStepMetadata = NormalResumeStepMetadata | BranchResumeStepMetadata | LoopResumeStepMetadata;
export declare enum PauseType {

@@ -27,3 +42,3 @@ DELAY = "DELAY"

type: T;
resumeStepName: string;
resumeStepMetadata: ResumeStepMetadata;
executionState: ExecutionState;

@@ -36,3 +51,3 @@ };

export declare type PauseExecutionOutput = BaseExecutionOutput<ExecutionOutputStatus.PAUSED> & {
pauseMetadata: PauseMetadata;
pauseMetadata: Omit<PauseMetadata, 'executionState'>;
};

@@ -39,0 +54,0 @@ export declare type FinishExecutionOutput = BaseExecutionOutput<Exclude<ExecutionOutputStatus, ExecutionOutputStatus.PAUSED>>;

import { StepOutput } from './step-output';
declare type GetStepOutputParams = {
stepName: string;
ancestors: [string, number][];
};
export declare class ExecutionState {

@@ -6,6 +10,8 @@ steps: Record<string, StepOutput>;

constructor(executionState?: ExecutionState);
insertStep(stepOutput: StepOutput, actionName: string, ancestors: [string, number][]): void;
updateLastStep(outputOnly: unknown, actionName: string): void;
insertStep(stepOutput: StepOutput, stepName: string, ancestors: [string, number][]): void;
updateLastStep(outputOnly: unknown, stepName: string): void;
getStepOutput<T extends StepOutput>(params: GetStepOutputParams): T | undefined;
private static deepClone;
private getTargetMap;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecutionState = void 0;
const step_output_1 = require("./step-output");
const action_1 = require("../../flows/actions/action");
class ExecutionState {

@@ -14,10 +14,15 @@ constructor(executionState) {

}
insertStep(stepOutput, actionName, ancestors) {
insertStep(stepOutput, stepName, ancestors) {
const targetMap = this.getTargetMap(ancestors);
targetMap[actionName] = stepOutput;
this.updateLastStep(stepOutput.output, actionName);
targetMap[stepName] = stepOutput;
this.updateLastStep(stepOutput.output, stepName);
}
updateLastStep(outputOnly, actionName) {
this.lastStepState[actionName] = ExecutionState.deepClone(outputOnly);
updateLastStep(outputOnly, stepName) {
this.lastStepState[stepName] = ExecutionState.deepClone(outputOnly);
}
getStepOutput(params) {
const { stepName, ancestors } = params;
const targetMap = this.getTargetMap(ancestors);
return targetMap[stepName];
}
static deepClone(value) {

@@ -40,4 +45,4 @@ if (value === undefined) {

const targetStepOutput = targetMap[parent[0]];
if (!(targetStepOutput instanceof step_output_1.LoopOnItemsStepOutput)) {
throw 'Error in ancestor tree, Not instance of Loop On Items step output';
if (targetStepOutput.type !== action_1.ActionType.LOOP_ON_ITEMS) {
throw new Error('[ExecutionState#getTargetMap] Not instance of Loop On Items step output');
}

@@ -44,0 +49,0 @@ const loopOutput = targetStepOutput;

@@ -0,23 +1,29 @@

import { ActionType } from "../../flows/actions/action";
import { PauseMetadata } from "./execution-output";
export declare enum StepOutputStatus {
RUNNING = "RUNNING",
SUCCEEDED = "SUCCEEDED",
FAILED = "FAILED"
FAILED = "FAILED",
PAUSED = "PAUSED"
}
export declare class StepOutput<T = any> {
export declare type StepOutput<T extends ActionType = ActionType, O = any> = {
type: T;
status: StepOutputStatus;
input: unknown;
output?: O;
duration?: number;
input?: unknown;
output?: T;
errorMessage?: unknown;
standardOutput?: unknown;
status?: StepOutputStatus;
}
export declare class LoopOnItemsStepOutput extends StepOutput<{
pauseMetadata?: Omit<PauseMetadata, 'executionState'>;
};
declare type LoopOnItemsOutput = {
item: unknown;
index: number;
iterations: Record<string, StepOutput>[];
}> {
}
export declare class BranchStepOutput extends StepOutput<{
};
export declare type LoopOnItemsStepOutput = StepOutput<ActionType.LOOP_ON_ITEMS, LoopOnItemsOutput>;
declare type BranchOutput = {
condition: boolean;
}> {
}
};
export declare type BranchStepOutput = StepOutput<ActionType.BRANCH, BranchOutput>;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BranchStepOutput = exports.LoopOnItemsStepOutput = exports.StepOutput = exports.StepOutputStatus = void 0;
exports.StepOutputStatus = void 0;
var StepOutputStatus;

@@ -9,12 +9,4 @@ (function (StepOutputStatus) {

StepOutputStatus["FAILED"] = "FAILED";
StepOutputStatus["PAUSED"] = "PAUSED";
})(StepOutputStatus = exports.StepOutputStatus || (exports.StepOutputStatus = {}));
class StepOutput {
}
exports.StepOutput = StepOutput;
class LoopOnItemsStepOutput extends StepOutput {
}
exports.LoopOnItemsStepOutput = LoopOnItemsStepOutput;
class BranchStepOutput extends StepOutput {
}
exports.BranchStepOutput = BranchStepOutput;
//# sourceMappingURL=step-output.js.map

@@ -5,2 +5,10 @@ import { FlowOperationRequest } from './flow-operations';

import { FlowVersion } from './flow-version';
declare type Step = Action | Trigger;
declare type GetAllSubFlowSteps = {
subFlowStartStep: Step;
};
declare type GetStepFromSubFlow = {
subFlowStartStep: Step;
stepName: string;
};
declare function isValid(flowVersion: FlowVersion): boolean;

@@ -16,2 +24,3 @@ declare function isAction(type: ActionType | TriggerType): boolean;

apply(flowVersion: FlowVersion, operation: FlowOperationRequest): FlowVersion;
clone: (flowVersion: FlowVersion) => FlowVersion;
getStep: typeof getStep;

@@ -21,6 +30,7 @@ isAction: typeof isAction;

getUsedPieces: typeof getUsedPieces;
getAllSubFlowSteps: ({ subFlowStartStep }: GetAllSubFlowSteps) => Step[];
getStepFromSubFlow: ({ subFlowStartStep, stepName }: GetStepFromSubFlow) => Step | undefined;
isChildOf: typeof isChildOf;
getAllChildSteps: typeof getAllChildSteps;
clone: (flowVersion: FlowVersion) => FlowVersion;
};
export {};

@@ -96,2 +96,11 @@ "use strict";

}
const getAllSubFlowSteps = ({ subFlowStartStep }) => {
return traverseInternal(subFlowStartStep);
};
const getStepFromSubFlow = ({ subFlowStartStep, stepName }) => {
const subFlowSteps = getAllSubFlowSteps({
subFlowStartStep,
});
return subFlowSteps.find((step) => step.name === stepName);
};
function updateAction(flowVersion, request) {

@@ -313,12 +322,14 @@ const steps = getAllSteps(flowVersion);

},
getStep: getStep,
isAction: isAction,
getAllSteps: getAllSteps,
getUsedPieces: getUsedPieces,
isChildOf: isChildOf,
getAllChildSteps: getAllChildSteps,
clone: (flowVersion) => {
return JSON.parse(JSON.stringify(flowVersion));
},
getStep,
isAction,
getAllSteps,
getUsedPieces,
getAllSubFlowSteps,
getStepFromSubFlow,
isChildOf,
getAllChildSteps,
};
//# sourceMappingURL=flow-helper.js.map

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 not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc