fastlane 2.195.0 → 2.213.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +96 -89
  4. data/cert/lib/cert/runner.rb +19 -8
  5. data/deliver/lib/assets/ScreenshotsHelp +29 -6
  6. data/deliver/lib/deliver/app_screenshot.rb +30 -4
  7. data/deliver/lib/deliver/app_screenshot_iterator.rb +1 -1
  8. data/deliver/lib/deliver/options.rb +6 -2
  9. data/deliver/lib/deliver/runner.rb +88 -24
  10. data/deliver/lib/deliver/submit_for_review.rb +25 -3
  11. data/deliver/lib/deliver/upload_price_tier.rb +3 -1
  12. data/deliver/lib/deliver/upload_screenshots.rb +2 -2
  13. data/fastlane/lib/assets/AppfileTemplate +1 -1
  14. data/fastlane/lib/assets/AppfileTemplate.swift +1 -1
  15. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +12 -6
  16. data/fastlane/lib/fastlane/actions/badge.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +1 -1
  18. data/fastlane/lib/fastlane/actions/danger.rb +14 -0
  19. data/fastlane/lib/fastlane/actions/docs/build_app.md +5 -5
  20. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +19 -2
  21. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  22. data/fastlane/lib/fastlane/actions/docs/run_tests.md +1 -1
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +1 -1
  24. data/fastlane/lib/fastlane/actions/download_dsyms.rb +62 -46
  25. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +44 -5
  26. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +1 -1
  27. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
  28. data/fastlane/lib/fastlane/actions/get_version_number.rb +8 -3
  29. data/fastlane/lib/fastlane/actions/git_commit.rb +4 -6
  30. data/fastlane/lib/fastlane/actions/import_certificate.rb +1 -1
  31. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +2 -3
  32. data/fastlane/lib/fastlane/actions/notarize.rb +29 -11
  33. data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +1 -1
  34. data/fastlane/lib/fastlane/actions/pod_push.rb +19 -1
  35. data/fastlane/lib/fastlane/actions/read_podspec.rb +1 -1
  36. data/fastlane/lib/fastlane/actions/run_tests.rb +19 -9
  37. data/fastlane/lib/fastlane/actions/set_github_release.rb +11 -5
  38. data/fastlane/lib/fastlane/actions/setup_ci.rb +13 -4
  39. data/fastlane/lib/fastlane/actions/trainer.rb +49 -0
  40. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +31 -4
  41. data/fastlane/lib/fastlane/actions/update_info_plist.rb +1 -1
  42. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +10 -1
  43. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +1 -1
  44. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
  45. data/fastlane/lib/fastlane/actions/xcode_install.rb +5 -1
  46. data/fastlane/lib/fastlane/actions/xcode_select.rb +1 -1
  47. data/fastlane/lib/fastlane/actions/xcodebuild.rb +8 -2
  48. data/fastlane/lib/fastlane/actions/xcodes.rb +152 -0
  49. data/fastlane/lib/fastlane/actions/xcov.rb +5 -0
  50. data/fastlane/lib/fastlane/actions/xcversion.rb +17 -7
  51. data/fastlane/lib/fastlane/cli_tools_distributor.rb +5 -0
  52. data/fastlane/lib/fastlane/commands_generator.rb +2 -1
  53. data/fastlane/lib/fastlane/documentation/docs_generator.rb +17 -12
  54. data/fastlane/lib/fastlane/fast_file.rb +18 -5
  55. data/fastlane/lib/fastlane/features.rb +3 -0
  56. data/fastlane/lib/fastlane/helper/xcodebuild_formatter_helper.rb +9 -0
  57. data/fastlane/lib/fastlane/helper/xcodes_helper.rb +28 -0
  58. data/fastlane/lib/fastlane/helper/xcversion_helper.rb +0 -9
  59. data/fastlane/lib/fastlane/lane_manager.rb +1 -1
  60. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +1 -1
  61. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +5 -1
  62. data/fastlane/lib/fastlane/setup/setup_ios.rb +1 -1
  63. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +1 -1
  64. data/fastlane/lib/fastlane/swift_lane_manager.rb +11 -3
  65. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +54 -1
  66. data/fastlane/lib/fastlane/tools.rb +18 -1
  67. data/fastlane/lib/fastlane/version.rb +1 -1
  68. data/fastlane/swift/Actions.swift +1 -1
  69. data/fastlane/swift/Appfile.swift +2 -2
  70. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  71. data/fastlane/swift/Atomic.swift +150 -0
  72. data/fastlane/swift/ControlCommand.swift +1 -1
  73. data/fastlane/swift/Deliverfile.swift +2 -2
  74. data/fastlane/swift/DeliverfileProtocol.swift +8 -4
  75. data/fastlane/swift/Fastlane.swift +604 -249
  76. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +30 -20
  77. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +1 -1
  78. data/fastlane/swift/Gymfile.swift +2 -2
  79. data/fastlane/swift/GymfileProtocol.swift +20 -8
  80. data/fastlane/swift/LaneFileProtocol.swift +3 -3
  81. data/fastlane/swift/MainProcess.swift +3 -3
  82. data/fastlane/swift/Matchfile.swift +2 -2
  83. data/fastlane/swift/MatchfileProtocol.swift +25 -5
  84. data/fastlane/swift/OptionalConfigValue.swift +1 -1
  85. data/fastlane/swift/Plugins.swift +1 -1
  86. data/fastlane/swift/Precheckfile.swift +2 -2
  87. data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
  88. data/fastlane/swift/RubyCommand.swift +1 -1
  89. data/fastlane/swift/RubyCommandable.swift +1 -1
  90. data/fastlane/swift/Runner.swift +14 -10
  91. data/fastlane/swift/RunnerArgument.swift +1 -1
  92. data/fastlane/swift/Scanfile.swift +2 -2
  93. data/fastlane/swift/ScanfileProtocol.swift +35 -11
  94. data/fastlane/swift/Screengrabfile.swift +2 -2
  95. data/fastlane/swift/ScreengrabfileProtocol.swift +5 -5
  96. data/fastlane/swift/Snapshotfile.swift +2 -2
  97. data/fastlane/swift/SnapshotfileProtocol.swift +12 -8
  98. data/fastlane/swift/SocketClient.swift +9 -5
  99. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -2
  100. data/fastlane/swift/SocketResponse.swift +1 -1
  101. data/fastlane/swift/formatting/Brewfile.lock.json +47 -24
  102. data/fastlane/swift/main.swift +1 -1
  103. data/fastlane/swift/upgrade_manifest.json +1 -1
  104. data/fastlane_core/README.md +1 -0
  105. data/fastlane_core/lib/fastlane_core/cert_checker.rb +74 -17
  106. data/fastlane_core/lib/fastlane_core/device_manager.rb +5 -1
  107. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +10 -5
  108. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +409 -26
  109. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -0
  110. data/fastlane_core/lib/fastlane_core/project.rb +19 -2
  111. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +7 -0
  112. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +4 -2
  113. data/frameit/lib/frameit/device.rb +1 -1
  114. data/frameit/lib/frameit/device_types.rb +9 -0
  115. data/frameit/lib/frameit/editor.rb +16 -18
  116. data/frameit/lib/frameit/frame_downloader.rb +1 -1
  117. data/frameit/lib/frameit/trim_box.rb +6 -0
  118. data/gym/lib/gym/generators/build_command_generator.rb +70 -23
  119. data/gym/lib/gym/options.rb +30 -5
  120. data/match/lib/match/change_password.rb +2 -0
  121. data/match/lib/match/commands_generator.rb +2 -1
  122. data/match/lib/match/encryption/openssl.rb +1 -1
  123. data/match/lib/match/encryption.rb +3 -0
  124. data/match/lib/match/generator.rb +1 -0
  125. data/match/lib/match/importer.rb +11 -1
  126. data/match/lib/match/migrate.rb +4 -3
  127. data/match/lib/match/module.rb +54 -2
  128. data/match/lib/match/nuke.rb +115 -47
  129. data/match/lib/match/options.rb +27 -1
  130. data/match/lib/match/runner.rb +26 -6
  131. data/match/lib/match/setup.rb +1 -1
  132. data/match/lib/match/spaceship_ensure.rb +5 -2
  133. data/match/lib/match/storage/gitlab/client.rb +102 -0
  134. data/match/lib/match/storage/gitlab/secure_file.rb +65 -0
  135. data/match/lib/match/storage/gitlab_secure_files.rb +188 -0
  136. data/match/lib/match/storage/google_cloud_storage.rb +7 -6
  137. data/match/lib/match/storage/s3_storage.rb +3 -3
  138. data/match/lib/match/storage.rb +4 -0
  139. data/match/lib/match/table_printer.rb +2 -1
  140. data/match/lib/match/utils.rb +15 -2
  141. data/pem/lib/pem/manager.rb +32 -8
  142. data/pem/lib/pem/options.rb +10 -1
  143. data/pilot/lib/pilot/build_manager.rb +34 -14
  144. data/pilot/lib/pilot/options.rb +6 -1
  145. data/scan/lib/scan/detect_values.rb +14 -1
  146. data/scan/lib/scan/error_handler.rb +9 -0
  147. data/scan/lib/scan/options.rb +54 -9
  148. data/scan/lib/scan/runner.rb +171 -25
  149. data/scan/lib/scan/test_command_generator.rb +65 -5
  150. data/screengrab/lib/screengrab/options.rb +2 -2
  151. data/sigh/lib/assets/resign.sh +8 -5
  152. data/sigh/lib/sigh/download_all.rb +14 -2
  153. data/sigh/lib/sigh/module.rb +3 -1
  154. data/sigh/lib/sigh/options.rb +5 -0
  155. data/sigh/lib/sigh/runner.rb +12 -2
  156. data/snapshot/lib/assets/SnapshotHelper.swift +3 -3
  157. data/snapshot/lib/snapshot/latest_os_version.rb +2 -5
  158. data/snapshot/lib/snapshot/options.rb +24 -8
  159. data/snapshot/lib/snapshot/reports_generator.rb +9 -0
  160. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +10 -3
  161. data/snapshot/lib/snapshot/test_command_generator.rb +37 -2
  162. data/spaceship/lib/spaceship/client.rb +71 -40
  163. data/spaceship/lib/spaceship/commands_generator.rb +1 -1
  164. data/spaceship/lib/spaceship/connect_api/api_client.rb +10 -5
  165. data/spaceship/lib/spaceship/connect_api/models/actor.rb +26 -0
  166. data/spaceship/lib/spaceship/connect_api/models/app.rb +52 -6
  167. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  168. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +5 -0
  169. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +7 -0
  170. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +1 -1
  171. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +27 -10
  172. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -2
  173. data/spaceship/lib/spaceship/connect_api/models/build_bundle.rb +68 -0
  174. data/spaceship/lib/spaceship/connect_api/models/build_bundle_file_sizes.rb +34 -0
  175. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +2 -1
  176. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +4 -0
  177. data/spaceship/lib/spaceship/connect_api/models/device.rb +47 -4
  178. data/spaceship/lib/spaceship/connect_api/models/profile.rb +4 -0
  179. data/spaceship/lib/spaceship/connect_api/models/resolution_center_message.rb +29 -0
  180. data/spaceship/lib/spaceship/connect_api/models/resolution_center_thread.rb +67 -0
  181. data/spaceship/lib/spaceship/connect_api/models/review_rejection.rb +19 -0
  182. data/spaceship/lib/spaceship/connect_api/models/review_submission.rb +86 -0
  183. data/spaceship/lib/spaceship/connect_api/models/review_submission_item.rb +40 -0
  184. data/spaceship/lib/spaceship/connect_api/models/user.rb +5 -0
  185. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +19 -0
  186. data/spaceship/lib/spaceship/connect_api/response.rb +23 -6
  187. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +33 -2
  188. data/spaceship/lib/spaceship/connect_api/token.rb +6 -3
  189. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +124 -8
  190. data/spaceship/lib/spaceship/connect_api.rb +9 -0
  191. data/spaceship/lib/spaceship/errors.rb +34 -0
  192. data/spaceship/lib/spaceship/globals.rb +9 -0
  193. data/spaceship/lib/spaceship/hashcash.rb +52 -0
  194. data/spaceship/lib/spaceship/portal/certificate.rb +4 -3
  195. data/spaceship/lib/spaceship/spaceauth_runner.rb +1 -1
  196. data/spaceship/lib/spaceship/tunes/app_ratings.rb +6 -6
  197. data/spaceship/lib/spaceship/tunes/iap_families.rb +1 -1
  198. data/spaceship/lib/spaceship/tunes/tunes.rb +0 -1
  199. data/spaceship/lib/spaceship/tunes/tunes_client.rb +79 -21
  200. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +11 -3
  201. data/spaceship/lib/spaceship.rb +1 -0
  202. data/supply/lib/supply/client.rb +5 -10
  203. data/supply/lib/supply/options.rb +8 -0
  204. data/supply/lib/supply/uploader.rb +7 -3
  205. data/trainer/lib/assets/junit.xml.erb +28 -0
  206. data/trainer/lib/trainer/commands_generator.rb +51 -0
  207. data/trainer/lib/trainer/junit_generator.rb +31 -0
  208. data/trainer/lib/trainer/module.rb +10 -0
  209. data/trainer/lib/trainer/options.rb +66 -0
  210. data/trainer/lib/trainer/test_parser.rb +398 -0
  211. data/trainer/lib/trainer/xcresult.rb +403 -0
  212. data/trainer/lib/trainer.rb +7 -0
  213. metadata +73 -37
  214. data/spaceship/lib/spaceship/tunes/user_detail.rb +0 -15
