diff --git a/README.md b/README.md index 8ed12f36..c7f4748a 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,10 @@ Results: developerEmail: 'translate-android-support@google.com', developerWebsite: 'http://support.google.com/translate', developerAddress: '1600 Amphitheatre Parkway, Mountain View 94043', + developerLegalName: undefined, + developerLegalEmail: undefined, + developerLegalAddress: undefined, + developerLegalPhoneNumber: undefined, privacyPolicy: 'http://www.google.com/policies/privacy/', developerInternalID: '5700313618786177705', genre: 'Tools', diff --git a/index.d.ts b/index.d.ts index 083324a8..c2402ae6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -129,6 +129,10 @@ export interface IAppItemFullDetail extends IAppItem { developerEmail: string developerWebsite: string developerAddress: string + developerLegalName: string + developerLegalEmail: string + developerLegalAddress: string + developerLegalPhoneNumber: string genre: string genreId: string categories: Array<{ diff --git a/lib/app.js b/lib/app.js index 4cbb8908..1bd082ea 100644 --- a/lib/app.js +++ b/lib/app.js @@ -110,21 +110,15 @@ const MAPPINGS = { developerEmail: ['ds:5', 1, 2, 69, 1, 0], developerWebsite: ['ds:5', 1, 2, 69, 0, 5, 2], developerAddress: ['ds:5', 1, 2, 69, 2, 0], - aboutDeveloper: { + developerLegalName: ['ds:5', 1, 2, 69, 4, 0], + developerLegalEmail: ['ds:5', 1, 2, 69, 4, 1, 0], + developerLegalAddress: { path: ['ds:5', 1, 2, 69], fun: (searchArray) => { - const name = R.path([4, 0], searchArray); - const email = R.path([4, 1, 0], searchArray); - const address = R.path([4, 2, 0], searchArray).replace(/\n/g, ', '); - const phoneNumber = R.path([4, 3], searchArray); - return { - name, - email, - address, - phoneNumber - }; + return R.path([4, 2, 0], searchArray)?.replace(/\n/g, ', '); } }, + developerLegalPhoneNumber: ['ds:5', 1, 2, 69, 4, 3], privacyPolicy: ['ds:5', 1, 2, 99, 0, 5, 2], developerInternalID: { path: ['ds:5', 1, 2, 68, 1, 4, 2], diff --git a/test/lib.app.js b/test/lib.app.js index 27b04818..9205f07a 100644 --- a/test/lib.app.js +++ b/test/lib.app.js @@ -109,6 +109,16 @@ describe('App method', () => { }); }); + it('should fetch the developer legal address, legal name, email and phone number', () => { + return gplay.app({ appId: 'com.taktak.browser' }) + .then((app) => { + assert.equal(app.developerLegalName, 'AHREFS PTE. LTD.'); + assert.equal(app.developerLegalAddress, '16 Raffles Quay #33-03 Hong Leong Building, Singapore 048581'); + assert.equal(app.developerLegalEmail, 'apps@ahrefs.com'); + assert.equal(app.developerLegalPhoneNumber, '+65 8372 0700'); + }); + }); + it('should properly parse a VARY android version', () => { return gplay.app({ appId: 'com.facebook.katana' }) .then((app) => {