fastlane 2.187.0 → 2.191.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +94 -94
  3. data/deliver/lib/deliver/app_screenshot.rb +2 -1
  4. data/deliver/lib/deliver/app_screenshot_iterator.rb +2 -2
  5. data/deliver/lib/deliver/loader.rb +1 -1
  6. data/deliver/lib/deliver/options.rb +6 -0
  7. data/deliver/lib/deliver/runner.rb +9 -1
  8. data/deliver/lib/deliver/screenshot_comparable.rb +62 -0
  9. data/deliver/lib/deliver/sync_screenshots.rb +200 -0
  10. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +1 -1
  11. data/fastlane/lib/fastlane/actions/appledoc.rb +45 -45
  12. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +1 -2
  13. data/fastlane/lib/fastlane/actions/bundle_install.rb +13 -1
  14. data/fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb +25 -1
  15. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +2 -2
  16. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +2 -2
  17. data/fastlane/lib/fastlane/actions/gradle.rb +1 -1
  18. data/fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb +1 -4
  19. data/fastlane/lib/fastlane/actions/update_info_plist.rb +1 -1
  20. data/fastlane/lib/fastlane/actions/update_keychain_access_groups.rb +1 -4
  21. data/fastlane/lib/fastlane/actions/update_plist.rb +1 -1
  22. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +2 -2
  23. data/fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb +0 -1
  24. data/fastlane/lib/fastlane/actions/update_url_schemes.rb +15 -26
  25. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +1 -2
  26. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +3 -10
  27. data/fastlane/lib/fastlane/actions/validate_play_store_json_key.rb +40 -44
  28. data/fastlane/lib/fastlane/actions/version_get_podspec.rb +1 -2
  29. data/fastlane/lib/fastlane/actions/xcode_server_get_assets.rb +3 -3
  30. data/fastlane/lib/fastlane/actions/zip.rb +86 -21
  31. data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +1 -1
  32. data/fastlane/lib/fastlane/features.rb +3 -0
  33. data/fastlane/lib/fastlane/plugins/template/.circleci/config.yml +1 -1
  34. data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +1 -1
  35. data/fastlane/lib/fastlane/version.rb +1 -1
  36. data/fastlane/swift/Deliverfile.swift +1 -1
  37. data/fastlane/swift/DeliverfileProtocol.swift +5 -1
  38. data/fastlane/swift/Fastlane.swift +108 -46
  39. data/fastlane/swift/Gymfile.swift +1 -1
  40. data/fastlane/swift/GymfileProtocol.swift +1 -1
  41. data/fastlane/swift/Matchfile.swift +1 -1
  42. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  43. data/fastlane/swift/Precheckfile.swift +1 -1
  44. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  45. data/fastlane/swift/Scanfile.swift +1 -1
  46. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  47. data/fastlane/swift/Screengrabfile.swift +1 -1
  48. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  49. data/fastlane/swift/Snapshotfile.swift +1 -1
  50. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  51. data/fastlane/swift/formatting/Brewfile.lock.json +17 -9
  52. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +11 -4
  53. data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +1 -0
  54. data/pilot/lib/pilot.rb +0 -1
  55. data/precheck/lib/precheck/module.rb +2 -0
  56. data/precheck/lib/precheck/options.rb +3 -3
  57. data/produce/lib/produce/commands_generator.rb +28 -0
  58. data/produce/lib/produce/service.rb +15 -0
  59. data/scan/lib/scan/detect_values.rb +22 -13
  60. data/scan/lib/scan/module.rb +1 -0
  61. data/scan/lib/scan/options.rb +12 -1
  62. data/scan/lib/scan/test_command_generator.rb +29 -6
  63. data/scan/lib/scan/xcpretty_reporter_options_generator.rb +1 -1
  64. data/screengrab/lib/screengrab/runner.rb +2 -2
  65. data/sigh/lib/sigh/options.rb +2 -1
  66. data/spaceship/lib/spaceship/client.rb +19 -3
  67. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  68. data/spaceship/lib/spaceship/connect_api/models/app.rb +7 -0
  69. data/spaceship/lib/spaceship/connect_api/models/capabilities.rb +27 -0
  70. data/spaceship/lib/spaceship/connect_api/models/user.rb +17 -3
  71. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +26 -5
  72. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +5 -0
  73. data/spaceship/lib/spaceship/connect_api/testflight/client.rb +3 -0
  74. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +39 -0
  75. data/spaceship/lib/spaceship/connect_api/token.rb +2 -1
  76. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +3 -0
  77. data/spaceship/lib/spaceship/connect_api/users/client.rb +3 -0
  78. data/spaceship/lib/spaceship/connect_api/users/users.rb +58 -3
  79. data/spaceship/lib/spaceship/tunes/tunes_client.rb +3 -0
  80. data/supply/lib/supply/client.rb +7 -1
  81. data/supply/lib/supply/options.rb +5 -0
  82. data/supply/lib/supply/uploader.rb +1 -1
  83. metadata +26 -28
  84. data/fastlane/lib/fastlane/.erb_template_helper.rb.swp +0 -0
  85. data/gym/lib/gym/generators/.package_command_generator_xcode7.rb.swp +0 -0
  86. data/pilot/lib/pilot/features.rb +0 -0
  87. data/spaceship/lib/spaceship/.DS_Store +0 -0
  88. data/spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp +0 -0
