smplkit 1.0.12 → 1.0.13
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/lib/smplkit/config/client.rb +15 -5
- data/lib/smplkit/config/helpers.rb +4 -3
- data/lib/smplkit/management/client.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f74b529f57291b182d674d166e138a61b95bb01c1bdf01a71261405f75a6879
|
|
4
|
+
data.tar.gz: 7e08e3ec63e892ae13bec37446afcd38c7b5d16008a0396d7046efd362598ed9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 28aa21a7b049e824c613ab8d53df09a0993abd938cb275ee7a330735623b9e6de99b986f6930bc6bab472a26533abf472d5a6f41301e54d833856fdb6708c882
|
|
7
|
+
data.tar.gz: 738683d247b8a2c557731deaae62c93120899da054dcfb91991d7ee114dd5a40c7f945456916713aa4500aa2a6e1fefe5ea0916f682804c63a4eea2af3ad1afc
|
|
@@ -157,11 +157,21 @@ module Smplkit
|
|
|
157
157
|
|
|
158
158
|
def typed_get(item_key, default, config_key)
|
|
159
159
|
snapshot = config_key ? resolve(config_key) : merged_snapshot
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
160
|
+
key = item_key.to_s
|
|
161
|
+
# Items live under flat dotted keys (e.g. +"api.host"+ — not nested
|
|
162
|
+
# +api → host+). Match Python's +current_values.get(key)+ behavior.
|
|
163
|
+
value = snapshot[key]
|
|
164
|
+
if value.nil? && snapshot.is_a?(Hash)
|
|
165
|
+
# Fallback: support callers that constructed an explicitly-nested
|
|
166
|
+
# snapshot (rare — typed model bindings only).
|
|
167
|
+
parts = key.split(".")
|
|
168
|
+
if parts.length > 1
|
|
169
|
+
value = parts.reduce(snapshot) do |scope, k|
|
|
170
|
+
break nil unless scope.is_a?(Hash)
|
|
171
|
+
|
|
172
|
+
scope[k]
|
|
173
|
+
end
|
|
174
|
+
end
|
|
165
175
|
end
|
|
166
176
|
return default if value.nil?
|
|
167
177
|
|
|
@@ -32,7 +32,7 @@ module Smplkit
|
|
|
32
32
|
key: attrs["key"] || resource["id"],
|
|
33
33
|
name: attrs["name"],
|
|
34
34
|
description: attrs["description"],
|
|
35
|
-
parent_id: attrs["parent_id"],
|
|
35
|
+
parent_id: attrs["parent"] || attrs["parent_id"],
|
|
36
36
|
items: items,
|
|
37
37
|
environments: environments,
|
|
38
38
|
created_at: attrs["created_at"],
|
|
@@ -54,11 +54,12 @@ module Smplkit
|
|
|
54
54
|
out[env] = { "values" => env_obj.values_raw }
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
# The Config schema (per the OpenAPI spec) does not include +key+ in
|
|
58
|
+
# attributes — the resource +id+ carries the customer-facing key.
|
|
57
59
|
attributes = {
|
|
58
|
-
"key" => config.key,
|
|
59
60
|
"name" => config.name,
|
|
60
61
|
"description" => config.description,
|
|
61
|
-
"
|
|
62
|
+
"parent" => config.parent_id,
|
|
62
63
|
"items" => items,
|
|
63
64
|
"environments" => environments
|
|
64
65
|
}.compact
|
|
@@ -400,8 +400,11 @@ module Smplkit
|
|
|
400
400
|
|
|
401
401
|
def new_config(key, name: nil, description: nil, parent: nil)
|
|
402
402
|
Smplkit::Config::Config.new(
|
|
403
|
-
self,
|
|
404
|
-
|
|
403
|
+
self,
|
|
404
|
+
key: key,
|
|
405
|
+
name: name || Smplkit::Helpers.key_to_display_name(key),
|
|
406
|
+
description: description,
|
|
407
|
+
parent_id: parent.is_a?(Smplkit::Config::Config) ? parent.key : parent
|
|
405
408
|
)
|
|
406
409
|
end
|
|
407
410
|
|