eas-cli 25.1.1 → 25.3.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.
Files changed (61) hide show
  1. package/README.md +282 -162
  2. package/build/analytics/AnalyticsManager.d.ts +7 -1
  3. package/build/analytics/AnalyticsManager.js +12 -1
  4. package/build/billing/resolveAccount.d.ts +12 -0
  5. package/build/billing/resolveAccount.js +1 -0
  6. package/build/build/build.d.ts +3 -1
  7. package/build/build/build.js +14 -12
  8. package/build/build/context.d.ts +4 -0
  9. package/build/build/createContext.d.ts +5 -1
  10. package/build/build/createContext.js +3 -1
  11. package/build/build/freeTierLimitCheckout.d.ts +39 -0
  12. package/build/build/freeTierLimitCheckout.js +106 -0
  13. package/build/build/freeTierLimitGuidance.d.ts +19 -0
  14. package/build/build/freeTierLimitGuidance.js +39 -0
  15. package/build/build/runBuildAndSubmit.d.ts +7 -1
  16. package/build/build/runBuildAndSubmit.js +6 -2
  17. package/build/build/utils/url.d.ts +1 -0
  18. package/build/build/utils/url.js +4 -0
  19. package/build/commandUtils/EasCommand.d.ts +9 -0
  20. package/build/commandUtils/EasCommand.js +12 -1
  21. package/build/commandUtils/context/ExperimentationContextField.d.ts +13 -0
  22. package/build/commandUtils/context/ExperimentationContextField.js +79 -0
  23. package/build/commandUtils/context/contextUtils/createGraphqlClient.d.ts +3 -0
  24. package/build/commandUtils/context/contextUtils/createGraphqlClient.js +29 -2
  25. package/build/commandUtils/errors.d.ts +5 -1
  26. package/build/commandUtils/errors.js +4 -3
  27. package/build/commands/analytics.js +1 -1
  28. package/build/commands/build/index.d.ts +1 -0
  29. package/build/commands/build/index.js +4 -1
  30. package/build/commands/simulator/control.d.ts +26 -0
  31. package/build/commands/simulator/control.js +250 -0
  32. package/build/commands/simulator/index.d.ts +1 -0
  33. package/build/commands/simulator/index.js +18 -4
  34. package/build/commands/update/republish.d.ts +1 -1
  35. package/build/env.d.ts +6 -0
  36. package/build/env.js +6 -0
  37. package/build/experimentation/AnalyticsExposureLogger.d.ts +7 -0
  38. package/build/experimentation/AnalyticsExposureLogger.js +21 -0
  39. package/build/experimentation/ExperimentNamespace.d.ts +24 -0
  40. package/build/experimentation/ExperimentNamespace.js +69 -0
  41. package/build/experimentation/ExperimentOverrides.d.ts +17 -0
  42. package/build/experimentation/ExperimentOverrides.js +68 -0
  43. package/build/experimentation/ExperimentationClient.d.ts +32 -0
  44. package/build/experimentation/ExperimentationClient.js +125 -0
  45. package/build/experimentation/LazyExperimentationClient.d.ts +12 -0
  46. package/build/experimentation/LazyExperimentationClient.js +22 -0
  47. package/build/graphql/generated.d.ts +12 -0
  48. package/build/graphql/queries/ExperimentationConfigQuery.d.ts +10 -0
  49. package/build/graphql/queries/ExperimentationConfigQuery.js +49 -0
  50. package/build/graphql/queries/UserQuery.d.ts +3 -1
  51. package/build/graphql/queries/UserQuery.js +2 -1
  52. package/build/help.d.ts +4 -0
  53. package/build/help.js +56 -0
  54. package/build/simulator/hostActions.d.ts +70 -0
  55. package/build/simulator/hostActions.js +411 -0
  56. package/build/simulator/utils.d.ts +5 -0
  57. package/build/simulator/utils.js +11 -0
  58. package/build/user/SessionManager.d.ts +8 -1
  59. package/build/user/SessionManager.js +7 -2
  60. package/oclif.manifest.json +917 -3
  61. package/package.json +8 -6
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SafeNamespace = exports.OverrideFallbackNamespace = exports.FALLBACK_NAMESPACE = void 0;
4
+ exports.coerceOverrideValue = coerceOverrideValue;
5
+ const tslib_1 = require("tslib");
6
+ const log_1 = tslib_1.__importDefault(require("../log"));
7
+ exports.FALLBACK_NAMESPACE = {
8
+ getParam(_paramName, defaultValue) {
9
+ return defaultValue;
10
+ },
11
+ isOverridden: false,
12
+ };
13
+ /** Serves overrides without consulting the real namespace, so no exposure is logged. */
14
+ class OverrideFallbackNamespace {
15
+ namespaceName;
16
+ overrides;
17
+ isOverridden = true;
18
+ constructor(namespaceName, overrides) {
19
+ this.namespaceName = namespaceName;
20
+ this.overrides = overrides;
21
+ }
22
+ getParam(paramName, defaultValue) {
23
+ if (this.overrides.hasOverride(this.namespaceName, paramName)) {
24
+ return coerceOverrideValue(this.overrides.getOverride(this.namespaceName, paramName), defaultValue);
25
+ }
26
+ return defaultValue;
27
+ }
28
+ }
29
+ exports.OverrideFallbackNamespace = OverrideFallbackNamespace;
30
+ /** Returns the default instead of throwing when the library rejects a param on first read. */
31
+ class SafeNamespace {
32
+ namespace;
33
+ namespaceName;
34
+ isOverridden = false;
35
+ constructor(namespace, namespaceName) {
36
+ this.namespace = namespace;
37
+ this.namespaceName = namespaceName;
38
+ }
39
+ getParam(paramName, defaultValue) {
40
+ try {
41
+ return this.namespace.getParam(paramName, defaultValue);
42
+ }
43
+ catch (error) {
44
+ log_1.default.debug(`[experimentation] Failed to read param "${paramName}" from namespace "${this.namespaceName}". Returning the default.`, error);
45
+ return defaultValue;
46
+ }
47
+ }
48
+ }
49
+ exports.SafeNamespace = SafeNamespace;
50
+ function coerceOverrideValue(overrideValue, defaultValue) {
51
+ if (overrideValue === undefined || overrideValue.trim() === '') {
52
+ return defaultValue;
53
+ }
54
+ if (typeof defaultValue === 'boolean') {
55
+ const normalized = overrideValue.toLowerCase();
56
+ if (normalized === 'true') {
57
+ return true;
58
+ }
59
+ if (normalized === 'false') {
60
+ return false;
61
+ }
62
+ return defaultValue;
63
+ }
64
+ if (typeof defaultValue === 'number') {
65
+ const parsed = Number(overrideValue);
66
+ return (Number.isFinite(parsed) ? parsed : defaultValue);
67
+ }
68
+ return overrideValue;
69
+ }
@@ -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;
@@ -20050,6 +20050,18 @@ export type EnvironmentVariablesSharedWithSensitiveQuery = {
20050
20050
  };
