Skip to content

Commit

Permalink
Release v22.3.1-rc.4 from PR #518
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins User committed Feb 12, 2024
2 parents 5538b9e + f757e82 commit da2dee8
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 32 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ For public Changelog covering all changes done to Pipedrive’s API, webhooks an

## [Unreleased]

## [22.3.1-rc.4] - 2024-02-12

## [22.3.1-rc.3] - 2024-01-08
- Add `lead_id` as an acceptable body parameter for the `POST /v1/callLogs` endpoint
- Add TypeScript Support

## [22.5.0] - 2024-02-02
### Added
- Added documentation for new endpoint `/deals/{id}/participantsChangelog`.

## [22.4.0] - 2024-01-05
### Added
- Added documentation for `/meetings/userProviderLinks` endpoints

## [22.3.1-rc.2] - 2023-12-22

Expand Down Expand Up @@ -595,7 +605,8 @@ structure
* Fixed `GET /goal/:id/results` error handling in case when there are no existing stages connected to specified goal
* Fixed typo in lead example response (`crrency` to `currency`)

[Unreleased]: https://github.com/pipedrive/api-docs/compare/v22.3.1-rc.3...HEAD
[Unreleased]: https://github.com/pipedrive/api-docs/compare/v22.3.1-rc.4...HEAD
[22.3.1-rc.4]: https://github.com/pipedrive/api-docs/compare/v22.3.1-rc.3...v22.3.1-rc.4
[22.3.1-rc.3]: https://github.com/pipedrive/api-docs/compare/v22.4.0...v22.3.1-rc.3
[22.4.0]: https://github.com/pipedrive/api-docs/compare/v22.3.0...v22.4.0
[22.3.0]: https://github.com/pipedrive/api-docs/compare/v22.2.0...v22.3.0
Expand Down
51 changes: 27 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,62 +191,65 @@ const app = express();

app.use(cookieParser());
app.use(cookieSession({
name: "session",
keys: ["key1"]
name: "session",
keys: ["key1"]
}));

const PORT = 3000;


const oauth2 = new OAuth2Configuration({
clientId: "clientId", // OAuth 2 Client ID
clientSecret: "clientSecret", // OAuth 2 Client Secret
redirectUri: 'redirectUri' // OAuth 2 Redirection endpoint or Callback Uri
clientId: "clientId", // OAuth 2 Client ID
clientSecret: "clientSecret", // OAuth 2 Client Secret
redirectUri: 'redirectUri' // OAuth 2 Redirection endpoint or Callback Uri
});

app.listen(PORT, () => {
console.log(`Listening on port ${PORT}`);
});

