fastlane 2.167.0 → 2.172.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +76 -76
  3. data/cert/lib/cert/options.rb +3 -3
  4. data/deliver/lib/deliver/app_screenshot.rb +5 -7
  5. data/deliver/lib/deliver/app_screenshot_validator.rb +108 -0
  6. data/deliver/lib/deliver/commands_generator.rb +1 -1
  7. data/deliver/lib/deliver/loader.rb +123 -21
  8. data/deliver/lib/deliver/setup.rb +8 -3
  9. data/deliver/lib/deliver/upload_metadata.rb +6 -10
  10. data/deliver/lib/deliver/upload_screenshots.rb +1 -64
  11. data/fastlane/lib/fastlane/actions/{.download_dsyms.rb.swp → .update_fastlane.rb.swp} +0 -0
  12. data/fastlane/lib/fastlane/actions/add_git_tag.rb +12 -3
  13. data/fastlane/lib/fastlane/actions/artifactory.rb +36 -3
  14. data/fastlane/lib/fastlane/actions/build_app.rb +3 -1
  15. data/fastlane/lib/fastlane/actions/create_pull_request.rb +16 -1
  16. data/fastlane/lib/fastlane/actions/create_xcframework.rb +118 -0
  17. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  18. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +1 -1
  19. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +4 -0
  20. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +5 -1
  21. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +142 -0
  22. data/fastlane/lib/fastlane/actions/download_dsyms.rb +0 -1
  23. data/fastlane/lib/fastlane/actions/git_commit.rb +6 -2
  24. data/fastlane/lib/fastlane/actions/github_api.rb +14 -3
  25. data/fastlane/lib/fastlane/actions/nexus_upload.rb +1 -0
  26. data/fastlane/lib/fastlane/actions/onesignal.rb +13 -3
  27. data/fastlane/lib/fastlane/actions/pod_push.rb +9 -0
  28. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +9 -1
  29. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  30. data/fastlane/lib/fastlane/actions/register_devices.rb +2 -1
  31. data/fastlane/lib/fastlane/actions/set_github_release.rb +21 -8
  32. data/fastlane/lib/fastlane/actions/slack.rb +4 -5
  33. data/fastlane/lib/fastlane/actions/slather.rb +2 -2
  34. data/fastlane/lib/fastlane/actions/spm.rb +2 -2
  35. data/fastlane/lib/fastlane/actions/swiftlint.rb +4 -4
  36. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +291 -0
  37. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +3 -3
  38. data/fastlane/lib/fastlane/actions/xcode_install.rb +8 -5
  39. data/fastlane/lib/fastlane/cli_tools_distributor.rb +3 -0
  40. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -1
  41. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +3 -0
  42. data/fastlane/lib/fastlane/version.rb +1 -1
  43. data/fastlane/swift/Deliverfile.swift +2 -2
  44. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  45. data/fastlane/swift/Fastlane.swift +276 -54
  46. data/fastlane/swift/Gymfile.swift +2 -2
  47. data/fastlane/swift/GymfileProtocol.swift +15 -3
  48. data/fastlane/swift/Matchfile.swift +2 -2
  49. data/fastlane/swift/MatchfileProtocol.swift +4 -4
  50. data/fastlane/swift/Precheckfile.swift +2 -2
  51. data/fastlane/swift/PrecheckfileProtocol.swift +6 -2
  52. data/fastlane/swift/Scanfile.swift +2 -2
  53. data/fastlane/swift/ScanfileProtocol.swift +18 -2
  54. data/fastlane/swift/Screengrabfile.swift +2 -2
  55. data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
  56. data/fastlane/swift/Snapshotfile.swift +2 -2
  57. data/fastlane/swift/SnapshotfileProtocol.swift +15 -3
  58. data/fastlane_core/lib/fastlane_core/helper.rb +3 -3
  59. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +41 -16
  60. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -4
  61. data/fastlane_core/lib/fastlane_core/project.rb +18 -5
  62. data/frameit/lib/frameit/device_types.rb +7 -1
  63. data/gym/lib/gym/generators/build_command_generator.rb +3 -0
  64. data/gym/lib/gym/options.rb +19 -3
  65. data/match/lib/match/encryption/openssl.rb +4 -2
  66. data/match/lib/match/module.rb +1 -1
  67. data/match/lib/match/options.rb +1 -1
  68. data/match/lib/match/runner.rb +1 -1
  69. data/match/lib/match/storage/git_storage.rb +14 -10
  70. data/precheck/lib/precheck/options.rb +6 -1
  71. data/precheck/lib/precheck/rule_processor.rb +1 -1
  72. data/precheck/lib/precheck/runner.rb +1 -1
  73. data/scan/lib/scan/options.rb +22 -1
  74. data/scan/lib/scan/runner.rb +7 -2
  75. data/scan/lib/scan/slack_poster.rb +4 -1
  76. data/scan/lib/scan/test_command_generator.rb +3 -0
  77. data/screengrab/lib/screengrab/runner.rb +2 -0
  78. data/sigh/lib/sigh/runner.rb +1 -1
  79. data/snapshot/lib/assets/SnapshotHelper.swift +6 -2
  80. data/snapshot/lib/snapshot/options.rb +17 -2
  81. data/snapshot/lib/snapshot/update.rb +1 -1
  82. data/spaceship/lib/spaceship/client.rb +14 -0
  83. data/spaceship/lib/spaceship/connect_api.rb +6 -0
  84. data/spaceship/lib/spaceship/connect_api/api_client.rb +1 -1
  85. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +3 -2
  86. data/spaceship/lib/spaceship/connect_api/models/app.rb +94 -54
  87. data/spaceship/lib/spaceship/connect_api/models/app_data_usage.rb +59 -0
  88. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_category.rb +65 -0
  89. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_data_protection.rb +27 -0
  90. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_grouping.rb +18 -0
  91. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_purposes.rb +37 -0
  92. data/spaceship/lib/spaceship/connect_api/models/app_data_usages_publish_state.rb +36 -0
  93. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +16 -10
  94. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +8 -4
  95. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +15 -11
  96. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +13 -9
  97. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +9 -7
  98. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +15 -11
  99. data/spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb +7 -5
  100. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +6 -4
  101. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +62 -37
  102. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +21 -14
  103. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +3 -2
  104. data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +3 -2
  105. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +6 -4
  106. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +12 -2
  107. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +12 -8
  108. data/spaceship/lib/spaceship/connect_api/models/build.rb +24 -16
  109. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +3 -2
  110. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +9 -6
  111. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +6 -4
  112. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +12 -8
  113. data/spaceship/lib/spaceship/connect_api/models/device.rb +36 -4
  114. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +6 -4
  115. data/spaceship/lib/spaceship/connect_api/models/profile.rb +12 -8
  116. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +3 -2
  117. data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +9 -6
  118. data/spaceship/lib/spaceship/connect_api/models/territory.rb +3 -2
  119. data/spaceship/lib/spaceship/connect_api/models/user.rb +6 -4
  120. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +9 -6
  121. data/spaceship/lib/spaceship/connect_api/response.rb +3 -1
  122. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  123. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +103 -0
  124. data/spaceship/lib/spaceship/errors.rb +19 -0
  125. data/spaceship/lib/spaceship/tunes/iap_detail.rb +1 -1
  126. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  127. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +19 -6
  128. data/supply/lib/supply/options.rb +1 -1
  129. data/supply/lib/supply/uploader.rb +3 -2
  130. metadata +45 -21
