nahook 0.2.0 → 0.3.0
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 +39 -0
- data/lib/nahook/resources/applications.rb +15 -2
- data/lib/nahook/version.rb +1 -1
- data/lib/nahook.rb +9 -1
- 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: 31b7901878b562021d9a71ccb5824bed11ef0b8ccf5da2c671cb2235f5d8f731
|
|
4
|
+
data.tar.gz: d75d53e1e2607c7336d19f24b28b18eea0110d66ec77904c3869d626745ef1a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b55f9e8b6727a5fd7ead12368cdc6a86b2e105d205d9e9637c889ceb3f77683fc59d91c445f407a711470fe1d56f02f90cea06523d1c34c98155fe16c45afd57
|
|
7
|
+
data.tar.gz: a292a9e334b84aa4550f68aba8859d8afee1fd956fc3dd54b378e9fe5cf79d1922debfacc868b902fec534851057ca23b89ba075abb8df2277f819daedef7406
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this SDK are documented here.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/) and
|
|
6
|
+
this project follows [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [0.3.0] - 2026-06-12
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Per-application endpoint cap (`maxEndpoints`) and Developer Portal event-catalog toggle (`showEventTypes`) on the applications resource
|
|
14
|
+
|
|
15
|
+
## [0.2.0] - 2026-05-31
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- Keep-alive by default + BYO Faraday connection
|
|
20
|
+
- Add Deliveries resource to Nahook::Management
|
|
21
|
+
|
|
22
|
+
## [0.1.1] - 2026-05-25
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
- Expose optional environmentId on endpoints.create
|
|
27
|
+
- Add environments resource to the management client
|
|
28
|
+
- Embed workspace region in API keys for SDK auto-routing
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
- Differentiate homepage/source_code/bug_tracker URIs
|
|
33
|
+
- Ruby mandatory name param
|
|
34
|
+
|
|
35
|
+
## [0.1.0] - 2026-04-10
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- Initial release of the Nahook Ruby SDK
|
|
@@ -45,11 +45,18 @@ module Nahook
|
|
|
45
45
|
# @param name [String] the application name
|
|
46
46
|
# @param external_id [String, nil] an external identifier for your system
|
|
47
47
|
# @param metadata [Hash, nil] arbitrary key-value metadata
|
|
48
|
+
# @param max_endpoints [Integer, nil] cap on how many endpoints this
|
|
49
|
+
# application may have (disabled endpoints count); 0 makes it
|
|
50
|
+
# read-only, nil (default) means unlimited
|
|
51
|
+
# @param show_event_types [Boolean, nil] whether the Developer Portal
|
|
52
|
+
# exposes the event-type catalog (server defaults to true)
|
|
48
53
|
# @return [Hash] the created application
|
|
49
|
-
def create(workspace_id, name:, external_id: nil, metadata: nil)
|
|
54
|
+
def create(workspace_id, name:, external_id: nil, metadata: nil, max_endpoints: nil, show_event_types: nil)
|
|
50
55
|
body = { "name" => name }
|
|
51
56
|
body["externalId"] = external_id if external_id
|
|
52
57
|
body["metadata"] = metadata if metadata
|
|
58
|
+
body["maxEndpoints"] = max_endpoints unless max_endpoints.nil?
|
|
59
|
+
body["showEventTypes"] = show_event_types unless show_event_types.nil?
|
|
53
60
|
|
|
54
61
|
@http.request(
|
|
55
62
|
method: :post,
|
|
@@ -76,11 +83,17 @@ module Nahook
|
|
|
76
83
|
# @param id [String] the application public ID
|
|
77
84
|
# @param name [String, nil] updated name
|
|
78
85
|
# @param metadata [Hash, nil] updated metadata
|
|
86
|
+
# @param max_endpoints [Integer, nil, UNSET] tri-state: leave as
|
|
87
|
+
# +UNSET+ (default) to keep the current cap, pass +nil+ to clear it
|
|
88
|
+
# (unlimited), or pass an Integer (>= 0) to set it
|
|
89
|
+
# @param show_event_types [Boolean, UNSET] omitted when +UNSET+
|
|
79
90
|
# @return [Hash] the updated application
|
|
80
|
-
def update(workspace_id, id, name: nil, metadata: nil)
|
|
91
|
+
def update(workspace_id, id, name: nil, metadata: nil, max_endpoints: UNSET, show_event_types: UNSET)
|
|
81
92
|
body = {}
|
|
82
93
|
body["name"] = name unless name.nil?
|
|
83
94
|
body["metadata"] = metadata unless metadata.nil?
|
|
95
|
+
body["maxEndpoints"] = max_endpoints unless max_endpoints.equal?(UNSET)
|
|
96
|
+
body["showEventTypes"] = show_event_types unless show_event_types.equal?(UNSET)
|
|
84
97
|
|
|
85
98
|
@http.request(
|
|
86
99
|
method: :patch,
|
data/lib/nahook/version.rb
CHANGED
data/lib/nahook.rb
CHANGED
|
@@ -27,4 +27,12 @@ require_relative "nahook/resources/deliveries"
|
|
|
27
27
|
# @example Managing endpoints
|
|
28
28
|
# mgmt = Nahook::Management.new("nhm_your_token")
|
|
29
29
|
# mgmt.endpoints.list("ws_abc123")
|
|
30
|
-
module Nahook
|
|
30
|
+
module Nahook
|
|
31
|
+
# Sentinel distinguishing "argument not passed" from an explicit +nil+.
|
|
32
|
+
#
|
|
33
|
+
# Used for tri-state PATCH fields like +max_endpoints+: leaving the
|
|
34
|
+
# argument as +UNSET+ omits it from the request body (unchanged), while
|
|
35
|
+
# passing +nil+ sends an explicit JSON null (clear).
|
|
36
|
+
UNSET = Object.new
|
|
37
|
+
UNSET.freeze
|
|
38
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nahook
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nahook
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -47,6 +47,7 @@ executables: []
|
|
|
47
47
|
extensions: []
|
|
48
48
|
extra_rdoc_files: []
|
|
49
49
|
files:
|
|
50
|
+
- CHANGELOG.md
|
|
50
51
|
- LICENSE
|
|
51
52
|
- README.md
|
|
52
53
|
- lib/nahook.rb
|