fastlane 2.157.3 → 2.161.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -72
  3. data/deliver/lib/deliver/options.rb +17 -1
  4. data/deliver/lib/deliver/runner.rb +36 -5
  5. data/deliver/lib/deliver/upload_metadata.rb +36 -6
  6. data/deliver/lib/deliver/upload_price_tier.rb +7 -2
  7. data/{pilot/lib/pilot/.manager.rb.swp → fastlane/lib/fastlane/.erb_template_helper.rb.swp} +0 -0
  8. data/fastlane/lib/fastlane/actions/{.ensure_git_status_clean.rb.swp → .git_commit.rb.swp} +0 -0
  9. data/fastlane/lib/fastlane/actions/actions_helper.rb +20 -1
  10. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +1 -0
  11. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +6 -1
  12. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +1 -0
  13. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +2 -2
  14. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  15. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -1
  16. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +3 -2
  17. data/fastlane/lib/fastlane/actions/docs/run_tests.md +2 -2
  18. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +3 -3
  19. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -2
  20. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +2 -2
  21. data/fastlane/lib/fastlane/actions/download_dsyms.rb +34 -7
  22. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +13 -2
  23. data/fastlane/lib/fastlane/actions/set_changelog.rb +2 -0
  24. data/fastlane/lib/fastlane/helper/git_helper.rb +2 -0
  25. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +6 -4
  26. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  27. data/fastlane/lib/fastlane/version.rb +1 -1
  28. data/fastlane/swift/Actions.swift +2 -1
  29. data/fastlane/swift/Appfile.swift +2 -4
  30. data/fastlane/swift/ArgumentProcessor.swift +2 -6
  31. data/fastlane/swift/ControlCommand.swift +2 -5
  32. data/fastlane/swift/Deliverfile.swift +5 -2
  33. data/fastlane/swift/DeliverfileProtocol.swift +15 -4
  34. data/fastlane/swift/Fastfile.swift +5 -1
  35. data/fastlane/swift/Fastlane.swift +2285 -2240
  36. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +5 -5
  37. data/fastlane/swift/Gymfile.swift +5 -2
  38. data/fastlane/swift/GymfileProtocol.swift +6 -3
  39. data/fastlane/swift/LaneFileProtocol.swift +42 -29
  40. data/fastlane/swift/MainProcess.swift +77 -0
  41. data/fastlane/swift/Matchfile.swift +5 -2
  42. data/fastlane/swift/MatchfileProtocol.swift +7 -4
  43. data/fastlane/swift/Plugins.swift +2 -1
  44. data/fastlane/swift/Precheckfile.swift +5 -2
  45. data/fastlane/swift/PrecheckfileProtocol.swift +18 -3
  46. data/fastlane/swift/RubyCommand.swift +2 -6
  47. data/fastlane/swift/RubyCommandable.swift +2 -6
  48. data/fastlane/swift/Runner.swift +5 -9
  49. data/fastlane/swift/RunnerArgument.swift +2 -6
  50. data/fastlane/swift/Scanfile.swift +5 -2
  51. data/fastlane/swift/ScanfileProtocol.swift +6 -3
  52. data/fastlane/swift/Screengrabfile.swift +5 -2
  53. data/fastlane/swift/ScreengrabfileProtocol.swift +6 -3
  54. data/fastlane/swift/Snapshotfile.swift +5 -2
  55. data/fastlane/swift/SnapshotfileProtocol.swift +6 -3
  56. data/fastlane/swift/SocketClient.swift +3 -7
  57. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -6
  58. data/fastlane/swift/SocketResponse.swift +2 -6
  59. data/fastlane/swift/formatting/Brewfile.lock.json +18 -10
  60. data/fastlane/swift/main.swift +4 -8
  61. data/fastlane/swift/upgrade_manifest.json +1 -1
  62. data/frameit/lib/frameit/editor.rb +1 -0
  63. data/match/lib/match/importer.rb +5 -2
  64. data/match/lib/match/options.rb +1 -1
  65. data/match/lib/match/spaceship_ensure.rb +3 -3
  66. data/pilot/lib/pilot/options.rb +2 -2
  67. data/precheck/lib/precheck/options.rb +25 -0
  68. data/precheck/lib/precheck/rule_processor.rb +94 -60
  69. data/precheck/lib/precheck/runner.rb +26 -5
  70. data/produce/lib/produce/itunes_connect.rb +2 -0
  71. data/sigh/lib/sigh/runner.rb +2 -0
  72. data/snapshot/lib/assets/SnapshotHelper.swift +17 -2
  73. data/spaceship/README.md +1 -1
  74. data/spaceship/lib/spaceship/{connect_api/.DS_Store → .DS_Store} +0 -0
  75. data/spaceship/lib/spaceship/connect_api/client.rb +34 -13
  76. data/{fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp → spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp} +0 -0
  77. data/spaceship/lib/spaceship/connect_api/models/app.rb +17 -9
  78. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  79. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +2 -2
  80. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +3 -5
  81. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +3 -5
  82. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +21 -0
  83. data/spaceship/lib/spaceship/connect_api/spaceship.rb +3 -2
  84. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +29 -9
  85. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +11 -5
  86. metadata +24 -26
  87. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  88. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  89. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
