@friggframework/api-module-pipedrive 2.1.0-next.0 → 2.1.0-next.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/dist/api.d.ts +16 -1
- package/dist/api.js +32 -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, PipedriveResponse, PipedriveUser, PipedriveTokenResponse } from "./types";
|
|
2
|
+
import { OAuth2RequesterOptions, ActivityParams, ListActivitiesParams, ListDealsParams, ListPersonsParams, GetPersonParams, ListOrganizationsParams, GetOrganizationParams, PipedriveResponse, PipedriveUser, PipedriveTokenResponse } from "./types";
|
|
3
3
|
export declare class Api extends OAuth2Requester {
|
|
4
4
|
companyDomain: string | null;
|
|
5
5
|
URLs: {
|
|
@@ -11,6 +11,8 @@ export declare class Api extends OAuth2Requester {
|
|
|
11
11
|
deals: string;
|
|
12
12
|
persons: string;
|
|
13
13
|
personById: (personId: string | number) => string;
|
|
14
|
+
organizations: string;
|
|
15
|
+
organizationById: (orgId: string | number) => string;
|
|
14
16
|
};
|
|
15
17
|
constructor(params: OAuth2RequesterOptions);
|
|
16
18
|
/**
|
|
@@ -56,4 +58,17 @@ export declare class Api extends OAuth2Requester {
|
|
|
56
58
|
* @returns Response with person data
|
|
57
59
|
*/
|
|
58
60
|
getPerson(personId: string | number, params?: GetPersonParams): Promise<PipedriveResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* List organizations with v2 API support
|
|
63
|
+
* @param params - Query parameters for filtering and pagination
|
|
64
|
+
* @returns Response with organization data array and pagination cursor
|
|
65
|
+
*/
|
|
66
|
+
listOrganizations(params?: ListOrganizationsParams): Promise<PipedriveResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Get a single organization by ID
|
|
69
|
+
* @param orgId - The ID of the organization to retrieve
|
|
70
|
+
* @param params - Query parameters for additional fields
|
|
71
|
+
* @returns Response with organization data
|
|
72
|
+
*/
|
|
73
|
+
getOrganization(orgId: string | number, params?: GetOrganizationParams): Promise<PipedriveResponse>;
|
|
59
74
|
}
|
package/dist/api.js
CHANGED
|
@@ -16,6 +16,8 @@ class Api extends core_1.OAuth2Requester {
|
|
|
16
16
|
deals: "/v2/deals",
|
|
17
17
|
persons: "/v2/persons",
|
|
18
18
|
personById: (personId) => `/v2/persons/${personId}`,
|
|
19
|
+
organizations: "/v2/organizations",
|
|
20
|
+
organizationById: (orgId) => `/v2/organizations/${orgId}`,
|
|
19
21
|
};
|
|
20
22
|
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}`);
|
|
21
23
|
this.tokenUri = "https://oauth.pipedrive.com/oauth/token";
|
|
@@ -154,5 +156,35 @@ class Api extends core_1.OAuth2Requester {
|
|
|
154
156
|
}
|
|
155
157
|
return this._get(options);
|
|
156
158
|
}
|
|
159
|
+
// ************************** Organizations **********************************
|
|
160
|
+
/**
|
|
161
|
+
* List organizations with v2 API support
|
|
162
|
+
* @param params - Query parameters for filtering and pagination
|
|
163
|
+
* @returns Response with organization data array and pagination cursor
|
|
164
|
+
*/
|
|
165
|
+
async listOrganizations(params) {
|
|
166
|
+
const options = {
|
|
167
|
+
url: this.baseUrl + this.URLs.organizations,
|
|
168
|
+
};
|
|
169
|
+
if (params && Object.keys(params).length > 0) {
|
|
170
|
+
options.query = params;
|
|
171
|
+
}
|
|
172
|
+
return this._get(options);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get a single organization by ID
|
|
176
|
+
* @param orgId - The ID of the organization to retrieve
|
|
177
|
+
* @param params - Query parameters for additional fields
|
|
178
|
+
* @returns Response with organization data
|
|
179
|
+
*/
|
|
180
|
+
async getOrganization(orgId, params) {
|
|
181
|
+
const options = {
|
|
182
|
+
url: this.baseUrl + this.URLs.organizationById(orgId),
|
|
183
|
+
};
|
|
184
|
+
if (params && Object.keys(params).length > 0) {
|
|
185
|
+
options.query = params;
|
|
186
|
+
}
|
|
187
|
+
return this._get(options);
|
|
188
|
+
}
|
|
157
189
|
}
|
|
158
190
|
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-next.
|
|
3
|
+
"version": "2.1.0-next.1",
|
|
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": "5b22500d5eb6b9032389753acad2279ddd70a8dd"
|
|
34
34
|
}
|