beardon / apple-reporter Goto Github PK
View Code? Open in Web Editor NEWPromise-based Apple iTunes Connect Reporter for Node.js
Promise-based Apple iTunes Connect Reporter for Node.js
It seems like Reporter no longer allow email / password and requires access token.
I've tried adding an accesstoken
param here to replace username & password, and it works fine for me.
I get this error while trying to retrieveAccessToken, I only get this error when my password is correct (I get a password error when it's not good)
Unhandled rejection AppleReporterError: An unexpected error occurred. Try again later.
at xmlErrorThrower (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\apple-reporter\dist\util.js:27:11)
at tryCatcher (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\promise.js:517:31)
at Promise._settlePromise (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\promise.js:699:18)
at _drainQueueStep (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\async.js:138:12)
at _drainQueue (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\async.js:131:9)
at Async._drainQueues (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (D:\Sandoche\00 - Projects\John-doe-accountant\node_modules\bluebird\js\release\async.js:17:14)
at processImmediate (internal/timers.js:439:21)
It happens when I run this code
const AppleReporter = require("apple-reporter");
const reporter = new AppleReporter({
userid: "xxx",
password: "xxx",
tokenOptions: {
forceRetrieve: true,
generateNewIfNeeded: true
}
});
reporter.retrieveAccessToken({ forceRetrieve: true, generateNewIfNeeded: true })
.then(({ token, isNew }) => {
console.log(`Token: ${token}, was newly generated: ${isNew}`);
});
It was working perfectly yesterday, and stopped working suddenly.
Hey,
I'm fetching data like described in the docs:
reporter.Sales.getReport({
vendorNumber: 234567,
reportType: 'Sales',
reportSubType: 'Summary',
dateType: 'Daily',
date: '20170121'
})
.then((report) => {
console.log(report)
})
But my response is just a String
with the data instead of an object. The docs say it should be an object created with xml2js... Is this a bug or how can I further manipulate my data?
The finance doesn't work at all and return the error 212
"An unexpected error occurred. Try again later."
Hey, I'm getting this error:
Unhandled rejection AppleReporterError: You have access to more than one account. Please specify an account number in your properties file or on the command line. To see a list of accounts, run the command getAccounts.
After running getAccount()
I get my account numbers, but how do I specify a single one? I tried this but it doesn't work:
const reporter = new AppleReporter({
userid: '[email protected]',
password: 'mypassword',
account: 12345
});
It was working totally fine yesterday, but today when I try to download my report, I get the following error:
AppleReporterError: Please include the version parameter. The latest version for this report is 1_1.
I suspect Apple finally shutdown 1_0 (2 months late?) as written in the documentation:
A workaround to make it work locally was to:
reportVersion: "1_1"
to my reporter.Sales.getReport
optionsreportVersion
to the parameters list index.js line 35from:
this.getReport = create('getReport', ['vendorNumber', 'reportType', 'reportSubType', 'dateType', 'date',]);
to:
this.getReport = create('getReport', ['vendorNumber', 'reportType', 'reportSubType', 'dateType', 'date','reportVersion']);
As a result, the downloaded CSV is different (new fields), but this works.
This is probably not a good solution, but I don't know your codebase enough to fix the issue properly; this API update probably also impact other endpoints, but I'm not using any other one so no idea which one has to change.
Happy to help with a PR with some guidance.
This error appears when trying to download event report.
"Sales and Trends Reporter is currently available." FetchError: invalid response body at: https://reportingitc-reporter.apple.com/reportservice/sales/v1 reason: incorrect header check at Gunzip.<anonymous> (/Users/cmg/projects/gcp_vendor_apple/reporter/node_modules/node-fetch/lib/body.js:123:11) at Gunzip.emit (events.js:208:15) at Zlib.zlibOnError [as onerror] (zlib.js:171:8) { name: 'FetchError', message: 'invalid response body at: https://reportingitc-reporter.apple.com/reportservice/sales/v1 reason: incorrect header check', type: 'system', errno: 'Z_DATA_ERROR', code: 'Z_DATA_ERROR' }
I believe this is due to the file format changes from apple,
https://itunespartner.apple.com/en/music/news/100002692
Btw thanks for the great work with this lib!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.