@@ -13,7 +13,7 @@ module Scan
13
13
  Scan.config[:xcpretty_args])
14
14
  end
15
15
 
16
- # Intialize with values from Scan.config matching these param names
16
+ # Initialize with values from Scan.config matching these param names
17
17
  def initialize(open_report, output_types, output_files, output_directory, use_clang_report_name, xcpretty_args)
18
18
  @open_report = open_report
19
19
  @output_types = output_types
@@ -54,7 +54,7 @@ module Screengrab
54
54
  device_screenshots_paths = [
55
55
  determine_external_screenshots_path(device_serial, @config[:app_package_name], @config[:locales]),
56
56
  determine_internal_screenshots_paths(device_serial, @config[:app_package_name], @config[:locales])
57
- ].flatten
57
+ ].flatten(1)
58
58
 
59
59
  # Root is needed to access device paths at /data
60
60
  if @config[:use_adb_root]
@@ -301,7 +301,7 @@ module Screengrab
301
301
  device_screenshots_paths = [
302
302
  determine_external_screenshots_path(device_serial, @config[:app_package_name], [locale]),
303
303
  determine_internal_screenshots_paths(device_serial, @config[:app_package_name], [locale])
304
- ].flatten
304
+ ].flatten(1)
305
305
 
306
306
  # Make a temp directory into which to pull the screenshots before they are moved to their final location.
307
307
  # This makes directory cleanup easier, as the temp directory will be removed when the block completes.
@@ -149,7 +149,8 @@ module Sigh
149
149
  env_name: "SIGH_SKIP_CERTIFICATE_VERIFICATION",
150
150
  description: "Skips the verification of the certificates for every existing profiles. This will make sure the provisioning profile can be used on the local machine",
151
151
  is_string: false,
