eas-cli 1.1.1 → 2.1.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 (89) hide show
  1. package/README.md +86 -79
  2. package/build/branch/queries.js +11 -8
  3. package/build/build/android/graphql.js +2 -1
  4. package/build/build/android/prepareJob.js +3 -1
  5. package/build/build/createContext.js +1 -0
  6. package/build/build/ios/graphql.js +2 -2
  7. package/build/build/ios/prepareJob.js +3 -1
  8. package/build/commandUtils/EasCommand.d.ts +2 -0
  9. package/build/commandUtils/EasCommand.js +44 -3
  10. package/build/commands/branch/delete.js +1 -1
  11. package/build/commands/build/index.d.ts +2 -1
  12. package/build/commands/build/index.js +91 -19
  13. package/build/commands/channel/delete.js +1 -1
  14. package/build/commands/device/delete.js +3 -2
  15. package/build/commands/open.d.ts +5 -0
  16. package/build/commands/open.js +40 -0
  17. package/build/commands/secret/delete.js +1 -1
  18. package/build/commands/submit.d.ts +2 -1
  19. package/build/commands/submit.js +28 -14
  20. package/build/commands/update/configure.js +58 -5
  21. package/build/commands/update/delete.js +1 -1
  22. package/build/commands/update/index.js +3 -0
  23. package/build/commands/webhook/delete.js +1 -1
  24. package/build/credentials/android/api/GraphqlClient.js +1 -1
  25. package/build/credentials/context.d.ts +3 -0
  26. package/build/credentials/context.js +1 -0
  27. package/build/credentials/ios/IosCredentialsProvider.d.ts +1 -0
  28. package/build/credentials/ios/IosCredentialsProvider.js +33 -5
  29. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +3 -1
  30. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +5 -2
  31. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +3 -1
  32. package/build/credentials/ios/actions/CreateProvisioningProfile.js +3 -2
  33. package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -1
  34. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +4 -2
  35. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +8 -2
  36. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +30 -18
  37. package/build/credentials/ios/actions/SetUpBuildCredentials.js +1 -0
  38. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +8 -2
  39. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.js +6 -12
  40. package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +3 -1
  41. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +8 -5
  42. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +2 -0
  43. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +5 -5
  44. package/build/credentials/ios/api/GraphqlClient.js +1 -1
  45. package/build/credentials/ios/appstore/AppStoreApi.d.ts +7 -4
  46. package/build/credentials/ios/appstore/AppStoreApi.js +8 -8
  47. package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -14
  48. package/build/credentials/ios/appstore/Credentials.types.js +0 -6
  49. package/build/credentials/ios/appstore/bundleIdCapabilities.js +176 -15
  50. package/build/credentials/ios/appstore/constants.d.ts +1 -0
  51. package/build/credentials/ios/appstore/constants.js +6 -0
  52. package/build/credentials/ios/appstore/distributionCertificate.js +1 -1
  53. package/build/credentials/ios/appstore/provisioningProfile.d.ts +5 -3
  54. package/build/credentials/ios/appstore/provisioningProfile.js +30 -7
  55. package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +3 -1
  56. package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +10 -10
  57. package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +2 -1
  58. package/build/credentials/ios/validators/validateProvisioningProfile.js +6 -4
  59. package/build/credentials/manager/ManageAndroid.js +2 -8
  60. package/build/credentials/manager/ManageIos.js +10 -9
  61. package/build/devices/actions/create/developerPortalMethod.js +2 -2
  62. package/build/graphql/generated.d.ts +230 -39
  63. package/build/graphql/generated.js +39 -1
  64. package/build/{credentials/ios/api/graphql → graphql}/queries/AppQuery.d.ts +1 -1
  65. package/build/{credentials/ios/api/graphql → graphql}/queries/AppQuery.js +2 -2
  66. package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +1 -1
  67. package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -2
  68. package/build/graphql/queries/StatuspageServiceQuery.d.ts +4 -0
  69. package/build/graphql/queries/StatuspageServiceQuery.js +28 -0
  70. package/build/graphql/types/StatuspageService.d.ts +1 -0
  71. package/build/graphql/types/StatuspageService.js +19 -0
  72. package/build/project/ensureProjectExists.d.ts +0 -7
  73. package/build/project/ensureProjectExists.js +4 -14
  74. package/build/project/ios/target.d.ts +7 -0
  75. package/build/project/ios/target.js +26 -1
  76. package/build/project/projectUtils.d.ts +0 -1
  77. package/build/project/projectUtils.js +9 -29
  78. package/build/project/workflow.js +3 -1
  79. package/build/submit/android/AndroidSubmitter.js +1 -1
  80. package/build/submit/submit.js +2 -2
  81. package/build/submit/utils/errors.js +2 -0
  82. package/build/utils/statuspageService.d.ts +2 -0
  83. package/build/utils/statuspageService.js +41 -0
  84. package/build/vcs/clients/git.js +4 -1
  85. package/build/vcs/clients/gitNoCommit.js +2 -1
  86. package/oclif.manifest.json +1 -1
  87. package/package.json +7 -6
  88. package/build/graphql/queries/ProjectQuery.d.ts +0 -6
  89. package/build/graphql/queries/ProjectQuery.js +0 -24
