ashby 0.1.3 → 0.1.4
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/CHANGELOG.md +8 -1
- data/lib/ashby/reports.rb +44 -0
- data/lib/ashby/version.rb +1 -1
- data/lib/ashby.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09a8af897eeee672d698d855e5f6ac0f59d73d3cce0a24390cb76e5a549b5327'
|
|
4
|
+
data.tar.gz: '0385e3c248c17ca0e3269bcf68388109d19c8b4e2cd6ef62f7da4ea064d97d71'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 792cd2180f6a00004eca115b3bc2754aa33a0a0459668d036e552505ec93521fcb243f379d0d145fc9662f1e7fcc100a961e9a03d812f889731b903d1c44ac09
|
|
7
|
+
data.tar.gz: 351e266d26c5768264f56d16a067684ad50914ef882df4877ea22847f8866e3f3d76cc9c4f3e77a324e1a193f5ad90cce07a14b45492e5b4ed4d30612412b433
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.4] - 2025-12-08
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `Ashby::Reports.synchronous` - Retrieve report data synchronously with 30-second timeout
|
|
8
|
+
- `Ashby::Reports.generate` - Generate reports asynchronously with two-step polling process
|
|
2
9
|
|
|
3
10
|
## [0.1.0] - 2025-05-30
|
|
4
11
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ashby
|
|
4
|
+
# Ashby::Reports provides access to report-related functionality in the Ashby API.
|
|
5
|
+
#
|
|
6
|
+
# Supports running reports synchronously and generating them asynchronously.
|
|
7
|
+
# The synchronous endpoint has a 30-second timeout; for longer-running reports, use the
|
|
8
|
+
# asynchronous generate method.
|
|
9
|
+
#
|
|
10
|
+
# Example:
|
|
11
|
+
# Ashby::Reports.synchronous(id: 'report_abc123')
|
|
12
|
+
#
|
|
13
|
+
# # Async generation - two-step process
|
|
14
|
+
# result = Ashby::Reports.generate(id: 'report_abc123')
|
|
15
|
+
# request_id = result['requestId']
|
|
16
|
+
# # Poll until complete
|
|
17
|
+
# result = Ashby::Reports.generate(id: 'report_abc123', request_id: request_id)
|
|
18
|
+
#
|
|
19
|
+
class Reports < Client
|
|
20
|
+
# Retrieves report data synchronously (30 second timeout)
|
|
21
|
+
# If a report times out, use generate instead
|
|
22
|
+
def self.synchronous(id: nil)
|
|
23
|
+
raise ArgumentError, 'Report ID is required' if id.to_s.strip.empty?
|
|
24
|
+
|
|
25
|
+
payload = { reportId: id }
|
|
26
|
+
response = post('report.synchronous', payload)
|
|
27
|
+
response['results']
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Generates a report asynchronously
|
|
31
|
+
# Two-step process:
|
|
32
|
+
# 1. Call with only report_id to start generation (returns request_id)
|
|
33
|
+
# 2. Poll with both report_id and request_id until status is 'complete' or 'failed'
|
|
34
|
+
def self.generate(id: nil, request_id: nil)
|
|
35
|
+
raise ArgumentError, 'Report ID is required' if id.to_s.strip.empty?
|
|
36
|
+
|
|
37
|
+
payload = { reportId: id }
|
|
38
|
+
payload[:requestId] = request_id unless request_id.to_s.strip.empty?
|
|
39
|
+
|
|
40
|
+
response = post('report.generate', payload)
|
|
41
|
+
response['results']
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
data/lib/ashby/version.rb
CHANGED
data/lib/ashby.rb
CHANGED
|
@@ -19,6 +19,7 @@ require_relative 'ashby/custom_fields'
|
|
|
19
19
|
require_relative 'ashby/feedback'
|
|
20
20
|
require_relative 'ashby/postings'
|
|
21
21
|
require_relative 'ashby/job_boards'
|
|
22
|
+
require_relative 'ashby/reports'
|
|
22
23
|
|
|
23
24
|
# This module handles integration with Ashby's API
|
|
24
25
|
# for recruitment and hiring processes
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ashby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lien
|
|
@@ -84,6 +84,7 @@ files:
|
|
|
84
84
|
- lib/ashby/offers.rb
|
|
85
85
|
- lib/ashby/openings.rb
|
|
86
86
|
- lib/ashby/postings.rb
|
|
87
|
+
- lib/ashby/reports.rb
|
|
87
88
|
- lib/ashby/users.rb
|
|
88
89
|
- lib/ashby/version.rb
|
|
89
90
|
- sig/.DS_Store
|
|
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
111
|
- !ruby/object:Gem::Version
|
|
111
112
|
version: '0'
|
|
112
113
|
requirements: []
|
|
113
|
-
rubygems_version: 3.6.
|
|
114
|
+
rubygems_version: 3.6.9
|
|
114
115
|
specification_version: 4
|
|
115
116
|
summary: Ruby wrapper for Ashby's API.
|
|
116
117
|
test_files: []
|