eas-cli 0.56.0 → 0.59.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 (93) hide show
  1. package/README.md +98 -49
  2. package/build/branch/queries.d.ts +5 -0
  3. package/build/branch/queries.js +87 -0
  4. package/build/build/android/build.js +17 -3
  5. package/build/build/android/graphql.js +2 -0
  6. package/build/build/android/prepareJob.js +5 -0
  7. package/build/build/android/syncProjectConfiguration.d.ts +3 -4
  8. package/build/build/android/syncProjectConfiguration.js +2 -3
  9. package/build/build/android/version.d.ts +11 -0
  10. package/build/build/android/version.js +71 -1
  11. package/build/build/build.js +1 -1
  12. package/build/build/context.d.ts +5 -0
  13. package/build/build/createContext.d.ts +3 -1
  14. package/build/build/createContext.js +8 -1
  15. package/build/build/ios/build.js +17 -1
  16. package/build/build/ios/graphql.js +2 -0
  17. package/build/build/ios/prepareJob.js +5 -0
  18. package/build/build/ios/syncProjectConfiguration.d.ts +3 -4
  19. package/build/build/ios/syncProjectConfiguration.js +2 -3
  20. package/build/build/ios/version.d.ts +13 -0
  21. package/build/build/ios/version.js +72 -1
  22. package/build/build/local.d.ts +2 -2
  23. package/build/build/local.js +7 -7
  24. package/build/build/metadata.d.ts +1 -0
  25. package/build/build/metadata.js +32 -6
  26. package/build/build/runBuildAndSubmit.d.ts +1 -0
  27. package/build/build/runBuildAndSubmit.js +24 -3
  28. package/build/build/utils/printBuildInfo.d.ts +1 -1
  29. package/build/build/utils/printBuildInfo.js +7 -13
  30. package/build/commandUtils/pagination.d.ts +13 -0
  31. package/build/commandUtils/pagination.js +42 -0
  32. package/build/commands/branch/list.d.ts +3 -4
  33. package/build/commands/branch/list.js +6 -69
  34. package/build/commands/branch/view.d.ts +3 -0
  35. package/build/commands/branch/view.js +15 -63
  36. package/build/commands/build/index.d.ts +1 -0
  37. package/build/commands/build/index.js +9 -0
  38. package/build/commands/build/version/set.d.ts +0 -1
  39. package/build/commands/build/version/set.js +2 -3
  40. package/build/commands/build/version/sync.d.ts +0 -1
  41. package/build/commands/build/version/sync.js +2 -3
  42. package/build/commands/submit.js +4 -1
  43. package/build/commands/update/index.d.ts +2 -2
  44. package/build/commands/update/index.js +22 -6
  45. package/build/commands/update/list.js +13 -18
  46. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +2 -2
  47. package/build/devices/actions/create/action.d.ts +5 -2
  48. package/build/devices/actions/create/action.js +12 -2
  49. package/build/devices/actions/create/developerPortalMethod.d.ts +6 -0
  50. package/build/devices/actions/create/developerPortalMethod.js +90 -0
  51. package/build/devices/manager.js +4 -4
  52. package/build/graphql/generated.d.ts +424 -61
  53. package/build/graphql/generated.js +9 -1
  54. package/build/graphql/mutations/PublishMutation.d.ts +2 -4
  55. package/build/graphql/queries/BranchQuery.d.ts +2 -1
  56. package/build/graphql/queries/BranchQuery.js +26 -0
  57. package/build/graphql/queries/BuildQuery.d.ts +4 -1
  58. package/build/graphql/queries/BuildQuery.js +19 -0
  59. package/build/graphql/queries/PublishQuery.d.ts +2 -1
  60. package/build/graphql/queries/PublishQuery.js +16 -0
  61. package/build/graphql/queries/UpdateQuery.d.ts +6 -8
  62. package/build/graphql/queries/UpdateQuery.js +27 -23
  63. package/build/graphql/types/Build.d.ts +1 -0
  64. package/build/graphql/types/Build.js +16 -1
  65. package/build/metadata/apple/config/reader.d.ts +3 -2
  66. package/build/metadata/apple/config/reader.js +22 -5
  67. package/build/metadata/apple/config/writer.d.ts +3 -2
  68. package/build/metadata/apple/config/writer.js +22 -6
  69. package/build/metadata/apple/tasks/app-version.d.ts +5 -1
  70. package/build/metadata/apple/tasks/app-version.js +109 -8
  71. package/build/metadata/apple/tasks/index.d.ts +6 -1
  72. package/build/metadata/apple/tasks/index.js +7 -2
  73. package/build/metadata/apple/types.d.ts +3 -7
  74. package/build/metadata/upload.js +6 -1
  75. package/build/project/publish.d.ts +3 -1
  76. package/build/project/publish.js +17 -8
  77. package/build/project/remoteVersionSource.d.ts +5 -3
  78. package/build/project/remoteVersionSource.js +18 -9
  79. package/build/submit/submit.d.ts +2 -1
  80. package/build/submit/submit.js +3 -2
  81. package/build/update/queries.d.ts +3 -0
  82. package/build/update/queries.js +72 -0
  83. package/build/update/utils.d.ts +14 -0
  84. package/build/update/utils.js +26 -9
  85. package/build/utils/expodash/chunk.d.ts +1 -0
  86. package/build/utils/expodash/chunk.js +16 -0
  87. package/build/utils/queries.d.ts +25 -0
  88. package/build/utils/queries.js +67 -0
  89. package/build/vcs/clients/gitNoCommit.d.ts +1 -0
  90. package/build/vcs/clients/gitNoCommit.js +14 -0
  91. package/oclif.manifest.json +1 -1
  92. package/package.json +27 -25
  93. package/schema/metadata-0.json +38 -233
