-
Notifications
You must be signed in to change notification settings - Fork 0
/
runAppGetDataFlow.ts
50 lines (41 loc) · 1.29 KB
/
runAppGetDataFlow.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { SolidLib } from './SolidLib/Interface/SolidLib';
import { clearStores, setup } from './setup';
async function addPolicy() {
const solidLib = new SolidLib("admin-App", 'steve');
await solidLib.login()
await solidLib.addPolicy(`
<myPolicy> <a> <Policy>;
<subject> <food-store>;
<action> <read>;
<resource> "?webID <https://www.w3.org/2006/vcard/ns#bday> ?bdate .";
<context> <verification>.`)
await solidLib.logout();
}
async function getDataFlow() {
const solidLib = new SolidLib("food-store", 'steve');
await solidLib.login()
let dataplusplus = await solidLib.getData("?webID <https://www.w3.org/2006/vcard/ns#bday> ?bdate .", [
"verification",
"advertisement"
])
let logEntries = await solidLib.getLogEntries()
console.log('App flow response')
console.log(dataplusplus)
console.log()
console.log('Logged Agreements:')
console.log(logEntries)
await solidLib.logout()
}
async function run() {
clearStores()
const close = await setup('steve')
await addPolicy()
console.log('')
console.log('######################################')
console.log('Running Experiment')
console.log('######################################')
console.log('')
await getDataFlow()
await close();
}
run()