feat(server): implement KV store API and fingerprinting functionality
- Added a new KV store API with endpoints for querying namespaces and key-value pairs. - Introduced fingerprinting functionality to hash and manage data fingerprints, allowing for efficient change detection. - Enhanced existing scripts to utilize the new fingerprinting capabilities, enabling conditional execution based on data changes. - Updated the web interface to include a dedicated KV page for managing key-value entries and displaying their details. - Improved overall user experience with pagination and search capabilities in the KV management interface.
This commit is contained in:
@@ -313,3 +313,25 @@ export function useDeleteSecret() {
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ["secrets"] }),
|
||||
});
|
||||
}
|
||||
|
||||
export function useKvNamespaces() {
|
||||
return useQuery({
|
||||
queryKey: ["kv", "namespaces"],
|
||||
queryFn: async () => (await api.get("/kv/namespaces")).data.namespaces,
|
||||
});
|
||||
}
|
||||
|
||||
export function useKv(filters = {}) {
|
||||
const { namespace, q, limit, offset } = filters;
|
||||
return useQuery({
|
||||
queryKey: ["kv", { namespace, q, limit, offset }],
|
||||
queryFn: async () => {
|
||||
const params = {};
|
||||
if (namespace) params.namespace = namespace;
|
||||
if (q) params.q = q;
|
||||
if (limit != null) params.limit = limit;
|
||||
if (offset != null) params.offset = offset;
|
||||
return (await api.get("/kv", { params })).data;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user