fastlane 2.155.1 → 2.157.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +72 -72
- data/deliver/lib/deliver.rb +1 -0
- data/deliver/lib/deliver/app_screenshot_iterator.rb +95 -0
- data/deliver/lib/deliver/detect_values.rb +4 -1
- data/deliver/lib/deliver/languages.rb +7 -0
- data/deliver/lib/deliver/loader.rb +4 -5
- data/deliver/lib/deliver/queue_worker.rb +64 -0
- data/deliver/lib/deliver/runner.rb +7 -5
- data/deliver/lib/deliver/upload_screenshots.rb +143 -128
- data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +120 -0
- data/fastlane/lib/fastlane/actions/commit_version_bump.rb +1 -1
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +17 -1
- data/fastlane/lib/fastlane/actions/set_changelog.rb +2 -2
- data/fastlane/lib/fastlane/actions/sonar.rb +5 -0
- data/fastlane/lib/fastlane/actions/spaceship_stats.rb +73 -0
- data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +4 -0
- 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/Fastlane.swift +68 -8
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +1 -1
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +1 -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_core/lib/fastlane_core/itunes_transporter.rb +71 -42
- data/fastlane_core/lib/fastlane_core/project.rb +1 -0
- data/gym/lib/gym/error_handler.rb +1 -1
- data/gym/lib/gym/generators/build_command_generator.rb +0 -1
- data/pilot/lib/pilot/build_manager.rb +18 -4
- data/pilot/lib/pilot/manager.rb +15 -5
- data/pilot/lib/pilot/options.rb +16 -0
- data/produce/lib/produce/itunes_connect.rb +2 -2
- data/scan/lib/scan/test_command_generator.rb +3 -1
- data/screengrab/lib/screengrab/runner.rb +8 -7
- data/sigh/lib/sigh/runner.rb +9 -5
- data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
- data/spaceship/lib/spaceship.rb +4 -0
- data/spaceship/lib/spaceship/client.rb +2 -0
- data/spaceship/lib/spaceship/connect_api.rb +0 -15
- data/spaceship/lib/spaceship/connect_api/api_client.rb +270 -0
- data/spaceship/lib/spaceship/connect_api/client.rb +139 -213
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +75 -64
- data/spaceship/lib/spaceship/connect_api/spaceship.rb +94 -0
- data/spaceship/lib/spaceship/connect_api/testflight/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +288 -277
- data/spaceship/lib/spaceship/connect_api/token.rb +46 -5
- data/spaceship/lib/spaceship/connect_api/token_refresh_middleware.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/tunes/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +717 -706
- data/spaceship/lib/spaceship/connect_api/users/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/users/users.rb +28 -17
- data/spaceship/lib/spaceship/stats_middleware.rb +65 -0
- metadata +25 -18
- data/sigh/lib/sigh/.runner.rb.swp +0 -0
- data/spaceship/lib/spaceship/connect_api/models/.device.rb.swp +0 -0
| @@ -0,0 +1,94 @@ | |
| 1 | 
            +
            require_relative './client'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require_relative './testflight/testflight'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            module Spaceship
         | 
| 6 | 
            +
              class ConnectAPI
         | 
| 7 | 
            +
                class << self
         | 
| 8 | 
            +
                  # This client stores the global client when using the lazy syntax
         | 
| 9 | 
            +
                  attr_accessor :client
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                  # Forward class calls to the global client
         | 
| 12 | 
            +
                  # This is implemented for backwards compatibility
         | 
| 13 | 
            +
                  extend(Forwardable)
         | 
| 14 | 
            +
                  def_delegators(:client, *Spaceship::ConnectAPI::Provisioning::API.instance_methods(false))
         | 
| 15 | 
            +
                  def_delegators(:client, *Spaceship::ConnectAPI::TestFlight::API.instance_methods(false))
         | 
| 16 | 
            +
                  def_delegators(:client, *Spaceship::ConnectAPI::Tunes::API.instance_methods(false))
         | 
| 17 | 
            +
                  def_delegators(:client, *Spaceship::ConnectAPI::Users::API.instance_methods(false))
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  def client
         | 
| 20 | 
            +
                    # Always look for a client set explicitly by the client first
         | 
| 21 | 
            +
                    return @client if @client
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                    # A client may not always be explicitly set (specially when running tools like match, sigh, pilot, etc)
         | 
| 24 | 
            +
                    # In that case, create a new client based on existing sessions
         | 
| 25 | 
            +
                    # Note: This does not perform logins on the user. It is only reusing the cookies and selected teams
         | 
| 26 | 
            +
                    return nil if Spaceship::Tunes.client.nil? && Spaceship::Portal.client.nil?
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                    implicit_client = ConnectAPI::Client.new(tunes_client: Spaceship::Tunes.client, portal_client: Spaceship::Portal.client)
         | 
| 29 | 
            +
                    return implicit_client
         | 
| 30 | 
            +
                  end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                  def token=(token)
         | 
| 33 | 
            +
                    @client = ConnectAPI::Client.new(token: token)
         | 
| 34 | 
            +
                  end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                  def token
         | 
