eas-cli 20.0.0 → 20.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.
Files changed (40) hide show
  1. package/README.md +197 -116
  2. package/build/commands/simulator/exec.d.ts +12 -0
  3. package/build/commands/simulator/exec.js +42 -0
  4. package/build/commands/simulator/get.d.ts +2 -1
  5. package/build/commands/simulator/get.js +13 -7
  6. package/build/commands/simulator/start.d.ts +4 -0
  7. package/build/commands/simulator/start.js +70 -5
  8. package/build/commands/simulator/stop.d.ts +2 -1
  9. package/build/commands/simulator/stop.js +16 -9
  10. package/build/commands/update/embedded/delete.d.ts +15 -0
  11. package/build/commands/update/embedded/delete.js +55 -0
  12. package/build/commands/update/embedded/list.d.ts +19 -0
  13. package/build/commands/update/embedded/list.js +132 -0
  14. package/build/commands/update/embedded/view.d.ts +17 -0
  15. package/build/commands/update/embedded/view.js +75 -0
  16. package/build/commands/update/rollback.d.ts +11 -0
  17. package/build/commands/update/rollback.js +117 -14
  18. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +20 -0
  19. package/build/credentials/ios/actions/AscApiKeyUtils.js +64 -0
  20. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +2 -4
  21. package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -4
  22. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +3 -20
  23. package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +10 -0
  24. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +39 -5
  25. package/build/credentials/ios/appstore/resolveCredentials.d.ts +1 -0
  26. package/build/credentials/ios/appstore/resolveCredentials.js +1 -0
  27. package/build/graphql/generated.d.ts +457 -4
  28. package/build/graphql/generated.js +35 -1
  29. package/build/graphql/mutations/EmbeddedUpdateMutation.d.ts +5 -0
  30. package/build/graphql/mutations/EmbeddedUpdateMutation.js +14 -0
  31. package/build/graphql/queries/EmbeddedUpdateQuery.d.ts +18 -0
  32. package/build/graphql/queries/EmbeddedUpdateQuery.js +81 -0
  33. package/build/graphql/queries/UpdateQuery.d.ts +2 -1
  34. package/build/graphql/queries/UpdateQuery.js +52 -0
  35. package/build/simulator/env.d.ts +7 -0
  36. package/build/simulator/env.js +44 -0
  37. package/build/simulator/utils.d.ts +3 -1
  38. package/build/simulator/utils.js +26 -7
  39. package/oclif.manifest.json +945 -525
  40. package/package.json +5 -5
@@ -11,4 +11,9 @@ export declare function isEmbeddedUpdateAssetNotAvailableError(error: unknown):
11
11
  export declare function isEmbeddedUpdateAlreadyExistsError(error: unknown): boolean;
12
12
  export declare const EmbeddedUpdateMutation: {
13
13
  uploadEmbeddedUpdateAsync(graphqlClient: ExpoGraphqlClient, input: UploadEmbeddedUpdateInput): Promise<EmbeddedUpdateResult>;
14
+ deleteEmbeddedUpdateAsync(graphqlClient: ExpoGraphqlClient, { id }: {
15
+ id: string;
16
+ }): Promise<{
17
+ id: string;
18
+ }>;
14
19
  };
@@ -34,4 +34,18 @@ exports.EmbeddedUpdateMutation = {
34
34
  .toPromise());
35
35
  return data.embeddedUpdate.uploadEmbeddedUpdate;
36
36
  },
37
+ async deleteEmbeddedUpdateAsync(graphqlClient, { id }) {
38
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
39
+ .mutation((0, graphql_tag_1.default) `
40
+ mutation DeleteEmbeddedUpdate($id: ID!) {
41
+ embeddedUpdate {
42
+ deleteEmbeddedUpdate(id: $id) {
43
+ id
44
+ }
45
+ }
46
+ }
47
+ `, { id })
48
+ .toPromise());
49
+ return data.embeddedUpdate.deleteEmbeddedUpdate;
50
+ },
37
51
  };
