fastlane 2.196.0 → 2.212.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +88 -81
  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/badge.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/danger.rb +14 -0
  18. data/fastlane/lib/fastlane/actions/docs/build_app.md +5 -5
  19. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +19 -2
  20. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  21. data/fastlane/lib/fastlane/actions/docs/run_tests.md +1 -1
  22. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +1 -1
  23. data/fastlane/lib/fastlane/actions/download_dsyms.rb +62 -46
  24. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +15 -4
  25. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +1 -1
  26. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
  27. data/fastlane/lib/fastlane/actions/get_version_number.rb +8 -3
  28. data/fastlane/lib/fastlane/actions/git_commit.rb +4 -6
  29. data/fastlane/lib/fastlane/actions/import_certificate.rb +1 -1
  30. data/fastlane/lib/fastlane/actions/notarize.rb +29 -11
  31. data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +1 -1
  32. data/fastlane/lib/fastlane/actions/pod_push.rb +19 -1
  33. data/fastlane/lib/fastlane/actions/read_podspec.rb +1 -1
  34. data/fastlane/lib/fastlane/actions/run_tests.rb +19 -9
  35. data/fastlane/lib/fastlane/actions/set_github_release.rb +11 -5
  36. data/fastlane/lib/fastlane/actions/setup_ci.rb +13 -4
  37. data/fastlane/lib/fastlane/actions/trainer.rb +49 -0
  38. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +31 -4
  39. data/fastlane/lib/fastlane/actions/update_info_plist.rb +1 -1
  40. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +10 -1
  41. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +1 -1
  42. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
  43. data/fastlane/lib/fastlane/actions/xcode_install.rb +5 -1
  44. data/fastlane/lib/fastlane/actions/xcode_select.rb +1 -1
  45. data/fastlane/lib/fastlane/actions/xcodebuild.rb +8 -2
  46. data/fastlane/lib/fastlane/actions/xcodes.rb +152 -0
  47. data/fastlane/lib/fastlane/actions/xcov.rb +5 -0
  48. data/fastlane/lib/fastlane/actions/xcversion.rb +17 -7
  49. data/fastlane/lib/fastlane/cli_tools_distributor.rb +5 -0
  50. data/fastlane/lib/fastlane/commands_generator.rb +2 -1
  51. data/fastlane/lib/fastlane/documentation/docs_generator.rb +17 -12
  52. data/fastlane/lib/fastlane/fast_file.rb +18 -5
  53. data/fastlane/lib/fastlane/features.rb +3 -0
  54. data/fastlane/lib/fastlane/helper/xcodebuild_formatter_helper.rb +9 -0
  55. data/fastlane/lib/fastlane/helper/xcodes_helper.rb +28 -0
  56. data/fastlane/lib/fastlane/helper/xcversion_helper.rb +0 -9
  57. data/fastlane/lib/fastlane/lane_manager.rb +1 -1
  58. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +1 -1
  59. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +5 -1
  60. data/fastlane/lib/fastlane/setup/setup_ios.rb +1 -1
  61. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +1 -1
  62. data/fastlane/lib/fastlane/swift_lane_manager.rb +11 -3
  63. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +54 -1
  64. data/fastlane/lib/fastlane/tools.rb +18 -1
  65. data/fastlane/lib/fastlane/version.rb +1 -1
  66. data/fastlane/swift/Actions.swift +1 -1
  67. data/fastlane/swift/Appfile.swift +2 -2
  68. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  69. data/fastlane/swift/Atomic.swift +150 -0
  70. data/fastlane/swift/ControlCommand.swift +1 -1
  71. data/fastlane/swift/Deliverfile.swift +2 -2
  72. data/fastlane/swift/DeliverfileProtocol.swift +8 -4
  73. data/fastlane/swift/Fastlane.swift +570 -239
  74. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +30 -20
  75. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +1 -1
  76. data/fastlane/swift/Gymfile.swift +2 -2
  77. data/fastlane/swift/GymfileProtocol.swift +20 -8
  78. data/fastlane/swift/LaneFileProtocol.swift +2 -2
  79. data/fastlane/swift/MainProcess.swift +3 -3
  80. data/fastlane/swift/Matchfile.swift +2 -2
  81. data/fastlane/swift/MatchfileProtocol.swift +21 -5
  82. data/fastlane/swift/OptionalConfigValue.swift +1 -1
  83. data/fastlane/swift/Plugins.swift +1 -1
  84. data/fastlane/swift/Precheckfile.swift +2 -2
  85. data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
  86. data/fastlane/swift/RubyCommand.swift +1 -1
  87. data/fastlane/swift/RubyCommandable.swift +1 -1
  88. data/fastlane/swift/Runner.swift +13 -9
  89. data/fastlane/swift/RunnerArgument.swift +1 -1
  90. data/fastlane/swift/Scanfile.swift +2 -2
  91. data/fastlane/swift/ScanfileProtocol.swift +31 -11
  92. data/fastlane/swift/Screengrabfile.swift +2 -2
  93. data/fastlane/swift/ScreengrabfileProtocol.swift +3 -3
  94. data/fastlane/swift/Snapshotfile.swift +2 -2
  95. data/fastlane/swift/SnapshotfileProtocol.swift +12 -8
  96. data/fastlane/swift/SocketClient.swift +9 -5
  97. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -2
  98. data/fastlane/swift/SocketResponse.swift +1 -1
  99. data/fastlane/swift/formatting/Brewfile.lock.json +46 -23
  100. data/fastlane/swift/main.swift +1 -1
  101. data/fastlane/swift/upgrade_manifest.json +1 -1
  102. data/fastlane_core/README.md +1 -0
  103. data/fastlane_core/lib/fastlane_core/cert_checker.rb +79 -17
  104. data/fastlane_core/lib/fastlane_core/device_manager.rb +5 -1
  105. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +10 -5
  106. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +409 -26
  107. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -0
  108. data/fastlane_core/lib/fastlane_core/project.rb +19 -2
  109. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +7 -0
  110. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +4 -2
  111. data/frameit/lib/frameit/device.rb +1 -1
  112. data/frameit/lib/frameit/device_types.rb +9 -0
  113. data/frameit/lib/frameit/editor.rb +16 -18
  114. data/frameit/lib/frameit/frame_downloader.rb +1 -1
  115. data/frameit/lib/frameit/trim_box.rb +6 -0
  116. data/gym/lib/gym/generators/build_command_generator.rb +70 -23
  117. data/gym/lib/gym/options.rb +30 -5
  118. data/match/lib/match/change_password.rb +2 -0
  119. data/match/lib/match/commands_generator.rb +2 -1
  120. data/match/lib/match/encryption/openssl.rb +1 -1
  121. data/match/lib/match/encryption.rb +3 -0
  122. data/match/lib/match/generator.rb +1 -0
  123. data/match/lib/match/importer.rb +10 -1
  124. data/match/lib/match/migrate.rb +4 -3
  125. data/match/lib/match/module.rb +54 -2
  126. data/match/lib/match/nuke.rb +114 -47
  127. data/match/lib/match/options.rb +22 -1
  128. data/match/lib/match/runner.rb +25 -6
  129. data/match/lib/match/setup.rb +1 -1
  130. data/match/lib/match/spaceship_ensure.rb +5 -2
  131. data/match/lib/match/storage/gitlab/client.rb +102 -0
  132. data/match/lib/match/storage/gitlab/secure_file.rb +65 -0
  133. data/match/lib/match/storage/gitlab_secure_files.rb +182 -0
  134. data/match/lib/match/storage/google_cloud_storage.rb +7 -6
  135. data/match/lib/match/storage/s3_storage.rb +3 -3
  136. data/match/lib/match/storage.rb +4 -0
  137. data/match/lib/match/table_printer.rb +2 -1
  138. data/match/lib/match/utils.rb +15 -2
  139. data/pem/lib/pem/manager.rb +30 -7
  140. data/pem/lib/pem/options.rb +9 -0
  141. data/pilot/lib/pilot/build_manager.rb +34 -14
  142. data/pilot/lib/pilot/options.rb +6 -1
  143. data/scan/lib/scan/detect_values.rb +6 -0
  144. data/scan/lib/scan/error_handler.rb +9 -0
  145. data/scan/lib/scan/options.rb +49 -9
  146. data/scan/lib/scan/runner.rb +171 -25
  147. data/scan/lib/scan/test_command_generator.rb +65 -5
  148. data/sigh/lib/sigh/download_all.rb +14 -2
  149. data/sigh/lib/sigh/module.rb +3 -1
  150. data/sigh/lib/sigh/options.rb +5 -0
  151. data/sigh/lib/sigh/runner.rb +12 -2
  152. data/snapshot/lib/assets/SnapshotHelper.swift +3 -3
  153. data/snapshot/lib/snapshot/latest_os_version.rb +2 -5
  154. data/snapshot/lib/snapshot/options.rb +24 -8
  155. data/snapshot/lib/snapshot/reports_generator.rb +1 -0
  156. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +10 -3
  157. data/snapshot/lib/snapshot/test_command_generator.rb +37 -2
  158. data/spaceship/lib/spaceship/client.rb +71 -40
  159. data/spaceship/lib/spaceship/commands_generator.rb +1 -1
  160. data/spaceship/lib/spaceship/connect_api/api_client.rb +10 -5
  161. data/spaceship/lib/spaceship/connect_api/models/actor.rb +26 -0
  162. data/spaceship/lib/spaceship/connect_api/models/app.rb +52 -6
  163. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  164. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +5 -0
  165. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +7 -0
  166. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +1 -1
  167. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +27 -10
  168. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -2
  169. data/spaceship/lib/spaceship/connect_api/models/build_bundle.rb +68 -0
  170. data/spaceship/lib/spaceship/connect_api/models/build_bundle_file_sizes.rb +34 -0
  171. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +2 -1
  172. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +4 -0
  173. data/spaceship/lib/spaceship/connect_api/models/device.rb +47 -4
  174. data/spaceship/lib/spaceship/connect_api/models/profile.rb +4 -0
  175. data/spaceship/lib/spaceship/connect_api/models/resolution_center_message.rb +29 -0
  176. data/spaceship/lib/spaceship/connect_api/models/resolution_center_thread.rb +67 -0
  177. data/spaceship/lib/spaceship/connect_api/models/review_rejection.rb +19 -0
  178. data/spaceship/lib/spaceship/connect_api/models/review_submission.rb +86 -0
  179. data/spaceship/lib/spaceship/connect_api/models/review_submission_item.rb +40 -0
  180. data/spaceship/lib/spaceship/connect_api/models/user.rb +5 -0
  181. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +19 -0
  182. data/spaceship/lib/spaceship/connect_api/response.rb +23 -6
  183. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +33 -2
  184. data/spaceship/lib/spaceship/connect_api/token.rb +5 -2
  185. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +124 -8
  186. data/spaceship/lib/spaceship/connect_api.rb +9 -0
  187. data/spaceship/lib/spaceship/errors.rb +34 -0
  188. data/spaceship/lib/spaceship/globals.rb +9 -0
  189. data/spaceship/lib/spaceship/hashcash.rb +52 -0
  190. data/spaceship/lib/spaceship/portal/certificate.rb +4 -3
  191. data/spaceship/lib/spaceship/spaceauth_runner.rb +1 -1
  192. data/spaceship/lib/spaceship/tunes/app_ratings.rb +6 -6
  193. data/spaceship/lib/spaceship/tunes/iap_families.rb +1 -1
  194. data/spaceship/lib/spaceship/tunes/tunes.rb +0 -1
  195. data/spaceship/lib/spaceship/tunes/tunes_client.rb +79 -21
  196. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +11 -3
  197. data/spaceship/lib/spaceship.rb +1 -0
  198. data/supply/lib/supply/client.rb +2 -7
  199. data/supply/lib/supply/options.rb +8 -0
  200. data/supply/lib/supply/uploader.rb +6 -2
  201. data/trainer/lib/assets/junit.xml.erb +28 -0
  202. data/trainer/lib/trainer/commands_generator.rb +51 -0
  203. data/trainer/lib/trainer/junit_generator.rb +31 -0
  204. data/trainer/lib/trainer/module.rb +10 -0
  205. data/trainer/lib/trainer/options.rb +66 -0
  206. data/trainer/lib/trainer/test_parser.rb +398 -0
  207. data/trainer/lib/trainer/xcresult.rb +403 -0
  208. data/trainer/lib/trainer.rb +7 -0
  209. metadata +49 -24
  210. data/spaceship/lib/spaceship/connect_api/testflight/.testflight.rb.swp +0 -0
  211. data/spaceship/lib/spaceship/tunes/user_detail.rb +0 -15