@@ -6,7 +6,7 @@
6
6
  * For more info and docs, visit https://graphql-code-generator.com/
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.WebhookType = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.SubmissionStatus = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OfferType = exports.MailchimpTag = exports.MailchimpAudience = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.Feature = exports.EasServiceMetric = exports.EasBuildDeprecationInfoType = exports.DistributionType = exports.CacheControlScope = exports.BuildWorkflow = exports.BuildStatus = exports.BuildResourceClass = exports.BuildPriority = exports.BuildJobStatus = exports.BuildJobLogsFormat = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.AssetMetadataStatus = exports.AppsFilter = exports.AppleDeviceClass = exports.AppStoreConnectUserRole = exports.AppSort = exports.AppPrivacy = exports.AppPlatform = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = void 0;
9
+ exports.WebhookType = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.SubmissionStatus = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OfferType = exports.MailchimpTag = exports.MailchimpAudience = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.Feature = exports.EasServiceMetric = exports.EasBuildDeprecationInfoType = exports.DistributionType = exports.CacheControlScope = exports.BuildWorkflow = exports.BuildStatus = exports.BuildResourceClass = exports.BuildPriority = exports.BuildJobStatus = exports.BuildJobLogsFormat = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.AuthProtocolType = exports.AssetMetadataStatus = exports.AppsFilter = exports.AppleDeviceClass = exports.AppStoreConnectUserRole = exports.AppSort = exports.AppPrivacy = exports.AppPlatform = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = void 0;
10
10
  var ActivityTimelineProjectActivityType;
11
11
  (function (ActivityTimelineProjectActivityType) {
12
12
  ActivityTimelineProjectActivityType["Build"] = "BUILD";
@@ -86,6 +86,10 @@ var AssetMetadataStatus;
86
86
  AssetMetadataStatus["DoesNotExist"] = "DOES_NOT_EXIST";
87
87
  AssetMetadataStatus["Exists"] = "EXISTS";
88
88
  })(AssetMetadataStatus = exports.AssetMetadataStatus || (exports.AssetMetadataStatus = {}));
89
+ var AuthProtocolType;
90
+ (function (AuthProtocolType) {
91
+ AuthProtocolType["Oidc"] = "OIDC";
92
+ })(AuthProtocolType = exports.AuthProtocolType || (exports.AuthProtocolType = {}));
89
93
  var BuildCredentialsSource;
