eas-cli 27.4.1 → 27.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 +373 -200
- package/build/build/simulatorsLaunchHint.js +1 -1
- package/build/commands/observe/events.d.ts +2 -0
- package/build/commands/observe/events.js +42 -4
- package/build/commands/simulator/availability.d.ts +1 -0
- package/build/commands/simulator/availability.js +3 -1
- package/build/commands/simulator/control/connection.d.ts +19 -0
- package/build/commands/simulator/control/connection.js +93 -0
- package/build/commands/simulator/control.d.ts +7 -0
- package/build/commands/simulator/control.js +249 -110
- package/build/commands/simulator/egress.d.ts +1 -0
- package/build/commands/simulator/egress.js +3 -1
- package/build/commands/simulator/events.d.ts +1 -0
- package/build/commands/simulator/events.js +3 -1
- package/build/commands/simulator/exec.d.ts +1 -0
- package/build/commands/simulator/exec.js +3 -1
- package/build/commands/simulator/get.d.ts +1 -0
- package/build/commands/simulator/get.js +3 -1
- package/build/commands/simulator/index.d.ts +2 -0
- package/build/commands/simulator/index.js +286 -76
- package/build/commands/simulator/list.d.ts +1 -0
- package/build/commands/simulator/list.js +3 -1
- package/build/commands/simulator/logs.d.ts +1 -0
- package/build/commands/simulator/logs.js +3 -1
- package/build/commands/simulator/stop.d.ts +1 -0
- package/build/commands/simulator/stop.js +3 -1
- package/build/commands/workflow/ssh.d.ts +0 -1
- package/build/commands/workflow/ssh.js +0 -1
- package/build/graphql/generated.d.ts +8 -0
- package/build/graphql/types/Actor.js +3 -0
- package/build/help.js +2 -1
- package/build/observe/fetchCustomEvents.d.ts +2 -1
- package/build/observe/fetchCustomEvents.js +1 -0
- package/build/project/accountSelection.js +5 -8
- package/build/simulator/commandAliases.d.ts +10 -0
- package/build/simulator/commandAliases.js +24 -0
- package/build/simulator/controlActions.d.ts +32 -0
- package/build/simulator/controlActions.js +128 -0
- package/build/simulator/controlConfig.d.ts +43 -0
- package/build/simulator/controlConfig.js +156 -0
- package/build/simulator/controlConnection.d.ts +28 -0
- package/build/simulator/controlConnection.js +337 -0
- package/build/simulator/controlConnectionProtocol.d.ts +64 -0
- package/build/simulator/controlConnectionProtocol.js +155 -0
- package/build/simulator/controlConnectionWorker.d.ts +7 -0
- package/build/simulator/controlConnectionWorker.js +278 -0
- package/build/simulator/controlSession.d.ts +3 -0
- package/build/simulator/controlSession.js +28 -0
- package/build/simulator/hostActions.d.ts +22 -3
- package/build/simulator/hostActions.js +78 -19
- package/build/simulator/sessionConfig.d.ts +16 -0
- package/build/simulator/sessionConfig.js +36 -0
- package/build/simulator/startConfig.d.ts +7 -0
- package/build/simulator/startConfig.js +89 -0
- package/build/simulator/startSetup.d.ts +7 -0
- package/build/simulator/startSetup.js +17 -0
- package/build/user/User.d.ts +9 -1
- package/build/user/User.js +25 -3
- package/build/user/accountPermissions.js +3 -1
- package/oclif.manifest.json +1194 -996
- package/package.json +8 -6
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveStartConfigAsync = resolveStartConfigAsync;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const controlConfig_1 = require("./controlConfig");
|
|
6
|
+
const sessionConfig_1 = require("./sessionConfig");
|
|
7
|
+
/** Reparse the effective values using the command's own validation, options and defaults. */
|
|
8
|
+
async function resolveStartConfigAsync(argv, definitions) {
|
|
9
|
+
if (!argv.some(arg => arg === '--import' || arg.startsWith('--import='))) {
|
|
10
|
+
return { argv };
|
|
11
|
+
}
|
|
12
|
+
// Relationships are checked after file values and explicit CLI overrides are combined.
|
|
13
|
+
const relaxed = Object.fromEntries(Object.entries(definitions).map(([name, flag]) => [
|
|
14
|
+
name,
|
|
15
|
+
{
|
|
16
|
+
...flag,
|
|
17
|
+
dependsOn: undefined,
|
|
18
|
+
exclusive: undefined,
|
|
19
|
+
exactlyOne: undefined,
|
|
20
|
+
atLeastOne: undefined,
|
|
21
|
+
relationships: undefined,
|
|
22
|
+
required: false,
|
|
23
|
+
},
|
|
24
|
+
]));
|
|
25
|
+
const parsed = await core_1.Parser.parse(argv, { flags: relaxed });
|
|
26
|
+
if (parsed.flags.import === undefined) {
|
|
27
|
+
return { argv };
|
|
28
|
+
}
|
|
29
|
+
if (!parsed.flags.import.trim()) {
|
|
30
|
+
throw new Error('--import requires a non-empty configuration file path.');
|
|
31
|
+
}
|
|
32
|
+
const config = await (0, sessionConfig_1.readSimulatorSessionConfigAsync)(parsed.flags.import);
|
|
33
|
+
const values = { ...config.start };
|
|
34
|
+
for (const key of Object.keys(values)) {
|
|
35
|
+
if (!Object.hasOwn(definitions, key) || ['import', 'json', 'non-interactive'].includes(key)) {
|
|
36
|
+
throw new Error(`Unknown or invocation-only start setting "${key}" in ${config.path}.`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const explicit = Object.entries(parsed.flags).filter(([name, value]) => value !== undefined && !parsed.metadata.flags[name]?.setFromDefault);
|
|
40
|
+
const explicitNames = new Set(explicit.map(([name]) => name));
|
|
41
|
+
const removed = new Set();
|
|
42
|
+
for (const [name, value] of explicit) {
|
|
43
|
+
for (const excluded of definitions[name].exclusive ?? []) {
|
|
44
|
+
if (!explicitNames.has(excluded)) {
|
|
45
|
+
delete values[excluded];
|
|
46
|
+
removed.add(excluded);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
values[name] = value;
|
|
50
|
+
}
|
|
51
|
+
// SDK selection belongs to the saved Expo Go app source, not a replacement build.
|
|
52
|
+
if (removed.has('expo-go') && !explicitNames.has('sdk-version')) {
|
|
53
|
+
delete values['sdk-version'];
|
|
54
|
+
}
|
|
55
|
+
if (explicitNames.has('network-capture') &&
|
|
56
|
+
values['network-capture'] === false &&
|
|
57
|
+
!explicitNames.has('network-capture-field')) {
|
|
58
|
+
delete values['network-capture-field'];
|
|
59
|
+
}
|
|
60
|
+
const effectiveArgv = [];
|
|
61
|
+
for (const [name, value] of Object.entries(values)) {
|
|
62
|
+
const flag = definitions[name];
|
|
63
|
+
if (flag.type === 'boolean') {
|
|
64
|
+
if (typeof value !== 'boolean') {
|
|
65
|
+
throw new Error(`Start setting "${name}" must be a boolean.`);
|
|
66
|
+
}
|
|
67
|
+
if (value) {
|
|
68
|
+
effectiveArgv.push(`--${name}`);
|
|
69
|
+
}
|
|
70
|
+
else if (flag.allowNo) {
|
|
71
|
+
effectiveArgv.push(`--no-${name}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const items = Array.isArray(value) ? value : [value];
|
|
76
|
+
if (Array.isArray(value) && !flag.multiple) {
|
|
77
|
+
throw new Error(`Start setting "${name}" does not accept multiple values.`);
|
|
78
|
+
}
|
|
79
|
+
for (const item of items) {
|
|
80
|
+
if (typeof item !== 'string' && typeof item !== 'number') {
|
|
81
|
+
throw new Error(`Start setting "${name}" must contain a string or number.`);
|
|
82
|
+
}
|
|
83
|
+
effectiveArgv.push(`--${name}=${item}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
await (0, controlConfig_1.preflightControlConfigFilesAsync)(config);
|
|
88
|
+
return { argv: effectiveArgv, config };
|
|
89
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ControlConfigProgress, ControlConfigResult } from './controlConfig';
|
|
2
|
+
import { SimulatorSessionConfig } from './sessionConfig';
|
|
3
|
+
import { PreviewApiAccess } from './utils';
|
|
4
|
+
export declare function applyStartConfigAsync(access: PreviewApiAccess, config: SimulatorSessionConfig, { signal, onProgress, }: {
|
|
5
|
+
signal: AbortSignal;
|
|
6
|
+
onProgress?: (progress: ControlConfigProgress) => void;
|
|
7
|
+
}): Promise<ControlConfigResult[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyStartConfigAsync = applyStartConfigAsync;
|
|
4
|
+
const controlConfig_1 = require("./controlConfig");
|
|
5
|
+
const hostActions_1 = require("./hostActions");
|
|
6
|
+
async function applyStartConfigAsync(access, config, { signal, onProgress, }) {
|
|
7
|
+
const connection = await (0, hostActions_1.connectHostActionsAsync)(access, { signal });
|
|
8
|
+
try {
|
|
9
|
+
const catalog = await (0, hostActions_1.fetchHostActionCatalogAsync)(connection);
|
|
10
|
+
const prepared = await (0, controlConfig_1.prepareControlConfigAsync)(catalog, config.path, connection.udid, config);
|
|
11
|
+
signal.throwIfAborted();
|
|
12
|
+
return await (0, controlConfig_1.executeControlConfigAsync)(connection, prepared, { onProgress });
|
|
13
|
+
}
|
|
14
|
+
finally {
|
|
15
|
+
connection.close();
|
|
16
|
+
}
|
|
17
|
+
}
|
package/build/user/User.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrentUserQuery, PartnerActor, Robot, SsoUser, User } from '../graphql/generated';
|
|
1
|
+
import { AccountFragment, CurrentUserQuery, PartnerActor, Robot, SsoUser, User } from '../graphql/generated';
|
|
2
2
|
export type Actor = NonNullable<CurrentUserQuery['meActor']>;
|
|
3
3
|
/**
|
|
4
4
|
* Whether the actor can create projects on the account with the credential used for this command.
|
|
@@ -29,3 +29,11 @@ export declare function getCreatableAccountNames(actor: Actor): string[];
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function getActorDisplayName(actor?: Pick<Robot, '__typename' | 'firstName'> | Pick<User, '__typename' | 'username'> | Pick<SsoUser, '__typename' | 'username'> | Pick<PartnerActor, '__typename' | 'username'> | null): string;
|
|
31
31
|
export declare function getActorUsername(actor?: Actor): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve the personal account of an actor. Use this helper instead of
|
|
34
|
+
* assuming that a user's personal account name equals their username.
|
|
35
|
+
*
|
|
36
|
+
* Returns `null` for actors without a personal account (e.g. robots), and when the session's
|
|
37
|
+
* scope doesn't include the personal account.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getPersonalAccount(actor?: Actor): AccountFragment | null;
|
package/build/user/User.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.getCannotCreateProjectsOnAccountNameReason = getCannotCreateProjectsOnAc
|
|
|
6
6
|
exports.getCreatableAccountNames = getCreatableAccountNames;
|
|
7
7
|
exports.getActorDisplayName = getActorDisplayName;
|
|
8
8
|
exports.getActorUsername = getActorUsername;
|
|
9
|
+
exports.getPersonalAccount = getPersonalAccount;
|
|
9
10
|
const generated_1 = require("../graphql/generated");
|
|
10
11
|
/**
|
|
11
12
|
* Whether the actor can create projects on the account with the credential used for this command.
|
|
@@ -49,10 +50,11 @@ function getCreatableAccountNames(actor) {
|
|
|
49
50
|
if (actor.__typename === 'Robot') {
|
|
50
51
|
return creatableAccounts.map(it => it.name);
|
|
51
52
|
}
|
|
53
|
+
const personalAccountId = getPersonalAccount(actor)?.id;
|
|
52
54
|
return [
|
|
53
|
-
...creatableAccounts.filter(a => a.
|
|
54
|
-
...creatableAccounts.filter(a => a.ownerUserActor && a.
|
|
55
|
-
...creatableAccounts.filter(a => !a.ownerUserActor),
|
|
55
|
+
...creatableAccounts.filter(a => a.id === personalAccountId),
|
|
56
|
+
...creatableAccounts.filter(a => a.ownerUserActor && a.id !== personalAccountId),
|
|
57
|
+
...creatableAccounts.filter(a => !a.ownerUserActor && a.id !== personalAccountId),
|
|
56
58
|
].map(it => it.name);
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
@@ -85,3 +87,23 @@ function getActorUsername(actor) {
|
|
|
85
87
|
return null;
|
|
86
88
|
}
|
|
87
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Resolve the personal account of an actor. Use this helper instead of
|
|
92
|
+
* assuming that a user's personal account name equals their username.
|
|
93
|
+
*
|
|
94
|
+
* Returns `null` for actors without a personal account (e.g. robots), and when the session's
|
|
95
|
+
* scope doesn't include the personal account.
|
|
96
|
+
*/
|
|
97
|
+
function getPersonalAccount(actor) {
|
|
98
|
+
switch (actor?.__typename) {
|
|
99
|
+
case 'User':
|
|
100
|
+
case 'SSOUser':
|
|
101
|
+
return actor.accounts.find(account => account.ownerUserActor?.id === actor.id) ?? null;
|
|
102
|
+
case 'PartnerActor':
|
|
103
|
+
// ownerUserActor only resolves to a User or SSOUser, so match on the primary account id
|
|
104
|
+
return actor.accounts.find(account => account.id === actor.primaryAccount.id) ?? null;
|
|
105
|
+
case 'Robot':
|
|
106
|
+
case undefined:
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const generated_1 = require("../graphql/generated");
|
|
7
7
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
8
|
+
const User_1 = require("./User");
|
|
8
9
|
const roles_1 = require("./roles");
|
|
9
10
|
/**
|
|
10
11
|
* Logs the actor's role on each account, and whether the credentials used for this command limit
|
|
@@ -17,7 +18,8 @@ function logAccountPermissions(actor) {
|
|
|
17
18
|
// personal account is included, only show if more accounts that personal account
|
|
18
19
|
// but do show personal account in list if there are more, or if the credentials used for
|
|
19
20
|
// this command limit the permissions on it
|
|
20
|
-
const
|
|
21
|
+
const personalAccount = (0, User_1.getPersonalAccount)(actor);
|
|
22
|
+
const accountExcludingPersonalAccount = actor.accounts.filter(account => account.id !== personalAccount?.id);
|
|
21
23
|
const hasLimitedAccount = actor.accounts.some(isLimitedByCredentials);
|
|
22
24
|
if (accountExcludingPersonalAccount.length === 0 && !hasLimitedAccount) {
|
|
23
25
|
return { hasLimitedAccount };
|