@@ -1,19 +1,5 @@
1
1
  /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
2
  import { UserRole } from '@expo/apple-utils';
3
- export interface Device {
4
- id: string;
5
- teamId: string;
6
- identifier: string;
7
- name?: string;
8
- model?: string;
9
- deviceClass?: DeviceClass;
10
- softwareVersion?: string;
11
- enabled: boolean;
12
- }
13
- export declare enum DeviceClass {
14
- IPHONE = "iphone",
15
- IPAD = "ipad"
16
- }
17
3
  export interface DistributionCertificateStoreInfo {
18
4
  id: string;
19
5
  name: string;
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceClass = void 0;
4
- var DeviceClass;
5
- (function (DeviceClass) {
6
- DeviceClass["IPHONE"] = "iphone";
7
- DeviceClass["IPAD"] = "ipad";
8
- })(DeviceClass = exports.DeviceClass || (exports.DeviceClass = {}));
@@ -372,6 +372,7 @@ exports.CapabilityMapping = [
372
372
  {
373
373
  // https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_networking_vpn_api
374
374
  name: 'Push Notifications',
375
+ // com.apple.developer.aps-environment
375
376
  entitlement: 'aps-environment',
376
377
  capability: apple_utils_1.CapabilityType.PUSH_NOTIFICATIONS,
377
378
  validateOptions: validateDevProdString,
@@ -410,6 +411,181 @@ exports.CapabilityMapping = [
410
411
  validateOptions: validateDevProdString,
411
412
  getOptions: getDefinedOptions,
412
413
  },
414
+ {
415
+ entitlement: 'com.apple.developer.coremedia.hls.low-latency',
416
+ name: 'Low Latency HLS',
417
+ capability: apple_utils_1.CapabilityType.HLS_LOW_LATENCY,
418
+ validateOptions: validateBooleanOptions,
419
+ getOptions: getBooleanOptions,
420
+ },
421
+ {
422
+ entitlement: 'com.apple.developer.associated-domains.mdm-managed',
423
+ name: 'MDM Managed Associated Domains',
424
+ capability: apple_utils_1.CapabilityType.MDM_MANAGED_ASSOCIATED_DOMAINS,
425
+ validateOptions: validateBooleanOptions,
426
+ getOptions: getBooleanOptions,
427
+ },
428
+ {
429
+ entitlement: 'com.apple.developer.fileprovider.testing-mode',
430
+ name: 'FileProvider TestingMode',
431
+ capability: apple_utils_1.CapabilityType.FILE_PROVIDER_TESTING_MODE,
432
+ validateOptions: validateBooleanOptions,
433
+ getOptions: getBooleanOptions,
434
+ },
435
+ {
436
+ entitlement: 'com.apple.developer.healthkit.recalibrate-estimates',
437
+ name: 'Recalibrate Estimates',
438
+ capability: apple_utils_1.CapabilityType.HEALTH_KIT_RECALIBRATE_ESTIMATES,
439
+ validateOptions: validateBooleanOptions,
440
+ getOptions: getBooleanOptions,
441
+ },
442
+ {
443
+ entitlement: 'com.apple.developer.maps',
444
+ name: 'Maps',
445
+ capability: apple_utils_1.CapabilityType.MAPS,
446
+ validateOptions: validateBooleanOptions,
447
+ getOptions: getBooleanOptions,
448
+ },
449
+ {
450
+ entitlement: 'com.apple.developer.user-management',
451
+ name: 'TV Services',
452
+ capability: apple_utils_1.CapabilityType.USER_MANAGEMENT,
453
+ validateOptions: validateBooleanOptions,
454
+ getOptions: getBooleanOptions,
455
+ },
456
+ {
457
+ entitlement: 'com.apple.developer.networking.custom-protocol',
458
+ name: 'Custom Network Protocol',
459
+ capability: apple_utils_1.CapabilityType.NETWORK_CUSTOM_PROTOCOL,
460
+ validateOptions: validateBooleanOptions,
461
+ getOptions: getBooleanOptions,
462
+ },
463
+ {
464
+ entitlement: 'com.apple.developer.system-extension.install',
465
+ name: 'System Extension',
466
+ capability: apple_utils_1.CapabilityType.SYSTEM_EXTENSION_INSTALL,
467
+ validateOptions: validateBooleanOptions,
468
+ getOptions: getBooleanOptions,
469
+ },
470
+ {
471
+ entitlement: 'com.apple.developer.push-to-talk',
472
+ name: 'Push to Talk',
473
+ capability: apple_utils_1.CapabilityType.PUSH_TO_TALK,
474
+ validateOptions: validateBooleanOptions,
475
+ getOptions: getBooleanOptions,
476
+ },
477
+ {
478
+ entitlement: 'com.apple.developer.driverkit.transport.usb',
479
+ name: 'DriverKit USB Transport (development)',
480
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_USB_TRANSPORT_PUB,
481
+ validateOptions: validateBooleanOptions,
482
+ getOptions: getBooleanOptions,
483
+ },
484
+ {
485
+ entitlement: 'com.apple.developer.kernel.increased-memory-limit',
486
+ name: 'Increased Memory Limit',
487
+ capability: apple_utils_1.CapabilityType.INCREASED_MEMORY_LIMIT,
488
+ validateOptions: validateBooleanOptions,
489
+ getOptions: getBooleanOptions,
490
+ },
491
+ {
492
+ entitlement: 'com.apple.developer.driverkit.communicates-with-drivers',
493
+ name: 'Communicates with Drivers',
494
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_COMMUNICATES_WITH_DRIVERS,
495
+ validateOptions: validateBooleanOptions,
496
+ getOptions: getBooleanOptions,
497
+ },
498
+ {
499
+ entitlement: 'com.apple.developer.media-device-discovery-extension',
500
+ name: 'Media Device Discovery',
501
+ capability: apple_utils_1.CapabilityType.MEDIA_DEVICE_DISCOVERY,
502
+ validateOptions: validateBooleanOptions,
503
+ getOptions: getBooleanOptions,
504
+ },
505
+ {
506
+ entitlement: 'com.apple.developer.driverkit.allow-third-party-userclients',
507
+ name: 'DriverKit Allow Third Party UserClients',
508
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_ALLOW_THIRD_PARTY_USER_CLIENTS,
509
+ validateOptions: validateBooleanOptions,
510
+ getOptions: getBooleanOptions,
511
+ },
512
+ {
513
+ entitlement: 'com.apple.developer.weatherkit',
514
+ name: 'WeatherKit',
515
+ capability: apple_utils_1.CapabilityType.WEATHER_KIT,
516
+ validateOptions: validateBooleanOptions,
517
+ getOptions: getBooleanOptions,
518
+ },
519
+ {
520
+ entitlement: 'com.apple.developer.on-demand-install-capable',
521
+ name: 'On Demand Install Capable for App Clip Extensions',
522
+ capability: apple_utils_1.CapabilityType.ON_DEMAND_INSTALL_EXTENSIONS,
523
+ validateOptions: validateBooleanOptions,
524
+ getOptions: getBooleanOptions,
525
+ },
526
+ {
527
+ entitlement: 'com.apple.developer.driverkit.family.scsicontroller',
528
+ name: 'DriverKit Family SCSIController (development)',
529
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_FAMILY_SCSI_CONTROLLER_PUB,
530
+ validateOptions: validateBooleanOptions,
531
+ getOptions: getBooleanOptions,
532
+ },
533
+ {
534
+ entitlement: 'com.apple.developer.driverkit.family.serial',
535
+ name: 'DriverKit Family Serial (development)',
536
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_FAMILY_SERIAL_PUB,
537
+ validateOptions: validateBooleanOptions,
538
+ getOptions: getBooleanOptions,
539
+ },
540
+ {
541
+ entitlement: 'com.apple.developer.driverkit.family.networking',
542
+ name: 'DriverKit Family Networking (development)',
543
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_FAMILY_NETWORKING_PUB,
544
+ validateOptions: validateBooleanOptions,
545
+ getOptions: getBooleanOptions,
546
+ },
547
+ {
548
+ entitlement: 'com.apple.developer.driverkit.family.hid.eventservice',
549
+ name: 'DriverKit Family HID EventService (development)',
550
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_FAMILY_HID_EVENT_SERVICE_PUB,
551
+ validateOptions: validateBooleanOptions,
552
+ getOptions: getBooleanOptions,
553
+ },
554
+ {
555
+ entitlement: 'com.apple.developer.driverkit.family.hid.device',
556
+ name: 'DriverKit Family HID Device (development)',
557
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_FAMILY_HID_DEVICE_PUB,
558
+ validateOptions: validateBooleanOptions,
559
+ getOptions: getBooleanOptions,
560
+ },
561
+ {
562
+ entitlement: 'com.apple.developer.driverkit',
563
+ name: 'DriverKit for Development',
564
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_PUBLIC,
565
+ validateOptions: validateBooleanOptions,
566
+ getOptions: getBooleanOptions,
567
+ },
568
+ {
569
+ entitlement: 'com.apple.developer.driverkit.transport.hid',
570
+ name: 'DriverKit Transport HID (development)',
571
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_TRANSPORT_HID_PUB,
572
+ validateOptions: validateBooleanOptions,
573
+ getOptions: getBooleanOptions,
574
+ },
575
+ {
576
+ entitlement: 'com.apple.developer.driverkit.family.audio',
577
+ name: 'DriverKit Family Audio (development)',
578
+ capability: apple_utils_1.CapabilityType.DRIVER_KIT_FAMILY_AUDIO_PUB,
579
+ validateOptions: validateBooleanOptions,
580
+ getOptions: getBooleanOptions,
581
+ },
582
+ {
583
+ entitlement: 'com.apple.developer.shared-with-you',
584
+ name: 'Shared with You',
585
+ capability: apple_utils_1.CapabilityType.SHARED_WITH_YOU,
586
+ validateOptions: validateBooleanOptions,
587
+ getOptions: getBooleanOptions,
588
+ },
413
589
  // These don't appear to have entitlements, so it's unclear how we can automatically enable / disable them at this time.
414
590
  // TODO: Maybe add a warning about manually enabling features?
415
591
  // ?? -- links `StoreKit.framework`
@@ -421,24 +597,9 @@ exports.CapabilityMapping = [
421
597
  // },
422
598
  // {
423
599
  // entitlement: '',
424
- // name: 'FileProvider TestingMode',
425
- // capability: 'FILEPROVIDER_TESTINGMODE',
426
- // },
427
- // {
428
- // entitlement: '',
429
600
  // name: 'HLS Interstitial Previews',
430
601
  // capability: 'HLS_INTERSTITIAL_PREVIEW',
431
602
  // },
432
- // {
433
- // entitlement: '',
434
- // name: 'Low Latency HLS',
435
- // capability: 'COREMEDIA_HLS_LOW_LATENCY',
436
- // },
437
- // {
438
- // entitlement: '',
439
- // name: 'MDM Managed Associated Domains',
440
- // capability: 'MDM_MANAGED_ASSOCIATED_DOMAINS',
441
- // },
442
603
  // "Game Controllers" doesn't appear in Dev Portal but it does show up in Xcode,
443
604
  // toggling in Xcode causes no network request to be sent.
444
605
  // Therefore it seems that it's a mistake in Xcode,
@@ -0,0 +1 @@
1
+ export { Platform as ApplePlatform } from '@expo/apple-utils';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplePlatform = void 0;
4
+ // Renamed to avoid conflation with Android/iOS/Web Platform constants
5
+ var apple_utils_1 = require("@expo/apple-utils");
6
+ Object.defineProperty(exports, "ApplePlatform", { enumerable: true, get: function () { return apple_utils_1.Platform; } });
@@ -21,7 +21,7 @@ async function getDistributionCertificateAsync(context, serialNumber) {
21
21
  const certificates = await apple_utils_1.Certificate.getAsync(context, {
22
22
  query: {
23
23
  filter: {
24
- certificateType: apple_utils_1.CertificateType.IOS_DISTRIBUTION,
24
+ certificateType: [apple_utils_1.CertificateType.IOS_DISTRIBUTION, apple_utils_1.CertificateType.DISTRIBUTION],
25
25
  },
26
26
  },
27
27
  });
@@ -1,10 +1,12 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
1
2
  import { DistributionCertificate, ProvisioningProfile, ProvisioningProfileStoreInfo } from './Credentials.types';
2
3
  import { AuthCtx } from './authenticateTypes';
4
+ import { ApplePlatform } from './constants';
3
5
  export declare enum ProfileClass {
4
6
  Adhoc = "ad_hoc",
5
7
  General = "general"
6
8
  }
7
9
  export declare function useExistingProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, provisioningProfile: ProvisioningProfile, distCert: DistributionCertificate): Promise<ProvisioningProfile>;
8
- export declare function listProvisioningProfilesAsync(authCtx: AuthCtx, bundleIdentifier: string, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
9
- export declare function createProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
10
- export declare function revokeProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, profileClass?: ProfileClass): Promise<void>;
10
+ export declare function listProvisioningProfilesAsync(authCtx: AuthCtx, bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfileStoreInfo[]>;
11
+ export declare function createProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, distCert: DistributionCertificate, profileName: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<ProvisioningProfile>;
12
+ export declare function revokeProvisioningProfileAsync(authCtx: AuthCtx, bundleIdentifier: string, applePlatform: ApplePlatform, profileClass?: ProfileClass): Promise<void>;
@@ -7,13 +7,36 @@ const authType_1 = require("../utils/authType");
7
7
  const p12Certificate_1 = require("../utils/p12Certificate");
8
8
  const authenticate_1 = require("./authenticate");
9
9
  const bundleId_1 = require("./bundleId");
10
+ const constants_1 = require("./constants");
10
11
  const distributionCertificate_1 = require("./distributionCertificate");
11
12
  var ProfileClass;
12
13
  (function (ProfileClass) {
13
14
  ProfileClass["Adhoc"] = "ad_hoc";
14
15
  ProfileClass["General"] = "general";
15
16
  })(ProfileClass = exports.ProfileClass || (exports.ProfileClass = {}));
16
- function resolveProfileType(profileClass, isEnterprise) {
17
+ function resolveProfileType(applePlatform, profileClass, isEnterprise) {
18
+ switch (applePlatform) {
19
+ case constants_1.ApplePlatform.IOS:
20
+ return resolveProfileTypeIos(profileClass, isEnterprise);
21
+ case constants_1.ApplePlatform.TV_OS:
22
+ return resolveProfileTypeAppleTv(profileClass, isEnterprise);
23
+ case constants_1.ApplePlatform.MAC_OS:
24
+ throw new Error(`${applePlatform} profiles are not supported`);
25
+ }
26
+ }
27
+ function resolveProfileTypeAppleTv(profileClass, isEnterprise) {
28
+ if (isEnterprise) {
29
+ return profileClass === ProfileClass.Adhoc
30
+ ? apple_utils_1.ProfileType.TVOS_APP_ADHOC
31
+ : apple_utils_1.ProfileType.TVOS_APP_INHOUSE;
32
+ }
33
+ else {
34
+ return profileClass === ProfileClass.Adhoc
35
+ ? apple_utils_1.ProfileType.TVOS_APP_ADHOC
36
+ : apple_utils_1.ProfileType.TVOS_APP_STORE;
37
+ }
38
+ }
39
+ function resolveProfileTypeIos(profileClass, isEnterprise) {
17
40
  if (isEnterprise) {
18
41
  return profileClass === ProfileClass.Adhoc
19
42
  ? apple_utils_1.ProfileType.IOS_APP_ADHOC
@@ -95,11 +118,11 @@ async function useExistingProvisioningProfileAsync(authCtx, bundleIdentifier, pr
95
118
  }
96
119
  }
97
120
  exports.useExistingProvisioningProfileAsync = useExistingProvisioningProfileAsync;
98
- async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, profileClass = ProfileClass.General) {
121
+ async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, applePlatform, profileClass = ProfileClass.General) {
99
122
  const spinner = (0, ora_1.ora)(`Fetching Apple provisioning profiles`).start();
100
123
  try {
101
124
  const context = (0, authenticate_1.getRequestContext)(authCtx);
102
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
125
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
103
126
  const profiles = (await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleIdentifier)).filter(profile => profile.attributes.profileType === profileType);
104
127
  const result = await Promise.all(profiles.map(profile => transformProfileAsync(profile, authCtx)));
105
128
  spinner.succeed(`Fetched Apple provisioning profiles`);
@@ -111,14 +134,14 @@ async function listProvisioningProfilesAsync(authCtx, bundleIdentifier, profileC
111
134
  }
112
135
  }
113
136
  exports.listProvisioningProfilesAsync = listProvisioningProfilesAsync;
114
- async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCert, profileName, profileClass = ProfileClass.General) {
137
+ async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCert, profileName, applePlatform, profileClass = ProfileClass.General) {
115
138
  const spinner = (0, ora_1.ora)(`Creating Apple provisioning profile`).start();
116
139
  try {
117
140
  if (!distCert.distCertSerialNumber) {
118
141
  distCert.distCertSerialNumber = (0, p12Certificate_1.findP12CertSerialNumber)(distCert.certP12, distCert.certPassword);
119
142
  }
120
143
  const context = (0, authenticate_1.getRequestContext)(authCtx);
121
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
144
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
122
145
  const certificate = await (0, distributionCertificate_1.getCertificateBySerialNumberAsync)(context, distCert.distCertSerialNumber);
123
146
  const bundleIdItem = await (0, bundleId_1.getBundleIdForIdentifierAsync)(context, bundleIdentifier);
124
147
  const profile = await apple_utils_1.Profile.createAsync(context, {
@@ -138,12 +161,12 @@ async function createProvisioningProfileAsync(authCtx, bundleIdentifier, distCer
138
161
  }
139
162
  }
140
163
  exports.createProvisioningProfileAsync = createProvisioningProfileAsync;
141
- async function revokeProvisioningProfileAsync(authCtx, bundleIdentifier, profileClass = ProfileClass.General) {
164
+ async function revokeProvisioningProfileAsync(authCtx, bundleIdentifier, applePlatform, profileClass = ProfileClass.General) {
142
165
  const spinner = (0, ora_1.ora)(`Revoking Apple provisioning profile`).start();
143
166
  try {
144
167
  const context = (0, authenticate_1.getRequestContext)(authCtx);
145
168
  const profiles = await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleIdentifier);
146
- const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
169
+ const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
147
170
  await Promise.all(profiles
148
171
  .filter(profile => profile.attributes.profileType === profileType)
149
172
  .map(profile => apple_utils_1.Profile.deleteAsync(context, { id: profile.id })));
@@ -1,3 +1,5 @@
1
+ /// <reference types="@expo/apple-utils/ts-declarations/expo__app-store" />
2
+ import { ProfileType } from '@expo/apple-utils';
1
3
  import { ProvisioningProfile } from './Credentials.types';
2
4
  import { AuthCtx } from './authenticateTypes';
3
- export declare function createOrReuseAdhocProvisioningProfileAsync(authCtx: AuthCtx, udids: string[], bundleIdentifier: string, distCertSerialNumber: string): Promise<ProvisioningProfile>;
5
+ export declare function createOrReuseAdhocProvisioningProfileAsync(authCtx: AuthCtx, udids: string[], bundleIdentifier: string, distCertSerialNumber: string, profileType: ProfileType): Promise<ProvisioningProfile>;
@@ -12,8 +12,8 @@ function uniqueItems(items) {
12
12
  return [...set];
13
13
  }
14
14
  async function registerMissingDevicesAsync(context, udids) {
15
- const allIosProfileDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync(context);
16
- const alreadyAdded = allIosProfileDevices.filter(device => udids.includes(device.attributes.udid));
15
+ const allDevices = await apple_utils_1.Device.getAsync(context);
16
+ const alreadyAdded = allDevices.filter(device => udids.includes(device.attributes.udid));
17
17
  const alreadyAddedUdids = alreadyAdded.map(i => i.attributes.udid);
18
18
  await Promise.all(udids.map(async (udid) => {
19
19
  if (!alreadyAddedUdids.includes(udid)) {
@@ -26,9 +26,9 @@ async function registerMissingDevicesAsync(context, udids) {
26
26
  }));
27
27
  return alreadyAdded;
28
28
  }
29
- async function findProfileByBundleIdAsync(context, bundleId, certSerialNumber) {
29
+ async function findProfileAsync(context, { bundleId, certSerialNumber, profileType, }) {
30
30
  const expoProfiles = (await (0, bundleId_1.getProfilesForBundleIdAsync)(context, bundleId)).filter(profile => {
31
- return (profile.attributes.profileType === apple_utils_1.ProfileType.IOS_APP_ADHOC &&
31
+ return (profile.attributes.profileType === profileType &&
32
32
  profile.attributes.name.startsWith('*[expo]') &&
33
33
  profile.attributes.profileState !== apple_utils_1.ProfileState.EXPIRED);
34
34
  });
@@ -79,7 +79,7 @@ async function findProfileByIdAsync(context, profileId, bundleId) {
79
79
  profiles = profiles.filter(profile => profile.attributes.profileType === apple_utils_1.ProfileType.IOS_APP_ADHOC);
80
80
  return (_a = profiles.find(profile => profile.id === profileId)) !== null && _a !== void 0 ? _a : null;
81
81
  }
82
- async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNumber, profileId, }) {
82
+ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNumber, profileId, profileType, }) {
83
83
  var _a, _b, _c, _d, _e;
84
84
  // We register all missing devices on the Apple Developer Portal. They are identified by UDIDs.
85
85
  const devices = await registerMissingDevicesAsync(context, udids);
@@ -94,7 +94,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
94
94
  }
95
95
  else {
96
96
  // If no profile id is passed, try to find a suitable provisioning profile for the App ID.
97
- const results = await findProfileByBundleIdAsync(context, bundleId, certSerialNumber);
97
+ const results = await findProfileAsync(context, { bundleId, certSerialNumber, profileType });
98
98
  existingProfile = results.profile;
99
99
  didUpdate = results.didUpdate;
100
100
  }
@@ -126,8 +126,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
126
126
  // This method does not support App Store Connect API.
127
127
  await existingProfile.regenerateAsync();
128
128
  }
129
- const updatedProfile = (await findProfileByBundleIdAsync(context, bundleId, certSerialNumber))
130
- .profile;
129
+ const updatedProfile = (await findProfileAsync(context, { bundleId, certSerialNumber, profileType })).profile;
131
130
  if (!updatedProfile) {
132
131
  throw new Error(`Failed to locate updated profile for bundle identifier "${bundleId}" and serial number "${certSerialNumber}"`);
133
132
  }
@@ -153,7 +152,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
153
152
  name: `*[expo] ${bundleId} AdHoc ${Date.now()}`,
154
153
  certificates: [distributionCertificate.id],
155
154
  devices: devices.map(device => device.id),
156
- profileType: apple_utils_1.ProfileType.IOS_APP_ADHOC,
155
+ profileType,
157
156
  });
158
157
  return {
159
158
  didUpdate: true,
@@ -163,7 +162,7 @@ async function manageAdHocProfilesAsync(context, { udids, bundleId, certSerialNu
163
162
  provisioningProfile: newProfile.attributes.profileContent,
164
163
  };
165
164
  }
166
- async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundleIdentifier, distCertSerialNumber) {
165
+ async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundleIdentifier, distCertSerialNumber, profileType) {
167
166
  const spinner = (0, ora_1.ora)(`Handling Apple ad hoc provisioning profiles`).start();
168
167
  try {
169
168
  const context = (0, authenticate_1.getRequestContext)(authCtx);
@@ -171,6 +170,7 @@ async function createOrReuseAdhocProvisioningProfileAsync(authCtx, udids, bundle
171
170
  udids,
172
171
  bundleId: bundleIdentifier,
173
172
  certSerialNumber: distCertSerialNumber,
173
+ profileType,
174
174
  });
175
175
  if (didCreate) {
176
176
  spinner.succeed(`Created new profile: ${profileName}`);
@@ -1,4 +1,5 @@
1
1
  import { IosAppBuildCredentialsFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare function validateProvisioningProfileAsync(ctx: CredentialsContext, app: AppLookupParams, buildCredentials: Partial<IosAppBuildCredentialsFragment> | null): Promise<boolean>;
4
+ import { Target } from '../types';
5
+ export declare function validateProvisioningProfileAsync(ctx: CredentialsContext, target: Target, app: AppLookupParams, buildCredentials: Partial<IosAppBuildCredentialsFragment> | null): Promise<boolean>;
@@ -8,10 +8,11 @@ const minimatch_1 = tslib_1.__importDefault(require("minimatch"));
8
8
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
9
9
  const generated_1 = require("../../../graphql/generated");
10
10
  const log_1 = tslib_1.__importDefault(require("../../../log"));
11
+ const target_1 = require("../../../project/ios/target");
11
12
  const provisioningProfile_1 = require("../appstore/provisioningProfile");
12
13
  const p12Certificate_1 = require("../utils/p12Certificate");
13
14
  const provisioningProfile_2 = require("../utils/provisioningProfile");
14
- async function validateProvisioningProfileAsync(ctx, app, buildCredentials) {
15
+ async function validateProvisioningProfileAsync(ctx, target, app, buildCredentials) {
15
16
  if (!buildCredentials ||
16
17
  !buildCredentials.distributionCertificate ||
17
18
  !buildCredentials.provisioningProfile) {
@@ -25,7 +26,7 @@ async function validateProvisioningProfileAsync(ctx, app, buildCredentials) {
25
26
  log_1.default.warn("Skipping Provisioning Profile validation on Apple Servers because we aren't authenticated.");
26
27
  return true;
27
28
  }
28
- return await validateProvisioningProfileWithAppleAsync(ctx, app, buildCredentials);
29
+ return await validateProvisioningProfileWithAppleAsync(ctx, target, app, buildCredentials);
29
30
  }
30
31
  exports.validateProvisioningProfileAsync = validateProvisioningProfileAsync;
31
32
  function validateProvisioningProfileWithoutApple(app, { provisioningProfile, distributionCertificate }) {
@@ -59,10 +60,11 @@ function validateProvisioningProfileWithoutApple(app, { provisioningProfile, dis
59
60
  }
60
61
  return true;
61
62
  }
62
- async function validateProvisioningProfileWithAppleAsync(ctx, app, buildCredentials) {
63
+ async function validateProvisioningProfileWithAppleAsync(ctx, target, app, buildCredentials) {
63
64
  (0, assert_1.default)(buildCredentials.provisioningProfile, 'Provisioning Profile must be defined');
64
65
  const { developerPortalIdentifier, provisioningProfile } = buildCredentials.provisioningProfile;
65
- const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(app.bundleIdentifier, buildCredentials.iosDistributionType === generated_1.IosDistributionType.AdHoc
66
+ const applePlatform = await (0, target_1.getApplePlatformFromSdkRoot)(target);
67
+ const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(app.bundleIdentifier, applePlatform, buildCredentials.iosDistributionType === generated_1.IosDistributionType.AdHoc
66
68
  ? provisioningProfile_1.ProfileClass.Adhoc
67
69
  : provisioningProfile_1.ProfileClass.General);
68
70
  const configuredProfileFromApple = profilesFromApple.find(appleProfile => developerPortalIdentifier
@@ -61,10 +61,6 @@ class ManageAndroid {
61
61
  while (true) {
62
62
  try {
63
63
  if (ctx.hasProjectContext) {
64
- const maybeProjectId = await (0, projectUtils_1.promptToCreateProjectIfNotExistsAsync)(ctx.exp);
65
- if (!maybeProjectId) {
66
- throw new Error('Your project must be registered with EAS in order to use the credentials manager.');
67
- }
68
64
  const appLookupParams = await (0, BuildCredentialsUtils_1.getAppLookupParamsFromContextAsync)(ctx, gradleContext);
69
65
  const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(appLookupParams);
70
66
  if (!appCredentials) {
@@ -131,10 +127,8 @@ class ManageAndroid {
131
127
  }
132
128
  async createProjectContextAsync(ctx, buildProfile) {
133
129
  (0, assert_1.default)(ctx.hasProjectContext, 'createProjectContextAsync: must have project context.');
134
- const maybeProjectId = await (0, projectUtils_1.promptToCreateProjectIfNotExistsAsync)(ctx.exp);
135
- if (!maybeProjectId) {
136
- throw new Error('Your project must be registered with EAS in order to use the credentials manager.');
137
- }
130
+ // ensure the project exists on the EAS server
131
+ await (0, projectUtils_1.getProjectIdAsync)(ctx.exp);
138
132
  return await (0, gradle_1.resolveGradleBuildContextAsync)(ctx.projectDir, buildProfile);
139
133
  }
140
134
  async runProjectSpecificActionAsync(ctx, action, gradleContext) {
@@ -147,10 +147,8 @@ class ManageIos {
147
147
  }
148
148
  async createProjectContextAsync(ctx, account, buildProfile) {
149
149
  (0, assert_1.default)(ctx.hasProjectContext, 'createProjectContextAsync: must have project context.');
150
- const maybeProjectId = await (0, projectUtils_1.promptToCreateProjectIfNotExistsAsync)(ctx.exp);
151
- if (!maybeProjectId) {
152
- throw new Error('Your project must be registered with EAS in order to use the credentials manager.');
153
- }
150
+ // ensure the project exists on the EAS server
151
+ await (0, projectUtils_1.getProjectIdAsync)(ctx.exp);
154
152
  const app = { account, projectName: ctx.exp.slug };
155
153
  const xcodeBuildContext = await (0, scheme_1.resolveXcodeBuildContextAsync)({
156
154
  projectDir: ctx.projectDir,
@@ -216,7 +214,7 @@ class ManageIos {
216
214
  if (!distCert) {
217
215
  return;
218
216
  }
219
- await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType);
217
+ await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType);
220
218
  return;
221
219
  }
222
220
  case Actions_1.IosActionType.CreateDistributionCertificate: {
@@ -225,7 +223,7 @@ class ManageIos {
225
223
  message: `Do you want ${appLookupParams.projectName} to use the new Distribution Certificate?`,
226
224
  });
227
225
  if (confirm) {
228
- await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType);
226
+ await this.setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType);
229
227
  }
230
228
  return;
231
229
  }
@@ -299,14 +297,17 @@ class ManageIos {
299
297
  throw new Error('Unknown action selected');
300
298
  }
301
299
  }
302
- async setupProvisioningProfileWithSpecificDistCertAsync(ctx, appLookupParams, distCert, distributionType) {
300
+ async setupProvisioningProfileWithSpecificDistCertAsync(ctx, target, appLookupParams, distCert, distributionType) {
303
301
  log_1.default.log(`Setting up ${appLookupParams.projectName} to use Distribution Certificate`);
304
302
  log_1.default.log(`Creating provisioning profile...`);
305
303
  if (distributionType === generated_1.IosDistributionType.AdHoc) {
306
- return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile(appLookupParams).runWithDistributionCertificateAsync(ctx, distCert);
304
+ return await new SetUpAdhocProvisioningProfile_1.SetUpAdhocProvisioningProfile({
305
+ app: appLookupParams,
306
+ target,
307
+ }).runWithDistributionCertificateAsync(ctx, distCert);
307
308
  }
308
309
  else {
309
- return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(appLookupParams, distributionType).createAndAssignProfileAsync(ctx, distCert);
310
+ return await new SetUpProvisioningProfile_1.SetUpProvisioningProfile(appLookupParams, target, distributionType).createAndAssignProfileAsync(ctx, distCert);
310
311
  }
311
312
  }
312
313
  async selectTargetAsync(targets) {
@@ -59,9 +59,9 @@ async function findUnregisteredPortalDevicesAsync(appleAuthCtx, accountId, apple
59
59
  acc[device.identifier] = device;
60
60
  return acc;
61
61
  }, {});
62
- const portalDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync((0, authenticate_1.getRequestContext)(appleAuthCtx));
62
+ const portalDevices = await apple_utils_1.Device.getAsync((0, authenticate_1.getRequestContext)(appleAuthCtx));
63
63
  return portalDevices.filter(portalDevice => !(portalDevice.attributes.udid in expoRegisteredDevicesByUdid) &&
64
- [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE].includes(portalDevice.attributes.deviceClass));
64
+ [apple_utils_1.DeviceClass.IPAD, apple_utils_1.DeviceClass.IPHONE, apple_utils_1.DeviceClass.APPLE_TV].includes(portalDevice.attributes.deviceClass));
65
65
  }
66
66
  async function chooseDevicesToImportAsync(devices) {
67
67
  const { chosenDevices } = await (0, prompts_1.promptAsync)({