eas-cli 7.8.1 → 7.8.3

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 (38) hide show
  1. package/README.md +59 -59
  2. package/build/build/local.js +1 -1
  3. package/build/commands/build/version/get.js +1 -0
  4. package/build/commands/build/version/set.js +1 -0
  5. package/build/commands/build/version/sync.js +1 -0
  6. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +7 -1
  7. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +41 -5
  8. package/build/credentials/ios/actions/DistributionCertificateUtils.js +7 -2
  9. package/build/credentials/ios/actions/PushKeyUtils.js +7 -2
  10. package/build/credentials/ios/actions/RemoveDistributionCertificate.js +8 -3
  11. package/build/credentials/ios/actions/RemovePushKey.js +7 -2
  12. package/build/credentials/ios/api/GraphqlClient.js +1 -1
  13. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +7 -1
  14. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +41 -5
  15. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +11 -3
  16. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +77 -53
  17. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.d.ts +7 -1
  18. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +41 -5
  19. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.d.ts +7 -1
  20. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +41 -5
  21. package/build/devices/actions/create/action.js +1 -1
  22. package/build/devices/actions/create/developerPortalMethod.d.ts +2 -2
  23. package/build/devices/actions/create/developerPortalMethod.js +5 -5
  24. package/build/graphql/generated.d.ts +279 -178
  25. package/build/project/android/applicationId.d.ts +2 -1
  26. package/build/project/android/applicationId.js +12 -3
  27. package/build/project/applicationIdentifier.d.ts +2 -1
  28. package/build/project/applicationIdentifier.js +3 -1
  29. package/build/project/ios/bundleIdentifier.d.ts +2 -1
  30. package/build/project/ios/bundleIdentifier.js +6 -2
  31. package/build/project/publish.js +5 -4
  32. package/build/project/resolveRuntimeVersionAsync.js +5 -4
  33. package/build/utils/expoUpdatesCli.d.ts +2 -0
  34. package/build/utils/expoUpdatesCli.js +12 -4
  35. package/build/utils/relay.d.ts +6 -0
  36. package/build/utils/relay.js +40 -1
  37. package/oclif.manifest.json +1 -1
  38. package/package.json +2 -2
