@@ -39,20 +39,50 @@ export class ApplePortalApplicationService
3939 const webSessionCookie = await this . $applePortalSessionService . createWebSession (
4040 contentProviderId
4141 ) ;
42+ const summaries : IApplePortalApplicationSummary [ ] = [ ] ;
43+ await this . getApplicationsByUrl (
44+ webSessionCookie ,
45+ "https://appstoreconnect.apple.com/iris/v1/apps?include=appStoreVersions,prices" ,
46+ summaries
47+ ) ;
48+
49+ return { summaries : summaries } ;
50+ }
51+
52+ private async getApplicationsByUrl (
53+ webSessionCookie : string ,
54+ url : string ,
55+ summaries : IApplePortalApplicationSummary [ ]
56+ ) : Promise < void > {
4257 const response = await this . $httpClient . httpRequest ( {
43- url :
44- "https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/manageyourapps/summary/v2" ,
58+ url,
4559 method : "GET" ,
46- body : {
47- contentProviderId,
48- } ,
4960 headers : {
5061 "Content-Type" : "application/json" ,
5162 Cookie : webSessionCookie ,
5263 } ,
5364 } ) ;
65+ const result = JSON . parse ( response . body ) ;
66+ const data = result . data ;
5467
55- return JSON . parse ( response . body ) . data ;
68+ for ( const app of data ) {
69+ let summary : IApplePortalApplicationSummary ;
70+ summary = {
71+ bundleId : app . attributes . bundleId ,
72+ adamId : app . id ,
73+ name : app . attributes . name ,
74+ versionSets : [ ] ,
75+ } ;
76+ summaries . push ( summary ) ;
77+ }
78+
79+ if ( result . links . next ) {
80+ await this . getApplicationsByUrl (
81+ webSessionCookie ,
82+ result . links . next ,
83+ summaries
84+ ) ;
85+ }
5686 }
5787
5888 public async getApplicationByBundleId (
0 commit comments