plivo-node
plivo-node copied to clipboard
fix: correct typing for transfer method in CallInterface
The types of transfer are incorrect.
According to the docs (and the JSDocs), the methods properties should be optional, and belUrl is required only when legs: "bleg". Currently, this is the only workaround for that:
client.calls.transfer(payload.CallUUID, {
legs: "aleg",
alegMethod: "POST",
alegUrl: url.toString(),
// optional props, bad typings.
blegMethod: undefined as unknown as string,
blegUrl: undefined as unknown as string
});