| 37 | 
            +
                    return nil if @client.nil?
         | 
| 38 | 
            +
                    return @client.token
         | 
| 39 | 
            +
                  end
         | 
| 40 | 
            +
             | 
| 41 | 
            +
                  def token?
         | 
| 42 | 
            +
                    (@client && @client.token)
         | 
| 43 | 
            +
                  end
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                  # Initializes client with Apple's App Store Connect JWT auth key.
         | 
| 46 | 
            +
                  #
         | 
| 47 | 
            +
                  # This method will automatically use the key id, issuer id, and filepath from environment
         | 
| 48 | 
            +
                  # variables if not given.
         | 
| 49 | 
            +
                  #
         | 
| 50 | 
            +
                  # All three parameters are needed to authenticate.
         | 
| 51 | 
            +
                  #
         | 
| 52 | 
            +
                  # @param key_id (String) (optional): The key id
         | 
| 53 | 
            +
                  # @param issuer_id (String) (optional): The issuer id
         | 
| 54 | 
            +
                  # @param filepath (String) (optional): The filepath
         | 
| 55 | 
            +
                  #
         | 
| 56 | 
            +
                  # @raise InvalidUserCredentialsError: raised if authentication failed
         | 
| 57 | 
            +
                  #
         | 
| 58 | 
            +
                  # @return (Spaceship::ConnectAPI::Client) The client the login method was called for
         | 
| 59 | 
            +
                  def auth(key_id: nil, issuer_id: nil, filepath: nil)
         | 
| 60 | 
            +
                    @client = ConnectAPI::Client.auth(key_id: key_id, issuer_id: issuer_id, filepath: filepath)
         | 
| 61 | 
            +
                  end
         | 
| 62 | 
            +
             | 
| 63 | 
            +
                  # Authenticates with Apple's web services. This method has to be called once
         | 
| 64 | 
            +
                  # to generate a valid session.
         | 
| 65 | 
            +
                  #
         | 
| 66 | 
            +
                  # This method will automatically use the username from the Appfile (if available)
         | 
| 67 | 
            +
                  # and fetch the password from the Keychain (if available)
         | 
| 68 | 
            +
                  #
         | 
| 69 | 
            +
                  # @param user (String) (optional): The username (usually the email address)
         | 
| 70 | 
            +
                  # @param password (String) (optional): The password
         | 
| 71 | 
            +
                  # @param team_id (String) (optional): The team id
         | 
| 72 | 
            +
                  # @param team_name (String) (optional): The team name
         | 
| 73 | 
            +
                  #
         | 
| 74 | 
            +
                  # @raise InvalidUserCredentialsError: raised if authentication failed
         | 
| 75 | 
            +
                  #
         | 
| 76 | 
            +
                  # @return (Spaceship::ConnectAPI::Client) The client the login method was called for
         | 
| 77 | 
            +
                  def login(user = nil, password = nil, team_id: nil, team_name: nil)
         | 
| 78 | 
            +
                    @client = ConnectAPI::Client.login(user, password, team_id: team_id, team_name: team_name)
         | 
| 79 | 
            +
                  end
         | 
| 80 | 
            +
             | 
| 81 | 
            +
                  # Open up the team selection for the user (if necessary).
         | 
| 82 | 
            +
                  #
         | 
| 83 | 
            +
                  # If the user is in multiple teams, a team selection is shown.
         | 
| 84 | 
            +
                  # The user can then select a team by entering the number
         | 
| 85 | 
            +
                  #
         | 
| 86 | 
            +
                  # @param team_id (String) (optional): The ID of an App Store Connect team
         | 
| 87 | 
            +
                  # @param team_name (String) (optional): The name of an App Store Connect team
         | 
| 88 | 
            +
                  def select_team(team_id: nil, team_name: nil)
         | 
| 89 | 
            +
                    return if client.nil?
         | 
| 90 | 
            +
                    client.select_team(team_id: team_id, team_name: team_name)
         | 
| 91 | 
            +
                  end
         | 
| 92 | 
            +
                end
         | 
| 93 | 
            +
              end
         | 
| 94 | 
            +
            end
         | 
| @@ -1,27 +1,18 @@ | |
| 1 | 
            -
            require_relative '../ | 
| 1 | 
            +
            require_relative '../api_client'
         | 
| 2 | 
            +
            require_relative './testflight'
         | 
| 2 3 | 
             
            require_relative '../../tunes/tunes_client'
         | 
| 3 4 |  | 
| 4 5 | 
             
            module Spaceship
         | 
| 5 6 | 
             
              class ConnectAPI
         | 
| 6 7 | 
             
                module TestFlight
         | 
| 7 | 
            -
                  class Client < Spaceship::ConnectAPI:: | 
| 8 | 
            -
                    def  | 
| 9 | 
            -
                       | 
| 10 | 
            -
                      if Spaceship::ConnectAPI.token
         | 
| 11 | 
            -
                        if @client.nil? || @client.token != Spaceship::ConnectAPI.token
         | 
| 12 | 
            -
                          @client = Client.new(token: Spaceship::ConnectAPI.token)
         | 
