mux-node-sdk icon indicating copy to clipboard operation
mux-node-sdk copied to clipboard

[Bug] Playback Restrictions API does not return expected types

Open danzool opened this issue 3 years ago • 1 comments

I am using some of the Playback Restrictions API with TypeScript. I am noticing that when I call the following on PlaybackRestrictions:

list(): Promise<ListPlaybackRestrictionsResponse>;

...instead of returning ListPlaybackRestrictionsResponse (which has data nested), it returns data: Array<PlaybackRestriction>; directly. This means as a workaround, I need to cast it to unknown and then over to Array<PlaybackRestriction>.

The same is true for:

create(restriction: CreatePlaybackRestrictionParams): Promise<PlaybackRestrictionResponse>;

...as it returns a promise that resolves to PlaybackRestriction rather than an actual PlaybackRestrictionResponse.

This may be true of other elements of the PlaybackRestrictions API, but I have not verified that.

danzool avatar Sep 04 '22 01:09 danzool

The version in my dependency is "@mux/mux-node": "^6.2.0",.

danzool avatar Sep 04 '22 01:09 danzool

Can you please try version 7.0.0 and let me know if that solves the issue. Thanks!

jaredsmith avatar Nov 22 '22 14:11 jaredsmith

@danzool, can you please try with v7.1.0 and let us know if that solves your problem?

jaredsmith avatar Feb 07 '23 20:02 jaredsmith

Closing, as I think this has been addressed. If you still encounter errors, please open another issue.

jaredsmith avatar Feb 13 '23 15:02 jaredsmith