eas-cli 0.29.0 → 0.31.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 (148) hide show
  1. package/README.md +26 -26
  2. package/build/analytics.js +6 -9
  3. package/build/build/android/build.js +6 -8
  4. package/build/build/android/configure.d.ts +6 -1
  5. package/build/build/android/configure.js +31 -5
  6. package/build/build/android/prepareJob.js +3 -3
  7. package/build/build/android/version.d.ts +15 -0
  8. package/build/build/android/version.js +75 -1
  9. package/build/build/context.d.ts +2 -0
  10. package/build/build/context.js +8 -0
  11. package/build/build/ios/UpdatesModule.js +3 -1
  12. package/build/build/ios/configure.js +1 -1
  13. package/build/build/ios/credentials.js +2 -7
  14. package/build/build/ios/prepareJob.js +3 -14
  15. package/build/build/ios/version.d.ts +1 -1
  16. package/build/build/ios/version.js +5 -23
  17. package/build/build/utils/printBuildInfo.js +1 -1
  18. package/build/build/utils/updates.js +1 -1
  19. package/build/build/utils/version.d.ts +7 -0
  20. package/build/build/utils/version.js +37 -0
  21. package/build/commands/branch/create.js +1 -4
  22. package/build/commands/branch/delete.js +1 -4
  23. package/build/commands/branch/list.js +1 -4
  24. package/build/commands/branch/publish.js +2 -5
  25. package/build/commands/branch/rename.js +1 -4
  26. package/build/commands/branch/view.js +1 -4
  27. package/build/commands/build/cancel.js +1 -2
  28. package/build/commands/build/configure.js +2 -2
  29. package/build/commands/build/index.js +15 -6
  30. package/build/commands/build/list.js +1 -2
  31. package/build/commands/build/view.js +1 -2
  32. package/build/commands/channel/create.js +1 -4
  33. package/build/commands/channel/edit.js +1 -4
  34. package/build/commands/channel/list.js +1 -4
  35. package/build/commands/channel/rollout.js +1 -4
  36. package/build/commands/channel/view.js +1 -4
  37. package/build/commands/config.js +1 -2
  38. package/build/commands/credentials.js +5 -1
  39. package/build/commands/device/list.js +1 -2
  40. package/build/commands/device/view.js +1 -2
  41. package/build/commands/project/info.js +1 -4
  42. package/build/commands/project/init.js +1 -4
  43. package/build/commands/secret/create.js +1 -2
  44. package/build/commands/secret/delete.js +1 -2
  45. package/build/commands/secret/list.js +1 -2
  46. package/build/commands/submit.js +2 -3
  47. package/build/commands/webhook/create.js +1 -4
  48. package/build/commands/webhook/delete.js +1 -4
  49. package/build/commands/webhook/list.js +1 -4
  50. package/build/credentials/android/AndroidCredentialsProvider.d.ts +2 -2
  51. package/build/credentials/android/actions/AssignFcm.d.ts +2 -2
  52. package/build/credentials/android/actions/AssignGoogleServiceAccountKey.d.ts +8 -0
  53. package/build/credentials/android/actions/AssignGoogleServiceAccountKey.js +19 -0
  54. package/build/credentials/android/actions/BuildCredentialsUtils.d.ts +5 -5
  55. package/build/credentials/android/actions/CreateFcm.d.ts +2 -2
  56. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +3 -2
  57. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.js +19 -11
  58. package/build/credentials/android/actions/CreateKeystore.d.ts +2 -2
  59. package/build/credentials/android/actions/DownloadKeystore.d.ts +3 -3
  60. package/build/credentials/android/actions/RemoveFcm.d.ts +2 -2
  61. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +13 -0
  62. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.js +48 -0
  63. package/build/credentials/android/actions/RemoveKeystore.d.ts +2 -2
  64. package/build/credentials/android/actions/SetupBuildCredentials.d.ts +5 -5
  65. package/build/credentials/android/actions/SetupBuildCredentialsFromCredentialsJson.d.ts +2 -2
  66. package/build/credentials/android/actions/SetupGoogleServiceAccountKey.d.ts +10 -0
  67. package/build/credentials/android/actions/SetupGoogleServiceAccountKey.js +59 -0
  68. package/build/credentials/android/actions/UpdateCredentialsJson.d.ts +2 -2
  69. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +8 -0
  70. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.js +23 -0
  71. package/build/credentials/android/api/GraphqlClient.d.ts +5 -2
  72. package/build/credentials/android/api/GraphqlClient.js +20 -3
  73. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.d.ts +1 -0
  74. package/build/credentials/android/api/graphql/mutations/AndroidAppCredentialsMutation.js +26 -0
  75. package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.d.ts +1 -0
  76. package/build/credentials/android/api/graphql/mutations/GoogleServiceAccountKeyMutation.js +17 -0
  77. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +4 -0
  78. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +31 -0
  79. package/build/credentials/android/credentials.d.ts +2 -0
  80. package/build/credentials/android/utils/googleServiceAccountKey.d.ts +3 -0
  81. package/build/credentials/android/utils/googleServiceAccountKey.js +90 -1
  82. package/build/credentials/android/utils/printCredentials.js +67 -28
  83. package/build/credentials/context.d.ts +17 -21
  84. package/build/credentials/context.js +21 -26
  85. package/build/credentials/credentialsJson/update.d.ts +3 -3
  86. package/build/credentials/ios/IosCredentialsProvider.d.ts +2 -2
  87. package/build/credentials/ios/actions/AppleTeamUtils.d.ts +2 -2
  88. package/build/credentials/ios/actions/AssignPushKey.d.ts +2 -2
  89. package/build/credentials/ios/actions/BuildCredentialsUtils.d.ts +8 -8
  90. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +2 -2
  91. package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +2 -2
  92. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +2 -2
  93. package/build/credentials/ios/actions/CreatePushKey.d.ts +2 -2
  94. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +4 -4
  95. package/build/credentials/ios/actions/DistributionCertificateUtils.js +3 -3
  96. package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -2
  97. package/build/credentials/ios/actions/PushKeyUtils.d.ts +4 -4
  98. package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -3
  99. package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +2 -2
  100. package/build/credentials/ios/actions/RemovePushKey.d.ts +3 -3
  101. package/build/credentials/ios/actions/SetupAdhocProvisioningProfile.d.ts +4 -3
  102. package/build/credentials/ios/actions/SetupAdhocProvisioningProfile.js +48 -4
  103. package/build/credentials/ios/actions/SetupBuildCredentials.d.ts +2 -2
  104. package/build/credentials/ios/actions/SetupBuildCredentialsFromCredentialsJson.d.ts +2 -2
  105. package/build/credentials/ios/actions/SetupDistributionCertificate.d.ts +3 -3
  106. package/build/credentials/ios/actions/SetupInternalProvisioningProfile.d.ts +2 -2
  107. package/build/credentials/ios/actions/SetupProvisioningProfile.d.ts +6 -6
  108. package/build/credentials/ios/actions/SetupPushKey.d.ts +3 -3
  109. package/build/credentials/ios/actions/SetupTargetBuildCredentials.d.ts +4 -4
  110. package/build/credentials/ios/actions/SetupTargetBuildCredentialsFromCredentialsJson.d.ts +5 -5
  111. package/build/credentials/ios/actions/UpdateCredentialsJson.d.ts +2 -2
  112. package/build/credentials/ios/appstore/AppStoreApi.d.ts +4 -15
  113. package/build/credentials/ios/appstore/AppStoreApi.js +4 -12
  114. package/build/credentials/ios/appstore/entitlements.js +14 -13
  115. package/build/credentials/ios/utils/printCredentials.js +83 -51
  116. package/build/credentials/ios/validators/validateDistributionCertificate.d.ts +2 -2
  117. package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +2 -2
  118. package/build/credentials/ios/validators/validatePushKey.d.ts +2 -2
  119. package/build/credentials/manager/HelperActions.d.ts +4 -0
  120. package/build/credentials/manager/ManageAndroid.d.ts +18 -12
  121. package/build/credentials/manager/ManageAndroid.js +72 -10
  122. package/build/credentials/manager/ManageIos.d.ts +3 -2
  123. package/build/credentials/manager/SelectAndroidBuildCredentials.d.ts +3 -3
  124. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +3 -4
  125. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +0 -1
  126. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.d.ts +3 -3
  127. package/build/credentials/manager/SelectPlatform.d.ts +3 -3
  128. package/build/devices/context.js +1 -1
  129. package/build/graphql/generated.d.ts +60 -1
  130. package/build/graphql/types/credentials/AndroidAppCredentials.js +6 -0
  131. package/build/project/android/applicationId.js +2 -2
  132. package/build/project/projectUtils.d.ts +4 -1
  133. package/build/project/projectUtils.js +13 -3
  134. package/build/project/publish.d.ts +3 -3
  135. package/build/project/publish.js +10 -10
  136. package/build/submit/android/AndroidSubmitCommand.js +3 -8
  137. package/build/submit/android/AndroidSubmitter.js +31 -9
  138. package/build/submit/android/ServiceAccountSource.d.ts +24 -5
  139. package/build/submit/android/ServiceAccountSource.js +54 -75
  140. package/build/submit/context.d.ts +14 -7
  141. package/build/submit/context.js +18 -4
  142. package/build/submit/ios/AppProduce.js +3 -3
  143. package/build/submit/ios/AppSpecificPasswordSource.js +1 -1
  144. package/build/submit/ios/IosSubmitCommand.js +1 -1
  145. package/build/utils/json.js +2 -6
  146. package/build/vcs/local.js +7 -7
  147. package/oclif.manifest.json +1 -1
  148. package/package.json +9 -8
