From 1be4db6032dece403b26f27f41f0d5121cd63a20 Mon Sep 17 00:00:00 2001 From: Renato Selenica <137913282+renatosrounds@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:53:38 +0200 Subject: [PATCH] Added new about the developer section to the `app` method (#693) * Added new about developer section * added about developer section data * improved structure of the about developer data * simplified address * (WIP) changed naming, structure, added tests, README and types * (WIP) improved name of the test * updated test app * small text fix --- README.md | 4 ++++ index.d.ts | 4 ++++ lib/app.js | 9 +++++++++ test/lib.app.js | 10 ++++++++++ 4 files changed, 27 insertions(+) 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 c778f82a..1bd082ea 100644 --- a/lib/app.js +++ b/lib/app.js @@ -110,6 +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], + 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) => { + 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..bc3a17d0 100644 --- a/test/lib.app.js +++ b/test/lib.app.js @@ -109,6 +109,16 @@ describe('App method', () => { }); }); + it('should check the developer legal information from the "About the developer" section', () => { + return gplay.app({ appId: 'com.soundcloud.android' }) + .then((app) => { + assert.equal(app.developerLegalName, 'SoundCloud Global Limited & Co. KG'); + assert.equal(app.developerLegalEmail, 'playstore@soundcloud.com'); + assert.equal(app.developerLegalAddress, 'Rheinsberger Str. 76 /, 10115 Berlin, Germany'); + assert.equal(app.developerLegalPhoneNumber, '+49 1573 5982119'); + }); + }); + it('should properly parse a VARY android version', () => { return gplay.app({ appId: 'com.facebook.katana' }) .then((app) => {