@activepieces/pieces-framework
Advanced tools
Comparing version 0.7.8 to 0.7.9
{ | ||
"name": "@activepieces/pieces-framework", | ||
"version": "0.7.8", | ||
"version": "0.7.9", | ||
"type": "commonjs", | ||
@@ -14,5 +14,5 @@ "dependencies": { | ||
"@activepieces/shared": "0.10.55", | ||
"tslib": "2.6.2" | ||
"tslib": "2.6.1" | ||
}, | ||
"main": "./src/index.js" | ||
} |
@@ -25,3 +25,3 @@ import { ProjectId } from "@activepieces/shared"; | ||
}; | ||
export type TriggerBase = ActionBase & { | ||
export type TriggerBase = Omit<ActionBase, "requireAuth"> & { | ||
type: TriggerStrategy; | ||
@@ -28,0 +28,0 @@ sampleData: unknown; |
@@ -40,3 +40,2 @@ import { TestOrRunHookContext, TriggerHookContext } from '../context'; | ||
test?: (context: TestOrRunHookContext<PieceAuth, TriggerProps, TS>) => Promise<unknown[]>; | ||
requireAuth?: boolean; | ||
sampleData: unknown; | ||
@@ -57,4 +56,3 @@ }; | ||
sampleData: unknown; | ||
readonly requireAuth: boolean; | ||
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); | ||
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); | ||
} | ||
@@ -61,0 +59,0 @@ export type Trigger<PieceAuth extends PieceAuthProperty = any, TriggerProps extends NonAuthPiecePropertyMap = any, S extends TriggerStrategy = TriggerStrategy> = ITrigger<S, PieceAuth, TriggerProps>; |
@@ -19,3 +19,3 @@ "use strict"; | ||
class ITrigger { | ||
constructor(name, displayName, description, props, type, handshakeConfiguration, onEnable, onHandshake, onDisable, run, test, sampleData, requireAuth = true) { | ||
constructor(name, displayName, description, props, type, handshakeConfiguration, onEnable, onHandshake, onDisable, run, test, sampleData) { | ||
this.name = name; | ||
@@ -33,3 +33,2 @@ this.displayName = displayName; | ||
this.sampleData = sampleData; | ||
this.requireAuth = requireAuth; | ||
} | ||
@@ -40,5 +39,5 @@ } | ||
var _a, _b, _c; | ||
return new ITrigger(params.name, params.displayName, params.description, params.props, params.type, (_a = params.handshakeConfiguration) !== null && _a !== void 0 ? _a : { strategy: WebhookHandshakeStrategy.NONE }, params.onEnable, (_b = params.onHandshake) !== null && _b !== void 0 ? _b : (() => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return ({ status: 200 }); })), params.onDisable, params.run, (_c = params.test) !== null && _c !== void 0 ? _c : (() => Promise.resolve([params.sampleData])), params.sampleData, params.requireAuth); | ||
return new ITrigger(params.name, params.displayName, params.description, params.props, params.type, (_a = params.handshakeConfiguration) !== null && _a !== void 0 ? _a : { strategy: WebhookHandshakeStrategy.NONE }, params.onEnable, (_b = params.onHandshake) !== null && _b !== void 0 ? _b : (() => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return ({ status: 200 }); })), params.onDisable, params.run, (_c = params.test) !== null && _c !== void 0 ? _c : (() => Promise.resolve([params.sampleData])), params.sampleData); | ||
}; | ||
exports.createTrigger = createTrigger; | ||
//# sourceMappingURL=trigger.js.map |
Sorry, the diff of this file is not supported yet
91895
1336
+ Addedtslib@2.6.1(transitive)
- Removedtslib@2.6.2(transitive)
Updatedtslib@2.6.1