90
94
  (function (BuildCredentialsSource) {
91
95
  BuildCredentialsSource["Local"] = "LOCAL";
@@ -158,7 +162,9 @@ var EasServiceMetric;
158
162
  (function (EasServiceMetric) {
159
163
  EasServiceMetric["AssetsRequests"] = "ASSETS_REQUESTS";
160
164
  EasServiceMetric["BandwidthUsage"] = "BANDWIDTH_USAGE";
165
+ EasServiceMetric["Builds"] = "BUILDS";
161
166
  EasServiceMetric["ManifestRequests"] = "MANIFEST_REQUESTS";
167
+ EasServiceMetric["UniqueUpdaters"] = "UNIQUE_UPDATERS";
162
168
  EasServiceMetric["UniqueUsers"] = "UNIQUE_USERS";
163
169
  })(EasServiceMetric = exports.EasServiceMetric || (exports.EasServiceMetric = {}));
164
170
  var Feature;
@@ -300,7 +306,9 @@ var UploadSessionType;
300
306
  var UsageMetricType;
301
307
  (function (UsageMetricType) {
302
308
  UsageMetricType["Bandwidth"] = "BANDWIDTH";
309
+ UsageMetricType["Build"] = "BUILD";
303
310
  UsageMetricType["Request"] = "REQUEST";
311
+ UsageMetricType["Update"] = "UPDATE";
304
312
  UsageMetricType["User"] = "USER";
305
313
  })(UsageMetricType = exports.UsageMetricType || (exports.UsageMetricType = {}));
306
314
  var UsageMetricsGranularity;
@@ -1,8 +1,6 @@
1
- import { CodeSigningInfoInput, PublishUpdateGroupInput, SetCodeSigningInfoMutation, UpdatePublishMutation } from '../generated';
1
+ import { CodeSigningInfoInput, GetSignedUploadMutation, PublishUpdateGroupInput, SetCodeSigningInfoMutation, UpdatePublishMutation } from '../generated';
2
2
  export declare const PublishMutation: {
3
- getUploadURLsAsync(contentTypes: string[]): Promise<{
4
- specifications: string[];
5
- }>;
3
+ getUploadURLsAsync(contentTypes: string[]): Promise<GetSignedUploadMutation['asset']['getSignedAssetUploadSpecifications']>;
6
4
  publishUpdateGroupAsync(publishUpdateGroupsInput: PublishUpdateGroupInput[]): Promise<UpdatePublishMutation['updateBranch']['publishUpdateGroups']>;
7
5
  setCodeSigningInfoAsync(updateId: string, codeSigningInfo: CodeSigningInfoInput): Promise<SetCodeSigningInfoMutation['update']['setCodeSigningInfo']>;
8
6
  };
@@ -1,7 +1,8 @@
1
- import { ViewBranchQuery } from '../generated';
1
+ import { BranchesByAppQueryVariables, UpdateBranchFragment, ViewBranchQuery } from '../generated';
2
2
  export declare const BranchQuery: {
3
3
  getBranchByNameAsync({ appId, name, }: {
4
4
  appId: string;
5
5
  name: string;
6
6
  }): Promise<ViewBranchQuery['app']['byId']['updateBranchByName']>;
7
+ listBranchesAsync({ appId, limit, offset, }: BranchesByAppQueryVariables): Promise<UpdateBranchFragment[]>;
7
8
  };
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BranchQuery = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const graphql_1 = require("graphql");
5
6
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
7
  const client_1 = require("../client");
8
+ const UpdateBranch_1 = require("../types/UpdateBranch");
7
9
  exports.BranchQuery = {
8
10
  async getBranchByNameAsync({ appId, name, }) {
9
11
  const { app: { byId: { updateBranchByName: branch }, }, } = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
@@ -26,4 +28,28 @@ exports.BranchQuery = {
26
28
  .toPromise());
27
29
  return branch;
28
30
  },
31
+ async listBranchesAsync({ appId, limit, offset, }) {
32
+ var _a, _b;
33
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
34
+ .query((0, graphql_tag_1.default) `
35
+ query BranchesByAppQuery($appId: String!, $limit: Int!, $offset: Int!) {
36
+ app {
37
+ byId(appId: $appId) {
38
+ id
39
+ updateBranches(limit: $limit, offset: $offset) {
40
+ id
41
+ ...UpdateBranchFragment
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ${(0, graphql_1.print)(UpdateBranch_1.UpdateBranchFragmentNode)}
47
+ `, {
48
+ appId,
49
+ limit,
50
+ offset,
51
+ }, { additionalTypenames: ['UpdateBranch'] })
52
+ .toPromise());
53
+ return (_b = (_a = data === null || data === void 0 ? void 0 : data.app) === null || _a === void 0 ? void 0 : _a.byId.updateBranches) !== null && _b !== void 0 ? _b : [];
54
+ },
29
55
  };
@@ -1,4 +1,4 @@
1
- import { AppPlatform, BuildFragment, BuildStatus, DistributionType } from '../generated';
1
+ import { AppPlatform, BuildFragment, BuildStatus, BuildWithSubmissionsFragment, DistributionType } from '../generated';
2
2
  declare type BuildsQuery = {
3
3
  offset?: number;
4
4
  limit?: number;
@@ -20,6 +20,9 @@ export declare const BuildQuery: {
20
20
  byIdAsync(buildId: string, { useCache }?: {
21
21
  useCache?: boolean | undefined;
22
22
  }): Promise<BuildFragment>;
23
+ withSubmissionsByIdAsync(buildId: string, { useCache }?: {
24
+ useCache?: boolean | undefined;
25
+ }): Promise<BuildWithSubmissionsFragment>;
23
26
  allForAppAsync(appId: string, { limit, offset, filter }: BuildsQuery): Promise<BuildFragment[]>;
24
27
  };
25
28
  export {};
@@ -26,6 +26,25 @@ exports.BuildQuery = {
26
26
  .toPromise());
27
27
  return data.builds.byId;
28
28
  },
29
+ async withSubmissionsByIdAsync(buildId, { useCache = true } = {}) {
30
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
31
+ .query((0, graphql_tag_1.default) `
32
+ query BuildsWithSubmissionsByIdQuery($buildId: ID!) {
33
+ builds {
34
+ byId(buildId: $buildId) {
35
+ id
36
+ ...BuildWithSubmissionsFragment
37
+ }
38
+ }
39
+ }
40
+ ${(0, graphql_1.print)(Build_1.BuildFragmentWithSubmissionsNode)}
41
+ `, { buildId }, {
42
+ requestPolicy: useCache ? 'cache-first' : 'network-only',
43
+ additionalTypenames: ['Build'],
44
+ })
45
+ .toPromise());
46
+ return data.builds.byId;
47
+ },
29
48
  async allForAppAsync(appId, { limit = 10, offset = 0, filter }) {
30
49
  var _a, _b;
31
50
  const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
@@ -1,4 +1,5 @@
1
- import { AssetMetadataResult } from '../generated';
1
+ import { AssetMetadataResult, GetAssetLimitPerUpdateGroupForAppQuery } from '../generated';
2
2
  export declare const PublishQuery: {
3
3
  getAssetMetadataAsync(storageKeys: string[]): Promise<AssetMetadataResult[]>;
4
+ getAssetLimitPerUpdateGroupAsync(appId: string): Promise<GetAssetLimitPerUpdateGroupForAppQuery['app']['byId']['assetLimitPerUpdateGroup']>;
4
5
  };
@@ -26,4 +26,20 @@ exports.PublishQuery = {
26
26
  .toPromise());
27
27
  return data.asset.metadata;
28
28
  },
