forked from activepieces/activepieces
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
69 additions
and
42 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
packages/pieces/apitraffic/src/lib/triggers/stream-view-match.ts
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "@apitraffic/piece-apitraffic", | ||
"version": "0.0.12" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
packages/pieces/community/apitraffic/src/lib/triggers/stream-view-match.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework'; | ||
import { updateWebhook } from '../api'; | ||
import { apiTrafficAuth } from '../auth'; | ||
|
||
export const streamViewMatch = createTrigger({ | ||
auth: apiTrafficAuth, | ||
name: 'streamViewMatch', | ||
displayName: 'New Stream View Request', | ||
description: 'Triggers when a request matches a stream view criteria.', | ||
props: {}, | ||
sampleData: {}, | ||
type: TriggerStrategy.WEBHOOK, | ||
async onEnable(context){ | ||
// implement webhook creation logic | ||
const { auth, webhookUrl } = context; | ||
//console.log('Start: ON ENABLE'); | ||
//console.log(store); | ||
//console.log(auth); | ||
//console.log(propsValue); | ||
//console.log('End: ON ENABLE'); | ||
|
||
await updateWebhook(auth, webhookUrl, true); | ||
|
||
|
||
}, | ||
async onDisable(context){ | ||
// implement webhook deletion logic | ||
const { auth, webhookUrl } = context; | ||
//console.log('Start: ON DISABLE'); | ||
//console.log(store); | ||
//console.log(auth); | ||
//console.log(propsValue); | ||
//console.log('End: ON DISABLE'); | ||
|
||
await updateWebhook(auth, webhookUrl, false); | ||
}, | ||
async run(context){ | ||
return [context.payload.body] | ||
} | ||
}) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters