Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/pipedrive/actions/add-activity/add-activity.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "pipedrive-add-activity",
name: "Add Activity",
description: "Adds a new activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). See the Pipedrive API docs for Activities [here](https://developers.pipedrive.com/docs/api/v1/#!/Activities). For info on [adding an activity in Pipedrive](https://developers.pipedrive.com/docs/api/v1/Activities#addActivity)",
version: "0.1.13",
version: "0.1.14",
type: "action",
props: {
pipedriveApp,
Expand Down
162 changes: 132 additions & 30 deletions components/pipedrive/actions/add-deal/add-deal.mjs
Original file line number Diff line number Diff line change
@@ -1,110 +1,212 @@
import { ConfigurationError } from "@pipedream/platform";
import pipedriveApp from "../../pipedrive.app.mjs";
import app from "../../pipedrive.app.mjs";
import { parseObject } from "../../common/utils.mjs";

export default {
key: "pipedrive-add-deal",
name: "Add Deal",
description: "Adds a new deal. See the Pipedrive API docs for Deals [here](https://developers.pipedrive.com/docs/api/v1/Deals#addDeal)",
version: "0.1.13",
version: "0.1.14",
type: "action",
props: {
pipedriveApp,
app,
title: {
propDefinition: [
pipedriveApp,
app,
"dealTitle",
],
},
ownerId: {
propDefinition: [
pipedriveApp,
app,
"userId",
],
},
personId: {
propDefinition: [
pipedriveApp,
app,
"personId",
],
},
orgId: {
propDefinition: [
pipedriveApp,
app,
"organizationId",
],
},
pipelineId: {
propDefinition: [
pipedriveApp,
app,
"pipelineId",
],
optional: true,
},
stageId: {
propDefinition: [
pipedriveApp,
app,
"stageId",
],
},
value: {
propDefinition: [
pipedriveApp,
app,
"dealValue",
],
},
currency: {
propDefinition: [
pipedriveApp,
app,
"dealCurrency",
],
},
status: {
propDefinition: [
pipedriveApp,
app,
"status",
],
},
probability: {
propDefinition: [
pipedriveApp,
app,
"probability",
],
},
lostReason: {
propDefinition: [
pipedriveApp,
app,
"lostReason",
],
},
visibleTo: {
propDefinition: [
pipedriveApp,
app,
"visibleTo",
],
},
isDeleted: {
propDefinition: [
app,
"isDeleted",
],
},
isArchived: {
propDefinition: [
app,
"isArchived",
],
},
archiveTime: {
propDefinition: [
app,
"archiveTime",
],
},
closeTime: {
propDefinition: [
app,
"closeTime",
],
},
wonTime: {
propDefinition: [
app,
"wonTime",
],
},
lostTime: {
propDefinition: [
app,
"lostTime",
],
},
expectedCloseDate: {
propDefinition: [
app,
"expectedCloseDate",
],
},
labelIds: {
propDefinition: [
app,
"labelIds",
],
},
customFields: {
propDefinition: [
app,
"customFields",
],
},
note: {
type: "string",
label: "Note",
description: "The content of a note to be attached to the deal. The note will be created after the deal is successfully added.",
optional: true,
},
},
async run({ $ }) {
const {
app,
title,
ownerId,
personId,
orgId,
pipelineId,
stageId,
value,
currency,
status,
probability,
lostReason,
visibleTo,
isDeleted,
isArchived,
archiveTime,
closeTime,
wonTime,
lostTime,
expectedCloseDate,
labelIds,
customFields,
note,
} = this;

try {
const resp =
await this.pipedriveApp.addDeal({
title: this.title,
owner_id: this.ownerId,
person_id: this.personId,
org_id: this.orgId,
pipeline_id: this.pipelineId,
stage_id: this.stageId,
value: this.value,
currency: this.currency,
status: this.status,
probability: this.probability,
lost_reason: this.lostReason,
visible_to: this.visibleTo,
const resp = await app.addDeal({
title,
owner_id: ownerId,
person_id: personId,
org_id: orgId,
pipeline_id: pipelineId,
stage_id: stageId,
value,
currency,
status,
probability,
lost_reason: lostReason,
visible_to: visibleTo,
is_deleted: isDeleted,
is_archived: isArchived,
archive_time: archiveTime,
close_time: closeTime,
won_time: wonTime,
lost_time: lostTime,
expected_close_date: expectedCloseDate,
label_ids: parseObject(labelIds),
custom_fields: parseObject(customFields),
});

if (note) {
await app.addNote({
content: note,
deal_id: resp.data?.id,
});
}

$.export("$summary", "Successfully added deal");

return resp;
} catch ({ error }) {
} catch ({ error }) {
throw new ConfigurationError(error);
}
},
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/actions/add-lead/add-lead.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "pipedrive-add-lead",
name: "Add Lead",
description: "Create a new lead in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#addLead)",
version: "0.0.7",
version: "0.0.8",
type: "action",
props: {
pipedrive,
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/actions/add-note/add-note.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "pipedrive-add-note",
name: "Add Note",
description: "Adds a new note. For info on [adding an note in Pipedrive](https://developers.pipedrive.com/docs/api/v1/Notes#addNote)",
version: "0.0.11",
version: "0.0.12",
type: "action",
props: {
pipedriveApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "pipedrive-add-organization",
name: "Add Organization",
description: "Adds a new organization. See the Pipedrive API docs for Organizations [here](https://developers.pipedrive.com/docs/api/v1/Organizations#addOrganization)",
version: "0.1.13",
version: "0.1.14",
type: "action",
props: {
pipedriveApp,
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/actions/add-person/add-person.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "pipedrive-add-person",
name: "Add Person",
description: "Adds a new person. See the Pipedrive API docs for People [here](https://developers.pipedrive.com/docs/api/v1/Persons#addPerson)",
version: "0.1.13",
version: "0.1.14",
type: "action",
props: {
pipedriveApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "pipedrive-get-lead-by-id",
name: "Get Lead by ID",
description: "Get a lead by its ID. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#getLead)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
pipedriveApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "pipedrive-get-person-details",
name: "Get person details",
description: "Get details of a person by their ID. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#getPerson)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
pipedriveApp,
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/actions/merge-deals/merge-deals.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "pipedrive-merge-deals",
name: "Merge Deals",
description: "Merge two deals in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Deals#mergeDeals)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
pipedriveApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "pipedrive-merge-persons",
name: "Merge Persons",
description: "Merge two persons in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#mergePersons)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
pipedriveApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "pipedrive-remove-duplicate-notes",
name: "Remove Duplicate Notes",
description: "Remove duplicate notes from an object in Pipedrive. See the documentation for [getting notes](https://developers.pipedrive.com/docs/api/v1/Notes#getNotes) and [deleting notes](https://developers.pipedrive.com/docs/api/v1/Notes#deleteNote)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
pipedriveApp,
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/actions/search-leads/search-leads.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "pipedrive-search-leads",
name: "Search Leads",
description: "Search for leads by name or email. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#searchLeads)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
pipedriveApp,
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/actions/search-notes/search-notes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "pipedrive-search-notes",
name: "Search Notes",
description: "Search for notes in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Notes#getNotes)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
pipedriveApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "pipedrive-search-persons",
name: "Search persons",
description: "Searches all Persons by `name`, `email`, `phone`, `notes` and/or custom fields. This endpoint is a wrapper of `/v1/itemSearch` with a narrower OAuth scope. Found Persons can be filtered by Organization ID. See the Pipedrive API docs [here](https://developers.pipedrive.com/docs/api/v1/Persons#searchPersons)",
version: "0.1.13",
version: "0.1.14",
type: "action",
props: {
pipedriveApp,
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/actions/update-deal/update-deal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "pipedrive-update-deal",
name: "Update Deal",
description: "Updates the properties of a deal. See the Pipedrive API docs for Deals [here](https://developers.pipedrive.com/docs/api/v1/Deals#updateDeal)",
version: "0.1.15",
version: "0.1.16",
type: "action",
props: {
pipedriveApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "pipedrive-update-person",
name: "Update Person",
description: "Updates an existing person in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#updatePerson)",
version: "0.0.5",
version: "0.0.6",
type: "action",
props: {
pipedriveApp,
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/pipedrive",
"version": "0.10.0",
"version": "0.10.1",
"description": "Pipedream Pipedrive Components",
"main": "pipedrive.app.mjs",
"keywords": [
Expand Down
Loading
Loading