eas-cli 0.53.1 → 0.55.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 (66) hide show
  1. package/README.md +78 -42
  2. package/build/build/android/build.js +2 -1
  3. package/build/build/build.d.ts +2 -2
  4. package/build/build/build.js +9 -3
  5. package/build/build/context.d.ts +2 -0
  6. package/build/build/createContext.d.ts +3 -1
  7. package/build/build/createContext.js +2 -1
  8. package/build/build/ios/build.js +2 -1
  9. package/build/build/runBuildAndSubmit.d.ts +2 -0
  10. package/build/build/runBuildAndSubmit.js +19 -4
  11. package/build/build/types.d.ts +4 -0
  12. package/build/build/types.js +6 -1
  13. package/build/build/utils/url.d.ts +1 -0
  14. package/build/build/utils/url.js +5 -1
  15. package/build/commands/build/index.d.ts +2 -1
  16. package/build/commands/build/index.js +9 -54
  17. package/build/commands/config.js +0 -2
  18. package/build/commands/metadata/pull.d.ts +8 -0
  19. package/build/commands/metadata/pull.js +59 -0
  20. package/build/commands/metadata/push.d.ts +8 -0
  21. package/build/commands/metadata/push.js +53 -0
  22. package/build/commands/submit.js +2 -1
  23. package/build/commands/update/index.d.ts +13 -0
  24. package/build/commands/update/index.js +88 -35
  25. package/build/env.d.ts +11 -0
  26. package/build/env.js +12 -0
  27. package/build/graphql/generated.d.ts +39 -12
  28. package/build/graphql/generated.js +9 -1
  29. package/build/graphql/mutations/BuildMutation.d.ts +3 -1
  30. package/build/graphql/mutations/BuildMutation.js +14 -2
  31. package/build/graphql/queries/UpdateQuery.d.ts +4 -1
  32. package/build/graphql/queries/UpdateQuery.js +8 -7
  33. package/build/graphql/queries/WebhookQuery.d.ts +1 -1
  34. package/build/metadata/apple/config/reader.d.ts +2 -1
  35. package/build/metadata/apple/config/reader.js +68 -10
  36. package/build/metadata/apple/config/writer.d.ts +3 -2
  37. package/build/metadata/apple/config/writer.js +64 -12
  38. package/build/metadata/apple/data.d.ts +2 -1
  39. package/build/metadata/apple/tasks/app-info.js +8 -6
  40. package/build/metadata/apple/tasks/app-review-detail.d.ts +14 -0
  41. package/build/metadata/apple/tasks/app-review-detail.js +49 -0
  42. package/build/metadata/apple/tasks/app-version.js +16 -12
  43. package/build/metadata/apple/tasks/index.js +2 -1
  44. package/build/metadata/apple/types.d.ts +9 -11
  45. package/build/metadata/context.js +7 -14
  46. package/build/metadata/download.js +9 -2
  47. package/build/metadata/errors.d.ts +7 -2
  48. package/build/metadata/errors.js +25 -6
  49. package/build/metadata/upload.d.ts +3 -1
  50. package/build/metadata/upload.js +17 -3
  51. package/build/metadata/utils/date.d.ts +1 -1
  52. package/build/project/android/applicationId.js +4 -0
  53. package/build/project/ensureProjectExists.js +4 -1
  54. package/build/project/publish.d.ts +6 -1
  55. package/build/project/publish.js +23 -5
  56. package/build/project/workflow.js +13 -11
  57. package/build/uploads.d.ts +6 -0
  58. package/build/uploads.js +15 -3
  59. package/build/utils/expodash/uniq.d.ts +1 -0
  60. package/build/{metadata/utils/array.js → utils/expodash/uniq.js} +2 -3
  61. package/build/utils/profiles.d.ts +3 -3
  62. package/build/utils/profiles.js +5 -93
  63. package/oclif.manifest.json +1 -1
  64. package/package.json +11 -6
  65. package/schema/metadata-0.json +988 -0
  66. package/build/metadata/utils/array.d.ts +0 -1
@@ -1301,10 +1301,13 @@ export declare type Build = ActivityTimelineProjectActivity & BuildOrBuildJob &
1301
1301
  appVersion?: Maybe<Scalars['String']>;
1302
1302
  artifacts?: Maybe<BuildArtifacts>;
1303
1303
  buildProfile?: Maybe<Scalars['String']>;
1304
+ canRetry: Scalars['Boolean'];
1304
1305
  cancelingActor?: Maybe<Actor>;
1305
1306
  channel?: Maybe<Scalars['String']>;
1306
- createdAt?: Maybe<Scalars['DateTime']>;
1307
+ completedAt?: Maybe<Scalars['DateTime']>;
1308
+ createdAt: Scalars['DateTime'];
1307
1309
  distribution?: Maybe<DistributionType>;
1310
+ enqueuedAt?: Maybe<Scalars['DateTime']>;
1308
1311
  error?: Maybe<BuildError>;