152
- default_value: false),
152
+ default_value: !FastlaneCore::Helper.mac?,
153
+ default_value_dynamic: true),
153
154
  FastlaneCore::ConfigItem.new(key: :platform,
154
155
  short_option: '-p',
155
156
  env_name: "SIGH_PLATFORM",
@@ -41,6 +41,7 @@ module Spaceship
41
41
  attr_accessor :logger
42
42
 
43
43
  attr_accessor :csrf_tokens
44
+ attr_accessor :additional_headers
44
45
 
45
46
  attr_accessor :provider
46
47
 
@@ -147,6 +148,7 @@ module Spaceship
147
148
  available_teams = teams.collect do |team|
148
149
  {
149
150
  team_id: (team["contentProvider"] || {})["contentProviderId"],
151
+ public_team_id: (team["contentProvider"] || {})["contentProviderPublicId"],
150
152
  team_name: (team["contentProvider"] || {})["name"]
151
153
  }
152
154
  end
@@ -161,10 +163,19 @@ module Spaceship
161
163
  end
162
164
 
163
165
  response = request(:post) do |req|
164
- req.url("ra/v1/session/webSession")
166
+ req.url("https://appstoreconnect.apple.com/olympus/v1/providerSwitchRequests")
165
167
  req.body = {
166
- contentProviderId: team_id,
167
- dsId: user_detail_data.ds_id # https://github.com/fastlane/fastlane/issues/6711
168
+ "data": {
169
+ "type": "providerSwitchRequests",
170
+ "relationships": {
171
+ "provider": {
172
+ "data": {
173
+ "type": "providers",
174
+ "id": result[:public_team_id]
175
+ }
176
+ }
177
+ }
178
+ }
168
179
  }.to_json
169
180
  req.headers['Content-Type'] = 'application/json'
170
181
  end
@@ -707,8 +718,13 @@ module Spaceship
707
718
  @csrf_tokens || {}
708
719
  end
709
720
 
721
+ def additional_headers
722
+ @additional_headers || {}
723
+ end
724
+
710
725
  def request(method, url_or_path = nil, params = nil, headers = {}, auto_paginate = false, &block)
711
726
  headers.merge!(csrf_tokens)
727
+ headers.merge!(additional_headers)
712
728
  headers['User-Agent'] = USER_AGENT
713
729
 
714
730
  # Before encoding the parameters, log them
@@ -10,6 +10,7 @@ require 'spaceship/connect_api/tunes/tunes'
10
10
 
11
11
  require 'spaceship/connect_api/models/bundle_id_capability'
12
12
  require 'spaceship/connect_api/models/bundle_id'
13
+ require 'spaceship/connect_api/models/capabilities'
13
14
  require 'spaceship/connect_api/models/certificate'
14
15
  require 'spaceship/connect_api/models/device'
15
16
  require 'spaceship/connect_api/models/profile'
@@ -423,6 +423,13 @@ module Spaceship
423
423
  client.add_user_visible_apps(user_id: user_id, app_ids: [id])
424
424
  end
425
425
  end
426
+
427
+ def remove_users(client: nil, user_ids: nil)
428
+ client ||= Spaceship::ConnectAPI
429
+ user_ids.each do |user_id|
430
+ client.delete_user_visible_apps(user_id: user_id, app_ids: [id])
431
+ end
432
+ end
426
433
  end
427
434
  end
428
435
  end
@@ -0,0 +1,27 @@
1
+ require_relative '../model'
2
+
3
+ module Spaceship
4
+ class ConnectAPI
5
+ class Capabilities
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :name
9
+ attr_accessor :description
10
+
11
+ attr_mapping({
12
+ "name" => "name",
13
+ "description" => "description",
14
+ })
15
+
16
+ def self.type
17
+ return "capabilities"
18
+ end
19
+
20
+ def self.all(client: nil)
21
+ client ||= Spaceship::ConnectAPI
22
+ resp = client.get_available_bundle_id_capabilities(bundle_id_id: id).all_pages
23
+ return resp.flat_map(&:to_models)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -16,6 +16,8 @@ module Spaceship
16
16
  attr_accessor :email_vetting_required
17
17
  attr_accessor :notifications
18
18
 
19
+ attr_accessor :visible_apps
20
+
19
21
  attr_mapping({
20
22
  "username" => "username",
21
23
  "firstName" => "first_name",
@@ -27,9 +29,15 @@ module Spaceship
27
29
  "allAppsVisible" => "all_apps_visible",
28
30
  "provisioningAllowed" => "provisioning_allowed",
29
31
  "emailVettingRequired" => "email_vetting_required",
30
- "notifications" => "notifications"
32
+ "notifications" => "notifications",
33
+
34
+ "visibleApps" => "visible_apps"
31
35
  })
32
36
 
37
+ ESSENTIAL_INCLUDES = [
38
+ "visibleApps"
39
+ ].join(",")
40
+
33
41
  def self.type
34
42
  return "users"
35
43
  end
@@ -38,16 +46,22 @@ module Spaceship
38
46
  # API
39
47
  #
40
48
 
41
- def self.all(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
49
+ def self.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, limit: nil, sort: nil)
42
50
  client ||= Spaceship::ConnectAPI
43
51
  resps = client.get_users(filter: filter, includes: includes).all_pages
44
52
  return resps.flat_map(&:to_models)
45
53
  end
46
54
 
47
- def self.find(client: nil, email: nil, includes: nil)
55
+ def self.find(client: nil, email: nil, includes: ESSENTIAL_INCLUDES)
48
56
  client ||= Spaceship::ConnectAPI
49
57
  return all(client: client, filter: { email: email }, includes: includes)
50
58
  end
59
+
60
+ def get_visible_apps(client: nil, limit: nil)
61
+ client ||= Spaceship::ConnectAPI
62
+ resp = client.get_user_visible_apps(user_id: id, limit: limit)
63
+ return resp.to_models
64
+ end
51
65
  end
52
66
  end
53
67
  end
@@ -11,15 +11,23 @@ module Spaceship
11
11
  attr_accessor :all_apps_visible
12
12
  attr_accessor :provisioning_allowed
13
13
 
14
+ attr_accessor :visible_apps
15
+
14
16
  attr_mapping({
15
17
  "firstName" => "first_name",
16
18
  "lastName" => "last_name",
17
19
  "email" => "email",
18
20
  "roles" => "roles",
19
21
  "allAppsVisible" => "all_apps_visible",
20
- "provisioningAllowed" => "provisioning_allowed"
22
+ "provisioningAllowed" => "provisioning_allowed",
23
+
24
+ "visibleApps" => "visible_apps"
21
25
  })
22
26
 
27
+ ESSENTIAL_INCLUDES = [
28
+ "visibleApps"
29
+ ].join(",")
30
+
23
31
  module UserRole
24
32
  ADMIN = "ADMIN"
25
33
  FINANCE = "FINANCE"
@@ -42,18 +50,23 @@ module Spaceship
42
50
  # Managing invitations
43
51
  #
44
52
 
45
- def self.all(client: nil, filter: {}, includes: nil, sort: nil)
53
+ def self.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, sort: nil)
46
54
  client ||= Spaceship::ConnectAPI
