@hasna/configs 0.2.17 → 0.2.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;;;;AAsRA,wBAAgE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;;;;AAgSA,wBAAgE"}
@@ -2608,8 +2608,10 @@ app.post("/api/configs/:id/snapshot", async (c) => {
2608
2608
  });
2609
2609
  app.get("/api/configs/:id/snapshots", (c) => {
2610
2610
  try {
2611
+ const { fields } = c.req.query();
2611
2612
  const config = getConfig(c.req.param("id"));
2612
- return c.json(listSnapshots(config.id));
2613
+ const snaps = listSnapshots(config.id);
2614
+ return c.json(fields ? snaps.map((s) => pickFields(s, fields)) : snaps);
2613
2615
  } catch {
2614
2616
  return c.json({ error: "Not found" }, 404);
2615
2617
  }
@@ -2631,7 +2633,11 @@ app.post("/api/sync", async (c) => {
2631
2633
  return c.json({ error: e instanceof Error ? e.message : String(e) }, 422);
2632
2634
  }
2633
2635
  });
2634
- app.get("/api/profiles", (c) => c.json(listProfiles()));
2636
+ app.get("/api/profiles", (c) => {
2637
+ const { fields } = c.req.query();
2638
+ const profiles = listProfiles();
2639
+ return c.json(fields ? profiles.map((p) => pickFields(p, fields)) : profiles);
2640
+ });
2635
2641
  app.post("/api/profiles", async (c) => {
2636
2642
  try {
2637
2643
  const body = await c.req.json();
@@ -2677,7 +2683,11 @@ app.post("/api/profiles/:id/apply", async (c) => {
2677
2683
  return c.json({ error: e instanceof Error ? e.message : String(e) }, 422);
2678
2684
  }
2679
2685
  });
2680
- app.get("/api/machines", (c) => c.json(listMachines()));
2686
+ app.get("/api/machines", (c) => {
2687
+ const { fields } = c.req.query();
2688
+ const machines = listMachines();
2689
+ return c.json(fields ? machines.map((m) => pickFields(m, fields)) : machines);
2690
+ });
2681
2691
  app.post("/api/machines", async (c) => {
2682
2692
  try {
2683
2693
  const body = await c.req.json().catch(() => ({}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/configs",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "AI coding agent configuration manager — store, version, apply, and share all your AI coding configs. CLI + MCP + REST API + Dashboard.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",