1309
1312
  estimatedWaitTimeLeftSeconds?: Maybe<Scalars['Int']>;
1310
1313
  expirationDate?: Maybe<Scalars['DateTime']>;
@@ -1319,18 +1322,22 @@ export declare type Build = ActivityTimelineProjectActivity & BuildOrBuildJob &
1319
1322
  isGitWorkingTreeDirty?: Maybe<Scalars['Boolean']>;
1320
1323
  logFiles: Array<Scalars['String']>;
1321
1324
  metrics?: Maybe<BuildMetrics>;
1325
+ parentBuild?: Maybe<Build>;
1322
1326
  platform: AppPlatform;
1323
1327
  priority: BuildPriority;
1324
1328
  project: Project;
1329
+ provisioningStartedAt?: Maybe<Scalars['DateTime']>;
1325
1330
  /** Queue position is 1-indexed */
1326
1331
  queuePosition?: Maybe<Scalars['Int']>;
1327
1332
  reactNativeVersion?: Maybe<Scalars['String']>;
1328
1333
  releaseChannel?: Maybe<Scalars['String']>;
1334
+ resourceClass?: Maybe<BuildResourceClass>;
1329
1335
  runtimeVersion?: Maybe<Scalars['String']>;
1330
1336
  sdkVersion?: Maybe<Scalars['String']>;
1331
1337
  status: BuildStatus;
1332
1338
  submissions: Array<Submission>;
1333
- updatedAt?: Maybe<Scalars['DateTime']>;
1339
+ updatedAt: Scalars['DateTime'];
1340
+ workerStartedAt?: Maybe<Scalars['DateTime']>;
1334
1341
  };