| 13 | 
            -
                        end
         | 
| 14 | 
            -
                      elsif Spaceship::Tunes.client
         | 
| 15 | 
            -
                        # Initialize new client if new or if team changed
         | 
| 16 | 
            -
                        if @client.nil? || @client.team_id != Spaceship::Tunes.client.team_id
         | 
| 17 | 
            -
                          @client = Client.client_with_authorization_from(Spaceship::Tunes.client)
         | 
| 18 | 
            -
                        end
         | 
| 19 | 
            -
                      end
         | 
| 8 | 
            +
                  class Client < Spaceship::ConnectAPI::APIClient
         | 
| 9 | 
            +
                    def initialize(cookie: nil, current_team_id: nil, token: nil, another_client: nil)
         | 
| 10 | 
            +
                      another_client ||= Spaceship::Tunes.client if cookie.nil? && token.nil?
         | 
| 20 11 |  | 
| 21 | 
            -
                       | 
| 22 | 
            -
                      raise "Please login using `Spaceship::Tunes.login('user', 'password')`" unless @client
         | 
| 12 | 
            +
                      super(cookie: cookie, current_team_id: current_team_id, token: token, another_client: another_client)
         | 
| 23 13 |  | 
| 24 | 
            -
                       | 
| 14 | 
            +
                      self.extend(Spaceship::ConnectAPI::TestFlight::API)
         | 
| 15 | 
            +
                      self.test_flight_request_client = self
         | 
| 25 16 | 
             
                    end
         | 
| 26 17 |  | 
| 27 18 | 
             
                    def self.hostname
         | 
| @@ -3,364 +3,375 @@ require 'spaceship/connect_api/testflight/client' | |
| 3 3 | 
             
            module Spaceship
         | 
| 4 4 | 
             
              class ConnectAPI
         | 
| 5 5 | 
             
                module TestFlight
         | 
| 6 | 
            -
                   | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 6 | 
            +
                  module API
         | 
| 7 | 
            +
                    def test_flight_request_client=(test_flight_request_client)
         | 
| 8 | 
            +
                      @test_flight_request_client = test_flight_request_client
         | 
| 9 | 
            +
                    end
         | 
| 9 10 |  | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 11 | 
            +
                    def test_flight_request_client
         | 
| 12 | 
            +
                      return @test_flight_request_client if @test_flight_request_client
         | 
| 13 | 
            +
                      raise TypeError, "You need to instantiate this module with test_flight_request_client"
         | 
| 14 | 
            +
                    end
         | 
| 14 15 |  | 
| 15 | 
            -
             | 
| 16 | 
            -
                     | 
| 17 | 
            -
                     | 
| 18 | 
            -
                  end
         | 
| 16 | 
            +
                    #
         | 
| 17 | 
            +
                    # apps
         | 
| 18 | 
            +
                    #
         | 
| 19 19 |  | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 20 | 
            +
                    def get_apps(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 21 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 22 | 
            +
                      @test_flight_request_client.get("apps", params)
         | 
| 23 | 
            +
                    end
         | 
| 23 24 |  | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 25 | 
            +
                    def get_app(app_id: nil, includes: nil)
         | 
| 26 | 
            +
                      params = @test_flight_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
         | 
| 27 | 
            +
                      @test_flight_request_client.get("apps/#{app_id}", params)
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                    #
         | 
| 31 | 
            +
                    # betaAppLocalizations
         | 
| 32 | 
            +
                    #
         | 
| 28 33 |  | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
                       | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 34 | 
            +
                    def get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 35 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 36 | 
            +
                      @test_flight_request_client.get("betaAppLocalizations", params)
         | 
| 37 | 
            +
                    end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                    def post_beta_app_localizations(app_id: nil, attributes: {})
         | 
| 40 | 
            +
                      body = {
         | 
| 41 | 
            +
                        data: {
         | 
| 42 | 
            +
                          attributes: attributes,
         | 
| 43 | 
            +
                          type: "betaAppLocalizations",
         | 
| 44 | 
            +
                          relationships: {
         | 
| 45 | 
            +
                            app: {
         | 
| 46 | 
            +
                              data: {
         | 
| 47 | 
            +
                                type: "apps",
         | 
| 48 | 
            +
                                id: app_id
         | 
| 49 | 
            +
                              }
         | 
| 39 50 | 
             
                            }
         | 
| 40 51 | 
             
                          }
         | 
| 41 52 | 
             
                        }
         | 
| 42 53 | 
             
                      }
         | 
| 43 | 
            -
                    }
         | 
| 44 54 |  | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 55 | 
            +
                      @test_flight_request_client.post("betaAppLocalizations", body)
         | 
| 56 | 
            +
                    end
         | 
| 47 57 |  | 
| 48 | 
            -
             | 
| 49 | 
            -
             | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 58 | 
            +
                    def patch_beta_app_localizations(localization_id: nil, attributes: {})
         | 