@@ -18,10 +18,24 @@ module Precheck
18
18
  hide_keys: [:output_path],
19
19
  title: "Summary for precheck #{Fastlane::VERSION}")
20
20
 
21
- unless Spaceship::Tunes.client
21
+ if api_token
22
+
23
+ # As of 2020-09-15, App Store Connect API does not have support for IAPs yet
24
+ # This means that API Key will fail if checking for IAPs.
25
+ #
26
+ # There is also a check in Deliver::Runner for this.
27
+ # Please remove check in Deliver when the API support IAPs.
28
+ if Precheck.config[:include_in_app_purchases]
29
+ UI.user_error!("Precheck cannot check In-app purchases with the App Store Connect API Key (yet). Exclude In-app purchases from precheck or use Apple ID login")
30
+ end
31
+
32
+ UI.message("Creating authorization token for App Store Connect API")
33
+ Spaceship::ConnectAPI.token = api_token
34
+ elsif Spaceship::Tunes.client.nil?
35
+ # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
36
+ # Prompts select team if multiple teams and none specified
22
37
  UI.message("Starting login with user '#{Precheck.config[:username]}'")
23
- Spaceship::Tunes.login(Precheck.config[:username])
24
- Spaceship::Tunes.select_team
38
+ Spaceship::ConnectAPI.login(Precheck.config[:username], use_portal: false, use_tunes: true)
25
39
 
26
40
  UI.message("Successfully logged in")
27
41
  end
@@ -57,6 +71,12 @@ module Precheck
57
71
  return true
58
72
  end
59
73
 
74
+ def api_token
75
+ @api_token ||= Spaceship::ConnectAPI::Token.create(Precheck.config[:api_key]) if Precheck.config[:api_key]
76
+ @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(Precheck.config[:api_key_path]) if Precheck.config[:api_key_path]
77
+ return @api_token
78
+ end
79
+
60
80
  def print_items_not_checked(processor_result: nil)
61
81
  names = processor_result.items_not_checked.map(&:friendly_name)
62
82
  UI.message("😶 Metadata fields not checked by any rule: #{names.join(', ')}".yellow) if names.length > 0
@@ -160,11 +180,12 @@ module Precheck
160
180
  end
161
181
 
162
182
  def app
163
- Spaceship::Tunes::Application.find(Precheck.config[:app_identifier])
183
+ Spaceship::ConnectAPI::App.find(Precheck.config[:app_identifier])
164
184
  end
165
185
 
166
186
  def latest_app_version
167
- @latest_version ||= app.latest_version
187
+ platform = Spaceship::ConnectAPI::Platform.map(Precheck.config[:platform])
188
+ @latest_version ||= app.get_edit_app_store_version(platform: platform)
168
189
  end
169
190
 
170
191
  # Makes sure the current App ID exists. If not, it will show an appropriate error message
@@ -9,6 +9,8 @@ module Produce
9
9
  @full_bundle_identifier = app_identifier
10
10
  @full_bundle_identifier.gsub!('*', Produce.config[:bundle_identifier_suffix].to_s) if wildcard_bundle?
11
11
 
