Skip to content

Commit 5ceb254

Browse files
authored
fix(ios-publish): changes in Apple API to set Team (#5653)
1 parent 37d576b commit 5ceb254

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class ApplePortalApplicationService
2323
let result: IApplePortalApplicationSummary[] = [];
2424

2525
for (const account of user.associatedAccounts) {
26-
const contentProviderId = account.contentProvider.contentProviderPublicId;
26+
const contentProviderId = account.contentProvider.contentProviderId;
2727
const applications = await this.getApplicationsByProvider(
2828
contentProviderId
2929
);
@@ -34,7 +34,7 @@ export class ApplePortalApplicationService
3434
}
3535

3636
public async getApplicationsByProvider(
37-
contentProviderId: string
37+
contentProviderId: number
3838
): Promise<IApplePortalApplication> {
3939
const webSessionCookie = await this.$applePortalSessionService.createWebSession(
4040
contentProviderId

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,21 @@ export class ApplePortalSessionService implements IApplePortalSessionService {
7979
return result;
8080
}
8181

82-
public async createWebSession(contentProviderId: string): Promise<string> {
82+
public async createWebSession(contentProviderId: number): Promise<string> {
8383
const webSessionResponse = await this.$httpClient.httpRequest({
84-
url:
85-
"https://appstoreconnect.apple.com/olympus/v1/providerSwitchRequests",
84+
url: "https://appstoreconnect.apple.com/olympus/v1/session",
8685
method: "POST",
8786
body: {
88-
data: {
89-
type: "providerSwitchRequests",
90-
relationships: {
91-
provider: {
92-
data: {
93-
type: "providers",
94-
id: contentProviderId,
95-
},
96-
},
97-
},
87+
provider: {
88+
providerId: contentProviderId,
9889
},
9990
},
10091
headers: {
10192
Accept: "application/json, text/plain, */*",
10293
"Accept-Encoding": "gzip, deflate, br",
10394
"X-Csrf-Itc": "itc",
10495
"Content-Type": "application/json;charset=UTF-8",
96+
"X-Requested-With": "olympus-ui",
10597
Cookie: this.$applePortalCookieService.getUserSessionCookie(),
10698
},
10799
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ICredentials } from "../../common/declarations";
22

33
interface IApplePortalSessionService {
4-
createWebSession(contentProviderId: string): Promise<string>;
4+
createWebSession(contentProviderId: number): Promise<string>;
55
createUserSession(
66
credentials: ICredentials,
77
opts?: IAppleCreateUserSessionOptions
@@ -19,7 +19,7 @@ interface IApplePortalApplicationService {
1919
user: IApplePortalUserDetail
2020
): Promise<IApplePortalApplicationSummary[]>;
2121
getApplicationsByProvider(
22-
contentProviderId: string
22+
contentProviderId: number
2323
): Promise<IApplePortalApplication>;
2424
getApplicationByBundleId(
2525
user: IApplePortalUserDetail,

0 commit comments

Comments
 (0)