Skip to content

Commit 4abe2c9

Browse files
authored
fix(ios-publish): Update API calls to get applications (#5678)
1 parent 1da28bc commit 4abe2c9

File tree

2 files changed

+38
-22
lines changed

2 files changed

+38
-22
lines changed

lib/services/apple-portal/apple-portal-application-service.ts

+36-6
Original file line numberDiff line numberDiff line change
@@ -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(

lib/services/apple-portal/definitions.d.ts

+2-16
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,13 @@ interface IApplePortalAssociatedAccountData {
7474

7575
interface IApplePortalApplication {
7676
summaries: IApplePortalApplicationSummary[];
77-
showSharedSecret: boolean;
78-
macBundlesEnabled: boolean;
79-
canCreateMacApps: boolean;
80-
cloudStorageEnabled: boolean;
81-
sharedSecretLink: string;
82-
gameCenterGroupLink: string;
83-
enabledPlatforms: string[];
84-
cloudStorageLink: string;
85-
catalogReportsLink: string;
86-
canCreateIOSApps: boolean;
8777
}
8878

8979
interface IApplePortalApplicationSummary {
9080
name: string;
9181
adamId: string;
92-
vendorId: string;
82+
9383
bundleId: string;
94-
appType: any;
84+
9585
versionSets: any[];
96-
lastModifiedDate: number;
97-
iconUrl: string;
98-
issuesCount: number;
99-
priceTier: string;
10086
}

0 commit comments

Comments
 (0)