eas-cli 21.8.0 → 22.0.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 (56) hide show
  1. package/README.md +166 -156
  2. package/build/build/android/prepareJob.js +1 -0
  3. package/build/build/ios/prepareJob.js +1 -0
  4. package/build/build/metadata.js +0 -1
  5. package/build/build/runBuildAndSubmit.js +1 -1
  6. package/build/build/utils/formatBuild.js +2 -2
  7. package/build/build/utils/url.js +3 -5
  8. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +10 -3
  9. package/build/commandUtils/new/configs.js +1 -1
  10. package/build/commands/account/view.js +1 -2
  11. package/build/commands/build/cancel.js +3 -3
  12. package/build/commands/build/download.js +1 -1
  13. package/build/commands/go.js +2 -45
  14. package/build/commands/project/icon/set.js +4 -40
  15. package/build/commands/project/init.d.ts +1 -0
  16. package/build/commands/project/init.js +13 -0
  17. package/build/commands/submit.d.ts +1 -0
  18. package/build/commands/submit.js +8 -1
  19. package/build/commands/update/index.js +1 -1
  20. package/build/commands/update/revert-update-rollout.js +1 -1
  21. package/build/commands/update/rollback.js +1 -1
  22. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +20 -13
  23. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +14 -2
  24. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +47 -7
  25. package/build/credentials/ios/appstore/ensureTestFlightGroup.d.ts +3 -1
  26. package/build/credentials/ios/appstore/ensureTestFlightGroup.js +14 -11
  27. package/build/graphql/generated.d.ts +596 -922
  28. package/build/graphql/generated.js +12 -2
  29. package/build/graphql/queries/ChannelInsightsQuery.js +4 -1
  30. package/build/graphql/types/Account.js +1 -4
  31. package/build/graphql/types/Build.js +13 -8
  32. package/build/graphql/types/Submission.js +0 -1
  33. package/build/graphql/types/Update.js +4 -1
  34. package/build/project/accountSelection.js +1 -3
  35. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +3 -5
  36. package/build/project/projectIcon.d.ts +40 -0
  37. package/build/project/projectIcon.js +132 -0
  38. package/build/project/projectNotConfiguredError.d.ts +17 -0
  39. package/build/project/projectNotConfiguredError.js +24 -0
  40. package/build/submit/ArchiveSource.js +3 -3
  41. package/build/submit/context.d.ts +2 -0
  42. package/build/submit/context.js +1 -0
  43. package/build/submit/ios/AppProduce.js +1 -1
  44. package/build/submit/ios/IosSubmitCommand.js +2 -0
  45. package/build/submit/ios/ensureTestFlightSetup.d.ts +7 -0
  46. package/build/submit/ios/ensureTestFlightSetup.js +81 -0
  47. package/build/submit/status.js +1 -1
  48. package/build/submit/utils/formatSubmission.js +2 -2
  49. package/build/update/queries.js +1 -1
  50. package/build/update/republish.js +3 -3
  51. package/build/update/roll-back-to-embedded.js +1 -1
  52. package/build/update/utils.d.ts +2 -1
  53. package/build/update/utils.js +7 -7
  54. package/build/user/User.js +1 -1
  55. package/oclif.manifest.json +2323 -2311
  56. package/package.json +6 -6
@@ -83,6 +83,7 @@ async function prepareJobAsync(ctx, jobData) {
83
83
  }),
84
84
  experimental: {
85
85
  prebuildCommand: buildProfile.prebuildCommand,
86
+ uploadSourceMaps: buildProfile.uploadSourceMaps,
86
87
  },
87
88
  mode: buildMode,
88
89
  triggeredBy: eas_build_job_1.BuildTrigger.EAS_CLI,
@@ -78,6 +78,7 @@ async function prepareJobAsync(ctx, jobData) {
78
78
  }),
79
79
  experimental: {
80
80
  prebuildCommand: buildProfile.prebuildCommand,
81
+ uploadSourceMaps: buildProfile.uploadSourceMaps,
81
82
  },
82
83
  mode: buildMode,
83
84
  triggeredBy: eas_build_job_1.BuildTrigger.EAS_CLI,