@@ -0,0 +1,18 @@
1
+ import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
2
+ import { Connection } from '../../utils/relay';
3
+ import { EmbeddedUpdateFilterInput, ViewEmbeddedUpdateByIdQuery } from '../generated';
4
+ export declare function isEmbeddedUpdateNotFoundError(error: unknown): boolean;
5
+ export type EmbeddedUpdateFragment = ViewEmbeddedUpdateByIdQuery['embeddedUpdates']['byId'];
6
+ export type EmbeddedUpdateFilter = EmbeddedUpdateFilterInput;
7
+ export declare const EmbeddedUpdateQuery: {
8
+ viewByIdAsync(graphqlClient: ExpoGraphqlClient, { embeddedUpdateId, appId }: {
9
+ embeddedUpdateId: string;
10
+ appId: string;
11
+ }): Promise<EmbeddedUpdateFragment>;
12
+ viewPaginatedAsync(graphqlClient: ExpoGraphqlClient, { appId, filter, first, after, }: {
13
+ appId: string;
14
+ filter?: EmbeddedUpdateFilter;
15
+ first: number;
16
+ after?: string;
17
+ }): Promise<Connection<EmbeddedUpdateFragment>>;
18
+ };
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmbeddedUpdateQuery = void 0;
4
+ exports.isEmbeddedUpdateNotFoundError = isEmbeddedUpdateNotFoundError;
5
+ const tslib_1 = require("tslib");
6
+ const core_1 = require("@urql/core");
7
+ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
8
+ const client_1 = require("../client");
9
+ function isEmbeddedUpdateNotFoundError(error) {
10
+ return (error instanceof core_1.CombinedError &&
11
+ error.graphQLErrors.some(e => e.extensions?.['errorCode'] === 'EMBEDDED_UPDATE_NOT_FOUND'));
12
+ }
13
+ exports.EmbeddedUpdateQuery = {
14
+ async viewByIdAsync(graphqlClient, { embeddedUpdateId, appId }) {
15
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
16
+ .query((0, graphql_tag_1.default) `
17
+ query ViewEmbeddedUpdateById($embeddedUpdateId: ID!, $appId: ID!) {
18
+ embeddedUpdates {
19
+ byId(embeddedUpdateId: $embeddedUpdateId, appId: $appId) {
20
+ id
21
+ platform
22
+ runtimeVersion
23
+ channel
24
+ createdAt
25
+ launchAsset {
26
+ id
27
+ fileSize
28
+ finalFileSize
29
+ fileSHA256
30
+ }
31
+ }
32
+ }
33
+ }
34
+ `, { embeddedUpdateId, appId }, { additionalTypenames: ['EmbeddedUpdate'] })
35
+ .toPromise());
36
+ return data.embeddedUpdates.byId;
37
+ },
38
+ async viewPaginatedAsync(graphqlClient, { appId, filter, first, after, }) {
39
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
40
+ .query((0, graphql_tag_1.default) `
41
+ query ViewEmbeddedUpdatesPaginated(
42
+ $appId: String!
43
+ $first: Int!
44
+ $after: String
45
+ $filter: EmbeddedUpdateFilterInput
46
+ ) {
47
+ app {
48
+ byId(appId: $appId) {
49
+ id
50
+ embeddedUpdatesPaginated(first: $first, after: $after, filter: $filter) {
51
+ edges {
52
+ cursor
53
+ node {
54
+ id
55
+ platform
56
+ runtimeVersion
57
+ channel
58
+ createdAt
59
+ launchAsset {
60
+ id
61
+ fileSize
62
+ finalFileSize
63
+ fileSHA256
64
+ }
65
+ }
66
+ }
67
+ pageInfo {
68
+ hasNextPage
69
+ hasPreviousPage
70
+ startCursor
71
+ endCursor
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ `, { appId, first, after, filter }, { additionalTypenames: ['EmbeddedUpdate'] })
78
+ .toPromise());
79
+ return data.app.byId.embeddedUpdatesPaginated;
80
+ },
81
+ };
@@ -1,8 +1,9 @@
1
1
  import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