@@ -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
@@ -21,6 +21,9 @@ module Spaceship
21
21
  attr_accessor :created_date
22
22
 
23
23
  attr_accessor :app_store_version_submission
24
+ attr_accessor :app_store_version_phased_release
25
+ attr_accessor :app_store_review_detail
26
+ attr_accessor :app_store_version_localizations
24
27
 
25
28
  module AppStoreState
26
29
  READY_FOR_SALE = "READY_FOR_SALE"
@@ -30,6 +33,7 @@ module Spaceship
30
33
  IN_REVIEW = "IN_REVIEW"
31
34
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
32
35
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
36
+ DEVELOPER_REMOVED_FROM_SALE = "DEVELOPER_REMOVED_FROM_SALE"
33
37
  REJECTED = "REJECTED"
34
38
  PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
35
39
  METADATA_REJECTED = "METADATA_REJECTED"
@@ -57,7 +61,10 @@ module Spaceship
57
61
  "createdDate" => "created_date",
58
62
 
59
63
  "appStoreVersionSubmission" => "app_store_version_submission",
60
- "build" => "build"
64
+ "build" => "build",
65
+ "appStoreVersionPhasedRelease" => "app_store_version_phased_release",
66
+ "appStoreReviewDetail" => "app_store_review_detail",
67
+ "appStoreVersionLocalizations" => "app_store_version_localizations"
61
68
  })
