eas-cli 2.0.0 → 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.
Files changed (54) hide show
  1. package/README.md +65 -50
  2. package/build/branch/queries.js +11 -8
  3. package/build/build/android/graphql.js +2 -1
  4. package/build/build/android/prepareJob.js +3 -1
  5. package/build/build/ios/graphql.js +2 -1
  6. package/build/build/ios/prepareJob.js +3 -1
  7. package/build/commands/branch/delete.js +1 -1
  8. package/build/commands/build/index.js +55 -1
  9. package/build/commands/channel/delete.js +1 -1
  10. package/build/commands/device/delete.js +3 -2
  11. package/build/commands/open.d.ts +5 -0
  12. package/build/commands/open.js +40 -0
  13. package/build/commands/secret/delete.js +1 -1
  14. package/build/commands/update/configure.js +4 -4
  15. package/build/commands/update/delete.js +1 -1
  16. package/build/commands/webhook/delete.js +1 -1
  17. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +3 -1
  18. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +5 -2
  19. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +3 -1
  20. package/build/credentials/ios/actions/CreateProvisioningProfile.js +3 -2
  21. package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -1
  22. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +4 -2
  23. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +8 -2
  24. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +30 -18
  25. package/build/credentials/ios/actions/SetUpBuildCredentials.js +1 -0
  26. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +8 -2
  27. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.js +6 -12
  28. package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +3 -1
  29. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +8 -5
  30. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +2 -0
  31. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +5 -5
  32. package/build/credentials/ios/appstore/AppStoreApi.d.ts +7 -4
  33. package/build/credentials/ios/appstore/AppStoreApi.js +8 -8
  34. package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -14
  35. package/build/credentials/ios/appstore/Credentials.types.js +0 -6
  36. package/build/credentials/ios/appstore/constants.d.ts +1 -0
  37. package/build/credentials/ios/appstore/constants.js +6 -0
  38. package/build/credentials/ios/appstore/distributionCertificate.js +1 -1
  39. package/build/credentials/ios/appstore/provisioningProfile.d.ts +5 -3
  40. package/build/credentials/ios/appstore/provisioningProfile.js +30 -7
  41. package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +3 -1
  42. package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +10 -10
  43. package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +2 -1
  44. package/build/credentials/ios/validators/validateProvisioningProfile.js +6 -4
  45. package/build/credentials/manager/ManageIos.js +8 -5
  46. package/build/devices/actions/create/developerPortalMethod.js +2 -2
  47. package/build/graphql/generated.d.ts +39 -0
  48. package/build/project/ios/target.d.ts +7 -0
  49. package/build/project/ios/target.js +26 -1
  50. package/build/project/workflow.js +3 -1
  51. package/build/vcs/clients/git.js +4 -1
  52. package/build/vcs/clients/gitNoCommit.js +2 -1
  53. package/oclif.manifest.json +1 -1
  54. package/package.json +6 -5
@@ -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();
@@ -1,19 +1,5 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
2
  import { UserRole } from '@expo/apple-utils';