2
- import { UpdateByIdQueryVariables, UpdateFragment, ViewUpdateGroupsOnAppQueryVariables, ViewUpdateGroupsOnBranchQueryVariables, ViewUpdatesByGroupQueryVariables } from '../generated';
2
+ import { UpdateByIdQueryVariables, UpdateFragment, ViewUpdateGroupsOnAppQueryVariables, ViewUpdateGroupsOnBranchQueryVariables, ViewUpdateGroupsPaginatedOnBranchQueryVariables, ViewUpdatesByGroupQueryVariables } from '../generated';
3
3
  export declare const UpdateQuery: {
4
4
  viewUpdateGroupAsync(graphqlClient: ExpoGraphqlClient, { groupId }: ViewUpdatesByGroupQueryVariables): Promise<UpdateFragment[]>;
5
5
  viewUpdateGroupsOnBranchAsync(graphqlClient: ExpoGraphqlClient, { limit, offset, appId, branchName, filter }: ViewUpdateGroupsOnBranchQueryVariables): Promise<UpdateFragment[][]>;
6
+ viewUpdateGroupsPaginatedOnBranchAsync(graphqlClient: ExpoGraphqlClient, { appId, branchName, first, last, after, before, filter, }: ViewUpdateGroupsPaginatedOnBranchQueryVariables): Promise<UpdateFragment[][]>;
6
7
  viewUpdateGroupsOnAppAsync(graphqlClient: ExpoGraphqlClient, { limit, offset, appId, filter }: ViewUpdateGroupsOnAppQueryVariables): Promise<UpdateFragment[][]>;
7
8
  viewByUpdateAsync(graphqlClient: ExpoGraphqlClient, { updateId }: UpdateByIdQueryVariables): Promise<UpdateFragment>;
8
9
  };
@@ -64,6 +64,58 @@ exports.UpdateQuery = {
64
64
  }
65
65
  return branch.updateGroups;
66
66
  },
