eas-cli 1.1.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -79
- package/build/branch/queries.js +11 -8
- package/build/build/android/graphql.js +2 -1
- package/build/build/android/prepareJob.js +3 -1
- package/build/build/createContext.js +1 -0
- package/build/build/ios/graphql.js +2 -2
- package/build/build/ios/prepareJob.js +3 -1
- package/build/commandUtils/EasCommand.d.ts +2 -0
- package/build/commandUtils/EasCommand.js +44 -3
- package/build/commands/branch/delete.js +1 -1
- package/build/commands/build/index.d.ts +2 -1
- package/build/commands/build/index.js +91 -19
- package/build/commands/channel/delete.js +1 -1
- package/build/commands/device/delete.js +3 -2
- package/build/commands/open.d.ts +5 -0
- package/build/commands/open.js +40 -0
- package/build/commands/secret/delete.js +1 -1
- package/build/commands/submit.d.ts +2 -1
- package/build/commands/submit.js +28 -14
- package/build/commands/update/configure.js +58 -5
- package/build/commands/update/delete.js +1 -1
- package/build/commands/update/index.js +3 -0
- package/build/commands/webhook/delete.js +1 -1
- package/build/credentials/android/api/GraphqlClient.js +1 -1
- package/build/credentials/context.d.ts +3 -0
- package/build/credentials/context.js +1 -0
- package/build/credentials/ios/IosCredentialsProvider.d.ts +1 -0
- package/build/credentials/ios/IosCredentialsProvider.js +33 -5
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +3 -1
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +5 -2
- package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +3 -1
- package/build/credentials/ios/actions/CreateProvisioningProfile.js +3 -2
- package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -1
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +4 -2
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +8 -2
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +30 -18
- package/build/credentials/ios/actions/SetUpBuildCredentials.js +1 -0
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +8 -2
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.js +6 -12
- package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +3 -1
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +8 -5
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +2 -0
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +5 -5
- package/build/credentials/ios/api/GraphqlClient.js +1 -1
- package/build/credentials/ios/appstore/AppStoreApi.d.ts +7 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +8 -8
- package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -14
- package/build/credentials/ios/appstore/Credentials.types.js +0 -6
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +176 -15
- package/build/credentials/ios/appstore/constants.d.ts +1 -0
- package/build/credentials/ios/appstore/constants.js +6 -0
- package/build/credentials/ios/appstore/distributionCertificate.js +1 -1
- package/build/credentials/ios/appstore/provisioningProfile.d.ts +5 -3
- package/build/credentials/ios/appstore/provisioningProfile.js +30 -7
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +3 -1
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +10 -10
- package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +2 -1
- package/build/credentials/ios/validators/validateProvisioningProfile.js +6 -4
- package/build/credentials/manager/ManageAndroid.js +2 -8
- package/build/credentials/manager/ManageIos.js +10 -9
- package/build/devices/actions/create/developerPortalMethod.js +2 -2
- package/build/graphql/generated.d.ts +230 -39
- package/build/graphql/generated.js +39 -1
- package/build/{credentials/ios/api/graphql → graphql}/queries/AppQuery.d.ts +1 -1
- package/build/{credentials/ios/api/graphql → graphql}/queries/AppQuery.js +2 -2
- package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +1 -1
- package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -2
- package/build/graphql/queries/StatuspageServiceQuery.d.ts +4 -0
- package/build/graphql/queries/StatuspageServiceQuery.js +28 -0
- package/build/graphql/types/StatuspageService.d.ts +1 -0
- package/build/graphql/types/StatuspageService.js +19 -0
- package/build/project/ensureProjectExists.d.ts +0 -7
- package/build/project/ensureProjectExists.js +4 -14
- package/build/project/ios/target.d.ts +7 -0
- package/build/project/ios/target.js +26 -1
- package/build/project/projectUtils.d.ts +0 -1
- package/build/project/projectUtils.js +9 -29
- package/build/project/workflow.js +3 -1
- package/build/submit/android/AndroidSubmitter.js +1 -1
- package/build/submit/submit.js +2 -2
- package/build/submit/utils/errors.js +2 -0
- package/build/utils/statuspageService.d.ts +2 -0
- package/build/utils/statuspageService.js +41 -0
- package/build/vcs/clients/git.js +4 -1
- package/build/vcs/clients/gitNoCommit.js +2 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -6
- package/build/graphql/queries/ProjectQuery.d.ts +0 -6
- package/build/graphql/queries/ProjectQuery.js +0 -24
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
5
|
const eas_json_1 = require("@expo/eas-json");
|
|
6
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
7
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
7
8
|
const target_1 = require("../../project/ios/target");
|
|
8
9
|
const prompts_1 = require("../../prompts");
|
|
@@ -12,6 +13,12 @@ const BuildCredentialsUtils_1 = require("./actions/BuildCredentialsUtils");
|
|
|
12
13
|
const SetUpBuildCredentials_1 = require("./actions/SetUpBuildCredentials");
|
|
13
14
|
const SetUpPushKey_1 = require("./actions/SetUpPushKey");
|
|
14
15
|
const provisioningProfile_1 = require("./utils/provisioningProfile");
|
|
16
|
+
var PushNotificationSetupOption;
|
|
17
|
+
(function (PushNotificationSetupOption) {
|
|
18
|
+
PushNotificationSetupOption[PushNotificationSetupOption["YES"] = 0] = "YES";
|
|
19
|
+
PushNotificationSetupOption[PushNotificationSetupOption["NO"] = 1] = "NO";
|
|
20
|
+
PushNotificationSetupOption[PushNotificationSetupOption["NO_DONT_ASK_AGAIN"] = 2] = "NO_DONT_ASK_AGAIN";
|
|
21
|
+
})(PushNotificationSetupOption || (PushNotificationSetupOption = {}));
|
|
15
22
|
class IosCredentialsProvider {
|
|
16
23
|
constructor(ctx, options) {
|
|
17
24
|
this.ctx = ctx;
|
|
@@ -47,6 +54,7 @@ class IosCredentialsProvider {
|
|
|
47
54
|
}).runAsync(this.ctx);
|
|
48
55
|
}
|
|
49
56
|
async getPushKeyAsync(ctx, targets) {
|
|
57
|
+
var _a;
|
|
50
58
|
if (ctx.nonInteractive) {
|
|
51
59
|
return null;
|
|
52
60
|
}
|
|
@@ -63,13 +71,33 @@ class IosCredentialsProvider {
|
|
|
63
71
|
log_1.default.succeed(`Push Notifications setup for ${app.projectName}: ${applicationTarget.bundleIdentifier}`);
|
|
64
72
|
return null;
|
|
65
73
|
}
|
|
66
|
-
|
|
67
|
-
message: `Would you like to set up Push Notifications for your project?`,
|
|
68
|
-
});
|
|
69
|
-
if (!confirmSetup) {
|
|
74
|
+
if (((_a = ctx.easJsonCliConfig) === null || _a === void 0 ? void 0 : _a.promptToConfigurePushNotifications) === false) {
|
|
70
75
|
return null;
|
|
71
76
|
}
|
|
72
|
-
|
|
77
|
+
const setupOption = await (0, prompts_1.selectAsync)(`Would you like to set up Push Notifications for your project?`, [
|
|
78
|
+
{ title: 'Yes', value: PushNotificationSetupOption.YES },
|
|
79
|
+
{ title: 'No', value: PushNotificationSetupOption.NO },
|
|
80
|
+
{
|
|
81
|
+
title: `No, don't ask again (preference will be saved to eas.json)`,
|
|
82
|
+
value: PushNotificationSetupOption.NO_DONT_ASK_AGAIN,
|
|
83
|
+
},
|
|
84
|
+
]);
|
|
85
|
+
if (setupOption === PushNotificationSetupOption.YES) {
|
|
86
|
+
return await setupPushKeyAction.runAsync(ctx);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
if (setupOption === PushNotificationSetupOption.NO_DONT_ASK_AGAIN) {
|
|
90
|
+
await this.disablePushNotificationsSetupInEasJsonAsync(ctx);
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async disablePushNotificationsSetupInEasJsonAsync(ctx) {
|
|
96
|
+
const easJsonPath = eas_json_1.EasJsonReader.formatEasJsonPath(ctx.projectDir);
|
|
97
|
+
const easJson = await fs_extra_1.default.readJSON(easJsonPath);
|
|
98
|
+
easJson.cli = { ...easJson === null || easJson === void 0 ? void 0 : easJson.cli, promptToConfigurePushNotifications: false };
|
|
99
|
+
await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
|
|
100
|
+
log_1.default.withTick('Updated eas.json');
|
|
73
101
|
}
|
|
74
102
|
assertProvisioningProfileType(provisioningProfile, targetName) {
|
|
75
103
|
const isAdHoc = (0, provisioningProfile_1.isAdHocProfile)(provisioningProfile);
|
|
@@ -2,11 +2,13 @@ import { AppleDistributionCertificateFragment, AppleProvisioningProfileFragment
|
|
|
2
2
|
import { CredentialsContext } from '../../context';
|
|
3
3
|
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
4
|
import { AppleProvisioningProfileMutationResult } from '../api/graphql/mutations/AppleProvisioningProfileMutation';
|
|
5
|
+
import { Target } from '../types';
|
|
5
6
|
export declare class ConfigureProvisioningProfile {
|
|
6
7
|
private app;
|
|
8
|
+
private target;
|
|
7
9
|
private distributionCertificate;
|
|
8
10
|
private originalProvisioningProfile;
|
|
9
|
-
constructor(app: AppLookupParams, distributionCertificate: AppleDistributionCertificateFragment, originalProvisioningProfile: AppleProvisioningProfileFragment);
|
|
11
|
+
constructor(app: AppLookupParams, target: Target, distributionCertificate: AppleDistributionCertificateFragment, originalProvisioningProfile: AppleProvisioningProfileFragment);
|
|
10
12
|
runAsync(ctx: CredentialsContext): Promise<AppleProvisioningProfileMutationResult | null>;
|
|
11
13
|
private configureAndUpdateAsync;
|
|
12
14
|
}
|
|
@@ -6,10 +6,12 @@ const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
8
8
|
const ora_1 = require("../../../ora");
|
|
9
|
+
const target_1 = require("../../../project/ios/target");
|
|
9
10
|
const errors_1 = require("../../errors");
|
|
10
11
|
class ConfigureProvisioningProfile {
|
|
11
|
-
constructor(app, distributionCertificate, originalProvisioningProfile) {
|
|
12
|
+
constructor(app, target, distributionCertificate, originalProvisioningProfile) {
|
|
12
13
|
this.app = app;
|
|
14
|
+
this.target = target;
|
|
13
15
|
this.distributionCertificate = distributionCertificate;
|
|
14
16
|
this.originalProvisioningProfile = originalProvisioningProfile;
|
|
15
17
|
}
|
|
@@ -27,7 +29,8 @@ class ConfigureProvisioningProfile {
|
|
|
27
29
|
log_1.default.warn('Make sure to recreate the profile if you selected a new distribution certificate.');
|
|
28
30
|
return null;
|
|
29
31
|
}
|
|
30
|
-
const
|
|
32
|
+
const applePlatform = await (0, target_1.getApplePlatformFromSdkRoot)(this.target);
|
|
33
|
+
const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(this.app.bundleIdentifier, applePlatform);
|
|
31
34
|
const [matchingProfile] = profilesFromApple.filter(appleInfo => developerPortalIdentifier
|
|
32
35
|
? appleInfo.provisioningProfileId === developerPortalIdentifier
|
|
33
36
|
: appleInfo.provisioningProfile === provisioningProfile);
|
|
@@ -2,10 +2,12 @@ import { AppleDistributionCertificateFragment } from '../../../graphql/generated
|
|
|
2
2
|
import { CredentialsContext } from '../../context';
|
|
3
3
|
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
4
|
import { AppleProvisioningProfileMutationResult } from '../api/graphql/mutations/AppleProvisioningProfileMutation';
|
|
5
|
+
import { Target } from '../types';
|
|
5
6
|
export declare class CreateProvisioningProfile {
|
|
6
7
|
private app;
|
|
8
|
+
private target;
|
|
7
9
|
private distributionCertificate;
|
|
8
|
-
constructor(app: AppLookupParams, distributionCertificate: AppleDistributionCertificateFragment);
|
|
10
|
+
constructor(app: AppLookupParams, target: Target, distributionCertificate: AppleDistributionCertificateFragment);
|
|
9
11
|
runAsync(ctx: CredentialsContext): Promise<AppleProvisioningProfileMutationResult>;
|
|
10
12
|
private provideOrGenerateAsync;
|
|
11
13
|
}
|
|
@@ -11,8 +11,9 @@ const credentials_1 = require("../credentials");
|
|
|
11
11
|
const AppleTeamUtils_1 = require("./AppleTeamUtils");
|
|
12
12
|
const ProvisioningProfileUtils_1 = require("./ProvisioningProfileUtils");
|
|
13
13
|
class CreateProvisioningProfile {
|
|
14
|
-
constructor(app, distributionCertificate) {
|
|
14
|
+
constructor(app, target, distributionCertificate) {
|
|
15
15
|
this.app = app;
|
|
16
|
+
this.target = target;
|
|
16
17
|
this.distributionCertificate = distributionCertificate;
|
|
17
18
|
}
|
|
18
19
|
async runAsync(ctx) {
|
|
@@ -40,7 +41,7 @@ class CreateProvisioningProfile {
|
|
|
40
41
|
}
|
|
41
42
|
(0, assert_1.default)(this.distributionCertificate.certificateP12, 'Distribution Certificate must have p12 certificate');
|
|
42
43
|
(0, assert_1.default)(this.distributionCertificate.certificatePassword, 'Distribution Certificate must have certificate password');
|
|
43
|
-
return await (0, ProvisioningProfileUtils_1.generateProvisioningProfileAsync)(ctx, this.app.bundleIdentifier, {
|
|
44
|
+
return await (0, ProvisioningProfileUtils_1.generateProvisioningProfileAsync)(ctx, this.target, this.app.bundleIdentifier, {
|
|
44
45
|
certId: (_a = this.distributionCertificate.developerPortalIdentifier) !== null && _a !== void 0 ? _a : undefined,
|
|
45
46
|
certP12: this.distributionCertificate.certificateP12,
|
|
46
47
|
certPassword: this.distributionCertificate.certificatePassword,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CredentialsContext } from '../../context';
|
|
2
2
|
import { DistributionCertificate, ProvisioningProfile, ProvisioningProfileStoreInfo } from '../appstore/Credentials.types';
|
|
3
|
+
import { Target } from '../types';
|
|
3
4
|
export declare function formatProvisioningProfileFromApple(appleInfo: ProvisioningProfileStoreInfo): string;
|
|
4
|
-
export declare function generateProvisioningProfileAsync(ctx: CredentialsContext, bundleIdentifier: string, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
|
|
5
|
+
export declare function generateProvisioningProfileAsync(ctx: CredentialsContext, target: Target, bundleIdentifier: string, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateProvisioningProfileAsync = exports.formatProvisioningProfileFromApple = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const target_1 = require("../../../project/ios/target");
|
|
6
7
|
function formatProvisioningProfileFromApple(appleInfo) {
|
|
7
8
|
var _a;
|
|
8
9
|
const { expires, provisioningProfileId } = appleInfo;
|
|
@@ -13,10 +14,11 @@ function formatProvisioningProfileFromApple(appleInfo) {
|
|
|
13
14
|
return `Provisioning Profile - ID: ${id}${details}`;
|
|
14
15
|
}
|
|
15
16
|
exports.formatProvisioningProfileFromApple = formatProvisioningProfileFromApple;
|
|
16
|
-
async function generateProvisioningProfileAsync(ctx, bundleIdentifier, distCert) {
|
|
17
|
+
async function generateProvisioningProfileAsync(ctx, target, bundleIdentifier, distCert) {
|
|
17
18
|
const appleAuthCtx = await ctx.appStore.ensureAuthenticatedAsync();
|
|
18
19
|
const type = appleAuthCtx.team.inHouse ? 'Enterprise ' : 'AppStore';
|
|
19
20
|
const profileName = `*[expo] ${bundleIdentifier} ${type} ${new Date().toISOString()}`; // Apple drops [ if its the first char (!!)
|
|
20
|
-
|
|
21
|
+
const applePlatform = await (0, target_1.getApplePlatformFromSdkRoot)(target);
|
|
22
|
+
return await ctx.appStore.createProvisioningProfileAsync(bundleIdentifier, distCert, profileName, applePlatform);
|
|
21
23
|
}
|
|
22
24
|
exports.generateProvisioningProfileAsync = generateProvisioningProfileAsync;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { AppleDistributionCertificateFragment, IosAppBuildCredentialsFragment } from '../../../graphql/generated';
|
|
2
2
|
import { CredentialsContext } from '../../context';
|
|
3
3
|
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
|
+
import { Target } from '../types';
|
|
5
|
+
interface Options {
|
|
6
|
+
app: AppLookupParams;
|
|
7
|
+
target: Target;
|
|
8
|
+
}
|
|
4
9
|
export declare class SetUpAdhocProvisioningProfile {
|
|
5
|
-
private
|
|
6
|
-
constructor(
|
|
10
|
+
private options;
|
|
11
|
+
constructor(options: Options);
|
|
7
12
|
runAsync(ctx: CredentialsContext): Promise<IosAppBuildCredentialsFragment>;
|
|
8
13
|
runWithDistributionCertificateAsync(ctx: CredentialsContext, distCert: AppleDistributionCertificateFragment): Promise<IosAppBuildCredentialsFragment>;
|
|
9
14
|
private areBuildCredentialsSetupAsync;
|
|
@@ -12,3 +17,4 @@ export declare class SetUpAdhocProvisioningProfile {
|
|
|
12
17
|
private registerDevicesAsync;
|
|
13
18
|
}
|
|
14
19
|
export declare function doUDIDsMatch(udidsA: string[], udidsB: string[]): boolean;
|
|
20
|
+
export {};
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doUDIDsMatch = exports.SetUpAdhocProvisioningProfile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const apple_utils_1 = require("@expo/apple-utils");
|
|
5
6
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
8
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
8
9
|
const action_1 = tslib_1.__importStar(require("../../../devices/actions/create/action"));
|
|
9
10
|
const generated_1 = require("../../../graphql/generated");
|
|
10
11
|
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
12
|
+
const target_1 = require("../../../project/ios/target");
|
|
11
13
|
const prompts_1 = require("../../../prompts");
|
|
12
14
|
const differenceBy_1 = tslib_1.__importDefault(require("../../../utils/expodash/differenceBy"));
|
|
13
15
|
const errors_1 = require("../../errors");
|
|
16
|
+
const constants_1 = require("../appstore/constants");
|
|
14
17
|
const validateProvisioningProfile_1 = require("../validators/validateProvisioningProfile");
|
|
15
18
|
const AppleTeamUtils_1 = require("./AppleTeamUtils");
|
|
16
19
|
const BuildCredentialsUtils_1 = require("./BuildCredentialsUtils");
|
|
@@ -23,21 +26,22 @@ var ReuseAction;
|
|
|
23
26
|
ReuseAction[ReuseAction["No"] = 2] = "No";
|
|
24
27
|
})(ReuseAction || (ReuseAction = {}));
|
|
25
28
|
class SetUpAdhocProvisioningProfile {
|
|
26
|
-
constructor(
|
|
27
|
-
this.
|
|
29
|
+
constructor(options) {
|
|
30
|
+
this.options = options;
|
|
28
31
|
}
|
|
29
32
|
async runAsync(ctx) {
|
|
30
|
-
const
|
|
33
|
+
const { app } = this.options;
|
|
34
|
+
const distCert = await new SetUpDistributionCertificate_1.SetUpDistributionCertificate(app, generated_1.IosDistributionType.AdHoc).runAsync(ctx);
|
|
31
35
|
const areBuildCredentialsSetup = await this.areBuildCredentialsSetupAsync(ctx);
|
|
32
36
|
if (ctx.nonInteractive) {
|
|
33
37
|
if (areBuildCredentialsSetup) {
|
|
34
|
-
return (0, nullthrows_1.default)(await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx,
|
|
38
|
+
return (0, nullthrows_1.default)(await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx, app, generated_1.IosDistributionType.AdHoc));
|
|
35
39
|
}
|
|
36
40
|
else {
|
|
37
41
|
throw new errors_1.MissingCredentialsNonInteractiveError('Provisioning profile is not configured correctly. Run this command again in interactive mode.');
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
|
-
const currentBuildCredentials = await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx,
|
|
44
|
+
const currentBuildCredentials = await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx, app, generated_1.IosDistributionType.AdHoc);
|
|
41
45
|
if (areBuildCredentialsSetup) {
|
|
42
46
|
const buildCredentials = (0, nullthrows_1.default)(currentBuildCredentials);
|
|
43
47
|
if (await this.shouldUseExistingProfileAsync(ctx, buildCredentials)) {
|
|
@@ -48,16 +52,17 @@ class SetUpAdhocProvisioningProfile {
|
|
|
48
52
|
}
|
|
49
53
|
async runWithDistributionCertificateAsync(ctx, distCert) {
|
|
50
54
|
var _a, _b, _c, _d, _e;
|
|
51
|
-
const
|
|
55
|
+
const { app, target } = this.options;
|
|
56
|
+
const currentBuildCredentials = await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx, app, generated_1.IosDistributionType.AdHoc);
|
|
52
57
|
// 1. Resolve Apple Team
|
|
53
58
|
let appleTeam = (_c = (_a = distCert.appleTeam) !== null && _a !== void 0 ? _a : (_b = currentBuildCredentials === null || currentBuildCredentials === void 0 ? void 0 : currentBuildCredentials.provisioningProfile) === null || _b === void 0 ? void 0 : _b.appleTeam) !== null && _c !== void 0 ? _c : null;
|
|
54
59
|
if (!appleTeam) {
|
|
55
60
|
await ctx.appStore.ensureAuthenticatedAsync();
|
|
56
|
-
appleTeam = await (0, AppleTeamUtils_1.resolveAppleTeamIfAuthenticatedAsync)(ctx,
|
|
61
|
+
appleTeam = await (0, AppleTeamUtils_1.resolveAppleTeamIfAuthenticatedAsync)(ctx, app);
|
|
57
62
|
}
|
|
58
63
|
(0, assert_1.default)(appleTeam, 'Apple Team must be defined here');
|
|
59
64
|
// 2. Fetch devices registered on EAS servers
|
|
60
|
-
let registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(
|
|
65
|
+
let registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(app, appleTeam);
|
|
61
66
|
if (registeredAppleDevices.length === 0) {
|
|
62
67
|
const shouldRegisterDevices = await (0, prompts_1.confirmAsync)({
|
|
63
68
|
message: `You don't have any registered devices yet. Would you like to register them now?`,
|
|
@@ -74,9 +79,13 @@ class SetUpAdhocProvisioningProfile {
|
|
|
74
79
|
const provisionedDeviceIdentifiers = ((_e = (_d = currentBuildCredentials === null || currentBuildCredentials === void 0 ? void 0 : currentBuildCredentials.provisioningProfile) === null || _d === void 0 ? void 0 : _d.appleDevices) !== null && _e !== void 0 ? _e : []).map(i => i.identifier);
|
|
75
80
|
const chosenDevices = await (0, DeviceUtils_1.chooseDevicesAsync)(registeredAppleDevices, provisionedDeviceIdentifiers);
|
|
76
81
|
// 4. Reuse or create the profile on Apple Developer Portal
|
|
77
|
-
const
|
|
82
|
+
const applePlatform = await (0, target_1.getApplePlatformFromSdkRoot)(target);
|
|
83
|
+
const profileType = applePlatform === constants_1.ApplePlatform.TV_OS
|
|
84
|
+
? apple_utils_1.ProfileType.TVOS_APP_ADHOC
|
|
85
|
+
: apple_utils_1.ProfileType.IOS_APP_ADHOC;
|
|
86
|
+
const provisioningProfileStoreInfo = await ctx.appStore.createOrReuseAdhocProvisioningProfileAsync(chosenDevices.map(({ identifier }) => identifier), app.bundleIdentifier, distCert.serialNumber, profileType);
|
|
78
87
|
// 5. Create or update the profile on servers
|
|
79
|
-
const appleAppIdentifier = await ctx.ios.createOrGetExistingAppleAppIdentifierAsync(
|
|
88
|
+
const appleAppIdentifier = await ctx.ios.createOrGetExistingAppleAppIdentifierAsync(app, appleTeam);
|
|
80
89
|
let appleProvisioningProfile = null;
|
|
81
90
|
if (currentBuildCredentials === null || currentBuildCredentials === void 0 ? void 0 : currentBuildCredentials.provisioningProfile) {
|
|
82
91
|
if (currentBuildCredentials.provisioningProfile.developerPortalIdentifier !==
|
|
@@ -84,7 +93,7 @@ class SetUpAdhocProvisioningProfile {
|
|
|
84
93
|
await ctx.ios.deleteProvisioningProfilesAsync([
|
|
85
94
|
currentBuildCredentials.provisioningProfile.id,
|
|
86
95
|
]);
|
|
87
|
-
appleProvisioningProfile = await ctx.ios.createProvisioningProfileAsync(
|
|
96
|
+
appleProvisioningProfile = await ctx.ios.createProvisioningProfileAsync(app, appleAppIdentifier, {
|
|
88
97
|
appleProvisioningProfile: provisioningProfileStoreInfo.provisioningProfile,
|
|
89
98
|
developerPortalIdentifier: provisioningProfileStoreInfo.provisioningProfileId,
|
|
90
99
|
});
|
|
@@ -94,23 +103,25 @@ class SetUpAdhocProvisioningProfile {
|
|
|
94
103
|
}
|
|
95
104
|
}
|
|
96
105
|
else {
|
|
97
|
-
appleProvisioningProfile = await ctx.ios.createProvisioningProfileAsync(
|
|
106
|
+
appleProvisioningProfile = await ctx.ios.createProvisioningProfileAsync(app, appleAppIdentifier, {
|
|
98
107
|
appleProvisioningProfile: provisioningProfileStoreInfo.provisioningProfile,
|
|
99
108
|
developerPortalIdentifier: provisioningProfileStoreInfo.provisioningProfileId,
|
|
100
109
|
});
|
|
101
110
|
}
|
|
102
111
|
// 6. Create (or update) app build credentials
|
|
103
112
|
(0, assert_1.default)(appleProvisioningProfile);
|
|
104
|
-
return await (0, BuildCredentialsUtils_1.assignBuildCredentialsAsync)(ctx,
|
|
113
|
+
return await (0, BuildCredentialsUtils_1.assignBuildCredentialsAsync)(ctx, app, generated_1.IosDistributionType.AdHoc, distCert, appleProvisioningProfile, appleTeam);
|
|
105
114
|
}
|
|
106
115
|
async areBuildCredentialsSetupAsync(ctx) {
|
|
107
|
-
const
|
|
108
|
-
|
|
116
|
+
const { app, target } = this.options;
|
|
117
|
+
const buildCredentials = await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx, app, generated_1.IosDistributionType.AdHoc);
|
|
118
|
+
return await (0, validateProvisioningProfile_1.validateProvisioningProfileAsync)(ctx, target, app, buildCredentials);
|
|
109
119
|
}
|
|
110
120
|
async shouldUseExistingProfileAsync(ctx, buildCredentials) {
|
|
121
|
+
const { app } = this.options;
|
|
111
122
|
const provisioningProfile = (0, nullthrows_1.default)(buildCredentials.provisioningProfile);
|
|
112
123
|
const appleTeam = (0, nullthrows_1.default)(provisioningProfile.appleTeam);
|
|
113
|
-
const registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(
|
|
124
|
+
const registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(app, appleTeam);
|
|
114
125
|
const provisionedDevices = provisioningProfile.appleDevices;
|
|
115
126
|
const allRegisteredDevicesAreProvisioned = doUDIDsMatch(registeredAppleDevices.map(({ identifier }) => identifier), provisionedDevices.map(({ identifier }) => identifier));
|
|
116
127
|
if (allRegisteredDevicesAreProvisioned) {
|
|
@@ -170,7 +181,8 @@ class SetUpAdhocProvisioningProfile {
|
|
|
170
181
|
return selected;
|
|
171
182
|
}
|
|
172
183
|
async registerDevicesAsync(ctx, appleTeam) {
|
|
173
|
-
const
|
|
184
|
+
const { app } = this.options;
|
|
185
|
+
const action = new action_1.default(ctx.appStore, app.account, appleTeam);
|
|
174
186
|
const method = await action.runAsync();
|
|
175
187
|
while (true) {
|
|
176
188
|
if (method === action_1.RegistrationMethod.WEBSITE) {
|
|
@@ -179,7 +191,7 @@ class SetUpAdhocProvisioningProfile {
|
|
|
179
191
|
await (0, prompts_1.pressAnyKeyToContinueAsync)();
|
|
180
192
|
}
|
|
181
193
|
log_1.default.newLine();
|
|
182
|
-
const devices = await ctx.ios.getDevicesForAppleTeamAsync(
|
|
194
|
+
const devices = await ctx.ios.getDevicesForAppleTeamAsync(app, appleTeam, {
|
|
183
195
|
useCache: false,
|
|
184
196
|
});
|
|
185
197
|
if (devices.length === 0) {
|
|
@@ -39,6 +39,7 @@ class SetUpBuildCredentials {
|
|
|
39
39
|
enterpriseProvisioning: this.options.enterpriseProvisioning,
|
|
40
40
|
distribution: this.options.distribution,
|
|
41
41
|
entitlements: target.entitlements,
|
|
42
|
+
target,
|
|
42
43
|
app: {
|
|
43
44
|
...this.options.app,
|
|
44
45
|
bundleIdentifier: target.bundleIdentifier,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IosAppBuildCredentialsFragment } from '../../../graphql/generated';
|
|
2
2
|
import { CredentialsContext } from '../../context';
|
|
3
3
|
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
|
+
import { Target } from '../types';
|
|
4
5
|
/**
|
|
5
6
|
* It's used when setting up credentials for internal distribution but `enterpriseProvisioning` is not set.
|
|
6
7
|
*
|
|
@@ -8,11 +9,16 @@ import { AppLookupParams } from '../api/GraphqlClient';
|
|
|
8
9
|
* to choose if they want to set up an adhoc or universal distribution provisioning profile. Otherwise, always
|
|
9
10
|
* set up an adhoc provisioning profile.
|
|
10
11
|
*/
|
|
12
|
+
interface Options {
|
|
13
|
+
app: AppLookupParams;
|
|
14
|
+
target: Target;
|
|
15
|
+
}
|
|
11
16
|
export declare class SetUpInternalProvisioningProfile {
|
|
12
|
-
private
|
|
13
|
-
constructor(
|
|
17
|
+
private options;
|
|
18
|
+
constructor(options: Options);
|
|
14
19
|
runAsync(ctx: CredentialsContext): Promise<IosAppBuildCredentialsFragment>;
|
|
15
20
|
private setupAdhocProvisioningProfileAsync;
|
|
16
21
|
private setupUniversalProvisioningProfileAsync;
|
|
17
22
|
private askForDistributionTypeAndSetupAsync;
|
|
18
23
|
}
|
|
24
|
+
export {};
|
|
@@ -8,19 +8,12 @@ const prompts_1 = require("../../../prompts");
|
|
|
8
8
|
const BuildCredentialsUtils_1 = require("./BuildCredentialsUtils");
|
|
9
9
|
const SetUpAdhocProvisioningProfile_1 = require("./SetUpAdhocProvisioningProfile");
|
|
10
10
|
const SetUpProvisioningProfile_1 = require("./SetUpProvisioningProfile");
|
|
11
|
-
/**
|
|
12
|
-
* It's used when setting up credentials for internal distribution but `enterpriseProvisioning` is not set.
|
|
13
|
-
*
|
|
14
|
-
* TLDR: If the user authenticates with an account with Apple Developer Enterprise Program membership we ask them
|
|
15
|
-
* to choose if they want to set up an adhoc or universal distribution provisioning profile. Otherwise, always
|
|
16
|
-
* set up an adhoc provisioning profile.
|
|
17
|
-
*/
|
|
18
11
|
class SetUpInternalProvisioningProfile {
|
|
19
|
-
constructor(
|
|
20
|
-
this.
|
|
12
|
+
constructor(options) {
|
|
13
|
+
this.options = options;
|
|
21
14
|
}
|
|
22
15
|
async runAsync(ctx) {
|
|
23
|
-
const buildCredentials = await (0, BuildCredentialsUtils_1.getAllBuildCredentialsAsync)(ctx, this.app);
|
|
16
|
+
const buildCredentials = await (0, BuildCredentialsUtils_1.getAllBuildCredentialsAsync)(ctx, this.options.app);
|
|
24
17
|
const adhocBuildCredentialsExist = buildCredentials.filter(({ iosDistributionType }) => iosDistributionType === generated_1.IosDistributionType.AdHoc).length > 0;
|
|
25
18
|
const enterpriseBuildCredentialsExist = buildCredentials.filter(({ iosDistributionType }) => iosDistributionType === generated_1.IosDistributionType.Enterprise).length > 0;
|
|
26
19
|
if (!ctx.nonInteractive) {
|
|
@@ -73,10 +66,11 @@ class SetUpInternalProvisioningProfile {
|
|
|
73
66
|
}
|
|
74
67
|
}
|
|
75
68
|
async setupAdhocProvisioningProfileAsync(ctx) {
|
|
76
|
-
|
|
69
|
+
const { app, target } = this.options;
|
|
70
|
+
return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile({ app, target }).runAsync(ctx);
|
|
77
71
|
}
|
|
78
72
|
async setupUniversalProvisioningProfileAsync(ctx) {
|
|
79
|
-
return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(this.app, generated_1.IosDistributionType.Enterprise).runAsync(ctx);
|
|
73
|
+
return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(this.options.app, this.options.target, generated_1.IosDistributionType.Enterprise).runAsync(ctx);
|
|
80
74
|
}
|
|
81
75
|
async askForDistributionTypeAndSetupAsync(ctx, message) {
|
|
82
76
|
const { distributionType } = await (0, prompts_1.promptAsync)({
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { AppleDistributionCertificateFragment, AppleProvisioningProfileFragment, IosAppBuildCredentialsFragment, IosDistributionType } from '../../../graphql/generated';
|
|
2
2
|
import { CredentialsContext } from '../../context';
|
|
3
3
|
import { AppLookupParams } from '../api/GraphqlClient';
|
|
4
|
+
import { Target } from '../types';
|
|
4
5
|
/**
|
|
5
6
|
* Sets up either APP_STORE or ENTERPRISE provisioning profiles
|
|
6
7
|
*/
|
|
7
8
|
export declare class SetUpProvisioningProfile {
|
|
8
9
|
private app;
|
|
10
|
+
private target;
|
|
9
11
|
private distributionType;
|
|
10
|
-
constructor(app: AppLookupParams, distributionType: IosDistributionType);
|
|
12
|
+
constructor(app: AppLookupParams, target: Target, distributionType: IosDistributionType);
|
|
11
13
|
areBuildCredentialsSetupAsync(ctx: CredentialsContext): Promise<boolean>;
|
|
12
14
|
assignNewAndDeleteOldProfileAsync(ctx: CredentialsContext, distCert: AppleDistributionCertificateFragment, currentProfile: AppleProvisioningProfileFragment): Promise<IosAppBuildCredentialsFragment>;
|
|
13
15
|
createAndAssignProfileAsync(ctx: CredentialsContext, distCert: AppleDistributionCertificateFragment): Promise<IosAppBuildCredentialsFragment>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SetUpProvisioningProfile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
|
+
const target_1 = require("../../../project/ios/target");
|
|
6
7
|
const prompts_1 = require("../../../prompts");
|
|
7
8
|
const errors_1 = require("../../errors");
|
|
8
9
|
const validateProvisioningProfile_1 = require("../validators/validateProvisioningProfile");
|
|
@@ -15,13 +16,14 @@ const SetUpDistributionCertificate_1 = require("./SetUpDistributionCertificate")
|
|
|
15
16
|
* Sets up either APP_STORE or ENTERPRISE provisioning profiles
|
|
16
17
|
*/
|
|
17
18
|
class SetUpProvisioningProfile {
|
|
18
|
-
constructor(app, distributionType) {
|
|
19
|
+
constructor(app, target, distributionType) {
|
|
19
20
|
this.app = app;
|
|
21
|
+
this.target = target;
|
|
20
22
|
this.distributionType = distributionType;
|
|
21
23
|
}
|
|
22
24
|
async areBuildCredentialsSetupAsync(ctx) {
|
|
23
25
|
const buildCredentials = await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx, this.app, this.distributionType);
|
|
24
|
-
return await (0, validateProvisioningProfile_1.validateProvisioningProfileAsync)(ctx, this.app, buildCredentials);
|
|
26
|
+
return await (0, validateProvisioningProfile_1.validateProvisioningProfileAsync)(ctx, this.target, this.app, buildCredentials);
|
|
25
27
|
}
|
|
26
28
|
async assignNewAndDeleteOldProfileAsync(ctx, distCert, currentProfile) {
|
|
27
29
|
const buildCredentials = await this.createAndAssignProfileAsync(ctx, distCert);
|
|
@@ -30,11 +32,11 @@ class SetUpProvisioningProfile {
|
|
|
30
32
|
return buildCredentials;
|
|
31
33
|
}
|
|
32
34
|
async createAndAssignProfileAsync(ctx, distCert) {
|
|
33
|
-
const provisioningProfile = await new CreateProvisioningProfile_1.CreateProvisioningProfile(this.app, distCert).runAsync(ctx);
|
|
35
|
+
const provisioningProfile = await new CreateProvisioningProfile_1.CreateProvisioningProfile(this.app, this.target, distCert).runAsync(ctx);
|
|
34
36
|
return await (0, BuildCredentialsUtils_1.assignBuildCredentialsAsync)(ctx, this.app, this.distributionType, distCert, provisioningProfile);
|
|
35
37
|
}
|
|
36
38
|
async configureAndAssignProfileAsync(ctx, distCert, originalProvisioningProfile) {
|
|
37
|
-
const profileConfigurator = new ConfigureProvisioningProfile_1.ConfigureProvisioningProfile(this.app, distCert, originalProvisioningProfile);
|
|
39
|
+
const profileConfigurator = new ConfigureProvisioningProfile_1.ConfigureProvisioningProfile(this.app, this.target, distCert, originalProvisioningProfile);
|
|
38
40
|
const updatedProvisioningProfile = await profileConfigurator.runAsync(ctx);
|
|
39
41
|
if (!updatedProvisioningProfile) {
|
|
40
42
|
return null;
|
|
@@ -55,7 +57,8 @@ class SetUpProvisioningProfile {
|
|
|
55
57
|
return await this.createAndAssignProfileAsync(ctx, distCert);
|
|
56
58
|
}
|
|
57
59
|
// See if the profile we have exists on the Apple Servers
|
|
58
|
-
const
|
|
60
|
+
const applePlatform = await (0, target_1.getApplePlatformFromSdkRoot)(this.target);
|
|
61
|
+
const existingProfiles = await ctx.appStore.listProvisioningProfilesAsync(this.app.bundleIdentifier, applePlatform);
|
|
59
62
|
const currentProfileFromServer = this.getCurrentProfileStoreInfo(existingProfiles, currentProfile);
|
|
60
63
|
if (!currentProfileFromServer) {
|
|
61
64
|
return await this.assignNewAndDeleteOldProfileAsync(ctx, distCert, currentProfile);
|
|
@@ -3,11 +3,13 @@ import { JSONObject } from '@expo/json-file';
|
|
|
3
3
|
import { IosAppBuildCredentialsFragment } from '../../../graphql/generated';
|
|
4
4
|
import { CredentialsContext } from '../../context';
|
|
5
5
|
import { AppLookupParams as GraphQLAppLookupParams } from '../api/GraphqlClient';
|
|
6
|
+
import { Target } from '../types';
|
|
6
7
|
interface Options {
|
|
7
8
|
app: GraphQLAppLookupParams;
|
|
8
9
|
distribution: DistributionType;
|
|
9
10
|
enterpriseProvisioning?: IosEnterpriseProvisioning;
|
|
10
11
|
entitlements: JSONObject;
|
|
12
|
+
target: Target;
|
|
11
13
|
}
|
|
12
14
|
export declare class SetUpTargetBuildCredentials {
|
|
13
15
|
private options;
|
|
@@ -30,20 +30,20 @@ class SetUpTargetBuildCredentials {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
async setupBuildCredentialsAsync(ctx) {
|
|
33
|
-
const { app, distribution, enterpriseProvisioning } = this.options;
|
|
33
|
+
const { app, distribution, enterpriseProvisioning, target } = this.options;
|
|
34
34
|
if (distribution === 'internal') {
|
|
35
35
|
if (enterpriseProvisioning === 'adhoc') {
|
|
36
|
-
return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile(app).runAsync(ctx);
|
|
36
|
+
return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile({ app, target }).runAsync(ctx);
|
|
37
37
|
}
|
|
38
38
|
else if (enterpriseProvisioning === 'universal') {
|
|
39
|
-
return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(app, generated_1.IosDistributionType.Enterprise).runAsync(ctx);
|
|
39
|
+
return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(app, target, generated_1.IosDistributionType.Enterprise).runAsync(ctx);
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
return await new SetUpInternalProvisioningProfile_1.SetUpInternalProvisioningProfile(app).runAsync(ctx);
|
|
42
|
+
return await new SetUpInternalProvisioningProfile_1.SetUpInternalProvisioningProfile({ app, target }).runAsync(ctx);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(app, generated_1.IosDistributionType.AppStore).runAsync(ctx);
|
|
46
|
+
return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(app, target, generated_1.IosDistributionType.AppStore).runAsync(ctx);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const apple_utils_1 = require("@expo/apple-utils");
|
|
6
6
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
7
7
|
const generated_1 = require("../../../graphql/generated");
|
|
8
|
+
const AppQuery_1 = require("../../../graphql/queries/AppQuery");
|
|
8
9
|
const bundleIdentifier_1 = require("../../../project/ios/bundleIdentifier");
|
|
9
10
|
const errors_1 = require("../errors");
|
|
10
11
|
const AppStoreConnectApiKeyMutation_1 = require("./graphql/mutations/AppStoreConnectApiKeyMutation");
|
|
@@ -15,7 +16,6 @@ const ApplePushKeyMutation_1 = require("./graphql/mutations/ApplePushKeyMutation
|
|
|
15
16
|
const AppleTeamMutation_1 = require("./graphql/mutations/AppleTeamMutation");
|
|
16
17
|
const IosAppBuildCredentialsMutation_1 = require("./graphql/mutations/IosAppBuildCredentialsMutation");
|
|
17
18
|
const IosAppCredentialsMutation_1 = require("./graphql/mutations/IosAppCredentialsMutation");
|
|
18
|
-
const AppQuery_1 = require("./graphql/queries/AppQuery");
|
|
19
19
|
const AppStoreConnectApiKeyQuery_1 = require("./graphql/queries/AppStoreConnectApiKeyQuery");
|
|
20
20
|
const AppleAppIdentifierQuery_1 = require("./graphql/queries/AppleAppIdentifierQuery");
|
|
21
21
|
const AppleDeviceQuery_1 = require("./graphql/queries/AppleDeviceQuery");
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
|
|
2
|
+
import { ProfileType } from '@expo/app-store';
|
|
1
3
|
import { AscApiKey, AscApiKeyInfo, DistributionCertificate, DistributionCertificateStoreInfo, ProvisioningProfile, ProvisioningProfileStoreInfo, PushKey, PushKeyStoreInfo } from './Credentials.types';
|
|
2
4
|
import { Options as AuthenticateOptions } from './authenticate';
|
|
3
5
|
import { AuthCtx, AuthenticationMode, UserAuthCtx } from './authenticateTypes';
|
|
6
|
+
import { ApplePlatform } from './constants';
|
|
4
7
|
import { AppLookupParams, IosCapabilitiesOptions } from './ensureAppExists';
|
|
5
8
|
import { ProfileClass } from './provisioningProfile';
|
|
6
9
|
export default class AppStoreApi {
|
|
@@ -17,10 +20,10 @@ export default class AppStoreApi {
|
|
|
17
20
|
createPushKeyAsync(name?: string): Promise<PushKey>;
|
|
18
21
|
revokePushKeyAsync(ids: string[]): Promise<void>;
|
|
19
22
|
useExistingProvisioningProfileAsync(bundleIdentifier: string, provisioningProfile: ProvisioningProfile, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
|
|
20
|
-
listProvisioningProfilesAsync(bundleIdentifier: string, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
|
|
21
|
-
createProvisioningProfileAsync(bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
|
|
22
|
-
revokeProvisioningProfileAsync(bundleIdentifier: string, profileClass?: ProfileClass): Promise<void>;
|
|
23
|
-
createOrReuseAdhocProvisioningProfileAsync(udids: string[], bundleIdentifier: string, distCertSerialNumber: string): Promise<ProvisioningProfile>;
|
|
23
|
+
listProvisioningProfilesAsync(bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
|
|
24
|
+
createProvisioningProfileAsync(bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
|
|
25
|
+
revokeProvisioningProfileAsync(bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<void>;
|
|
26
|
+
createOrReuseAdhocProvisioningProfileAsync(udids: string[], bundleIdentifier: string, distCertSerialNumber: string, profileType: ProfileType): Promise<ProvisioningProfile>;
|
|
24
27
|
listAscApiKeysAsync(): Promise<AscApiKeyInfo[]>;
|
|
25
28
|
getAscApiKeyAsync(keyId: string): Promise<AscApiKeyInfo | null>;
|
|
26
29
|
createAscApiKeyAsync({ nickname }: {
|
|
@@ -69,21 +69,21 @@ class AppStoreApi {
|
|
|
69
69
|
const ctx = await this.ensureAuthenticatedAsync();
|
|
70
70
|
return await (0, provisioningProfile_1.useExistingProvisioningProfileAsync)(ctx, bundleIdentifier, provisioningProfile, distCert);
|
|
71
71
|
}
|
|
72
|
-
async listProvisioningProfilesAsync(bundleIdentifier, profileClass) {
|
|
72
|
+
async listProvisioningProfilesAsync(bundleIdentifier, applePlatform, profileClass) {
|
|
73
73
|
const ctx = await this.ensureAuthenticatedAsync();
|
|
74
|
-
return await (0, provisioningProfile_1.listProvisioningProfilesAsync)(ctx, bundleIdentifier, profileClass);
|
|
74
|
+
return await (0, provisioningProfile_1.listProvisioningProfilesAsync)(ctx, bundleIdentifier, applePlatform, profileClass);
|
|
75
75
|
}
|
|
76
|
-
async createProvisioningProfileAsync(bundleIdentifier, distCert, profileName, profileClass) {
|
|
76
|
+
async createProvisioningProfileAsync(bundleIdentifier, distCert, profileName, applePlatform, profileClass) {
|
|
77
77
|
const ctx = await this.ensureAuthenticatedAsync();
|
|
78
|
-
return await (0, provisioningProfile_1.createProvisioningProfileAsync)(ctx, bundleIdentifier, distCert, profileName, profileClass);
|
|
78
|
+
return await (0, provisioningProfile_1.createProvisioningProfileAsync)(ctx, bundleIdentifier, distCert, profileName, applePlatform, profileClass);
|
|
79
79
|
}
|
|
80
|
-
async revokeProvisioningProfileAsync(bundleIdentifier, profileClass) {
|
|
80
|
+
async revokeProvisioningProfileAsync(bundleIdentifier, applePlatform, profileClass) {
|
|
81
81
|
const ctx = await this.ensureAuthenticatedAsync();
|
|
82
|
-
return await (0, provisioningProfile_1.revokeProvisioningProfileAsync)(ctx, bundleIdentifier, profileClass);
|
|
82
|
+
return await (0, provisioningProfile_1.revokeProvisioningProfileAsync)(ctx, bundleIdentifier, applePlatform, profileClass);
|
|
83
83
|
}
|
|
84
|
-
async createOrReuseAdhocProvisioningProfileAsync(udids, bundleIdentifier, distCertSerialNumber) {
|
|
84
|
+
async createOrReuseAdhocProvisioningProfileAsync(udids, bundleIdentifier, distCertSerialNumber, profileType) {
|
|
85
85
|
const ctx = await this.ensureAuthenticatedAsync();
|
|
86
|
-
return await (0, provisioningProfileAdhoc_1.createOrReuseAdhocProvisioningProfileAsync)(ctx, udids, bundleIdentifier, distCertSerialNumber);
|
|
86
|
+
return await (0, provisioningProfileAdhoc_1.createOrReuseAdhocProvisioningProfileAsync)(ctx, udids, bundleIdentifier, distCertSerialNumber, profileType);
|
|
87
87
|
}
|
|
88
88
|
async listAscApiKeysAsync() {
|
|
89
89
|
const userCtx = await this.ensureUserAuthenticatedAsync();
|