@pipedream/pipedrive
Advanced tools
@@ -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.20", | ||
| version: "0.1.21", | ||
| 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.21", | ||
| version: "0.1.22", | ||
| 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.14", | ||
| version: "0.0.15", | ||
| annotations: { | ||
@@ -12,0 +12,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.20", | ||
| version: "0.1.21", | ||
| annotations: { | ||
@@ -12,0 +12,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.20", | ||
| version: "0.1.21", | ||
| annotations: { | ||
@@ -14,0 +14,0 @@ destructiveHint: false, |
@@ -8,3 +8,3 @@ import { parseObject } from "../../common/utils.mjs"; | ||
| description: "Updates a lead in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#updateLead)", | ||
| version: "0.0.1", | ||
| version: "0.0.2", | ||
| 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.12", | ||
| version: "0.0.13", | ||
| annotations: { | ||
@@ -12,0 +12,0 @@ destructiveHint: true, |
+44
-16
@@ -59,2 +59,18 @@ export const parseObject = (obj) => { | ||
| const getCustomFieldData = async (fn) => { | ||
| const { data: personFields } = await fn(); | ||
| const customFields = personFields.filter((field) => field.created_by_user_id); | ||
| const customFieldNames = {}; | ||
| customFields.forEach((field) => { | ||
| customFieldNames[field.key] = { | ||
| name: field.name, | ||
| type: field.field_type, | ||
| options: field?.options?.length | ||
| ? field.options | ||
| : undefined, | ||
| }; | ||
| }); | ||
| return customFieldNames; | ||
| }; | ||
| export const formatCustomFields = async (resp, getResourcesFn, getFieldsFn) => { | ||
@@ -95,7 +111,3 @@ const { data: persons } = await getResourcesFn({ | ||
| export const formatCustomFieldDataFromSource = async ({ | ||
| body, customFieldFn, resourceFn, | ||
| }) => { | ||
| const customFieldNames = await getCustomFieldNames(customFieldFn); | ||
| const { data } = await resourceFn(body.data.id); | ||
| const formatCustomSelectFields = (customFieldNames, data, body, isPrevious = false) => { | ||
| const formattedCustomFields = {}; | ||
@@ -106,16 +118,32 @@ for (const [ | ||
| ] of Object.entries(customFieldNames)) { | ||
| formattedCustomFields[value] = data[key] ?? data?.custom_fields?.[key] ?? null; | ||
| } | ||
| const formattedPreviousCustomFields = {}; | ||
| if (body?.previous?.custom_fields) { | ||
| for (const [ | ||
| key, | ||
| value, | ||
| ] of Object.entries(customFieldNames)) { | ||
| if (body.previous.custom_fields[key]) { | ||
| formattedPreviousCustomFields[value] = body.previous.custom_fields[key]; | ||
| let fieldValue = isPrevious | ||
| ? body.previous.custom_fields[key] | ||
| : data[key] ?? data?.custom_fields?.[key] ?? null; | ||
| if (fieldValue && value.options?.length) { | ||
| if (value.type === "enum") { | ||
| fieldValue = value.options | ||
| .find((option) => option.id === (fieldValue.id || fieldValue)) | ||
| ?.label; | ||
| } | ||
| if (value.type === "set") { | ||
| const selectedOptions = isPrevious | ||
| ? fieldValue.values | ||
| : fieldValue.split(","); | ||
| fieldValue = selectedOptions.map((option) => value.options.find((o) => o.id == (option.id || option))?.label).join(", "); | ||
| } | ||
| } | ||
| formattedCustomFields[value.name] = fieldValue?.value ?? fieldValue; | ||
| } | ||
| return formattedCustomFields; | ||
| }; | ||
| export const formatCustomFieldDataFromSource = async ({ | ||
| body, customFieldFn, resourceFn, | ||
| }) => { | ||
| const customFieldNames = await getCustomFieldData(customFieldFn); | ||
| const { data } = await resourceFn(body.data.id); | ||
| const formattedCustomFields = await formatCustomSelectFields(customFieldNames, data, body); | ||
| const formattedPreviousCustomFields | ||
| = await formatCustomSelectFields(customFieldNames, data, body, true); | ||
| return { | ||
@@ -122,0 +150,0 @@ ...body, |
+1
-1
| { | ||
| "name": "@pipedream/pipedrive", | ||
| "version": "0.11.0", | ||
| "version": "0.11.1", | ||
| "description": "Pipedream Pipedrive Components", | ||
@@ -5,0 +5,0 @@ "main": "pipedrive.app.mjs", |
@@ -10,3 +10,3 @@ import { parseData } from "../../common/utils.mjs"; | ||
| description: "Emit new event when a deal is updated.", | ||
| version: "0.1.9", | ||
| version: "0.1.10", | ||
| 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.9", | ||
| version: "0.1.10", | ||
| 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.9", | ||
| version: "0.1.10", | ||
| type: "source", | ||
@@ -13,0 +13,0 @@ dedupe: "unique", |
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
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
102226
1.08%3335
0.79%2
-33.33%