67
+ async viewUpdateGroupsPaginatedOnBranchAsync(graphqlClient, { appId, branchName, first, last, after, before, filter, }) {
68
+ const response = await (0, client_1.withErrorHandlingAsync)(graphqlClient
69
+ .query((0, graphql_tag_1.default) `
70
+ query ViewUpdateGroupsPaginatedOnBranch(
71
+ $appId: String!
72
+ $branchName: String!
73
+ $first: Int
74
+ $last: Int
75
+ $after: String
76
+ $before: String
77
+ $filter: UpdatesFilterV2
78
+ ) {
79
+ app {
80
+ byId(appId: $appId) {
81
+ id
82
+ updateBranchByName(name: $branchName) {
83
+ id
84
+ updateGroupsPaginated(
85
+ first: $first
86
+ last: $last
87
+ after: $after
88
+ before: $before
89
+ filter: $filter
90
+ ) {
91
+ edges {
92
+ node {
93
+ id
94
+ ...UpdateFragment
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ${(0, graphql_1.print)(Update_1.UpdateFragmentNode)}
103
+ `, {
104
+ appId,
105
+ branchName,
106
+ first,
107
+ last,
108
+ after,
109
+ before,
110
+ filter,
111
+ }, { additionalTypenames: ['Update'] })
112
+ .toPromise());
113
+ const branch = response.app.byId.updateBranchByName;
114
+ if (!branch) {
115
+ throw new Error(`Could not find branch "${branchName}"`);
116
+ }
117
+ return branch.updateGroupsPaginated.edges.map(edge => edge.node);
118
+ },
67
119
  async viewUpdateGroupsOnAppAsync(graphqlClient, { limit, offset, appId, filter }) {
68
120
  const response = await (0, client_1.withErrorHandlingAsync)(graphqlClient
69
121
  .query((0, graphql_tag_1.default) `
@@ -0,0 +1,7 @@
1
+ export declare const SIMULATOR_DOTENV_FILE_NAME = ".env.eas-simulator";
2
+ export declare const EAS_SIMULATOR_SESSION_ID = "EAS_SIMULATOR_SESSION_ID";
3
+ export declare const SIMULATOR_DOTENV_FILE_HEADER = "# Do not commit this file.\n# Do not modify these values manually. They are managed by eas-cli.\n# It holds configuration only for the current simulator session.\n\n";
4
+ export declare function getSimulatorEnvFilePath(projectDir: string): string;
5
+ export declare function loadSimulatorEnvAsync(projectDir: string): Promise<void>;
6
+ export declare function writeSimulatorEnvAsync(projectDir: string, environmentVariables: Record<string, string>): Promise<void>;
7
+ export declare function resetSimulatorEnvAsync(projectDir: string): Promise<void>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SIMULATOR_DOTENV_FILE_HEADER = exports.EAS_SIMULATOR_SESSION_ID = exports.SIMULATOR_DOTENV_FILE_NAME = void 0;
4
+ exports.getSimulatorEnvFilePath = getSimulatorEnvFilePath;
5
+ exports.loadSimulatorEnvAsync = loadSimulatorEnvAsync;
6
+ exports.writeSimulatorEnvAsync = writeSimulatorEnvAsync;
7
+ exports.resetSimulatorEnvAsync = resetSimulatorEnvAsync;
8
+ const tslib_1 = require("tslib");
9
+ const env_1 = require("@expo/env");
10
+ const fs = tslib_1.__importStar(require("fs-extra"));
11
+ const path_1 = tslib_1.__importDefault(require("path"));
12
+ exports.SIMULATOR_DOTENV_FILE_NAME = '.env.eas-simulator';
13
+ exports.EAS_SIMULATOR_SESSION_ID = 'EAS_SIMULATOR_SESSION_ID';
14
+ exports.SIMULATOR_DOTENV_FILE_HEADER = '# Do not commit this file.\n# Do not modify these values manually. They are managed by eas-cli.\n# It holds configuration only for the current simulator session.\n\n';
15
+ function getSimulatorEnvFilePath(projectDir) {
16
+ return path_1.default.join(projectDir, exports.SIMULATOR_DOTENV_FILE_NAME);
17
+ }
18
+ async function loadSimulatorEnvAsync(projectDir) {
19
+ const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
20
+ (0, env_1.loadProjectEnv)(projectDir, { silent: true });
21
+ (0, env_1.loadEnvFiles)([simulatorDotenvFilePath], { force: true });
22
+ }
23
+ async function writeSimulatorEnvAsync(projectDir, environmentVariables) {
24
+ const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
25
+ const simulatorDotenvContent = exports.SIMULATOR_DOTENV_FILE_HEADER +
26
+ Object.entries(environmentVariables)
27
+ .map(([key, value]) => `${key}=${JSON.stringify(value)}`)
28
+ .join('\n') +
29
+ '\n';
30
+ await fs.writeFile(simulatorDotenvFilePath, simulatorDotenvContent);
31
+ }
32
+ async function resetSimulatorEnvAsync(projectDir) {
33
+ const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
34
+ try {
35
+ await fs.writeFile(simulatorDotenvFilePath, exports.SIMULATOR_DOTENV_FILE_HEADER, { flag: 'r+' });
36
+ await fs.truncate(simulatorDotenvFilePath, Buffer.byteLength(exports.SIMULATOR_DOTENV_FILE_HEADER));
37
+ }
38
+ catch (err) {
39
+ if (typeof err === 'object' && err !== null && 'code' in err && err.code === 'ENOENT') {
40
+ return;
41
+ }
42
+ throw err;
43
+ }
44
+ }
@@ -4,5 +4,7 @@ export type DeviceRunSessionRemoteConfig = NonNullable<DeviceRunSessionByIdResul
4
4
  export declare const DEVICE_RUN_SESSION_TYPE_FLAG_VALUES: Record<DeviceRunSessionType, string>;
5
5
  export declare const DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE: Record<string, DeviceRunSessionType>;
6
6
  export declare function deviceRunSessionTypeToFlagValue(type: DeviceRunSessionType): string;
7
- export declare function formatRemoteSessionInstructions(remoteConfig: DeviceRunSessionRemoteConfig): string;
7
+ export declare function getRemoteSessionEnvironmentVariables(remoteConfig: DeviceRunSessionRemoteConfig): Record<string, string>;
8
+ type RemoteSessionInstructionsConfigType = 'env' | 'dotenv';
9
+ export declare function formatRemoteSessionInstructions(remoteConfig: DeviceRunSessionRemoteConfig, configType: RemoteSessionInstructionsConfigType): string;
8
10
  export {};
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = void 0;
4
4
  exports.deviceRunSessionTypeToFlagValue = deviceRunSessionTypeToFlagValue;
5
+ exports.getRemoteSessionEnvironmentVariables = getRemoteSessionEnvironmentVariables;
5
6
  exports.formatRemoteSessionInstructions = formatRemoteSessionInstructions;
6
7
  const generated_1 = require("../graphql/generated");
7
8
  // Mapping enum -> CLI flag value. Declared as Record<DeviceRunSessionType, string>
@@ -15,15 +16,33 @@ exports.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = Object.fromEntries(Object.entrie
15
16
  function deviceRunSessionTypeToFlagValue(type) {
16
17
  return exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES[type];
17
18
  }
18
- function formatRemoteSessionInstructions(remoteConfig) {
19
+ function getRemoteSessionEnvironmentVariables(remoteConfig) {
20
+ switch (remoteConfig.__typename) {
21
+ case 'AgentDeviceRunSessionRemoteConfig':
22
+ return {
23
+ AGENT_DEVICE_DAEMON_BASE_URL: remoteConfig.agentDeviceRemoteSessionUrl,
24
+ AGENT_DEVICE_DAEMON_AUTH_TOKEN: remoteConfig.agentDeviceRemoteSessionToken,
25
+ };
26
+ case 'ArgentRunSessionRemoteConfig':
27
+ case 'ServeSimRunSessionRemoteConfig':
28
+ return {};
29
+ }
30
+ }
31
+ function formatRemoteSessionInstructions(remoteConfig, configType) {
19
32
  switch (remoteConfig.__typename) {
20
33
  case 'AgentDeviceRunSessionRemoteConfig': {
21
- const lines = [
22
- '🔑 Run the following in your shell to attach to the agent-device daemon:',
23
- '',
24
- `export AGENT_DEVICE_DAEMON_BASE_URL='${remoteConfig.agentDeviceRemoteSessionUrl}'`,
25
- `export AGENT_DEVICE_DAEMON_AUTH_TOKEN='${remoteConfig.agentDeviceRemoteSessionToken}'`,
26
- ];
34
+ const environmentVariables = getRemoteSessionEnvironmentVariables(remoteConfig);
35
+ const lines = configType === 'dotenv'
36
+ ? [
37
+ '🔑 Run the following to use agent-device with the simulator:',
38
+ '',
39
+ 'eas simulator:exec agent-device <command>',
40
+ ]
41
+ : [
42
+ '🔑 Run the following in your shell to attach to the agent-device daemon:',
43
+ '',
44
+ ...Object.entries(environmentVariables).map(([key, value]) => `export ${key}='${value}'`),
45
+ ];
27
46
  if (remoteConfig.webPreviewUrl) {
28
47
  lines.push('', '🌐 Open the following URL in your browser to preview the simulator:', '', remoteConfig.webPreviewUrl);
29
48
  }