facebook / facebook-nodejs-business-sdk

Node.js SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
489 stars 226 forks source link

Getting a problematic warning when using the latest @types version #290

Open amit-toren opened 2 months ago

amit-toren commented 2 months ago

Which SDK version are you using?

20.0.0 (18.0.4 for @types/facebook-nodejs-business-sdk)

What's the issue?

Getting this issue when running tsc on my project: /@types+facebook-nodejs-business-sdk@18.0.0/node_modules/@types/facebook-nodejs-business-sdk/src/objects/businessdataapi/event-request.d.ts (37,9): The return type of a 'get' accessor must be assignable to its 'set' accessor type Type 'undefined' is not assignable to type 'string'.

The issue stems from these lines of code:

/**
* Gets the partner_agent for the request
* Allows you to specify the platform from which the event is sent e.g. Zapier
*/
get partner_agent(): string | null | undefined;
/**
* Sets the partner_agent for the request
* Allows you to specify the platform from which the event is sent e.g. Zapier
* @param {String} partner_agent String value for the partner agent
*/
set partner_agent(partner_agent: string);

As you can see, the types don't match, as opposed to the previous @types version (15.0.2):

get partner_agent(): string | null | undefined;
set partner_agent(partner_agent: string | null | undefined);

Where they do match.