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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
8
|
+
const fetchSessions_1 = require("../../observe/fetchSessions");
|
|
9
|
+
const flags_2 = require("../../observe/flags");
|
|
10
|
+
const formatSessions_1 = require("../../observe/formatSessions");
|
|
11
|
+
const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
|
|
12
|
+
const json_1 = require("../../utils/json");
|
|
13
|
+
// Fixed at 100 — the maximum page size accepted by the underlying events and
|
|
14
|
+
// customEventList queries. Until there's a dedicated sessions query, this
|
|
15
|
+
// command pulls one page of each and merges client-side.
|
|
16
|
+
const SESSION_PAGE_SIZE = 100;
|
|
17
|
+
class ObserveSession extends EasCommand_1.default {
|
|
18
|
+
static description = 'display the timeline of metric and log events for a specific session';
|
|
19
|
+
static args = {
|
|
20
|
+
sessionId: core_1.Args.string({
|
|
21
|
+
description: 'Session ID to inspect',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
static flags = {
|
|
26
|
+
...flags_2.ObserveProjectIdFlag,
|
|
27
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
28
|
+
};
|
|
29
|
+
static contextDefinition = {
|
|
30
|
+
...this.ContextOptions.ProjectId,
|
|
31
|
+
...this.ContextOptions.LoggedIn,
|
|
32
|
+
};
|
|
33
|
+
static loggedInOnlyContextDefinition = {
|
|
34
|
+
...this.ContextOptions.LoggedIn,
|
|
35
|
+
};
|
|
36
|
+
async runAsync() {
|
|
37
|
+
const { flags, args } = await this.parse(ObserveSession);
|
|
38
|
+
const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
|
|
39
|
+
command: this,
|
|
40
|
+
commandClass: ObserveSession,
|
|
41
|
+
loggedInOnlyContextDefinition: ObserveSession.loggedInOnlyContextDefinition,
|
|
42
|
+
projectIdOverride: flags['project-id'],
|
|
43
|
+
nonInteractive: flags['non-interactive'],
|
|
44
|
+
});
|
|
45
|
+
if (flags.json) {
|
|
46
|
+
(0, json_1.enableJsonOutput)();
|
|
47
|
+
}
|
|
48
|
+
const { entries, metadata, hasMoreMetricEvents, hasMoreLogEvents } = await (0, fetchSessions_1.fetchObserveSessionEventsAsync)(graphqlClient, projectId, {
|
|
49
|
+
sessionId: args.sessionId,
|
|
50
|
+
limit: SESSION_PAGE_SIZE,
|
|
51
|
+
});
|
|
52
|
+
if (flags.json) {
|
|
53
|
+
(0, json_1.printJsonOnlyOutput)((0, formatSessions_1.buildObserveSessionEventsJson)(entries, args.sessionId, metadata, hasMoreMetricEvents, hasMoreLogEvents));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
log_1.default.addNewLineIfNone();
|
|
57
|
+
log_1.default.log((0, formatSessions_1.buildObserveSessionEventsTable)(entries, {
|
|
58
|
+
metadata,
|
|
59
|
+
hasMoreMetricEvents,
|
|
60
|
+
hasMoreLogEvents,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = ObserveSession;
|
|
@@ -15,4 +15,11 @@ export default class UpdateView extends EasCommand {
|
|
|
15
15
|
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
16
16
|
};
|
|
17
17
|
runAsync(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves the provided ID into an update group and its updates. The ID may be either an
|
|
20
|
+
* update group ID or the ID of a single platform-specific update. We first try to look it up
|
|
21
|
+
* as a group; if no updates are found, we fall back to resolving it as a platform-specific
|
|
22
|
+
* update and then fetch the group that update belongs to.
|
|
23
|
+
*/
|
|
24
|
+
private static resolveUpdateGroupAsync;
|
|
18
25
|
}
|
|
@@ -17,7 +17,7 @@ class UpdateView extends EasCommand_1.default {
|
|
|
17
17
|
static args = {
|
|
18
18
|
groupId: core_1.Args.string({
|
|
19
19
|
required: true,
|
|
20
|
-
description: 'The ID of an update group.',
|
|
20
|
+
description: 'The ID of an update group, or the ID of a platform-specific update.',
|
|
21
21
|
}),
|
|
22
22
|
};
|
|
23
23
|
static flags = {
|
|
@@ -44,7 +44,7 @@ class UpdateView extends EasCommand_1.default {
|
|
|
44
44
|
...this.ContextOptions.LoggedIn,
|
|
45
45
|
};
|
|
46
46
|
async runAsync() {
|
|
47
|
-
const { args: { groupId }, flags: { json: jsonFlag, insights: insightsFlag, days, start, end }, } = await this.parse(UpdateView);
|
|
47
|
+
const { args: { groupId: idArg }, flags: { json: jsonFlag, insights: insightsFlag, days, start, end }, } = await this.parse(UpdateView);
|
|
48
48
|
if (!insightsFlag && (days !== undefined || start !== undefined || end !== undefined)) {
|
|
49
49
|
throw new Error('--days, --start, and --end can only be used with --insights.');
|
|
50
50
|
}
|
|
@@ -52,7 +52,7 @@ class UpdateView extends EasCommand_1.default {
|
|
|
52
52
|
if (jsonFlag) {
|
|
53
53
|
(0, json_1.enableJsonOutput)();
|
|
54
54
|
}
|
|
55
|
-
const updatesByGroup = await
|
|
55
|
+
const { groupId, updatesByGroup } = await UpdateView.resolveUpdateGroupAsync(graphqlClient, idArg);
|
|
56
56
|
let insightsSummary = null;
|
|
57
57
|
if (insightsFlag) {
|
|
58
58
|
const { daysBack, startTime, endTime } = (0, timeRange_1.resolveInsightsTimeRange)({ days, start, end });
|
|
@@ -84,5 +84,32 @@ class UpdateView extends EasCommand_1.default {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Resolves the provided ID into an update group and its updates. The ID may be either an
|
|
89
|
+
* update group ID or the ID of a single platform-specific update. We first try to look it up
|
|
90
|
+
* as a group; if no updates are found, we fall back to resolving it as a platform-specific
|
|
91
|
+
* update and then fetch the group that update belongs to.
|
|
92
|
+
*/
|
|
93
|
+
static async resolveUpdateGroupAsync(graphqlClient, id) {
|
|
94
|
+
try {
|
|
95
|
+
const updatesByGroup = await UpdateQuery_1.UpdateQuery.viewUpdateGroupAsync(graphqlClient, { groupId: id });
|
|
96
|
+
return { groupId: id, updatesByGroup };
|
|
97
|
+
}
|
|
98
|
+
catch (groupError) {
|
|
99
|
+
let update;
|
|
100
|
+
try {
|
|
101
|
+
update = await UpdateQuery_1.UpdateQuery.viewByUpdateAsync(graphqlClient, { updateId: id });
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// The ID is neither a valid update group nor a valid platform-specific update; surface
|
|
105
|
+
// the original group lookup error since the group ID is the primary input.
|
|
106
|
+
throw groupError;
|
|
107
|
+
}
|
|
108
|
+
const updatesByGroup = await UpdateQuery_1.UpdateQuery.viewUpdateGroupAsync(graphqlClient, {
|
|
109
|
+
groupId: update.group,
|
|
110
|
+
});
|
|
111
|
+
return { groupId: update.group, updatesByGroup };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
87
114
|
}
|
|
88
115
|
exports.default = UpdateView;
|