@@ -1,6 +1,7 @@
1
1
  require_relative '../model'
2
2
  require_relative './app_preview_set'
3
3
  require_relative './app_screenshot_set'
4
+ require_relative '../../errors'
4
5
 
5
6
  module Spaceship
6
7
  class ConnectAPI
@@ -19,16 +20,16 @@ module Spaceship
19
20
  attr_accessor :app_preview_sets
20
21
 
21
22
  attr_mapping({
22
- "description" => "description",
23
- "locale" => "locale",
24
- "keywords" => "keywords",
25
- "marketingUrl" => "marketing_url",
26
- "promotionalText" => "promotional_text",
27
- "supportUrl" => "support_url",
28
- "whatsNew" => "whats_new",
29
-
30
- "appScreenshotSets" => "app_screenshot_sets",
31
- "appPreviewSets" => "app_preview_sets"
23
+ "description" => "description",
24
+ "locale" => "locale",
25
+ "keywords" => "keywords",
26
+ "marketingUrl" => "marketing_url",
27
+ "promotionalText" => "promotional_text",
28
+ "supportUrl" => "support_url",
29
+ "whatsNew" => "whats_new",
30
+
31
+ "appScreenshotSets" => "app_screenshot_sets",
32
+ "appPreviewSets" => "app_preview_sets"
32
33
  })