47
55
  resps = client.get_user_invitations(filter: filter, includes: includes, sort: sort).all_pages
48
56
  return resps.flat_map(&:to_models)
49
57
  end
50
58
 
51
- def self.find(client: nil, email: nil, includes: nil)
59
+ def self.find(client: nil, email: nil, includes: ESSENTIAL_INCLUDES)
52
60
  client ||= Spaceship::ConnectAPI
53
61
  return all(client: client, filter: { email: email }, includes: includes)
54
62
  end
55
63
 
56
- def self.create(client: nil, email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil)
64
+ # Create and post user invitation
65
+ # App Store Connect allows for the following combinations of `all_apps_visible` and `visible_app_ids`:
66
+ # - if `all_apps_visible` is `nil`, you don't have to provide values for `visible_app_ids`
67
+ # - if `all_apps_visible` is true, you must provide values for `visible_app_ids`.
68
+ # - if `all_apps_visible` is false, you must not provide values for `visible_app_ids`.
69
+ def self.create(client: nil, email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil, visible_app_ids: [])
57
70
  client ||= Spaceship::ConnectAPI
58
71
  resp = client.post_user_invitation(
59
72
  email: email,
@@ -61,7 +74,8 @@ module Spaceship
61
74
  last_name: last_name,
62
75
  roles: roles,
63
76
  provisioning_allowed: provisioning_allowed,
64
- all_apps_visible: all_apps_visible
77
+ all_apps_visible: all_apps_visible,
78
+ visible_app_ids: visible_app_ids
65
79
  )
66
80
  return resp.to_models.first
67
81
  end
@@ -70,6 +84,13 @@ module Spaceship
70
84
  client ||= Spaceship::ConnectAPI
71
85
  client.delete_user_invitation(user_invitation_id: id)
72
86
  end
87
+
88
+ # Get visible apps for invited user
89
+ def get_visible_apps(client: nil, limit: nil)
90
+ client ||= Spaceship::ConnectAPI
91
+ resp = client.get_user_invitation_visible_apps(user_invitation_id: id, limit: limit)
92
+ return resp.to_models
93
+ end
73
94
  end
74
95
  end
75
96
  end
