@activepieces/pieces-framework 0.6.14 → 0.6.15

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/pieces-framework",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
6
  "@sinclair/typebox": "^0.26.3",
@@ -8,9 +8,8 @@
8
8
  "dayjs": "^1.11.8",
9
9
  "is-base64": "^1.1.0",
10
10
  "nanoid": "^3.3.4",
11
- "object-sizeof": "^2.6.3",
12
11
  "semver": "7.5.4",
13
- "@activepieces/shared": "0.7.3",
12
+ "@activepieces/shared": "0.7.4",
14
13
  "tslib": "2.6.1"
15
14
  },
16
15
  "main": "./src/index.js",
@@ -5,7 +5,6 @@ import { NonAuthPiecePropertyMap, PieceAuthProperty, PiecePropValueSchema, Piece
5
5
  type BaseContext<PieceAuth extends PieceAuthProperty, Props extends PiecePropertyMap> = {
6
6
  auth: PiecePropValueSchema<PieceAuth>;
7
7
  propsValue: StaticPropsValue<Props>;
8
- files: FilesService;
9
8
  store: Store;
10
9
  };
11
10
  type AppWebhookTriggerHookContext<PieceAuth extends PieceAuthProperty, TriggerProps extends PiecePropertyMap> = BaseContext<PieceAuth, TriggerProps> & {
@@ -29,6 +28,9 @@ type WebhookTriggerHookContext<PieceAuth extends PieceAuthProperty, TriggerProps
29
28
  payload: TriggerPayload;
30
29
  };
31
30
  export type TriggerHookContext<PieceAuth extends PieceAuthProperty, TriggerProps extends PiecePropertyMap, S extends TriggerStrategy> = S extends TriggerStrategy.APP_WEBHOOK ? AppWebhookTriggerHookContext<PieceAuth, TriggerProps> : S extends TriggerStrategy.POLLING ? PollingTriggerHookContext<PieceAuth, TriggerProps> : S extends TriggerStrategy.WEBHOOK ? WebhookTriggerHookContext<PieceAuth, TriggerProps> : never;
31
+ export type TestOrRunHookContext<PieceAuth extends PieceAuthProperty, TriggerProps extends PiecePropertyMap, S extends TriggerStrategy> = TriggerHookContext<PieceAuth, TriggerProps, S> & {
32
+ files: FilesService;
33
+ };
32
34
  export type StopHookParams = {
33
35
  response: StopResponse;
34
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/context.ts"],"names":[],"mappings":";;;AAkHA,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,iDAAiD;IACjD,oCAAsB,CAAA;IACtB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/context.ts"],"names":[],"mappings":";;;AAyHA,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,iDAAiD;IACjD,oCAAsB,CAAA;IACtB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
@@ -1,4 +1,4 @@
1
- import { TriggerHookContext } from '../context';
1
+ import { TestOrRunHookContext, TriggerHookContext } from '../context';
2
2
  import { TriggerBase } from '../piece-metadata';
3
3
  import { NonAuthPiecePropertyMap, PieceAuthProperty } from '../property/property';
4
4
  export declare enum TriggerStrategy {
@@ -35,8 +35,8 @@ type CreateTriggerParams<PieceAuth extends PieceAuthProperty, TriggerProps exten
35
35
  onEnable: (context: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>;
36
36
  onHandshake?: (context: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<WebhookResponse>;
37
37
  onDisable: (context: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>;
38
- run: (context: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
39
- test?: (context: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
38
+ run: (context: TestOrRunHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
39
+ test?: (context: TestOrRunHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
40
40
  requireAuth?: boolean;
41
41
  sampleData: unknown;
42
42
  };
@@ -50,11 +50,11 @@ export declare class ITrigger<TS extends TriggerStrategy, PieceAuth extends Piec
50
50
  readonly onEnable: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>;
51
51
  readonly onHandshake: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<WebhookResponse>;
52
52
  readonly onDisable: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>;
53
- readonly run: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
54
- readonly test: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
53
+ readonly run: (ctx: TestOrRunHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
54
+ readonly test: (ctx: TestOrRunHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>;
55
55
  sampleData: unknown;
56
56
  readonly requireAuth: boolean;
57
- constructor(name: string, displayName: string, description: string, props: TriggerProps, type: TS, handshakeConfiguration: WebhookHandshakeConfiguration, onEnable: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>, onHandshake: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<WebhookResponse>, onDisable: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>, run: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>, test: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>, sampleData: unknown, requireAuth?: boolean);
57
+ constructor(name: string, displayName: string, description: string, props: TriggerProps, type: TS, handshakeConfiguration: WebhookHandshakeConfiguration, onEnable: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>, onHandshake: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<WebhookResponse>, onDisable: (ctx: TriggerHookContext<PieceAuth, TriggerProps, TS>) => Promise<void>, run: (ctx: TestOrRunHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>, test: (ctx: TestOrRunHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>, sampleData: unknown, requireAuth?: boolean);
58
58
  }
59
59
  export type Trigger<PieceAuth extends PieceAuthProperty = any, TriggerProps extends NonAuthPiecePropertyMap = any, S extends TriggerStrategy = TriggerStrategy> = ITrigger<S, PieceAuth, TriggerProps>;
60
60
  export declare const createTrigger: <TS extends TriggerStrategy, PieceAuth extends PieceAuthProperty, TriggerProps extends NonAuthPiecePropertyMap>(params: CreateTriggerParams<PieceAuth, TriggerProps, TS>) => ITrigger<TS, PieceAuth, TriggerProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/trigger/trigger.ts"],"names":[],"mappings":";;;;AAIA,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,8CAA2B,CAAA;AAC7B,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAED,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,yCAAa,CAAA;IACb,6DAAiC,CAAA;IACjC,2DAA+B,CAAA;IAC/B,qEAAyC,CAAA;AAC3C,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC;AAqCD,MAAa,QAAQ;IAKnB,YACkB,IAAY,EACZ,WAAmB,EACnB,WAAmB,EACnB,KAAmB,EACnB,IAAQ,EACR,sBAAqD,EACrD,QAAiF,EACjF,WAA+F,EAC/F,SAAkF,EAClF,GAAiF,EACjF,IAAkF,EAC3F,UAAmB,EACV,cAAuB,IAAI;QAZ3B,SAAI,GAAJ,IAAI,CAAQ;QACZ,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAAQ;QACnB,UAAK,GAAL,KAAK,CAAc;QACnB,SAAI,GAAJ,IAAI,CAAI;QACR,2BAAsB,GAAtB,sBAAsB,CAA+B;QACrD,aAAQ,GAAR,QAAQ,CAAyE;QACjF,gBAAW,GAAX,WAAW,CAAoF;QAC/F,cAAS,GAAT,SAAS,CAAyE;QAClF,QAAG,GAAH,GAAG,CAA8E;QACjF,SAAI,GAAJ,IAAI,CAA8E;QAC3F,eAAU,GAAV,UAAU,CAAS;QACV,gBAAW,GAAX,WAAW,CAAgB;IACzC,CAAC;CACN;AApBD,4BAoBC;AAQM,MAAM,aAAa,GAAG,CAI3B,MAAwD,EAAE,EAAE;;IAC5D,OAAO,IAAI,QAAQ,CACjB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,IAAI,EACX,MAAA,MAAM,CAAC,sBAAsB,mCAAI,EAAE,QAAQ,EAAE,wBAAwB,CAAC,IAAI,EAAE,EAC5E,MAAM,CAAC,QAAQ,EACf,MAAA,MAAM,CAAC,WAAW,mCAAI,CAAC,GAAS,EAAE,0DAAC,OAAA,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA,GAAA,CAAC,EACrD,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,GAAG,EACV,MAAA,MAAM,CAAC,IAAI,mCAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAC3D,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,WAAW,CACnB,CAAA;AACH,CAAC,CAAA;AApBY,QAAA,aAAa,iBAoBzB"}
1
+ {"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/trigger/trigger.ts"],"names":[],"mappings":";;;;AAIA,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,8C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