At times I feel like I’m going crazy finding things to do until APIs etc are ready
so as you know I’ve been working on a safe-js tutorial website (yes I know I know, it’s launcher-based and will all be obsolete soon, but I want to work on something!) and I have my template and most of my data finished.
Also this will be a very good practice exercise for myself and my team, so when new APIs are ready we’re more familiar with the principles.
I’d like to go ahead and finish it completely, just so we have it, but I can’t get documentation or examples for the rest of safe-js. I have found the following so far, but could anyone with more knowledge help me fill in the blanks? Then it will be finished and I’ll post it for everyone (people keep saying the rest of the info is in the Email / Comments Tutorials but that’s all npm-based I think and I’m looking to fill it in for safe-js (javascript)).
So here’s what I have already:
#Authorize
function authorize() {
const app =
{
name: "Test Auth App",
id: "Test1",
version: "0.0.1",
vendor:"WhiteOutMashups",
permissions: ["SAFE_DRIVE_ACCESS"]
};
safeAuth.authorise(app);
};
#Create Folder
function createdir(){
safeNFS.createDir(auth.token,name,false);
};
subacton GET directory: safeNFS.getDir(auth.token,name)
#Create / Update File
function createorupdatefile(){
safeNFS.createOrUpdateFile(auth.token,name,content);
}
subaction GET file: safeNFS.getFile(auth.token,name);
subaction DELETE file: safeNFS.deleteFile(auth.token,name);
#Create Name for URLs
function createlongname(){
safeDNS.createLongName(auth.token,name);
}
subaction GET longnames: safeDNS.listLongNames(auth.token);
#Create “Service Name”
function createservice(){
safeDNS.addService(auth.token,longname,name,homedir,false);
}
subaction GET services: safeDNS.listServices(auth.token,longname);
#Create Structured Data? _________
#Create Appendable Data? _________
These last two aren’t documented, but only exist in the polyfill.js file in the safe-js repo. Does anyone know how to create & use (GET) SD & AD with safe-js? I haven’t found any documentation on this, and my team is very stumped. This will be very very useful practice for us.
If someone can answer, it would let us create many more interesting types of web apps here in the meantime, until MaidSafe releases their new Authenticator, Browser, APIs and docs / tutorials.
#Template for once this is all figured out
Anyone know? Hope so! Thx!