62
69
 
63
70
  ESSENTIAL_INCLUDES = [
@@ -85,24 +92,27 @@ module Spaceship
85
92
  #
86
93
 
87
94
  # 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(
95
+ def self.get(client: nil, app_store_version_id: nil, includes: nil, limit: nil, sort: nil)
96
+ client ||= Spaceship::ConnectAPI
97
+ return client.get_app_store_version(
90
98
  app_store_version_id: app_store_version_id,
91
99
  includes: includes
92
100
  ).first
93
101
  end
94
102
 
95
- def update(attributes: nil)
103
+ def update(client: nil, attributes: nil)
104
+ client ||= Spaceship::ConnectAPI
96
105
  attributes = reverse_attr_mapping(attributes)
97
- return Spaceship::ConnectAPI.patch_app_store_version(app_store_version_id: id, attributes: attributes).first
106
+ return client.patch_app_store_version(app_store_version_id: id, attributes: attributes).first
98
107
  end
99
108
 
100
109
  #
101
110
  # Age Rating Declaration
102
111
  #
103
112
 
104
- def fetch_age_rating_declaration
105
- resp = Spaceship::ConnectAPI.get_age_rating_declaration(app_store_version_id: id)
113
+ def fetch_age_rating_declaration(client: nil)
114
+ client ||= Spaceship::ConnectAPI
115
+ resp = client.get_age_rating_declaration(app_store_version_id: id)
106
116
  return resp.to_models.first
107
117
  end
108
118
 
@@ -110,27 +120,31 @@ module Spaceship
110
120
  # App Store Version Localizations
111
121
  #
112
122
 
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)
123
+ def create_app_store_version_localization(client: nil, attributes: nil)
124
+ client ||= Spaceship::ConnectAPI
125
+ resp = client.post_app_store_version_localization(app_store_version_id: id, attributes: attributes)
115
126
  return resp.to_models.first
116
127
  end
117
128
 
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)
129
+ def get_app_store_version_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
130
+ client ||= Spaceship::ConnectAPI
131
+ return Spaceship::ConnectAPI::AppStoreVersionLocalization.all(client: client, app_store_version_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
120
132
  end
121
133
 
122
134
  #
123
135
  # App Store Review Detail
124
136
  #
125
137
 
126
- def create_app_store_review_detail(attributes: nil)
138
+ def create_app_store_review_detail(client: nil, attributes: nil)
139
+ client ||= Spaceship::ConnectAPI
127
140
  attributes = Spaceship::ConnectAPI::AppStoreReviewDetail.reverse_attr_mapping(attributes)
128
- resp = Spaceship::ConnectAPI.post_app_store_review_detail(app_store_version_id: id, attributes: attributes)
141
+ resp = client.post_app_store_review_detail(app_store_version_id: id, attributes: attributes)
129
142
  return resp.to_models.first
130
143
  end
131
144
 
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)
145
+ def fetch_app_store_review_detail(client: nil, includes: "appStoreReviewAttachments")
146
+ client ||= Spaceship::ConnectAPI
147
+ resp = client.get_app_store_review_detail(app_store_version_id: id, includes: includes)
134
148
  return resp.to_models.first
135
149
  end
136
150
 
@@ -138,13 +152,15 @@ module Spaceship
138
152
  # App Store Version Phased Releases
139
153
  #
140
154
 
141
- def fetch_app_store_version_phased_release
142
- resp = Spaceship::ConnectAPI.get_app_store_version_phased_release(app_store_version_id: id)
155
+ def fetch_app_store_version_phased_release(client: nil)
156
+ client ||= Spaceship::ConnectAPI
157
+ resp = client.get_app_store_version_phased_release(app_store_version_id: id)
143
158
  return resp.to_models.first
144
159
  end
