eas-cli 3.18.0 → 3.18.2
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 +55 -55
- package/build/branch/actions/SelectBranch.d.ts +33 -0
- package/build/branch/actions/SelectBranch.js +67 -0
- package/build/build/local.js +1 -1
- package/build/build/runBuildAndSubmit.js +0 -2
- package/build/channel/actions/SelectChannel.d.ts +16 -0
- package/build/channel/actions/SelectChannel.js +42 -24
- package/build/channel/branch-mapping.d.ts +17 -1
- package/build/channel/branch-mapping.js +48 -7
- package/build/channel/queries.d.ts +1 -6
- package/build/channel/queries.js +1 -25
- package/build/commands/build/version/get.js +0 -1
- package/build/commands/build/version/sync.js +0 -1
- package/build/commands/channel/rollout-preview.d.ts +32 -0
- package/build/commands/channel/rollout-preview.js +109 -0
- package/build/commands/metadata/lint.js +0 -1
- package/build/commands/metadata/pull.js +0 -1
- package/build/commands/metadata/push.js +0 -1
- package/build/commands/submit.js +0 -1
- package/build/commands/update/republish.js +23 -74
- package/build/graphql/generated.d.ts +192 -18
- package/build/graphql/generated.js +8 -2
- package/build/graphql/queries/BranchQuery.d.ts +3 -2
- package/build/graphql/queries/BranchQuery.js +43 -1
- package/build/graphql/queries/ChannelQuery.d.ts +3 -2
- package/build/graphql/queries/ChannelQuery.js +19 -5
- package/build/graphql/queries/RuntimeQuery.d.ts +6 -0
- package/build/graphql/queries/RuntimeQuery.js +70 -0
- package/build/graphql/types/Runtime.d.ts +1 -0
- package/build/graphql/types/Runtime.js +11 -0
- package/build/graphql/types/UpdateBranch.js +3 -1
- package/build/graphql/types/UpdateBranchBasicInfo.d.ts +1 -0
- package/build/graphql/types/UpdateBranchBasicInfo.js +11 -0
- package/build/metadata/apple/config/reader.js +1 -1
- package/build/rollout/actions/CreateRollout.d.ts +23 -0
- package/build/rollout/actions/CreateRollout.js +153 -0
- package/build/rollout/actions/EditRollout.d.ts +17 -0
- package/build/rollout/actions/EditRollout.js +79 -0
- package/build/rollout/actions/EndRollout.d.ts +24 -0
- package/build/rollout/actions/EndRollout.js +164 -0
- package/build/rollout/actions/ManageRollout.d.ts +24 -0
- package/build/rollout/actions/ManageRollout.js +78 -0
- package/build/rollout/actions/NonInteractiveRollout.d.ts +18 -0
- package/build/rollout/actions/NonInteractiveRollout.js +46 -0
- package/build/rollout/actions/RolloutMainMenu.d.ts +28 -0
- package/build/rollout/actions/RolloutMainMenu.js +110 -0
- package/build/rollout/actions/SelectRollout.js +18 -8
- package/build/rollout/actions/SelectRuntime.d.ts +36 -0
- package/build/rollout/actions/SelectRuntime.js +167 -0
- package/build/rollout/branch-mapping.d.ts +52 -4
- package/build/rollout/branch-mapping.js +68 -19
- package/build/rollout/utils.d.ts +9 -2
- package/build/rollout/utils.js +66 -21
- package/build/update/configure.d.ts +6 -1
- package/build/update/configure.js +18 -8
- package/build/update/republish.d.ts +26 -0
- package/build/update/republish.js +83 -0
- package/build/utils/profiles.d.ts +1 -2
- package/build/utils/profiles.js +3 -35
- package/build/utils/relay.d.ts +80 -15
- package/build/utils/relay.js +211 -28
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
|
@@ -2,48 +2,66 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SelectChannel = void 0;
|
|
4
4
|
const utils_1 = require("../../eas-update/utils");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const ChannelQuery_1 = require("../../graphql/queries/ChannelQuery");
|
|
6
|
+
const relay_1 = require("../../utils/relay");
|
|
7
7
|
/**
|
|
8
8
|
* Select a channel for the project.
|
|
9
9
|
*
|
|
10
10
|
* @constructor
|
|
11
11
|
* @param {function} options.filterPredicate - A predicate to filter the channels that are shown to the user. It takes a channelInfo object as a parameter and returns a boolean.
|
|
12
12
|
* @param {string} options.printedType - The type of channel printed to the user. Defaults to 'channel'.
|
|
13
|
+
* @param {number} options.pageSize - The number of channels to show per page. Defaults to 100.
|
|
14
|
+
* @param {function} options.beforeEachFilterQuery Optional. If a filter predicate was specified, this callback function will be called before each query.
|
|
15
|
+
* @args externalQueryParams The query params for the pagination.
|
|
16
|
+
* @args totalNodesFetched The total number of nodes fetched so far.
|
|
17
|
+
* @args dataset The dataset so far.
|
|
18
|
+
* @param {function} options.afterEachFilterQuery Optional. If a filter predicate was specified, this callback function will be called after each query.
|
|
19
|
+
* @args externalQueryParams The query params for the pagination.
|
|
20
|
+
* @args totalNodesFetched The total number of nodes fetched so far.
|
|
21
|
+
* @args dataset The dataset so far.
|
|
22
|
+
* @args willFetchAgain If the query will fetch again to get a complete page.
|
|
13
23
|
*/
|
|
14
24
|
class SelectChannel {
|
|
15
25
|
constructor(options = {}) {
|
|
16
26
|
this.options = options;
|
|
17
27
|
}
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
const { nonInteractive, graphqlClient, app } = ctx;
|
|
28
|
+
async queryAsync(ctx, queryParams) {
|
|
29
|
+
const { graphqlClient, app } = ctx;
|
|
21
30
|
const { projectId } = app;
|
|
31
|
+
return await ChannelQuery_1.ChannelQuery.viewUpdateChannelsBasicInfoPaginatedOnAppAsync(graphqlClient, {
|
|
32
|
+
appId: projectId,
|
|
33
|
+
...queryParams,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async filterQueryAsync(ctx, queryParams, filterPredicate) {
|
|
37
|
+
const queryAsync = async (queryParams) => await this.queryAsync(ctx, queryParams);
|
|
38
|
+
return await relay_1.FilterPagination.getPageAsync({
|
|
39
|
+
queryParams,
|
|
40
|
+
queryAsync,
|
|
41
|
+
filterPredicate,
|
|
42
|
+
beforeEachQuery: this.options.beforeEachFilterQuery,
|
|
43
|
+
afterEachQuery: this.options.afterEachFilterQuery,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async runAsync(ctx) {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
const { nonInteractive } = ctx;
|
|
22
49
|
const { filterPredicate } = this.options;
|
|
23
50
|
const printedType = (_a = this.options.printedType) !== null && _a !== void 0 ? _a : 'channel';
|
|
51
|
+
const pageSize = (_b = this.options.pageSize) !== null && _b !== void 0 ? _b : 100;
|
|
24
52
|
if (nonInteractive) {
|
|
25
53
|
throw new utils_1.NonInteractiveError(`${printedType} selection cannot be run in non-interactive mode.`);
|
|
26
54
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
const { channel: selectedChannel } = await (0, prompts_1.promptAsync)({
|
|
38
|
-
type: 'select',
|
|
39
|
-
name: 'channel',
|
|
40
|
-
message: `Select a ${printedType}`,
|
|
41
|
-
choices: channels.map(channel => ({
|
|
42
|
-
value: channel,
|
|
43
|
-
title: channel.name,
|
|
44
|
-
})),
|
|
55
|
+
const queryAsync = async (queryParams) => filterPredicate
|
|
56
|
+
? this.filterQueryAsync(ctx, queryParams, filterPredicate)
|
|
57
|
+
: this.queryAsync(ctx, queryParams);
|
|
58
|
+
const getTitleAsync = async (channelInfo) => channelInfo.name;
|
|
59
|
+
return await (0, relay_1.selectPaginatedAsync)({
|
|
60
|
+
queryAsync,
|
|
61
|
+
getTitleAsync,
|
|
62
|
+
printedType,
|
|
63
|
+
pageSize,
|
|
45
64
|
});
|
|
46
|
-
return selectedChannel;
|
|
47
65
|
}
|
|
48
66
|
}
|
|
49
67
|
exports.SelectChannel = SelectChannel;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UpdateChannelBasicInfoFragment } from '../graphql/generated';
|
|
1
2
|
export type BranchMappingOperator = '==' | '!=' | '<' | '>' | '<=' | '>=' | 'in' | 'regex' | 'hash_lt' | 'hash_lte' | 'hash_gt' | 'hash_gte';
|
|
2
3
|
export type BranchMappingObject = {
|
|
3
4
|
clientKey: string;
|
|
@@ -14,7 +15,20 @@ export type BranchMapping = {
|
|
|
14
15
|
branchMappingLogic: BranchMappingNode;
|
|
15
16
|
}[];
|
|
16
17
|
};
|
|
17
|
-
export
|
|
18
|
+
export type AlwaysTrueBranchMapping = {
|
|
19
|
+
version: number;
|
|
20
|
+
data: [
|
|
21
|
+
{
|
|
22
|
+
branchId: string;
|
|
23
|
+
branchMappingLogic: BranchMappingAlwaysTrue;
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
};
|
|
27
|
+
export declare function getAlwaysTrueBranchMapping(branchId: string): AlwaysTrueBranchMapping;
|
|
28
|
+
export declare function hasStandardBranchMap(channelInfo: UpdateChannelBasicInfoFragment): boolean;
|
|
29
|
+
export declare function getStandardBranchId(channelInfo: UpdateChannelBasicInfoFragment): string;
|
|
30
|
+
export declare function isAlwaysTrueBranchMapping(branchMapping: BranchMapping): branchMapping is AlwaysTrueBranchMapping;
|
|
31
|
+
export declare function getBranchIds(branchMapping: BranchMapping): string[];
|
|
18
32
|
export declare function getBranchMapping(branchMappingString: string): BranchMapping;
|
|
19
33
|
export declare function getNodesFromStatement(statement: BranchMappingStatement): BranchMappingNode[];
|
|
20
34
|
export declare function isAndStatement(statement: BranchMappingStatement): statement is BranchMappingStatement;
|
|
@@ -29,3 +43,5 @@ export declare function assertStatement(node: BranchMappingNode): asserts node i
|
|
|
29
43
|
export declare function assertNodeObject(node: BranchMappingNode): asserts node is BranchMappingObject;
|
|
30
44
|
export declare function assertNumber(operand: string | number | string[]): asserts operand is number;
|
|
31
45
|
export declare function assertString(operand: string | number | string[]): asserts operand is string;
|
|
46
|
+
export declare class BranchMappingValidationError extends Error {
|
|
47
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertString = exports.assertNumber = exports.assertNodeObject = exports.assertStatement = exports.hashLtOperator = exports.equalsOperator = exports.alwaysTrue = exports.isAlwaysTrue = exports.andStatement = exports.isNodeObject = exports.isStatement = exports.isAndStatement = exports.getNodesFromStatement = exports.getBranchMapping = exports.getAlwaysTrueBranchMapping = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
3
|
+
exports.BranchMappingValidationError = exports.assertString = exports.assertNumber = exports.assertNodeObject = exports.assertStatement = exports.hashLtOperator = exports.equalsOperator = exports.alwaysTrue = exports.isAlwaysTrue = exports.andStatement = exports.isNodeObject = exports.isStatement = exports.isAndStatement = exports.getNodesFromStatement = exports.getBranchMapping = exports.getBranchIds = exports.isAlwaysTrueBranchMapping = exports.getStandardBranchId = exports.hasStandardBranchMap = exports.getAlwaysTrueBranchMapping = void 0;
|
|
6
4
|
function getAlwaysTrueBranchMapping(branchId) {
|
|
7
5
|
return {
|
|
8
6
|
version: 0,
|
|
@@ -15,6 +13,33 @@ function getAlwaysTrueBranchMapping(branchId) {
|
|
|
15
13
|
};
|
|
16
14
|
}
|
|
17
15
|
exports.getAlwaysTrueBranchMapping = getAlwaysTrueBranchMapping;
|
|
16
|
+
function hasStandardBranchMap(channelInfo) {
|
|
17
|
+
const branchMapping = getBranchMapping(channelInfo.branchMapping);
|
|
18
|
+
return isAlwaysTrueBranchMapping(branchMapping);
|
|
19
|
+
}
|
|
20
|
+
exports.hasStandardBranchMap = hasStandardBranchMap;
|
|
21
|
+
function getStandardBranchId(channelInfo) {
|
|
22
|
+
const branchMapping = getBranchMapping(channelInfo.branchMapping);
|
|
23
|
+
assertAlwaysTrueBranchMapping(branchMapping);
|
|
24
|
+
return getBranchIdFromStandardMapping(branchMapping);
|
|
25
|
+
}
|
|
26
|
+
exports.getStandardBranchId = getStandardBranchId;
|
|
27
|
+
function isAlwaysTrueBranchMapping(branchMapping) {
|
|
28
|
+
const numBranches = branchMapping.data.length;
|
|
29
|
+
if (numBranches !== 1) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const branchMappingLogic = branchMapping.data[0].branchMappingLogic;
|
|
33
|
+
return isAlwaysTrue(branchMappingLogic);
|
|
34
|
+
}
|
|
35
|
+
exports.isAlwaysTrueBranchMapping = isAlwaysTrueBranchMapping;
|
|
36
|
+
function getBranchIdFromStandardMapping(branchMapping) {
|
|
37
|
+
return branchMapping.data[0].branchId;
|
|
38
|
+
}
|
|
39
|
+
function getBranchIds(branchMapping) {
|
|
40
|
+
return branchMapping.data.map(data => data.branchId);
|
|
41
|
+
}
|
|
42
|
+
exports.getBranchIds = getBranchIds;
|
|
18
43
|
function getBranchMapping(branchMappingString) {
|
|
19
44
|
try {
|
|
20
45
|
return JSON.parse(branchMappingString);
|
|
@@ -61,18 +86,34 @@ function hashLtOperator() {
|
|
|
61
86
|
}
|
|
62
87
|
exports.hashLtOperator = hashLtOperator;
|
|
63
88
|
function assertStatement(node) {
|
|
64
|
-
|
|
89
|
+
if (!isStatement(node)) {
|
|
90
|
+
throw new BranchMappingValidationError('Branch mapping node must be a statement. Received: ' + JSON.stringify(node));
|
|
91
|
+
}
|
|
65
92
|
}
|
|
66
93
|
exports.assertStatement = assertStatement;
|
|
67
94
|
function assertNodeObject(node) {
|
|
68
|
-
|
|
95
|
+
if (!isNodeObject(node)) {
|
|
96
|
+
throw new BranchMappingValidationError('Branch mapping node must be an object. Received: ' + JSON.stringify(node));
|
|
97
|
+
}
|
|
69
98
|
}
|
|
70
99
|
exports.assertNodeObject = assertNodeObject;
|
|
71
100
|
function assertNumber(operand) {
|
|
72
|
-
|
|
101
|
+
if (typeof operand !== 'number') {
|
|
102
|
+
throw new BranchMappingValidationError('Expected a number. Received: ' + JSON.stringify(operand));
|
|
103
|
+
}
|
|
73
104
|
}
|
|
74
105
|
exports.assertNumber = assertNumber;
|
|
75
106
|
function assertString(operand) {
|
|
76
|
-
|
|
107
|
+
if (typeof operand !== 'string') {
|
|
108
|
+
throw new BranchMappingValidationError('Expected a string. Received: ' + JSON.stringify(operand));
|
|
109
|
+
}
|
|
77
110
|
}
|
|
78
111
|
exports.assertString = assertString;
|
|
112
|
+
function assertAlwaysTrueBranchMapping(branchMapping) {
|
|
113
|
+
if (!isAlwaysTrueBranchMapping(branchMapping)) {
|
|
114
|
+
throw new BranchMappingValidationError('Expected standard branch mapping. Received: ' + JSON.stringify(branchMapping));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
class BranchMappingValidationError extends Error {
|
|
118
|
+
}
|
|
119
|
+
exports.BranchMappingValidationError = BranchMappingValidationError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
|
3
|
-
import { CreateUpdateChannelOnAppMutation
|
|
3
|
+
import { CreateUpdateChannelOnAppMutation } from '../graphql/generated';
|
|
4
4
|
import { UpdateChannelObject } from '../graphql/queries/ChannelQuery';
|
|
5
5
|
export declare const CHANNELS_LIMIT = 25;
|
|
6
6
|
export declare function selectChannelOnAppAsync(graphqlClient: ExpoGraphqlClient, { projectId, selectionPromptTitle, paginatedQueryOptions, }: {
|
|
@@ -27,8 +27,3 @@ export declare function ensureChannelExistsAsync(graphqlClient: ExpoGraphqlClien
|
|
|
27
27
|
branchId: string;
|
|
28
28
|
channelName: string;
|
|
29
29
|
}): Promise<void>;
|
|
30
|
-
export declare function getChannelsDatasetAsync(graphqlClient: ExpoGraphqlClient, { appId, filterPredicate, batchSize, }: {
|
|
31
|
-
appId: string;
|
|
32
|
-
filterPredicate?: (channelInfo: UpdateChannelBasicInfoFragment) => boolean;
|
|
33
|
-
batchSize?: number;
|
|
34
|
-
}): Promise<UpdateChannelBasicInfoFragment[]>;
|
package/build/channel/queries.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ensureChannelExistsAsync = exports.createChannelOnAppAsync = exports.listAndRenderBranchesAndUpdatesOnChannelAsync = exports.listAndRenderChannelsOnAppAsync = exports.selectChannelOnAppAsync = exports.CHANNELS_LIMIT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const graphql_1 = require("graphql");
|
|
@@ -10,11 +10,9 @@ const BranchQuery_1 = require("../graphql/queries/BranchQuery");
|
|
|
10
10
|
const ChannelQuery_1 = require("../graphql/queries/ChannelQuery");
|
|
11
11
|
const UpdateChannelBasicInfo_1 = require("../graphql/types/UpdateChannelBasicInfo");
|
|
12
12
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
13
|
-
const ora_1 = require("../ora");
|
|
14
13
|
const formatFields_1 = tslib_1.__importDefault(require("../utils/formatFields"));
|
|
15
14
|
const json_1 = require("../utils/json");
|
|
16
15
|
const queries_1 = require("../utils/queries");
|
|
17
|
-
const relay_1 = require("../utils/relay");
|
|
18
16
|
const utils_1 = require("./utils");
|
|
19
17
|
exports.CHANNELS_LIMIT = 25;
|
|
20
18
|
async function selectChannelOnAppAsync(graphqlClient, { projectId, selectionPromptTitle, paginatedQueryOptions, }) {
|
|
@@ -181,25 +179,3 @@ async function ensureChannelExistsAsync(graphqlClient, { appId, branchId, channe
|
|
|
181
179
|
}
|
|
182
180
|
}
|
|
183
181
|
exports.ensureChannelExistsAsync = ensureChannelExistsAsync;
|
|
184
|
-
async function getChannelsDatasetAsync(graphqlClient, { appId, filterPredicate, batchSize = 100, }) {
|
|
185
|
-
const queryAsync = async ({ first, after, }) => await ChannelQuery_1.ChannelQuery.viewUpdateChannelsBasicInfoPaginatedOnAppAsync(graphqlClient, {
|
|
186
|
-
appId,
|
|
187
|
-
first,
|
|
188
|
-
after,
|
|
189
|
-
});
|
|
190
|
-
const assetSpinner = (0, ora_1.ora)().start('Fetching channels...');
|
|
191
|
-
const afterEachQuery = (totalNodesFetched, _dataset, _batch, pageInfo) => {
|
|
192
|
-
if (pageInfo.hasNextPage) {
|
|
193
|
-
assetSpinner.text = `Fetched ${totalNodesFetched} channels`;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
const dataset = await (0, relay_1.getPaginatedDatasetAsync)({
|
|
197
|
-
queryAsync,
|
|
198
|
-
afterEachQuery,
|
|
199
|
-
filterPredicate,
|
|
200
|
-
batchSize,
|
|
201
|
-
});
|
|
202
|
-
assetSpinner.succeed(`Fetched all channels`);
|
|
203
|
-
return dataset;
|
|
204
|
-
}
|
|
205
|
-
exports.getChannelsDatasetAsync = getChannelsDatasetAsync;
|
|
@@ -39,7 +39,6 @@ class BuildVersionGetView extends EasCommand_1.default {
|
|
|
39
39
|
easJsonAccessor,
|
|
40
40
|
platforms,
|
|
41
41
|
profileName: (_b = flags.profile) !== null && _b !== void 0 ? _b : undefined,
|
|
42
|
-
projectDir,
|
|
43
42
|
});
|
|
44
43
|
const results = {};
|
|
45
44
|
for (const { profile, platform } of buildProfiles) {
|
|
@@ -38,7 +38,6 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
38
38
|
easJsonAccessor,
|
|
39
39
|
platforms,
|
|
40
40
|
profileName: (_b = flags.profile) !== null && _b !== void 0 ? _b : undefined,
|
|
41
|
-
projectDir,
|
|
42
41
|
});
|
|
43
42
|
for (const profileInfo of buildProfiles) {
|
|
44
43
|
const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { EndOutcome } from '../../rollout/actions/EndRollout';
|
|
3
|
+
declare enum ActionRawFlagValue {
|
|
4
|
+
CREATE = "create",
|
|
5
|
+
EDIT = "edit",
|
|
6
|
+
END = "end"
|
|
7
|
+
}
|
|
8
|
+
export default class ChannelRolloutPreview extends EasCommand {
|
|
9
|
+
static hidden: boolean;
|
|
10
|
+
static description: string;
|
|
11
|
+
static args: {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}[];
|
|
15
|
+
static flags: {
|
|
16
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
action: import("@oclif/core/lib/interfaces").OptionFlag<ActionRawFlagValue | undefined>;
|
|
19
|
+
percent: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
20
|
+
outcome: import("@oclif/core/lib/interfaces").OptionFlag<EndOutcome | undefined>;
|
|
21
|
+
branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
22
|
+
'runtime-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
23
|
+
};
|
|
24
|
+
static contextDefinition: {
|
|
25
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
26
|
+
privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
|
|
27
|
+
};
|
|
28
|
+
runAsync(): Promise<void>;
|
|
29
|
+
private getAction;
|
|
30
|
+
private sanitizeArgsAndFlags;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
8
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
9
|
+
const EndRollout_1 = require("../../rollout/actions/EndRollout");
|
|
10
|
+
const ManageRollout_1 = require("../../rollout/actions/ManageRollout");
|
|
11
|
+
const NonInteractiveRollout_1 = require("../../rollout/actions/NonInteractiveRollout");
|
|
12
|
+
const RolloutMainMenu_1 = require("../../rollout/actions/RolloutMainMenu");
|
|
13
|
+
var ActionRawFlagValue;
|
|
14
|
+
(function (ActionRawFlagValue) {
|
|
15
|
+
ActionRawFlagValue["CREATE"] = "create";
|
|
16
|
+
ActionRawFlagValue["EDIT"] = "edit";
|
|
17
|
+
ActionRawFlagValue["END"] = "end";
|
|
18
|
+
})(ActionRawFlagValue || (ActionRawFlagValue = {}));
|
|
19
|
+
class ChannelRolloutPreview extends EasCommand_1.default {
|
|
20
|
+
async runAsync() {
|
|
21
|
+
const { args, flags } = await this.parse(ChannelRolloutPreview);
|
|
22
|
+
const argsAndFlags = this.sanitizeArgsAndFlags({ ...flags, ...args });
|
|
23
|
+
const { privateProjectConfig: { exp, projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(ChannelRolloutPreview, {
|
|
24
|
+
nonInteractive: argsAndFlags.nonInteractive,
|
|
25
|
+
});
|
|
26
|
+
if (argsAndFlags.json) {
|
|
27
|
+
// TODO(quin): implement json output
|
|
28
|
+
throw new Error('Developer Preview doesnt support JSON output yet');
|
|
29
|
+
}
|
|
30
|
+
const app = { projectId, exp };
|
|
31
|
+
const ctx = {
|
|
32
|
+
projectId,
|
|
33
|
+
nonInteractive: argsAndFlags.nonInteractive,
|
|
34
|
+
graphqlClient,
|
|
35
|
+
app,
|
|
36
|
+
};
|
|
37
|
+
if (argsAndFlags.nonInteractive) {
|
|
38
|
+
await new NonInteractiveRollout_1.NonInteractiveRollout(argsAndFlags).runAsync(ctx);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
log_1.default.addNewLineIfNone();
|
|
42
|
+
log_1.default.warn(`✨ This command is in Developer Preview and has not been released to production yet`);
|
|
43
|
+
log_1.default.addNewLineIfNone();
|
|
44
|
+
await new RolloutMainMenu_1.RolloutMainMenu(argsAndFlags).runAsync(ctx);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
getAction(action) {
|
|
48
|
+
switch (action) {
|
|
49
|
+
case ActionRawFlagValue.CREATE:
|
|
50
|
+
return RolloutMainMenu_1.MainMenuActions.CREATE_NEW;
|
|
51
|
+
case ActionRawFlagValue.EDIT:
|
|
52
|
+
return ManageRollout_1.ManageRolloutActions.EDIT;
|
|
53
|
+
case ActionRawFlagValue.END:
|
|
54
|
+
return ManageRollout_1.ManageRolloutActions.END;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
sanitizeArgsAndFlags(rawFlags) {
|
|
58
|
+
const action = rawFlags.action;
|
|
59
|
+
return {
|
|
60
|
+
channelName: rawFlags.channel,
|
|
61
|
+
percent: rawFlags.percent,
|
|
62
|
+
outcome: rawFlags.outcome,
|
|
63
|
+
branchNameToRollout: rawFlags.branch,
|
|
64
|
+
runtimeVersion: rawFlags['runtime-version'],
|
|
65
|
+
action: action ? this.getAction(action) : undefined,
|
|
66
|
+
nonInteractive: rawFlags['non-interactive'],
|
|
67
|
+
json: rawFlags.json,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.default = ChannelRolloutPreview;
|
|
72
|
+
_a = ChannelRolloutPreview;
|
|
73
|
+
ChannelRolloutPreview.hidden = true;
|
|
74
|
+
ChannelRolloutPreview.description = 'Roll a new branch out on a channel incrementally.';
|
|
75
|
+
ChannelRolloutPreview.args = [
|
|
76
|
+
{
|
|
77
|
+
name: 'channel',
|
|
78
|
+
description: 'channel on which the rollout should be done',
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
ChannelRolloutPreview.flags = {
|
|
82
|
+
action: core_1.Flags.enum({
|
|
83
|
+
description: 'Rollout action to perform',
|
|
84
|
+
options: Object.values(ActionRawFlagValue),
|
|
85
|
+
required: false,
|
|
86
|
+
}),
|
|
87
|
+
percent: core_1.Flags.integer({
|
|
88
|
+
description: 'Percent of users to send to the new branch. Use with --action=edit or --action=create',
|
|
89
|
+
required: false,
|
|
90
|
+
}),
|
|
91
|
+
outcome: core_1.Flags.enum({
|
|
92
|
+
description: 'End outcome of rollout. Use with --action=end',
|
|
93
|
+
options: Object.values(EndRollout_1.EndOutcome),
|
|
94
|
+
required: false,
|
|
95
|
+
}),
|
|
96
|
+
branch: core_1.Flags.string({
|
|
97
|
+
description: 'Branch to rollout. Use with --action=create',
|
|
98
|
+
required: false,
|
|
99
|
+
}),
|
|
100
|
+
'runtime-version': core_1.Flags.string({
|
|
101
|
+
description: 'Runtime version to target. Use with --action=create',
|
|
102
|
+
required: false,
|
|
103
|
+
}),
|
|
104
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
105
|
+
};
|
|
106
|
+
ChannelRolloutPreview.contextDefinition = {
|
|
107
|
+
..._a.ContextOptions.ProjectConfig,
|
|
108
|
+
..._a.ContextOptions.LoggedIn,
|
|
109
|
+
};
|
|
@@ -28,7 +28,6 @@ class MetadataLint extends EasCommand_1.default {
|
|
|
28
28
|
easJsonAccessor: eas_json_1.EasJsonAccessor.fromProjectPath(projectDir),
|
|
29
29
|
platforms: [eas_build_job_1.Platform.IOS],
|
|
30
30
|
profileName: flags.profile,
|
|
31
|
-
projectDir,
|
|
32
31
|
});
|
|
33
32
|
if (submitProfiles.length !== 1) {
|
|
34
33
|
throw new Error('Metadata only supports iOS and a single submit profile.');
|
|
@@ -28,7 +28,6 @@ class MetadataPull extends EasCommand_1.default {
|
|
|
28
28
|
easJsonAccessor: eas_json_1.EasJsonAccessor.fromProjectPath(projectDir),
|
|
29
29
|
platforms: [eas_build_job_1.Platform.IOS],
|
|
30
30
|
profileName: flags.profile,
|
|
31
|
-
projectDir,
|
|
32
31
|
});
|
|
33
32
|
if (submitProfiles.length !== 1) {
|
|
34
33
|
throw new Error('Metadata only supports iOS and a single submit profile.');
|
|
@@ -26,7 +26,6 @@ class MetadataPush extends EasCommand_1.default {
|
|
|
26
26
|
easJsonAccessor: eas_json_1.EasJsonAccessor.fromProjectPath(projectDir),
|
|
27
27
|
platforms: [eas_build_job_1.Platform.IOS],
|
|
28
28
|
profileName: flags.profile,
|
|
29
|
-
projectDir,
|
|
30
29
|
});
|
|
31
30
|
if (submitProfiles.length !== 1) {
|
|
32
31
|
throw new Error('Metadata only supports iOS and a single submit profile.');
|
package/build/commands/submit.js
CHANGED
|
@@ -30,7 +30,6 @@ class Submit extends EasCommand_1.default {
|
|
|
30
30
|
easJsonAccessor: eas_json_1.EasJsonAccessor.fromProjectPath(projectDir),
|
|
31
31
|
platforms,
|
|
32
32
|
profileName: flagsWithPlatform.profile,
|
|
33
|
-
projectDir,
|
|
34
33
|
});
|
|
35
34
|
const submissions = [];
|
|
36
35
|
for (const submissionProfile of submissionProfiles) {
|
|
@@ -3,20 +3,16 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
-
const url_1 = require("../../build/utils/url");
|
|
7
6
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
8
7
|
const flags_1 = require("../../commandUtils/flags");
|
|
9
8
|
const pagination_1 = require("../../commandUtils/pagination");
|
|
10
|
-
const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
|
|
11
9
|
const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
|
|
12
|
-
const log_1 = tslib_1.
|
|
13
|
-
const ora_1 = require("../../ora");
|
|
14
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
10
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
15
11
|
const prompts_1 = require("../../prompts");
|
|
16
12
|
const getBranchNameFromChannelNameAsync_1 = require("../../update/getBranchNameFromChannelNameAsync");
|
|
17
13
|
const queries_1 = require("../../update/queries");
|
|
14
|
+
const republish_1 = require("../../update/republish");
|
|
18
15
|
const utils_1 = require("../../update/utils");
|
|
19
|
-
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
20
16
|
const json_1 = require("../../utils/json");
|
|
21
17
|
const defaultRepublishPlatforms = ['android', 'ios'];
|
|
22
18
|
class UpdateRepublish extends EasCommand_1.default {
|
|
@@ -47,63 +43,16 @@ class UpdateRepublish extends EasCommand_1.default {
|
|
|
47
43
|
}
|
|
48
44
|
log_1.default.withTick(`The republished update will appear on the same platforms it was originally published on: ${platformsFromUpdates.join(', ')}`);
|
|
49
45
|
}
|
|
50
|
-
// This command only republishes a single update group
|
|
51
|
-
// The update group properties are the same for all updates
|
|
52
|
-
const { branchId, branchName, runtimeVersion } = updatesToPublish[0];
|
|
53
46
|
const updateMessage = await getOrAskUpdateMessageAsync(updatesToPublish, flags);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
branchId,
|
|
65
|
-
runtimeVersion,
|
|
66
|
-
message: updateMessage,
|
|
67
|
-
updateInfoGroup: Object.fromEntries(updatesToPublish.map(update => [update.platform, JSON.parse(update.manifestFragment)])),
|
|
68
|
-
gitCommitHash: updatesToPublish[0].gitCommitHash,
|
|
69
|
-
awaitingCodeSigningInfo: shouldRepublishWithCodesigning,
|
|
70
|
-
},
|
|
71
|
-
]);
|
|
72
|
-
if (shouldRepublishWithCodesigning) {
|
|
73
|
-
const codeSigningByPlatform = Object.fromEntries(updatesToPublish.map(update => [update.platform, update.codeSigningInfo]));
|
|
74
|
-
await Promise.all(updatesRepublished.map(async (update) => {
|
|
75
|
-
const codeSigning = codeSigningByPlatform[update.platform];
|
|
76
|
-
if (codeSigning) {
|
|
77
|
-
await PublishMutation_1.PublishMutation.setCodeSigningInfoAsync(graphqlClient, update.id, codeSigning);
|
|
78
|
-
}
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
publishIndicator.succeed('Republished update');
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
publishIndicator.fail('Failed to republish update');
|
|
85
|
-
throw error;
|
|
86
|
-
}
|
|
87
|
-
if (flags.json) {
|
|
88
|
-
return (0, json_1.printJsonOnlyOutput)(updatesRepublished);
|
|
89
|
-
}
|
|
90
|
-
const updatesRepublishedByPlatform = Object.fromEntries(updatesRepublished.map(update => [update.platform, update]));
|
|
91
|
-
const updateGroupUrl = (0, url_1.getUpdateGroupUrl)((await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId)).name, exp.slug, updatesRepublished[0].group);
|
|
92
|
-
log_1.default.addNewLineIfNone();
|
|
93
|
-
log_1.default.log((0, formatFields_1.default)([
|
|
94
|
-
{ label: 'Branch', value: branchName },
|
|
95
|
-
{ label: 'Runtime version', value: updatesRepublished[0].runtimeVersion },
|
|
96
|
-
{ label: 'Platform', value: updatesRepublished.map(update => update.platform).join(', ') },
|
|
97
|
-
{ label: 'Update Group ID', value: updatesRepublished[0].id },
|
|
98
|
-
...(updatesRepublishedByPlatform.android
|
|
99
|
-
? [{ label: 'Android update ID', value: updatesRepublishedByPlatform.android.id }]
|
|
100
|
-
: []),
|
|
101
|
-
...(updatesRepublishedByPlatform.ios
|
|
102
|
-
? [{ label: 'iOS update ID', value: updatesRepublishedByPlatform.ios.id }]
|
|
103
|
-
: []),
|
|
104
|
-
{ label: 'Message', value: updateMessage },
|
|
105
|
-
{ label: 'Website link', value: (0, log_1.link)(updateGroupUrl, { dim: false }) },
|
|
106
|
-
]));
|
|
47
|
+
const arbitraryUpdate = updatesToPublish[0];
|
|
48
|
+
await (0, republish_1.republishAsync)({
|
|
49
|
+
graphqlClient,
|
|
50
|
+
app: { exp, projectId },
|
|
51
|
+
updatesToPublish,
|
|
52
|
+
targetBranch: { branchId: arbitraryUpdate.branchId, branchName: arbitraryUpdate.branchName },
|
|
53
|
+
updateMessage,
|
|
54
|
+
json: flags.json,
|
|
55
|
+
});
|
|
107
56
|
}
|
|
108
57
|
sanitizeFlags(rawFlags) {
|
|
109
58
|
var _b;
|
|
@@ -165,14 +114,14 @@ UpdateRepublish.contextDefinition = {
|
|
|
165
114
|
/** Retrieve the update group from either the update group id, or select from branch name. */
|
|
166
115
|
async function getOrAskUpdatesAsync(graphqlClient, projectId, flags) {
|
|
167
116
|
if (flags.groupId) {
|
|
168
|
-
const
|
|
117
|
+
const updateGroup = await UpdateQuery_1.UpdateQuery.viewUpdateGroupAsync(graphqlClient, {
|
|
169
118
|
groupId: flags.groupId,
|
|
170
119
|
});
|
|
171
|
-
return
|
|
172
|
-
...
|
|
173
|
-
groupId:
|
|
174
|
-
branchId:
|
|
175
|
-
branchName:
|
|
120
|
+
return updateGroup.map(update => ({
|
|
121
|
+
...update,
|
|
122
|
+
groupId: update.group,
|
|
123
|
+
branchId: update.branch.id,
|
|
124
|
+
branchName: update.branch.name,
|
|
176
125
|
}));
|
|
177
126
|
}
|
|
178
127
|
if (flags.branchName) {
|
|
@@ -196,16 +145,16 @@ async function askUpdatesFromBranchNameAsync(graphqlClient, { projectId, branchN
|
|
|
196
145
|
if (nonInteractive) {
|
|
197
146
|
throw new Error('Must supply --group when in non-interactive mode');
|
|
198
147
|
}
|
|
199
|
-
const
|
|
148
|
+
const updateGroup = await (0, queries_1.selectUpdateGroupOnBranchAsync)(graphqlClient, {
|
|
200
149
|
projectId,
|
|
201
150
|
branchName,
|
|
202
151
|
paginatedQueryOptions: (0, pagination_1.getPaginatedQueryOptions)({ json, 'non-interactive': nonInteractive }),
|
|
203
152
|
});
|
|
204
|
-
return
|
|
205
|
-
...
|
|
206
|
-
groupId: group
|
|
207
|
-
branchId:
|
|
208
|
-
branchName:
|
|
153
|
+
return updateGroup.map(update => ({
|
|
154
|
+
...update,
|
|
155
|
+
groupId: update.group,
|
|
156
|
+
branchId: update.branch.id,
|
|
157
|
+
branchName: update.branch.name,
|
|
209
158
|
}));
|
|
210
159
|
}
|
|
211
160
|
/** Ask the user which update needs to be republished by channel name, this requires interactive mode */
|