eas-cli 21.2.0 → 21.4.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 +343 -148
- package/build/build/build.js +102 -17
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +31 -16
- package/build/commands/observe/events.js +10 -6
- package/build/commands/observe/metrics-summary.js +2 -1
- package/build/commands/observe/metrics.js +3 -2
- package/build/commands/observe/routes.js +3 -2
- package/build/commands/observe/session.js +8 -2
- package/build/commands/project/icon/set.d.ts +15 -0
- package/build/commands/project/icon/set.js +93 -0
- package/build/commands/project/init.d.ts +3 -0
- package/build/commands/project/init.js +34 -7
- package/build/commands/simulator/events.d.ts +16 -0
- package/build/commands/simulator/events.js +136 -0
- package/build/commands/simulator/get.js +2 -0
- package/build/commands/simulator/list.js +2 -0
- package/build/commands/simulator/start.d.ts +1 -0
- package/build/commands/simulator/start.js +8 -0
- package/build/commands/testflight/crashes.d.ts +23 -0
- package/build/commands/testflight/crashes.js +82 -0
- package/build/commands/testflight/feedback.d.ts +23 -0
- package/build/commands/testflight/feedback.js +82 -0
- package/build/graphql/generated.d.ts +370 -254
- package/build/graphql/generated.js +18 -23
- package/build/graphql/mutations/UploadSessionMutation.d.ts +5 -1
- package/build/graphql/mutations/UploadSessionMutation.js +15 -0
- package/build/graphql/queries/AppQuery.d.ts +1 -0
- package/build/graphql/queries/AppQuery.js +19 -0
- package/build/graphql/queries/DeviceRunSessionQuery.d.ts +2 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +22 -0
- package/build/observe/fetchEvents.js +7 -1
- package/build/observe/fetchMetrics.js +6 -0
- package/build/observe/fetchNavigationRoutes.js +6 -0
- package/build/observe/fetchSessions.d.ts +7 -0
- package/build/observe/fetchSessions.js +16 -0
- package/build/observe/planGating.d.ts +15 -0
- package/build/observe/planGating.js +48 -0
- package/build/project/accountSelection.d.ts +4 -0
- package/build/project/accountSelection.js +56 -0
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +4 -3
- package/build/project/projectInitialization.d.ts +13 -3
- package/build/project/projectInitialization.js +52 -80
- package/build/simulator/events.d.ts +7 -0
- package/build/simulator/events.js +95 -0
- package/build/simulator/utils.js +1 -1
- package/build/testflight/app.d.ts +18 -0
- package/build/testflight/app.js +124 -0
- package/build/testflight/fetch.d.ts +56 -0
- package/build/testflight/fetch.js +116 -0
- package/build/testflight/format.d.ts +4 -0
- package/build/testflight/format.js +104 -0
- package/build/testflight/queries.d.ts +16 -0
- package/build/testflight/queries.js +123 -0
- package/build/testflight/target.d.ts +15 -0
- package/build/testflight/target.js +32 -0
- package/build/uploads.d.ts +7 -1
- package/build/uploads.js +9 -0
- package/build/user/User.d.ts +6 -0
- package/build/user/User.js +18 -0
- package/oclif.manifest.json +2185 -1728
- package/package.json +8 -5
|
@@ -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.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 = exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AssetMapSourceType = exports.
|
|
10
|
-
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 = 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.DashboardViewPin = exports.
|
|
11
|
-
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 = exports.UpdateDiffReceiptOrderByDirection = exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidReleaseStatus = 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 =
|
|
9
|
+
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 = 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.ActivityTimelineProjectActivityType = exports.AccountUploadSessionType = exports.AccountMemberType = exports.AccountAppsSortByField = void 0;
|
|
10
|
+
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 = 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.DashboardViewPin = exports.DashboardChatMessageStatus = exports.DashboardChatMessageRole = exports.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.CrashSampleFor = exports.ContinentCode = void 0;
|
|
11
|
+
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 = exports.UpdateDiffReceiptOrderByDirection = 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.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 = 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 = void 0;
|
|
13
13
|
var AccountAppsSortByField;
|
|
14
14
|
(function (AccountAppsSortByField) {
|
|
15
15
|
AccountAppsSortByField["LatestActivityTime"] = "LATEST_ACTIVITY_TIME";
|
|
@@ -163,13 +163,6 @@ var AppProfileImageWidth;
|
|
|
163
163
|
AppProfileImageWidth["Medium"] = "MEDIUM";
|
|
164
164
|
AppProfileImageWidth["Small"] = "SMALL";
|
|
165
165
|
})(AppProfileImageWidth || (exports.AppProfileImageWidth = AppProfileImageWidth = {}));
|
|
166
|
-
var AppSort;
|
|
167
|
-
(function (AppSort) {
|
|
168
|
-
/** Sort by recently published */
|
|
169
|
-
AppSort["RecentlyPublished"] = "RECENTLY_PUBLISHED";
|
|
170
|
-
/** Sort by highest trendScore */
|
|
171
|
-
AppSort["Viewed"] = "VIEWED";
|
|
172
|
-
})(AppSort || (exports.AppSort = AppSort = {}));
|
|
173
166
|
var AppStoreConnectBuildProcessingState;
|
|
174
167
|
(function (AppStoreConnectBuildProcessingState) {
|
|
175
168
|
AppStoreConnectBuildProcessingState["Failed"] = "FAILED";
|
|
@@ -230,13 +223,6 @@ var AppleTeamType;
|
|
|
230
223
|
AppleTeamType["Individual"] = "INDIVIDUAL";
|
|
231
224
|
AppleTeamType["InHouse"] = "IN_HOUSE";
|
|
232
225
|
})(AppleTeamType || (exports.AppleTeamType = AppleTeamType = {}));
|
|
233
|
-
var AppsFilter;
|
|
234
|
-
(function (AppsFilter) {
|
|
235
|
-
/** Featured Projects */
|
|
236
|
-
AppsFilter["Featured"] = "FEATURED";
|
|
237
|
-
/** New Projects */
|
|
238
|
-
AppsFilter["New"] = "NEW";
|
|
239
|
-
})(AppsFilter || (exports.AppsFilter = AppsFilter = {}));
|
|
240
226
|
var AssetMapSourceType;
|
|
241
227
|
(function (AssetMapSourceType) {
|
|
242
228
|
AssetMapSourceType["Gcs"] = "GCS";
|
|
@@ -361,6 +347,7 @@ var BuildPhase;
|
|
|
361
347
|
/** @deprecated No longer supported */
|
|
362
348
|
BuildPhase["UploadArtifacts"] = "UPLOAD_ARTIFACTS";
|
|
363
349
|
BuildPhase["UploadBuildArtifacts"] = "UPLOAD_BUILD_ARTIFACTS";
|
|
350
|
+
BuildPhase["UploadEmbeddedBundle"] = "UPLOAD_EMBEDDED_BUNDLE";
|
|
364
351
|
})(BuildPhase || (exports.BuildPhase = BuildPhase = {}));
|
|
365
352
|
var BuildPriority;
|
|
366
353
|
(function (BuildPriority) {
|
|
@@ -448,6 +435,18 @@ var CustomDomainStatus;
|
|
|
448
435
|
CustomDomainStatus["Pending"] = "PENDING";
|
|
449
436
|
CustomDomainStatus["TimedOut"] = "TIMED_OUT";
|
|
450
437
|
})(CustomDomainStatus || (exports.CustomDomainStatus = CustomDomainStatus = {}));
|
|
438
|
+
var DashboardChatMessageRole;
|
|
439
|
+
(function (DashboardChatMessageRole) {
|
|
440
|
+
DashboardChatMessageRole["Assistant"] = "ASSISTANT";
|
|
441
|
+
DashboardChatMessageRole["User"] = "USER";
|
|
442
|
+
})(DashboardChatMessageRole || (exports.DashboardChatMessageRole = DashboardChatMessageRole = {}));
|
|
443
|
+
/** Terminal state of an assistant message */
|
|
444
|
+
var DashboardChatMessageStatus;
|
|
445
|
+
(function (DashboardChatMessageStatus) {
|
|
446
|
+
DashboardChatMessageStatus["Canceled"] = "CANCELED";
|
|
447
|
+
DashboardChatMessageStatus["Completed"] = "COMPLETED";
|
|
448
|
+
DashboardChatMessageStatus["Error"] = "ERROR";
|
|
449
|
+
})(DashboardChatMessageStatus || (exports.DashboardChatMessageStatus = DashboardChatMessageStatus = {}));
|
|
451
450
|
var DashboardViewPin;
|
|
452
451
|
(function (DashboardViewPin) {
|
|
453
452
|
DashboardViewPin["Activity"] = "ACTIVITY";
|
|
@@ -967,11 +966,6 @@ var StatuspageServiceStatus;
|
|
|
967
966
|
StatuspageServiceStatus["PartialOutage"] = "PARTIAL_OUTAGE";
|
|
968
967
|
StatuspageServiceStatus["UnderMaintenance"] = "UNDER_MAINTENANCE";
|
|
969
968
|
})(StatuspageServiceStatus || (exports.StatuspageServiceStatus = StatuspageServiceStatus = {}));
|
|
970
|
-
var SubmissionAndroidArchiveType;
|
|
971
|
-
(function (SubmissionAndroidArchiveType) {
|
|
972
|
-
SubmissionAndroidArchiveType["Aab"] = "AAB";
|
|
973
|
-
SubmissionAndroidArchiveType["Apk"] = "APK";
|
|
974
|
-
})(SubmissionAndroidArchiveType || (exports.SubmissionAndroidArchiveType = SubmissionAndroidArchiveType = {}));
|
|
975
969
|
var SubmissionAndroidReleaseStatus;
|
|
976
970
|
(function (SubmissionAndroidReleaseStatus) {
|
|
977
971
|
SubmissionAndroidReleaseStatus["Completed"] = "COMPLETED";
|
|
@@ -1234,6 +1228,7 @@ var WorkflowJobType;
|
|
|
1234
1228
|
WorkflowJobType["Submission"] = "SUBMISSION";
|
|
1235
1229
|
WorkflowJobType["Testflight"] = "TESTFLIGHT";
|
|
1236
1230
|
WorkflowJobType["Update"] = "UPDATE";
|
|
1231
|
+
WorkflowJobType["UpdateRollout"] = "UPDATE_ROLLOUT";
|
|
1237
1232
|
})(WorkflowJobType || (exports.WorkflowJobType = WorkflowJobType = {}));
|
|
1238
1233
|
var WorkflowProjectSourceType;
|
|
1239
1234
|
(function (WorkflowProjectSourceType) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AccountUploadSessionType, UploadSessionType } from '../generated';
|
|
2
|
+
import { AccountUploadSessionType, AppUploadSessionType, UploadSessionType } from '../generated';
|
|
3
3
|
export interface SignedUrl {
|
|
4
4
|
url: string;
|
|
5
5
|
headers: Record<string, string>;
|
|
@@ -11,4 +11,8 @@ export declare const UploadSessionMutation: {
|
|
|
11
11
|
type: AccountUploadSessionType;
|
|
12
12
|
accountID: string;
|
|
13
13
|
}): Promise<SignedUrl>;
|
|
14
|
+
createAppScopedUploadSessionAsync(graphqlClient: ExpoGraphqlClient, { type, appID, }: {
|
|
15
|
+
type: AppUploadSessionType;
|
|
16
|
+
appID: string;
|
|
17
|
+
}): Promise<SignedUrl>;
|
|
14
18
|
};
|
|
@@ -38,4 +38,19 @@ exports.UploadSessionMutation = {
|
|
|
38
38
|
.toPromise());
|
|
39
39
|
return data.uploadSession.createAccountScopedUploadSession;
|
|
40
40
|
},
|
|
41
|
+
async createAppScopedUploadSessionAsync(graphqlClient, { type, appID, }) {
|
|
42
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
43
|
+
.mutation((0, graphql_tag_1.default) `
|
|
44
|
+
mutation CreateAppScopedUploadSessionMutation($appID: ID!, $type: AppUploadSessionType!) {
|
|
45
|
+
uploadSession {
|
|
46
|
+
createAppScopedUploadSession(appID: $appID, type: $type)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`, {
|
|
50
|
+
type,
|
|
51
|
+
appID,
|
|
52
|
+
})
|
|
53
|
+
.toPromise());
|
|
54
|
+
return data.uploadSession.createAppScopedUploadSession;
|
|
55
|
+
},
|
|
41
56
|
};
|
|
@@ -3,6 +3,7 @@ import { AppFragment, WorkflowFragment, WorkflowRunFragment, WorkflowRunStatus }
|
|
|
3
3
|
export declare const AppQuery: {
|
|
4
4
|
byIdAsync(graphqlClient: ExpoGraphqlClient, projectId: string): Promise<AppFragment>;
|
|
5
5
|
byFullNameAsync(graphqlClient: ExpoGraphqlClient, fullName: string): Promise<AppFragment>;
|
|
6
|
+
byIdProfileImageUrlAsync(graphqlClient: ExpoGraphqlClient, projectId: string): Promise<string | null>;
|
|
6
7
|
byIdWorkflowsAsync(graphqlClient: ExpoGraphqlClient, appId: string): Promise<WorkflowFragment[]>;
|
|
7
8
|
byIdWorkflowRunsFilteredByStatusAsync(graphqlClient: ExpoGraphqlClient, appId: string, status?: WorkflowRunStatus, limit?: number): Promise<WorkflowRunFragment[]>;
|
|
8
9
|
};
|
|
@@ -49,6 +49,25 @@ exports.AppQuery = {
|
|
|
49
49
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
50
50
|
return data.app.byFullName;
|
|
51
51
|
},
|
|
52
|
+
async byIdProfileImageUrlAsync(graphqlClient, projectId) {
|
|
53
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
54
|
+
.query((0, graphql_tag_1.default) `
|
|
55
|
+
query AppByIdProfileImageUrlQuery($appId: String!) {
|
|
56
|
+
app {
|
|
57
|
+
byId(appId: $appId) {
|
|
58
|
+
id
|
|
59
|
+
profileImageUrl
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`, { appId: projectId }, {
|
|
64
|
+
requestPolicy: 'network-only',
|
|
65
|
+
additionalTypenames: ['App'],
|
|
66
|
+
})
|
|
67
|
+
.toPromise());
|
|
68
|
+
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
69
|
+
return data.app.byId.profileImageUrl ?? null;
|
|
70
|
+
},
|
|
52
71
|
async byIdWorkflowsAsync(graphqlClient, appId) {
|
|
53
72
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
54
73
|
.query((0, graphql_tag_1.default) `
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { DeviceRunSessionByIdQuery, DeviceRunSessionFilterInput, DeviceRunSessionsByAppIdQuery } from '../generated';
|
|
2
|
+
import { DeviceRunSessionByIdQuery, DeviceRunSessionEventsByIdQuery, DeviceRunSessionFilterInput, DeviceRunSessionsByAppIdQuery } from '../generated';
|
|
3
3
|
export declare const DeviceRunSessionQuery: {
|
|
4
|
+
eventsByIdAsync(graphqlClient: ExpoGraphqlClient, deviceRunSessionId: string): Promise<DeviceRunSessionEventsByIdQuery["deviceRunSessions"]["byId"]>;
|
|
4
5
|
byIdAsync(graphqlClient: ExpoGraphqlClient, deviceRunSessionId: string): Promise<DeviceRunSessionByIdQuery["deviceRunSessions"]["byId"]>;
|
|
5
6
|
listByAppIdAsync(graphqlClient: ExpoGraphqlClient, { appId, first, after, filter, }: {
|
|
6
7
|
appId: string;
|
|
@@ -5,6 +5,26 @@ 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.DeviceRunSessionQuery = {
|
|
8
|
+
async eventsByIdAsync(graphqlClient, deviceRunSessionId) {
|
|
9
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
10
|
+
.query((0, graphql_tag_1.default) `
|
|
11
|
+
query DeviceRunSessionEventsByIdQuery($deviceRunSessionId: ID!) {
|
|
12
|
+
deviceRunSessions {
|
|
13
|
+
byId(deviceRunSessionId: $deviceRunSessionId) {
|
|
14
|
+
id
|
|
15
|
+
status
|
|
16
|
+
artifacts {
|
|
17
|
+
id
|
|
18
|
+
downloadUrl
|
|
19
|
+
metadata
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`, { deviceRunSessionId }, { requestPolicy: 'network-only' })
|
|
25
|
+
.toPromise());
|
|
26
|
+
return data.deviceRunSessions.byId;
|
|
27
|
+
},
|
|
8
28
|
async byIdAsync(graphqlClient, deviceRunSessionId) {
|
|
9
29
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
10
30
|
.query((0, graphql_tag_1.default) `
|
|
@@ -12,6 +32,7 @@ exports.DeviceRunSessionQuery = {
|
|
|
12
32
|
deviceRunSessions {
|
|
13
33
|
byId(deviceRunSessionId: $deviceRunSessionId) {
|
|
14
34
|
id
|
|
35
|
+
name
|
|
15
36
|
status
|
|
16
37
|
type
|
|
17
38
|
platform
|
|
@@ -81,6 +102,7 @@ exports.DeviceRunSessionQuery = {
|
|
|
81
102
|
cursor
|
|
82
103
|
node {
|
|
83
104
|
id
|
|
105
|
+
name
|
|
84
106
|
status
|
|
85
107
|
type
|
|
86
108
|
platform
|
|
@@ -6,6 +6,7 @@ exports.fetchObserveEventsAsync = fetchObserveEventsAsync;
|
|
|
6
6
|
exports.fetchTotalEventCountAsync = fetchTotalEventCountAsync;
|
|
7
7
|
const generated_1 = require("../graphql/generated");
|
|
8
8
|
const ObserveQuery_1 = require("../graphql/queries/ObserveQuery");
|
|
9
|
+
const planGating_1 = require("./planGating");
|
|
9
10
|
var EventsOrderPreset;
|
|
10
11
|
(function (EventsOrderPreset) {
|
|
11
12
|
EventsOrderPreset["Slowest"] = "SLOWEST";
|
|
@@ -75,7 +76,12 @@ async function fetchTotalEventCountAsync(graphqlClient, appId, metricName, platf
|
|
|
75
76
|
return sum + (metric?.eventCount ?? 0);
|
|
76
77
|
}, 0);
|
|
77
78
|
}
|
|
78
|
-
catch {
|
|
79
|
+
catch (error) {
|
|
80
|
+
// A plan gate is an account-wide rejection, not a per-platform failure —
|
|
81
|
+
// let it propagate so the command surfaces the upgrade prompt.
|
|
82
|
+
if ((0, planGating_1.isObservePlanGateError)(error)) {
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
79
85
|
return 0;
|
|
80
86
|
}
|
|
81
87
|
});
|
|
@@ -7,6 +7,7 @@ const errors_1 = require("../commandUtils/errors");
|
|
|
7
7
|
const ObserveQuery_1 = require("../graphql/queries/ObserveQuery");
|
|
8
8
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
9
9
|
const formatMetrics_1 = require("./formatMetrics");
|
|
10
|
+
const planGating_1 = require("./planGating");
|
|
10
11
|
const platforms_1 = require("./platforms");
|
|
11
12
|
function validateDateFlag(value, flagName) {
|
|
12
13
|
const parsed = new Date(value);
|
|
@@ -28,6 +29,11 @@ async function fetchObserveMetricsAsync(graphqlClient, appId, metricNames, platf
|
|
|
28
29
|
return { appPlatform, appVersions };
|
|
29
30
|
}
|
|
30
31
|
catch (error) {
|
|
32
|
+
// A plan gate is an account-wide rejection, not a per-platform failure —
|
|
33
|
+
// let it propagate so the command surfaces the upgrade prompt.
|
|
34
|
+
if ((0, planGating_1.isObservePlanGateError)(error)) {
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
31
37
|
log_1.default.warn(`Failed to fetch observe data on ${observePlatform}: ${error.message}`);
|
|
32
38
|
return null;
|
|
33
39
|
}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const generated_1 = require("../graphql/generated");
|
|
6
6
|
const ObserveQuery_1 = require("../graphql/queries/ObserveQuery");
|
|
7
7
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
8
|
+
const planGating_1 = require("./planGating");
|
|
8
9
|
const platforms_1 = require("./platforms");
|
|
9
10
|
async function fetchObserveNavigationRoutesAsync(graphqlClient, appId, options) {
|
|
10
11
|
const orderBy = options.orderBy ?? {
|
|
@@ -32,6 +33,11 @@ async function fetchObserveNavigationRoutesAsync(graphqlClient, appId, options)
|
|
|
32
33
|
return { appPlatform, ...result };
|
|
33
34
|
}
|
|
34
35
|
catch (error) {
|
|
36
|
+
// A plan gate is an account-wide rejection, not a per-platform failure —
|
|
37
|
+
// let it propagate so the command surfaces the upgrade prompt.
|
|
38
|
+
if ((0, planGating_1.isObservePlanGateError)(error)) {
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
35
41
|
log_1.default.warn(`Failed to fetch navigation routes on ${observePlatform}: ${error.message}`);
|
|
36
42
|
return null;
|
|
37
43
|
}
|
|
@@ -49,6 +49,13 @@ export interface FetchSessionEventsResult {
|
|
|
49
49
|
hasMoreMetricEvents: boolean;
|
|
50
50
|
hasMoreLogEvents: boolean;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Issues a throwaway session-scoped query so the server-side session-timeline
|
|
54
|
+
* plan gate fires (or doesn't) up front. Blocked plans reject with the coded
|
|
55
|
+
* plan-gate error; allowed plans get an empty result that is discarded. Used to
|
|
56
|
+
* check access before the interactive session picker runs.
|
|
57
|
+
*/
|
|
58
|
+
export declare function verifyObserveSessionAccessAsync(graphqlClient: ExpoGraphqlClient, appId: string): Promise<void>;
|
|
52
59
|
export declare function fetchObserveSessionEventsAsync(graphqlClient: ExpoGraphqlClient, appId: string, options: FetchSessionEventsOptions): Promise<FetchSessionEventsResult>;
|
|
53
60
|
/**
|
|
54
61
|
* A metric event that is guaranteed to belong to a session — used as a
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyObserveSessionAccessAsync = verifyObserveSessionAccessAsync;
|
|
3
4
|
exports.fetchObserveSessionEventsAsync = fetchObserveSessionEventsAsync;
|
|
4
5
|
exports.fetchSessionMetricCandidatesAsync = fetchSessionMetricCandidatesAsync;
|
|
5
6
|
exports.fetchSessionLogCandidatesAsync = fetchSessionLogCandidatesAsync;
|
|
@@ -45,6 +46,21 @@ function customEventToEntry(event) {
|
|
|
45
46
|
environment: event.environment ?? null,
|
|
46
47
|
};
|
|
47
48
|
}
|
|
49
|
+
// A syntactically valid UUID that matches no real session, used only to trip
|
|
50
|
+
// the server-side session-timeline plan gate without fetching real data.
|
|
51
|
+
const SESSION_ACCESS_PROBE_ID = '00000000-0000-0000-0000-000000000000';
|
|
52
|
+
/**
|
|
53
|
+
* Issues a throwaway session-scoped query so the server-side session-timeline
|
|
54
|
+
* plan gate fires (or doesn't) up front. Blocked plans reject with the coded
|
|
55
|
+
* plan-gate error; allowed plans get an empty result that is discarded. Used to
|
|
56
|
+
* check access before the interactive session picker runs.
|
|
57
|
+
*/
|
|
58
|
+
async function verifyObserveSessionAccessAsync(graphqlClient, appId) {
|
|
59
|
+
await fetchObserveSessionEventsAsync(graphqlClient, appId, {
|
|
60
|
+
sessionId: SESSION_ACCESS_PROBE_ID,
|
|
61
|
+
limit: 1,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
48
64
|
async function fetchObserveSessionEventsAsync(graphqlClient, appId, options) {
|
|
49
65
|
const [metricResult, logResult] = await Promise.all([
|
|
50
66
|
(0, fetchEvents_1.fetchObserveEventsAsync)(graphqlClient, appId, {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const EAS_OBSERVE_PLAN_UPGRADE_REQUIRED_ERROR_CODE = "EAS_OBSERVE_PLAN_UPGRADE_REQUIRED";
|
|
2
|
+
export declare const EAS_OBSERVE_FEATURE_NOT_AVAILABLE_IN_FREE_TIER_ERROR_CODE = "EAS_OBSERVE_FEATURE_NOT_AVAILABLE_IN_FREE_TIER";
|
|
3
|
+
/**
|
|
4
|
+
* Whether an error is a server Observe plan-gate rejection. Useful where a
|
|
5
|
+
* plan-gate error must escape error handling that would otherwise swallow it
|
|
6
|
+
* (e.g. per-platform fetch loops that treat failures as empty results).
|
|
7
|
+
*/
|
|
8
|
+
export declare function isObservePlanGateError(error: unknown): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Runs an Observe GraphQL operation and, when the server rejects it because the
|
|
11
|
+
* feature is not included in the account's plan, rethrows the server's upgrade
|
|
12
|
+
* message (which links to the account's billing page) as an `EasCommandError`.
|
|
13
|
+
* Reusable across Observe commands.
|
|
14
|
+
*/
|
|
15
|
+
export declare function withObservePlanGateHandlingAsync<T>(fn: () => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EAS_OBSERVE_FEATURE_NOT_AVAILABLE_IN_FREE_TIER_ERROR_CODE = exports.EAS_OBSERVE_PLAN_UPGRADE_REQUIRED_ERROR_CODE = void 0;
|
|
4
|
+
exports.isObservePlanGateError = isObservePlanGateError;
|
|
5
|
+
exports.withObservePlanGateHandlingAsync = withObservePlanGateHandlingAsync;
|
|
6
|
+
const errors_1 = require("../commandUtils/errors");
|
|
7
|
+
const client_1 = require("../graphql/client");
|
|
8
|
+
// Must match the server's Observe plan-gate error codes (`ExpoErrorCode`). Both
|
|
9
|
+
// signal "this Observe feature is not available on the account's current plan";
|
|
10
|
+
// they differ only in which plans are blocked, which is decided server-side.
|
|
11
|
+
exports.EAS_OBSERVE_PLAN_UPGRADE_REQUIRED_ERROR_CODE = 'EAS_OBSERVE_PLAN_UPGRADE_REQUIRED';
|
|
12
|
+
exports.EAS_OBSERVE_FEATURE_NOT_AVAILABLE_IN_FREE_TIER_ERROR_CODE = 'EAS_OBSERVE_FEATURE_NOT_AVAILABLE_IN_FREE_TIER';
|
|
13
|
+
const OBSERVE_PLAN_GATE_ERROR_CODES = new Set([
|
|
14
|
+
exports.EAS_OBSERVE_PLAN_UPGRADE_REQUIRED_ERROR_CODE,
|
|
15
|
+
exports.EAS_OBSERVE_FEATURE_NOT_AVAILABLE_IN_FREE_TIER_ERROR_CODE,
|
|
16
|
+
]);
|
|
17
|
+
function findObservePlanGateMessage(error) {
|
|
18
|
+
if (!(error instanceof client_1.GraphqlError)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return error.graphQLErrors.find(e => OBSERVE_PLAN_GATE_ERROR_CODES.has(e?.extensions?.errorCode))?.message;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Whether an error is a server Observe plan-gate rejection. Useful where a
|
|
25
|
+
* plan-gate error must escape error handling that would otherwise swallow it
|
|
26
|
+
* (e.g. per-platform fetch loops that treat failures as empty results).
|
|
27
|
+
*/
|
|
28
|
+
function isObservePlanGateError(error) {
|
|
29
|
+
return findObservePlanGateMessage(error) !== undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Runs an Observe GraphQL operation and, when the server rejects it because the
|
|
33
|
+
* feature is not included in the account's plan, rethrows the server's upgrade
|
|
34
|
+
* message (which links to the account's billing page) as an `EasCommandError`.
|
|
35
|
+
* Reusable across Observe commands.
|
|
36
|
+
*/
|
|
37
|
+
async function withObservePlanGateHandlingAsync(fn) {
|
|
38
|
+
try {
|
|
39
|
+
return await fn();
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const planGateMessage = findObservePlanGateMessage(error);
|
|
43
|
+
if (planGateMessage !== undefined) {
|
|
44
|
+
throw new errors_1.EasCommandError(planGateMessage);
|
|
45
|
+
}
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Choice } from '../prompts';
|
|
2
|
+
import { Actor } from '../user/User';
|
|
3
|
+
export declare function getAccountNamesWhereUserHasSufficientPermissionsToCreateApp(actor: Actor): Set<string>;
|
|
4
|
+
export declare function getAccountChoices(actor: Actor, namesWithSufficientPermissions: Set<string>): Choice[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccountNamesWhereUserHasSufficientPermissionsToCreateApp = getAccountNamesWhereUserHasSufficientPermissionsToCreateApp;
|
|
4
|
+
exports.getAccountChoices = getAccountChoices;
|
|
5
|
+
const generated_1 = require("../graphql/generated");
|
|
6
|
+
function getAccountNamesWhereUserHasSufficientPermissionsToCreateApp(actor) {
|
|
7
|
+
return new Set(actor.accounts
|
|
8
|
+
.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
|
|
9
|
+
.map(it => it.name));
|
|
10
|
+
}
|
|
11
|
+
function getAccountChoices(actor, namesWithSufficientPermissions) {
|
|
12
|
+
const allAccounts = actor.accounts;
|
|
13
|
+
const sortedAccounts = actor.__typename === 'Robot'
|
|
14
|
+
? allAccounts
|
|
15
|
+
: [...allAccounts].sort((a, _b) => actor.__typename === 'User' ? (a.name === actor.username ? -1 : 1) : 0);
|
|
16
|
+
if (actor.__typename !== 'Robot') {
|
|
17
|
+
const personalAccount = allAccounts?.find(account => account?.ownerUserActor?.id === actor.id);
|
|
18
|
+
const personalAccountChoice = personalAccount
|
|
19
|
+
? {
|
|
20
|
+
title: personalAccount.name,
|
|
21
|
+
value: personalAccount,
|
|
22
|
+
description: !namesWithSufficientPermissions.has(personalAccount.name)
|
|
23
|
+
? '(Personal) (Viewer Role)'
|
|
24
|
+
: '(Personal)',
|
|
25
|
+
}
|
|
26
|
+
: undefined;
|
|
27
|
+
const userAccounts = allAccounts
|
|
28
|
+
?.filter(account => account.ownerUserActor && account.name !== actor.username)
|
|
29
|
+
.map(account => ({
|
|
30
|
+
title: account.name,
|
|
31
|
+
value: account,
|
|
32
|
+
description: !namesWithSufficientPermissions.has(account.name)
|
|
33
|
+
? '(Team) (Viewer Role)'
|
|
34
|
+
: '(Team)',
|
|
35
|
+
}));
|
|
36
|
+
const organizationAccounts = allAccounts
|
|
37
|
+
?.filter(account => account.name !== actor.username && !account.ownerUserActor)
|
|
38
|
+
.map(account => ({
|
|
39
|
+
title: account.name,
|
|
40
|
+
value: account,
|
|
41
|
+
description: !namesWithSufficientPermissions.has(account.name)
|
|
42
|
+
? '(Organization) (Viewer Role)'
|
|
43
|
+
: '(Organization)',
|
|
44
|
+
}));
|
|
45
|
+
let choices = [];
|
|
46
|
+
if (personalAccountChoice) {
|
|
47
|
+
choices = [personalAccountChoice];
|
|
48
|
+
}
|
|
49
|
+
return [...choices, ...userAccounts, ...organizationAccounts].sort((a, _b) => actor.__typename === 'User' ? (a.value.name === actor.username ? -1 : 1) : 0);
|
|
50
|
+
}
|
|
51
|
+
return sortedAccounts.map(account => ({
|
|
52
|
+
title: account.name,
|
|
53
|
+
value: account,
|
|
54
|
+
description: !namesWithSufficientPermissions.has(account.name) ? '(Viewer Role)' : undefined,
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
@@ -11,6 +11,7 @@ const AppQuery_1 = require("../graphql/queries/AppQuery");
|
|
|
11
11
|
const log_1 = require("../log");
|
|
12
12
|
const ora_1 = require("../ora");
|
|
13
13
|
const prompts_1 = require("../prompts");
|
|
14
|
+
const User_1 = require("../user/User");
|
|
14
15
|
/**
|
|
15
16
|
* 1. Looks for an existing project on EAS servers. If found, ask the user whether this is the
|
|
16
17
|
* project they would like to link. If yes, return that. If not, throw.
|
|
@@ -20,13 +21,13 @@ const prompts_1 = require("../prompts");
|
|
|
20
21
|
async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graphqlClient, projectInfo, options, actor) {
|
|
21
22
|
const { accountName, projectName } = projectInfo;
|
|
22
23
|
const projectFullName = `@${accountName}/${projectName}`;
|
|
23
|
-
if (options.nonInteractive) {
|
|
24
|
-
throw new Error(`Must configure EAS project by running 'eas init' before this command can be run in non-interactive mode.`);
|
|
25
|
-
}
|
|
26
24
|
const allAccounts = actor.accounts;
|
|
27
25
|
const accountNamesWhereUserHasSufficientPublishPermissions = new Set(allAccounts
|
|
28
26
|
.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
|
|
29
27
|
.map(it => it.name));
|
|
28
|
+
if (options.nonInteractive) {
|
|
29
|
+
throw new Error(`EAS project not configured. To configure it non-interactively, choose the account that should own the project and run:\n\n eas init --account <name> --non-interactive\n\nAccounts you have permissions to create projects in: ${(0, User_1.getCreatableAccountNames)(actor).join(', ')}\n\nAlternatively, set the "owner" field in your app config, or run "eas init" to configure it interactively.`);
|
|
30
|
+
}
|
|
30
31
|
const account = allAccounts.find(a => a.name === accountName);
|
|
31
32
|
if (!account) {
|
|
32
33
|
throw new Error(`You must have access to the ${accountName} account to configure this EAS project.`);
|
|
@@ -4,6 +4,16 @@ export type InitializeMethodOptions = {
|
|
|
4
4
|
force: boolean;
|
|
5
5
|
nonInteractive: boolean;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
|
|
7
|
+
export type ProjectInitStatus = 'created' | 'linked' | 'already-linked';
|
|
8
|
+
export type ProjectInitResult = {
|
|
9
|
+
projectId: string;
|
|
10
|
+
status: ProjectInitStatus;
|
|
11
|
+
};
|
|
12
|
+
export declare function ensureOwnerSlugConsistencyAsync(graphqlClient: ExpoGraphqlClient, projectId: string, projectDir: string, { force, nonInteractive }: InitializeMethodOptions): Promise<{
|
|
13
|
+
owner: string;
|
|
14
|
+
slug: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function initializeWithExplicitIDAsync(projectId: string, projectDir: string, { force, nonInteractive }: InitializeMethodOptions): Promise<ProjectInitStatus>;
|
|
17
|
+
export declare function initializeWithoutExplicitIDAsync(graphqlClient: ExpoGraphqlClient, actor: Actor, projectDir: string, { force, nonInteractive, accountName: accountNameArgument, }: InitializeMethodOptions & {
|
|
18
|
+
accountName?: string;
|
|
19
|
+
}): Promise<ProjectInitResult>;
|