@@ -57,6 +57,11 @@ module Spaceship
57
57
  return all(client: client, filter: { email: email }, includes: includes)
58
58
  end
59
59
 
60
+ def delete!(client: nil)
61
+ client ||= Spaceship::ConnectAPI
62
+ client.delete_user(user_id: id)
63
+ end
64
+
60
65
  def get_visible_apps(client: nil, limit: nil)
61
66
  client ||= Spaceship::ConnectAPI
62
67
  resp = client.get_user_visible_apps(user_id: id, limit: limit)
@@ -190,6 +190,25 @@ module Spaceship
190
190
  provisioning_request_client.post("devices", body)
191
191
  end
192
192
 
193
+ def patch_device(id: nil, status: nil, new_name: nil)
194
+ raise "Device id is nil" if id.nil?
195
+
196
+ attributes = {
197
+ name: new_name,
198
+ status: status
199
+ }
200
+
201
+ body = {
202
+ data: {
203
+ attributes: attributes,
204
+ id: id,
205
+ type: "devices"
206
+ }
207
+ }
208
+
209
+ provisioning_request_client.patch("devices/#{id}", body)
210
+ end
211
+
193
212
  #
194
213
  # profiles
195
214
  #
@@ -22,13 +22,17 @@ module Spaceship
22
22
  return links["next"]
