Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build 118 - version-prerelease #585

Merged
merged 6 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/cicd_npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish NPM Packages

on:
pull_request:
types:
- labeled

jobs:
publish:
if: ${{ github.event.label.name == 'npm-ready-for-publish' }}
uses: pipedrive-actions/github-actions-workflows/.github/workflows/reusable_cicd-npm-publish.yml@master
with:
revision: ${{ github.event.pull_request.head.ref }}
secrets: inherit
9 changes: 8 additions & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ models/base-team.ts
models/basic-deal-product-request-all-of.ts
models/basic-deal-product-request.ts
models/basic-deal.ts
models/basic-deal1.ts
models/basic-goal-request.ts
models/basic-organization.ts
models/basic-organization1.ts
models/basic-person-request-email-inner.ts
models/basic-person-request.ts
models/call-log-bad-request-response.ts
Expand Down Expand Up @@ -422,6 +424,8 @@ models/get-duplicated-deal-response.ts
models/get-field-response-all-of.ts
models/get-field-response.ts
models/get-fields-response-all-of-additional-data.ts
models/get-fields-response-all-of-data-inner-all-of.ts
models/get-fields-response-all-of-data-inner-all-of1.ts
models/get-fields-response-all-of-data-inner.ts
models/get-fields-response-all-of.ts
models/get-fields-response.ts
Expand Down Expand Up @@ -479,7 +483,8 @@ models/get-mail-thread-response1.ts
models/get-merged-deal-response-data-all-of.ts
models/get-merged-deal-response-data.ts
models/get-merged-deal-response.ts
models/get-note-fields-response-all-of-data-inner-options-inner.ts
models/get-note-fields-response-all-of-data-inner-all-of-options-inner.ts
models/get-note-fields-response-all-of-data-inner-all-of.ts
models/get-note-fields-response-all-of-data-inner.ts
models/get-note-fields-response-all-of.ts
models/get-note-fields-response.ts
Expand Down Expand Up @@ -574,6 +579,7 @@ models/get-product-attachment-details-response-data.ts
models/get-product-attachment-details-response.ts
models/get-product-field-response-data.ts
models/get-product-field-response.ts
models/get-product-fields-response-data-inner.ts
models/get-product-fields-response.ts
models/get-product-followers-response-all-of-data-inner.ts
models/get-product-followers-response-all-of.ts
Expand Down Expand Up @@ -752,6 +758,7 @@ models/product-field-all-of.ts
models/product-field-all-of1.ts
models/product-field.ts
models/product-request.ts
models/product-request1.ts
models/project-put-plan-item-body-object.ts
models/project-response-object-all-of.ts
models/project-response-object.ts
Expand Down
80 changes: 66 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,57 @@ The file format of it is based on [Keep a Changelog](http://keepachangelog.com/e
For public Changelog covering all changes done to Pipedrive’s API, webhooks and app extensions platforms, see [public Changelog](https://pipedrive.readme.io/docs/changelog) with discussion area in [Developers Community](https://devcommunity.pipedrive.com/c/documentation/changelog/19).

## [Unreleased]
### Added
- Add "additionalProperties" to entities with custom fields
### Changed
- Updated the code examples in the README for the JavaScript SDK
### Added
- Add "custom_fields" query paremeter to GET /api/v2/products


## [23.2.5-rc.3] - 2024-09-02
### Updated
- Fix optional fields in the TypeScript interfaces

## [23.4.3] - 2024-11-22
### Added
- Add "additionalProperties" to entities with custom fields
### Changed
- Updated the code examples in the README for the JavaScript SDK
### Added
- Add "custom_fields" query paremeter to GET /api/v2/products

## [23.4.2] - 2024-10-31
### Changed
- Updated the code examples in the README for the JavaScript SDK
### Added
- Add "custom_fields" query paremeter to GET /api/v2/products

## [23.4.1] - 2024-10-09

## [23.2.5-rc.2] - 2024-09-03
### Changed
- Migrate publish flow from Jenkins to GitHub Actions
- Add devops-tooling as owner for .github/workflows/cicd_*

## [23.4.0] - 2024-09-24
### Changed
- Added the field "notes" to product prices in the body and response for v1 and v2
- Added the field "overhead_cost" to the product variation prices in the response for v1
- Added the field "direct_cost" to the product variation prices in the response and body for v2

## [23.3.0] - 2024-09-23
### Added
- Add documentation for installments functionality:
- `POST` `/v1/deals/{id}/products` endpoint
- `PUT` `/v1/deals/{id}/products/{product_attachment_id}` endpoint
- `DELETE` `/v1/deals/{id}/products/{product_attachment_id}` endpoint
- `POST` `/v2/deals/{id}/products` endpoint
- `PATCH` `/v2/deals/{id}/products/{product_attachment_id}` endpoint
- `DELETE` `/v2/deals/{id}/products/{product_attachment_id}` endpoint

## [23.2.6] - 2024-09-06
### Fixed
- Updated default values for "billing_frequency_cycles", "billing_start_date" fields
- Deleted unused file with long name

## [23.2.5-rc.1] - 2024-09-02
### Updated
Expand Down Expand Up @@ -199,7 +246,7 @@ Based on this [Changelog post](https://developers.pipedrive.com/changelog/post/r
## [19.0.1] - 2023-04-27
### Changed
- Updated `label` field data type in response examples from number -> string for Deals related endpoints
Changed `active_flag`, `enabled_flag`, and `selectable` body parameters and response examples data type from number -> boolean for all Products related endpoints
Changed `active_flag`, `enabled_flag`, and `selectable` body parameters and response examples data type from number -> boolean for all Products related endpoints

## [19.0.0] - 2023-04-04
### Removed
Expand Down Expand Up @@ -271,12 +318,12 @@ Based on this [Changelog post](https://developers.pipedrive.com/changelog/post/b

## [18.0.3] - 2023-01-11
### Updated dependencies
- Updated `json5` from 2.2.1 to 2.2.3
- Updated `qs` from 6.9.3 to 6.11.0
- Updated `formidable` from 2.0.1 to 2.1.1
- Updated `decode-uri-component` from 0.2.0 to 0.2.2
- Updated `minimatch` from 3.0.4 to 3.1.2
- Updated `mocha` from 8.4.0 to 10.1.0
- Updated `json5` from 2.2.1 to 2.2.3
- Updated `qs` from 6.9.3 to 6.11.0
- Updated `formidable` from 2.0.1 to 2.1.1
- Updated `decode-uri-component` from 0.2.0 to 0.2.2
- Updated `minimatch` from 3.0.4 to 3.1.2
- Updated `mocha` from 8.4.0 to 10.1.0

## [18.0.2] - 2022-12-22
### Fixed
Expand All @@ -289,7 +336,7 @@ Based on this [Changelog post](https://developers.pipedrive.com/changelog/post/b
## 18.0.0
### Security
- Removed `.instance` static property from sdk client to prevent race conditions when using it as a singleton
See the updated examples in the readme to get an overview of the necessary code changes.
See the updated examples in the readme to get an overview of the necessary code changes.

## 17.5.2
### Changed
Expand Down Expand Up @@ -438,9 +485,9 @@ See the updated examples in the readme to get an overview of the necessary code
- Renamed file with long name and it's class.

Old name:
AnyOfRecentsActivityRecentsActivityTypeRecentsDealRecentsFileRecentsFilterRecentsNoteRecentsPersonRecentsOrganizationRecentsPipelineRecentsProductRecentsStageRecentsUser
AnyOfRecentsActivityRecentsActivityTypeRecentsDealRecentsFileRecentsFilterRecentsNoteRecentsPersonRecentsOrganizationRecentsPipelineRecentsProductRecentsStageRecentsUser
New name:
AnyOfRecents
AnyOfRecents

## 14.0.1
### Fixed
Expand Down Expand Up @@ -615,7 +662,7 @@ Those fields will be formatted as "2020-07-13" instead of "2020-07-13T00:00:00.0
## 12.2.0
### Changed
- Changed notes and comments endpoints additional_data to match the correct pagination response
structure
structure
* GET /notes
* GET /notes/:id/comments

Expand Down Expand Up @@ -685,8 +732,13 @@ 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/v23.2.5-rc.2...HEAD
[23.2.5-rc.2]: https://github.com/pipedrive/api-docs/compare/v23.2.5...v23.2.5-rc.2
[23.4.3]: https://github.com/pipedrive/api-docs/compare/v23.4.2...v23.4.3
[23.4.2]: https://github.com/pipedrive/api-docs/compare/v23.4.1...v23.4.2
[23.4.1]: https://github.com/pipedrive/api-docs/compare/v23.4.0...v23.4.1
[23.4.0]: https://github.com/pipedrive/api-docs/compare/v23.3.0...v23.4.0
[23.3.0]: https://github.com/pipedrive/api-docs/compare/v23.2.5...v23.3.0
[23.2.5]: https://github.com/pipedrive/api-docs/compare/v23.2.4...v23.2.5
[23.2.4]: https://github.com/pipedrive/api-docs/compare/v23.2.3...v23.2.4
[23.2.3]: https://github.com/pipedrive/api-docs/compare/v23.2.2...v23.2.3
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/cicd_* @pipedrive/devops-tooling
3 changes: 0 additions & 3 deletions Jenkinsfile

This file was deleted.

8 changes: 4 additions & 4 deletions api/deals-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration
};
},
/**
* Deletes a product attachment from a deal, using the `product_attachment_id`.
* Deletes a product attachment from a deal, using the `product_attachment_id` Not possible to delete the attached product if the deal has installments associated and the product is the last one enabled
* @summary Delete an attached product from a deal
* @param {number} id The ID of the deal
* @param {number} product_attachment_id The product attachment ID
Expand Down Expand Up @@ -1765,7 +1765,7 @@ export const DealsApiFp = function(configuration?: Configuration) {
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Deletes a product attachment from a deal, using the `product_attachment_id`.
* Deletes a product attachment from a deal, using the `product_attachment_id` Not possible to delete the attached product if the deal has installments associated and the product is the last one enabled
* @summary Delete an attached product from a deal
* @param {number} id The ID of the deal
* @param {number} product_attachment_id The product attachment ID
Expand Down Expand Up @@ -2159,7 +2159,7 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath
return localVarFp.deleteDealParticipant(requestParameters.id, requestParameters.deal_participant_id, ).then((request) => request(axios, basePath));
},
/**
* Deletes a product attachment from a deal, using the `product_attachment_id`.
* Deletes a product attachment from a deal, using the `product_attachment_id` Not possible to delete the attached product if the deal has installments associated and the product is the last one enabled
* @summary Delete an attached product from a deal
* @param {DealsApiDeleteDealProductRequest} requestParameters Request parameters.

Expand Down Expand Up @@ -3365,7 +3365,7 @@ export class DealsApi extends BaseAPI {
}

/**
* Deletes a product attachment from a deal, using the `product_attachment_id`.
* Deletes a product attachment from a deal, using the `product_attachment_id` Not possible to delete the attached product if the deal has installments associated and the product is the last one enabled
* @summary Delete an attached product from a deal
* @param {DealsApiDeleteDealProductRequest} requestParameters Request parameters.

Expand Down
16 changes: 10 additions & 6 deletions configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ export interface Parameters {
export type ParamKey = keyof Parameters;

export class OAuth2Configuration {
public host: string;
public clientId: string;
public clientSecret: string;
public basePath = "";
public onTokenUpdate?: (token: TokenResponse) => void;

private axios = axios.create();
private host: string;
private accessToken: string | null = null;
private refreshToken: string | null = null;
private scope: string | null = null;
private expiresIn = 0; // expiration value in seconds sent by the OAuth server.
private expiresAt = 0; // expiration time as number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.

public onTokenUpdate?: (token: TokenResponse) => void;
private clientId: string;
private clientSecret: string;
private redirectUri: string;
public basePath = "";

constructor(params: Parameters) {
this.clientId = this.validateParam(params, 'clientId');
Expand Down Expand Up @@ -77,6 +77,10 @@ export class OAuth2Configuration {
return this.accessToken!;
};

public shouldRefreshToken = (): boolean => {
return this.expiresAt && Date.now() > this.expiresAt;
}

/**
* Authorizes the authorization code sent by the server and returns OAuth 2 token.
* @param {String} code The authorization code sent by the OAuth server.
Expand Down
2 changes: 1 addition & 1 deletion docs/AddProductRequestBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name | Type | Description | Notes
**selectable** | **Boolean** | Whether this product can be selected in deals or not | [optional] [default to true]
**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner & followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional]
**owner_id** | **Number** | The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used | [optional]
**prices** | **[Object]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. | [optional]
**prices** | **[Object]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional), `notes` (string, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. | [optional]
**billing_frequency** | [**BillingFrequency1**](BillingFrequency1.md) | | [optional]
**billing_frequency_cycles** | **Number** | Only available in Advanced and above plans The number of times the billing frequency repeats for a product in a deal When `billing_frequency` is set to `one-time`, this field must be `null` For all the other values of `billing_frequency`, `null` represents a product billed indefinitely Must be a positive integer less or equal to 312 | [optional]

Expand Down
2 changes: 1 addition & 1 deletion docs/DealProductRequestBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name | Type | Description | Notes
**comments** | **String** | A textual comment associated with this product-deal attachment | [optional]
**tax** | **Number** | The tax percentage | [optional] [default to 0]
**tax_method** | **String** | The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount | [optional]
**enabled_flag** | **Boolean** | Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default | [optional] [default to true]
**enabled_flag** | **Boolean** | Whether the product is enabled for a deal or not This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default Not possible to disable the product if the deal has installments associated and the product is the last one enabled Not possible to enable the product if the deal has installments associated and the product is recurring | [optional] [default to true]



Expand Down
2 changes: 1 addition & 1 deletion docs/DealsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Name | Type | Description | Notes

Delete an attached product from a deal

Deletes a product attachment from a deal, using the `product_attachment_id`.
Deletes a product attachment from a deal, using the `product_attachment_id` Not possible to delete the attached product if the deal has installments associated and the product is the last one enabled

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/FieldsResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **Boolean** | If the response is successful or not | [optional]
**data** | [**[Field]**](Field.md) | | [optional]
**data** | [**[GetField]**](GetField.md) | | [optional]
**additional_data** | [**AdditionalData**](AdditionalData.md) | | [optional]


2 changes: 1 addition & 1 deletion docs/FieldsResponseAllOf.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**[Field]**](Field.md) | | [optional]
**data** | [**[GetField]**](GetField.md) | | [optional]
**additional_data** | [**AdditionalData**](AdditionalData.md) | | [optional]


2 changes: 1 addition & 1 deletion docs/GetAllProductFieldsResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**success** | **Boolean** | If the response is successful or not | [optional]
**data** | [**[ProductField]**](ProductField.md) | Array containing data for all product fields | [optional]
**data** | [**[GetProductField]**](GetProductField.md) | Array containing data for all product fields | [optional]
**additional_data** | **Object** | Additional data for the product field, such as pagination | [optional]


Loading
Loading