12
+ # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
13
+ # Prompts select team if multiple teams and none specified
12
14
  Spaceship::ConnectAPI.login(Produce.config[:username], nil, use_portal: false, use_tunes: true)
13
15
 
14
16
  create_new_app
@@ -17,6 +17,8 @@ module Sigh
17
17
  hide_keys: [:output_path],
18
18
  title: "Summary for sigh #{Fastlane::VERSION}")
19
19
 
20
+ # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
21
+ # Prompts select team if multiple teams and none specified
20
22
  UI.message("Starting login with user '#{Sigh.config[:username]}'")
21
23
  Spaceship::ConnectAPI.login(Sigh.config[:username], nil, use_portal: true, use_tunes: false)
22
24
  UI.message("Successfully logged in")
@@ -165,6 +165,8 @@ open class Snapshot: NSObject {
165
165
  }
166
166
 
167
167
  let screenshot = XCUIScreen.main.screenshot()
168
+ let image = XCUIDevice.shared.orientation.isLandscape ? fixLandscapeOrientation(image: screenshot.image) : screenshot.image
169
+
168
170
  guard var simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return }
169
171
 
170
172
  do {
@@ -174,7 +176,7 @@ open class Snapshot: NSObject {
174
176
  simulator = regex.stringByReplacingMatches(in: simulator, range: range, withTemplate: "")
175
177
 
176
178
  let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png")
177
- try screenshot.pngRepresentation.write(to: path)
179
+ try image.pngData()?.write(to: path, options: .atomic)
178
180
  } catch let error {
179
181
  NSLog("Problem writing screenshot: \(name) to \(screenshotsDir)/\(simulator)-\(name).png")
180
182
  NSLog(error.localizedDescription)
@@ -182,6 +184,19 @@ open class Snapshot: NSObject {
182
184
  #endif
183
185
  }
184
186
 
187
+ class func fixLandscapeOrientation(image: UIImage) -> UIImage {
188
+ if #available(iOS 10.0, *) {
189
+ let format = UIGraphicsImageRendererFormat()
190
+ format.scale = image.scale
191
+ let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
192
+ return renderer.image { context in
193
+ image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height))
194
+ }
195
+ } else {
196
+ return image
197
+ }
198
+ }
199
+
185
200
  class func waitForLoadingIndicatorToDisappear(within timeout: TimeInterval) {
186
201
  #if os(tvOS)
187
202
  return
@@ -279,4 +294,4 @@ private extension CGFloat {
279
294
 
280
295
  // Please don't remove the lines below
281
296
  // They are used to detect outdated configuration files
282
- // SnapshotHelperVersion [1.23]
297
+ // SnapshotHelperVersion [1.24]
@@ -167,7 +167,7 @@ _spaceship_ uses all those API points to offer this seamless experience.
167
167
  _spaceship_ does a lot of magic to get everything working so neatly:
168
168
 
169
169
  - **Sensible Defaults**: You only have to provide the mandatory information (e.g. new provisioning profiles contain all devices by default)
170
- - **Local Validation**: When pushing changes back to the Apple Dev Portal _spaceship_ will make sure only valid data is sent to Apple (e.g. automatic repairing of provisioning profiles)
170
+ - **Local Validation**: When pushing changes back to the Apple Developer Portal _spaceship_ will make sure only valid data is sent to Apple (e.g. automatic repairing of provisioning profiles)
171
171
  - **Various request/response types**: When working with the different API endpoints, _spaceship_ has to deal with `JSON`, `XML`, `txt`, `plist` and sometimes even `HTML` responses and requests.
172
172
  - **Automatic Pagination**: Even if you have thousands of apps, profiles or certificates, _spaceship_ **can** handle your scale. It was heavily tested by first using _spaceship_ to create hundreds of profiles and then accessing them using _spaceship_.
173
173
  - **Session, Cookie and CSRF token**: All the security aspects are handled by _spaceship_.
@@ -43,26 +43,27 @@ module Spaceship
43
43
  # @param portal_team_id (String) (optional): The Spaceship::Portal team id
44
44
  # @param tunes_team_id (String) (optional): The Spaceship::Tunes team id
45
45
  # @param team_name (String) (optional): The team name
46
+ # @param skip_select_team (Boolean) (optional): Whether to skip automatic selection or prompt for team
46
47
  #
47
48
  # @raise InvalidUserCredentialsError: raised if authentication failed
48
49
  #
49
50
  # @return (Spaceship::ConnectAPI::Client) The client the login method was called for
50
- def self.login(user = nil, password = nil, use_portal: true, use_tunes: true, portal_team_id: nil, tunes_team_id: nil, team_name: nil)
51
+ def self.login(user = nil, password = nil, use_portal: true, use_tunes: true, portal_team_id: nil, tunes_team_id: nil, team_name: nil, skip_select_team: false)
51
52
  portal_client = Spaceship::Portal.login(user, password) if use_portal
52
53
  tunes_client = Spaceship::Tunes.login(user, password) if use_tunes
53
54
 
54
- # Check if environment variables are set for Spaceship::Portal or Spaceship::Tunes to select team
55
- portal_team_id ||= ENV['FASTLANE_TEAM_ID']
56
- portal_team_name = team_name || ENV['FASTLANE_TEAM_NAME']
57
- tunes_team_id ||= ENV['FASTLANE_ITC_TEAM_ID']
58
- tunes_team_name = team_name || ENV['FASTLANE_ITC_TEAM_NAME']
59
-
60
- # The clients will automatically select the first team if none is given
61
- if portal_client && (!portal_team_id.to_s.strip.empty? || !portal_team_name.to_s.strip.empty?)
62
- portal_client.select_team(team_id: portal_team_id, team_name: portal_team_name)
63
- end
64
- if tunes_client && (!tunes_team_id.to_s.strip.empty? || !tunes_team_name.to_s.strip.empty?)
65
- tunes_client.select_team(team_id: tunes_team_id, team_name: tunes_team_name)
55
+ unless skip_select_team
56
+ # Check if environment variables are set for Spaceship::Portal or Spaceship::Tunes to select team
57
+ portal_team_id ||= ENV['FASTLANE_TEAM_ID']
58
+ portal_team_name = team_name || ENV['FASTLANE_TEAM_NAME']
59
+ tunes_team_id ||= ENV['FASTLANE_ITC_TEAM_ID']
60
+ tunes_team_name = team_name || ENV['FASTLANE_ITC_TEAM_NAME']
61
+
62
+ # The clients will prompt for a team selection if:
63
+ # 1. client exists
64
+ # 2. team_id and team_name are nil and user belongs to multiple teams
65
+ portal_client.select_team(team_id: portal_team_id, team_name: portal_team_name) if portal_client
66
+ tunes_client.select_team(team_id: tunes_team_id, team_name: tunes_team_name) if tunes_client
66
67
  end
67
68
 
68
69
  return ConnectAPI::Client.new(tunes_client: tunes_client, portal_client: portal_client)
@@ -95,6 +96,26 @@ module Spaceship
95
96
  )
96
97
  end
97
98
 
99
+ def portal_team_id
100
+ return nil if @portal_client.nil?
101
+ return @portal_client.team_id
102
+ end
103
+
104
+ def tunes_team_id
105
+ return nil if @tunes_client.nil?
106
+ return @tunes_client.team_id
107
+ end
108
+
109
+ def portal_teams
110
+ return nil if @portal_client.nil?
111
+ return @portal_client.teams
112
+ end
113
+
114
+ def tunes_teams
115
+ return nil if @tunes_client.nil?
116
+ return @tunes_client.teams
117
+ end
118
+
98
119
  def in_house?
99
120
  if token
100
121
  if token.in_house.nil?
@@ -16,6 +16,7 @@ module Spaceship
16
16
  attr_accessor :available_in_new_territories
17
17
  attr_accessor :content_rights_declaration
18
18
  attr_accessor :app_store_versions
19
+ attr_accessor :prices
19
20
 
20
21
  module ContentRightsDeclaration
21
22
  USES_THIRD_PARTY_CONTENT = "USES_THIRD_PARTY_CONTENT"
@@ -34,9 +35,15 @@ module Spaceship
34
35
 
35
36
  "contentRightsDeclaration" => "content_rights_declaration",
36
37
 
37
- "appStoreVersions" => "app_store_versions"
38
+ "appStoreVersions" => "app_store_versions",
39
+ "prices" => "prices"
38
40
  })
