@activepieces/piece-pipedrive 0.3.6 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -4
- package/src/index.js +89 -5
- package/src/index.js.map +1 -1
- package/src/lib/actions/add-follower.d.ts +5 -0
- package/src/lib/actions/add-follower.js +119 -0
- package/src/lib/actions/add-follower.js.map +1 -0
- package/src/lib/actions/add-label-to-person.d.ts +4 -0
- package/src/lib/actions/add-label-to-person.js +46 -0
- package/src/lib/actions/add-label-to-person.js.map +1 -0
- package/src/lib/actions/add-product-to-deal.d.ts +12 -0
- package/src/lib/actions/add-product-to-deal.js +106 -0
- package/src/lib/actions/add-product-to-deal.js.map +1 -0
- package/src/lib/actions/attach-file.d.ts +9 -0
- package/src/lib/actions/attach-file.js +62 -0
- package/src/lib/actions/attach-file.js.map +1 -0
- package/src/lib/actions/create-activity.d.ts +16 -0
- package/src/lib/actions/create-activity.js +54 -0
- package/src/lib/actions/create-activity.js.map +1 -0
- package/src/lib/actions/create-deal.d.ts +17 -0
- package/src/lib/actions/create-deal.js +69 -0
- package/src/lib/actions/create-deal.js.map +1 -0
- package/src/lib/actions/create-lead.d.ts +13 -0
- package/src/lib/actions/create-lead.js +75 -0
- package/src/lib/actions/create-lead.js.map +1 -0
- package/src/lib/actions/create-note.d.ts +11 -0
- package/src/lib/actions/create-note.js +73 -0
- package/src/lib/actions/create-note.js.map +1 -0
- package/src/lib/actions/create-organization.d.ts +8 -0
- package/src/lib/actions/create-organization.js +57 -0
- package/src/lib/actions/create-organization.js.map +1 -0
- package/src/lib/actions/create-person.d.ts +13 -0
- package/src/lib/actions/create-person.js +68 -0
- package/src/lib/actions/create-person.js.map +1 -0
- package/src/lib/actions/create-product.d.ts +15 -0
- package/src/lib/actions/create-product.js +109 -0
- package/src/lib/actions/create-product.js.map +1 -0
- package/src/lib/actions/find-activity.d.ts +8 -0
- package/src/lib/actions/find-activity.js +85 -0
- package/src/lib/actions/find-activity.js.map +1 -0
- package/src/lib/actions/find-deal.d.ts +4 -0
- package/src/lib/actions/find-deal.js +104 -0
- package/src/lib/actions/find-deal.js.map +1 -0
- package/src/lib/actions/find-deals-associated-with-person.d.ts +3 -0
- package/src/lib/actions/find-deals-associated-with-person.js +53 -0
- package/src/lib/actions/find-deals-associated-with-person.js.map +1 -0
- package/src/lib/actions/find-notes.d.ts +4 -0
- package/src/lib/actions/find-notes.js +70 -0
- package/src/lib/actions/find-notes.js.map +1 -0
- package/src/lib/actions/find-organization.d.ts +4 -0
- package/src/lib/actions/find-organization.js +104 -0
- package/src/lib/actions/find-organization.js.map +1 -0
- package/src/lib/actions/find-person.d.ts +4 -0
- package/src/lib/actions/find-person.js +104 -0
- package/src/lib/actions/find-person.js.map +1 -0
- package/src/lib/actions/find-product.d.ts +3 -0
- package/src/lib/actions/find-product.js +59 -0
- package/src/lib/actions/find-product.js.map +1 -0
- package/src/lib/actions/find-products.d.ts +4 -0
- package/src/lib/actions/find-products.js +73 -0
- package/src/lib/actions/find-products.js.map +1 -0
- package/src/lib/actions/find-user.d.ts +4 -0
- package/src/lib/actions/find-user.js +57 -0
- package/src/lib/actions/find-user.js.map +1 -0
- package/src/lib/actions/get-note.d.ts +3 -0
- package/src/lib/actions/get-note.js +39 -0
- package/src/lib/actions/get-note.js.map +1 -0
- package/src/lib/actions/get-product.d.ts +3 -0
- package/src/lib/actions/get-product.js +50 -0
- package/src/lib/actions/get-product.js.map +1 -0
- package/src/lib/actions/update-activity.d.ts +17 -0
- package/src/lib/actions/update-activity.js +57 -0
- package/src/lib/actions/update-activity.js.map +1 -0
- package/src/lib/actions/update-deal.d.ts +18 -0
- package/src/lib/actions/update-deal.js +69 -0
- package/src/lib/actions/update-deal.js.map +1 -0
- package/src/lib/actions/update-lead.d.ts +14 -0
- package/src/lib/actions/update-lead.js +72 -0
- package/src/lib/actions/update-lead.js.map +1 -0
- package/src/lib/actions/update-organization.d.ts +9 -0
- package/src/lib/actions/update-organization.js +58 -0
- package/src/lib/actions/update-organization.js.map +1 -0
- package/src/lib/actions/update-person.d.ts +14 -0
- package/src/lib/actions/update-person.js +68 -0
- package/src/lib/actions/update-person.js.map +1 -0
- package/src/lib/common/index.js +26 -3
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/common/props.d.ts +92 -0
- package/src/lib/common/props.js +988 -0
- package/src/lib/common/props.js.map +1 -0
- package/src/lib/common/types.d.ts +24 -2
- package/src/lib/trigger/activity-matching-filter.d.ts +8 -0
- package/src/lib/trigger/activity-matching-filter.js +178 -0
- package/src/lib/trigger/activity-matching-filter.js.map +1 -0
- package/src/lib/trigger/deal-matching-filter.d.ts +11 -0
- package/src/lib/trigger/deal-matching-filter.js +287 -0
- package/src/lib/trigger/deal-matching-filter.js.map +1 -0
- package/src/lib/trigger/new-deal.js +1 -1
- package/src/lib/trigger/new-deal.js.map +1 -1
- package/src/lib/trigger/new-lead.d.ts +2 -0
- package/src/lib/trigger/new-lead.js +124 -0
- package/src/lib/trigger/new-lead.js.map +1 -0
- package/src/lib/trigger/new-note.d.ts +2 -0
- package/src/lib/trigger/new-note.js +113 -0
- package/src/lib/trigger/new-note.js.map +1 -0
- package/src/lib/trigger/new-organization.d.ts +2 -0
- package/src/lib/trigger/new-organization.js +160 -0
- package/src/lib/trigger/new-organization.js.map +1 -0
- package/src/lib/trigger/new-person.js.map +1 -1
- package/src/lib/trigger/organization-matching-filter.d.ts +8 -0
- package/src/lib/trigger/organization-matching-filter.js +174 -0
- package/src/lib/trigger/organization-matching-filter.js.map +1 -0
- package/src/lib/trigger/person-matching-filter.d.ts +8 -0
- package/src/lib/trigger/person-matching-filter.js +203 -0
- package/src/lib/trigger/person-matching-filter.js.map +1 -0
- package/src/lib/trigger/updated-deal-stage.d.ts +8 -0
- package/src/lib/trigger/updated-deal-stage.js +288 -0
- package/src/lib/trigger/updated-deal-stage.js.map +1 -0
- package/src/lib/trigger/updated-organization.d.ts +2 -0
- package/src/lib/trigger/updated-organization.js +160 -0
- package/src/lib/trigger/updated-organization.js.map +1 -0
- package/src/lib/trigger/updated-person.js.map +1 -1
- package/src/lib/actions/add-person.action/add-person.action.d.ts +0 -8
- package/src/lib/actions/add-person.action/add-person.action.js +0 -179
- package/src/lib/actions/add-person.action/add-person.action.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-pipedrive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@anthropic-ai/sdk": "0.
|
|
5
|
+
"@anthropic-ai/sdk": "0.33.1",
|
|
6
6
|
"@sinclair/typebox": "0.34.11",
|
|
7
7
|
"axios": "1.7.8",
|
|
8
8
|
"axios-retry": "4.4.1",
|
|
9
|
+
"dayjs": "1.11.9",
|
|
9
10
|
"deepmerge-ts": "7.1.0",
|
|
11
|
+
"form-data": "4.0.0",
|
|
10
12
|
"mime-types": "2.1.35",
|
|
11
13
|
"nanoid": "3.3.8",
|
|
12
14
|
"openai": "4.67.1",
|
|
13
15
|
"replicate": "0.34.1",
|
|
14
16
|
"semver": "7.6.0",
|
|
15
17
|
"zod": "3.23.8",
|
|
16
|
-
"@activepieces/pieces-common": "0.3.
|
|
18
|
+
"@activepieces/pieces-common": "0.3.2",
|
|
17
19
|
"@activepieces/pieces-framework": "0.7.42",
|
|
18
|
-
"@activepieces/shared": "0.10.
|
|
20
|
+
"@activepieces/shared": "0.10.141",
|
|
19
21
|
"tslib": "1.14.1"
|
|
20
22
|
},
|
|
21
23
|
"overrides": {
|
package/src/index.js
CHANGED
|
@@ -5,18 +5,61 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const shared_1 = require("@activepieces/shared");
|
|
8
|
-
const add_person_action_1 = require("./lib/actions/add-person.action/add-person.action");
|
|
9
8
|
const new_activity_1 = require("./lib/trigger/new-activity");
|
|
10
9
|
const new_deal_1 = require("./lib/trigger/new-deal");
|
|
11
10
|
const new_person_1 = require("./lib/trigger/new-person");
|
|
12
11
|
const updated_deal_1 = require("./lib/trigger/updated-deal");
|
|
13
12
|
const updated_person_1 = require("./lib/trigger/updated-person");
|
|
13
|
+
const new_lead_1 = require("./lib/trigger/new-lead");
|
|
14
|
+
const new_organization_1 = require("./lib/trigger/new-organization");
|
|
15
|
+
const updated_organization_1 = require("./lib/trigger/updated-organization");
|
|
16
|
+
const updated_deal_stage_1 = require("./lib/trigger/updated-deal-stage");
|
|
17
|
+
const create_person_1 = require("./lib/actions/create-person");
|
|
18
|
+
const update_person_1 = require("./lib/actions/update-person");
|
|
19
|
+
const create_organization_1 = require("./lib/actions/create-organization");
|
|
20
|
+
const update_organization_1 = require("./lib/actions/update-organization");
|
|
21
|
+
const create_lead_1 = require("./lib/actions/create-lead");
|
|
22
|
+
const update_lead_1 = require("./lib/actions/update-lead");
|
|
23
|
+
const create_deal_1 = require("./lib/actions/create-deal");
|
|
24
|
+
const update_deal_1 = require("./lib/actions/update-deal");
|
|
25
|
+
const create_product_1 = require("./lib/actions/create-product");
|
|
26
|
+
const add_product_to_deal_1 = require("./lib/actions/add-product-to-deal");
|
|
27
|
+
const add_label_to_person_1 = require("./lib/actions/add-label-to-person");
|
|
28
|
+
const create_activity_1 = require("./lib/actions/create-activity");
|
|
29
|
+
const update_activity_1 = require("./lib/actions/update-activity");
|
|
30
|
+
const attach_file_1 = require("./lib/actions/attach-file");
|
|
31
|
+
const add_follower_1 = require("./lib/actions/add-follower");
|
|
32
|
+
const create_note_1 = require("./lib/actions/create-note");
|
|
33
|
+
const get_note_1 = require("./lib/actions/get-note");
|
|
34
|
+
const find_user_1 = require("./lib/actions/find-user");
|
|
35
|
+
const find_product_1 = require("./lib/actions/find-product");
|
|
36
|
+
const organization_matching_filter_1 = require("./lib/trigger/organization-matching-filter");
|
|
37
|
+
const person_matching_filter_1 = require("./lib/trigger/person-matching-filter");
|
|
38
|
+
const activity_matching_filter_1 = require("./lib/trigger/activity-matching-filter");
|
|
39
|
+
const deal_matching_filter_1 = require("./lib/trigger/deal-matching-filter");
|
|
40
|
+
const new_note_1 = require("./lib/trigger/new-note");
|
|
41
|
+
const find_deals_associated_with_person_1 = require("./lib/actions/find-deals-associated-with-person");
|
|
42
|
+
const find_products_1 = require("./lib/actions/find-products");
|
|
43
|
+
const get_product_1 = require("./lib/actions/get-product");
|
|
44
|
+
const find_notes_1 = require("./lib/actions/find-notes");
|
|
45
|
+
const find_organization_1 = require("./lib/actions/find-organization");
|
|
46
|
+
const find_person_1 = require("./lib/actions/find-person");
|
|
47
|
+
const find_deal_1 = require("./lib/actions/find-deal");
|
|
48
|
+
const find_activity_1 = require("./lib/actions/find-activity");
|
|
14
49
|
exports.pipedriveAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
15
50
|
description: '',
|
|
16
51
|
authUrl: 'https://oauth.pipedrive.com/oauth/authorize',
|
|
17
52
|
tokenUrl: 'https://oauth.pipedrive.com/oauth/token',
|
|
18
53
|
required: true,
|
|
19
|
-
scope: [
|
|
54
|
+
scope: [
|
|
55
|
+
'admin',
|
|
56
|
+
'contacts:full',
|
|
57
|
+
'users:read',
|
|
58
|
+
'deals:full',
|
|
59
|
+
'activities:full',
|
|
60
|
+
'leads:full',
|
|
61
|
+
'products:full',
|
|
62
|
+
],
|
|
20
63
|
});
|
|
21
64
|
exports.pipedrive = (0, pieces_framework_1.createPiece)({
|
|
22
65
|
displayName: 'Pipedrive',
|
|
@@ -26,7 +69,33 @@ exports.pipedrive = (0, pieces_framework_1.createPiece)({
|
|
|
26
69
|
categories: [shared_1.PieceCategory.SALES_AND_CRM],
|
|
27
70
|
auth: exports.pipedriveAuth,
|
|
28
71
|
actions: [
|
|
29
|
-
|
|
72
|
+
add_follower_1.addFollowerAction,
|
|
73
|
+
get_note_1.getNoteAction,
|
|
74
|
+
create_note_1.createNoteAction,
|
|
75
|
+
add_label_to_person_1.addLabelToPersonAction,
|
|
76
|
+
add_product_to_deal_1.addProductToDealAction,
|
|
77
|
+
attach_file_1.attachFileAction,
|
|
78
|
+
create_activity_1.createActivityAction,
|
|
79
|
+
update_activity_1.updateActivityAction,
|
|
80
|
+
create_deal_1.createDealAction,
|
|
81
|
+
update_deal_1.updateDealAction,
|
|
82
|
+
create_lead_1.createLeadAction,
|
|
83
|
+
update_lead_1.updateLeadAction,
|
|
84
|
+
create_organization_1.createOrganizationAction,
|
|
85
|
+
update_organization_1.updateOrganizationAction,
|
|
86
|
+
create_person_1.createPersonAction,
|
|
87
|
+
update_person_1.updatePersonAction,
|
|
88
|
+
create_product_1.createProductAction,
|
|
89
|
+
find_deals_associated_with_person_1.findDealsAssociatedWithPersonAction,
|
|
90
|
+
find_product_1.findProductAction,
|
|
91
|
+
find_products_1.findProductsAction,
|
|
92
|
+
find_notes_1.findNotesAction,
|
|
93
|
+
get_product_1.getProductAction,
|
|
94
|
+
find_organization_1.findOrganizationAction,
|
|
95
|
+
find_person_1.findPersonAction,
|
|
96
|
+
find_deal_1.findDealAction,
|
|
97
|
+
find_activity_1.findActivityAction,
|
|
98
|
+
find_user_1.findUserAction,
|
|
30
99
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
31
100
|
baseUrl: () => 'https://api.pipedrive.com/v1',
|
|
32
101
|
auth: exports.pipedriveAuth,
|
|
@@ -37,7 +106,22 @@ exports.pipedrive = (0, pieces_framework_1.createPiece)({
|
|
|
37
106
|
}),
|
|
38
107
|
}),
|
|
39
108
|
],
|
|
40
|
-
authors: [
|
|
41
|
-
triggers: [
|
|
109
|
+
authors: ['ashrafsamhouri', 'kishanprmr', 'MoShizzle', 'khaledmashaly', 'abuaboud'],
|
|
110
|
+
triggers: [
|
|
111
|
+
new_person_1.newPerson,
|
|
112
|
+
new_deal_1.newDeal,
|
|
113
|
+
new_activity_1.newActivity,
|
|
114
|
+
new_note_1.newNoteTrigger,
|
|
115
|
+
updated_person_1.updatedPerson,
|
|
116
|
+
updated_deal_1.updatedDeal,
|
|
117
|
+
updated_deal_stage_1.updatedDealStageTrigger,
|
|
118
|
+
new_lead_1.newLeadTrigger,
|
|
119
|
+
new_organization_1.newOrganizationTrigger,
|
|
120
|
+
updated_organization_1.updatedOrganizationTrigger,
|
|
121
|
+
activity_matching_filter_1.activityMatchingFilterTrigger,
|
|
122
|
+
deal_matching_filter_1.dealMatchingFilterTrigger,
|
|
123
|
+
person_matching_filter_1.personMatchingFilterTrigger,
|
|
124
|
+
organization_matching_filter_1.organizationMatchingFilterTrigger,
|
|
125
|
+
],
|
|
42
126
|
});
|
|
43
127
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/pipedrive/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/pipedrive/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6F;AAC7F,iDAAqD;AACrD,6DAAyD;AACzD,qDAAiD;AACjD,yDAAqD;AACrD,6DAAyD;AACzD,iEAA6D;AAC7D,qDAAwD;AACxD,qEAAwE;AACxE,6EAAgF;AAChF,yEAA2E;AAC3E,+DAAiE;AACjE,+DAAiE;AACjE,2EAA6E;AAC7E,2EAA6E;AAC7E,2DAA6D;AAC7D,2DAA6D;AAC7D,2DAA6D;AAC7D,2DAA6D;AAC7D,iEAAmE;AACnE,2EAA2E;AAC3E,2EAA2E;AAC3E,mEAAqE;AACrE,mEAAqE;AACrE,2DAA6D;AAC7D,6DAA+D;AAC/D,2DAA6D;AAC7D,qDAAuD;AACvD,uDAAyD;AACzD,6DAA+D;AAC/D,6FAA+F;AAC/F,iFAAmF;AACnF,qFAAuF;AACvF,6EAA+E;AAC/E,qDAAwD;AACxD,u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,CAAA;cAAA;SACF,CAAC;KACF;IACD,OAAO,EAAE,CAAC,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,CAAC;IACnF,QAAQ,EAAE;QACT,sBAAS;QACT,kBAAO;QACP,0BAAW;QACX,yBAAc;QACd,8BAAa;QACb,0BAAW;QACX,4CAAuB;QACvB,yBAAc;QACd,yCAAsB;QACtB,iDAA0B;QAC1B,wDAA6B;QAC7B,gDAAyB;QACzB,oDAA2B;QAC3B,gEAAiC;KACjC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const addFollowerAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
followerId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
3
|
+
entity: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
entityId: import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addFollowerAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const props_1 = require("../common/props");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
+
exports.addFollowerAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: index_1.pipedriveAuth,
|
|
12
|
+
name: 'add-follower',
|
|
13
|
+
displayName: 'Add Follower',
|
|
14
|
+
description: 'Adds a follower to a deal, person, organization or product.',
|
|
15
|
+
props: {
|
|
16
|
+
followerId: (0, props_1.ownerIdProp)('Follower', true),
|
|
17
|
+
entity: pieces_framework_1.Property.StaticDropdown({
|
|
18
|
+
displayName: 'Target Object',
|
|
19
|
+
description: 'Type of object to add the follower to.',
|
|
20
|
+
required: true,
|
|
21
|
+
options: {
|
|
22
|
+
disabled: false,
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
label: 'Deal',
|
|
26
|
+
value: 'deal',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Person',
|
|
30
|
+
value: 'person',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: 'Organization',
|
|
34
|
+
value: 'organization',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Product',
|
|
38
|
+
value: 'product',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
entityId: pieces_framework_1.Property.Dropdown({
|
|
44
|
+
displayName: 'Target Object ID',
|
|
45
|
+
description: 'ID of the object to add the follower to.',
|
|
46
|
+
refreshers: ['entity'],
|
|
47
|
+
required: true,
|
|
48
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, entity }) {
|
|
49
|
+
if (!auth) {
|
|
50
|
+
return {
|
|
51
|
+
disabled: true,
|
|
52
|
+
options: [],
|
|
53
|
+
placeholder: 'Please connect your account.',
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (!entity)
|
|
57
|
+
return {
|
|
58
|
+
disabled: true,
|
|
59
|
+
options: [],
|
|
60
|
+
placeholder: 'Please select entity type.',
|
|
61
|
+
};
|
|
62
|
+
const authValue = auth;
|
|
63
|
+
let options;
|
|
64
|
+
switch (entity) {
|
|
65
|
+
case 'deal':
|
|
66
|
+
options = yield (0, props_1.fetchDealsOptions)(authValue);
|
|
67
|
+
break;
|
|
68
|
+
case 'person':
|
|
69
|
+
options = yield (0, props_1.fetchPersonsOptions)(authValue);
|
|
70
|
+
break;
|
|
71
|
+
case 'organization':
|
|
72
|
+
options = yield (0, props_1.fetchOrganizationsOptions)(authValue);
|
|
73
|
+
break;
|
|
74
|
+
case 'product':
|
|
75
|
+
options = yield (0, props_1.fetchProductsOptions)(authValue);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
disabled: false,
|
|
80
|
+
options: options !== null && options !== void 0 ? options : [],
|
|
81
|
+
};
|
|
82
|
+
}),
|
|
83
|
+
}),
|
|
84
|
+
},
|
|
85
|
+
run(context) {
|
|
86
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
const { followerId, entity, entityId } = context.propsValue;
|
|
88
|
+
let endpoint = '';
|
|
89
|
+
switch (entity) {
|
|
90
|
+
case 'deal':
|
|
91
|
+
endpoint = `/deals/${entityId}/followers`;
|
|
92
|
+
break;
|
|
93
|
+
case 'organization':
|
|
94
|
+
endpoint = `/organizations/${entityId}/followers`;
|
|
95
|
+
break;
|
|
96
|
+
case 'person':
|
|
97
|
+
endpoint = `/persons/${entityId}/followers`;
|
|
98
|
+
break;
|
|
99
|
+
case 'product':
|
|
100
|
+
endpoint = `/products/${entityId}/followers`;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
if (!endpoint) {
|
|
104
|
+
throw new Error(`Invalid object type: ${entity}`);
|
|
105
|
+
}
|
|
106
|
+
const response = yield (0, common_1.pipedriveApiCall)({
|
|
107
|
+
accessToken: context.auth.access_token,
|
|
108
|
+
apiDomain: context.auth.data['api_domain'],
|
|
109
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
110
|
+
resourceUri: endpoint,
|
|
111
|
+
body: {
|
|
112
|
+
user_id: followerId,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
return response;
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=add-follower.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-follower.js","sourceRoot":"","sources":["../../../../../../../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,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,wBAAwB,MAAM,EAAE,CAAC,CAAC;YACtD,CAAC;YAEP,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAC;gBACvC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE;oBACL,OAAO,EAAE,UAAU;iBACnB;aACD,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QACjB,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const addLabelToPersonAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
personId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
3
|
+
labelIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, false> | import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addLabelToPersonAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const props_1 = require("../common/props");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
+
exports.addLabelToPersonAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: index_1.pipedriveAuth,
|
|
12
|
+
name: 'add-labels-to-person',
|
|
13
|
+
displayName: 'Add Labels to Person',
|
|
14
|
+
description: 'Adds an existing labels to an existing person.',
|
|
15
|
+
props: {
|
|
16
|
+
personId: (0, props_1.personIdProp)(true),
|
|
17
|
+
labelIds: (0, props_1.labelIdsProp)('person', 'label_ids', true),
|
|
18
|
+
},
|
|
19
|
+
run(context) {
|
|
20
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
var _a;
|
|
22
|
+
const { personId } = context.propsValue;
|
|
23
|
+
const labelIds = (_a = context.propsValue.labelIds) !== null && _a !== void 0 ? _a : [];
|
|
24
|
+
const personDefaultFields = {};
|
|
25
|
+
if (labelIds.length > 0) {
|
|
26
|
+
personDefaultFields.label_ids = labelIds;
|
|
27
|
+
}
|
|
28
|
+
const updatedPersonResponse = yield (0, common_1.pipedriveApiCall)({
|
|
29
|
+
accessToken: context.auth.access_token,
|
|
30
|
+
apiDomain: context.auth.data['api_domain'],
|
|
31
|
+
method: pieces_common_1.HttpMethod.PUT,
|
|
32
|
+
resourceUri: `/persons/${personId}`,
|
|
33
|
+
body: Object.assign({}, personDefaultFields),
|
|
34
|
+
});
|
|
35
|
+
const customFieldsResponse = yield (0, common_1.pipedrivePaginatedApiCall)({
|
|
36
|
+
accessToken: context.auth.access_token,
|
|
37
|
+
apiDomain: context.auth.data['api_domain'],
|
|
38
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
39
|
+
resourceUri: '/personFields',
|
|
40
|
+
});
|
|
41
|
+
const updatedPersonProperties = (0, common_1.pipedriveTransformCustomFields)(customFieldsResponse, updatedPersonResponse.data);
|
|
42
|
+
return Object.assign(Object.assign({}, updatedPersonResponse), { data: updatedPersonProperties });
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=add-label-to-person.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-label-to-person.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces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1C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,eAAe;aAC5B,CAAC,CAAC;YAEH,MAAM,uBAAuB,GAAG,IAAA,uCAA8B,EAC7D,oBAAoB,EACpB,qBAAqB,CAAC,IAAI,CAC1B,CAAC;YAEF,uCACI,qBAAqB,KACxB,IAAI,EAAE,uBAAuB,IAC5B;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const addProductToDealAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
dealId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
3
|
+
productId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
4
|
+
price: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
5
|
+
quantity: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
6
|
+
discount: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
7
|
+
discountType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
8
|
+
comments: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
9
|
+
enableProduct: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
10
|
+
taxMethod: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
11
|
+
taxPercentage: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addProductToDealAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const props_1 = require("../common/props");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
+
exports.addProductToDealAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: index_1.pipedriveAuth,
|
|
12
|
+
name: 'add-product-to-deal',
|
|
13
|
+
displayName: 'Add Product to Deal',
|
|
14
|
+
description: 'Adds a product to a deal.',
|
|
15
|
+
props: {
|
|
16
|
+
dealId: (0, props_1.dealIdProp)(true),
|
|
17
|
+
productId: (0, props_1.productIdProp)(true),
|
|
18
|
+
price: pieces_framework_1.Property.Number({
|
|
19
|
+
displayName: 'Price',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
quantity: pieces_framework_1.Property.Number({
|
|
23
|
+
displayName: 'Quantity',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
discount: pieces_framework_1.Property.Number({
|
|
27
|
+
displayName: 'Discount',
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
discountType: pieces_framework_1.Property.StaticDropdown({
|
|
31
|
+
displayName: 'Discount Type',
|
|
32
|
+
required: false,
|
|
33
|
+
options: {
|
|
34
|
+
disabled: false,
|
|
35
|
+
options: [
|
|
36
|
+
{
|
|
37
|
+
label: 'Percentage',
|
|
38
|
+
value: 'percentage',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'Amount',
|
|
42
|
+
value: 'amount',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
comments: pieces_framework_1.Property.LongText({
|
|
48
|
+
displayName: 'Comments',
|
|
49
|
+
required: false,
|
|
50
|
+
}),
|
|
51
|
+
enableProduct: pieces_framework_1.Property.Checkbox({
|
|
52
|
+
displayName: 'Enable Product?',
|
|
53
|
+
required: false,
|
|
54
|
+
defaultValue: true,
|
|
55
|
+
}),
|
|
56
|
+
taxMethod: pieces_framework_1.Property.StaticDropdown({
|
|
57
|
+
displayName: 'Tax Method',
|
|
58
|
+
required: false,
|
|
59
|
+
options: {
|
|
60
|
+
disabled: false,
|
|
61
|
+
options: [
|
|
62
|
+
{
|
|
63
|
+
label: 'Exclusive',
|
|
64
|
+
value: 'exclusive',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'Inclusive',
|
|
68
|
+
value: 'inclusive',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'None',
|
|
72
|
+
value: 'none',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
taxPercentage: pieces_framework_1.Property.Number({
|
|
78
|
+
displayName: 'Tax Percentage',
|
|
79
|
+
required: false,
|
|
80
|
+
}),
|
|
81
|
+
},
|
|
82
|
+
run(context) {
|
|
83
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const { productId, dealId, price, quantity, discountType, discount, comments, enableProduct, taxPercentage, taxMethod, } = context.propsValue;
|
|
85
|
+
const response = yield (0, common_1.pipedriveApiCall)({
|
|
86
|
+
accessToken: context.auth.access_token,
|
|
87
|
+
apiDomain: context.auth.data['api_domain'],
|
|
88
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
89
|
+
resourceUri: `/deals/${dealId}/products`,
|
|
90
|
+
body: {
|
|
91
|
+
product_id: productId,
|
|
92
|
+
item_price: price,
|
|
93
|
+
quantity,
|
|
94
|
+
discount_type: discountType,
|
|
95
|
+
discount,
|
|
96
|
+
comments,
|
|
97
|
+
enable_product: enableProduct,
|
|
98
|
+
tax: taxPercentage,
|
|
99
|
+
tax_method: taxMethod,
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
return response;
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=add-product-to-deal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-product-to-deal.js","sourceRoot":"","sources":["../../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C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const attachFileAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
file: import("@activepieces/pieces-framework").FileProperty<true>;
|
|
3
|
+
fileName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
dealId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
5
|
+
personId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
6
|
+
organizationId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
7
|
+
productId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
8
|
+
activityId: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attachFileAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const props_1 = require("../common/props");
|
|
8
|
+
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
9
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
+
exports.attachFileAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: index_1.pipedriveAuth,
|
|
12
|
+
name: 'attach-file',
|
|
13
|
+
displayName: 'Attach File',
|
|
14
|
+
description: 'Uploads a file and attaches it to a deal,person,organization,activity or product.',
|
|
15
|
+
props: {
|
|
16
|
+
file: pieces_framework_1.Property.File({
|
|
17
|
+
displayName: 'File',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
fileName: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'File Name',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
dealId: (0, props_1.dealIdProp)(false),
|
|
25
|
+
personId: (0, props_1.personIdProp)(false),
|
|
26
|
+
organizationId: (0, props_1.organizationIdProp)(false),
|
|
27
|
+
productId: (0, props_1.productIdProp)(false),
|
|
28
|
+
activityId: pieces_framework_1.Property.Number({
|
|
29
|
+
displayName: 'Activity ID',
|
|
30
|
+
required: false,
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
run(context) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const { file, fileName, dealId, personId, organizationId, productId, activityId } = context.propsValue;
|
|
36
|
+
const formatData = new form_data_1.default();
|
|
37
|
+
formatData.append('file', file.data, fileName);
|
|
38
|
+
if (dealId)
|
|
39
|
+
formatData.append('deal_id', dealId);
|
|
40
|
+
if (personId)
|
|
41
|
+
formatData.append('person_id', personId);
|
|
42
|
+
if (organizationId)
|
|
43
|
+
formatData.append('org_id', organizationId);
|
|
44
|
+
if (productId)
|
|
45
|
+
formatData.append('product_id', productId);
|
|
46
|
+
if (activityId)
|
|
47
|
+
formatData.append('activity_id', activityId);
|
|
48
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
49
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
50
|
+
url: `${context.auth.data['api_domain']}/api/v1/files`,
|
|
51
|
+
body: formatData,
|
|
52
|
+
authentication: {
|
|
53
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
54
|
+
token: context.auth.access_token,
|
|
55
|
+
},
|
|
56
|
+
headers: Object.assign({}, formatData.getHeaders()),
|
|
57
|
+
});
|
|
58
|
+
return response.body;
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=attach-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pipedrive/src/lib/actions/attach-file.ts"],"names":[],"mappings":";;;;AAAA,uCAA4C;AAC5C,qEAAwE;AACxE,2CAA8F;AAC9F,kEAAiC;AACjC,+DAAyF;AAE5E,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,mFAAmF;IAChG,KAAK,EAAE;QACN,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACnB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,MAAM,EAAE,IAAA,kBAAU,EAAC,KAAK,CAAC;QACzB,QAAQ,EAAE,IAAA,oBAAY,EAAC,KAAK,CAAC;QAC7B,cAAc,EAAE,IAAA,0BAAkB,EAAC,KAAK,CAAC;QACzC,SAAS,EAAE,IAAA,qBAAa,EAAC,KAAK,CAAC;QAC/B,UAAU,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC3B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,GAChF,OAAO,CAAC,UAAU,CAAC;YAEpB,MAAM,UAAU,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAElC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC/C,IAAI,MAAM;gBAAE,UAAU,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACjD,IAAI,QAAQ;gBAAE,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YACvD,IAAI,cAAc;gBAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;YAChE,IAAI,SAAS;gBAAE,UAAU,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;YAC1D,IAAI,UAAU;gBAAE,UAAU,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;YAE7D,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC7C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe;gBACtD,IAAI,EAAE,UAAU;gBAChB,cAAc,EAAE;oBACf,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBAChC;gBACD,OAAO,oBACH,UAAU,CAAC,UAAU,EAAE,CAC1B;aACD,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const createActivityAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
organizationId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
3
|
+
personId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
4
|
+
dealId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
5
|
+
leadId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
6
|
+
assignTo: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
7
|
+
type: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
8
|
+
dueDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
9
|
+
dueTime: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
duration: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
idDone: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
12
|
+
isBusy: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
13
|
+
note: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
14
|
+
publicDescription: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
15
|
+
subject: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createActivityAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const props_1 = require("../common/props");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
11
|
+
exports.createActivityAction = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: index_1.pipedriveAuth,
|
|
13
|
+
name: 'create-activity',
|
|
14
|
+
displayName: 'Create Activity',
|
|
15
|
+
description: 'Creates a new activity.',
|
|
16
|
+
props: Object.assign({ subject: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Subject',
|
|
18
|
+
required: true,
|
|
19
|
+
}) }, props_1.activityCommonProps),
|
|
20
|
+
run(context) {
|
|
21
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { subject, organizationId, personId, dealId, leadId, assignTo, type, dueDate, dueTime, duration, idDone, isBusy, note, publicDescription, } = context.propsValue;
|
|
23
|
+
const activityDefaultFields = {
|
|
24
|
+
subject,
|
|
25
|
+
org_id: organizationId,
|
|
26
|
+
person_id: personId,
|
|
27
|
+
deal_id: dealId,
|
|
28
|
+
lead_id: leadId,
|
|
29
|
+
note,
|
|
30
|
+
public_description: publicDescription,
|
|
31
|
+
type,
|
|
32
|
+
user_id: assignTo,
|
|
33
|
+
due_time: dueTime,
|
|
34
|
+
duration,
|
|
35
|
+
done: idDone ? 1 : 0,
|
|
36
|
+
};
|
|
37
|
+
if (isBusy) {
|
|
38
|
+
activityDefaultFields.busy_flag = isBusy === 'busy' ? true : false;
|
|
39
|
+
}
|
|
40
|
+
if (dueDate) {
|
|
41
|
+
activityDefaultFields.due_date = (0, dayjs_1.default)(dueDate).format('YYYY-MM-DD');
|
|
42
|
+
}
|
|
43
|
+
const response = yield (0, common_1.pipedriveApiCall)({
|
|
44
|
+
accessToken: context.auth.access_token,
|
|
45
|
+
apiDomain: context.auth.data['api_domain'],
|
|
46
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
47
|
+
resourceUri: '/activities',
|
|
48
|
+
body: activityDefaultFields,
|
|
49
|
+
});
|
|
50
|
+
return response;
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=create-activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-activity.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pipedrive/src/lib/actions/create-activity.ts"],"names":[],"mappings":";;;;AAAA,uCAA4C;AAC5C,qEAAwE;AACxE,2CAAsD;AACtD,sCAA6C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