-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - heylibby #17015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New Components - heylibby #17015
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
components/heylibby/actions/list-qualified-leads/list-qualified-leads.mjs
This file contains hidden or 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,21 @@ | ||
| import heylibby from "../../heylibby.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "heylibby-list-qualified-leads", | ||
| name: "List Qualified Leads", | ||
| description: "List qualified leads.", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| heylibby, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.heylibby.listQualifiedLeads({ | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully listed ${response.length} qualified lead${response.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,27 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "heylibby", | ||
| propDefinitions: {}, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return "https://3wsq3v2kgg.execute-api.us-east-1.amazonaws.com/prod/zapier/trigger"; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, params = {}, ...opts | ||
| }) { | ||
| return axios($, { | ||
| url: this._baseUrl(), | ||
| params: { | ||
| ...params, | ||
| zapierAPI: this.$auth.api_key, | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ...opts, | ||
| }); | ||
| }, | ||
| listQualifiedLeads(opts = {}) { | ||
| return this._makeRequest(opts); | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@pipedream/heylibby", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream HeyLibby Components", | ||
| "main": "heylibby.app.mjs", | ||
| "keywords": [ | ||
|
|
@@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.1.0" | ||
| } | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
52 changes: 52 additions & 0 deletions
52
components/heylibby/sources/new-qualified-lead-created/new-qualified-lead-created.mjs
This file contains hidden or 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,52 @@ | ||
| import heylibby from "../../heylibby.app.mjs"; | ||
| import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; | ||
| import sampleEmit from "./test-event.mjs"; | ||
|
|
||
| export default { | ||
| key: "heylibby-new-qualified-lead-created", | ||
| name: "New Qualified Lead Created", | ||
| description: "Emit new event when a new qualified lead is created.", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| props: { | ||
| heylibby, | ||
| db: "$.service.db", | ||
| timer: { | ||
| type: "$.interface.timer", | ||
| default: { | ||
| intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, | ||
| }, | ||
| }, | ||
| }, | ||
| methods: { | ||
| _getLastTs() { | ||
| return this.db.get("lastTs") || 0; | ||
| }, | ||
| _setLastTs(ts) { | ||
| this.db.set("lastTs", ts); | ||
| }, | ||
| generateMeta(lead) { | ||
| return { | ||
| id: lead.id, | ||
| summary: `New Lead ID: ${lead.id}`, | ||
| ts: Date.parse(lead.datetime), | ||
| }; | ||
| }, | ||
| }, | ||
| async run() { | ||
| const lastTs = this._getLastTs(); | ||
| let maxTs = lastTs; | ||
| const leads = await this.heylibby.listQualifiedLeads(); | ||
| for (const lead of leads) { | ||
| const ts = Date.parse(lead.datetime); | ||
| if (ts > lastTs) { | ||
| const meta = this.generateMeta(lead); | ||
| this.$emit(lead, meta); | ||
| maxTs = Math.max(maxTs, ts); | ||
| } | ||
| } | ||
| this._setLastTs(maxTs); | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sampleEmit, | ||
| }; | ||
21 changes: 21 additions & 0 deletions
21
components/heylibby/sources/new-qualified-lead-created/test-event.mjs
This file contains hidden or 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,21 @@ | ||
| export default { | ||
| "id": "f5652b14-80aa-4cfb-82e9-688d7d373209", | ||
| "summary": "Not enough information for a summary.", | ||
| "name": null, | ||
| "email": null, | ||
| "phone": "", | ||
| "streetAddress": null, | ||
| "city": null, | ||
| "state": null, | ||
| "zipCode": null, | ||
| "country": null, | ||
| "qualification": "qualified", | ||
| "nextStep": "Recommend follow-up email", | ||
| "status": "New", | ||
| "htmlChat": "<ul><li>assistant: Hi, I'm the AI assistant.</li></ul>", | ||
| "chat": "• assistant: Hi, I'm the AI assistant.\n", | ||
| "datetime": "2025-06-05T19:52:54.388Z", | ||
| "channel": "phone", | ||
| "leftVoicemail": false, | ||
| "sentLinks": null | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.