clawnexus 0.2.1 → 0.2.3
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.
- package/dist/api/server.js +5 -2
- package/dist/registry/store.js +5 -2
- package/package.json +1 -1
package/dist/api/server.js
CHANGED
|
@@ -195,8 +195,11 @@ function registerRegistryRoutes(app, deps) {
|
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
function registerInstanceRoutes(app, store, scanner) {
|
|
198
|
-
app.get("/instances", async () => {
|
|
199
|
-
|
|
198
|
+
app.get("/instances", async (request) => {
|
|
199
|
+
let instances = store.getAll();
|
|
200
|
+
if (request.query.scope) {
|
|
201
|
+
instances = instances.filter((i) => i.network_scope === request.query.scope);
|
|
202
|
+
}
|
|
200
203
|
return { count: instances.length, instances };
|
|
201
204
|
});
|
|
202
205
|
app.get("/instances/:id", async (request, reply) => {
|
package/dist/registry/store.js
CHANGED
|
@@ -163,10 +163,12 @@ class RegistryStore extends node_events_1.EventEmitter {
|
|
|
163
163
|
}
|
|
164
164
|
if (agentMatches.length === 1)
|
|
165
165
|
return agentMatches[0];
|
|
166
|
-
// 5. address
|
|
166
|
+
// 5. address or address:port
|
|
167
167
|
for (const inst of this.instances.values()) {
|
|
168
168
|
if (inst.address === query)
|
|
169
169
|
return inst;
|
|
170
|
+
if (`${inst.address}:${inst.gateway_port}` === query)
|
|
171
|
+
return inst;
|
|
170
172
|
}
|
|
171
173
|
return undefined;
|
|
172
174
|
}
|
|
@@ -179,7 +181,8 @@ class RegistryStore extends node_events_1.EventEmitter {
|
|
|
179
181
|
inst.auto_name.toLowerCase() === q ||
|
|
180
182
|
inst.display_name.toLowerCase() === q ||
|
|
181
183
|
inst.agent_id.toLowerCase() === q ||
|
|
182
|
-
inst.address === query
|
|
184
|
+
inst.address === query ||
|
|
185
|
+
`${inst.address}:${inst.gateway_port}` === query) {
|
|
183
186
|
results.push(inst);
|
|
184
187
|
}
|
|
185
188
|
}
|