20051
20051
  };
20052
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
+ };
20053
20065
  export type FingerprintsByAppIdQueryVariables = Exact<{
20054
20066
  appId: Scalars['String']['input'];
20055
20067
  after?: InputMaybe<Scalars['String']['input']>;
@@ -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): Promise<CurrentUserQuery["meActor"]>;
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;
@@ -0,0 +1,4 @@
1
+ import { Help } from '@oclif/core';
2
+ export default class EasHelp extends Help {
3
+ showHelp(argv: string[]): Promise<void>;
4
+ }
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,70 @@
1
+ import { z } from 'zod';
2
+ import { PreviewApiAccess } from './utils';
3
+ export type HostActionResult = {
4
+ stdout: string;
5
+ stderr: string;
6
+ exitCode: number;
7
+ };
8
+ export type HostActionConnection = {
9
+ requestAsync(action: string, params?: Record<string, unknown>): Promise<HostActionResult>;
10
+ close(): void;
11
+ };
12
+ declare const CatalogEntry: z.ZodObject<{
13
+ type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
14
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
15
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
+ allOf: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
17
+ anyOf: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
18
+ oneOf: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
19
+ description: z.ZodOptional<z.ZodString>;
20
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ upload: z.ZodOptional<z.ZodString>;
22
+ uploadAs: z.ZodOptional<z.ZodEnum<{
23
+ path: "path";
24
+ id: "id";
25
+ }>>;
26
+ uploadWhen: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
27
+ keepUpload: z.ZodOptional<z.ZodBoolean>;
28
+ output: z.ZodOptional<z.ZodEnum<{
29
+ path: "path";
30
+ base64: "base64";
31
+ }>>;
32
+ }, z.core.$loose>;
33
+ declare const Catalog: z.ZodRecord<z.ZodString, z.ZodObject<{
34
+ type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
35
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
36
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ allOf: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
38
+ anyOf: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
39
+ oneOf: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
40
+ description: z.ZodOptional<z.ZodString>;
41
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
+ upload: z.ZodOptional<z.ZodString>;
43
+ uploadAs: z.ZodOptional<z.ZodEnum<{
44
+ path: "path";
45
+ id: "id";
46
+ }>>;
47
+ uploadWhen: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
48
+ keepUpload: z.ZodOptional<z.ZodBoolean>;
49
+ output: z.ZodOptional<z.ZodEnum<{
50
+ path: "path";
51
+ base64: "base64";
52
+ }>>;
53
+ }, z.core.$loose>>;
54
+ export type HostActionCatalog = z.infer<typeof Catalog>;
55
+ export type HostActionCatalogEntry = z.infer<typeof CatalogEntry>;
56
+ export declare function connectHostActionsAsync(access: PreviewApiAccess, { timeoutMs }?: {
57
+ timeoutMs?: number;
58
+ }): Promise<HostActionConnection>;
59
+ export declare function fetchHostActionCatalogAsync(connection: HostActionConnection): Promise<HostActionCatalog>;
60
+ export declare function formatHostActionUsage(name: string, entry: HostActionCatalogEntry): string;
61
+ export declare function buildHostActionParams(name: string, entry: HostActionCatalogEntry, values: string[]): Record<string, unknown>;
62
+ export declare function assertHostActionOutputAsync(name: string, entry: HostActionCatalogEntry, outputPath: string | undefined): Promise<void>;
63
+ export declare function uploadFileAsync(connection: HostActionConnection, localPath: string, { chunkBytes }?: {
64
+ chunkBytes?: number;
65
+ }): Promise<{
66
+ uploadId: string;
67
+ path: string;
68
+ }>;
69
+ export declare function saveHostActionOutputAsync(connection: HostActionConnection, entry: HostActionCatalogEntry, stdout: string, outputPath: string | undefined): Promise<string | null>;
70
+ export {};