leap_salesforce 1.0.4 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 524899b1fcc374750dcb570db5de67ad6aaea98e8d9fd1381ed5c68cec0ea34a
4
- data.tar.gz: d950d41267bbfde2fa9e7765b1f89a7b72cf61c47589567adef70b0a62e0566c
3
+ metadata.gz: 258bca84c4767b65af3cd5c8d9ba5793bde62df0252362e0f1e299104285da0a
4
+ data.tar.gz: dbd278d3534e47034f9ea13b01343b5411b0e57a5f1a06e571d27154bcb3d774
5
5
  SHA512:
6
- metadata.gz: 5717e4bc877a62fa921abe70c0a2ee12d4a29e46941d6e0283f8665dc49d76d9a78be697ba4be609f6567d545b29e2d8cf6a7c965a4924e328feff71b090b891
7
- data.tar.gz: 37adfa1837d29609c6aee8f2195ca0e41c134b94d5ced4be994064e4720eb12fe7930276fb296a9794a452a9ce21633c913fa507dfce24a88a51504b6cdecf95
6
+ metadata.gz: 40c2ed16eafa5a643fca053388b67ca49014039850c5b1c4a36da11857b3f6f98c1abc032215b2426069df4c854751be4378f97550663c25459318d41434275e
7
+ data.tar.gz: 781698e76929b80b87607616f27525d5d09c359a1880e27768c4dc970e26f9a825f882e6b8495860c16ab4776340135b93a768e771cef201f7829c6f31ea529c
data/.gitlab-ci.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  include:
2
2
  - template: Code-Quality.gitlab-ci.yml
3
3
 
4
- image: ruby:2.7
4
+ image: ruby:3.0
5
5
 
6
6
  stages:
7
7
  - test
@@ -18,7 +18,7 @@ variables:
18
18
  pages:
19
19
  stage: deploy
20
20
  dependencies:
21
- - test_2.7
21
+ - test
22
22
  script:
23
23
  - mv coverage/ public
24
24
  artifacts:
@@ -612,7 +612,8 @@ pages:
612
612
  sfdx force:auth:jwt:grant --clientid "$SF_CONSUMER_KEY" --jwtkeyfile assets/server.key --username "$SF_USERNAME" --setdefaultdevhubusername --setalias HubOrg
613
613
  }
614
614
 
615
- test_2.7:
615
+ test:
616
+ image: ruby:3.0
616
617
  script:
617
618
  # Decrypt server key
618
619
  - *sfdx_helpers
@@ -624,14 +625,3 @@ test_2.7:
624
625
  artifacts:
625
626
  paths:
626
627
  - coverage/
627
-
628
- test_3.0:
629
- image: ruby:3.0
630
- script:
631
- # Decrypt server key
632
- - *sfdx_helpers
633
- - setup_integration_env
634
- - bundle exec rake check_oauth # Check OAuth
635
- - bundle exec rake leaps:create_soql_objects
636
- - bundle exec rake leaps:create_enums
637
- - bundle exec rspec
data/ChangeLog CHANGED
@@ -1,3 +1,16 @@
1
+ Version 1.1.2
2
+ * Fix user_id from session
3
+
4
+ Version 1.1.1
5
+ * Allow session information from SOAP login to be available with LeapSalesforce::Session class
6
+
7
+ Version 1.1.0
8
+ * Proper fix to work with activerecord 7 - requires ruby > 2.7
9
+
10
+ Version 1.0.5
11
+ * Fix
12
+ * Stabilize using of active record by fixing version
13
+
1
14
  Version 1.0.4
2
15
  * Enhancement
3
16
  * Strip out ':' from user key for when it is accidentally added
data/README.md CHANGED
@@ -27,7 +27,7 @@ The benefits of an open source tool like this are:
27
27
  and can add extra unit tests if you need more confidence
28
28
  * Built with and for CI in Gitlab. Designed to work within Docker containers
29
29
  * Will integrate with `sfdx` leveraging all of it's benefits
