@activepieces/shared
Advanced tools
Comparing version 0.3.42 to 0.3.43
{ | ||
"name": "@activepieces/shared", | ||
"version": "0.3.42", | ||
"version": "0.3.43", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ApId = exports.apId = exports.ExecutionState = exports.RunEnvironment = exports.FlowVersionState = exports.TriggerType = exports.WebhookTrigger = exports.PieceTrigger = exports.PieceTriggerSettings = exports.EmptyTrigger = exports.Trigger = exports.CreateFlowRunRequest = exports.CodeActionSettings = exports.ActionType = exports.Action = exports.LoopOnItemsActionSettings = exports.PieceActionSettings = exports.PrincipalType = exports.SignInRequest = exports.SignUpRequest = exports.ExecuteCodeRequest = exports.StepOutputStatus = void 0; | ||
exports.ApId = exports.apId = exports.ExecutionState = exports.RunEnvironment = exports.FlowVersionState = exports.FlowVersion = exports.TriggerType = exports.WebhookTrigger = exports.PieceTrigger = exports.PieceTriggerSettings = exports.EmptyTrigger = exports.Trigger = exports.CreateFlowRunRequest = exports.CodeActionSettings = exports.ActionType = exports.Action = exports.LoopOnItemsActionSettings = exports.PieceActionSettings = exports.PrincipalType = exports.SignInRequest = exports.SignUpRequest = exports.ExecuteCodeRequest = exports.StepOutputStatus = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -56,2 +56,3 @@ tslib_1.__exportStar(require("./lib/flows/actions/action"), exports); | ||
var flow_version_1 = require("./lib/flows/flow-version"); | ||
Object.defineProperty(exports, "FlowVersion", { enumerable: true, get: function () { return flow_version_1.FlowVersion; } }); | ||
Object.defineProperty(exports, "FlowVersionState", { enumerable: true, get: function () { return flow_version_1.FlowVersionState; } }); | ||
@@ -58,0 +59,0 @@ tslib_1.__exportStar(require("./lib/flows/flow-helper"), exports); |
@@ -28,3 +28,4 @@ import { BaseModel } from "../common/base-model"; | ||
LATEST_VERSION = "LATEST_VERSION", | ||
CLOUD_AUTH_ENABLED = "CLOUD_AUTH_ENABLED" | ||
CLOUD_AUTH_ENABLED = "CLOUD_AUTH_ENABLED", | ||
TEMPLATES_SOURCE_URL = "TEMPLATES_SOURCE_URL" | ||
} |
@@ -19,3 +19,4 @@ "use strict"; | ||
ApFlagId["CLOUD_AUTH_ENABLED"] = "CLOUD_AUTH_ENABLED"; | ||
ApFlagId["TEMPLATES_SOURCE_URL"] = "TEMPLATES_SOURCE_URL"; | ||
})(ApFlagId = exports.ApFlagId || (exports.ApFlagId = {})); | ||
//# sourceMappingURL=flag.js.map |
import { Static } from "@sinclair/typebox"; | ||
export declare const FlowVersionTemplate: import("@sinclair/typebox").TObject<{ | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
trigger: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("../triggers/trigger").TriggerType.WEBHOOK>; | ||
settings: import("@sinclair/typebox").TObject<{ | ||
inputUiInfo: import("@sinclair/typebox").TObject<{ | ||
currentSelectedData: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>; | ||
customizedInputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TUnknown>>; | ||
lastTestDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>; | ||
}>; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>, import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("../triggers/trigger").TriggerType.PIECE>; | ||
settings: import("@sinclair/typebox").TObject<{ | ||
pieceName: import("@sinclair/typebox").TString<string>; | ||
pieceVersion: import("@sinclair/typebox").TString<string>; | ||
triggerName: import("@sinclair/typebox").TString<string>; | ||
input: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TAny>; | ||
inputUiInfo: import("@sinclair/typebox").TObject<{ | ||
currentSelectedData: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>; | ||
customizedInputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TUnknown>>; | ||
lastTestDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>; | ||
}>; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>, import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("../triggers/trigger").TriggerType.EMPTY>; | ||
settings: import("@sinclair/typebox").TAny; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>]>; | ||
}>; | ||
export declare type FlowVersionTemplate = Static<typeof FlowVersionTemplate>; | ||
export declare const FlowTemplate: import("@sinclair/typebox").TObject<{ | ||
@@ -7,4 +50,54 @@ name: import("@sinclair/typebox").TString<string>; | ||
pieces: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString<string>>; | ||
template: import("@sinclair/typebox").TUnknown; | ||
pinnedOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; | ||
blogUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
template: import("@sinclair/typebox").TObject<{ | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
trigger: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("../triggers/trigger").TriggerType.WEBHOOK>; | ||
settings: import("@sinclair/typebox").TObject<{ | ||
inputUiInfo: import("@sinclair/typebox").TObject<{ | ||
currentSelectedData: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>; | ||
customizedInputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TUnknown>>; | ||
lastTestDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>; | ||
}>; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>, import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("../triggers/trigger").TriggerType.PIECE>; | ||
settings: import("@sinclair/typebox").TObject<{ | ||
pieceName: import("@sinclair/typebox").TString<string>; | ||
pieceVersion: import("@sinclair/typebox").TString<string>; | ||
triggerName: import("@sinclair/typebox").TString<string>; | ||
input: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TAny>; | ||
inputUiInfo: import("@sinclair/typebox").TObject<{ | ||
currentSelectedData: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>; | ||
customizedInputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TUnknown>>; | ||
lastTestDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>; | ||
}>; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>, import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("../triggers/trigger").TriggerType.EMPTY>; | ||
settings: import("@sinclair/typebox").TAny; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>]>; | ||
}>; | ||
}>; | ||
export declare type FlowTemplate = Static<typeof FlowTemplate>; | ||
export declare const ListFlowTemplatesRequest: import("@sinclair/typebox").TObject<{ | ||
pieces: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString<string>>>; | ||
tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString<string>>>; | ||
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
pinned: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>; | ||
}>; | ||
export declare type ListFlowTemplatesRequest = Static<typeof ListFlowTemplatesRequest>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FlowTemplate = void 0; | ||
exports.ListFlowTemplatesRequest = exports.FlowTemplate = exports.FlowVersionTemplate = void 0; | ||
const typebox_1 = require("@sinclair/typebox"); | ||
const flow_version_1 = require("../flow-version"); | ||
exports.FlowVersionTemplate = typebox_1.Type.Omit(flow_version_1.FlowVersion, ["id", "created", "updated", "flowId", "state"]); | ||
exports.FlowTemplate = typebox_1.Type.Object({ | ||
@@ -10,4 +12,12 @@ name: typebox_1.Type.String(), | ||
pieces: typebox_1.Type.Array(typebox_1.Type.String()), | ||
template: typebox_1.Type.Unknown(), | ||
pinnedOrder: typebox_1.Type.Optional(typebox_1.Type.Number()), | ||
blogUrl: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
template: exports.FlowVersionTemplate, | ||
}); | ||
exports.ListFlowTemplatesRequest = typebox_1.Type.Object({ | ||
pieces: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())), | ||
tags: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())), | ||
search: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
pinned: typebox_1.Type.Optional(typebox_1.Type.Boolean()) | ||
}); | ||
//# sourceMappingURL=flow-template-request.js.map |
@@ -16,3 +16,3 @@ import { FlowOperationRequest } from './flow-operations'; | ||
declare function getUsedPieces(trigger: Trigger): string[]; | ||
declare function getAllSteps(flowVersion: FlowVersion): (Action | Trigger)[]; | ||
declare function getAllSteps(trigger: Trigger): (Action | Trigger)[]; | ||
declare function getAllChildSteps(action: LoopOnItemsAction | BranchAction): (Action)[]; | ||
@@ -19,0 +19,0 @@ declare function getStep(flowVersion: FlowVersion, stepName: string): Action | Trigger | undefined; |
@@ -14,3 +14,3 @@ "use strict"; | ||
let valid = true; | ||
const steps = exports.flowHelper.getAllSteps(flowVersion); | ||
const steps = exports.flowHelper.getAllSteps(flowVersion.trigger); | ||
for (let i = 0; i < steps.length; i++) { | ||
@@ -26,3 +26,3 @@ const step = steps[i]; | ||
function deleteAction(flowVersion, request) { | ||
const steps = getAllSteps(flowVersion); | ||
const steps = getAllSteps(flowVersion.trigger); | ||
let deleted = false; | ||
@@ -84,4 +84,4 @@ for (let i = 0; i < steps.length; i++) { | ||
} | ||
function getAllSteps(flowVersion) { | ||
return traverseInternal(flowVersion.trigger); | ||
function getAllSteps(trigger) { | ||
return traverseInternal(trigger); | ||
} | ||
@@ -97,3 +97,3 @@ function getAllChildSteps(action) { | ||
function getStep(flowVersion, stepName) { | ||
return getAllSteps(flowVersion).find((step) => step.name === stepName); | ||
return getAllSteps(flowVersion.trigger).find((step) => step.name === stepName); | ||
} | ||
@@ -110,3 +110,3 @@ const getAllSubFlowSteps = ({ subFlowStartStep }) => { | ||
function updateAction(flowVersion, request) { | ||
const steps = getAllSteps(flowVersion); | ||
const steps = getAllSteps(flowVersion.trigger); | ||
let updated = false; | ||
@@ -155,3 +155,3 @@ for (let i = 0; i < steps.length; i++) { | ||
function moveAction(flowVersion, request) { | ||
const steps = getAllSteps(flowVersion); | ||
const steps = getAllSteps(flowVersion.trigger); | ||
const sourceStep = steps.find(step => step.name === request.name); | ||
@@ -179,3 +179,3 @@ if (!sourceStep || !isAction(sourceStep === null || sourceStep === void 0 ? void 0 : sourceStep.type)) { | ||
function addAction(flowVersion, request) { | ||
const parentStep = getAllSteps(flowVersion).find(step => step.name === request.parentStep); | ||
const parentStep = getAllSteps(flowVersion.trigger).find(step => step.name === request.parentStep); | ||
if (parentStep === undefined) { | ||
@@ -182,0 +182,0 @@ throw new activepieces_error_1.ActivepiecesError({ |
@@ -1,13 +0,4 @@ | ||
import { BaseModel } from "../common/base-model"; | ||
import { FlowId } from "./flow"; | ||
import { ApId } from "../common/id-generator"; | ||
import { Trigger } from "./triggers/trigger"; | ||
import { Static } from "@sinclair/typebox"; | ||
export declare type FlowVersionId = ApId; | ||
export interface FlowVersion extends BaseModel<FlowVersionId> { | ||
flowId: FlowId; | ||
displayName: string; | ||
trigger: Trigger; | ||
valid: boolean; | ||
state: FlowVersionState; | ||
} | ||
export declare enum FlowVersionState { | ||
@@ -17,1 +8,49 @@ LOCKED = "LOCKED", | ||
} | ||
export declare const FlowVersion: import("@sinclair/typebox").TObject<{ | ||
flowId: import("@sinclair/typebox").TString<string>; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
trigger: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("./triggers/trigger").TriggerType.WEBHOOK>; | ||
settings: import("@sinclair/typebox").TObject<{ | ||
inputUiInfo: import("@sinclair/typebox").TObject<{ | ||
currentSelectedData: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>; | ||
customizedInputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TUnknown>>; | ||
lastTestDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>; | ||
}>; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>, import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("./triggers/trigger").TriggerType.PIECE>; | ||
settings: import("@sinclair/typebox").TObject<{ | ||
pieceName: import("@sinclair/typebox").TString<string>; | ||
pieceVersion: import("@sinclair/typebox").TString<string>; | ||
triggerName: import("@sinclair/typebox").TString<string>; | ||
input: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TAny>; | ||
inputUiInfo: import("@sinclair/typebox").TObject<{ | ||
currentSelectedData: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>; | ||
customizedInputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TUnknown>>; | ||
lastTestDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>; | ||
}>; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>, import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TLiteral<import("./triggers/trigger").TriggerType.EMPTY>; | ||
settings: import("@sinclair/typebox").TAny; | ||
name: import("@sinclair/typebox").TString<string>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
displayName: import("@sinclair/typebox").TString<string>; | ||
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>; | ||
}>]>; | ||
valid: import("@sinclair/typebox").TBoolean; | ||
state: import("@sinclair/typebox").TEnum<typeof FlowVersionState>; | ||
id: import("@sinclair/typebox").TString<string>; | ||
created: import("@sinclair/typebox").TString<string>; | ||
updated: import("@sinclair/typebox").TString<string>; | ||
}>; | ||
export declare type FlowVersion = Static<typeof FlowVersion>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FlowVersionState = void 0; | ||
exports.FlowVersion = exports.FlowVersionState = void 0; | ||
const base_model_1 = require("../common/base-model"); | ||
const trigger_1 = require("./triggers/trigger"); | ||
const typebox_1 = require("@sinclair/typebox"); | ||
var FlowVersionState; | ||
@@ -9,2 +12,3 @@ (function (FlowVersionState) { | ||
})(FlowVersionState = exports.FlowVersionState || (exports.FlowVersionState = {})); | ||
exports.FlowVersion = typebox_1.Type.Object(Object.assign(Object.assign({}, base_model_1.BaseModelSchema), { flowId: typebox_1.Type.String(), displayName: typebox_1.Type.String(), trigger: trigger_1.Trigger, valid: typebox_1.Type.Boolean(), state: typebox_1.Type.Enum(FlowVersionState) })); | ||
//# sourceMappingURL=flow-version.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
285374
4010