-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - benchmarkone #15668
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
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4f18977
benchmarkone init
luancazarine ec2a57e
[Components] benchmarkone #15631
luancazarine 63781a3
Merge branch 'master' into issue-15631
luancazarine 82ebcd2
pnpm update
luancazarine 2ea88ae
pnpm update
luancazarine eee05a9
Merge branch 'issue-15631' of https://github.com/PipedreamHQ/pipedrea…
luancazarine 5f02a7f
Update components/benchmarkone/sources/new-webhook-automation-event-i…
vunguyenhung 49ef151
some adjusts
luancazarine 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
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,54 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import benchmarkone from "../../benchmarkone.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "benchmarkone-add-note", | ||
| name: "Add Note to Contact", | ||
| description: "Adds a note to a BenchmarkONE contact. [See the documentation](https://sandbox.hatchbuck.com/api/dist/#!/Notes/post_contact_email_address_or_contact_ID_notes).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| benchmarkone, | ||
| contactId: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "contactId", | ||
| ], | ||
| }, | ||
| subject: { | ||
| type: "string", | ||
| label: "Subject", | ||
| description: "Subject line for the note.", | ||
| }, | ||
| body: { | ||
| type: "string", | ||
| label: "Body", | ||
| description: "Body of the note.", | ||
| }, | ||
| copyToCompany: { | ||
| type: "boolean", | ||
| label: "Copy To Company", | ||
| description: "Copy this note to the contact's associated company record.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| try { | ||
| const response = await this.benchmarkone.addNoteToContact({ | ||
| $, | ||
| contactId: this.contactId, | ||
| data: { | ||
| subject: this.subject, | ||
| body: this.body, | ||
| copyToCompany: this.copyToCompany, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Added note to contact with ID ${this.contactId}`); | ||
|
|
||
| return response; | ||
| } catch (error) { | ||
| throw new ConfigurationError(error.message); | ||
| } | ||
| }, | ||
| }; |
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,35 @@ | ||
| import benchmarkone from "../../benchmarkone.app.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "benchmarkone-add-tag", | ||
| name: "Add Tag to Contact", | ||
| description: "Adds tags to a contact. If the contact does not exist, it will be created first. [See the documentation](https://sandbox.hatchbuck.com/api/dist/#/Tags).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| benchmarkone, | ||
| contactId: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "contactId", | ||
| ], | ||
| }, | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "A list of tags to add to the contact.", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.benchmarkone.addTagToContact({ | ||
| contactId: this.contactId, | ||
| data: parseObject(this.tags)?.map((item) => ({ | ||
| name: item, | ||
| })), | ||
| }); | ||
|
|
||
| $.export("$summary", `Succcessfully added tags to contact ID ${this.contactId}`); | ||
| return response; | ||
| }, | ||
| }; |
122 changes: 122 additions & 0 deletions
122
components/benchmarkone/actions/create-contact/create-contact.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,122 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import benchmarkone from "../../benchmarkone.app.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "benchmarkone-create-contact", | ||
| name: "Create Contact", | ||
| description: "Creates a new contact in BenchmarkONE. [See the documentation](https://sandbox.hatchbuck.com/api/dist/#!/Contacts/post_contact)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| benchmarkone, | ||
| firstName: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "firstName", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| lastName: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "lastName", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| title: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "title", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| company: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "company", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| emails: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "emails", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| phones: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "phones", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| addresses: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "addresses", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| status: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "status", | ||
| ], | ||
| }, | ||
| temperature: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "temperature", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| website: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "website", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| try { | ||
| const data = { | ||
| contactId: this.contactId, | ||
| firstName: this.firstName, | ||
| lastName: this.lastName, | ||
| emails: parseObject(this.emails), | ||
| phones: parseObject(this.phones), | ||
| addresses: parseObject(this.addresses), | ||
| }; | ||
| if (this.status) { | ||
| data.status = { | ||
| name: this.status.label, | ||
| id: this.status.value, | ||
| }; | ||
| } | ||
| if (this.temperature) { | ||
| data.temperature = { | ||
| name: this.temperature.label, | ||
| id: this.temperature.value, | ||
| }; | ||
| } | ||
| if (this.website) { | ||
| data.website = [ | ||
| { | ||
| websiteUrl: this.website, | ||
| }, | ||
| ]; | ||
| } | ||
| const response = await this.benchmarkone.createContact({ | ||
| $, | ||
| data, | ||
| }); | ||
| $.export("$summary", `Created contact with ID: ${response.contactId}`); | ||
| return response; | ||
| } catch (error) { | ||
| throw new ConfigurationError(`Failed to create contact: ${error.message}`); | ||
| } | ||
| }, | ||
| }; | ||
130 changes: 130 additions & 0 deletions
130
components/benchmarkone/actions/update-contact/update-contact.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,130 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import benchmarkone from "../../benchmarkone.app.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "benchmarkone-update-contact", | ||
| name: "Update Contact", | ||
| description: "Updates an existing contact. [See the documentation](https://sandbox.hatchbuck.com/api/dist/#!/Contacts/put_contact)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| benchmarkone, | ||
| contactId: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "contactId", | ||
| ], | ||
| }, | ||
| firstName: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "firstName", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| lastName: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "lastName", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| title: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "title", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| company: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "company", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| emails: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "emails", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| phones: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "phones", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| addresses: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "addresses", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| status: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "status", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| temperature: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "temperature", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| website: { | ||
| propDefinition: [ | ||
| benchmarkone, | ||
| "website", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| try { | ||
| const data = { | ||
| contactId: this.contactId, | ||
| firstName: this.firstName, | ||
| lastName: this.lastName, | ||
| emails: parseObject(this.emails), | ||
| phones: parseObject(this.phones), | ||
| addresses: parseObject(this.addresses), | ||
| }; | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (this.status) { | ||
| data.status = { | ||
| name: this.status.label, | ||
| id: this.status.value, | ||
| }; | ||
| } | ||
| if (this.temperature) { | ||
| data.temperature = { | ||
| name: this.temperature.label, | ||
| id: this.temperature.value, | ||
| }; | ||
| } | ||
| if (this.website) { | ||
| data.website = [ | ||
| { | ||
| websiteUrl: this.website, | ||
| }, | ||
| ]; | ||
| } | ||
|
|
||
| const response = await this.benchmarkone.updateContact({ | ||
| $, | ||
| data, | ||
| }); | ||
| $.export("$summary", "Contact updated successfully."); | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return response; | ||
| } catch (error) { | ||
| throw new ConfigurationError(`Failed to create contact: ${error.message}`); | ||
| } | ||
| }, | ||
| }; | ||
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.