| 59 | 
            +
                      body = {
         | 
| 60 | 
            +
                        data: {
         | 
| 61 | 
            +
                          attributes: attributes,
         | 
| 62 | 
            +
                          id: localization_id,
         | 
| 63 | 
            +
                          type: "betaAppLocalizations"
         | 
| 64 | 
            +
                        }
         | 
| 54 65 | 
             
                      }
         | 
| 55 | 
            -
                    }
         | 
| 56 66 |  | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 67 | 
            +
                      @test_flight_request_client.patch("betaAppLocalizations/#{localization_id}", body)
         | 
| 68 | 
            +
                    end
         | 
| 59 69 |  | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 70 | 
            +
                    #
         | 
| 71 | 
            +
                    # betaAppReviewDetails
         | 
| 72 | 
            +
                    #
         | 
| 63 73 |  | 
| 64 | 
            -
             | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 67 | 
            -
             | 
| 74 | 
            +
                    def get_beta_app_review_detail(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 75 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 76 | 
            +
                      @test_flight_request_client.get("betaAppReviewDetails", params)
         | 
| 77 | 
            +
                    end
         | 
| 68 78 |  | 
| 69 | 
            -
             | 
| 70 | 
            -
             | 
| 71 | 
            -
             | 
| 72 | 
            -
             | 
| 73 | 
            -
             | 
| 74 | 
            -
             | 
| 79 | 
            +
                    def patch_beta_app_review_detail(app_id: nil, attributes: {})
         | 
| 80 | 
            +
                      body = {
         | 
| 81 | 
            +
                        data: {
         | 
| 82 | 
            +
                          attributes: attributes,
         | 
| 83 | 
            +
                          id: app_id,
         | 
| 84 | 
            +
                          type: "betaAppReviewDetails"
         | 
| 85 | 
            +
                        }
         | 
| 75 86 | 
             
                      }
         | 
| 76 | 
            -
                    }
         | 
| 77 87 |  | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 88 | 
            +
                      @test_flight_request_client.patch("betaAppReviewDetails/#{app_id}", body)
         | 
| 89 | 
            +
                    end
         | 
| 80 90 |  | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 91 | 
            +
                    #
         | 
| 92 | 
            +
                    # betaAppReviewSubmissions
         | 
| 93 | 
            +
                    #
         | 
| 84 94 |  | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
             | 
| 95 | 
            +
                    def get_beta_app_review_submissions(filter: {}, includes: nil, limit: nil, sort: nil, cursor: nil)
         | 
| 96 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort, cursor: cursor)
         | 
| 97 | 
            +
                      @test_flight_request_client.get("betaAppReviewSubmissions", params)
         | 
| 98 | 
            +
                    end
         | 
| 89 99 |  | 
| 90 | 
            -
             | 
| 91 | 
            -
             | 
| 92 | 
            -
             | 
| 93 | 
            -
             | 
| 94 | 
            -
             | 
| 95 | 
            -
             | 
| 96 | 
            -
             | 
| 97 | 
            -
             | 
| 98 | 
            -
             | 
| 100 | 
            +
                    def post_beta_app_review_submissions(build_id: nil)
         | 
| 101 | 
            +
                      body = {
         | 
| 102 | 
            +
                        data: {
         | 
| 103 | 
            +
                          type: "betaAppReviewSubmissions",
         | 
| 104 | 
            +
                          relationships: {
         | 
| 105 | 
            +
                            build: {
         | 
| 106 | 
            +
                              data: {
         | 
| 107 | 
            +
                                type: "builds",
         | 
| 108 | 
            +
                                id: build_id
         | 
| 109 | 
            +
                              }
         | 
| 99 110 | 
             
                            }
         | 
| 100 111 | 
             
                          }
         | 
| 101 112 | 
             
                        }
         | 
| 102 113 | 
             
                      }
         | 
| 103 | 
            -
                    }
         | 
| 104 114 |  | 
| 105 | 
            -
             | 
| 106 | 
            -
             | 
| 115 | 
            +
                      @test_flight_request_client.post("betaAppReviewSubmissions", body)
         | 
| 116 | 
            +
                    end
         | 
| 107 117 |  | 
| 108 | 
            -
             | 
| 109 | 
            -
             | 
| 110 | 
            -
             | 
| 111 | 
            -
             | 
| 118 | 
            +
                    def delete_beta_app_review_submission(beta_app_review_submission_id: nil)
         | 
| 119 | 
            +
                      params = @test_flight_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil, cursor: nil)
         | 
| 120 | 
            +
                      @test_flight_request_client.delete("betaAppReviewSubmissions/#{beta_app_review_submission_id}", params)
         | 
| 121 | 
            +
                    end
         | 
| 112 122 |  | 
| 113 | 
            -
             | 
| 114 | 
            -
             | 
| 115 | 
            -
             | 
| 123 | 
            +
                    #
         | 
| 124 | 
            +
                    # betaBuildLocalizations
         | 
| 125 | 
            +
                    #
         | 
| 116 126 |  | 
| 117 | 
            -
             | 
| 118 | 
            -
             | 
| 119 | 
            -
             | 
| 120 | 
            -
             | 
| 127 | 
            +
                    def get_beta_build_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 128 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 129 | 
            +
                      @test_flight_request_client.get("betaBuildLocalizations", params)
         | 
