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 +4 -4
- data/.github/workflows/ci.yml +2 -0
- data/CHANGELOG.md +10 -0
- data/lib/payroll_hero/api/base_group.rb +4 -4
- data/lib/payroll_hero/api/client.rb +2 -1
- data/lib/payroll_hero/api/v4/schedule_events.rb +2 -2
- data/lib/payroll_hero/api/version.rb +1 -1
- data/lib/payroll_hero/api.rb +10 -10
- data/payroll_hero-api.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7d87ebf5c0d69d41ce93fa9fc43ab102dfde47ae502b4759be1f607b1a00370
|
4
|
+
data.tar.gz: 965388cb851e573e6312dac69f634e241084b9ca20a9d617f84476576970ca30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac4a88d0344abdf1a335ffcd9b2a74f1928da4061460247ec913ff4e592562e4d7449599ecd99dd590cc5034a0c3148878271738cb2271bc6de2512c228ba9db
|
7
|
+
data.tar.gz: 7479f3c9860580531f28504e6a861c68e35eb77067d262c5a55ffcaf7934550a6f7d706ec75bf515b23430a7c40f80fe98a79fce56b4d1915472f0070e79511a
|
data/.github/workflows/ci.yml
CHANGED
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
|
}
|
data/lib/payroll_hero/api.rb
CHANGED
@@ -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)
|
data/payroll_hero-api.gemspec
CHANGED
@@ -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.
|
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:
|
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: '
|
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: '
|
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.
|
236
|
+
rubygems_version: 3.4.18
|
237
237
|
signing_key:
|
238
238
|
specification_version: 4
|
239
239
|
summary: Ruby API Client for PayrollHero Apis
|