23
23
  end
24
24
 
25
- def next_page
25
+ def next_page(&block)
26
26
  url = next_url
27
27
  return nil if url.nil?
28
- return client.get(url)
28
+ if block_given?
29
+ return yield(url)
30
+ else
31
+ return client.get(url)
32
+ end
29
33
  end
30
34
 
31
- def next_pages(count: 1)
35
+ def next_pages(count: 1, &block)
32
36
  if !count.nil? && count < 0
33
37
  count = 0
34
38
  end
@@ -38,7 +42,7 @@ module Spaceship
38
42
 
39
43
  resp = self
40
44
  loop do
41
- resp = resp.next_page
45
+ resp = resp.next_page(&block)
42
46
  break if resp.nil?
43
47
  responses << resp
44
48
  counter += 1
@@ -49,8 +53,8 @@ module Spaceship
49
53
  return responses
50
54
  end
51
55
 
52
- def all_pages
53
- return next_pages(count: nil)
56
+ def all_pages(&block)
57
+ return next_pages(count: nil, &block)
54
58
  end
55
59
 
56
60
  def to_models
@@ -64,6 +68,19 @@ module Spaceship
64
68
  yield(model)
65
69
  end
66
70
  end
71
+
72
+ def all_pages_each(&block)
73
+ to_models.each do |model|
74
+ yield(model)
75
+ end
76
+
77
+ resp = self
78
+ loop do
79
+ resp = resp.next_page
80
+ break if resp.nil?
81
+ resp.each(&block)
82
+ end
83
+ end
67
84
  end
