eas-cli 20.2.0 → 20.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 +225 -110
- package/build/commandUtils/new/templates/AGENTS.md +25 -146
- package/build/commandUtils/new/templates/CLAUDE.md +1 -9
- package/build/commandUtils/posthog.d.ts +4 -0
- package/build/commandUtils/posthog.js +23 -0
- package/build/commands/account/audit.d.ts +17 -0
- package/build/commands/account/audit.js +112 -0
- package/build/commands/integrations/posthog/connect.d.ts +27 -0
- package/build/commands/integrations/posthog/connect.js +432 -0
- package/build/commands/integrations/posthog/dashboard.d.ts +13 -0
- package/build/commands/integrations/posthog/dashboard.js +66 -0
- package/build/commands/integrations/posthog/disconnect.d.ts +14 -0
- package/build/commands/integrations/posthog/disconnect.js +80 -0
- package/build/commands/observe/session.d.ts +18 -0
- package/build/commands/observe/session.js +65 -0
- package/build/commands/update/view.d.ts +7 -0
- package/build/commands/update/view.js +30 -3
- package/build/graphql/generated.d.ts +468 -2
- package/build/graphql/generated.js +28 -4
- package/build/graphql/mutations/PostHogMutation.d.ts +8 -0
- package/build/graphql/mutations/PostHogMutation.js +55 -0
- package/build/graphql/queries/AuditLogQuery.d.ts +6 -0
- package/build/graphql/queries/AuditLogQuery.js +57 -0
- package/build/graphql/queries/DeviceRunSessionQuery.js +1 -0
- package/build/graphql/queries/PostHogQuery.d.ts +6 -0
- package/build/graphql/queries/PostHogQuery.js +49 -0
- package/build/graphql/types/AuditLog.d.ts +1 -0
- package/build/graphql/types/AuditLog.js +18 -0
- package/build/graphql/types/Observe.js +1 -0
- package/build/graphql/types/PostHogConnection.d.ts +7 -0
- package/build/graphql/types/PostHogConnection.js +30 -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/simulator/utils.js +28 -5
- package/build/update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.js +23 -26
- package/build/user/SessionManager.d.ts +1 -22
- package/build/user/SessionManager.js +7 -89
- package/oclif.manifest.json +1583 -1108
- package/package.json +7 -3
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.DashboardViewPin = exports.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.CrashSampleFor = exports.ContinentCode = exports.BuildWorkflow = exports.BuildTrigger = exports.BuildStatus = exports.BuildRetryDisabledReason = exports.BuildResourceClass = exports.BuildPriority = exports.BuildPhase = exports.BuildMode = exports.BuildLimitThresholdExceededMetadataType = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.BuildAnnotationType = exports.BackgroundJobState = exports.BackgroundJobResultType = exports.AuthProviderIdentifier = exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AssetMapSourceType = exports.AppsFilter = exports.AppleTeamType = exports.AppleDeviceClass = exports.AppUploadSessionType = 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.AppObserveCustomEventNamesOrderByField = exports.AppObserveCustomEventNamesOrderByDirection = exports.AppInternalDistributionBuildPrivacy = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = exports.AccountUploadSessionType = exports.AccountMemberType = exports.AccountAppsSortByField = void 0;
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.WorkflowsInsightsRunsOverTimeGranularity = exports.WorkflowsInsightsExportFormat = exports.WorkflowRunTriggerEventType = void 0;
|
|
10
|
+
exports.OAuthProvider = exports.NotificationType = exports.NotificationEvent = exports.LocalBuildArchiveSourceType = exports.JobRunStatus = exports.JobRunPriority = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = exports.GitHubAppInstallationStatus = exports.GitHubAppInstallationAccountType = exports.GitHubAppEnvironment = exports.FingerprintSourceType = 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 = void 0;
|
|
11
|
+
exports.WorkflowJobStatus = exports.WorkflowJobReviewDecision = exports.WorkflowDeviceTestCaseStatusFilter = exports.WorkflowDeviceTestCaseStatus = exports.WorkflowDeviceTestCaseStatSortField = exports.WorkflowDeviceTestCaseSortDirection = exports.WorkflowDeviceTestCaseInsightsTimeSeriesGranularity = exports.WorkflowArtifactStorageType = exports.WorkerLoggerLevel = exports.WorkerDeploymentLogLevel = exports.WorkerDeploymentCrashKind = exports.WebhookType = exports.UserSpecifiedAccountUsage = exports.UserEntityTypeName = exports.UserAgentPlatform = exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.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 = void 0;
|
|
12
|
+
exports.WorkflowsInsightsRunsOverTimeGranularity = exports.WorkflowsInsightsExportFormat = exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = void 0;
|
|
13
13
|
var AccountAppsSortByField;
|
|
14
14
|
(function (AccountAppsSortByField) {
|
|
15
15
|
AccountAppsSortByField["LatestActivityTime"] = "LATEST_ACTIVITY_TIME";
|
|
@@ -565,6 +565,8 @@ var EntityTypeName;
|
|
|
565
565
|
EntityTypeName["IosAppCredentialsEntity"] = "IosAppCredentialsEntity";
|
|
566
566
|
EntityTypeName["LogRocketOrganizationEntity"] = "LogRocketOrganizationEntity";
|
|
567
567
|
EntityTypeName["LogRocketProjectEntity"] = "LogRocketProjectEntity";
|
|
568
|
+
EntityTypeName["PostHogOrganizationConnectionEntity"] = "PostHogOrganizationConnectionEntity";
|
|
569
|
+
EntityTypeName["PostHogProjectEntity"] = "PostHogProjectEntity";
|
|
568
570
|
EntityTypeName["UserInvitationEntity"] = "UserInvitationEntity";
|
|
569
571
|
EntityTypeName["UserPermissionEntity"] = "UserPermissionEntity";
|
|
570
572
|
EntityTypeName["VexoAccountConnectionEntity"] = "VexoAccountConnectionEntity";
|
|
@@ -593,6 +595,18 @@ var EnvironmentVariableVisibility;
|
|
|
593
595
|
EnvironmentVariableVisibility["Secret"] = "SECRET";
|
|
594
596
|
EnvironmentVariableVisibility["Sensitive"] = "SENSITIVE";
|
|
595
597
|
})(EnvironmentVariableVisibility || (exports.EnvironmentVariableVisibility = EnvironmentVariableVisibility = {}));
|
|
598
|
+
var ExitInterviewMessageRole;
|
|
599
|
+
(function (ExitInterviewMessageRole) {
|
|
600
|
+
ExitInterviewMessageRole["Assistant"] = "ASSISTANT";
|
|
601
|
+
ExitInterviewMessageRole["User"] = "USER";
|
|
602
|
+
})(ExitInterviewMessageRole || (exports.ExitInterviewMessageRole = ExitInterviewMessageRole = {}));
|
|
603
|
+
var ExitInterviewOutcome;
|
|
604
|
+
(function (ExitInterviewOutcome) {
|
|
605
|
+
ExitInterviewOutcome["CancelledImmediately"] = "CANCELLED_IMMEDIATELY";
|
|
606
|
+
ExitInterviewOutcome["ContinuedToStripe"] = "CONTINUED_TO_STRIPE";
|
|
607
|
+
ExitInterviewOutcome["Dismissed"] = "DISMISSED";
|
|
608
|
+
ExitInterviewOutcome["KeptPlan"] = "KEPT_PLAN";
|
|
609
|
+
})(ExitInterviewOutcome || (exports.ExitInterviewOutcome = ExitInterviewOutcome = {}));
|
|
596
610
|
var Experiment;
|
|
597
611
|
(function (Experiment) {
|
|
598
612
|
Experiment["Orbit"] = "ORBIT";
|
|
@@ -763,6 +777,11 @@ var Permission;
|
|
|
763
777
|
Permission["Publish"] = "PUBLISH";
|
|
764
778
|
Permission["View"] = "VIEW";
|
|
765
779
|
})(Permission || (exports.Permission = Permission = {}));
|
|
780
|
+
var PostHogRegion;
|
|
781
|
+
(function (PostHogRegion) {
|
|
782
|
+
PostHogRegion["Eu"] = "EU";
|
|
783
|
+
PostHogRegion["Us"] = "US";
|
|
784
|
+
})(PostHogRegion || (exports.PostHogRegion = PostHogRegion = {}));
|
|
766
785
|
var ProjectArchiveSourceType;
|
|
767
786
|
(function (ProjectArchiveSourceType) {
|
|
768
787
|
ProjectArchiveSourceType["Gcs"] = "GCS";
|
|
@@ -834,7 +853,10 @@ var SecondFactorMethod;
|
|
|
834
853
|
(function (SecondFactorMethod) {
|
|
835
854
|
/** Google Authenticator (TOTP) */
|
|
836
855
|
SecondFactorMethod["Authenticator"] = "AUTHENTICATOR";
|
|
837
|
-
/**
|
|
856
|
+
/**
|
|
857
|
+
* SMS
|
|
858
|
+
* @deprecated No longer supported
|
|
859
|
+
*/
|
|
838
860
|
SecondFactorMethod["Sms"] = "SMS";
|
|
839
861
|
})(SecondFactorMethod || (exports.SecondFactorMethod = SecondFactorMethod = {}));
|
|
840
862
|
var StandardOffer;
|
|
@@ -1020,6 +1042,7 @@ var UserEntityTypeName;
|
|
|
1020
1042
|
UserEntityTypeName["PasswordEntity"] = "PasswordEntity";
|
|
1021
1043
|
UserEntityTypeName["SsoUserEntity"] = "SSOUserEntity";
|
|
1022
1044
|
UserEntityTypeName["UserEntity"] = "UserEntity";
|
|
1045
|
+
UserEntityTypeName["UserPasskeyCredentialEntity"] = "UserPasskeyCredentialEntity";
|
|
1023
1046
|
UserEntityTypeName["UserPermissionEntity"] = "UserPermissionEntity";
|
|
1024
1047
|
UserEntityTypeName["UserSecondFactorBackupCodesEntity"] = "UserSecondFactorBackupCodesEntity";
|
|
1025
1048
|
UserEntityTypeName["UserSecondFactorDeviceEntity"] = "UserSecondFactorDeviceEntity";
|
|
@@ -1168,6 +1191,7 @@ var WorkflowRunTriggerEventType;
|
|
|
1168
1191
|
WorkflowRunTriggerEventType["GithubPullRequestReopened"] = "GITHUB_PULL_REQUEST_REOPENED";
|
|
1169
1192
|
WorkflowRunTriggerEventType["GithubPullRequestSynchronize"] = "GITHUB_PULL_REQUEST_SYNCHRONIZE";
|
|
1170
1193
|
WorkflowRunTriggerEventType["GithubPush"] = "GITHUB_PUSH";
|
|
1194
|
+
WorkflowRunTriggerEventType["GithubRefDelete"] = "GITHUB_REF_DELETE";
|
|
1171
1195
|
WorkflowRunTriggerEventType["Manual"] = "MANUAL";
|
|
1172
1196
|
WorkflowRunTriggerEventType["RepackExpoGo"] = "REPACK_EXPO_GO";
|
|
1173
1197
|
WorkflowRunTriggerEventType["Schedule"] = "SCHEDULE";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { CreatePostHogAccountRequestInput, SetupPostHogProjectInput } from '../generated';
|
|
3
|
+
import { PostHogOrganizationConnectionData, PostHogProjectData } from '../types/PostHogConnection';
|
|
4
|
+
export declare const PostHogMutation: {
|
|
5
|
+
createPostHogAccountRequestAsync(graphqlClient: ExpoGraphqlClient, input: CreatePostHogAccountRequestInput): Promise<PostHogOrganizationConnectionData>;
|
|
6
|
+
setupPostHogProjectAsync(graphqlClient: ExpoGraphqlClient, input: SetupPostHogProjectInput): Promise<PostHogProjectData>;
|
|
7
|
+
deletePostHogProjectAsync(graphqlClient: ExpoGraphqlClient, id: string): Promise<string>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostHogMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("graphql");
|
|
6
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
|
+
const client_1 = require("../client");
|
|
8
|
+
const PostHogConnection_1 = require("../types/PostHogConnection");
|
|
9
|
+
exports.PostHogMutation = {
|
|
10
|
+
async createPostHogAccountRequestAsync(graphqlClient, input) {
|
|
11
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
12
|
+
.mutation((0, graphql_tag_1.default) `
|
|
13
|
+
mutation CreatePostHogAccountRequest($input: CreatePostHogAccountRequestInput!) {
|
|
14
|
+
posthogOrganizationConnection {
|
|
15
|
+
createPostHogAccountRequest(input: $input) {
|
|
16
|
+
id
|
|
17
|
+
...PostHogOrganizationConnectionFragment
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
${(0, graphql_1.print)(PostHogConnection_1.PostHogOrganizationConnectionFragmentNode)}
|
|
22
|
+
`, { input })
|
|
23
|
+
.toPromise());
|
|
24
|
+
return data.posthogOrganizationConnection.createPostHogAccountRequest;
|
|
25
|
+
},
|
|
26
|
+
async setupPostHogProjectAsync(graphqlClient, input) {
|
|
27
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
28
|
+
.mutation((0, graphql_tag_1.default) `
|
|
29
|
+
mutation SetupPostHogProject($input: SetupPostHogProjectInput!) {
|
|
30
|
+
posthogProject {
|
|
31
|
+
setupPostHogProject(input: $input) {
|
|
32
|
+
id
|
|
33
|
+
...PostHogProjectFragment
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
${(0, graphql_1.print)(PostHogConnection_1.PostHogOrganizationConnectionFragmentNode)}
|
|
38
|
+
${(0, graphql_1.print)(PostHogConnection_1.PostHogProjectFragmentNode)}
|
|
39
|
+
`, { input })
|
|
40
|
+
.toPromise());
|
|
41
|
+
return data.posthogProject.setupPostHogProject;
|
|
42
|
+
},
|
|
43
|
+
async deletePostHogProjectAsync(graphqlClient, id) {
|
|
44
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
45
|
+
.mutation((0, graphql_tag_1.default) `
|
|
46
|
+
mutation DeletePostHogProject($id: ID!) {
|
|
47
|
+
posthogProject {
|
|
48
|
+
deletePostHogProject(id: $id)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`, { id }, { additionalTypenames: ['App', 'PostHogProject'] })
|
|
52
|
+
.toPromise());
|
|
53
|
+
return data.posthogProject.deletePostHogProject;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { Connection, QueryParams } from '../../utils/relay';
|
|
3
|
+
import { AuditLogFragment } from '../generated';
|
|
4
|
+
export declare const AuditLogQuery: {
|
|
5
|
+
getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, accountId: string, queryParams: QueryParams): Promise<Connection<AuditLogFragment>>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditLogQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("graphql");
|
|
6
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
|
+
const client_1 = require("../client");
|
|
8
|
+
const AuditLog_1 = require("../types/AuditLog");
|
|
9
|
+
exports.AuditLogQuery = {
|
|
10
|
+
async getAllForAccountAsync(graphqlClient, accountId, queryParams) {
|
|
11
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
12
|
+
.query((0, graphql_tag_1.default) `
|
|
13
|
+
query AuditLogsByAccount(
|
|
14
|
+
$accountId: String!
|
|
15
|
+
$first: Int
|
|
16
|
+
$after: String
|
|
17
|
+
$last: Int
|
|
18
|
+
$before: String
|
|
19
|
+
) {
|
|
20
|
+
account {
|
|
21
|
+
byId(accountId: $accountId) {
|
|
22
|
+
id
|
|
23
|
+
auditLogsPaginated(
|
|
24
|
+
first: $first
|
|
25
|
+
after: $after
|
|
26
|
+
last: $last
|
|
27
|
+
before: $before
|
|
28
|
+
) {
|
|
29
|
+
edges {
|
|
30
|
+
cursor
|
|
31
|
+
node {
|
|
32
|
+
id
|
|
33
|
+
...AuditLogFragment
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
pageInfo {
|
|
37
|
+
hasNextPage
|
|
38
|
+
hasPreviousPage
|
|
39
|
+
startCursor
|
|
40
|
+
endCursor
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
${(0, graphql_1.print)(AuditLog_1.AuditLogFragmentNode)}
|
|
47
|
+
`, {
|
|
48
|
+
accountId,
|
|
49
|
+
first: queryParams.first,
|
|
50
|
+
after: queryParams.after,
|
|
51
|
+
last: queryParams.last,
|
|
52
|
+
before: queryParams.before,
|
|
53
|
+
}, { additionalTypenames: ['AuditLog'] })
|
|
54
|
+
.toPromise());
|
|
55
|
+
return data.account.byId.auditLogsPaginated;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { PostHogOrganizationConnectionData, PostHogProjectData } from '../types/PostHogConnection';
|
|
3
|
+
export declare const PostHogQuery: {
|
|
4
|
+
getPostHogOrganizationConnectionByAccountIdAsync(graphqlClient: ExpoGraphqlClient, accountId: string): Promise<PostHogOrganizationConnectionData | null>;
|
|
5
|
+
getPostHogProjectByAppIdAsync(graphqlClient: ExpoGraphqlClient, appId: string): Promise<PostHogProjectData | null>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostHogQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("graphql");
|
|
6
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
|
+
const client_1 = require("../client");
|
|
8
|
+
const PostHogConnection_1 = require("../types/PostHogConnection");
|
|
9
|
+
exports.PostHogQuery = {
|
|
10
|
+
async getPostHogOrganizationConnectionByAccountIdAsync(graphqlClient, accountId) {
|
|
11
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
12
|
+
.query((0, graphql_tag_1.default) `
|
|
13
|
+
query PostHogOrganizationConnectionByAccountId($accountId: String!) {
|
|
14
|
+
account {
|
|
15
|
+
byId(accountId: $accountId) {
|
|
16
|
+
id
|
|
17
|
+
posthogOrganizationConnection {
|
|
18
|
+
id
|
|
19
|
+
...PostHogOrganizationConnectionFragment
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
${(0, graphql_1.print)(PostHogConnection_1.PostHogOrganizationConnectionFragmentNode)}
|
|
25
|
+
`, { accountId }, { additionalTypenames: ['PostHogOrganizationConnection'] })
|
|
26
|
+
.toPromise());
|
|
27
|
+
return data.account.byId.posthogOrganizationConnection ?? null;
|
|
28
|
+
},
|
|
29
|
+
async getPostHogProjectByAppIdAsync(graphqlClient, appId) {
|
|
30
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
31
|
+
.query((0, graphql_tag_1.default) `
|
|
32
|
+
query PostHogProjectByAppId($appId: String!) {
|
|
33
|
+
app {
|
|
34
|
+
byId(appId: $appId) {
|
|
35
|
+
id
|
|
36
|
+
posthogProject {
|
|
37
|
+
id
|
|
38
|
+
...PostHogProjectFragment
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
${(0, graphql_1.print)(PostHogConnection_1.PostHogOrganizationConnectionFragmentNode)}
|
|
44
|
+
${(0, graphql_1.print)(PostHogConnection_1.PostHogProjectFragmentNode)}
|
|
45
|
+
`, { appId }, { additionalTypenames: ['App', 'PostHogProject'] })
|
|
46
|
+
.toPromise());
|
|
47
|
+
return data.app.byId.posthogProject ?? null;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AuditLogFragmentNode: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditLogFragmentNode = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
exports.AuditLogFragmentNode = (0, graphql_tag_1.default) `
|
|
7
|
+
fragment AuditLogFragment on AuditLog {
|
|
8
|
+
id
|
|
9
|
+
createdAt
|
|
10
|
+
websiteMessage
|
|
11
|
+
targetEntityTypePublicName
|
|
12
|
+
targetEntityMutationType
|
|
13
|
+
actor {
|
|
14
|
+
id
|
|
15
|
+
displayName
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PostHogOrganizationConnection, PostHogProject } from '../generated';
|
|
2
|
+
export type PostHogOrganizationConnectionData = Pick<PostHogOrganizationConnection, 'id' | 'posthogOrganizationIdentifier' | 'posthogOrganizationName' | 'posthogRegion' | 'createdAt' | 'updatedAt'>;
|
|
3
|
+
export type PostHogProjectData = Pick<PostHogProject, 'id' | 'posthogProjectIdentifier' | 'posthogProjectName' | 'posthogProjectToken' | 'posthogHost' | 'createdAt' | 'updatedAt'> & {
|
|
4
|
+
posthogOrganizationConnection: PostHogOrganizationConnectionData;
|
|
5
|
+
};
|
|
6
|
+
export declare const PostHogOrganizationConnectionFragmentNode: import("graphql").DocumentNode;
|
|
7
|
+
export declare const PostHogProjectFragmentNode: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostHogProjectFragmentNode = exports.PostHogOrganizationConnectionFragmentNode = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
exports.PostHogOrganizationConnectionFragmentNode = (0, graphql_tag_1.default) `
|
|
7
|
+
fragment PostHogOrganizationConnectionFragment on PostHogOrganizationConnection {
|
|
8
|
+
id
|
|
9
|
+
posthogOrganizationIdentifier
|
|
10
|
+
posthogOrganizationName
|
|
11
|
+
posthogRegion
|
|
12
|
+
createdAt
|
|
13
|
+
updatedAt
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
exports.PostHogProjectFragmentNode = (0, graphql_tag_1.default) `
|
|
17
|
+
fragment PostHogProjectFragment on PostHogProject {
|
|
18
|
+
id
|
|
19
|
+
posthogProjectIdentifier
|
|
20
|
+
posthogProjectName
|
|
21
|
+
posthogProjectToken
|
|
22
|
+
posthogHost
|
|
23
|
+
createdAt
|
|
24
|
+
updatedAt
|
|
25
|
+
posthogOrganizationConnection {
|
|
26
|
+
id
|
|
27
|
+
...PostHogOrganizationConnectionFragment
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
@@ -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;
|