Skip to content

Commit

Permalink
Added new about the developer section to the app method (#693)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
renatosrounds authored Oct 16, 2024
1 parent 60261ad commit 1be4db6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<{
Expand Down
9 changes: 9 additions & 0 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
10 changes: 10 additions & 0 deletions test/lib.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 1be4db6

Please sign in to comment.