Open eugene-kim opened 4 years ago
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.
@eshanholtz is there a source of truth one can use as a reference for the Message Resource schema? It would help anyone looking to create a PR or have a temporary work around for the type discrepancies.
The source of truth is internal (and only has error_code
marked as nullable). I've submitted an internal ticket to get the others updated as nullable (ref MSG-6006), but changes are also needed in the code generator to handle null-ables properly.
UPDATE: fixed this by deleting my package-lock.json
file ... looks like it was a DefinitelyTyped
@types/express
issue ...
—
Seeing similar TypeScript
compilation errors when deploying firebase
functions:
Type 'P' does not satisfy the constraint 'Params'.
Type 'P' is not assignable to type 'ParamsArray'.
relating to
extends core.ErrorRequestHandler<P, ResBody, ReqBody, ReqQuery> { }
interface Request<P = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.Request<P, ResBody, ReqBody, ReqQuery> { }
interface RequestHandler<P = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.RequestHandler<P, ResBody, ReqBody, ReqQuery> { }
Downgrading from 3.49.1
to 3.49.0
does not seem to help ...
Deploying functions to a Node.js 10
environment ...
Probably worth noting that firebase
still uses tslint
, not eslint
for Typescript
projects
Couple more mistyped fields on MessageInstance
:
from
should bestring | null
dateSent
should be Date | null
10 months open now folks. Additionally, MessageInstance
is all over this codebase, but there's no direct export in the Twilio lib, so importing the type is problematic and requires a path import, which is fragile and an antipattern.
+1
+1
not fixed yet
Issue Summary
The
MessageInstance
class looks as if it contains incorrect types for some of its instance properties. Properties such aserrorCode
anderrorMessage
can be nullable according to the documentation so I would think that the type oferrorCode
should benumber | null
rather than simplynumber
as it currently is.Props types that seem incorrect:
errorCode
: should benumber | null
rather thannumber
errorMessage
: should bestring | null
rather thanstring
price
: should bestring | null
rather thanstring
priceUnit
: should bestring | null
rather thanstring
messagingServiceSid
: should bestring | null
rather thanstring
(From the docs: "The SID of the Messaging Service used with the message. The value is null if a Messaging Service was not used.")Code Snippet
Compare the type of the instance property
errorCode
hereto the sample JSON response in the documentation:
Exception/Log
Technical details:
v3.49.0
12.8.3