| 130 | 
            +
                    end
         | 
| 121 131 |  | 
| 122 | 
            -
             | 
| 123 | 
            -
             | 
| 124 | 
            -
             | 
| 125 | 
            -
             | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 132 | 
            +
                    def post_beta_build_localizations(build_id: nil, attributes: {})
         | 
| 133 | 
            +
                      body = {
         | 
| 134 | 
            +
                        data: {
         | 
| 135 | 
            +
                          attributes: attributes,
         | 
| 136 | 
            +
                          type: "betaBuildLocalizations",
         | 
| 137 | 
            +
                          relationships: {
         | 
| 138 | 
            +
                            build: {
         | 
| 139 | 
            +
                              data: {
         | 
| 140 | 
            +
                                type: "builds",
         | 
| 141 | 
            +
                                id: build_id
         | 
| 142 | 
            +
                              }
         | 
| 132 143 | 
             
                            }
         | 
| 133 144 | 
             
                          }
         | 
| 134 145 | 
             
                        }
         | 
| 135 146 | 
             
                      }
         | 
| 136 | 
            -
                    }
         | 
| 137 147 |  | 
| 138 | 
            -
             | 
| 139 | 
            -
             | 
| 148 | 
            +
                      @test_flight_request_client.post("betaBuildLocalizations", body)
         | 
| 149 | 
            +
                    end
         | 
| 140 150 |  | 
| 141 | 
            -
             | 
| 142 | 
            -
             | 
| 143 | 
            -
             | 
| 144 | 
            -
             | 
| 145 | 
            -
             | 
| 146 | 
            -
             | 
| 151 | 
            +
                    def patch_beta_build_localizations(localization_id: nil, feedbackEmail: nil, attributes: {})
         | 
| 152 | 
            +
                      body = {
         | 
| 153 | 
            +
                        data: {
         | 
| 154 | 
            +
                          attributes: attributes,
         | 
| 155 | 
            +
                          id: localization_id,
         | 
| 156 | 
            +
                          type: "betaBuildLocalizations"
         | 
| 157 | 
            +
                        }
         | 
| 147 158 | 
             
                      }
         | 
| 148 | 
            -
                    }
         | 
| 149 159 |  | 
| 150 | 
            -
             | 
| 151 | 
            -
             | 
| 160 | 
            +
                      @test_flight_request_client.patch("betaBuildLocalizations/#{localization_id}", body)
         | 
| 161 | 
            +
                    end
         | 
| 152 162 |  | 
| 153 | 
            -
             | 
| 154 | 
            -
             | 
| 155 | 
            -
             | 
| 163 | 
            +
                    #
         | 
| 164 | 
            +
                    # betaBuildMetrics
         | 
| 165 | 
            +
                    #
         | 
| 156 166 |  | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 159 | 
            -
             | 
| 160 | 
            -
             | 
| 167 | 
            +
                    def get_beta_build_metrics(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 168 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 169 | 
            +
                      @test_flight_request_client.get("betaBuildMetrics", params)
         | 
| 170 | 
            +
                    end
         | 
| 161 171 |  | 
| 162 | 
            -
             | 
| 163 | 
            -
             | 
| 164 | 
            -
             | 
| 172 | 
            +
                    #
         | 
| 173 | 
            +
                    # betaGroups
         | 
| 174 | 
            +
                    #
         | 
| 165 175 |  | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 168 | 
            -
             | 
| 169 | 
            -
             | 
| 176 | 
            +
                    def get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 177 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 178 | 
            +
                      @test_flight_request_client.get("betaGroups", params)
         | 
| 179 | 
            +
                    end
         | 
| 170 180 |  | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 173 | 
            -
             | 
| 174 | 
            -
             | 
| 175 | 
            -
             | 
| 176 | 
            -
             | 
| 177 | 
            -
             | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 181 | 
            +
                    def add_beta_groups_to_build(build_id: nil, beta_group_ids: [])
         | 
| 182 | 
            +
                      body = {
         | 
| 183 | 
            +
                        data: beta_group_ids.map do |id|
         | 
| 184 | 
            +
                          {
         | 
| 185 | 
            +
                            type: "betaGroups",
         | 
| 186 | 
            +
                            id: id
         | 
| 187 | 
            +
                          }
         | 
| 188 | 
            +
                        end
         | 
| 189 | 
            +
                      }
         | 
| 180 190 |  | 
| 181 | 
            -
             | 
| 182 | 
            -
             | 
| 191 | 
            +
                      @test_flight_request_client.post("builds/#{build_id}/relationships/betaGroups", body)
         | 
| 192 | 
            +
                    end
         | 
| 183 193 |  | 
| 184 | 
            -
             | 
| 185 | 
            -
             | 
| 186 | 
            -
             | 
| 187 | 
            -
             | 
| 188 | 
            -
             | 
| 189 | 
            -
             | 
| 190 | 
            -
             | 
| 191 | 
            -
             | 
| 192 | 
            -
             | 
| 193 | 
            -
             | 
| 194 | 
            -
             | 
| 195 | 
            -
             | 
| 196 | 
            -
             | 
| 197 | 
            -
             | 
| 194 | 
            +
                    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 | 
            +
                      body = {
         | 
| 196 | 
            +
                        data: {
         | 
| 197 | 
            +
                          attributes: {
         | 
| 198 | 
            +
                            name: group_name,
         | 
| 199 | 
            +
                            publicLinkEnabled: public_link_enabled,
         | 
| 200 | 
            +
                            publicLinkLimit: public_link_limit,
         | 
| 201 | 
            +
                            publicLinkLimitEnabled: public_link_limit_enabled
         | 
| 202 | 
            +
                          },
         | 
| 203 | 
            +
                          relationships: {
         | 
| 204 | 
            +
                            app: {
         | 
| 205 | 
            +
                              data: {
         | 
| 206 | 
            +
                                id: app_id,
         | 
| 207 | 
            +
                                type: "apps"
         | 
| 208 | 
            +
                              }
         | 
| 198 209 | 
             
                            }
         | 
| 199 | 
            -
                          }
         | 
| 200 | 
            -
             | 
| 201 | 
            -
                         | 
| 210 | 
            +
                          },
         | 
| 211 | 
            +
                          type: "betaGroups"
         | 
| 212 | 
            +
                        }
         | 
| 202 213 | 
             
                      }
         | 