@@ -25,8 +25,13 @@ function formatDistributionCertificate(distributionCertificate, validSerialNumbe
25
25
  line += chalk_1.default.gray(`\n Expires: ${(0, dateformat_1.default)(validityNotAfter, 'expiresHeaderFormat')}`);
26
26
  const apps = distributionCertificate.iosAppBuildCredentialsList.map(buildCredentials => buildCredentials.iosAppCredentials.app);
27
27
  if (apps.length) {
28
- const appFullNames = apps.map(app => app.fullName).join(',');
29
- line += chalk_1.default.gray(`\n 📲 Used by: ${appFullNames}`);
28
+ // iosAppBuildCredentialsList is capped at 20 on www
29
+ const appFullNames = apps
30
+ .map(app => app.fullName)
31
+ .slice(0, 19)
32
+ .join(',');
33
+ const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
34
+ line += chalk_1.default.gray(`\n 📲 Used by: ${appFullNames}${andMaybeMore}`);
30
35
  }
31
36
  if (validSerialNumbers === null || validSerialNumbers === void 0 ? void 0 : validSerialNumbers.includes(serialNumber)) {
32
37
  line += chalk_1.default.gray("\n ✅ Currently valid on Apple's servers.");
@@ -157,8 +157,13 @@ function formatPushKey(pushKey, validPushKeyIdentifiers) {
157
157
  line += chalk_1.default.gray(`\n Updated: ${(0, date_1.fromNow)(new Date(updatedAt))} ago,`);
158
158
  const apps = pushKey.iosAppCredentialsList.map(appCredentials => appCredentials.app);
159
159
  if (apps.length) {
160
- const appFullNames = apps.map(app => app.fullName).join(',');
161
- line += chalk_1.default.gray(`\n 📲 Used by: ${appFullNames}`);
160
+ // iosAppCredentialsList is capped at 20 on www
161
+ const appFullNames = apps
162
+ .map(app => app.fullName)
163
+ .slice(0, 19)
164
+ .join(',');
165
+ const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
166
+ line += chalk_1.default.gray(`\n 📲 Used by: ${appFullNames}${andMaybeMore}`);
162
167
  }
163
168
  if (validPushKeyIdentifiers === null || validPushKeyIdentifiers === void 0 ? void 0 : validPushKeyIdentifiers.includes(keyIdentifier)) {
164
169
  line += chalk_1.default.gray("\n ✅ Currently valid on Apple's servers.");
@@ -28,12 +28,17 @@ class RemoveDistributionCertificate {
28
28
  async runAsync(ctx) {
29
29
  const apps = this.distributionCertificate.iosAppBuildCredentialsList.map(buildCredentials => buildCredentials.iosAppCredentials.app);
30
30
  if (apps.length !== 0) {
31
- const appFullNames = apps.map(app => app.fullName).join(',');
31
+ // iosAppBuildCredentialsList is capped at 20 on www
32
+ const appFullNames = apps
33
+ .map(app => app.fullName)
34
+ .slice(0, 19)
35
+ .join(',');
36
+ const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
32
37
  if (ctx.nonInteractive) {
33
- throw new Error(`Certificate is currently used by ${appFullNames} and cannot be deleted in non-interactive mode.`);
38
+ throw new Error(`Certificate is currently used by ${appFullNames}${andMaybeMore} and cannot be deleted in non-interactive mode.`);
34
39
  }
35
40
  const confirm = await (0, prompts_1.confirmAsync)({
36
- message: `You are removing certificate used by ${appFullNames}. Do you want to continue?`,
41
+ message: `You are removing certificate used by ${appFullNames}${andMaybeMore}. Do you want to continue?`,
37
42
  });
38
43
  if (!confirm) {
39
44
  log_1.default.log('Aborting');
@@ -29,9 +29,14 @@ class RemovePushKey {
29
29
  }
30
30
  const apps = this.pushKey.iosAppCredentialsList.map(appCredentials => appCredentials.app);
31
31
  if (apps.length !== 0) {
32
- const appFullNames = apps.map(app => app.fullName).join(',');
32
+ // iosAppCredentialsList is capped at 20 on www
33
+ const appFullNames = apps
34
+ .map(app => app.fullName)
35
+ .slice(0, 19)
36
+ .join(',');
37
+ const andMaybeMore = apps.length > 19 ? ' (and more)' : '';
33
38
  const confirm = await (0, prompts_1.confirmAsync)({
34
- message: `Removing this push key will disable push notifications for ${appFullNames}. Do you want to continue?`,
39
+ message: `Removing this push key will disable push notifications for ${appFullNames}${andMaybeMore}. Do you want to continue?`,
35
40
  });
36
41
  if (!confirm) {
37
42
  log_1.default.log('Aborting');
@@ -149,7 +149,7 @@ async function createOrGetExistingAppleAppIdentifierAsync(graphqlClient, { accou
149
149
  }
150
150
  exports.createOrGetExistingAppleAppIdentifierAsync = createOrGetExistingAppleAppIdentifierAsync;
151
151
  async function getDevicesForAppleTeamAsync(graphqlClient, { account }, { appleTeamIdentifier }, { useCache = true } = {}) {
152
- return await AppleDeviceQuery_1.AppleDeviceQuery.getAllByAppleTeamIdentifierAsync(graphqlClient, account.id, appleTeamIdentifier, {
152
+ return await AppleDeviceQuery_1.AppleDeviceQuery.getAllByAppleTeamIdentifierAsync(graphqlClient, account.name, appleTeamIdentifier, {
153
153
  useCache,
154
154
  });
155
155
  }
@@ -1,5 +1,11 @@
1
1
  import { ExpoGraphqlClient } from '../../../../../commandUtils/context/contextUtils/createGraphqlClient';
2
- import { AppStoreConnectApiKeyFragment } from '../../../../../graphql/generated';
2
+ import { AppStoreConnectApiKeyFragment, AppStoreConnectApiKeysPaginatedByAccountQuery } from '../../../../../graphql/generated';
3
3
  export declare const AppStoreConnectApiKeyQuery: {
4
4
  getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, accountName: string): Promise<AppStoreConnectApiKeyFragment[]>;
5
+ getAllForAccountPaginatedAsync(graphqlClient: ExpoGraphqlClient, accountName: string, { after, first, before, last, }: {
6
+ after?: string | undefined;
7
+ first?: number | undefined;
8
+ before?: string | undefined;
9
+ last?: number | undefined;
10
+ }): Promise<AppStoreConnectApiKeysPaginatedByAccountQuery['account']['byName']['appStoreConnectApiKeysPaginated']>;
5
11
  };
@@ -6,17 +6,49 @@ const graphql_1 = require("graphql");
6
6
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
7
  const client_1 = require("../../../../../graphql/client");
8
8
  const AppStoreConnectApiKey_1 = require("../../../../../graphql/types/credentials/AppStoreConnectApiKey");
9
+ const relay_1 = require("../../../../../utils/relay");
9
10
  exports.AppStoreConnectApiKeyQuery = {
10
11
  async getAllForAccountAsync(graphqlClient, accountName) {
12
+ const paginatedGetterAsync = async (relayArgs) => {
13
+ return await exports.AppStoreConnectApiKeyQuery.getAllForAccountPaginatedAsync(graphqlClient, accountName, relayArgs);
14
+ };
15
+ return await (0, relay_1.fetchEntireDatasetAsync)({
16
+ paginatedGetterAsync,
17
+ progressBarLabel: 'fetching ASC Keys...',
18
+ });
19
+ },
20
+ async getAllForAccountPaginatedAsync(graphqlClient, accountName, { after, first, before, last, }) {
11
21
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
12
22
  .query((0, graphql_tag_1.default) `
13
- query AppStoreConnectApiKeyByAccountQuery($accountName: String!) {
23
+ query AppStoreConnectApiKeysPaginatedByAccountQuery(
24
+ $accountName: String!
25
+ $after: String
26
+ $first: Int
27
+ $before: String
28
+ $last: Int
29
+ ) {
14
30
  account {
15
31
  byName(accountName: $accountName) {
16
32
  id
17
- appStoreConnectApiKeys {
18
- id
19
- ...AppStoreConnectApiKeyFragment
33
+ appStoreConnectApiKeysPaginated(
34
+ after: $after
35
+ first: $first
36
+ before: $before
37
+ last: $last
38
+ ) {
39
+ edges {
40
+ cursor
41
+ node {
42
+ id
43
+ ...AppStoreConnectApiKeyFragment
44
+ }
45
+ }
46
+ pageInfo {
47
+ hasNextPage
48
+ hasPreviousPage
49
+ startCursor
50
+ endCursor
51
+ }
20
52
  }
21
53
  }
22
54
  }
@@ -24,10 +56,14 @@ exports.AppStoreConnectApiKeyQuery = {
24
56
  ${(0, graphql_1.print)(AppStoreConnectApiKey_1.AppStoreConnectApiKeyFragmentNode)}
25
57
  `, {
26
58
  accountName,
59
+ after,
60
+ first,
61
+ before,
62
+ last,
27
63
  }, {
28
64
  additionalTypenames: ['AppStoreConnectApiKey'],
29
65
  })
30
66
  .toPromise());
31
- return data.account.byName.appStoreConnectApiKeys;
67
+ return data.account.byName.appStoreConnectApiKeysPaginated;
32
68
  },
33
69
  };
@@ -1,5 +1,5 @@
1
1
  import { ExpoGraphqlClient } from '../../../../../commandUtils/context/contextUtils/createGraphqlClient';
2
- import { AppleDevice, AppleDeviceFragment, AppleDevicesByTeamIdentifierQueryVariables, AppleTeamFragment } from '../../../../../graphql/generated';
2
+ import { AppleDevice, AppleDeviceFilterInput, AppleDeviceFragment, AppleDevicesByTeamIdentifierQueryVariables, AppleDevicesPaginatedByAccountQuery, AppleTeamFragment } from '../../../../../graphql/generated';
3
3
  export type AppleDeviceFragmentWithAppleTeam = AppleDeviceFragment & {
4
4
  appleTeam: AppleTeamFragment;
5
5
  };
@@ -11,9 +11,17 @@ export type AppleDevicesByIdentifierQueryResult = AppleDeviceQueryResult & {
11
11
  appleTeam: AppleTeamFragment;
12
12
  };
13
13
  export declare const AppleDeviceQuery: {
14
- getAllByAppleTeamIdentifierAsync(graphqlClient: ExpoGraphqlClient, accountId: string, appleTeamIdentifier: string, { useCache }?: {
14
+ getAllByAppleTeamIdentifierAsync(graphqlClient: ExpoGraphqlClient, accountName: string, appleTeamIdentifier: string, { useCache }?: {
15
15
  useCache?: boolean | undefined;
16
16
  }): Promise<AppleDeviceFragmentWithAppleTeam[]>;
17
17
  getAllForAppleTeamAsync(graphqlClient: ExpoGraphqlClient, { accountName, appleTeamIdentifier, offset, limit }: AppleDevicesByTeamIdentifierQueryVariables): Promise<AppleDeviceFragment[]>;
18
- getByDeviceIdentifierAsync(graphqlClient: ExpoGraphqlClient, accountName: string, identifier: string): Promise<AppleDevicesByIdentifierQueryResult>;
18
+ getByDeviceIdentifierAsync(graphqlClient: ExpoGraphqlClient, accountName: string, identifier: string): Promise<AppleDeviceFragmentWithAppleTeam>;
19
+ getAllForAccountPaginatedAsync(graphqlClient: ExpoGraphqlClient, accountName: string, { after, first, before, last, filter, useCache, }: {
20
+ after?: string | undefined;
21
+ first?: number | undefined;
22
+ before?: string | undefined;
23
+ last?: number | undefined;
24
+ filter?: AppleDeviceFilterInput | undefined;
25
+ useCache?: boolean | undefined;
26
+ }): Promise<AppleDevicesPaginatedByAccountQuery['account']['byName']['appleDevicesPaginated']>;
19
27
  };
@@ -2,48 +2,29 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppleDeviceQuery = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const assert_1 = tslib_1.__importDefault(require("assert"));
6
5
  const graphql_1 = require("graphql");
7
6
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
8
7
  const errors_1 = require("../../../../../devices/utils/errors");
9
8
  const client_1 = require("../../../../../graphql/client");
10
9
  const AppleDevice_1 = require("../../../../../graphql/types/credentials/AppleDevice");
11
10
  const AppleTeam_1 = require("../../../../../graphql/types/credentials/AppleTeam");
11
+ const relay_1 = require("../../../../../utils/relay");
12
12
  const AppleTeamFormatting_1 = require("../../../actions/AppleTeamFormatting");
13
13
  exports.AppleDeviceQuery = {
14
- async getAllByAppleTeamIdentifierAsync(graphqlClient, accountId, appleTeamIdentifier, { useCache = true } = {}) {
15
- const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
16
- .query((0, graphql_tag_1.default) `
17
- query AppleDevicesByAppleTeamQuery($accountId: ID!, $appleTeamIdentifier: String!) {
18
- appleTeam {
19
- byAppleTeamIdentifier(accountId: $accountId, identifier: $appleTeamIdentifier) {
20
- id
21
- ...AppleTeamFragment
22
- appleDevices {
23
- id
24
- ...AppleDeviceFragment
25
- appleTeam {
26
- id
27
- ...AppleTeamFragment
28
- }
29
- }
30
- }
31
- }
32
- }
33
- ${(0, graphql_1.print)(AppleTeam_1.AppleTeamFragmentNode)}
34
- ${(0, graphql_1.print)(AppleDevice_1.AppleDeviceFragmentNode)}
35
- `, {
36
- accountId,
37
- appleTeamIdentifier,
38
- }, {
39
- additionalTypenames: ['AppleDevice'],
40
- requestPolicy: useCache ? 'cache-first' : 'network-only',
41
- })
42
- .toPromise());
43
- (0, assert_1.default)(data.appleTeam.byAppleTeamIdentifier, 'byAppleTeamIdentifier should be defined in this context - enforced by GraphQL');
44
- const { appleDevices } = data.appleTeam.byAppleTeamIdentifier;
45
- (0, assert_1.default)(appleDevices, 'Apple Devices should be defined in this context - enforced by GraphQL');
46
- return appleDevices;
14
+ async getAllByAppleTeamIdentifierAsync(graphqlClient, accountName, appleTeamIdentifier, { useCache = true } = {}) {
15
+ const paginatedGetterAsync = async (relayArgs) => {
16
+ return await exports.AppleDeviceQuery.getAllForAccountPaginatedAsync(graphqlClient, accountName, {
17
+ ...relayArgs,
18
+ filter: {
19
+ appleTeamIdentifier,
20
+ },
21
+ useCache,
22
+ });
23
+ };
24
+ return await (0, relay_1.fetchEntireDatasetAsync)({
25
+ paginatedGetterAsync,
26
+ progressBarLabel: 'Fetching Apple devices...',
27
+ });
47
28
  },
48
29
  async getAllForAppleTeamAsync(graphqlClient, { accountName, appleTeamIdentifier, offset, limit }) {
49
30
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
@@ -86,36 +67,79 @@ exports.AppleDeviceQuery = {
86
67
  return appleDevices;
87
68
  },
88
69
  async getByDeviceIdentifierAsync(graphqlClient, accountName, identifier) {
70
+ const paginatedGetterAsync = async (relayArgs) => {
71
+ return await exports.AppleDeviceQuery.getAllForAccountPaginatedAsync(graphqlClient, accountName, {
72
+ ...relayArgs,
73
+ filter: {
74
+ identifier,
75
+ },
76
+ });
77
+ };
78
+ const devices = await (0, relay_1.fetchEntireDatasetAsync)({
79
+ paginatedGetterAsync,
80
+ });
81
+ const device = devices[0];
82
+ if (!device) {
83
+ throw new errors_1.DeviceNotFoundError(`Device with id ${identifier} was not found on account ${accountName}.`);
84
+ }
85
+ return device;
86
+ },
87
+ async getAllForAccountPaginatedAsync(graphqlClient, accountName, { after, first, before, last, filter, useCache = true, }) {
89
88
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
90
89
  .query((0, graphql_tag_1.default) `
91
- query AppleDevicesByIdentifier($accountName: String!, $identifier: String!) {
90
+ query AppleDevicesPaginatedByAccountQuery(
91
+ $accountName: String!
92
+ $after: String
93
+ $first: Int
94
+ $before: String
95
+ $last: Int
96
+ $filter: AppleDeviceFilterInput
97
+ ) {
92
98
  account {
93
99
  byName(accountName: $accountName) {
94
100
  id
95
- appleDevices(identifier: $identifier) {
96
- id
97
- model
98
- identifier
99
- name
100
- deviceClass
101
- enabled
102
- appleTeam {
103
- id
104
- appleTeamIdentifier
105
- appleTeamName
101
+ appleDevicesPaginated(
102
+ after: $after
103
+ first: $first
104
+ before: $before
105
+ last: $last
106
+ filter: $filter
107
+ ) {
108
+ edges {
109
+ cursor
110
+ node {
111
+ id
112
+ ...AppleDeviceFragment
113
+ appleTeam {
114
+ id
115
+ ...AppleTeamFragment
116
+ }
117
+ }
118
+ }
119
+ pageInfo {
120
+ hasNextPage
121
+ hasPreviousPage
122
+ startCursor
123
+ endCursor
106
124
  }
107
125
  }
108
126
  }
109
127
  }
110
128
  }
111
- `, { accountName, identifier }, {
112
- additionalTypenames: ['AppleDevice', 'AppleTeam'],
129
+ ${(0, graphql_1.print)(AppleTeam_1.AppleTeamFragmentNode)}
130
+ ${(0, graphql_1.print)(AppleDevice_1.AppleDeviceFragmentNode)}
131
+ `, {
132
+ accountName,
133
+ after,
134
+ first,
135
+ before,
136
+ last,
137
+ filter,
138
+ }, {
139
+ additionalTypenames: ['AppleDevice'],
140
+ requestPolicy: useCache ? 'cache-first' : 'network-only',
113
141
  })
114
142
  .toPromise());
115
- const device = data.account.byName.appleDevices[0];
116
- if (!device) {
117
- throw new errors_1.DeviceNotFoundError(`Device with id ${identifier} was not found on account ${accountName}.`);
118
- }
119
- return device;
143
+ return data.account.byName.appleDevicesPaginated;
120
144
  },
121
145
  };
@@ -1,9 +1,15 @@
1
1
  import { ExpoGraphqlClient } from '../../../../../commandUtils/context/contextUtils/createGraphqlClient';
2
- import { AppleDistributionCertificateFragment, IosDistributionType } from '../../../../../graphql/generated';
2
+ import { AppleDistributionCertificateFragment, AppleDistributionCertificatesPaginatedByAccountQuery, IosDistributionType } from '../../../../../graphql/generated';
3
3
  export declare const AppleDistributionCertificateQuery: {
4
4
  getForAppAsync(graphqlClient: ExpoGraphqlClient, projectFullName: string, { appleAppIdentifierId, iosDistributionType, }: {
5
5
  appleAppIdentifierId: string;
6
6
  iosDistributionType: IosDistributionType;
7
7
  }): Promise<AppleDistributionCertificateFragment | null>;
8
8
  getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, accountName: string): Promise<AppleDistributionCertificateFragment[]>;
9
+ getAllForAccountPaginatedAsync(graphqlClient: ExpoGraphqlClient, accountName: string, { after, first, before, last, }: {
10
+ after?: string | undefined;
11
+ first?: number | undefined;
12
+ before?: string | undefined;
13
+ last?: number | undefined;
14
+ }): Promise<AppleDistributionCertificatesPaginatedByAccountQuery['account']['byName']['appleDistributionCertificatesPaginated']>;
9
15
  };
@@ -8,6 +8,7 @@ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
8
8
  const client_1 = require("../../../../../graphql/client");
9
9
  const AppleDistributionCertificate_1 = require("../../../../../graphql/types/credentials/AppleDistributionCertificate");
10
10
  const AppleTeam_1 = require("../../../../../graphql/types/credentials/AppleTeam");
11
+ const relay_1 = require("../../../../../utils/relay");
11
12
  exports.AppleDistributionCertificateQuery = {
12
13
  async getForAppAsync(graphqlClient, projectFullName, { appleAppIdentifierId, iosDistributionType, }) {
13
14
  var _a, _b, _c;
@@ -58,15 +59,46 @@ exports.AppleDistributionCertificateQuery = {
58
59
  return ((_c = (_b = (_a = data.app.byFullName.iosAppCredentials[0]) === null || _a === void 0 ? void 0 : _a.iosAppBuildCredentialsList[0]) === null || _b === void 0 ? void 0 : _b.distributionCertificate) !== null && _c !== void 0 ? _c : null);
59
60
  },
60
61
  async getAllForAccountAsync(graphqlClient, accountName) {
62
+ const paginatedGetterAsync = async (relayArgs) => {
63
+ return await exports.AppleDistributionCertificateQuery.getAllForAccountPaginatedAsync(graphqlClient, accountName, relayArgs);
64
+ };
65
+ return await (0, relay_1.fetchEntireDatasetAsync)({
66
+ paginatedGetterAsync,
67
+ progressBarLabel: 'fetching Apple Distribution Certificates...',
68
+ });
69
+ },
70
+ async getAllForAccountPaginatedAsync(graphqlClient, accountName, { after, first, before, last, }) {
61
71
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
62
72
  .query((0, graphql_tag_1.default) `
63
- query AppleDistributionCertificateByAccountQuery($accountName: String!) {
73
+ query AppleDistributionCertificatesPaginatedByAccountQuery(
74
+ $accountName: String!
75
+ $after: String
76
+ $first: Int
77
+ $before: String
78
+ $last: Int
79
+ ) {
64
80
  account {
65
81
  byName(accountName: $accountName) {
66
82
  id
67
- appleDistributionCertificates {
68
- id
69
- ...AppleDistributionCertificateFragment
83
+ appleDistributionCertificatesPaginated(
84
+ after: $after
85
+ first: $first
86
+ before: $before
87
+ last: $last
88
+ ) {
89
+ edges {
90
+ cursor
91
+ node {
92
+ id
93
+ ...AppleDistributionCertificateFragment
94
+ }
95
+ }
96
+ pageInfo {
97
+ hasNextPage
98
+ hasPreviousPage
99
+ startCursor
100
+ endCursor
101
+ }
70
102
  }
71
103
  }
72
104
  }
@@ -74,10 +106,14 @@ exports.AppleDistributionCertificateQuery = {
74
106
  ${(0, graphql_1.print)(AppleDistributionCertificate_1.AppleDistributionCertificateFragmentNode)}
75
107
  `, {
76
108
  accountName,
109
+ after,
110
+ first,
111
+ before,
112
+ last,
77
113
  }, {
78
114
  additionalTypenames: ['AppleDistributionCertificate'],
79
115
  })
80
116
  .toPromise());
81
- return data.account.byName.appleDistributionCertificates;
117
+ return data.account.byName.appleDistributionCertificatesPaginated;
82
118
  },
83
119
  };
@@ -1,5 +1,11 @@
1
1
  import { ExpoGraphqlClient } from '../../../../../commandUtils/context/contextUtils/createGraphqlClient';
2
- import { ApplePushKeyFragment } from '../../../../../graphql/generated';
2
+ import { ApplePushKeyFragment, ApplePushKeysPaginatedByAccountQuery } from '../../../../../graphql/generated';
3
3
  export declare const ApplePushKeyQuery: {
4
4
  getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, accountName: string): Promise<ApplePushKeyFragment[]>;
5
+ getAllForAccountPaginatedAsync(graphqlClient: ExpoGraphqlClient, accountName: string, { after, first, before, last, }: {
6
+ after?: string | undefined;
7
+ first?: number | undefined;
8
+ before?: string | undefined;
9
+ last?: number | undefined;
10
+ }): Promise<ApplePushKeysPaginatedByAccountQuery['account']['byName']['applePushKeysPaginated']>;
5
11
  };
@@ -6,17 +6,49 @@ const graphql_1 = require("graphql");
6
6
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
7
  const client_1 = require("../../../../../graphql/client");
8
8
  const ApplePushKey_1 = require("../../../../../graphql/types/credentials/ApplePushKey");
9
+ const relay_1 = require("../../../../../utils/relay");
9
10
  exports.ApplePushKeyQuery = {
10
11
  async getAllForAccountAsync(graphqlClient, accountName) {
12
+ const paginatedGetterAsync = async (relayArgs) => {
13
+ return await exports.ApplePushKeyQuery.getAllForAccountPaginatedAsync(graphqlClient, accountName, relayArgs);
14
+ };
15
+ return await (0, relay_1.fetchEntireDatasetAsync)({
16
+ paginatedGetterAsync,
17
+ progressBarLabel: 'fetching Apple Push Keys...',
18
+ });
19
+ },
20
+ async getAllForAccountPaginatedAsync(graphqlClient, accountName, { after, first, before, last, }) {
11
21
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
12
22
  .query((0, graphql_tag_1.default) `
13
- query ApplePushKeyByAccountQuery($accountName: String!) {
23
+ query ApplePushKeysPaginatedByAccountQuery(
24
+ $accountName: String!
25
+ $after: String
26
+ $first: Int
27
+ $before: String
28
+ $last: Int
29
+ ) {
14
30
  account {
15
31
  byName(accountName: $accountName) {
16
32
  id
17
- applePushKeys {
18
- id
19
- ...ApplePushKeyFragment
33
+ applePushKeysPaginated(
34
+ after: $after
35
+ first: $first
36
+ before: $before
37
+ last: $last
38
+ ) {
39
+ edges {
40
+ cursor
41
+ node {
42
+ id
43
+ ...ApplePushKeyFragment
44
+ }
45
+ }
46
+ pageInfo {
47
+ hasNextPage
48
+ hasPreviousPage
49
+ startCursor
50
+ endCursor
51
+ }
20
52
  }
21
53
  }
22
54
  }
@@ -24,10 +56,14 @@ exports.ApplePushKeyQuery = {
24
56
  ${(0, graphql_1.print)(ApplePushKey_1.ApplePushKeyFragmentNode)}
25
57
  `, {
26
58
  accountName,
59
+ after,
60
+ first,
61
+ before,
62
+ last,
27
63
  }, {
28
64
  additionalTypenames: ['ApplePushKey'],
29
65
  })
30
66
  .toPromise());
31
- return data.account.byName.applePushKeys;
67
+ return data.account.byName.applePushKeysPaginated;
32
68
  },
33
69
  };
@@ -30,7 +30,7 @@ class DeviceCreateAction {
30
30
  await (0, registrationUrlMethod_1.runRegistrationUrlMethodAsync)(this.graphqlClient, this.account.id, this.appleTeam);
31
31
  }
32
32
  else if (method === RegistrationMethod.DEVELOPER_PORTAL) {
33
- await (0, developerPortalMethod_1.runDeveloperPortalMethodAsync)(this.graphqlClient, this.appStoreApi, this.account.id, this.appleTeam);
33
+ await (0, developerPortalMethod_1.runDeveloperPortalMethodAsync)(this.graphqlClient, this.appStoreApi, this.account, this.appleTeam);
34
34
  }
35
35
  else if (method === RegistrationMethod.INPUT) {
36
36
  await (0, inputMethod_1.runInputMethodAsync)(this.graphqlClient, this.account.id, this.appleTeam);
@@ -2,6 +2,6 @@
2
2
  import { Device } from '@expo/apple-utils';
3
3
  import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
4
4
  import AppStoreApi from '../../../credentials/ios/appstore/AppStoreApi';
5
- import { AppleTeam } from '../../../graphql/generated';
6
- export declare function runDeveloperPortalMethodAsync(graphqlClient: ExpoGraphqlClient, appStoreApi: AppStoreApi, accountId: string, appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName' | 'id'>): Promise<void>;
5
+ import { AccountFragment, AppleTeam } from '../../../graphql/generated';
6
+ export declare function runDeveloperPortalMethodAsync(graphqlClient: ExpoGraphqlClient, appStoreApi: AppStoreApi, account: AccountFragment, appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName' | 'id'>): Promise<void>;
7
7
  export declare function formatDeviceLabel(device: Device): string;
@@ -17,15 +17,15 @@ const DEVICE_CLASS_TO_GRAPHQL_TYPE = {
17
17
  [apple_utils_1.DeviceClass.IPHONE]: generated_1.AppleDeviceClass.Iphone,
18
18
  [apple_utils_1.DeviceClass.MAC]: generated_1.AppleDeviceClass.Mac,
19
19
  };
20
- async function runDeveloperPortalMethodAsync(graphqlClient, appStoreApi, accountId, appleTeam) {
20
+ async function runDeveloperPortalMethodAsync(graphqlClient, appStoreApi, account, appleTeam) {
21
21
  const appleAuthCtx = await appStoreApi.ensureAuthenticatedAsync();
22
- const unregisteredPortalDevices = await findUnregisteredPortalDevicesAsync(graphqlClient, appleAuthCtx, accountId, appleTeam);
22
+ const unregisteredPortalDevices = await findUnregisteredPortalDevicesAsync(graphqlClient, appleAuthCtx, account.name, appleTeam);
23
23
  if (unregisteredPortalDevices.length === 0) {
24
24
  log_1.default.log('All your devices registered on Apple Developer Portal are already imported to EAS.');
25
25
  return;
26
26
  }
27
27
  const devicesToImport = await chooseDevicesToImportAsync(unregisteredPortalDevices);
28
- await importDevicesAsync(graphqlClient, accountId, appleTeam, devicesToImport);
28
+ await importDevicesAsync(graphqlClient, account.id, appleTeam, devicesToImport);
29
29
  }
30
30
  exports.runDeveloperPortalMethodAsync = runDeveloperPortalMethodAsync;
31
31
  async function importDevicesAsync(graphqlClient, accountId, appleTeam, devices) {
@@ -54,8 +54,8 @@ async function importDeviceChunkAsync(graphqlClient, accountId, appleTeam, devic
54
54
  });
55
55
  await Promise.all(promises);
56
56
  }
57
- async function findUnregisteredPortalDevicesAsync(graphqlClient, appleAuthCtx, accountId, appleTeam) {
58
- const expoRegisteredDevices = await AppleDeviceQuery_1.AppleDeviceQuery.getAllByAppleTeamIdentifierAsync(graphqlClient, accountId, appleTeam.appleTeamIdentifier, { useCache: false });
57
+ async function findUnregisteredPortalDevicesAsync(graphqlClient, appleAuthCtx, accountName, appleTeam) {
58
+ const expoRegisteredDevices = await AppleDeviceQuery_1.AppleDeviceQuery.getAllByAppleTeamIdentifierAsync(graphqlClient, accountName, appleTeam.appleTeamIdentifier, { useCache: false });
59
59
  const expoRegisteredDevicesByUdid = expoRegisteredDevices.reduce((acc, device) => {
60
60
  acc[device.identifier] = device;
61
61
  return acc;