@@ -60,7 +60,6 @@ async function collectMetadataAsync(ctx, runtimeAndFingerprintMetadata) {
60
60
  customWorkflowName: ctx.customBuildConfigMetadata?.workflowName,
61
61
  developmentClient: ctx.developmentClient,
62
62
  requiredPackageManager: ctx.requiredPackageManager ?? undefined,
63
- selectedImage: ctx.buildProfile.image,
64
63
  customNodeVersion: ctx.buildProfile.node,
65
64
  simulator: 'simulator' in ctx.buildProfile && ctx.buildProfile.simulator,
66
65
  };
@@ -369,7 +369,7 @@ function exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds) {
369
369
  }
370
370
  async function downloadAndRunAsync(build, simulator) {
371
371
  (0, assert_1.default)(build.artifacts?.applicationArchiveUrl);
372
- const cachedAppPath = (0, run_1.getEasBuildRunCachedAppPath)(build.project.id, build.id, build.platform);
372
+ const cachedAppPath = (0, run_1.getEasBuildRunCachedAppPath)(build.app.id, build.id, build.platform);
373
373
  if (await (0, fs_extra_1.pathExists)(cachedAppPath)) {
374
374
  log_1.default.newLine();
375
375
  log_1.default.log(`Using cached app...`);
@@ -88,7 +88,7 @@ function formatGraphQLBuild(build) {
88
88
  },
89
89
  {
90
90
  label: 'Channel',
91
- value: build.channel,
91
+ value: build.updateChannel?.name,
92
92
  },
93
93
  {
94
94
  label: 'SDK Version',
@@ -96,7 +96,7 @@ function formatGraphQLBuild(build) {
96
96
  },
97
97
  {
98
98
  label: 'Runtime Version',
99
- value: build.runtimeVersion,
99
+ value: build.runtime?.version,
100
100
  },
101
101
  {
102
102
  label: 'Version',
@@ -23,10 +23,8 @@ function getProjectPageUrl(accountName, projectName, page) {
23
23
  return new URL(page ? `${projectPath}/${page}` : projectPath, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
24
24
  }
25
25
  function getBuildLogsUrl(build, hash) {
26
- const { project } = build;
27
- const url = project.__typename !== 'App'
28
- ? `/builds/${build.id}`
29
- : `/accounts/${project.ownerAccount.name}/projects/${project.slug}/builds/${build.id}${hash ? `#${hash}` : ''}`;
26
+ const { app } = build;
27
+ const url = `/accounts/${app.ownerAccount.name}/projects/${app.slug}/builds/${build.id}${hash ? `#${hash}` : ''}`;
30
28
  return new URL(url, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
31
29
  }
32
30
  function getArtifactUrl(artifactId) {
@@ -34,7 +32,7 @@ function getArtifactUrl(artifactId) {
34
32
  }
35
33
  function getInternalDistributionInstallUrl(build) {
36
34
  if (build.platform === generated_1.AppPlatform.Ios) {
37
- return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/v2/projects/${build.project.id}/builds/${build.id}/manifest.plist`;
35
+ return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/v2/projects/${build.app.id}/builds/${build.id}/manifest.plist`;
38
36
  }
39
37
  (0, assert_1.default)(build.artifacts?.buildUrl, 'buildUrl is missing');
40
38
  return build.artifacts.buildUrl;
@@ -15,6 +15,7 @@ const ora_1 = require("../../../ora");
15
15
  const accountSelection_1 = require("../../../project/accountSelection");
16
16
  const expoConfig_1 = require("../../../project/expoConfig");
17
17
  const fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1 = require("../../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync");
18
+ const projectNotConfiguredError_1 = require("../../../project/projectNotConfiguredError");
18
19
  const prompts_1 = require("../../../prompts");
19
20
  const User_1 = require("../../../user/User");
20
21
  /**
@@ -106,7 +107,9 @@ async function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options,
106
107
  if (!projectDir) {
107
108
  throw new Error('This command must be run inside a project directory.');
108
109
  }
109
- log_1.default.warn('EAS project not configured.');
110
+ if (!options.nonInteractive) {
111
+ log_1.default.warn('EAS project not configured.');
112
+ }
110
113
  const accountName = await chooseAccountNameForEASProjectAsync(exp, actor, options);
111
114
  const projectId = await (0, fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync)(graphqlClient, {
112
115
  accountName,
@@ -135,14 +138,18 @@ async function chooseAccountNameForEASProjectAsync(exp, actor, options) {
135
138
  return exp.owner;
136
139
  }
137
140
  if (actor.__typename === 'Robot') {
138
- throw new Error(`Project is not configured. When using a robot access token, run "eas init --account <name> --non-interactive" or set the "owner" field in your app config before managing the project. Accounts this token can create projects in: ${(0, User_1.getCreatableAccountNames)(actor).join(', ')}`);
141
+ throw (0, projectNotConfiguredError_1.getUnconfiguredProjectError)({
142
+ actor,
143
+ reason: 'A robot access token cannot configure it interactively.',
144
+ additionalFix: 'Alternatively, set the "owner" field in your app config.',
145
+ });
139
146
  }
140
147
  const allAccounts = actor.accounts;
141
148
  if (allAccounts.length === 1) {
142
149
  return allAccounts[0].name;
143
150
  }
144
151
  if (options.nonInteractive) {
145
- throw new Error(`Must configure EAS project by running 'eas init' before this command can be run in non-interactive mode.`);
152
+ throw (0, projectNotConfiguredError_1.getUnconfiguredProjectError)({ actor });
146
153
  }
147
154
  const choices = (0, accountSelection_1.getAccountChoices)(actor, (0, accountSelection_1.getAccountNamesWhereUserHasSufficientPermissionsToCreateApp)(actor));
148
155
  return (await (0, prompts_1.promptAsync)({
@@ -55,7 +55,7 @@ async function generateProjectConfigAsync(pathArg, options) {
55
55
  function getAccountPermissionsMap(actor) {
56
56
  const permissionsMap = new Map();
57
57
  for (const account of actor.accounts) {
58
- const hasPermission = account.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly;
58
+ const hasPermission = account.viewerUserPermission.role !== generated_1.Role.ViewOnly;
59
59
  permissionsMap.set(account.name, hasPermission);
60
60
  }
61
61
  return permissionsMap;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
5
- const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
6
5
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
6
  const generated_1 = require("../../graphql/generated");
8
7
  const log_1 = tslib_1.__importDefault(require("../../log"));
@@ -45,7 +44,7 @@ class AccountView extends EasCommand_1.default {
45
44
  if ('username' in actor && account.name === actor.username) {
46
45
  return generated_1.Role.Owner;
47
46
  }
48
- return (0, nullthrows_1.default)(account.users.find(user => user.actor.id === actor.id)?.role);
47
+ return account.viewerUserPermission.role;
49
48
  }
50
49
  static getLabelForRole(role) {
51
50
  switch (role) {
@@ -18,8 +18,8 @@ async function cancelBuildAsync(graphqlClient, buildId) {
18
18
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
19
19
  .mutation((0, graphql_tag_1.default) `
20
20
  mutation CancelBuildMutation($buildId: ID!) {
21
- build(buildId: $buildId) {
22
- cancel {
21
+ build {
22
+ cancelBuild(buildId: $buildId) {
23
23
  id
24
24
  status
25
25
  }
@@ -27,7 +27,7 @@ async function cancelBuildAsync(graphqlClient, buildId) {
27
27
  }
28
28
  `, { buildId })
29
29
  .toPromise());
30
- return data.build.cancel;
30
+ return data.build.cancelBuild;
31
31
  }
32
32
  async function selectBuildToCancelAsync(graphqlClient, projectId, projectDisplayName, filters) {
33
33
  const spinner = (0, ora_1.ora)().start('Fetching the uncompleted builds…');
@@ -168,7 +168,7 @@ class Download extends EasCommand_1.default {
168
168
  return builds[0];
169
169
  }
170
170
  async getPathToBuildArtifactAsync(build, platform) {
171
- const cachedBuildArtifactPath = (0, run_1.getEasBuildRunCachedAppPath)(build.project.id, build.id, platform);
171
+ const cachedBuildArtifactPath = (0, run_1.getEasBuildRunCachedAppPath)(build.app.id, build.id, platform);
172
172
  if (await fs_extra_1.default.pathExists(cachedBuildArtifactPath)) {
173
173
  log_1.default.newLine();
174
174
  log_1.default.log(`Using cached build...`);
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.detectProjectSdkVersionAsync = detectProjectSdkVersionAsync;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const apple_utils_1 = require("@expo/apple-utils");
7
6
  const core_1 = require("@oclif/core");
8
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
9
8
  const fs = tslib_1.__importStar(require("fs-extra"));
@@ -17,6 +16,7 @@ const SetUpAscApiKey_1 = require("../credentials/ios/actions/SetUpAscApiKey");
17
16
  const SetUpBuildCredentials_1 = require("../credentials/ios/actions/SetUpBuildCredentials");
18
17
  const SetUpPushKey_1 = require("../credentials/ios/actions/SetUpPushKey");
19
18
  const ensureAppExists_1 = require("../credentials/ios/appstore/ensureAppExists");
19
+ const ensureTestFlightGroup_1 = require("../credentials/ios/appstore/ensureTestFlightGroup");
20
20
  const generated_1 = require("../graphql/generated");
21
21
  const url_1 = require("../build/utils/url");
22
22
  const AppMutation_1 = require("../graphql/mutations/AppMutation");
@@ -49,51 +49,8 @@ async function detectProjectSdkVersionAsync(projectDir) {
49
49
  return;
50
50
  }
51
51
  }
52
- const TESTFLIGHT_GROUP_NAME = 'Team (Expo)';
53
52
  async function setupTestFlightAsync(ascApp) {
54
- let group;
55
- for (let attempt = 0; attempt < 10; attempt++) {
56
- try {
57
- const groups = await ascApp.getBetaGroupsAsync({
58
- query: { includes: ['betaTesters'] },
59
- });
60
- group = groups.find(g => g.attributes.isInternalGroup && g.attributes.name === TESTFLIGHT_GROUP_NAME);
61
- if (!group) {
62
- group = await ascApp.createBetaGroupAsync({
63
- name: TESTFLIGHT_GROUP_NAME,
64
- isInternalGroup: true,
65
- hasAccessToAllBuilds: true,
66
- });
67
- }
68
- break;
69
- }
70
- catch (error) {
71
- // Apple returns this error when the app isn't ready yet
72
- if (error?.data?.errors?.some((e) => e.code === 'ENTITY_ERROR.RELATIONSHIP.INVALID')) {
73
- if (attempt < 9) {
74
- await (0, promise_1.sleepAsync)(10_000);
75
- continue;
76
- }
77
- }
78
- throw error;
79
- }
80
- }
81
- if (!group) {
82
- throw new Error('Failed to create TestFlight group');
83
- }
84
- const users = await apple_utils_1.User.getAsync(ascApp.context);
85
- const admins = users.filter(u => u.attributes.roles?.includes(apple_utils_1.UserRole.ADMIN));
86
- const existingEmails = new Set(group.attributes.betaTesters?.map((t) => t.attributes.email?.toLowerCase()) ?? []);
87
- const newTesters = admins
88
- .filter(u => u.attributes.email && !existingEmails.has(u.attributes.email.toLowerCase()))
89
- .map(u => ({
90
- email: u.attributes.email,
91
- firstName: u.attributes.firstName ?? '',
92
- lastName: u.attributes.lastName ?? '',
93
- }));
94
- if (newTesters.length > 0) {
95
- await group.createBulkBetaTesterAssignmentsAsync(newTesters);
96
- }
53
+ await (0, ensureTestFlightGroup_1.ensureTestFlightGroupExistsAsync)(ascApp);
97
54
  }
98
55
  /* eslint-disable no-console */
99
56
  async function withSuppressedOutputAsync(fn) {
@@ -3,21 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const core_1 = require("@oclif/core");
5
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
- const path_1 = tslib_1.__importDefault(require("path"));
8
6
  const url_1 = require("../../../build/utils/url");
9
7
  const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
10
8
  const flags_1 = require("../../../commandUtils/flags");
11
- const generated_1 = require("../../../graphql/generated");
12
9
  const AppQuery_1 = require("../../../graphql/queries/AppQuery");
13
10
  const log_1 = tslib_1.__importStar(require("../../../log"));
14
11
  const ora_1 = require("../../../ora");
15
- const uploads_1 = require("../../../uploads");
16
- const promise_1 = require("../../../utils/promise");
17
- const ALLOWED_EXTENSIONS = ['.png', '.jpg', '.jpeg'];
18
- const MAX_IMAGE_SIZE_BYTES = 10 * 1024 * 1024; // matches the upload session's GCS limit
19
- const POLL_INTERVAL_MS = 2000;
20
- const POLL_TIMEOUT_MS = 90_000;
12
+ const projectIcon_1 = require("../../../project/projectIcon");
21
13
  class ProjectIconSet extends EasCommand_1.default {
22
14
  static description = 'set the project icon displayed on the EAS dashboard';
23
15
  static args = {
@@ -38,21 +30,17 @@ class ProjectIconSet extends EasCommand_1.default {
38
30
  const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ProjectIconSet, {
39
31
  nonInteractive: flags['non-interactive'],
40
32
  });
41
- await validateImageAsync(imagePath);
33
+ await (0, projectIcon_1.validateIconAsync)(imagePath);
42
34
  const app = await AppQuery_1.AppQuery.byIdAsync(graphqlClient, projectId);
43
35
  const projectDashboardUrl = (0, url_1.getProjectDashboardUrl)(app.ownerAccount.name, app.slug);
44
36
  const previousProfileImageUrl = await AppQuery_1.AppQuery.byIdProfileImageUrlAsync(graphqlClient, projectId);
45
37
  const spinner = (0, ora_1.ora)('Uploading project icon').start();
46
38
  try {
47
- await (0, uploads_1.uploadAppScopedFileAtPathToGCSAsync)(graphqlClient, {
48
- type: generated_1.AppUploadSessionType.ProfileImageUpload,
49
- appId: projectId,
50
- path: imagePath,
51
- });
39
+ await (0, projectIcon_1.uploadProjectIconAsync)(graphqlClient, { projectId, imagePath });
52
40
  // The icon is processed asynchronously (resized and assigned to the
53
41
  // project by the server), so poll until the icon URL changes.
54
42
  spinner.text = 'Processing project icon';
55
- await pollForProfileImageChangeAsync(graphqlClient, {
43
+ await (0, projectIcon_1.pollForProfileImageChangeAsync)(graphqlClient, {
56
44
  projectId,
57
45
  previousProfileImageUrl,
58
46
  projectDashboardUrl,
@@ -67,27 +55,3 @@ class ProjectIconSet extends EasCommand_1.default {
67
55
  }
68
56
  }
69
57
  exports.default = ProjectIconSet;
70
- async function validateImageAsync(imagePath) {
71
- if (!(await fs_extra_1.default.pathExists(imagePath))) {
72
- throw new Error(`No file found at ${imagePath}`);
73
- }
74
- const extension = path_1.default.extname(imagePath).toLowerCase();
75
- if (!ALLOWED_EXTENSIONS.includes(extension)) {
76
- throw new Error(`Unsupported image format "${extension}". The icon must be a PNG or JPEG file.`);
77
- }
78
- const { size } = await fs_extra_1.default.stat(imagePath);
79
- if (size > MAX_IMAGE_SIZE_BYTES) {
80
- throw new Error(`The image is ${(size / 1024 / 1024).toFixed(1)} MB, but the maximum allowed size is 10 MB.`);
81
- }
82
- }
83
- async function pollForProfileImageChangeAsync(graphqlClient, { projectId, previousProfileImageUrl, projectDashboardUrl, }) {
84
- const startTime = Date.now();
85
- while (Date.now() - startTime < POLL_TIMEOUT_MS) {
86
- await (0, promise_1.sleepAsync)(POLL_INTERVAL_MS);
87
- const profileImageUrl = await AppQuery_1.AppQuery.byIdProfileImageUrlAsync(graphqlClient, projectId);
88
- if (profileImageUrl && profileImageUrl !== previousProfileImageUrl) {
89
- return;
90
- }
91
- }
92
- throw new Error(`Timed out waiting for the icon to be processed. It may still appear on the project page shortly: ${chalk_1.default.underline(projectDashboardUrl)}`);
93
- }
@@ -9,6 +9,7 @@ export default class ProjectInit extends EasCommand {
9
9
  id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  account: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
11
  force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ icon: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
13
  };
13
14
  static contextDefinition: {
14
15
  projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
5
5
  const url_1 = require("../../build/utils/url");
6
6
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
7
  const flags_1 = require("../../commandUtils/flags");
8
+ const projectIcon_1 = require("../../project/projectIcon");
8
9
  const projectInitialization_1 = require("../../project/projectInitialization");
9
10
  const json_1 = require("../../utils/json");
10
11
  class ProjectInit extends EasCommand_1.default {
@@ -27,6 +28,11 @@ class ProjectInit extends EasCommand_1.default {
27
28
  force: core_1.Flags.boolean({
28
29
  description: 'Whether to create a new project/link an existing project without additional prompts or overwrite any existing project ID when running with --id flag',
29
30
  }),
31
+ icon: core_1.Flags.boolean({
32
+ description: 'Set the icon shown on the EAS dashboard from the app config, when the project does not have one yet',
33
+ default: true,
34
+ allowNo: true,
35
+ }),
30
36
  ...flags_1.EasNonInteractiveAndJsonFlags,
31
37
  };
32
38
  static contextDefinition = {
@@ -60,6 +66,12 @@ class ProjectInit extends EasCommand_1.default {
60
66
  force,
61
67
  nonInteractive,
62
68
  });
69
+ const iconResult = flags.icon
70
+ ? await (0, projectIcon_1.maybeSetProjectIconFromAppConfigAsync)(graphqlClient, {
71
+ projectId: result.projectId,
72
+ projectDir,
73
+ })
74
+ : null;
63
75
  if (jsonFlag) {
64
76
  (0, json_1.printJsonOnlyOutput)({
65
77
  status: result.status,
@@ -67,6 +79,7 @@ class ProjectInit extends EasCommand_1.default {
67
79
  owner,
68
80
  slug,
69
81
  dashboardUrl: (0, url_1.getProjectDashboardUrl)(owner, slug),
82
+ ...(iconResult?.status === 'set' ? { icon: { source: iconResult.icon.field } } : {}),
70
83
  });
71
84
  }
72
85
  }
@@ -15,6 +15,7 @@ export default class Submit extends EasCommand {
15
15
  'verbose-fastlane': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
16
  groups: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
17
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ 'auto-testflight-setup': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
19
  };
19
20
  static contextDefinition: {
20
21
  vcsClient: import("../commandUtils/context/VcsClientContextField").default;
@@ -67,6 +67,11 @@ class Submit extends EasCommand_1.default {
67
67
  default: false,
68
68
  description: 'Run command in non-interactive mode',
69
69
  }),
70
+ 'auto-testflight-setup': core_1.Flags.boolean({
71
+ default: true,
72
+ allowNo: true,
73
+ description: 'Set up an internal TestFlight group for the app (iOS only)',
74
+ }),
70
75
  };
71
76
  static contextDefinition = {
72
77
  ...this.ContextOptions.LoggedIn,
@@ -101,6 +106,7 @@ class Submit extends EasCommand_1.default {
101
106
  profile: submissionProfile.profile,
102
107
  archiveFlags: flagsWithPlatform.archiveFlags,
103
108
  nonInteractive: flagsWithPlatform.nonInteractive,
109
+ autoTestFlightSetup: flagsWithPlatform.autoTestFlightSetup,
104
110
  isVerboseFastlaneEnabled: flagsWithPlatform.isVerboseFastlaneEnabled,
105
111
  groups: flagsWithPlatform.groups,
106
112
  actor,
@@ -130,7 +136,7 @@ class Submit extends EasCommand_1.default {
130
136
  }
131
137
  }
132
138
  sanitizeFlags(flags) {
133
- const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, 'verbose-fastlane': isVerboseFastlaneEnabled, groups, 'what-to-test': whatToTest, ...archiveFlags } = flags;
139
+ const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, 'auto-testflight-setup': autoTestFlightSetup, 'verbose-fastlane': isVerboseFastlaneEnabled, groups, 'what-to-test': whatToTest, ...archiveFlags } = flags;
134
140
  if (!flags.platform && nonInteractive) {
135
141
  core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
136
142
  }
@@ -145,6 +151,7 @@ class Submit extends EasCommand_1.default {
145
151
  wait,
146
152
  profile,
147
153
  nonInteractive,
154
+ autoTestFlightSetup,
148
155
  whatToTest,
149
156
  isVerboseFastlaneEnabled,
150
157
  groups,
@@ -453,7 +453,7 @@ class UpdatePublish extends EasCommand_1.default {
453
453
  }
454
454
  log_1.default.addNewLineIfNone();
455
455
  for (const runtime of (0, uniqBy_1.default)(runtimeToPlatformsAndFingerprintInfoMapping, version => version.runtimeVersion)) {
456
- const newUpdatesForRuntimeVersion = newUpdates.filter(update => update.runtimeVersion === runtime.runtimeVersion);
456
+ const newUpdatesForRuntimeVersion = newUpdates.filter(update => update.runtime.version === runtime.runtimeVersion);
457
457
  if (newUpdatesForRuntimeVersion.length === 0) {
458
458
  throw new Error(`Publish response is missing updates with runtime ${runtime.runtimeVersion}.`);
459
459
  }
@@ -193,7 +193,7 @@ class UpdateRevertUpdateRollout extends EasCommand_1.default {
193
193
  rolloutUpdateGroup,
194
194
  });
195
195
  const platforms = rolloutUpdateGroup.map(update => update.platform);
196
- const runtimeVersion = rolloutUpdateGroup[0].runtimeVersion;
196
+ const runtimeVersion = rolloutUpdateGroup[0].runtime.version;
197
197
  const targetBranch = {
198
198
  name: rolloutUpdateGroup[0].branchName,
199
199
  id: rolloutUpdateGroup[0].branchId,
@@ -115,7 +115,7 @@ async function getSourceUpdateGroupAsync(graphqlClient, groupId) {
115
115
  return {
116
116
  groupId,
117
117
  branchName: arbitraryUpdate.branch.name,
118
- runtimeVersion: arbitraryUpdate.runtimeVersion,
118
+ runtimeVersion: arbitraryUpdate.runtime.version,
119
119
  };
120
120
  }
121
121
  async function getPreviousUpdateGroupAsync(graphqlClient, projectId, sourceGroup) {
@@ -38,18 +38,22 @@ exports.AppleDeviceQuery = {
38
38
  account {
39
39
  byName(accountName: $accountName) {
40
40
  id
41
- appleTeams(appleTeamIdentifier: $appleTeamIdentifier) {
42
- id
43
- appleTeamIdentifier
44
- appleTeamName
45
- appleDevices(offset: $offset, limit: $limit) {
46
- id
47
- identifier
48
- name
49
- deviceClass
50
- enabled
51
- model
52
- createdAt
41
+ appleTeamsPaginated(first: 1, filter: { appleTeamIdentifier: $appleTeamIdentifier }) {
42
+ edges {
43
+ node {
44
+ id
45
+ appleTeamIdentifier
46
+ appleTeamName
47
+ appleDevices(offset: $offset, limit: $limit) {
48
+ id
49
+ identifier
50
+ name
51
+ deviceClass
52
+ enabled
53
+ model
54
+ createdAt
55
+ }
56
+ }
53
57
  }
54
58
  }
55
59
  }
@@ -59,7 +63,10 @@ exports.AppleDeviceQuery = {
59
63
  additionalTypenames: ['AppleDevice', 'AppleTeam'],
60
64
  })
61
65
  .toPromise());
62
- const [appleTeam] = data.account.byName.appleTeams;
66
+ const appleTeam = data.account.byName.appleTeamsPaginated.edges[0]?.node;
67
+ if (!appleTeam) {
68
+ throw new Error(`Could not find Apple team with the identifier ${appleTeamIdentifier} on account ${accountName}`);
69
+ }
63
70
  const { appleDevices } = appleTeam;
64
71
  if (!appleDevices) {
65
72
  throw new Error(`Could not find devices on Apple team -- ${(0, AppleTeamFormatting_1.formatAppleTeam)(appleTeam)}`);
@@ -1,6 +1,18 @@
1
1
  import { ExpoGraphqlClient } from '../../../../../commandUtils/context/contextUtils/createGraphqlClient';
2
- import { AppleTeamFragment, AppleTeamsByAccountNameQueryVariables } from '../../../../../graphql/generated';
2
+ import { AppleTeamFilterInput, AppleTeamFragment } from '../../../../../graphql/generated';
3
+ import { Connection } from '../../../../../utils/relay';
3
4
  export declare const AppleTeamQuery: {
4
- getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, { accountName, offset, limit }: AppleTeamsByAccountNameQueryVariables): Promise<AppleTeamFragment[]>;
5
+ getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, { accountName, offset, limit, }: {
6
+ accountName: string;
7
+ offset?: number | null;
8
+ limit?: number | null;
9
+ }): Promise<AppleTeamFragment[]>;
10
+ getAllForAccountPaginatedAsync(graphqlClient: ExpoGraphqlClient, accountName: string, { after, first, before, last, filter, }: {
11
+ after?: string;
12
+ first?: number;
13
+ before?: string;
14
+ last?: number;
15
+ filter?: AppleTeamFilterInput;
16
+ }): Promise<Connection<AppleTeamFragment>>;
5
17
  getByAppleTeamIdentifierAsync(graphqlClient: ExpoGraphqlClient, accountId: string, appleTeamIdentifier: string): Promise<AppleTeamFragment | null>;
6
18
  };
@@ -7,26 +7,66 @@ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
7
  const client_1 = require("../../../../../graphql/client");
8
8
  const AppleTeam_1 = require("../../../../../graphql/types/credentials/AppleTeam");
9
9
  exports.AppleTeamQuery = {
10
- async getAllForAccountAsync(graphqlClient, { accountName, offset, limit }) {
10
+ async getAllForAccountAsync(graphqlClient, { accountName, offset, limit, }) {
11
+ // appleTeamsPaginated is cursor-based, so emulate offset/limit by fetching
12
+ // pages from the start until enough nodes are collected
13
+ const start = offset ?? 0;
14
+ const teams = [];
15
+ let after;
16
+ while (limit == null || teams.length < start + limit) {
17
+ const connection = await exports.AppleTeamQuery.getAllForAccountPaginatedAsync(graphqlClient, accountName, { first: 100, after });
18
+ teams.push(...connection.edges.map(edge => edge.node));
19
+ if (!connection.pageInfo.hasNextPage) {
20
+ break;
21
+ }
22
+ after = connection.pageInfo.endCursor ?? undefined;
23
+ }
24
+ return limit == null ? teams.slice(start) : teams.slice(start, start + limit);
25
+ },
26
+ async getAllForAccountPaginatedAsync(graphqlClient, accountName, { after, first, before, last, filter, }) {
11
27
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
12
28
  .query((0, graphql_tag_1.default) `
13
- query AppleTeamsByAccountName($accountName: String!, $offset: Int, $limit: Int) {
29
+ query AppleTeamsPaginatedByAccountQuery(
30
+ $accountName: String!
31
+ $after: String
32
+ $first: Int
33
+ $before: String
34
+ $last: Int
35
+ $filter: AppleTeamFilterInput
36
+ ) {
14
37
  account {
15
38
  byName(accountName: $accountName) {
16
39
  id
17
- appleTeams(offset: $offset, limit: $limit) {
18
- id
19
- ...AppleTeamFragment
40
+ appleTeamsPaginated(
41
+ after: $after
42
+ first: $first
43
+ before: $before
44
+ last: $last
45
+ filter: $filter
46
+ ) {
47
+ edges {
48
+ cursor
49
+ node {
50
+ id
51
+ ...AppleTeamFragment
52
+ }
53
+ }
54
+ pageInfo {
55
+ hasNextPage
56
+ hasPreviousPage
57
+ startCursor
58
+ endCursor
59
+ }
20
60
  }
21
61
  }
22
62
  }
23
63
  }
24
64
  ${(0, graphql_1.print)(AppleTeam_1.AppleTeamFragmentNode)}
25
- `, { accountName, offset, limit }, {
65
+ `, { accountName, after, first, before, last, filter }, {
26
66
  additionalTypenames: ['AppleTeam'],
27
67
  })
28
68
  .toPromise());
29
- return data.account.byName.appleTeams ?? [];
69
+ return data.account.byName.appleTeamsPaginated;
30
70
  },
31
71
  async getByAppleTeamIdentifierAsync(graphqlClient, accountId, appleTeamIdentifier) {
32
72
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
@@ -3,4 +3,6 @@ import { App } from '@expo/apple-utils';
3
3
  * Ensure a TestFlight internal group with access to all builds exists for the app and has all admin users invited to it.
4
4
  * This allows users to instantly access their builds from TestFlight after it finishes processing.
5
5
  */
6
- export declare function ensureTestFlightGroupExistsAsync(app: App): Promise<void>;
6
+ export declare function ensureTestFlightGroupExistsAsync(app: App, { nonInteractive }?: {
7
+ nonInteractive?: boolean;
8
+ }): Promise<void>;