fastlane 2.164.0 → 2.169.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +80 -80
  3. data/cert/lib/cert/.options.rb.swp +0 -0
  4. data/cert/lib/cert/.runner.rb.swp +0 -0
  5. data/cert/lib/cert/options.rb +3 -3
  6. data/cert/lib/cert/runner.rb +2 -2
  7. data/deliver/lib/deliver/app_screenshot.rb +6 -2
  8. data/deliver/lib/deliver/loader.rb +136 -18
  9. data/deliver/lib/deliver/upload_metadata.rb +4 -10
  10. data/deliver/lib/deliver/upload_screenshots.rb +1 -64
  11. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  12. data/fastlane/lib/fastlane/actions/actions_helper.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/add_git_tag.rb +9 -2
  14. data/fastlane/lib/fastlane/actions/appledoc.rb +1 -1
  15. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +4 -0
  16. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  17. data/fastlane/lib/fastlane/actions/slather.rb +2 -2
  18. data/fastlane/lib/fastlane/actions/spm.rb +6 -0
  19. data/fastlane/lib/fastlane/actions/update_fastlane.rb +29 -8
  20. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -3
  21. data/fastlane/lib/fastlane/actions/xcode_install.rb +8 -5
  22. data/fastlane/lib/fastlane/cli_tools_distributor.rb +2 -2
  23. data/fastlane/lib/fastlane/features.rb +1 -1
  24. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -0
  25. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  26. data/fastlane/lib/fastlane/version.rb +1 -1
  27. data/fastlane/swift/Deliverfile.swift +1 -1
  28. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  29. data/fastlane/swift/Fastfile.swift +1 -1
  30. data/fastlane/swift/Fastlane.swift +56 -26
  31. data/fastlane/swift/Gymfile.swift +1 -1
  32. data/fastlane/swift/GymfileProtocol.swift +5 -1
  33. data/fastlane/swift/LaneFileProtocol.swift +2 -2
  34. data/fastlane/swift/MainProcess.swift +2 -0
  35. data/fastlane/swift/Matchfile.swift +1 -1
  36. data/fastlane/swift/MatchfileProtocol.swift +4 -4
  37. data/fastlane/swift/Precheckfile.swift +1 -1
  38. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  39. data/fastlane/swift/Runner.swift +1 -1
  40. data/fastlane/swift/Scanfile.swift +1 -1
  41. data/fastlane/swift/ScanfileProtocol.swift +9 -1
  42. data/fastlane/swift/Screengrabfile.swift +1 -1
  43. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  44. data/fastlane/swift/Snapshotfile.swift +1 -1
  45. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  46. data/fastlane/swift/SocketClient.swift +1 -1
  47. data/fastlane_core/lib/fastlane_core/cert_checker.rb +12 -7
  48. data/fastlane_core/lib/fastlane_core/helper.rb +10 -2
  49. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -3
  50. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +3 -1
  51. data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +8 -0
  52. data/gym/lib/gym/code_signing_mapping.rb +1 -1
  53. data/gym/lib/gym/generators/build_command_generator.rb +1 -0
  54. data/gym/lib/gym/options.rb +7 -1
  55. data/match/lib/match/.options.rb.swp +0 -0
  56. data/match/lib/match/module.rb +1 -1
  57. data/match/lib/match/nuke.rb +9 -5
  58. data/match/lib/match/options.rb +2 -2
  59. data/pilot/lib/pilot/build_manager.rb +9 -3
  60. data/scan/lib/scan/detect_values.rb +3 -1
  61. data/scan/lib/scan/module.rb +4 -0
  62. data/scan/lib/scan/options.rb +16 -1
  63. data/scan/lib/scan/runner.rb +2 -2
  64. data/scan/lib/scan/test_command_generator.rb +1 -0
  65. data/{match/lib/match/.commands_generator.rb.swp → sigh/lib/sigh/.options.rb.swp} +0 -0
  66. data/sigh/lib/sigh/runner.rb +2 -2
  67. data/snapshot/lib/assets/SnapshotHelper.swift +5 -1
  68. data/snapshot/lib/snapshot/test_command_generator.rb +1 -1
  69. data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
  70. data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +1 -1
  71. data/spaceship/lib/spaceship/client.rb +14 -0
  72. data/spaceship/lib/spaceship/connect_api.rb +2 -0
  73. data/spaceship/lib/spaceship/connect_api/client.rb +7 -4
  74. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +3 -2
  75. data/spaceship/lib/spaceship/connect_api/models/app.rb +139 -54
  76. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +16 -10
  77. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +8 -4
  78. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +15 -11
  79. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +13 -9
  80. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +9 -7
  81. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +15 -11
  82. data/spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb +7 -5
  83. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +6 -4
  84. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +55 -36
  85. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +21 -14
  86. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +3 -2
  87. data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +3 -2
  88. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +6 -4
  89. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +12 -2
  90. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +12 -8
  91. data/spaceship/lib/spaceship/connect_api/models/build.rb +24 -16
  92. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +3 -2
  93. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +9 -6
  94. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +6 -4
  95. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +12 -8
  96. data/spaceship/lib/spaceship/connect_api/models/custom_app_organization.rb +43 -0
  97. data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
  98. data/spaceship/lib/spaceship/connect_api/models/device.rb +6 -4
  99. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +6 -4
  100. data/spaceship/lib/spaceship/connect_api/models/profile.rb +12 -8
  101. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +3 -2
  102. data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +9 -6
  103. data/spaceship/lib/spaceship/connect_api/models/territory.rb +3 -2
  104. data/spaceship/lib/spaceship/connect_api/models/user.rb +6 -4
  105. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +9 -6
  106. data/spaceship/lib/spaceship/connect_api/spaceship.rb +7 -4
  107. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  108. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +71 -0
  109. data/spaceship/lib/spaceship/errors.rb +19 -0
  110. data/spaceship/lib/spaceship/tunes/iap_detail.rb +1 -1
  111. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  112. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +18 -6
  113. data/supply/lib/supply.rb +1 -1
  114. data/supply/lib/supply/options.rb +1 -1
  115. data/supply/lib/supply/uploader.rb +3 -2
  116. metadata +26 -22
  117. data/match/lib/match/.importer.rb.swp +0 -0
