folio_client 0.3.0 → 0.3.1
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/Gemfile.lock +2 -1
- data/lib/folio_client/inventory.rb +1 -0
- data/lib/folio_client/unexpected_response.rb +8 -5
- data/lib/folio_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e53de53a53383306d8d102202f46a3d7812fea93d63ba876e4be9f3d31c122a
|
4
|
+
data.tar.gz: 6a923cb74ab603ecba4fc9e909da87fdcd0a2540cbc58dafc381147012ae1a4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bf690f79b82a5ec7c7a53b88867671a389bcae846832971ecb8a07f55f227b3c77761270e1d584207a6c4b1775e00f49d5ddadaea1d10bb6c9ce4a64bbb69b4
|
7
|
+
data.tar.gz: 98520694ded40e076ee49a456f46ad1b2c460c34d247fff9d519f9e5f5f4ae825e1ea2f3a56f7d8118301b14b8ffb02aa12c44cbe7e6106e9b1451f6fe8344fd
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
folio_client (0.3.
|
4
|
+
folio_client (0.3.1)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
faraday
|
7
7
|
zeitwerk
|
@@ -98,6 +98,7 @@ GEM
|
|
98
98
|
PLATFORMS
|
99
99
|
x86_64-darwin-19
|
100
100
|
x86_64-darwin-20
|
101
|
+
x86_64-darwin-21
|
101
102
|
x86_64-linux
|
102
103
|
|
103
104
|
DEPENDENCIES
|
@@ -11,6 +11,7 @@ class FolioClient
|
|
11
11
|
end
|
12
12
|
|
13
13
|
# @param barcode [String] barcode to search by to fetch the HRID
|
14
|
+
# @return [String,nil] HRID if present, otherwise nil.
|
14
15
|
def fetch_hrid(barcode:)
|
15
16
|
# find the instance UUID for this barcode
|
16
17
|
instance = client.get("/search/instances", {query: "items.barcode==#{barcode}"})
|
@@ -3,20 +3,23 @@
|
|
3
3
|
class FolioClient
|
4
4
|
# Handles unexpected responses when communicating with Folio
|
5
5
|
class UnexpectedResponse
|
6
|
+
# Base class for all FolioClient errors
|
7
|
+
class FolioClientError < StandardError; end
|
8
|
+
|
6
9
|
# Error raised by the Folio Auth API returns a 422 Unauthorized
|
7
|
-
class UnauthorizedError <
|
10
|
+
class UnauthorizedError < FolioClientError; end
|
8
11
|
|
9
12
|
# Error raised when the Folio API returns a 404 NotFound, or returns 0 results when one was expected
|
10
|
-
class ResourceNotFound <
|
13
|
+
class ResourceNotFound < FolioClientError; end
|
11
14
|
|
12
15
|
# Error raised when e.g. exactly one result was expected, but more than one was returned
|
13
|
-
class MultipleResourcesFound <
|
16
|
+
class MultipleResourcesFound < FolioClientError; end
|
14
17
|
|
15
18
|
# Error raised when the Folio API returns a 403 Forbidden
|
16
|
-
class ForbiddenError <
|
19
|
+
class ForbiddenError < FolioClientError; end
|
17
20
|
|
18
21
|
# Error raised when the Folio API returns a 500
|
19
|
-
class ServiceUnavailable <
|
22
|
+
class ServiceUnavailable < FolioClientError; end
|
20
23
|
|
21
24
|
# @param [Faraday::Response] response
|
22
25
|
def self.call(response)
|
data/lib/folio_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: folio_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Mangiafico
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|