fastlane 2.163.0 → 2.168.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 +80 -80
- data/cert/lib/cert/options.rb +1 -1
- data/cert/lib/cert/runner.rb +2 -2
- data/deliver/lib/deliver/app_screenshot.rb +6 -2
- data/deliver/lib/deliver/queue_worker.rb +14 -29
- data/deliver/lib/deliver/upload_metadata.rb +7 -2
- data/deliver/lib/deliver/upload_screenshots.rb +3 -5
- data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
- 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 +5 -1
- data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +9 -0
- data/fastlane/lib/fastlane/actions/import_from_git.rb +9 -1
- data/fastlane/lib/fastlane/actions/is_ci.rb +1 -1
- data/fastlane/lib/fastlane/actions/register_devices.rb +4 -1
- data/fastlane/lib/fastlane/actions/set_changelog.rb +31 -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_to_app_store.rb +3 -3
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +2 -2
- data/fastlane/lib/fastlane/fast_file.rb +74 -23
- data/fastlane/lib/fastlane/features.rb +1 -1
- data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -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 +37 -16
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -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 +8 -4
- 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 +5 -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/device_manager.rb +8 -4
- data/fastlane_core/lib/fastlane_core/helper.rb +11 -3
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -3
- data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -1
- 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/match/lib/match/importer.rb +33 -21
- data/match/lib/match/module.rb +1 -1
- data/match/lib/match/nuke.rb +9 -5
- data/match/lib/match/options.rb +8 -2
- data/pilot/lib/pilot/build_manager.rb +9 -3
- data/scan/lib/scan/detect_values.rb +8 -9
- data/scan/lib/scan/module.rb +4 -0
- data/scan/lib/scan/options.rb +9 -0
- data/scan/lib/scan/runner.rb +4 -3
- data/sigh/lib/assets/resign.sh +1 -1
- data/sigh/lib/sigh/runner.rb +4 -4
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +2 -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/connect_api.rb +2 -0
- data/spaceship/lib/spaceship/connect_api/client.rb +7 -4
- data/spaceship/lib/spaceship/connect_api/models/.app.rb.swp +0 -0
- data/spaceship/lib/spaceship/connect_api/models/.app_screenshot.rb.swp +0 -0
- data/spaceship/lib/spaceship/connect_api/models/.build.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 +127 -51
- data/spaceship/lib/spaceship/connect_api/models/app_info.rb +15 -10
- data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +6 -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 +54 -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/custom_app_organization.rb +43 -0
- data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
- data/spaceship/lib/spaceship/connect_api/models/device.rb +6 -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/spaceship.rb +7 -4
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +71 -0
- data/spaceship/lib/spaceship/tunes/iap_detail.rb +1 -1
- data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
- data/supply/lib/supply.rb +1 -1
- data/supply/lib/supply/options.rb +1 -1
- data/supply/lib/supply/uploader.rb +4 -3
- metadata +24 -20
- data/fastlane/lib/fastlane/actions/.register_device.rb.swp +0 -0
- data/fastlane/lib/fastlane/actions/.register_devices.rb.swp +0 -0
data/sigh/lib/sigh/runner.rb
CHANGED
@@ -139,7 +139,7 @@ module Sigh
|
|
139
139
|
# Skip certificates that failed to download
|
140
140
|
next unless current_cert[:downloaded]
|
141
141
|
file = Tempfile.new('cert')
|
142
|
-
file.write(current_cert[:downloaded])
|
142
|
+
file.write(current_cert[:downloaded].force_encoding('UTF-8'))
|
143
143
|
file.close
|
144
144
|
if FastlaneCore::CertChecker.installed?(file.path)
|
145
145
|
installed = true
|
@@ -303,7 +303,7 @@ module Sigh
|
|
303
303
|
end
|
304
304
|
|
305
305
|
if Sigh.config[:cert_owner_name]
|
306
|
-
next unless c.
|
306
|
+
next unless c.display_name.strip == Sigh.config[:cert_owner_name].strip
|
307
307
|
end
|
308
308
|
|
309
309
|
true
|
@@ -315,7 +315,7 @@ module Sigh
|
|
315
315
|
certificates = certificates.find_all do |c|
|
316
316
|
file = Tempfile.new('cert')
|
317
317
|
raw_data = Base64.decode64(c.certificate_content)
|
318
|
-
file.write(raw_data)
|
318
|
+
file.write(raw_data.force_encoding("UTF-8"))
|
319
319
|
file.close
|
320
320
|
|
321
321
|
FastlaneCore::CertChecker.installed?(file.path)
|
@@ -327,7 +327,7 @@ module Sigh
|
|
327
327
|
UI.important("Found more than one code signing identity. Choosing the first one. Check out `fastlane sigh --help` to see all available options.")
|
328
328
|
UI.important("Available Code Signing Identities for current filters:")
|
329
329
|
certificates.each do |c|
|
330
|
-
str = ["\t- Name:", c.
|
330
|
+
str = ["\t- Name:", c.display_name, "- ID:", c.id + " - Expires", c.expires.strftime("%d/%m/%Y")].join(" ")
|
331
331
|
UI.message(str.green)
|
332
332
|
end
|
333
333
|
end
|
@@ -18,6 +18,7 @@ module Snapshot
|
|
18
18
|
|
19
19
|
def initialize(launcher_configuration: nil)
|
20
20
|
@launcher_config = launcher_configuration
|
21
|
+
@device_boot_datetime = DateTime.now
|
21
22
|
end
|
22
23
|
|
23
24
|
def collected_errors
|
@@ -192,7 +193,7 @@ module Snapshot
|
|
192
193
|
|
193
194
|
UI.header("Collecting system logs #{device_name} - #{language}")
|
194
195
|
log_identity = Digest::MD5.hexdigest(components.join("-"))
|
195
|
-
FastlaneCore::Simulator.copy_logs(device, log_identity, language_folder)
|
196
|
+
FastlaneCore::Simulator.copy_logs(device, log_identity, language_folder, @device_boot_datetime)
|
196
197
|
end
|
197
198
|
end
|
198
199
|
end
|
@@ -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)
|
@@ -31,6 +31,8 @@ require 'spaceship/connect_api/models/beta_tester_metric'
|
|
31
31
|
require 'spaceship/connect_api/models/build'
|
32
32
|
require 'spaceship/connect_api/models/build_delivery'
|
33
33
|
require 'spaceship/connect_api/models/build_beta_detail'
|
34
|
+
require 'spaceship/connect_api/models/custom_app_organization'
|
35
|
+
require 'spaceship/connect_api/models/custom_app_user'
|
34
36
|
require 'spaceship/connect_api/models/pre_release_version'
|
35
37
|
|
36
38
|
require 'spaceship/connect_api/models/age_rating_declaration'
|
@@ -13,20 +13,23 @@ module Spaceship
|
|
13
13
|
|
14
14
|
# Initializes client with Apple's App Store Connect JWT auth key.
|
15
15
|
#
|
16
|
-
# This method will automatically use the
|
16
|
+
# This method will automatically use the arguments from environment
|
17
17
|
# variables if not given.
|
18
18
|
#
|
19
|
-
#
|
19
|
+
# The key_id, issuer_id and either filepath or key are needed to authenticate.
|
20
20
|
#
|
21
21
|
# @param key_id (String) (optional): The key id
|
22
22
|
# @param issuer_id (String) (optional): The issuer id
|
23
23
|
# @param filepath (String) (optional): The filepath
|
24
|
+
# @param key (String) (optional): The key
|
25
|
+
# @param duration (Integer) (optional): How long this session should last
|
26
|
+
# @param in_house (Boolean) (optional): Whether this session is an Enterprise one
|
24
27
|
#
|
25
28
|
# @raise InvalidUserCredentialsError: raised if authentication failed
|
26
29
|
#
|
27
30
|
# @return (Spaceship::ConnectAPI::Client) The client the login method was called for
|
28
|
-
def self.auth(key_id: nil, issuer_id: nil, filepath: nil)
|
29
|
-
token = Spaceship::ConnectAPI::Token.create(key_id: key_id, issuer_id: issuer_id, filepath: filepath)
|
31
|
+
def self.auth(key_id: nil, issuer_id: nil, filepath: nil, key: nil, duration: nil, in_house: nil)
|
32
|
+
token = Spaceship::ConnectAPI::Token.create(key_id: key_id, issuer_id: issuer_id, filepath: filepath, key: key, duration: duration, in_house: in_house)
|
30
33
|
return ConnectAPI::Client.new(token: token)
|
31
34
|
end
|
32
35
|
|
Binary file
|
Binary file
|
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
|
@@ -18,11 +18,26 @@ module Spaceship
|
|
18
18
|
attr_accessor :app_store_versions
|
19
19
|
attr_accessor :prices
|
20
20
|
|
21
|
+
# Only available with Apple ID auth
|
22
|
+
attr_accessor :distribution_type
|
23
|
+
attr_accessor :educationDiscountType
|
24
|
+
|
21
25
|
module ContentRightsDeclaration
|
22
26
|
USES_THIRD_PARTY_CONTENT = "USES_THIRD_PARTY_CONTENT"
|
23
27
|
DOES_NOT_USE_THIRD_PARTY_CONTENT = "DOES_NOT_USE_THIRD_PARTY_CONTENT"
|
24
28
|
end
|
25
29
|
|
30
|
+
module DistributionType
|
31
|
+
APP_STORE = "APP_STORE"
|
32
|
+
CUSTOM = "CUSTOM"
|
33
|
+
end
|
34
|
+
|
35
|
+
module EducationDiscountType
|
36
|
+
DISCOUNTED = "DISCOUNTED"
|
37
|
+
NOT_APPLICABLE = "NOT_APPLICABLE"
|
38
|
+
NOT_DISCOUNTED = "NOT_DISCOUNTED"
|
39
|
+
end
|
40
|
+
|
26
41
|
self.attr_mapping({
|
27
42
|
"name" => "name",
|
28
43
|
"bundleId" => "bundle_id",
|
@@ -32,6 +47,8 @@ module Spaceship
|
|
32
47
|
"removed" => "removed",
|
33
48
|
"isAAG" => "is_aag",
|
34
49
|
"availableInNewTerritories" => "available_in_new_territories",
|
50
|
+
"distributionType" => "distribution_type",
|
51
|
+
"educationDiscountType" => "education_discount_type",
|
35
52
|
|
36
53
|
"contentRightsDeclaration" => "content_rights_declaration",
|
37
54
|
|
@@ -52,19 +69,22 @@ module Spaceship
|
|
52
69
|
# Apps
|
53
70
|
#
|
54
71
|
|
55
|
-
def self.all(filter: {}, includes: ESSENTIAL_INCLUDES, limit: nil, sort: nil)
|
56
|
-
|
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
|
57
75
|
return resps.flat_map(&:to_models)
|
58
76
|
end
|
59
77
|
|
60
|
-
def self.find(bundle_id)
|
61
|
-
|
78
|
+
def self.find(bundle_id, client: nil)
|
79
|
+
client ||= Spaceship::ConnectAPI
|
80
|
+
return all(client: client, filter: { bundleId: bundle_id }).find do |app|
|
62
81
|
app.bundle_id == bundle_id
|
63
82
|
end
|
64
83
|
end
|
65
84
|
|
66
|
-
def self.create(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, company_name: nil)
|
67
|
-
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(
|
68
88
|
name: name,
|
69
89
|
version_string: version_string,
|
70
90
|
sku: sku,
|
@@ -75,20 +95,23 @@ module Spaceship
|
|
75
95
|
)
|
76
96
|
end
|
77
97
|
|
78
|
-
def self.get(app_id: nil, includes: "appStoreVersions")
|
79
|
-
|
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
|
80
101
|
end
|
81
102
|
|
82
|
-
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
|
83
105
|
attributes = reverse_attr_mapping(attributes)
|
84
|
-
return
|
106
|
+
return client.patch_app(app_id: id, attributes: attributes, app_price_tier_id: app_price_tier_id, territory_ids: territory_ids)
|
85
107
|
end
|
86
108
|
|
87
109
|
#
|
88
110
|
# App Info
|
89
111
|
#
|
90
112
|
|
91
|
-
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
|
92
115
|
states = [
|
93
116
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::READY_FOR_SALE,
|
94
117
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_APPLE_RELEASE,
|
@@ -97,13 +120,14 @@ module Spaceship
|
|
97
120
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::IN_REVIEW
|
98
121
|
]
|
99
122
|
|
100
|
-
resp =
|
123
|
+
resp = client.get_app_infos(app_id: id, includes: includes)
|
101
124
|
return resp.to_models.select do |model|
|
102
125
|
states.include?(model.app_store_state)
|
103
126
|
end.first
|
104
127
|
end
|
105
128
|
|
106
|
-
def fetch_edit_app_info(includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
|
129
|
+
def fetch_edit_app_info(client: nil, includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
|
130
|
+
client ||= Spaceship::ConnectAPI
|
107
131
|
states = [
|
108
132
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::PREPARE_FOR_SUBMISSION,
|
109
133
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REJECTED,
|
@@ -113,7 +137,7 @@ module Spaceship
|
|
113
137
|
Spaceship::ConnectAPI::AppInfo::AppStoreState::INVALID_BINARY
|
114
138
|
]
|
115
139
|
|
116
|
-
resp =
|
140
|
+
resp = client.get_app_infos(app_id: id, includes: includes)
|
117
141
|
return resp.to_models.select do |model|
|
118
142
|
states.include?(model.app_store_state)
|
119
143
|
end.first
|
@@ -123,9 +147,10 @@ module Spaceship
|
|
123
147
|
# Available Territories
|
124
148
|
#
|
125
149
|
|
126
|
-
def fetch_available_territories(filter: {}, includes: nil, limit: nil, sort: nil)
|
150
|
+
def fetch_available_territories(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
151
|
+
client ||= Spaceship::ConnectAPI
|
127
152
|
filter ||= {}
|
128
|
-
resps =
|
153
|
+
resps = client.get_available_territories(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
129
154
|
return resps.flat_map(&:to_models)
|
130
155
|
end
|
131
156
|
|
@@ -133,8 +158,9 @@ module Spaceship
|
|
133
158
|
# App Pricing
|
134
159
|
#
|
135
160
|
|
136
|
-
def fetch_app_prices(filter: {}, includes: "priceTier", limit: nil, sort: nil)
|
137
|
-
|
161
|
+
def fetch_app_prices(client: nil, filter: {}, includes: "priceTier", limit: nil, sort: nil)
|
162
|
+
client ||= Spaceship::ConnectAPI
|
163
|
+
resp = client.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
|
138
164
|
return resp.to_models
|
139
165
|
end
|
140
166
|
|
@@ -142,7 +168,8 @@ module Spaceship
|
|
142
168
|
# App Store Versions
|
143
169
|
#
|
144
170
|
|
145
|
-
def reject_version_if_possible!(platform: nil)
|
171
|
+
def reject_version_if_possible!(client: nil, platform: nil)
|
172
|
+
client ||= Spaceship::ConnectAPI
|
146
173
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
147
174
|
filter = {
|
148
175
|
appStoreState: [
|
@@ -155,7 +182,7 @@ module Spaceship
|
|
155
182
|
}
|
156
183
|
|
157
184
|
# Get the latest version
|
158
|
-
version = get_app_store_versions(filter: filter, includes: "appStoreVersionSubmission")
|
185
|
+
version = get_app_store_versions(client: client, filter: filter, includes: "appStoreVersionSubmission")
|
159
186
|
.sort_by { |v| Gem::Version.new(v.version_string) }
|
160
187
|
.last
|
161
188
|
|
@@ -167,46 +194,50 @@ module Spaceship
|
|
167
194
|
# This will either create a new version or change the version number
|
168
195
|
# from an existing version
|
169
196
|
# @return (Bool) Was something changed?
|
170
|
-
def ensure_version!(version_string, platform: nil)
|
197
|
+
def ensure_version!(version_string, platform: nil, client: nil)
|
198
|
+
client ||= Spaceship::ConnectAPI
|
171
199
|
app_store_version = get_edit_app_store_version(platform: platform)
|
172
200
|
|
173
201
|
if app_store_version
|
174
202
|
if version_string != app_store_version.version_string
|
175
203
|
attributes = { versionString: version_string }
|
176
|
-
app_store_version.update(attributes: attributes)
|
204
|
+
app_store_version.update(client: client, attributes: attributes)
|
177
205
|
return true
|
178
206
|
end
|
179
207
|
return false
|
180
208
|
else
|
181
209
|
attributes = { versionString: version_string, platform: platform }
|
182
|
-
|
210
|
+
client.post_app_store_version(app_id: id, attributes: attributes)
|
183
211
|
|
184
212
|
return true
|
185
213
|
end
|
186
214
|
end
|
187
215
|
|
188
|
-
def get_latest_app_store_version(platform: nil, includes: nil)
|
216
|
+
def get_latest_app_store_version(client: nil, platform: nil, includes: nil)
|
217
|
+
client ||= Spaceship::ConnectAPI
|
189
218
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
190
219
|
filter = {
|
191
220
|
platform: platform
|
192
221
|
}
|
193
222
|
|
194
223
|
# Get the latest version
|
195
|
-
return get_app_store_versions(filter: filter, includes: includes)
|
224
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes)
|
196
225
|
.sort_by { |v| Date.parse(v.created_date) }
|
197
226
|
.last
|
198
227
|
end
|
199
228
|
|
200
|
-
def get_live_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
229
|
+
def get_live_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
230
|
+
client ||= Spaceship::ConnectAPI
|
201
231
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
202
232
|
filter = {
|
203
233
|
appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE,
|
204
234
|
platform: platform
|
205
235
|
}
|
206
|
-
return get_app_store_versions(filter: filter, includes: includes).first
|
236
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes).first
|
207
237
|
end
|
208
238
|
|
209
|
-
def get_edit_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
239
|
+
def get_edit_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
240
|
+
client ||= Spaceship::ConnectAPI
|
210
241
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
211
242
|
filter = {
|
212
243
|
appStoreState: [
|
@@ -221,21 +252,23 @@ module Spaceship
|
|
221
252
|
}
|
222
253
|
|
223
254
|
# Get the latest version
|
224
|
-
return get_app_store_versions(filter: filter, includes: includes)
|
255
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes)
|
225
256
|
.sort_by { |v| Gem::Version.new(v.version_string) }
|
226
257
|
.last
|
227
258
|
end
|
228
259
|
|
229
|
-
def get_in_review_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
260
|
+
def get_in_review_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
261
|
+
client ||= Spaceship::ConnectAPI
|
230
262
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
231
263
|
filter = {
|
232
264
|
appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
|
233
265
|
platform: platform
|
234
266
|
}
|
235
|
-
return get_app_store_versions(filter: filter, includes: includes).first
|
267
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes).first
|
236
268
|
end
|
237
269
|
|
238
|
-
def get_pending_release_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
270
|
+
def get_pending_release_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
|
271
|
+
client ||= Spaceship::ConnectAPI
|
239
272
|
platform ||= Spaceship::ConnectAPI::Platform::IOS
|
240
273
|
filter = {
|
241
274
|
appStoreState: [
|
@@ -244,23 +277,43 @@ module Spaceship
|
|
244
277
|
].join(','),
|
245
278
|
platform: platform
|
246
279
|
}
|
247
|
-
return get_app_store_versions(filter: filter, includes: includes).first
|
280
|
+
return get_app_store_versions(client: client, filter: filter, includes: includes).first
|
248
281
|
end
|
249
282
|
|
250
|
-
def get_app_store_versions(filter: {}, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES, limit: nil, sort: nil)
|
251
|
-
|
283
|
+
def get_app_store_versions(client: nil, filter: {}, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES, limit: nil, sort: nil)
|
284
|
+
client ||= Spaceship::ConnectAPI
|
285
|
+
resps = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
252
286
|
return resps.flat_map(&:to_models)
|
253
287
|
end
|
254
288
|
|
289
|
+
#
|
290
|
+
# B2B
|
291
|
+
#
|
292
|
+
|
293
|
+
def disable_b2b
|
294
|
+
update(attributes: {
|
295
|
+
distributionType: DistributionType::APP_STORE,
|
296
|
+
education_discount_type: EducationDiscountType::NOT_DISCOUNTED
|
297
|
+
})
|
298
|
+
end
|
299
|
+
|
300
|
+
def enable_b2b
|
301
|
+
update(attributes: {
|
302
|
+
distributionType: App::DistributionType::CUSTOM,
|
303
|
+
education_discount_type: EducationDiscountType::NOT_APPLICABLE
|
304
|
+
})
|
305
|
+
end
|
306
|
+
|
255
307
|
#
|
256
308
|
# Beta Feedback
|
257
309
|
#
|
258
310
|
|
259
|
-
def get_beta_feedback(filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
|
311
|
+
def get_beta_feedback(client: nil, filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
|
312
|
+
client ||= Spaceship::ConnectAPI
|
260
313
|
filter ||= {}
|
261
314
|
filter["build.app"] = id
|
262
315
|
|
263
|
-
resps =
|
316
|
+
resps = client.get_beta_feedback(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
264
317
|
return resps.flat_map(&:to_models)
|
265
318
|
end
|
266
319
|
|
@@ -268,11 +321,12 @@ module Spaceship
|
|
268
321
|
# Beta Testers
|
269
322
|
#
|
270
323
|
|
271
|
-
def get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil)
|
324
|
+
def get_beta_testers(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
325
|
+
client ||= Spaceship::ConnectAPI
|
272
326
|
filter ||= {}
|
273
327
|
filter[:apps] = id
|
274
328
|
|
275
|
-
resps =
|
329
|
+
resps = client.get_beta_testers(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
276
330
|
return resps.flat_map(&:to_models)
|
277
331
|
end
|
278
332
|
|
@@ -280,40 +334,45 @@ module Spaceship
|
|
280
334
|
# Builds
|
281
335
|
#
|
282
336
|
|
283
|
-
def get_builds(filter: {}, includes: nil, limit: nil, sort: nil)
|
337
|
+
def get_builds(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
338
|
+
client ||= Spaceship::ConnectAPI
|
284
339
|
filter ||= {}
|
285
340
|
filter[:app] = id
|
286
341
|
|
287
|
-
resps =
|
342
|
+
resps = client.get_builds(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
288
343
|
return resps.flat_map(&:to_models)
|
289
344
|
end
|
290
345
|
|
291
|
-
def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
|
346
|
+
def get_build_deliveries(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
347
|
+
client ||= Spaceship::ConnectAPI
|
292
348
|
filter ||= {}
|
293
349
|
filter[:app] = id
|
294
350
|
|
295
|
-
resps =
|
351
|
+
resps = client.get_build_deliveries(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
296
352
|
return resps.flat_map(&:to_models)
|
297
353
|
end
|
298
354
|
|
299
|
-
def get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
|
355
|
+
def get_beta_app_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
356
|
+
client ||= Spaceship::ConnectAPI
|
300
357
|
filter ||= {}
|
301
358
|
filter[:app] = id
|
302
359
|
|
303
|
-
resps =
|
360
|
+
resps = client.get_beta_app_localizations(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
304
361
|
return resps.flat_map(&:to_models)
|
305
362
|
end
|
306
363
|
|
307
|
-
def get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil)
|
364
|
+
def get_beta_groups(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
365
|
+
client ||= Spaceship::ConnectAPI
|
308
366
|
filter ||= {}
|
309
367
|
filter[:app] = id
|
310
368
|
|
311
|
-
resps =
|
369
|
+
resps = client.get_beta_groups(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
|
312
370
|
return resps.flat_map(&:to_models)
|
313
371
|
end
|
314
372
|
|
315
|
-
def create_beta_group(group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
|
316
|
-
|
373
|
+
def create_beta_group(client: nil, group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
|
374
|
+
client ||= Spaceship::ConnectAPI
|
375
|
+
resps = client.create_beta_group(
|
317
376
|
app_id: id,
|
318
377
|
group_name: group_name,
|
319
378
|
public_link_enabled: public_link_enabled,
|
@@ -323,13 +382,30 @@ module Spaceship
|
|
323
382
|
return resps.flat_map(&:to_models).first
|
324
383
|
end
|
325
384
|
|
385
|
+
#
|
386
|
+
# Education
|
387
|
+
#
|
388
|
+
|
389
|
+
def disable_educational_discount
|
390
|
+
update(attributes: {
|
391
|
+
education_discount_type: EducationDiscountType::NOT_DISCOUNTED
|
392
|
+
})
|
393
|
+
end
|
394
|
+
|
395
|
+
def enable_educational_discount
|
396
|
+
update(attributes: {
|
397
|
+
education_discount_type: EducationDiscountType::DISCOUNTED
|
398
|
+
})
|
399
|
+
end
|
400
|
+
|
326
401
|
#
|
327
402
|
# Users
|
328
403
|
#
|
329
404
|
|
330
|
-
def add_users(user_ids: nil)
|
405
|
+
def add_users(client: nil, user_ids: nil)
|
406
|
+
client ||= Spaceship::ConnectAPI
|
331
407
|
user_ids.each do |user_id|
|
332
|
-
|
408
|
+
client.add_user_visible_apps(user_id: user_id, app_ids: [id])
|
333
409
|
end
|
334
410
|
end
|
335
411
|
end
|