29
+ async getAssetLimitPerUpdateGroupAsync(appId) {
30
+ const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
31
+ .query((0, graphql_tag_1.default) `
32
+ query GetAssetLimitPerUpdateGroupForApp($appId: String!) {
33
+ app {
34
+ byId(appId: $appId) {
35
+ id
36
+ assetLimitPerUpdateGroup
37
+ }
38
+ }
39
+ }
40
+ `, { appId }, { additionalTypenames: [] } // required arg
41
+ )
42
+ .toPromise());
43
+ return data.app.byId.assetLimitPerUpdateGroup;
44
+ },
29
45
  };
@@ -1,10 +1,8 @@
1
- import { ViewAllUpdatesQuery, ViewBranchUpdatesQuery, ViewBranchUpdatesQueryVariables } from '../generated';
2
- export declare const viewBranchUpdatesQueryUpdateLimit = 300;
3
- declare type ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset = Partial<ViewBranchUpdatesQueryVariables> & Pick<ViewBranchUpdatesQueryVariables, 'appId' | 'name'>;
1
+ import { ViewAllUpdatesQuery, ViewAllUpdatesQueryVariables, ViewBranchUpdatesQuery, ViewBranchUpdatesQueryVariables } from '../generated';
2
+ export declare type BranchUpdateObject = Exclude<ViewBranchUpdatesQuery['app']['byId']['updateBranchByName'], null | undefined>['updates'][number];
3
+ export declare type AppUpdateObject = ViewAllUpdatesQuery['app']['byId']['updates'][number];
4
+ export declare type UpdateObject = BranchUpdateObject | AppUpdateObject;
4
5
  export declare const UpdateQuery: {
5
- viewAllAsync({ appId }: {
6
- appId: string;
7
- }): Promise<ViewAllUpdatesQuery>;
8
- viewBranchAsync({ appId, name, limit, offset, }: ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset): Promise<ViewBranchUpdatesQuery>;
6
+ viewAllAsync({ appId, limit, offset }: ViewAllUpdatesQueryVariables): Promise<ViewAllUpdatesQuery>;
7
+ viewBranchAsync({ appId, name, limit, offset }: ViewBranchUpdatesQueryVariables): Promise<ViewBranchUpdatesQuery>;
9
8
  };
10
- export {};
@@ -1,37 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateQuery = exports.viewBranchUpdatesQueryUpdateLimit = void 0;
3
+ exports.UpdateQuery = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
6
  const client_1 = require("../client");
