Skip to content

Commit

Permalink
fix(ios-publish): changes in Apple API to set Team (#5653)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcassidyav committed Mar 23, 2022
1 parent 37d576b commit 5ceb254
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/services/apple-portal/apple-portal-application-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class ApplePortalApplicationService
let result: IApplePortalApplicationSummary[] = [];

for (const account of user.associatedAccounts) {
const contentProviderId = account.contentProvider.contentProviderPublicId;
const contentProviderId = account.contentProvider.contentProviderId;
const applications = await this.getApplicationsByProvider(
contentProviderId
);
Expand All @@ -34,7 +34,7 @@ export class ApplePortalApplicationService
}

public async getApplicationsByProvider(
contentProviderId: string
contentProviderId: number
): Promise<IApplePortalApplication> {
const webSessionCookie = await this.$applePortalSessionService.createWebSession(
contentProviderId
Expand Down
18 changes: 5 additions & 13 deletions lib/services/apple-portal/apple-portal-session-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,21 @@ export class ApplePortalSessionService implements IApplePortalSessionService {
return result;
}

public async createWebSession(contentProviderId: string): Promise<string> {
public async createWebSession(contentProviderId: number): Promise<string> {
const webSessionResponse = await this.$httpClient.httpRequest({
url:
"https://appstoreconnect.apple.com/olympus/v1/providerSwitchRequests",
url: "https://appstoreconnect.apple.com/olympus/v1/session",
method: "POST",
body: {
data: {
type: "providerSwitchRequests",
relationships: {
provider: {
data: {
type: "providers",
id: contentProviderId,
},
},
},
provider: {
providerId: contentProviderId,
},
},
headers: {
Accept: "application/json, text/plain, */*",
"Accept-Encoding": "gzip, deflate, br",
"X-Csrf-Itc": "itc",
"Content-Type": "application/json;charset=UTF-8",
"X-Requested-With": "olympus-ui",
Cookie: this.$applePortalCookieService.getUserSessionCookie(),
},
});
Expand Down
4 changes: 2 additions & 2 deletions lib/services/apple-portal/definitions.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ICredentials } from "../../common/declarations";

interface IApplePortalSessionService {
createWebSession(contentProviderId: string): Promise<string>;
createWebSession(contentProviderId: number): Promise<string>;
createUserSession(
credentials: ICredentials,
opts?: IAppleCreateUserSessionOptions
Expand All @@ -19,7 +19,7 @@ interface IApplePortalApplicationService {
user: IApplePortalUserDetail
): Promise<IApplePortalApplicationSummary[]>;
getApplicationsByProvider(
contentProviderId: string
contentProviderId: number
): Promise<IApplePortalApplication>;
getApplicationByBundleId(
user: IApplePortalUserDetail,
Expand Down

0 comments on commit 5ceb254

Please sign in to comment.