1335
1342
  export declare type BuildArtifact = {
1336
1343
  __typename?: 'BuildArtifact';
@@ -1482,26 +1489,36 @@ export declare type BuildMutation = {
1482
1489
  createIosBuild: CreateBuildResult;
1483
1490
  /** Delete an EAS Build build */
1484
1491
  deleteBuild: Build;
1492
+ /** Retry an EAS Build build */
1493
+ retryBuild: Build;
1485
1494
  };
1486
1495
  export declare type BuildMutationCancelBuildArgs = {
1487
1496
  buildId: Scalars['ID'];
1488
1497
  };
1489
1498
  export declare type BuildMutationCreateAndroidBuildArgs = {
1490
1499
  appId: Scalars['ID'];
1500
+ buildParams?: InputMaybe<BuildParamsInput>;
1491
1501
  job: AndroidJobInput;
1492
1502
  metadata?: InputMaybe<BuildMetadataInput>;
1493
1503
  };
1494
1504
  export declare type BuildMutationCreateIosBuildArgs = {
1495
1505
  appId: Scalars['ID'];
1506
+ buildParams?: InputMaybe<BuildParamsInput>;
1496
1507
  job: IosJobInput;
1497
1508
  metadata?: InputMaybe<BuildMetadataInput>;
1498
1509
  };
1499
1510
  export declare type BuildMutationDeleteBuildArgs = {
1500
1511
  buildId: Scalars['ID'];
1501
1512
  };
1513
+ export declare type BuildMutationRetryBuildArgs = {
1514
+ buildId: Scalars['ID'];
1515
+ };
1502
1516
  export declare type BuildOrBuildJob = {
1503
1517
  id: Scalars['ID'];
1504
1518
  };
1519
+ export declare type BuildParamsInput = {
1520
+ resourceClass: BuildResourceClass;
1521
+ };
1505
1522
  export declare enum BuildPriority {
1506
1523
  High = "HIGH",
1507
1524
  Normal = "NORMAL"
@@ -1557,6 +1574,13 @@ export declare type BuildQueryAllForAppArgs = {
1557
1574
  export declare type BuildQueryByIdArgs = {
1558
1575
  buildId: Scalars['ID'];
1559
1576
  };
1577
+ export declare enum BuildResourceClass {
1578
+ AndroidDefault = "ANDROID_DEFAULT",
1579
+ AndroidLarge = "ANDROID_LARGE",
1580
+ IosDefault = "IOS_DEFAULT",
1581
+ IosLarge = "IOS_LARGE",
1582
+ Legacy = "LEGACY"
1583
+ }
1560
1584
  export declare enum BuildStatus {
1561
1585
  Canceled = "CANCELED",
1562
1586
  Errored = "ERRORED",
@@ -5739,6 +5763,7 @@ export declare type CreateAndroidBuildMutationVariables = Exact<{
5739
5763
  appId: Scalars['ID'];
5740
5764
  job: AndroidJobInput;
5741
5765
  metadata?: InputMaybe<BuildMetadataInput>;
5766
+ buildParams?: InputMaybe<BuildParamsInput>;
5742
5767
  }>;
5743
5768
  export declare type CreateAndroidBuildMutation = {
5744
5769
  __typename?: 'RootMutation';
@@ -5765,8 +5790,8 @@ export declare type CreateAndroidBuildMutation = {
5765
5790
  queuePosition?: number | null;
5766
5791
  estimatedWaitTimeLeftSeconds?: number | null;
5767
5792
  priority: BuildPriority;
5768
- createdAt?: any | null;
5769
- updatedAt?: any | null;
5793
+ createdAt: any;
5794
+ updatedAt: any;
5770
5795
  error?: {
5771
5796
  __typename?: 'BuildError';
5772
5797
  errorCode: string;
@@ -5816,6 +5841,7 @@ export declare type CreateIosBuildMutationVariables = Exact<{
5816
5841
  appId: Scalars['ID'];
5817
5842
  job: IosJobInput;
5818
5843
  metadata?: InputMaybe<BuildMetadataInput>;
5844
+ buildParams?: InputMaybe<BuildParamsInput>;
5819
5845
  }>;
5820
5846
  export declare type CreateIosBuildMutation = {
5821
5847
  __typename?: 'RootMutation';
@@ -5842,8 +5868,8 @@ export declare type CreateIosBuildMutation = {
5842
5868
  queuePosition?: number | null;
5843
5869
  estimatedWaitTimeLeftSeconds?: number | null;
5844
5870
  priority: BuildPriority;
5845
- createdAt?: any | null;
5846
- updatedAt?: any | null;
5871
+ createdAt: any;
5872
+ updatedAt: any;
5847
5873
  error?: {
5848
5874
  __typename?: 'BuildError';
5849
5875
  errorCode: string;
@@ -6200,8 +6226,8 @@ export declare type BuildsByIdQuery = {
6200
6226
  queuePosition?: number | null;
6201
6227
  estimatedWaitTimeLeftSeconds?: number | null;
6202
6228
  priority: BuildPriority;
6203
- createdAt?: any | null;
6204
- updatedAt?: any | null;
6229
+ createdAt: any;
6230
+ updatedAt: any;
6205
6231
  error?: {
6206
6232
  __typename?: 'BuildError';
6207
6233
  errorCode: string;
@@ -6273,8 +6299,8 @@ export declare type GetAllBuildsForAppQuery = {
6273
6299
  queuePosition?: number | null;
6274
6300
  estimatedWaitTimeLeftSeconds?: number | null;
6275
6301
  priority: BuildPriority;
6276
- createdAt?: any | null;
6277
- updatedAt?: any | null;
6302
+ createdAt: any;
6303
+ updatedAt: any;
6278
6304
  error?: {
6279
6305
  __typename?: 'BuildError';
6280
6306
  errorCode: string;
@@ -6563,6 +6589,7 @@ export declare type ViewBranchUpdatesQueryVariables = Exact<{
6563
6589
  appId: Scalars['String'];
6564
6590
  name: Scalars['String'];
6565
6591
  limit: Scalars['Int'];
6592
+ offset: Scalars['Int'];
6566
6593
  }>;
6567
6594
  export declare type ViewBranchUpdatesQuery = {
6568
6595
  __typename?: 'RootQuery';
@@ -6689,8 +6716,8 @@ export declare type BuildFragment = {
6689
6716
  queuePosition?: number | null;
6690
6717
  estimatedWaitTimeLeftSeconds?: number | null;
6691
6718
  priority: BuildPriority;
6692
- createdAt?: any | null;
6693
- updatedAt?: any | null;
6719
+ createdAt: any;
6720
+ updatedAt: any;
6694
6721
  error?: {
6695
6722
  __typename?: 'BuildError';
6696
6723
  errorCode: string;
@@ -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.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.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";
@@ -115,6 +115,14 @@ var BuildPriority;
115
115
  BuildPriority["High"] = "HIGH";
116
116
  BuildPriority["Normal"] = "NORMAL";
117
117
  })(BuildPriority = exports.BuildPriority || (exports.BuildPriority = {}));
118
+ var BuildResourceClass;
119
+ (function (BuildResourceClass) {
120
+ BuildResourceClass["AndroidDefault"] = "ANDROID_DEFAULT";
121
+ BuildResourceClass["AndroidLarge"] = "ANDROID_LARGE";
122
+ BuildResourceClass["IosDefault"] = "IOS_DEFAULT";
123
+ BuildResourceClass["IosLarge"] = "IOS_LARGE";
124
+ BuildResourceClass["Legacy"] = "LEGACY";
125
+ })(BuildResourceClass = exports.BuildResourceClass || (exports.BuildResourceClass = {}));
118
126
  var BuildStatus;
119
127
  (function (BuildStatus) {
120
128
  BuildStatus["Canceled"] = "CANCELED";
@@ -1,4 +1,4 @@
1
- import { AndroidJobInput, BuildFragment, BuildMetadataInput, EasBuildDeprecationInfo, IosJobInput } from '../generated';
1
+ import { AndroidJobInput, BuildFragment, BuildMetadataInput, BuildParamsInput, EasBuildDeprecationInfo, IosJobInput } from '../generated';
2
2
  export interface BuildResult {
3
3
  build: BuildFragment;
4
4
  deprecationInfo?: EasBuildDeprecationInfo | null;
@@ -8,10 +8,12 @@ export declare const BuildMutation: {
8
8
  appId: string;
9
9
  job: AndroidJobInput;
10
10
  metadata: BuildMetadataInput;
11
+ buildParams: BuildParamsInput;
11
12
  }): Promise<BuildResult>;
12
13
  createIosBuildAsync(input: {
13
14
  appId: string;
14
15
  job: IosJobInput;
15
16
  metadata: BuildMetadataInput;
17
+ buildParams: BuildParamsInput;
16
18
  }): Promise<BuildResult>;
17
19
  };
@@ -16,9 +16,15 @@ exports.BuildMutation = {
16
16
  $appId: ID!
17
17
  $job: AndroidJobInput!
18
18
  $metadata: BuildMetadataInput
19
+ $buildParams: BuildParamsInput
19
20
  ) {
20
21
  build {
21
- createAndroidBuild(appId: $appId, job: $job, metadata: $metadata) {
22
+ createAndroidBuild(
23
+ appId: $appId
24
+ job: $job
25
+ metadata: $metadata
26
+ buildParams: $buildParams
27
+ ) {
22
28
  build {
23
29
  id
24
30
  ...BuildFragment
@@ -43,9 +49,15 @@ exports.BuildMutation = {
43
49
  $appId: ID!
44
50
  $job: IosJobInput!
45
51
  $metadata: BuildMetadataInput
52
+ $buildParams: BuildParamsInput
46
53
  ) {
47
54
  build {
48
- createIosBuild(appId: $appId, job: $job, metadata: $metadata) {
55
+ createIosBuild(
56
+ appId: $appId
57
+ job: $job
58
+ metadata: $metadata
59
+ buildParams: $buildParams
60
+ ) {
49
61
  build {
50
62
  id
51
63
  ...BuildFragment
@@ -1,7 +1,10 @@
1
1
  import { ViewAllUpdatesQuery, ViewBranchUpdatesQuery, ViewBranchUpdatesQueryVariables } from '../generated';
2
+ export declare const viewBranchUpdatesQueryUpdateLimit = 300;
3
+ declare type ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset = Partial<ViewBranchUpdatesQueryVariables> & Pick<ViewBranchUpdatesQueryVariables, 'appId' | 'name'>;
2
4
  export declare const UpdateQuery: {
3
5
  viewAllAsync({ appId }: {
4
6
  appId: string;
5
7
  }): Promise<ViewAllUpdatesQuery>;
6
- viewBranchAsync({ appId, name }: Pick<ViewBranchUpdatesQueryVariables, 'appId' | 'name'>): Promise<ViewBranchUpdatesQuery>;
8
+ viewBranchAsync({ appId, name, limit, offset, }: ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset): Promise<ViewBranchUpdatesQuery>;
7
9
  };
10
+ export {};
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateQuery = void 0;
3
+ exports.UpdateQuery = exports.viewBranchUpdatesQueryUpdateLimit = 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
- const PAGE_LIMIT = 300;
7
+ exports.viewBranchUpdatesQueryUpdateLimit = 300;
8
8
  exports.UpdateQuery = {
9
9
  async viewAllAsync({ appId }) {
10
10
  return (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
@@ -39,21 +39,21 @@ exports.UpdateQuery = {
39
39
  }
40
40
  `, {
41
41
  appId,
42
- limit: PAGE_LIMIT,
42
+ limit: exports.viewBranchUpdatesQueryUpdateLimit,
43
43
  }, { additionalTypenames: ['UpdateBranch', 'Update'] })
44
44
  .toPromise());
45
45
  },
46
- async viewBranchAsync({ appId, name }) {
46
+ async viewBranchAsync({ appId, name, limit = exports.viewBranchUpdatesQueryUpdateLimit, offset = 0, }) {
47
47
  return (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
48
48
  .query((0, graphql_tag_1.default) `
49
- query ViewBranchUpdates($appId: String!, $name: String!, $limit: Int!) {
49
+ query ViewBranchUpdates($appId: String!, $name: String!, $limit: Int!, $offset: Int!) {
50
50
  app {
51
51
  byId(appId: $appId) {
52
52
  id
53
53
  updateBranchByName(name: $name) {
54
54
  id
55
55
  name
56
- updates(offset: 0, limit: $limit) {
56
+ updates(offset: $offset, limit: $limit) {
57
57
  id
58
58
  group
59
59
  message
@@ -78,7 +78,8 @@ exports.UpdateQuery = {
78
78
  `, {
79
79
  appId,
80
80
  name,
81
- limit: PAGE_LIMIT,
81
+ limit,
82
+ offset,
82
83
  }, { additionalTypenames: ['UpdateBranch', 'Update'] })
83
84
  .toPromise());
84
85
  },
@@ -1,5 +1,5 @@
1
1
  import { WebhookFilter, WebhookFragment } from '../generated';
2
2
  export declare const WebhookQuery: {
3
- byAppIdAsync(appId: string, webhookFilter?: WebhookFilter | undefined): Promise<WebhookFragment[]>;
3
+ byAppIdAsync(appId: string, webhookFilter?: WebhookFilter): Promise<WebhookFragment[]>;
4
4
  byIdAsync(webhookId: string): Promise<WebhookFragment>;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
- import { AgeRatingDeclaration, AppInfoLocalization, AppStoreVersion, AppStoreVersionLocalization, CategoryIds } from '@expo/apple-utils';
2
+ import { AgeRatingDeclaration, AppInfoLocalization, AppStoreReviewDetail, AppStoreVersion, AppStoreVersionLocalization, 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>>;
@@ -21,5 +21,6 @@ export declare class AppleConfigReader {
21
21
  getVersionLocale(locale: string, context: {
22
22
  versionIsFirst: boolean;
23
23
  }): Partial<AttributesOf<AppStoreVersionLocalization>> | null;
24
+ getReviewDetails(): Partial<AttributesOf<AppStoreReviewDetail>> | null;
24
25
  }
25
26
  export {};
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppleConfigReader = exports.DEFAULT_WHATSNEW = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const apple_utils_1 = require("@expo/apple-utils");
5
- const array_1 = require("../../utils/array");
6
+ const uniq_1 = tslib_1.__importDefault(require("../../../utils/expodash/uniq"));
6
7
  const date_1 = require("../../utils/date");
7
8
  // TODO: find out if we can move this to default JSON schema normalization
8
9
  exports.DEFAULT_WHATSNEW = 'Bug fixes and improved stability';
@@ -15,11 +16,33 @@ class AppleConfigReader {
15
16
  this.schema = schema;
16
17
  }
17
18
  getAgeRating() {
18
- return this.schema.advisory || null;
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
20
+ const attributes = this.schema.advisory;
21
+ if (!attributes) {
22
+ return null;
23
+ }
24
+ return {
25
+ alcoholTobaccoOrDrugUseOrReferences: (_a = attributes.alcoholTobaccoOrDrugUseOrReferences) !== null && _a !== void 0 ? _a : apple_utils_1.Rating.NONE,
26
+ contests: (_b = attributes.contests) !== null && _b !== void 0 ? _b : apple_utils_1.Rating.NONE,
27
+ gamblingSimulated: (_c = attributes.gamblingSimulated) !== null && _c !== void 0 ? _c : apple_utils_1.Rating.NONE,
28
+ horrorOrFearThemes: (_d = attributes.horrorOrFearThemes) !== null && _d !== void 0 ? _d : apple_utils_1.Rating.NONE,
29
+ matureOrSuggestiveThemes: (_e = attributes.matureOrSuggestiveThemes) !== null && _e !== void 0 ? _e : apple_utils_1.Rating.NONE,
30
+ medicalOrTreatmentInformation: (_f = attributes.medicalOrTreatmentInformation) !== null && _f !== void 0 ? _f : apple_utils_1.Rating.NONE,
31
+ profanityOrCrudeHumor: (_g = attributes.profanityOrCrudeHumor) !== null && _g !== void 0 ? _g : apple_utils_1.Rating.NONE,
32
+ sexualContentGraphicAndNudity: (_h = attributes.sexualContentGraphicAndNudity) !== null && _h !== void 0 ? _h : apple_utils_1.Rating.NONE,
33
+ sexualContentOrNudity: (_j = attributes.sexualContentOrNudity) !== null && _j !== void 0 ? _j : apple_utils_1.Rating.NONE,
34
+ violenceCartoonOrFantasy: (_k = attributes.violenceCartoonOrFantasy) !== null && _k !== void 0 ? _k : apple_utils_1.Rating.NONE,
35
+ violenceRealistic: (_l = attributes.violenceRealistic) !== null && _l !== void 0 ? _l : apple_utils_1.Rating.NONE,
36
+ violenceRealisticProlongedGraphicOrSadistic: (_m = attributes.violenceRealisticProlongedGraphicOrSadistic) !== null && _m !== void 0 ? _m : apple_utils_1.Rating.NONE,
37
+ gambling: (_o = attributes.gambling) !== null && _o !== void 0 ? _o : false,
38
+ unrestrictedWebAccess: (_p = attributes.unrestrictedWebAccess) !== null && _p !== void 0 ? _p : false,
39
+ kidsAgeBand: (_q = attributes.kidsAgeBand) !== null && _q !== void 0 ? _q : null,
40
+ seventeenPlus: (_r = attributes.seventeenPlus) !== null && _r !== void 0 ? _r : false,
41
+ };
19
42
  }
20
43
  getLocales() {
21
44
  // TODO: filter "default" locales, add option to add non-localized info to the config
22
- return (0, array_1.unique)(Object.keys(this.schema.info || {}));
45
+ return (0, uniq_1.default)(Object.keys(this.schema.info || {}));
23
46
  }
24
47
  getInfoLocale(locale) {
25
48
  var _a;
@@ -29,7 +52,7 @@ class AppleConfigReader {
29
52
  }
30
53
  return {
31
54
  locale,
32
- name: info.title || 'no name provided',
55
+ name: info.title,
33
56
  subtitle: info.subtitle,
34
57
  privacyChoicesUrl: info.privacyChoicesUrl,
35
58
  privacyPolicyText: info.privacyPolicyText,
@@ -37,13 +60,31 @@ class AppleConfigReader {
37
60
  };
38
61
  }
39
62
  getCategories() {
40
- if (Array.isArray(this.schema.categories) && this.schema.categories.length > 0) {
41
- return {
42
- primaryCategory: this.schema.categories[0],
43
- secondaryCategory: this.schema.categories[1],
44
- };
63
+ const { categories } = this.schema;
64
+ if (!categories || categories.length <= 0) {
65
+ return null;
45
66
  }
46
- return null;
67
+ // We validate the categories based on enums, but they will still be strings here.
68
+ const categoryIds = {};
69
+ if (Array.isArray(categories[0])) {
70
+ categoryIds.primaryCategory = categories[0][0];
71
+ categoryIds.primarySubcategoryOne = categories[0][1];
72
+ categoryIds.primarySubcategoryTwo = categories[0][2];
73
+ }
74
+ else {
75
+ categoryIds.primaryCategory = categories[0];
76
+ }
77
+ if (Array.isArray(categories[1])) {
78
+ categoryIds.secondaryCategory = categories[1][0];
79
+ categoryIds.secondarySubcategoryOne = categories[1][1];
80
+ categoryIds.secondarySubcategoryTwo = categories[1][2];
81
+ }
82
+ else {
83
+ categoryIds.secondaryCategory = categories[1];
84
+ }
85
+ // Because we handle categories as normal strings,
86
+ // the type doesn't match with the actual CategoryIds types.
87
+ return categoryIds;
47
88
  }
48
89
  /** Get the `AppStoreVersion` object. */
49
90
  getVersion() {
@@ -90,5 +131,22 @@ class AppleConfigReader {
90
131
  supportUrl: info.supportUrl,
91
132
  };
92
133
  }
134
+ getReviewDetails() {
135
+ const review = this.schema.review;
136
+ if (!review) {
137
+ return null;
138
+ }
139
+ return {
140
+ contactFirstName: review.firstName,
141
+ contactLastName: review.lastName,
142
+ contactEmail: review.email,
143
+ contactPhone: review.phone,
144
+ demoAccountName: review.demoUsername,
145
+ demoAccountPassword: review.demoPassword,
146
+ demoAccountRequired: review.demoRequired,
147
+ notes: review.notes,
148
+ // TODO: add attachment
149
+ };
150
+ }
93
151
  }
94
152
  exports.AppleConfigReader = AppleConfigReader;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
- import { AgeRatingDeclaration, AppInfo, AppInfoLocalization, AppStoreVersion, AppStoreVersionLocalization } from '@expo/apple-utils';
2
+ import { AgeRatingDeclaration, AppInfo, AppInfoLocalization, AppStoreReviewDetail, AppStoreVersion, AppStoreVersionLocalization } from '@expo/apple-utils';
3
3
  import { AttributesOf } from '../../utils/asc';
4
4
  import { AppleMetadata } from '../types';
5
5
  /**
@@ -16,8 +16,9 @@ export declare class AppleConfigWriter {
16
16
  };
17
17
  setAgeRating(attributes: AttributesOf<AgeRatingDeclaration>): void;
18
18
  setInfoLocale(attributes: AttributesOf<AppInfoLocalization>): void;
19
- setCategories({ primaryCategory, secondaryCategory }: AttributesOf<AppInfo>): void;
19
+ setCategories(attributes: Pick<AttributesOf<AppInfo>, 'primaryCategory' | 'primarySubcategoryOne' | 'primarySubcategoryTwo' | 'secondaryCategory' | 'secondarySubcategoryOne' | 'secondarySubcategoryTwo'>): void;
20
20
  setVersion(attributes: Omit<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>): void;
21
21
  setVersionRelease(attributes: Pick<AttributesOf<AppStoreVersion>, 'releaseType' | 'earliestReleaseDate'>): void;
22
22
  setVersionLocale(attributes: AttributesOf<AppStoreVersionLocalization>): void;
23
+ setReviewDetails(attributes: AttributesOf<AppStoreReviewDetail>): void;
23
24
  }
@@ -18,7 +18,25 @@ class AppleConfigWriter {
18
18
  };
19
19
  }
20
20
  setAgeRating(attributes) {
21
- this.schema.advisory = attributes;
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
22
+ this.schema.advisory = {
23
+ alcoholTobaccoOrDrugUseOrReferences: (_a = attributes.alcoholTobaccoOrDrugUseOrReferences) !== null && _a !== void 0 ? _a : apple_utils_1.Rating.NONE,
24
+ contests: (_b = attributes.contests) !== null && _b !== void 0 ? _b : apple_utils_1.Rating.NONE,
25
+ gamblingSimulated: (_c = attributes.gamblingSimulated) !== null && _c !== void 0 ? _c : apple_utils_1.Rating.NONE,
26
+ horrorOrFearThemes: (_d = attributes.horrorOrFearThemes) !== null && _d !== void 0 ? _d : apple_utils_1.Rating.NONE,
27
+ matureOrSuggestiveThemes: (_e = attributes.matureOrSuggestiveThemes) !== null && _e !== void 0 ? _e : apple_utils_1.Rating.NONE,
28
+ medicalOrTreatmentInformation: (_f = attributes.medicalOrTreatmentInformation) !== null && _f !== void 0 ? _f : apple_utils_1.Rating.NONE,
29
+ profanityOrCrudeHumor: (_g = attributes.profanityOrCrudeHumor) !== null && _g !== void 0 ? _g : apple_utils_1.Rating.NONE,
30
+ sexualContentGraphicAndNudity: (_h = attributes.sexualContentGraphicAndNudity) !== null && _h !== void 0 ? _h : apple_utils_1.Rating.NONE,
31
+ sexualContentOrNudity: (_j = attributes.sexualContentOrNudity) !== null && _j !== void 0 ? _j : apple_utils_1.Rating.NONE,
32
+ violenceCartoonOrFantasy: (_k = attributes.violenceCartoonOrFantasy) !== null && _k !== void 0 ? _k : apple_utils_1.Rating.NONE,
33
+ violenceRealistic: (_l = attributes.violenceRealistic) !== null && _l !== void 0 ? _l : apple_utils_1.Rating.NONE,
34
+ violenceRealisticProlongedGraphicOrSadistic: (_m = attributes.violenceRealisticProlongedGraphicOrSadistic) !== null && _m !== void 0 ? _m : apple_utils_1.Rating.NONE,
35
+ gambling: (_o = attributes.gambling) !== null && _o !== void 0 ? _o : false,
36
+ unrestrictedWebAccess: (_p = attributes.unrestrictedWebAccess) !== null && _p !== void 0 ? _p : false,
37
+ kidsAgeBand: (_q = attributes.kidsAgeBand) !== null && _q !== void 0 ? _q : null,
38
+ seventeenPlus: (_r = attributes.seventeenPlus) !== null && _r !== void 0 ? _r : false,
39
+ };
22
40
  }
23
41
  setInfoLocale(attributes) {
24
42
  var _a, _b, _c;
@@ -26,21 +44,41 @@ class AppleConfigWriter {
26
44
  const existing = (_b = this.schema.info[attributes.locale]) !== null && _b !== void 0 ? _b : {};
27
45
  this.schema.info[attributes.locale] = {
28
46
  ...existing,
29
- title: (_c = attributes.name) !== null && _c !== void 0 ? _c : 'no name provided',
47
+ title: (_c = attributes.name) !== null && _c !== void 0 ? _c : '',
30
48
  subtitle: optional(attributes.subtitle),
31
49
  privacyPolicyUrl: optional(attributes.privacyPolicyUrl),
32
50
  privacyPolicyText: optional(attributes.privacyPolicyText),
33
51
  privacyChoicesUrl: optional(attributes.privacyChoicesUrl),
34
52
  };
35
53
  }
36
- setCategories({ primaryCategory, secondaryCategory }) {
54
+ setCategories(attributes) {
55
+ var _a, _b, _c, _d, _e, _f;
56
+ this.schema.categories = undefined;
57
+ if (!attributes.primaryCategory && !attributes.secondaryCategory) {
58
+ return;
59
+ }
37
60
  this.schema.categories = [];
38
- // TODO: see why these types are conflicting
39
- if (primaryCategory) {
40
- this.schema.categories.push(primaryCategory.id);
41
- if (secondaryCategory) {
42
- this.schema.categories.push(secondaryCategory.id);
43
- }
61
+ if (attributes.primaryCategory && attributes.primarySubcategoryOne) {
62
+ this.schema.categories[0] = [
63
+ attributes.primaryCategory.id,
64
+ (_a = attributes.primarySubcategoryOne) === null || _a === void 0 ? void 0 : _a.id,
65
+ (_b = attributes.primarySubcategoryTwo) === null || _b === void 0 ? void 0 : _b.id,
66
+ ].filter(Boolean);
67
+ }
68
+ else {
69
+ // If only the secondaryCategory was provided,
70
+ // autofill with an empty string and cause a store config error.
71
+ this.schema.categories[0] = (_d = (_c = attributes.primaryCategory) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '';
72
+ }
73
+ if (attributes.secondaryCategory && attributes.secondarySubcategoryOne) {
74
+ this.schema.categories[1] = [
75
+ attributes.secondaryCategory.id,
76
+ (_e = attributes.secondarySubcategoryOne) === null || _e === void 0 ? void 0 : _e.id,
77
+ (_f = attributes.secondarySubcategoryTwo) === null || _f === void 0 ? void 0 : _f.id,
78
+ ].filter(Boolean);
79
+ }
80
+ else if (attributes.secondaryCategory) {
81
+ this.schema.categories[1] = attributes.secondaryCategory.id;
44
82
  }
45
83
  }
46
84
  setVersion(attributes) {
@@ -58,9 +96,9 @@ class AppleConfigWriter {
58
96
  };
59
97
  }
60
98
  if (attributes.releaseType === apple_utils_1.ReleaseType.MANUAL) {
61
- this.schema.release = {
62
- automaticRelease: false,
63
- };
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;
64
102
  }
65
103
  }
66
104
  setVersionLocale(attributes) {
@@ -77,6 +115,20 @@ class AppleConfigWriter {
77
115
  supportUrl: optional(attributes.supportUrl),
78
116
  };
79
117
  }
118
+ setReviewDetails(attributes) {
119
+ var _a, _b, _c, _d;
120
+ this.schema.review = {
121
+ firstName: (_a = attributes.contactFirstName) !== null && _a !== void 0 ? _a : '',
122
+ lastName: (_b = attributes.contactLastName) !== null && _b !== void 0 ? _b : '',
123
+ email: (_c = attributes.contactEmail) !== null && _c !== void 0 ? _c : '',
124
+ phone: (_d = attributes.contactPhone) !== null && _d !== void 0 ? _d : '',
125
+ demoUsername: optional(attributes.demoAccountName),
126
+ demoPassword: optional(attributes.demoAccountPassword),
127
+ demoRequired: optional(attributes.demoAccountRequired),
128
+ notes: optional(attributes.notes),
129
+ // TODO: add attachment
130
+ };
131
+ }
80
132
  }
81
133
  exports.AppleConfigWriter = AppleConfigWriter;
82
134
  /** Helper function to convert `T | null` to `T | undefined`, required for the entity properties */
@@ -2,6 +2,7 @@
2
2
  import type { App } from '@expo/apple-utils';
3
3
  import type { AgeRatingData } from './tasks/age-rating';
4
4
  import type { AppInfoData } from './tasks/app-info';
5
+ import type { AppReviewData } from './tasks/app-review-detail';
5
6
  import type { AppVersionData } from './tasks/app-version';
6
7
  /**
7
8
  * The fully prepared apple data, used within the `downloadAsync` or `uploadAsync` tasks.
@@ -9,7 +10,7 @@ import type { AppVersionData } from './tasks/app-version';
9
10
  */
10
11
  export declare type AppleData = {
11
12
  app: App;
12
- } & AppInfoData & AppVersionData & AgeRatingData;
13
+ } & AppInfoData & AppVersionData & AgeRatingData & AppReviewData;
13
14
  /**
14
15
  * The unprepared partial apple data, used within the `prepareAsync` tasks.
15
16
  * It contains a reference to the app, each task should populate the necessary data.
@@ -56,12 +56,14 @@ class AppInfoTask extends task_1.AppleTask {
56
56
  continue;
57
57
  }
58
58
  const model = context.infoLocales.find(model => model.attributes.locale === locale);
59
- await (0, log_2.logAsync)(() => model
60
- ? model.updateAsync(attributes)
61
- : context.info.createLocalizationAsync({ ...attributes, locale }), {
62
- pending: `${model ? 'Updating' : 'Creating'} localized info for ${locale}...`,
63
- success: `${model ? 'Updated' : 'Created'} localized info for ${locale}`,
64
- failure: `Failed ${model ? 'updating' : 'creating'} localized info for ${locale}`,
59
+ await (0, log_2.logAsync)(async () => {
60
+ return model
61
+ ? await model.updateAsync(attributes)
62
+ : await context.info.createLocalizationAsync({ ...attributes, locale });
63
+ }, {
64
+ pending: `${model ? 'Updating' : 'Creating'} localized info for ${chalk_1.default.bold(locale)}...`,
65
+ success: `${model ? 'Updated' : 'Created'} localized info for ${chalk_1.default.bold(locale)}`,
66
+ failure: `Failed ${model ? 'updating' : 'creating'} localized info for ${chalk_1.default.bold(locale)}`,
65
67
  });
66
68
  }
67
69
  context.infoLocales = await context.info.getLocalizationsAsync();
@@ -0,0 +1,14 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
+ import { AppStoreReviewDetail } from '@expo/apple-utils';
3
+ import { AppleTask, TaskDownloadOptions, TaskPrepareOptions, TaskUploadOptions } from '../task';
4
+ export declare type AppReviewData = {
5
+ /** The current app info that should be edited */
6
+ reviewDetail: AppStoreReviewDetail;
7
+ };
8
+ /** Handle all contact, demo account, or instruction info that are required for the App Store review team. */
9
+ export declare class AppReviewDetailTask extends AppleTask {
10
+ name: () => string;
11
+ prepareAsync({ context }: TaskPrepareOptions): Promise<void>;
12
+ downloadAsync({ config, context }: TaskDownloadOptions): Promise<void>;
13
+ uploadAsync({ config, context }: TaskUploadOptions): Promise<void>;
14
+ }