pipedrive 22.3.1-rc.2 → 22.3.1-rc.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +17 -4
- package/README.md +29 -24
- package/api/activities-api.ts +1 -24
- package/api/activity-fields-api.ts +1 -24
- package/api/activity-types-api.ts +1 -21
- package/api/billing-api.ts +1 -24
- package/api/call-logs-api.ts +1 -24
- package/api/channels-api.ts +1 -24
- package/api/currencies-api.ts +1 -24
- package/api/deal-fields-api.ts +1 -24
- package/api/deals-api.ts +1 -24
- package/api/files-api.ts +1 -24
- package/api/filters-api.ts +1 -24
- package/api/goals-api.ts +1 -24
- package/api/item-search-api.ts +1 -24
- package/api/lead-labels-api.ts +1 -21
- package/api/lead-sources-api.ts +1 -24
- package/api/leads-api.ts +1 -24
- package/api/legacy-teams-api.ts +1 -24
- package/api/mailbox-api.ts +1 -24
- package/api/note-fields-api.ts +1 -24
- package/api/notes-api.ts +1 -21
- package/api/organization-fields-api.ts +1 -24
- package/api/organization-relationships-api.ts +1 -24
- package/api/organizations-api.ts +1 -24
- package/api/permission-sets-api.ts +1 -24
- package/api/person-fields-api.ts +1 -21
- package/api/persons-api.ts +1 -24
- package/api/pipelines-api.ts +1 -24
- package/api/product-fields-api.ts +1 -24
- package/api/products-api.ts +1 -24
- package/api/project-templates-api.ts +1 -24
- package/api/projects-api.ts +1 -24
- package/api/recents-api.ts +1 -24
- package/api/roles-api.ts +1 -24
- package/api/stages-api.ts +1 -24
- package/api/subscriptions-api.ts +1 -24
- package/api/tasks-api.ts +1 -24
- package/api/user-connections-api.ts +1 -24
- package/api/user-settings-api.ts +1 -24
- package/api/users-api.ts +1 -24
- package/api/webhooks-api.ts +1 -21
- package/base.ts +31 -0
- package/common.ts +0 -1
- package/configuration.ts +11 -2
- package/dist/api/activities-api.js +7 -30
- package/dist/api/activity-fields-api.js +1 -24
- package/dist/api/activity-types-api.js +0 -20
- package/dist/api/billing-api.js +1 -24
- package/dist/api/call-logs-api.js +5 -28
- package/dist/api/channels-api.js +4 -27
- package/dist/api/currencies-api.js +1 -24
- package/dist/api/deal-fields-api.js +6 -29
- package/dist/api/deals-api.js +28 -51
- package/dist/api/files-api.js +11 -34
- package/dist/api/filters-api.js +7 -30
- package/dist/api/goals-api.js +5 -28
- package/dist/api/item-search-api.js +2 -25
- package/dist/api/lead-labels-api.js +0 -20
- package/dist/api/lead-sources-api.js +1 -24
- package/dist/api/leads-api.js +7 -30
- package/dist/api/legacy-teams-api.js +8 -31
- package/dist/api/mailbox-api.js +7 -30
- package/dist/api/note-fields-api.js +1 -24
- package/dist/api/notes-api.js +0 -20
- package/dist/api/organization-fields-api.js +6 -29
- package/dist/api/organization-relationships-api.js +5 -28
- package/dist/api/organizations-api.js +19 -42
- package/dist/api/permission-sets-api.js +3 -26
- package/dist/api/person-fields-api.js +0 -20
- package/dist/api/persons-api.js +21 -44
- package/dist/api/pipelines-api.js +8 -31
- package/dist/api/product-fields-api.js +6 -29
- package/dist/api/products-api.js +12 -35
- package/dist/api/project-templates-api.js +4 -27
- package/dist/api/projects-api.js +14 -37
- package/dist/api/recents-api.js +1 -24
- package/dist/api/roles-api.js +12 -35
- package/dist/api/stages-api.js +7 -30
- package/dist/api/subscriptions-api.js +9 -32
- package/dist/api/tasks-api.js +5 -28
- package/dist/api/user-connections-api.js +1 -24
- package/dist/api/user-settings-api.js +1 -24
- package/dist/api/users-api.js +10 -33
- package/dist/api/webhooks-api.js +0 -20
- package/dist/base.js +26 -0
- package/dist/common.d.ts +0 -1
- package/dist/common.js +1 -2
- package/dist/configuration.d.ts +1 -0
- package/dist/configuration.js +8 -2
- package/dist/esm/api/activities-api.js +0 -23
- package/dist/esm/api/activity-fields-api.js +0 -23
- package/dist/esm/api/activity-types-api.js +0 -20
- package/dist/esm/api/billing-api.js +0 -23
- package/dist/esm/api/call-logs-api.js +0 -23
- package/dist/esm/api/channels-api.js +0 -23
- package/dist/esm/api/currencies-api.js +0 -23
- package/dist/esm/api/deal-fields-api.js +0 -23
- package/dist/esm/api/deals-api.js +0 -23
- package/dist/esm/api/files-api.js +0 -23
- package/dist/esm/api/filters-api.js +0 -23
- package/dist/esm/api/goals-api.js +0 -23
- package/dist/esm/api/item-search-api.js +0 -23
- package/dist/esm/api/lead-labels-api.js +0 -20
- package/dist/esm/api/lead-sources-api.js +0 -23
- package/dist/esm/api/leads-api.js +0 -23
- package/dist/esm/api/legacy-teams-api.js +0 -23
- package/dist/esm/api/mailbox-api.js +0 -23
- package/dist/esm/api/note-fields-api.js +0 -23
- package/dist/esm/api/notes-api.js +0 -20
- package/dist/esm/api/organization-fields-api.js +0 -23
- package/dist/esm/api/organization-relationships-api.js +0 -23
- package/dist/esm/api/organizations-api.js +0 -23
- package/dist/esm/api/permission-sets-api.js +0 -23
- package/dist/esm/api/person-fields-api.js +0 -20
- package/dist/esm/api/persons-api.js +0 -23
- package/dist/esm/api/pipelines-api.js +0 -23
- package/dist/esm/api/product-fields-api.js +0 -23
- package/dist/esm/api/products-api.js +0 -23
- package/dist/esm/api/project-templates-api.js +0 -23
- package/dist/esm/api/projects-api.js +0 -23
- package/dist/esm/api/recents-api.js +0 -23
- package/dist/esm/api/roles-api.js +0 -23
- package/dist/esm/api/stages-api.js +0 -23
- package/dist/esm/api/subscriptions-api.js +0 -23
- package/dist/esm/api/tasks-api.js +0 -23
- package/dist/esm/api/user-connections-api.js +0 -23
- package/dist/esm/api/user-settings-api.js +0 -23
- package/dist/esm/api/users-api.js +0 -23
- package/dist/esm/api/webhooks-api.js +0 -20
- package/dist/esm/base.js +26 -0
- package/dist/esm/common.d.ts +0 -1
- package/dist/esm/common.js +0 -1
- package/dist/esm/configuration.d.ts +1 -0
- package/dist/esm/configuration.js +8 -2
- package/docs/AddWebhookRequest.md +1 -1
- package/docs/BasicDeal.md +3 -0
- package/docs/CallLogObject.md +2 -1
- package/docs/DealParticipantsChangelog.md +12 -0
- package/docs/DealsApi.md +74 -8
- package/docs/FiltersApi.md +4 -1
- package/docs/GetDeal.md +1 -1
- package/docs/GetDealRelatedObjects.md +11 -0
- package/docs/GetDealsRelatedObjects.md +3 -3
- package/docs/ItemSearchApi.md +2 -2
- package/docs/LeadsApi.md +4 -1
- package/docs/MailboxApi.md +2 -2
- package/docs/MeetingsApi.md +118 -0
- package/docs/NewDeal.md +3 -0
- package/docs/OrganizationsApi.md +10 -4
- package/docs/ParticipantsChangelog.md +11 -0
- package/docs/ParticipantsChangelogItem.md +12 -0
- package/docs/PersonsApi.md +14 -5
- package/docs/PostDealParticipants.md +1 -1
- package/docs/PostDealParticipantsRelatedObjects.md +10 -0
- package/docs/ProductsApi.md +2 -2
- package/docs/RecentsApi.md +2 -2
- package/docs/ResponseCallLogObject.md +2 -1
- package/docs/UpdateDealRequest.md +3 -0
- package/docs/UserProviderLinkCreateRequest.md +12 -0
- package/docs/UserProviderLinkErrorResponse.md +10 -0
- package/docs/UserProviderLinkSuccessResponse.md +10 -0
- package/docs/UserProviderLinkSuccessResponseData.md +9 -0
- package/docs/UsersApi.md +2 -2
- package/migration.md +309 -0
- package/package.json +3 -3
- package/src/api/MeetingsApi.js +181 -0
- package/src/model/GetDealRelatedObjects.js +101 -0
- package/src/model/PostDealParticipantsRelatedObjects.js +90 -0
- package/src/model/UserProviderLinkCreateRequest.js +120 -0
- package/src/model/UserProviderLinkErrorResponse.js +90 -0
- package/src/model/UserProviderLinkSuccessResponse.js +90 -0
- package/src/model/UserProviderLinkSuccessResponseData.js +79 -0
- package/test/functional/access-token.test.js +5 -5
- package/test/functional/authorisation.test.js +5 -8
package/migration.md
ADDED
@@ -0,0 +1,309 @@
|
|
1
|
+
### Breaking changes
|
2
|
+
|
3
|
+
- Suggested nodejs version is 18
|
4
|
+
- Function signatures have changed from the previous version of the sdk. Now each function takes a strongly typed root object that contains all the parameters needed such as id and request payload, where in the previous version those were seperate function params
|
5
|
+
|
6
|
+
|
7
|
+
Example functions change:
|
8
|
+
|
9
|
+
- Previous version:
|
10
|
+
|
11
|
+
```
|
12
|
+
|
13
|
+
await dealsApi.addDeal({
|
14
|
+
title: 'My First Deal',
|
15
|
+
});
|
16
|
+
|
17
|
+
await dealsApi.updateDeal(1, {
|
18
|
+
title: 'Updated Title',
|
19
|
+
});
|
20
|
+
|
21
|
+
|
22
|
+
await api.getDeal(1);
|
23
|
+
|
24
|
+
```
|
25
|
+
|
26
|
+
- New version:
|
27
|
+
```
|
28
|
+
await dealsApi.addDeal({
|
29
|
+
AddDealRequest: {
|
30
|
+
title: 'My First Deal',
|
31
|
+
},
|
32
|
+
});
|
33
|
+
|
34
|
+
await dealsApi.updateDeal({
|
35
|
+
id: 1,
|
36
|
+
UpdateDealRequest: {
|
37
|
+
title: 'Updated Title',
|
38
|
+
},
|
39
|
+
});
|
40
|
+
|
41
|
+
await dealsApi.getDeal({
|
42
|
+
id : 1
|
43
|
+
})
|
44
|
+
|
45
|
+
await dealsApi.deleteDeal({
|
46
|
+
id : 1
|
47
|
+
})
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
## Installation
|
52
|
+
|
53
|
+
```
|
54
|
+
npm i pipedrive@22.3.1-rc.3
|
55
|
+
```
|
56
|
+
|
57
|
+
## API Reference
|
58
|
+
|
59
|
+
The Pipedrive RESTful API Reference can be found at https://developers.pipedrive.com/docs/api/v1.
|
60
|
+
Pipedrive API’s core concepts for its usage can be found in our [Developer documentation](https://pipedrive.readme.io/docs/core-api-concepts-about-pipedrive-api).
|
61
|
+
|
62
|
+
## How to use it?
|
63
|
+
|
64
|
+
### With a pre-set API token
|
65
|
+
|
66
|
+
You can retrieve the api_token from your existing Pipedrive account’s settings page. A step-by-step guide is available [here](https://pipedrive.readme.io/docs/how-to-find-the-api-token).
|
67
|
+
|
68
|
+
```typescript
|
69
|
+
import express from "express";
|
70
|
+
import { Configuration, DealsApi } from "pipedrive";
|
71
|
+
|
72
|
+
const app = express();
|
73
|
+
|
74
|
+
const PORT = 3000;
|
75
|
+
|
76
|
+
// Configure Client with API key authorization
|
77
|
+
const apiConfig = new Configuration({
|
78
|
+
apiKey: "YOUR_API_TOKEN_HERE",
|
79
|
+
});
|
80
|
+
|
81
|
+
app.listen(PORT, () => {
|
82
|
+
console.log(`Listening on port ${PORT}`);
|
83
|
+
});
|
84
|
+
|
85
|
+
app.get("/", async (req, res) => {
|
86
|
+
const dealsApi = new DealsApi(apiConfig);
|
87
|
+
const response = await dealsApi.getDeals();
|
88
|
+
const { data: deals } = response;
|
89
|
+
|
90
|
+
res.send(deals);
|
91
|
+
});
|
92
|
+
```
|
93
|
+
|
94
|
+
### With OAuth 2
|
95
|
+
|
96
|
+
If you would like to use an OAuth access token for making API calls, then make sure the API key described in the previous section is not set or is set to an empty string. If both API token and OAuth access token are set, then the API token takes precedence.
|
97
|
+
|
98
|
+
To set up authentication in the API client, you need the following information. You can receive the necessary client tokens through a Sandbox account (get it [here](https://developers.pipedrive.com/start-here)) and generate the tokens (detailed steps [here](https://pipedrive.readme.io/docs/marketplace-manager#section-how-to-get-your-client-id-and-client-secret)).
|
99
|
+
|
100
|
+
| Parameter | Description |
|
101
|
+
| ------------ | -------------------------------------------- |
|
102
|
+
| clientId | OAuth 2 Client ID |
|
103
|
+
| clientSecret | OAuth 2 Client Secret |
|
104
|
+
| redirectUri | OAuth 2 Redirection endpoint or Callback Uri |
|
105
|
+
|
106
|
+
Next, initialize the API client as follows:
|
107
|
+
|
108
|
+
```typescript
|
109
|
+
import { OAuth2Configuration, Configuration } from 'pipedrive';
|
110
|
+
|
111
|
+
// Configuration parameters and credentials
|
112
|
+
const oauth2 = new OAuth2Configuration({
|
113
|
+
clientId: "clientId", // OAuth 2 Client ID
|
114
|
+
clientSecret: "clientSecret", // OAuth 2 Client Secret
|
115
|
+
redirectUri: 'redirectUri' // OAuth 2 Redirection endpoint or Callback Uri
|
116
|
+
});
|
117
|
+
|
118
|
+
const apiConfig = new Configuration({
|
119
|
+
accessToken: oauth2.getAccessToken,
|
120
|
+
basePath: oauth2.basePath,
|
121
|
+
});
|
122
|
+
|
123
|
+
```
|
124
|
+
|
125
|
+
You must now authorize the client.
|
126
|
+
|
127
|
+
### Authorizing your client
|
128
|
+
|
129
|
+
Your application must obtain user authorization before it can execute an endpoint call. The SDK uses OAuth 2.0 authorization to obtain a user's consent to perform an API request on the user's behalf. Details about how the OAuth2.0 flow works in Pipedrive, how long tokens are valid, and more, can be found [here](https://pipedrive.readme.io/docs/marketplace-oauth-authorization).
|
130
|
+
|
131
|
+
#### 1. Obtaining user consent
|
132
|
+
|
133
|
+
To obtain user's consent, you must redirect the user to the authorization page. The `authorizationUrl` returns the URL to the authorization page.
|
134
|
+
|
135
|
+
```typescript
|
136
|
+
// open up the authUrl in the browser
|
137
|
+
const authUrl = oauth2.authorizationUrl;
|
138
|
+
```
|
139
|
+
|
140
|
+
#### 2. Handle the OAuth server response
|
141
|
+
|
142
|
+
Once the user responds to the consent request, the OAuth 2.0 server responds to your application's access request by using the URL specified in the request.
|
143
|
+
|
144
|
+
If the user approves the request, the authorization code will be sent as the `code` query string:
|
145
|
+
|
146
|
+
```
|
147
|
+
https://example.com/oauth/callback?code=XXXXXXXXXXXXXXXXXXXXXXXXX
|
148
|
+
```
|
149
|
+
|
150
|
+
If the user does not approve the request, the response contains an `error` query string:
|
151
|
+
|
152
|
+
```
|
153
|
+
https://example.com/oauth/callback?error=access_denied
|
154
|
+
```
|
155
|
+
|
156
|
+
#### 3. Authorize the client using the code
|
157
|
+
|
158
|
+
After the server receives the code, it can exchange this for an _access token_. The access token is an object containing information for authorizing the client and refreshing the token itself. In the API client all the access token fields are held separately in the `OAuth2Configuration` class. Additionally access token expiration time as an `OAuth2Configuration.expiresAt` field is calculated. It is measured in the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
|
159
|
+
|
160
|
+
```typescript
|
161
|
+
const token = await oauth2.authorize(code);
|
162
|
+
```
|
163
|
+
|
164
|
+
The Node.js SDK supports only promises. So, the authorize call returns a promise.
|
165
|
+
|
166
|
+
### Refreshing token
|
167
|
+
|
168
|
+
Access tokens may expire after sometime, if it necessary you can do it manually.
|
169
|
+
|
170
|
+
```typescript
|
171
|
+
const newToken = await oauth2.tokenRefresh();
|
172
|
+
```
|
173
|
+
|
174
|
+
If the access token expires, the SDK will attempt to automatically refresh it before the next endpoint call which requires authentication.
|
175
|
+
|
176
|
+
### Storing an access token for reuse
|
177
|
+
|
178
|
+
It is recommended that you store the access token for reuse.
|
179
|
+
|
180
|
+
This code snippet stores the access token in a session for an express application. It uses the [cookie-parser](https://www.npmjs.com/package/cookie-parser) and [cookie-session](https://www.npmjs.com/package/cookie-session) npm packages for storing the access token.
|
181
|
+
|
182
|
+
```typescript
|
183
|
+
import express from "express";
|
184
|
+
import cookieParse from "cookie-parser";
|
185
|
+
import cookeSession from "cookie-session";
|
186
|
+
import { Configuration, DealsApi, OAuth2Configuration } from "pipedrive";
|
187
|
+
|
188
|
+
const app = express();
|
189
|
+
|
190
|
+
app.use(cookieParser());
|
191
|
+
app.use(cookieSession({
|
192
|
+
name: "session",
|
193
|
+
keys: ["key1"]
|
194
|
+
}));
|
195
|
+
|
196
|
+
...
|
197
|
+
|
198
|
+
// store access token in the session
|
199
|
+
// note that this is only the access token field value not the whole token object
|
200
|
+
req.session.accessToken = await oauth.getAccessToken();
|
201
|
+
```
|
202
|
+
|
203
|
+
However, since the SDK will attempt to automatically refresh the access token when it expires,
|
204
|
+
it is recommended that you register a **token update callback** to detect any change to the access token.
|
205
|
+
|
206
|
+
```typescript
|
207
|
+
oauth2.onTokenUpdate = function (token) {
|
208
|
+
// getting the updated token
|
209
|
+
// here the token is an object, you can store the whole object or extract fields into separate values
|
210
|
+
req.session.token = token;
|
211
|
+
};
|
212
|
+
```
|
213
|
+
|
214
|
+
The token update callback will be fired upon authorization as well as token refresh.
|
215
|
+
|
216
|
+
### Complete example
|
217
|
+
|
218
|
+
This example demonstrates an express application (which uses [cookie-parser](https://www.npmjs.com/package/cookie-parser) and [cookie-session](https://www.npmjs.com/package/cookie-session)) for handling session persistence.
|
219
|
+
|
220
|
+
In this example, there are 2 endpoints. The base endpoint `'/'` first checks if the token is stored in the session.
|
221
|
+
If it is, API endpoints can be called using the corresponding SDK controllers.
|
222
|
+
|
223
|
+
However, if the token is not set in the session, then authorization URL is built and opened up.
|
224
|
+
The response comes back at the `'/callback'` endpoint, which uses the code to authorize the client and store the token in the session.
|
225
|
+
It then redirects back to the base endpoint for calling endpoints from the SDK.
|
226
|
+
|
227
|
+
```typescript
|
228
|
+
|
229
|
+
import express from "express";
|
230
|
+
import { Configuration, DealsApi, OAuth2Configuration } from "pipedrive";
|
231
|
+
import cookieParser from "cookie-parser";
|
232
|
+
import cookieSession from "cookie-session";
|
233
|
+
|
234
|
+
const app = express();
|
235
|
+
|
236
|
+
app.use(cookieParser());
|
237
|
+
app.use(cookieSession({
|
238
|
+
name: "session",
|
239
|
+
keys: ["key1"]
|
240
|
+
}));
|
241
|
+
|
242
|
+
const PORT = 3000;
|
243
|
+
|
244
|
+
|
245
|
+
const oauth2 = new OAuth2Configuration({
|
246
|
+
clientId: "clientId", // OAuth 2 Client ID
|
247
|
+
clientSecret: "clientSecret", // OAuth 2 Client Secret
|
248
|
+
redirectUri: 'redirectUri' // OAuth 2 Redirection endpoint or Callback Uri
|
249
|
+
});
|
250
|
+
|
251
|
+
app.listen(PORT, () => {
|
252
|
+
console.log(`Listening on port ${PORT}`);
|
253
|
+
});
|
254
|
+
|
255
|
+
app.get('/', async (req, res) => {
|
256
|
+
try {
|
257
|
+
// method will handle return null if token is not available in the session
|
258
|
+
const token = oauth2.updateToken(req.session?.accessToken);
|
259
|
+
|
260
|
+
if (!token) {
|
261
|
+
const authUrl = oauth2.authorizationUrl;
|
262
|
+
return res.redirect(authUrl);
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
const apiConfig = new Configuration({
|
267
|
+
accessToken: oauth2.getAccessToken,
|
268
|
+
basePath: oauth2.basePath,
|
269
|
+
});
|
270
|
+
|
271
|
+
const dealsApi = new DealsApi(apiConfig)
|
272
|
+
|
273
|
+
const response = await dealsApi.getDeals();
|
274
|
+
const { data: deals } = response;
|
275
|
+
|
276
|
+
return res.send(deals);
|
277
|
+
} catch (error){
|
278
|
+
console.error(error)
|
279
|
+
return res.status(500).send(error)
|
280
|
+
}
|
281
|
+
});
|
282
|
+
|
283
|
+
app.get('/callback', async (req, res) => {
|
284
|
+
try {
|
285
|
+
const authCode = req.query.code as string;
|
286
|
+
const newAccessToken = await oauth2.authorize(authCode);
|
287
|
+
|
288
|
+
req.session.accessToken = newAccessToken;
|
289
|
+
return res.redirect("/");
|
290
|
+
}catch (error) {
|
291
|
+
console.error(error)
|
292
|
+
return res.status(500).send(error)
|
293
|
+
}
|
294
|
+
});
|
295
|
+
|
296
|
+
```
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pipedrive",
|
3
|
-
"version": "22.3.1-rc.
|
3
|
+
"version": "22.3.1-rc.4",
|
4
4
|
"description": "Pipedrive REST client for NodeJS",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://developers.pipedrive.com",
|
@@ -29,7 +29,6 @@
|
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
31
|
"axios": "^1.3.3",
|
32
|
-
"eslint-plugin-jest": "^27.6.0",
|
33
32
|
"qs": "^6.11.0"
|
34
33
|
},
|
35
34
|
"devDependencies": {
|
@@ -78,6 +77,7 @@
|
|
78
77
|
"shelljs": "^0.8.4",
|
79
78
|
"sinon": "^7.2.0",
|
80
79
|
"ts-jest": "^29.1.1",
|
81
|
-
"typescript": "^4.9.5"
|
80
|
+
"typescript": "^4.9.5",
|
81
|
+
"eslint-plugin-jest": "^27.6.0"
|
82
82
|
}
|
83
83
|
}
|
@@ -0,0 +1,181 @@
|
|
1
|
+
/**
|
2
|
+
* Pipedrive API v1
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
4
|
+
*
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
6
|
+
*
|
7
|
+
*
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
9
|
+
* https://openapi-generator.tech
|
10
|
+
* Do not edit the class manually.
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
|
14
|
+
|
15
|
+
import ApiClient from "../ApiClient";
|
16
|
+
import UserProviderLinkCreateRequest from '../model/UserProviderLinkCreateRequest';
|
17
|
+
import UserProviderLinkErrorResponse from '../model/UserProviderLinkErrorResponse';
|
18
|
+
import UserProviderLinkSuccessResponse from '../model/UserProviderLinkSuccessResponse';
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Meetings service.
|
22
|
+
* @module api/MeetingsApi
|
23
|
+
* @version 1.0.0
|
24
|
+
*/
|
25
|
+
export default class MeetingsApi {
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Constructs a new MeetingsApi.
|
29
|
+
* @alias module:api/MeetingsApi
|
30
|
+
* @class
|
31
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
32
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
33
|
+
*/
|
34
|
+
constructor(apiClient) {
|
35
|
+
this.apiClient = apiClient;
|
36
|
+
}
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Delete the link between a user and the installed video call integration
|
42
|
+
* A video calling provider must call this endpoint to remove the link between a user and the installed video calling app.
|
43
|
+
* @param {String} id Unique identifier linking a user to the installed integration
|
44
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserProviderLinkSuccessResponse} and HTTP response
|
45
|
+
*/
|
46
|
+
deleteUserProviderLinkWithHttpInfo(id) {
|
47
|
+
const opts = {}
|
48
|
+
let postBody = null;
|
49
|
+
|
50
|
+
// verify the required parameter 'id' is set
|
51
|
+
if (id === undefined || id === null) {
|
52
|
+
throw new Error("Missing the required parameter 'id' when calling deleteUserProviderLink");
|
53
|
+
}
|
54
|
+
|
55
|
+
let pathParams = {
|
56
|
+
'id': id,
|
57
|
+
};
|
58
|
+
let queryParams = {
|
59
|
+
};
|
60
|
+
let headerParams = {
|
61
|
+
};
|
62
|
+
let formParams = {
|
63
|
+
};
|
64
|
+
|
65
|
+
let formParamArray = [
|
66
|
+
];
|
67
|
+
|
68
|
+
let contentTypes = [];
|
69
|
+
const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
|
70
|
+
const isJSON = contentTypes.includes('application/json');
|
71
|
+
|
72
|
+
if (isJSON) {
|
73
|
+
postBody = { ...postBody, ...opts };
|
74
|
+
} else if (isURLEncoded) {
|
75
|
+
for (let key in opts) {
|
76
|
+
if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
|
77
|
+
formParams[key] = opts[key];
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
let authNames = ['api_key', 'oauth2', ];
|
83
|
+
let accepts = ['application/json', ];
|
84
|
+
let returnType = UserProviderLinkSuccessResponse;
|
85
|
+
return this.apiClient.callApi(
|
86
|
+
'/meetings/userProviderLinks/{id}', 'DELETE',
|
87
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
88
|
+
authNames, contentTypes, accepts, returnType, null
|
89
|
+
);
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Delete the link between a user and the installed video call integration
|
94
|
+
* A video calling provider must call this endpoint to remove the link between a user and the installed video calling app.
|
95
|
+
* @param {String} id Unique identifier linking a user to the installed integration
|
96
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserProviderLinkSuccessResponse}
|
97
|
+
*/
|
98
|
+
deleteUserProviderLink(id) {
|
99
|
+
return this.deleteUserProviderLinkWithHttpInfo(id)
|
100
|
+
.then(function(response_and_data) {
|
101
|
+
return response_and_data;
|
102
|
+
});
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Link a user with the installed video call integration
|
108
|
+
* A video calling provider must call this endpoint after a user has installed the video calling app so that the new user's information is sent.
|
109
|
+
* @param {Object} opts Optional parameters
|
110
|
+
* @param {module:model/UserProviderLinkCreateRequest} opts.userProviderLinkCreateRequest
|
111
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserProviderLinkSuccessResponse} and HTTP response
|
112
|
+
*/
|
113
|
+
saveUserProviderLinkWithHttpInfo(opts) {
|
114
|
+
opts = opts || {};
|
115
|
+
let postBody = opts['userProviderLinkCreateRequest'];
|
116
|
+
|
117
|
+
if (opts['user_provider_id'] === undefined || opts['user_provider_id'] === null) {
|
118
|
+
throw new Error("Missing the required parameter 'user_provider_id' when calling saveUserProviderLink");
|
119
|
+
}
|
120
|
+
if (opts['user_id'] === undefined || opts['user_id'] === null) {
|
121
|
+
throw new Error("Missing the required parameter 'user_id' when calling saveUserProviderLink");
|
122
|
+
}
|
123
|
+
if (opts['company_id'] === undefined || opts['company_id'] === null) {
|
124
|
+
throw new Error("Missing the required parameter 'company_id' when calling saveUserProviderLink");
|
125
|
+
}
|
126
|
+
if (opts['marketplace_client_id'] === undefined || opts['marketplace_client_id'] === null) {
|
127
|
+
throw new Error("Missing the required parameter 'marketplace_client_id' when calling saveUserProviderLink");
|
128
|
+
}
|
129
|
+
|
130
|
+
let pathParams = {
|
131
|
+
};
|
132
|
+
let queryParams = {
|
133
|
+
};
|
134
|
+
let headerParams = {
|
135
|
+
};
|
136
|
+
let formParams = {
|
137
|
+
};
|
138
|
+
|
139
|
+
let formParamArray = [
|
140
|
+
];
|
141
|
+
|
142
|
+
let contentTypes = ['application/json', ];
|
143
|
+
const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
|
144
|
+
const isJSON = contentTypes.includes('application/json');
|
145
|
+
|
146
|
+
if (isJSON) {
|
147
|
+
postBody = { ...postBody, ...opts };
|
148
|
+
} else if (isURLEncoded) {
|
149
|
+
for (let key in opts) {
|
150
|
+
if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
|
151
|
+
formParams[key] = opts[key];
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
let authNames = ['api_key', 'oauth2', ];
|
157
|
+
let accepts = ['application/json', ];
|
158
|
+
let returnType = UserProviderLinkSuccessResponse;
|
159
|
+
return this.apiClient.callApi(
|
160
|
+
'/meetings/userProviderLinks', 'POST',
|
161
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
162
|
+
authNames, contentTypes, accepts, returnType, null
|
163
|
+
);
|
164
|
+
}
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Link a user with the installed video call integration
|
168
|
+
* A video calling provider must call this endpoint after a user has installed the video calling app so that the new user's information is sent.
|
169
|
+
* @param {Object} opts Optional parameters
|
170
|
+
* @param {module:model/UserProviderLinkCreateRequest} opts.userProviderLinkCreateRequest
|
171
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserProviderLinkSuccessResponse}
|
172
|
+
*/
|
173
|
+
saveUserProviderLink(opts) {
|
174
|
+
return this.saveUserProviderLinkWithHttpInfo(opts)
|
175
|
+
.then(function(response_and_data) {
|
176
|
+
return response_and_data;
|
177
|
+
});
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
/**
|
2
|
+
* Pipedrive API v1
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
4
|
+
*
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
6
|
+
*
|
7
|
+
*
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
9
|
+
* https://openapi-generator.tech
|
10
|
+
* Do not edit the class manually.
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
|
14
|
+
import ApiClient from '../ApiClient';
|
15
|
+
import RelatedOrganizationDataWithActiveFlag from './RelatedOrganizationDataWithActiveFlag';
|
16
|
+
import RelatedPersonDataWithActiveFlag from './RelatedPersonDataWithActiveFlag';
|
17
|
+
import RelatedUserData from './RelatedUserData';
|
18
|
+
|
19
|
+
/**
|
20
|
+
* The GetDealRelatedObjects model module.
|
21
|
+
* @module model/GetDealRelatedObjects
|
22
|
+
* @version 1.0.0
|
23
|
+
*/
|
24
|
+
class GetDealRelatedObjects {
|
25
|
+
/**
|
26
|
+
* Constructs a new <code>GetDealRelatedObjects</code>.
|
27
|
+
* @alias module:model/GetDealRelatedObjects
|
28
|
+
*/
|
29
|
+
constructor() {
|
30
|
+
|
31
|
+
GetDealRelatedObjects.initialize(this);
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Initializes the fields of this object.
|
36
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
37
|
+
* Only for internal use.
|
38
|
+
*/
|
39
|
+
static initialize(obj) {
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Constructs a <code>GetDealRelatedObjects</code> from a plain JavaScript object, optionally creating a new instance.
|
44
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
45
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
46
|
+
* @param {module:model/GetDealRelatedObjects} obj Optional instance to populate.
|
47
|
+
* @return {module:model/GetDealRelatedObjects} The populated <code>GetDealRelatedObjects</code> instance.
|
48
|
+
*/
|
49
|
+
static constructFromObject(data, obj) {
|
50
|
+
if (data) {
|
51
|
+
obj = obj || new GetDealRelatedObjects();
|
52
|
+
|
53
|
+
if (data.hasOwnProperty('user')) {
|
54
|
+
obj['user'] = RelatedUserData.constructFromObject(data['user']);
|
55
|
+
|
56
|
+
delete data['user'];
|
57
|
+
}
|
58
|
+
if (data.hasOwnProperty('person')) {
|
59
|
+
obj['person'] = RelatedPersonDataWithActiveFlag.constructFromObject(data['person']);
|
60
|
+
|
61
|
+
delete data['person'];
|
62
|
+
}
|
63
|
+
if (data.hasOwnProperty('organization')) {
|
64
|
+
obj['organization'] = RelatedOrganizationDataWithActiveFlag.constructFromObject(data['organization']);
|
65
|
+
|
66
|
+
delete data['organization'];
|
67
|
+
}
|
68
|
+
|
69
|
+
if (Object.keys(data).length > 0) {
|
70
|
+
Object.assign(obj, data);
|
71
|
+
}
|
72
|
+
|
73
|
+
}
|
74
|
+
return obj;
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* @member {module:model/RelatedUserData} user
|
82
|
+
*/
|
83
|
+
GetDealRelatedObjects.prototype['user'] = undefined;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* @member {module:model/RelatedPersonDataWithActiveFlag} person
|
87
|
+
*/
|
88
|
+
GetDealRelatedObjects.prototype['person'] = undefined;
|
89
|
+
|
90
|
+
/**
|
91
|
+
* @member {module:model/RelatedOrganizationDataWithActiveFlag} organization
|
92
|
+
*/
|
93
|
+
GetDealRelatedObjects.prototype['organization'] = undefined;
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
export default GetDealRelatedObjects;
|
101
|
+
|
@@ -0,0 +1,90 @@
|
|
1
|
+
/**
|
2
|
+
* Pipedrive API v1
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
4
|
+
*
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
6
|
+
*
|
7
|
+
*
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
9
|
+
* https://openapi-generator.tech
|
10
|
+
* Do not edit the class manually.
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
|
14
|
+
import ApiClient from '../ApiClient';
|
15
|
+
import RelatedPersonDataWithActiveFlag from './RelatedPersonDataWithActiveFlag';
|
16
|
+
import RelatedUserData from './RelatedUserData';
|
17
|
+
|
18
|
+
/**
|
19
|
+
* The PostDealParticipantsRelatedObjects model module.
|
20
|
+
* @module model/PostDealParticipantsRelatedObjects
|
21
|
+
* @version 1.0.0
|
22
|
+
*/
|
23
|
+
class PostDealParticipantsRelatedObjects {
|
24
|
+
/**
|
25
|
+
* Constructs a new <code>PostDealParticipantsRelatedObjects</code>.
|
26
|
+
* @alias module:model/PostDealParticipantsRelatedObjects
|
27
|
+
*/
|
28
|
+
constructor() {
|
29
|
+
|
30
|
+
PostDealParticipantsRelatedObjects.initialize(this);
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Initializes the fields of this object.
|
35
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
36
|
+
* Only for internal use.
|
37
|
+
*/
|
38
|
+
static initialize(obj) {
|
39
|
+
}
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Constructs a <code>PostDealParticipantsRelatedObjects</code> from a plain JavaScript object, optionally creating a new instance.
|
43
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
44
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
45
|
+
* @param {module:model/PostDealParticipantsRelatedObjects} obj Optional instance to populate.
|
46
|
+
* @return {module:model/PostDealParticipantsRelatedObjects} The populated <code>PostDealParticipantsRelatedObjects</code> instance.
|
47
|
+
*/
|
48
|
+
static constructFromObject(data, obj) {
|
49
|
+
if (data) {
|
50
|
+
obj = obj || new PostDealParticipantsRelatedObjects();
|
51
|
+
|
52
|
+
if (data.hasOwnProperty('user')) {
|
53
|
+
obj['user'] = RelatedUserData.constructFromObject(data['user']);
|
54
|
+
|
55
|
+
delete data['user'];
|
56
|
+
}
|
57
|
+
if (data.hasOwnProperty('person')) {
|
58
|
+
obj['person'] = RelatedPersonDataWithActiveFlag.constructFromObject(data['person']);
|
59
|
+
|
60
|
+
delete data['person'];
|
61
|
+
}
|
62
|
+
|
63
|
+
if (Object.keys(data).length > 0) {
|
64
|
+
Object.assign(obj, data);
|
65
|
+
}
|
66
|
+
|
67
|
+
}
|
68
|
+
return obj;
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* @member {module:model/RelatedUserData} user
|
76
|
+
*/
|
77
|
+
PostDealParticipantsRelatedObjects.prototype['user'] = undefined;
|
78
|
+
|
79
|
+
/**
|
80
|
+
* @member {module:model/RelatedPersonDataWithActiveFlag} person
|
81
|
+
*/
|
82
|
+
PostDealParticipantsRelatedObjects.prototype['person'] = undefined;
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
export default PostDealParticipantsRelatedObjects;
|
90
|
+
|