@@ -54,6 +54,11 @@ module Spaceship
54
54
  provisioning_request_client.get("bundleIds/#{bundle_id_id}/bundleIdCapabilities", params)
55
55
  end
56
56
 
57
+ def get_available_bundle_id_capabilities(bundle_id_id:)
58
+ params = provisioning_request_client.build_params(filter: { bundleId: bundle_id_id })
59
+ provisioning_request_client.get("capabilities", params)
60
+ end
61
+
57
62
  def post_bundle_id_capability(bundle_id_id:, capability_type:, settings: [])
58
63
  body = {
59
64
  data: {
@@ -11,6 +11,9 @@ module Spaceship
11
11
 
12
12
  super(cookie: cookie, current_team_id: current_team_id, token: token, another_client: another_client)
13
13
 
14
+ # Used by most iris requests starting in July 2021
15
+ @additional_headers = { 'x-csrf-itc': '[asc-ui]' } if another_client
16
+
14
17
  self.extend(Spaceship::ConnectAPI::TestFlight::API)
15
18
  self.test_flight_request_client = self
16
19
  end
@@ -191,6 +191,19 @@ module Spaceship
191
191
  test_flight_request_client.post("builds/#{build_id}/relationships/betaGroups", body)
192
192
  end
193
193
 
194
+ def delete_beta_groups_from_build(build_id: nil, beta_group_ids: [])
195
+ body = {
196
+ data: beta_group_ids.map do |id|
197
+ {
198
+ type: "betaGroups",
199
+ id: id
200
+ }
201
+ end
202
+ }
203
+
204
+ test_flight_request_client.delete("builds/#{build_id}/relationships/betaGroups", nil, body)
205
+ end
206
+
194
207
  def create_beta_group(app_id: nil, group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
195
208
  body = {
196
209
  data: {
@@ -340,6 +353,32 @@ module Spaceship
340
353
  test_flight_request_client.post("betaTesters/#{beta_tester_id}/relationships/builds", body)
341
354
  end
342
355
 
356
+ def add_beta_testers_to_build(build_id: nil, beta_tester_ids: [])
357
+ body = {
358
+ data: beta_tester_ids.map do |id|
359
+ {
360
+ type: "betaTesters",
361
+ id: id
362
+ }
363
+ end
364
+ }
365
+
366
+ test_flight_request_client.post("builds/#{build_id}/relationships/individualTesters", body)
367
+ end
368
+
369
+ def delete_beta_testers_from_build(build_id: nil, beta_tester_ids: [])
370
+ body = {
371
+ data: beta_tester_ids.map do |id|
372
+ {
373
+ type: "betaTesters",
374
+ id: id
375
+ }
376
+ end
377
+ }
378
+
379
+ test_flight_request_client.delete("builds/#{build_id}/relationships/individualTesters", nil, body)
380
+ end
381
+
343
382
  #
344
383
  # betaTesterMetrics
345
384
  #
@@ -13,6 +13,7 @@ module Spaceship
13
13
  class Token
14
14
  # maximum expiration supported by AppStore (20 minutes)
15
15
  MAX_TOKEN_DURATION = 1200
16
+ DEFAULT_TOKEN_DURATION = 500
16
17
 
17
18
  attr_reader :key_id
18
19
  attr_reader :issuer_id
@@ -80,7 +81,7 @@ module Spaceship
80
81
  @duration = duration
81
82
  @in_house = in_house
82
83
 
83
- @duration ||= MAX_TOKEN_DURATION
84
+ @duration ||= DEFAULT_TOKEN_DURATION
84
85
  @duration = @duration.to_i if @duration
85
86
 
86
87
  refresh!
@@ -11,6 +11,9 @@ module Spaceship
11
11
 
12
12
  super(cookie: cookie, current_team_id: current_team_id, token: token, another_client: another_client)
13
13
 
14
+ # Used by most iris requests starting in July 2021
15
+ @additional_headers = { 'x-csrf-itc': '[asc-ui]' } if another_client
16
+
14
17
  self.extend(Spaceship::ConnectAPI::Tunes::API)
15
18
  self.tunes_request_client = self
16
19
  end
@@ -11,6 +11,9 @@ module Spaceship
11
11
 
12
12
  super(cookie: cookie, current_team_id: current_team_id, token: token, another_client: another_client)
13
13
 
14
+ # Used by most iris requests starting in July 2021
15
+ @additional_headers = { 'x-csrf-itc': '[asc-ui]' } if another_client
16
+
14
17
  self.extend(Spaceship::ConnectAPI::Users::API)
15
18
  self.users_request_client = self
16
19
  end
@@ -28,8 +28,13 @@ module Spaceship
28
28
  users_request_client.delete("users/#{user_id}")
29
29
  end
30
30
 
31
- # Change app permissions for user
31
+ # Add app permissions for user
32
+ # @deprecated Use {#post_user_visible_apps} instead.
32
33
  def add_user_visible_apps(user_id: nil, app_ids: nil)
34
+ post_user_visible_apps(user_id: user_id, app_ids: app_ids)
35
+ end
36
+
37
+ def post_user_visible_apps(user_id: nil, app_ids: nil)
33
38
  body = {
34
39
  data: app_ids.map do |app_id|
35
40
  {
@@ -42,18 +47,52 @@ module Spaceship
42
47
  users_request_client.post("users/#{user_id}/relationships/visibleApps", body)
43
48
  end
44
49
 
50
+ # Replace app permissions for user
51
+ def patch_user_visible_apps(user_id: nil, app_ids: nil)
52
+ body = {
53
+ data: app_ids.map do |app_id|
54
+ {
55
+ type: "apps",
56
+ id: app_id
57
+ }
58
+ end
59
+ }
60
+
61
+ users_request_client.patch("users/#{user_id}/relationships/visibleApps", body)
62
+ end
63
+
64
+ # Remove app permissions for user
65
+ def delete_user_visible_apps(user_id: nil, app_ids: nil)
66
+ body = {
67
+ data: app_ids.map do |app_id|
68
+ {
69
+ type: "apps",
70
+ id: app_id
71
+ }
72
+ end
73
+ }
74
+ params = nil
75
+ users_request_client.delete("users/#{user_id}/relationships/visibleApps", params, body)
76
+ end
77
+
78
+ # Get app permissions for user
79
+ def get_user_visible_apps(user_id: id, limit: nil)
80
+ params = users_request_client.build_params(filter: {}, includes: nil, limit: limit, sort: nil)
81
+ users_request_client.get("users/#{user_id}/visibleApps", params)
82
+ end
83
+
45
84
  #
46
85
  # invitations (invited users)
47
86
  #
48
87
 
49
- # Get all invited users (not yet accepted)
88
+ # Get all invited users
50
89
  def get_user_invitations(filter: {}, includes: nil, limit: nil, sort: nil)
51
90
  params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
52
91
  users_request_client.get("userInvitations", params)
53
92
  end
54
93
 
55
94
  # Invite new users to App Store Connect
56
- def post_user_invitation(email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil)
95
+ def post_user_invitation(email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil, visible_app_ids: [])
57
96
  body = {
58
97
  data: {
59
98
  type: "userInvitations",
@@ -64,6 +103,16 @@ module Spaceship
64
103
  roles: roles,
65
104
  provisioningAllowed: provisioning_allowed,
66
105
  allAppsVisible: all_apps_visible
106
+ },
107
+ relationships: {
108
+ visibleApps: {
109
+ data: visible_app_ids.map do |id|
110
+ {
111
+ id: id,
112
+ type: "apps"
113
+ }
114
+ end
115
+ }
67
116
  }
68
117
  }
69
118
  }
@@ -74,6 +123,12 @@ module Spaceship
74
123
  def delete_user_invitation(user_invitation_id: nil)
75
124
  users_request_client.delete("userInvitations/#{user_invitation_id}")
76
125
  end
126
+
127
+ # Get all app permissions for invited user
128
+ def get_user_invitation_visible_apps(user_invitation_id: id, limit: nil)
129
+ params = users_request_client.build_params(filter: {}, includes: nil, limit: limit, sort: nil)
130
+ users_request_client.get("userInvitations/#{user_invitation_id}/visibleApps", params)
131
+ end
77
132
  end
78
133
  end
79
134
  end