fastlane 2.219.0 → 2.221.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +86 -86
  3. data/bin/console +11 -0
  4. data/bin/match_file +60 -0
  5. data/deliver/lib/deliver/download_screenshots.rb +2 -1
  6. data/deliver/lib/deliver/generate_summary.rb +1 -1
  7. data/deliver/lib/deliver/options.rb +14 -0
  8. data/deliver/lib/deliver/runner.rb +4 -4
  9. data/deliver/lib/deliver/submit_for_review.rb +2 -2
  10. data/deliver/lib/deliver/upload_metadata.rb +43 -28
  11. data/deliver/lib/deliver/upload_screenshots.rb +15 -8
  12. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +2 -1
  13. data/fastlane/lib/fastlane/actions/appetize.rb +4 -0
  14. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +6 -2
  15. data/fastlane/lib/fastlane/actions/git_add.rb +17 -2
  16. data/fastlane/lib/fastlane/actions/mailgun.rb +30 -8
  17. data/fastlane/lib/fastlane/actions/onesignal.rb +14 -2
  18. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  19. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +2 -1
  20. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +4 -2
  21. data/fastlane/lib/fastlane/commands_generator.rb +9 -0
  22. data/fastlane/lib/fastlane/console.rb +24 -0
  23. data/fastlane/lib/fastlane/helper/sh_helper.rb +1 -1
  24. data/fastlane/lib/fastlane/lane_manager_base.rb +16 -8
  25. data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +2 -1
  26. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +2 -1
  27. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +2 -1
  28. data/fastlane/lib/fastlane/runner.rb +2 -2
  29. data/fastlane/lib/fastlane/version.rb +2 -1
  30. data/fastlane/swift/Deliverfile.swift +1 -1
  31. data/fastlane/swift/DeliverfileProtocol.swift +9 -1
  32. data/fastlane/swift/Fastlane.swift +48 -11
  33. data/fastlane/swift/Gymfile.swift +1 -1
  34. data/fastlane/swift/GymfileProtocol.swift +1 -1
  35. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  36. data/fastlane/swift/Matchfile.swift +1 -1
  37. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  38. data/fastlane/swift/OptionalConfigValue.swift +2 -2
  39. data/fastlane/swift/Precheckfile.swift +1 -1
  40. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  41. data/fastlane/swift/Scanfile.swift +1 -1
  42. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  43. data/fastlane/swift/Screengrabfile.swift +1 -1
  44. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  45. data/fastlane/swift/Snapshotfile.swift +1 -1
  46. data/fastlane/swift/SnapshotfileProtocol.swift +3 -3
  47. data/fastlane/swift/formatting/Brewfile.lock.json +19 -19
  48. data/fastlane_core/lib/fastlane_core/cert_checker.rb +11 -8
  49. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  50. data/fastlane_core/lib/fastlane_core/helper.rb +0 -15
  51. data/fastlane_core/lib/fastlane_core/print_table.rb +16 -0
  52. data/fastlane_core/lib/fastlane_core/project.rb +5 -0
  53. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +0 -4
  54. data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +1 -5
  55. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +2 -0
  56. data/frameit/lib/frameit/device_types.rb +4 -0
  57. data/frameit/lib/frameit/editor.rb +20 -0
  58. data/gym/lib/gym/detect_values.rb +2 -0
  59. data/gym/lib/gym/module.rb +2 -2
  60. data/match/lib/assets/READMETemplate.md +3 -5
  61. data/match/lib/match/encryption/encryption.rb +154 -0
  62. data/match/lib/match/encryption/openssl.rb +7 -38
  63. data/match/lib/match/encryption.rb +1 -0
  64. data/match/lib/match/runner.rb +44 -6
  65. data/match/lib/match/storage/git_storage.rb +4 -3
  66. data/match/lib/match/storage/interface.rb +9 -5
  67. data/pilot/lib/pilot/build_manager.rb +14 -6
  68. data/pilot/lib/pilot/manager.rb +2 -2
  69. data/pilot/lib/pilot/options.rb +1 -1
  70. data/snapshot/lib/snapshot/options.rb +2 -2
  71. data/snapshot/lib/snapshot/setup.rb +1 -1
  72. data/spaceship/lib/spaceship/connect_api/api_client.rb +2 -2
  73. data/spaceship/lib/spaceship/connect_api/models/app.rb +28 -33
  74. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +17 -0
  75. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +44 -9
  76. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +30 -2
  77. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +2 -2
  78. data/spaceship/lib/spaceship/connect_api/models/device.rb +11 -6
  79. data/spaceship/lib/spaceship/connect_api/models/profile.rb +8 -1
  80. data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +1 -1
  81. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +31 -22
  82. data/spaceship/lib/spaceship/connect_api/testflight/client.rb +1 -1
  83. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +47 -43
  84. data/spaceship/lib/spaceship/connect_api/token.rb +9 -3
  85. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +1 -1
  86. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +96 -90
  87. data/spaceship/lib/spaceship/connect_api/users/client.rb +1 -1
  88. data/spaceship/lib/spaceship/connect_api/users/users.rb +15 -11
  89. data/spaceship/lib/spaceship/connect_api.rb +5 -2
  90. data/spaceship/lib/spaceship/portal/certificate.rb +2 -2
  91. data/spaceship/lib/spaceship/portal/provisioning_profile.rb +8 -1
  92. data/spaceship/lib/spaceship/stats_middleware.rb +2 -2
  93. data/trainer/lib/trainer/xcresult.rb +6 -10
  94. metadata +50 -33