7
- exports.viewBranchUpdatesQueryUpdateLimit = 300;
8
7
  exports.UpdateQuery = {
9
- async viewAllAsync({ appId }) {
8
+ async viewAllAsync({ appId, limit, offset }) {
10
9
  return (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
11
10
  .query((0, graphql_tag_1.default) `
12
- query ViewAllUpdates($appId: String!, $limit: Int!) {
11
+ query ViewAllUpdates($appId: String!, $limit: Int!, $offset: Int!) {
13
12
  app {
14
13
  byId(appId: $appId) {
15
14
  id
16
- updateBranches(offset: 0, limit: $limit) {
15
+ updates(limit: $limit, offset: $offset) {
17
16
  id
18
- name
19
- updates(offset: 0, limit: $limit) {
17
+ group
18
+ message
19
+ createdAt
20
+ runtimeVersion
21
+ platform
22
+ actor {
20
23
  id
21
- group
22
- message
23
- createdAt
24
- runtimeVersion
25
- platform
26
- actor {
27
- id
28
- ... on User {
29
- username
30
- }
31
- ... on Robot {
32
- firstName
33
- }
24
+ ... on User {
25
+ username
34
26
  }
27
+ ... on Robot {
28
+ firstName
29
+ }
30
+ }
31
+ branch {
32
+ id
33
+ name
35
34
  }
36
35
  }
37
36
  }
@@ -39,11 +38,12 @@ exports.UpdateQuery = {
39
38
  }
40
39
  `, {
41
40
  appId,
42
- limit: exports.viewBranchUpdatesQueryUpdateLimit,
41
+ limit,
42
+ offset,
43
43
  }, { additionalTypenames: ['UpdateBranch', 'Update'] })
44
44
  .toPromise());
45
45
  },
46
- async viewBranchAsync({ appId, name, limit = exports.viewBranchUpdatesQueryUpdateLimit, offset = 0, }) {
46
+ async viewBranchAsync({ appId, name, limit, offset }) {
47
47
  return (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
48
48
  .query((0, graphql_tag_1.default) `
49
49
  query ViewBranchUpdates($appId: String!, $name: String!, $limit: Int!, $offset: Int!) {
@@ -53,7 +53,7 @@ exports.UpdateQuery = {
53
53
  updateBranchByName(name: $name) {
54
54
  id
55
55
  name
56
- updates(offset: $offset, limit: $limit) {
56
+ updates(limit: $limit, offset: $offset) {
57
57
  id
58
58
  group
59
59
  message
@@ -70,6 +70,10 @@ exports.UpdateQuery = {
70
70
  firstName
71
71
  }
72
72
  }
73
+ branch {
74
+ id
75
+ name
76
+ }
73
77
  }
74
78
  }
75
79
  }
@@ -1 +1,2 @@
1
1
  export declare const BuildFragmentNode: import("graphql").DocumentNode;
2
+ export declare const BuildFragmentWithSubmissionsNode: import("graphql").DocumentNode;
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuildFragmentNode = void 0;
3
+ exports.BuildFragmentWithSubmissionsNode = exports.BuildFragmentNode = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const graphql_1 = require("graphql");
5
6
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
+ const Submission_1 = require("./Submission");
6
8
  exports.BuildFragmentNode = (0, graphql_tag_1.default) `
7
9
  fragment BuildFragment on Build {
8
10
  id
@@ -52,3 +54,16 @@ exports.BuildFragmentNode = (0, graphql_tag_1.default) `
52
54
  updatedAt
53
55
  }
54
56
  `;
57
+ exports.BuildFragmentWithSubmissionsNode = (0, graphql_tag_1.default) `
58
+ ${(0, graphql_1.print)(Submission_1.SubmissionFragmentNode)}
59
+ ${(0, graphql_1.print)(exports.BuildFragmentNode)}
60
+
61
+ fragment BuildWithSubmissionsFragment on Build {
62
+ id
63
+ ...BuildFragment
64
+ submissions {
65
+ id
66
+ ...SubmissionFragment
67
+ }
68
+ }
69
+ `;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
- import { AgeRatingDeclaration, AppInfoLocalization, AppStoreReviewDetail, AppStoreVersion, AppStoreVersionLocalization, CategoryIds } from '@expo/apple-utils';
2
+ import { AgeRatingDeclaration, AppInfoLocalization, AppStoreReviewDetail, AppStoreVersion, AppStoreVersionLocalization, AppStoreVersionPhasedRelease, CategoryIds } from '@expo/apple-utils';
3
3
  import { AttributesOf } from '../../utils/asc';
4
4
  import { AppleMetadata } from '../types';
5
5
  declare type PartialExcept<T, K extends keyof T> = Pick<T, K> & Partial<Omit<T, K>>;
@@ -17,7 +17,8 @@ export declare class AppleConfigReader {
17
17
  getCategories(): CategoryIds | null;
18
18
  /** Get the `AppStoreVersion` object. */
19
19
  getVersion(): Partial<Omit<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>> | null;
20
- getVersionRelease(): Partial<Pick<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>> | null;
20
+ getVersionReleaseType(): Partial<Pick<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>> | null;
21
+ getVersionReleasePhased(): Pick<AttributesOf<AppStoreVersionPhasedRelease>, 'phasedReleaseState'> | null;
21
22
  getVersionLocale(locale: string, context: {
22
23
  versionIsFirst: boolean;
23
24
  }): Partial<AttributesOf<AppStoreVersionLocalization>> | null;
@@ -88,16 +88,22 @@ class AppleConfigReader {
88
88
  }
89
89
  /** Get the `AppStoreVersion` object. */
90
90
  getVersion() {
91
- return this.schema.copyright ? { copyright: this.schema.copyright } : null;
91
+ var _a, _b;
92
+ const attributes = {
93
+ versionString: (_a = this.schema.version) !== null && _a !== void 0 ? _a : '',
94
+ copyright: (_b = this.schema.copyright) !== null && _b !== void 0 ? _b : null,
95
+ };
96
+ const hasValues = Object.values(attributes).some(Boolean);
97
+ return hasValues ? attributes : null;
92
98
  }
93
- getVersionRelease() {
99
+ getVersionReleaseType() {
94
100
  var _a, _b;
95
101
  const { release } = this.schema;
96
- if (release === null || release === void 0 ? void 0 : release.autoReleaseDate) {
102
+ if (typeof (release === null || release === void 0 ? void 0 : release.automaticRelease) === 'string') {
97
103
  return {
98
104
  releaseType: apple_utils_1.ReleaseType.SCHEDULED,
99
- // Convert time format to 2020-06-17T12:00:00-07:00
100
- earliestReleaseDate: (_b = (_a = (0, date_1.removeDatePrecision)(release.autoReleaseDate)) === null || _a === void 0 ? void 0 : _a.toISOString()) !== null && _b !== void 0 ? _b : null,
105
+ // Convert time format to 2020-06-17T12:00:00-07:00, if that fails, try the date anyways.
106
+ earliestReleaseDate: (_b = (_a = (0, date_1.removeDatePrecision)(release.automaticRelease)) === null || _a === void 0 ? void 0 : _a.toISOString()) !== null && _b !== void 0 ? _b : release.automaticRelease,
101
107
  };
102
108
  }
103
109
  if ((release === null || release === void 0 ? void 0 : release.automaticRelease) === true) {
@@ -114,6 +120,17 @@ class AppleConfigReader {
114
120
  }
115
121
  return null;
116
122
  }
123
+ getVersionReleasePhased() {
124
+ var _a;
125
+ if (((_a = this.schema.release) === null || _a === void 0 ? void 0 : _a.phasedRelease) === true) {
126
+ return {
127
+ phasedReleaseState: apple_utils_1.PhasedReleaseState.ACTIVE,
128
+ };
129
+ }
130
+ // When phased release is turned off, we need to delete the phased release request.
131
+ // There is no concept (yet) of pausing the phased release through EAS metadata.
132
+ return null;
133
+ }
117
134
  getVersionLocale(locale, context) {
118
135
  var _a, _b;
119
136
  const info = (_a = this.schema.info) === null || _a === void 0 ? void 0 : _a[locale];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
- import { AgeRatingDeclaration, AppInfo, AppInfoLocalization, AppStoreReviewDetail, AppStoreVersion, AppStoreVersionLocalization } from '@expo/apple-utils';
2
+ import { AgeRatingDeclaration, AppInfo, AppInfoLocalization, AppStoreReviewDetail, AppStoreVersion, AppStoreVersionLocalization, AppStoreVersionPhasedRelease } from '@expo/apple-utils';
3
3
  import { AttributesOf } from '../../utils/asc';
4
4
  import { AppleMetadata } from '../types';
5
5
  /**
@@ -18,7 +18,8 @@ export declare class AppleConfigWriter {
18
18
  setInfoLocale(attributes: AttributesOf<AppInfoLocalization>): void;
19
19
  setCategories(attributes: Pick<AttributesOf<AppInfo>, 'primaryCategory' | 'primarySubcategoryOne' | 'primarySubcategoryTwo' | 'secondaryCategory' | 'secondarySubcategoryOne' | 'secondarySubcategoryTwo'>): void;
20
20
  setVersion(attributes: Omit<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>): void;
21
- setVersionRelease(attributes: Pick<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>): void;
21
+ setVersionReleaseType(attributes: Pick<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>): void;
22
+ setVersionReleasePhased(attributes?: AttributesOf<AppStoreVersionPhasedRelease>): void;
22
23
  setVersionLocale(attributes: AttributesOf<AppStoreVersionLocalization>): void;
23
24
  setReviewDetails(attributes: AttributesOf<AppStoreReviewDetail>): void;
24
25
  }
@@ -82,23 +82,39 @@ class AppleConfigWriter {
82
82
  }
83
83
  }
84
84
  setVersion(attributes) {
85
+ this.schema.version = optional(attributes.versionString);
85
86
  this.schema.copyright = optional(attributes.copyright);
86
87
  }
87
- setVersionRelease(attributes) {
88
- if (attributes.releaseType === apple_utils_1.ReleaseType.SCHEDULED) {
88
+ setVersionReleaseType(attributes) {
89
+ if (attributes.releaseType === apple_utils_1.ReleaseType.SCHEDULED && attributes.earliestReleaseDate) {
89
90
  this.schema.release = {
90
- autoReleaseDate: optional(attributes.earliestReleaseDate),
91
+ ...this.schema.release,
92
+ automaticRelease: attributes.earliestReleaseDate,
91
93
  };
92
94
  }
93
95
  if (attributes.releaseType === apple_utils_1.ReleaseType.AFTER_APPROVAL) {
94
96
  this.schema.release = {
97
+ ...this.schema.release,
95
98
  automaticRelease: true,
96
99
  };
97
100
  }
98
101
  if (attributes.releaseType === apple_utils_1.ReleaseType.MANUAL) {
99
- // ReleaseType.MANUAL is the default behavior, so we don't need to configure it.
100
- // Setting `"automaticRelease": false` is a bit confusing for people who don't know what automaticRelease does.
101
- this.schema.release = undefined;
102
+ this.schema.release = {
103
+ ...this.schema.release,
104
+ automaticRelease: false,
105
+ };
106
+ }
107
+ }
108
+ setVersionReleasePhased(attributes) {
109
+ var _a;
110
+ if (!attributes) {
111
+ (_a = this.schema.release) === null || _a === void 0 ? true : delete _a.phasedRelease;
112
+ }
113
+ else {
114
+ this.schema.release = {
115
+ ...this.schema.release,
116
+ phasedRelease: true,
117
+ };
102
118
  }
103
119
  }
104
120
  setVersionLocale(attributes) {
@@ -1,11 +1,13 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
- import { AppStoreVersion, AppStoreVersionLocalization, Platform } from '@expo/apple-utils';
2
+ import { AppStoreVersion, AppStoreVersionLocalization, AppStoreVersionPhasedRelease, Platform } from '@expo/apple-utils';
3
3
  import { AppleTask, TaskDownloadOptions, TaskPrepareOptions, TaskUploadOptions } from '../task';
4
4
  export declare type AppVersionOptions = {
5
5
  /** If we should use the live version of the app (if available - defaults to false) */
6
6
  editLive: boolean;
7
7
  /** The platform to use (defaults to IOS) */
8
8
  platform: Platform;
9
+ /** A version to create or select, if defined in the store configuration */
10
+ version: string | null;
9
11
  };
10
12
  export declare type AppVersionData = {
11
13
  /** The current selected app store version to update */
@@ -16,6 +18,8 @@ export declare type AppVersionData = {
16
18
  versionIsFirst: boolean;
17
19
  /** All version locales that should be, or are enabled */
18
20
  versionLocales: AppStoreVersionLocalization[];
21
+ /** The (existing) phased release configuration, when set */
22
+ versionPhasedRelease: AppStoreVersionPhasedRelease | null;
19
23
  };
20
24
  export declare class AppVersionTask extends AppleTask {
21
25
  private options;
@@ -11,12 +11,13 @@ const retry_1 = require("../../utils/retry");
11
11
  const task_1 = require("../task");
12
12
  class AppVersionTask extends task_1.AppleTask {
13
13
  constructor(options = {}) {
14
- var _a, _b;
14
+ var _a, _b, _c;
15
15
  super();
16
16
  this.name = () => (this.options.editLive ? 'live app version' : 'editable app version');
17
17
  this.options = {
18
18
  platform: (_a = options.platform) !== null && _a !== void 0 ? _a : apple_utils_1.Platform.IOS,
19
19
  editLive: (_b = options.editLive) !== null && _b !== void 0 ? _b : false,
20
+ version: (_c = options.version) !== null && _c !== void 0 ? _c : null,
20
21
  };
21
22
  }
22
23
  async prepareAsync({ context }) {
@@ -26,24 +27,39 @@ class AppVersionTask extends task_1.AppleTask {
26
27
  context.versionIsFirst = versionIsFirst;
27
28
  context.versionIsLive = versionIsLive;
28
29
  context.versionLocales = await version.getLocalizationsAsync();
30
+ context.versionPhasedRelease = await version.getPhasedReleaseAsync();
29
31
  }
30
32
  async downloadAsync({ config, context }) {
33
+ var _a;
31
34
  (0, assert_1.default)(context.version, `App version not initialized, can't download version`);
32
35
  config.setVersion(context.version.attributes);
33
- config.setVersionRelease(context.version.attributes);
36
+ config.setVersionReleaseType(context.version.attributes);
37
+ config.setVersionReleasePhased((_a = context.versionPhasedRelease) === null || _a === void 0 ? void 0 : _a.attributes);
34
38
  for (const locale of context.versionLocales) {
35
39
  config.setVersionLocale(locale.attributes);
36
40
  }
37
41
  }
38
42
  async uploadAsync({ config, context }) {
39
- (0, assert_1.default)(context.version, `App version not initialized, can't update version`);
40
43
  const version = config.getVersion();
41
- const release = config.getVersionRelease();
44
+ if (!context.version && (version === null || version === void 0 ? void 0 : version.versionString)) {
45
+ context.version = await (0, log_2.logAsync)(() => {
46
+ return context.app.createVersionAsync({
47
+ versionString: version.versionString,
48
+ platform: this.options.platform,
49
+ });
50
+ }, {
51
+ pending: `Creating new version ${chalk_1.default.bold(version.versionString)}...`,
52
+ success: `Created new version ${chalk_1.default.bold(version.versionString)}`,
53
+ failure: `Failed creating new version ${chalk_1.default.bold(version.versionString)}`,
54
+ });
55
+ }
56
+ (0, assert_1.default)(context.version, `App version not initialized, can't update version`);
57
+ const { versionString } = context.version.attributes;
58
+ const release = config.getVersionReleaseType();
42
59
  if (!version && !release) {
43
60
  log_1.default.log((0, chalk_1.default) `{dim - Skipped version and release update, not configured}`);
44
61
  }
45
62
  else {
46
- const { versionString } = context.version.attributes;
47
63
  const description = [version && 'version', release && 'release']
48
64
  .filter(Boolean)
49
65
  .join(' and ');
@@ -53,6 +69,24 @@ class AppVersionTask extends task_1.AppleTask {
53
69
  failure: `Failed updating ${description} info for ${chalk_1.default.bold(versionString)}`,
54
70
  });
55
71
  }
72
+ const phasedRelease = config.getVersionReleasePhased();
73
+ if (!phasedRelease && shouldDeletePhasedRelease(context.versionPhasedRelease)) {
74
+ // if phased release was enabled, but now disabled, we need to remove it
75
+ await (0, log_2.logAsync)(() => context.versionPhasedRelease.deleteAsync(), {
76
+ pending: `Disabling phased release for ${chalk_1.default.bold(versionString)}...`,
77
+ success: `Disabled phased release for ${chalk_1.default.bold(versionString)}`,
78
+ failure: `Failed disabling phased release for ${chalk_1.default.bold(versionString)}`,
79
+ });
80
+ context.versionPhasedRelease = null;
81
+ }
82
+ else if (phasedRelease && !context.versionPhasedRelease) {
83
+ // if phased release was not yet set, but now enabled, we need to create it
84
+ context.versionPhasedRelease = await (0, log_2.logAsync)(() => context.version.createPhasedReleaseAsync({ state: phasedRelease.phasedReleaseState }), {
85
+ pending: `Enabling phased release for ${chalk_1.default.bold(versionString)}...`,
86
+ success: `Enabled phased release for ${chalk_1.default.bold(versionString)}`,
87
+ failure: `Failed enabling phased release for ${chalk_1.default.bold(versionString)}`,
88
+ });
89
+ }
56
90
  const locales = config.getLocales();
57
91
  if (locales.length <= 0) {
58
92
  log_1.default.log((0, chalk_1.default) `{dim - Skipped localized version update, no locales configured}`);
@@ -80,13 +114,23 @@ class AppVersionTask extends task_1.AppleTask {
80
114
  }
81
115
  exports.AppVersionTask = AppVersionTask;
82
116
  /**
83
- * Resolve the AppStoreVersion instance, either from live or editable version.
117
+ * Resolve the AppStoreVersion instance, either from the store config, live, or editable version.
84
118
  * This also checks if this is the first version, which disallow release notes.
85
119
  */
86
- async function resolveVersionAsync(app, { editLive, platform }) {
120
+ async function resolveVersionAsync(app, { editLive, platform, version: versionString }) {
87
121
  let version = null;
88
122
  let versionIsLive = false;
89
- if (editLive) {
123
+ if (versionString) {
124
+ version = await findEditAppStoreVersionAsync(app, { platform, version: versionString });
125
+ if (!version) {
126
+ version = await createOrUpdateEditAppStoreVersionAsync(app, {
127
+ platform,
128
+ version: versionString,
129
+ });
130
+ }
131
+ versionIsLive = (version === null || version === void 0 ? void 0 : version.attributes.appStoreState) === apple_utils_1.AppStoreState.READY_FOR_SALE;
132
+ }
133
+ if (!version && editLive) {
90
134
  version = await app.getLiveAppStoreVersionAsync({ platform });
91
135
  versionIsLive = !!version;
92
136
  }
@@ -102,3 +146,60 @@ async function resolveVersionAsync(app, { editLive, platform }) {
102
146
  versionIsFirst: versions.length === 1,
103
147
  };
104
148
  }
149
+ /**
150
+ * Determine if we can, and should, delete the phased release instance.
151
+ * This returns true if the instance exist, and has one of the states below:
152
+ * - PhasedReleaseState.INACTIVE
153
+ * - PhasedReleaseState.ACTIVE
154
+ * - PhasedReleaseState.PAUSED
155
+ */
156
+ function shouldDeletePhasedRelease(phasedRelease) {
157
+ if (!phasedRelease ||
158
+ phasedRelease.attributes.phasedReleaseState === apple_utils_1.PhasedReleaseState.COMPLETE) {
159
+ return false;
160
+ }
161
+ return true;
162
+ }
163
+ /*
164
+ * Search for editable app store versions that matches the `versionString` option.
165
+ * When nothing is found, it will return `null`, and a new version should be created.
166
+ */
167
+ async function findEditAppStoreVersionAsync(app, options) {
168
+ if (options.version) {
169
+ const versions = await app.getAppStoreVersionsAsync({
170
+ query: {
171
+ limit: 200,
172
+ filter: {
173
+ platform: options.platform,
174
+ appStoreState: [
175
+ apple_utils_1.AppStoreState.PREPARE_FOR_SUBMISSION,
176
+ apple_utils_1.AppStoreState.DEVELOPER_REJECTED,
177
+ apple_utils_1.AppStoreState.REJECTED,
178
+ apple_utils_1.AppStoreState.METADATA_REJECTED,
179
+ apple_utils_1.AppStoreState.WAITING_FOR_REVIEW,
180
+ apple_utils_1.AppStoreState.INVALID_BINARY,
181
+ ].join(','),
182
+ },
183
+ },
184
+ });
185
+ const version = versions.find(model => model.attributes.versionString === options.version);
186
+ if (version) {
187
+ return version;
188
+ }
189
+ }
190
+ return null;
191
+ }
192
+ /**
193
+ * Check if we can reuse an existing editable app version that has not been published yet.
194
+ * If not, it creates a new version based on the version string.
195
+ */
196
+ async function createOrUpdateEditAppStoreVersionAsync(app, options) {
197
+ const version = await app.getEditAppStoreVersionAsync({ platform: options.platform });
198
+ if (version) {
199
+ return await version.updateAsync({ versionString: options.version });
200
+ }
201
+ return await app.createVersionAsync({
202
+ versionString: options.version,
203
+ platform: options.platform,
204
+ });
205
+ }