@@ -1,13 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readAndValidateServiceAccountKey = exports.MinimalGoogleServiceAccountKeySchema = void 0;
3
+ exports.detectGoogleServiceAccountKeyPathAsync = exports.selectGoogleServiceAccountKeyAsync = exports.readAndValidateServiceAccountKey = exports.MinimalGoogleServiceAccountKeySchema = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
6
+ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
+ const fast_glob_1 = (0, tslib_1.__importDefault)(require("fast-glob"));
6
8
  const joi_1 = (0, tslib_1.__importDefault)(require("joi"));
9
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
7
10
  const log_1 = (0, tslib_1.__importStar)(require("../../../log"));
11
+ const prompts_1 = require("../../../prompts");
12
+ const date_1 = require("../../../utils/date");
8
13
  exports.MinimalGoogleServiceAccountKeySchema = joi_1.default.object({
14
+ type: joi_1.default.string().required(),
9
15
  private_key: joi_1.default.string().required(),
16
+ client_email: joi_1.default.string().required(),
10
17
  });
18
+ function fileIsServiceAccountKey(keyJsonPath) {
19
+ try {
20
+ readAndValidateServiceAccountKey(keyJsonPath);
21
+ return true;
22
+ }
23
+ catch (err) {
24
+ return false;
25
+ }
26
+ }
11
27
  function readAndValidateServiceAccountKey(keyJsonPath) {
12
28
  try {
13
29
  const jsonKeyObject = json_file_1.default.read(keyJsonPath);
@@ -32,3 +48,76 @@ function readAndValidateServiceAccountKey(keyJsonPath) {
32
48
  }
33
49
  }
34
50
  exports.readAndValidateServiceAccountKey = readAndValidateServiceAccountKey;
51
+ async function selectGoogleServiceAccountKeyAsync(keys) {
52
+ const sortedKeys = sortGoogleServiceAccountKeysByUpdatedAtDesc(keys);
53
+ const { chosenKey } = await (0, prompts_1.promptAsync)({
54
+ type: 'select',
55
+ name: 'chosenKey',
56
+ message: 'Select a Google Service Account Key:',
57
+ choices: sortedKeys.map(key => ({
58
+ title: formatGoogleServiceAccountKey(key),
59
+ value: key,
60
+ })),
61
+ });
62
+ return chosenKey;
63
+ }
64
+ exports.selectGoogleServiceAccountKeyAsync = selectGoogleServiceAccountKeyAsync;
65
+ function sortGoogleServiceAccountKeysByUpdatedAtDesc(keys) {
66
+ return keys.sort((keyA, keyB) => new Date(keyB.updatedAt).getTime() - new Date(keyA.updatedAt).getTime());
67
+ }
68
+ function formatGoogleServiceAccountKey({ projectIdentifier, privateKeyIdentifier, clientEmail, clientIdentifier, updatedAt, }) {
69
+ let line = `Client Email: ${clientEmail}, Project Id: ${projectIdentifier}`;
70
+ line += chalk_1.default.gray(`\n Client Id: ${clientIdentifier}, Private Key Id: ${privateKeyIdentifier}`);
71
+ line += chalk_1.default.gray(`\n Updated: ${(0, date_1.fromNow)(new Date(updatedAt))} ago,`);
72
+ return line;
73
+ }
74
+ async function detectGoogleServiceAccountKeyPathAsync(projectDir) {
75
+ const foundFilePaths = await (0, fast_glob_1.default)('**/*.json', {
76
+ cwd: projectDir,
77
+ ignore: ['app.json', 'package*.json', 'tsconfig.json', 'node_modules'],
78
+ });
79
+ const googleServiceFiles = foundFilePaths
80
+ .map(file => path_1.default.join(projectDir, file))
81
+ .filter(fileIsServiceAccountKey);
82
+ if (googleServiceFiles.length > 1) {
83
+ const selectedPath = await displayPathChooserAsync(googleServiceFiles, projectDir);
84
+ if (selectedPath) {
85
+ return selectedPath;
86
+ }
87
+ }
88
+ else if (googleServiceFiles.length === 1) {
89
+ const [detectedPath] = googleServiceFiles;
90
+ if (await confirmDetectedPathAsync(detectedPath)) {
91
+ return detectedPath;
92
+ }
93
+ }
94
+ return null;
95
+ }
96
+ exports.detectGoogleServiceAccountKeyPathAsync = detectGoogleServiceAccountKeyPathAsync;
97
+ async function displayPathChooserAsync(paths, projectDir) {
98
+ const choices = paths.map(f => ({
99
+ value: f,
100
+ title: f.startsWith(projectDir) ? path_1.default.relative(projectDir, f) : f,
101
+ }));
102
+ choices.push({
103
+ title: 'None of the above',
104
+ value: null,
105
+ });
106
+ log_1.default.log('Multiple Google Service Account JSON keys have been found inside your project directory.');
107
+ const { selectedPath } = await (0, prompts_1.promptAsync)({
108
+ name: 'selectedPath',
109
+ type: 'select',
110
+ message: 'Choose the key you want to use:',
111
+ choices,
112
+ });
113
+ log_1.default.addNewLineIfNone();
114
+ return selectedPath;
115
+ }
116
+ async function confirmDetectedPathAsync(path) {
117
+ log_1.default.log(`A Google Service Account JSON key has been found at\n ${chalk_1.default.underline(path)}`);
118
+ const confirm = await (0, prompts_1.confirmAsync)({
119
+ message: 'Would you like to use this file?',
120
+ });
121
+ log_1.default.addNewLineIfNone();
122
+ return confirm;
123
+ }
@@ -6,40 +6,71 @@ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
6
6
  const generated_1 = require("../../../graphql/generated");
7
7
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
8
8
  const date_1 = require("../../../utils/date");
9
+ const formatFields_1 = (0, tslib_1.__importDefault)(require("../../../utils/formatFields"));
9
10
  const BuildCredentialsUtils_1 = require("../actions/BuildCredentialsUtils");
10
11
  function displayEmptyAndroidCredentials(appLookupParams) {
11
12
  const { projectName, androidApplicationIdentifier } = appLookupParams;
12
- log_1.default.log(chalk_1.default.bold(`Android Credentials`));
13
- log_1.default.log(` Project: ${projectName}`);
14
- log_1.default.log(` Application Identifier: ${androidApplicationIdentifier}`);
15
- log_1.default.log(` No credentials set up yet!`);
13
+ const fields = [
14
+ { label: 'Android Credentials', value: '' },
15
+ { label: 'Project', value: projectName },
16
+ { label: 'Application Identifier', value: androidApplicationIdentifier },
17
+ ];
18
+ log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
19
+ log_1.default.log((0, formatFields_1.default)([{ label: 'No credentials set up yet!', value: '' }]));
20
+ log_1.default.newLine();
16
21
  }
17
22
  exports.displayEmptyAndroidCredentials = displayEmptyAndroidCredentials;
18
23
  function displayAndroidFcmCredentials(appCredentials) {
19
24
  const maybeFcm = appCredentials.androidFcm;
20
- log_1.default.log(` Push Notifications (FCM):`);
25
+ log_1.default.log((0, formatFields_1.default)([{ label: 'Push Notifications (FCM)', value: '' }], {
26
+ labelFormat: chalk_1.default.cyan.bold,
27
+ }));
21
28
  if (!maybeFcm) {
22
- log_1.default.log(` None assigned yet`);
29
+ log_1.default.log((0, formatFields_1.default)([{ label: '', value: 'None assigned yet' }]));
23
30
  log_1.default.newLine();
24
31
  return;
25
32
  }
26
33
  const { snippet, version, updatedAt } = maybeFcm;
34
+ const fields = [];
27
35
  if (version === generated_1.AndroidFcmVersion.Legacy) {
28
36
  const { firstFourCharacters, lastFourCharacters } = snippet;
29
- log_1.default.log(` Key: ${firstFourCharacters}...${lastFourCharacters}`);
37
+ fields.push({ label: 'Key', value: `${firstFourCharacters}...${lastFourCharacters}` });
30
38
  }
31
39
  else if (version === generated_1.AndroidFcmVersion.V1) {
32
40
  const { projectId, serviceAccountEmail, clientId, keyId } = snippet;
33
- log_1.default.log(` Project Id: ${projectId}`);
34
- log_1.default.log(` Service Account: ${serviceAccountEmail}`);
35
- log_1.default.log(` Client Id: ${clientId}`);
36
- log_1.default.log(` Key Id: ${keyId}`);
41
+ fields.push({ label: 'Project ID', value: projectId });
42
+ fields.push({ label: 'Client Email', value: serviceAccountEmail });
43
+ fields.push({ label: 'Client ID', value: clientId !== null && clientId !== void 0 ? clientId : 'Unknown' });
44
+ fields.push({ label: 'Private Key ID', value: keyId });
37
45
  }
38
- log_1.default.log(` Updated ${(0, date_1.fromNow)(new Date(updatedAt))} ago`);
46
+ fields.push({ label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` });
47
+ log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
48
+ log_1.default.newLine();
49
+ }
50
+ function displayGoogleServiceAccountKeyForSubmissions(appCredentials) {
51
+ const maybeGsaKey = appCredentials.googleServiceAccountKeyForSubmissions;
52
+ log_1.default.log((0, formatFields_1.default)([{ label: 'Google Service Account Key For Submissions', value: '' }], {
53
+ labelFormat: chalk_1.default.cyan.bold,
54
+ }));
55
+ if (!maybeGsaKey) {
56
+ log_1.default.log((0, formatFields_1.default)([{ label: '', value: 'None assigned yet' }]));
57
+ log_1.default.newLine();
58
+ return;
59
+ }
60
+ const { projectIdentifier, privateKeyIdentifier, clientEmail, clientIdentifier, updatedAt } = maybeGsaKey;
61
+ const fields = [
62
+ { label: 'Project ID', value: projectIdentifier },
63
+ { label: 'Client Email', value: clientEmail },
64
+ { label: 'Client ID', value: clientIdentifier },
65
+ { label: 'Private Key ID', value: privateKeyIdentifier },
66
+ { label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` },
67
+ ];
68
+ log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
39
69
  log_1.default.newLine();
40
70
  }
41
71
  function displayEASAndroidAppCredentials(appCredentials) {
42
72
  displayAndroidFcmCredentials(appCredentials);
73
+ displayGoogleServiceAccountKeyForSubmissions(appCredentials);
43
74
  const sortedBuildCredentialsList = (0, BuildCredentialsUtils_1.sortBuildCredentials)(appCredentials.androidAppBuildCredentialsList);
44
75
  for (const buildCredentials of sortedBuildCredentialsList) {
45
76
  displayAndroidBuildCredentials(buildCredentials);
@@ -62,36 +93,44 @@ function formatFingerprint(fingerprint) {
62
93
  }
63
94
  return bytes.join(':');
64
95
  }
65
- function displayAndroidBuildCredentials(buildCredentials, skipConfigurationDisplay) {
66
- if (!skipConfigurationDisplay) {
67
- const { isDefault, name } = buildCredentials;
68
- log_1.default.log(chalk_1.default.bold(` Configuration: ${name}${isDefault ? ' (Default)' : ''}`));
69
- }
96
+ function displayAndroidBuildCredentials(buildCredentials) {
97
+ const { isDefault, name } = buildCredentials;
98
+ log_1.default.log((0, formatFields_1.default)([{ label: `Configuration: ${name}${isDefault ? ' (Default)' : ''}`, value: '' }], {
99
+ labelFormat: chalk_1.default.cyan.bold,
100
+ }));
70
101
  const maybeKeystore = buildCredentials.androidKeystore;
71
- log_1.default.log(` Keystore:`);
102
+ log_1.default.log((0, formatFields_1.default)([{ label: 'Keystore', value: '' }], {
103
+ labelFormat: chalk_1.default.cyan.bold,
104
+ }));
72
105
  if (maybeKeystore) {
73
106
  displayAndroidKeystore(maybeKeystore);
74
107
  }
75
108
  else {
76
- log_1.default.log(` None assigned yet`);
109
+ log_1.default.log((0, formatFields_1.default)([{ label: '', value: 'None assigned yet' }]));
77
110
  }
78
111
  log_1.default.newLine();
79
112
  }
80
113
  function displayAndroidKeystore(keystore) {
81
114
  const { keyAlias, type, md5CertificateFingerprint, sha1CertificateFingerprint, sha256CertificateFingerprint, updatedAt, } = keystore;
82
- log_1.default.log(` Type: ${type}`);
83
- log_1.default.log(` Key Alias: ${keyAlias}`);
84
- log_1.default.log(` MD5 Fingerprint: ${formatFingerprint(md5CertificateFingerprint !== null && md5CertificateFingerprint !== void 0 ? md5CertificateFingerprint : null)}`);
85
- log_1.default.log(` SHA1 Fingerprint: ${formatFingerprint(sha1CertificateFingerprint !== null && sha1CertificateFingerprint !== void 0 ? sha1CertificateFingerprint : null)}`);
86
- log_1.default.log(` SHA256 Fingerprint: ${formatFingerprint(sha256CertificateFingerprint !== null && sha256CertificateFingerprint !== void 0 ? sha256CertificateFingerprint : null)}`);
87
- log_1.default.log(` Updated ${(0, date_1.fromNow)(new Date(updatedAt))} ago`);
115
+ const fields = [
116
+ { label: 'Type', value: type },
117
+ { label: 'Key Alias', value: keyAlias },
118
+ { label: 'MD5 Fingerprint', value: formatFingerprint(md5CertificateFingerprint !== null && md5CertificateFingerprint !== void 0 ? md5CertificateFingerprint : null) },
119
+ { label: 'SHA1 Fingerprint', value: formatFingerprint(sha1CertificateFingerprint !== null && sha1CertificateFingerprint !== void 0 ? sha1CertificateFingerprint : null) },
120
+ { label: 'SHA256 Fingerprint', value: formatFingerprint(sha256CertificateFingerprint !== null && sha256CertificateFingerprint !== void 0 ? sha256CertificateFingerprint : null) },
121
+ { label: 'Updated', value: `${(0, date_1.fromNow)(new Date(updatedAt))} ago` },
122
+ ];
123
+ log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
88
124
  }
89
125
  exports.displayAndroidKeystore = displayAndroidKeystore;
90
126
  function displayAndroidAppCredentials({ appLookupParams, appCredentials, }) {
91
127
  const { projectName, androidApplicationIdentifier } = appLookupParams;
92
- log_1.default.log(chalk_1.default.bold(`Android Credentials`));
93
- log_1.default.log(` Project: ${projectName}`);
94
- log_1.default.log(` Application Identifier: ${androidApplicationIdentifier}`);
128
+ const fields = [
129
+ { label: 'Android Credentials', value: '' },
130
+ { label: 'Project', value: projectName },
131
+ { label: 'Application Identifier', value: androidApplicationIdentifier },
132
+ ];
133
+ log_1.default.log((0, formatFields_1.default)(fields, { labelFormat: chalk_1.default.cyan.bold }));
95
134
  log_1.default.newLine();
96
135
  if (appCredentials) {
97
136
  displayEASAndroidAppCredentials(appCredentials);
@@ -3,29 +3,25 @@ import { Actor } from '../user/User';
3
3
  import * as AndroidGraphqlClient from './android/api/GraphqlClient';
4
4
  import * as IosGraphqlClient from './ios/api/GraphqlClient';
5
5
  import AppStoreApi from './ios/appstore/AppStoreApi';
6
- export interface Action<T = void> {
7
- runAsync(ctx: Context): Promise<T>;
8
- }
9
- interface AppleCtxOptions {
10
- appleId?: string;
11
- appleIdPassword?: string;
12
- teamId?: string;
13
- }
14
- interface Options extends AppleCtxOptions {
15
- nonInteractive?: boolean;
16
- exp?: ExpoConfig;
17
- }
18
- export interface Context {
19
- readonly projectDir: string;
20
- readonly user: Actor;
21
- readonly nonInteractive: boolean;
6
+ export declare class CredentialsContext {
7
+ private options;
22
8
  readonly android: typeof AndroidGraphqlClient;
23
- readonly ios: typeof IosGraphqlClient;
24
9
  readonly appStore: AppStoreApi;
25
- readonly hasProjectContext: boolean;
26
- readonly exp: ExpoConfig;
10
+ readonly ios: typeof IosGraphqlClient;
11
+ readonly nonInteractive: boolean;
12
+ readonly projectDir: string;
13
+ readonly user: Actor;
14
+ private shouldAskAuthenticateAppStore;
15
+ private _exp?;
16
+ constructor(options: {
17
+ exp?: ExpoConfig;
18
+ nonInteractive?: boolean;
19
+ projectDir: string;
20
+ user: Actor;
21
+ });
22
+ get hasProjectContext(): boolean;
23
+ get exp(): ExpoConfig;
27
24
  ensureProjectContext(): void;
25
+ logOwnerAndProject(): void;
28
26
  bestEffortAppStoreAuthenticateAsync(): Promise<void>;
29
27
  }
30
- export declare function createCredentialsContextAsync(projectDir: string, options: Options): Promise<Context>;
31
- export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCredentialsContextAsync = void 0;
3
+ exports.CredentialsContext = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
@@ -9,36 +9,29 @@ const expoConfig_1 = require("../project/expoConfig");
9
9
  const projectUtils_1 = require("../project/projectUtils");
10
10
  const prompts_1 = require("../prompts");
11
11
  const User_1 = require("../user/User");
12
- const actions_1 = require("../user/actions");
13
- const pick_1 = (0, tslib_1.__importDefault)(require("../utils/expodash/pick"));
14
12
  const AndroidGraphqlClient = (0, tslib_1.__importStar)(require("./android/api/GraphqlClient"));
15
13
  const IosGraphqlClient = (0, tslib_1.__importStar)(require("./ios/api/GraphqlClient"));
16
14
  const AppStoreApi_1 = (0, tslib_1.__importDefault)(require("./ios/appstore/AppStoreApi"));
17
- async function createCredentialsContextAsync(projectDir, options) {
18
- const user = await (0, actions_1.ensureLoggedInAsync)();
19
- let expoConfig = options.exp;
20
- if (!expoConfig) {
21
- try {
22
- expoConfig = (0, expoConfig_1.getExpoConfig)(projectDir);
23
- }
24
- catch (error) {
25
- // ignore error, context might be created outside of expo project
26
- }
27
- }
28
- return new CredentialsContext(projectDir, user, expoConfig, options);
29
- }
30
- exports.createCredentialsContextAsync = createCredentialsContextAsync;
31
15
  class CredentialsContext {
32
- constructor(projectDir, user, _exp, options) {
16
+ constructor(options) {
33
17
  var _a;
34
- this.projectDir = projectDir;
35
- this.user = user;
36
- this._exp = _exp;
18
+ this.options = options;
37
19
  this.android = AndroidGraphqlClient;
20
+ this.appStore = new AppStoreApi_1.default();
38
21
  this.ios = IosGraphqlClient;
39
22
  this.shouldAskAuthenticateAppStore = true;
40
- this.appStore = new AppStoreApi_1.default((0, pick_1.default)(options, ['appleId', 'appleIdPassword', 'teamId']));
23
+ this.projectDir = options.projectDir;
24
+ this.user = options.user;
41
25
  this.nonInteractive = (_a = options.nonInteractive) !== null && _a !== void 0 ? _a : false;
26
+ this._exp = options.exp;
27
+ if (!this._exp) {
28
+ try {
29
+ this._exp = (0, expoConfig_1.getExpoConfig)(options.projectDir);
30
+ }
31
+ catch (error) {
32
+ // ignore error, context might be created outside of expo project
33
+ }
34
+ }
42
35
  }
43
36
  get hasProjectContext() {
44
37
  return !!this._exp;
@@ -52,18 +45,19 @@ class CredentialsContext {
52
45
  return;
53
46
  }
54
47
  // trigger getConfig error
55
- (0, config_1.getConfig)(this.projectDir, { skipSDKVersionRequirement: true });
48
+ (0, config_1.getConfig)(this.options.projectDir, { skipSDKVersionRequirement: true });
56
49
  }
57
50
  logOwnerAndProject() {
58
51
  var _a;
52
+ const { user } = this.options;
59
53
  if (this.hasProjectContext) {
60
- const owner = (0, projectUtils_1.getProjectAccountName)(this.exp, this.user);
54
+ const owner = (0, projectUtils_1.getProjectAccountName)(this.exp, user);
61
55
  // Figure out if User A is configuring credentials as admin for User B's project
62
- const isProxyUser = this.user.__typename === 'Robot' || owner !== this.user.username;
56
+ const isProxyUser = user.__typename === 'Robot' || owner !== user.username;
63
57
  log_1.default.log(`Accessing credentials ${isProxyUser ? 'on behalf of' : 'for'} ${owner} in project ${this.exp.slug}`);
64
58
  }
65
59
  else {
66
- log_1.default.log(`Accessing credentials for ${(_a = this.exp.owner) !== null && _a !== void 0 ? _a : (0, User_1.getActorDisplayName)(this.user)}`);
60
+ log_1.default.log(`Accessing credentials for ${(_a = this.exp.owner) !== null && _a !== void 0 ? _a : (0, User_1.getActorDisplayName)(user)}`);
67
61
  }
68
62
  }
69
63
  async bestEffortAppStoreAuthenticateAsync() {
@@ -88,3 +82,4 @@ class CredentialsContext {
88
82
  this.shouldAskAuthenticateAppStore = false;
89
83
  }
90
84
  }
85
+ exports.CredentialsContext = CredentialsContext;
@@ -1,14 +1,14 @@
1
1
  import { AndroidAppBuildCredentialsFragment, IosDistributionType } from '../../graphql/generated';
2
- import { Context } from '../context';
2
+ import { CredentialsContext } from '../context';
3
3
  import { App, Target } from '../ios/types';
4
4
  /**
5
5
  * Update Android credentials.json with values from www, content of credentials.json
6
6
  * is not validated
7
7
  */
8
- export declare function updateAndroidCredentialsAsync(ctx: Context, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
8
+ export declare function updateAndroidCredentialsAsync(ctx: CredentialsContext, buildCredentials: AndroidAppBuildCredentialsFragment): Promise<void>;
9
9
  /**
10
10
  * Update iOS credentials in credentials.json with values from www, contents
11
11
  * of credentials.json are not validated, if www has incomplete credentials
12
12
  * credentials.json will be updated partially
13
13
  */
14
- export declare function updateIosCredentialsAsync(ctx: Context, app: App, targets: Target[], distributionType: IosDistributionType): Promise<void>;
14
+ export declare function updateIosCredentialsAsync(ctx: CredentialsContext, app: App, targets: Target[], distributionType: IosDistributionType): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { CredentialsSource, DistributionType, IosEnterpriseProvisioning } from '@expo/eas-json';
3
- import { Context } from '../context';
3
+ import { CredentialsContext } from '../context';
4
4
  import { IosCapabilitiesOptions } from './appstore/ensureAppExists';
5
5
  import { App, IosCredentials, Target } from './types';
6
6
  interface Options {
@@ -14,7 +14,7 @@ export default class IosCredentialsProvider {
14
14
  private ctx;
15
15
  private options;
16
16
  readonly platform = Platform.IOS;
17
- constructor(ctx: Context, options: Options);
17
+ constructor(ctx: CredentialsContext, options: Options);
18
18
  getCredentialsAsync(src: CredentialsSource.LOCAL | CredentialsSource.REMOTE): Promise<IosCredentials>;
19
19
  private getLocalAsync;
20
20
  private getRemoteAsync;
@@ -1,5 +1,5 @@
1
1
  import { AppleTeamFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare function resolveAppleTeamIfAuthenticatedAsync(ctx: Context, app: AppLookupParams): Promise<AppleTeamFragment | null>;
4
+ export declare function resolveAppleTeamIfAuthenticatedAsync(ctx: CredentialsContext, app: AppLookupParams): Promise<AppleTeamFragment | null>;
5
5
  export declare function formatAppleTeam({ appleTeamIdentifier, appleTeamName }: AppleTeamFragment): string;
@@ -1,8 +1,8 @@
1
1
  import { ApplePushKeyFragment, CommonIosAppCredentialsFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  export declare class AssignPushKey {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
- runAsync(ctx: Context, pushKey: ApplePushKeyFragment): Promise<CommonIosAppCredentialsFragment>;
7
+ runAsync(ctx: CredentialsContext, pushKey: ApplePushKeyFragment): Promise<CommonIosAppCredentialsFragment>;
8
8
  }
@@ -1,11 +1,11 @@
1
1
  import { AppleDistributionCertificateFragment, AppleProvisioningProfileFragment, AppleTeamFragment, IosDistributionType as GraphQLIosDistributionType, IosAppBuildCredentialsFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  import { App, Target } from '../types';
5
- export declare function getAllBuildCredentialsAsync(ctx: Context, app: AppLookupParams): Promise<IosAppBuildCredentialsFragment[]>;
6
- export declare function getBuildCredentialsAsync(ctx: Context, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType): Promise<IosAppBuildCredentialsFragment | null>;
7
- export declare function getProvisioningProfileAsync(ctx: Context, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType): Promise<AppleProvisioningProfileFragment | null>;
8
- export declare function getDistributionCertificateAsync(ctx: Context, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType): Promise<AppleDistributionCertificateFragment | null>;
9
- export declare function assignBuildCredentialsAsync(ctx: Context, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType, distCert: AppleDistributionCertificateFragment, provisioningProfile: AppleProvisioningProfileFragment, appleTeam?: AppleTeamFragment): Promise<IosAppBuildCredentialsFragment>;
10
- export declare function getAppFromContext(ctx: Context): App;
11
- export declare function getAppLookupParamsFromContext(ctx: Context, target: Target): AppLookupParams;
5
+ export declare function getAllBuildCredentialsAsync(ctx: CredentialsContext, app: AppLookupParams): Promise<IosAppBuildCredentialsFragment[]>;
6
+ export declare function getBuildCredentialsAsync(ctx: CredentialsContext, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType): Promise<IosAppBuildCredentialsFragment | null>;
7
+ export declare function getProvisioningProfileAsync(ctx: CredentialsContext, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType): Promise<AppleProvisioningProfileFragment | null>;
8
+ export declare function getDistributionCertificateAsync(ctx: CredentialsContext, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType): Promise<AppleDistributionCertificateFragment | null>;
9
+ export declare function assignBuildCredentialsAsync(ctx: CredentialsContext, app: AppLookupParams, iosDistributionType: GraphQLIosDistributionType, distCert: AppleDistributionCertificateFragment, provisioningProfile: AppleProvisioningProfileFragment, appleTeam?: AppleTeamFragment): Promise<IosAppBuildCredentialsFragment>;
10
+ export declare function getAppFromContext(ctx: CredentialsContext): App;
11
+ export declare function getAppLookupParamsFromContext(ctx: CredentialsContext, target: Target): AppLookupParams;
@@ -1,5 +1,5 @@
1
1
  import { AppleDistributionCertificateFragment, AppleProvisioningProfileFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  import { AppleProvisioningProfileMutationResult } from '../api/graphql/mutations/AppleProvisioningProfileMutation';
5
5
  export declare class ConfigureProvisioningProfile {
@@ -7,6 +7,6 @@ export declare class ConfigureProvisioningProfile {
7
7
  private distributionCertificate;
8
8
  private originalProvisioningProfile;
9
9
  constructor(app: AppLookupParams, distributionCertificate: AppleDistributionCertificateFragment, originalProvisioningProfile: AppleProvisioningProfileFragment);
10
- runAsync(ctx: Context): Promise<AppleProvisioningProfileMutationResult | null>;
10
+ runAsync(ctx: CredentialsContext): Promise<AppleProvisioningProfileMutationResult | null>;
11
11
  private configureAndUpdateAsync;
12
12
  }
@@ -1,8 +1,8 @@
1
1
  import { Account } from '../../../user/Account';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppleDistributionCertificateMutationResult } from '../api/graphql/mutations/AppleDistributionCertificateMutation';
4
4
  export declare class CreateDistributionCertificate {
5
5
  private account;
6
6
  constructor(account: Account);
7
- runAsync(ctx: Context): Promise<AppleDistributionCertificateMutationResult>;
7
+ runAsync(ctx: CredentialsContext): Promise<AppleDistributionCertificateMutationResult>;
8
8
  }
@@ -1,11 +1,11 @@
1
1
  import { AppleDistributionCertificateFragment } from '../../../graphql/generated';
2
- import { Context } from '../../context';
2
+ import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
4
  import { AppleProvisioningProfileMutationResult } from '../api/graphql/mutations/AppleProvisioningProfileMutation';
5
5
  export declare class CreateProvisioningProfile {
6
6
  private app;
7
7
  private distributionCertificate;
8
8
  constructor(app: AppLookupParams, distributionCertificate: AppleDistributionCertificateFragment);
9
- runAsync(ctx: Context): Promise<AppleProvisioningProfileMutationResult>;
9
+ runAsync(ctx: CredentialsContext): Promise<AppleProvisioningProfileMutationResult>;
10
10
  private provideOrGenerateAsync;
11
11
  }
@@ -1,8 +1,8 @@
1
1
  import { ApplePushKeyFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  export declare class CreatePushKey {
5
5
  private account;
6
6
  constructor(account: Account);
7
- runAsync(ctx: Context): Promise<ApplePushKeyFragment>;
7
+ runAsync(ctx: CredentialsContext): Promise<ApplePushKeyFragment>;
8
8
  }
@@ -1,15 +1,15 @@
1
1
  import { AppleDistributionCertificateFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  import { AppLookupParams } from '../api/GraphqlClient';
5
5
  import { DistributionCertificate } from '../appstore/Credentials.types';
6
6
  export declare function formatDistributionCertificate(distributionCertificate: AppleDistributionCertificateFragment, validSerialNumbers?: string[]): string;
7
7
  /**
8
8
  * select a distribution certificate from an account (validity status shown on a best effort basis)
9
9
  * */
10
- export declare function selectDistributionCertificateWithDependenciesAsync(ctx: Context, account: Account): Promise<AppleDistributionCertificateFragment | null>;
10
+ export declare function selectDistributionCertificateWithDependenciesAsync(ctx: CredentialsContext, account: Account): Promise<AppleDistributionCertificateFragment | null>;
11
11
  /**
12
12
  * select a distribution certificate from a valid set (curated on a best effort basis)
13
13
  * */
14
- export declare function selectValidDistributionCertificateAsync(ctx: Context, appLookupParams: AppLookupParams): Promise<AppleDistributionCertificateFragment | null>;
15
- export declare function provideOrGenerateDistributionCertificateAsync(ctx: Context, accountName: string): Promise<DistributionCertificate>;
14
+ export declare function selectValidDistributionCertificateAsync(ctx: CredentialsContext, appLookupParams: AppLookupParams): Promise<AppleDistributionCertificateFragment | null>;
15
+ export declare function provideOrGenerateDistributionCertificateAsync(ctx: CredentialsContext, accountName: string): Promise<DistributionCertificate>;
@@ -9,8 +9,8 @@ const log_1 = (0, tslib_1.__importStar)(require("../../../log"));
9
9
  const prompts_1 = require("../../../prompts");
10
10
  const date_1 = require("../../../utils/date");
11
11
  const promptForCredentials_1 = require("../../utils/promptForCredentials");
12
- const AppStoreApi_1 = require("../appstore/AppStoreApi");
13
12
  const CredentialsUtils_1 = require("../appstore/CredentialsUtils");
13
+ const distributionCertificate_1 = require("../appstore/distributionCertificate");
14
14
  const credentials_1 = require("../credentials");
15
15
  const validateDistributionCertificate_1 = require("../validators/validateDistributionCertificate");
16
16
  const AppleTeamUtils_1 = require("./AppleTeamUtils");
@@ -89,7 +89,7 @@ async function selectValidDistributionCertificateAsync(ctx, appLookupParams) {
89
89
  });
90
90
  // filter by valid certs on the developer portal
91
91
  const certInfoFromApple = await ctx.appStore.listDistributionCertificatesAsync();
92
- const validDistCerts = await (0, CredentialsUtils_1.filterRevokedDistributionCertsFromEasServers)(distCertsForAppleTeam, certInfoFromApple);
92
+ const validDistCerts = (0, CredentialsUtils_1.filterRevokedDistributionCertsFromEasServers)(distCertsForAppleTeam, certInfoFromApple);
93
93
  log_1.default.log(`${validDistCerts.length}/${distCertsForAccount.length} Distribution Certificates are currently valid for Apple Team ${(_a = ctx.appStore.authCtx) === null || _a === void 0 ? void 0 : _a.team.id}.`);
94
94
  return _selectDistributionCertificateAsync(validDistCerts);
95
95
  }
@@ -146,7 +146,7 @@ async function generateDistributionCertificateAsync(ctx, accountName) {
146
146
  return await ctx.appStore.createDistributionCertificateAsync();
147
147
  }
148
148
  catch (e) {
149
- if (e instanceof AppStoreApi_1.AppleTooManyCertsError) {
149
+ if (e instanceof distributionCertificate_1.AppleTooManyCertsError) {
150
150
  const distCerts = await ctx.appStore.listDistributionCertificatesAsync();
151
151
  log_1.default.warn('Maximum number of Distribution Certificates generated on Apple Developer Portal.');
152
152
  log_1.default.warn(APPLE_DIST_CERTS_TOO_MANY_GENERATED_ERROR);
@@ -1,4 +1,4 @@
1
- import { Context } from '../../context';
1
+ import { CredentialsContext } from '../../context';
2
2
  import { DistributionCertificate, ProvisioningProfile, ProvisioningProfileStoreInfo } from '../appstore/Credentials.types';
3
3
  export declare function formatProvisioningProfileFromApple(appleInfo: ProvisioningProfileStoreInfo): string;
4
- export declare function generateProvisioningProfileAsync(ctx: Context, bundleIdentifier: string, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
4
+ export declare function generateProvisioningProfileAsync(ctx: CredentialsContext, bundleIdentifier: string, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
@@ -1,12 +1,12 @@
1
1
  import { ApplePushKeyFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  import { PushKey } from '../appstore/Credentials.types';
5
- export declare function provideOrGeneratePushKeyAsync(ctx: Context, accountName: string): Promise<PushKey>;
5
+ export declare function provideOrGeneratePushKeyAsync(ctx: CredentialsContext, accountName: string): Promise<PushKey>;
6
6
  /**
7
7
  * select a push key from an account (validity status shown on a best effort basis)
8
8
  * */
9
- export declare function selectPushKeyAsync(ctx: Context, account: Account): Promise<ApplePushKeyFragment | null>;
10
- export declare function getValidAndTrackedPushKeysOnEasServersAsync(ctx: Context, pushKeysForAccount: ApplePushKeyFragment[]): Promise<ApplePushKeyFragment[]>;
9
+ export declare function selectPushKeyAsync(ctx: CredentialsContext, account: Account): Promise<ApplePushKeyFragment | null>;
10
+ export declare function getValidAndTrackedPushKeysOnEasServersAsync(ctx: CredentialsContext, pushKeysForAccount: ApplePushKeyFragment[]): Promise<ApplePushKeyFragment[]>;
11
11
  export declare function sortPushKeys(pushKeys: ApplePushKeyFragment[], validPushKeys?: ApplePushKeyFragment[]): ApplePushKeyFragment[];
12
12
  export declare function formatPushKey(pushKey: ApplePushKeyFragment, validPushKeyIdentifiers?: string[]): string;
@@ -1,15 +1,15 @@
1
1
  import { AppleDistributionCertificateFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
- import { Context } from '../../context';
3
+ import { CredentialsContext } from '../../context';
4
4
  export declare class SelectAndRemoveDistributionCertificate {
5
5
  private account;
6
6
  constructor(account: Account);
7
- runAsync(ctx: Context): Promise<void>;
7
+ runAsync(ctx: CredentialsContext): Promise<void>;
8
8
  }
9
9
  export declare class RemoveDistributionCertificate {
10
10
  private account;
11
11
  private distributionCertificate;
12
12
  constructor(account: Account, distributionCertificate: AppleDistributionCertificateFragment);
13
- runAsync(ctx: Context): Promise<void>;
13
+ runAsync(ctx: CredentialsContext): Promise<void>;
14
14
  private removeInvalidProvisioningProfilesAsync;
15
15
  }