fastlane 2.165.0 → 2.170.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +76 -76
- data/cert/lib/cert/options.rb +3 -3
- data/cert/lib/cert/runner.rb +1 -1
- data/deliver/lib/deliver/app_screenshot.rb +6 -2
- data/deliver/lib/deliver/loader.rb +136 -18
- data/deliver/lib/deliver/upload_metadata.rb +4 -10
- data/deliver/lib/deliver/upload_screenshots.rb +1 -64
- data/fastlane/lib/fastlane/actions/actions_helper.rb +1 -1
- data/fastlane/lib/fastlane/actions/add_git_tag.rb +9 -2
- data/fastlane/lib/fastlane/actions/appledoc.rb +1 -1
- data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +4 -0
- data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
- data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +1 -1
- data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +4 -0
- data/fastlane/lib/fastlane/actions/onesignal.rb +13 -3
- data/fastlane/lib/fastlane/actions/slather.rb +2 -2
- data/fastlane/lib/fastlane/actions/spm.rb +6 -0
- data/fastlane/lib/fastlane/actions/update_fastlane.rb +29 -8
- data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +289 -0
- data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -3
- data/fastlane/lib/fastlane/actions/xcode_install.rb +8 -5
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +2 -2
- data/fastlane/lib/fastlane/features.rb +1 -1
- data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -1
- data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +3 -0
- data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +1 -1
- data/fastlane/swift/Fastfile.swift +1 -1
- data/fastlane/swift/Fastlane.swift +97 -26
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +5 -1
- data/fastlane/swift/LaneFileProtocol.swift +2 -2
- data/fastlane/swift/MainProcess.swift +2 -0
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +3 -3
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
- data/fastlane/swift/Runner.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +9 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
- data/fastlane/swift/SocketClient.swift +1 -1
- data/fastlane_core/lib/fastlane_core/cert_checker.rb +12 -7
- data/fastlane_core/lib/fastlane_core/helper.rb +10 -2
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -3
- data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +3 -1
- data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +8 -0
- data/gym/lib/gym/code_signing_mapping.rb +1 -1
- data/gym/lib/gym/generators/build_command_generator.rb +1 -0
- data/gym/lib/gym/options.rb +7 -1
- data/match/lib/match/module.rb +1 -1
- data/match/lib/match/nuke.rb +9 -5
- data/match/lib/match/options.rb +1 -1
- data/match/lib/match/runner.rb +1 -1
- data/pilot/lib/pilot/build_manager.rb +9 -3
- data/scan/lib/scan/detect_values.rb +3 -1
- data/scan/lib/scan/module.rb +4 -0
- data/scan/lib/scan/options.rb +16 -1
- data/scan/lib/scan/runner.rb +2 -2
- data/scan/lib/scan/test_command_generator.rb +1 -0
- data/snapshot/lib/assets/SnapshotHelper.swift +5 -1
- data/snapshot/lib/snapshot/test_command_generator.rb +1 -1
- data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
- data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +1 -1
- data/spaceship/lib/spaceship/client.rb +14 -0
- data/spaceship/lib/spaceship/connect_api.rb +6 -0
- data/spaceship/lib/spaceship/connect_api/models/.app_data_usage_data_protection.rb.swp +0 -0
- data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/app.rb +88 -54
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage.rb +59 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_category.rb +65 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_data_protection.rb +27 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_grouping.rb +18 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usage_purposes.rb +37 -0
- data/spaceship/lib/spaceship/connect_api/models/app_data_usages_publish_state.rb +36 -0
- data/spaceship/lib/spaceship/connect_api/models/app_info.rb +16 -10
- data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +8 -4
- data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +15 -11
- data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +13 -9
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +9 -7
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +15 -11
- data/spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb +7 -5
- data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +55 -36
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +21 -14
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +12 -2
- data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +12 -8
- data/spaceship/lib/spaceship/connect_api/models/build.rb +24 -16
- data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +9 -6
- data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/certificate.rb +12 -8
- data/spaceship/lib/spaceship/connect_api/models/device.rb +10 -4
- data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +12 -8
- data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +9 -6
- data/spaceship/lib/spaceship/connect_api/models/territory.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/models/user.rb +6 -4
- data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +9 -6
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +103 -0
- data/spaceship/lib/spaceship/errors.rb +19 -0
- data/spaceship/lib/spaceship/tunes/iap_detail.rb +1 -1
- data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
- data/spaceship/lib/spaceship/two_step_or_factor_client.rb +18 -6
- data/supply/lib/supply.rb +1 -1
- data/supply/lib/supply/options.rb +1 -1
- data/supply/lib/supply/uploader.rb +3 -2
- metadata +26 -18
data/scan/lib/scan/runner.rb
CHANGED
@@ -83,6 +83,8 @@ module Scan
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def handle_results(tests_exit_status)
|
86
|
+
return if Scan.config[:disable_xcpretty]
|
87
|
+
|
86
88
|
result = TestResultParser.new.parse_result(test_results)
|
87
89
|
SlackPoster.new.run(result)
|
88
90
|
|
@@ -144,8 +146,6 @@ module Scan
|
|
144
146
|
end
|
145
147
|
|
146
148
|
def test_results
|
147
|
-
return if Scan.config[:disable_xcpretty]
|
148
|
-
|
149
149
|
temp_junit_report = Scan.cache[:temp_junit_report]
|
150
150
|
return File.read(temp_junit_report) if temp_junit_report && File.file?(temp_junit_report)
|
151
151
|
|
@@ -32,6 +32,7 @@ module Scan
|
|
32
32
|
|
33
33
|
options = []
|
34
34
|
options += project_path_array unless config[:xctestrun]
|
35
|
+
options << "-scmProvider system" if config[:use_system_scm]
|
35
36
|
options << "-sdk '#{config[:sdk]}'" if config[:sdk]
|
36
37
|
options << destination # generated in `detect_values`
|
37
38
|
options << "-toolchain '#{config[:toolchain]}'" if config[:toolchain]
|
@@ -180,7 +180,11 @@ open class Snapshot: NSObject {
|
|
180
180
|
simulator = regex.stringByReplacingMatches(in: simulator, range: range, withTemplate: "")
|
181
181
|
|
182
182
|
let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png")
|
183
|
-
|
183
|
+
#if swift(<5.0)
|
184
|
+
UIImagePNGRepresentation(image)?.write(to: path, options: .atomic)
|
185
|
+
#else
|
186
|
+
try image.pngData()?.write(to: path, options: .atomic)
|
187
|
+
#endif
|
184
188
|
} catch let error {
|
185
189
|
NSLog("Problem writing screenshot: \(name) to \(screenshotsDir)/\(simulator)-\(name).png")
|
186
190
|
NSLog(error.localizedDescription)
|
@@ -40,11 +40,13 @@ module Snapshot
|
|
40
40
|
return options
|
41
41
|
end
|
42
42
|
|
43
|
-
def build_settings
|
43
|
+
def build_settings(language, locale)
|
44
44
|
config = Snapshot.config
|
45
45
|
|
46
46
|
build_settings = []
|
47
47
|
build_settings << "FASTLANE_SNAPSHOT=YES"
|
48
|
+
build_settings << "FASTLANE_LANGUAGE=#{language}" if language
|
49
|
+
build_settings << "FASTLANE_LOCALE=#{locale}" if locale
|
48
50
|
build_settings << "TEST_TARGET_NAME=#{config[:test_target_name].shellescape}" if config[:test_target_name]
|
49
51
|
|
50
52
|
return build_settings
|
@@ -14,7 +14,7 @@ module Snapshot
|
|
14
14
|
parts << "xcodebuild"
|
15
15
|
parts += options(language, locale)
|
16
16
|
parts += destination(device_type)
|
17
|
-
parts += build_settings
|
17
|
+
parts += build_settings(language, locale)
|
18
18
|
parts += actions
|
19
19
|
parts += suffix
|
20
20
|
parts += pipe(device_type, language, locale)
|
@@ -57,6 +57,7 @@ module Spaceship
|
|
57
57
|
InternalServerError = Spaceship::InternalServerError
|
58
58
|
BadGatewayError = Spaceship::BadGatewayError
|
59
59
|
AccessForbiddenError = Spaceship::AccessForbiddenError
|
60
|
+
TooManyRequestsError = Spaceship::TooManyRequestsError
|
60
61
|
|
61
62
|
def self.hostname
|
62
63
|
raise "You must implement self.hostname"
|
@@ -645,6 +646,17 @@ module Spaceship
|
|
645
646
|
retry
|
646
647
|
end
|
647
648
|
raise ex # re-raise the exception
|
649
|
+
rescue TooManyRequestsError => ex
|
650
|
+
tries -= 1
|
651
|
+
unless tries.zero?
|
652
|
+
msg = "Timeout received: '#{ex.class}', '#{ex.message}'. Retrying after #{ex.retry_after} seconds (remaining: #{tries})..."
|
653
|
+
puts(msg) if Spaceship::Globals.verbose?
|
654
|
+
logger.warn(msg)
|
655
|
+
|
656
|
+
sleep(ex.retry_after) unless Object.const_defined?("SpecHelper")
|
657
|
+
retry
|
658
|
+
end
|
659
|
+
raise ex # re-raise the exception
|
648
660
|
rescue \
|
649
661
|
Faraday::ParsingError, # <h2>Internal Server Error</h2> with content type json
|
650
662
|
InternalServerError => ex
|
@@ -873,6 +885,8 @@ module Spaceship
|
|
873
885
|
msg = "Access forbidden"
|
874
886
|
logger.warn(msg)
|
875
887
|
raise AccessForbiddenError.new, msg
|
888
|
+
elsif resp_hash[:status] == 429
|
889
|
+
raise TooManyRequestsError, resp_hash
|
876
890
|
end
|
877
891
|
|
878
892
|
return response
|
@@ -35,6 +35,12 @@ require 'spaceship/connect_api/models/custom_app_organization'
|
|
35
35
|
require 'spaceship/connect_api/models/custom_app_user'
|
36
36
|
require 'spaceship/connect_api/models/pre_release_version'
|
37
37
|
|
38
|
+
require 'spaceship/connect_api/models/app_data_usage'
|
39
|
+
require 'spaceship/connect_api/models/app_data_usage_category'
|
40
|
+
require 'spaceship/connect_api/models/app_data_usage_data_protection'
|
41
|
+
require 'spaceship/connect_api/models/app_data_usage_grouping'
|
42
|
+
require 'spaceship/connect_api/models/app_data_usage_purposes'
|
43
|
+
require 'spaceship/connect_api/models/app_data_usages_publish_state'
|
38
44
|
require 'spaceship/connect_api/models/age_rating_declaration'
|
39
45
|
require 'spaceship/connect_api/models/app_category'
|
40
46
|
require 'spaceship/connect_api/models/app_info'
|
Binary file
|
@@ -105,9 +105,10 @@ module Spaceship
|
|
105
105
|
# API
|
106
106
|
#
|
107
107
|
|
108
|
-
def update(attributes: nil)
|
108
|
+
def update(client: nil, attributes: nil)
|
109
|
+
client ||= Spaceship::ConnectAPI
|
109
110
|
attributes = reverse_attr_mapping(attributes)
|
110
|
-
|
111
|
+
client.patch_age_rating_declaration(age_rating_declaration_id: id, attributes: attributes)
|
111
112
|
end
|
112
113
|
end
|
113
114
|
end
|
@@ -69,19 +69,22 @@ module Spaceship
|
|
69
69
|
# Apps
|
70
70
|
#
|
71
71
|
|
72
|
-
def self.all(filter: {}, includes: ESSENTIAL_INCLUDES, limit: nil, sort: nil)
|
73
|
-
|
72
|
+
def self.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, limit: nil, sort: nil)
|
73
|
+
client ||= Spaceship::ConnectAPI
|
74
|
+
resps = client.get_apps(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
74
75
|
return resps.flat_map(&:to_models)
|
75
76
|
end
|
76
77
|
|
77
|
-
def self.find(bundle_id)
|
78
|
-
|
78
|
+
def self.find(bundle_id, client: nil)
|
79
|
+
client ||= Spaceship::ConnectAPI
|
80
|
+
return all(client: client, filter: { bundleId: bundle_id }).find do |app|
|
79
81
|
app.bundle_id == bundle_id
|
80
82
|
end
|
81
83
|
end
|
82
84
|
|
83
|
-
def self.create(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, company_name: nil)
|
84
|
-
Spaceship::ConnectAPI
|
85
|
+
def self.create(client: nil, name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, company_name: nil)
|
86
|
+
client ||= Spaceship::ConnectAPI
|
87
|
+
client.post_app(
|
85
88
|
name: name,
|
86
89
|
version_string: version_string,
|
87
90
|
sku: sku,
|
@@ -92,35 +95,40 @@ module Spaceship
|
|
92
95
|
)
|
93
96
|
end
|
94
97
|
|
95
|
-
def self.get(app_id: nil, includes: "appStoreVersions")
|
96
|
-
|
98
|
+
def self.get(client: nil, app_id: nil, includes: "appStoreVersions")
|
99
|
+
client ||= Spaceship::ConnectAPI
|
100
|
+
return client.get_app(app_id: app_id, includes: includes).first
|
97
101
|
end
|
98
102
|
|
99
|
-
def update(attributes: nil, app_price_tier_id: nil, territory_ids: nil)
|
103
|
+
def update(client: nil, attributes: nil, app_price_tier_id: nil, territory_ids: nil)
|
104
|
+
client ||= Spaceship::ConnectAPI
|
100
105
|
attributes = reverse_attr_mapping(attributes)
|
101
|
-
return
|
106
|
+
return client.patch_app(app_id: id, attributes: attributes, app_price_tier_id: app_price_tier_id, territory_ids: territory_ids)
|
102
107
|
end
|
103
108
|
|
104
109
|
#
|
105
110
|
# App Info
|
106
111
|
#
|
107
112
|
|
108
|
-
def fetch_live_app_info(includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
|
113
|
+
def fetch_live_app_info(client: nil, includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
|
114
|
+
client ||= Spaceship::ConnectAPI
|
109
115
|
states = [
|
110
116
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::READY_FOR_SALE,
|
111
117
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_APPLE_RELEASE,
|
112
118
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_DEVELOPER_RELEASE,
|
113
119
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::PROCESSING_FOR_APP_STORE,
|
114
|
-
Spaceship::ConnectAPI::AppInfo::AppStoreState::IN_REVIEW
|
120
|
+
Spaceship::ConnectAPI::AppInfo::AppStoreState::IN_REVIEW,
|
121
|
+
Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REMOVED_FROM_SALE
|
115
122
|
]
|
116
123
|
|
117
|
-
resp =
|
124
|
+
resp = client.get_app_infos(app_id: id, includes: includes)
|
118
125
|
return resp.to_models.select do |model|
|
119
126
|
states.include?(model.app_store_state)
|
120
127
|
end.first
|
121
128
|
end
|
122
129
|
|
123
|
-
def fetch_edit_app_info(includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
|
130
|
+
def fetch_edit_app_info(client: nil, includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
|
131
|
+
client ||= Spaceship::ConnectAPI
|
124
132
|
states = [
|
125
133
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::PREPARE_FOR_SUBMISSION,
|
126
134
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REJECTED,
|
@@ -130,7 +138,7 @@ module Spaceship
|
|
130
138
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::INVALID_BINARY
|
131
139
|
]
|
132
140
|
|
133
|
-
resp =
|
141
|
+
resp = client.get_app_infos(app_id: id, includes: includes)
|
134
142
|
return resp.to_models.select do |model|
|
135
143
|
states.include?(model.app_store_state)
|
136
144
|
end.first
|
@@ -140,9 +148,10 @@ module Spaceship
|
|
140
148
|
# Available Territories
|
141
149
|
#
|
142
150
|
|
143
|
-
def fetch_available_territories(filter: {}, includes: nil, limit: nil, sort: nil)
|
151
|
+
def fetch_available_territories(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
152
|
+
client ||= Spaceship::ConnectAPI
|
144
153
|
filter ||= {}
|
145
|
-
resps =
|
154
|
+
resps = client.get_available_territories(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
146
155
|
return resps.flat_map(&:to_models)
|
147
156
|
end
|
148
157
|
|
@@ -150,8 +159,9 @@ module Spaceship
|
|
150
159
|
# App Pricing
|
151
160
|
#
|
152
161
|
|
153
|
-
def fetch_app_prices(filter: {}, includes: "priceTier", limit: nil, sort: nil)
|
154
|
-
|
162
|
+
def fetch_app_prices(client: nil, filter: {}, includes: "priceTier", limit: nil, sort: nil)
|
163
|
+
client ||= Spaceship::ConnectAPI
|
164
|
+
resp = client.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
|
155
165
|
return resp.to_models
|
156
166
|
end
|
157
167
|
|
@@ -159,7 +169,8 @@ module Spaceship
|
|
159
169
|
# App Store Versions
|
160
170
|
#
|
161
171
|
|
162
|
-
def reject_version_if_possible!(platform: nil)
|
172
|
+
def reject_version_if_possible!(client: nil, platform: nil)
|
173
|
+
client ||= Spaceship::ConnectAPI
|
163
174
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
164
175
|
filter = {
|
165
176
|
appStoreState: [
|
@@ -172,7 +183,7 @@ module Spaceship
|
|
172
183
|
}
|
173
184
|
|
174
185
|
# Get the latest version
|
175
|
-
version = get_app_store_versions(filter: filter, includes: "appStoreVersionSubmission")
|
186
|
+
version = get_app_store_versions(client: client, filter: filter, includes: "appStoreVersionSubmission")
|
176
187
|
.sort_by { |v| Gem::Version.new(v.version_string) }
|
177
188
|
.last
|
178
189
|
|
@@ -184,46 +195,53 @@ module Spaceship
|
|
184
195
|
# This will either create a new version or change the version number
|
185
196
|
# from an existing version
|
186
197
|
# @return (Bool) Was something changed?
|
187
|
-
def ensure_version!(version_string, platform: nil)
|
198
|
+
def ensure_version!(version_string, platform: nil, client: nil)
|
199
|
+
client ||= Spaceship::ConnectAPI
|
188
200
|
app_store_version = get_edit_app_store_version(platform: platform)
|
189
201
|
|
190
202
|
if app_store_version
|
191
203
|
if version_string != app_store_version.version_string
|
192
204
|
attributes = { versionString: version_string }
|
193
|
-
app_store_version.update(attributes: attributes)
|
205
|
+
app_store_version.update(client: client, attributes: attributes)
|
194
206
|
return true
|
195
207
|
end
|
196
208
|
return false
|
197
209
|
else
|
198
210
|
attributes = { versionString: version_string, platform: platform }
|
199
|
-
|
211
|
+
client.post_app_store_version(app_id: id, attributes: attributes)
|
200
212
|
|
201
213
|
return true
|
202
214
|
end
|
203
215
|
end
|
204
216
|
|
205
|
-
def get_latest_app_store_version(platform: nil, includes: nil)
|
217
|
+
def get_latest_app_store_version(client: nil, platform: nil, includes: nil)
|
218
|
+
client ||= Spaceship::ConnectAPI
|
206
219
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
207
220
|
filter = {
|
208
221
|
platform: platform
|
209
222
|
}
|
210
223
|
|
211
224
|
# Get the latest version
|
212
|
-
return get_app_store_versions(filter: filter, includes: includes)
|
225
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes)
|
213
226
|
.sort_by { |v| Date.parse(v.created_date) }
|
214
227
|
.last
|
215
228
|
end
|
216
229
|
|
217
|
-
def get_live_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
230
|
+
def get_live_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
231
|
+
client ||= Spaceship::ConnectAPI
|
218
232
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
219
233
|
filter = {
|
220
|
-
appStoreState:
|
234
|
+
appStoreState: [
|
235
|
+
Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE,
|
236
|
+
Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REMOVED_FROM_SALE
|
237
|
+
].join(","),
|
221
238
|
platform: platform
|
222
239
|
}
|
223
|
-
return get_app_store_versions(filter: filter, includes: includes).first
|
240
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes).first
|
224
241
|
end
|
225
242
|
|
226
|
-
def get_edit_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
243
|
+
def get_edit_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
244
|
+
client ||= Spaceship::ConnectAPI
|
227
245
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
228
246
|
filter = {
|
229
247
|
appStoreState: [
|
@@ -238,21 +256,23 @@ module Spaceship
|
|
238
256
|
}
|
239
257
|
|
240
258
|
# Get the latest version
|
241
|
-
return get_app_store_versions(filter: filter, includes: includes)
|
259
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes)
|
242
260
|
.sort_by { |v| Gem::Version.new(v.version_string) }
|
243
261
|
.last
|
244
262
|
end
|
245
263
|
|
246
|
-
def get_in_review_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
264
|
+
def get_in_review_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
265
|
+
client ||= Spaceship::ConnectAPI
|
247
266
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
248
267
|
filter = {
|
249
268
|
appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
|
250
269
|
platform: platform
|
251
270
|
}
|
252
|
-
return get_app_store_versions(filter: filter, includes: includes).first
|
271
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes).first
|
253
272
|
end
|
254
273
|
|
255
|
-
def get_pending_release_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
274
|
+
def get_pending_release_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
275
|
+
client ||= Spaceship::ConnectAPI
|
256
276
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
257
277
|
filter = {
|
258
278
|
appStoreState: [
|
@@ -261,12 +281,18 @@ module Spaceship
|
|
261
281
|
].join(','),
|
262
282
|
platform: platform
|
263
283
|
}
|
264
|
-
return get_app_store_versions(filter: filter, includes: includes).first
|
284
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes).first
|
265
285
|
end
|
266
286
|
|
267
|
-
def get_app_store_versions(filter: {}, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES, limit: nil, sort: nil)
|
268
|
-
|
269
|
-
|
287
|
+
def get_app_store_versions(client: nil, filter: {}, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES, limit: nil, sort: nil)
|
288
|
+
client ||= Spaceship::ConnectAPI
|
289
|
+
if limit.nil?
|
290
|
+
resps = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
291
|
+
return resps.flat_map(&:to_models)
|
292
|
+
else
|
293
|
+
resp = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
|
294
|
+
return resp.to_models
|
295
|
+
end
|
270
296
|
end
|
271
297
|
|
272
298
|
#
|
@@ -291,11 +317,12 @@ module Spaceship
|
|
291
317
|
# Beta Feedback
|
292
318
|
#
|
293
319
|
|
294
|
-
def get_beta_feedback(filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
|
320
|
+
def get_beta_feedback(client: nil, filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
|
321
|
+
client ||= Spaceship::ConnectAPI
|
295
322
|
filter ||= {}
|
296
323
|
filter["build.app"] = id
|
297
324
|
|
298
|
-
resps =
|
325
|
+
resps = client.get_beta_feedback(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
299
326
|
return resps.flat_map(&:to_models)
|
300
327
|
end
|
301
328
|
|
@@ -303,11 +330,12 @@ module Spaceship
|
|
303
330
|
# Beta Testers
|
304
331
|
#
|
305
332
|
|
306
|
-
def get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil)
|
333
|
+
def get_beta_testers(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
334
|
+
client ||= Spaceship::ConnectAPI
|
307
335
|
filter ||= {}
|
308
336
|
filter[:apps] = id
|
309
337
|
|
310
|
-
resps =
|
338
|
+
resps = client.get_beta_testers(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
311
339
|
return resps.flat_map(&:to_models)
|
312
340
|
end
|
313
341
|
|
@@ -315,40 +343,45 @@ module Spaceship
|
|
315
343
|
# Builds
|
316
344
|
#
|
317
345
|
|
318
|
-
def get_builds(filter: {}, includes: nil, limit: nil, sort: nil)
|
346
|
+
def get_builds(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
347
|
+
client ||= Spaceship::ConnectAPI
|
319
348
|
filter ||= {}
|
320
349
|
filter[:app] = id
|
321
350
|
|
322
|
-
resps =
|
351
|
+
resps = client.get_builds(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
323
352
|
return resps.flat_map(&:to_models)
|
324
353
|
end
|
325
354
|
|
326
|
-
def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
|
355
|
+
def get_build_deliveries(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
356
|
+
client ||= Spaceship::ConnectAPI
|
327
357
|
filter ||= {}
|
328
358
|
filter[:app] = id
|
329
359
|
|
330
|
-
resps =
|
360
|
+
resps = client.get_build_deliveries(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
331
361
|
return resps.flat_map(&:to_models)
|
332
362
|
end
|
333
363
|
|
334
|
-
def get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
|
364
|
+
def get_beta_app_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
365
|
+
client ||= Spaceship::ConnectAPI
|
335
366
|
filter ||= {}
|
336
367
|
filter[:app] = id
|
337
368
|
|
338
|
-
resps =
|
369
|
+
resps = client.get_beta_app_localizations(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
339
370
|
return resps.flat_map(&:to_models)
|
340
371
|
end
|
341
372
|
|
342
|
-
def get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil)
|
373
|
+
def get_beta_groups(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
374
|
+
client ||= Spaceship::ConnectAPI
|
343
375
|
filter ||= {}
|
344
376
|
filter[:app] = id
|
345
377
|
|
346
|
-
resps =
|
378
|
+
resps = client.get_beta_groups(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
347
379
|
return resps.flat_map(&:to_models)
|
348
380
|
end
|
349
381
|
|
350
|
-
def create_beta_group(group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
|
351
|
-
|
382
|
+
def create_beta_group(client: nil, group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
|
383
|
+
client ||= Spaceship::ConnectAPI
|
384
|
+
resps = client.create_beta_group(
|
352
385
|
app_id: id,
|
353
386
|
group_name: group_name,
|
354
387
|
public_link_enabled: public_link_enabled,
|
@@ -378,9 +411,10 @@ module Spaceship
|
|
378
411
|
# Users
|
379
412
|
#
|
380
413
|
|
381
|
-
def add_users(user_ids: nil)
|
414
|
+
def add_users(client: nil, user_ids: nil)
|
415
|
+
client ||= Spaceship::ConnectAPI
|
382
416
|
user_ids.each do |user_id|
|
383
|
-
|
417
|
+
client.add_user_visible_apps(user_id: user_id, app_ids: [id])
|
384
418
|
end
|
385
419
|
end
|
386
420
|
end
|