payroll_hero-api 1.3.0 → 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: ac465cfa37b58e1920c41ea738dd2abc17a0fd9be7e2ab1b0c0c810842751f2a
4
- data.tar.gz: 025353a74f5b48720fe91af34ee307ecaf1edada0410557ee3a29196041ebfc0
3
+ metadata.gz: b7d87ebf5c0d69d41ce93fa9fc43ab102dfde47ae502b4759be1f607b1a00370
4
+ data.tar.gz: 965388cb851e573e6312dac69f634e241084b9ca20a9d617f84476576970ca30
5
5
  SHA512:
6
- metadata.gz: 2695041a137e5e1caaf6d18d97c3475a1f37629bbb14e260532cfd5e1d1d588967b9011b981c5db575e4f73e2dbf2967133d883d3fa59d346357cd2e968fe143
7
- data.tar.gz: 2ff97007820ae845b4394a9dd74287cd04f271d3c6ddc53f621baa2804fbe864312090e077f1c72d538bc9ad9771ca66fcbf4b23e475c1cd73dd3d1ef70f2636
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,15 @@
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
+
8
+ ## [v1.3.1](https://github.com/payrollhero/payroll_hero-api/tree/v1.3.1) (2022-11-24)
9
+ [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.3.0...v1.3.1)
10
+
11
+ - [FIX] default params needs to be nil by default not empty arrays
12
+
3
13
  ## [v1.3.0](https://github.com/payrollhero/payroll_hero-api/tree/v1.3.0) (2022-11-21)
4
14
  [Full Changelog](https://github.com/payrollhero/payroll_hero-api/compare/v1.2.7...v1.3.0)
5
15
 
@@ -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
  }
@@ -9,8 +9,8 @@ module PayrollHero
9
9
  end_time: nil,
10
10
  start_date: nil,
11
11
  end_date: nil,
12
- employee_ids: [],
13
- worksite_ids: [],
12
+ employee_ids: nil,
13
+ worksite_ids: nil,
14
14
  excluded_worksite_ids: nil,
15
15
  shared_events: nil,
16
16
  page: nil,
@@ -1,5 +1,5 @@
1
1
  module PayrollHero
2
2
  module Api
3
- VERSION = "1.3.0"
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.0
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-21 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.4.0.dev
236
+ rubygems_version: 3.4.18
237
237
  signing_key:
238
238
  specification_version: 4
239
239
  summary: Ruby API Client for PayrollHero Apis