30
- * Supported by [IntegrationQA](www.integrationqa.com) who can provide
30
+ * Supported by [Sentify](https://www.sentify.co/) who can provide
31
31
  [support and training](https://gitlab.com/leap-dojo/leap_salesforce/wikis/SupportModel)
32
32
  to help you get started and overcome challenges
33
33
 
@@ -577,4 +577,5 @@ Everyone interacting in the LeapSalesforce project’s codebases, issue trackers
577
577
  * Presentation on this library [here](https://gitpitch.com/leap-dojo/leap_salesforce?grs=gitlab)
578
578
  * Example of this library within a CI/CD pipeline [here](https://gitlab.com/iqa_public/labs/salesforce_cicd_demo)
579
579
  * Using `leap_salesforce` to download event log files [here](https://gitlab.com/samuel-garratt/leap_salesforce_event_log_files)
580
+ * Video walking through setting up automation using this [here](https://youtu.be/Xvj0mAnDKfA)
580
581
 
data/Rakefile CHANGED
@@ -14,6 +14,7 @@ RSpec::Core::RakeTask.new(:spec)
14
14
 
15
15
  desc 'Check Salesforce OAuth2 authentication is working'
16
16
  task :check_oauth do
17
+ Soaspec::OAuth2.debug_oauth = true
17
18
  LeapSalesforce.oauth_working?
18
19
  end
19
20
 
@@ -32,7 +32,7 @@ It reads the Metadata from Salesforce and creates the foundation for API tests.'
32
32
  spec.add_development_dependency 'semaphore_test_boosters'
33
33
  spec.add_development_dependency 'topoisomerase'
34
34
  spec.add_development_dependency 'yard-doctest'
35
- spec.add_dependency 'activerecord'
35
+ spec.add_dependency 'activerecord', '7'
36
36
  spec.add_dependency 'colorize'
37
37
  spec.add_dependency 'factory_bot'
38
38
  spec.add_dependency 'faker', '>= 2.0'
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'nori/core_ext'
4
4
  require 'humanize'
5
+ require 'active_support/isolated_execution_state'
5
6
  require 'active_support/core_ext/string'
6
7
  require 'date'
7
8
  require 'json'
@@ -0,0 +1,38 @@
1
+ require_relative 'auth'
2
+ require 'savon'
3
+ require 'json'
4
+
5
+ module LeapSalesforce
6
+ # Holds information about a login session
7
+ class Session
8
+ # @return [String] Session id returned from SOAP API
9
+ attr_accessor :session_id
10
+ # @return [String] User id returned from SOAP API
11
+ attr_accessor :user_id
12
+
13
+ def initialize(username, password)
14
+ login_body = LeapSalesforce::Session.soap_login username, password
15
+
16
+ self.session_id = login_body[:login_response][:result][:session_id]
17
+ self.user_id = login_body[:login_response][:result][:user_id]
18
+ end
19
+
20
+ class << self
21
+
22
+ # Login via SOAP API
23
+ def soap_login(username, password)
24
+ client = Savon.client do
25
+ endpoint "#{SoqlHandler.instance_url}/services/Soap/u/51.0"
26
+ namespace "urn:partner.soap.sforce.com"
27
+ end
28
+
29
+ response = client.call(:login, message:
30
+ {
31
+ username: username,
32
+ password: password
33
+ })
34
+ response.body
35
+ end
36
+ end
37
+ end
38
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '1.0.4'
5
+ VERSION = '1.1.2'
6
6
  end
@@ -8,6 +8,7 @@ Soaspec.log_warnings = false # Log any API warnings
8
8
  Soaspec::SpecLogger.progname = 'Leaps' # Program name shown in logs
9
9
  Soaspec::OAuth2.request_message = false # Don't display message explaining OAuth request
10
10
  Soaspec::OAuth2.retry_limit = 1 # Retrying for OAuth token too many times results in user locked out
11
+ require 'active_support/isolated_execution_state'
11
12
  require 'active_support/core_ext/integer/time' # Creating time objects
12
13
  require 'leap_salesforce/parameters' # Important to load this first
13
14
  require 'leap_salesforce/ext/string'
@@ -18,6 +19,7 @@ require 'factory_bot' # For mass production of data
18
19
  require 'faker' # For fake data
19
20
  require 'leap_salesforce/error'
20
21
  require 'leap_salesforce/loader'
22
+ require 'leap_salesforce/session'
21
23
 
22
24
  # If variable is present within LeapSalesforce set it
23
25
  def load_variables_from(file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leap_salesforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - IQA
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-02-09 00:00:00.000000000 Z
12
+ date: 2022-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -99,16 +99,16 @@ dependencies:
99
99
  name: activerecord
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: '7'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - '='
110
110
  - !ruby/object:Gem::Version
111
- version: '0'
111
+ version: '7'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: colorize
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -333,6 +333,7 @@ files:
333
333
  - lib/leap_salesforce/rake.rb
334
334
  - lib/leap_salesforce/rake/setup.rake
335
335
  - lib/leap_salesforce/rake/sfdx.rake
336
+ - lib/leap_salesforce/session.rb
336
337
  - lib/leap_salesforce/soql_data/common_enum_methods.rb
337
338
  - lib/leap_salesforce/soql_data/data_relationships.rb
338
339
  - lib/leap_salesforce/soql_data/meta_data_handler.rb
@@ -370,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
370
371
  - !ruby/object:Gem::Version
371
372
  version: '0'
372
373
  requirements: []
373
- rubygems_version: 3.0.6
374
+ rubygems_version: 3.2.3
374
375
  signing_key:
375
376
  specification_version: 4
376
377
  summary: Helps with setting up integrated automated test frameworks against Salesforce.