| 203 | 
            -
             | 
| 204 | 
            -
                     | 
| 205 | 
            -
                  end
         | 
| 214 | 
            +
                      @test_flight_request_client.post("betaGroups", body)
         | 
| 215 | 
            +
                    end
         | 
| 206 216 |  | 
| 207 | 
            -
             | 
| 208 | 
            -
             | 
| 209 | 
            -
             | 
| 217 | 
            +
                    #
         | 
| 218 | 
            +
                    # betaTesters
         | 
| 219 | 
            +
                    #
         | 
| 210 220 |  | 
| 211 | 
            -
             | 
| 212 | 
            -
             | 
| 213 | 
            -
             | 
| 214 | 
            -
             | 
| 221 | 
            +
                    def get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 222 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 223 | 
            +
                      @test_flight_request_client.get("betaTesters", params)
         | 
| 224 | 
            +
                    end
         | 
| 215 225 |  | 
| 216 | 
            -
             | 
| 217 | 
            -
             | 
| 218 | 
            -
             | 
| 226 | 
            +
                    # beta_testers - [{email: "", firstName: "", lastName: ""}]
         | 
| 227 | 
            +
                    def post_bulk_beta_tester_assignments(beta_group_id: nil, beta_testers: nil)
         | 
| 228 | 
            +
                      beta_testers || []
         | 
| 219 229 |  | 
| 220 | 
            -
             | 
| 221 | 
            -
             | 
| 222 | 
            -
             | 
| 230 | 
            +
                      beta_testers.map do |tester|
         | 
| 231 | 
            +
                        tester[:errors] = []
         | 
| 232 | 
            +
                      end
         | 
| 223 233 |  | 
| 224 | 
            -
             | 
| 225 | 
            -
             | 
| 226 | 
            -
             | 
| 227 | 
            -
             | 
| 228 | 
            -
             | 
| 229 | 
            -
             | 
| 230 | 
            -
             | 
| 231 | 
            -
             | 
| 232 | 
            -
             | 
| 233 | 
            -
             | 
| 234 | 
            +
                      body = {
         | 
| 235 | 
            +
                        data: {
         | 
| 236 | 
            +
                          attributes: {
         | 
| 237 | 
            +
                            betaTesters: beta_testers
         | 
| 238 | 
            +
                          },
         | 
| 239 | 
            +
                          relationships: {
         | 
| 240 | 
            +
                            betaGroup: {
         | 
| 241 | 
            +
                              data: {
         | 
| 242 | 
            +
                                type: "betaGroups",
         | 
| 243 | 
            +
                                id: beta_group_id
         | 
| 244 | 
            +
                              }
         | 
| 234 245 | 
             
                            }
         | 
| 235 | 
            -
                          }
         | 
| 236 | 
            -
             | 
| 237 | 
            -
                         | 
| 246 | 
            +
                          },
         | 
| 247 | 
            +
                          type: "bulkBetaTesterAssignments"
         | 
| 248 | 
            +
                        }
         | 
| 238 249 | 
             
                      }
         | 
| 239 | 
            -
                    }
         | 
| 240 250 |  | 
| 241 | 
            -
             | 
| 242 | 
            -
             | 
| 251 | 
            +
                      @test_flight_request_client.post("bulkBetaTesterAssignments", body)
         | 
| 252 | 
            +
                    end
         | 
| 243 253 |  | 
| 244 | 
            -
             | 
| 245 | 
            -
             | 
| 246 | 
            -
             | 
| 247 | 
            -
             | 
| 248 | 
            -
             | 
| 249 | 
            -
             | 
| 250 | 
            -
             | 
| 251 | 
            -
             | 
| 252 | 
            -
             | 
| 254 | 
            +
                    def delete_beta_tester_from_apps(beta_tester_id: nil, app_ids: [])
         | 
