From 92fd64ff2da59678cc1a56046053f37e7d59ed10 Mon Sep 17 00:00:00 2001 From: BiruLyuPG Date: Thu, 10 Nov 2022 15:43:37 -0800 Subject: [PATCH 1/2] Fix usePassword option --- lib/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 86f1142..5d141c9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -132,7 +132,7 @@ class Reporter { let newTokenWasGenerated = false; - return this.fetch(this.config.salesUrl, '[Sales.viewToken]', true) + return this.fetch(this.config.salesUrl, '[Sales.viewToken]', { usePassword: true }) .then((result) => { if (result.ViewToken.Message != null) return null; @@ -154,13 +154,13 @@ class Reporter { const url = this.config.salesUrl; // Doesn't matter const params = '[Sales.generateToken]'; - return this.fetchRaw(url, params, true) + return this.fetchRaw(url, params, { usePassword: true }) .then((intermediateResponse) => { // To complete this kind of request, we have to make another request with some // particular URL params, referencing the service request id passed in these response headers const requestId = intermediateResponse.headers.service_request_id; // Do a regular fetch so the result will get parsed - return this.fetchRaw(`${url}?isExistingToken=Y&requestId=${requestId}`, params, true); + return this.fetchRaw(`${url}?isExistingToken=Y&requestId=${requestId}`, params, { usePassword: true }); }) .then((response) => Reporter.handleFetchResponse(this.config.mode, response)) .then((accessTokenResponse) => accessTokenResponse.ViewToken.AccessToken[0]); From 246e7e07970abc1427404c32386928310009cdad Mon Sep 17 00:00:00 2001 From: BiruLyuPG Date: Thu, 10 Nov 2022 15:44:08 -0800 Subject: [PATCH 2/2] Bump Version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dceb078..abaad35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "apple-reporter", - "version": "2.2.2", + "version": "2.2.3", "description": "Promise-based Apple iTunes Connect Reporter", "main": "dist/index.js", "files": [