eas-cli 21.4.0 → 21.6.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 +454 -120
- package/build/build/local.js +64 -7
- package/build/commandUtils/workflow/compositeFunctions.d.ts +1 -0
- package/build/commandUtils/workflow/compositeFunctions.js +36 -0
- package/build/commandUtils/workflow/validation.js +3 -0
- package/build/commands/account/usage.d.ts +3 -0
- package/build/commands/account/usage.js +6 -5
- package/build/commands/integrations/posthog/connect.js +1 -1
- package/build/commands/project/new.d.ts +1 -1
- package/build/commands/simulator/availability.d.ts +1 -0
- package/build/commands/simulator/availability.js +9 -2
- package/build/commands/simulator/events.d.ts +1 -0
- package/build/commands/simulator/events.js +1 -0
- package/build/commands/simulator/exec.d.ts +1 -0
- package/build/commands/simulator/exec.js +1 -0
- package/build/commands/simulator/get.d.ts +1 -0
- package/build/commands/simulator/get.js +1 -0
- package/build/commands/simulator/{start.d.ts → index.d.ts} +1 -1
- package/build/commands/simulator/{start.js → index.js} +99 -29
- package/build/commands/simulator/list.d.ts +2 -0
- package/build/commands/simulator/list.js +7 -0
- package/build/commands/simulator/stop.d.ts +1 -0
- package/build/commands/simulator/stop.js +1 -0
- package/build/commands/submit/cancel.d.ts +20 -0
- package/build/commands/submit/cancel.js +116 -0
- package/build/commands/submit/list.d.ts +27 -0
- package/build/commands/submit/list.js +100 -0
- package/build/commands/submit/retry.d.ts +18 -0
- package/build/commands/submit/retry.js +123 -0
- package/build/commands/submit/status.d.ts +19 -0
- package/build/commands/submit/status.js +116 -0
- package/build/commands/submit/view.d.ts +17 -0
- package/build/commands/submit/view.js +96 -0
- package/build/graphql/generated.d.ts +580 -4
- package/build/graphql/generated.js +3 -0
- package/build/graphql/mutations/SubmissionMutation.d.ts +3 -1
- package/build/graphql/mutations/SubmissionMutation.js +33 -0
- package/build/graphql/queries/SubmissionQuery.d.ts +3 -2
- package/build/graphql/queries/SubmissionQuery.js +19 -2
- package/build/graphql/types/SubmissionWithSubmittedBuild.d.ts +1 -0
- package/build/graphql/types/SubmissionWithSubmittedBuild.js +25 -0
- package/build/simulator/utils.d.ts +7 -0
- package/build/simulator/utils.js +15 -1
- package/build/submit/queries.d.ts +34 -0
- package/build/submit/queries.js +94 -0
- package/build/submit/status.d.ts +31 -0
- package/build/submit/status.js +187 -0
- package/build/submit/utils/formatSubmission.d.ts +2 -0
- package/build/submit/utils/formatSubmission.js +78 -0
- package/build/utils/promise.d.ts +3 -2
- package/build/utils/promise.js +17 -3
- package/build/utils/terminalText.d.ts +1 -0
- package/build/utils/terminalText.js +14 -0
- package/build/utils/usage/checkForOverages.js +1 -1
- package/oclif.manifest.json +2247 -1726
- package/package.json +8 -5
|
@@ -610,12 +610,15 @@ var EntityTypeName;
|
|
|
610
610
|
EntityTypeName["CustomerEntity"] = "CustomerEntity";
|
|
611
611
|
EntityTypeName["EchoProjectEntity"] = "EchoProjectEntity";
|
|
612
612
|
EntityTypeName["EchoVersionEntity"] = "EchoVersionEntity";
|
|
613
|
+
EntityTypeName["EnvironmentVariableEntity"] = "EnvironmentVariableEntity";
|
|
613
614
|
EntityTypeName["GoogleServiceAccountKeyEntity"] = "GoogleServiceAccountKeyEntity";
|
|
614
615
|
EntityTypeName["IosAppCredentialsEntity"] = "IosAppCredentialsEntity";
|
|
615
616
|
EntityTypeName["LogRocketOrganizationEntity"] = "LogRocketOrganizationEntity";
|
|
616
617
|
EntityTypeName["LogRocketProjectEntity"] = "LogRocketProjectEntity";
|
|
617
618
|
EntityTypeName["PostHogOrganizationConnectionEntity"] = "PostHogOrganizationConnectionEntity";
|
|
618
619
|
EntityTypeName["PostHogProjectEntity"] = "PostHogProjectEntity";
|
|
620
|
+
EntityTypeName["SupabaseConnectionEntity"] = "SupabaseConnectionEntity";
|
|
621
|
+
EntityTypeName["SupabaseProjectEntity"] = "SupabaseProjectEntity";
|
|
619
622
|
EntityTypeName["UserInvitationEntity"] = "UserInvitationEntity";
|
|
620
623
|
EntityTypeName["UserPermissionEntity"] = "UserPermissionEntity";
|
|
621
624
|
EntityTypeName["VexoAccountConnectionEntity"] = "VexoAccountConnectionEntity";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { CreateAndroidSubmissionInput, CreateIosSubmissionInput, SubmissionFragment } from '../generated';
|
|
2
|
+
import { CreateAndroidSubmissionInput, CreateIosSubmissionInput, Submission, SubmissionFragment } from '../generated';
|
|
3
3
|
export declare const SubmissionMutation: {
|
|
4
4
|
createAndroidSubmissionAsync(graphqlClient: ExpoGraphqlClient, input: CreateAndroidSubmissionInput): Promise<SubmissionFragment>;
|
|
5
5
|
createIosSubmissionAsync(graphqlClient: ExpoGraphqlClient, input: CreateIosSubmissionInput): Promise<SubmissionFragment>;
|
|
6
|
+
cancelSubmissionAsync(graphqlClient: ExpoGraphqlClient, submissionId: string): Promise<Pick<Submission, "id" | "status">>;
|
|
7
|
+
retrySubmissionAsync(graphqlClient: ExpoGraphqlClient, parentSubmissionId: string): Promise<SubmissionFragment>;
|
|
6
8
|
};
|
|
@@ -68,4 +68,37 @@ exports.SubmissionMutation = {
|
|
|
68
68
|
.toPromise());
|
|
69
69
|
return (0, nullthrows_1.default)(data.submission.createIosSubmission.submission);
|
|
70
70
|
},
|
|
71
|
+
async cancelSubmissionAsync(graphqlClient, submissionId) {
|
|
72
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
73
|
+
.mutation((0, graphql_tag_1.default) `
|
|
74
|
+
mutation CancelSubmissionMutation($submissionId: ID!) {
|
|
75
|
+
submission {
|
|
76
|
+
cancelSubmission(submissionId: $submissionId) {
|
|
77
|
+
id
|
|
78
|
+
status
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`, { submissionId })
|
|
83
|
+
.toPromise());
|
|
84
|
+
return data.submission.cancelSubmission;
|
|
85
|
+
},
|
|
86
|
+
async retrySubmissionAsync(graphqlClient, parentSubmissionId) {
|
|
87
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
88
|
+
.mutation((0, graphql_tag_1.default) `
|
|
89
|
+
mutation RetrySubmissionMutation($parentSubmissionId: ID!) {
|
|
90
|
+
submission {
|
|
91
|
+
retrySubmission(parentSubmissionId: $parentSubmissionId) {
|
|
92
|
+
submission {
|
|
93
|
+
id
|
|
94
|
+
...SubmissionFragment
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
${(0, graphql_1.print)(Submission_1.SubmissionFragmentNode)}
|
|
100
|
+
`, { parentSubmissionId })
|
|
101
|
+
.toPromise());
|
|
102
|
+
return (0, nullthrows_1.default)(data.submission.retrySubmission.submission);
|
|
103
|
+
},
|
|
71
104
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AppPlatform, SubmissionFragment, SubmissionStatus } from '../generated';
|
|
2
|
+
import { AppPlatform, SubmissionFragment, SubmissionStatus, SubmissionWithSubmittedBuildFragment } from '../generated';
|
|
3
3
|
type Filters = {
|
|
4
4
|
platform?: AppPlatform;
|
|
5
5
|
status?: SubmissionStatus;
|
|
@@ -10,6 +10,7 @@ export declare const SubmissionQuery: {
|
|
|
10
10
|
byIdAsync(graphqlClient: ExpoGraphqlClient, submissionId: string, { useCache }?: {
|
|
11
11
|
useCache?: boolean;
|
|
12
12
|
}): Promise<SubmissionFragment>;
|
|
13
|
-
|
|
13
|
+
byIdWithSubmittedBuildAsync(graphqlClient: ExpoGraphqlClient, submissionId: string): Promise<SubmissionWithSubmittedBuildFragment>;
|
|
14
|
+
allForAppAsync(graphqlClient: ExpoGraphqlClient, appId: string, { limit, offset, status, platform }: Filters): Promise<SubmissionWithSubmittedBuildFragment[]>;
|
|
14
15
|
};
|
|
15
16
|
export {};
|
|
@@ -6,6 +6,7 @@ const graphql_1 = require("graphql");
|
|
|
6
6
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
7
|
const client_1 = require("../client");
|
|
8
8
|
const Submission_1 = require("../types/Submission");
|
|
9
|
+
const SubmissionWithSubmittedBuild_1 = require("../types/SubmissionWithSubmittedBuild");
|
|
9
10
|
exports.SubmissionQuery = {
|
|
10
11
|
async byIdAsync(graphqlClient, submissionId, { useCache = true } = {}) {
|
|
11
12
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
@@ -26,6 +27,22 @@ exports.SubmissionQuery = {
|
|
|
26
27
|
.toPromise());
|
|
27
28
|
return data.submissions.byId;
|
|
28
29
|
},
|
|
30
|
+
async byIdWithSubmittedBuildAsync(graphqlClient, submissionId) {
|
|
31
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
32
|
+
.query((0, graphql_tag_1.default) `
|
|
33
|
+
query SubmissionByIdWithSubmittedBuildQuery($submissionId: ID!) {
|
|
34
|
+
submissions {
|
|
35
|
+
byId(submissionId: $submissionId) {
|
|
36
|
+
id
|
|
37
|
+
...SubmissionWithSubmittedBuildFragment
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
${(0, graphql_1.print)(SubmissionWithSubmittedBuild_1.SubmissionWithSubmittedBuildFragmentNode)}
|
|
42
|
+
`, { submissionId }, { additionalTypenames: ['Submission'] })
|
|
43
|
+
.toPromise());
|
|
44
|
+
return data.submissions.byId;
|
|
45
|
+
},
|
|
29
46
|
async allForAppAsync(graphqlClient, appId, { limit = 10, offset = 0, status, platform }) {
|
|
30
47
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
31
48
|
.query((0, graphql_tag_1.default) `
|
|
@@ -45,12 +62,12 @@ exports.SubmissionQuery = {
|
|
|
45
62
|
limit: $limit
|
|
46
63
|
) {
|
|
47
64
|
id
|
|
48
|
-
...
|
|
65
|
+
...SubmissionWithSubmittedBuildFragment
|
|
49
66
|
}
|
|
50
67
|
}
|
|
51
68
|
}
|
|
52
69
|
}
|
|
53
|
-
${(0, graphql_1.print)(
|
|
70
|
+
${(0, graphql_1.print)(SubmissionWithSubmittedBuild_1.SubmissionWithSubmittedBuildFragmentNode)}
|
|
54
71
|
`, { appId, offset, limit, status, platform }, { additionalTypenames: ['Submission'] })
|
|
55
72
|
.toPromise());
|
|
56
73
|
return data.app?.byId.submissions ?? [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SubmissionWithSubmittedBuildFragmentNode: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubmissionWithSubmittedBuildFragmentNode = 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 Build_1 = require("./Build");
|
|
8
|
+
const Submission_1 = require("./Submission");
|
|
9
|
+
exports.SubmissionWithSubmittedBuildFragmentNode = (0, graphql_tag_1.default) `
|
|
10
|
+
${(0, graphql_1.print)(Build_1.BuildFragmentNode)}
|
|
11
|
+
${(0, graphql_1.print)(Submission_1.SubmissionFragmentNode)}
|
|
12
|
+
|
|
13
|
+
fragment SubmissionWithSubmittedBuildFragment on Submission {
|
|
14
|
+
id
|
|
15
|
+
...SubmissionFragment
|
|
16
|
+
createdAt
|
|
17
|
+
completedAt
|
|
18
|
+
canRetry
|
|
19
|
+
maxRetryTimeMinutes
|
|
20
|
+
submittedBuild {
|
|
21
|
+
id
|
|
22
|
+
...BuildFragment
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { DeviceRunSessionByIdQuery, DeviceRunSessionType } from '../graphql/generated';
|
|
2
2
|
type DeviceRunSessionByIdResult = DeviceRunSessionByIdQuery['deviceRunSessions']['byId'];
|
|
3
3
|
export type DeviceRunSessionRemoteConfig = NonNullable<DeviceRunSessionByIdResult['remoteConfig']>;
|
|
4
|
+
/** Landing page where accounts without access can request it. */
|
|
5
|
+
export declare const EAS_SIMULATOR_WAITLIST_URL = "https://expo.dev/services/simulators";
|
|
6
|
+
/**
|
|
7
|
+
* Message shown when EAS Simulator is not enabled for the account. Shared by every
|
|
8
|
+
* command that can hit the gate so users always get the same waitlist pointer.
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatSimulatorUnavailableMessage(accountName: string): string;
|
|
4
11
|
export declare const DEVICE_RUN_SESSION_TYPE_FLAG_VALUES: Record<DeviceRunSessionType, string>;
|
|
5
12
|
export declare const DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE: Record<string, DeviceRunSessionType>;
|
|
6
13
|
export declare function deviceRunSessionTypeToFlagValue(type: DeviceRunSessionType): string;
|
package/build/simulator/utils.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = void 0;
|
|
3
|
+
exports.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = exports.EAS_SIMULATOR_WAITLIST_URL = void 0;
|
|
4
|
+
exports.formatSimulatorUnavailableMessage = formatSimulatorUnavailableMessage;
|
|
4
5
|
exports.deviceRunSessionTypeToFlagValue = deviceRunSessionTypeToFlagValue;
|
|
5
6
|
exports.getRemoteSessionEnvironmentVariables = getRemoteSessionEnvironmentVariables;
|
|
6
7
|
exports.formatRemoteSessionInstructions = formatRemoteSessionInstructions;
|
|
7
8
|
const generated_1 = require("../graphql/generated");
|
|
9
|
+
const log_1 = require("../log");
|
|
10
|
+
/** Landing page where accounts without access can request it. */
|
|
11
|
+
exports.EAS_SIMULATOR_WAITLIST_URL = 'https://expo.dev/services/simulators';
|
|
12
|
+
/**
|
|
13
|
+
* Message shown when EAS Simulator is not enabled for the account. Shared by every
|
|
14
|
+
* command that can hit the gate so users always get the same waitlist pointer.
|
|
15
|
+
*/
|
|
16
|
+
function formatSimulatorUnavailableMessage(accountName) {
|
|
17
|
+
return [
|
|
18
|
+
`EAS Simulator isn't available on ${accountName} yet — it's coming soon.`,
|
|
19
|
+
`Join the waitlist to get access: ${(0, log_1.link)(exports.EAS_SIMULATOR_WAITLIST_URL)}`,
|
|
20
|
+
].join('\n');
|
|
21
|
+
}
|
|
8
22
|
// Mapping enum -> CLI flag value. Declared as Record<DeviceRunSessionType, string>
|
|
9
23
|
// so adding a new enum value in codegen fails the build until it is wired up here.
|
|
10
24
|
exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
|
3
|
+
import { AppPlatform, SubmissionStatus, SubmissionWithSubmittedBuildFragment } from '../graphql/generated';
|
|
4
|
+
export declare const SUBMISSIONS_LIMIT = 50;
|
|
5
|
+
export type SubmissionFilter = {
|
|
6
|
+
platform?: AppPlatform;
|
|
7
|
+
status?: SubmissionStatus;
|
|
8
|
+
};
|
|
9
|
+
export declare function listAndRenderSubmissionsOnAppAsync(graphqlClient: ExpoGraphqlClient, { projectId, projectDisplayName, filter, paginatedQueryOptions, }: {
|
|
10
|
+
projectId: string;
|
|
11
|
+
projectDisplayName: string;
|
|
12
|
+
filter?: SubmissionFilter;
|
|
13
|
+
paginatedQueryOptions: PaginatedQueryOptions;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
export declare function getLatestSubmissionAsync(graphqlClient: ExpoGraphqlClient, { projectId, filter, }: {
|
|
16
|
+
projectId: string;
|
|
17
|
+
filter?: SubmissionFilter;
|
|
18
|
+
}): Promise<SubmissionWithSubmittedBuildFragment | null>;
|
|
19
|
+
export declare function getRecentSubmissionsAsync(graphqlClient: ExpoGraphqlClient, { projectId, filter, limit, }: {
|
|
20
|
+
projectId: string;
|
|
21
|
+
filter?: SubmissionFilter;
|
|
22
|
+
limit?: number;
|
|
23
|
+
}): Promise<SubmissionWithSubmittedBuildFragment[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Fetch a page per status and merge, newest first. The GraphQL filter takes a single status;
|
|
26
|
+
* fetching one unfiltered page instead would let recent finished submissions push older
|
|
27
|
+
* still-active ones off the page.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getRecentSubmissionsWithStatusesAsync(graphqlClient: ExpoGraphqlClient, { projectId, platform, statuses, }: {
|
|
30
|
+
projectId: string;
|
|
31
|
+
platform?: AppPlatform;
|
|
32
|
+
statuses: SubmissionStatus[];
|
|
33
|
+
}): Promise<SubmissionWithSubmittedBuildFragment[]>;
|
|
34
|
+
export declare function formatSubmissionChoice(submission: SubmissionWithSubmittedBuildFragment): string;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUBMISSIONS_LIMIT = void 0;
|
|
4
|
+
exports.listAndRenderSubmissionsOnAppAsync = listAndRenderSubmissionsOnAppAsync;
|
|
5
|
+
exports.getLatestSubmissionAsync = getLatestSubmissionAsync;
|
|
6
|
+
exports.getRecentSubmissionsAsync = getRecentSubmissionsAsync;
|
|
7
|
+
exports.getRecentSubmissionsWithStatusesAsync = getRecentSubmissionsWithStatusesAsync;
|
|
8
|
+
exports.formatSubmissionChoice = formatSubmissionChoice;
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
11
|
+
const formatSubmission_1 = require("./utils/formatSubmission");
|
|
12
|
+
const SubmissionQuery_1 = require("../graphql/queries/SubmissionQuery");
|
|
13
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
14
|
+
const platform_1 = require("../platform");
|
|
15
|
+
const date_1 = require("../utils/date");
|
|
16
|
+
const json_1 = require("../utils/json");
|
|
17
|
+
const queries_1 = require("../utils/queries");
|
|
18
|
+
exports.SUBMISSIONS_LIMIT = 50;
|
|
19
|
+
async function listAndRenderSubmissionsOnAppAsync(graphqlClient, { projectId, projectDisplayName, filter, paginatedQueryOptions, }) {
|
|
20
|
+
if (paginatedQueryOptions.nonInteractive) {
|
|
21
|
+
const submissions = await SubmissionQuery_1.SubmissionQuery.allForAppAsync(graphqlClient, projectId, {
|
|
22
|
+
limit: paginatedQueryOptions.limit ?? exports.SUBMISSIONS_LIMIT,
|
|
23
|
+
offset: paginatedQueryOptions.offset,
|
|
24
|
+
...filter,
|
|
25
|
+
});
|
|
26
|
+
renderPageOfSubmissions({ submissions, projectDisplayName, paginatedQueryOptions });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
await (0, queries_1.paginatedQueryWithConfirmPromptAsync)({
|
|
30
|
+
limit: paginatedQueryOptions.limit ?? exports.SUBMISSIONS_LIMIT,
|
|
31
|
+
offset: paginatedQueryOptions.offset,
|
|
32
|
+
queryToPerform: (limit, offset) => SubmissionQuery_1.SubmissionQuery.allForAppAsync(graphqlClient, projectId, {
|
|
33
|
+
limit,
|
|
34
|
+
offset,
|
|
35
|
+
...filter,
|
|
36
|
+
}),
|
|
37
|
+
promptOptions: {
|
|
38
|
+
title: 'Load more submissions?',
|
|
39
|
+
renderListItems: submissions => {
|
|
40
|
+
renderPageOfSubmissions({ submissions, projectDisplayName, paginatedQueryOptions });
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function getLatestSubmissionAsync(graphqlClient, { projectId, filter, }) {
|
|
47
|
+
const submissions = await SubmissionQuery_1.SubmissionQuery.allForAppAsync(graphqlClient, projectId, {
|
|
48
|
+
limit: 1,
|
|
49
|
+
offset: 0,
|
|
50
|
+
...filter,
|
|
51
|
+
});
|
|
52
|
+
return submissions[0] ?? null;
|
|
53
|
+
}
|
|
54
|
+
async function getRecentSubmissionsAsync(graphqlClient, { projectId, filter, limit = exports.SUBMISSIONS_LIMIT, }) {
|
|
55
|
+
return await SubmissionQuery_1.SubmissionQuery.allForAppAsync(graphqlClient, projectId, {
|
|
56
|
+
limit,
|
|
57
|
+
offset: 0,
|
|
58
|
+
...filter,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Fetch a page per status and merge, newest first. The GraphQL filter takes a single status;
|
|
63
|
+
* fetching one unfiltered page instead would let recent finished submissions push older
|
|
64
|
+
* still-active ones off the page.
|
|
65
|
+
*/
|
|
66
|
+
async function getRecentSubmissionsWithStatusesAsync(graphqlClient, { projectId, platform, statuses, }) {
|
|
67
|
+
const pages = await Promise.all(statuses.map(status => SubmissionQuery_1.SubmissionQuery.allForAppAsync(graphqlClient, projectId, {
|
|
68
|
+
limit: exports.SUBMISSIONS_LIMIT,
|
|
69
|
+
offset: 0,
|
|
70
|
+
platform,
|
|
71
|
+
status,
|
|
72
|
+
})));
|
|
73
|
+
return pages
|
|
74
|
+
.flat()
|
|
75
|
+
.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
76
|
+
}
|
|
77
|
+
function formatSubmissionChoice(submission) {
|
|
78
|
+
const platform = platform_1.appPlatformDisplayNames[submission.platform];
|
|
79
|
+
const status = submission.status.toLowerCase().replace(/_/g, ' ');
|
|
80
|
+
return `${platform} submission ${submission.id} (${status}, created ${(0, date_1.fromNow)(new Date(submission.createdAt))} ago)`;
|
|
81
|
+
}
|
|
82
|
+
function renderPageOfSubmissions({ submissions, projectDisplayName, paginatedQueryOptions, }) {
|
|
83
|
+
if (paginatedQueryOptions.json) {
|
|
84
|
+
(0, json_1.printJsonOnlyOutput)(submissions);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const list = submissions
|
|
88
|
+
.map(submission => (0, formatSubmission_1.formatGraphQLSubmission)(submission))
|
|
89
|
+
.join(`\n\n${chalk_1.default.dim('———')}\n\n`);
|
|
90
|
+
log_1.default.addNewLineIfNone();
|
|
91
|
+
log_1.default.log(chalk_1.default.bold(`Submissions for ${projectDisplayName}:`));
|
|
92
|
+
log_1.default.log(`\n${list}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { App } from '@expo/apple-utils';
|
|
2
|
+
import { SubmissionWithSubmittedBuildFragment } from '../graphql/generated';
|
|
3
|
+
export type EasBuildLinkage = {
|
|
4
|
+
easSubmissionId: string | null;
|
|
5
|
+
easBuildId: string | null;
|
|
6
|
+
runtimeVersion: string | null;
|
|
7
|
+
fingerprintHash: string | null;
|
|
8
|
+
};
|
|
9
|
+
export type IosStoreVersionStatus = EasBuildLinkage & {
|
|
10
|
+
versionString: string;
|
|
11
|
+
buildNumber: string | null;
|
|
12
|
+
state: string | null;
|
|
13
|
+
};
|
|
14
|
+
export type IosTestFlightBuildStatus = EasBuildLinkage & {
|
|
15
|
+
appVersion: string | null;
|
|
16
|
+
buildNumber: string;
|
|
17
|
+
processingState: string;
|
|
18
|
+
internalState: string | null;
|
|
19
|
+
externalState: string | null;
|
|
20
|
+
uploadedDate: string;
|
|
21
|
+
expired: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type IosStoreStatus = {
|
|
24
|
+
ascAppIdentifier: string;
|
|
25
|
+
live: IosStoreVersionStatus | null;
|
|
26
|
+
inReview: IosStoreVersionStatus | null;
|
|
27
|
+
pendingRelease: IosStoreVersionStatus | null;
|
|
28
|
+
testFlightBuilds: IosTestFlightBuildStatus[];
|
|
29
|
+
};
|
|
30
|
+
export declare function getIosStoreStatusAsync(app: App, easSubmissions: SubmissionWithSubmittedBuildFragment[]): Promise<IosStoreStatus>;
|
|
31
|
+
export declare function renderIosStoreStatus(status: IosStoreStatus, easSubmissions: SubmissionWithSubmittedBuildFragment[]): void;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIosStoreStatusAsync = getIosStoreStatusAsync;
|
|
4
|
+
exports.renderIosStoreStatus = renderIosStoreStatus;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const apple_utils_1 = require("@expo/apple-utils");
|
|
7
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const urls_1 = require("./utils/urls");
|
|
9
|
+
const log_1 = tslib_1.__importStar(require("../log"));
|
|
10
|
+
const date_1 = require("../utils/date");
|
|
11
|
+
const formatFields_1 = tslib_1.__importDefault(require("../utils/formatFields"));
|
|
12
|
+
const terminalText_1 = require("../utils/terminalText");
|
|
13
|
+
const TESTFLIGHT_BUILDS_LIMIT = 5;
|
|
14
|
+
async function getIosStoreStatusAsync(app, easSubmissions) {
|
|
15
|
+
const [live, inReview, pendingRelease, builds] = await Promise.all([
|
|
16
|
+
app.getLiveAppStoreVersionAsync({ platform: apple_utils_1.Platform.IOS }),
|
|
17
|
+
app.getInReviewAppStoreVersionAsync({ platform: apple_utils_1.Platform.IOS }),
|
|
18
|
+
app.getPendingReleaseAppStoreVersionAsync({ platform: apple_utils_1.Platform.IOS }),
|
|
19
|
+
apple_utils_1.Build.getAsync(app.context, {
|
|
20
|
+
query: {
|
|
21
|
+
filter: { app: app.id },
|
|
22
|
+
sort: '-uploadedDate',
|
|
23
|
+
limit: TESTFLIGHT_BUILDS_LIMIT,
|
|
24
|
+
includes: ['buildBetaDetail', 'preReleaseVersion'],
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
]);
|
|
28
|
+
return {
|
|
29
|
+
ascAppIdentifier: app.id,
|
|
30
|
+
live: await toStoreVersionStatusAsync(live, easSubmissions),
|
|
31
|
+
inReview: await toStoreVersionStatusAsync(inReview, easSubmissions),
|
|
32
|
+
pendingRelease: await toStoreVersionStatusAsync(pendingRelease, easSubmissions),
|
|
33
|
+
// The ASC limit param only caps the page size and the client auto-paginates, so cap here too.
|
|
34
|
+
testFlightBuilds: builds
|
|
35
|
+
.slice(0, TESTFLIGHT_BUILDS_LIMIT)
|
|
36
|
+
.map(build => toTestFlightBuildStatus(build, easSubmissions)),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async function toStoreVersionStatusAsync(version, easSubmissions) {
|
|
40
|
+
if (!version) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const build = await version.getBuildAsync();
|
|
44
|
+
const buildNumber = build?.attributes.version ?? null;
|
|
45
|
+
const easSubmission = buildNumber
|
|
46
|
+
? findEasSubmissionByBuildNumber(easSubmissions, buildNumber, version.attributes.versionString)
|
|
47
|
+
: null;
|
|
48
|
+
// Values stay raw here so --json reports exactly what the APIs returned; the render
|
|
49
|
+
// functions sanitize at print time.
|
|
50
|
+
return {
|
|
51
|
+
versionString: version.attributes.versionString,
|
|
52
|
+
buildNumber,
|
|
53
|
+
state: version.attributes.appVersionState ?? version.attributes.appStoreState ?? null,
|
|
54
|
+
...toEasBuildLinkage(easSubmission),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function toEasBuildLinkage(easSubmission) {
|
|
58
|
+
return {
|
|
59
|
+
easSubmissionId: easSubmission?.id ?? null,
|
|
60
|
+
easBuildId: easSubmission?.submittedBuild?.id ?? null,
|
|
61
|
+
runtimeVersion: easSubmission?.submittedBuild?.runtimeVersion ?? null,
|
|
62
|
+
fingerprintHash: easSubmission?.submittedBuild?.fingerprint?.hash ?? null,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function toTestFlightBuildStatus(build, easSubmissions) {
|
|
66
|
+
const buildNumber = build.attributes.version;
|
|
67
|
+
const appVersion = build.attributes.preReleaseVersion?.attributes.version ?? null;
|
|
68
|
+
const easSubmission = findEasSubmissionByBuildNumber(easSubmissions, buildNumber, appVersion);
|
|
69
|
+
return {
|
|
70
|
+
appVersion,
|
|
71
|
+
buildNumber,
|
|
72
|
+
processingState: build.attributes.processingState,
|
|
73
|
+
internalState: build.attributes.buildBetaDetail?.attributes.internalBuildState ?? null,
|
|
74
|
+
externalState: build.attributes.buildBetaDetail?.attributes.externalBuildState ?? null,
|
|
75
|
+
uploadedDate: build.attributes.uploadedDate,
|
|
76
|
+
expired: build.attributes.expired,
|
|
77
|
+
...toEasBuildLinkage(easSubmission),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function findEasSubmissionByBuildNumber(easSubmissions, buildNumber, appVersion) {
|
|
81
|
+
return (easSubmissions.find(submission => submission.submittedBuild?.appBuildVersion === buildNumber &&
|
|
82
|
+
(!appVersion || submission.submittedBuild?.appVersion === appVersion)) ?? null);
|
|
83
|
+
}
|
|
84
|
+
function renderIosStoreStatus(status, easSubmissions) {
|
|
85
|
+
log_1.default.addNewLineIfNone();
|
|
86
|
+
log_1.default.log(chalk_1.default.bold('iOS — App Store Connect'));
|
|
87
|
+
log_1.default.newLine();
|
|
88
|
+
log_1.default.log(chalk_1.default.bold('App Store'));
|
|
89
|
+
renderStoreVersion('Live', status.live, easSubmissions);
|
|
90
|
+
renderStoreVersion('In review', status.inReview, easSubmissions);
|
|
91
|
+
renderStoreVersion('Pending release', status.pendingRelease, easSubmissions);
|
|
92
|
+
log_1.default.newLine();
|
|
93
|
+
log_1.default.log(chalk_1.default.bold('TestFlight (latest uploads)'));
|
|
94
|
+
if (status.testFlightBuilds.length === 0) {
|
|
95
|
+
log_1.default.log(chalk_1.default.dim(' No builds found.'));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
for (const build of status.testFlightBuilds) {
|
|
99
|
+
const version = (0, terminalText_1.sanitizeTerminalText)(`${build.appVersion ?? '?'} (${build.buildNumber})`);
|
|
100
|
+
const states = [];
|
|
101
|
+
if (build.expired) {
|
|
102
|
+
states.push(chalk_1.default.gray('expired'));
|
|
103
|
+
}
|
|
104
|
+
else if (build.processingState !== 'VALID') {
|
|
105
|
+
states.push(chalk_1.default.yellow(build.processingState.toLowerCase()));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
if (build.internalState) {
|
|
109
|
+
states.push(`internal: ${formatBetaState(build.internalState)}`);
|
|
110
|
+
}
|
|
111
|
+
if (build.externalState) {
|
|
112
|
+
states.push(`external: ${formatBetaState(build.externalState)}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const uploaded = `uploaded ${(0, date_1.fromNow)(new Date(build.uploadedDate))} ago`;
|
|
116
|
+
log_1.default.log(` ${chalk_1.default.bold(version)} — ${states.join(', ')} — ${uploaded}`);
|
|
117
|
+
logEasLinkage(build, easSubmissions);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function renderStoreVersion(label, version, easSubmissions) {
|
|
121
|
+
if (!version) {
|
|
122
|
+
log_1.default.log(` ${chalk_1.default.dim(`${label}: none`)}`);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const versionText = (0, terminalText_1.sanitizeTerminalText)(version.buildNumber
|
|
126
|
+
? `${version.versionString} (${version.buildNumber})`
|
|
127
|
+
: version.versionString);
|
|
128
|
+
const state = version.state ? formatStoreState(version.state) : '';
|
|
129
|
+
log_1.default.log(` ${label}: ${chalk_1.default.bold(versionText)}${state ? ` — ${state}` : ''}`);
|
|
130
|
+
logEasLinkage(version, easSubmissions);
|
|
131
|
+
}
|
|
132
|
+
function logEasLinkage(linkage, easSubmissions) {
|
|
133
|
+
if (!linkage.easSubmissionId) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const submission = easSubmissions.find(s => s.id === linkage.easSubmissionId);
|
|
137
|
+
const fields = [
|
|
138
|
+
{
|
|
139
|
+
label: 'EAS Submission',
|
|
140
|
+
value: submission ? (0, log_1.link)((0, urls_1.getSubmissionDetailsUrl)(submission)) : linkage.easSubmissionId,
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
if (linkage.easBuildId) {
|
|
144
|
+
fields.push({ label: 'EAS Build ID', value: linkage.easBuildId });
|
|
145
|
+
}
|
|
146
|
+
if (linkage.runtimeVersion) {
|
|
147
|
+
fields.push({ label: 'Runtime Version', value: (0, terminalText_1.sanitizeTerminalText)(linkage.runtimeVersion) });
|
|
148
|
+
}
|
|
149
|
+
if (linkage.fingerprintHash) {
|
|
150
|
+
fields.push({ label: 'Fingerprint', value: linkage.fingerprintHash });
|
|
151
|
+
}
|
|
152
|
+
log_1.default.log((0, formatFields_1.default)(fields)
|
|
153
|
+
.split('\n')
|
|
154
|
+
.map(line => ` ${line}`)
|
|
155
|
+
.join('\n'));
|
|
156
|
+
}
|
|
157
|
+
function formatStoreState(state) {
|
|
158
|
+
const lower = state.toLowerCase().replace(/_/g, ' ');
|
|
159
|
+
switch (state) {
|
|
160
|
+
case 'READY_FOR_SALE':
|
|
161
|
+
case 'READY_FOR_DISTRIBUTION':
|
|
162
|
+
return chalk_1.default.green(lower);
|
|
163
|
+
case 'REJECTED':
|
|
164
|
+
case 'METADATA_REJECTED':
|
|
165
|
+
case 'DEVELOPER_REJECTED':
|
|
166
|
+
case 'INVALID_BINARY':
|
|
167
|
+
return chalk_1.default.red(lower);
|
|
168
|
+
default:
|
|
169
|
+
return chalk_1.default.blue(lower);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function formatBetaState(state) {
|
|
173
|
+
const lower = state.toLowerCase().replace(/_/g, ' ');
|
|
174
|
+
switch (state) {
|
|
175
|
+
case 'IN_BETA_TESTING':
|
|
176
|
+
case 'BETA_APPROVED':
|
|
177
|
+
return chalk_1.default.green(lower);
|
|
178
|
+
case 'BETA_REJECTED':
|
|
179
|
+
case 'PROCESSING_EXCEPTION':
|
|
180
|
+
case 'MISSING_EXPORT_COMPLIANCE':
|
|
181
|
+
return chalk_1.default.red(lower);
|
|
182
|
+
case 'EXPIRED':
|
|
183
|
+
return chalk_1.default.gray(lower);
|
|
184
|
+
default:
|
|
185
|
+
return chalk_1.default.blue(lower);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatGraphQLSubmission = formatGraphQLSubmission;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const urls_1 = require("./urls");
|
|
7
|
+
const generated_1 = require("../../graphql/generated");
|
|
8
|
+
const log_1 = require("../../log");
|
|
9
|
+
const platform_1 = require("../../platform");
|
|
10
|
+
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
11
|
+
const terminalText_1 = require("../../utils/terminalText");
|
|
12
|
+
// Submission and build fields carry project-controlled text (versions, profiles, error
|
|
13
|
+
// messages); strip control characters so a crafted value cannot spoof terminal output.
|
|
14
|
+
const sanitize = (value) => value == null ? value : (0, terminalText_1.sanitizeTerminalText)(value);
|
|
15
|
+
function formatGraphQLSubmission(submission) {
|
|
16
|
+
const { submittedBuild } = submission;
|
|
17
|
+
const fields = [
|
|
18
|
+
{ label: 'ID', value: submission.id },
|
|
19
|
+
{
|
|
20
|
+
label: 'Platform',
|
|
21
|
+
value: platform_1.appPlatformDisplayNames[submission.platform],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Status',
|
|
25
|
+
get value() {
|
|
26
|
+
switch (submission.status) {
|
|
27
|
+
case generated_1.SubmissionStatus.AwaitingBuild:
|
|
28
|
+
return chalk_1.default.blue('awaiting build');
|
|
29
|
+
case generated_1.SubmissionStatus.InQueue:
|
|
30
|
+
return chalk_1.default.blue('in queue');
|
|
31
|
+
case generated_1.SubmissionStatus.InProgress:
|
|
32
|
+
return chalk_1.default.blue('in progress');
|
|
33
|
+
case generated_1.SubmissionStatus.Finished:
|
|
34
|
+
return chalk_1.default.green('finished');
|
|
35
|
+
case generated_1.SubmissionStatus.Errored:
|
|
36
|
+
return chalk_1.default.red('errored');
|
|
37
|
+
case generated_1.SubmissionStatus.Canceled:
|
|
38
|
+
return chalk_1.default.gray('canceled');
|
|
39
|
+
default:
|
|
40
|
+
return 'unknown';
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
...(submission.platform === generated_1.AppPlatform.Android
|
|
45
|
+
? [
|
|
46
|
+
{
|
|
47
|
+
label: 'Application Identifier',
|
|
48
|
+
value: sanitize(submission.androidConfig?.applicationIdentifier),
|
|
49
|
+
},
|
|
50
|
+
{ label: 'Track', value: sanitize(submission.androidConfig?.track)?.toLowerCase() },
|
|
51
|
+
{
|
|
52
|
+
label: 'Release Status',
|
|
53
|
+
value: submission.androidConfig?.releaseStatus?.toLowerCase(),
|
|
54
|
+
},
|
|
55
|
+
]
|
|
56
|
+
: [{ label: 'ASC App ID', value: sanitize(submission.iosConfig?.ascAppIdentifier) }]),
|
|
57
|
+
{ label: 'Build ID', value: submittedBuild?.id },
|
|
58
|
+
{ label: 'Build Profile', value: sanitize(submittedBuild?.buildProfile) },
|
|
59
|
+
{ label: 'App Version', value: sanitize(submittedBuild?.appVersion) },
|
|
60
|
+
{
|
|
61
|
+
label: submission.platform === generated_1.AppPlatform.Android ? 'Version code' : 'Build number',
|
|
62
|
+
value: sanitize(submittedBuild?.appBuildVersion),
|
|
63
|
+
},
|
|
64
|
+
{ label: 'Runtime Version', value: sanitize(submittedBuild?.runtimeVersion) },
|
|
65
|
+
{ label: 'Fingerprint', value: submittedBuild?.fingerprint?.hash },
|
|
66
|
+
{ label: 'Commit', value: sanitize(submittedBuild?.gitCommitHash) },
|
|
67
|
+
{ label: 'Error Code', value: sanitize(submission.error?.errorCode) },
|
|
68
|
+
{ label: 'Error Message', value: sanitize(submission.error?.message) },
|
|
69
|
+
{ label: 'Started at', value: new Date(submission.createdAt).toLocaleString() },
|
|
70
|
+
{
|
|
71
|
+
label: 'Finished at',
|
|
72
|
+
value: submission.completedAt ? new Date(submission.completedAt).toLocaleString() : null,
|
|
73
|
+
},
|
|
74
|
+
{ label: 'Submission Details', value: (0, log_1.link)((0, urls_1.getSubmissionDetailsUrl)(submission)) },
|
|
75
|
+
];
|
|
76
|
+
const filteredFields = fields.filter(({ value }) => value !== undefined && value !== null);
|
|
77
|
+
return (0, formatFields_1.default)(filteredFields);
|
|
78
|
+
}
|
package/build/utils/promise.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Returns a promise that will be resolved after given ms milliseconds.
|
|
3
3
|
*
|
|
4
4
|
* @param ms A number of milliseconds to sleep.
|
|
5
|
-
* @
|
|
5
|
+
* @param signal An optional signal that resolves the sleep early when aborted.
|
|
6
|
+
* @returns A promise that resolves after the provided number of milliseconds or when aborted.
|
|
6
7
|
*/
|
|
7
|
-
export declare function sleepAsync(ms: number): Promise<void>;
|
|
8
|
+
export declare function sleepAsync(ms: number, signal?: AbortSignal): Promise<void>;
|