@@ -24,6 +24,7 @@ module Spaceship
24
24
  IN_REVIEW = "IN_REVIEW"
25
25
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
26
26
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
27
+ DEVELOPER_REMOVED_FROM_SALE = "DEVELOPER_REMOVED_FROM_SALE"
27
28
  REJECTED = "REJECTED"
28
29
  PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
29
30
  METADATA_REJECTED = "METADATA_REJECTED"
@@ -65,29 +66,34 @@ module Spaceship
65
66
  # API
66
67
  #
67
68
 
68
- def update(filter: {}, includes: nil, limit: nil, sort: nil)
69
- Spaceship::ConnectAPI.patch_app_info(app_info_id: id).first
69
+ def update(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
70
+ client ||= Spaceship::ConnectAPI
71
+ client.patch_app_info(app_info_id: id).first
70
72
  end
71
73
 
72
- def update_categories(category_id_map: nil)
73
- Spaceship::ConnectAPI.patch_app_info_categories(app_info_id: id, category_id_map: category_id_map).first
74
+ def update_categories(client: nil, category_id_map: nil)
75
+ client ||= Spaceship::ConnectAPI
76
+ client.patch_app_info_categories(app_info_id: id, category_id_map: category_id_map).first
74
77
  end
75
78
 
76
- def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
77
- Spaceship::ConnectAPI.delete_app_info(app_info_id: id)
79
+ def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
80
+ client ||= Spaceship::ConnectAPI
81
+ client.delete_app_info(app_info_id: id)
78
82
  end
79
83
 
80
84
  #
81
85
  # App Info Localizations
82
86
  #
83
87
 
84
- def create_app_info_localization(attributes: nil)
85
- resp = Spaceship::ConnectAPI.post_app_info_localization(app_info_id: id, attributes: attributes)
88
+ def create_app_info_localization(client: nil, attributes: nil)
89
+ client ||= Spaceship::ConnectAPI
90
+ resp = client.post_app_info_localization(app_info_id: id, attributes: attributes)
86
91
  return resp.to_models.first
87
92
  end
88
93
 
89
- def get_app_info_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
90
- resp = Spaceship::ConnectAPI.get_app_info_localizations(app_info_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
94
+ def get_app_info_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
95
+ client ||= Spaceship::ConnectAPI
96
+ resp = client.get_app_info_localizations(app_info_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
91
97
  return resp.to_models
92
98
  end
93
99
  end
@@ -8,6 +8,7 @@ module Spaceship
8
8
  attr_accessor :name
9
9
  attr_accessor :subtitle
10
10
  attr_accessor :privacy_policy_url
11
+ attr_accessor :privacy_choices_url
11
12
  attr_accessor :privacy_policy_text
12
13
 
13
14
  attr_mapping({
@@ -15,6 +16,7 @@ module Spaceship
15
16
  "name" => "name",
16
17
  "subtitle" => "subtitle",
17
18
  "privacyPolicyUrl" => "privacy_policy_url",
19
+ "privacyChoicesUrl" => "privacy_choices_url",
18
20
  "privacyPolicyText" => "privacy_policy_text"
19
21
  })
20
22
 
@@ -26,13 +28,15 @@ module Spaceship
26
28
  # API
27
29
  #
28
30
 
29
- def update(attributes: nil)
31
+ def update(client: nil, attributes: nil)
32
+ client ||= Spaceship::ConnectAPI
30
33
  attributes = reverse_attr_mapping(attributes)
31
- Spaceship::ConnectAPI.patch_app_info_localization(app_info_localization_id: id, attributes: attributes)
34
+ client.patch_app_info_localization(app_info_localization_id: id, attributes: attributes)
32
35
  end
33
36
 
34
- def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
35
- Spaceship::ConnectAPI.delete_app_info_localization(app_info_localization_id: id)
37
+ def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
38
+ client ||= Spaceship::ConnectAPI
39
+ client.delete_app_info_localization(app_info_localization_id: id)
36
40
  end
37
41
  end
38
42
  end
@@ -45,8 +45,9 @@ module Spaceship
45
45
  # API
46
46
  #
47
47
 
48
- def self.get(app_preview_id: nil)
49
- Spaceship::ConnectAPI.get_app_preview(app_preview_id: app_preview_id).first
48
+ def self.get(client: nil, app_preview_id: nil)
49
+ client ||= Spaceship::ConnectAPI
50
+ client.get_app_preview(app_preview_id: app_preview_id).first
50
51
  end
51
52
 
52
53
  # Creates an AppPreview in an AppPreviewSet
@@ -54,7 +55,8 @@ module Spaceship
54
55
  # @param app_preview_set_id The AppPreviewSet id
55
56
  # @param path The path of the file
56
57
  # @param frame_time_code The time code for the preview still frame (ex: "00:00:07:01")
57
- def self.create(app_preview_set_id: nil, path: nil, wait_for_processing: true, frame_time_code: nil)
58
+ def self.create(client: nil, app_preview_set_id: nil, path: nil, wait_for_processing: true, frame_time_code: nil)
59
+ client ||= Spaceship::ConnectAPI
58
60
  require 'faraday'
59
61
 
60
62
  filename = File.basename(path)
@@ -67,7 +69,7 @@ module Spaceship
67
69
  }
68
70
 
69
71
  # Create placeholder
70
- preview = Spaceship::ConnectAPI.post_app_preview(
72
+ preview = client.post_app_preview(
71
73
  app_preview_set_id: app_preview_set_id,
72
74
  attributes: post_attributes
73
75
  ).first
@@ -83,14 +85,14 @@ module Spaceship
83
85
  }
84
86
 
85
87
  begin
86
- preview = Spaceship::ConnectAPI.patch_app_preview(
88
+ preview = client.patch_app_preview(
87
89
  app_preview_id: preview.id,
88
90
  attributes: patch_attributes
89
91
  ).first
90
92
  rescue => error
91
93
  puts("Failed to patch app preview. Update may have gone through so verifying") if Spaceship::Globals.verbose?
92
94
 
93
- preview = Spaceship::ConnectAPI::AppPreview.get(app_preview_id: preview.id)
95
+ preview = Spaceship::ConnectAPI::AppPreview.get(client: client, app_preview_id: preview.id)
94
96
  raise error unless preview.complete?
95
97
  end
96
98
 
@@ -111,20 +113,22 @@ module Spaceship
111
113
  puts("Waiting #{sleep_time} seconds before checking status of processing...") if Spaceship::Globals.verbose?
112
114
  sleep(sleep_time)
113
115
 
114
- preview = Spaceship::ConnectAPI::AppPreview.get(app_preview_id: preview.id)
116
+ preview = Spaceship::ConnectAPI::AppPreview.get(client: client, app_preview_id: preview.id)
115
117
  end
116
118
  end
117
119
 
118
120
  preview
119
121
  end
120
122
 
121
- def update(attributes: nil)
123
+ def update(client: nil, attributes: nil)
124
+ client ||= Spaceship::ConnectAPI
122
125
  attributes = reverse_attr_mapping(attributes)
123
- Spaceship::ConnectAPI.patch_app_preview(app_preview_id: id, attributes: attributes).first
126
+ client.patch_app_preview(app_preview_id: id, attributes: attributes).first
124
127
  end
125
128
 
126
- def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
127
- Spaceship::ConnectAPI.delete_app_preview(app_preview_id: id)
129
+ def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
130
+ client ||= Spaceship::ConnectAPI
131
+ client.delete_app_preview(app_preview_id: id)
128
132
  end
129
133
  end
130
134
  end
@@ -58,18 +58,21 @@ module Spaceship
58
58
  # API
59
59
  #
60
60
 
61
- def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
62
- resp = Spaceship::ConnectAPI.get_app_preview_sets(filter: filter, includes: includes, limit: limit, sort: sort)
61
+ def self.all(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
62
+ client ||= Spaceship::ConnectAPI
63
+ resp = client.get_app_preview_sets(filter: filter, includes: includes, limit: limit, sort: sort)
63
64
  return resp.to_models
64
65
  end
65
66
 
66
- def self.get(app_preview_set_id: nil, includes: "appPreviews")
67
- return Spaceship::ConnectAPI.get_app_preview_set(app_preview_set_id: app_preview_set_id, filter: nil, includes: includes, limit: nil, sort: nil).first
67
+ def self.get(client: nil, app_preview_set_id: nil, includes: "appPreviews")
68
+ client ||= Spaceship::ConnectAPI
69
+ return client.get_app_preview_set(app_preview_set_id: app_preview_set_id, filter: nil, includes: includes, limit: nil, sort: nil).first
68
70
  end
69
71
 
70
- def upload_preview(path: nil, wait_for_processing: true, position: nil, frame_time_code: nil)
72
+ def upload_preview(client: nil, path: nil, wait_for_processing: true, position: nil, frame_time_code: nil)
73
+ client ||= Spaceship::ConnectAPI
71
74
  # Upload preview
72
- preview = Spaceship::ConnectAPI::AppPreview.create(app_preview_set_id: id, path: path, wait_for_processing: wait_for_processing, frame_time_code: frame_time_code)
75
+ preview = Spaceship::ConnectAPI::AppPreview.create(client: client, app_preview_set_id: id, path: path, wait_for_processing: wait_for_processing, frame_time_code: frame_time_code)
73
76
 
74
77
  # Reposition (if specified)
75
78
  unless position.nil?
@@ -90,10 +93,11 @@ module Spaceship
90
93
  return preview
91
94
  end
92
95
 
93
- def reorder_previews(app_preview_ids: nil)
94
- Spaceship::ConnectAPI.patch_app_preview_set_previews(app_preview_set_id: id, app_preview_ids: app_preview_ids)
96
+ def reorder_previews(client: nil, app_preview_ids: nil)
97
+ client ||= Spaceship::ConnectAPI
98
+ client.patch_app_preview_set_previews(app_preview_set_id: id, app_preview_ids: app_preview_ids)
95
99
 
96
- return Spaceship::ConnectAPI.get_app_preview_set(app_preview_set_id: id, includes: "appPreviews").first
100
+ return client.get_app_preview_set(app_preview_set_id: id, includes: "appPreviews").first
97
101
  end
98
102
  end
99
103
  end
@@ -79,7 +79,8 @@ module Spaceship
79
79
  #
80
80
  #
81
81
 
82
- def self.create(app_screenshot_set_id: nil, path: nil, wait_for_processing: true)
82
+ def self.create(client: nil, app_screenshot_set_id: nil, path: nil, wait_for_processing: true)
83
+ client ||= Spaceship::ConnectAPI
83
84
  require 'faraday'
84
85
 
85
86
  filename = File.basename(path)
@@ -93,7 +94,7 @@ module Spaceship
93
94
 
94
95
  # Create placeholder to upload screenshot
95
96
  begin
96
- screenshot = Spaceship::ConnectAPI.post_app_screenshot(
97
+ screenshot = client.post_app_screenshot(
97
98
  app_screenshot_set_id: app_screenshot_set_id,
98
99
  attributes: post_attributes
99
100
  ).first
@@ -117,7 +118,7 @@ module Spaceship
117
118
  sleep(30)
118
119
 
119
120
  screenshots = Spaceship::ConnectAPI::AppScreenshotSet
120
- .get(app_screenshot_set_id: app_screenshot_set_id)
121
+ .get(client: client, app_screenshot_set_id: app_screenshot_set_id)
121
122
  .app_screenshots
122
123
 
123
124
  screenshot = screenshots.find do |s|
@@ -152,7 +153,7 @@ module Spaceship
152
153
  rescue => error
153
154
  puts("Failed to patch app screenshot. Update may have gone through so verifying") if Spaceship::Globals.verbose?
154
155
 
155
- screenshot = Spaceship::ConnectAPI.get_app_screenshot(app_screenshot_id: screenshot.id).first
156
+ screenshot = client.get_app_screenshot(app_screenshot_id: screenshot.id).first
156
157
  raise error unless screenshot.complete?
157
158
  end
158
159
 
@@ -172,15 +173,16 @@ module Spaceship
172
173
  puts("Waiting #{sleep_time} seconds before checking status of processing...") if Spaceship::Globals.verbose?
173
174
  sleep(sleep_time)
174
175
 
175
- screenshot = Spaceship::ConnectAPI.get_app_screenshot(app_screenshot_id: screenshot.id).first
176
+ screenshot = client.get_app_screenshot(app_screenshot_id: screenshot.id).first
176
177
  end
177
178
  end
178
179
 
179
180
  return screenshot
180
181
  end
181
182
 
182
- def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
183
- Spaceship::ConnectAPI.delete_app_screenshot(app_screenshot_id: id)
183
+ def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
184
+ client ||= Spaceship::ConnectAPI
185
+ client.delete_app_screenshot(app_screenshot_id: id)
184
186
  end
185
187
  end
186
188
  end
@@ -112,22 +112,25 @@ module Spaceship
112
112
  # API
113
113
  #
114
114
 
115
- def self.all(app_store_version_localization_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
116
- resp = Spaceship::ConnectAPI.get_app_screenshot_sets(app_store_version_localization_id: app_store_version_localization_id, filter: filter, includes: includes, limit: limit, sort: sort)
115
+ def self.all(client: nil, app_store_version_localization_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
116
+ client ||= Spaceship::ConnectAPI
117
+ resp = client.get_app_screenshot_sets(app_store_version_localization_id: app_store_version_localization_id, filter: filter, includes: includes, limit: limit, sort: sort)
117
118
  return resp.to_models
118
119
  end
119
120
 
120
- def self.get(app_screenshot_set_id: nil, includes: "appScreenshots")
121
- return Spaceship::ConnectAPI.get_app_screenshot_set(app_screenshot_set_id: app_screenshot_set_id, filter: nil, includes: includes, limit: nil, sort: nil).first
121
+ def self.get(client: nil, app_screenshot_set_id: nil, includes: "appScreenshots")
122
+ client ||= Spaceship::ConnectAPI
123
+ return client.get_app_screenshot_set(app_screenshot_set_id: app_screenshot_set_id, filter: nil, includes: includes, limit: nil, sort: nil).first
122
124
  end
123
125
 
124
- def upload_screenshot(path: nil, wait_for_processing: true, position: nil)
125
- screenshot = Spaceship::ConnectAPI::AppScreenshot.create(app_screenshot_set_id: id, path: path, wait_for_processing: wait_for_processing)
126
+ def upload_screenshot(client: nil, path: nil, wait_for_processing: true, position: nil)
127
+ client ||= Spaceship::ConnectAPI
128
+ screenshot = Spaceship::ConnectAPI::AppScreenshot.create(client: client, app_screenshot_set_id: id, path: path, wait_for_processing: wait_for_processing)
126
129
 
127
130
  # Reposition (if specified)
128
131
  unless position.nil?
129
132
  # Get all app preview ids
130
- set = AppScreenshotSet.get(app_screenshot_set_id: id)
133
+ set = AppScreenshotSet.get(client: client, app_screenshot_set_id: id)
131
134
  app_screenshot_ids = set.app_screenshots.map(&:id)
132
135
 
133
136
  # Remove new uploaded screenshot
@@ -137,16 +140,17 @@ module Spaceship
137
140
  app_screenshot_ids = app_screenshot_ids.insert(position, screenshot.id).compact
138
141
 
139
142
  # Reorder screenshots
140
- reorder_screenshots(app_screenshot_ids: app_screenshot_ids)
143
+ reorder_screenshots(client: client, app_screenshot_ids: app_screenshot_ids)
141
144
  end
142
145
 
143
146
  return screenshot
144
147
  end
145
148
 
146
- def reorder_screenshots(app_screenshot_ids: nil)
147
- Spaceship::ConnectAPI.patch_app_screenshot_set_screenshots(app_screenshot_set_id: id, app_screenshot_ids: app_screenshot_ids)
149
+ def reorder_screenshots(client: nil, app_screenshot_ids: nil)
150
+ client ||= Spaceship::ConnectAPI
151
+ client.patch_app_screenshot_set_screenshots(app_screenshot_set_id: id, app_screenshot_ids: app_screenshot_ids)
148
152
 
149
- return Spaceship::ConnectAPI.get_app_screenshot_set(app_screenshot_set_id: id, includes: "appScreenshots").first
153
+ return client.get_app_screenshot_set(app_screenshot_set_id: id, includes: "appScreenshots").first
150
154
  end
151
155
  end
152
156
  end
@@ -29,7 +29,8 @@ module Spaceship
29
29
  # API
30
30
  #
31
31
 
32
- def self.create(app_store_review_detail_id: nil, path: nil)
32
+ def self.create(client: nil, app_store_review_detail_id: nil, path: nil)
33
+ client ||= Spaceship::ConnectAPI
33
34
  require 'faraday'
34
35
 
35
36
  filename = File.basename(path)
@@ -42,7 +43,7 @@ module Spaceship
42
43
  }
43
44
 
44
45
  # Create placeholder
45
- attachment = Spaceship::ConnectAPI.post_app_store_review_attachment(
46
+ attachment = client.post_app_store_review_attachment(
46
47
  app_store_review_detail_id: app_store_review_detail_id,
47
48
  attributes: post_attributes
48
49
  ).to_models.first
@@ -57,14 +58,15 @@ module Spaceship
57
58
  sourceFileChecksum: Digest::MD5.hexdigest(bytes)
58
59
  }
59
60
 
60
- Spaceship::ConnectAPI.patch_app_store_review_attachment(
61
+ client.patch_app_store_review_attachment(
61
62
  app_store_review_attachment_id: attachment.id,
62
63
  attributes: patch_attributes
63
64
  ).to_models.first
64
65
  end
65
66
 
66
- def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
67
- Spaceship::ConnectAPI.delete_app_store_review_attachment(app_store_review_attachment_id: id)
67
+ def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
68
+ client ||= Spaceship::ConnectAPI
69
+ client.delete_app_store_review_attachment(app_store_review_attachment_id: id)
68
70
  end
69
71
  end
70
72
  end
@@ -38,13 +38,15 @@ module Spaceship
38
38
  # API
39
39
  #
40
40
 
41
- def update(attributes: nil)
41
+ def update(client: nil, attributes: nil)
42
+ client ||= Spaceship::ConnectAPI
42
43
  attributes = reverse_attr_mapping(attributes)
43
- return Spaceship::ConnectAPI.patch_app_store_review_detail(app_store_review_detail_id: id, attributes: attributes)
44
+ return client.patch_app_store_review_detail(app_store_review_detail_id: id, attributes: attributes)
44
45
  end
45
46
 
46
- def upload_attachment(path: nil)
47
- return Spaceship::ConnectAPI::AppStoreReviewAttachment.create(app_store_review_detail_id: id, path: path)
47
+ def upload_attachment(client: nil, path: nil)
48
+ client ||= Spaceship::ConnectAPI
49
+ return client::AppStoreReviewAttachment.create(app_store_review_detail_id: id, path: path)
48
50
  end
49
51
  end
50
52
  end
@@ -30,6 +30,7 @@ module Spaceship
30
30
  IN_REVIEW = "IN_REVIEW"
31
31
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
32
32
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
33
+ DEVELOPER_REMOVED_FROM_SALE = "DEVELOPER_REMOVED_FROM_SALE"
33
34
  REJECTED = "REJECTED"
34
35
  PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
35
36
  METADATA_REJECTED = "METADATA_REJECTED"
@@ -85,24 +86,27 @@ module Spaceship
85
86
  #
86
87
 
87
88
  # app,routingAppCoverage,resetRatingsRequest,appStoreVersionSubmission,appStoreVersionPhasedRelease,ageRatingDeclaration,appStoreReviewDetail,idfaDeclaration,gameCenterConfiguration
88
- def self.get(app_store_version_id: nil, includes: nil, limit: nil, sort: nil)
89
- return Spaceship::ConnectAPI.get_app_store_version(
89
+ def self.get(client: nil, app_store_version_id: nil, includes: nil, limit: nil, sort: nil)
90
+ client ||= Spaceship::ConnectAPI
91
+ return client.get_app_store_version(
90
92
  app_store_version_id: app_store_version_id,
91
93
  includes: includes
92
94
  ).first
93
95
  end
94
96
 
95
- def update(attributes: nil)
97
+ def update(client: nil, attributes: nil)
98
+ client ||= Spaceship::ConnectAPI
96
99
  attributes = reverse_attr_mapping(attributes)
97
- return Spaceship::ConnectAPI.patch_app_store_version(app_store_version_id: id, attributes: attributes).first
100
+ return client.patch_app_store_version(app_store_version_id: id, attributes: attributes).first
98
101
  end
99
102
 
100
103
  #
101
104
  # Age Rating Declaration
102
105
  #
103
106
 
104
- def fetch_age_rating_declaration
105
- resp = Spaceship::ConnectAPI.get_age_rating_declaration(app_store_version_id: id)
107
+ def fetch_age_rating_declaration(client: nil)
108
+ client ||= Spaceship::ConnectAPI
109
+ resp = client.get_age_rating_declaration(app_store_version_id: id)
106
110
  return resp.to_models.first
107
111
  end
108
112
 
@@ -110,27 +114,31 @@ module Spaceship
110
114
  # App Store Version Localizations
111
115
  #
112
116
 
113
- def create_app_store_version_localization(attributes: nil)
114
- resp = Spaceship::ConnectAPI.post_app_store_version_localization(app_store_version_id: id, attributes: attributes)
117
+ def create_app_store_version_localization(client: nil, attributes: nil)
118
+ client ||= Spaceship::ConnectAPI
119
+ resp = client.post_app_store_version_localization(app_store_version_id: id, attributes: attributes)
115
120
  return resp.to_models.first
116
121
  end
117
122
 
118
- def get_app_store_version_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
119
- return Spaceship::ConnectAPI::AppStoreVersionLocalization.all(app_store_version_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
123
+ def get_app_store_version_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
124
+ client ||= Spaceship::ConnectAPI
125
+ return Spaceship::ConnectAPI::AppStoreVersionLocalization.all(client: client, app_store_version_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
120
126
  end
121
127
 
122
128
  #
123
129
  # App Store Review Detail
124
130
  #
125
131
 
126
- def create_app_store_review_detail(attributes: nil)
132
+ def create_app_store_review_detail(client: nil, attributes: nil)
133
+ client ||= Spaceship::ConnectAPI
127
134
  attributes = Spaceship::ConnectAPI::AppStoreReviewDetail.reverse_attr_mapping(attributes)
128
- resp = Spaceship::ConnectAPI.post_app_store_review_detail(app_store_version_id: id, attributes: attributes)
135
+ resp = client.post_app_store_review_detail(app_store_version_id: id, attributes: attributes)
129
136
  return resp.to_models.first
130
137
  end
131
138
 
132
- def fetch_app_store_review_detail(includes: "appStoreReviewAttachments")
133
- resp = Spaceship::ConnectAPI.get_app_store_review_detail(app_store_version_id: id, includes: includes)
139
+ def fetch_app_store_review_detail(client: nil, includes: "appStoreReviewAttachments")
140
+ client ||= Spaceship::ConnectAPI
141
+ resp = client.get_app_store_review_detail(app_store_version_id: id, includes: includes)
134
142
  return resp.to_models.first
135
143
  end
136
144
 
@@ -138,13 +146,15 @@ module Spaceship
138
146
  # App Store Version Phased Releases
139
147
  #
140
148
 
141
- def fetch_app_store_version_phased_release
142
- resp = Spaceship::ConnectAPI.get_app_store_version_phased_release(app_store_version_id: id)
149
+ def fetch_app_store_version_phased_release(client: nil)
150
+ client ||= Spaceship::ConnectAPI
151
+ resp = client.get_app_store_version_phased_release(app_store_version_id: id)
143
152
  return resp.to_models.first
144
153
  end
145
154
 
146
- def create_app_store_version_phased_release(attributes: nil)
147
- resp = Spaceship::ConnectAPI.post_app_store_version_phased_release(app_store_version_id: id, attributes: attributes)
155
+ def create_app_store_version_phased_release(client: nil, attributes: nil)
156
+ client ||= Spaceship::ConnectAPI
157
+ resp = client.post_app_store_version_phased_release(app_store_version_id: id, attributes: attributes)
148
158
  return resp.to_models.first
149
159
  end
150
160
 
@@ -152,13 +162,15 @@ module Spaceship
152
162
  # App Store Version Submissions
153
163
  #
154
164
 
155
- def fetch_app_store_version_submission
156
- resp = Spaceship::ConnectAPI.get_app_store_version_submission(app_store_version_id: id)
165
+ def fetch_app_store_version_submission(client: nil)
166
+ client ||= Spaceship::ConnectAPI
167
+ resp = client.get_app_store_version_submission(app_store_version_id: id)
157
168
  return resp.to_models.first
158
169
  end
159
170
 
160
- def create_app_store_version_submission
161
- resp = Spaceship::ConnectAPI.post_app_store_version_submission(app_store_version_id: id)
171
+ def create_app_store_version_submission(client: nil)
172
+ client ||= Spaceship::ConnectAPI
173
+ resp = client.post_app_store_version_submission(app_store_version_id: id)
162
174
  return resp.to_models.first
163
175
  end
164
176
 
@@ -166,8 +178,9 @@ module Spaceship
166
178
  # App Store Version Release Requests
167
179
  #
168
180
 
169
- def create_app_store_version_release_request
170
- resp = Spaceship::ConnectAPI.post_app_store_version_release_request(app_store_version_id: id)
181
+ def create_app_store_version_release_request(client: nil)
182
+ client ||= Spaceship::ConnectAPI
183
+ resp = client.post_app_store_version_release_request(app_store_version_id: id)
171
184
  return resp.to_models.first
172
185
  end
173
186
 
@@ -175,13 +188,15 @@ module Spaceship
175
188
  # Build
176
189
  #
177
190
 
178
- def get_build(build_id: nil)
179
- resp = Spaceship::ConnectAPI.get_build(app_store_version_id: id, build_id: build_id)
191
+ def get_build(client: nil, build_id: nil)
192
+ client ||= Spaceship::ConnectAPI
193
+ resp = client.get_build(app_store_version_id: id, build_id: build_id)
180
194
  return resp.to_models.first
181
195
  end
182
196
 
183
- def select_build(build_id: nil)
184
- resp = Spaceship::ConnectAPI.patch_app_store_version_with_build(app_store_version_id: id, build_id: build_id)
197
+ def select_build(client: nil, build_id: nil)
198
+ client ||= Spaceship::ConnectAPI
199
+ resp = client.patch_app_store_version_with_build(app_store_version_id: id, build_id: build_id)
185
200
  return resp.to_models.first
186
201
  end
187
202
 
@@ -189,13 +204,15 @@ module Spaceship
189
204
  # IDFA Declarations
190
205
  #
191
206
 
192
- def fetch_idfa_declaration
193
- resp = Spaceship::ConnectAPI.get_idfa_declaration(app_store_version_id: id)
207
+ def fetch_idfa_declaration(client: nil)
208
+ client ||= Spaceship::ConnectAPI
209
+ resp = client.get_idfa_declaration(app_store_version_id: id)
194
210
  return resp.to_models.first
195
211
  end
196
212
 
197
- def create_idfa_declaration(attributes: nil)
198
- resp = Spaceship::ConnectAPI.post_idfa_declaration(app_store_version_id: id, attributes: attributes)
213
+ def create_idfa_declaration(client: nil, attributes: nil)
214
+ client ||= Spaceship::ConnectAPI
215
+ resp = client.post_idfa_declaration(app_store_version_id: id, attributes: attributes)
199
216
  return resp.to_models.first
200
217
  end
201
218
 
@@ -203,13 +220,15 @@ module Spaceship
203
220
  # Reset Ratings Requests
204
221
  #
205
222
 
206
- def fetch_reset_ratings_request
207
- resp = Spaceship::ConnectAPI.get_reset_ratings_request(app_store_version_id: id)
223
+ def fetch_reset_ratings_request(client: nil)
224
+ client ||= Spaceship::ConnectAPI
225
+ resp = client.get_reset_ratings_request(app_store_version_id: id)
208
226
  return resp.to_models.first
209
227
  end
210
228
 
211
- def create_reset_ratings_request
212
- resp = Spaceship::ConnectAPI.post_reset_ratings_request(app_store_version_id: id)
229
+ def create_reset_ratings_request(client: nil)
230
+ client ||= Spaceship::ConnectAPI
231
+ resp = client.post_reset_ratings_request(app_store_version_id: id)
213
232
  return resp.to_models.first
214
233
  end
215
234
  end