33
34
 
34
35
  def self.type
@@ -43,23 +44,31 @@ module Spaceship
43
44
  client ||= Spaceship::ConnectAPI
44
45
  resp = client.get_app_store_version_localization(app_store_version_localization_id: app_store_version_localization_id, filter: filter, includes: includes, limit: limit, sort: sort)
45
46
  return resp.to_models
47
+ rescue
48
+ raise Spaceship::AppStoreLocalizationError, @locale
46
49
  end
47
50
 
48
51
  def self.all(client: nil, app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
49
52
  client ||= Spaceship::ConnectAPI
50
53
  resp = client.get_app_store_version_localizations(app_store_version_id: app_store_version_id, filter: filter, includes: includes, limit: limit, sort: sort)
51
54
  return resp.to_models
55
+ rescue
56
+ raise Spaceship::AppStoreLocalizationError, @locale
52
57
  end
53
58
 
54
59
  def update(client: nil, attributes: nil)
55
60
  client ||= Spaceship::ConnectAPI
56
61
  attributes = reverse_attr_mapping(attributes)
57
62
  client.patch_app_store_version_localization(app_store_version_localization_id: id, attributes: attributes)
63
+ rescue
64
+ raise Spaceship::AppStoreLocalizationError, @locale
58
65
  end
59
66
 
60
67
  def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
61
68
  client ||= Spaceship::ConnectAPI
62
69
  client.delete_app_store_version_localization(app_store_version_localization_id: id)
70
+ rescue
71
+ raise Spaceship::AppStoreLocalizationError, @locale
63
72
  end
64
73
 
65
74
  #
@@ -71,12 +80,16 @@ module Spaceship
71
80
  filter ||= {}
72
81
  filter["appStoreVersionLocalization"] = id
73
82
  return Spaceship::ConnectAPI::AppPreviewSet.all(client: client, filter: filter, includes: includes, limit: limit, sort: sort)
83
+ rescue
84
+ raise Spaceship::AppStoreAppPreviewError, @locale
74
85
  end
75
86
 
76
87
  def create_app_preview_set(client: nil, attributes: nil)
77
88
  client ||= Spaceship::ConnectAPI
78
89
  resp = client.post_app_preview_set(app_store_version_localization_id: id, attributes: attributes)
79
90
  return resp.to_models.first
91
+ rescue
92
+ raise Spaceship::AppStoreAppPreviewError, @locale
80
93
  end
81
94
 
82
95
  #
@@ -86,12 +99,16 @@ module Spaceship
86
99
  def get_app_screenshot_sets(client: nil, filter: {}, includes: "appScreenshots", limit: nil, sort: nil)
87
100
  client ||= Spaceship::ConnectAPI
88
101
  return Spaceship::ConnectAPI::AppScreenshotSet.all(client: client, app_store_version_localization_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
102
+ rescue
103
+ raise Spaceship::AppStoreScreenshotError, @locale
89
104
  end
90
105
 
91
106
  def create_app_screenshot_set(client: nil, attributes: nil)
92
107
  client ||= Spaceship::ConnectAPI
93
108
  resp = client.post_app_screenshot_set(app_store_version_localization_id: id, attributes: attributes)
94
109
  return resp.to_models.first
110
+ rescue
111
+ raise Spaceship::AppStoreScreenshotError, @locale
95
112
  end
96
113
  end
97
114
  end
@@ -19,6 +19,7 @@ module Spaceship
19
19
  attr_accessor :beta_build_metrics
20
20
  attr_accessor :beta_build_localizations
21
21
  attr_accessor :build_beta_detail
22
+ attr_accessor :build_bundles
22
23
  attr_accessor :pre_release_version
23
24
  attr_accessor :individual_testers
24
25
 
@@ -38,10 +39,11 @@ module Spaceship
38
39
  "betaBuildLocalizations" => "beta_build_localizations",
39
40
  "buildBetaDetail" => "build_beta_detail",
40
41
  "preReleaseVersion" => "pre_release_version",
41
- "individualTesters" => "individual_testers"
42
+ "individualTesters" => "individual_testers",
43
+ "buildBundles" => "build_bundles"
42
44
  })
