@friggframework/api-module-pipedrive 2.1.0-canary.57.58a8b12.0 → 2.1.0-canary.58.42ea316.0
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/dist/api.d.ts +83 -1
- package/dist/api.js +133 -0
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OAuth2Requester } from "@friggframework/core";
|
|
2
|
-
import { OAuth2RequesterOptions, ActivityParams, ListActivitiesParams, ListDealsParams, ListPersonsParams, GetPersonParams, ListOrganizationsParams, GetOrganizationParams, PipedriveResponse, PipedriveUser, PipedriveTokenResponse } from "./types";
|
|
2
|
+
import { OAuth2RequesterOptions, ActivityParams, ListActivitiesParams, ListDealsParams, CreateDealParams, ListPersonsParams, GetPersonParams, SearchPersonsParams, SearchParams, CreateNoteParams, ListOrganizationsParams, GetOrganizationParams, PipedriveResponse, PipedriveUser, PipedriveTokenResponse, CreateWebhookParams } from "./types";
|
|
3
3
|
export declare class Api extends OAuth2Requester {
|
|
4
4
|
companyDomain: string | null;
|
|
5
5
|
URLs: {
|
|
@@ -11,8 +11,13 @@ export declare class Api extends OAuth2Requester {
|
|
|
11
11
|
deals: string;
|
|
12
12
|
persons: string;
|
|
13
13
|
personById: (personId: string | number) => string;
|
|
14
|
+
personsSearch: string;
|
|
14
15
|
organizations: string;
|
|
15
16
|
organizationById: (orgId: string | number) => string;
|
|
17
|
+
notes: string;
|
|
18
|
+
webhooks: string;
|
|
19
|
+
webhookById: (webhookId: string | number) => string;
|
|
20
|
+
search: string;
|
|
16
21
|
};
|
|
17
22
|
constructor(params: OAuth2RequesterOptions);
|
|
18
23
|
/**
|
|
@@ -33,6 +38,19 @@ export declare class Api extends OAuth2Requester {
|
|
|
33
38
|
* @returns Response with deal data array and pagination cursor
|
|
34
39
|
*/
|
|
35
40
|
listDeals(params?: ListDealsParams): Promise<PipedriveResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a new deal
|
|
43
|
+
* @param params - Deal data
|
|
44
|
+
* @param params.title - Deal title (required)
|
|
45
|
+
* @param params.value - Deal value
|
|
46
|
+
* @param params.currency - Currency code
|
|
47
|
+
* @param params.person_id - Associated person ID
|
|
48
|
+
* @param params.org_id - Associated organization ID
|
|
49
|
+
* @param params.pipeline_id - Pipeline ID
|
|
50
|
+
* @param params.stage_id - Stage ID
|
|
51
|
+
* @returns Response with created deal data
|
|
52
|
+
*/
|
|
53
|
+
createDeal(params: CreateDealParams): Promise<PipedriveResponse>;
|
|
36
54
|
listActivityFields(): Promise<PipedriveResponse>;
|
|
37
55
|
/**
|
|
38
56
|
* List activities with v2 API support
|
|
@@ -58,6 +76,45 @@ export declare class Api extends OAuth2Requester {
|
|
|
58
76
|
* @returns Response with person data
|
|
59
77
|
*/
|
|
60
78
|
getPerson(personId: string | number, params?: GetPersonParams): Promise<PipedriveResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* Search for persons
|
|
81
|
+
* @param params - Search parameters
|
|
82
|
+
* @param params.term - The search term (minimum 2 characters, or 1 if using exact_match)
|
|
83
|
+
* @param params.fields - Comma-separated fields to search in
|
|
84
|
+
* @param params.exact_match - When enabled, only full exact matches are returned
|
|
85
|
+
* @param params.organization_id - Filter persons by organization ID
|
|
86
|
+
* @param params.include_fields - Optional fields to include (e.g., "person.picture")
|
|
87
|
+
* @param params.limit - Number of entries to return (default 100, max 500)
|
|
88
|
+
* @param params.cursor - Pagination cursor
|
|
89
|
+
* @returns Response with search results including items with result_score and person data
|
|
90
|
+
*/
|
|
91
|
+
searchPersons(params: SearchPersonsParams): Promise<PipedriveResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Search across all items (persons, organizations, deals, etc.)
|
|
94
|
+
* @param params - Search parameters
|
|
95
|
+
* @param params.term - The search term (minimum 2 characters)
|
|
96
|
+
* @param params.item_types - Comma-separated item types to search (e.g., 'person,organization,deal')
|
|
97
|
+
* @param params.exact_match - When enabled, only full exact matches are returned
|
|
98
|
+
* @param params.fields - Comma-separated fields to search in
|
|
99
|
+
* @param params.limit - Number of entries to return (default 10, max 100)
|
|
100
|
+
* @param params.start - Pagination start
|
|
101
|
+
* @returns Response with search results across multiple item types
|
|
102
|
+
*/
|
|
103
|
+
search(params: SearchParams): Promise<PipedriveResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Create a new note
|
|
106
|
+
* @param params - Note data
|
|
107
|
+
* @param params.content - The content of the note in HTML format (required)
|
|
108
|
+
* @param params.lead_id - The ID of the lead (UUID format)
|
|
109
|
+
* @param params.deal_id - The ID of the deal
|
|
110
|
+
* @param params.person_id - The ID of the person
|
|
111
|
+
* @param params.org_id - The ID of the organization
|
|
112
|
+
* @param params.project_id - The ID of the project
|
|
113
|
+
* @param params.user_id - The ID of the user (author)
|
|
114
|
+
* @param params.add_time - Creation date & time in UTC (Format: YYYY-MM-DD HH:MM:SS)
|
|
115
|
+
* @returns Response with created note data
|
|
116
|
+
*/
|
|
117
|
+
createNote(params: CreateNoteParams): Promise<PipedriveResponse>;
|
|
61
118
|
/**
|
|
62
119
|
* List organizations with v2 API support
|
|
63
120
|
* @param params - Query parameters for filtering and pagination
|
|
@@ -71,4 +128,29 @@ export declare class Api extends OAuth2Requester {
|
|
|
71
128
|
* @returns Response with organization data
|
|
72
129
|
*/
|
|
73
130
|
getOrganization(orgId: string | number, params?: GetOrganizationParams): Promise<PipedriveResponse>;
|
|
131
|
+
/**
|
|
132
|
+
* List all webhooks for the company
|
|
133
|
+
* @returns Response with array of webhook configurations
|
|
134
|
+
*/
|
|
135
|
+
listWebhooks(): Promise<PipedriveResponse>;
|
|
136
|
+
/**
|
|
137
|
+
* Create a new webhook subscription
|
|
138
|
+
* @param params - Webhook configuration
|
|
139
|
+
* @param params.subscription_url - Public HTTPS URL to receive webhooks
|
|
140
|
+
* @param params.event_action - Event action: added, updated, deleted, merged, *
|
|
141
|
+
* @param params.event_object - Event object: person, organization, deal, activity, product, *
|
|
142
|
+
* @param params.name - Human-readable name for the webhook
|
|
143
|
+
* @param params.user_id - Optional: User ID to authorize webhook with
|
|
144
|
+
* @param params.http_auth_user - Optional: HTTP basic auth username
|
|
145
|
+
* @param params.http_auth_password - Optional: HTTP basic auth password
|
|
146
|
+
* @param params.version - Optional: Webhook version (1.0 or 2.0, default: 2.0)
|
|
147
|
+
* @returns Response with created webhook data
|
|
148
|
+
*/
|
|
149
|
+
createWebhook(params: CreateWebhookParams): Promise<PipedriveResponse>;
|
|
150
|
+
/**
|
|
151
|
+
* Delete a webhook by ID
|
|
152
|
+
* @param webhookId - The ID of the webhook to delete
|
|
153
|
+
* @returns Response confirming deletion
|
|
154
|
+
*/
|
|
155
|
+
deleteWebhook(webhookId: string | number): Promise<PipedriveResponse>;
|
|
74
156
|
}
|
package/dist/api.js
CHANGED
|
@@ -16,8 +16,13 @@ class Api extends core_1.OAuth2Requester {
|
|
|
16
16
|
deals: "/v2/deals",
|
|
17
17
|
persons: "/v2/persons",
|
|
18
18
|
personById: (personId) => `/v2/persons/${personId}`,
|
|
19
|
+
personsSearch: "/v2/persons/search",
|
|
19
20
|
organizations: "/v2/organizations",
|
|
20
21
|
organizationById: (orgId) => `/v2/organizations/${orgId}`,
|
|
22
|
+
notes: "/v1/notes",
|
|
23
|
+
webhooks: "/v1/webhooks",
|
|
24
|
+
webhookById: (webhookId) => `/v1/webhooks/${webhookId}`,
|
|
25
|
+
search: "/v1/search",
|
|
21
26
|
};
|
|
22
27
|
this.authorizationUri = encodeURI(`https://oauth.pipedrive.com/oauth/authorize?client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&response_type=code&scope=${this.scope}`);
|
|
23
28
|
this.tokenUri = "https://oauth.pipedrive.com/oauth/token";
|
|
@@ -66,6 +71,28 @@ class Api extends core_1.OAuth2Requester {
|
|
|
66
71
|
}
|
|
67
72
|
return this._get(options);
|
|
68
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a new deal
|
|
76
|
+
* @param params - Deal data
|
|
77
|
+
* @param params.title - Deal title (required)
|
|
78
|
+
* @param params.value - Deal value
|
|
79
|
+
* @param params.currency - Currency code
|
|
80
|
+
* @param params.person_id - Associated person ID
|
|
81
|
+
* @param params.org_id - Associated organization ID
|
|
82
|
+
* @param params.pipeline_id - Pipeline ID
|
|
83
|
+
* @param params.stage_id - Stage ID
|
|
84
|
+
* @returns Response with created deal data
|
|
85
|
+
*/
|
|
86
|
+
async createDeal(params) {
|
|
87
|
+
const options = {
|
|
88
|
+
url: this.baseUrl + this.URLs.deals,
|
|
89
|
+
body: params,
|
|
90
|
+
headers: {
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
return this._post(options);
|
|
95
|
+
}
|
|
69
96
|
// ************************** Activities **********************************
|
|
70
97
|
async listActivityFields() {
|
|
71
98
|
const options = {
|
|
@@ -156,6 +183,67 @@ class Api extends core_1.OAuth2Requester {
|
|
|
156
183
|
}
|
|
157
184
|
return this._get(options);
|
|
158
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Search for persons
|
|
188
|
+
* @param params - Search parameters
|
|
189
|
+
* @param params.term - The search term (minimum 2 characters, or 1 if using exact_match)
|
|
190
|
+
* @param params.fields - Comma-separated fields to search in
|
|
191
|
+
* @param params.exact_match - When enabled, only full exact matches are returned
|
|
192
|
+
* @param params.organization_id - Filter persons by organization ID
|
|
193
|
+
* @param params.include_fields - Optional fields to include (e.g., "person.picture")
|
|
194
|
+
* @param params.limit - Number of entries to return (default 100, max 500)
|
|
195
|
+
* @param params.cursor - Pagination cursor
|
|
196
|
+
* @returns Response with search results including items with result_score and person data
|
|
197
|
+
*/
|
|
198
|
+
async searchPersons(params) {
|
|
199
|
+
const options = {
|
|
200
|
+
url: this.baseUrl + this.URLs.personsSearch,
|
|
201
|
+
query: params,
|
|
202
|
+
};
|
|
203
|
+
return this._get(options);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Search across all items (persons, organizations, deals, etc.)
|
|
207
|
+
* @param params - Search parameters
|
|
208
|
+
* @param params.term - The search term (minimum 2 characters)
|
|
209
|
+
* @param params.item_types - Comma-separated item types to search (e.g., 'person,organization,deal')
|
|
210
|
+
* @param params.exact_match - When enabled, only full exact matches are returned
|
|
211
|
+
* @param params.fields - Comma-separated fields to search in
|
|
212
|
+
* @param params.limit - Number of entries to return (default 10, max 100)
|
|
213
|
+
* @param params.start - Pagination start
|
|
214
|
+
* @returns Response with search results across multiple item types
|
|
215
|
+
*/
|
|
216
|
+
async search(params) {
|
|
217
|
+
const options = {
|
|
218
|
+
url: this.baseUrl + this.URLs.search,
|
|
219
|
+
query: params,
|
|
220
|
+
};
|
|
221
|
+
return this._get(options);
|
|
222
|
+
}
|
|
223
|
+
// ************************** Notes **********************************
|
|
224
|
+
/**
|
|
225
|
+
* Create a new note
|
|
226
|
+
* @param params - Note data
|
|
227
|
+
* @param params.content - The content of the note in HTML format (required)
|
|
228
|
+
* @param params.lead_id - The ID of the lead (UUID format)
|
|
229
|
+
* @param params.deal_id - The ID of the deal
|
|
230
|
+
* @param params.person_id - The ID of the person
|
|
231
|
+
* @param params.org_id - The ID of the organization
|
|
232
|
+
* @param params.project_id - The ID of the project
|
|
233
|
+
* @param params.user_id - The ID of the user (author)
|
|
234
|
+
* @param params.add_time - Creation date & time in UTC (Format: YYYY-MM-DD HH:MM:SS)
|
|
235
|
+
* @returns Response with created note data
|
|
236
|
+
*/
|
|
237
|
+
async createNote(params) {
|
|
238
|
+
const options = {
|
|
239
|
+
url: this.baseUrl + this.URLs.notes,
|
|
240
|
+
body: params,
|
|
241
|
+
headers: {
|
|
242
|
+
"Content-Type": "application/json",
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
return this._post(options);
|
|
246
|
+
}
|
|
159
247
|
// ************************** Organizations **********************************
|
|
160
248
|
/**
|
|
161
249
|
* List organizations with v2 API support
|
|
@@ -186,5 +274,50 @@ class Api extends core_1.OAuth2Requester {
|
|
|
186
274
|
}
|
|
187
275
|
return this._get(options);
|
|
188
276
|
}
|
|
277
|
+
// ************************** Webhooks **********************************
|
|
278
|
+
/**
|
|
279
|
+
* List all webhooks for the company
|
|
280
|
+
* @returns Response with array of webhook configurations
|
|
281
|
+
*/
|
|
282
|
+
async listWebhooks() {
|
|
283
|
+
const options = {
|
|
284
|
+
url: this.baseUrl + this.URLs.webhooks,
|
|
285
|
+
};
|
|
286
|
+
return this._get(options);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Create a new webhook subscription
|
|
290
|
+
* @param params - Webhook configuration
|
|
291
|
+
* @param params.subscription_url - Public HTTPS URL to receive webhooks
|
|
292
|
+
* @param params.event_action - Event action: added, updated, deleted, merged, *
|
|
293
|
+
* @param params.event_object - Event object: person, organization, deal, activity, product, *
|
|
294
|
+
* @param params.name - Human-readable name for the webhook
|
|
295
|
+
* @param params.user_id - Optional: User ID to authorize webhook with
|
|
296
|
+
* @param params.http_auth_user - Optional: HTTP basic auth username
|
|
297
|
+
* @param params.http_auth_password - Optional: HTTP basic auth password
|
|
298
|
+
* @param params.version - Optional: Webhook version (1.0 or 2.0, default: 2.0)
|
|
299
|
+
* @returns Response with created webhook data
|
|
300
|
+
*/
|
|
301
|
+
async createWebhook(params) {
|
|
302
|
+
const options = {
|
|
303
|
+
url: this.baseUrl + this.URLs.webhooks,
|
|
304
|
+
body: params,
|
|
305
|
+
headers: {
|
|
306
|
+
"Content-Type": "application/json",
|
|
307
|
+
},
|
|
308
|
+
};
|
|
309
|
+
return this._post(options);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Delete a webhook by ID
|
|
313
|
+
* @param webhookId - The ID of the webhook to delete
|
|
314
|
+
* @returns Response confirming deletion
|
|
315
|
+
*/
|
|
316
|
+
async deleteWebhook(webhookId) {
|
|
317
|
+
const options = {
|
|
318
|
+
url: this.baseUrl + this.URLs.webhookById(webhookId),
|
|
319
|
+
};
|
|
320
|
+
return this._delete(options);
|
|
321
|
+
}
|
|
189
322
|
}
|
|
190
323
|
exports.Api = Api;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/api-module-pipedrive",
|
|
3
|
-
"version": "2.1.0-canary.
|
|
3
|
+
"version": "2.1.0-canary.58.42ea316.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "42ea316f7f84d2b882d71b0330608f35b84d0c48"
|
|
34
34
|
}
|