@hasna/mementos 0.3.2 → 0.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AACA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAgmBH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAoG9C"}
|
package/dist/server/index.js
CHANGED
|
@@ -911,6 +911,11 @@ addRoute("GET", "/api/memories", (_req, url) => {
|
|
|
911
911
|
if (q["offset"])
|
|
912
912
|
filter.offset = parseInt(q["offset"], 10);
|
|
913
913
|
const memories = listMemories(filter);
|
|
914
|
+
if (q["fields"]) {
|
|
915
|
+
const fields = q["fields"].split(",").map((f) => f.trim());
|
|
916
|
+
const filtered = memories.map((m) => Object.fromEntries(fields.map((f) => [f, m[f]]).filter(([, v]) => v !== undefined)));
|
|
917
|
+
return json({ memories: filtered, count: filtered.length });
|
|
918
|
+
}
|
|
914
919
|
return json({ memories, count: memories.length });
|
|
915
920
|
});
|
|
916
921
|
addRoute("GET", "/api/memories/stats", (_req) => {
|