43
45
 
44
- ESSENTIAL_INCLUDES = "app,buildBetaDetail,preReleaseVersion"
46
+ ESSENTIAL_INCLUDES = "app,buildBetaDetail,preReleaseVersion,buildBundles"
45
47
 
46
48
  module ProcessingState
47
49
  PROCESSING = "PROCESSING"
@@ -0,0 +1,68 @@
1
+ require_relative '../model'
2
+ require_relative './build_bundle_file_sizes'
3
+ module Spaceship
4
+ class ConnectAPI
5
+ class BuildBundle
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :bundle_id
9
+ attr_accessor :bundle_type
10
+ attr_accessor :sdk_build
11
+ attr_accessor :platform_build
12
+ attr_accessor :file_name
13
+ attr_accessor :has_siri_kit
14
+ attr_accessor :has_on_demand_resources
15
+ attr_accessor :is_newsstand
16
+ attr_accessor :has_prerendered_icon
17
+ attr_accessor :uses_location_services
18
+ attr_accessor :is_ios_build_mac_app_store_compatible
19
+ attr_accessor :includes_symbols
20
+ attr_accessor :dsym_url
21
+ attr_accessor :supported_architectures
22
+ attr_accessor :required_capabilities
23
+ attr_accessor :device_protocols
24
+ attr_accessor :locales
25
+ attr_accessor :entitlements
26
+ attr_accessor :tracks_users
27
+
28
+ module BundleType
29
+ APP = "APP"
30
+ # APP_CLIP might be in here as well
31
+ end
32
+
33
+ attr_mapping({
34
+ "bundleId" => "bundle_id",
35
+ "bundleType" => "bundle_type",
36
+ "sdkBuild" => "sdk_build",
37
+ "platformBuild" => "platform_build",
38
+ "fileName" => "file_name",
39
+ "hasSirikit" => "has_siri_kit",
40
+ "hasOnDemandResources" => "has_on_demand_resources",
41
+ "isNewsstand" => "is_newsstand",
42
+ "hasPrerenderedIcon" => "has_prerendered_icon",
43
+ "usesLocationServices" => "uses_location_services",
44
+ "isIosBuildMacAppStoreCompatible" => "is_ios_build_mac_app_store_compatible",
45
+ "includesSymbols" => "includes_symbols",
46
+ "dSYMUrl" => "dsym_url",
47
+ "supportedArchitectures" => "supported_architectures",
48
+ "requiredCapabilities" => "required_capabilities",
49
+ "deviceProtocols" => "device_protocols",
50
+ "locales" => "locales",
51
+ "entitlements" => "entitlements",
52
+ "tracksUsers" => "tracks_users"
53
+ })
54
+
55
+ def self.type
56
+ return "buildBundles"
57
+ end
58
+
59
+ #
60
+ # API
61
+ #
62
+
63
+ def build_bundle_file_sizes(client: nil)
64
+ @build_bundle_file_sizes ||= BuildBundleFileSizes.all(client: client, build_bundle_id: id)
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,34 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class BuildBundleFileSizes
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :device_model
8
+ attr_accessor :os_version
9
+ attr_accessor :download_bytes
10
+ attr_accessor :install_bytes
11
+
12
+ attr_mapping({
13
+ "deviceModel" => "device_model",
14
+ "osVersion" => "os_version",
15
+ "downloadBytes" => "download_bytes",
16
+ "installBytes" => "install_bytes"
17
+ })
18
+
19
+ def self.type
20
+ return "buildBundleFileSizes"
21
+ end
22
+
23
+ #
24
+ # API
25
+ #
26
+
27
+ def self.all(client: nil, build_bundle_id: nil, limit: 30)
28
+ client ||= Spaceship::ConnectAPI
29
+ resps = client.get_build_bundles_build_bundle_file_sizes(build_bundle_id: build_bundle_id).all_pages
30
+ resps.flat_map(&:to_models)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -27,7 +27,8 @@ module Spaceship
27
27
  def self.all(client: nil, app_id: nil, version: nil, build_number: nil)