68
85
  end
69
86
  end
@@ -290,6 +290,28 @@ module Spaceship
290
290
  test_flight_request_client.post("bulkBetaTesterAssignments", body)
291
291
  end
292
292
 
293
+ # attributes - {email: "", firstName: "", lastName: ""}
294
+ def post_beta_tester_assignment(beta_group_ids: [], attributes: {})
295
+ body = {
296
+ data: {
297
+ attributes: attributes,
298
+ relationships: {
299
+ betaGroups: {
300
+ data: beta_group_ids.map do |id|
301
+ {
302
+ type: "betaGroups",
303
+ id: id
304
+ }
305
+ end
306
+ }
307
+ },
308
+ type: "betaTesters"
309
+ }
310
+ }
311
+
312
+ test_flight_request_client.post("betaTesters", body)
313
+ end
314
+
293
315
  def add_beta_tester_to_group(beta_group_id: nil, beta_tester_ids: nil)
294
316
  beta_tester_ids || []
295
317
  body = {
@@ -390,6 +412,15 @@ module Spaceship
390
412
  test_flight_request_client.get("betaTesterMetrics", params)
391
413
  end
392
414
 
415
+ #
416
+ # buildBundles
417
+ #
418
+
419
+ def get_build_bundles_build_bundle_file_sizes(build_bundle_id:, limit: nil)
420
+ params = test_flight_request_client.build_params(filter: nil, includes: nil, limit: limit, sort: nil, cursor: nil)
421
+ test_flight_request_client.get("buildBundles/#{build_bundle_id}/buildBundleFileSizes", params)
422
+ end
423
+
393
424
  #
394
425
  # builds
395
426
  #
@@ -448,9 +479,9 @@ module Spaceship
448
479
  # buildDeliveries
449
480
  #
450
481
 
451
- def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
482
+ def get_build_deliveries(app_id:, filter: {}, includes: nil, limit: nil, sort: nil)
452
483
  params = test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
453
- test_flight_request_client.get("buildDeliveries", params)
484
+ test_flight_request_client.get("apps/#{app_id}/buildDeliveries", params)
454
485
  end
455
486
 
456
487
  #
@@ -29,7 +29,7 @@ module Spaceship
29
29
  attr_accessor :in_house
30
30
 
31
31
  def self.from(hash: nil, filepath: nil)
32
- api_token ||= self.create(**hash) if hash
32
+ api_token ||= self.create(**hash.transform_keys(&:to_sym)) if hash
33
33
  api_token ||= self.from_json_file(filepath) if filepath
34
34
  return api_token
35
35
  end
@@ -90,14 +90,17 @@ module Spaceship
90
90
  end
91
91
 
92
92
  def refresh!
93
- @expiration = Time.now + @duration
93
+ now = Time.now
94
+ @expiration = now + @duration
94
95
 
95
96
  header = {
96
- kid: key_id
97
+ kid: key_id,
98
+ typ: 'JWT'
97
99
  }
98
100
 
99
101
  payload = {
100
102
  iss: issuer_id,
103
+ iat: now.to_i,
101
104
  exp: @expiration.to_i,
102
105
  aud: 'appstoreconnect-v1'
103
106
  }
@@ -134,7 +134,15 @@ module Spaceship
134
134
  tunes_request_client.post("apps", body)
135
135
  end
136
136
 
137
- def patch_app(app_id: nil, attributes: {}, app_price_tier_id: nil, territory_ids: nil)
137
+ # Updates app attributes, price tier, visibility in regions or countries.
138
+ # Use territory_ids with allow_removing_from_sale to remove app from sale
139
+ # @param territory_ids updates app visibility in regions or countries.
140
+ # Possible values:
141
+ # empty array will remove app from sale if allow_removing_from_sale is true,
142
+ # array with territory ids will set availability to territories with those ids,
143
+ # nil will leave app availability on AppStore as is
144
+ # @param allow_removing_from_sale allows for removing app from sale when territory_ids is an empty array
145
+ def patch_app(app_id: nil, attributes: {}, app_price_tier_id: nil, territory_ids: nil, allow_removing_from_sale: false)
138
146
  relationships = {}
139
147
  included = []
140
148
 
@@ -173,13 +181,15 @@ module Spaceship
173
181
  end
174
182
 
175
183
  # Territories
176
- territories_data = (territory_ids || []).map do |id|
177
- { type: "territories", id: id }
178
- end
179
- unless territories_data.empty?
180
- relationships[:availableTerritories] = {
181
- data: territories_data
182
- }
184
+ unless territory_ids.nil?
185
+ territories_data = territory_ids.map do |id|
186
+ { type: "territories", id: id }
187
+ end
188
+ if !territories_data.empty? || allow_removing_from_sale
189
+ relationships[:availableTerritories] = {
190
+ data: territories_data
191
+ }
192
+ end
183
193
  end
184
194
 
185
195
  # Data
@@ -1126,6 +1136,89 @@ module Spaceship
1126
1136
  tunes_request_client.delete("idfaDeclarations/#{idfa_declaration_id}", params)
1127
1137
  end
1128
1138
 
1139
+ #
1140
+ # reviewSubmissions
1141
+ #
1142
+
1143
+ def get_review_submissions(app_id:, filter: {}, includes: nil, limit: nil, sort: nil)
1144
+ params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
1145
+ tunes_request_client.get("apps/#{app_id}/reviewSubmissions", params)
1146
+ end
1147
+
1148
+ def get_review_submission(review_submission_id:, filter: {}, includes: nil, limit: nil, sort: nil)
1149
+ params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
1150
+ tunes_request_client.get("reviewSubmissions/#{review_submission_id}", params)
1151
+ end
1152
+
1153
+ def post_review_submission(app_id:, platform:)
1154
+ body = {
1155
+ data: {
1156
+ type: "reviewSubmissions",
1157
+ attributes: {
1158
+ platform: platform
1159
+ },
1160
+ relationships: {
1161
+ app: {
1162
+ data: {
1163
+ type: "apps",
1164
+ id: app_id
1165
+ }
1166
+ }
1167
+ }
1168
+ }
1169
+ }
1170
+
1171
+ tunes_request_client.post("reviewSubmissions", body)
1172
+ end
1173
+
1174
+ def patch_review_submission(review_submission_id:, attributes: nil)
1175
+ body = {
1176
+ data: {
1177
+ type: "reviewSubmissions",
1178
+ id: review_submission_id,
1179
+ attributes: attributes,
1180
+ }
1181
+ }
1182
+
1183
+ tunes_request_client.patch("reviewSubmissions/#{review_submission_id}", body)
1184
+ end
1185
+
1186
+ #
1187
+ # reviewSubmissionItems
1188
+ #
1189
+
1190
+ def get_review_submission_items(review_submission_id:, filter: {}, includes: nil, limit: nil, sort: nil)
1191
+ params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
1192
+ tunes_request_client.get("reviewSubmissions/#{review_submission_id}/items", params)
1193
+ end
1194
+
1195
+ def post_review_submission_item(review_submission_id:, app_store_version_id: nil)
1196
+ body = {
1197
+ data: {
1198
+ type: "reviewSubmissionItems",
1199
+ relationships: {
1200
+ reviewSubmission: {
1201
+ data: {
1202
+ type: "reviewSubmissions",
1203
+ id: review_submission_id
1204
+ }
1205
+ }
1206
+ }
1207
+ }
1208
+ }
1209
+
1210
+ unless app_store_version_id.nil?
1211
+ body[:data][:relationships][:appStoreVersion] = {
1212
+ data: {
1213
+ type: "appStoreVersions",
1214
+ id: app_store_version_id
1215
+ }
1216
+ }
1217
+ end
1218
+
1219
+ tunes_request_client.post("reviewSubmissionItems", body)
1220
+ end
1221
+
1129
1222
  #
1130
1223
  # sandboxTesters
1131
1224
  #
@@ -1159,6 +1252,29 @@ module Spaceship
1159
1252
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
1160
1253
  tunes_request_client.get("territories", params)
1161
1254
  end
1255
+
1256
+ #
1257
+ # resolutionCenter
1258
+ #
1259
+ # As of 2022-11-11:
1260
+ # This is not official available throught the App Store Connect API using an API Key.
1261
+ # This is only works with Apple ID auth.
1262
+ #
1263
+
1264
+ def get_resolution_center_threads(filter: {}, includes: nil)
1265
+ params = tunes_request_client.build_params(filter: filter, includes: includes)
1266
+ tunes_request_client.get('resolutionCenterThreads', params)
1267
+ end
1268
+
1269
+ def get_resolution_center_messages(thread_id:, filter: {}, includes: nil)
1270
+ params = tunes_request_client.build_params(filter: filter, includes: includes)
1271
+ tunes_request_client.get("resolutionCenterThreads/#{thread_id}/resolutionCenterMessages", params)
1272
+ end
1273
+
1274
+ def get_review_rejection(filter: {}, includes: nil)
1275
+ params = tunes_request_client.build_params(filter: filter, includes: includes)
1276
+ tunes_request_client.get("reviewRejections", params)
1277
+ end
1162
1278
  end
1163
1279
  end
1164
1280
  end
@@ -32,6 +32,8 @@ require 'spaceship/connect_api/models/beta_tester_metric'
32
32
  require 'spaceship/connect_api/models/build'
33
33
  require 'spaceship/connect_api/models/build_delivery'
34
34
  require 'spaceship/connect_api/models/build_beta_detail'
35
+ require 'spaceship/connect_api/models/build_bundle'
36
+ require 'spaceship/connect_api/models/build_bundle_file_sizes'
35
37
  require 'spaceship/connect_api/models/custom_app_organization'
36
38
  require 'spaceship/connect_api/models/custom_app_user'
37
39
  require 'spaceship/connect_api/models/pre_release_version'
@@ -61,10 +63,17 @@ require 'spaceship/connect_api/models/app_store_version_localization'
61
63
  require 'spaceship/connect_api/models/app_store_version_phased_release'
62
64
  require 'spaceship/connect_api/models/app_store_version'
63
65
  require 'spaceship/connect_api/models/idfa_declaration'
66
+ require 'spaceship/connect_api/models/review_submission'
67
+ require 'spaceship/connect_api/models/review_submission_item'
64
68
  require 'spaceship/connect_api/models/reset_ratings_request'
65
69
  require 'spaceship/connect_api/models/sandbox_tester'
66
70
  require 'spaceship/connect_api/models/territory'
67
71
 
72
+ require 'spaceship/connect_api/models/resolution_center_message'
73
+ require 'spaceship/connect_api/models/resolution_center_thread'
74
+ require 'spaceship/connect_api/models/review_rejection'
75
+ require 'spaceship/connect_api/models/actor'
76
+
68
77
  module Spaceship
69
78
  class ConnectAPI
70
79
  # Defined in the App Store Connect API docs:
@@ -98,4 +98,38 @@ module Spaceship
98
98
 
99
99
  # Raised when 403 is received from portal request
100
100
  class AccessForbiddenError < BasicPreferredInfoError; end
101
+
102
+ # Base class for errors coming from App Store Connect locale changes
103
+ class AppStoreLocaleError < BasicPreferredInfoError
104
+ def initialize(msg)
105
+ @message = (msg ? "An exception occurred for locale: #{msg}." : nil)
106
+ super
107
+ end
108
+
109
+ # no need to search github issues since the error is specific
110
+ def show_github_issues
111
+ false
112
+ end
113
+ end
114
+
115
+ # Raised for localized text errors from App Store Connect
116
+ class AppStoreLocalizationError < AppStoreLocaleError
117
+ def preferred_error_info
118
+ "#{@message} Check the localization requirements here: https://help.apple.com/app-store-connect/en.lproj/static.html#dev354659071"
119
+ end
120
+ end
121
+
122
+ # Raised for localized screenshots errors from App Store Connect
123
+ class AppStoreScreenshotError < AppStoreLocaleError
124
+ def preferred_error_info
125
+ "#{@message} Check the screenshot requirements here: https://help.apple.com/app-store-connect/en.lproj/static.html#devd274dd925"
126
+ end
127
+ end
128
+
129
+ # Raised for localized app preview errors from App Store Connect
130
+ class AppStoreAppPreviewError < AppStoreLocaleError
131
+ def preferred_error_info
132
+ "#{@message} Check the app preview requirements here: https://help.apple.com/app-store-connect/en.lproj/static.html#dev4e413fcb8"
133
+ end
134
+ end
101
135
  end
@@ -1,5 +1,9 @@
1
1
  module Spaceship
2
2
  class Globals
3
+ class << self
4
+ attr_writer(:check_session)
5
+ end
6
+
3
7
  # if spaceship is run with a FastlaneCore available respect the global state there
4
8
  # otherwise fallback to $verbose
5
9
  def self.verbose?
@@ -8,5 +12,10 @@ module Spaceship
8
12
  end
9
13
  return $verbose
10
14
  end
15
+
16
+ # if spaceship is run with the --check_session flag this value will be set to true
17
+ def self.check_session
18
+ return @check_session
19
+ end
11
20
  end
12
21
  end
@@ -0,0 +1,52 @@
1
+ require 'digest'
2
+
3
+ module Spaceship
4
+ module Hashcash
5
+ # This App Store Connect hashcash spec was generously donated by...
6
+ #
7
+ # __ _
8
+ # __ _ _ __ _ __ / _|(_) __ _ _ _ _ __ ___ ___
9
+ # / _` || '_ \ | '_ \ | |_ | | / _` || | | || '__|/ _ \/ __|
10
+ # | (_| || |_) || |_) || _|| || (_| || |_| || | | __/\__ \
11
+ # \__,_|| .__/ | .__/ |_| |_| \__, | \__,_||_| \___||___/
12
+ # |_| |_| |___/
13
+ #
14
+ #
15
+ # <summary>
16
+ # 1:11:20230223170600:4d74fb15eb23f465f1f6fcbf534e5877::6373
17
+ # X-APPLE-HC: 1:11:20230223170600:4d74fb15eb23f465f1f6fcbf534e5877::6373
18
+ # ^ ^ ^ ^ ^
19
+ # | | | | +-- Counter
20
+ # | | | +-- Resource
21
+ # | | +-- Date YYMMDD[hhmm[ss]]
22
+ # | +-- Bits (number of leading zeros)
23
+ # +-- Version
24
+ #
25
+ # We can't use an off-the-shelf Hashcash because Apple's implementation is not quite the same as the spec/convention.
26
+ # 1. The spec calls for a nonce called "Rand" to be inserted between the Ext and Counter. They don't do that at all.
27
+ # 2. The Counter conventionally encoded as base-64 but Apple just uses the decimal number's string representation.
28
+ #
29
+ # Iterate from Counter=0 to Counter=N finding an N that makes the SHA1(X-APPLE-HC) lead with Bits leading zero bits
30
+ #
31
+ #
32
+ # We get the "Resource" from the X-Apple-HC-Challenge header and Bits from X-Apple-HC-Bits
33
+ #
34
+ # </summary>
35
+ def self.make(bits:, challenge:)
36
+ version = 1
37
+ date = Time.now.strftime("%Y%m%d%H%M%S")
38
+
39
+ counter = 0
40
+ loop do
41
+ hc = [
42
+ version, bits, date, challenge, ":#{counter}"
43
+ ].join(":")
44
+
45
+ if Digest::SHA1.digest(hc).unpack1('B*')[0, bits.to_i].to_i == 0
46
+ return hc
47
+ end
48
+ counter += 1
49
+ end
50
+ end
51
+ end
52
+ end
@@ -168,7 +168,7 @@ module Spaceship
168
168
  "R58UK2EWSO" => Production,
169
169
  "9RQEK7MSXA" => InHouse,
170
170
  "LA30L5BJEU" => Certificate,
171
- "BKLRAVXMGM" => DevelopmentPush,
171
+ "JKG5JZ54H7" => DevelopmentPush,
172
172
  "UPV3DW712I" => ProductionPush,
173
173
  "Y3B2F3TYSI" => Passbook,
174
174
  "3T2ZP62QW8" => WebsitePush,
@@ -178,12 +178,13 @@ module Spaceship
178
178
  }