39
41
 
42
+ ESSENTIAL_INCLUDES = [
43
+ "appStoreVersions",
44
+ "prices"
45
+ ].join(",")
46
+
40
47
  def self.type
41
48
  return "apps"
42
49
  end
@@ -45,7 +52,7 @@ module Spaceship
45
52
  # Apps
46
53
  #
47
54
 
48
- def self.all(filter: {}, includes: "appStoreVersions", limit: nil, sort: nil)
55
+ def self.all(filter: {}, includes: ESSENTIAL_INCLUDES, limit: nil, sort: nil)
49
56
  resps = Spaceship::ConnectAPI.get_apps(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
50
57
  return resps.flat_map(&:to_models)
51
58
  end
@@ -84,13 +91,13 @@ module Spaceship
84
91
  def fetch_live_app_info(includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
85
92
  states = [
86
93
  Spaceship::ConnectAPI::AppInfo::AppStoreState::READY_FOR_SALE,
94
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_APPLE_RELEASE,
87
95
  Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_DEVELOPER_RELEASE,
88
96
  Spaceship::ConnectAPI::AppInfo::AppStoreState::PROCESSING_FOR_APP_STORE,
89
97
  Spaceship::ConnectAPI::AppInfo::AppStoreState::IN_REVIEW
90
98
  ]
91
99
 
92
- filter = { app: id }
93
- resp = Spaceship::ConnectAPI.get_app_infos(filter: filter, includes: includes)
100
+ resp = Spaceship::ConnectAPI.get_app_infos(app_id: id, includes: includes)
94
101
  return resp.to_models.select do |model|
95
102
  states.include?(model.app_store_state)
96
103
  end.first
@@ -106,8 +113,7 @@ module Spaceship
106
113
  Spaceship::ConnectAPI::AppInfo::AppStoreState::INVALID_BINARY
107
114
  ]
108
115
 
109
- filter = { app: id }
110
- resp = Spaceship::ConnectAPI.get_app_infos(filter: filter, includes: includes)
116
+ resp = Spaceship::ConnectAPI.get_app_infos(app_id: id, includes: includes)
111
117
  return resp.to_models.select do |model|
112
118
  states.include?(model.app_store_state)
113
119
  end.first
@@ -128,8 +134,6 @@ module Spaceship
128
134
  #
129
135
 
130
136
  def fetch_app_prices(filter: {}, includes: "priceTier", limit: nil, sort: nil)
131
- filter ||= {}
132
- filter[:app] = id
133
137
  resp = Spaceship::ConnectAPI.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
134
138
  return resp.to_models
135
139
  end
@@ -142,6 +146,7 @@ module Spaceship
142
146
  platform ||= Spaceship::ConnectAPI::Platform::IOS
143
147
  filter = {
144
148
  appStoreState: [
149
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_APPLE_RELEASE,
145
150
  Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_DEVELOPER_RELEASE,
146
151
  Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
147
152
  Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::WAITING_FOR_REVIEW
@@ -233,7 +238,10 @@ module Spaceship
233
238
  def get_pending_release_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
234
239
  platform ||= Spaceship::ConnectAPI::Platform::IOS
235
240
  filter = {
236
- appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_DEVELOPER_RELEASE,
241
+ appStoreState: [
242
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_APPLE_RELEASE,
243
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_DEVELOPER_RELEASE
244
+ ].join(','),
237
245
  platform: platform
238
246
  }
239
247
  return get_app_store_versions(filter: filter, includes: includes).first
@@ -20,6 +20,7 @@ module Spaceship
20
20
  READY_FOR_SALE = "READY_FOR_SALE"
21
21
  PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
22
22
  PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
23
+ PENDING_APPLE_RELEASE = "PENDING_APPLE_RELEASE"
23
24
  IN_REVIEW = "IN_REVIEW"
24
25
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
25
26
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
@@ -112,8 +112,8 @@ module Spaceship
112
112
  # API
113
113
  #
114
114
 
115
- def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
116
- resp = Spaceship::ConnectAPI.get_app_screenshot_sets(filter: filter, includes: includes, limit: limit, sort: sort)
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)
117
117
  return resp.to_models
118
118
  end
119
119
 
@@ -26,6 +26,7 @@ module Spaceship
26
26
  READY_FOR_SALE = "READY_FOR_SALE"
27
27
  PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
28
28
  PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
29
+ PENDING_APPLE_RELEASE = "PENDING_APPLE_RELEASE"
29
30
  IN_REVIEW = "IN_REVIEW"
30
31
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
31
32
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
@@ -114,11 +115,8 @@ module Spaceship
114
115
  return resp.to_models.first
115
116
  end
116
117
 
117
- # appScreenshotSets,appPreviewSets
118
- def get_app_store_version_localizations(filter: {}, includes: "appScreenshotSets", limit: nil, sort: nil)
119
- filter ||= {}
120
- filter["appStoreVersion"] = id
121
- return Spaceship::ConnectAPI::AppStoreVersionLocalization.all(filter: filter, includes: includes, limit: limit, sort: sort)
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)
122
120
  end
123
121
 
124
122
  #
@@ -39,8 +39,8 @@ module Spaceship
39
39
  # API
40
40
  #
41
41
 
42
- def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
43
- resp = Spaceship::ConnectAPI.get_app_store_version_localizations(filter: filter, includes: includes, limit: limit, sort: sort)
42
+ def self.all(app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
43
+ resp = Spaceship::ConnectAPI.get_app_store_version_localizations(app_store_version_id: app_store_version_id, filter: filter, includes: includes, limit: limit, sort: sort)
44
44
  return resp.to_models
45
45
  end
46
46
 
@@ -73,9 +73,7 @@ module Spaceship
73
73
  #
74
74
 
75
75
  def get_app_screenshot_sets(filter: {}, includes: "appScreenshots", limit: nil, sort: nil)
76
- filter ||= {}
77
- filter["appStoreVersionLocalization"] = id
78
- return Spaceship::ConnectAPI::AppScreenshotSet.all(filter: filter, includes: includes, limit: limit, sort: sort)
76
+ return Spaceship::ConnectAPI::AppScreenshotSet.all(app_store_version_localization_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
79
77
  end
80
78
 
81
79
  def create_app_screenshot_set(attributes: nil)
@@ -11,6 +11,9 @@ module Spaceship
11
11
 
12
12
  module PhasedReleaseState
13
13
  INACTIVE = "INACTIVE"
14
+ ACTIVE = "ACTIVE"
15
+ PAUSED = "PAUSED"
16
+ COMPLETE = "COMPLETE"
14
17
  end
15
18
 
16
19
  attr_mapping({
@@ -28,9 +31,27 @@ module Spaceship
28
31
  # API
29
32
  #
30
33
 
34
+ def pause
35
+ update(PhasedReleaseState::PAUSED)
36
+ end
37
+
38
+ def resume
39
+ update(PhasedReleaseState::ACTIVE)
40
+ end
41
+
42
+ def complete
43
+ update(PhasedReleaseState::COMPLETE)
44
+ end
45
+
31
46
  def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
32
47
  Spaceship::ConnectAPI.delete_app_store_version_phased_release(app_store_version_phased_release_id: id)
33
48
  end
49
+
50
+ private def update(state)
51
+ Spaceship::ConnectAPI.patch_app_store_version_phased_release(app_store_version_phased_release_id: id, attributes: {
52
+ phasedReleaseState: state
53
+ }).to_models.first
54
+ end
34
55
  end
35
56
  end
36
57
  end
@@ -73,12 +73,13 @@ module Spaceship
73
73
  # @param portal_team_id (String) (optional): The Spaceship::Portal team id
74
74
  # @param tunes_team_id (String) (optional): The Spaceship::Tunes team id
75
75
  # @param team_name (String) (optional): The team name
76
+ # @param skip_select_team (Boolean) (optional): Whether to skip automatic selection or prompt for team
76
77
  #
77
78
  # @raise InvalidUserCredentialsError: raised if authentication failed
78
79
  #
79
80
  # @return (Spaceship::ConnectAPI::Client) The client the login method was called for
80
- def login(user = nil, password = nil, use_portal: true, use_tunes: true, portal_team_id: nil, tunes_team_id: nil, team_name: nil)
81
- @client = ConnectAPI::Client.login(user, password, use_portal: use_portal, use_tunes: use_tunes, portal_team_id: portal_team_id, tunes_team_id: tunes_team_id, team_name: team_name)
81
+ def login(user = nil, password = nil, use_portal: true, use_tunes: true, portal_team_id: nil, tunes_team_id: nil, team_name: nil, skip_select_team: false)
82
+ @client = ConnectAPI::Client.login(user, password, use_portal: use_portal, use_tunes: use_tunes, portal_team_id: portal_team_id, tunes_team_id: tunes_team_id, team_name: team_name, skip_select_team: skip_select_team)
82
83
  end
83
84
 
84
85
  # Open up the team selection for the user (if necessary).
@@ -185,9 +185,12 @@ module Spaceship
185
185
  type: "apps",
186
186
  id: app_id
187
187
  }
188
- data[:attributes] = attributes unless attributes.empty?
189
188
  data[:relationships] = relationships unless relationships.empty?
190
189
 
190
+ if !attributes.nil? && !attributes.empty?
191
+ data[:attributes] = attributes
192
+ end
193
+
191
194
  # Body
192
195
  body = {
193
196
  data: data
@@ -308,12 +311,17 @@ module Spaceship
308
311
  tunes_request_client.get("appPrices", params)
309
312
  end
310
313
 
314
+ def get_app_price(app_price_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
315
+ params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
316
+ tunes_request_client.get("appPrices/#{app_price_id}", params)
317
+ end
318
+
311
319
  #
312
320
  # appPricePoints
313
321
  #
314
322
  def get_app_price_points(filter: {}, includes: nil, limit: nil, sort: nil)
315
- params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
316
- Client.instance.get("appPricePoints", params)
323
+ params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
324
+ tunes_request_client.get("appPricePoints", params)
317
325
  end
318
326
 
319
327
  #
@@ -360,9 +368,9 @@ module Spaceship
360
368
  # appScreenshotSets
361
369
  #
362
370
 
363
- def get_app_screenshot_sets(filter: {}, includes: nil, limit: nil, sort: nil)
371
+ def get_app_screenshot_sets(app_store_version_localization_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
364
372
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
365
- tunes_request_client.get("appScreenshotSets", params)
373
+ tunes_request_client.get("appStoreVersionLocalizations/#{app_store_version_localization_id}/appScreenshotSets", params)
366
374
  end
367
375
 
368
376
  def get_app_screenshot_set(app_screenshot_set_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
@@ -453,9 +461,9 @@ module Spaceship
453
461
  # appInfos
454
462
  #
455
463
 
456
- def get_app_infos(filter: {}, includes: nil, limit: nil, sort: nil)
464
+ def get_app_infos(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
457
465
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
458
- tunes_request_client.get("appInfos", params)
466
+ tunes_request_client.get("apps/#{app_id}/appInfos", params)
459
467
  end
460
468
 
461
469
  def patch_app_info(app_info_id: nil, attributes: {})
@@ -641,9 +649,9 @@ module Spaceship
641
649
  # appStoreVersionLocalizations
642
650
  #
643
651
 
644
- def get_app_store_version_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
652
+ def get_app_store_version_localizations(app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
645
653
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
646
- tunes_request_client.get("appStoreVersionLocalizations", params)
654
+ tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionLocalizations", params)
647
655
  end
648
656
 
649
657
  def post_app_store_version_localization(app_store_version_id: nil, attributes: {})
@@ -710,6 +718,18 @@ module Spaceship
710
718
  tunes_request_client.post("appStoreVersionPhasedReleases", body)
711
719
  end
712
720
 
721
+ def patch_app_store_version_phased_release(app_store_version_phased_release_id: nil, attributes: {})
722
+ body = {
723
+ data: {
724
+ type: "appStoreVersionPhasedReleases",
725
+ attributes: attributes,
726
+ id: app_store_version_phased_release_id
727
+ }
728
+ }
729
+
730
+ tunes_request_client.patch("appStoreVersionPhasedReleases/#{app_store_version_phased_release_id}", body)
731
+ end
732
+
713
733
  def delete_app_store_version_phased_release(app_store_version_phased_release_id: nil)
714
734
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
715
735
  tunes_request_client.delete("appStoreVersionPhasedReleases/#{app_store_version_phased_release_id}", params)