app.get('/', async (req, res) => {
try {
try {
// method will handle return null if token is not available in the session
const token = oauth2.updateToken(req.session?.accessToken);

if (!token) {
const authUrl = oauth2.authorizationUrl;
return res.redirect(authUrl);
if (!token) {
const authUrl = oauth2.authorizationUrl;
return res.redirect(authUrl);
}


const apiConfig = new Configuration({
accessToken: oauth2.getAccessToken,
basePath: oauth2.basePath,
accessToken: oauth2.getAccessToken,
basePath: oauth2.basePath,
});

// token is already set in the session
// now make API calls as required
// client will automatically refresh the token when it expires and call the token update callback
const dealsApi = new DealsApi(apiConfig)

const response = await dealsApi.getDeals();
const { data: deals } = response;

return res.send(deals);
} catch (error){
} catch (error){
console.error(error)
return res.status(500).send(error)
}
}
});

app.get('/callback', async (req, res) => {
try {
const authCode = req.query.code as string;
const newAccessToken = await oauth2.authorize(authCode);

req.session.accessToken = newAccessToken;
return res.redirect("/");
}catch (error) {
console.error(error)
return res.status(500).send(error)
}
try {
const authCode = req.query.code as string;
const newAccessToken = await oauth2.authorize(authCode);

req.session.accessToken = newAccessToken;
return res.redirect("/");
}catch (error) {
console.error(error)
return res.status(500).send(error)
}
});

```
Expand Down Expand Up @@ -547,7 +550,7 @@ WebhooksApi | getWebhooks | **GET** /webhooks | Get all Webhooks
- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://oauth.pipedrive.com/oauth/authorize
- **Scopes**:
- **Scopes**:
- base: Read settings of the authorized user and currencies in an account
- deals:read: Read most of the data about deals and related entities - deal fields, products, followers, participants; all notes, files, filters, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal)
- deals:full: Create, read, update and delete deals, its participants and followers; all files, notes, and filters. It also includes read access to deal fields, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal)
Expand Down
10 changes: 9 additions & 1 deletion base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ export interface RequestArgs {
* Axios interceptor to add the SDK version as a User-Agent header
* */
globalAxios.interceptors.request.use(function (config) {
const version = require("../package.json").version;
let version;

try {
version = require('../package.json').version;
} catch (error) {
version = '22.x';
}

config.headers['User-Agent'] = `Pipedrive-SDK-Javascript-${version}`;

return config;
});

Expand Down
9 changes: 8 additions & 1 deletion configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,14 @@ export class OAuth2Configuration {
}

private getUserAgent = () => {
const version = require("../package.json").version;
let version;

try {
version = require('../package.json').version;
} catch (error) {
version = '22.x';
}

return `Pipedrive-SDK-Javascript-${version}`;
};

Expand Down
2 changes: 1 addition & 1 deletion docs/AddWebhookRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Name | Type | Description | Notes
**subscriptionUrl** | **String** | A full, valid, publicly accessible URL which determines where to send the notifications. Please note that you cannot use Pipedrive API endpoints as the `subscription_url` and the chosen URL must not redirect to another link. |
**eventAction** | **String** | The type of action to receive notifications about. Wildcard will match all supported actions. |
**eventObject** | **String** | The type of object to receive notifications about. Wildcard will match all supported objects. |
**userId** | **Number** | The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a users permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`. | [optional]
**userId** | **Number** | The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a user's permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`. | [optional]
**httpAuthUser** | **String** | The HTTP basic auth username of the subscription URL endpoint (if required) | [optional]
**httpAuthPassword** | **String** | The HTTP basic auth password of the subscription URL endpoint (if required) | [optional]
**version** | **String** | The webhook's version | [optional] [default to '1.0']
Expand Down
3 changes: 3 additions & 0 deletions docs/BasicDeal.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**wonTime** | **String** | The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`. | [optional]
**lostTime** | **String** | The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`. | [optional]
**closeTime** | **String** | The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional]
**expectedCloseDate** | **Date** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional]
**probability** | **Number** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional]
**lostReason** | **String** | The optional message about why the deal was lost (to be used when status = lost) | [optional]
Expand Down
12 changes: 12 additions & 0 deletions docs/DealParticipantsChangelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Pipedrive.DealParticipantsChangelog

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**actorUserId** | **Number** | The ID of the user | [optional]
**personId** | **Number** | The ID of the person | [optional]
**action** | **String** | Deal participant action type | [optional]
**time** | **String** | The deal participant action log time | [optional]


