@activepieces/shared 0.17.6 → 0.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.d.ts +5 -2
- package/src/index.js +5 -2
- package/src/index.js.map +1 -1
- package/src/lib/agents/index.d.ts +1 -0
- package/src/lib/agents/index.js +1 -0
- package/src/lib/agents/index.js.map +1 -1
- package/src/lib/common/activepieces-error.d.ts +3 -0
- package/src/lib/common/activepieces-error.js.map +1 -1
- package/src/lib/common/telemetry.d.ts +7 -2
- package/src/lib/common/telemetry.js +1 -0
- package/src/lib/common/telemetry.js.map +1 -1
- package/src/lib/engine/engine-operation.d.ts +1 -5
- package/src/lib/engine/engine-operation.js.map +1 -1
- package/src/lib/file/index.d.ts +1 -0
- package/src/lib/file/index.js +1 -0
- package/src/lib/file/index.js.map +1 -1
- package/src/lib/flag/flag.d.ts +2 -3
- package/src/lib/flag/flag.js +1 -2
- package/src/lib/flag/flag.js.map +1 -1
- package/src/lib/flow-run/execution/step-output.d.ts +9 -9
- package/src/lib/flow-run/execution/step-output.js +2 -2
- package/src/lib/flow-run/execution/step-output.js.map +1 -1
- package/src/lib/flows/actions/action.d.ts +21 -21
- package/src/lib/flows/actions/action.js +14 -14
- package/src/lib/flows/actions/action.js.map +1 -1
- package/src/lib/flows/dto/flow-template-request.d.ts +6 -6
- package/src/lib/flows/flow-version.d.ts +2 -2
- package/src/lib/flows/flow-version.js +1 -1
- package/src/lib/flows/flow-version.js.map +1 -1
- package/src/lib/flows/flow.d.ts +13 -43
- package/src/lib/flows/flow.js +4 -23
- package/src/lib/flows/flow.js.map +1 -1
- package/src/lib/flows/operations/add-action-util.d.ts +3 -3
- package/src/lib/flows/operations/add-action-util.js.map +1 -1
- package/src/lib/flows/operations/add-action.js +10 -10
- package/src/lib/flows/operations/add-action.js.map +1 -1
- package/src/lib/flows/operations/add-branch.js +1 -1
- package/src/lib/flows/operations/add-branch.js.map +1 -1
- package/src/lib/flows/operations/copy-action-operations.d.ts +2 -2
- package/src/lib/flows/operations/copy-action-operations.js.map +1 -1
- package/src/lib/flows/operations/delete-action.js +2 -2
- package/src/lib/flows/operations/delete-action.js.map +1 -1
- package/src/lib/flows/operations/delete-branch.js +1 -1
- package/src/lib/flows/operations/delete-branch.js.map +1 -1
- package/src/lib/flows/operations/duplicate-step.js.map +1 -1
- package/src/lib/flows/operations/import-flow.d.ts +3 -3
- package/src/lib/flows/operations/import-flow.js +10 -10
- package/src/lib/flows/operations/import-flow.js.map +1 -1
- package/src/lib/flows/operations/index.d.ts +37 -37
- package/src/lib/flows/operations/index.js +1 -1
- package/src/lib/flows/operations/index.js.map +1 -1
- package/src/lib/flows/operations/migrations/flow-migration-util.d.ts +3 -3
- package/src/lib/flows/operations/migrations/flow-migration-util.js +1 -1
- package/src/lib/flows/operations/migrations/flow-migration-util.js.map +1 -1
- package/src/lib/flows/operations/migrations/index.d.ts +2 -2
- package/src/lib/flows/operations/migrations/migrate-v0-branch-to-router.js +1 -1
- package/src/lib/flows/operations/migrations/migrate-v0-branch-to-router.js.map +1 -1
- package/src/lib/flows/operations/move-branch.js +1 -1
- package/src/lib/flows/operations/move-branch.js.map +1 -1
- package/src/lib/flows/operations/paste-operations.d.ts +14 -14
- package/src/lib/flows/operations/paste-operations.js.map +1 -1
- package/src/lib/flows/operations/update-action.js +8 -8
- package/src/lib/flows/operations/update-action.js.map +1 -1
- package/src/lib/flows/operations/update-trigger.js +5 -5
- package/src/lib/flows/operations/update-trigger.js.map +1 -1
- package/src/lib/flows/test-trigger.d.ts +4 -0
- package/src/lib/flows/test-trigger.js +4 -1
- package/src/lib/flows/test-trigger.js.map +1 -1
- package/src/lib/flows/{trigger-events → triggers/trigger-events}/trigger-event.d.ts +1 -1
- package/src/lib/flows/triggers/trigger-events/trigger-event.js.map +1 -0
- package/src/lib/flows/{trigger-events → triggers/trigger-events}/trigger-events-dto.d.ts +5 -4
- package/src/lib/flows/{trigger-events → triggers/trigger-events}/trigger-events-dto.js +3 -2
- package/src/lib/flows/triggers/trigger-events/trigger-events-dto.js.map +1 -0
- package/src/lib/flows/triggers/trigger-run.d.ts +39 -0
- package/src/lib/flows/triggers/trigger-run.js +30 -0
- package/src/lib/flows/triggers/trigger-run.js.map +1 -0
- package/src/lib/flows/triggers/trigger.d.ts +7 -7
- package/src/lib/flows/triggers/trigger.js +9 -9
- package/src/lib/flows/triggers/trigger.js.map +1 -1
- package/src/lib/flows/util/flow-piece-util.d.ts +2 -2
- package/src/lib/flows/util/flow-piece-util.js +3 -3
- package/src/lib/flows/util/flow-piece-util.js.map +1 -1
- package/src/lib/flows/util/flow-structure-util.d.ts +10 -10
- package/src/lib/flows/util/flow-structure-util.js +7 -7
- package/src/lib/flows/util/flow-structure-util.js.map +1 -1
- package/src/lib/mcp/mcp.d.ts +13 -12
- package/src/lib/mcp/tools/mcp-tool.d.ts +26 -24
- package/src/lib/project-release/project-state.d.ts +130 -120
- package/src/lib/todos/index.d.ts +13 -12
- package/src/lib/trigger/index.d.ts +49 -0
- package/src/lib/trigger/index.js +33 -0
- package/src/lib/trigger/index.js.map +1 -0
- package/src/lib/webhook/index.d.ts +0 -1
- package/src/lib/webhook/index.js +0 -1
- package/src/lib/webhook/index.js.map +1 -1
- package/src/lib/workers/index.d.ts +2 -0
- package/src/lib/workers/index.js +2 -0
- package/src/lib/workers/index.js.map +1 -1
- package/src/lib/flows/trigger-events/trigger-event.js.map +0 -1
- package/src/lib/flows/trigger-events/trigger-events-dto.js.map +0 -1
- package/src/lib/webhook/webhook-simulation.d.ts +0 -9
- package/src/lib/webhook/webhook-simulation.js +0 -3
- package/src/lib/webhook/webhook-simulation.js.map +0 -1
- /package/src/lib/flows/{trigger-events → triggers/trigger-events}/trigger-event.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlowAction } from '../actions/action';
|
|
2
2
|
import { FlowVersion } from '../flow-version';
|
|
3
3
|
import { FlowOperationType, StepLocationRelativeToParent } from './index';
|
|
4
4
|
export type InsideBranchPasteLocation = {
|
|
@@ -11,7 +11,7 @@ export type OutsideBranchPasteLocation = {
|
|
|
11
11
|
stepLocationRelativeToParent: StepLocationRelativeToParent.AFTER | StepLocationRelativeToParent.INSIDE_LOOP;
|
|
12
12
|
};
|
|
13
13
|
export type PasteLocation = InsideBranchPasteLocation | OutsideBranchPasteLocation;
|
|
14
|
-
export declare const _getOperationsForPaste: (actions:
|
|
14
|
+
export declare const _getOperationsForPaste: (actions: FlowAction[], flowVersion: FlowVersion, pastingDetails: PasteLocation) => ({
|
|
15
15
|
type: FlowOperationType.MOVE_ACTION;
|
|
16
16
|
request: {
|
|
17
17
|
branchIndex?: number | undefined;
|
|
@@ -44,14 +44,14 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
44
44
|
displayName: string;
|
|
45
45
|
trigger: {
|
|
46
46
|
nextAction?: any;
|
|
47
|
-
type: import("../triggers/trigger").
|
|
47
|
+
type: import("../triggers/trigger").FlowTriggerType.EMPTY;
|
|
48
48
|
name: string;
|
|
49
49
|
displayName: string;
|
|
50
50
|
settings: any;
|
|
51
51
|
valid: boolean;
|
|
52
52
|
} | {
|
|
53
53
|
nextAction?: any;
|
|
54
|
-
type: import("../triggers/trigger").
|
|
54
|
+
type: import("../triggers/trigger").FlowTriggerType.PIECE;
|
|
55
55
|
name: string;
|
|
56
56
|
displayName: string;
|
|
57
57
|
settings: {
|
|
@@ -92,7 +92,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
92
92
|
request: {
|
|
93
93
|
skip?: boolean | undefined;
|
|
94
94
|
customLogoUrl?: string | undefined;
|
|
95
|
-
type: import("../actions/action").
|
|
95
|
+
type: import("../actions/action").FlowActionType.ROUTER;
|
|
96
96
|
name: string;
|
|
97
97
|
displayName: string;
|
|
98
98
|
settings: {
|
|
@@ -138,7 +138,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
138
138
|
} | {
|
|
139
139
|
skip?: boolean | undefined;
|
|
140
140
|
customLogoUrl?: string | undefined;
|
|
141
|
-
type: import("../actions/action").
|
|
141
|
+
type: import("../actions/action").FlowActionType.LOOP_ON_ITEMS;
|
|
142
142
|
name: string;
|
|
143
143
|
displayName: string;
|
|
144
144
|
settings: {
|
|
@@ -160,7 +160,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
160
160
|
} | {
|
|
161
161
|
skip?: boolean | undefined;
|
|
162
162
|
customLogoUrl?: string | undefined;
|
|
163
|
-
type: import("../actions/action").
|
|
163
|
+
type: import("../actions/action").FlowActionType.PIECE;
|
|
164
164
|
name: string;
|
|
165
165
|
displayName: string;
|
|
166
166
|
settings: {
|
|
@@ -195,7 +195,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
195
195
|
} | {
|
|
196
196
|
skip?: boolean | undefined;
|
|
197
197
|
customLogoUrl?: string | undefined;
|
|
198
|
-
type: import("../actions/action").
|
|
198
|
+
type: import("../actions/action").FlowActionType.CODE;
|
|
199
199
|
name: string;
|
|
200
200
|
displayName: string;
|
|
201
201
|
settings: {
|
|
@@ -238,7 +238,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
238
238
|
action: {
|
|
239
239
|
skip?: boolean | undefined;
|
|
240
240
|
customLogoUrl?: string | undefined;
|
|
241
|
-
type: import("../actions/action").
|
|
241
|
+
type: import("../actions/action").FlowActionType.ROUTER;
|
|
242
242
|
name: string;
|
|
243
243
|
displayName: string;
|
|
244
244
|
settings: {
|
|
@@ -284,7 +284,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
284
284
|
} | {
|
|
285
285
|
skip?: boolean | undefined;
|
|
286
286
|
customLogoUrl?: string | undefined;
|
|
287
|
-
type: import("../actions/action").
|
|
287
|
+
type: import("../actions/action").FlowActionType.LOOP_ON_ITEMS;
|
|
288
288
|
name: string;
|
|
289
289
|
displayName: string;
|
|
290
290
|
settings: {
|
|
@@ -306,7 +306,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
306
306
|
} | {
|
|
307
307
|
skip?: boolean | undefined;
|
|
308
308
|
customLogoUrl?: string | undefined;
|
|
309
|
-
type: import("../actions/action").
|
|
309
|
+
type: import("../actions/action").FlowActionType.PIECE;
|
|
310
310
|
name: string;
|
|
311
311
|
displayName: string;
|
|
312
312
|
settings: {
|
|
@@ -341,7 +341,7 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
341
341
|
} | {
|
|
342
342
|
skip?: boolean | undefined;
|
|
343
343
|
customLogoUrl?: string | undefined;
|
|
344
|
-
type: import("../actions/action").
|
|
344
|
+
type: import("../actions/action").FlowActionType.CODE;
|
|
345
345
|
name: string;
|
|
346
346
|
displayName: string;
|
|
347
347
|
settings: {
|
|
@@ -380,14 +380,14 @@ export declare const _getOperationsForPaste: (actions: Action[], flowVersion: Fl
|
|
|
380
380
|
type: FlowOperationType.UPDATE_TRIGGER;
|
|
381
381
|
request: {
|
|
382
382
|
nextAction?: any;
|
|
383
|
-
type: import("../triggers/trigger").
|
|
383
|
+
type: import("../triggers/trigger").FlowTriggerType.EMPTY;
|
|
384
384
|
name: string;
|
|
385
385
|
displayName: string;
|
|
386
386
|
settings: any;
|
|
387
387
|
valid: boolean;
|
|
388
388
|
} | {
|
|
389
389
|
nextAction?: any;
|
|
390
|
-
type: import("../triggers/trigger").
|
|
390
|
+
type: import("../triggers/trigger").FlowTriggerType.PIECE;
|
|
391
391
|
name: string;
|
|
392
392
|
displayName: string;
|
|
393
393
|
settings: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paste-operations.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/operations/paste-operations.ts"],"names":[],"mappings":";;;AAEA,qEAA+D;AAC/D,uDAAkD;AAClD,+CAAoD;AACpD,mCAA+F;AAkBxF,MAAM,sBAAsB,GAAG,CAClC,
|
|
1
|
+
{"version":3,"file":"paste-operations.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/operations/paste-operations.ts"],"names":[],"mappings":";;;AAEA,qEAA+D;AAC/D,uDAAkD;AAClD,+CAAoD;AACpD,mCAA+F;AAkBxF,MAAM,sBAAsB,GAAG,CAClC,OAAqB,EACrB,WAAwB,EACxB,cAA6B,EAC/B,EAAE;IACA,MAAM,WAAW,GAAG,gCAAc,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;IACtE,MAAM,aAAa,GAAiB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,uCAAiB,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,IAAgB,EAAE,EAAE;QAClH,OAAO,gCAAc,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;IAClD,CAAC,CAAe,CAAC,CAAA;IACjB,MAAM,UAAU,GAA2B,EAAE,CAAA;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACV,UAAU,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,yBAAiB,CAAC,UAAU;gBAClC,OAAO,EAAE;oBACL,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;oBACxB,UAAU,EAAE,cAAc,CAAC,cAAc;oBACzC,4BAA4B,EAAE,cAAc,CAAC,4BAA4B;oBACzE,WAAW,EAAE,cAAc,CAAC,4BAA4B,KAAK,oCAA4B,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;iBACnJ;aACJ,CAAC,CAAA;QACN,CAAC;aACI,CAAC;YACF,UAAU,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,yBAAiB,CAAC,UAAU;gBAClC,OAAO,EAAE;oBACL,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;oBACxB,UAAU,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;oBACrC,4BAA4B,EAAE,oCAA4B,CAAC,KAAK;iBACnE;aACJ,CAAC,CAAA;QACN,CAAC;QACD,MAAM,gBAAgB,GAAG,IAAA,kCAAoB,EAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QAC/D,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,UAAU,CAAA;AACrB,CAAC,CAAA;AApCY,QAAA,sBAAsB,0BAoClC"}
|
|
@@ -20,20 +20,20 @@ function _updateAction(flowVersion, request) {
|
|
|
20
20
|
};
|
|
21
21
|
let updatedAction;
|
|
22
22
|
switch (request.type) {
|
|
23
|
-
case action_1.
|
|
24
|
-
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.
|
|
23
|
+
case action_1.FlowActionType.CODE: {
|
|
24
|
+
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.FlowActionType.CODE, nextAction: stepToUpdate.nextAction });
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
|
-
case action_1.
|
|
28
|
-
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.
|
|
27
|
+
case action_1.FlowActionType.PIECE: {
|
|
28
|
+
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.FlowActionType.PIECE, nextAction: stepToUpdate.nextAction });
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
|
-
case action_1.
|
|
32
|
-
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.
|
|
31
|
+
case action_1.FlowActionType.LOOP_ON_ITEMS: {
|
|
32
|
+
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.FlowActionType.LOOP_ON_ITEMS, firstLoopAction: 'firstLoopAction' in stepToUpdate ? stepToUpdate.firstLoopAction : undefined, nextAction: stepToUpdate.nextAction });
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
|
-
case action_1.
|
|
36
|
-
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.
|
|
35
|
+
case action_1.FlowActionType.ROUTER: {
|
|
36
|
+
updatedAction = Object.assign(Object.assign({}, baseProps), { settings: request.settings, type: action_1.FlowActionType.ROUTER, nextAction: stepToUpdate.nextAction, children: 'children' in stepToUpdate ? stepToUpdate.children : [null, null] });
|
|
37
37
|
break;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-action.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/operations/update-action.ts"],"names":[],"mappings":";;AAyES,sCAAa;AAzEtB,yDAAyD;AACzD,yCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"update-action.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/operations/update-action.ts"],"names":[],"mappings":";;AAyES,sCAAa;AAzEtB,yDAAyD;AACzD,yCAAoC;AACpC,8CAAkF;AAElF,qEAA+D;AAG/D,MAAM,qBAAqB,GAAG,uBAAY,CAAC,OAAO,CAAC,2BAAkB,CAAC,CAAA;AAEtE,SAAS,aAAa,CAAC,WAAwB,EAAE,OAA4B;IACzE,OAAO,uCAAiB,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,EAAE;QAChE,IAAI,YAAY,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;YACrC,OAAO,YAAY,CAAA;QACvB,CAAC;QAED,MAAM,SAAS,GAA0C;YACrD,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,aAAa,EAAE,OAAO,CAAC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G,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,qBAAqB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QACzG,uCACO,aAAa,KAChB,KAAK,IACR;IACL,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -5,7 +5,7 @@ const compiler_1 = require("@sinclair/typebox/compiler");
|
|
|
5
5
|
const common_1 = require("../../common");
|
|
6
6
|
const trigger_1 = require("../triggers/trigger");
|
|
7
7
|
const flow_structure_util_1 = require("../util/flow-structure-util");
|
|
8
|
-
const triggerSchemaValidation = compiler_1.TypeCompiler.Compile(trigger_1.
|
|
8
|
+
const triggerSchemaValidation = compiler_1.TypeCompiler.Compile(trigger_1.FlowTrigger);
|
|
9
9
|
function createTrigger(name, request, nextAction) {
|
|
10
10
|
const baseProperties = {
|
|
11
11
|
displayName: request.displayName,
|
|
@@ -15,11 +15,11 @@ function createTrigger(name, request, nextAction) {
|
|
|
15
15
|
};
|
|
16
16
|
let trigger;
|
|
17
17
|
switch (request.type) {
|
|
18
|
-
case trigger_1.
|
|
19
|
-
trigger = Object.assign(Object.assign({}, baseProperties), { type: trigger_1.
|
|
18
|
+
case trigger_1.FlowTriggerType.EMPTY:
|
|
19
|
+
trigger = Object.assign(Object.assign({}, baseProperties), { type: trigger_1.FlowTriggerType.EMPTY, settings: request.settings });
|
|
20
20
|
break;
|
|
21
|
-
case trigger_1.
|
|
22
|
-
trigger = Object.assign(Object.assign({}, baseProperties), { type: trigger_1.
|
|
21
|
+
case trigger_1.FlowTriggerType.PIECE:
|
|
22
|
+
trigger = Object.assign(Object.assign({}, baseProperties), { type: trigger_1.FlowTriggerType.PIECE, settings: request.settings });
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
const valid = ((0, common_1.isNil)(request.valid) ? true : request.valid) && triggerSchemaValidation.Check(trigger);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-trigger.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/operations/update-trigger.ts"],"names":[],"mappings":";;AAoDS,wCAAc;AApDvB,yDAAyD;AACzD,yCAAoC;AAGpC,
|
|
1
|
+
{"version":3,"file":"update-trigger.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/operations/update-trigger.ts"],"names":[],"mappings":";;AAoDS,wCAAc;AApDvB,yDAAyD;AACzD,yCAAoC;AAGpC,iDAAkE;AAClE,qEAA+D;AAG/D,MAAM,uBAAuB,GAAG,uBAAY,CAAC,OAAO,CAAC,qBAAW,CAAC,CAAA;AAEjE,SAAS,aAAa,CAAC,IAAY,EAAE,OAA6B,EAAE,UAAkC;IAClG,MAAM,cAAc,GAAG;QACnB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,IAAI;QACJ,KAAK,EAAE,KAAK;QACZ,UAAU;KACb,CAAA;IACD,IAAI,OAAoB,CAAA;IACxB,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,yBAAe,CAAC,KAAK;YACtB,OAAO,mCACA,cAAc,KACjB,IAAI,EAAE,yBAAe,CAAC,KAAK,EAC3B,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAC7B,CAAA;YACD,MAAK;QACT,KAAK,yBAAe,CAAC,KAAK;YACtB,OAAO,mCACA,cAAc,KACjB,IAAI,EAAE,yBAAe,CAAC,KAAK,EAC3B,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAC7B,CAAA;YACD,MAAK;IACb,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACrG,uCACO,OAAO,KACV,KAAK,IACR;AACL,CAAC;AAED,SAAS,cAAc,CAAC,WAAwB,EAAE,OAA6B;IAC3E,MAAM,OAAO,GAAG,uCAAiB,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IACnF,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IAC/E,OAAO,uCAAiB,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE;QAC9D,IAAI,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,cAAc,CAAA;QACzB,CAAC;QACD,OAAO,UAAU,CAAA;IACrB,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -9,3 +9,7 @@ export declare const TestTriggerRequestBody: import("@sinclair/typebox").TObject
|
|
|
9
9
|
testStrategy: import("@sinclair/typebox").TEnum<typeof TriggerTestStrategy>;
|
|
10
10
|
}>;
|
|
11
11
|
export type TestTriggerRequestBody = Static<typeof TestTriggerRequestBody>;
|
|
12
|
+
export declare const CancelTestTriggerRequestBody: import("@sinclair/typebox").TObject<{
|
|
13
|
+
flowId: import("@sinclair/typebox").TString;
|
|
14
|
+
}>;
|
|
15
|
+
export type CancelTestTriggerRequestBody = Static<typeof CancelTestTriggerRequestBody>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TestTriggerRequestBody = exports.TriggerTestStrategy = void 0;
|
|
3
|
+
exports.CancelTestTriggerRequestBody = exports.TestTriggerRequestBody = exports.TriggerTestStrategy = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
const id_generator_1 = require("../common/id-generator");
|
|
6
6
|
var TriggerTestStrategy;
|
|
@@ -13,4 +13,7 @@ exports.TestTriggerRequestBody = typebox_1.Type.Object({
|
|
|
13
13
|
flowVersionId: id_generator_1.ApId,
|
|
14
14
|
testStrategy: typebox_1.Type.Enum(TriggerTestStrategy),
|
|
15
15
|
});
|
|
16
|
+
exports.CancelTestTriggerRequestBody = typebox_1.Type.Object({
|
|
17
|
+
flowId: id_generator_1.ApId,
|
|
18
|
+
});
|
|
16
19
|
//# sourceMappingURL=test-trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-trigger.js","sourceRoot":"","sources":["../../../../../../packages/shared/src/lib/flows/test-trigger.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAChD,yDAA6C;AAE7C,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,gDAAyB,CAAA;IACzB,sDAA+B,CAAA;AACnC,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAEY,QAAA,sBAAsB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,mBAAI;IACZ,aAAa,EAAE,mBAAI;IACnB,YAAY,EAAE,cAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC;CAC/C,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"test-trigger.js","sourceRoot":"","sources":["../../../../../../packages/shared/src/lib/flows/test-trigger.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAChD,yDAA6C;AAE7C,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC3B,gDAAyB,CAAA;IACzB,sDAA+B,CAAA;AACnC,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAEY,QAAA,sBAAsB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,mBAAI;IACZ,aAAa,EAAE,mBAAI;IACnB,YAAY,EAAE,cAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC;CAC/C,CAAC,CAAA;AAKW,QAAA,4BAA4B,GAAG,cAAI,CAAC,MAAM,CAAC;IACpD,MAAM,EAAE,mBAAI;CACf,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { BaseModel } from '
|
|
2
|
+
import { BaseModel } from '../../../common';
|
|
3
3
|
export type TriggerEventId = string;
|
|
4
4
|
export declare const TriggerEvent: import("@sinclair/typebox").TObject<{
|
|
5
5
|
id: import("@sinclair/typebox").TString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-event.js","sourceRoot":"","sources":["../../../../../../../../packages/shared/src/lib/flows/triggers/trigger-events/trigger-event.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAKnC,QAAA,YAAY,GAAG,cAAI,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,cAAI,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,cAAI,CAAC,MAAM,EAAE;IACxB,MAAM,EAAE,cAAI,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,cAAI,CAAC,MAAM,EAAE;IACzB,MAAM,EAAE,cAAI,CAAC,MAAM,EAAE;CACxB,CAAC,CAAA;AAIW,QAAA,uBAAuB,GAAG,cAAI,CAAC,SAAS,CAAC;IAClD,oBAAY;IACZ,cAAI,CAAC,MAAM,CAAC;QACR,OAAO,EAAE,cAAI,CAAC,OAAO,EAAE;KAC1B,CAAC;CACL,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { Cursor } from '
|
|
3
|
-
import { FlowId } from '
|
|
2
|
+
import { Cursor } from '../../../common/seek-page';
|
|
3
|
+
import { FlowId } from '../../flow';
|
|
4
4
|
export declare const ListTriggerEventsRequest: import("@sinclair/typebox").TObject<{
|
|
5
5
|
flowId: import("@sinclair/typebox").TString;
|
|
6
6
|
limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
@@ -10,7 +10,8 @@ export type ListTriggerEventsRequest = Omit<Static<typeof ListTriggerEventsReque
|
|
|
10
10
|
flowId: FlowId;
|
|
11
11
|
cursor: Cursor | undefined;
|
|
12
12
|
};
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const SaveTriggerEventRequest: import("@sinclair/typebox").TObject<{
|
|
14
14
|
flowId: import("@sinclair/typebox").TString;
|
|
15
|
+
mockData: import("@sinclair/typebox").TUnknown;
|
|
15
16
|
}>;
|
|
16
|
-
export type
|
|
17
|
+
export type SaveTriggerEventRequest = Static<typeof SaveTriggerEventRequest>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SaveTriggerEventRequest = exports.ListTriggerEventsRequest = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
exports.ListTriggerEventsRequest = typebox_1.Type.Object({
|
|
6
6
|
flowId: typebox_1.Type.String({}),
|
|
7
7
|
limit: typebox_1.Type.Optional(typebox_1.Type.Number({})),
|
|
8
8
|
cursor: typebox_1.Type.Optional(typebox_1.Type.String({})),
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.SaveTriggerEventRequest = typebox_1.Type.Object({
|
|
11
11
|
flowId: typebox_1.Type.String({}),
|
|
12
|
+
mockData: typebox_1.Type.Unknown(),
|
|
12
13
|
});
|
|
13
14
|
//# sourceMappingURL=trigger-events-dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-events-dto.js","sourceRoot":"","sources":["../../../../../../../../packages/shared/src/lib/flows/triggers/trigger-events/trigger-events-dto.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAInC,QAAA,wBAAwB,GAAG,cAAI,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,cAAI,CAAC,MAAM,CAAC,EAAE,CAAC;IACvB,KAAK,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;CACzC,CAAC,CAAA;AAOW,QAAA,uBAAuB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,cAAI,CAAC,MAAM,CAAC,EAAE,CAAC;IACvB,QAAQ,EAAE,cAAI,CAAC,OAAO,EAAE;CAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
export declare enum TriggerRunStatus {
|
|
3
|
+
COMPLETED = "COMPLETED",
|
|
4
|
+
FAILED = "FAILED",
|
|
5
|
+
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
6
|
+
TIMED_OUT = "TIMED_OUT"
|
|
7
|
+
}
|
|
8
|
+
export declare const TriggerRun: import("@sinclair/typebox").TObject<{
|
|
9
|
+
platformId: import("@sinclair/typebox").TString;
|
|
10
|
+
payloadFileId: import("@sinclair/typebox").TString;
|
|
11
|
+
error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string | null>>;
|
|
12
|
+
pieceName: import("@sinclair/typebox").TString;
|
|
13
|
+
pieceVersion: import("@sinclair/typebox").TString;
|
|
14
|
+
projectId: import("@sinclair/typebox").TString;
|
|
15
|
+
status: import("@sinclair/typebox").TEnum<typeof TriggerRunStatus>;
|
|
16
|
+
triggerSourceId: import("@sinclair/typebox").TString;
|
|
17
|
+
id: import("@sinclair/typebox").TString;
|
|
18
|
+
created: import("@sinclair/typebox").TString;
|
|
19
|
+
updated: import("@sinclair/typebox").TString;
|
|
20
|
+
}>;
|
|
21
|
+
export type TriggerRun = Static<typeof TriggerRun>;
|
|
22
|
+
export declare const CreateTriggerRunRequestBody: import("@sinclair/typebox").TObject<{
|
|
23
|
+
status: import("@sinclair/typebox").TEnum<typeof TriggerRunStatus>;
|
|
24
|
+
payload: import("@sinclair/typebox").TUnknown;
|
|
25
|
+
error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string | null>>;
|
|
26
|
+
flowId: import("@sinclair/typebox").TString;
|
|
27
|
+
simulate: import("@sinclair/typebox").TBoolean;
|
|
28
|
+
}>;
|
|
29
|
+
export type CreateTriggerRunRequestBody = Static<typeof CreateTriggerRunRequestBody>;
|
|
30
|
+
export declare const TriggerStatusReport: import("@sinclair/typebox").TObject<{
|
|
31
|
+
pieces: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
32
|
+
dailyStats: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
33
|
+
success: import("@sinclair/typebox").TNumber;
|
|
34
|
+
failure: import("@sinclair/typebox").TNumber;
|
|
35
|
+
}>>;
|
|
36
|
+
totalRuns: import("@sinclair/typebox").TNumber;
|
|
37
|
+
}>>;
|
|
38
|
+
}>;
|
|
39
|
+
export type TriggerStatusReport = Static<typeof TriggerStatusReport>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TriggerStatusReport = exports.CreateTriggerRunRequestBody = exports.TriggerRun = exports.TriggerRunStatus = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
var TriggerRunStatus;
|
|
7
|
+
(function (TriggerRunStatus) {
|
|
8
|
+
TriggerRunStatus["COMPLETED"] = "COMPLETED";
|
|
9
|
+
TriggerRunStatus["FAILED"] = "FAILED";
|
|
10
|
+
TriggerRunStatus["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
|
11
|
+
TriggerRunStatus["TIMED_OUT"] = "TIMED_OUT";
|
|
12
|
+
})(TriggerRunStatus || (exports.TriggerRunStatus = TriggerRunStatus = {}));
|
|
13
|
+
exports.TriggerRun = typebox_1.Type.Object(Object.assign(Object.assign({}, common_1.BaseModelSchema), { platformId: typebox_1.Type.String(), payloadFileId: typebox_1.Type.String(), error: (0, common_1.Nullable)(typebox_1.Type.String()), pieceName: typebox_1.Type.String(), pieceVersion: typebox_1.Type.String(), projectId: typebox_1.Type.String(), status: typebox_1.Type.Enum(TriggerRunStatus), triggerSourceId: typebox_1.Type.String() }));
|
|
14
|
+
exports.CreateTriggerRunRequestBody = typebox_1.Type.Object({
|
|
15
|
+
status: typebox_1.Type.Enum(TriggerRunStatus),
|
|
16
|
+
payload: typebox_1.Type.Unknown(),
|
|
17
|
+
error: (0, common_1.Nullable)(typebox_1.Type.String()),
|
|
18
|
+
flowId: typebox_1.Type.String(),
|
|
19
|
+
simulate: typebox_1.Type.Boolean(),
|
|
20
|
+
});
|
|
21
|
+
exports.TriggerStatusReport = typebox_1.Type.Object({
|
|
22
|
+
pieces: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Object({
|
|
23
|
+
dailyStats: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Object({
|
|
24
|
+
success: typebox_1.Type.Number(),
|
|
25
|
+
failure: typebox_1.Type.Number(),
|
|
26
|
+
})),
|
|
27
|
+
totalRuns: typebox_1.Type.Number(),
|
|
28
|
+
})),
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=trigger-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-run.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/triggers/trigger-run.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAChD,yCAAwD;AAGxD,IAAY,gBAKX;AALD,WAAY,gBAAgB;IACxB,2CAAuB,CAAA;IACvB,qCAAiB,CAAA;IACjB,qDAAiC,CAAA;IACjC,2CAAuB,CAAA;AAC3B,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAEY,QAAA,UAAU,GAAG,cAAI,CAAC,MAAM,iCAC9B,wBAAe,KAClB,UAAU,EAAE,cAAI,CAAC,MAAM,EAAE,EACzB,aAA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
export declare enum FlowTriggerType {
|
|
4
4
|
EMPTY = "EMPTY",
|
|
5
5
|
PIECE = "PIECE_TRIGGER"
|
|
6
6
|
}
|
|
7
7
|
export declare const EmptyTrigger: import("@sinclair/typebox").TObject<{
|
|
8
|
-
type: import("@sinclair/typebox").TLiteral<
|
|
8
|
+
type: import("@sinclair/typebox").TLiteral<FlowTriggerType.EMPTY>;
|
|
9
9
|
settings: import("@sinclair/typebox").TAny;
|
|
10
10
|
name: import("@sinclair/typebox").TString;
|
|
11
11
|
valid: import("@sinclair/typebox").TBoolean;
|
|
@@ -29,7 +29,7 @@ export declare const PieceTriggerSettings: import("@sinclair/typebox").TObject<{
|
|
|
29
29
|
}>;
|
|
30
30
|
export type PieceTriggerSettings = Static<typeof PieceTriggerSettings>;
|
|
31
31
|
export declare const PieceTrigger: import("@sinclair/typebox").TObject<{
|
|
32
|
-
type: import("@sinclair/typebox").TLiteral<
|
|
32
|
+
type: import("@sinclair/typebox").TLiteral<FlowTriggerType.PIECE>;
|
|
33
33
|
settings: import("@sinclair/typebox").TObject<{
|
|
34
34
|
pieceName: import("@sinclair/typebox").TString;
|
|
35
35
|
pieceVersion: import("@sinclair/typebox").TString;
|
|
@@ -50,8 +50,8 @@ export declare const PieceTrigger: import("@sinclair/typebox").TObject<{
|
|
|
50
50
|
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
|
|
51
51
|
}>;
|
|
52
52
|
export type PieceTrigger = Static<typeof PieceTrigger>;
|
|
53
|
-
export declare const
|
|
54
|
-
type: import("@sinclair/typebox").TLiteral<
|
|
53
|
+
export declare const FlowTrigger: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
54
|
+
type: import("@sinclair/typebox").TLiteral<FlowTriggerType.PIECE>;
|
|
55
55
|
settings: import("@sinclair/typebox").TObject<{
|
|
56
56
|
pieceName: import("@sinclair/typebox").TString;
|
|
57
57
|
pieceVersion: import("@sinclair/typebox").TString;
|
|
@@ -71,11 +71,11 @@ export declare const Trigger: import("@sinclair/typebox").TUnion<[import("@sincl
|
|
|
71
71
|
displayName: import("@sinclair/typebox").TString;
|
|
72
72
|
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
|
|
73
73
|
}>, import("@sinclair/typebox").TObject<{
|
|
74
|
-
type: import("@sinclair/typebox").TLiteral<
|
|
74
|
+
type: import("@sinclair/typebox").TLiteral<FlowTriggerType.EMPTY>;
|
|
75
75
|
settings: import("@sinclair/typebox").TAny;
|
|
76
76
|
name: import("@sinclair/typebox").TString;
|
|
77
77
|
valid: import("@sinclair/typebox").TBoolean;
|
|
78
78
|
displayName: import("@sinclair/typebox").TString;
|
|
79
79
|
nextAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
|
|
80
80
|
}>]>;
|
|
81
|
-
export type
|
|
81
|
+
export type FlowTrigger = Static<typeof FlowTrigger>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FlowTrigger = exports.PieceTrigger = exports.PieceTriggerSettings = exports.EmptyTrigger = exports.FlowTriggerType = exports.AUTHENTICATION_PROPERTY_NAME = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
const pieces_1 = require("../../pieces");
|
|
6
6
|
const sample_data_1 = require("../sample-data");
|
|
7
7
|
exports.AUTHENTICATION_PROPERTY_NAME = 'auth';
|
|
8
|
-
var
|
|
9
|
-
(function (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(
|
|
8
|
+
var FlowTriggerType;
|
|
9
|
+
(function (FlowTriggerType) {
|
|
10
|
+
FlowTriggerType["EMPTY"] = "EMPTY";
|
|
11
|
+
FlowTriggerType["PIECE"] = "PIECE_TRIGGER";
|
|
12
|
+
})(FlowTriggerType || (exports.FlowTriggerType = FlowTriggerType = {}));
|
|
13
13
|
const commonProps = {
|
|
14
14
|
name: typebox_1.Type.String({}),
|
|
15
15
|
valid: typebox_1.Type.Boolean({}),
|
|
16
16
|
displayName: typebox_1.Type.String({}),
|
|
17
17
|
nextAction: typebox_1.Type.Optional(typebox_1.Type.Any()),
|
|
18
18
|
};
|
|
19
|
-
exports.EmptyTrigger = typebox_1.Type.Object(Object.assign(Object.assign({}, commonProps), { type: typebox_1.Type.Literal(
|
|
19
|
+
exports.EmptyTrigger = typebox_1.Type.Object(Object.assign(Object.assign({}, commonProps), { type: typebox_1.Type.Literal(FlowTriggerType.EMPTY), settings: typebox_1.Type.Any() }));
|
|
20
20
|
exports.PieceTriggerSettings = typebox_1.Type.Object({
|
|
21
21
|
pieceName: typebox_1.Type.String({}),
|
|
22
22
|
pieceVersion: pieces_1.VersionType,
|
|
@@ -24,8 +24,8 @@ exports.PieceTriggerSettings = typebox_1.Type.Object({
|
|
|
24
24
|
input: typebox_1.Type.Record(typebox_1.Type.String({}), typebox_1.Type.Any()),
|
|
25
25
|
inputUiInfo: sample_data_1.SampleDataSetting,
|
|
26
26
|
});
|
|
27
|
-
exports.PieceTrigger = typebox_1.Type.Object(Object.assign(Object.assign({}, commonProps), { type: typebox_1.Type.Literal(
|
|
28
|
-
exports.
|
|
27
|
+
exports.PieceTrigger = typebox_1.Type.Object(Object.assign(Object.assign({}, commonProps), { type: typebox_1.Type.Literal(FlowTriggerType.PIECE), settings: exports.PieceTriggerSettings }));
|
|
28
|
+
exports.FlowTrigger = typebox_1.Type.Union([
|
|
29
29
|
exports.PieceTrigger,
|
|
30
30
|
exports.EmptyTrigger,
|
|
31
31
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/triggers/trigger.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAChD,yCAA0C;AAC1C,gDAAkD;AAErC,QAAA,4BAA4B,GAAG,MAAM,CAAA;AAElD,IAAY,
|
|
1
|
+
{"version":3,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,EACzC,QAAQ,EAAE,4BAAoB,IAChC,CAAA;AAIW,QAAA,WAAW,GAAG,cAAI,CAAC,KAAK,CAAC;IAClC,oBAAY;IACZ,oBAAY;CACf,CAAC,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlowVersion } from '../flow-version';
|
|
2
|
-
import {
|
|
2
|
+
import { FlowTrigger } from '../triggers/trigger';
|
|
3
3
|
export declare const flowPieceUtil: {
|
|
4
4
|
makeFlowAutoUpgradable(flowVersion: FlowVersion): FlowVersion;
|
|
5
5
|
getExactVersion(pieceVersion: string): string;
|
|
6
|
-
getUsedPieces(trigger:
|
|
6
|
+
getUsedPieces(trigger: FlowTrigger): string[];
|
|
7
7
|
getMostRecentPatchVersion(pieceVersion: string): string;
|
|
8
8
|
};
|
|
@@ -14,8 +14,8 @@ exports.flowPieceUtil = {
|
|
|
14
14
|
}
|
|
15
15
|
const clonedStep = JSON.parse(JSON.stringify(step));
|
|
16
16
|
switch (step.type) {
|
|
17
|
-
case action_1.
|
|
18
|
-
case trigger_1.
|
|
17
|
+
case action_1.FlowActionType.PIECE:
|
|
18
|
+
case trigger_1.FlowTriggerType.PIECE: {
|
|
19
19
|
const { pieceVersion } = step.settings;
|
|
20
20
|
clonedStep.settings.pieceVersion = exports.flowPieceUtil.getMostRecentPatchVersion(pieceVersion);
|
|
21
21
|
break;
|
|
@@ -34,7 +34,7 @@ exports.flowPieceUtil = {
|
|
|
34
34
|
},
|
|
35
35
|
getUsedPieces(trigger) {
|
|
36
36
|
return flow_structure_util_1.flowStructureUtil.getAllSteps(trigger)
|
|
37
|
-
.filter((step) => step.type === action_1.
|
|
37
|
+
.filter((step) => step.type === action_1.FlowActionType.PIECE || step.type === trigger_1.FlowTriggerType.PIECE)
|
|
38
38
|
.map((step) => step.settings.pieceName);
|
|
39
39
|
},
|
|
40
40
|
getMostRecentPatchVersion(pieceVersion) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-piece-util.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/util/flow-piece-util.ts"],"names":[],"mappings":";;;;AAAA,4DAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"flow-piece-util.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/flows/util/flow-piece-util.ts"],"names":[],"mappings":";;;;AAAA,4DAA2B;AAC3B,8CAAkD;AAElD,iDAAkE;AAClE,qEAAqE;AAExD,QAAA,aAAa,GAAG;IACzB,sBAAsB,CAAC,WAAwB;QAC3C,OAAO,uCAAiB,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;YACxD,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAA;YACf,CAAC;YACD,MAAM,UAAU,GAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;YACzD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;gBAChB,KAAK,uBAAc,CAAC,KAAK,CAAC;gBAC1B,KAAK,yBAAe,CAAC,KAAK,CAAC,CAAC,CAAC;oBACzB,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAA;oBACtC,UAAU,CAAC,QAAQ,CAAC,YAAY,GAAG,qBAAa,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAA;oBACxF,MAAK;gBACT,CAAC;gBACD;oBACI,MAAK;YACb,CAAC;YACD,OAAO,UAAU,CAAA;QACrB,CAAC,CAAC,CAAA;IACN,CAAC;IACD,eAAe,CAAC,YAAoB;QAChC,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/D,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChC,CAAC;QACD,OAAO,YAAY,CAAA;IACvB,CAAC;IACD,aAAa,CAAC,OAAoB;QAC9B,OAAO,uCAAiB,CAAC,WAAW,CAAC,OAAO,CAAC;aACxC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,uBAAc,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,yBAAe,CAAC,KAAK,CAAC;aAC3F,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC/C,CAAC;IACD,yBAAyB,CAAC,YAAoB;QAC1C,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/D,OAAO,YAAY,CAAA;QACvB,CAAC;QACD,IAAI,gBAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,gBAAM,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC;YACjE,OAAO,IAAI,YAAY,EAAE,CAAA;QAC7B,CAAC;QACD,OAAO,IAAI,YAAY,EAAE,CAAA;IAC7B,CAAC;CACJ,CAAA"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BranchCondition, BranchExecutionType, FlowAction, FlowActionType, LoopOnItemsAction, RouterAction } from '../actions/action';
|
|
2
2
|
import { FlowVersion } from '../flow-version';
|
|
3
|
-
import {
|
|
3
|
+
import { FlowTrigger, FlowTriggerType } from '../triggers/trigger';
|
|
4
4
|
export declare const AGENT_PIECE_NAME = "@activepieces/piece-agent";
|
|
5
|
-
export type Step =
|
|
5
|
+
export type Step = FlowAction | FlowTrigger;
|
|
6
6
|
type StepWithIndex = Step & {
|
|
7
7
|
dfsIndex: number;
|
|
8
8
|
};
|
|
9
|
-
declare function isAction(type:
|
|
10
|
-
declare function isTrigger(type:
|
|
11
|
-
declare function getActionOrThrow(name: string, flowRoot: Step):
|
|
12
|
-
declare function getTriggerOrThrow(name: string, flowRoot: Step):
|
|
9
|
+
declare function isAction(type: FlowActionType | FlowTriggerType | undefined): type is FlowActionType;
|
|
10
|
+
declare function isTrigger(type: FlowActionType | FlowTriggerType | undefined): type is FlowTriggerType;
|
|
11
|
+
declare function getActionOrThrow(name: string, flowRoot: Step): FlowAction;
|
|
12
|
+
declare function getTriggerOrThrow(name: string, flowRoot: Step): FlowTrigger;
|
|
13
13
|
declare function getStep(name: string, flowRoot: Step): Step | undefined;
|
|
14
14
|
declare function getStepOrThrow(name: string, flowRoot: Step): Step;
|
|
15
15
|
declare function transferStep<T extends Step>(step: Step, transferFunction: (step: T) => T): Step;
|
|
16
16
|
declare function transferFlow<T extends Step>(flowVersion: FlowVersion, transferFunction: (step: T) => T): FlowVersion;
|
|
17
17
|
declare function getAllSteps(step: Step): Step[];
|
|
18
|
-
declare function findPathToStep(trigger:
|
|
18
|
+
declare function findPathToStep(trigger: FlowTrigger, targetStepName: string): StepWithIndex[];
|
|
19
19
|
declare function getAllChildSteps(action: LoopOnItemsAction | RouterAction): Step[];
|
|
20
20
|
declare function isChildOf(parent: Step, childStepName: string): boolean;
|
|
21
21
|
declare function getAllNextActionsWithoutChildren(start: Step): Step[];
|
|
@@ -56,8 +56,8 @@ export declare const flowStructureUtil: {
|
|
|
56
56
|
};
|
|
57
57
|
findPathToStep: typeof findPathToStep;
|
|
58
58
|
isChildOf: typeof isChildOf;
|
|
59
|
-
findUnusedName: (source:
|
|
60
|
-
findUnusedNames: (source:
|
|
59
|
+
findUnusedName: (source: FlowTrigger | string[]) => string;
|
|
60
|
+
findUnusedNames: (source: FlowTrigger | string[], count?: number) => string[];
|
|
61
61
|
getAllNextActionsWithoutChildren: typeof getAllNextActionsWithoutChildren;
|
|
62
62
|
getAllChildSteps: typeof getAllChildSteps;
|
|
63
63
|
extractConnectionIds: typeof extractConnectionIds;
|
|
@@ -7,10 +7,10 @@ const action_1 = require("../actions/action");
|
|
|
7
7
|
const trigger_1 = require("../triggers/trigger");
|
|
8
8
|
exports.AGENT_PIECE_NAME = '@activepieces/piece-agent';
|
|
9
9
|
function isAction(type) {
|
|
10
|
-
return Object.entries(action_1.
|
|
10
|
+
return Object.entries(action_1.FlowActionType).some(([, value]) => value === type);
|
|
11
11
|
}
|
|
12
12
|
function isTrigger(type) {
|
|
13
|
-
return Object.entries(trigger_1.
|
|
13
|
+
return Object.entries(trigger_1.FlowTriggerType).some(([, value]) => value === type);
|
|
14
14
|
}
|
|
15
15
|
function getActionOrThrow(name, flowRoot) {
|
|
16
16
|
const step = getStepOrThrow(name, flowRoot);
|
|
@@ -54,14 +54,14 @@ function getStepOrThrow(name, flowRoot) {
|
|
|
54
54
|
function transferStep(step, transferFunction) {
|
|
55
55
|
const updatedStep = transferFunction(step);
|
|
56
56
|
switch (updatedStep.type) {
|
|
57
|
-
case action_1.
|
|
57
|
+
case action_1.FlowActionType.LOOP_ON_ITEMS: {
|
|
58
58
|
const { firstLoopAction } = updatedStep;
|
|
59
59
|
if (firstLoopAction) {
|
|
60
60
|
updatedStep.firstLoopAction = transferStep(firstLoopAction, transferFunction);
|
|
61
61
|
}
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
|
-
case action_1.
|
|
64
|
+
case action_1.FlowActionType.ROUTER: {
|
|
65
65
|
const { children } = updatedStep;
|
|
66
66
|
if (children) {
|
|
67
67
|
updatedStep.children = children.map((child) => child ? transferStep(child, transferFunction) : null);
|
|
@@ -110,8 +110,8 @@ function getAllChildSteps(action) {
|
|
|
110
110
|
}
|
|
111
111
|
function isChildOf(parent, childStepName) {
|
|
112
112
|
switch (parent.type) {
|
|
113
|
-
case action_1.
|
|
114
|
-
case action_1.
|
|
113
|
+
case action_1.FlowActionType.ROUTER:
|
|
114
|
+
case action_1.FlowActionType.LOOP_ON_ITEMS: {
|
|
115
115
|
const children = getAllChildSteps(parent);
|
|
116
116
|
return children.findIndex((c) => c.name === childStepName) > -1;
|
|
117
117
|
}
|
|
@@ -181,7 +181,7 @@ function getExternalAgentId(action) {
|
|
|
181
181
|
return null;
|
|
182
182
|
}
|
|
183
183
|
function isAgentPiece(action) {
|
|
184
|
-
return (action.type === action_1.
|
|
184
|
+
return (action.type === action_1.FlowActionType.PIECE && action.settings.pieceName === exports.AGENT_PIECE_NAME);
|
|
185
185
|
}
|
|
186
186
|
exports.flowStructureUtil = {
|
|
187
187
|
isTrigger,
|