eas-cli 18.8.0 → 18.9.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 (37) hide show
  1. package/README.md +162 -94
  2. package/build/build/utils/url.d.ts +6 -0
  3. package/build/build/utils/url.js +9 -0
  4. package/build/commands/build/download.d.ts +6 -2
  5. package/build/commands/build/download.js +129 -18
  6. package/build/commands/integrations/asc/connect.d.ts +19 -0
  7. package/build/commands/integrations/asc/connect.js +159 -0
  8. package/build/commands/integrations/asc/disconnect.d.ts +15 -0
  9. package/build/commands/integrations/asc/disconnect.js +115 -0
  10. package/build/commands/integrations/asc/status.d.ts +14 -0
  11. package/build/commands/integrations/asc/status.js +65 -0
  12. package/build/commands/simulator/start.d.ts +16 -0
  13. package/build/commands/simulator/start.js +205 -0
  14. package/build/commands/simulator/stop.d.ts +13 -0
  15. package/build/commands/simulator/stop.js +38 -0
  16. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +2 -1
  17. package/build/credentials/ios/actions/AscApiKeyUtils.js +16 -0
  18. package/build/credentials/ios/appstore/AppStoreApi.d.ts +3 -1
  19. package/build/credentials/ios/appstore/AppStoreApi.js +2 -2
  20. package/build/graphql/generated.d.ts +368 -0
  21. package/build/graphql/generated.js +23 -3
  22. package/build/graphql/mutations/AscAppLinkMutation.d.ts +12 -0
  23. package/build/graphql/mutations/AscAppLinkMutation.js +36 -0
  24. package/build/graphql/mutations/DeviceRunSessionMutation.d.ts +6 -0
  25. package/build/graphql/mutations/DeviceRunSessionMutation.js +49 -0
  26. package/build/graphql/queries/AscAppLinkQuery.d.ts +8 -0
  27. package/build/graphql/queries/AscAppLinkQuery.js +67 -0
  28. package/build/graphql/queries/DeviceRunSessionQuery.d.ts +5 -0
  29. package/build/graphql/queries/DeviceRunSessionQuery.js +28 -0
  30. package/build/integrations/asc/ascApiKey.d.ts +7 -0
  31. package/build/integrations/asc/ascApiKey.js +26 -0
  32. package/build/integrations/asc/utils.d.ts +21 -0
  33. package/build/integrations/asc/utils.js +56 -0
  34. package/build/utils/download.d.ts +1 -0
  35. package/build/utils/download.js +1 -0
  36. package/oclif.manifest.json +3152 -2671
  37. package/package.json +6 -3
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AscAppLinkQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_1 = require("graphql");
6
+ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
+ const client_1 = require("../client");
8
+ const Account_1 = require("../types/Account");
9
+ exports.AscAppLinkQuery = {
10
+ async getAppMetadataAsync(graphqlClient, appId, options) {
11
+ const useCache = options?.useCache ?? true;
12
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
13
+ .query((0, graphql_tag_1.default) `
14
+ query AscAppLinkAppMetadata($appId: String!) {
15
+ app {
16
+ byId(appId: $appId) {
17
+ id
18
+ fullName
19
+ ownerAccount {
20
+ id
21
+ ...AccountFragment
22
+ }
23
+ appStoreConnectApp {
24
+ id
25
+ ascAppIdentifier
26
+ remoteAppStoreConnectApp {
27
+ ascAppIdentifier
28
+ bundleIdentifier
29
+ name
30
+ appStoreIconUrl
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ${(0, graphql_1.print)(Account_1.AccountFragmentNode)}
37
+ `, { appId }, {
38
+ requestPolicy: useCache ? 'cache-first' : 'network-only',
39
+ additionalTypenames: ['App', 'AppStoreConnectApp'],
40
+ })
41
+ .toPromise());
42
+ return data.app.byId;
43
+ },
44
+ async discoverAccessibleAppsAsync(graphqlClient, appStoreConnectApiKeyId, bundleIdentifier) {
45
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
46
+ .query((0, graphql_tag_1.default) `
47
+ query DiscoverAccessibleAppStoreConnectApps(
48
+ $appStoreConnectApiKeyId: ID!
49
+ $bundleIdentifier: String
50
+ ) {
51
+ appStoreConnectApiKey {
52
+ byId(id: $appStoreConnectApiKeyId) {
53
+ id
54
+ remoteAppStoreConnectApps(bundleIdentifier: $bundleIdentifier) {
55
+ ascAppIdentifier
56
+ bundleIdentifier
57
+ name
58
+ appStoreIconUrl
59
+ }
60
+ }
61
+ }
62
+ }
63
+ `, { appStoreConnectApiKeyId, bundleIdentifier }, { additionalTypenames: ['AppStoreConnectApp'] })
64
+ .toPromise());
65
+ return data.appStoreConnectApiKey.byId?.remoteAppStoreConnectApps ?? [];
66
+ },
67
+ };
@@ -0,0 +1,5 @@
1
+ import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
2
+ import { DeviceRunSessionByIdQuery } from '../generated';
3
+ export declare const DeviceRunSessionQuery: {
4
+ byIdAsync(graphqlClient: ExpoGraphqlClient, deviceRunSessionId: string): Promise<DeviceRunSessionByIdQuery["deviceRunSessions"]["byId"]>;
5
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeviceRunSessionQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
+ const client_1 = require("../client");
7
+ exports.DeviceRunSessionQuery = {
8
+ async byIdAsync(graphqlClient, deviceRunSessionId) {
9
+ const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
10
+ .query((0, graphql_tag_1.default) `
11
+ query DeviceRunSessionByIdQuery($deviceRunSessionId: ID!) {
12
+ deviceRunSessions {
13
+ byId(deviceRunSessionId: $deviceRunSessionId) {
14
+ id
15
+ status
16
+ turtleJobRun {
17
+ id
18
+ status
19
+ logFileUrls
20
+ }
21
+ }
22
+ }
23
+ }
24
+ `, { deviceRunSessionId }, { requestPolicy: 'network-only' })
25
+ .toPromise());
26
+ return data.deviceRunSessions.byId;
27
+ },
28
+ };
@@ -0,0 +1,7 @@
1
+ import { CredentialsContext } from '../../credentials/context';
2
+ import { AccountFragment, AppStoreConnectApiKeyFragment } from '../../graphql/generated';
3
+ export declare function selectOrCreateAscApiKeyIdAsync({ credentialsContext, existingKeys, ownerAccount, }: {
4
+ credentialsContext: CredentialsContext;
5
+ existingKeys: AppStoreConnectApiKeyFragment[];
6
+ ownerAccount: AccountFragment;
7
+ }): Promise<string>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectOrCreateAscApiKeyIdAsync = selectOrCreateAscApiKeyIdAsync;
4
+ const prompts_1 = require("../../prompts");
5
+ const AscApiKeyUtils_1 = require("../../credentials/ios/actions/AscApiKeyUtils");
6
+ async function selectOrCreateAscApiKeyIdAsync({ credentialsContext, existingKeys, ownerAccount, }) {
7
+ const sortedKeys = (0, AscApiKeyUtils_1.sortAscApiKeysByUpdatedAtDesc)(existingKeys);
8
+ const createKeyOption = {
9
+ title: '[Create or upload a new API key]',
10
+ value: '__create_new_key__',
11
+ };
12
+ const selectedValue = sortedKeys.length === 0
13
+ ? createKeyOption.value
14
+ : await (0, prompts_1.selectAsync)('Select an App Store Connect API key:', [
15
+ ...sortedKeys.map(key => ({
16
+ title: (0, AscApiKeyUtils_1.formatAscApiKey)(key),
17
+ value: key.id,
18
+ })),
19
+ createKeyOption,
20
+ ]);
21
+ if (selectedValue !== createKeyOption.value) {
22
+ return selectedValue;
23
+ }
24
+ const newKey = await credentialsContext.ios.createAscApiKeyAsync(credentialsContext.graphqlClient, ownerAccount, await (0, AscApiKeyUtils_1.provideOrGenerateAscApiKeyAsync)(credentialsContext, AscApiKeyUtils_1.AppStoreApiKeyPurpose.ASC_APP_CONNECTION));
25
+ return newKey.id;
26
+ }
@@ -0,0 +1,21 @@
1
+ import { CombinedError } from '@urql/core';
2
+ import { AscAppLinkQuery } from '../../graphql/queries/AscAppLinkQuery';
3
+ type AscAppLinkMetadata = Awaited<ReturnType<typeof AscAppLinkQuery.getAppMetadataAsync>>;
4
+ export type AscAppLinkStatus = 'not-connected' | 'connected' | 'invalid';
5
+ export interface AscAppLinkJsonOutput {
6
+ action: string;
7
+ project: string;
8
+ status: AscAppLinkStatus;
9
+ appStoreConnectApp: {
10
+ id: string;
11
+ ascAppIdentifier: string;
12
+ name: string | null;
13
+ bundleIdentifier: string | null;
14
+ appleUrl: string;
15
+ } | null;
16
+ }
17
+ export declare function buildJsonOutput(action: string, metadata: AscAppLinkMetadata): AscAppLinkJsonOutput;
18
+ export declare function buildInvalidJsonOutput(action: string, projectId: string): AscAppLinkJsonOutput;
19
+ export declare function isAscAuthenticationError(error: unknown): error is CombinedError;
20
+ export declare function formatAscAppLinkStatus(metadata: AscAppLinkMetadata): string;
21
+ export {};
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildJsonOutput = buildJsonOutput;
4
+ exports.buildInvalidJsonOutput = buildInvalidJsonOutput;
5
+ exports.isAscAuthenticationError = isAscAuthenticationError;
6
+ exports.formatAscAppLinkStatus = formatAscAppLinkStatus;
7
+ const tslib_1 = require("tslib");
8
+ const core_1 = require("@urql/core");
9
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
+ function buildJsonOutput(action, metadata) {
11
+ const link = metadata.appStoreConnectApp;
12
+ return {
13
+ action,
14
+ project: metadata.fullName,
15
+ status: link ? 'connected' : 'not-connected',
16
+ appStoreConnectApp: link
17
+ ? {
18
+ id: link.id,
19
+ ascAppIdentifier: link.ascAppIdentifier,
20
+ name: link.remoteAppStoreConnectApp.name ?? null,
21
+ bundleIdentifier: link.remoteAppStoreConnectApp.bundleIdentifier ?? null,
22
+ appleUrl: getAppleAppUrl(link.ascAppIdentifier),
23
+ }
24
+ : null,
25
+ };
26
+ }
27
+ function buildInvalidJsonOutput(action, projectId) {
28
+ return {
29
+ action,
30
+ project: projectId,
31
+ status: 'invalid',
32
+ appStoreConnectApp: null,
33
+ };
34
+ }
35
+ function isAscAuthenticationError(error) {
36
+ return (error instanceof core_1.CombinedError &&
37
+ error.graphQLErrors.some(e => e.message.includes('App Store Connect rejected this API key')));
38
+ }
39
+ function formatAscAppLinkStatus(metadata) {
40
+ const link = metadata.appStoreConnectApp;
41
+ if (!link) {
42
+ return `Project ${chalk_1.default.bold(metadata.fullName)}: ${chalk_1.default.yellow('Not connected')} to App Store Connect.`;
43
+ }
44
+ const lines = [
45
+ `Project ${chalk_1.default.bold(metadata.fullName)}: ${chalk_1.default.green('Connected')} to App Store Connect.`,
46
+ ` ASC App ID: ${chalk_1.default.bold(link.ascAppIdentifier)}`,
47
+ ];
48
+ const remote = link.remoteAppStoreConnectApp;
49
+ lines.push(` Name: ${remote.name}`);
50
+ lines.push(` Bundle ID: ${remote.bundleIdentifier}`);
51
+ lines.push(` Apple URL: ${getAppleAppUrl(link.ascAppIdentifier)}`);
52
+ return lines.join('\n');
53
+ }
54
+ function getAppleAppUrl(ascAppIdentifier) {
55
+ return `https://appstoreconnect.apple.com/apps/${encodeURIComponent(ascAppIdentifier)}/distribution`;
56
+ }
@@ -1,3 +1,4 @@
1
1
  import { AppPlatform } from '../graphql/generated';
2
+ export declare function downloadFileWithProgressTrackerAsync(url: string, outputPath: string, progressTrackerMessage: string | ((ratio: number, total: number) => string), progressTrackerCompletedMessage: string): Promise<void>;
2
3
  export declare function downloadAndMaybeExtractAppAsync(url: string, platform: AppPlatform, cachedAppPath?: string): Promise<string>;
3
4
  export declare function extractAppFromLocalArchiveAsync(appArchivePath: string, platform: AppPlatform): Promise<string>;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.downloadFileWithProgressTrackerAsync = downloadFileWithProgressTrackerAsync;
3
4
  exports.downloadAndMaybeExtractAppAsync = downloadAndMaybeExtractAppAsync;
4
5
  exports.extractAppFromLocalArchiveAsync = extractAppFromLocalArchiveAsync;
5
6
  const tslib_1 = require("tslib");