payroll_hero-api 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dac5c567657fc69a648b1a09be4d242fe375383546f554ff843812273fae7ae5
4
- data.tar.gz: 02d1a8935d38617f58101e560ecfab7a2a35dd13dd7239f364954d8b6d045b2b
3
+ metadata.gz: b7d87ebf5c0d69d41ce93fa9fc43ab102dfde47ae502b4759be1f607b1a00370
4
+ data.tar.gz: 965388cb851e573e6312dac69f634e241084b9ca20a9d617f84476576970ca30
5
5
  SHA512:
6
- metadata.gz: 8ddf360c26a831b88f9726b8d3317f556bad919cd58a7ec235a789db68d8e487aafec8f5b8d4e7f85a2b9c4271c46f8183b221ada1dce4ed3733f11d94aada65
7
- data.tar.gz: 196fad1654cae835c424ad9553352004efccfccb4aec7384c4b095534fcf7bbcfec85e91d12bfb929cd11c82eb5c9f736048cf3f50aac71bf2916abccb8eb868
6
+ metadata.gz: ac4a88d0344abdf1a335ffcd9b2a74f1928da4061460247ec913ff4e592562e4d7449599ecd99dd590cc5034a0c3148878271738cb2271bc6de2512c228ba9db
7
+ data.tar.gz: 7479f3c9860580531f28504e6a861c68e35eb77067d262c5a55ffcaf7934550a6f7d706ec75bf515b23430a7c40f80fe98a79fce56b4d1915472f0070e79511a
@@ -20,6 +20,8 @@ jobs:
20
20
  gemfile: ["rails_7.0"]
21
21
  ruby: [2.7]
22
22
  include:
23
+ - gemfile: rails_7.0
24
+ ruby: '3.2'
23
25
  - gemfile: rails_7.0
24
26
  ruby: '3.1'
25
27
  # - gemfile: rails_6.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.4.0](https://github.com/payrollhero/payroll_hero-api/tree/v1.4.0) (2023-10-09)
4
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.3.1...v1.4.0)
5
+
6
+ - Added provisions for passing shared cookies (credentials) for SuperAdmin access.
7
+
3
8
  ## [v1.3.1](https://github.com/payrollhero/payroll_hero-api/tree/v1.3.1) (2022-11-24)
4
9
  [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.3.0...v1.3.1)
5
10
 
@@ -2,8 +2,8 @@ module PayrollHero
2
2
  module Api
3
3
 
4
4
  class BaseGroup
5
- def initialize(token)
6
- @client = new_client(token, :core)
5
+ def initialize(token, cookies = {})
6
+ @client = new_client(token, :core, cookies)
7
7
  end
8
8
 
9
9
 
@@ -15,8 +15,8 @@ module PayrollHero
15
15
  PayrollHero::Api.send("#{name}_base_url")
16
16
  end
17
17
 
18
- def new_client(token, name)
19
- Client.new(token, base_url_for(name))
18
+ def new_client(token, name, cookies)
19
+ Client.new(token, base_url_for(name), cookies)
20
20
  end
21
21
 
22
22
  def remove_nil_values_from!(hash)
@@ -8,10 +8,11 @@ module PayrollHero
8
8
  class Client
9
9
  attr_reader :client
10
10
 
11
- def initialize(token, base_url)
11
+ def initialize(token, base_url, cookies = {})
12
12
  headers = {
13
13
  'User-Agent' => user_agent_string,
14
14
  }
15
+ headers.merge!({ 'Cookie' => cookies.map { |key, value| "#{key}=#{value}" }.join('; ') }) unless cookies.nil? || cookies.empty?
15
16
  params = {
16
17
  token: token,
17
18
  }
@@ -1,5 +1,5 @@
1
1
  module PayrollHero
2
2
  module Api
3
- VERSION = "1.3.1"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
@@ -10,22 +10,22 @@ module PayrollHero
10
10
  define_setting :debug, false
11
11
  define_setting :application_name, :none
12
12
 
13
- def self.new(token)
13
+ def self.new(token, cookies = {})
14
14
  sections = {
15
15
  v2: {
16
- worksites: V2::Worksites.new(token),
16
+ worksites: V2::Worksites.new(token, cookies),
17
17
  },
18
18
  v3: {
19
- day_schedules: V3::DaySchedules.new(token),
20
- employees: V3::Employees.new(token),
21
- attendance_days: V3::AttendanceDays.new(token),
19
+ day_schedules: V3::DaySchedules.new(token, cookies),
20
+ employees: V3::Employees.new(token, cookies),
21
+ attendance_days: V3::AttendanceDays.new(token, cookies),
22
22
  },
23
23
  v4: {
24
- employees: V4::Employees.new(token),
25
- leaves: V4::Leaves.new(token),
26
- permissions: V4::Permissions.new(token),
27
- shifts: V4::Shifts.new(token),
28
- schedule_events: V4::ScheduleEvents.new(token),
24
+ employees: V4::Employees.new(token, cookies),
25
+ leaves: V4::Leaves.new(token, cookies),
26
+ permissions: V4::Permissions.new(token, cookies),
27
+ shifts: V4::Shifts.new(token, cookies),
28
+ schedule_events: V4::ScheduleEvents.new(token, cookies),
29
29
  }
30
30
  }
31
31
  Hashie::Mash.new(sections)
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'rake', '~> 10.0'
29
29
  spec.add_development_dependency 'rspec'
30
30
  spec.add_development_dependency 'rubocop'
31
- spec.add_development_dependency 'vcr'
31
+ spec.add_development_dependency 'vcr', '< 6.2'
32
32
  spec.add_development_dependency 'webmock'
33
33
  spec.add_development_dependency 'rack', '< 2.0.0' # requires ruby >= 2.2.2 for 2.0
34
34
  # Version locked as 1.10.4 has known installation issues
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payroll_hero-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Banasik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-23 00:00:00.000000000 Z
11
+ date: 2023-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: vcr
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "<"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '6.2'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "<"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '6.2'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: webmock
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  - !ruby/object:Gem::Version
234
234
  version: '0'
235
235
  requirements: []
236
- rubygems_version: 3.3.7
236
+ rubygems_version: 3.4.18
237
237
  signing_key:
238
238
  specification_version: 4
239
239
  summary: Ruby API Client for PayrollHero Apis