eas-cli 25.3.0 → 27.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +268 -198
- package/build/build/build.js +6 -0
- package/build/build/createContext.d.ts +4 -3
- package/build/build/createContext.js +1 -4
- package/build/build/errors.d.ts +2 -0
- package/build/build/errors.js +4 -1
- package/build/build/evaluateConfigWithEnvVarsAsync.js +1 -3
- package/build/build/runBuildAndSubmit.d.ts +7 -2
- package/build/build/runBuildAndSubmit.js +9 -8
- package/build/build/utils/expoTokenRole.d.ts +4 -0
- package/build/build/utils/expoTokenRole.js +14 -0
- package/build/commandUtils/EasCommand.js +3 -3
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +2 -2
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +40 -61
- package/build/commandUtils/context/LoggedInContextField.js +1 -2
- package/build/commandUtils/context/MaybeLoggedInContextField.js +1 -2
- package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.js +3 -1
- package/build/commandUtils/context/PrivateProjectConfigContextField.js +3 -1
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +2 -1
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +1 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +5 -2
- package/build/commandUtils/workflow/referencedFiles.d.ts +6 -0
- package/build/commandUtils/workflow/referencedFiles.js +63 -0
- package/build/commandUtils/workflow/types.d.ts +1 -1
- package/build/commandUtils/workflow/utils.js +34 -5
- package/build/commands/account/login.js +6 -0
- package/build/commands/account/view.d.ts +0 -7
- package/build/commands/account/view.js +4 -74
- package/build/commands/browse.js +1 -1
- package/build/commands/build/dev.js +3 -3
- package/build/commands/channel/delete.js +1 -1
- package/build/commands/channel/rollout.js +1 -1
- package/build/commands/credentials/configure-build.js +1 -1
- package/build/commands/deploy/alias/delete.js +1 -1
- package/build/commands/deploy/alias/index.js +1 -1
- package/build/commands/deploy/delete.js +1 -1
- package/build/commands/go.js +1 -1
- package/build/commands/observe/event.js +1 -1
- package/build/commands/observe/events.js +1 -1
- package/build/commands/project/new.js +1 -1
- package/build/commands/simulator/control.js +42 -7
- package/build/commands/simulator/get.js +14 -1
- package/build/commands/simulator/index.js +12 -4
- package/build/commands/simulator/logs.d.ts +22 -0
- package/build/commands/simulator/logs.js +188 -0
- package/build/commands/workflow/cancel.js +9 -20
- package/build/commands/workflow/list.js +1 -1
- package/build/commands/workflow/logs.js +1 -1
- package/build/commands/workflow/run.js +10 -1
- package/build/commands/workflow/runs.js +1 -1
- package/build/commands/workflow/status.js +1 -1
- package/build/commands/workflow/view.js +1 -1
- package/build/graphql/generated.d.ts +438 -115
- package/build/graphql/generated.js +40 -9
- package/build/graphql/mutations/WorkflowRevisionMutation.d.ts +3 -2
- package/build/graphql/mutations/WorkflowRevisionMutation.js +12 -3
- package/build/graphql/queries/DeviceRunSessionQuery.d.ts +8 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +67 -0
- package/build/graphql/queries/WorkflowRunQuery.js +6 -0
- package/build/graphql/types/WorkflowRun.js +1 -0
- package/build/help.js +13 -6
- package/build/log.d.ts +2 -0
- package/build/log.js +10 -0
- package/build/project/projectStatus.js +1 -0
- package/build/simulator/artifacts.d.ts +9 -0
- package/build/simulator/artifacts.js +97 -0
- package/build/simulator/download.d.ts +2 -0
- package/build/simulator/download.js +57 -0
- package/build/simulator/events.js +2 -10
- package/build/simulator/jobRunErrors.d.ts +22 -0
- package/build/simulator/jobRunErrors.js +134 -0
- package/build/simulator/preview.d.ts +26 -0
- package/build/simulator/preview.js +156 -0
- package/build/simulator/utils.d.ts +5 -0
- package/build/simulator/utils.js +42 -0
- package/build/user/SessionManager.d.ts +10 -0
- package/build/user/SessionManager.js +12 -0
- package/build/user/accountPermissions.d.ts +11 -0
- package/build/user/accountPermissions.js +89 -0
- package/oclif.manifest.json +169 -21
- package/package.json +7 -7
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* For more info and docs, visit https://graphql-code-generator.com/
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.WorkflowsInsightsRunsOverTimeGranularity = exports.WorkflowsInsightsExportFormat = exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = exports.WorkflowJobStatus = exports.WorkflowJobReviewDecision = exports.WorkflowDispatchInputType = exports.WorkflowDeviceTestCaseStatusFilter = exports.WorkflowDeviceTestCaseStatus = exports.WorkflowDeviceTestCaseStatSortField = exports.WorkflowDeviceTestCaseSortDirection = exports.WorkflowDeviceTestCaseInsightsTimeSeriesGranularity = exports.WorkflowArtifactStorageType = exports.WorkerLoggerLevel = exports.WorkerDeploymentLogLevel = exports.WorkerDeploymentCrashKind = exports.WebhookType = exports.UserSpecifiedAccountUsage = exports.UserEntityTypeName = exports.UserAgentPlatform = exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = void 0;
|
|
9
|
+
exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AssetMapSourceType = exports.AppleTeamType = exports.AppleDeviceClass = exports.AppUploadSessionType = exports.AppStoreConnectWorkflowConnectionStatus = exports.AppStoreConnectUserRole = exports.AppStoreConnectBuildUploadState = exports.AppStoreConnectBuildProcessingState = exports.AppProfileImageWidth = exports.AppPrivacy = exports.AppPlatform = exports.AppObserveUserEventNamesOrderByField = exports.AppObserveUserEventListOrderByField = exports.AppObserveUserEventBreakdownDimension = exports.AppObserveUpdatesOrderByField = exports.AppObserveSpanStatusCode = exports.AppObserveSpanListOrderByField = exports.AppObserveSpanKind = exports.AppObservePropertyType = exports.AppObservePlatform = exports.AppObserveOrderDirection = exports.AppObserveNavigationRoutesOrderByField = exports.AppObserveMetricsListOrderByField = exports.AppObserveLogsOrderByField = exports.AppObserveEventsOrderByField = exports.AppObserveEventsOrderByDirection = exports.AppObserveErrorSeverity = exports.AppObserveErrorOccurrencesOrderByField = exports.AppObserveErrorKind = exports.AppObserveErrorGroupsOrderBy = exports.AppObserveErrorBreakdownDimension = exports.AppObserveCustomEventNamesOrderByField = exports.AppObserveCustomEventNamesOrderByDirection = exports.AppObserveCustomEventListOrderByField = exports.AppInternalDistributionBuildPrivacy = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.AgentProviderConnectionStatus = exports.AgentProviderConnectionAuthorizationStatus = exports.AgentProvider = exports.AgentKind = exports.ActivityTimelineProjectActivityType = exports.AccountUploadSessionType = exports.AccountMemberType = exports.AccountAppsSortByField = exports.AccessTokenScopeType = void 0;
|
|
10
|
+
exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = exports.GitHubAppInstallationStatus = exports.GitHubAppInstallationAccountType = exports.GitHubAppEnvironment = exports.FingerprintSourceType = exports.Feature = exports.Experiment = exports.ExitInterviewOutcome = exports.ExitInterviewMessageRole = exports.EnvironmentVariableVisibility = exports.EnvironmentVariableScope = exports.EnvironmentSecretType = exports.EntityTypeName = exports.EasTotalPlanEnablementUnit = exports.EasServiceMetric = exports.EasService = exports.EasBuildWaiverType = exports.EasBuildDeprecationInfoType = exports.EasBuildBillingResourceClass = exports.DistributionType = exports.DeviceRunSessionType = exports.DeviceRunSessionStatus = exports.DeviceRunSessionResourceClass = exports.DeviceRunSessionRequestOrigin = exports.DeviceRunSessionEgress = exports.DashboardViewPin = 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.BuildAnnotationType = exports.BackgroundJobState = exports.BackgroundJobResultType = exports.AuthProviderIdentifier = void 0;
|
|
11
|
+
exports.UpdateDiffReceiptOrderByDirection = exports.TurtleSshTransportType = exports.TurtleSshTargetType = exports.TargetEntityMutationType = exports.SupabaseAdvisorType = exports.SupabaseAdvisorLintLevel = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidReleaseStatus = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SourceMapSourceType = exports.SecondFactorMethod = exports.SandboxStatus = exports.SandboxResourceClass = exports.SandboxOperatingSystem = exports.Role = exports.ResponseType = exports.ResponseStatusType = exports.ResponseCacheStatus = exports.ResourceClassExperiment = exports.RequestsOrderByField = exports.RequestsOrderByDirection = exports.RequestMethod = exports.RealtimeLogsTargetType = exports.ProjectArchiveSourceType = exports.PostHogRegion = exports.PostHogDeepLinkPurpose = exports.Permission = exports.Order = exports.OnboardingEnvironment = exports.OnboardingDeviceType = exports.OfferType = exports.OAuthProvider = exports.NotificationType = exports.NotificationEvent = exports.LocalBuildArchiveSourceType = exports.JobRunStatus = exports.JobRunPriority = exports.JobExpoTokenRole = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = void 0;
|
|
12
|
+
exports.WorkflowsInsightsRunsOverTimeGranularity = exports.WorkflowsInsightsExportFormat = exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = exports.WorkflowJobStatus = exports.WorkflowJobReviewDecision = exports.WorkflowDispatchInputType = exports.WorkflowDeviceTestCaseStatusFilter = exports.WorkflowDeviceTestCaseStatus = exports.WorkflowDeviceTestCaseStatSortField = exports.WorkflowDeviceTestCaseSortDirection = exports.WorkflowDeviceTestCaseInsightsTimeSeriesGranularity = exports.WorkflowArtifactStorageType = exports.WorkerLoggerLevel = exports.WorkerDeploymentLogLevel = exports.WorkerDeploymentCrashKind = exports.WebhookType = exports.UserSpecifiedAccountUsage = exports.UserEntityTypeName = exports.UserAgentPlatform = exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.UpdatesTimelineItemType = exports.UpdateDiffReceiptStateValue = exports.UpdateDiffReceiptOrderByField = void 0;
|
|
13
13
|
var AccessTokenScopeType;
|
|
14
14
|
(function (AccessTokenScopeType) {
|
|
15
15
|
/** One account, named by accountID, narrowed to the scope's permissions. */
|
|
@@ -49,11 +49,17 @@ var AccountUploadSessionType;
|
|
|
49
49
|
var ActivityTimelineProjectActivityType;
|
|
50
50
|
(function (ActivityTimelineProjectActivityType) {
|
|
51
51
|
ActivityTimelineProjectActivityType["Build"] = "BUILD";
|
|
52
|
+
ActivityTimelineProjectActivityType["DeviceRunSession"] = "DEVICE_RUN_SESSION";
|
|
52
53
|
ActivityTimelineProjectActivityType["Submission"] = "SUBMISSION";
|
|
53
54
|
ActivityTimelineProjectActivityType["Update"] = "UPDATE";
|
|
54
55
|
ActivityTimelineProjectActivityType["Worker"] = "WORKER";
|
|
55
56
|
ActivityTimelineProjectActivityType["WorkflowRun"] = "WORKFLOW_RUN";
|
|
56
57
|
})(ActivityTimelineProjectActivityType || (exports.ActivityTimelineProjectActivityType = ActivityTimelineProjectActivityType = {}));
|
|
58
|
+
var AgentKind;
|
|
59
|
+
(function (AgentKind) {
|
|
60
|
+
AgentKind["ClaudeCode"] = "CLAUDE_CODE";
|
|
61
|
+
AgentKind["Codex"] = "CODEX";
|
|
62
|
+
})(AgentKind || (exports.AgentKind = AgentKind = {}));
|
|
57
63
|
var AgentProvider;
|
|
58
64
|
(function (AgentProvider) {
|
|
59
65
|
AgentProvider["Anthropic"] = "ANTHROPIC";
|
|
@@ -188,11 +194,25 @@ var AppObservePropertyType;
|
|
|
188
194
|
AppObservePropertyType["Number"] = "NUMBER";
|
|
189
195
|
AppObservePropertyType["String"] = "STRING";
|
|
190
196
|
})(AppObservePropertyType || (exports.AppObservePropertyType = AppObservePropertyType = {}));
|
|
191
|
-
var
|
|
192
|
-
(function (
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
var AppObserveSpanKind;
|
|
198
|
+
(function (AppObserveSpanKind) {
|
|
199
|
+
AppObserveSpanKind["Client"] = "CLIENT";
|
|
200
|
+
AppObserveSpanKind["Consumer"] = "CONSUMER";
|
|
201
|
+
AppObserveSpanKind["Internal"] = "INTERNAL";
|
|
202
|
+
AppObserveSpanKind["Producer"] = "PRODUCER";
|
|
203
|
+
AppObserveSpanKind["Server"] = "SERVER";
|
|
204
|
+
AppObserveSpanKind["Unspecified"] = "UNSPECIFIED";
|
|
205
|
+
})(AppObserveSpanKind || (exports.AppObserveSpanKind = AppObserveSpanKind = {}));
|
|
206
|
+
var AppObserveSpanListOrderByField;
|
|
207
|
+
(function (AppObserveSpanListOrderByField) {
|
|
208
|
+
AppObserveSpanListOrderByField["StartTimestamp"] = "START_TIMESTAMP";
|
|
209
|
+
})(AppObserveSpanListOrderByField || (exports.AppObserveSpanListOrderByField = AppObserveSpanListOrderByField = {}));
|
|
210
|
+
var AppObserveSpanStatusCode;
|
|
211
|
+
(function (AppObserveSpanStatusCode) {
|
|
212
|
+
AppObserveSpanStatusCode["Error"] = "ERROR";
|
|
213
|
+
AppObserveSpanStatusCode["Ok"] = "OK";
|
|
214
|
+
AppObserveSpanStatusCode["Unset"] = "UNSET";
|
|
215
|
+
})(AppObserveSpanStatusCode || (exports.AppObserveSpanStatusCode = AppObserveSpanStatusCode = {}));
|
|
196
216
|
var AppObserveUpdatesOrderByField;
|
|
197
217
|
(function (AppObserveUpdatesOrderByField) {
|
|
198
218
|
AppObserveUpdatesOrderByField["DownloadCount"] = "DOWNLOAD_COUNT";
|
|
@@ -325,6 +345,7 @@ var AuthProviderIdentifier;
|
|
|
325
345
|
AuthProviderIdentifier["MsEntraId"] = "MS_ENTRA_ID";
|
|
326
346
|
AuthProviderIdentifier["Okta"] = "OKTA";
|
|
327
347
|
AuthProviderIdentifier["OneLogin"] = "ONE_LOGIN";
|
|
348
|
+
AuthProviderIdentifier["Rippling"] = "RIPPLING";
|
|
328
349
|
AuthProviderIdentifier["StubIdp"] = "STUB_IDP";
|
|
329
350
|
})(AuthProviderIdentifier || (exports.AuthProviderIdentifier = AuthProviderIdentifier = {}));
|
|
330
351
|
var BackgroundJobResultType;
|
|
@@ -645,7 +666,9 @@ var EntityTypeName;
|
|
|
645
666
|
EntityTypeName["ConvexProjectEntity"] = "ConvexProjectEntity";
|
|
646
667
|
EntityTypeName["ConvexTeamConnectionEntity"] = "ConvexTeamConnectionEntity";
|
|
647
668
|
EntityTypeName["CustomerEntity"] = "CustomerEntity";
|
|
669
|
+
/** @deprecated This entity type was deleted. Existing audit logs can still reference it. */
|
|
648
670
|
EntityTypeName["EchoProjectEntity"] = "EchoProjectEntity";
|
|
671
|
+
/** @deprecated This entity type was deleted. Existing audit logs can still reference it. */
|
|
649
672
|
EntityTypeName["EchoVersionEntity"] = "EchoVersionEntity";
|
|
650
673
|
EntityTypeName["EnvironmentVariableEntity"] = "EnvironmentVariableEntity";
|
|
651
674
|
EntityTypeName["GoogleServiceAccountKeyEntity"] = "GoogleServiceAccountKeyEntity";
|
|
@@ -794,6 +817,13 @@ var IosSchemeBuildConfiguration;
|
|
|
794
817
|
IosSchemeBuildConfiguration["Debug"] = "DEBUG";
|
|
795
818
|
IosSchemeBuildConfiguration["Release"] = "RELEASE";
|
|
796
819
|
})(IosSchemeBuildConfiguration || (exports.IosSchemeBuildConfiguration = IosSchemeBuildConfiguration = {}));
|
|
820
|
+
/** A role that a build can request for its EXPO_TOKEN. */
|
|
821
|
+
var JobExpoTokenRole;
|
|
822
|
+
(function (JobExpoTokenRole) {
|
|
823
|
+
JobExpoTokenRole["Developer"] = "DEVELOPER";
|
|
824
|
+
JobExpoTokenRole["ReleaseManager"] = "RELEASE_MANAGER";
|
|
825
|
+
JobExpoTokenRole["Runner"] = "RUNNER";
|
|
826
|
+
})(JobExpoTokenRole || (exports.JobExpoTokenRole = JobExpoTokenRole = {}));
|
|
797
827
|
var JobRunPriority;
|
|
798
828
|
(function (JobRunPriority) {
|
|
799
829
|
JobRunPriority["High"] = "HIGH";
|
|
@@ -1311,6 +1341,7 @@ var WorkflowJobType;
|
|
|
1311
1341
|
WorkflowJobType["Custom"] = "CUSTOM";
|
|
1312
1342
|
WorkflowJobType["Deploy"] = "DEPLOY";
|
|
1313
1343
|
WorkflowJobType["Doc"] = "DOC";
|
|
1344
|
+
WorkflowJobType["Email"] = "EMAIL";
|
|
1314
1345
|
WorkflowJobType["Fingerprint"] = "FINGERPRINT";
|
|
1315
1346
|
WorkflowJobType["GetBuild"] = "GET_BUILD";
|
|
1316
1347
|
WorkflowJobType["GithubComment"] = "GITHUB_COMMENT";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
-
import { WorkflowRevision } from '../generated';
|
|
3
|
+
import { WorkflowReferencedFileInput, WorkflowRevision } from '../generated';
|
|
4
4
|
export declare namespace WorkflowRevisionMutation {
|
|
5
5
|
const ValidationErrorExtensionZ: z.ZodObject<{
|
|
6
6
|
errorCode: z.ZodLiteral<"VALIDATION_ERROR">;
|
|
@@ -14,8 +14,9 @@ export declare namespace WorkflowRevisionMutation {
|
|
|
14
14
|
fileName: string;
|
|
15
15
|
gitRef: string;
|
|
16
16
|
}): Promise<WorkflowRevision | undefined>;
|
|
17
|
-
function validateWorkflowYamlConfigAsync(graphqlClient: ExpoGraphqlClient, { appId, yamlConfig, }: {
|
|
17
|
+
function validateWorkflowYamlConfigAsync(graphqlClient: ExpoGraphqlClient, { appId, yamlConfig, referencedFiles, }: {
|
|
18
18
|
appId: string;
|
|
19
19
|
yamlConfig: string;
|
|
20
|
+
referencedFiles?: WorkflowReferencedFileInput[];
|
|
20
21
|
}): Promise<void>;
|
|
21
22
|
}
|
|
@@ -41,17 +41,26 @@ var WorkflowRevisionMutation;
|
|
|
41
41
|
undefined);
|
|
42
42
|
}
|
|
43
43
|
WorkflowRevisionMutation.getOrCreateWorkflowRevisionFromGitRefAsync = getOrCreateWorkflowRevisionFromGitRefAsync;
|
|
44
|
-
async function validateWorkflowYamlConfigAsync(graphqlClient, { appId, yamlConfig, }) {
|
|
44
|
+
async function validateWorkflowYamlConfigAsync(graphqlClient, { appId, yamlConfig, referencedFiles, }) {
|
|
45
45
|
await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
46
46
|
.mutation((0, graphql_tag_1.default) `
|
|
47
|
-
mutation ValidateWorkflowYamlConfig(
|
|
47
|
+
mutation ValidateWorkflowYamlConfig(
|
|
48
|
+
$appId: ID!
|
|
49
|
+
$yamlConfig: String!
|
|
50
|
+
$referencedFiles: [WorkflowReferencedFileInput!]
|
|
51
|
+
) {
|
|
48
52
|
workflowRevision {
|
|
49
|
-
validateWorkflowYamlConfig(
|
|
53
|
+
validateWorkflowYamlConfig(
|
|
54
|
+
appId: $appId
|
|
55
|
+
yamlConfig: $yamlConfig
|
|
56
|
+
referencedFiles: $referencedFiles
|
|
57
|
+
)
|
|
50
58
|
}
|
|
51
59
|
}
|
|
52
60
|
`, {
|
|
53
61
|
appId,
|
|
54
62
|
yamlConfig,
|
|
63
|
+
referencedFiles,
|
|
55
64
|
})
|
|
56
65
|
.toPromise());
|
|
57
66
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { DeviceRunSessionByIdQuery, DeviceRunSessionEventsByIdQuery, DeviceRunSessionFilterInput, DeviceRunSessionsByAppIdQuery } from '../generated';
|
|
2
|
+
import { DeviceRunSessionByIdQuery, DeviceRunSessionEventsByIdQuery, DeviceRunSessionFilterInput, DeviceRunSessionJobRunErrorsByIdQuery, DeviceRunSessionsByAppIdQuery } from '../generated';
|
|
3
3
|
export declare const DeviceRunSessionQuery: {
|
|
4
4
|
eventsByIdAsync(graphqlClient: ExpoGraphqlClient, deviceRunSessionId: string): Promise<DeviceRunSessionEventsByIdQuery["deviceRunSessions"]["byId"]>;
|
|
5
|
+
/**
|
|
6
|
+
* Best-effort lookup of why the session's job run failed. It doesn't retry or print errors, and it
|
|
7
|
+
* rejects with `signal.reason` and cancels the request when `signal` aborts.
|
|
8
|
+
*/
|
|
9
|
+
jobRunErrorsByIdAsync(graphqlClient: ExpoGraphqlClient, deviceRunSessionId: string, { signal }: {
|
|
10
|
+
signal: AbortSignal;
|
|
11
|
+
}): Promise<DeviceRunSessionJobRunErrorsByIdQuery["deviceRunSessions"]["byId"]["turtleJobRun"]>;
|
|
5
12
|
byIdAsync(graphqlClient: ExpoGraphqlClient, deviceRunSessionId: string): Promise<DeviceRunSessionByIdQuery["deviceRunSessions"]["byId"]>;
|
|
6
13
|
listByAppIdAsync(graphqlClient: ExpoGraphqlClient, { appId, first, after, filter, }: {
|
|
7
14
|
appId: string;
|
|
@@ -25,6 +25,39 @@ exports.DeviceRunSessionQuery = {
|
|
|
25
25
|
.toPromise());
|
|
26
26
|
return data.deviceRunSessions.byId;
|
|
27
27
|
},
|
|
28
|
+
/**
|
|
29
|
+
* Best-effort lookup of why the session's job run failed. It doesn't retry or print errors, and it
|
|
30
|
+
* rejects with `signal.reason` and cancels the request when `signal` aborts.
|
|
31
|
+
*/
|
|
32
|
+
async jobRunErrorsByIdAsync(graphqlClient, deviceRunSessionId, { signal }) {
|
|
33
|
+
const { data, error } = await firstResultUntilAbortedAsync(graphqlClient.query((0, graphql_tag_1.default) `
|
|
34
|
+
query DeviceRunSessionJobRunErrorsByIdQuery($deviceRunSessionId: ID!) {
|
|
35
|
+
deviceRunSessions {
|
|
36
|
+
byId(deviceRunSessionId: $deviceRunSessionId) {
|
|
37
|
+
id
|
|
38
|
+
turtleJobRun {
|
|
39
|
+
id
|
|
40
|
+
errors {
|
|
41
|
+
errorCode
|
|
42
|
+
message
|
|
43
|
+
docsUrl
|
|
44
|
+
}
|
|
45
|
+
logFileUrls
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`, { deviceRunSessionId },
|
|
51
|
+
// Retries would keep a timer alive after the caller gives up.
|
|
52
|
+
{ requestPolicy: 'network-only', noRetry: true }), signal);
|
|
53
|
+
if (error) {
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
if (!data) {
|
|
57
|
+
throw new Error('Returned query result data is null!');
|
|
58
|
+
}
|
|
59
|
+
return data.deviceRunSessions.byId.turtleJobRun;
|
|
60
|
+
},
|
|
28
61
|
async byIdAsync(graphqlClient, deviceRunSessionId) {
|
|
29
62
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
30
63
|
.query((0, graphql_tag_1.default) `
|
|
@@ -179,3 +212,37 @@ exports.DeviceRunSessionQuery = {
|
|
|
179
212
|
return data.app.byId.deviceRunSessionsPaginated;
|
|
180
213
|
},
|
|
181
214
|
};
|
|
215
|
+
// Like `toPromise()`, but unsubscribing on abort makes urql cancel the request.
|
|
216
|
+
async function firstResultUntilAbortedAsync(source, signal) {
|
|
217
|
+
signal.throwIfAborted();
|
|
218
|
+
return await new Promise((resolve, reject) => {
|
|
219
|
+
let subscription;
|
|
220
|
+
let settled = false;
|
|
221
|
+
const settle = (finish) => {
|
|
222
|
+
if (settled) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
settled = true;
|
|
226
|
+
signal.removeEventListener('abort', onAbort);
|
|
227
|
+
subscription?.unsubscribe();
|
|
228
|
+
finish();
|
|
229
|
+
};
|
|
230
|
+
const onAbort = () => {
|
|
231
|
+
settle(() => {
|
|
232
|
+
reject(signal.reason);
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
236
|
+
subscription = source.subscribe(result => {
|
|
237
|
+
if (!result.stale && !result.hasNext) {
|
|
238
|
+
settle(() => {
|
|
239
|
+
resolve(result);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
// The result can arrive synchronously, before `subscription` is assigned.
|
|
244
|
+
if (settled) {
|
|
245
|
+
subscription.unsubscribe();
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
package/build/help.js
CHANGED
|
@@ -40,13 +40,20 @@ class EasHelp extends core_1.Help {
|
|
|
40
40
|
const [command, ...args] = argv;
|
|
41
41
|
if (command === 'simulator:control' || command === 'sim:control') {
|
|
42
42
|
const { default: SimulatorControl } = await Promise.resolve().then(() => __importStar(require('./commands/simulator/control')));
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
let parsed;
|
|
44
|
+
try {
|
|
45
|
+
parsed = await core_1.Parser.parse(args, {
|
|
46
|
+
args: SimulatorControl.args,
|
|
47
|
+
flags: SimulatorControl.flags,
|
|
48
|
+
strict: false,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
await super.showHelp(argv);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
48
55
|
if (parsed.args.action && parsed.flags.help) {
|
|
49
|
-
await
|
|
56
|
+
await this.config.runCommand('simulator:control', args);
|
|
50
57
|
return;
|
|
51
58
|
}
|
|
52
59
|
}
|
package/build/log.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export default class Log {
|
|
|
10
10
|
*/
|
|
11
11
|
static markFreshLine(): void;
|
|
12
12
|
static error(...args: any[]): void;
|
|
13
|
+
static errorToStderr(...args: any[]): void;
|
|
14
|
+
static warnToStderr(...args: any[]): void;
|
|
13
15
|
static warn(...args: any[]): void;
|
|
14
16
|
static debug(...args: any[]): void;
|
|
15
17
|
static gray(...args: any[]): void;
|
package/build/log.js
CHANGED
|
@@ -34,6 +34,16 @@ class Log {
|
|
|
34
34
|
static error(...args) {
|
|
35
35
|
Log.consoleLog(...Log.withTextColor(args, chalk_1.default.red));
|
|
36
36
|
}
|
|
37
|
+
static errorToStderr(...args) {
|
|
38
|
+
Log.updateIsLastLineNewLine(args);
|
|
39
|
+
// eslint-disable-next-line no-console
|
|
40
|
+
console.error(...Log.withTextColor(args, chalk_1.default.stderr.red));
|
|
41
|
+
}
|
|
42
|
+
static warnToStderr(...args) {
|
|
43
|
+
Log.updateIsLastLineNewLine(args);
|
|
44
|
+
// eslint-disable-next-line no-console
|
|
45
|
+
console.error(...Log.withTextColor(args, chalk_1.default.stderr.yellow));
|
|
46
|
+
}
|
|
37
47
|
static warn(...args) {
|
|
38
48
|
Log.consoleLog(...Log.withTextColor(args, chalk_1.default.yellow));
|
|
39
49
|
}
|
|
@@ -306,6 +306,7 @@ function colorWorkflowStatus(status) {
|
|
|
306
306
|
case generated_1.WorkflowRunStatus.ActionRequired:
|
|
307
307
|
return chalk_1.default.yellow('action required');
|
|
308
308
|
case generated_1.WorkflowRunStatus.New:
|
|
309
|
+
case generated_1.WorkflowRunStatus.Waiting:
|
|
309
310
|
case generated_1.WorkflowRunStatus.InProgress:
|
|
310
311
|
return chalk_1.default.blue(status.toLowerCase().replace(/_/g, ' '));
|
|
311
312
|
default:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DeviceRunSessionByIdQuery } from '../graphql/generated';
|
|
2
|
+
export type SimulatorSession = DeviceRunSessionByIdQuery['deviceRunSessions']['byId'];
|
|
3
|
+
export declare function hasSimulatorArtifacts(session: SimulatorSession): boolean;
|
|
4
|
+
export declare function downloadSimulatorArtifactAsync(session: SimulatorSession, type: string, { artifact: index, output, nonInteractive, json, }: {
|
|
5
|
+
artifact?: number;
|
|
6
|
+
output?: string;
|
|
7
|
+
nonInteractive: boolean;
|
|
8
|
+
json: boolean;
|
|
9
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasSimulatorArtifacts = hasSimulatorArtifacts;
|
|
4
|
+
exports.downloadSimulatorArtifactAsync = downloadSimulatorArtifactAsync;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
7
|
+
const download_1 = require("./download");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const fetch_1 = tslib_1.__importDefault(require("../fetch"));
|
|
10
|
+
const generated_1 = require("../graphql/generated");
|
|
11
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
12
|
+
const ora_1 = require("../ora");
|
|
13
|
+
const files_1 = require("../utils/files");
|
|
14
|
+
const prompts_1 = require("../prompts");
|
|
15
|
+
const json_1 = require("../utils/json");
|
|
16
|
+
function hasSimulatorArtifacts(session) {
|
|
17
|
+
return (session.status === generated_1.DeviceRunSessionStatus.Stopped ||
|
|
18
|
+
session.status === generated_1.DeviceRunSessionStatus.Errored);
|
|
19
|
+
}
|
|
20
|
+
async function downloadSimulatorArtifactAsync(session, type, { artifact: index, output, nonInteractive, json, }) {
|
|
21
|
+
const artifacts = session.artifacts
|
|
22
|
+
.filter(artifact => artifact.metadata?.__eas_type === type)
|
|
23
|
+
.sort((a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt) ||
|
|
24
|
+
a.name.localeCompare(b.name) ||
|
|
25
|
+
a.id.localeCompare(b.id));
|
|
26
|
+
if (artifacts.length === 0) {
|
|
27
|
+
throw new Error('No matching artifacts are available for this session. Artifacts may still be uploading or may not have been recorded. Run `eas simulator:get` to check the session, then try again.');
|
|
28
|
+
}
|
|
29
|
+
const titles = artifacts.map((artifact, i) => {
|
|
30
|
+
const metadata = artifact.metadata;
|
|
31
|
+
const device = metadata?.deviceName ?? metadata?.udid;
|
|
32
|
+
const part = metadata?.part;
|
|
33
|
+
return (0, utils_1.stripTerminalControlCharacters)(`${i + 1}. ${artifact.name} — ${artifact.filename} (${(0, files_1.formatBytes)(artifact.fileSizeBytes ?? 0)})${device ? ` (${device})` : ''}${part !== undefined ? ` (part ${part})` : ''}`);
|
|
34
|
+
});
|
|
35
|
+
const selectionMessage = `Choose an artifact with --artifact <index>:\n${titles.join('\n')}`;
|
|
36
|
+
let selectedIndex = index;
|
|
37
|
+
if (selectedIndex !== undefined &&
|
|
38
|
+
(!Number.isInteger(selectedIndex) || selectedIndex < 1 || selectedIndex > artifacts.length)) {
|
|
39
|
+
throw new Error(`The artifact index is out of range. ${selectionMessage}`);
|
|
40
|
+
}
|
|
41
|
+
if (selectedIndex === undefined) {
|
|
42
|
+
if (artifacts.length === 1) {
|
|
43
|
+
selectedIndex = 1;
|
|
44
|
+
}
|
|
45
|
+
else if (nonInteractive) {
|
|
46
|
+
throw new Error(selectionMessage);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
selectedIndex = await (0, prompts_1.selectAsync)('Select an artifact to download:', titles.map((title, i) => ({ title, value: i + 1 })));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const artifact = artifacts[selectedIndex - 1];
|
|
53
|
+
if (!output) {
|
|
54
|
+
if (nonInteractive) {
|
|
55
|
+
throw new Error('Pass --output <path> to save the session artifact in non-interactive mode.');
|
|
56
|
+
}
|
|
57
|
+
const { filePath } = await (0, prompts_1.promptAsync)({
|
|
58
|
+
type: 'text',
|
|
59
|
+
name: 'filePath',
|
|
60
|
+
message: 'Where should the artifact be saved?',
|
|
61
|
+
initial: (0, utils_1.stripTerminalControlCharacters)(node_path_1.default.basename(artifact.filename)),
|
|
62
|
+
validate: value => value.trim().length > 0 || 'Enter an output path.',
|
|
63
|
+
});
|
|
64
|
+
output = typeof filePath === 'string' ? filePath : undefined;
|
|
65
|
+
}
|
|
66
|
+
if (!output) {
|
|
67
|
+
throw new Error('Enter an output path.');
|
|
68
|
+
}
|
|
69
|
+
const spinner = json ? undefined : (0, ora_1.ora)('Downloading session artifact').start();
|
|
70
|
+
let filePath;
|
|
71
|
+
try {
|
|
72
|
+
filePath = await (0, download_1.downloadSimulatorFileAsync)(output, async (signal) => {
|
|
73
|
+
try {
|
|
74
|
+
return await (0, fetch_1.default)(artifact.downloadUrl, { signal, timeout: 30_000 });
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
throw new Error('Could not download the session artifact. Check your internet connection and try again.');
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
spinner?.succeed();
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
spinner?.fail();
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
if (json) {
|
|
87
|
+
const { id, name, filename, metadata } = artifact;
|
|
88
|
+
(0, json_1.printJsonOnlyOutput)({
|
|
89
|
+
deviceRunSessionId: session.id,
|
|
90
|
+
artifact: { id, name, filename, metadata },
|
|
91
|
+
filePath,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
log_1.default.log(`Saved ${(0, utils_1.stripTerminalControlCharacters)(artifact.name)} to ${(0, utils_1.stripTerminalControlCharacters)(filePath)}.`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.downloadSimulatorFileAsync = downloadSimulatorFileAsync;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
|
+
const promises_1 = require("node:fs/promises");
|
|
7
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
8
|
+
const promises_2 = require("node:stream/promises");
|
|
9
|
+
const DOWNLOAD_TIMEOUT_MS = 10 * 60_000;
|
|
10
|
+
async function downloadSimulatorFileAsync(output, getResponse) {
|
|
11
|
+
const outputPath = node_path_1.default.resolve(output);
|
|
12
|
+
if (await fs_extra_1.default.pathExists(outputPath)) {
|
|
13
|
+
throw new Error('The output file already exists. The command does not overwrite files. Choose another --output path.');
|
|
14
|
+
}
|
|
15
|
+
const controller = new AbortController();
|
|
16
|
+
const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS)]);
|
|
17
|
+
const interruptHandler = () => {
|
|
18
|
+
controller.abort();
|
|
19
|
+
};
|
|
20
|
+
let response;
|
|
21
|
+
let created = false;
|
|
22
|
+
process.on('SIGINT', interruptHandler);
|
|
23
|
+
try {
|
|
24
|
+
response = await getResponse(signal);
|
|
25
|
+
const file = await (0, promises_1.open)(outputPath, 'wx', 0o600);
|
|
26
|
+
created = true;
|
|
27
|
+
try {
|
|
28
|
+
await (0, promises_2.pipeline)(response.body, file.createWriteStream(), { signal });
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
await file.close();
|
|
32
|
+
}
|
|
33
|
+
return outputPath;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (created) {
|
|
37
|
+
await fs_extra_1.default.remove(outputPath);
|
|
38
|
+
}
|
|
39
|
+
if (error.code === 'EEXIST') {
|
|
40
|
+
throw new Error('The output file already exists. The command does not overwrite files. Choose another --output path.');
|
|
41
|
+
}
|
|
42
|
+
if (controller.signal.aborted) {
|
|
43
|
+
throw new Error('The download was canceled.');
|
|
44
|
+
}
|
|
45
|
+
if (signal.aborted) {
|
|
46
|
+
throw new Error('The download timed out. It did not finish within 10 minutes. Check your internet connection, then run the command again.');
|
|
47
|
+
}
|
|
48
|
+
if (!response) {
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
throw new Error('Could not save the download. Check that the --output directory exists and is writable, then try again.');
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
controller.abort();
|
|
55
|
+
process.removeListener('SIGINT', interruptHandler);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -4,8 +4,8 @@ exports.downloadDeviceRunSessionEventsAsync = downloadDeviceRunSessionEventsAsyn
|
|
|
4
4
|
exports.projectDeviceRunSessionEventsForDisplay = projectDeviceRunSessionEventsForDisplay;
|
|
5
5
|
exports.formatDeviceRunSessionEvent = formatDeviceRunSessionEvent;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
-
const util_1 = require("util");
|
|
8
7
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
9
|
const fetch_1 = tslib_1.__importStar(require("../fetch"));
|
|
10
10
|
const timer_1 = require("../utils/timer");
|
|
11
11
|
async function downloadDeviceRunSessionEventsAsync(eventLogUrl) {
|
|
@@ -71,7 +71,7 @@ function formatDeviceRunSessionEvent(event) {
|
|
|
71
71
|
? `${event.summary} ${screenshotFilename}`
|
|
72
72
|
: event.summary;
|
|
73
73
|
const duration = event.durationMs === undefined ? '' : ` (${formatEventDuration(event.durationMs)})`;
|
|
74
|
-
return stripTerminalControlCharacters(`${event.ts} [${event.producer}] ${summary}${duration}`);
|
|
74
|
+
return (0, utils_1.stripTerminalControlCharacters)(`${event.ts} [${event.producer}] ${summary}${duration}`);
|
|
75
75
|
}
|
|
76
76
|
function getOperationKey(event) {
|
|
77
77
|
return JSON.stringify([event.producer, event.operationId]);
|
|
@@ -85,11 +85,3 @@ function getScreenshotFilename(event) {
|
|
|
85
85
|
}
|
|
86
86
|
return event.data.path.split(/[\\/]/).at(-1);
|
|
87
87
|
}
|
|
88
|
-
function stripTerminalControlCharacters(value) {
|
|
89
|
-
return [...(0, util_1.stripVTControlCharacters)(value)]
|
|
90
|
-
.filter(character => {
|
|
91
|
-
const codePoint = character.codePointAt(0) ?? 0;
|
|
92
|
-
return codePoint >= 0x20 && !(codePoint >= 0x7f && codePoint <= 0x9f);
|
|
93
|
-
})
|
|
94
|
-
.join('');
|
|
95
|
-
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { RawLogLine } from '../commandUtils/logs/types';
|
|
3
|
+
export type SimulatorSessionError = {
|
|
4
|
+
errorCode: string;
|
|
5
|
+
message: string;
|
|
6
|
+
docsUrl?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export type FetchSimulatorSessionErrorsOptions = {
|
|
9
|
+
/** Aborts the lookup, e.g. on Ctrl+C. */
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
queryTimeoutMs?: number;
|
|
12
|
+
logDownloadTimeoutMs?: number;
|
|
13
|
+
maxLogSizeBytes?: number;
|
|
14
|
+
};
|
|
15
|
+
type JobRunLogLine = RawLogLine & {
|
|
16
|
+
level?: number;
|
|
17
|
+
source?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function fetchSimulatorSessionErrorsAsync(graphqlClient: ExpoGraphqlClient, deviceRunSessionId: string, { signal, queryTimeoutMs, logDownloadTimeoutMs, maxLogSizeBytes, }?: FetchSimulatorSessionErrorsOptions): Promise<SimulatorSessionError[]>;
|
|
20
|
+
export declare function formatSimulatorSessionError(error: SimulatorSessionError): string;
|
|
21
|
+
export declare function selectFailedStepErrors(logLines: JobRunLogLine[]): string[];
|
|
22
|
+
export {};
|