| 255 | 
            +
                      body = {
         | 
| 256 | 
            +
                        data: app_ids.map do |id|
         | 
| 257 | 
            +
                          {
         | 
| 258 | 
            +
                            type: "apps",
         | 
| 259 | 
            +
                            id: id
         | 
| 260 | 
            +
                          }
         | 
| 261 | 
            +
                        end
         | 
| 262 | 
            +
                      }
         | 
| 253 263 |  | 
| 254 | 
            -
             | 
| 255 | 
            -
             | 
| 264 | 
            +
                      @test_flight_request_client.delete("betaTesters/#{beta_tester_id}/relationships/apps", nil, body)
         | 
| 265 | 
            +
                    end
         | 
| 256 266 |  | 
| 257 | 
            -
             | 
| 258 | 
            -
             | 
| 259 | 
            -
             | 
| 260 | 
            -
             | 
| 261 | 
            -
             | 
| 262 | 
            -
             | 
| 263 | 
            -
             | 
| 264 | 
            -
             | 
| 265 | 
            -
             | 
| 267 | 
            +
                    def delete_beta_tester_from_beta_groups(beta_tester_id: nil, beta_group_ids: [])
         | 
| 268 | 
            +
                      body = {
         | 
| 269 | 
            +
                        data: beta_group_ids.map do |id|
         | 
| 270 | 
            +
                          {
         | 
| 271 | 
            +
                            type: "betaGroups",
         | 
| 272 | 
            +
                            id: id
         | 
| 273 | 
            +
                          }
         | 
| 274 | 
            +
                        end
         | 
| 275 | 
            +
                      }
         | 
| 266 276 |  | 
| 267 | 
            -
             | 
| 268 | 
            -
             | 
| 277 | 
            +
                      @test_flight_request_client.delete("betaTesters/#{beta_tester_id}/relationships/betaGroups", nil, body)
         | 
| 278 | 
            +
                    end
         | 
| 269 279 |  | 
| 270 | 
            -
             | 
| 271 | 
            -
             | 
| 272 | 
            -
             | 
| 280 | 
            +
                    #
         | 
| 281 | 
            +
                    # betaTesterMetrics
         | 
| 282 | 
            +
                    #
         | 
| 273 283 |  | 
| 274 | 
            -
             | 
| 275 | 
            -
             | 
| 276 | 
            -
             | 
| 277 | 
            -
             | 
| 284 | 
            +
                    def get_beta_tester_metrics(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 285 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 286 | 
            +
                      @test_flight_request_client.get("betaTesterMetrics", params)
         | 
| 287 | 
            +
                    end
         | 
| 278 288 |  | 
| 279 | 
            -
             | 
| 280 | 
            -
             | 
| 281 | 
            -
             | 
| 289 | 
            +
                    #
         | 
| 290 | 
            +
                    # builds
         | 
| 291 | 
            +
                    #
         | 
| 282 292 |  | 
| 283 | 
            -
             | 
| 284 | 
            -
             | 
| 285 | 
            -
             | 
| 286 | 
            -
             | 
| 293 | 
            +
                    def get_builds(filter: {}, includes: "buildBetaDetail,betaBuildMetrics", limit: 10, sort: "uploadedDate", cursor: nil)
         | 
| 294 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort, cursor: cursor)
         | 
| 295 | 
            +
                      @test_flight_request_client.get("builds", params)
         | 
| 296 | 
            +
                    end
         | 
| 287 297 |  | 
| 288 | 
            -
             | 
| 289 | 
            -
             | 
| 290 | 
            -
             | 
| 291 | 
            -
             | 
| 292 | 
            -
             | 
| 293 | 
            -
             | 
| 294 | 
            -
             | 
| 295 | 
            -
             | 
| 296 | 
            -
             | 
| 298 | 
            +
                    def get_build(build_id: nil, app_store_version_id: nil, includes: nil)
         | 
| 299 | 
            +
                      if build_id
         | 
| 300 | 
            +
                        params = @test_flight_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil, cursor: nil)
         | 
| 301 | 
            +
                        return @test_flight_request_client.get("builds/#{build_id}", params)
         | 
| 302 | 
            +
                      elsif app_store_version_id
         | 
| 303 | 
            +
                        params = @test_flight_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil, cursor: nil)
         | 
| 304 | 
            +
                        return @test_flight_request_client.get("appStoreVersions/#{app_store_version_id}/build", params)
         | 
| 305 | 
            +
                      else
         | 
| 306 | 
            +
                        return nil
         | 
| 307 | 
            +
                      end
         | 
| 297 308 | 
             
                    end
         | 
| 298 | 
            -
                  end
         | 
| 299 309 |  | 
| 300 | 
            -
             | 
| 301 | 
            -
             | 
| 302 | 
            -
             | 
| 303 | 
            -
             | 
| 304 | 
            -
             | 
| 305 | 
            -
             | 
| 310 | 
            +
                    def patch_builds(build_id: nil, attributes: {})
         | 