179
179
 
180
180
  OLDER_IOS_CERTIFICATE_TYPES = [
181
- # those are also sent by the browser, but not sure what they represent
181
+ "3BQKVH9I2X", # old ProductionPush
182
+ "BKLRAVXMGM", # old DevelopmentPush
183
+ # those are also sent by the browser, but not sure what they represent:
182
184
  "T44PTHVNID",
183
185
  "DZQUP8189Y",
184
186
  "FGQUP4785Z",
185
187
  "S5WE21TULA",
186
- "3BQKVH9I2X", # ProductionPush,
187
188
  "FUOY7LWJET"
188
189
  ]
189
190
 
@@ -16,7 +16,7 @@ module Spaceship
16
16
 
17
17
  def run
18
18
  begin
19
- puts("Logging into to App Store Connect (#{@username})...")
19
+ puts("Logging into to App Store Connect (#{@username})...") unless Spaceship::Globals.check_session
20
20
  Spaceship::Tunes.login(@username)
21
21
  puts("Successfully logged in to App Store Connect".green)
22
22
  puts("")
@@ -8,22 +8,22 @@ module Spaceship
8
8
  # this version is for
9
9
  attr_accessor :application
10
10
 
11
- # @return (Integer) total number of ratings recevied
11
+ # @return (Integer) total number of ratings received
12
12
  attr_accessor :rating_count
