forked from cory/tildefriends
Expose shared_database(), which provides access to data that is specific to the app owner and app and can be written for any visitor.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3860 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -221,6 +221,12 @@ async function getProcessBlob(blobId, key, options) {
|
||||
return Object.fromEntries(Object.keys(db).map(x => [x, db[x].bind(db)]));
|
||||
};
|
||||
}
|
||||
if (options.packageOwner && options.packageName) {
|
||||
imports.shared_database = function(key) {
|
||||
var db = new Database(':shared:' + options.packageOwner + ':' + options.packageName + ':' + key);
|
||||
return Object.fromEntries(Object.keys(db).map(x => [x, db[x].bind(db)]));
|
||||
}
|
||||
}
|
||||
process.task.setImports(imports);
|
||||
process.task.activate();
|
||||
let source = await getBlobOrContent(blobId);
|
||||
|
Reference in New Issue
Block a user