pipedrive / client-nodejs

Pipedrive API client for NodeJS
MIT License
205 stars 82 forks source link

clarification on certain breaking changes and lack of docs #249

Closed ephraimd closed 2 years ago

ephraimd commented 2 years ago

Hi guys! Excellent job you're doing here, this project makes my day so much easier.

Some issues though,

To update a person, it was formally

const resp = await controller.updateAPerson();

but now, it just

const resp = await controller.updatePerson();

https://github.com/pipedrive/client-nodejs/blob/master/docs/PersonsApi.md#updatePerson

i understand this is a change in new versions, but i've not updated the library version yet because there's so much work to do on that. So, the new README doc seems not be good for me right now.

i've tried looking for the older README doc that contains the const resp = await controller.updateAPerson(); version, but couldn't quite locate it.

Guys, please help here as i have to work with the older doc for the next couple of weeks while we incrementally transition to the new version of the library.

Thank you very much

BarbecueSilver commented 2 years ago

First of all: Thanks as well from my side for providing the client for nodejs :+1:

In general I can say, that we have pretty much the same problem.

Not related to the specific problem @ephraimd mentioned updateAPerson, but we are heavily trying to get version 12 to run. We can't. We are getting the following error: async () => await organizationFieldsApi.getOrganizationFields() Cannot read property 'res' of undefined TypeError: Cannot read property 'res' of undefined our code looks like this:

import pipedrive = require('pipedrive');
...
pipedrive.ApiClient.instance.authentications.api_key.apiKey = SOME_API_KEY;
...
const organizationFieldsApi = new pipedrive.OrganizationFieldsApi();
...
async () => await organizationFieldsApi.getOrganizationFields(),

We tried to stick to the code provided by the README.md. Currently we are out of ideas. We don't know what exactly breaks the code. Either our code is wrong or if something in the package itself.

Could you provide a migration guide in the future, when you introduce breaking changes? The CHANGELOG.md you started since v12 is a very good :+1: and I would really like to see it being maintained.

dmitriyeff commented 2 years ago

@ephraimd hi! Thank you for the kind words.

What version of the client-nodejs are you currently using? For the v11 you can find updateAPerson method here: https://github.com/pipedrive/client-nodejs/tree/v11.0.0#-updateaperson

dmitriyeff commented 2 years ago

OrganizationFieldsApi

If you are using ES6 modules, then importing file should look like this: import Pipedrive from 'pipedrive', if commonJS module system is used, then: const Pipedrive = require('pipedrive').

Consider this example: https://github.com/pipedrive/client-nodejs/blob/master/docs/OrganizationFieldsApi.md#example-4

I hope this (answer) helps you.

ephraimd commented 2 years ago

@ephraimd hi! Thank you for the kind words.

What version of the client-nodejs are you currently using? For the v11 you can find updateAPerson method here: https://github.com/pipedrive/client-nodejs/tree/v11.0.0#-updateaperson

Thank you for your response! Sorry this came in late