@pipedream/pipedrive
Advanced tools
| import pipedriveApp from "../../pipedrive.app.mjs"; | ||
| export default { | ||
| key: "pipedrive-add-labels", | ||
| name: "Add Labels", | ||
| description: "Adds labels to a lead, person, deal, or organization in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#updateLead)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: true, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| pipedriveApp, | ||
| type: { | ||
| type: "string", | ||
| label: "Type", | ||
| description: "The type of the item to add labels to", | ||
| options: [ | ||
| "lead", | ||
| "person", | ||
| "deal", | ||
| "organization", | ||
| ], | ||
| reloadProps: true, | ||
| }, | ||
| leadId: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "leadId", | ||
| ], | ||
| description: "The ID of the lead to add labels to", | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| personId: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "personId", | ||
| ], | ||
| description: "The ID of the person to add labels to", | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| dealId: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "dealId", | ||
| ], | ||
| description: "The ID of the deal to add labels to", | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| organizationId: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "organizationId", | ||
| ], | ||
| description: "The ID of the organization to add labels to", | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| leadLabelIds: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "leadLabelIds", | ||
| ], | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| personLabelIds: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "personLabelIds", | ||
| ], | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| dealLabelIds: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "labelIds", | ||
| ], | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| organizationLabelIds: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "organizationLabelIds", | ||
| ], | ||
| hidden: true, | ||
| optional: true, | ||
| }, | ||
| replaceExistingLabels: { | ||
| type: "boolean", | ||
| label: "Replace Existing Labels", | ||
| description: "Set to `true` to replace the existing labels with the new ones, `false` to add the new labels to the existing ones. Defaults to `false`.", | ||
| default: false, | ||
| optional: true, | ||
| }, | ||
| }, | ||
| additionalProps(props) { | ||
| if (!this.type) { | ||
| return {}; | ||
| } | ||
| props.leadId.hidden = this.type !== "lead"; | ||
| props.personId.hidden = this.type !== "person"; | ||
| props.dealId.hidden = this.type !== "deal"; | ||
| props.organizationId.hidden = this.type !== "organization"; | ||
| props.leadId.optional = this.type !== "lead"; | ||
| props.personId.optional = this.type !== "person"; | ||
| props.dealId.optional = this.type !== "deal"; | ||
| props.organizationId.optional = this.type !== "organization"; | ||
| props.leadLabelIds.hidden = this.type !== "lead"; | ||
| props.personLabelIds.hidden = this.type !== "person"; | ||
| props.dealLabelIds.hidden = this.type !== "deal"; | ||
| props.organizationLabelIds.hidden = this.type !== "organization"; | ||
| props.leadLabelIds.optional = this.type !== "lead"; | ||
| props.personLabelIds.optional = this.type !== "person"; | ||
| props.dealLabelIds.optional = this.type !== "deal"; | ||
| props.organizationLabelIds.optional = this.type !== "organization"; | ||
| return {}; | ||
| }, | ||
| methods: { | ||
| async getItem(type) { | ||
| const capitalizedType = this.capitalizedType(type); | ||
| const { data } = await this.pipedriveApp[`get${capitalizedType}`](this[`${type}Id`]); | ||
| return data; | ||
| }, | ||
| getLabelIds(type) { | ||
| return this[`${type}LabelIds`] || []; | ||
| }, | ||
| capitalizedType(type) { | ||
| return type.charAt(0).toUpperCase() + type.slice(1); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| let labelIds = this.getLabelIds(this.type); | ||
| if (!this.replaceExistingLabels) { | ||
| const { label_ids: originalLabelIds } = await this.getItem(this.type); | ||
| labelIds = [ | ||
| ...new Set([ | ||
| ...originalLabelIds, | ||
| ...labelIds, | ||
| ]), | ||
| ]; | ||
| } | ||
| const response = await this.pipedriveApp[`update${this.capitalizedType(this.type)}`]({ | ||
| [`${this.type}Id`]: this[`${this.type}Id`], | ||
| label_ids: labelIds, | ||
| }); | ||
| $.export("$summary", `Successfully added ${this.getLabelIds(this.type).length} label(s)`); | ||
| return response; | ||
| }, | ||
| }; |
| import { parseObject } from "../../common/utils.mjs"; | ||
| import pipedriveApp from "../../pipedrive.app.mjs"; | ||
| export default { | ||
| key: "pipedrive-update-lead", | ||
| name: "Update Lead", | ||
| description: "Updates a lead in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#updateLead)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: true, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| pipedriveApp, | ||
| leadId: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "leadId", | ||
| ], | ||
| optional: false, | ||
| }, | ||
| title: { | ||
| type: "string", | ||
| label: "Title", | ||
| description: "Title of the lead", | ||
| optional: true, | ||
| }, | ||
| personId: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "personId", | ||
| ], | ||
| description: "The ID of the person this lead will be linked to. If the person does not exist yet, it needs to be created first.", | ||
| }, | ||
| organizationId: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "organizationId", | ||
| ], | ||
| description: "ID of the organization this lead will belong to", | ||
| }, | ||
| ownerId: { | ||
| label: "Owner ID", | ||
| description: "ID of the user who will be marked as the owner of this lead", | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "userId", | ||
| ], | ||
| }, | ||
| labelIds: { | ||
| propDefinition: [ | ||
| pipedriveApp, | ||
| "leadLabelIds", | ||
| ], | ||
| }, | ||
| value: { | ||
| type: "object", | ||
| label: "Value", | ||
| description: "Potential value of the lead, e.g. `{ \"amount\": 200, \"currency\": \"EUR\" }`", | ||
| optional: true, | ||
| }, | ||
| expectedCloseDate: { | ||
| type: "string", | ||
| label: "Expected Close Date", | ||
| description: "The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.", | ||
| optional: true, | ||
| }, | ||
| visibleTo: { | ||
| type: "string", | ||
| label: "Visible To", | ||
| description: "The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups [here](https://support.pipedrive.com/en/article/visibility-groups).", | ||
| options: [ | ||
| { | ||
| label: "Essential / Advanced plan - Owner & followers, Professional / Enterprise plan - Owner only", | ||
| value: "1", | ||
| }, | ||
| { | ||
| label: "Essential / Advanced plan - Entire company, Professional / Enterprise plan - Owner's visibility group", | ||
| value: "3", | ||
| }, | ||
| { | ||
| label: "Professional / Enterprise plan - Owner's visibility group and sub-groups", | ||
| value: "5", | ||
| }, | ||
| { | ||
| label: "Professional / Enterprise plan - Entire company", | ||
| value: "7", | ||
| }, | ||
| ], | ||
| optional: true, | ||
| }, | ||
| wasSeen: { | ||
| type: "boolean", | ||
| label: "Was Seen", | ||
| description: "A flag indicating whether the lead was seen by someone in the Pipedrive UI", | ||
| optional: true, | ||
| }, | ||
| isArchived: { | ||
| type: "boolean", | ||
| label: "Is Archived", | ||
| description: "A flag indicating whether the lead is archived or not", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.pipedriveApp.updateLead({ | ||
| leadId: this.leadId, | ||
| title: this.title, | ||
| person_id: this.personId, | ||
| organization_id: this.organizationId, | ||
| owner_id: this.ownerId, | ||
| label_ids: this.labelIds, | ||
| value: parseObject(this.value), | ||
| expected_close_date: this.expectedCloseDate, | ||
| visible_to: this.visibleTo, | ||
| was_seen: this.wasSeen, | ||
| is_archived: this.isArchived, | ||
| }); | ||
| $.export("$summary", `Successfully updated lead: ${response.data?.title || response.data?.id}`); | ||
| return response; | ||
| }, | ||
| }; |
@@ -10,3 +10,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| 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.19", | ||
| version: "0.1.20", | ||
| annotations: { | ||
@@ -13,0 +13,0 @@ destructiveHint: false, |
@@ -9,3 +9,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| 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.20", | ||
| version: "0.1.21", | ||
| annotations: { | ||
@@ -12,0 +12,0 @@ destructiveHint: false, |
@@ -9,3 +9,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| description: "Create a new lead in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#addLead)", | ||
| version: "0.0.13", | ||
| version: "0.0.14", | ||
| annotations: { | ||
@@ -12,0 +12,0 @@ destructiveHint: false, |
@@ -8,3 +8,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| 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.16", | ||
| version: "0.0.17", | ||
| annotations: { | ||
@@ -11,0 +11,0 @@ destructiveHint: false, |
@@ -8,3 +8,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| 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.18", | ||
| version: "0.1.19", | ||
| annotations: { | ||
@@ -11,0 +11,0 @@ destructiveHint: false, |
@@ -9,3 +9,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| 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.19", | ||
| version: "0.1.20", | ||
| annotations: { | ||
@@ -12,0 +12,0 @@ destructiveHint: false, |
@@ -7,3 +7,3 @@ import app from "../../pipedrive.app.mjs"; | ||
| description: "Get all leads from Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#getLeads)", | ||
| version: "0.0.1", | ||
| version: "0.0.2", | ||
| type: "action", | ||
@@ -10,0 +10,0 @@ annotations: { |
@@ -7,3 +7,3 @@ import pipedriveApp from "../../pipedrive.app.mjs"; | ||
| description: "Get a lead by its ID. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#getLead)", | ||
| version: "0.0.6", | ||
| version: "0.0.7", | ||
| annotations: { | ||
@@ -10,0 +10,0 @@ destructiveHint: false, |
@@ -8,3 +8,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| description: "Get details of a person by their ID. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#getPerson)", | ||
| version: "0.0.7", | ||
| version: "0.0.8", | ||
| annotations: { | ||
@@ -11,0 +11,0 @@ destructiveHint: false, |
@@ -7,3 +7,3 @@ import pipedriveApp from "../../pipedrive.app.mjs"; | ||
| description: "Merge two deals in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Deals#mergeDeals)", | ||
| version: "0.0.6", | ||
| version: "0.0.7", | ||
| annotations: { | ||
@@ -10,0 +10,0 @@ destructiveHint: false, |
@@ -7,3 +7,3 @@ import pipedriveApp from "../../pipedrive.app.mjs"; | ||
| description: "Merge two persons in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#mergePersons)", | ||
| version: "0.0.6", | ||
| version: "0.0.7", | ||
| annotations: { | ||
@@ -10,0 +10,0 @@ destructiveHint: false, |
@@ -8,3 +8,3 @@ import { decode } from "html-entities"; | ||
| 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.9", | ||
| version: "0.0.10", | ||
| annotations: { | ||
@@ -11,0 +11,0 @@ destructiveHint: true, |
@@ -8,3 +8,3 @@ import pipedriveApp from "../../pipedrive.app.mjs"; | ||
| description: "Search for leads by name or email. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#searchLeads)", | ||
| version: "0.0.6", | ||
| version: "0.0.7", | ||
| annotations: { | ||
@@ -11,0 +11,0 @@ destructiveHint: false, |
@@ -7,3 +7,3 @@ import pipedriveApp from "../../pipedrive.app.mjs"; | ||
| description: "Search for notes in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Notes#getNotes)", | ||
| version: "0.0.9", | ||
| version: "0.0.10", | ||
| annotations: { | ||
@@ -10,0 +10,0 @@ destructiveHint: false, |
@@ -11,3 +11,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| 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.19", | ||
| version: "0.1.20", | ||
| annotations: { | ||
@@ -14,0 +14,0 @@ destructiveHint: false, |
@@ -8,3 +8,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| 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.20", | ||
| version: "0.1.21", | ||
| annotations: { | ||
@@ -11,0 +11,0 @@ destructiveHint: true, |
@@ -9,3 +9,3 @@ import { ConfigurationError } from "@pipedream/platform"; | ||
| description: "Updates an existing person in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#updatePerson)", | ||
| version: "0.0.11", | ||
| version: "0.0.12", | ||
| annotations: { | ||
@@ -12,0 +12,0 @@ destructiveHint: true, |
+1
-1
| { | ||
| "name": "@pipedream/pipedrive", | ||
| "version": "0.10.6", | ||
| "version": "0.11.0", | ||
| "description": "Pipedream Pipedrive Components", | ||
@@ -5,0 +5,0 @@ "main": "pipedrive.app.mjs", |
+64
-0
@@ -391,2 +391,32 @@ import pd from "pipedrive"; | ||
| }, | ||
| personLabelIds: { | ||
| type: "integer[]", | ||
| label: "Person Label IDs", | ||
| description: "The IDs of the person labels to associate with the person", | ||
| async options() { | ||
| const { data } = await this.getPersonCustomFields(); | ||
| const labelField = data.find(({ key }) => key === "label"); | ||
| return labelField?.options?.map(({ | ||
| id: value, label, | ||
| }) => ({ | ||
| label, | ||
| value, | ||
| })) || []; | ||
| }, | ||
| }, | ||
| organizationLabelIds: { | ||
| type: "integer[]", | ||
| label: "Organization Label IDs", | ||
| description: "The IDs of the organization labels to associate with the organization", | ||
| async options() { | ||
| const { data } = await this.getOrganizationCustomFields(); | ||
| const labelField = data.find(({ field_code: fieldCode }) => fieldCode === "label_ids"); | ||
| return labelField?.options?.map(({ | ||
| id: value, label, | ||
| }) => ({ | ||
| label, | ||
| value, | ||
| })) || []; | ||
| }, | ||
| }, | ||
| includeAllCustomFields: { | ||
@@ -463,2 +493,6 @@ type: "boolean", | ||
| }, | ||
| getOrganizationCustomFields(opts) { | ||
| const organizationCustomFieldsApi = this.api("OrganizationFieldsApi", "v2"); | ||
| return organizationCustomFieldsApi.getOrganizationFields(opts); | ||
| }, | ||
| addActivity(opts = {}) { | ||
@@ -534,2 +568,32 @@ const activityApi = this.api("ActivitiesApi", "v2"); | ||
| }, | ||
| updateLead({ | ||
| leadId, ...opts | ||
| }) { | ||
| const leadsApi = this.api("LeadsApi"); | ||
| return leadsApi.updateLead({ | ||
| id: leadId, | ||
| UpdateLeadRequest: opts, | ||
| }); | ||
| }, | ||
| updateOrganization({ | ||
| organizationId, ...opts | ||
| }) { | ||
| const organizationsApi = this.api("OrganizationsApi", "v2"); | ||
| return organizationsApi.updateOrganization({ | ||
| id: organizationId, | ||
| UpdateOrganizationRequest: opts, | ||
| }); | ||
| }, | ||
| getDeal(dealId) { | ||
| const dealsApi = this.api("DealsApi", "v2"); | ||
| return dealsApi.getDeal({ | ||
| id: dealId, | ||
| }); | ||
| }, | ||
| getOrganization(organizationId) { | ||
| const organizationsApi = this.api("OrganizationsApi", "v2"); | ||
| return organizationsApi.getOrganization({ | ||
| id: organizationId, | ||
| }); | ||
| }, | ||
| deleteNote(noteId) { | ||
@@ -536,0 +600,0 @@ const notesApi = this.api("NotesApi"); |
@@ -9,3 +9,3 @@ import common from "../common/base.mjs"; | ||
| description: "Emit new event when a new deal is created.", | ||
| version: "0.0.14", | ||
| version: "0.0.15", | ||
| type: "source", | ||
@@ -12,0 +12,0 @@ dedupe: "unique", |
@@ -8,3 +8,3 @@ import common from "../common/base.mjs"; | ||
| description: "Emit new event when a new webhook event is received. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Webhooks#addWebhook)", | ||
| version: "0.0.5", | ||
| version: "0.0.6", | ||
| type: "source", | ||
@@ -11,0 +11,0 @@ dedupe: "unique", |
@@ -9,3 +9,3 @@ import common from "../common/base.mjs"; | ||
| description: "Emit new event when a new person is created.", | ||
| version: "0.0.14", | ||
| version: "0.0.15", | ||
| type: "source", | ||
@@ -12,0 +12,0 @@ dedupe: "unique", |
@@ -10,3 +10,3 @@ import { parseData } from "../../common/utils.mjs"; | ||
| description: "Emit new event when a deal is updated.", | ||
| version: "0.1.8", | ||
| version: "0.1.9", | ||
| type: "source", | ||
@@ -13,0 +13,0 @@ dedupe: "unique", |
@@ -10,3 +10,3 @@ import { formatCustomFieldDataFromSource } from "../../common/utils.mjs"; | ||
| description: "Emit new event when a lead is updated.", | ||
| version: "0.1.8", | ||
| version: "0.1.9", | ||
| type: "source", | ||
@@ -13,0 +13,0 @@ dedupe: "unique", |
@@ -10,3 +10,3 @@ import { formatCustomFieldDataFromSource } from "../../common/utils.mjs"; | ||
| description: "Emit new event when a person is updated.", | ||
| version: "0.1.8", | ||
| version: "0.1.9", | ||
| type: "source", | ||
@@ -13,0 +13,0 @@ dedupe: "unique", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
101132
11.27%37
5.71%3309
11.56%3
50%