parakey-client 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7a9e0253c3a8e5a39e372c39c77be783d54ae0875290af41a2215588ed96b1c
4
- data.tar.gz: 1cf12063617bcc57125e2560e9cc44b6e4906c06e93101be114ca1ea3fae3e24
3
+ metadata.gz: d3b8a25c8c0200e3463ba9feead8e0061eec2917a0aa7fe70f8ac55130c26cfb
4
+ data.tar.gz: 473fc2c957fc64295f35f8976ab18a8205d9be6c5cc9565449a3cd7c4e443209
5
5
  SHA512:
6
- metadata.gz: 1539da5296f053cfaa0cf0bbf0ecb22ab12f4d95811a5a44f94b1e46af1b029ddc3d0807296f0d7b16d5078568b2380681bab3b6ecf7720a547ab8c98fd9e85a
7
- data.tar.gz: e63ec011675cf935074272dee5f01f5e3ad5ffbb1be966ad5234f6d35d10827e4329fdf41fbe0f6fcc93f7a60c3a2ad3ae597243deffca50a815ef948874caaa
6
+ metadata.gz: c9a1c9f8a1e69306a4e4e1bb848c44ee07d445abd695b063c7a6da5d162c692bfb675fa30f9c18c03bc2c336f42bb02dc0759df85f631a17c350f48c83e763de
7
+ data.tar.gz: e3975e297fc86299bda4fffc1ed4df4569710824ce4e91e8500fc0f7f54876d7db8bc9c2314a1e142eb688f10ddd975828347da1f9169be43768fc8f62cae7ee
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.1] - 2026-11-11
6
+
7
+ ### Changed
8
+
9
+ - `Parakey::ArgumentError` messages are sentences the host can show as they are ("Access ID is required.") in
10
+ place of `key: reason` pairs.
11
+
5
12
  ## [0.1.0] - 2026-11-10
6
13
 
7
14
  First release as `parakey-client`, extracted from the Parakey integration Guestit runs in production. The specs are
@@ -24,5 +31,6 @@ identifiers — this repo is public).
24
31
  - Members: `Index` with wire filters and `Destroy` by email.
25
32
  - `AccessEvents::Normalize` for event-log items and webhook deliveries.
26
33
 
27
- [Unreleased]: https://github.com/guestitab/parakey-client/compare/v0.1.0...staging
34
+ [Unreleased]: https://github.com/guestitab/parakey-client/compare/v0.1.1...staging
35
+ [0.1.1]: https://github.com/guestitab/parakey-client/compare/v0.1.0...v0.1.1
28
36
  [0.1.0]: https://github.com/guestitab/parakey-client/releases/tag/v0.1.0
data/README.md CHANGED
@@ -85,7 +85,7 @@ Lists page 1-based with `page` and `limit` on the wire; the operations take `ski
85
85
 
86
86
  | Class | Raised when |
87
87
  | --- | --- |
88
- | `Parakey::ArgumentError` | The arguments are unusable. Raised before any request. |
88
+ | `Parakey::ArgumentError` | The arguments are unusable. Raised before any request, with a message the host can show as it is. |
89
89
  | `Parakey::ApiError` | Parakey answered with an error status. `#status` holds the HTTP status. |
90
90
  | `Parakey::Error` | The parent of the two above, also raised when no access token is configured. |
91
91
 
@@ -11,7 +11,7 @@ module Parakey
11
11
 
12
12
  # @rbs (item: ::Hash[::Symbol, untyped]) -> Dry::Monads::Result[::Hash[::Symbol, untyped]]
13
13
  def call(item:)
14
- argument! item: :required if item.blank?
14
+ argument! 'Event item is required.' if item.blank?
15
15
 
16
16
  Success(attributes(item))
17
17
  end
@@ -8,9 +8,9 @@ module Parakey
8
8
 
9
9
  # @rbs (attributes: ::Hash[::Symbol, untyped]) -> Dry::Monads::Result[::Hash[::Symbol, untyped]]
10
10
  def call(attributes:)
11
- argument! access_id: :required if attributes[:access_id].blank?
12
- argument! kind: :invalid unless KINDS.include?(attributes[:kind])
13
- argument! recipient_email: :required if attributes[:recipient_email].blank?
11
+ argument! 'Access ID is required.' if attributes[:access_id].blank?
12
+ argument! 'Grant kind is invalid.' unless KINDS.include?(attributes[:kind])
13
+ argument! 'Recipient email is required.' if attributes[:recipient_email].blank?
14
14
 
15
15
  validate_validity_window!(attributes)
16
16
 
@@ -26,10 +26,10 @@ module Parakey
26
26
  # @rbs (::Hash[::Symbol, untyped] attributes) -> void
27
27
  def validate_validity_window!(attributes)
28
28
  if attributes[:kind] == KIND_TIME_CONTROLLED
29
- argument! validity_window: :required if attributes[:start_date].blank? || attributes[:end_date].blank?
30
- argument! end_date: :invalid if attributes[:start_date].in_time_zone >= attributes[:end_date].in_time_zone
29
+ argument! 'Start date and end date are both required.' if attributes[:start_date].blank? || attributes[:end_date].blank?
30
+ argument! 'End date must be after start date.' if attributes[:start_date].in_time_zone >= attributes[:end_date].in_time_zone
31
31
  elsif attributes[:start_date].present? || attributes[:end_date].present?
32
- argument! validity_window: :invalid
32
+ argument! 'A validity window is only supported for time-controlled grants.'
33
33
  end
34
34
  end
35
35
 
@@ -7,7 +7,7 @@ module Parakey
7
7
 
8
8
  # @rbs (attributes: ::Hash[::Symbol, untyped]) -> Dry::Monads::Result[bool]
9
9
  def call(attributes:)
10
- argument! external_id: :required if attributes[:external_id].blank?
10
+ argument! 'External ID is required.' if attributes[:external_id].blank?
11
11
 
12
12
  path = "access-keys/#{ERB::Util.url_encode(attributes[:external_id])}"
13
13
  Parakey.request(:delete, path, accepted_statuses: [404])
@@ -7,8 +7,8 @@ module Parakey
7
7
 
8
8
  # @rbs (email: ::String?) -> Dry::Monads::Result[bool]
9
9
  def call(email:)
10
- argument! email: :required if email.blank?
11
- argument! domain_id: :required if Parakey.config.domain_id.blank?
10
+ argument! 'Email is required.' if email.blank?
11
+ argument! 'Domain ID is required.' if Parakey.config.domain_id.blank?
12
12
 
13
13
  filter = {
14
14
  domainId: Parakey.config.domain_id,
@@ -25,15 +25,14 @@ module Parakey
25
25
 
26
26
  private
27
27
 
28
- def argument!(**attrs)
29
- key, reason = attrs.first
30
- raise Parakey::ArgumentError, "#{key}: #{reason}"
28
+ def argument!(message)
29
+ raise Parakey::ArgumentError, message
31
30
  end
32
31
 
33
32
  # Lists page 1-based by page and limit on the wire; the operations take an item offset.
34
33
  # @rbs (::Integer skip, ::Integer take) -> ::Hash[::Symbol, untyped]
35
34
  def page_params(skip, take)
36
- argument! take: :invalid unless take.to_i.positive?
35
+ argument! 'Take must be a positive number.' unless take.to_i.positive?
37
36
 
38
37
  {
39
38
  domainId: Parakey.config.domain_id,
@@ -1,3 +1,3 @@
1
1
  module Parakey
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parakey-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guestit