add: apps rust sdk

This commit is contained in:
trisua 2025-07-19 15:31:06 -04:00
parent f05074ffc5
commit fe1e53c47a
11 changed files with 461 additions and 11 deletions

View file

@ -117,6 +117,29 @@ export default function tetratto({
);
}
async function update(id, value) {
if (!api_key) {
throw Error("No API key provided.");
}
return api_promise(
json_parse(
await (
await fetch(`${host}/api/v1/app_data/${id}/value`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Atto-Secret-Key": api_key,
},
body: json_stringify({
value,
}),
})
).text(),
),
);
}
async function remove(id) {
if (!api_key) {
throw Error("No API key provided.");
@ -241,6 +264,7 @@ export default function tetratto({
app,
query,
insert,
update,
remove,
remove_query,
// user connection