wisco 0.4.0 → 0.4.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/lib/wisco/commands/list.rb +37 -36
- data/lib/wisco/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: 6d835a3d768c20b2555e1b17ecd61bf1d3363db39b74aa6e2a3cd56c507ec136
|
|
4
|
+
data.tar.gz: 903542f44f76502b94f247337b4c77f6bb34d06c6d84f1f94ef0efab05a97917
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5cec2439df4a49df18a314a40535acd2d460e1116b80a87e550a356ad02b4a834d94c2c5a921ed342f4994411c5897bd7814d635a7ae0483c17957bc2d55ae31
|
|
7
|
+
data.tar.gz: 19ad6f559d813656907576b53d341f2222bce65e234f0ac42bd6285d8f59f8c55e8f0595a598ca02ec0e2608c8be5c4afe5af278027f3f75af94a62174cc540d
|
data/lib/wisco/commands/list.rb
CHANGED
|
@@ -114,50 +114,51 @@ module Wisco
|
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
def build_connector_hash(connector)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
'connection' => build_connection(connector[:connection]),
|
|
120
|
-
'actions' => build_section(connector[:actions]),
|
|
121
|
-
'triggers' => build_section(connector[:triggers]),
|
|
122
|
-
'methods' => (connector[:methods] || {}).keys.map(&:to_s).sort,
|
|
123
|
-
'pick_lists' => (connector[:pick_lists] || {}).keys.map(&:to_s).sort
|
|
124
|
-
}
|
|
125
|
-
end
|
|
126
|
-
|
|
127
|
-
def build_connection(conn)
|
|
128
|
-
return { 'fields' => [] } unless conn.is_a?(Hash)
|
|
129
|
-
|
|
130
|
-
fields = conn[:fields] || []
|
|
131
|
-
{ 'fields' => fields.map { |f| safe_serialize(f) }.compact }
|
|
132
|
-
end
|
|
117
|
+
# Full connector serialization with context-aware lambda handling
|
|
118
|
+
data = serialize_value(connector, context: :root)
|
|
133
119
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
section.keys.sort_by(&:to_s).each_with_object({}) do |key, h|
|
|
138
|
-
item = section[key]
|
|
139
|
-
h[key.to_s] = {
|
|
140
|
-
'title' => title_for(key, item),
|
|
141
|
-
'subtitle' => subtitle_for(item).to_s
|
|
142
|
-
}
|
|
120
|
+
# Post-process object_definitions: convert Hash to sorted array of keys
|
|
121
|
+
if data.is_a?(Hash) && data['object_definitions'].is_a?(Hash)
|
|
122
|
+
data['object_definitions'] = data['object_definitions'].keys.map(&:to_s).sort
|
|
143
123
|
end
|
|
124
|
+
|
|
125
|
+
data
|
|
144
126
|
end
|
|
145
127
|
|
|
146
|
-
|
|
147
|
-
# Proc/lambda values are dropped (returned as nil so callers can compact).
|
|
148
|
-
def safe_serialize(value)
|
|
128
|
+
def serialize_value(value, context: nil)
|
|
149
129
|
case value
|
|
130
|
+
when Proc
|
|
131
|
+
case context
|
|
132
|
+
when :methods, :pick_lists
|
|
133
|
+
# Extract parameter info; format type as string
|
|
134
|
+
{
|
|
135
|
+
'parameters' => value.parameters.map { |type, name| [type.to_s, name.to_s] }
|
|
136
|
+
}
|
|
137
|
+
else
|
|
138
|
+
# All other lambdas become "__is_lambda__" string
|
|
139
|
+
'__is_lambda__'
|
|
140
|
+
end
|
|
150
141
|
when Hash
|
|
142
|
+
# Recursively serialize each key-value pair, tracking context
|
|
151
143
|
value.each_with_object({}) do |(k, v), h|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
serialized = safe_serialize(v)
|
|
155
|
-
h[k.to_s] = serialized
|
|
144
|
+
next_context = determine_context(k, context)
|
|
145
|
+
h[k.to_s] = serialize_value(v, context: next_context)
|
|
156
146
|
end
|
|
157
|
-
when Array
|
|
158
|
-
|
|
159
|
-
when Symbol
|
|
160
|
-
|
|
147
|
+
when Array
|
|
148
|
+
value.map { |v| serialize_value(v, context: context) }
|
|
149
|
+
when Symbol
|
|
150
|
+
value.to_s
|
|
151
|
+
else
|
|
152
|
+
value
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def determine_context(key, parent_context)
|
|
157
|
+
# When traversing into :methods or :pick_lists hashes, set context for param extraction
|
|
158
|
+
case key
|
|
159
|
+
when :methods then :methods
|
|
160
|
+
when :pick_lists then :pick_lists
|
|
161
|
+
else parent_context
|
|
161
162
|
end
|
|
162
163
|
end
|
|
163
164
|
|
data/lib/wisco/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wisco
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mbillington
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|