eas-cli 3.18.2 → 4.0.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 (52) hide show
  1. package/README.md +76 -65
  2. package/build/channel/branch-mapping.d.ts +1 -0
  3. package/build/channel/branch-mapping.js +11 -1
  4. package/build/channel/print-utils.d.ts +2 -0
  5. package/build/channel/print-utils.js +39 -0
  6. package/build/channel/queries.js +3 -3
  7. package/build/channel/utils.d.ts +0 -11
  8. package/build/channel/utils.js +1 -93
  9. package/build/commands/channel/edit.js +6 -1
  10. package/build/commands/channel/rollout.d.ts +14 -2
  11. package/build/commands/channel/rollout.js +106 -270
  12. package/build/commands/update/republish.d.ts +2 -21
  13. package/build/commands/update/republish.js +15 -6
  14. package/build/devices/actions/create/action.d.ts +2 -1
  15. package/build/devices/actions/create/action.js +10 -1
  16. package/build/devices/actions/create/currentMachineMethod.d.ts +3 -0
  17. package/build/devices/actions/create/currentMachineMethod.js +100 -0
  18. package/build/devices/actions/create/developerPortalMethod.js +2 -1
  19. package/build/devices/actions/create/inputMethod.d.ts +0 -1
  20. package/build/devices/actions/create/inputMethod.js +6 -64
  21. package/build/devices/actions/create/utils.d.ts +10 -0
  22. package/build/devices/actions/create/utils.js +73 -0
  23. package/build/devices/manager.js +3 -3
  24. package/build/devices/utils/errors.d.ts +3 -0
  25. package/build/devices/utils/errors.js +7 -1
  26. package/build/devices/utils/formatDevice.js +1 -0
  27. package/build/graphql/generated.d.ts +5 -4
  28. package/build/graphql/generated.js +1 -0
  29. package/build/graphql/types/credentials/AppleDevice.js +1 -0
  30. package/build/rollout/actions/CreateRollout.d.ts +2 -0
  31. package/build/rollout/actions/CreateRollout.js +79 -5
  32. package/build/rollout/actions/EditRollout.js +5 -2
  33. package/build/rollout/actions/EndRollout.d.ts +6 -3
  34. package/build/rollout/actions/EndRollout.js +22 -21
  35. package/build/rollout/actions/ManageRollout.d.ts +3 -3
  36. package/build/rollout/actions/ManageRollout.js +1 -1
  37. package/build/rollout/actions/NonInteractiveRollout.d.ts +6 -4
  38. package/build/rollout/actions/NonInteractiveRollout.js +1 -1
  39. package/build/rollout/actions/RolloutMainMenu.d.ts +4 -4
  40. package/build/rollout/actions/RolloutMainMenu.js +14 -5
  41. package/build/rollout/actions/SelectRuntime.d.ts +4 -7
  42. package/build/rollout/actions/SelectRuntime.js +22 -39
  43. package/build/rollout/branch-mapping.js +2 -2
  44. package/build/rollout/utils.d.ts +1 -1
  45. package/build/rollout/utils.js +5 -5
  46. package/build/update/republish.d.ts +3 -1
  47. package/build/update/republish.js +38 -15
  48. package/build/utils/relay.js +3 -9
  49. package/oclif.manifest.json +1 -1
  50. package/package.json +3 -3
  51. package/build/commands/channel/rollout-preview.d.ts +0 -32
  52. package/build/commands/channel/rollout-preview.js +0 -109