60 changes: 60 additions & 0 deletions docs/DealsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Method | HTTP request | Description
[**getDealFollowers**](DealsApi.md#getDealFollowers) | **GET** /deals/{id}/followers | List followers of a deal
[**getDealMailMessages**](DealsApi.md#getDealMailMessages) | **GET** /deals/{id}/mailMessages | List mail messages associated with a deal
[**getDealParticipants**](DealsApi.md#getDealParticipants) | **GET** /deals/{id}/participants | List participants of a deal
[**getDealParticipantsChangelog**](DealsApi.md#getDealParticipantsChangelog) | **GET** /deals/{id}/participantsChangelog | List updates about participants of a deal
[**getDealPersons**](DealsApi.md#getDealPersons) | **GET** /deals/{id}/persons | List all persons associated with a deal
[**getDealProducts**](DealsApi.md#getDealProducts) | **GET** /deals/{id}/products | List products attached to a deal
[**getDealUpdates**](DealsApi.md#getDealUpdates) | **GET** /deals/{id}/flow | List updates about a deal
Expand Down Expand Up @@ -933,6 +934,65 @@ Name | Type | Description | Notes
- **Accept**: application/json


## getDealParticipantsChangelog

> ParticipantsChangelog getDealParticipantsChangelog(id, opts)
List updates about participants of a deal

List updates about participants of a deal. This is a cursor-paginated endpoint. For more information, please refer to our documentation on <a href=\"https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=\"_blank\" rel=\"noopener noreferrer\">pagination</a>.

### Example

```javascript
import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.DealsApi(apiClient);
let id = 56; // Number | The ID of the deal
let opts = {
'limit': 56, // Number | Items shown per page
'cursor': "cursor_example" // String | For pagination, the marker (an opaque string value) representing the first item on the next page
};
apiInstance.getDealParticipantsChangelog(id, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});

```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Number**| The ID of the deal |
**limit** | **Number**| Items shown per page | [optional]
**cursor** | **String**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional]

### Return type

[**ParticipantsChangelog**](ParticipantsChangelog.md)

### Authorization

[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## getDealPersons

> ListPersonsResponse getDealPersons(id, opts)
Expand Down
3 changes: 3 additions & 0 deletions docs/NewDeal.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Name | Type | Description | Notes
**stageId** | **Number** | The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. | [optional]
**status** | **String** | open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. | [optional]
**addTime** | **String** | The optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional]
**wonTime** | **String** | The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`. | [optional]
**lostTime** | **String** | The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`. | [optional]
**closeTime** | **String** | The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional]
**expectedCloseDate** | **Date** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional]
**probability** | **Number** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional]
**lostReason** | **String** | The optional message about why the deal was lost (to be used when status = lost) | [optional]
Expand Down
11 changes: 11 additions & 0 deletions docs/ParticipantsChangelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Pipedrive.ParticipantsChangelog

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **Boolean** | If the request was successful or not | [optional]
**data** | [**[ParticipantsChangelogItem]**](ParticipantsChangelogItem.md) | The array of participant changelog | [optional]
**additionalData** | [**AdditionalData**](AdditionalData.md) | | [optional]


12 changes: 12 additions & 0 deletions docs/ParticipantsChangelogItem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Pipedrive.ParticipantsChangelogItem

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**actorUserId** | **Number** | The ID of the user | [optional]
**personId** | **Number** | The ID of the person | [optional]
**action** | **String** | Deal participant action type | [optional]
**time** | **String** | The deal participant action log time | [optional]


3 changes: 3 additions & 0 deletions docs/UpdateDealRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Name | Type | Description | Notes
**pipelineId** | **Number** | The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. | [optional]
**stageId** | **Number** | The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. | [optional]
**status** | **String** | open = Open, won = Won, lost = Lost, deleted = Deleted. | [optional]
**wonTime** | **String** | The optional date and time of changing the deal status as won in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Won. Can not be used together with `lost_time`. | [optional]
**lostTime** | **String** | The optional date and time of changing the deal status as lost in UTC. Format: YYYY-MM-DD HH:MM:SS. Can be set only when deal `status` is already Lost. Can not be used together with `won_time`. | [optional]
**closeTime** | **String** | The optional date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional]
**expectedCloseDate** | **Date** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional]
**probability** | **Number** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional]
**lostReason** | **String** | The optional message about why the deal was lost (to be used when status = lost) | [optional]
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pipedrive",
"version": "22.3.1-rc.3",
"version": "22.3.1-rc.4",
"description": "Pipedrive REST client for NodeJS",
"license": "MIT",
"homepage": "https://developers.pipedrive.com",
Expand Down

0 comments on commit da2dee8

Please sign in to comment.