-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New Components - companyhub #16661
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 - companyhub #16661
Changes from all commits
Commits
Show all changes
2 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
120 changes: 120 additions & 0 deletions
120
components/companyhub/actions/create-company/create-company.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,120 @@ | ||
import companyhub from "../../companyhub.app.mjs"; | ||
|
||
export default { | ||
key: "companyhub-create-company", | ||
name: "Create Company", | ||
description: "Creates a new company. [See the documentation](https://companyhub.com/docs/api-documentation)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
companyhub, | ||
name: { | ||
type: "string", | ||
label: "Name", | ||
description: "The name of the company", | ||
}, | ||
website: { | ||
type: "string", | ||
label: "Website", | ||
description: "The website URL of the company", | ||
optional: true, | ||
}, | ||
phone: { | ||
type: "string", | ||
label: "Phone", | ||
description: "The phone number of the company", | ||
optional: true, | ||
}, | ||
description: { | ||
type: "string", | ||
label: "Description", | ||
description: "A description of the company", | ||
optional: true, | ||
}, | ||
billingStreet: { | ||
type: "string", | ||
label: "Billing Street", | ||
description: "The billing street address", | ||
optional: true, | ||
}, | ||
billingCity: { | ||
type: "string", | ||
label: "Billing City", | ||
description: "The billing city", | ||
optional: true, | ||
}, | ||
billingState: { | ||
type: "string", | ||
label: "Billing State", | ||
description: "The billing state/province", | ||
optional: true, | ||
}, | ||
billingCountry: { | ||
type: "string", | ||
label: "Billing Country", | ||
description: "The billing country", | ||
optional: true, | ||
}, | ||
billingPostalCode: { | ||
type: "string", | ||
label: "Billing Postal Code", | ||
description: "The billing postal/zip code", | ||
optional: true, | ||
}, | ||
shippingStreet: { | ||
type: "string", | ||
label: "Shipping Street", | ||
description: "The shipping street address", | ||
optional: true, | ||
}, | ||
shippingCity: { | ||
type: "string", | ||
label: "Shipping City", | ||
description: "The shipping city", | ||
optional: true, | ||
}, | ||
shippingState: { | ||
type: "string", | ||
label: "Shipping State", | ||
description: "The shipping state/province", | ||
optional: true, | ||
}, | ||
shippingCountry: { | ||
type: "string", | ||
label: "Shipping Country", | ||
description: "The shipping country", | ||
optional: true, | ||
}, | ||
shippingPostalCode: { | ||
type: "string", | ||
label: "Shipping Postal Code", | ||
description: "The shipping postal/zip code", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.companyhub.createCompany({ | ||
$, | ||
data: { | ||
Name: this.name, | ||
Website: this.website, | ||
Phone: this.phone, | ||
Description: this.description, | ||
BillingStreet: this.billingStreet, | ||
BillingCity: this.billingCity, | ||
BillingState: this.billingState, | ||
BillingCountry: this.billingCountry, | ||
BillingPostalCode: this.billingPostalCode, | ||
ShippingStreet: this.shippingStreet, | ||
ShippingCity: this.shippingCity, | ||
ShippingState: this.shippingState, | ||
ShippingCountry: this.shippingCountry, | ||
ShippingPostalCode: this.shippingPostalCode, | ||
}, | ||
}); | ||
if (response.Success) { | ||
$.export("$summary", `Successfully created company with ID: ${response.Id}`); | ||
} | ||
return response; | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}; |
132 changes: 132 additions & 0 deletions
132
components/companyhub/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,132 @@ | ||
import companyhub from "../../companyhub.app.mjs"; | ||
|
||
export default { | ||
key: "companyhub-create-contact", | ||
name: "Create Contact", | ||
description: "Creates a new contact. [See the documentation](https://companyhub.com/docs/api-documentation)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
companyhub, | ||
firstName: { | ||
type: "string", | ||
label: "First Name", | ||
description: "The first name of the contact", | ||
}, | ||
lastName: { | ||
type: "string", | ||
label: "Last Name", | ||
description: "The last name of the contact", | ||
}, | ||
email: { | ||
type: "string", | ||
label: "Email", | ||
description: "The email address of the contact", | ||
optional: true, | ||
}, | ||
companyId: { | ||
propDefinition: [ | ||
companyhub, | ||
"companyId", | ||
], | ||
}, | ||
phone: { | ||
type: "string", | ||
label: "Phone Number", | ||
description: "The phone number of the contact", | ||
optional: true, | ||
}, | ||
designation: { | ||
type: "string", | ||
label: "Designation", | ||
description: "The designation of the contact", | ||
optional: true, | ||
}, | ||
description: { | ||
type: "string", | ||
label: "Description", | ||
description: "The description of the contact", | ||
optional: true, | ||
}, | ||
source: { | ||
type: "string", | ||
label: "Source", | ||
description: "The source of the contact", | ||
optional: true, | ||
options: [ | ||
"Web", | ||
"Call", | ||
"Referral", | ||
"Other", | ||
], | ||
}, | ||
nextFollowUpDate: { | ||
type: "string", | ||
label: "Next Follow Up Date", | ||
description: "The next follow up date with the contact. E.g. `2025-03-14T00:00:00`", | ||
optional: true, | ||
}, | ||
hasOptedOutOfEmails: { | ||
type: "boolean", | ||
label: "Has Opted Out of Emails", | ||
description: "Whether the contact has opted out of emails", | ||
optional: true, | ||
}, | ||
street: { | ||
type: "string", | ||
label: "Street Address", | ||
description: "The street address of the contact", | ||
optional: true, | ||
}, | ||
city: { | ||
type: "string", | ||
label: "City", | ||
description: "The city where the contact is located", | ||
optional: true, | ||
}, | ||
state: { | ||
type: "string", | ||
label: "State/Province", | ||
description: "The state or province where the contact is located", | ||
optional: true, | ||
}, | ||
country: { | ||
type: "string", | ||
label: "Country", | ||
description: "The country where the contact is located", | ||
optional: true, | ||
}, | ||
postalCode: { | ||
type: "string", | ||
label: "Postal Code", | ||
description: "The postal code of the contact's address", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.companyhub.createContact({ | ||
$, | ||
data: { | ||
FirstName: this.firstName, | ||
LastName: this.lastName, | ||
Email: this.email, | ||
Company: this.companyId, | ||
Phone: this.phone, | ||
Designation: this.designation, | ||
Description: this.description, | ||
Source: this.source, | ||
NextFollowUpDate: this.nextFollowUpDate, | ||
HasOptedOutOfEmails: this.hasOptedOutOfEmails, | ||
Street: this.street, | ||
City: this.city, | ||
State: this.state, | ||
Country: this.country, | ||
PostalCode: this.postalCode, | ||
}, | ||
}); | ||
if (response.Success) { | ||
$.export("$summary", `Successfully created contact with ID: ${response.Id}`); | ||
} | ||
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import companyhub from "../../companyhub.app.mjs"; | ||
|
||
export default { | ||
key: "companyhub-create-deal", | ||
name: "Create Deal", | ||
description: "Creates a new deal. [See the documentation](https://companyhub.com/docs/api-documentation)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
companyhub, | ||
name: { | ||
type: "string", | ||
label: "Deal Name", | ||
description: "The name of the deal", | ||
}, | ||
stage: { | ||
type: "string", | ||
label: "Deal Stage", | ||
description: "The stage of the deal", | ||
options: [ | ||
"Prospecting", | ||
"Qualification", | ||
"Discussion", | ||
"Proposal", | ||
"Review", | ||
"Closed Won", | ||
"Closed Lost", | ||
], | ||
}, | ||
companyId: { | ||
propDefinition: [ | ||
companyhub, | ||
"companyId", | ||
], | ||
}, | ||
contactId: { | ||
propDefinition: [ | ||
companyhub, | ||
"contactId", | ||
], | ||
}, | ||
amount: { | ||
type: "string", | ||
label: "Amount", | ||
description: "The amount of the deal", | ||
optional: true, | ||
}, | ||
closeDate: { | ||
type: "string", | ||
label: "Expected Close Date", | ||
description: "The expected close date of the deal in ISO-8601 format. E.g. `2025-03-14T00:00:00`", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.companyhub.createDeal({ | ||
$, | ||
data: { | ||
Name: this.name, | ||
Company: this.companyId, | ||
Contact: this.contactId, | ||
Stage: this.stage, | ||
Amount: this.amount, | ||
CloseDate: this.closeDate, | ||
}, | ||
}); | ||
if (response.Success) { | ||
$.export("$summary", `Successfully created deal with ID: ${response.Id}`); | ||
} | ||
return response; | ||
}, | ||
}; |
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.