eas-cli 20.3.0 → 20.5.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 +136 -113
- package/build/build/utils/url.d.ts +1 -0
- package/build/build/utils/url.js +4 -0
- package/build/commandUtils/new/templates/AGENTS.md +25 -146
- package/build/commandUtils/new/templates/CLAUDE.md +1 -9
- package/build/commands/integrations/posthog/connect.d.ts +3 -0
- package/build/commands/integrations/posthog/connect.js +66 -12
- package/build/commands/observe/session.d.ts +18 -0
- package/build/commands/observe/session.js +65 -0
- package/build/commands/simulator/get.js +8 -10
- package/build/commands/simulator/list.js +7 -13
- package/build/commands/simulator/start.js +27 -27
- package/build/commands/simulator/stop.js +5 -5
- package/build/graphql/generated.d.ts +353 -78
- package/build/graphql/generated.js +41 -5
- package/build/graphql/mutations/PostHogMutation.d.ts +2 -2
- package/build/graphql/mutations/PostHogMutation.js +13 -7
- package/build/graphql/queries/AccountQuery.js +5 -0
- package/build/graphql/queries/PostHogQuery.d.ts +3 -1
- package/build/graphql/queries/PostHogQuery.js +5 -2
- package/build/graphql/types/Observe.js +1 -0
- package/build/graphql/types/PostHogConnection.d.ts +8 -0
- package/build/observe/fetchCustomEvents.d.ts +2 -2
- package/build/observe/fetchCustomEvents.js +2 -2
- package/build/observe/fetchEvents.d.ts +4 -3
- package/build/observe/fetchEvents.js +4 -3
- package/build/observe/fetchSessions.d.ts +51 -0
- package/build/observe/fetchSessions.js +86 -0
- package/build/observe/formatEvents.d.ts +1 -0
- package/build/observe/formatEvents.js +1 -0
- package/build/observe/formatSessions.d.ts +15 -0
- package/build/observe/formatSessions.js +100 -0
- package/build/update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.js +23 -26
- package/build/utils/usage/checkForOverages.d.ts +13 -3
- package/build/utils/usage/checkForOverages.js +72 -21
- package/oclif.manifest.json +1644 -1549
- package/package.json +4 -3
|
@@ -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 = void 0;
|
|
9
|
+
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 = exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AssetMapSourceType = exports.AppsFilter = exports.AppleTeamType = exports.AppleDeviceClass = exports.AppUploadSessionType = exports.AppStoreConnectWorkflowConnectionStatus = exports.AppStoreConnectUserRole = exports.AppSort = 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.AppInternalDistributionBuildPrivacy = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = exports.AccountUploadSessionType = exports.AccountMemberType = exports.AccountAppsSortByField = void 0;
|
|
10
|
+
exports.JobRunStatus = exports.JobRunPriority = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = exports.GitHubAppInstallationStatus = exports.GitHubAppInstallationAccountType = exports.GitHubAppEnvironment = exports.FingerprintSourceType = 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.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.CrashSampleFor = void 0;
|
|
11
|
+
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 = exports.UpdateDiffReceiptOrderByDirection = exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ResponseType = exports.ResponseStatusType = exports.ResponseCacheStatus = exports.ResourceClassExperiment = exports.RequestsOrderByField = exports.RequestsOrderByDirection = exports.RequestMethod = exports.ProjectArchiveSourceType = exports.PostHogRegion = exports.Permission = exports.Order = exports.OnboardingEnvironment = exports.OnboardingDeviceType = exports.OfferType = exports.OAuthProvider = exports.NotificationType = exports.NotificationEvent = exports.LocalBuildArchiveSourceType = void 0;
|
|
12
|
+
exports.WorkflowsInsightsRunsOverTimeGranularity = exports.WorkflowsInsightsExportFormat = exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = exports.WorkflowJobStatus = exports.WorkflowJobReviewDecision = exports.WorkflowDeviceTestCaseStatusFilter = exports.WorkflowDeviceTestCaseStatus = exports.WorkflowDeviceTestCaseStatSortField = void 0;
|
|
13
13
|
var AccountAppsSortByField;
|
|
14
14
|
(function (AccountAppsSortByField) {
|
|
15
15
|
AccountAppsSortByField["LatestActivityTime"] = "LATEST_ACTIVITY_TIME";
|
|
@@ -77,6 +77,25 @@ var AppObserveCustomEventNamesOrderByField;
|
|
|
77
77
|
AppObserveCustomEventNamesOrderByField["Count"] = "COUNT";
|
|
78
78
|
AppObserveCustomEventNamesOrderByField["EventName"] = "EVENT_NAME";
|
|
79
79
|
})(AppObserveCustomEventNamesOrderByField || (exports.AppObserveCustomEventNamesOrderByField = AppObserveCustomEventNamesOrderByField = {}));
|
|
80
|
+
var AppObserveErrorBreakdownDimension;
|
|
81
|
+
(function (AppObserveErrorBreakdownDimension) {
|
|
82
|
+
AppObserveErrorBreakdownDimension["AppVersion"] = "APP_VERSION";
|
|
83
|
+
AppObserveErrorBreakdownDimension["Country"] = "COUNTRY";
|
|
84
|
+
AppObserveErrorBreakdownDimension["Device"] = "DEVICE";
|
|
85
|
+
AppObserveErrorBreakdownDimension["Os"] = "OS";
|
|
86
|
+
})(AppObserveErrorBreakdownDimension || (exports.AppObserveErrorBreakdownDimension = AppObserveErrorBreakdownDimension = {}));
|
|
87
|
+
var AppObserveErrorGroupsOrderBy;
|
|
88
|
+
(function (AppObserveErrorGroupsOrderBy) {
|
|
89
|
+
AppObserveErrorGroupsOrderBy["FirstSeen"] = "FIRST_SEEN";
|
|
90
|
+
AppObserveErrorGroupsOrderBy["LastSeen"] = "LAST_SEEN";
|
|
91
|
+
AppObserveErrorGroupsOrderBy["MostFrequent"] = "MOST_FREQUENT";
|
|
92
|
+
AppObserveErrorGroupsOrderBy["MostUsers"] = "MOST_USERS";
|
|
93
|
+
})(AppObserveErrorGroupsOrderBy || (exports.AppObserveErrorGroupsOrderBy = AppObserveErrorGroupsOrderBy = {}));
|
|
94
|
+
var AppObserveErrorSeverity;
|
|
95
|
+
(function (AppObserveErrorSeverity) {
|
|
96
|
+
AppObserveErrorSeverity["Error"] = "ERROR";
|
|
97
|
+
AppObserveErrorSeverity["Fatal"] = "FATAL";
|
|
98
|
+
})(AppObserveErrorSeverity || (exports.AppObserveErrorSeverity = AppObserveErrorSeverity = {}));
|
|
80
99
|
var AppObserveEventsOrderByDirection;
|
|
81
100
|
(function (AppObserveEventsOrderByDirection) {
|
|
82
101
|
AppObserveEventsOrderByDirection["Asc"] = "ASC";
|
|
@@ -166,6 +185,16 @@ var AppStoreConnectUserRole;
|
|
|
166
185
|
AppStoreConnectUserRole["Technical"] = "TECHNICAL";
|
|
167
186
|
AppStoreConnectUserRole["Unknown"] = "UNKNOWN";
|
|
168
187
|
})(AppStoreConnectUserRole || (exports.AppStoreConnectUserRole = AppStoreConnectUserRole = {}));
|
|
188
|
+
/** Whether a project has an App Store Connect connection for its ASC-triggered workflows. */
|
|
189
|
+
var AppStoreConnectWorkflowConnectionStatus;
|
|
190
|
+
(function (AppStoreConnectWorkflowConnectionStatus) {
|
|
191
|
+
/** An App Store Connect app connection is linked to this project. */
|
|
192
|
+
AppStoreConnectWorkflowConnectionStatus["HasWorkflowsIsConnected"] = "HAS_WORKFLOWS_IS_CONNECTED";
|
|
193
|
+
/** The project has App Store Connect-triggered workflows but no connection. */
|
|
194
|
+
AppStoreConnectWorkflowConnectionStatus["HasWorkflowsMissingConnection"] = "HAS_WORKFLOWS_MISSING_CONNECTION";
|
|
195
|
+
/** The project has no workflows with an on.app_store_connect trigger. */
|
|
196
|
+
AppStoreConnectWorkflowConnectionStatus["NoAppStoreConnectWorkflows"] = "NO_APP_STORE_CONNECT_WORKFLOWS";
|
|
197
|
+
})(AppStoreConnectWorkflowConnectionStatus || (exports.AppStoreConnectWorkflowConnectionStatus = AppStoreConnectWorkflowConnectionStatus = {}));
|
|
169
198
|
var AppUploadSessionType;
|
|
170
199
|
(function (AppUploadSessionType) {
|
|
171
200
|
AppUploadSessionType["ProfileImageUpload"] = "PROFILE_IMAGE_UPLOAD";
|
|
@@ -311,7 +340,7 @@ var BuildPhase;
|
|
|
311
340
|
BuildPhase["StartBuild"] = "START_BUILD";
|
|
312
341
|
BuildPhase["Unknown"] = "UNKNOWN";
|
|
313
342
|
BuildPhase["UploadApplicationArchive"] = "UPLOAD_APPLICATION_ARCHIVE";
|
|
314
|
-
/** @deprecated
|
|
343
|
+
/** @deprecated No longer supported */
|
|
315
344
|
BuildPhase["UploadArtifacts"] = "UPLOAD_ARTIFACTS";
|
|
316
345
|
BuildPhase["UploadBuildArtifacts"] = "UPLOAD_BUILD_ARTIFACTS";
|
|
317
346
|
})(BuildPhase || (exports.BuildPhase = BuildPhase = {}));
|
|
@@ -967,6 +996,11 @@ var UpdateDiffReceiptStateValue;
|
|
|
967
996
|
UpdateDiffReceiptStateValue["Success"] = "SUCCESS";
|
|
968
997
|
UpdateDiffReceiptStateValue["WontCompute"] = "WONT_COMPUTE";
|
|
969
998
|
})(UpdateDiffReceiptStateValue || (exports.UpdateDiffReceiptStateValue = UpdateDiffReceiptStateValue = {}));
|
|
999
|
+
var UpdatesTimelineItemType;
|
|
1000
|
+
(function (UpdatesTimelineItemType) {
|
|
1001
|
+
UpdatesTimelineItemType["EmbeddedUpdate"] = "EMBEDDED_UPDATE";
|
|
1002
|
+
UpdatesTimelineItemType["UpdateGroup"] = "UPDATE_GROUP";
|
|
1003
|
+
})(UpdatesTimelineItemType || (exports.UpdatesTimelineItemType = UpdatesTimelineItemType = {}));
|
|
970
1004
|
var UploadSessionType;
|
|
971
1005
|
(function (UploadSessionType) {
|
|
972
1006
|
UploadSessionType["EasBuildGcsProjectMetadata"] = "EAS_BUILD_GCS_PROJECT_METADATA";
|
|
@@ -1185,6 +1219,8 @@ var WorkflowRunTriggerEventType;
|
|
|
1185
1219
|
WorkflowRunTriggerEventType["AppStoreConnectExternalBetaStateChanged"] = "APP_STORE_CONNECT_EXTERNAL_BETA_STATE_CHANGED";
|
|
1186
1220
|
WorkflowRunTriggerEventType["EasSubmit"] = "EAS_SUBMIT";
|
|
1187
1221
|
WorkflowRunTriggerEventType["ExpoLaunch"] = "EXPO_LAUNCH";
|
|
1222
|
+
WorkflowRunTriggerEventType["GithubPullRequestBaseRefChanged"] = "GITHUB_PULL_REQUEST_BASE_REF_CHANGED";
|
|
1223
|
+
WorkflowRunTriggerEventType["GithubPullRequestEdited"] = "GITHUB_PULL_REQUEST_EDITED";
|
|
1188
1224
|
WorkflowRunTriggerEventType["GithubPullRequestLabeled"] = "GITHUB_PULL_REQUEST_LABELED";
|
|
1189
1225
|
WorkflowRunTriggerEventType["GithubPullRequestOpened"] = "GITHUB_PULL_REQUEST_OPENED";
|
|
1190
1226
|
WorkflowRunTriggerEventType["GithubPullRequestReadyForReview"] = "GITHUB_PULL_REQUEST_READY_FOR_REVIEW";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { CreatePostHogAccountRequestInput, SetupPostHogProjectInput } from '../generated';
|
|
3
|
-
import {
|
|
3
|
+
import { PostHogProjectData, StartPostHogConnectionResult } from '../types/PostHogConnection';
|
|
4
4
|
export declare const PostHogMutation: {
|
|
5
|
-
|
|
5
|
+
startPostHogConnectionAsync(graphqlClient: ExpoGraphqlClient, input: CreatePostHogAccountRequestInput): Promise<StartPostHogConnectionResult>;
|
|
6
6
|
setupPostHogProjectAsync(graphqlClient: ExpoGraphqlClient, input: SetupPostHogProjectInput): Promise<PostHogProjectData>;
|
|
7
7
|
deletePostHogProjectAsync(graphqlClient: ExpoGraphqlClient, id: string): Promise<string>;
|
|
8
8
|
};
|
|
@@ -7,21 +7,27 @@ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
|
7
7
|
const client_1 = require("../client");
|
|
8
8
|
const PostHogConnection_1 = require("../types/PostHogConnection");
|
|
9
9
|
exports.PostHogMutation = {
|
|
10
|
-
async
|
|
10
|
+
async startPostHogConnectionAsync(graphqlClient, input) {
|
|
11
11
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
12
12
|
.mutation((0, graphql_tag_1.default) `
|
|
13
|
-
mutation
|
|
13
|
+
mutation StartPostHogConnection($input: CreatePostHogAccountRequestInput!) {
|
|
14
14
|
posthogOrganizationConnection {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...
|
|
15
|
+
startPostHogConnection(input: $input) {
|
|
16
|
+
__typename
|
|
17
|
+
... on PostHogOrganizationConnection {
|
|
18
|
+
id
|
|
19
|
+
...PostHogOrganizationConnectionFragment
|
|
20
|
+
}
|
|
21
|
+
... on PostHogPendingConnection {
|
|
22
|
+
url
|
|
23
|
+
}
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
${(0, graphql_1.print)(PostHogConnection_1.PostHogOrganizationConnectionFragmentNode)}
|
|
22
|
-
`, { input })
|
|
28
|
+
`, { input }, { additionalTypenames: ['PostHogOrganizationConnection'] })
|
|
23
29
|
.toPromise());
|
|
24
|
-
return data.posthogOrganizationConnection.
|
|
30
|
+
return data.posthogOrganizationConnection.startPostHogConnection;
|
|
25
31
|
},
|
|
26
32
|
async setupPostHogProjectAsync(graphqlClient, input) {
|
|
27
33
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { PostHogOrganizationConnectionData, PostHogProjectData } from '../types/PostHogConnection';
|
|
3
3
|
export declare const PostHogQuery: {
|
|
4
|
-
getPostHogOrganizationConnectionByAccountIdAsync(graphqlClient: ExpoGraphqlClient, accountId: string
|
|
4
|
+
getPostHogOrganizationConnectionByAccountIdAsync(graphqlClient: ExpoGraphqlClient, accountId: string, { useCache }?: {
|
|
5
|
+
useCache?: boolean;
|
|
6
|
+
}): Promise<PostHogOrganizationConnectionData | null>;
|
|
5
7
|
getPostHogProjectByAppIdAsync(graphqlClient: ExpoGraphqlClient, appId: string): Promise<PostHogProjectData | null>;
|
|
6
8
|
};
|
|
@@ -7,7 +7,7 @@ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
|
7
7
|
const client_1 = require("../client");
|
|
8
8
|
const PostHogConnection_1 = require("../types/PostHogConnection");
|
|
9
9
|
exports.PostHogQuery = {
|
|
10
|
-
async getPostHogOrganizationConnectionByAccountIdAsync(graphqlClient, accountId) {
|
|
10
|
+
async getPostHogOrganizationConnectionByAccountIdAsync(graphqlClient, accountId, { useCache = true } = {}) {
|
|
11
11
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
12
12
|
.query((0, graphql_tag_1.default) `
|
|
13
13
|
query PostHogOrganizationConnectionByAccountId($accountId: String!) {
|
|
@@ -22,7 +22,10 @@ exports.PostHogQuery = {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
${(0, graphql_1.print)(PostHogConnection_1.PostHogOrganizationConnectionFragmentNode)}
|
|
25
|
-
`, { accountId }, {
|
|
25
|
+
`, { accountId }, {
|
|
26
|
+
additionalTypenames: ['PostHogOrganizationConnection'],
|
|
27
|
+
requestPolicy: useCache ? 'cache-first' : 'network-only',
|
|
28
|
+
})
|
|
26
29
|
.toPromise());
|
|
27
30
|
return data.account.byId.posthogOrganizationConnection ?? null;
|
|
28
31
|
},
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { PostHogOrganizationConnection, PostHogProject } from '../generated';
|
|
2
2
|
export type PostHogOrganizationConnectionData = Pick<PostHogOrganizationConnection, 'id' | 'posthogOrganizationIdentifier' | 'posthogOrganizationName' | 'posthogRegion' | 'createdAt' | 'updatedAt'>;
|
|
3
|
+
export type PostHogPendingConnectionData = {
|
|
4
|
+
url: string;
|
|
5
|
+
};
|
|
6
|
+
export type StartPostHogConnectionResult = ({
|
|
7
|
+
__typename: 'PostHogOrganizationConnection';
|
|
8
|
+
} & PostHogOrganizationConnectionData) | ({
|
|
9
|
+
__typename: 'PostHogPendingConnection';
|
|
10
|
+
} & PostHogPendingConnectionData);
|
|
3
11
|
export type PostHogProjectData = Pick<PostHogProject, 'id' | 'posthogProjectIdentifier' | 'posthogProjectName' | 'posthogProjectToken' | 'posthogHost' | 'createdAt' | 'updatedAt'> & {
|
|
4
12
|
posthogOrganizationConnection: PostHogOrganizationConnectionData;
|
|
5
13
|
};
|
|
@@ -4,8 +4,8 @@ exports.fetchObserveCustomEventsAsync = fetchObserveCustomEventsAsync;
|
|
|
4
4
|
const ObserveQuery_1 = require("../graphql/queries/ObserveQuery");
|
|
5
5
|
async function fetchObserveCustomEventsAsync(graphqlClient, appId, options) {
|
|
6
6
|
const filter = {
|
|
7
|
-
startTime: options.startTime,
|
|
8
|
-
endTime: options.endTime,
|
|
7
|
+
...(options.startTime && { startTime: options.startTime }),
|
|
8
|
+
...(options.endTime && { endTime: options.endTime }),
|
|
9
9
|
...(options.eventName && { eventName: options.eventName }),
|
|
10
10
|
...(options.platform && { platform: options.platform }),
|
|
11
11
|
...(options.appVersion && { appVersion: options.appVersion }),
|
|
@@ -8,15 +8,16 @@ export declare enum EventsOrderPreset {
|
|
|
8
8
|
}
|
|
9
9
|
export declare function resolveOrderBy(input: string): AppObserveEventsOrderBy;
|
|
10
10
|
interface FetchObserveEventsOptions {
|
|
11
|
-
metricName
|
|
11
|
+
metricName?: string;
|
|
12
12
|
orderBy: AppObserveEventsOrderBy;
|
|
13
13
|
limit: number;
|
|
14
14
|
after?: string;
|
|
15
|
-
startTime
|
|
16
|
-
endTime
|
|
15
|
+
startTime?: string;
|
|
16
|
+
endTime?: string;
|
|
17
17
|
platform?: AppObservePlatform;
|
|
18
18
|
appVersion?: string;
|
|
19
19
|
updateId?: string;
|
|
20
|
+
sessionId?: string;
|
|
20
21
|
}
|
|
21
22
|
interface FetchObserveEventsResult {
|
|
22
23
|
events: AppObserveEvent[];
|
|
@@ -40,12 +40,13 @@ function resolveOrderBy(input) {
|
|
|
40
40
|
}
|
|
41
41
|
async function fetchObserveEventsAsync(graphqlClient, appId, options) {
|
|
42
42
|
const filter = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
...(options.startTime && { startTime: options.startTime }),
|
|
44
|
+
...(options.endTime && { endTime: options.endTime }),
|
|
45
|
+
...(options.metricName && { metricName: options.metricName }),
|
|
46
46
|
...(options.platform && { platform: options.platform }),
|
|
47
47
|
...(options.appVersion && { appVersion: options.appVersion }),
|
|
48
48
|
...(options.updateId && { appUpdateId: options.updateId }),
|
|
49
|
+
...(options.sessionId && { sessionId: options.sessionId }),
|
|
49
50
|
};
|
|
50
51
|
return await ObserveQuery_1.ObserveQuery.eventsAsync(graphqlClient, {
|
|
51
52
|
appId,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
export interface SessionEventEntry {
|
|
3
|
+
source: 'metric' | 'log';
|
|
4
|
+
timestamp: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
appVersion: string;
|
|
7
|
+
appBuildNumber: string;
|
|
8
|
+
appUpdateId: string | null;
|
|
9
|
+
deviceModel: string;
|
|
10
|
+
deviceOs: string;
|
|
11
|
+
deviceOsVersion: string;
|
|
12
|
+
countryCode: string | null;
|
|
13
|
+
easClientId: string;
|
|
14
|
+
metricName?: string;
|
|
15
|
+
metricValue?: number;
|
|
16
|
+
customParams?: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
} | null;
|
|
19
|
+
routeName?: string | null;
|
|
20
|
+
eventName?: string;
|
|
21
|
+
severityText?: string | null;
|
|
22
|
+
severityNumber?: number | null;
|
|
23
|
+
properties?: Array<{
|
|
24
|
+
key: string;
|
|
25
|
+
value: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}>;
|
|
28
|
+
environment?: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface SessionMetadata {
|
|
31
|
+
appVersion: string;
|
|
32
|
+
appBuildNumber: string;
|
|
33
|
+
appUpdateId: string | null;
|
|
34
|
+
deviceOs: string;
|
|
35
|
+
deviceOsVersion: string;
|
|
36
|
+
deviceModel: string;
|
|
37
|
+
countryCode: string | null;
|
|
38
|
+
firstSeenAt: string;
|
|
39
|
+
lastSeenAt: string;
|
|
40
|
+
}
|
|
41
|
+
export interface FetchSessionEventsOptions {
|
|
42
|
+
sessionId: string;
|
|
43
|
+
limit: number;
|
|
44
|
+
}
|
|
45
|
+
export interface FetchSessionEventsResult {
|
|
46
|
+
entries: SessionEventEntry[];
|
|
47
|
+
metadata: SessionMetadata | null;
|
|
48
|
+
hasMoreMetricEvents: boolean;
|
|
49
|
+
hasMoreLogEvents: boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare function fetchObserveSessionEventsAsync(graphqlClient: ExpoGraphqlClient, appId: string, options: FetchSessionEventsOptions): Promise<FetchSessionEventsResult>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchObserveSessionEventsAsync = fetchObserveSessionEventsAsync;
|
|
4
|
+
const generated_1 = require("../graphql/generated");
|
|
5
|
+
const fetchCustomEvents_1 = require("./fetchCustomEvents");
|
|
6
|
+
const fetchEvents_1 = require("./fetchEvents");
|
|
7
|
+
function metricEventToEntry(event) {
|
|
8
|
+
return {
|
|
9
|
+
source: 'metric',
|
|
10
|
+
timestamp: event.timestamp,
|
|
11
|
+
sessionId: event.sessionId ?? '',
|
|
12
|
+
appVersion: event.appVersion,
|
|
13
|
+
appBuildNumber: event.appBuildNumber,
|
|
14
|
+
appUpdateId: event.appUpdateId ?? null,
|
|
15
|
+
deviceModel: event.deviceModel,
|
|
16
|
+
deviceOs: event.deviceOs,
|
|
17
|
+
deviceOsVersion: event.deviceOsVersion,
|
|
18
|
+
countryCode: event.countryCode ?? null,
|
|
19
|
+
easClientId: event.easClientId,
|
|
20
|
+
metricName: event.metricName,
|
|
21
|
+
metricValue: event.metricValue,
|
|
22
|
+
customParams: event.customParams ?? null,
|
|
23
|
+
routeName: event.routeName ?? null,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function customEventToEntry(event) {
|
|
27
|
+
return {
|
|
28
|
+
source: 'log',
|
|
29
|
+
timestamp: event.timestamp,
|
|
30
|
+
sessionId: event.sessionId ?? '',
|
|
31
|
+
appVersion: event.appVersion,
|
|
32
|
+
appBuildNumber: event.appBuildNumber,
|
|
33
|
+
appUpdateId: event.appUpdateId ?? null,
|
|
34
|
+
deviceModel: event.deviceModel,
|
|
35
|
+
deviceOs: event.deviceOs,
|
|
36
|
+
deviceOsVersion: event.deviceOsVersion,
|
|
37
|
+
countryCode: event.countryCode ?? null,
|
|
38
|
+
easClientId: event.easClientId,
|
|
39
|
+
eventName: event.eventName,
|
|
40
|
+
severityText: event.severityText ?? null,
|
|
41
|
+
severityNumber: event.severityNumber ?? null,
|
|
42
|
+
properties: event.properties.map(p => ({ key: p.key, value: p.value, type: p.type })),
|
|
43
|
+
environment: event.environment ?? null,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async function fetchObserveSessionEventsAsync(graphqlClient, appId, options) {
|
|
47
|
+
const [metricResult, logResult] = await Promise.all([
|
|
48
|
+
(0, fetchEvents_1.fetchObserveEventsAsync)(graphqlClient, appId, {
|
|
49
|
+
orderBy: {
|
|
50
|
+
field: generated_1.AppObserveEventsOrderByField.Timestamp,
|
|
51
|
+
direction: generated_1.AppObserveEventsOrderByDirection.Asc,
|
|
52
|
+
},
|
|
53
|
+
limit: options.limit,
|
|
54
|
+
sessionId: options.sessionId,
|
|
55
|
+
}),
|
|
56
|
+
(0, fetchCustomEvents_1.fetchObserveCustomEventsAsync)(graphqlClient, appId, {
|
|
57
|
+
limit: options.limit,
|
|
58
|
+
sessionId: options.sessionId,
|
|
59
|
+
}),
|
|
60
|
+
]);
|
|
61
|
+
const entries = [
|
|
62
|
+
...metricResult.events.map(metricEventToEntry),
|
|
63
|
+
...logResult.events.map(customEventToEntry),
|
|
64
|
+
].sort((a, b) => (a.timestamp < b.timestamp ? -1 : a.timestamp > b.timestamp ? 1 : 0));
|
|
65
|
+
let metadata = null;
|
|
66
|
+
if (entries.length > 0) {
|
|
67
|
+
const newest = entries[entries.length - 1];
|
|
68
|
+
metadata = {
|
|
69
|
+
appVersion: newest.appVersion,
|
|
70
|
+
appBuildNumber: newest.appBuildNumber,
|
|
71
|
+
appUpdateId: newest.appUpdateId,
|
|
72
|
+
deviceOs: newest.deviceOs,
|
|
73
|
+
deviceOsVersion: newest.deviceOsVersion,
|
|
74
|
+
deviceModel: newest.deviceModel,
|
|
75
|
+
countryCode: newest.countryCode,
|
|
76
|
+
firstSeenAt: entries[0].timestamp,
|
|
77
|
+
lastSeenAt: newest.timestamp,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
entries,
|
|
82
|
+
metadata,
|
|
83
|
+
hasMoreMetricEvents: metricResult.pageInfo.hasNextPage,
|
|
84
|
+
hasMoreLogEvents: logResult.pageInfo.hasNextPage,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -65,6 +65,7 @@ function buildObserveEventsJson(events, pageInfo) {
|
|
|
65
65
|
easClientId: event.easClientId,
|
|
66
66
|
timestamp: event.timestamp,
|
|
67
67
|
customParams: resolveCustomParams(event),
|
|
68
|
+
routeName: event.routeName ?? null,
|
|
68
69
|
})),
|
|
69
70
|
pageInfo: {
|
|
70
71
|
hasNextPage: pageInfo.hasNextPage,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SessionEventEntry, SessionMetadata } from './fetchSessions';
|
|
2
|
+
export interface BuildSessionEventsOptions {
|
|
3
|
+
metadata?: SessionMetadata | null;
|
|
4
|
+
hasMoreMetricEvents?: boolean;
|
|
5
|
+
hasMoreLogEvents?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildObserveSessionEventsTable(entries: SessionEventEntry[], options?: BuildSessionEventsOptions): string;
|
|
8
|
+
export interface ObserveSessionEventsJson {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
metadata: SessionMetadata | null;
|
|
11
|
+
entries: SessionEventEntry[];
|
|
12
|
+
hasMoreMetricEvents: boolean;
|
|
13
|
+
hasMoreLogEvents: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function buildObserveSessionEventsJson(entries: SessionEventEntry[], sessionId: string, metadata: SessionMetadata | null, hasMoreMetricEvents: boolean, hasMoreLogEvents: boolean): ObserveSessionEventsJson;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildObserveSessionEventsTable = buildObserveSessionEventsTable;
|
|
4
|
+
exports.buildObserveSessionEventsJson = buildObserveSessionEventsJson;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const formatUtils_1 = require("./formatUtils");
|
|
8
|
+
const metricNames_1 = require("./metricNames");
|
|
9
|
+
const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
|
|
10
|
+
function formatEntryName(entry) {
|
|
11
|
+
if (entry.source === 'metric' && entry.metricName) {
|
|
12
|
+
const name = (0, metricNames_1.getMetricDisplayName)(entry.metricName);
|
|
13
|
+
return entry.routeName ? `${name} · ${entry.routeName}` : name;
|
|
14
|
+
}
|
|
15
|
+
return entry.eventName ?? '-';
|
|
16
|
+
}
|
|
17
|
+
function formatMetricEntryValue(entry) {
|
|
18
|
+
if (typeof entry.metricValue === 'number') {
|
|
19
|
+
return `${entry.metricValue.toFixed(2)}s`;
|
|
20
|
+
}
|
|
21
|
+
return '-';
|
|
22
|
+
}
|
|
23
|
+
function formatEntrySeverity(entry) {
|
|
24
|
+
if (entry.source !== 'log') {
|
|
25
|
+
return '-';
|
|
26
|
+
}
|
|
27
|
+
if (entry.severityText) {
|
|
28
|
+
return entry.severityText;
|
|
29
|
+
}
|
|
30
|
+
if (entry.severityNumber != null) {
|
|
31
|
+
return String(entry.severityNumber);
|
|
32
|
+
}
|
|
33
|
+
return '-';
|
|
34
|
+
}
|
|
35
|
+
function primitivePropertyLines(entry) {
|
|
36
|
+
if (entry.source !== 'log' || !entry.properties) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
return entry.properties
|
|
40
|
+
.filter(p => p.type === 'STRING' || p.type === 'NUMBER' || p.type === 'BOOLEAN')
|
|
41
|
+
.map(p => `${p.key}=${p.value}`);
|
|
42
|
+
}
|
|
43
|
+
function formatOffsetSeconds(startIso, currentIso) {
|
|
44
|
+
const offsetMs = new Date(currentIso).getTime() - new Date(startIso).getTime();
|
|
45
|
+
return `${(offsetMs / 1000).toFixed(2)}s`;
|
|
46
|
+
}
|
|
47
|
+
function buildObserveSessionEventsTable(entries, options) {
|
|
48
|
+
const lines = [];
|
|
49
|
+
if (options?.metadata) {
|
|
50
|
+
const { metadata } = options;
|
|
51
|
+
lines.push(`App version: ${metadata.appVersion} (${metadata.appBuildNumber})`, `Device: ${metadata.deviceModel} · ${metadata.deviceOs} ${metadata.deviceOsVersion}`, `First seen: ${(0, formatUtils_1.formatLogTimestamp)(metadata.firstSeenAt)}`, `Last seen: ${(0, formatUtils_1.formatLogTimestamp)(metadata.lastSeenAt)}`, '');
|
|
52
|
+
}
|
|
53
|
+
if (entries.length === 0) {
|
|
54
|
+
lines.push(chalk_1.default.yellow('No events found for this session.'));
|
|
55
|
+
return lines.join('\n');
|
|
56
|
+
}
|
|
57
|
+
const startIso = entries[0].timestamp;
|
|
58
|
+
const headers = ['Offset', 'Type', 'Name', 'Value', 'Properties', 'Severity'];
|
|
59
|
+
const rows = [];
|
|
60
|
+
for (const entry of entries) {
|
|
61
|
+
const offset = formatOffsetSeconds(startIso, entry.timestamp);
|
|
62
|
+
const type = entry.source === 'metric' ? 'metric' : 'log';
|
|
63
|
+
const name = formatEntryName(entry);
|
|
64
|
+
const severity = formatEntrySeverity(entry);
|
|
65
|
+
if (entry.source === 'metric') {
|
|
66
|
+
rows.push([offset, type, name, formatMetricEntryValue(entry), '-', severity]);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const propLines = primitivePropertyLines(entry);
|
|
70
|
+
if (propLines.length === 0) {
|
|
71
|
+
rows.push([offset, type, name, '-', '-', severity]);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
rows.push([offset, type, name, '-', propLines[0], severity]);
|
|
75
|
+
for (let i = 1; i < propLines.length; i++) {
|
|
76
|
+
rows.push(['', '', '', '', propLines[i], '']);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
lines.push((0, renderTextTable_1.default)(headers, rows));
|
|
80
|
+
if (options?.hasMoreMetricEvents || options?.hasMoreLogEvents) {
|
|
81
|
+
const sources = [];
|
|
82
|
+
if (options.hasMoreMetricEvents) {
|
|
83
|
+
sources.push('metric events');
|
|
84
|
+
}
|
|
85
|
+
if (options.hasMoreLogEvents) {
|
|
86
|
+
sources.push('log events');
|
|
87
|
+
}
|
|
88
|
+
lines.push('', chalk_1.default.yellow(`More ${sources.join(' and ')} are available for this session; only the first 100 of each are shown.`));
|
|
89
|
+
}
|
|
90
|
+
return lines.join('\n');
|
|
91
|
+
}
|
|
92
|
+
function buildObserveSessionEventsJson(entries, sessionId, metadata, hasMoreMetricEvents, hasMoreLogEvents) {
|
|
93
|
+
return {
|
|
94
|
+
sessionId,
|
|
95
|
+
metadata,
|
|
96
|
+
entries,
|
|
97
|
+
hasMoreMetricEvents,
|
|
98
|
+
hasMoreLogEvents,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -6,40 +6,37 @@ const errors_1 = require("../channel/errors");
|
|
|
6
6
|
const queries_2 = require("../channel/queries");
|
|
7
7
|
const ChannelQuery_1 = require("../graphql/queries/ChannelQuery");
|
|
8
8
|
async function getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync(graphqlClient, projectId, channelName) {
|
|
9
|
-
let
|
|
9
|
+
let channel;
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
channel = await ChannelQuery_1.ChannelQuery.viewUpdateChannelAsync(graphqlClient, {
|
|
12
12
|
appId: projectId,
|
|
13
13
|
channelName,
|
|
14
14
|
});
|
|
15
|
-
if (channel.updateBranches.length === 1) {
|
|
16
|
-
const branch = channel.updateBranches[0];
|
|
17
|
-
branchInfo = { branchId: branch.id, branchName: branch.name };
|
|
18
|
-
}
|
|
19
|
-
else if (channel.updateBranches.length === 0) {
|
|
20
|
-
throw new Error("Channel has no branches associated with it. Run 'eas channel:edit' to map a branch");
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
throw new Error(`Channel has multiple branches associated with it. Instead, use '--branch' instead of '--channel'`);
|
|
24
|
-
}
|
|
25
15
|
}
|
|
26
16
|
catch (error) {
|
|
27
17
|
if (!(error instanceof errors_1.ChannelNotFoundError)) {
|
|
28
18
|
throw error;
|
|
29
19
|
}
|
|
30
|
-
|
|
31
|
-
appId: projectId,
|
|
32
|
-
branchName: channelName,
|
|
33
|
-
});
|
|
34
|
-
const { updateChannel: { createUpdateChannelForApp: newChannel }, } = await (0, queries_2.createChannelOnAppAsync)(graphqlClient, {
|
|
35
|
-
appId: projectId,
|
|
36
|
-
channelName,
|
|
37
|
-
branchId: branch.id,
|
|
38
|
-
});
|
|
39
|
-
if (!newChannel) {
|
|
40
|
-
throw new Error(`Could not create channel with name ${channelName} on project with id ${projectId}`);
|
|
41
|
-
}
|
|
42
|
-
branchInfo = { branchId: branch.id, branchName: channelName };
|
|
20
|
+
return await createAndLinkBranchToChannelAsync(graphqlClient, projectId, channelName);
|
|
43
21
|
}
|
|
44
|
-
|
|
22
|
+
if (channel.updateBranches.length === 1) {
|
|
23
|
+
const branch = channel.updateBranches[0];
|
|
24
|
+
return { branchId: branch.id, branchName: branch.name };
|
|
25
|
+
}
|
|
26
|
+
if (channel.updateBranches.length === 0) {
|
|
27
|
+
return await createAndLinkBranchToChannelAsync(graphqlClient, projectId, channelName);
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Channel has multiple branches associated with it. Instead, use '--branch' instead of '--channel'`);
|
|
30
|
+
}
|
|
31
|
+
async function createAndLinkBranchToChannelAsync(graphqlClient, projectId, channelName) {
|
|
32
|
+
const { branch } = await (0, queries_1.ensureBranchExistsAsync)(graphqlClient, {
|
|
33
|
+
appId: projectId,
|
|
34
|
+
branchName: channelName,
|
|
35
|
+
});
|
|
36
|
+
await (0, queries_2.createChannelOnAppAsync)(graphqlClient, {
|
|
37
|
+
appId: projectId,
|
|
38
|
+
channelName,
|
|
39
|
+
branchId: branch.id,
|
|
40
|
+
});
|
|
41
|
+
return { branchId: branch.id, branchName: channelName };
|
|
45
42
|
}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
export type UsageTier = 'approaching' | 'at' | 'over';
|
|
2
3
|
export declare function maybeWarnAboutUsageOveragesAsync({ graphqlClient, accountId, }: {
|
|
3
4
|
graphqlClient: ExpoGraphqlClient;
|
|
4
5
|
accountId: string;
|
|
5
6
|
}): Promise<void>;
|
|
7
|
+
export declare function classifyUsageTier({ planValue, limit, overageCount, }: {
|
|
8
|
+
planValue: number;
|
|
9
|
+
limit: number;
|
|
10
|
+
overageCount: number;
|
|
11
|
+
}): UsageTier | null;
|
|
6
12
|
export declare function calculatePercentUsed(value: number, limit: number): number;
|
|
7
13
|
export declare function createProgressBar(percentUsed: number, width?: number): string;
|
|
8
|
-
export declare function displayOverageWarning({
|
|
9
|
-
|
|
10
|
-
hasFreePlan: boolean;
|
|
14
|
+
export declare function displayOverageWarning({ tier, name, hasFreePlan, planValue, limit, overageCount, overageCostCents, }: {
|
|
15
|
+
tier: UsageTier;
|
|
11
16
|
name: string;
|
|
17
|
+
hasFreePlan: boolean;
|
|
18
|
+
planValue: number;
|
|
19
|
+
limit: number;
|
|
20
|
+
overageCount: number;
|
|
21
|
+
overageCostCents: number;
|
|
12
22
|
}): void;
|