eas-cli 25.0.0 → 25.2.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 +285 -150
- package/build/analytics/AnalyticsManager.d.ts +6 -1
- package/build/analytics/AnalyticsManager.js +11 -1
- package/build/build/build.d.ts +2 -1
- package/build/build/build.js +5 -4
- package/build/build/context.d.ts +2 -0
- package/build/build/createContext.d.ts +3 -1
- package/build/build/createContext.js +2 -1
- package/build/build/freeTierLimitGuidance.d.ts +19 -0
- package/build/build/freeTierLimitGuidance.js +39 -0
- package/build/build/runBuildAndSubmit.d.ts +4 -1
- package/build/build/runBuildAndSubmit.js +4 -2
- package/build/commandUtils/EasCommand.d.ts +9 -0
- package/build/commandUtils/EasCommand.js +9 -0
- package/build/commandUtils/context/ExperimentationContextField.d.ts +13 -0
- package/build/commandUtils/context/ExperimentationContextField.js +79 -0
- package/build/commandUtils/context/contextUtils/createGraphqlClient.d.ts +3 -0
- package/build/commandUtils/context/contextUtils/createGraphqlClient.js +29 -2
- package/build/commandUtils/usageUtils.d.ts +14 -0
- package/build/commandUtils/usageUtils.js +40 -2
- package/build/commands/account/usage.js +55 -2
- package/build/commands/analytics.js +1 -1
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/index.js +3 -1
- package/build/commands/simulator/control.d.ts +26 -0
- package/build/commands/simulator/control.js +250 -0
- package/build/commands/simulator/index.d.ts +2 -0
- package/build/commands/simulator/index.js +28 -1
- package/build/commands/update/republish.d.ts +1 -1
- package/build/env.d.ts +6 -0
- package/build/env.js +6 -0
- package/build/experimentation/AnalyticsExposureLogger.d.ts +7 -0
- package/build/experimentation/AnalyticsExposureLogger.js +21 -0
- package/build/experimentation/ExperimentNamespace.d.ts +24 -0
- package/build/experimentation/ExperimentNamespace.js +69 -0
- package/build/experimentation/ExperimentOverrides.d.ts +17 -0
- package/build/experimentation/ExperimentOverrides.js +68 -0
- package/build/experimentation/ExperimentationClient.d.ts +32 -0
- package/build/experimentation/ExperimentationClient.js +125 -0
- package/build/experimentation/LazyExperimentationClient.d.ts +12 -0
- package/build/experimentation/LazyExperimentationClient.js +22 -0
- package/build/graphql/generated.d.ts +124 -0
- package/build/graphql/queries/AccountQuery.js +25 -0
- package/build/graphql/queries/ExperimentationConfigQuery.d.ts +10 -0
- package/build/graphql/queries/ExperimentationConfigQuery.js +49 -0
- package/build/graphql/queries/UserQuery.d.ts +3 -1
- package/build/graphql/queries/UserQuery.js +2 -1
- package/build/graphql/types/Account.js +5 -0
- package/build/help.d.ts +4 -0
- package/build/help.js +56 -0
- package/build/simulator/frameAncestors.d.ts +9 -0
- package/build/simulator/frameAncestors.js +66 -0
- package/build/simulator/hostActions.d.ts +70 -0
- package/build/simulator/hostActions.js +411 -0
- package/build/simulator/utils.d.ts +19 -2
- package/build/simulator/utils.js +68 -8
- package/build/user/SessionManager.d.ts +8 -1
- package/build/user/SessionManager.js +7 -2
- package/oclif.manifest.json +1164 -243
- package/package.json +8 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type ExperimentOverrideMap = ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
2
|
+
/**
|
|
3
|
+
* Parses `EAS_EXPERIMENT_OVERRIDE`: comma-separated `namespace:param=value` entries. Values may
|
|
4
|
+
* contain `:` and `=` but not `,`. Overrides are keyed by namespace name and apply in every scope.
|
|
5
|
+
*
|
|
6
|
+
* @example EAS_EXPERIMENT_OVERRIDE="onboarding:variant=treatment,cli-hints:enabled=true"
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseExperimentOverrides(rawValue: string | undefined): ExperimentOverrideMap;
|
|
9
|
+
export declare class ExperimentOverrides {
|
|
10
|
+
private readonly overrideMap;
|
|
11
|
+
constructor(overrideMap: ExperimentOverrideMap);
|
|
12
|
+
static fromEnv(): ExperimentOverrides;
|
|
13
|
+
static empty(): ExperimentOverrides;
|
|
14
|
+
hasNamespaceOverride(namespace: string): boolean;
|
|
15
|
+
hasOverride(namespace: string, param: string): boolean;
|
|
16
|
+
getOverride(namespace: string, param: string): string | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExperimentOverrides = void 0;
|
|
4
|
+
exports.parseExperimentOverrides = parseExperimentOverrides;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const env_1 = tslib_1.__importDefault(require("../env"));
|
|
7
|
+
/**
|
|
8
|
+
* Parses `EAS_EXPERIMENT_OVERRIDE`: comma-separated `namespace:param=value` entries. Values may
|
|
9
|
+
* contain `:` and `=` but not `,`. Overrides are keyed by namespace name and apply in every scope.
|
|
10
|
+
*
|
|
11
|
+
* @example EAS_EXPERIMENT_OVERRIDE="onboarding:variant=treatment,cli-hints:enabled=true"
|
|
12
|
+
*/
|
|
13
|
+
function parseExperimentOverrides(rawValue) {
|
|
14
|
+
const overrideMap = new Map();
|
|
15
|
+
if (!rawValue) {
|
|
16
|
+
return overrideMap;
|
|
17
|
+
}
|
|
18
|
+
for (const entry of rawValue.split(',')) {
|
|
19
|
+
const override = entry.trim();
|
|
20
|
+
if (!override) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const firstEqualsIndex = override.indexOf('=');
|
|
24
|
+
if (firstEqualsIndex === -1) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const namespaceAndParam = override.slice(0, firstEqualsIndex);
|
|
28
|
+
const value = override.slice(firstEqualsIndex + 1).trim();
|
|
29
|
+
const firstColonIndex = namespaceAndParam.indexOf(':');
|
|
30
|
+
if (firstColonIndex === -1) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const namespace = namespaceAndParam.slice(0, firstColonIndex).trim();
|
|
34
|
+
const param = namespaceAndParam.slice(firstColonIndex + 1).trim();
|
|
35
|
+
if (!namespace || !param) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
let params = overrideMap.get(namespace);
|
|
39
|
+
if (!params) {
|
|
40
|
+
params = new Map();
|
|
41
|
+
overrideMap.set(namespace, params);
|
|
42
|
+
}
|
|
43
|
+
params.set(param, value);
|
|
44
|
+
}
|
|
45
|
+
return overrideMap;
|
|
46
|
+
}
|
|
47
|
+
class ExperimentOverrides {
|
|
48
|
+
overrideMap;
|
|
49
|
+
constructor(overrideMap) {
|
|
50
|
+
this.overrideMap = overrideMap;
|
|
51
|
+
}
|
|
52
|
+
static fromEnv() {
|
|
53
|
+
return new ExperimentOverrides(parseExperimentOverrides(env_1.default.experimentOverride));
|
|
54
|
+
}
|
|
55
|
+
static empty() {
|
|
56
|
+
return new ExperimentOverrides(new Map());
|
|
57
|
+
}
|
|
58
|
+
hasNamespaceOverride(namespace) {
|
|
59
|
+
return this.overrideMap.has(namespace);
|
|
60
|
+
}
|
|
61
|
+
hasOverride(namespace, param) {
|
|
62
|
+
return this.overrideMap.get(namespace)?.has(param) ?? false;
|
|
63
|
+
}
|
|
64
|
+
getOverride(namespace, param) {
|
|
65
|
+
return this.overrideMap.get(namespace)?.get(param);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.ExperimentOverrides = ExperimentOverrides;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ExperimentationDefinition, type LoggerConfig } from '@expo/experimentation';
|
|
2
|
+
import { type ExperimentNamespace } from './ExperimentNamespace';
|
|
3
|
+
import { ExperimentOverrides } from './ExperimentOverrides';
|
|
4
|
+
import { Analytics } from '../analytics/AnalyticsManager';
|
|
5
|
+
export type ExperimentationScope = 'user' | 'account' | 'device';
|
|
6
|
+
export type ExperimentationConfigs = Record<ExperimentationScope, ExperimentationDefinition>;
|
|
7
|
+
/** Commands pass the account unit on each `getAccountNamespace` call. */
|
|
8
|
+
export type ExperimentationUnits = Record<Exclude<ExperimentationScope, 'account'>, string | null>;
|
|
9
|
+
export declare const EMPTY_EXPERIMENTATION_DEFINITION: ExperimentationDefinition;
|
|
10
|
+
export declare function createLoggerConfig(analytics: Analytics): LoggerConfig;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves experiment params for the current CLI run. Units: user is the actor ID, account is the
|
|
13
|
+
* ID the command passes to `getAccountNamespace`, device is the analytics device ID.
|
|
14
|
+
* User and account units are shared across surfaces. The device unit is specific to the CLI, so a
|
|
15
|
+
* device namespace must not be shared with another surface.
|
|
16
|
+
* The first `getParam` on a namespace logs an exposure, so call it only where the variant is used.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ExperimentationClient {
|
|
19
|
+
private readonly units;
|
|
20
|
+
private readonly overrides;
|
|
21
|
+
private readonly scopes;
|
|
22
|
+
constructor(configs: ExperimentationConfigs, units: ExperimentationUnits, overrides: ExperimentOverrides, loggerConfig: LoggerConfig);
|
|
23
|
+
/** Env overrides still apply, so QA can force a variant even with analytics disabled. */
|
|
24
|
+
static createDisabled(overrides?: ExperimentOverrides): ExperimentationClient;
|
|
25
|
+
getUserNamespace(name: string): ExperimentNamespace;
|
|
26
|
+
/** Takes the account the command already resolved, so no extra lookup or config read happens here. */
|
|
27
|
+
getAccountNamespace(name: string, { accountId }: {
|
|
28
|
+
accountId: string;
|
|
29
|
+
}): ExperimentNamespace;
|
|
30
|
+
getDeviceNamespace(name: string): ExperimentNamespace;
|
|
31
|
+
private resolve;
|
|
32
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExperimentationClient = exports.EMPTY_EXPERIMENTATION_DEFINITION = void 0;
|
|
4
|
+
exports.createLoggerConfig = createLoggerConfig;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const experimentation_1 = require("@expo/experimentation");
|
|
7
|
+
const node_crypto_1 = require("node:crypto");
|
|
8
|
+
const AnalyticsExposureLogger_1 = require("./AnalyticsExposureLogger");
|
|
9
|
+
const ExperimentNamespace_1 = require("./ExperimentNamespace");
|
|
10
|
+
const ExperimentOverrides_1 = require("./ExperimentOverrides");
|
|
11
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
12
|
+
exports.EMPTY_EXPERIMENTATION_DEFINITION = {
|
|
13
|
+
experiments: [],
|
|
14
|
+
namespaces: [],
|
|
15
|
+
};
|
|
16
|
+
const EMPTY_CONFIGS = {
|
|
17
|
+
user: exports.EMPTY_EXPERIMENTATION_DEFINITION,
|
|
18
|
+
account: exports.EMPTY_EXPERIMENTATION_DEFINITION,
|
|
19
|
+
device: exports.EMPTY_EXPERIMENTATION_DEFINITION,
|
|
20
|
+
};
|
|
21
|
+
const NULL_UNITS = { user: null, device: null };
|
|
22
|
+
function sha1(input) {
|
|
23
|
+
return (0, node_crypto_1.createHash)('sha1').update(input).digest('hex');
|
|
24
|
+
}
|
|
25
|
+
function createLoggerConfig(analytics) {
|
|
26
|
+
return {
|
|
27
|
+
flavorMap: new Map([
|
|
28
|
+
['no-op', new experimentation_1.NoOpExposureLogger()],
|
|
29
|
+
['rudderstack', new AnalyticsExposureLogger_1.AnalyticsExposureLogger(analytics)],
|
|
30
|
+
]),
|
|
31
|
+
fallbackLoggerType: 'no-op',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const NO_OP_LOGGER_CONFIG = {
|
|
35
|
+
flavorMap: new Map([['no-op', new experimentation_1.NoOpExposureLogger()]]),
|
|
36
|
+
fallbackLoggerType: 'no-op',
|
|
37
|
+
};
|
|
38
|
+
/** Cached per (unit, name): the library deduplicates exposures per Namespace instance. */
|
|
39
|
+
class ScopedNamespaces {
|
|
40
|
+
factories;
|
|
41
|
+
instances = new Map();
|
|
42
|
+
constructor(definition, loggerConfig, defaultUnit) {
|
|
43
|
+
this.factories = (0, experimentation_1.parseExperimentationConfig)(definition, { sha1Fn: sha1 }, loggerConfig);
|
|
44
|
+
// Build every namespace now so an invalid server config throws here, in the fail-open path.
|
|
45
|
+
if (defaultUnit) {
|
|
46
|
+
for (const name of this.factories.keys()) {
|
|
47
|
+
this.getNamespace(name, defaultUnit);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
getNamespace(name, unit) {
|
|
52
|
+
const factory = this.factories.get(name);
|
|
53
|
+
if (!factory) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
let byName = this.instances.get(unit);
|
|
57
|
+
if (!byName) {
|
|
58
|
+
byName = new Map();
|
|
59
|
+
this.instances.set(unit, byName);
|
|
60
|
+
}
|
|
61
|
+
let namespace = byName.get(name);
|
|
62
|
+
if (!namespace) {
|
|
63
|
+
namespace = factory([unit]);
|
|
64
|
+
byName.set(name, namespace);
|
|
65
|
+
}
|
|
66
|
+
return namespace;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Resolves experiment params for the current CLI run. Units: user is the actor ID, account is the
|
|
71
|
+
* ID the command passes to `getAccountNamespace`, device is the analytics device ID.
|
|
72
|
+
* User and account units are shared across surfaces. The device unit is specific to the CLI, so a
|
|
73
|
+
* device namespace must not be shared with another surface.
|
|
74
|
+
* The first `getParam` on a namespace logs an exposure, so call it only where the variant is used.
|
|
75
|
+
*/
|
|
76
|
+
class ExperimentationClient {
|
|
77
|
+
units;
|
|
78
|
+
overrides;
|
|
79
|
+
scopes;
|
|
80
|
+
constructor(configs, units, overrides, loggerConfig) {
|
|
81
|
+
this.units = units;
|
|
82
|
+
this.overrides = overrides;
|
|
83
|
+
this.scopes = {
|
|
84
|
+
user: new ScopedNamespaces(configs.user, loggerConfig, units.user),
|
|
85
|
+
account: new ScopedNamespaces(configs.account, loggerConfig, null),
|
|
86
|
+
device: new ScopedNamespaces(configs.device, loggerConfig, units.device),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** Env overrides still apply, so QA can force a variant even with analytics disabled. */
|
|
90
|
+
static createDisabled(overrides = ExperimentOverrides_1.ExperimentOverrides.fromEnv()) {
|
|
91
|
+
return new ExperimentationClient(EMPTY_CONFIGS, NULL_UNITS, overrides, NO_OP_LOGGER_CONFIG);
|
|
92
|
+
}
|
|
93
|
+
getUserNamespace(name) {
|
|
94
|
+
return this.resolve('user', name, this.units.user);
|
|
95
|
+
}
|
|
96
|
+
/** Takes the account the command already resolved, so no extra lookup or config read happens here. */
|
|
97
|
+
getAccountNamespace(name, { accountId }) {
|
|
98
|
+
return this.resolve('account', name, accountId);
|
|
99
|
+
}
|
|
100
|
+
getDeviceNamespace(name) {
|
|
101
|
+
return this.resolve('device', name, this.units.device);
|
|
102
|
+
}
|
|
103
|
+
resolve(scope, name, unit) {
|
|
104
|
+
if (this.overrides.hasNamespaceOverride(name)) {
|
|
105
|
+
return new ExperimentNamespace_1.OverrideFallbackNamespace(name, this.overrides);
|
|
106
|
+
}
|
|
107
|
+
if (!unit) {
|
|
108
|
+
return ExperimentNamespace_1.FALLBACK_NAMESPACE;
|
|
109
|
+
}
|
|
110
|
+
let namespace;
|
|
111
|
+
try {
|
|
112
|
+
namespace = this.scopes[scope].getNamespace(name, unit);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
log_1.default.debug(`[experimentation] Failed to build namespace "${name}" in the ${scope} config. Returning defaults.`, error);
|
|
116
|
+
return ExperimentNamespace_1.FALLBACK_NAMESPACE;
|
|
117
|
+
}
|
|
118
|
+
if (!namespace) {
|
|
119
|
+
log_1.default.debug(`[experimentation] Namespace "${name}" not found in the ${scope} config. Returning defaults.`);
|
|
120
|
+
return ExperimentNamespace_1.FALLBACK_NAMESPACE;
|
|
121
|
+
}
|
|
122
|
+
return new ExperimentNamespace_1.SafeNamespace(namespace, name);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.ExperimentationClient = ExperimentationClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExperimentationClient } from './ExperimentationClient';
|
|
2
|
+
/**
|
|
3
|
+
* Defers building the experimentation client, and the config fetch behind it, until a command
|
|
4
|
+
* first needs a variant.
|
|
5
|
+
*/
|
|
6
|
+
export declare class LazyExperimentationClient {
|
|
7
|
+
private readonly loadAsync;
|
|
8
|
+
private pending;
|
|
9
|
+
constructor(loadAsync: () => Promise<ExperimentationClient>);
|
|
10
|
+
static fromClient(client: ExperimentationClient): LazyExperimentationClient;
|
|
11
|
+
getClientAsync(): Promise<ExperimentationClient>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LazyExperimentationClient = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Defers building the experimentation client, and the config fetch behind it, until a command
|
|
6
|
+
* first needs a variant.
|
|
7
|
+
*/
|
|
8
|
+
class LazyExperimentationClient {
|
|
9
|
+
loadAsync;
|
|
10
|
+
pending = null;
|
|
11
|
+
constructor(loadAsync) {
|
|
12
|
+
this.loadAsync = loadAsync;
|
|
13
|
+
}
|
|
14
|
+
static fromClient(client) {
|
|
15
|
+
return new LazyExperimentationClient(async () => client);
|
|
16
|
+
}
|
|
17
|
+
async getClientAsync() {
|
|
18
|
+
this.pending ??= this.loadAsync();
|
|
19
|
+
return await this.pending;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.LazyExperimentationClient = LazyExperimentationClient;
|
|
@@ -5538,6 +5538,14 @@ export type CreateDeviceRunSessionInput = {
|
|
|
5538
5538
|
* and applicationArchiveUrl.
|
|
5539
5539
|
*/
|
|
5540
5540
|
expoGo?: InputMaybe<Scalars['Boolean']['input']>;
|
|
5541
|
+
/**
|
|
5542
|
+
* Origins of pages that may embed the session's preview host in a frame, next to expo.dev.
|
|
5543
|
+
* Each value is an https origin such as https://app.example.com or a subdomain wildcard such
|
|
5544
|
+
* as https://*.example.com; plain http is accepted for localhost only. At most 10. The
|
|
5545
|
+
* embedding page still needs the preview token from remoteConfig, and whoever embeds the
|
|
5546
|
+
* preview can also control the device. If omitted, only expo.dev may embed the preview.
|
|
5547
|
+
*/
|
|
5548
|
+
frameAncestors?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5541
5549
|
/** iOS Simulator options. Only supported when platform is IOS. */
|
|
5542
5550
|
ios?: InputMaybe<CreateIosDeviceRunSessionInput>;
|
|
5543
5551
|
/**
|
|
@@ -5667,6 +5675,13 @@ export type CreateGitHubRepositorySettingsInput = {
|
|
|
5667
5675
|
baseDirectory: Scalars['String']['input'];
|
|
5668
5676
|
};
|
|
5669
5677
|
export type CreateIosDeviceRunSessionInput = {
|
|
5678
|
+
/**
|
|
5679
|
+
* Origins of pages that may call the session's preview host API cross-origin, for example to
|
|
5680
|
+
* render the device with @expo/hub-client. Framing the preview does not need this. Same value
|
|
5681
|
+
* rules as frameAncestors. At most 10. The page still needs the preview token from remoteConfig.
|
|
5682
|
+
* If omitted, only expo.dev may call the preview API cross-origin.
|
|
5683
|
+
*/
|
|
5684
|
+
corsOrigins?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5670
5685
|
/** Simulator device name or UDID to use for the session (e.g. "iPhone 16 Pro"). */
|
|
5671
5686
|
deviceIdentifier?: InputMaybe<Scalars['String']['input']>;
|
|
5672
5687
|
};
|
|
@@ -17840,6 +17855,12 @@ export type AccountFullUsageQuery = {
|
|
|
17840
17855
|
limit: number;
|
|
17841
17856
|
};
|
|
17842
17857
|
} | null;
|
|
17858
|
+
jobTypeBreakdown?: {
|
|
17859
|
+
__typename?: 'EstimatedUsageJobTypeBreakdown';
|
|
17860
|
+
workflows: number;
|
|
17861
|
+
simulator: number;
|
|
17862
|
+
other: number;
|
|
17863
|
+
} | null;
|
|
17843
17864
|
}>;
|
|
17844
17865
|
overageMetrics: Array<{
|
|
17845
17866
|
__typename?: 'EstimatedOverageAndCost';
|
|
@@ -17889,6 +17910,71 @@ export type AccountFullUsageQuery = {
|
|
|
17889
17910
|
limit: number;
|
|
17890
17911
|
};
|
|
17891
17912
|
} | null;
|
|
17913
|
+
jobTypeBreakdown?: {
|
|
17914
|
+
__typename?: 'EstimatedUsageJobTypeBreakdown';
|
|
17915
|
+
workflows: number;
|
|
17916
|
+
simulator: number;
|
|
17917
|
+
other: number;
|
|
17918
|
+
} | null;
|
|
17919
|
+
}>;
|
|
17920
|
+
overageMetrics: Array<{
|
|
17921
|
+
__typename?: 'EstimatedOverageAndCost';
|
|
17922
|
+
id: string;
|
|
17923
|
+
service: EasService;
|
|
17924
|
+
serviceMetric: EasServiceMetric;
|
|
17925
|
+
metricType: UsageMetricType;
|
|
17926
|
+
value: number;
|
|
17927
|
+
limit: number;
|
|
17928
|
+
totalCost: number;
|
|
17929
|
+
metadata?: {
|
|
17930
|
+
__typename?: 'AccountUsageEASBuildMetadata';
|
|
17931
|
+
billingResourceClass?: EasBuildBillingResourceClass | null;
|
|
17932
|
+
platform?: AppPlatform | null;
|
|
17933
|
+
} | null;
|
|
17934
|
+
}>;
|
|
17935
|
+
};
|
|
17936
|
+
EAS_SIMULATOR: {
|
|
17937
|
+
__typename?: 'UsageMetricTotal';
|
|
17938
|
+
id: string;
|
|
17939
|
+
totalCost: number;
|
|
17940
|
+
unavailableServiceUsageMetrics: Array<{
|
|
17941
|
+
__typename?: 'UnavailableServiceUsageMetric';
|
|
17942
|
+
service: EasService;
|
|
17943
|
+
}>;
|
|
17944
|
+
billingPeriod: {
|
|
17945
|
+
__typename?: 'BillingPeriod';
|
|
17946
|
+
id: string;
|
|
17947
|
+
start: any;
|
|
17948
|
+
end: any;
|
|
17949
|
+
anchor: any;
|
|
17950
|
+
};
|
|
17951
|
+
planMetrics: Array<{
|
|
17952
|
+
__typename?: 'EstimatedUsage';
|
|
17953
|
+
id: string;
|
|
17954
|
+
service: EasService;
|
|
17955
|
+
serviceMetric: EasServiceMetric;
|
|
17956
|
+
metricType: UsageMetricType;
|
|
17957
|
+
value: number;
|
|
17958
|
+
limit: number;
|
|
17959
|
+
platformBreakdown?: {
|
|
17960
|
+
__typename?: 'EstimatedUsagePlatformBreakdown';
|
|
17961
|
+
ios: {
|
|
17962
|
+
__typename?: 'EstimatedUsagePlatformDetail';
|
|
17963
|
+
value: number;
|
|
17964
|
+
limit: number;
|
|
17965
|
+
};
|
|
17966
|
+
android: {
|
|
17967
|
+
__typename?: 'EstimatedUsagePlatformDetail';
|
|
17968
|
+
value: number;
|
|
17969
|
+
limit: number;
|
|
17970
|
+
};
|
|
17971
|
+
} | null;
|
|
17972
|
+
jobTypeBreakdown?: {
|
|
17973
|
+
__typename?: 'EstimatedUsageJobTypeBreakdown';
|
|
17974
|
+
workflows: number;
|
|
17975
|
+
simulator: number;
|
|
17976
|
+
other: number;
|
|
17977
|
+
} | null;
|
|
17892
17978
|
}>;
|
|
17893
17979
|
overageMetrics: Array<{
|
|
17894
17980
|
__typename?: 'EstimatedOverageAndCost';
|
|
@@ -17906,6 +17992,20 @@ export type AccountFullUsageQuery = {
|
|
|
17906
17992
|
} | null;
|
|
17907
17993
|
}>;
|
|
17908
17994
|
};
|
|
17995
|
+
IOS_SIMULATOR_MINUTES: Array<{
|
|
17996
|
+
__typename?: 'AccountUsageMetric';
|
|
17997
|
+
id: string;
|
|
17998
|
+
serviceMetric: EasServiceMetric;
|
|
17999
|
+
metricType: UsageMetricType;
|
|
18000
|
+
value: number;
|
|
18001
|
+
}>;
|
|
18002
|
+
ANDROID_SIMULATOR_MINUTES: Array<{
|
|
18003
|
+
__typename?: 'AccountUsageMetric';
|
|
18004
|
+
id: string;
|
|
18005
|
+
serviceMetric: EasServiceMetric;
|
|
18006
|
+
metricType: UsageMetricType;
|
|
18007
|
+
value: number;
|
|
18008
|
+
}>;
|
|
17909
18009
|
};
|
|
17910
18010
|
};
|
|
17911
18011
|
};
|
|
@@ -19950,6 +20050,18 @@ export type EnvironmentVariablesSharedWithSensitiveQuery = {
|
|
|
19950
20050
|
};
|
|
19951
20051
|
};
|
|
19952
20052
|
};
|
|
20053
|
+
export type ExperimentationConfigsQueryVariables = Exact<{
|
|
20054
|
+
[key: string]: never;
|
|
20055
|
+
}>;
|
|
20056
|
+
export type ExperimentationConfigsQuery = {
|
|
20057
|
+
__typename?: 'RootQuery';
|
|
20058
|
+
experimentation: {
|
|
20059
|
+
__typename?: 'ExperimentationQuery';
|
|
20060
|
+
userConfig: any;
|
|
20061
|
+
accountConfig: any;
|
|
20062
|
+
deviceConfig: any;
|
|
20063
|
+
};
|
|
20064
|
+
};
|
|
19953
20065
|
export type FingerprintsByAppIdQueryVariables = Exact<{
|
|
19954
20066
|
appId: Scalars['String']['input'];
|
|
19955
20067
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -22922,6 +23034,12 @@ export type EstimatedUsageFragment = {
|
|
|
22922
23034
|
limit: number;
|
|
22923
23035
|
};
|
|
22924
23036
|
} | null;
|
|
23037
|
+
jobTypeBreakdown?: {
|
|
23038
|
+
__typename?: 'EstimatedUsageJobTypeBreakdown';
|
|
23039
|
+
workflows: number;
|
|
23040
|
+
simulator: number;
|
|
23041
|
+
other: number;
|
|
23042
|
+
} | null;
|
|
22925
23043
|
};
|
|
22926
23044
|
export type EstimatedOverageAndCostFragment = {
|
|
22927
23045
|
__typename?: 'EstimatedOverageAndCost';
|
|
@@ -22970,6 +23088,12 @@ export type UsageMetricTotalFragment = {
|
|
|
22970
23088
|
limit: number;
|
|
22971
23089
|
};
|
|
22972
23090
|
} | null;
|
|
23091
|
+
jobTypeBreakdown?: {
|
|
23092
|
+
__typename?: 'EstimatedUsageJobTypeBreakdown';
|
|
23093
|
+
workflows: number;
|
|
23094
|
+
simulator: number;
|
|
23095
|
+
other: number;
|
|
23096
|
+
} | null;
|
|
22973
23097
|
}>;
|
|
22974
23098
|
overageMetrics: Array<{
|
|
22975
23099
|
__typename?: 'EstimatedOverageAndCost';
|
|
@@ -109,6 +109,31 @@ exports.AccountQuery = {
|
|
|
109
109
|
id
|
|
110
110
|
...UsageMetricTotalFragment
|
|
111
111
|
}
|
|
112
|
+
EAS_SIMULATOR: byBillingPeriod(date: $currentDate, service: SIMULATOR) {
|
|
113
|
+
unavailableServiceUsageMetrics {
|
|
114
|
+
service
|
|
115
|
+
}
|
|
116
|
+
id
|
|
117
|
+
...UsageMetricTotalFragment
|
|
118
|
+
}
|
|
119
|
+
IOS_SIMULATOR_MINUTES: metricsForServiceMetric(
|
|
120
|
+
serviceMetric: SIMULATOR_USAGE
|
|
121
|
+
granularity: TOTAL
|
|
122
|
+
timespan: { start: $startDate, end: $endDate }
|
|
123
|
+
filterParams: { platform: "ios" }
|
|
124
|
+
) {
|
|
125
|
+
id
|
|
126
|
+
...AccountUsageMetricFragment
|
|
127
|
+
}
|
|
128
|
+
ANDROID_SIMULATOR_MINUTES: metricsForServiceMetric(
|
|
129
|
+
serviceMetric: SIMULATOR_USAGE
|
|
130
|
+
granularity: TOTAL
|
|
131
|
+
timespan: { start: $startDate, end: $endDate }
|
|
132
|
+
filterParams: { platform: "android" }
|
|
133
|
+
) {
|
|
134
|
+
id
|
|
135
|
+
...AccountUsageMetricFragment
|
|
136
|
+
}
|
|
112
137
|
}
|
|
113
138
|
}
|
|
114
139
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExperimentationDefinition } from '@expo/experimentation';
|
|
2
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
+
export type ExperimentationConfigsResult = {
|
|
4
|
+
userConfig: ExperimentationDefinition;
|
|
5
|
+
accountConfig: ExperimentationDefinition;
|
|
6
|
+
deviceConfig: ExperimentationDefinition;
|
|
7
|
+
};
|
|
8
|
+
export declare const ExperimentationConfigQuery: {
|
|
9
|
+
getConfigsAsync(graphqlClient: ExpoGraphqlClient): Promise<ExperimentationConfigsResult>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExperimentationConfigQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
const ExperimentationClient_1 = require("../../experimentation/ExperimentationClient");
|
|
7
|
+
/** Like `withErrorHandlingAsync`, but never logs. Callers fail open. */
|
|
8
|
+
async function quietQueryAsync(promise) {
|
|
9
|
+
const { data, error } = await promise;
|
|
10
|
+
if (error) {
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
if (!data) {
|
|
14
|
+
throw new Error('Returned query result data is null!');
|
|
15
|
+
}
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
/** The server sends an untyped JSONObject. Anything but the expected shape means no experiments. */
|
|
19
|
+
function toExperimentationDefinition(value) {
|
|
20
|
+
if (value &&
|
|
21
|
+
typeof value === 'object' &&
|
|
22
|
+
Array.isArray(value.experiments) &&
|
|
23
|
+
Array.isArray(value.namespaces)) {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
return ExperimentationClient_1.EMPTY_EXPERIMENTATION_DEFINITION;
|
|
27
|
+
}
|
|
28
|
+
exports.ExperimentationConfigQuery = {
|
|
29
|
+
async getConfigsAsync(graphqlClient) {
|
|
30
|
+
const data = await quietQueryAsync(graphqlClient
|
|
31
|
+
.query((0, graphql_tag_1.default) `
|
|
32
|
+
query ExperimentationConfigs {
|
|
33
|
+
experimentation {
|
|
34
|
+
userConfig
|
|
35
|
+
accountConfig
|
|
36
|
+
deviceConfig
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`, {},
|
|
40
|
+
// A failing network must not delay the command.
|
|
41
|
+
{ additionalTypenames: ['ExperimentationQuery'], noRetry: true })
|
|
42
|
+
.toPromise());
|
|
43
|
+
return {
|
|
44
|
+
userConfig: toExperimentationDefinition(data.experimentation.userConfig),
|
|
45
|
+
accountConfig: toExperimentationDefinition(data.experimentation.accountConfig),
|
|
46
|
+
deviceConfig: toExperimentationDefinition(data.experimentation.deviceConfig),
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { AccountFragment, CurrentUserQuery } from '../generated';
|
|
3
3
|
export declare const UserQuery: {
|
|
4
|
-
currentUserAsync(graphqlClient: ExpoGraphqlClient
|
|
4
|
+
currentUserAsync(graphqlClient: ExpoGraphqlClient, { noRetry }?: {
|
|
5
|
+
noRetry?: boolean;
|
|
6
|
+
}): Promise<CurrentUserQuery["meActor"]>;
|
|
5
7
|
requireCurrentUserPrimaryAccountAsync(graphqlClient: ExpoGraphqlClient): Promise<AccountFragment>;
|
|
6
8
|
};
|
|
@@ -8,7 +8,7 @@ const client_1 = require("../client");
|
|
|
8
8
|
const Account_1 = require("../types/Account");
|
|
9
9
|
const Actor_1 = require("../types/Actor");
|
|
10
10
|
exports.UserQuery = {
|
|
11
|
-
async currentUserAsync(graphqlClient) {
|
|
11
|
+
async currentUserAsync(graphqlClient, { noRetry = false } = {}) {
|
|
12
12
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
13
13
|
.query((0, graphql_tag_1.default) `
|
|
14
14
|
query CurrentUser {
|
|
@@ -21,6 +21,7 @@ exports.UserQuery = {
|
|
|
21
21
|
${(0, graphql_1.print)(Actor_1.MeActorFragmentNode)}
|
|
22
22
|
`, {}, {
|
|
23
23
|
additionalTypenames: ['User', 'SSOUser'],
|
|
24
|
+
noRetry,
|
|
24
25
|
})
|
|
25
26
|
.toPromise());
|
|
26
27
|
return data.meActor;
|
|
@@ -112,6 +112,11 @@ exports.EstimatedUsageFragmentNode = (0, graphql_tag_1.default) `
|
|
|
112
112
|
platformBreakdown {
|
|
113
113
|
...EstimatedUsagePlatformBreakdownFragment
|
|
114
114
|
}
|
|
115
|
+
jobTypeBreakdown {
|
|
116
|
+
workflows
|
|
117
|
+
simulator
|
|
118
|
+
other
|
|
119
|
+
}
|
|
115
120
|
}
|
|
116
121
|
`;
|
|
117
122
|
exports.EstimatedOverageAndCostFragmentNode = (0, graphql_tag_1.default) `
|
package/build/help.d.ts
ADDED
package/build/help.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const core_1 = require("@oclif/core");
|
|
37
|
+
class EasHelp extends core_1.Help {
|
|
38
|
+
// eslint-disable-next-line async-protect/async-suffix -- oclif defines the method name.
|
|
39
|
+
async showHelp(argv) {
|
|
40
|
+
const [command, ...args] = argv;
|
|
41
|
+
if (command === 'simulator:control' || command === 'sim:control') {
|
|
42
|
+
const { default: SimulatorControl } = await Promise.resolve().then(() => __importStar(require('./commands/simulator/control')));
|
|
43
|
+
const parsed = await core_1.Parser.parse(args, {
|
|
44
|
+
args: SimulatorControl.args,
|
|
45
|
+
flags: SimulatorControl.flags,
|
|
46
|
+
strict: false,
|
|
47
|
+
});
|
|
48
|
+
if (parsed.args.action && parsed.flags.help) {
|
|
49
|
+
await SimulatorControl.run(args, this.config);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
await super.showHelp(argv);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = EasHelp;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--frame-ancestor` and `--cors-origin` values: origins of pages that may embed the simulator
|
|
3
|
+
* preview host in a frame, or call its API cross-origin. The server applies the same rules;
|
|
4
|
+
* checking here gives a fast, local error.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MAX_FRAME_ANCESTORS = 10;
|
|
7
|
+
export declare const MAX_CORS_ORIGINS = 10;
|
|
8
|
+
export declare function parseFrameAncestorList(entries: readonly string[]): string[];
|
|
9
|
+
export declare function parseCorsOriginList(entries: readonly string[]): string[];
|