eas-cli 23.1.0 → 23.2.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 +170 -147
- package/build/api.d.ts +1 -0
- package/build/api.js +12 -0
- package/build/commandUtils/workflow/logs/fetchLogs.d.ts +5 -0
- package/build/commandUtils/workflow/logs/fetchLogs.js +24 -0
- package/build/commandUtils/workflow/logs/parseLogs.d.ts +14 -0
- package/build/commandUtils/workflow/logs/parseLogs.js +69 -0
- package/build/commandUtils/workflow/logs/watcher.d.ts +32 -0
- package/build/commandUtils/workflow/logs/watcher.js +162 -0
- package/build/commandUtils/workflow/stateMachine.js +2 -1
- package/build/commandUtils/workflow/types.d.ts +12 -5
- package/build/commandUtils/workflow/utils.d.ts +9 -5
- package/build/commandUtils/workflow/utils.js +144 -146
- package/build/commands/simulator/get.js +2 -0
- package/build/commands/simulator/index.d.ts +1 -0
- package/build/commands/simulator/index.js +10 -0
- package/build/commands/simulator/list.d.ts +1 -0
- package/build/commands/simulator/list.js +9 -0
- package/build/commands/workflow/run.d.ts +8 -0
- package/build/commands/workflow/run.js +27 -0
- package/build/commands/workflow/ssh.d.ts +31 -0
- package/build/commands/workflow/ssh.js +190 -0
- package/build/graphql/generated.d.ts +243 -3
- package/build/graphql/generated.js +28 -4
- package/build/graphql/mutations/RealtimeLogsMutation.d.ts +6 -0
- package/build/graphql/mutations/RealtimeLogsMutation.js +40 -0
- package/build/graphql/mutations/WorkflowRunMutation.d.ts +3 -2
- package/build/graphql/mutations/WorkflowRunMutation.js +4 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +5 -0
- package/build/graphql/queries/WorkflowJobSshQuery.d.ts +20 -0
- package/build/graphql/queries/WorkflowJobSshQuery.js +133 -0
- package/build/ora.d.ts +7 -0
- package/build/ora.js +12 -0
- package/build/simulator/utils.js +9 -1
- package/build/utils/centrifuge.d.ts +10 -0
- package/build/utils/centrifuge.js +89 -0
- package/build/utils/expodash/uniqBy.js +3 -2
- package/oclif.manifest.json +936 -833
- package/package.json +5 -2
- package/build/commandUtils/workflow/fetchLogs.d.ts +0 -6
- package/build/commandUtils/workflow/fetchLogs.js +0 -44
|
@@ -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 = void 0;
|
|
9
|
+
exports.BuildRetryDisabledReason = exports.BuildResourceClass = exports.BuildPriority = exports.BuildPhase = exports.BuildMode = exports.BuildLimitThresholdExceededMetadataType = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.BuildAnnotationType = exports.BackgroundJobState = exports.BackgroundJobResultType = exports.AuthProviderIdentifier = 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.AppObserveUpdatesOrderByField = exports.AppObserveUpdatesOrderByDirection = exports.AppObservePropertyType = exports.AppObservePlatform = exports.AppObserveNavigationRoutesOrderByField = exports.AppObserveEventsOrderByField = exports.AppObserveEventsOrderByDirection = exports.AppObserveErrorSeverity = 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.ActivityTimelineProjectActivityType = exports.AccountUploadSessionType = exports.AccountMemberType = exports.AccountAppsSortByField = void 0;
|
|
10
|
+
exports.InsightsFilterType = 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.EchoVersionSource = exports.EchoTurnCompletionStatus = exports.EchoProjectVisibility = exports.EchoProjectUploadSessionType = exports.EchoProjectIconSource = exports.EchoMessageRole = exports.EchoMessagePartType = exports.EchoChatState = exports.EchoChangeType = exports.EchoBuildStatus = exports.EchoAgentType = exports.EasTotalPlanEnablementUnit = exports.EasServiceMetric = exports.EasService = exports.EasBuildWaiverType = exports.EasBuildDeprecationInfoType = exports.EasBuildBillingResourceClass = exports.DistributionType = exports.DeviceRunSessionType = exports.DeviceRunSessionStatus = exports.DeviceRunSessionResourceClass = exports.DashboardViewPin = exports.DashboardChatMessageStatus = exports.DashboardChatMessageRole = exports.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.CrashSampleFor = exports.ContinentCode = exports.BuildWorkflow = exports.BuildTrigger = exports.BuildStatus = void 0;
|
|
11
|
+
exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.UpdatesTimelineItemType = exports.UpdateDiffReceiptStateValue = exports.UpdateDiffReceiptOrderByField = exports.UpdateDiffReceiptOrderByDirection = exports.TurtleSshTransportType = exports.TurtleSshTargetType = exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidReleaseStatus = 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.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.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = 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 = void 0;
|
|
13
13
|
var AccountAppsSortByField;
|
|
14
14
|
(function (AccountAppsSortByField) {
|
|
15
15
|
AccountAppsSortByField["LatestActivityTime"] = "LATEST_ACTIVITY_TIME";
|
|
@@ -44,6 +44,23 @@ var ActivityTimelineProjectActivityType;
|
|
|
44
44
|
ActivityTimelineProjectActivityType["Worker"] = "WORKER";
|
|
45
45
|
ActivityTimelineProjectActivityType["WorkflowRun"] = "WORKFLOW_RUN";
|
|
46
46
|
})(ActivityTimelineProjectActivityType || (exports.ActivityTimelineProjectActivityType = ActivityTimelineProjectActivityType = {}));
|
|
47
|
+
var AgentProvider;
|
|
48
|
+
(function (AgentProvider) {
|
|
49
|
+
AgentProvider["Anthropic"] = "ANTHROPIC";
|
|
50
|
+
AgentProvider["Openai"] = "OPENAI";
|
|
51
|
+
})(AgentProvider || (exports.AgentProvider = AgentProvider = {}));
|
|
52
|
+
var AgentProviderConnectionAuthorizationStatus;
|
|
53
|
+
(function (AgentProviderConnectionAuthorizationStatus) {
|
|
54
|
+
AgentProviderConnectionAuthorizationStatus["Expired"] = "EXPIRED";
|
|
55
|
+
AgentProviderConnectionAuthorizationStatus["Pending"] = "PENDING";
|
|
56
|
+
AgentProviderConnectionAuthorizationStatus["Succeeded"] = "SUCCEEDED";
|
|
57
|
+
})(AgentProviderConnectionAuthorizationStatus || (exports.AgentProviderConnectionAuthorizationStatus = AgentProviderConnectionAuthorizationStatus = {}));
|
|
58
|
+
var AgentProviderConnectionStatus;
|
|
59
|
+
(function (AgentProviderConnectionStatus) {
|
|
60
|
+
AgentProviderConnectionStatus["Invalid"] = "INVALID";
|
|
61
|
+
AgentProviderConnectionStatus["UnableToVerify"] = "UNABLE_TO_VERIFY";
|
|
62
|
+
AgentProviderConnectionStatus["Valid"] = "VALID";
|
|
63
|
+
})(AgentProviderConnectionStatus || (exports.AgentProviderConnectionStatus = AgentProviderConnectionStatus = {}));
|
|
47
64
|
var AndroidBuildType;
|
|
48
65
|
(function (AndroidBuildType) {
|
|
49
66
|
AndroidBuildType["Apk"] = "APK";
|
|
@@ -473,7 +490,10 @@ var DeviceRunSessionType;
|
|
|
473
490
|
DeviceRunSessionType["AgentDevice"] = "AGENT_DEVICE";
|
|
474
491
|
DeviceRunSessionType["Appium"] = "APPIUM";
|
|
475
492
|
DeviceRunSessionType["Argent"] = "ARGENT";
|
|
493
|
+
/** @deprecated Use WEB_PREVIEW_ONLY instead. */
|
|
476
494
|
DeviceRunSessionType["ServeSim"] = "SERVE_SIM";
|
|
495
|
+
/** A session accessed only through its web preview. Currently supported on iOS. */
|
|
496
|
+
DeviceRunSessionType["WebPreviewOnly"] = "WEB_PREVIEW_ONLY";
|
|
477
497
|
})(DeviceRunSessionType || (exports.DeviceRunSessionType = DeviceRunSessionType = {}));
|
|
478
498
|
var DistributionType;
|
|
479
499
|
(function (DistributionType) {
|
|
@@ -603,6 +623,7 @@ var EntityTypeName;
|
|
|
603
623
|
(function (EntityTypeName) {
|
|
604
624
|
EntityTypeName["AccountEntity"] = "AccountEntity";
|
|
605
625
|
EntityTypeName["AccountSsoConfigurationEntity"] = "AccountSSOConfigurationEntity";
|
|
626
|
+
EntityTypeName["AgentProviderConnectionEntity"] = "AgentProviderConnectionEntity";
|
|
606
627
|
EntityTypeName["AndroidAppCredentialsEntity"] = "AndroidAppCredentialsEntity";
|
|
607
628
|
EntityTypeName["AndroidKeystoreEntity"] = "AndroidKeystoreEntity";
|
|
608
629
|
EntityTypeName["AppEntity"] = "AppEntity";
|
|
@@ -1280,6 +1301,9 @@ var WorkflowRunTriggerEventType;
|
|
|
1280
1301
|
WorkflowRunTriggerEventType["EasSubmit"] = "EAS_SUBMIT";
|
|
1281
1302
|
WorkflowRunTriggerEventType["ExpoLaunch"] = "EXPO_LAUNCH";
|
|
1282
1303
|
WorkflowRunTriggerEventType["GithubPullRequestBaseRefChanged"] = "GITHUB_PULL_REQUEST_BASE_REF_CHANGED";
|
|
1304
|
+
WorkflowRunTriggerEventType["GithubPullRequestCommentCreated"] = "GITHUB_PULL_REQUEST_COMMENT_CREATED";
|
|
1305
|
+
WorkflowRunTriggerEventType["GithubPullRequestCommentDeleted"] = "GITHUB_PULL_REQUEST_COMMENT_DELETED";
|
|
1306
|
+
WorkflowRunTriggerEventType["GithubPullRequestCommentEdited"] = "GITHUB_PULL_REQUEST_COMMENT_EDITED";
|
|
1283
1307
|
WorkflowRunTriggerEventType["GithubPullRequestEdited"] = "GITHUB_PULL_REQUEST_EDITED";
|
|
1284
1308
|
WorkflowRunTriggerEventType["GithubPullRequestLabeled"] = "GITHUB_PULL_REQUEST_LABELED";
|
|
1285
1309
|
WorkflowRunTriggerEventType["GithubPullRequestOpened"] = "GITHUB_PULL_REQUEST_OPENED";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { RealtimeLogsCentrifugoConnectionToken, RealtimeLogsCentrifugoSubscriptionToken, RealtimeLogsMutationGenerateCentrifugoSubscriptionTokenArgs } from '../generated';
|
|
3
|
+
export declare const RealtimeLogsMutation: {
|
|
4
|
+
generateCentrifugoConnectionTokenAsync(graphqlClient: ExpoGraphqlClient): Promise<RealtimeLogsCentrifugoConnectionToken>;
|
|
5
|
+
generateCentrifugoSubscriptionTokenAsync(graphqlClient: ExpoGraphqlClient, { target, thread }: RealtimeLogsMutationGenerateCentrifugoSubscriptionTokenArgs): Promise<RealtimeLogsCentrifugoSubscriptionToken>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RealtimeLogsMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
const client_1 = require("../client");
|
|
7
|
+
exports.RealtimeLogsMutation = {
|
|
8
|
+
async generateCentrifugoConnectionTokenAsync(graphqlClient) {
|
|
9
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
10
|
+
.mutation((0, graphql_tag_1.default) `
|
|
11
|
+
mutation GenerateRealtimeLogsCentrifugoConnectionToken {
|
|
12
|
+
realtimeLogs {
|
|
13
|
+
generateCentrifugoConnectionToken {
|
|
14
|
+
token
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`, {})
|
|
19
|
+
.toPromise());
|
|
20
|
+
return data.realtimeLogs.generateCentrifugoConnectionToken;
|
|
21
|
+
},
|
|
22
|
+
async generateCentrifugoSubscriptionTokenAsync(graphqlClient, { target, thread }) {
|
|
23
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
24
|
+
.mutation((0, graphql_tag_1.default) `
|
|
25
|
+
mutation GenerateRealtimeLogsCentrifugoSubscriptionToken(
|
|
26
|
+
$target: RealtimeLogsTargetInput!
|
|
27
|
+
$thread: String
|
|
28
|
+
) {
|
|
29
|
+
realtimeLogs {
|
|
30
|
+
generateCentrifugoSubscriptionToken(target: $target, thread: $thread) {
|
|
31
|
+
channel
|
|
32
|
+
token
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`, { target, thread })
|
|
37
|
+
.toPromise());
|
|
38
|
+
return data.realtimeLogs.generateCentrifugoSubscriptionToken;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { WorkflowProjectSourceInput, WorkflowRevisionInput, WorkflowRunInput } from '../generated';
|
|
2
|
+
import { WorkflowProjectSourceInput, WorkflowRevisionInput, WorkflowRunInput, WorkflowRunSshInput } from '../generated';
|
|
3
3
|
export declare namespace WorkflowRunMutation {
|
|
4
4
|
function createWorkflowRunAsync(graphqlClient: ExpoGraphqlClient, { appId, workflowRevisionInput, workflowRunInput, }: {
|
|
5
5
|
appId: string;
|
|
@@ -8,10 +8,11 @@ export declare namespace WorkflowRunMutation {
|
|
|
8
8
|
}): Promise<{
|
|
9
9
|
id: string;
|
|
10
10
|
}>;
|
|
11
|
-
function createWorkflowRunFromGitRefAsync(graphqlClient: ExpoGraphqlClient, { workflowRevisionId, gitRef, inputs, }: {
|
|
11
|
+
function createWorkflowRunFromGitRefAsync(graphqlClient: ExpoGraphqlClient, { workflowRevisionId, gitRef, inputs, ssh, }: {
|
|
12
12
|
workflowRevisionId: string;
|
|
13
13
|
gitRef: string;
|
|
14
14
|
inputs?: Record<string, any>;
|
|
15
|
+
ssh?: WorkflowRunSshInput | null;
|
|
15
16
|
}): Promise<{
|
|
16
17
|
id: string;
|
|
17
18
|
}>;
|
|
@@ -33,19 +33,21 @@ var WorkflowRunMutation;
|
|
|
33
33
|
return { id: data.workflowRun.createWorkflowRun.id };
|
|
34
34
|
}
|
|
35
35
|
WorkflowRunMutation.createWorkflowRunAsync = createWorkflowRunAsync;
|
|
36
|
-
async function createWorkflowRunFromGitRefAsync(graphqlClient, { workflowRevisionId, gitRef, inputs, }) {
|
|
36
|
+
async function createWorkflowRunFromGitRefAsync(graphqlClient, { workflowRevisionId, gitRef, inputs, ssh, }) {
|
|
37
37
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
38
38
|
.mutation((0, graphql_tag_1.default) `
|
|
39
39
|
mutation CreateWorkflowRunFromGitRef(
|
|
40
40
|
$workflowRevisionId: ID!
|
|
41
41
|
$gitRef: String!
|
|
42
42
|
$inputs: JSONObject
|
|
43
|
+
$ssh: WorkflowRunSshInput
|
|
43
44
|
) {
|
|
44
45
|
workflowRun {
|
|
45
46
|
createWorkflowRunFromGitRef(
|
|
46
47
|
workflowRevisionId: $workflowRevisionId
|
|
47
48
|
gitRef: $gitRef
|
|
48
49
|
inputs: $inputs
|
|
50
|
+
ssh: $ssh
|
|
49
51
|
) {
|
|
50
52
|
id
|
|
51
53
|
}
|
|
@@ -55,6 +57,7 @@ var WorkflowRunMutation;
|
|
|
55
57
|
workflowRevisionId,
|
|
56
58
|
gitRef,
|
|
57
59
|
inputs,
|
|
60
|
+
ssh,
|
|
58
61
|
})
|
|
59
62
|
.toPromise());
|
|
60
63
|
return { id: data.workflowRun.createWorkflowRunFromGitRef.id };
|
|
@@ -33,6 +33,7 @@ exports.DeviceRunSessionQuery = {
|
|
|
33
33
|
byId(deviceRunSessionId: $deviceRunSessionId) {
|
|
34
34
|
id
|
|
35
35
|
name
|
|
36
|
+
tags
|
|
36
37
|
status
|
|
37
38
|
type
|
|
38
39
|
platform
|
|
@@ -78,6 +79,9 @@ exports.DeviceRunSessionQuery = {
|
|
|
78
79
|
... on ServeSimRunSessionRemoteConfig {
|
|
79
80
|
previewUrl
|
|
80
81
|
}
|
|
82
|
+
... on WebPreviewOnlyRunSessionRemoteConfig {
|
|
83
|
+
previewUrl: webPreviewUrl
|
|
84
|
+
}
|
|
81
85
|
}
|
|
82
86
|
turtleJobRun {
|
|
83
87
|
id
|
|
@@ -108,6 +112,7 @@ exports.DeviceRunSessionQuery = {
|
|
|
108
112
|
node {
|
|
109
113
|
id
|
|
110
114
|
name
|
|
115
|
+
tags
|
|
111
116
|
status
|
|
112
117
|
type
|
|
113
118
|
platform
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
export type WorkflowJobSshConnectionConfig = {
|
|
3
|
+
host: string;
|
|
4
|
+
secret: string;
|
|
5
|
+
reconnecting: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type WorkflowJobSshSession = {
|
|
8
|
+
id: string;
|
|
9
|
+
connectionConfig: WorkflowJobSshConnectionConfig;
|
|
10
|
+
};
|
|
11
|
+
export type WorkflowJobSshConnectInfo = {
|
|
12
|
+
sshRequested: boolean;
|
|
13
|
+
jobCompleted: boolean;
|
|
14
|
+
session: WorkflowJobSshSession | null;
|
|
15
|
+
};
|
|
16
|
+
export declare const WorkflowJobSshQuery: {
|
|
17
|
+
connectInfoForWorkflowJobAsync(graphqlClient: ExpoGraphqlClient, workflowJobId: string): Promise<WorkflowJobSshConnectInfo | null>;
|
|
18
|
+
connectInfoForJobRunAsync(graphqlClient: ExpoGraphqlClient, jobRunId: string): Promise<WorkflowJobSshConnectInfo | null>;
|
|
19
|
+
connectInfoForResourceIdAsync(graphqlClient: ExpoGraphqlClient, resourceId: string): Promise<WorkflowJobSshConnectInfo | null>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowJobSshQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
const client_1 = require("../client");
|
|
7
|
+
const generated_1 = require("../generated");
|
|
8
|
+
const FINAL_WORKFLOW_JOB_STATUSES = new Set([
|
|
9
|
+
generated_1.WorkflowJobStatus.Success,
|
|
10
|
+
generated_1.WorkflowJobStatus.Failure,
|
|
11
|
+
generated_1.WorkflowJobStatus.Canceled,
|
|
12
|
+
generated_1.WorkflowJobStatus.Skipped,
|
|
13
|
+
]);
|
|
14
|
+
const FINAL_JOB_RUN_STATUSES = new Set([
|
|
15
|
+
generated_1.JobRunStatus.Errored,
|
|
16
|
+
generated_1.JobRunStatus.Finished,
|
|
17
|
+
generated_1.JobRunStatus.Canceled,
|
|
18
|
+
]);
|
|
19
|
+
function toConnectInfo(job) {
|
|
20
|
+
const hasTurtleTarget = job.turtleJobRun != null || job.turtleBuild != null;
|
|
21
|
+
return {
|
|
22
|
+
sshRequested: hasTurtleTarget && job.workflowRun.sshSettings != null,
|
|
23
|
+
jobCompleted: FINAL_WORKFLOW_JOB_STATUSES.has(job.status),
|
|
24
|
+
session: job.turtleJobRun?.sshSession ?? job.turtleBuild?.sshSession ?? null,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function isNotFoundError(error) {
|
|
28
|
+
if (!(error instanceof client_1.GraphqlError)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return error.graphQLErrors.some(e => {
|
|
32
|
+
const code = e?.extensions?.errorCode ?? e?.extensions?.code;
|
|
33
|
+
return (code === 'ENTITY_NOT_FOUND' ||
|
|
34
|
+
/Entity not found/i.test(e?.message ?? '') ||
|
|
35
|
+
/not found/i.test(e?.message ?? ''));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.WorkflowJobSshQuery = {
|
|
39
|
+
async connectInfoForWorkflowJobAsync(graphqlClient, workflowJobId) {
|
|
40
|
+
let data;
|
|
41
|
+
try {
|
|
42
|
+
data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
43
|
+
.query((0, graphql_tag_1.default) `
|
|
44
|
+
query WorkflowJobSshPoll($workflowJobId: ID!) {
|
|
45
|
+
workflowJobs {
|
|
46
|
+
byId(workflowJobId: $workflowJobId) {
|
|
47
|
+
id
|
|
48
|
+
status
|
|
49
|
+
workflowRun {
|
|
50
|
+
id
|
|
51
|
+
sshSettings {
|
|
52
|
+
idleTimeoutSeconds
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
turtleJobRun {
|
|
56
|
+
id
|
|
57
|
+
sshSession {
|
|
58
|
+
id
|
|
59
|
+
connectionConfig {
|
|
60
|
+
host
|
|
61
|
+
secret
|
|
62
|
+
reconnecting
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
turtleBuild {
|
|
67
|
+
id
|
|
68
|
+
sshSession {
|
|
69
|
+
id
|
|
70
|
+
connectionConfig {
|
|
71
|
+
host
|
|
72
|
+
secret
|
|
73
|
+
reconnecting
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`, { workflowJobId }, { requestPolicy: 'network-only' })
|
|
81
|
+
.toPromise());
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (isNotFoundError(error)) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
return toConnectInfo(data.workflowJobs.byId);
|
|
90
|
+
},
|
|
91
|
+
async connectInfoForJobRunAsync(graphqlClient, jobRunId) {
|
|
92
|
+
let data;
|
|
93
|
+
try {
|
|
94
|
+
data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
95
|
+
.query((0, graphql_tag_1.default) `
|
|
96
|
+
query JobRunSshPoll($jobRunId: ID!) {
|
|
97
|
+
jobRun {
|
|
98
|
+
byId(jobRunId: $jobRunId) {
|
|
99
|
+
id
|
|
100
|
+
status
|
|
101
|
+
sshSession {
|
|
102
|
+
id
|
|
103
|
+
connectionConfig {
|
|
104
|
+
host
|
|
105
|
+
secret
|
|
106
|
+
reconnecting
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`, { jobRunId }, { requestPolicy: 'network-only' })
|
|
113
|
+
.toPromise());
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (isNotFoundError(error)) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
const jobRun = data.jobRun.byId;
|
|
122
|
+
const jobCompleted = FINAL_JOB_RUN_STATUSES.has(jobRun.status);
|
|
123
|
+
return {
|
|
124
|
+
sshRequested: jobRun.sshSession != null || jobCompleted,
|
|
125
|
+
jobCompleted,
|
|
126
|
+
session: jobRun.sshSession,
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
async connectInfoForResourceIdAsync(graphqlClient, resourceId) {
|
|
130
|
+
return ((await exports.WorkflowJobSshQuery.connectInfoForWorkflowJobAsync(graphqlClient, resourceId)) ??
|
|
131
|
+
(await exports.WorkflowJobSshQuery.connectInfoForJobRunAsync(graphqlClient, resourceId)));
|
|
132
|
+
},
|
|
133
|
+
};
|
package/build/ora.d.ts
CHANGED
|
@@ -7,3 +7,10 @@ export { Ora, Options };
|
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
9
|
export declare function ora(options?: Options | string): Ora;
|
|
10
|
+
/**
|
|
11
|
+
* Updates the text of a spinner. Does nothing if new text is the same as old text to prevent flickering.
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateSpinnerText(spinner: Ora, { prefixText, text }: {
|
|
14
|
+
prefixText?: string;
|
|
15
|
+
text?: string;
|
|
16
|
+
}): void;
|
package/build/ora.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ora = ora;
|
|
4
|
+
exports.updateSpinnerText = updateSpinnerText;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const getenv_1 = require("getenv");
|
|
6
7
|
// eslint-disable-next-line
|
|
@@ -99,3 +100,14 @@ function ora(options) {
|
|
|
99
100
|
};
|
|
100
101
|
return spinner;
|
|
101
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Updates the text of a spinner. Does nothing if new text is the same as old text to prevent flickering.
|
|
105
|
+
*/
|
|
106
|
+
function updateSpinnerText(spinner, { prefixText, text }) {
|
|
107
|
+
if (prefixText !== undefined && spinner.prefixText !== prefixText) {
|
|
108
|
+
spinner.prefixText = prefixText;
|
|
109
|
+
}
|
|
110
|
+
if (text !== undefined && spinner.text !== text) {
|
|
111
|
+
spinner.text = text;
|
|
112
|
+
}
|
|
113
|
+
}
|
package/build/simulator/utils.js
CHANGED
|
@@ -26,6 +26,7 @@ exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = {
|
|
|
26
26
|
[generated_1.DeviceRunSessionType.Appium]: 'appium',
|
|
27
27
|
[generated_1.DeviceRunSessionType.Argent]: 'argent',
|
|
28
28
|
[generated_1.DeviceRunSessionType.ServeSim]: 'web-preview-only',
|
|
29
|
+
[generated_1.DeviceRunSessionType.WebPreviewOnly]: 'web-preview-only',
|
|
29
30
|
};
|
|
30
31
|
exports.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = Object.fromEntries(Object.entries(exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES).map(([type, value]) => [value, type]));
|
|
31
32
|
function deviceRunSessionTypeToFlagValue(type) {
|
|
@@ -54,6 +55,7 @@ function getRemoteSessionEnvironmentVariables(remoteConfig) {
|
|
|
54
55
|
APPIUM_CAPS: JSON.stringify(remoteConfig.capabilities),
|
|
55
56
|
};
|
|
56
57
|
case 'ServeSimRunSessionRemoteConfig':
|
|
58
|
+
case 'WebPreviewOnlyRunSessionRemoteConfig':
|
|
57
59
|
return {};
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -123,7 +125,7 @@ function formatRemoteSessionInstructions(remoteConfig, configType) {
|
|
|
123
125
|
'<appium-client> [args...]',
|
|
124
126
|
];
|
|
125
127
|
if (remoteConfig.webPreviewUrl) {
|
|
126
|
-
lines.push('', 'Open the
|
|
128
|
+
lines.push('', 'Open the simulator preview:', '', remoteConfig.webPreviewUrl);
|
|
127
129
|
}
|
|
128
130
|
return lines.join('\n');
|
|
129
131
|
}
|
|
@@ -133,5 +135,11 @@ function formatRemoteSessionInstructions(remoteConfig, configType) {
|
|
|
133
135
|
'',
|
|
134
136
|
remoteConfig.previewUrl,
|
|
135
137
|
].join('\n');
|
|
138
|
+
case 'WebPreviewOnlyRunSessionRemoteConfig':
|
|
139
|
+
return [
|
|
140
|
+
'🌐 Open the following URL in your browser to access the simulator:',
|
|
141
|
+
'',
|
|
142
|
+
remoteConfig.previewUrl,
|
|
143
|
+
].join('\n');
|
|
136
144
|
}
|
|
137
145
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { RealtimeLogsMutationGenerateCentrifugoSubscriptionTokenArgs } from '../graphql/generated';
|
|
3
|
+
export type RealtimeLogsSubscription = {
|
|
4
|
+
close: () => void;
|
|
5
|
+
};
|
|
6
|
+
export type RealtimeLogsClient = {
|
|
7
|
+
subscribeAsync: (args: RealtimeLogsMutationGenerateCentrifugoSubscriptionTokenArgs, onPublication: (data: unknown) => void) => Promise<RealtimeLogsSubscription | null>;
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function createRealtimeLogsClient(graphqlClient: ExpoGraphqlClient): RealtimeLogsClient | null;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRealtimeLogsClient = createRealtimeLogsClient;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const centrifuge_1 = require("centrifuge");
|
|
6
|
+
const ws_1 = tslib_1.__importDefault(require("ws"));
|
|
7
|
+
const api_1 = require("../api");
|
|
8
|
+
const RealtimeLogsMutation_1 = require("../graphql/mutations/RealtimeLogsMutation");
|
|
9
|
+
const fetch_1 = require("../fetch");
|
|
10
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
11
|
+
function createProxiedWebSocketConstructor(agent) {
|
|
12
|
+
return class ProxiedWebSocket extends ws_1.default {
|
|
13
|
+
constructor(address, protocols) {
|
|
14
|
+
super(address, protocols, { agent });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function createWebSocketConstructor() {
|
|
19
|
+
return fetch_1.httpsProxyAgent ? createProxiedWebSocketConstructor(fetch_1.httpsProxyAgent) : ws_1.default;
|
|
20
|
+
}
|
|
21
|
+
function createRealtimeLogsClient(graphqlClient) {
|
|
22
|
+
const getTokenAsync = async () => {
|
|
23
|
+
const { token } = await RealtimeLogsMutation_1.RealtimeLogsMutation.generateCentrifugoConnectionTokenAsync(graphqlClient);
|
|
24
|
+
return token;
|
|
25
|
+
};
|
|
26
|
+
let client;
|
|
27
|
+
try {
|
|
28
|
+
client = new centrifuge_1.Centrifuge((0, api_1.getEASLogsWebsocketUrl)(), {
|
|
29
|
+
websocket: createWebSocketConstructor(),
|
|
30
|
+
getToken: getTokenAsync,
|
|
31
|
+
});
|
|
32
|
+
client.on('error', ({ error }) => {
|
|
33
|
+
log_1.default.debug(`Realtime logs connection error: ${error.message}`);
|
|
34
|
+
});
|
|
35
|
+
client.connect();
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
log_1.default.debug(`Failed to connect to realtime logs: ${err.message}`);
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
subscribeAsync: async (args, onPublication) => {
|
|
43
|
+
const getSubscriptionTokenAsync = async () => {
|
|
44
|
+
const { token } = await RealtimeLogsMutation_1.RealtimeLogsMutation.generateCentrifugoSubscriptionTokenAsync(graphqlClient, args);
|
|
45
|
+
return token;
|
|
46
|
+
};
|
|
47
|
+
try {
|
|
48
|
+
const { channel, token } = await RealtimeLogsMutation_1.RealtimeLogsMutation.generateCentrifugoSubscriptionTokenAsync(graphqlClient, args);
|
|
49
|
+
const subscription = client.newSubscription(channel, {
|
|
50
|
+
token,
|
|
51
|
+
getToken: getSubscriptionTokenAsync,
|
|
52
|
+
});
|
|
53
|
+
subscription.on('error', ({ error }) => {
|
|
54
|
+
log_1.default.debug(`Realtime logs subscription error on ${channel}: ${error.message}`);
|
|
55
|
+
});
|
|
56
|
+
subscription.on('publication', ({ data }) => {
|
|
57
|
+
onPublication(data);
|
|
58
|
+
});
|
|
59
|
+
subscription.subscribe();
|
|
60
|
+
return {
|
|
61
|
+
close: () => {
|
|
62
|
+
closeSubscription(client, subscription);
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
log_1.default.debug(`Failed to subscribe to realtime logs: ${err.message}`);
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
close: () => {
|
|
72
|
+
for (const subscription of Object.values(client.subscriptions())) {
|
|
73
|
+
closeSubscription(client, subscription);
|
|
74
|
+
}
|
|
75
|
+
client.removeAllListeners();
|
|
76
|
+
client.disconnect();
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function closeSubscription(client, subscription) {
|
|
81
|
+
try {
|
|
82
|
+
subscription.unsubscribe();
|
|
83
|
+
subscription.removeAllListeners();
|
|
84
|
+
client.removeSubscription(subscription);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
log_1.default.debug(`Failed to close realtime logs subscription: ${err.message}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -5,9 +5,10 @@ function uniqBy(list, getKey) {
|
|
|
5
5
|
const uniqueValues = new Set();
|
|
6
6
|
const result = [];
|
|
7
7
|
for (const i of list) {
|
|
8
|
-
|
|
8
|
+
const key = getKey(i);
|
|
9
|
+
if (!uniqueValues.has(key)) {
|
|
9
10
|
result.push(i);
|
|
10
|
-
uniqueValues.add(
|
|
11
|
+
uniqueValues.add(key);
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
return result;
|