@@ -116,34 +116,29 @@ module Spaceship
116
116
  def fetch_live_app_info(client: nil, includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
117
117
  client ||= Spaceship::ConnectAPI
118
118
  states = [
119
- Spaceship::ConnectAPI::AppInfo::AppStoreState::READY_FOR_SALE,
120
- Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_APPLE_RELEASE,
121
- Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_DEVELOPER_RELEASE,
122
- Spaceship::ConnectAPI::AppInfo::AppStoreState::PROCESSING_FOR_APP_STORE,
123
- Spaceship::ConnectAPI::AppInfo::AppStoreState::IN_REVIEW,
124
- Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REMOVED_FROM_SALE
119
+ Spaceship::ConnectAPI::AppInfo::State::READY_FOR_DISTRIBUTION,
120
+ Spaceship::ConnectAPI::AppInfo::State::PENDING_RELEASE,
121
+ Spaceship::ConnectAPI::AppInfo::State::IN_REVIEW
125
122
  ]
126
123
 
127
124
  resp = client.get_app_infos(app_id: id, includes: includes)
128
125
  return resp.to_models.select do |model|
129
- states.include?(model.app_store_state)
126
+ states.include?(model.state)
130
127
  end.first
131
128
  end
132
129
 
133
130
  def fetch_edit_app_info(client: nil, includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
134
131
  client ||= Spaceship::ConnectAPI
135
132
  states = [
136
- Spaceship::ConnectAPI::AppInfo::AppStoreState::PREPARE_FOR_SUBMISSION,
137
- Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REJECTED,
138
- Spaceship::ConnectAPI::AppInfo::AppStoreState::REJECTED,
139
- Spaceship::ConnectAPI::AppInfo::AppStoreState::METADATA_REJECTED,
140
- Spaceship::ConnectAPI::AppInfo::AppStoreState::WAITING_FOR_REVIEW,
141
- Spaceship::ConnectAPI::AppInfo::AppStoreState::INVALID_BINARY
133
+ Spaceship::ConnectAPI::AppInfo::State::PREPARE_FOR_SUBMISSION,
134
+ Spaceship::ConnectAPI::AppInfo::State::DEVELOPER_REJECTED,
135
+ Spaceship::ConnectAPI::AppInfo::State::REJECTED,
136
+ Spaceship::ConnectAPI::AppInfo::State::WAITING_FOR_REVIEW
142
137
  ]
143
138
 
144
139
  resp = client.get_app_infos(app_id: id, includes: includes)
145
140
  return resp.to_models.select do |model|
146
- states.include?(model.app_store_state)
141
+ states.include?(model.state)
147
142
  end.first
148
143
  end
149
144
 
@@ -182,11 +177,11 @@ module Spaceship
182
177
  client ||= Spaceship::ConnectAPI
183
178
  platform ||= Spaceship::ConnectAPI::Platform::IOS
184
179
  filter = {
185
- appStoreState: [
186
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_APPLE_RELEASE,
187
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_DEVELOPER_RELEASE,
188
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
189
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::WAITING_FOR_REVIEW
180
+ appVersionState: [
181
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::PENDING_APPLE_RELEASE,
182
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::PENDING_DEVELOPER_RELEASE,
183
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::IN_REVIEW,
184
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::WAITING_FOR_REVIEW
190
185
  ].join(","),
191
186
  platform: platform
192
187
  }
@@ -240,9 +235,9 @@ module Spaceship
240
235
  client ||= Spaceship::ConnectAPI
241
236
  platform ||= Spaceship::ConnectAPI::Platform::IOS
242
237
  filter = {
243
- appStoreState: [
244
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE,
245
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REMOVED_FROM_SALE
238
+ appVersionState: [
239
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::READY_FOR_DISTRIBUTION,
240
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::PROCESSING_FOR_DISTRIBUTION
246
241
  ].join(","),
247
242
  platform: platform
248
243
  }
@@ -253,13 +248,13 @@ module Spaceship
253
248
  client ||= Spaceship::ConnectAPI
254
249
  platform ||= Spaceship::ConnectAPI::Platform::IOS
255
250
  filter = {
256
- appStoreState: [
257
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PREPARE_FOR_SUBMISSION,
258
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REJECTED,
259
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::REJECTED,
260
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::METADATA_REJECTED,
261
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::WAITING_FOR_REVIEW,
262
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::INVALID_BINARY
251
+ appVersionState: [
252
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::PREPARE_FOR_SUBMISSION,
253
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::DEVELOPER_REJECTED,
254
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::REJECTED,
255
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::METADATA_REJECTED,
256
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::WAITING_FOR_REVIEW,
257
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::INVALID_BINARY
263
258
  ].join(","),
264
259
  platform: platform
265
260
  }
@@ -274,7 +269,7 @@ module Spaceship
274
269
  client ||= Spaceship::ConnectAPI
275
270
  platform ||= Spaceship::ConnectAPI::Platform::IOS
276
271
  filter = {
277
- appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
272
+ appVersionState: Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::IN_REVIEW,
278
273
  platform: platform
279
274
  }
280
275
  return get_app_store_versions(client: client, filter: filter, includes: includes).first
@@ -284,9 +279,9 @@ module Spaceship
284
279
  client ||= Spaceship::ConnectAPI
285
280
  platform ||= Spaceship::ConnectAPI::Platform::IOS
286
281
  filter = {
287
- appStoreState: [
288
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_APPLE_RELEASE,
289
- Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_DEVELOPER_RELEASE
282
+ appVersionState: [
283
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::PENDING_APPLE_RELEASE,
284
+ Spaceship::ConnectAPI::AppStoreVersion::AppVersionState::PENDING_DEVELOPER_RELEASE
290
285
  ].join(','),
291
286
  platform: platform
292
287
  }
@@ -5,6 +5,7 @@ module Spaceship
5
5
  include Spaceship::ConnectAPI::Model
6
6
 
7
7
  attr_accessor :app_store_state
8
+ attr_accessor :state
8
9
  attr_accessor :app_store_age_rating
9
10
  attr_accessor :brazil_age_rating
10
11
  attr_accessor :kids_age_band
@@ -16,6 +17,7 @@ module Spaceship
16
17
  attr_accessor :secondary_subcategory_one
17
18
  attr_accessor :secondary_subcategory_two
18
19
 
20
+ # Deprecated in App Store Connect API specification 3.3
19
21
  module AppStoreState
20
22
  ACCEPTED = "ACCEPTED"
21
23
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
@@ -36,6 +38,20 @@ module Spaceship
36
38
  REPLACED_WITH_NEW_VERSION = "REPLACED_WITH_NEW_VERSION"
37
39
  WAITING_FOR_EXPORT_COMPLIANCE = "WAITING_FOR_EXPORT_COMPLIANCE"
38
40
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
41
+ NOT_APPLICABLE = "NOT_APPLICABLE"
42
+ end
43
+
44
+ module State
45
+ ACCEPTED = "ACCEPTED"
46
+ DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
47
+ IN_REVIEW = "IN_REVIEW"
48
+ PENDING_RELEASE = "PENDING_RELEASE"
49
+ PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
50
+ READY_FOR_DISTRIBUTION = "READY_FOR_DISTRIBUTION"
51
+ READY_FOR_REVIEW = "READY_FOR_REVIEW"
52
+ REJECTED = "REJECTED"
53
+ REPLACED_WITH_NEW_INFO = "REPLACED_WITH_NEW_INFO"
54
+ WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
39
55
  end
40
56
 
41
57
  module AppStoreAgeRating
@@ -44,6 +60,7 @@ module Spaceship
44
60
 
45
61
  attr_mapping({
46
62
  "appStoreState" => "app_store_state",
63
+ "state" => "state",
47
64
  "appStoreAgeRating" => "app_store_age_rating",
48
65
  "brazilAgeRating" => "brazil_age_rating",
49
66
  "kidsAgeBand" => "kids_age_band",
@@ -10,6 +10,7 @@ module Spaceship
10
10
  attr_accessor :platform
11
11
  attr_accessor :version_string
12
12
  attr_accessor :app_store_state
13
+ attr_accessor :app_version_state
13
14
  attr_accessor :store_icon
14
15
  attr_accessor :watch_store_icon
15
16
  attr_accessor :copyright
@@ -19,26 +20,53 @@ module Spaceship
19
20
  attr_accessor :is_watch_only
20
21
  attr_accessor :downloadable
21
22
  attr_accessor :created_date
23
+ attr_accessor :review_type
22
24
 
23
25
  attr_accessor :app_store_version_submission
24
26
  attr_accessor :app_store_version_phased_release
25
27
  attr_accessor :app_store_review_detail
26
28
  attr_accessor :app_store_version_localizations
27
29
 
30
+ # Deprecated in App Store Connect API specification 3.3
28
31
  module AppStoreState
29
- READY_FOR_SALE = "READY_FOR_SALE"
30
- READY_FOR_REVIEW = "READY_FOR_REVIEW"
31
- PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
32
- PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
33
- PENDING_APPLE_RELEASE = "PENDING_APPLE_RELEASE"
34
- IN_REVIEW = "IN_REVIEW"
35
- WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
32
+ ACCEPTED = "ACCEPTED"
36
33
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
37
34
  DEVELOPER_REMOVED_FROM_SALE = "DEVELOPER_REMOVED_FROM_SALE"
38
- REJECTED = "REJECTED"
39
- PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
35
+ IN_REVIEW = "IN_REVIEW"
36
+ INVALID_BINARY = "INVALID_BINARY"
40
37
  METADATA_REJECTED = "METADATA_REJECTED"
38
+ PENDING_APPLE_RELEASE = "PENDING_APPLE_RELEASE"
39
+ PENDING_CONTRACT = "PENDING_CONTRACT"
40
+ PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
41
+ PREORDER_READY_FOR_SALE = "PREORDER_READY_FOR_SALE"
42
+ PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
43
+ PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
44
+ READY_FOR_REVIEW = "READY_FOR_REVIEW"
45
+ READY_FOR_SALE = "READY_FOR_SALE"
46
+ REJECTED = "REJECTED"
47
+ REMOVED_FROM_SALE = "REMOVED_FROM_SALE"
48
+ REPLACED_WITH_NEW_VERSION = "REPLACED_WITH_NEW_VERSION"
49
+ WAITING_FOR_EXPORT_COMPLIANCE = "WAITING_FOR_EXPORT_COMPLIANCE"
50
+ WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
51
+ NOT_APPLICABLE = "NOT_APPLICABLE"
52
+ end
53
+
54
+ module AppVersionState
55
+ ACCEPTED = "ACCEPTED"
56
+ DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
57
+ IN_REVIEW = "IN_REVIEW"
41
58
  INVALID_BINARY = "INVALID_BINARY"
59
+ METADATA_REJECTED = "METADATA_REJECTED"
60
+ PENDING_APPLE_RELEASE = "PENDING_APPLE_RELEASE"
61
+ PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
62
+ PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
63
+ PROCESSING_FOR_DISTRIBUTION = "PROCESSING_FOR_DISTRIBUTION"
64
+ READY_FOR_DISTRIBUTION = "READY_FOR_DISTRIBUTION"
65
+ READY_FOR_REVIEW = "READY_FOR_REVIEW"
66
+ REJECTED = "REJECTED"
67
+ REPLACED_WITH_NEW_VERSION = "REPLACED_WITH_NEW_VERSION"
68
+ WAITING_FOR_EXPORT_COMPLIANCE = "WAITING_FOR_EXPORT_COMPLIANCE"
69
+ WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
42
70
  end
43
71
 
44
72
  module ReleaseType
@@ -47,10 +75,16 @@ module Spaceship
47
75
  SCHEDULED = "SCHEDULED"
48
76
  end
49
77
 
78
+ module ReviewType
79
+ APP_STORE = "APP_STORE"
80
+ NOTARIZATION = "NOTARIZATION"
81
+ end
82
+
50
83
  attr_mapping({
51
84
  "platform" => "platform",
52
85
  "versionString" => "version_string",
53
86
  "appStoreState" => "app_store_state",
87
+ "appVersionState" => "app_version_state",
54
88
  "storeIcon" => "store_icon",
55
89
  "watchStoreIcon" => "watch_store_icon",
56
90
  "copyright" => "copyright",
@@ -60,6 +94,7 @@ module Spaceship
60
94
  "isWatchOnly" => "is_watch_only",
61
95
  "downloadable" => "downloadable",
62
96
  "createdDate" => "created_date",
97
+ "reviewType" => "review_type",
63
98
 
64
99
  "appStoreVersionSubmission" => "app_store_version_submission",
65
100
  "build" => "build",
@@ -8,7 +8,21 @@ module Spaceship
8
8
  attr_accessor :last_name
9
9
  attr_accessor :email
10
10
  attr_accessor :invite_type
11
- attr_accessor :invitation
11
+ attr_accessor :beta_tester_state
12
+ attr_accessor :is_deleted
13
+ attr_accessor :last_modified_date
14
+ attr_accessor :installed_cf_bundle_short_version_string
15
+ attr_accessor :installed_cf_bundle_version
16
+ attr_accessor :remove_after_date
17
+ attr_accessor :installed_device
18
+ attr_accessor :installed_os_version
19
+ attr_accessor :number_of_installed_devices
20
+ attr_accessor :latest_expiring_cf_bundle_short_version_string
21
+ attr_accessor :latest_expiring_cf_bundle_version_string
22
+ attr_accessor :installed_device_platform
23
+ attr_accessor :latest_installed_device
24
+ attr_accessor :latest_installed_os_version
25
+ attr_accessor :latest_installed_device_platform
12
26
 
13
27
  attr_accessor :apps
14
28
  attr_accessor :beta_groups
@@ -20,7 +34,21 @@ module Spaceship
20
34
  "lastName" => "last_name",
21
35
  "email" => "email",
22
36
  "inviteType" => "invite_type",
23
- "invitation" => "invitation",
37
+ "betaTesterState" => "beta_tester_state",
38
+ "isDeleted" => "is_deleted",
39
+ "lastModifiedDate" => "last_modified_date",
40
+ "installedCfBundleShortVersionString" => "installed_cf_bundle_short_version_string",
41
+ "installedCfBundleVersion" => "installed_cf_bundle_version",
42
+ "removeAfterDate" => "remove_after_date",
43
+ "installedDevice" => "installed_device",
44
+ "installedOsVersion" => "installed_os_version",
45
+ "numberOfInstalledDevices" => "number_of_installed_devices",
46
+ "latestExpiringCfBundleShortVersionString" => "latest_expiring_cf_bundle_short_version_string",
47
+ "latestExpiringCfBundleVersionString" => "latest_expiring_cf_bundle_version_string",
48
+ "installedDevicePlatform" => "installed_device_platform",
49
+ "latestInstalledDevice" => "latest_installed_device",
50
+ "latestInstalledOsVersion" => "latest_installed_os_version",
51
+ "latestInstalledDevicePlatform" => "latest_installed_device_platform",
24
52
 
25
53
  "apps" => "apps",
26
54
  "betaGroups" => "beta_groups",
@@ -55,7 +55,7 @@ module Spaceship
55
55
  Time.parse(expiration_date) > Time.now
56
56
  end
57
57
 
58
- # Create a new code signing request that can be used to
58
+ # Create a new cert signing request that can be used to
59
59
  # generate a new certificate
60
60
  # @example
61
61
  # Create a new certificate signing request
@@ -71,7 +71,7 @@ module Spaceship
71
71
  ['CN', 'PEM', OpenSSL::ASN1::UTF8STRING]
72
72
  ])
73
73
  csr.public_key = key.public_key
74
- csr.sign(key, OpenSSL::Digest::SHA1.new)
74
+ csr.sign(key, OpenSSL::Digest::SHA256.new)
75
75
  return [csr, key]
76
76
  end
77
77
 
@@ -30,9 +30,11 @@ module Spaceship
30
30
  IPOD = "IPOD"
31
31
  APPLE_TV = "APPLE_TV"
32
32
  MAC = "MAC"
33
+ APPLE_VISION_PRO = "APPLE_VISION_PRO"
33
34
 
34
- # As of 2022-11-12, this is not officially supported by App Store Connect API
35
+ # As of 2024-03-08, this is not _officially_ supported by App Store Connect API (according to API docs)—yet still used in the API responses
35
36
  APPLE_SILICON_MAC = "APPLE_SILICON_MAC"
37
+ INTEL_MAC = "INTEL_MAC"
36
38
  end
37
39
 
38
40
  module Status
@@ -68,7 +70,7 @@ module Spaceship
68
70
  device_platform = case platform
69
71
  when :osx, :macos, :mac
70
72
  Spaceship::ConnectAPI::Platform::MAC_OS
71
- when :ios
73
+ when :ios, :tvos, :xros, :visionos
72
74
  Spaceship::ConnectAPI::Platform::IOS
73
75
  when :catalyst
74
76
  Spaceship::ConnectAPI::Platform::MAC_OS
@@ -86,7 +88,8 @@ module Spaceship
86
88
  Spaceship::ConnectAPI::Device::DeviceClass::IPAD,
87
89
  Spaceship::ConnectAPI::Device::DeviceClass::IPHONE,
88
90
  Spaceship::ConnectAPI::Device::DeviceClass::IPOD,
89
- Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH
91
+ Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH,
92
+ Spaceship::ConnectAPI::Device::DeviceClass::APPLE_VISION_PRO
90
93
  ]
91
94
  when :tvos
92
95
  [
@@ -94,7 +97,9 @@ module Spaceship
94
97
  ]
95
98
  when :macos, :catalyst
96
99
  [
97
- Spaceship::ConnectAPI::Device::DeviceClass::MAC
100
+ Spaceship::ConnectAPI::Device::DeviceClass::MAC,
101
+ Spaceship::ConnectAPI::Device::DeviceClass::APPLE_SILICON_MAC,
102
+ Spaceship::ConnectAPI::Device::DeviceClass::INTEL_MAC
98
103
  ]
99
104
  else
100
105
  []
@@ -106,9 +111,9 @@ module Spaceship
106
111
  end
107
112
 
108
113
  filter = {
109
- status: Spaceship::ConnectAPI::Device::Status::ENABLED,
110
- platform: device_platforms.uniq.join(',')
114
+ status: Spaceship::ConnectAPI::Device::Status::ENABLED
111
115
  }
116
+ filter[:platform] = device_platforms.uniq.join(',') unless device_platforms.empty?
112
117
 
113
118
  devices = Spaceship::ConnectAPI::Device.all(
114
119
  client: client,
@@ -64,7 +64,14 @@ module Spaceship
64
64
  end
65
65
 
66
66
  def valid?
67
- return profile_state == ProfileState::ACTIVE
67
+ # Provisioning profiles are not invalidated automatically on the dev portal when the certificate expires.
68
+ # They become Invalid only when opened directly in the portal 🤷.
69
+ # We need to do an extra check on the expiration date to ensure the profile is valid.
70
+ expired = Time.now.utc > Time.parse(self.expiration_date)
71
+
72
+ is_valid = profile_state == ProfileState::ACTIVE && !expired
73
+
74
+ return is_valid
68
75
  end
69
76
 
70
77
  #
@@ -16,7 +16,7 @@ module Spaceship
16
16
  end
17
17
 
18
18
  def self.hostname
19
- 'https://developer.apple.com/services-account/v1/'
19
+ 'https://developer.apple.com/services-account/'
20
20
  end
21
21
 
22
22
  #
@@ -4,6 +4,10 @@ module Spaceship
4
4
  class ConnectAPI
5
5
  module Provisioning
6
6
  module API
7
+ module Version
8
+ V1 = "v1"
9
+ end
10
+
7
11
  def provisioning_request_client=(provisioning_request_client)
8
12
  @provisioning_request_client = provisioning_request_client
9
13
  end
@@ -19,12 +23,12 @@ module Spaceship
19
23
 
20
24
  def get_bundle_ids(filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
21
25
  params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
22
- provisioning_request_client.get("bundleIds", params)
26
+ provisioning_request_client.get("#{Version::V1}/bundleIds", params)
23
27
  end
24
28
 
25
29
  def get_bundle_id(bundle_id_id: {}, includes: nil)
26
30
  params = provisioning_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
27
- provisioning_request_client.get("bundleIds/#{bundle_id_id}", params)
31
+ provisioning_request_client.get("#{Version::V1}/bundleIds/#{bundle_id_id}", params)
28
32
  end
29
33
 
30
34
  def post_bundle_id(name:, platform:, identifier:, seed_id:)
@@ -42,7 +46,7 @@ module Spaceship
42
46
  }
43
47
  }
44
48
 
45
- provisioning_request_client.post("bundleIds", body)
49
+ provisioning_request_client.post("#{Version::V1}/bundleIds", body)
46
50
  end
47
51
 
48
52
  #
@@ -51,12 +55,12 @@ module Spaceship
51
55
 
52
56
  def get_bundle_id_capabilities(bundle_id_id:, includes: nil, limit: nil, sort: nil)
53
57
  params = provisioning_request_client.build_params(filter: nil, includes: includes, limit: limit, sort: sort)
54
- provisioning_request_client.get("bundleIds/#{bundle_id_id}/bundleIdCapabilities", params)
58
+ provisioning_request_client.get("#{Version::V1}/bundleIds/#{bundle_id_id}/bundleIdCapabilities", params)
55
59
  end
56
60
 
57
61
  def get_available_bundle_id_capabilities(bundle_id_id:)
58
62
  params = provisioning_request_client.build_params(filter: { bundleId: bundle_id_id })
59
- provisioning_request_client.get("capabilities", params)
63
+ provisioning_request_client.get("#{Version::V1}/capabilities", params)
60
64
  end
61
65
 
62
66
  def post_bundle_id_capability(bundle_id_id:, capability_type:, settings: [])
@@ -83,7 +87,7 @@ module Spaceship
83
87
  }
84
88
  }
85
89
  }
86
- provisioning_request_client.post("bundleIdCapabilities", body)
90
+ provisioning_request_client.post("#{Version::V1}/bundleIdCapabilities", body)
87
91
  end
88
92
 
89
93
  def patch_bundle_id_capability(bundle_id_id:, seed_id:, enabled: false, capability_type:, settings: [])
@@ -92,7 +96,12 @@ module Spaceship
92
96
  type: "bundleIds",
93
97
  id: bundle_id_id,
94
98
  attributes: {
95
- teamId: seed_id
99
+ permissions: {
100
+ edit: true,
101
+ delete: true
102
+ },
103
+ seedId: seed_id,
104
+ teamId: provisioning_request_client.team_id
96
105
  },
97
106
  relationships: {
98
107
  bundleIdCapabilities: {
@@ -118,11 +127,11 @@ module Spaceship
118
127
  }
119
128
  }
120
129
 
121
- provisioning_request_client.patch("bundleIds/#{bundle_id_id}", body)
130
+ provisioning_request_client.patch("#{Version::V1}/bundleIds/#{bundle_id_id}", body)
122
131
  end
123
132
 
124
133
  def delete_bundle_id_capability(bundle_id_capability_id:)
125
- provisioning_request_client.delete("bundleIdCapabilities/#{bundle_id_capability_id}")
134
+ provisioning_request_client.delete("#{Version::V1}/bundleIdCapabilities/#{bundle_id_capability_id}")
126
135
  end
127
136
 
128
137
  #
@@ -132,15 +141,15 @@ module Spaceship
132
141
  def get_certificates(profile_id: nil, filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
133
142
  params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
134
143
  if profile_id.nil?
135
- provisioning_request_client.get("certificates", params)
144
+ provisioning_request_client.get("#{Version::V1}/certificates", params)
136
145
  else
137
- provisioning_request_client.get("profiles/#{profile_id}/certificates", params)
146
+ provisioning_request_client.get("#{Version::V1}/profiles/#{profile_id}/certificates", params)
138
147
  end
139
148
  end
140
149
 
141
150
  def get_certificate(certificate_id: nil, includes: nil)
142
151
  params = provisioning_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
143
- provisioning_request_client.get("certificates/#{certificate_id}", params)
152
+ provisioning_request_client.get("#{Version::V1}/certificates/#{certificate_id}", params)
144
153
  end
145
154
 
146
155
  def post_certificate(attributes: {})
@@ -151,13 +160,13 @@ module Spaceship
151
160
  }
152
161
  }
153
162
 
154
- provisioning_request_client.post("certificates", body)
163
+ provisioning_request_client.post("#{Version::V1}/certificates", body)
155
164
  end
156
165
 
157
166
  def delete_certificate(certificate_id: nil)
158
167
  raise "Certificate id is nil" if certificate_id.nil?
159
168
 
160
- provisioning_request_client.delete("certificates/#{certificate_id}")
169
+ provisioning_request_client.delete("#{Version::V1}/certificates/#{certificate_id}")
161
170
  end
162
171
 
163
172
  #
@@ -167,9 +176,9 @@ module Spaceship
167
176
  def get_devices(profile_id: nil, filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
168
177
  params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
169
178
  if profile_id.nil?
170
- provisioning_request_client.get("devices", params)
179
+ provisioning_request_client.get("#{Version::V1}/devices", params)
171
180
  else
172
- provisioning_request_client.get("profiles/#{profile_id}/devices", params)
181
+ provisioning_request_client.get("#{Version::V1}/profiles/#{profile_id}/devices", params)
173
182
  end
174
183
  end
175
184
 
@@ -187,7 +196,7 @@ module Spaceship
187
196
  }
188
197
  }
189
198
 
190
- provisioning_request_client.post("devices", body)
199
+ provisioning_request_client.post("#{Version::V1}/devices", body)
191
200
  end
192
201
 
193
202
  def patch_device(id: nil, status: nil, new_name: nil)
@@ -206,7 +215,7 @@ module Spaceship
206
215
  }
207
216
  }
