@activepieces/pieces-framework 0.4.0 → 0.5.0
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 +2 -2
- package/src/lib/context.d.ts +12 -4
- package/src/lib/context.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/pieces-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@sinclair/typebox": "^0.26.3",
|
|
7
7
|
"nanoid": "^3.3.4",
|
|
8
|
-
"@activepieces/shared": "0.
|
|
8
|
+
"@activepieces/shared": "0.5.0",
|
|
9
9
|
"tslib": "1.14.1"
|
|
10
10
|
},
|
|
11
11
|
"main": "./src/index.js",
|
package/src/lib/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppConnectionValue, ExecutionType, PauseMetadata, StopResponse, TriggerPayload } from "@activepieces/shared";
|
|
1
|
+
import { AppConnectionValue, ExecutionType, FlowRunId, PauseMetadata, StopResponse, TriggerPayload } from "@activepieces/shared";
|
|
2
2
|
import { TriggerStrategy } from "./trigger/trigger";
|
|
3
3
|
import { NonAuthPiecePropertyMap, PieceAuthProperty, PiecePropValueSchema, PiecePropertyMap, StaticPropsValue } from "./property";
|
|
4
4
|
type BaseContext<PieceAuth extends PieceAuthProperty, Props extends PiecePropertyMap> = {
|
|
@@ -31,19 +31,27 @@ export type StopHookParams = {
|
|
|
31
31
|
response: StopResponse;
|
|
32
32
|
};
|
|
33
33
|
export type StopHook = (params: StopHookParams) => void;
|
|
34
|
-
|
|
34
|
+
type PauseMetadataWithoutResumeStepMetadata<T extends PauseMetadata> = T extends PauseMetadata ? Omit<T, 'resumeStepMetadata'> : never;
|
|
35
|
+
export type PauseHookPauseMetadata = PauseMetadataWithoutResumeStepMetadata<PauseMetadata>;
|
|
35
36
|
export type PauseHookParams = {
|
|
36
37
|
pauseMetadata: PauseHookPauseMetadata;
|
|
37
38
|
};
|
|
38
39
|
export type PauseHook = (params: PauseHookParams) => void;
|
|
39
|
-
export type
|
|
40
|
-
executionType:
|
|
40
|
+
export type BaseActionContext<ET extends ExecutionType, PieceAuth extends PieceAuthProperty, ActionProps extends NonAuthPiecePropertyMap> = BaseContext<PieceAuth, ActionProps> & {
|
|
41
|
+
executionType: ET;
|
|
41
42
|
connections: ConnectionsManager;
|
|
42
43
|
run: {
|
|
44
|
+
id: FlowRunId;
|
|
45
|
+
webhookBaseUrl: string;
|
|
43
46
|
stop: StopHook;
|
|
44
47
|
pause: PauseHook;
|
|
45
48
|
};
|
|
46
49
|
};
|
|
50
|
+
type BeginExecutionActionContext<PieceAuth extends PieceAuthProperty = PieceAuthProperty, ActionProps extends NonAuthPiecePropertyMap = NonAuthPiecePropertyMap> = BaseActionContext<ExecutionType.BEGIN, PieceAuth, ActionProps>;
|
|
51
|
+
type ResumeExecutionActionContext<PieceAuth extends PieceAuthProperty = PieceAuthProperty, ActionProps extends NonAuthPiecePropertyMap = NonAuthPiecePropertyMap> = BaseActionContext<ExecutionType.RESUME, PieceAuth, ActionProps> & {
|
|
52
|
+
resumePayload: unknown;
|
|
53
|
+
};
|
|
54
|
+
export type ActionContext<PieceAuth extends PieceAuthProperty = PieceAuthProperty, ActionProps extends NonAuthPiecePropertyMap = NonAuthPiecePropertyMap> = BeginExecutionActionContext<PieceAuth, ActionProps> | ResumeExecutionActionContext<PieceAuth, ActionProps>;
|
|
47
55
|
export interface ConnectionsManager {
|
|
48
56
|
get(key: string): Promise<AppConnectionValue | Record<string, unknown> | string | null>;
|
|
49
57
|
}
|
package/src/lib/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/context.ts"],"names":[],"mappings":";;;AAuGA,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,iDAAiD;IACjD,oCAAsB,CAAA;IACtB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
|