@@ -13,6 +13,7 @@ const getBranchNameFromChannelNameAsync_1 = require("../../update/getBranchNameF
13
13
  const queries_1 = require("../../update/queries");
14
14
  const republish_1 = require("../../update/republish");
15
15
  const utils_1 = require("../../update/utils");
16
+ const code_signing_1 = require("../../utils/code-signing");
16
17
  const json_1 = require("../../utils/json");
17
18
  const defaultRepublishPlatforms = ['android', 'ios'];
18
19
  class UpdateRepublish extends EasCommand_1.default {
@@ -25,6 +26,7 @@ class UpdateRepublish extends EasCommand_1.default {
25
26
  if (flags.json) {
26
27
  (0, json_1.enableJsonOutput)();
27
28
  }
29
+ const codeSigningInfo = await (0, code_signing_1.getCodeSigningInfoAsync)(exp, flags.privateKeyPath);
28
30
  const existingUpdates = await getOrAskUpdatesAsync(graphqlClient, projectId, flags);
29
31
  const updatesToPublish = existingUpdates.filter(update => flags.platform.includes(update.platform));
30
32
  if (existingUpdates.length === 0) {
@@ -34,14 +36,14 @@ class UpdateRepublish extends EasCommand_1.default {
34
36
  throw new Error(`There are no updates on branch "${existingUpdates[0].branchName}" published for the platform(s) "${rawFlags.platform}" with group ID "${flags.groupId ? flags.groupId : updatesToPublish[0].groupId}". Did you mean to publish a new update instead?`);
35
37
  }
36
38
  if (rawFlags.platform === 'all') {
37
- log_1.default.withTick(`The republished update will appear only on: ${rawFlags.platform}`);
39
+ log_1.default.withTick(`The republished update group will appear only on: ${rawFlags.platform}`);
38
40
  }
39
41
  else {
40
42
  const platformsFromUpdates = updatesToPublish.map(update => update.platform);
41
43
  if (platformsFromUpdates.length < defaultRepublishPlatforms.length) {
42
- log_1.default.warn(`You are republishing an update that wasn't published for all platforms.`);
44
+ log_1.default.warn(`You are republishing an update group that wasn't published for all platforms.`);
43
45
  }
44
- log_1.default.withTick(`The republished update will appear on the same platforms it was originally published on: ${platformsFromUpdates.join(', ')}`);
46
+ log_1.default.withTick(`The republished update group will appear on the same platforms it was originally published on: ${platformsFromUpdates.join(', ')}`);
45
47
  }
46
48
  const updateMessage = await getOrAskUpdateMessageAsync(updatesToPublish, flags);
47
49
  const arbitraryUpdate = updatesToPublish[0];
@@ -51,6 +53,7 @@ class UpdateRepublish extends EasCommand_1.default {
51
53
  updatesToPublish,
52
54
  targetBranch: { branchId: arbitraryUpdate.branchId, branchName: arbitraryUpdate.branchName },
53
55
  updateMessage,
56
+ codeSigningInfo,
54
57
  json: flags.json,
55
58
  });
56
59
  }
@@ -60,6 +63,7 @@ class UpdateRepublish extends EasCommand_1.default {
60
63
  const channelName = rawFlags.channel;
61
64
  const groupId = rawFlags.group;
62
65
  const nonInteractive = rawFlags['non-interactive'];
66
+ const privateKeyPath = rawFlags['private-key-path'];
63
67
  if (nonInteractive && !groupId) {
64
68
  throw new Error('Only --group can be used in non-interactive mode');
65
69
  }
@@ -73,6 +77,7 @@ class UpdateRepublish extends EasCommand_1.default {
73
77
  groupId,
74
78
  platform,
75
79
  updateMessage: rawFlags.message,
80
+ privateKeyPath,
76
81
  json: (_b = rawFlags.json) !== null && _b !== void 0 ? _b : false,
77
82
  nonInteractive,
78
83
  };
@@ -83,11 +88,11 @@ _a = UpdateRepublish;
83
88
  UpdateRepublish.description = 'roll back to an existing update';
84
89
  UpdateRepublish.flags = {
85
90
  channel: core_1.Flags.string({
86
- description: 'Channel name to select an update to republish from',
91
+ description: 'Channel name to select an update group to republish from',
87
92
  exclusive: ['branch', 'group'],
88
93
  }),
89
94
  branch: core_1.Flags.string({
90
- description: 'Branch name to select an update to republish from',
95
+ description: 'Branch name to select an update group to republish from',
91
96
  exclusive: ['channel', 'group'],
92
97
  }),
93
98
  group: core_1.Flags.string({
@@ -96,7 +101,7 @@ UpdateRepublish.flags = {
96
101
  }),
97
102
  message: core_1.Flags.string({
98
103
  char: 'm',
99
- description: 'Short message describing the republished update',
104
+ description: 'Short message describing the republished update group',
100
105
  required: false,
101
106
  }),
102
107
  platform: core_1.Flags.enum({
@@ -105,6 +110,10 @@ UpdateRepublish.flags = {
105
110
  default: 'all',
106
111
  required: false,
107
112
  }),
113
+ 'private-key-path': core_1.Flags.string({
114
+ description: `File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named "private-key.pem" in the certificate's directory.`,
115
+ required: false,
116
+ }),
108
117
  ...flags_1.EasNonInteractiveAndJsonFlags,
109
118
  };
110
119
  UpdateRepublish.contextDefinition = {
@@ -5,7 +5,8 @@ export declare enum RegistrationMethod {
5
5
  WEBSITE = 0,
6
6
  INPUT = 1,
7
7
  DEVELOPER_PORTAL = 2,
8
- EXIT = 3
8
+ CURRENT_MACHINE = 3,
9
+ EXIT = 4
9
10
  }
10
11
  export default class DeviceCreateAction {
11
12
  private graphqlClient;
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
6
  const log_1 = tslib_1.__importDefault(require("../../../log"));
7
7
  const prompts_1 = require("../../../prompts");
8
+ const currentMachineMethod_1 = require("./currentMachineMethod");
8
9
  const developerPortalMethod_1 = require("./developerPortalMethod");
9
10
  const inputMethod_1 = require("./inputMethod");
10
11
  const registrationUrlMethod_1 = require("./registrationUrlMethod");
@@ -13,7 +14,8 @@ var RegistrationMethod;
13
14
  RegistrationMethod[RegistrationMethod["WEBSITE"] = 0] = "WEBSITE";
14
15
  RegistrationMethod[RegistrationMethod["INPUT"] = 1] = "INPUT";
15
16
  RegistrationMethod[RegistrationMethod["DEVELOPER_PORTAL"] = 2] = "DEVELOPER_PORTAL";
16
- RegistrationMethod[RegistrationMethod["EXIT"] = 3] = "EXIT";
17
+ RegistrationMethod[RegistrationMethod["CURRENT_MACHINE"] = 3] = "CURRENT_MACHINE";
18
+ RegistrationMethod[RegistrationMethod["EXIT"] = 4] = "EXIT";
17
19
  })(RegistrationMethod = exports.RegistrationMethod || (exports.RegistrationMethod = {}));
18
20
  class DeviceCreateAction {
19
21
  constructor(graphqlClient, appStoreApi, account, appleTeam) {
@@ -33,6 +35,9 @@ class DeviceCreateAction {
33
35
  else if (method === RegistrationMethod.INPUT) {
34
36
  await (0, inputMethod_1.runInputMethodAsync)(this.graphqlClient, this.account.id, this.appleTeam);
35
37
  }
38
+ else if (method === RegistrationMethod.CURRENT_MACHINE) {
39
+ await (0, currentMachineMethod_1.runCurrentMachineMethodAsync)(this.graphqlClient, this.account.id, this.appleTeam);
40
+ }
36
41
  else if (method === RegistrationMethod.EXIT) {
37
42
  log_1.default.log('Bye!');
38
43
  process.exit(0);
@@ -57,6 +62,10 @@ class DeviceCreateAction {
57
62
  title: `${chalk_1.default.bold('Input')} - allows you to type in UDIDs (advanced option)`,
58
63
  value: RegistrationMethod.INPUT,
59
64
  },
65
+ {
66
+ title: `${chalk_1.default.bold('Current Machine')} - automatically sets the provisioning UDID of the current Apple Silicon machine`,
67
+ value: RegistrationMethod.CURRENT_MACHINE,
68
+ },
60
69
  { title: chalk_1.default.bold('Exit'), value: RegistrationMethod.EXIT },
61
70
  ],
62
71
  validate: (val) => Object.values(RegistrationMethod).includes(val),
@@ -0,0 +1,3 @@
1
+ import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
2
+ import { AppleTeam } from '../../../graphql/generated';
3
+ export declare function runCurrentMachineMethodAsync(graphqlClient: ExpoGraphqlClient, accountId: string, appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName' | 'id'>): Promise<void>;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runCurrentMachineMethodAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
6
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
+ const os_1 = tslib_1.__importDefault(require("os"));
8
+ const AppleDeviceMutation_1 = require("../../../credentials/ios/api/graphql/mutations/AppleDeviceMutation");
9
+ const generated_1 = require("../../../graphql/generated");
10
+ const log_1 = tslib_1.__importDefault(require("../../../log"));
11
+ const ora_1 = require("../../../ora");
12
+ const prompts_1 = require("../../../prompts");
13
+ const errors_1 = require("../../utils/errors");
14
+ const utils_1 = require("./utils");
15
+ async function runCurrentMachineMethodAsync(graphqlClient, accountId, appleTeam) {
16
+ log_1.default.newLine();
17
+ log_1.default.log(chalk_1.default.white('Checking if current machine is an Apple Silicon one.'));
18
+ if (!isMachineAppleSilicon()) {
19
+ throw new errors_1.DeviceCreateError("Current machine is not of Apple Silicon type - provisioning UDID can't be added automatically.");
20
+ }
21
+ log_1.default.log(chalk_1.default.green('Check successful.'));
22
+ await collectDataAndRegisterDeviceAsync(graphqlClient, { accountId, appleTeam });
23
+ }
24
+ exports.runCurrentMachineMethodAsync = runCurrentMachineMethodAsync;
25
+ function isMachineAppleSilicon() {
26
+ return os_1.default.cpus()[0].model.includes('Apple M') && process.platform === 'darwin';
27
+ }
28
+ async function collectDataAndRegisterDeviceAsync(graphqlClient, { accountId, appleTeam, }) {
29
+ const deviceData = await collectDeviceDataAsync(appleTeam);
30
+ if (!deviceData) {
31
+ return;
32
+ }
33
+ const { udid, deviceClass, name } = deviceData;
34
+ const spinner = (0, ora_1.ora)(`Registering Apple device on Expo`).start();
35
+ try {
36
+ await AppleDeviceMutation_1.AppleDeviceMutation.createAppleDeviceAsync(graphqlClient, {
37
+ appleTeamId: appleTeam.id,
38
+ identifier: udid,
39
+ name,
40
+ deviceClass: deviceClass !== null && deviceClass !== void 0 ? deviceClass : undefined,
41
+ }, accountId);
42
+ }
43
+ catch (err) {
44
+ spinner.fail();
45
+ throw err;
46
+ }
47
+ spinner.succeed();
48
+ }
49
+ async function collectDeviceDataAsync(appleTeam, initialValues = {}) {
50
+ log_1.default.log(chalk_1.default.white('Fetching the provisioning UDID.'));
51
+ const [udid, defaultMachineName] = await fetchCurrentMachineUDIDAsync();
52
+ log_1.default.log(chalk_1.default.green(`Fetched the provisioning UDID - ${udid}`));
53
+ const name = await (0, utils_1.promptForNameAsync)(defaultMachineName !== null && defaultMachineName !== void 0 ? defaultMachineName : initialValues.name);
54
+ const deviceClass = generated_1.AppleDeviceClass.Mac;
55
+ const deviceData = {
56
+ udid,
57
+ name,
58
+ deviceClass,
59
+ };
60
+ (0, utils_1.printDeviceData)(deviceData, appleTeam);
61
+ const registrationConfirmed = await (0, prompts_1.confirmAsync)({
62
+ message: 'Is this what you want to register?',
63
+ });
64
+ if (!registrationConfirmed) {
65
+ log_1.default.log('No worries, just try again.');
66
+ log_1.default.newLine();
67
+ return null;
68
+ }
69
+ else {
70
+ return deviceData;
71
+ }
72
+ }
73
+ async function fetchCurrentMachineUDIDAsync() {
74
+ var _a, _b;
75
+ try {
76
+ const profilerData = (await (0, spawn_async_1.default)('system_profiler', ['-json', 'SPHardwareDataType'])).stdout.trim();
77
+ if (!profilerData) {
78
+ const message = 'Failed to fetch the provisioning UDID from system profiler';
79
+ log_1.default.error(message);
80
+ throw new errors_1.DeviceCreateError(message);
81
+ }
82
+ const profilerDataJSON = JSON.parse(profilerData);
83
+ const provisioningUDID = (_a = profilerDataJSON === null || profilerDataJSON === void 0 ? void 0 : profilerDataJSON.SPHardwareDataType[0]) === null || _a === void 0 ? void 0 : _a.provisioning_UDID;
84
+ if (!provisioningUDID) {
85
+ const message = 'System profiler data did not contain the provisioning UDID';
86
+ log_1.default.error(message);
87
+ throw new errors_1.DeviceCreateError(message);
88
+ }
89
+ const defaultMachineName = (_b = profilerDataJSON === null || profilerDataJSON === void 0 ? void 0 : profilerDataJSON.SPHardwareDataType[0]) === null || _b === void 0 ? void 0 : _b.machine_name;
90
+ return [provisioningUDID, defaultMachineName];
91
+ }
92
+ catch (err) {
93
+ if (!(err instanceof errors_1.DeviceCreateError)) {
94
+ const message = `Failed to fetch the provisioning UDID of the current machine - ${err.message}`;
95
+ log_1.default.error(message);
96
+ throw new errors_1.DeviceCreateError(message);
97
+ }
98
+ throw err;
99
+ }
100
+ }
@@ -15,6 +15,7 @@ const DEVICE_IMPORT_CHUNK_SIZE = 10;
15
15
  const DEVICE_CLASS_TO_GRAPHQL_TYPE = {
16
16
  [apple_utils_1.DeviceClass.IPAD]: generated_1.AppleDeviceClass.Ipad,
17
17
  [apple_utils_1.DeviceClass.IPHONE]: generated_1.AppleDeviceClass.Iphone,
18
+ [apple_utils_1.DeviceClass.MAC]: generated_1.AppleDeviceClass.Mac,
18
19
  };
19
20
  async function runDeveloperPortalMethodAsync(graphqlClient, appStoreApi, accountId, appleTeam) {
20
21
  const appleAuthCtx = await appStoreApi.ensureAuthenticatedAsync();
@@ -61,7 +62,7 @@ async function findUnregisteredPortalDevicesAsync(graphqlClient, appleAuthCtx, a
61
62
  }, {});
62
63
  const portalDevices = await apple_utils_1.Device.getAsync((0, authenticate_1.getRequestContext)(appleAuthCtx));
63
64
  return portalDevices.filter(portalDevice => !(portalDevice.attributes.udid in expoRegisteredDevicesByUdid) &&
64
- [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE, apple_utils_1.DeviceClass.APPLE_TV].includes(portalDevice.attributes.deviceClass));
65
+ [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE, apple_utils_1.DeviceClass.APPLE_TV, apple_utils_1.DeviceClass.MAC].includes(portalDevice.attributes.deviceClass));
65
66
  }
66
67
  async function chooseDevicesToImportAsync(devices) {
67
68
  const { chosenDevices } = await (0, prompts_1.promptAsync)({
@@ -1,4 +1,3 @@
1
1
  import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
2
2
  import { AppleTeam } from '../../../graphql/generated';
3
3
  export declare function runInputMethodAsync(graphqlClient: ExpoGraphqlClient, accountId: string, appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName' | 'id'>): Promise<void>;
4
- export declare function promptForUDIDAsync(initial?: string): Promise<string>;
@@ -1,15 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptForUDIDAsync = exports.runInputMethodAsync = void 0;
3
+ exports.runInputMethodAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
6
  const AppleDeviceMutation_1 = require("../../../credentials/ios/api/graphql/mutations/AppleDeviceMutation");
7
- const generated_1 = require("../../../graphql/generated");
8
7
  const log_1 = tslib_1.__importDefault(require("../../../log"));
9
8
  const ora_1 = require("../../../ora");
10
9
  const prompts_1 = require("../../../prompts");
11
- const udids_1 = require("../../udids");
12
- const formatDevice_1 = require("../../utils/formatDevice");
10
+ const utils_1 = require("./utils");
13
11
  async function runInputMethodAsync(graphqlClient, accountId, appleTeam) {
14
12
  log_1.default.newLine();
15
13
  log_1.default.log(chalk_1.default.yellow('This is an advanced option. Use at your own risk.'));
@@ -42,20 +40,15 @@ async function collectDataAndRegisterDeviceAsync(graphqlClient, { accountId, app
42
40
  spinner.succeed();
43
41
  }
44
42
  async function collectDeviceDataAsync(appleTeam, initialValues = {}) {
45
- const udid = await promptForUDIDAsync(initialValues.udid);
46
- const name = await promptForNameAsync(initialValues.name);
47
- const deviceClass = await promptForDeviceClassAsync(initialValues.deviceClass);
43
+ const udid = await (0, utils_1.promptForUDIDAsync)(initialValues.udid);
44
+ const name = await (0, utils_1.promptForNameAsync)(initialValues.name);
45
+ const deviceClass = await (0, utils_1.promptForDeviceClassAsync)(initialValues.deviceClass);
48
46
  const deviceData = {
49
47
  udid,
50
48
  name,
51
49
  deviceClass,
52
50
  };
53
- log_1.default.newLine();
54
- log_1.default.log(`We are going to register the following device in our database.
55
- This device will ${chalk_1.default.bold('not')} be registered on the Apple Developer Portal until it is chosen for an internal distribution build.`);
56
- log_1.default.newLine();
57
- log_1.default.log((0, formatDevice_1.formatNewDevice)({ ...deviceData, identifier: deviceData.udid }, appleTeam));
58
- log_1.default.newLine();
51
+ (0, utils_1.printDeviceData)(deviceData, appleTeam);
59
52
  const registrationConfirmed = await (0, prompts_1.confirmAsync)({
60
53
  message: 'Is this what you want to register?',
61
54
  });
@@ -68,54 +61,3 @@ This device will ${chalk_1.default.bold('not')} be registered on the Apple Devel
68
61
  return deviceData;
69
62
  }
70
63
  }
71
- async function promptForUDIDAsync(initial) {
72
- const { udid } = await (0, prompts_1.promptAsync)({
73
- type: 'text',
74
- name: 'udid',
75
- message: 'UDID:',
76
- initial,
77
- validate: (rawVal) => {
78
- const val = (0, udids_1.normalizeUDID)(rawVal);
79
- if (!val || val === '') {
80
- return 'UDID cannot be empty';
81
- }
82
- else if (val.length !== 25 && val.length !== 40) {
83
- return 'UDID should be a 25 or 40-character string';
84
- }
85
- else if (!(0, udids_1.isValidUDID)(val)) {
86
- return 'UDID is invalid';
87
- }
88
- else {
89
- return true;
90
- }
91
- },
92
- format: (val) => (0, udids_1.normalizeUDID)(val),
93
- });
94
- return udid;
95
- }
96
- exports.promptForUDIDAsync = promptForUDIDAsync;
97
- async function promptForNameAsync(initial) {
98
- const { name } = await (0, prompts_1.promptAsync)({
99
- type: 'text',
100
- name: 'name',
101
- message: 'Device name (optional):',
102
- initial,
103
- });
104
- return name;
105
- }
106
- async function promptForDeviceClassAsync(initial) {
107
- const choices = [
108
- { title: 'iPhone', value: generated_1.AppleDeviceClass.Iphone },
109
- { title: 'iPad', value: generated_1.AppleDeviceClass.Ipad },
110
- { title: 'Not sure (leave empty)', value: null },
111
- ];
112
- const values = choices.map(({ value }) => value);
113
- const { deviceClass } = await (0, prompts_1.promptAsync)({
114
- type: 'select',
115
- name: 'deviceClass',
116
- message: 'Device class (optional):',
117
- choices,
118
- initial: initial !== undefined && values.indexOf(initial),
119
- });
120
- return deviceClass;
121
- }
@@ -0,0 +1,10 @@
1
+ import { AppleDeviceClass, AppleTeam } from '../../../graphql/generated';
2
+ export interface DeviceData {
3
+ udid: string;
4
+ name?: string;
5
+ deviceClass: AppleDeviceClass | null;
6
+ }
7
+ export declare function promptForDeviceClassAsync(initial?: AppleDeviceClass | null): Promise<AppleDeviceClass | null>;
8
+ export declare function promptForNameAsync(initial?: string): Promise<string | undefined>;
9
+ export declare function promptForUDIDAsync(initial?: string): Promise<string>;
10
+ export declare function printDeviceData(deviceData: DeviceData, appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName'>): void;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printDeviceData = exports.promptForUDIDAsync = exports.promptForNameAsync = exports.promptForDeviceClassAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const generated_1 = require("../../../graphql/generated");
7
+ const log_1 = tslib_1.__importDefault(require("../../../log"));
8
+ const prompts_1 = require("../../../prompts");
9
+ const udids_1 = require("../../udids");
10
+ const formatDevice_1 = require("../../utils/formatDevice");
11
+ async function promptForDeviceClassAsync(initial) {
12
+ const choices = [
13
+ { title: 'iPhone', value: generated_1.AppleDeviceClass.Iphone },
14
+ { title: 'iPad', value: generated_1.AppleDeviceClass.Ipad },
15
+ { title: 'Mac', value: generated_1.AppleDeviceClass.Mac },
16
+ { title: 'Not sure (leave empty)', value: null },
17
+ ];
18
+ const values = choices.map(({ value }) => value);
19
+ const { deviceClass } = await (0, prompts_1.promptAsync)({
20
+ type: 'select',
21
+ name: 'deviceClass',
22
+ message: 'Device class (optional):',
23
+ choices,
24
+ initial: initial !== undefined && values.indexOf(initial),
25
+ });
26
+ return deviceClass;
27
+ }
28
+ exports.promptForDeviceClassAsync = promptForDeviceClassAsync;
29
+ async function promptForNameAsync(initial) {
30
+ const { name } = await (0, prompts_1.promptAsync)({
31
+ type: 'text',
32
+ name: 'name',
33
+ message: 'Device name (optional):',
34
+ initial,
35
+ });
36
+ return name;
37
+ }
38
+ exports.promptForNameAsync = promptForNameAsync;
39
+ async function promptForUDIDAsync(initial) {
40
+ const { udid } = await (0, prompts_1.promptAsync)({
41
+ type: 'text',
42
+ name: 'udid',
43
+ message: 'UDID:',
44
+ initial,
45
+ validate: (rawVal) => {
46
+ const val = (0, udids_1.normalizeUDID)(rawVal);
47
+ if (!val || val === '') {
48
+ return 'UDID cannot be empty';
49
+ }
50
+ else if (val.length !== 25 && val.length !== 40) {
51
+ return 'UDID should be a 25 or 40-character string';
52
+ }
53
+ else if (!(0, udids_1.isValidUDID)(val)) {
54
+ return 'UDID is invalid';
55
+ }
56
+ else {
57
+ return true;
58
+ }
59
+ },
60
+ format: (val) => (0, udids_1.normalizeUDID)(val),
61
+ });
62
+ return udid;
63
+ }
64
+ exports.promptForUDIDAsync = promptForUDIDAsync;
65
+ function printDeviceData(deviceData, appleTeam) {
66
+ log_1.default.newLine();
67
+ log_1.default.log(`We are going to register the following device in our database.
68
+ This device will ${chalk_1.default.bold('not')} be registered on the Apple Developer Portal until it is chosen for an internal distribution build.`);
69
+ log_1.default.newLine();
70
+ log_1.default.log((0, formatDevice_1.formatNewDevice)({ ...deviceData, identifier: deviceData.udid }, appleTeam));
71
+ log_1.default.newLine();
72
+ }
73
+ exports.printDeviceData = printDeviceData;
@@ -10,10 +10,10 @@ const log_1 = tslib_1.__importDefault(require("../log"));
10
10
  const projectUtils_1 = require("../project/projectUtils");
11
11
  const prompts_1 = require("../prompts");
12
12
  const action_1 = tslib_1.__importDefault(require("./actions/create/action"));
13
- const CREATE_COMMAND_DESCRIPTION = `This command lets you register your Apple devices (iPhones and iPads) for internal distribution of your app.
13
+ const CREATE_COMMAND_DESCRIPTION = `This command lets you register your Apple devices (iPhones, iPads and Macs) for internal distribution of your app.
14
14
  Internal distribution means that you won't need to upload your app archive to App Store / Testflight.
15
- Your app archive (.ipa) will be installable on your equipment as long as you sign your application with an adhoc provisiong profile.
16
- The provisioning profile needs to contain the UDIDs (unique identifiers) of your iPhones and iPads.
15
+ Your app archive (.ipa) will be installable on your equipment as long as you sign your application with an adhoc provisioning profile.
16
+ The provisioning profile needs to contain the UDIDs (unique identifiers) of your iPhones, iPads and Macs.
17
17
 
18
18
  First of all, choose the Expo account under which you want to register your devices.
19
19
  Later, authenticate with Apple and choose your desired Apple Team (if your Apple ID has access to multiple teams).`;
@@ -1,3 +1,6 @@
1
1
  export declare class DeviceNotFoundError extends Error {
2
2
  constructor(message?: string);
3
3
  }
4
+ export declare class DeviceCreateError extends Error {
5
+ constructor(message?: string);
6
+ }
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceNotFoundError = void 0;
3
+ exports.DeviceCreateError = exports.DeviceNotFoundError = void 0;
4
4
  class DeviceNotFoundError extends Error {
5
5
  constructor(message) {
6
6
  super(message !== null && message !== void 0 ? message : 'Device not found.');
7
7
  }
8
8
  }
9
9
  exports.DeviceNotFoundError = DeviceNotFoundError;
10
+ class DeviceCreateError extends Error {
11
+ constructor(message) {
12
+ super(message !== null && message !== void 0 ? message : 'Failed to create a device.');
13
+ }
14
+ }
15
+ exports.DeviceCreateError = DeviceCreateError;
@@ -7,6 +7,7 @@ const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields
7
7
  const DEVICE_CLASS_DISPLAY_NAMES = {
8
8
  [generated_1.AppleDeviceClass.Iphone]: 'iPhone',
9
9
  [generated_1.AppleDeviceClass.Ipad]: 'iPad',
10
+ [generated_1.AppleDeviceClass.Mac]: 'Mac',
10
11
  };
11
12
  function formatDeviceClass(device) {
12
13
  if (!device.deviceClass || !DEVICE_CLASS_DISPLAY_NAMES[device.deviceClass]) {
@@ -1391,7 +1391,8 @@ export type AppleDevice = {
1391
1391
  };
1392
1392
  export declare enum AppleDeviceClass {
1393
1393
  Ipad = "IPAD",
1394
- Iphone = "IPHONE"
1394
+ Iphone = "IPHONE",
1395
+ Mac = "MAC"
1395
1396
  }
1396
1397
  export type AppleDeviceInput = {
1397
1398
  appleTeamId: Scalars['ID'];
@@ -3713,7 +3714,7 @@ export type SsoUser = Actor & UserActor & {
3713
3714
  twitterUsername?: Maybe<Scalars['String']>;
3714
3715
  username: Scalars['String'];
3715
3716
  /** Web notifications linked to a user */
3716
- webNotifications: Array<Notification>;
3717
+ websiteNotifications: Array<Notification>;
3717
3718
  };
3718
3719
  /** Represents a human SSO (not robot) actor. */
3719
3720
  export type SsoUserActivityTimelineProjectActivitiesArgs = {
@@ -4356,7 +4357,7 @@ export type User = Actor & UserActor & {
4356
4357
  /** @deprecated No longer supported */
4357
4358
  twitterUsername?: Maybe<Scalars['String']>;
4358
4359
  username: Scalars['String'];
4359
- webNotifications: Array<Notification>;
4360
+ websiteNotifications: Array<Notification>;
4360
4361
  };
4361
4362
  /** Represents a human (not robot) actor. */
4362
4363
  export type UserActivityTimelineProjectActivitiesArgs = {
@@ -4435,7 +4436,7 @@ export type UserActor = {
4435
4436
  twitterUsername?: Maybe<Scalars['String']>;
4436
4437
  username: Scalars['String'];
4437
4438
  /** Web notifications linked to a user */
4438
- webNotifications: Array<Notification>;
4439
+ websiteNotifications: Array<Notification>;
4439
4440
  };
4440
4441
  /** A human user (type User or SSOUser) that can login to the Expo website, use Expo services, and be a member of accounts. */
4441
4442
  export type UserActorActivityTimelineProjectActivitiesArgs = {
@@ -83,6 +83,7 @@ var AppleDeviceClass;
83
83
  (function (AppleDeviceClass) {
84
84
  AppleDeviceClass["Ipad"] = "IPAD";
85
85
  AppleDeviceClass["Iphone"] = "IPHONE";
86
+ AppleDeviceClass["Mac"] = "MAC";
86
87
  })(AppleDeviceClass = exports.AppleDeviceClass || (exports.AppleDeviceClass = {}));
87
88
  var AppsFilter;
88
89
  (function (AppsFilter) {
@@ -7,6 +7,7 @@ const generated_1 = require("../../generated");
7
7
  exports.APPLE_DEVICE_CLASS_LABELS = {
8
8
  [generated_1.AppleDeviceClass.Ipad]: 'iPad',
9
9
  [generated_1.AppleDeviceClass.Iphone]: 'iPhone',
10
+ [generated_1.AppleDeviceClass.Mac]: 'Mac',
10
11
  };
11
12
  exports.AppleDeviceFragmentNode = (0, graphql_tag_1.default) `
12
13
  fragment AppleDeviceFragment on AppleDevice {
@@ -18,6 +18,8 @@ export declare class CreateRollout implements EASUpdateAction<UpdateChannelBasic
18
18
  getChannelObjectAsync(ctx: EASUpdateContext, runtimeVersion: string): Promise<UpdateChannelObject>;
19
19
  getLatestUpdateGroupOnBranchAsync(ctx: EASUpdateContext, branchInfo: UpdateBranchBasicInfoFragment, runtimeVersion: string): Promise<UpdateFragment[] | null>;
20
20
  selectRuntimeVersionAsync(ctx: EASUpdateContext, branchToRollout: UpdateBranchBasicInfoFragment, defaultBranchId: string): Promise<string>;
21
+ selectRuntimeVersionFromAlternativeSourceAsync(ctx: EASUpdateContext, branchToRollout: UpdateBranchBasicInfoFragment, defaultBranch: UpdateBranchBasicInfoFragment): Promise<string>;
22
+ selectRuntimeVersionFromProjectConfigAsync(ctx: EASUpdateContext): Promise<string>;
21
23
  selectBranchAsync(ctx: EASUpdateContext, defaultBranchId: string): Promise<UpdateBranchBasicInfoFragment>;
22
24
  resolveBranchNameAsync(ctx: EASUpdateContext, branchName: string): Promise<UpdateBranchBasicInfoFragment>;
23
25
  }