sendinblue/APIv3-typescript-library

Type problem, object is expected in params for sendSmtpEmailMessageVersions model

Closed this issue · 8 comments

Hello,

In the sendSmtpEmailMessageVersions model the params key expects { [key: string]: object; } type but according to the documentation, this kind of type { [key: string]: string; } is expected. Is it a little mistake in the model or is there any good reason for typing it as it is ?

'params'?: { [key: string]: object; };

Thanks 🙂

Hi,

Thanks for reporting it, I see it can create build errors. I think this error is fixed in the latest beta release. Can you please try this beta release https://www.npmjs.com/package/sib-api-v3-typescript/v/2.2.3-beta.1, if it's working well on your side?

Hi,

Yes, thanks it is working now but I do not think that replacing object type by any type is a good solution, cannot we use string type ?

Hi,

Another thing, I cannot use your package without adding @types/request in my package dev dependencies, even with the 2.2.3-beta.1 version.

node_modules/sib-api-v3-typescript/api/accountApi.ts(13,34): error TS7016: Could not find a declaration file for module 'request'. '/usr/src/app/back/node_modules/request/index.js' implicitly has an 'any' type.

It might be something you have to add in your package dev dependencies right ?

Hi @loic-couharde

I do not think that replacing object type by any type is a good solution, cannot we use string type?

I will look into it

node_modules/sib-api-v3-typescript/api/accountApi.ts(13,34): error TS7016: Could not find a declaration file for module 'request'. '/usr/src/app/back/node_modules/request/index.js' implicitly has an 'any' type.

This error should not come in the v2.2.3-beta.1 as there is no accountApi.ts file. Can you please check if you are using the correct version?

Hi @aayush-sib

This error should not come in the v2.2.3-beta.1 as there is no accountApi.ts file. Can you please check if you are using the correct version?

Yes I pasted an error from the latest stable package but I encountered the same error in the beta one.

Can you please share the error from the beta one, so that I can check at my end also?

Yes,

node_modules/sib-api-v3-typescript/api.d.ts:2:34 - error TS7016: Could not find a declaration file for module 'request'. '/Users/loic.couharde/Projects/teemeo/back/custom-server/node_modules/request/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request` if it exists or add a new declaration (.d.ts) file containing `declare module 'request';`

2 import * as localVarRequest from 'request';

Hi,

@loic-couharde, I tried to replicate the issue at my end but was unable to replicate it. Also, this package is already added in dev dependencies.