Skip to content

Conversation

@dfabulich
Copy link
Owner

Fixes #4.

@tkafka Do you have an opinion of whether we should return the raw TSV text or whether we should convert the TSV to a JSON object first?

This PR returns a JSON object in a fake {data: []} object, like this:

{ "data": [
      Provider: 'APPLE',
      'Provider Country': 'US',
      SKU: 'MYSKU',
      Developer: 'My Developer Name',
      Title: 'My App Name',
      Version: '1.0.0',
      'Product Type Identifier': '7F',
      Units: '1',
      'Developer Proceeds': '0.00',
      'Begin Date': '06/15/2024',
      'End Date': '06/15/2024',
      'Customer Currency': 'CHF',
      'Country Code': 'CH',
      'Currency of Proceeds': 'CHF',
      'Apple Identifier': '1363309257',
      'Customer Price': '0.00',
      'Promo Code': ' ',
      'Parent Identifier': ' ',
      Subscription: ' ',
      Period: ' ',
      Category: 'Games',
      CMB: '',
      Device: 'iPad',
      'Supported Platforms': 'iOS',
      'Proceeds Reason': ' ',
      'Preserved Pricing': ' ',
      Client: ' ',
      'Order Type': ' '
    }
] }

That way, you can write code like this:

const {data: report} = await read(url);
console.log(report.length);

But maybe I should just return the raw TSV as a giant string. Or at least not make a fake data key, just return the report results inline.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for requests that return gzip

2 participants