13
13
 
14
- # @return (Integer) total number of one star ratings recevied
14
+ # @return (Integer) total number of one star ratings received
15
15
  attr_accessor :one_star_rating_count
16
16
 
17
- # @return (Integer) total number of two star ratings recevied
17
+ # @return (Integer) total number of two star ratings received
18
18
  attr_accessor :two_star_rating_count
19
19
 
20
- # @return (Integer) total number of three star ratings recevied
20
+ # @return (Integer) total number of three star ratings received
21
21
  attr_accessor :three_star_rating_count
22
22
 
23
- # @return (Integer) total number of four star ratings recevied
23
+ # @return (Integer) total number of four star ratings received
24
24
  attr_accessor :four_star_rating_count
25
25
 
26
- # @return (Integer) total number of five star ratings recevied
26
+ # @return (Integer) total number of five star ratings received
27
27
  attr_accessor :five_star_rating_count
28
28
 
29
29
  attr_mapping({
@@ -7,7 +7,7 @@ module Spaceship
7
7
  attr_accessor :application
8
8
 
9
9
  # Create a new Purchase Family
10
- # a freshly created family has to have atleast one product.
10
+ # a freshly created family has to have at least one product.
11
11
  # the product will be created, and versions/pricing_intervals and so on
12
12
  # should be set by subsequent edit.
13
13
  # @param name (String) Familyname
@@ -14,7 +14,6 @@ require_relative 'app_version_ref'
14
14
  require_relative 'app_version_history'
15
15
  require_relative 'app_version_states_history'
16
16
  require_relative 'transit_app_file'
17
- require_relative 'user_detail'
18
17
  require_relative 'app_screenshot'
19
18
  require_relative 'language_converter'
20
19
  require_relative 'build'