eas-cli 16.2.0 → 16.2.1

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.
@@ -0,0 +1,18 @@
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import EasCommand from '../commandUtils/EasCommand';
3
+ export default class BuildUpload extends EasCommand {
4
+ static description: string;
5
+ static hidden: boolean;
6
+ static flags: {
7
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<Platform | undefined>;
9
+ 'build-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ fingerprint: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
+ };
12
+ static contextDefinition: {
13
+ loggedIn: import("../commandUtils/context/LoggedInContextField").default;
14
+ projectId: import("../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
15
+ };
16
+ runAsync(): Promise<void>;
17
+ private selectPlatformAsync;
18
+ }
@@ -0,0 +1,253 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const config_plugins_1 = require("@expo/config-plugins");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const core_1 = require("@oclif/core");
7
+ const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
8
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
9
+ const node_stream_zip_1 = tslib_1.__importDefault(require("node-stream-zip"));
10
+ const path_1 = tslib_1.__importDefault(require("path"));
11
+ const tar_1 = tslib_1.__importDefault(require("tar"));
12
+ const url_1 = require("../build/utils/url");
13
+ const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
14
+ const flags_1 = require("../commandUtils/flags");
15
+ const generated_1 = require("../graphql/generated");
16
+ const FingerprintMutation_1 = require("../graphql/mutations/FingerprintMutation");
17
+ const LocalBuildMutation_1 = require("../graphql/mutations/LocalBuildMutation");
18
+ const AppPlatform_1 = require("../graphql/types/AppPlatform");
19
+ const log_1 = tslib_1.__importDefault(require("../log"));
20
+ const prompts_1 = require("../prompts");
21
+ const xcode = tslib_1.__importStar(require("../run/ios/xcode"));
22
+ const uploads_1 = require("../uploads");
23
+ const progress_1 = require("../utils/progress");
24
+ class BuildUpload extends EasCommand_1.default {
25
+ static description = 'upload a local build and generate a sharable link';
26
+ static hidden = true;
27
+ static flags = {
28
+ platform: core_1.Flags.enum({
29
+ char: 'p',
30
+ options: [eas_build_job_1.Platform.IOS, eas_build_job_1.Platform.ANDROID],
31
+ }),
32
+ 'build-path': core_1.Flags.string({
33
+ description: 'Path for the local build',
34
+ }),
35
+ fingerprint: core_1.Flags.string({
36
+ description: 'Fingerprint hash of the local build',
37
+ }),
38
+ ...flags_1.EASNonInteractiveFlag,
39
+ };
40
+ static contextDefinition = {
41
+ ...this.ContextOptions.ProjectId,
42
+ ...this.ContextOptions.LoggedIn,
43
+ };
44
+ async runAsync() {
45
+ const { flags } = await this.parse(BuildUpload);
46
+ const { 'build-path': buildPath, fingerprint: manualFingerprintHash } = flags;
47
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(BuildUpload, {
48
+ nonInteractive: false,
49
+ });
50
+ const platform = await this.selectPlatformAsync(flags.platform);
51
+ const localBuildPath = await resolveLocalBuildPathAsync(platform, buildPath);
52
+ const { fingerprintHash: buildFingerprintHash, developmentClient, simulator, } = await extractAppMetadataAsync(localBuildPath, platform);
53
+ let fingerprint = manualFingerprintHash ?? buildFingerprintHash;
54
+ if (fingerprint) {
55
+ if (manualFingerprintHash &&
56
+ buildFingerprintHash &&
57
+ manualFingerprintHash !== buildFingerprintHash) {
58
+ const selectedAnswer = await (0, prompts_1.promptAsync)({
59
+ name: 'fingerprint',
60
+ message: `The provided fingerprint hash ${manualFingerprintHash} does not match the fingerprint hash of the build ${buildFingerprintHash}. Which fingerprint do you want to use?`,
61
+ type: 'select',
62
+ choices: [
63
+ { title: manualFingerprintHash, value: manualFingerprintHash },
64
+ { title: buildFingerprintHash, value: buildFingerprintHash },
65
+ ],
66
+ });
67
+ fingerprint = String(selectedAnswer.fingerprint);
68
+ }
69
+ await FingerprintMutation_1.FingerprintMutation.createFingerprintAsync(graphqlClient, projectId, {
70
+ hash: fingerprint,
71
+ });
72
+ }
73
+ log_1.default.log('Uploading your app archive to EAS');
74
+ const bucketKey = await uploadAppArchiveAsync(graphqlClient, localBuildPath);
75
+ const build = await LocalBuildMutation_1.LocalBuildMutation.createLocalBuildAsync(graphqlClient, projectId, { platform: (0, AppPlatform_1.toAppPlatform)(platform), simulator }, { type: generated_1.LocalBuildArchiveSourceType.Gcs, bucketKey }, { distribution: generated_1.DistributionType.Internal, fingerprintHash: fingerprint, developmentClient });
76
+ log_1.default.withTick(`Here is a sharable link of your build: ${(0, url_1.getBuildLogsUrl)(build)}`);
77
+ }
78
+ async selectPlatformAsync(platform) {
79
+ if (platform) {
80
+ return platform;
81
+ }
82
+ const { resolvedPlatform } = await (0, prompts_1.promptAsync)({
83
+ type: 'select',
84
+ message: 'Select platform',
85
+ name: 'resolvedPlatform',
86
+ choices: [
87
+ { title: 'Android', value: eas_build_job_1.Platform.ANDROID },
88
+ { title: 'iOS', value: eas_build_job_1.Platform.IOS },
89
+ ],
90
+ });
91
+ return resolvedPlatform;
92
+ }
93
+ }
94
+ exports.default = BuildUpload;
95
+ async function resolveLocalBuildPathAsync(platform, inputBuildPath) {
96
+ const rootDir = process.cwd();
97
+ let applicationArchivePatternOrPath = [];
98
+ if (inputBuildPath) {
99
+ applicationArchivePatternOrPath.push(inputBuildPath);
100
+ }
101
+ else if (platform === eas_build_job_1.Platform.ANDROID) {
102
+ applicationArchivePatternOrPath.push('android/app/build/outputs/**/*.{apk,aab}');
103
+ }
104
+ else {
105
+ const xcworkspacePath = await xcode.resolveXcodeProjectAsync(rootDir);
106
+ const schemes = config_plugins_1.IOSConfig.BuildScheme.getRunnableSchemesFromXcodeproj(rootDir);
107
+ if (xcworkspacePath && schemes.length > 0) {
108
+ for (const scheme of schemes) {
109
+ const buildSettings = await xcode.getXcodeBuildSettingsAsync(xcworkspacePath, scheme.name);
110
+ applicationArchivePatternOrPath = applicationArchivePatternOrPath.concat(buildSettings.map(({ buildSettings }) => `${buildSettings.BUILD_DIR}/**/*.app`));
111
+ }
112
+ }
113
+ }
114
+ let applicationArchives = await findArtifactsAsync({
115
+ rootDir,
116
+ patternOrPathArray: applicationArchivePatternOrPath,
117
+ });
118
+ if (applicationArchives.length === 0 && !inputBuildPath) {
119
+ log_1.default.warn(`No application archives found at ${applicationArchivePatternOrPath}.`);
120
+ const { path } = await (0, prompts_1.promptAsync)({
121
+ type: 'text',
122
+ name: 'path',
123
+ message: 'Provide a path to the application archive:',
124
+ validate: value => (value ? true : 'Path may not be empty.'),
125
+ });
126
+ applicationArchives = await findArtifactsAsync({
127
+ rootDir,
128
+ patternOrPathArray: [path],
129
+ });
130
+ }
131
+ if (applicationArchives.length === 1) {
132
+ return applicationArchives[0];
133
+ }
134
+ if (applicationArchives.length > 1) {
135
+ const { path } = await (0, prompts_1.promptAsync)({
136
+ type: 'select',
137
+ name: 'path',
138
+ message: 'Found multiple application archives. Select one:',
139
+ choices: applicationArchives.map(archivePath => {
140
+ return {
141
+ title: archivePath,
142
+ value: archivePath,
143
+ };
144
+ }),
145
+ });
146
+ return path;
147
+ }
148
+ throw new Error(`Found no application archives at ${inputBuildPath}.`);
149
+ }
150
+ async function findArtifactsAsync({ rootDir, patternOrPathArray, }) {
151
+ const files = [];
152
+ for (const patternOrPath of patternOrPathArray) {
153
+ if (path_1.default.isAbsolute(patternOrPath) && (await fs_extra_1.default.pathExists(patternOrPath))) {
154
+ files.push(patternOrPath);
155
+ }
156
+ else {
157
+ const filesFound = await (0, fast_glob_1.default)(patternOrPath, {
158
+ cwd: rootDir,
159
+ onlyFiles: false,
160
+ });
161
+ files.push(...filesFound);
162
+ }
163
+ }
164
+ return files.map(filePath => {
165
+ // User may provide an absolute path as input in which case
166
+ // fg will return an absolute path.
167
+ if (path_1.default.isAbsolute(filePath)) {
168
+ return filePath;
169
+ }
170
+ // User may also provide a relative path in which case
171
+ // fg will return a path relative to rootDir.
172
+ return path_1.default.join(rootDir, filePath);
173
+ });
174
+ }
175
+ async function uploadAppArchiveAsync(graphqlClient, path) {
176
+ const fileSize = (await fs_extra_1.default.stat(path)).size;
177
+ const bucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(graphqlClient, generated_1.UploadSessionType.EasShareGcsAppArchive, path, (0, progress_1.createProgressTracker)({
178
+ total: fileSize,
179
+ message: 'Uploading to EAS',
180
+ completedMessage: 'Uploaded to EAS',
181
+ }));
182
+ return bucketKey;
183
+ }
184
+ async function extractAppMetadataAsync(buildPath, platform) {
185
+ let developmentClient = false;
186
+ let fingerprintHash;
187
+ const simulator = platform === eas_build_job_1.Platform.IOS;
188
+ const basePath = platform === eas_build_job_1.Platform.ANDROID ? 'assets/' : buildPath;
189
+ const fingerprintFilePath = platform === eas_build_job_1.Platform.ANDROID ? 'fingerprint' : 'EXUpdates.bundle/fingerprint';
190
+ const devMenuBundlePath = platform === eas_build_job_1.Platform.ANDROID ? 'EXDevMenuApp.android.js' : 'EXDevMenu.bundle/';
191
+ const buildExtension = path_1.default.extname(buildPath);
192
+ if (['.apk', '.aab'].includes(buildExtension)) {
193
+ const zip = new node_stream_zip_1.default.async({ file: buildPath });
194
+ try {
195
+ developmentClient = Boolean(await zip.entry(path_1.default.join(basePath, devMenuBundlePath)));
196
+ if (await zip.entry(path_1.default.join(basePath, fingerprintFilePath))) {
197
+ fingerprintHash = (await zip.entryData(path_1.default.join(basePath, fingerprintFilePath))).toString('utf-8');
198
+ }
199
+ }
200
+ catch (err) {
201
+ log_1.default.error(`Error reading ${buildExtension}: ${err}`);
202
+ }
203
+ finally {
204
+ await zip.close();
205
+ }
206
+ }
207
+ else if (buildExtension === '.app') {
208
+ developmentClient = await fs_extra_1.default.exists(path_1.default.join(basePath, devMenuBundlePath));
209
+ if (await fs_extra_1.default.exists(path_1.default.join(basePath, fingerprintFilePath))) {
210
+ fingerprintHash = await fs_extra_1.default.readFile(path_1.default.join(basePath, fingerprintFilePath), 'utf8');
211
+ }
212
+ }
213
+ else {
214
+ // Use tar to list files in the archive
215
+ try {
216
+ let fingerprintHashPromise;
217
+ await tar_1.default.list({
218
+ file: buildPath,
219
+ // eslint-disable-next-line async-protect/async-suffix
220
+ onentry: entry => {
221
+ if (entry.path.endsWith(devMenuBundlePath)) {
222
+ developmentClient = true;
223
+ }
224
+ if (entry.path.endsWith(fingerprintFilePath)) {
225
+ fingerprintHashPromise = new Promise(async (resolve, reject) => {
226
+ try {
227
+ let content = '';
228
+ for await (const chunk of entry) {
229
+ content += chunk.toString('utf8');
230
+ }
231
+ resolve(content);
232
+ }
233
+ catch (error) {
234
+ reject(error);
235
+ }
236
+ });
237
+ }
238
+ },
239
+ });
240
+ if (fingerprintHashPromise !== undefined) {
241
+ fingerprintHash = await fingerprintHashPromise;
242
+ }
243
+ }
244
+ catch (err) {
245
+ log_1.default.error(`Error reading ${buildExtension}: ${err}`);
246
+ }
247
+ }
248
+ return {
249
+ developmentClient,
250
+ fingerprintHash,
251
+ simulator,
252
+ };
253
+ }
@@ -53,7 +53,7 @@ async function ensureInternalGroupAsync({ groups, app, }) {
53
53
  }, {
54
54
  shouldRetry(error) {
55
55
  if ((0, ensureAppExists_1.isAppleError)(error)) {
56
- spinner.text = `TestFlight not ready, retrying in 25 seconds...`;
56
+ spinner.text = `TestFlight still preparing, retrying in 10 seconds...`;
57
57
  return error.data.errors.some(error => error.code === 'ENTITY_ERROR.RELATIONSHIP.INVALID');
58
58
  }
59
59
  return false;
@@ -154,9 +154,10 @@ async function getTestFlightGroupUrlAsync(group) {
154
154
  }
155
155
  return null;
156
156
  }
157
- async function pollRetryAsync(fn, { shouldRetry, retries = 10,
157
+ async function pollRetryAsync(fn, { shouldRetry, retries = 15,
158
158
  // 25 seconds was the minium interval I calculated when measuring against 5 second intervals.
159
- interval = 25000, } = {}) {
159
+ // Switching to 10 seconds to account for days where Apple APIs are faster.
160
+ interval = 10000, } = {}) {
160
161
  let lastError = null;
161
162
  for (let i = 0; i < retries; i++) {
162
163
  try {
@@ -2596,6 +2596,8 @@ export type BuildMutation = {
2596
2596
  createAndroidBuild: CreateBuildResult;
2597
2597
  /** Create an iOS build */
2598
2598
  createIosBuild: CreateBuildResult;
2599
+ /** Create a local build */
2600
+ createLocalBuild: CreateBuildResult;
2599
2601
  /** Delete an EAS Build build */
2600
2602
  deleteBuild: Build;
2601
2603
  /** Retry an Android EAS Build */
@@ -2625,6 +2627,12 @@ export type BuildMutationCreateIosBuildArgs = {
2625
2627
  job: IosJobInput;
2626
2628
  metadata?: InputMaybe<BuildMetadataInput>;
2627
2629
  };
2630
+ export type BuildMutationCreateLocalBuildArgs = {
2631
+ appId: Scalars['ID']['input'];
2632
+ artifactSource: LocalBuildArchiveSourceInput;
2633
+ job: LocalBuildJobInput;
2634
+ metadata?: InputMaybe<BuildMetadataInput>;
2635
+ };
2628
2636
  export type BuildMutationDeleteBuildArgs = {
2629
2637
  buildId: Scalars['ID']['input'];
2630
2638
  };
@@ -4494,6 +4502,18 @@ export type LinkSharedEnvironmentVariableInput = {
4494
4502
  environment?: InputMaybe<EnvironmentVariableEnvironment>;
4495
4503
  environmentVariableId: Scalars['ID']['input'];
4496
4504
  };
4505
+ export type LocalBuildArchiveSourceInput = {
4506
+ bucketKey: Scalars['String']['input'];
4507
+ type: LocalBuildArchiveSourceType;
4508
+ };
4509
+ export declare enum LocalBuildArchiveSourceType {
4510
+ Gcs = "GCS"
4511
+ }
4512
+ export type LocalBuildJobInput = {
4513
+ developmentClient?: InputMaybe<Scalars['Boolean']['input']>;
4514
+ platform: AppPlatform;
4515
+ simulator?: InputMaybe<Scalars['Boolean']['input']>;
4516
+ };
4497
4517
  export type LogNameTypeMapping = {
4498
4518
  __typename?: 'LogNameTypeMapping';
4499
4519
  publicName: Scalars['String']['output'];
@@ -11993,6 +12013,95 @@ export type SetRolloutPercentageMutation = {
11993
12013
  };
11994
12014
  };
11995
12015
  };
12016
+ export type CreateLocalBuildMutationVariables = Exact<{
12017
+ appId: Scalars['ID']['input'];
12018
+ jobInput: LocalBuildJobInput;
12019
+ artifactSource: LocalBuildArchiveSourceInput;
12020
+ metadata?: InputMaybe<BuildMetadataInput>;
12021
+ }>;
12022
+ export type CreateLocalBuildMutation = {
12023
+ __typename?: 'RootMutation';
12024
+ build: {
12025
+ __typename?: 'BuildMutation';
12026
+ createLocalBuild: {
12027
+ __typename?: 'CreateBuildResult';
12028
+ build: {
12029
+ __typename?: 'Build';
12030
+ id: string;
12031
+ status: BuildStatus;
12032
+ platform: AppPlatform;
12033
+ channel?: string | null;
12034
+ distribution?: DistributionType | null;
12035
+ iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null;
12036
+ buildProfile?: string | null;
12037
+ sdkVersion?: string | null;
12038
+ appVersion?: string | null;
12039
+ appBuildVersion?: string | null;
12040
+ runtimeVersion?: string | null;
12041
+ gitCommitHash?: string | null;
12042
+ gitCommitMessage?: string | null;
12043
+ initialQueuePosition?: number | null;
12044
+ queuePosition?: number | null;
12045
+ estimatedWaitTimeLeftSeconds?: number | null;
12046
+ priority: BuildPriority;
12047
+ createdAt: any;
12048
+ updatedAt: any;
12049
+ message?: string | null;
12050
+ completedAt?: any | null;
12051
+ expirationDate?: any | null;
12052
+ isForIosSimulator: boolean;
12053
+ error?: {
12054
+ __typename?: 'BuildError';
12055
+ errorCode: string;
12056
+ message: string;
12057
+ docsUrl?: string | null;
12058
+ } | null;
12059
+ artifacts?: {
12060
+ __typename?: 'BuildArtifacts';
12061
+ buildUrl?: string | null;
12062
+ xcodeBuildLogsUrl?: string | null;
12063
+ applicationArchiveUrl?: string | null;
12064
+ buildArtifactsUrl?: string | null;
12065
+ } | null;
12066
+ initiatingActor?: {
12067
+ __typename: 'Robot';
12068
+ id: string;
12069
+ displayName: string;
12070
+ } | {
12071
+ __typename: 'SSOUser';
12072
+ id: string;
12073
+ displayName: string;
12074
+ } | {
12075
+ __typename: 'User';
12076
+ id: string;
12077
+ displayName: string;
12078
+ } | null;
12079
+ project: {
12080
+ __typename: 'App';
12081
+ id: string;
12082
+ name: string;
12083
+ slug: string;
12084
+ ownerAccount: {
12085
+ __typename?: 'Account';
12086
+ id: string;
12087
+ name: string;
12088
+ };
12089
+ } | {
12090
+ __typename: 'Snack';
12091
+ id: string;
12092
+ name: string;
12093
+ slug: string;
12094
+ };
12095
+ metrics?: {
12096
+ __typename?: 'BuildMetrics';
12097
+ buildWaitTime?: number | null;
12098
+ buildQueueTime?: number | null;
12099
+ buildDuration?: number | null;
12100
+ } | null;
12101
+ };
12102
+ };
12103
+ };
12104
+ };
11996
12105
  export type CreateAndroidSubmissionMutationVariables = Exact<{
11997
12106
  appId: Scalars['ID']['input'];
11998
12107
  config: AndroidSubmissionConfigInput;
@@ -12095,6 +12204,7 @@ export type CreateIosSubmissionMutation = {
12095
12204
  };
12096
12205
  export type CreateUploadSessionMutationVariables = Exact<{
12097
12206
  type: UploadSessionType;
12207
+ filename?: InputMaybe<Scalars['String']['input']>;
12098
12208
  }>;
12099
12209
  export type CreateUploadSessionMutation = {
12100
12210
  __typename?: 'RootMutation';
@@ -7,8 +7,8 @@
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.Feature = exports.Experiment = exports.EnvironmentVariableVisibility = exports.EnvironmentVariableScope = exports.EnvironmentVariableEnvironment = exports.EnvironmentSecretType = exports.EntityTypeName = exports.EasTotalPlanEnablementUnit = exports.EasServiceMetric = exports.EasService = exports.EasBuildWaiverType = exports.EasBuildDeprecationInfoType = exports.EasBuildBillingResourceClass = exports.DistributionType = exports.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.CrashSampleFor = exports.ContinentCode = exports.BuildWorkflow = exports.BuildTrigger = exports.BuildStatus = exports.BuildRetryDisabledReason = exports.BuildResourceClass = exports.BuildPriority = exports.BuildPhase = exports.BuildMode = exports.BuildLimitThresholdExceededMetadataType = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.BackgroundJobState = exports.BackgroundJobResultType = exports.AuthProviderIdentifier = exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AppsFilter = exports.AppleTeamType = exports.AppleDeviceClass = exports.AppUploadSessionType = exports.AppStoreConnectUserRole = exports.AppSort = exports.AppPrivacy = exports.AppPlatform = exports.AppInternalDistributionBuildPrivacy = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = exports.AccountUploadSessionType = exports.AccountAppsSortByField = void 0;
10
- exports.UploadSessionType = exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ResponseType = exports.ResponseStatusType = exports.ResponseCacheStatus = exports.ResourceClassExperiment = exports.RequestsOrderByField = exports.RequestsOrderByDirection = exports.RequestMethod = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OnboardingEnvironment = exports.OnboardingDeviceType = exports.OfferType = exports.NotificationType = exports.NotificationEvent = exports.MailchimpTag = exports.MailchimpAudience = exports.JobRunStatus = exports.JobRunPriority = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = exports.GitHubAppInstallationStatus = exports.GitHubAppInstallationAccountType = exports.GitHubAppEnvironment = exports.FingerprintSourceType = void 0;
11
- exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = exports.WorkflowJobStatus = exports.WorkerLoggerLevel = exports.WorkerDeploymentLogLevel = exports.WorkerDeploymentCrashKind = exports.WebhookType = exports.UserEntityTypeName = exports.UserAgentPlatform = exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = void 0;
10
+ exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ResponseType = exports.ResponseStatusType = exports.ResponseCacheStatus = exports.ResourceClassExperiment = exports.RequestsOrderByField = exports.RequestsOrderByDirection = exports.RequestMethod = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OnboardingEnvironment = exports.OnboardingDeviceType = exports.OfferType = exports.NotificationType = exports.NotificationEvent = exports.MailchimpTag = exports.MailchimpAudience = exports.LocalBuildArchiveSourceType = exports.JobRunStatus = exports.JobRunPriority = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = exports.GitHubAppInstallationStatus = exports.GitHubAppInstallationAccountType = exports.GitHubAppEnvironment = exports.FingerprintSourceType = void 0;
11
+ exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = exports.WorkflowJobStatus = exports.WorkerLoggerLevel = exports.WorkerDeploymentLogLevel = exports.WorkerDeploymentCrashKind = exports.WebhookType = exports.UserEntityTypeName = exports.UserAgentPlatform = exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = void 0;
12
12
  var AccountAppsSortByField;
13
13
  (function (AccountAppsSortByField) {
14
14
  AccountAppsSortByField["LatestActivityTime"] = "LATEST_ACTIVITY_TIME";
@@ -514,6 +514,10 @@ var JobRunStatus;
514
514
  JobRunStatus["New"] = "NEW";
515
515
  JobRunStatus["PendingCancel"] = "PENDING_CANCEL";
516
516
  })(JobRunStatus || (exports.JobRunStatus = JobRunStatus = {}));
517
+ var LocalBuildArchiveSourceType;
518
+ (function (LocalBuildArchiveSourceType) {
519
+ LocalBuildArchiveSourceType["Gcs"] = "GCS";
520
+ })(LocalBuildArchiveSourceType || (exports.LocalBuildArchiveSourceType = LocalBuildArchiveSourceType = {}));
517
521
  var MailchimpAudience;
518
522
  (function (MailchimpAudience) {
519
523
  MailchimpAudience["ExpoDevelopers"] = "EXPO_DEVELOPERS";
@@ -0,0 +1,5 @@
1
+ import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
2
+ import { BuildFragment, BuildMetadataInput, LocalBuildArchiveSourceInput, LocalBuildJobInput } from '../generated';
3
+ export declare const LocalBuildMutation: {
4
+ createLocalBuildAsync(graphqlClient: ExpoGraphqlClient, appId: string, job: LocalBuildJobInput, artifactSource: LocalBuildArchiveSourceInput, metadata: BuildMetadataInput): Promise<BuildFragment>;
5
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LocalBuildMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_1 = require("graphql");
6
+ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
+ const client_1 = require("../client");
8
+ const Build_1 = require("../types/Build");
9
+ exports.LocalBuildMutation = {
10
+ async createLocalBuildAsync(graphqlClient, appId, job, artifactSource, metadata) {
11
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
12
+ .mutation((0, graphql_tag_1.default) `
13
+ mutation createLocalBuildMutation(
14
+ $appId: ID!
15
+ $jobInput: LocalBuildJobInput!
16
+ $artifactSource: LocalBuildArchiveSourceInput!
17
+ $metadata: BuildMetadataInput
18
+ ) {
19
+ build {
20
+ createLocalBuild(
21
+ appId: $appId
22
+ job: $jobInput
23
+ artifactSource: $artifactSource
24
+ metadata: $metadata
25
+ ) {
26
+ build {
27
+ id
28
+ ...BuildFragment
29
+ }
30
+ }
31
+ }
32
+ }
33
+ ${(0, graphql_1.print)(Build_1.BuildFragmentNode)}
34
+ `, { appId, jobInput: job, artifactSource, metadata })
35
+ .toPromise());
36
+ return data.build.createLocalBuild.build;
37
+ },
38
+ };
@@ -6,7 +6,7 @@ export interface SignedUrl {
6
6
  bucketKey: string;
7
7
  }
8
8
  export declare const UploadSessionMutation: {
9
- createUploadSessionAsync(graphqlClient: ExpoGraphqlClient, type: UploadSessionType): Promise<SignedUrl>;
9
+ createUploadSessionAsync(graphqlClient: ExpoGraphqlClient, type: UploadSessionType, filename?: string): Promise<SignedUrl>;
10
10
  createAccountScopedUploadSessionAsync(graphqlClient: ExpoGraphqlClient, { type, accountID, }: {
11
11
  type: AccountUploadSessionType;
12
12
  accountID: string;
@@ -5,16 +5,17 @@ const tslib_1 = require("tslib");
5
5
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
6
  const client_1 = require("../client");
7
7
  exports.UploadSessionMutation = {
8
- async createUploadSessionAsync(graphqlClient, type) {
8
+ async createUploadSessionAsync(graphqlClient, type, filename) {
9
9
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
10
10
  .mutation((0, graphql_tag_1.default) `
11
- mutation CreateUploadSessionMutation($type: UploadSessionType!) {
11
+ mutation CreateUploadSessionMutation($type: UploadSessionType!, $filename: String) {
12
12
  uploadSession {
13
- createUploadSession(type: $type)
13
+ createUploadSession(type: $type, filename: $filename)
14
14
  }
15
15
  }
16
16
  `, {
17
17
  type,
18
+ filename,
18
19
  })
19
20
  .toPromise());
20
21
  return data.uploadSession.createUploadSession;
@@ -34,7 +34,7 @@ async function downloadMetadataAsync({ projectDir, profile, exp, analytics, cred
34
34
  projectDir,
35
35
  profile,
36
36
  });
37
- const { unsubscribeTelemetry, executionId } = (0, telemetry_1.subscribeTelemetry)(analytics, AnalyticsManager_1.MetadataEvent.APPLE_METADATA_DOWNLOAD, { app, auth });
37
+ const { unsubscribeTelemetry, executionId } = await (0, telemetry_1.subscribeTelemetryAsync)(analytics, AnalyticsManager_1.MetadataEvent.APPLE_METADATA_DOWNLOAD, { app, auth });
38
38
  log_1.default.addNewLineIfNone();
39
39
  log_1.default.log('Downloading App Store config...');
40
40
  const errors = [];
@@ -22,7 +22,7 @@ async function uploadMetadataAsync({ projectDir, profile, exp, analytics, creden
22
22
  projectDir,
23
23
  profile,
24
24
  });
25
- const { unsubscribeTelemetry, executionId } = (0, telemetry_1.subscribeTelemetry)(analytics, AnalyticsManager_1.MetadataEvent.APPLE_METADATA_UPLOAD, { app, auth });
25
+ const { unsubscribeTelemetry, executionId } = await (0, telemetry_1.subscribeTelemetryAsync)(analytics, AnalyticsManager_1.MetadataEvent.APPLE_METADATA_UPLOAD, { app, auth });
26
26
  log_1.default.addNewLineIfNone();
27
27
  log_1.default.log('Uploading App Store configuration...');
28
28
  const errors = [];
@@ -10,11 +10,11 @@ export type TelemetryContext = {
10
10
  * When providing the app and auth info, we can scrub that data from the telemetry.
11
11
  * Returns an execution ID to group all events of a single run together, and a unsubscribe function.
12
12
  */
13
- export declare function subscribeTelemetry(analytics: Analytics, event: MetadataEvent, options: TelemetryContext): {
13
+ export declare function subscribeTelemetryAsync(analytics: Analytics, event: MetadataEvent, options: TelemetryContext): Promise<{
14
14
  /** Unsubscribe the telemetry from all apple-utils events */
15
15
  unsubscribeTelemetry: () => void;
16
16
  /** The unique id added to all telemetry events from a single execution */
17
17
  executionId: string;
18
- };
18
+ }>;
19
19
  /** Exposed for testing */
20
- export declare function makeDataScrubber({ app, auth }: TelemetryContext): <T>(data: T) => string;
20
+ export declare function makeDataScrubberAsync({ app, auth, }: TelemetryContext): Promise<(<T>(data: T) => string)>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeDataScrubber = exports.subscribeTelemetry = void 0;
3
+ exports.makeDataScrubberAsync = exports.subscribeTelemetryAsync = void 0;
4
4
  const apple_utils_1 = require("@expo/apple-utils");
5
5
  const uuid_1 = require("uuid");
6
6
  /**
@@ -8,9 +8,9 @@ const uuid_1 = require("uuid");
8
8
  * When providing the app and auth info, we can scrub that data from the telemetry.
9
9
  * Returns an execution ID to group all events of a single run together, and a unsubscribe function.
10
10
  */
11
- function subscribeTelemetry(analytics, event, options) {
11
+ async function subscribeTelemetryAsync(analytics, event, options) {
12
12
  const executionId = (0, uuid_1.v4)();
13
- const scrubber = makeDataScrubber(options);
13
+ const scrubber = await makeDataScrubberAsync(options);
14
14
  const { interceptors } = (0, apple_utils_1.getRequestClient)();
15
15
  const responseInterceptorId = interceptors.response.use(response => {
16
16
  analytics.logEvent(event, {
@@ -43,10 +43,10 @@ function subscribeTelemetry(analytics, event, options) {
43
43
  }
44
44
  return { unsubscribeTelemetry, executionId };
45
45
  }
46
- exports.subscribeTelemetry = subscribeTelemetry;
46
+ exports.subscribeTelemetryAsync = subscribeTelemetryAsync;
47
47
  /** Exposed for testing */
48
- function makeDataScrubber({ app, auth }) {
49
- const token = getAuthTokenString(auth);
48
+ async function makeDataScrubberAsync({ app, auth, }) {
49
+ const token = await getAuthTokenStringAsync(auth);
50
50
  const patterns = {
51
51
  APPLE_APP_ID: new RegExp(app.id, 'gi'),
52
52
  APPLE_USERNAME: auth.username ? new RegExp(auth.username, 'gi') : null,
@@ -71,13 +71,13 @@ function makeDataScrubber({ app, auth }) {
71
71
  return value;
72
72
  };
73
73
  }
74
- exports.makeDataScrubber = makeDataScrubber;
75
- function getAuthTokenString(auth) {
74
+ exports.makeDataScrubberAsync = makeDataScrubberAsync;
75
+ async function getAuthTokenStringAsync(auth) {
76
76
  if (!auth.context?.token) {
77
77
  return null;
78
78
  }
79
79
  if (typeof auth.context.token === 'object') {
80
- return auth.context.token.getToken();
80
+ return await auth.context.token.getToken();
81
81
  }
82
82
  return auth.context.token;
83
83
  }
@@ -1,4 +1,19 @@
1
1
  export declare const MIN_XCODE_VERSION = "9.4.0";
2
2
  export declare const APP_STORE_ID = "497799835";
3
3
  export declare function getXcodeVersionAsync(): Promise<string | undefined>;
4
+ type XcodeBuildSettings = {
5
+ action: string;
6
+ buildSettings: {
7
+ BUILD_DIR: string;
8
+ CONFIGURATION_BUILD_DIR: string;
9
+ EXECUTABLE_FOLDER_PATH: string;
10
+ PRODUCT_BUNDLE_IDENTIFIER: string;
11
+ TARGET_BUILD_DIR: string;
12
+ UNLOCALIZED_RESOURCES_FOLDER_PATH: string;
13
+ };
14
+ target: string;
15
+ };
16
+ export declare function getXcodeBuildSettingsAsync(xcworkspacePath: string, scheme: string): Promise<XcodeBuildSettings[]>;
17
+ export declare function resolveXcodeProjectAsync(projectRoot: string): Promise<string | undefined>;
4
18
  export declare function openAppStoreAsync(appId: string): Promise<void>;
19
+ export {};