28
28
  client ||= Spaceship::ConnectAPI
29
29
  resps = client.get_build_deliveries(
30
- filter: { app: app_id, cfBundleShortVersionString: version, cfBundleVersion: build_number },
30
+ app_id: app_id,
31
+ filter: { cfBundleShortVersionString: version, cfBundleVersion: build_number },
31
32
  limit: 1
32
33
  ).all_pages
33
34
  return resps.flat_map(&:to_models)
@@ -41,6 +41,10 @@ module Spaceship
41
41
  MAC_APP_DEVELOPMENT = "MAC_APP_DEVELOPMENT"
42
42
  DEVELOPER_ID_KEXT = "DEVELOPER_ID_KEXT"
43
43
  DEVELOPER_ID_APPLICATION = "DEVELOPER_ID_APPLICATION"
44
+ DEVELOPER_ID_APPLICATION_G2 = "DEVELOPER_ID_APPLICATION_G2"
45
+
46
+ # As of 2021-11-09, this is only available with Apple ID auth
47
+ DEVELOPER_ID_INSTALLER = "DEVELOPER_ID_INSTALLER"
44
48
  end
45
49
 
46
50
  def self.type
@@ -29,6 +29,9 @@ module Spaceship
29
29
  IPOD = "IPOD"
30
30
  APPLE_TV = "APPLE_TV"