145
160
 
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)
161
+ def create_app_store_version_phased_release(client: nil, attributes: nil)
162
+ client ||= Spaceship::ConnectAPI
163
+ resp = client.post_app_store_version_phased_release(app_store_version_id: id, attributes: attributes)
148
164
  return resp.to_models.first
149
165
  end
150
166
 
@@ -152,13 +168,15 @@ module Spaceship
152
168
  # App Store Version Submissions
153
169
  #
154
170
 
155
- def fetch_app_store_version_submission
156
- resp = Spaceship::ConnectAPI.get_app_store_version_submission(app_store_version_id: id)
171
+ def fetch_app_store_version_submission(client: nil)
172
+ client ||= Spaceship::ConnectAPI
173
+ resp = client.get_app_store_version_submission(app_store_version_id: id)
157
174
  return resp.to_models.first
158
175
  end
159
176
 
160
- def create_app_store_version_submission
161
- resp = Spaceship::ConnectAPI.post_app_store_version_submission(app_store_version_id: id)
177
+ def create_app_store_version_submission(client: nil)
178
+ client ||= Spaceship::ConnectAPI
179
+ resp = client.post_app_store_version_submission(app_store_version_id: id)
162
180
  return resp.to_models.first
163
181
  end
164
182
 
@@ -166,8 +184,9 @@ module Spaceship
166
184
  # App Store Version Release Requests
167
185
  #
168
186
 
169
- def create_app_store_version_release_request
170
- resp = Spaceship::ConnectAPI.post_app_store_version_release_request(app_store_version_id: id)
187
+ def create_app_store_version_release_request(client: nil)
188
+ client ||= Spaceship::ConnectAPI
189
+ resp = client.post_app_store_version_release_request(app_store_version_id: id)
171
190
  return resp.to_models.first
172
191
  end
173
192
 
@@ -175,13 +194,15 @@ module Spaceship
175
194
  # Build
176
195
  #
177
196
 
178
- def get_build(build_id: nil)
179
- resp = Spaceship::ConnectAPI.get_build(app_store_version_id: id, build_id: build_id)
197
+ def get_build(client: nil, build_id: nil)
198
+ client ||= Spaceship::ConnectAPI
199
+ resp = client.get_build(app_store_version_id: id, build_id: build_id)
180
200
  return resp.to_models.first
181
201
  end
182
202
 
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)
203
+ def select_build(client: nil, build_id: nil)
204
+ client ||= Spaceship::ConnectAPI
205
+ resp = client.patch_app_store_version_with_build(app_store_version_id: id, build_id: build_id)
185
206
  return resp.to_models.first
186
207
  end
187
208
 
@@ -189,13 +210,15 @@ module Spaceship
189
210
  # IDFA Declarations
190
211
  #
191
212
 
192
- def fetch_idfa_declaration
193
- resp = Spaceship::ConnectAPI.get_idfa_declaration(app_store_version_id: id)
213
+ def fetch_idfa_declaration(client: nil)
214
+ client ||= Spaceship::ConnectAPI
215
+ resp = client.get_idfa_declaration(app_store_version_id: id)
194
216
  return resp.to_models.first
195
217
  end
196
218
 
197
- def create_idfa_declaration(attributes: nil)
198
- resp = Spaceship::ConnectAPI.post_idfa_declaration(app_store_version_id: id, attributes: attributes)
219
+ def create_idfa_declaration(client: nil, attributes: nil)
220
+ client ||= Spaceship::ConnectAPI
221
+ resp = client.post_idfa_declaration(app_store_version_id: id, attributes: attributes)
199
222
  return resp.to_models.first
200
223
  end
201
224
 
@@ -203,13 +226,15 @@ module Spaceship
203
226
  # Reset Ratings Requests
204
227
  #
205
228
 
206
- def fetch_reset_ratings_request
207
- resp = Spaceship::ConnectAPI.get_reset_ratings_request(app_store_version_id: id)
229
+ def fetch_reset_ratings_request(client: nil)
230
+ client ||= Spaceship::ConnectAPI
231
+ resp = client.get_reset_ratings_request(app_store_version_id: id)
208
232
  return resp.to_models.first
209
233
  end
210
234
 
211
- def create_reset_ratings_request
212
- resp = Spaceship::ConnectAPI.post_reset_ratings_request(app_store_version_id: id)
235
+ def create_reset_ratings_request(client: nil)
236
+ client ||= Spaceship::ConnectAPI
237
+ resp = client.post_reset_ratings_request(app_store_version_id: id)
213
238
  return resp.to_models.first