| 311 | 
            +
                      body = {
         | 
| 312 | 
            +
                        data: {
         | 
| 313 | 
            +
                          attributes: attributes,
         | 
| 314 | 
            +
                          id: build_id,
         | 
| 315 | 
            +
                          type: "builds"
         | 
| 316 | 
            +
                        }
         | 
| 306 317 | 
             
                      }
         | 
| 307 | 
            -
                    }
         | 
| 308 318 |  | 
| 309 | 
            -
             | 
| 310 | 
            -
             | 
| 319 | 
            +
                      @test_flight_request_client.patch("builds/#{build_id}", body)
         | 
| 320 | 
            +
                    end
         | 
| 311 321 |  | 
| 312 | 
            -
             | 
| 313 | 
            -
             | 
| 314 | 
            -
             | 
| 322 | 
            +
                    #
         | 
| 323 | 
            +
                    # buildBetaDetails
         | 
| 324 | 
            +
                    #
         | 
| 315 325 |  | 
| 316 | 
            -
             | 
| 317 | 
            -
             | 
| 318 | 
            -
             | 
| 319 | 
            -
             | 
| 326 | 
            +
                    def get_build_beta_details(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 327 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 328 | 
            +
                      @test_flight_request_client.get("buildBetaDetails", params)
         | 
| 329 | 
            +
                    end
         | 
| 320 330 |  | 
| 321 | 
            -
             | 
| 322 | 
            -
             | 
| 323 | 
            -
             | 
| 324 | 
            -
             | 
| 325 | 
            -
             | 
| 326 | 
            -
             | 
| 331 | 
            +
                    def patch_build_beta_details(build_beta_details_id: nil, attributes: {})
         | 
| 332 | 
            +
                      body = {
         | 
| 333 | 
            +
                        data: {
         | 
| 334 | 
            +
                          attributes: attributes,
         | 
| 335 | 
            +
                          id: build_beta_details_id,
         | 
| 336 | 
            +
                          type: "buildBetaDetails"
         | 
| 337 | 
            +
                        }
         | 
| 327 338 | 
             
                      }
         | 
| 328 | 
            -
                    }
         | 
| 329 339 |  | 
| 330 | 
            -
             | 
| 331 | 
            -
             | 
| 340 | 
            +
                      @test_flight_request_client.patch("buildBetaDetails/#{build_beta_details_id}", body)
         | 
| 341 | 
            +
                    end
         | 
| 332 342 |  | 
| 333 | 
            -
             | 
| 334 | 
            -
             | 
| 335 | 
            -
             | 
| 343 | 
            +
                    #
         | 
| 344 | 
            +
                    # buildDeliveries
         | 
| 345 | 
            +
                    #
         | 
| 336 346 |  | 
| 337 | 
            -
             | 
| 338 | 
            -
             | 
| 339 | 
            -
             | 
| 340 | 
            -
             | 
| 347 | 
            +
                    def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 348 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 349 | 
            +
                      @test_flight_request_client.get("buildDeliveries", params)
         | 
| 350 | 
            +
                    end
         | 
| 341 351 |  | 
| 342 | 
            -
             | 
| 343 | 
            -
             | 
| 344 | 
            -
             | 
| 352 | 
            +
                    #
         | 
| 353 | 
            +
                    # preReleaseVersions
         | 
| 354 | 
            +
                    #
         | 
| 345 355 |  | 
| 346 | 
            -
             | 
| 347 | 
            -
             | 
| 348 | 
            -
             | 
| 349 | 
            -
             | 
| 356 | 
            +
                    def get_pre_release_versions(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 357 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 358 | 
            +
                      @test_flight_request_client.get("preReleaseVersions", params)
         | 
| 359 | 
            +
                    end
         | 
| 350 360 |  | 
| 351 | 
            -
             | 
| 352 | 
            -
             | 
| 353 | 
            -
             | 
| 361 | 
            +
                    #
         | 
| 362 | 
            +
                    # betaFeedbacks (private API as of end 2019)
         | 
| 363 | 
            +
                    #
         | 
| 354 364 |  | 
| 355 | 
            -
             | 
| 356 | 
            -
             | 
| 357 | 
            -
             | 
| 358 | 
            -
             | 
| 365 | 
            +
                    def get_beta_feedback(filter: {}, includes: nil, limit: nil, sort: nil)
         | 
| 366 | 
            +
                      params = @test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
         | 
| 367 | 
            +
                      @test_flight_request_client.get("betaFeedbacks", params)
         | 
| 368 | 
            +
                    end
         | 
| 359 369 |  | 
| 360 | 
            -
             | 
| 361 | 
            -
             | 
| 370 | 
            +
                    def delete_beta_feedback(feedback_id: nil)
         | 
| 371 | 
            +
                      raise "Feedback id is nil" if feedback_id.nil?
         | 
| 362 372 |  | 
| 363 | 
            -
             | 
| 373 | 
            +
                      @test_flight_request_client.delete("betaFeedbacks/#{feedback_id}")
         | 
| 374 | 
            +
                    end
         | 
| 364 375 | 
             
                  end
         | 
| 365 376 | 
             
                end
         | 
| 366 377 | 
             
              end
         |