31
31
  MAC = "MAC"
32
+
33
+ # As of 2022-11-12, this is not officially supported by App Store Connect API
34
+ APPLE_SILICON_MAC = "APPLE_SILICON_MAC"
32
35
  end
33
36
 
34
37
  module Status
@@ -58,7 +61,7 @@ module Spaceship
58
61
  # @param platform [String] The platform of the device.
59
62
  # @param include_disabled [Bool] Whether to include disable devices. false by default.
60
63
  # @return (Device) Find a device based on the UDID of the device. nil if no device was found.
61
- def self.find_by_udid(device_udid, client: nil, platform: nil, include_disabled: false)
64
+ def self.find_by_udid(device_udid, client: nil, include_disabled: false)
62
65
  self.all(client: client).find do |device|
63
66
  device.udid.casecmp(device_udid) == 0 && (include_disabled ? true : device.enabled?)
64
67
  end
@@ -67,10 +70,9 @@ module Spaceship
67
70
  # @param client [ConnectAPI] ConnectAPI client.
68
71
  # @param name [String] The name to be assigned to the device, if it needs to be created.
69
72
  # @param platform [String] The platform of the device.
70
- # @param include_disabled [Bool] Whether to include disable devices. false by default.
71
73
  # @return (Device) Find a device based on the UDID of the device. If no device was found, nil if no device was found.
72
- def self.find_or_create(device_udid, client: nil, name: nil, platform: nil, include_disabled: false)
73
- existing = self.find_by_udid(device_udid, client: client, platform: platform)
74
+ def self.find_or_create(device_udid, client: nil, name: nil, platform: nil)
75
+ existing = self.find_by_udid(device_udid, client: client)
74
76
  return existing if existing
75
77
  return self.create(client: client, name: name, platform: platform, udid: device_udid)
76
78
  end
@@ -85,6 +87,47 @@ module Spaceship
85
87
  resp = client.post_device(name: name, platform: platform, udid: udid)
86
88
  return resp.to_models.first
87
89
  end
90
+
91
+ # @param device_udid [String] Device Provisioning UDID that needs to be modified.
92
+ # @param client [ConnectAPI] ConnectAPI client.
93
+ # @param enabled [Boolean] New enabled value. true - if device must be enabled, `false` - to disable device. nil if no status change needed.
94
+ # @param new_name [String] A new name for the device. nil if no name change needed.
95
+ # @return (Device) Modified device based on the UDID of the device. nil if no device was found.
96
+ def self.modify(device_udid, client: nil, enabled: nil, new_name: nil)
97
+ client ||= Spaceship::ConnectAPI
98
+ existing = self.find_by_udid(device_udid, client: client, include_disabled: true)
99
+ return nil if existing.nil?
100
+
101
+ enabled = existing.enabled? if enabled.nil?
102
+ new_name ||= existing.name
103
+ return existing if existing.name == new_name && existing.enabled? == enabled
104
+ new_status = enabled ? Status::ENABLED : Status::DISABLED
105
+
106
+ resp = client.patch_device(id: existing.id, new_name: new_name, status: new_status)
107
+ return resp.to_models.first
108
+ end
109
+
110
+ # @param device_udid [String] Device Provisioning UDID that needs to be enabled.
111
+ # @param client [ConnectAPI] ConnectAPI client.
112
+ # @return (Device) Modified device based on the UDID of the device. nil if no device was found.
113
+ def self.enable(device_udid, client: nil)
114
+ self.modify(device_udid, client: client, enabled: true)
115
+ end
116
+
117
+ # @param device_udid [String] Device Provisioning UDID that needs to be disabled.
118
+ # @param client [ConnectAPI] ConnectAPI client.
119
+ # @return (Device) Modified device based on the UDID of the device. nil if no device was found.
120
+ def self.disable(device_udid, client: nil)
121
+ self.modify(device_udid, client: client, enabled: false)
122
+ end
123
+
124
+ # @param device_udid [String] Device Provisioning UDID that needs to be renamed.
125
+ # @param new_name [String] A new name for the device.
126
+ # @param client [ConnectAPI] ConnectAPI client.
127
+ # @return (Device) Modified device based on the UDID of the device. nil if no device was found.
128
+ def self.rename(device_udid, new_name, client: nil)
129
+ self.modify(device_udid, client: client, new_name: new_name)
130
+ end
88
131
  end