3
- export interface Device {
4
- id: string;
5
- teamId: string;
6
- identifier: string;
7
- name?: string;
8
- model?: string;
9
- deviceClass?: DeviceClass;
10
- softwareVersion?: string;
11
- enabled: boolean;
12
- }
13
- export declare enum DeviceClass {
14
- IPHONE = "iphone",
15
- IPAD = "ipad"
16
- }
17
3
  export interface DistributionCertificateStoreInfo {
18
4
  id: string;
19
5
  name: string;
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceClass = void 0;
4
- var DeviceClass;
5
- (function (DeviceClass) {
6
- DeviceClass["IPHONE"] = "iphone";
7
- DeviceClass["IPAD"] = "ipad";
8
- })(DeviceClass = exports.DeviceClass || (exports.DeviceClass = {}));
@@ -0,0 +1 @@
1
+ export { Platform as ApplePlatform } from '@expo/apple-utils';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplePlatform = void 0;
4
+ // Renamed to avoid conflation with Android/iOS/Web Platform constants
5
+ var apple_utils_1 = require("@expo/apple-utils");
6
+ Object.defineProperty(exports, "ApplePlatform", { enumerable: true, get: function () { return apple_utils_1.Platform; } });
@@ -21,7 +21,7 @@ async function getDistributionCertificateAsync(context, serialNumber) {
21
21
  const certificates = await apple_utils_1.Certificate.getAsync(context, {
22
22
  query: {
23
23
  filter: {
24
- certificateType: apple_utils_1.CertificateType.IOS_DISTRIBUTION,
24
+ certificateType: [apple_utils_1.CertificateType.IOS_DISTRIBUTION, apple_utils_1.CertificateType.DISTRIBUTION],
25
25
  },
26
26
  },
27
27
  });
@@ -1,10 +1,12 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
1
2
  import { DistributionCertificate, ProvisioningProfile, ProvisioningProfileStoreInfo } from './Credentials.types';
2
3
  import { AuthCtx } from './authenticateTypes';
4
+ import { ApplePlatform } from './constants';
3
5
  export declare enum ProfileClass {
4
6
  Adhoc = "ad_hoc",
5
7
  General = "general"
6
8
  }
7
9
  export declare function useExistingProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, provisioningProfile: ProvisioningProfile, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
8
- export declare function listProvisioningProfilesAsync(authCtx: AuthCtx, bundleIdentifier: string, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
9
- export declare function createProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
10
- export declare function revokeProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, profileClass?: ProfileClass): Promise<void>;
10
+ export declare function listProvisioningProfilesAsync(authCtx: AuthCtx, bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
11
+ export declare function createProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
12
+ export declare function revokeProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<void>;
@@ -7,13 +7,36 @@ const authType_1 = require("../utils/authType");
7
7
  const p12Certificate_1 = require("../utils/p12Certificate");
8
8
  const authenticate_1 = require("./authenticate");
9
9
  const bundleId_1 = require("./bundleId");
10
+ const constants_1 = require("./constants");
10
11
  const distributionCertificate_1 = require("./distributionCertificate");
11
12
  var ProfileClass;
12
13
  (function (ProfileClass) {
13
14
  ProfileClass["Adhoc"] = "ad_hoc";
14
15
  ProfileClass["General"] = "general";
15
16
  })(ProfileClass = exports.ProfileClass || (exports.ProfileClass = {}));
16
- function resolveProfileType(profileClass, isEnterprise) {
17
+ function resolveProfileType(applePlatform, profileClass, isEnterprise) {
18
+ switch (applePlatform) {
19
+ case constants_1.ApplePlatform.IOS:
20
+ return resolveProfileTypeIos(profileClass, isEnterprise);
21
+ case constants_1.ApplePlatform.TV_OS:
22
+ return resolveProfileTypeAppleTv(profileClass, isEnterprise);
23
+ case constants_1.ApplePlatform.MAC_OS:
24
+ throw new Error(`${applePlatform} profiles are not supported`);
25
+ }
26
+ }
27
+ function resolveProfileTypeAppleTv(profileClass, isEnterprise) {
28
+ if (isEnterprise) {
29
+ return profileClass === ProfileClass.Adhoc
30
+ ? apple_utils_1.ProfileType.TVOS_APP_ADHOC
31
+ : apple_utils_1.ProfileType.TVOS_APP_INHOUSE;
32
+ }
33
+ else {
34
+ return profileClass === ProfileClass.Adhoc
35
+ ? apple_utils_1.ProfileType.TVOS_APP_ADHOC
36
+ : apple_utils_1.ProfileType.TVOS_APP_STORE;
37
+ }
38
+ }
39
+ function resolveProfileTypeIos(profileClass, isEnterprise) {
17
40
  if (isEnterprise) {
18
41
  return profileClass === ProfileClass.Adhoc
19
42
  ? apple_utils_1.ProfileType.IOS_APP_ADHOC
@@ -95,11 +118,11 @@ async function useExistingProvisioningProfileAsync(authCtx, bundleIdentifier, pr
95
118
  }
96
119
  }
97
120
  exports.useExistingProvisioningProfileAsync = useExistingProvisioningProfileAsync;
98
- async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, profileClass = ProfileClass.General) {
121
+ async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, applePlatform, profileClass = ProfileClass.General) {
99
122
  const spinner = (0, ora_1.ora)(`Fetching Apple provisioning profiles`).start();
100
123
  try {
101
124
  const context = (0, authenticate_1.getRequestContext)(authCtx);
102
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
125
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
103
126
  const profiles = (await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleIdentifier)).filter(profile => profile.attributes.profileType === profileType);
104
127
  const result = await Promise.all(profiles.map(profile => transformProfileAsync(profile, authCtx)));
105
128
  spinner.succeed(`Fetched Apple provisioning profiles`);
@@ -111,14 +134,14 @@ async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, profileC
111
134
  }
112
135
  }
113
136
  exports.listProvisioningProfilesAsync = listProvisioningProfilesAsync;
114
- async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCert, profileName, profileClass = ProfileClass.General) {
137
+ async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCert, profileName, applePlatform, profileClass = ProfileClass.General) {
115
138
  const spinner = (0, ora_1.ora)(`Creating Apple provisioning profile`).start();
116
139
  try {
117
140
  if (!distCert.distCertSerialNumber) {
118
141
  distCert.distCertSerialNumber = (0, p12Certificate_1.findP12CertSerialNumber)(distCert.certP12, distCert.certPassword);
119
142
  }
120
143
  const context = (0, authenticate_1.getRequestContext)(authCtx);
121
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
144
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
122
145
  const certificate = await (0, distributionCertificate_1.getCertificateBySerialNumberAsync)(context, distCert.distCertSerialNumber);
123
146
  const bundleIdItem = await (0, bundleId_1.getBundleIdForIdentifierAsync)(context, bundleIdentifier);
124
147
  const profile = await apple_utils_1.Profile.createAsync(context, {
@@ -138,12 +161,12 @@ async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCer
138
161
  }
139
162
  }
140
163
  exports.createProvisioningProfileAsync = createProvisioningProfileAsync;
141
- async function revokeProvisioningProfileAsync(authCtx, bundleIdentifier, profileClass = ProfileClass.General) {
164
+ async function revokeProvisioningProfileAsync(authCtx, bundleIdentifier, applePlatform, profileClass = ProfileClass.General) {
142
165
  const spinner = (0, ora_1.ora)(`Revoking Apple provisioning profile`).start();
143
166
  try {
144
167
  const context = (0, authenticate_1.getRequestContext)(authCtx);
145
168
  const profiles = await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleIdentifier);
146
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
169
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
147
170
  await Promise.all(profiles
148
171
  .filter(profile => profile.attributes.profileType === profileType)
149
172
  .map(profile => apple_utils_1.Profile.deleteAsync(context, { id: profile.id })));
@@ -1,3 +1,5 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
+ import { ProfileType } from '@expo/apple-utils';
1
3
  import { ProvisioningProfile } from './Credentials.types';
2
4
  import { AuthCtx } from './authenticateTypes';
3
- export declare function createOrReuseAdhocProvisioningProfileAsync(authCtx: AuthCtx, udids: string[], bundleIdentifier: string, distCertSerialNumber: string): Promise<ProvisioningProfile>;
5
+ export declare function createOrReuseAdhocProvisioningProfileAsync(authCtx: AuthCtx, udids: string[], bundleIdentifier: string, distCertSerialNumber: string, profileType: ProfileType): Promise<ProvisioningProfile>;
@@ -12,8 +12,8 @@ function uniqueItems(items) {
12
12
  return [...set];
13
13
  }
14
14
  async function registerMissingDevicesAsync(context, udids) {
15
- const allIosProfileDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync(context);
16
- const alreadyAdded = allIosProfileDevices.filter(device => udids.includes(device.attributes.udid));
15
+ const allDevices = await apple_utils_1.Device.getAsync(context);
16
+ const alreadyAdded = allDevices.filter(device => udids.includes(device.attributes.udid));
17
17
  const alreadyAddedUdids = alreadyAdded.map(i => i.attributes.udid);
18
18
  await Promise.all(udids.map(async (udid) => {
19
19
  if (!alreadyAddedUdids.includes(udid)) {
@@ -26,9 +26,9 @@ async function registerMissingDevicesAsync(context, udids) {
26
26
  }));
27
27
  return alreadyAdded;
28
28
  }
29
- async function findProfileByBundleIdAsync(context, bundleId, certSerialNumber) {
29
+ async function findProfileAsync(context, { bundleId, certSerialNumber, profileType, }) {
30
30
  const expoProfiles = (await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleId)).filter(profile => {
31
- return (profile.attributes.profileType === apple_utils_1.ProfileType.IOS_APP_ADHOC &&
31
+ return (profile.attributes.profileType === profileType &&
32
32
  profile.attributes.name.startsWith('*[expo]') &&
33
33
  profile.attributes.profileState !== apple_utils_1.ProfileState.EXPIRED);
34
34
  });
@@ -79,7 +79,7 @@ async function findProfileByIdAsync(context, profileId, bundleId) {
79
79
  profiles = profiles.filter(profile => profile.attributes.profileType === apple_utils_1.ProfileType.IOS_APP_ADHOC);
80
80
  return (_a = profiles.find(profile => profile.id === profileId)) !== null && _a !== void 0 ? _a : null;
81
81
  }
82
- async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNumber, profileId, }) {
82
+ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNumber, profileId, profileType, }) {
83
83
  var _a, _b, _c, _d, _e;
84
84
  // We register all missing devices on the Apple Developer Portal. They are identified by UDIDs.
85
85
  const devices = await registerMissingDevicesAsync(context, udids);
@@ -94,7 +94,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
94
94
  }
95
95
  else {
96
96
  // If no profile id is passed, try to find a suitable provisioning profile for the App ID.
97
- const results = await findProfileByBundleIdAsync(context, bundleId, certSerialNumber);
97
+ const results = await findProfileAsync(context, { bundleId, certSerialNumber, profileType });
98
98
  existingProfile = results.profile;
99
99
  didUpdate = results.didUpdate;
100
100
  }
@@ -126,8 +126,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
126
126
  // This method does not support App Store Connect API.
127
127
  await existingProfile.regenerateAsync();
128
128
  }
129
- const updatedProfile = (await findProfileByBundleIdAsync(context, bundleId, certSerialNumber))
130
- .profile;
129
+ const updatedProfile = (await findProfileAsync(context, { bundleId, certSerialNumber, profileType })).profile;
131
130
  if (!updatedProfile) {
132
131
  throw new Error(`Failed to locate updated profile for bundle identifier "${bundleId}" and serial number "${certSerialNumber}"`);
133
132
  }
@@ -153,7 +152,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
153
152
  name: `*[expo] ${bundleId} AdHoc ${Date.now()}`,
154
153
  certificates: [distributionCertificate.id],
155
154
  devices: devices.map(device => device.id),
156
- profileType: apple_utils_1.ProfileType.IOS_APP_ADHOC,
155
+ profileType,
157
156
  });
158
157
  return {
159
158
  didUpdate: true,
@@ -163,7 +162,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
163
162
  provisioningProfile: newProfile.attributes.profileContent,
164
163
  };
165
164
  }
166
- async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundleIdentifier, distCertSerialNumber) {
165
+ async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundleIdentifier, distCertSerialNumber, profileType) {
167
166
  const spinner = (0, ora_1.ora)(`Handling Apple ad hoc provisioning profiles`).start();
168
167
  try {
169
168
  const context = (0, authenticate_1.getRequestContext)(authCtx);
@@ -171,6 +170,7 @@ async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundle
171
170
  udids,
172
171
  bundleId: bundleIdentifier,
173
172
  certSerialNumber: distCertSerialNumber,
173
+ profileType,
174
174
  });
175
175
  if (didCreate) {
176
176
  spinner.succeed(`Created new profile: ${profileName}`);
@@ -1,4 +1,5 @@
1
1
  import { IosAppBuildCredentialsFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare function validateProvisioningProfileAsync(ctx: CredentialsContext, app: AppLookupParams, buildCredentials: Partial<IosAppBuildCredentialsFragment> | null): Promise<boolean>;
4
+ import { Target } from '../types';
5
+ export declare function validateProvisioningProfileAsync(ctx: CredentialsContext, target: Target, app: AppLookupParams, buildCredentials: Partial<IosAppBuildCredentialsFragment> | null): Promise<boolean>;
@@ -8,10 +8,11 @@ const minimatch_1 = tslib_1.__importDefault(require("minimatch"));
8
8
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
9
9
  const generated_1 = require("../../../graphql/generated");
10
10
  const log_1 = tslib_1.__importDefault(require("../../../log"));
11
+ const target_1 = require("../../../project/ios/target");
11
12
  const provisioningProfile_1 = require("../appstore/provisioningProfile");
12
13
  const p12Certificate_1 = require("../utils/p12Certificate");
13
14
  const provisioningProfile_2 = require("../utils/provisioningProfile");
14
- async function validateProvisioningProfileAsync(ctx, app, buildCredentials) {
15
+ async function validateProvisioningProfileAsync(ctx, target, app, buildCredentials) {
15
16
  if (!buildCredentials ||
16
17
  !buildCredentials.distributionCertificate ||
17
18
  !buildCredentials.provisioningProfile) {
@@ -25,7 +26,7 @@ async function validateProvisioningProfileAsync(ctx, app, buildCredentials) {
25
26
  log_1.default.warn("Skipping Provisioning Profile validation on Apple Servers because we aren't authenticated.");
26
27
  return true;
27
28
  }
28
- return await validateProvisioningProfileWithAppleAsync(ctx, app, buildCredentials);
29
+ return await validateProvisioningProfileWithAppleAsync(ctx, target, app, buildCredentials);
29
30
  }
30
31
  exports.validateProvisioningProfileAsync = validateProvisioningProfileAsync;
31
32
  function validateProvisioningProfileWithoutApple(app, { provisioningProfile, distributionCertificate }) {
@@ -59,10 +60,11 @@ function validateProvisioningProfileWithoutApple(app, { provisioningProfile, dis
59
60
  }
60
61
  return true;
61
62
  }
62
- async function validateProvisioningProfileWithAppleAsync(ctx, app, buildCredentials) {
63
+ async function validateProvisioningProfileWithAppleAsync(ctx, target, app, buildCredentials) {
63
64
  (0, assert_1.default)(buildCredentials.provisioningProfile, 'Provisioning Profile must be defined');
64
65
  const { developerPortalIdentifier, provisioningProfile } = buildCredentials.provisioningProfile;
65
- const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(app.bundleIdentifier, buildCredentials.iosDistributionType === generated_1.IosDistributionType.AdHoc
66
+ const applePlatform = await (0, target_1.getApplePlatformFromSdkRoot)(target);
67
+ const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(app.bundleIdentifier, applePlatform, buildCredentials.iosDistributionType === generated_1.IosDistributionType.AdHoc
66
68
  ? provisioningProfile_1.ProfileClass.Adhoc
67
69
  : provisioningProfile_1.ProfileClass.General);
68
70
  const configuredProfileFromApple = profilesFromApple.find(appleProfile => developerPortalIdentifier
@@ -214,7 +214,7 @@ class ManageIos {
214
214
  if (!distCert) {
215
215
  return;
216
216
  }
217
- await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType);
217
+ await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType);
218
218
  return;
219
219
  }
220
220
  case Actions_1.IosActionType.CreateDistributionCertificate: {
@@ -223,7 +223,7 @@ class ManageIos {
223
223
  message: `Do you want ${appLookupParams.projectName} to use the new Distribution Certificate?`,
224
224
  });
225
225
  if (confirm) {
226
- await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType);
226
+ await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType);
227
227
  }
228
228
  return;
229
229
  }
@@ -297,14 +297,17 @@ class ManageIos {
297
297
  throw new Error('Unknown action selected');
298
298
  }
299
299
  }
300
- async setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType) {
300
+ async setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType) {
301
301
  log_1.default.log(`Setting up ${appLookupParams.projectName} to use Distribution Certificate`);
302
302
  log_1.default.log(`Creating provisioning profile...`);
303
303
  if (distributionType === generated_1.IosDistributionType.AdHoc) {
304
- return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile(appLookupParams).runWithDistributionCertificateAsync(ctx, distCert);
304
+ return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile({
305
+ app: appLookupParams,
306
+ target,
307
+ }).runWithDistributionCertificateAsync(ctx, distCert);
305
308
  }
306
309
  else {
307
- return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(appLookupParams, distributionType).createAndAssignProfileAsync(ctx, distCert);
310
+ return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(appLookupParams, target, distributionType).createAndAssignProfileAsync(ctx, distCert);
308
311
  }
309
312
  }
310
313
  async selectTargetAsync(targets) {
@@ -59,9 +59,9 @@ async function findUnregisteredPortalDevicesAsync(appleAuthCtx, accountId, apple
59
59
  acc[device.identifier] = device;
60
60
  return acc;
61
61
  }, {});
62
- const portalDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync((0, authenticate_1.getRequestContext)(appleAuthCtx));
62
+ const portalDevices = await apple_utils_1.Device.getAsync((0, authenticate_1.getRequestContext)(appleAuthCtx));
63
63
  return portalDevices.filter(portalDevice => !(portalDevice.attributes.udid in expoRegisteredDevicesByUdid) &&
64
- [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE].includes(portalDevice.attributes.deviceClass));
64
+ [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE, apple_utils_1.DeviceClass.APPLE_TV].includes(portalDevice.attributes.deviceClass));
65
65
  }
66
66
  async function chooseDevicesToImportAsync(devices) {
67
67
  const { chosenDevices } = await (0, prompts_1.promptAsync)({
@@ -654,7 +654,10 @@ export declare type AndroidJobBuildCredentialsInput = {
654
654
  keystore: AndroidJobKeystoreInput;
655
655
  };
656
656
  export declare type AndroidJobInput = {
657
+ applicationArchivePath?: InputMaybe<Scalars['String']>;
658
+ /** @deprecated */
657
659
  artifactPath?: InputMaybe<Scalars['String']>;
660
+ buildArtifactPaths?: InputMaybe<Array<Scalars['String']>>;
658
661
  buildType?: InputMaybe<AndroidBuildType>;
659
662
  builderEnvironment?: InputMaybe<AndroidBuilderEnvironmentInput>;
660
663
  cache?: InputMaybe<BuildCacheInput>;
@@ -677,7 +680,10 @@ export declare type AndroidJobKeystoreInput = {
677
680
  keystorePassword: Scalars['String'];
678
681
  };
679
682
  export declare type AndroidJobOverridesInput = {
683
+ applicationArchivePath?: InputMaybe<Scalars['String']>;
684
+ /** @deprecated */
680
685
  artifactPath?: InputMaybe<Scalars['String']>;
686
+ buildArtifactPaths?: InputMaybe<Array<Scalars['String']>>;
681
687
  buildType?: InputMaybe<AndroidBuildType>;
682
688
  builderEnvironment?: InputMaybe<AndroidBuilderEnvironmentInput>;
683
689
  cache?: InputMaybe<BuildCacheInput>;
@@ -840,6 +846,8 @@ export declare type App = Project & {
840
846
  updateChannelByName?: Maybe<UpdateChannel>;
841
847
  /** EAS channels owned by an app */
842
848
  updateChannels: Array<UpdateChannel>;
849
+ /** EAS updates owned by an app grouped by update group */
850
+ updateGroups: Array<Array<Update>>;
843
851
  /** Time of last classic update publish */
844
852
  updated: Scalars['DateTime'];
845
853
  /** EAS updates owned by an app */
@@ -854,6 +862,7 @@ export declare type App = Project & {
854
862
  /** Represents an Exponent App (or Experience in legacy terms) */
855
863
  export declare type AppActivityTimelineProjectActivitiesArgs = {
856
864
  createdBefore?: InputMaybe<Scalars['DateTime']>;
865
+ filterChannels?: InputMaybe<Array<Scalars['String']>>;
857
866
  filterPlatforms?: InputMaybe<Array<AppPlatform>>;
858
867
  filterReleaseChannels?: InputMaybe<Array<Scalars['String']>>;
859
868
  filterTypes?: InputMaybe<Array<ActivityTimelineProjectActivityType>>;
@@ -942,6 +951,12 @@ export declare type AppUpdateChannelsArgs = {
942
951
  offset: Scalars['Int'];
943
952
  };
944
953
  /** Represents an Exponent App (or Experience in legacy terms) */
954
+ export declare type AppUpdateGroupsArgs = {
955
+ filter?: InputMaybe<UpdatesFilter>;
956
+ limit: Scalars['Int'];
957
+ offset: Scalars['Int'];
958
+ };
959
+ /** Represents an Exponent App (or Experience in legacy terms) */
945
960
  export declare type AppUpdatesArgs = {
946
961
  limit: Scalars['Int'];
947
962
  offset: Scalars['Int'];
@@ -1493,6 +1508,8 @@ export declare type BuildArtifact = {
1493
1508
  };
1494
1509
  export declare type BuildArtifacts = {
1495
1510
  __typename?: 'BuildArtifacts';
1511
+ applicationArchiveUrl?: Maybe<Scalars['String']>;
1512
+ buildArtifactsUrl?: Maybe<Scalars['String']>;
1496
1513
  buildUrl?: Maybe<Scalars['String']>;
1497
1514
  xcodeBuildLogsUrl?: Maybe<Scalars['String']>;
1498
1515
  };
@@ -1921,6 +1938,10 @@ export declare type DeleteWebhookResult = {
1921
1938
  __typename?: 'DeleteWebhookResult';
1922
1939
  id: Scalars['ID'];
1923
1940
  };
1941
+ export declare type DeployServerlessFunctionResult = {
1942
+ __typename?: 'DeployServerlessFunctionResult';
1943
+ url: Scalars['String'];
1944
+ };
1924
1945
  /** Represents a Deployment - a set of Builds with the same Runtime Version and Channel */
1925
1946
  export declare type Deployment = {
1926
1947
  __typename?: 'Deployment';
@@ -2274,7 +2295,10 @@ export declare type IosJobDistributionCertificateInput = {
2274
2295
  password: Scalars['String'];
2275
2296
  };
2276
2297
  export declare type IosJobInput = {
2298
+ applicationArchivePath?: InputMaybe<Scalars['String']>;
2299
+ /** @deprecated */
2277
2300
  artifactPath?: InputMaybe<Scalars['String']>;
2301
+ buildArtifactPaths?: InputMaybe<Array<Scalars['String']>>;
2278
2302
  buildConfiguration?: InputMaybe<Scalars['String']>;
2279
2303
  /** @deprecated */
2280
2304
  buildType?: InputMaybe<IosBuildType>;
@@ -2296,7 +2320,10 @@ export declare type IosJobInput = {
2296
2320
  version?: InputMaybe<IosJobVersionInput>;
2297
2321
  };
2298
2322
  export declare type IosJobOverridesInput = {
2323
+ applicationArchivePath?: InputMaybe<Scalars['String']>;
2324
+ /** @deprecated */
2299
2325
  artifactPath?: InputMaybe<Scalars['String']>;
2326
+ buildArtifactPaths?: InputMaybe<Array<Scalars['String']>>;
2300
2327
  buildConfiguration?: InputMaybe<Scalars['String']>;
2301
2328
  /** @deprecated */
2302
2329
  buildType?: InputMaybe<IosBuildType>;
@@ -2570,6 +2597,7 @@ export declare type ProjectQueryByUsernameAndSlugArgs = {
2570
2597
  };
2571
2598
  export declare type PublicArtifacts = {
2572
2599
  __typename?: 'PublicArtifacts';
2600
+ applicationArchiveUrl?: Maybe<Scalars['String']>;
2573
2601
  buildUrl?: Maybe<Scalars['String']>;
2574
2602
  };
2575
2603
  export declare type PublishUpdateGroupInput = {
@@ -2852,8 +2880,13 @@ export declare type ServerlessFunctionIdentifierInput = {
2852
2880
  };
2853
2881
  export declare type ServerlessFunctionMutation = {
2854
2882
  __typename?: 'ServerlessFunctionMutation';
2883
+ createDeployment: DeployServerlessFunctionResult;
2855
2884
  createUploadPresignedUrl: CreateServerlessFunctionUploadUrlResult;
2856
2885
  };
2886
+ export declare type ServerlessFunctionMutationCreateDeploymentArgs = {
2887
+ appId: Scalars['ID'];
2888
+ serverlessFunctionIdentifierInput: ServerlessFunctionIdentifierInput;
2889
+ };
2857
2890
  export declare type ServerlessFunctionMutationCreateUploadPresignedUrlArgs = {
2858
2891
  appId: Scalars['ID'];
2859
2892
  serverlessFunctionIdentifierInput: ServerlessFunctionIdentifierInput;
@@ -3136,9 +3169,15 @@ export declare type UpdateBranch = {
3136
3169
  createdAt: Scalars['DateTime'];
3137
3170
  id: Scalars['ID'];
3138
3171
  name: Scalars['String'];
3172
+ updateGroups: Array<Array<Update>>;
3139
3173
  updatedAt: Scalars['DateTime'];
3140
3174
  updates: Array<Update>;
3141
3175
  };
3176
+ export declare type UpdateBranchUpdateGroupsArgs = {
3177
+ filter?: InputMaybe<UpdatesFilter>;
3178
+ limit: Scalars['Int'];
3179
+ offset: Scalars['Int'];
3180
+ };
3142
3181
  export declare type UpdateBranchUpdatesArgs = {
3143
3182
  filter?: InputMaybe<UpdatesFilter>;
3144
3183
  limit: Scalars['Int'];
@@ -1,4 +1,6 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
1
2
  import { ExpoConfig } from '@expo/config';
3
+ import { ApplePlatform } from '../../credentials/ios/appstore/constants';
2
4
  import { Target } from '../../credentials/ios/types';
3
5
  import { XcodeBuildContext } from './scheme';
4
6
  interface ResolveTargetOptions {
@@ -12,4 +14,9 @@ export declare function resolveBareProjectTargetsAsync({ exp, projectDir, xcodeB
12
14
  export declare function resolveTargetsAsync(opts: ResolveTargetOptions): Promise<Target[]>;
13
15
  export declare function findApplicationTarget(targets: Target[]): Target;
14
16
  export declare function findTargetByName(targets: Target[], name: string): Target;
17
+ /**
18
+ * Get Apple Platform from the Xcode SDKROOT where possible.
19
+ * @returns - Apple Platform when known, defaults to IOS when unknown
20
+ */
21
+ export declare function getApplePlatformFromSdkRoot(target: Target): ApplePlatform;
15
22
  export {};
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findTargetByName = exports.findApplicationTarget = exports.resolveTargetsAsync = exports.resolveBareProjectTargetsAsync = exports.resolveMangedProjectTargetsAsync = void 0;
3
+ exports.getApplePlatformFromSdkRoot = exports.findTargetByName = exports.findApplicationTarget = exports.resolveTargetsAsync = exports.resolveBareProjectTargetsAsync = exports.resolveMangedProjectTargetsAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_plugins_1 = require("@expo/config-plugins");
6
6
  const eas_build_job_1 = require("@expo/eas-build-job");
7
7
  const joi_1 = tslib_1.__importDefault(require("joi"));
8
+ const constants_1 = require("../../credentials/ios/appstore/constants");
8
9
  const workflow_1 = require("../workflow");
9
10
  const bundleIdentifier_1 = require("./bundleIdentifier");
10
11
  const entitlements_1 = require("./entitlements");
@@ -158,3 +159,27 @@ function resolveBareProjectBuildSettings(project, targetName, buildConfiguration
158
159
  });
159
160
  return (_a = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : xcBuildConfiguration.buildSettings) !== null && _a !== void 0 ? _a : {};
160
161
  }
162
+ /**
163
+ * Get Apple Platform from the Xcode SDKROOT where possible.
164
+ * @returns - Apple Platform when known, defaults to IOS when unknown
165
+ */
166
+ function getApplePlatformFromSdkRoot(target) {
167
+ var _a;
168
+ const sdkRoot = (_a = target.buildSettings) === null || _a === void 0 ? void 0 : _a.SDKROOT;
169
+ if (!sdkRoot) {
170
+ return constants_1.ApplePlatform.IOS;
171
+ }
172
+ if (sdkRoot.includes('iphoneos')) {
173
+ return constants_1.ApplePlatform.IOS;
174
+ }
175
+ else if (sdkRoot.includes('tvos')) {
176
+ return constants_1.ApplePlatform.TV_OS;
177
+ }
178
+ else if (sdkRoot.includes('macosx')) {
179
+ return constants_1.ApplePlatform.MAC_OS;
180
+ }
181
+ else {
182
+ return constants_1.ApplePlatform.IOS;
183
+ }
184
+ }
185
+ exports.getApplePlatformFromSdkRoot = getApplePlatformFromSdkRoot;
@@ -21,9 +21,11 @@ async function resolveWorkflowAsync(projectDir, platform) {
21
21
  catch {
22
22
  return eas_build_job_1.Workflow.MANAGED;
23
23
  }
24
+ const vcsClient = (0, vcs_1.getVcsClient)();
25
+ const vcsRootPath = path_1.default.normalize(await vcsClient.getRootPathAsync());
24
26
  for (const marker of platformWorkflowMarkers) {
25
27
  if ((await fs_extra_1.default.pathExists(marker)) &&
26
- !(await (0, vcs_1.getVcsClient)().isFileIgnoredAsync(path_1.default.relative(projectDir, marker)))) {
28
+ !(await vcsClient.isFileIgnoredAsync(path_1.default.relative(vcsRootPath, marker)))) {
27
29
  return eas_build_job_1.Workflow.GENERIC;
28
30
  }
29
31
  }
@@ -6,6 +6,7 @@ const PackageManagerUtils = tslib_1.__importStar(require("@expo/package-manager"
6
6
  const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
7
7
  const core_1 = require("@oclif/core");
8
8
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
9
+ const path_1 = tslib_1.__importDefault(require("path"));
9
10
  const log_1 = tslib_1.__importStar(require("../../log"));
10
11
  const ora_1 = require("../../ora");
11
12
  const prompts_1 = require("../../prompts");
@@ -153,7 +154,9 @@ class GitClient extends vcs_1.Client {
153
154
  }
154
155
  async isFileIgnoredAsync(filePath) {
155
156
  try {
156
- await (0, spawn_async_1.default)('git', ['check-ignore', '-q', filePath]);
157
+ await (0, spawn_async_1.default)('git', ['check-ignore', '-q', filePath], {
158
+ cwd: path_1.default.normalize(await this.getRootPathAsync()),
159
+ });
157
160
  return true;
158
161
  }
159
162
  catch {
@@ -21,7 +21,8 @@ class GitNoCommitClient extends git_1.default {
21
21
  }
22
22
  async isFileIgnoredAsync(filePath) {
23
23
  // normalize converts C:/some/path to C:\some\path on windows
24
- const ignore = new local_1.Ignore(await this.getRootPathAsync());
24
+ const rootPath = path_1.default.normalize(await this.getRootPathAsync());
25
+ const ignore = new local_1.Ignore(rootPath);
25
26
  await ignore.initIgnoreAsync();
26
27
  return ignore.ignores(filePath);
27
28
  }