208
217
 
209
- provisioning_request_client.patch("devices/#{id}", body)
218
+ provisioning_request_client.patch("#{Version::V1}/devices/#{id}", body)
210
219
  end
211
220
 
212
221
  #
@@ -215,7 +224,7 @@ module Spaceship
215
224
 
216
225
  def get_profiles(filter: {}, includes: nil, fields: nil, limit: nil, sort: nil)
217
226
  params = provisioning_request_client.build_params(filter: filter, includes: includes, fields: fields, limit: limit, sort: sort)
218
- provisioning_request_client.get("profiles", params)
227
+ provisioning_request_client.get("#{Version::V1}/profiles", params)
219
228
  end
220
229
 
221
230
  def post_profiles(bundle_id_id: nil, certificates: nil, devices: nil, attributes: {})
@@ -250,19 +259,19 @@ module Spaceship
250
259
  }
251
260
  }
252
261
 
253
- provisioning_request_client.post("profiles", body)
262
+ provisioning_request_client.post("#{Version::V1}/profiles", body)
254
263
  end
255
264
 
256
265
  def get_profile_bundle_id(profile_id: nil)
257
266
  raise "Profile id is nil" if profile_id.nil?
258
267
 
259
- provisioning_request_client.get("profiles/#{profile_id}/bundleId")
268
+ provisioning_request_client.get("#{Version::V1}/profiles/#{profile_id}/bundleId")
260
269
  end
261
270
 
262
271
  def delete_profile(profile_id: nil)
263
272
  raise "Profile id is nil" if profile_id.nil?
264
273
 
265
- provisioning_request_client.delete("profiles/#{profile_id}")
274
+ provisioning_request_client.delete("#{Version::V1}/profiles/#{profile_id}")
266
275
  end
267
276
  end
268
277
  end
@@ -19,7 +19,7 @@ module Spaceship
19
19
  end
20
20
 
21
21
  def self.hostname
22
- 'https://appstoreconnect.apple.com/iris/v1/'
22
+ 'https://appstoreconnect.apple.com/iris/'
23
23
  end
24
24
  end
25
25
  end