214
239
  end
215
240
  end
@@ -39,32 +39,37 @@ module Spaceship
39
39
  # API
40
40
  #
41
41
 
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)
42
+ def self.all(client: nil, app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
43
+ client ||= Spaceship::ConnectAPI
44
+ resp = client.get_app_store_version_localizations(app_store_version_id: app_store_version_id, filter: filter, includes: includes, limit: limit, sort: sort)
44
45
  return resp.to_models
45
46
  end
46
47
 
47
- def update(attributes: nil)
48
+ def update(client: nil, attributes: nil)
49
+ client ||= Spaceship::ConnectAPI
48
50
  attributes = reverse_attr_mapping(attributes)
49
- Spaceship::ConnectAPI.patch_app_store_version_localization(app_store_version_localization_id: id, attributes: attributes)
51
+ client.patch_app_store_version_localization(app_store_version_localization_id: id, attributes: attributes)
50
52
  end
51
53
 
52
- def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
53
- Spaceship::ConnectAPI.delete_app_store_version_localization(app_store_version_localization_id: id)
54
+ def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
55
+ client ||= Spaceship::ConnectAPI
56
+ client.delete_app_store_version_localization(app_store_version_localization_id: id)
54
57
  end
55
58
 
56
59
  #
57
60
  # App Preview Sets
58
61
  #
59
62
 
60
- def get_app_preview_sets(filter: {}, includes: "appPreviews", limit: nil, sort: nil)
63
+ def get_app_preview_sets(client: nil, filter: {}, includes: "appPreviews", limit: nil, sort: nil)
64
+ client ||= Spaceship::ConnectAPI
61
65
  filter ||= {}
62
66
  filter["appStoreVersionLocalization"] = id
63
- return Spaceship::ConnectAPI::AppPreviewSet.all(filter: filter, includes: includes, limit: limit, sort: sort)
67
+ return Spaceship::ConnectAPI::AppPreviewSet.all(client: client, filter: filter, includes: includes, limit: limit, sort: sort)
64
68
  end
65
69
 
66
- def create_app_preview_set(attributes: nil)
67
- resp = Spaceship::ConnectAPI.post_app_preview_set(app_store_version_localization_id: id, attributes: attributes)
70
+ def create_app_preview_set(client: nil, attributes: nil)
71
+ client ||= Spaceship::ConnectAPI
72
+ resp = client.post_app_preview_set(app_store_version_localization_id: id, attributes: attributes)
68
73
  return resp.to_models.first
69
74
  end
70
75
 
@@ -72,12 +77,14 @@ module Spaceship
72
77
  # App Screenshot Sets
73
78
  #
74
79
 
75
- def get_app_screenshot_sets(filter: {}, includes: "appScreenshots", limit: nil, sort: nil)
76
- return Spaceship::ConnectAPI::AppScreenshotSet.all(app_store_version_localization_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
80
+ def get_app_screenshot_sets(client: nil, filter: {}, includes: "appScreenshots", limit: nil, sort: nil)
81
+ client ||= Spaceship::ConnectAPI
82
+ return Spaceship::ConnectAPI::AppScreenshotSet.all(client: client, app_store_version_localization_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
77
83
  end
78
84
 
79
- def create_app_screenshot_set(attributes: nil)
80
- resp = Spaceship::ConnectAPI.post_app_screenshot_set(app_store_version_localization_id: id, attributes: attributes)
85
+ def create_app_screenshot_set(client: nil, attributes: nil)
86
+ client ||= Spaceship::ConnectAPI
87
+ resp = client.post_app_screenshot_set(app_store_version_localization_id: id, attributes: attributes)
81
88
  return resp.to_models.first
82
89
  end
83
90
  end
@@ -18,8 +18,9 @@ module Spaceship
18
18
  # API
19
19
  #
20
20
 
21
- def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
22
- Spaceship::ConnectAPI.delete_app_store_version_submission(app_store_version_submission_id: id)
21
+ def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
22
+ client ||= Spaceship::ConnectAPI
23
+ client.delete_app_store_version_submission(app_store_version_submission_id: id)
23
24
  end
24
25
  end
25
26
  end
@@ -18,8 +18,9 @@ module Spaceship
18
18
  # API
19
19
  #
20
20
 
21
- def delete!
22
- return Spaceship::ConnectAPI.delete_beta_app_review_submission(beta_app_review_submission_id: id)
21
+ def delete!(client: nil)
22
+ client ||= Spaceship::ConnectAPI
23
+ return client.delete_beta_app_review_submission(beta_app_review_submission_id: id)
23
24
  end
24
25
  end
25
26
  end
@@ -63,12 +63,14 @@ module Spaceship
63
63
  # API
64
64
  #
65
65
 
66
- def self.all(filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
67
- return Spaceship::ConnectAPI.get_beta_feedback(filter: filter, includes: includes, limit: limit, sort: sort)
66
+ def self.all(client: nil, filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
67
+ client ||= Spaceship::ConnectAPI
68
+ return client.get_beta_feedback(filter: filter, includes: includes, limit: limit, sort: sort)
68
69
  end
69
70
 
70
- def delete!
71
- return Spaceship::ConnectAPI.delete_beta_feedback(feedback_id: self.id)
71
+ def delete!(client: nil)
72
+ client ||= Spaceship::ConnectAPI
73
+ return client.delete_beta_feedback(feedback_id: self.id)
72
74
  end
73
75
  end
74
76
  end
@@ -33,8 +33,18 @@ module Spaceship
33
33
  #
34
34
 
35
35
  # beta_testers - [{email: "", firstName: "", lastName: ""}]
36
- def post_bulk_beta_tester_assignments(beta_testers: nil)
37
- return Spaceship::ConnectAPI.post_bulk_beta_tester_assignments(beta_group_id: id, beta_testers: beta_testers)
36
+ def post_bulk_beta_tester_assignments(client: nil, beta_testers: nil)
37
+ client ||= Spaceship::ConnectAPI
38
+ return client.post_bulk_beta_tester_assignments(beta_group_id: id, beta_testers: beta_testers)
39
+ end
40
+
41
+ def update(client: nil, attributes: nil)
42
+ return if attributes.empty?
43
+
44
+ client ||= Spaceship::ConnectAPI
45
+
46
+ attributes = reverse_attr_mapping(attributes)
47
+ return client.patch_group(group_id: id, attributes: attributes).first
38
48
  end
39
49
 
40
50
  def delete!
@@ -34,23 +34,27 @@ module Spaceship
34
34
  # API
35
35
  #
36
36
 
37
- def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
38
- resps = Spaceship::ConnectAPI.get_beta_testers(filter: filter, includes: includes).all_pages
37
+ def self.all(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
38
+ client ||= Spaceship::ConnectAPI
39
+ resps = client.get_beta_testers(filter: filter, includes: includes).all_pages
39
40
  return resps.flat_map(&:to_models)
40
41
  end
41
42
 
42
- def self.find(email: nil, includes: nil)
43
- return all(filter: { email: email }, includes: includes).first
43
+ def self.find(client: nil, email: nil, includes: nil)
44
+ client ||= Spaceship::ConnectAPI
45
+ return all(client: client, filter: { email: email }, includes: includes).first
44
46
  end
45
47
 
46
- def delete_from_apps(apps: nil)
48
+ def delete_from_apps(client: nil, apps: nil)
49
+ client ||= Spaceship::ConnectAPI
47
50
  app_ids = apps.map(&:id)
48
- return Spaceship::ConnectAPI.delete_beta_tester_from_apps(beta_tester_id: id, app_ids: app_ids)
51
+ return client.delete_beta_tester_from_apps(beta_tester_id: id, app_ids: app_ids)
49
52
  end
50
53
 
51
- def delete_from_beta_groups(beta_groups: nil)
54
+ def delete_from_beta_groups(client: nil, beta_groups: nil)
55
+ client ||= Spaceship::ConnectAPI
52
56
  beta_group_ids = beta_groups.map(&:id)
53
- return Spaceship::ConnectAPI.delete_beta_tester_from_beta_groups(beta_tester_id: id, beta_group_ids: beta_group_ids)
57
+ return client.delete_beta_tester_from_beta_groups(beta_tester_id: id, beta_group_ids: beta_group_ids)
54
58
  end
55
59
  end
56
60
  end
@@ -106,8 +106,9 @@ module Spaceship
106
106
  # API
107
107
  #
108
108
 
109
- def self.all(app_id: nil, version: nil, build_number: nil, platform: nil, processing_states: "PROCESSING,FAILED,INVALID,VALID", includes: ESSENTIAL_INCLUDES, sort: "-uploadedDate", limit: 30)
110
- resps = Spaceship::ConnectAPI.get_builds(
109
+ def self.all(client: nil, app_id: nil, version: nil, build_number: nil, platform: nil, processing_states: "PROCESSING,FAILED,INVALID,VALID", includes: ESSENTIAL_INCLUDES, sort: "-uploadedDate", limit: 30)
110
+ client ||= Spaceship::ConnectAPI
111
+ resps = client.get_builds(
111
112
  filter: { app: app_id, "preReleaseVersion.version" => version, version: build_number, processingState: processing_states },
112
113
  includes: includes,
113
114
  sort: sort,
@@ -125,23 +126,27 @@ module Spaceship
125
126
  return models
126
127
  end
127
128
 
128
- def self.get(build_id: nil, includes: ESSENTIAL_INCLUDES)
129
- return Spaceship::ConnectAPI.get_build(build_id: build_id, includes: includes).first
129
+ def self.get(client: nil, build_id: nil, includes: ESSENTIAL_INCLUDES)
130
+ client ||= Spaceship::ConnectAPI
131
+ return client.get_build(build_id: build_id, includes: includes).first
130
132
  end
131
133
 
132
- def update(attributes: nil)
134
+ def update(client: nil, attributes: nil)
135
+ client ||= Spaceship::ConnectAPI
133
136
  attributes = reverse_attr_mapping(attributes)
134
- return Spaceship::ConnectAPI.patch_builds(build_id: id, attributes: attributes).first
137
+ return client.patch_builds(build_id: id, attributes: attributes).first
135
138
  end
136
139
 
137
- def add_beta_groups(beta_groups: nil)
140
+ def add_beta_groups(client: nil, beta_groups: nil)
141
+ client ||= Spaceship::ConnectAPI
138
142
  beta_groups ||= []
139
143
  beta_group_ids = beta_groups.map(&:id)
140
- return Spaceship::ConnectAPI.add_beta_groups_to_build(build_id: id, beta_group_ids: beta_group_ids)
144
+ return client.add_beta_groups_to_build(build_id: id, beta_group_ids: beta_group_ids)
141
145
  end
142
146
 
143
- def get_beta_build_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
144
- resps = Spaceship::ConnectAPI.get_beta_build_localizations(
147
+ def get_beta_build_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
148
+ client ||= Spaceship::ConnectAPI
149
+ resps = client.get_beta_build_localizations(
145
150
  filter: { build: id },
146
151
  includes: includes,
147
152
  sort: sort,
@@ -150,8 +155,9 @@ module Spaceship
150
155
  return resps.flat_map(&:to_models)
151
156
  end
152
157
 
153
- def get_build_beta_details(filter: {}, includes: nil, limit: nil, sort: nil)
154
- resps = Spaceship::ConnectAPI.get_build_beta_details(
158
+ def get_build_beta_details(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
159
+ client ||= Spaceship::ConnectAPI
160
+ resps = client.get_build_beta_details(
155
161
  filter: { build: id },
156
162
  includes: includes,
157
163
  sort: sort,
@@ -160,12 +166,14 @@ module Spaceship
160
166
  return resps.flat_map(&:to_models)
161
167
  end
162
168
 
163
- def post_beta_app_review_submission
164
- return Spaceship::ConnectAPI.post_beta_app_review_submissions(build_id: id)
169
+ def post_beta_app_review_submission(client: nil)
170
+ client ||= Spaceship::ConnectAPI
171
+ return client.post_beta_app_review_submissions(build_id: id)
165
172
  end
166
173
 
167
- def expire!
168
- return Spaceship::ConnectAPI.patch_builds(build_id: id, attributes: { expired: true })
174
+ def expire!(client: nil)
175
+ client ||= Spaceship::ConnectAPI
176
+ return client.patch_builds(build_id: id, attributes: { expired: true })
169
177
  end
170
178
  end
171
179
  end