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
@@ -196,7 +196,7 @@ module Spaceship
196
196
 
197
197
  store_csrf_tokens(response)
198
198
 
199
- return Spaceship::ConnectAPI::Response.new(body: response.body, status: response.status, client: self)
199
+ return Spaceship::ConnectAPI::Response.new(body: response.body, status: response.status, headers: response.headers, client: self)
200
200
  end
201
201
 
202
202
  def handle_401(response)
@@ -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
- Spaceship::ConnectAPI.patch_age_rating_declaration(age_rating_declaration_id: id, attributes: attributes)
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
- resps = Spaceship::ConnectAPI.get_apps(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
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
- return all(filter: { bundleId: bundle_id }).find do |app|
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.post_app(
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
- return Spaceship::ConnectAPI.get_app(app_id: app_id, includes: includes).first
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 Spaceship::ConnectAPI.patch_app(app_id: id, attributes: attributes, app_price_tier_id: app_price_tier_id, territory_ids: territory_ids)
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 = Spaceship::ConnectAPI.get_app_infos(app_id: id, includes: includes)
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,19 +138,26 @@ module Spaceship
130
138
  Spaceship::ConnectAPI::AppInfo::AppStoreState::INVALID_BINARY
131
139
  ]
132
140
 
133
- resp = Spaceship::ConnectAPI.get_app_infos(app_id: id, includes: includes)
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
137
145
  end
138
146
 
147
+ def fetch_latest_app_info(client: nil, includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
148
+ client ||= Spaceship::ConnectAPI
149
+ resp = client.get_app_infos(app_id: id, includes: includes)
150
+ return resp.to_models.first
151
+ end
152
+
139
153
  #
140
154
  # Available Territories
141
155
  #
142
156
 
143
- def fetch_available_territories(filter: {}, includes: nil, limit: nil, sort: nil)
157
+ def fetch_available_territories(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
158
+ client ||= Spaceship::ConnectAPI
144
159
  filter ||= {}
145
- resps = Spaceship::ConnectAPI.get_available_territories(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
160
+ resps = client.get_available_territories(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
146
161
  return resps.flat_map(&:to_models)
147
162
  end
148
163
 
@@ -150,8 +165,9 @@ module Spaceship
150
165
  # App Pricing
151
166
  #
152
167
 
153
- def fetch_app_prices(filter: {}, includes: "priceTier", limit: nil, sort: nil)
154
- resp = Spaceship::ConnectAPI.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
168
+ def fetch_app_prices(client: nil, filter: {}, includes: "priceTier", limit: nil, sort: nil)
169
+ client ||= Spaceship::ConnectAPI
170
+ resp = client.get_app_prices(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
155
171
  return resp.to_models
156
172
  end
157
173
 
@@ -159,7 +175,8 @@ module Spaceship
159
175
  # App Store Versions
160
176
  #
161
177
 
162
- def reject_version_if_possible!(platform: nil)
178
+ def reject_version_if_possible!(client: nil, platform: nil)
179
+ client ||= Spaceship::ConnectAPI
163
180
  platform ||= Spaceship::ConnectAPI::Platform::IOS
164
181
  filter = {
165
182
  appStoreState: [
@@ -172,7 +189,7 @@ module Spaceship
172
189
  }
173
190
 
174
191
  # Get the latest version
175
- version = get_app_store_versions(filter: filter, includes: "appStoreVersionSubmission")
192
+ version = get_app_store_versions(client: client, filter: filter, includes: "appStoreVersionSubmission")
176
193
  .sort_by { |v| Gem::Version.new(v.version_string) }
177
194
  .last
178
195
 
@@ -184,46 +201,53 @@ module Spaceship
184
201
  # This will either create a new version or change the version number
185
202
  # from an existing version
186
203
  # @return (Bool) Was something changed?
187
- def ensure_version!(version_string, platform: nil)
204
+ def ensure_version!(version_string, platform: nil, client: nil)
205
+ client ||= Spaceship::ConnectAPI
188
206
  app_store_version = get_edit_app_store_version(platform: platform)
189
207
 
190
208
  if app_store_version
191
209
  if version_string != app_store_version.version_string
192
210
  attributes = { versionString: version_string }
193
- app_store_version.update(attributes: attributes)
211
+ app_store_version.update(client: client, attributes: attributes)
194
212
  return true
195
213
  end
196
214
  return false
197
215
  else
198
216
  attributes = { versionString: version_string, platform: platform }
199
- Spaceship::ConnectAPI.post_app_store_version(app_id: id, attributes: attributes)
217
+ client.post_app_store_version(app_id: id, attributes: attributes)
200
218
 
201
219
  return true
202
220
  end
203
221
  end
204
222
 
205
- def get_latest_app_store_version(platform: nil, includes: nil)
223
+ def get_latest_app_store_version(client: nil, platform: nil, includes: nil)
224
+ client ||= Spaceship::ConnectAPI
206
225
  platform ||= Spaceship::ConnectAPI::Platform::IOS
207
226
  filter = {
208
227
  platform: platform
209
228
  }
210
229
 
211
230
  # Get the latest version
212
- return get_app_store_versions(filter: filter, includes: includes)
231
+ return get_app_store_versions(client: client, filter: filter, includes: includes)
213
232
  .sort_by { |v| Date.parse(v.created_date) }
214
233
  .last
215
234
  end
216
235
 
217
- def get_live_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
236
+ def get_live_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
237
+ client ||= Spaceship::ConnectAPI
218
238
  platform ||= Spaceship::ConnectAPI::Platform::IOS
219
239
  filter = {
220
- appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE,
240
+ appStoreState: [
241
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE,
242
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REMOVED_FROM_SALE
243
+ ].join(","),
221
244
  platform: platform
222
245
  }
223
- return get_app_store_versions(filter: filter, includes: includes).first
246
+ return get_app_store_versions(client: client, filter: filter, includes: includes).first
224
247
  end
225
248
 
226
- def get_edit_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
249
+ def get_edit_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
250
+ client ||= Spaceship::ConnectAPI
227
251
  platform ||= Spaceship::ConnectAPI::Platform::IOS
228
252
  filter = {
229
253
  appStoreState: [
@@ -238,21 +262,23 @@ module Spaceship
238
262
  }
239
263
 
240
264
  # Get the latest version
241
- return get_app_store_versions(filter: filter, includes: includes)
265
+ return get_app_store_versions(client: client, filter: filter, includes: includes)
242
266
  .sort_by { |v| Gem::Version.new(v.version_string) }
243
267
  .last
244
268
  end
245
269
 
246
- def get_in_review_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
270
+ def get_in_review_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
271
+ client ||= Spaceship::ConnectAPI
247
272
  platform ||= Spaceship::ConnectAPI::Platform::IOS
248
273
  filter = {
249
274
  appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
250
275
  platform: platform
251
276
  }
252
- return get_app_store_versions(filter: filter, includes: includes).first
277
+ return get_app_store_versions(client: client, filter: filter, includes: includes).first
253
278
  end
254
279
 
255
- def get_pending_release_app_store_version(platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
280
+ def get_pending_release_app_store_version(client: nil, platform: nil, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES)
281
+ client ||= Spaceship::ConnectAPI
256
282
  platform ||= Spaceship::ConnectAPI::Platform::IOS
257
283
  filter = {
258
284
  appStoreState: [
@@ -261,12 +287,18 @@ module Spaceship
261
287
  ].join(','),
262
288
  platform: platform
263
289
  }
264
- return get_app_store_versions(filter: filter, includes: includes).first
290
+ return get_app_store_versions(client: client, filter: filter, includes: includes).first
265
291
  end
266
292
 
267
- def get_app_store_versions(filter: {}, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES, limit: nil, sort: nil)
268
- resps = Spaceship::ConnectAPI.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
269
- return resps.flat_map(&:to_models)
293
+ def get_app_store_versions(client: nil, filter: {}, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES, limit: nil, sort: nil)
294
+ client ||= Spaceship::ConnectAPI
295
+ if limit.nil?
296
+ resps = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
297
+ return resps.flat_map(&:to_models)
298
+ else
299
+ resp = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
300
+ return resp.to_models
301
+ end
270
302
  end
271
303
 
272
304
  #
@@ -291,11 +323,12 @@ module Spaceship
291
323
  # Beta Feedback
292
324
  #
293
325
 
294
- def get_beta_feedback(filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
326
+ def get_beta_feedback(client: nil, filter: {}, includes: "tester,build,screenshots", limit: nil, sort: nil)
327
+ client ||= Spaceship::ConnectAPI
295
328
  filter ||= {}
296
329
  filter["build.app"] = id
297
330
 
298
- resps = Spaceship::ConnectAPI.get_beta_feedback(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
331
+ resps = client.get_beta_feedback(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
299
332
  return resps.flat_map(&:to_models)
300
333
  end
301
334
 
@@ -303,11 +336,12 @@ module Spaceship
303
336
  # Beta Testers
304
337
  #
305
338
 
306
- def get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil)
339
+ def get_beta_testers(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
340
+ client ||= Spaceship::ConnectAPI
307
341
  filter ||= {}
308
342
  filter[:apps] = id
309
343
 
310
- resps = Spaceship::ConnectAPI.get_beta_testers(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
344
+ resps = client.get_beta_testers(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
311
345
  return resps.flat_map(&:to_models)
312
346
  end
313
347
 
@@ -315,40 +349,45 @@ module Spaceship
315
349
  # Builds
316
350
  #
317
351
 
318
- def get_builds(filter: {}, includes: nil, limit: nil, sort: nil)
352
+ def get_builds(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
353
+ client ||= Spaceship::ConnectAPI
319
354
  filter ||= {}
320
355
  filter[:app] = id
321
356
 
322
- resps = Spaceship::ConnectAPI.get_builds(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
357
+ resps = client.get_builds(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
323
358
  return resps.flat_map(&:to_models)
324
359
  end
325
360
 
326
- def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
361
+ def get_build_deliveries(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
362
+ client ||= Spaceship::ConnectAPI
327
363
  filter ||= {}
328
364
  filter[:app] = id
329
365
 
330
- resps = Spaceship::ConnectAPI.get_build_deliveries(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
366
+ resps = client.get_build_deliveries(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
331
367
  return resps.flat_map(&:to_models)
332
368
  end
333
369
 
334
- def get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
370
+ def get_beta_app_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
371
+ client ||= Spaceship::ConnectAPI
335
372
  filter ||= {}
336
373
  filter[:app] = id
337
374
 
338
- resps = Spaceship::ConnectAPI.get_beta_app_localizations(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
375
+ resps = client.get_beta_app_localizations(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
339
376
  return resps.flat_map(&:to_models)
340
377
  end
341
378
 
342
- def get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil)
379
+ def get_beta_groups(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
380
+ client ||= Spaceship::ConnectAPI
343
381
  filter ||= {}
344
382
  filter[:app] = id
345
383
 
346
- resps = Spaceship::ConnectAPI.get_beta_groups(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
384
+ resps = client.get_beta_groups(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
347
385
  return resps.flat_map(&:to_models)
348
386
  end
349
387
 
350
- def create_beta_group(group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
351
- resps = Spaceship::ConnectAPI.create_beta_group(
388
+ def create_beta_group(client: nil, group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
389
+ client ||= Spaceship::ConnectAPI
390
+ resps = client.create_beta_group(
352
391
  app_id: id,
353
392
  group_name: group_name,
354
393
  public_link_enabled: public_link_enabled,
@@ -378,9 +417,10 @@ module Spaceship
378
417
  # Users
379
418
  #
380
419
 
381
- def add_users(user_ids: nil)
420
+ def add_users(client: nil, user_ids: nil)
421
+ client ||= Spaceship::ConnectAPI
382
422
  user_ids.each do |user_id|
383
- Spaceship::ConnectAPI.add_user_visible_apps(user_id: user_id, app_ids: [id])
423
+ client.add_user_visible_apps(user_id: user_id, app_ids: [id])
384
424
  end
385
425
  end
386
426
  end
@@ -0,0 +1,59 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AppDataUsage
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :category
8
+ attr_accessor :grouping
9
+ attr_accessor :purpose
10
+ attr_accessor :data_protection
11
+
12
+ attr_mapping({
13
+ "category" => "category",
14
+ "grouping" => "grouping",
15
+ "dataProtection" => "data_protection"
16
+ })
17
+
18
+ def self.type
19
+ return "appDataUsages"
20
+ end
21
+
22
+ #
23
+ # Helpers
24
+ #
25
+
26
+ def is_not_collected?
27
+ return false unless data_protection
28
+ return data_protection.id == "DATA_NOT_COLLECTED"
29
+ end
30
+
31
+ #
32
+ # API
33
+ #
34
+
35
+ def self.all(app_id:, filter: {}, includes: nil, limit: nil, sort: nil)
36
+ raise "app_id is required " if app_id.nil?
37
+
38
+ resps = Spaceship::ConnectAPI.get_app_data_usages(app_id: app_id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
39
+ return resps.flat_map(&:to_models)
40
+ end
41
+
42
+ def self.create(app_id:, app_data_usage_category_id: nil, app_data_usage_protection_id: nil, app_data_usage_purpose_id: nil)
43
+ raise "app_id is required " if app_id.nil?
44
+
45
+ resp = Spaceship::ConnectAPI.post_app_data_usage(
46
+ app_id: app_id,
47
+ app_data_usage_category_id: app_data_usage_category_id,
48
+ app_data_usage_protection_id: app_data_usage_protection_id,
49
+ app_data_usage_purpose_id: app_data_usage_purpose_id
50
+ )
51
+ return resp.to_models.first
52
+ end
53
+
54
+ def delete!
55
+ Spaceship::ConnectAPI.delete_app_data_usage(app_data_usage_id: id)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,65 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AppDataUsageCategory
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :deleted
8
+ attr_accessor :grouping
9
+
10
+ attr_mapping({
11
+ "deleted" => "deleted",
12
+ "grouping" => "grouping"
13
+ })
14
+
15
+ # Found at https://appstoreconnect.apple.com/iris/v1/appDataUsageCategories
16
+ module ID
17
+ PAYMENT_INFORMATION = "PAYMENT_INFORMATION"
18
+ CREDIT_AND_FRAUD = "CREDIT_AND_FRAUD"
19
+ OTHER_FINANCIAL_INFO = "OTHER_FINANCIAL_INFO"
20
+ PRECISE_LOCATION = "PRECISE_LOCATION"
21
+ SENSITIVE_INFO = "SENSITIVE_INFO"
22
+ PHYSICAL_ADDRESS = "PHYSICAL_ADDRESS"
23
+ EMAIL_ADDRESS = "EMAIL_ADDRESS"
24
+ NAME = "NAME"
25
+ PHONE_NUMBER = "PHONE_NUMBER"
26
+ OTHER_CONTACT_INFO = "OTHER_CONTACT_INFO"
27
+ CONTACTS = "CONTACTS"
28
+ EMAILS_OR_TEXT_MESSAGES = "EMAILS_OR_TEXT_MESSAGES"
29
+ PHOTOS_OR_VIDEOS = "PHOTOS_OR_VIDEOS"
30
+ AUDIO = "AUDIO"
31
+ GAMEPLAY_CONTENT = "GAMEPLAY_CONTENT"
32
+ CUSTOMER_SUPPORT = "CUSTOMER_SUPPORT"
33
+ OTHER_USER_CONTENT = "OTHER_USER_CONTENT"
34
+ BROWSING_HISTORY = "BROWSING_HISTORY"
35
+ SEARCH_HISTORY = "SEARCH_HISTORY"
36
+ USER_ID = "USER_ID"
37
+ DEVICE_ID = "DEVICE_ID"
38
+ PURCHASE_HISTORY = "PURCHASE_HISTORY"
39
+ PRODUCT_INTERACTION = "PRODUCT_INTERACTION"
40
+ ADVERTISING_DATA = "ADVERTISING_DATA"
41
+ OTHER_USAGE_DATA = "OTHER_USAGE_DATA"
42
+ CRASH_DATA = "CRASH_DATA"
43
+ PERFORMANCE_DATA = "PERFORMANCE_DATA"
44
+ OTHER_DIAGNOSTIC_DATA = "OTHER_DIAGNOSTIC_DATA"
45
+ OTHER_DATA = "OTHER_DATA"
46
+ HEALTH = "HEALTH"
47
+ FITNESS = "FITNESS"
48
+ COARSE_LOCATION = "COARSE_LOCATION"
49
+ end
50
+
51
+ def self.type
52
+ return "appDataUsageCategories"
53
+ end
54
+
55
+ #
56
+ # API
57
+ #
58
+
59
+ def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
60
+ resps = Spaceship::ConnectAPI.get_app_data_usage_categories(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
61
+ return resps.flat_map(&:to_models)
62
+ end
63
+ end
64
+ end
65
+ end