Regression: Bulk Exports specific-day `fetch()` returns `void` instead of `DayInstance` in 6.1.0

Open Beginner friendly
#1,207 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
node.js, typescript
Domain
api

Research direction

Start with src/rest/bulkexports/v1/export/day.ts, especially fetch and fetchWithHttpInfo, and compare its 6.1.0 behavior with the 6.0.2 implementation. Check the related response handling in src/base/Version.ts and use the TypeScript reproduction to verify that days(day).fetch() returns a DayInstance with redirectTo rather than void or the raw payload.

Written by the indexing model from the issue text.

Description

Summary

6.1.0 contains a regression in the Bulk Exports specific-day resource.

client.bulkexports.v1.exports('Messages').days(day).fetch() is typed as Promise<void> and does not construct a DayInstance at runtime. This breaks use of the documented GET /v1/Exports/{ResourceType}/Days/{Day} endpoint through the SDK.

Affected versions

  • Works in twilio 6.0.2.
  • Fails in twilio 6.1.0.

Reproduction

  1. Install the dependencies in a fresh project:
    npm install twilio@6.1.0 typescript
    
  2. Create index.ts that calls the helper and accesses its redirectTo value:
    import twilio from 'twilio';
    
    async function main() {
      const client = twilio('ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'auth-token');
      const day = await client.bulkexports.v1.exports('Messages').days('2026-08-01').fetch();
      const url = day.redirectTo;
    }
    
  3. Compile the file:
    npx tsc --noEmit index.ts
    

The compiler reports:

TS2339: Property 'redirectTo' does not exist on type 'void'.

This is also a runtime issue: the helper returns the raw parsed API payload rather than a DayInstance. JavaScript consumers may receive a payload with the API field name redirect_to, but cannot read the SDK property redirectTo from its result.

Expected behavior

days(day).fetch() should issue GET /v1/Exports/{ResourceType}/Days/{Day} and resolve to a DayInstance with properties including redirectTo. This is the current documented Node usage for the endpoint: Bulk Export day resource documentation.

Actual behavior

In 6.1.0, the specific-day fetch() is declared as Promise<void> and returns the raw parsed API response rather than a DayInstance. The DayInstance type still defines redirectTo, but the specific-day fetch path does not construct that instance.

Cause

The 6.1.0 generated specific-day resource declares fetch() as Promise<void>. Its implementation returns the raw Version.fetch result without mapping it to a DayInstance. Version.fetch returns the parsed response body, but the specific-day resource's fetchWithHttpInfo explicitly sets body to undefined.

The same 6.1.0 file still declares redirectTo on DayInstance.

In 6.0.2, the equivalent code declares a DayInstance result and maps the response payload into that instance.

Impact

For TypeScript consumers, this causes a compile failure when accessing DayInstance fields such as redirectTo.

For JavaScript consumers, it returns a raw payload rather than the SDK day object and therefore causes a runtime mismatch.

Dominant language
TypeScript
Stars
1.5k
Forks
564
Avg merge
14h 2m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twilio/twilio-node

All issues in twilio/twilio-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.