Files
.gitea
apps
admin
api
apps
blog
db
follow
identity
issues
journal
room
sneaker
app.js
filesaver.min.js
index.html
jszip.min.js
lit-all.min.js
lit-all.min.js.map
script.js
ssb
storage
test
todo
web
welcome
wiki
admin.json
api.json
apps.json
blog.json
db.json
follow.json
identity.json
issues.json
journal.json
room.json
sneaker.json
ssb.json
storage.json
test.json
todo.json
web.json
welcome.json
wiki.json
core
deps
docs
metadata
src
tools
.clang-format
.dockerignore
.git-blame-ignore-revs
.gitignore
.gitmodules
.prettierignore
.prettierrc.yaml
CONTRIBUTING.md
Dockerfile
Doxyfile
GNUmakefile
LICENSE
README.md
default.nix
flake.lock
flake.nix
package-lock.json
package.json
tildefriends/apps/sneaker/app.js

31 lines
752 B
JavaScript
Raw Normal View History

import * as tfrpc from '/tfrpc.js';
tfrpc.register(async function getAllIdentities() {
return ssb.getAllIdentities();
});
tfrpc.register(async function query(sql, args) {
let result = [];
await ssb.sqlAsync(sql, args, function callback(row) {
result.push(row);
});
return result;
});
tfrpc.register(async function store_blob(blob) {
if (Array.isArray(blob)) {
blob = Uint8Array.from(blob);
}
return await ssb.blobStore(blob);
});
tfrpc.register(async function get_blob(id) {
return Array.from(new Uint8Array(await ssb.blobGet(id)));
});
tfrpc.register(async function store_message(message) {
return await ssb.storeMessage(message);
});
async function main() {
await app.setDocument(utf8Decode(await getFile('index.html')));
}
2024-02-24 11:09:34 -05:00
main();