Type definition mismatch: `groupingSids` in RecordingInstance typed as objects but returns strings
Issue Description
In Twilio SDK 5.5.2, there's a mismatch between TypeScript definitions and actual runtime behavior for the groupingSids property in the RecordingInstance interface. The TypeScript definitions specify groupingSids as Record<string, object>, but at runtime, the values are strings.
TypeScript Definition
// From node_modules/twilio/lib/rest/video/v1/recording.d.ts
export declare class RecordingInstance {
// ...
/**
* A list of SIDs related to the recording. Includes the `room_sid` and `participant_sid`.
*/
groupingSids: Record<string, object>;
// ...
}
Actual Runtime Value
When logging the values from a real API response:
console.error('Debug:', { roomSid: recordings[0].groupingSids.room_sid });
// Output: Debug: { roomSid: 'RM368fba367c70b5de88fb174180ad4a45' }
console.error('Debug:', { participantSid: recording.groupingSids.participant_sid });
// Output: Debug: { participantSid: 'PA82a37dea2c02488621cf0b89d0d69b53' }
Raw JSON response from the API:
"groupingSids": {
"participant_sid": "PA82a37dea2c02488621cf0b89d0d69b53",
"room_sid": "RM368fba367c70b5de88fb174180ad4a45"
}
Impact
This type mismatch causes TypeScript errors when using these values in functions that expect strings, such as:
// Error: Argument of type 'object' is not assignable to parameter of type 'string | Uint8Array<ArrayBufferLike>'
uuidv5(roomSid, uuidv5.URL)
Environment
- Twilio SDK version: 5.5.2
- Node.js version: v22.14.0
- TypeScript version: 5.x
Workaround
Currently using String() to force the correct type:
uuidv5(String(roomSid), uuidv5.URL)
Proposed Fix
Update the type definition to correctly reflect the runtime behavior:
groupingSids: Record<string, string>;
Thank you for your attention to this issue!
Thanks for this issue. We are taking a look here.
I noticed that many occurrences of any have been wrongly replaced with Record<string, object>.
We are working on resolving this. The conversation is going https://github.com/twilio/twilio-node/issues/1076
This has been fixed in 5.7.3 thanks!