89
132
  end
90
133
  end
@@ -51,6 +51,10 @@ module Spaceship
51
51
  MAC_CATALYST_APP_DEVELOPMENT = "MAC_CATALYST_APP_DEVELOPMENT"
52
52
  MAC_CATALYST_APP_STORE = "MAC_CATALYST_APP_STORE"
53
53
  MAC_CATALYST_APP_DIRECT = "MAC_CATALYST_APP_DIRECT"
54
+
55
+ # As of 2022-06-25, only available with Apple ID auth
56
+ MAC_APP_INHOUSE = "MAC_APP_INHOUSE"
57
+ MAC_CATALYST_APP_INHOUSE = "MAC_CATALYST_APP_INHOUSE"
54
58
  end
55
59
 
56
60
  def self.type
@@ -0,0 +1,29 @@
1
+ require_relative '../model'
2
+ require_relative './actor'
3
+ require_relative './review_rejection'
4
+
5
+ module Spaceship
6
+ class ConnectAPI
7
+ class ResolutionCenterMessage
8
+ include Spaceship::ConnectAPI::Model
9
+
10
+ attr_accessor :message_body
11
+ attr_accessor :created_date
12
+ attr_accessor :rejections
13
+ attr_accessor :from_actor
14
+
15
+ attr_mapping({
16
+ messageBody: 'message_body',
17
+ createdDate: 'created_date',
18
+
19
+ # includes
20
+ rejections: 'rejections',
21
+ fromActor: 'from_actor'
22
+ })
23
+
24
+ def self.type
25
+ return 'resolutionCenterMessages'
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,67 @@
1
+ require_relative '../model'
2
+
3
+ module Spaceship
4
+ class ConnectAPI
5
+ class ResolutionCenterThread
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :state
9
+ attr_accessor :can_developer_add_node
10
+ attr_accessor :objectionable_content
11
+ attr_accessor :thread_type
12
+ attr_accessor :created_date
13
+ attr_accessor :last_message_response_date
14
+
15
+ attr_accessor :resolution_center_messages
16
+ attr_accessor :app_store_version
17
+
18
+ module ThreadType
19
+ REJECTION_BINARY = 'REJECTION_BINARY'
20
+ REJECTION_METADATA = 'REJECTION_METADATA'
21
+ REJECTION_REVIEW_SUBMISSION = 'REJECTION_REVIEW_SUBMISSION'
22
+ APP_MESSAGE_ARC = 'APP_MESSAGE_ARC'
23
+ APP_MESSAGE_ARB = 'APP_MESSAGE_ARB'
24
+ APP_MESSAGE_COMM = 'APP_MESSAGE_COMM'
25
+ end
26
+
27
+ attr_mapping({
28
+ state: 'state',
29
+ canDeveloperAddNote: 'can_developer_add_node',
30
+ objectionableContent: 'objectionable_content',
31
+ threadType: 'thread_type',
32
+ createdDate: 'created_date',
33
+ lastMessageResponseDate: 'last_message_response_date',
34
+
35
+ # includes
36
+ resolutionCenterMessages: 'resolution_center_messages',
37
+ appStoreVersion: 'app_store_version'
38
+ })
39
+
40
+ def self.type
41
+ return "resolutionCenterThreads"
42
+ end
43
+
44
+ #
45
+ # API
46
+ #
47
+
48
+ def self.all(client: nil, filter:, includes: nil)
49
+ client ||= Spaceship::ConnectAPI
50
+ resps = client.get_resolution_center_threads(filter: filter, includes: includes).all_pages
51
+ return resps.flat_map(&:to_models)
52
+ end
53
+
54
+ def fetch_messages(client: nil, filter: {}, includes: nil)
55
+ client ||= Spaceship::ConnectAPI
56
+ resps = client.get_resolution_center_messages(thread_id: id, filter: filter, includes: includes).all_pages
57
+ return resps.flat_map(&:to_models)
58
+ end
59
+
60
+ def fetch_rejection_reasons(client: nil, includes: nil)
61
+ client ||= Spaceship::ConnectAPI
62
+ resp = client.get_review_rejection(filter: { 'resolutionCenterMessage.resolutionCenterThread': id }, includes: includes)
63
+ return resp.to_models
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,19 @@
1
+ require_relative '../model'
2
+
3
+ module Spaceship
4
+ class ConnectAPI
5
+ class ReviewRejection
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :reasons
9
+
10
+ attr_mapping({
11
+ reasons: 'reasons'
12
+ })
13
+
14
+ def self.type
15
+ return 'reviewRejections'
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,86 @@
1
+ require_relative '../model'
2
+ require_relative './review_submission_item'
3
+
4
+ module Spaceship
5
+ class ConnectAPI
6
+ class ReviewSubmission
7
+ include Spaceship::ConnectAPI::Model
8
+
9
+ attr_accessor :platform
10
+ attr_accessor :state
11
+ attr_accessor :submitted_date
12
+
13
+ attr_accessor :app_store_version_for_review
14
+ attr_accessor :items
15
+ attr_accessor :last_updated_by_actor
16
+ attr_accessor :submitted_by_actor
17
+
18
+ module ReviewSubmissionState
19
+ CANCELING = "CANCELING"
20
+ COMPLETE = "COMPLETE"
21
+ IN_REVIEW = "IN_REVIEW"
22
+ READY_FOR_REVIEW = "READY_FOR_REVIEW"
23
+ UNRESOLVED_ISSUES = "UNRESOLVED_ISSUES"
24
+ WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
25
+ end
26
+
27
+ attr_mapping({
28
+ "platform" => "platform",
29
+ "state" => "state",
30
+ "submittedDate" => "submitted_date",
31
+
32
+ "appStoreVersionForReview" => "app_store_version_for_review",
33
+ "items" => "items",
34
+ "lastUpdatedByActor" => "last_updated_by_actor",
35
+ "submittedByActor" => "submitted_by_actor",
36
+ })
37
+
38
+ def self.type
39
+ return "reviewSubmissions"
40
+ end
41
+
42
+ #
43
+ # API
44
+ #
45
+
46
+ # appStoreVersionForReview,items,submittedByActor,lastUpdatedByActor
47
+ def self.get(client: nil, review_submission_id:, includes: nil)
48
+ client ||= Spaceship::ConnectAPI
49
+ resp = client.get_review_submission(review_submission_id: review_submission_id, includes: includes)
50
+ return resp.to_models.first
51
+ end
52
+
53
+ def submit_for_review(client: nil)
54
+ client ||= Spaceship::ConnectAPI
55
+ attributes = { submitted: true }
56
+ resp = client.patch_review_submission(review_submission_id: id, attributes: attributes)
57
+ return resp.to_models.first
58
+ end
59
+
60
+ def cancel_submission(client: nil)
61
+ client ||= Spaceship::ConnectAPI
62
+ attributes = { canceled: true }
63
+ resp = client.patch_review_submission(review_submission_id: id, attributes: attributes)
64
+ return resp.to_models.first
65
+ end
66
+
67
+ def add_app_store_version_to_review_items(client: nil, app_store_version_id:)
68
+ client ||= Spaceship::ConnectAPI
69
+ resp = client.post_review_submission_item(review_submission_id: id, app_store_version_id: app_store_version_id)
70
+ return resp.to_models.first
71
+ end
72
+
73
+ def fetch_resolution_center_threads(client: nil)
74
+ client ||= Spaceship::ConnectAPI
75
+ resp = client.get_resolution_center_threads(filter: { reviewSubmission: id }, includes: 'reviewSubmission')
76
+ return resp.to_models
77
+ end
78
+
79
+ def latest_resolution_center_messages(client: nil)
80
+ client ||= Spaceship::ConnectAPI
81
+ threads = fetch_resolution_center_threads(client: client)
82
+ threads.first.fetch_messages(client: client)
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,40 @@
1
+ require_relative '../model'
2
+
3
+ module Spaceship
4
+ class ConnectAPI
5
+ class ReviewSubmissionItem
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :state
9
+
10
+ attr_accessor :app_store_version_experiment
11
+ attr_accessor :app_store_version
12
+ attr_accessor :app_store_product_page_version
13
+ attr_accessor :app_event
14
+
15
+ attr_mapping({
16
+ "state" => "state",
17
+
18
+ "appStoreVersionExperiment" => "app_store_version_experiment",
19
+ "appStoreVersion" => "app_store_version",
20
+ "appCustomProductPageVersion" => "app_store_product_page_version",
21
+ "appEvent" => "app_event",
22
+ })
23
+
24
+ def self.type
25
+ return "reviewSubmissionItems"
26
+ end
27
+
28
+ #
29
+ # API
30
+ #
31
+
32
+ # appCustomProductPageVersion,appEvent,appStoreVersion,appStoreVersionExperiment
33
+ def self.all(client: nil, review_submission_id:, includes: nil, limit: nil, sort: nil)
34
+ client ||= Spaceship::ConnectAPI
35
+ resps = client.get_review_submission_items(review_submission_id: review_submission_id, includes: includes, limit: limit, sort: sort).all_pages
36
+ return resps.flat_map(&:to_models)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -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
  #